File: md.h

package info (click to toggle)
pmidi 1.6.0-5
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 720 kB
  • ctags: 652
  • sloc: sh: 3,823; ansic: 3,010; makefile: 48
file content (52 lines) | stat: -rw-r--r-- 1,819 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * File: md.h
 * 
 * Copyright (C) 1999 Steve Ratcliffe
 * 
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation.
 * 
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 * 
 * 
 */

/* Defines for md_walk() */
#define MD_WALK_ALL	1	/* Include all elements including deleted, hidden*/

/* Defines for walk callback flags */
#define MD_WALK_START 0x001	/* This is a start element */
#define MD_WALK_END   0x002	/* This is the end of an element */
#define MD_WALK_EMPTY (MD_WALK_START|MD_WALK_END) /* Empty element */

/* Typedef for md_walk callback function */
typedef void (*walkFunc)(struct element *, void *, int);


/*
 * Structure to keep track of the position on each track that
 * is being merged.
 */
struct sequenceState {
	int  nmerge;	/* Number of tracks in trackPos to merge */
	struct trackPos *track_ptrs; /* Position pointers */
	struct rootElement *root; /* Root to be returned first */
	unsigned long endtime;	/* End time */
};
struct trackPos {
	int  len;	/* Total length of this container element */
	int  count;	/* Current position count */
	struct element **currel; /* Pointer to current position */
};

void md_walk(struct containerElement *c, walkFunc fn, void *arg, int flags);
int iscontainer(struct element *el);
struct sequenceState *md_sequence_init(struct rootElement *root);
struct element *md_sequence_next(struct sequenceState *seq);
void md_sequence_end(struct sequenceState *seq);
unsigned long md_sequence_end_time(struct sequenceState *seq);