| 1 | /* |
| 2 | * File: md.h |
| 3 | * |
| 4 | * Copyright (C) 1999 Steve Ratcliffe |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License version 2 as |
| 8 | * published by the Free Software Foundation. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * |
| 16 | * |
| 17 | */ |
| 18 | |
| 19 | /* Defines for md_walk() */ |
| 20 | #define MD_WALK_ALL 1 /* Include all elements including deleted, hidden*/ |
| 21 | |
| 22 | /* Defines for walk callback flags */ |
| 23 | #define MD_WALK_START 0x001 /* This is a start element */ |
| 24 | #define MD_WALK_END 0x002 /* This is the end of an element */ |
| 25 | #define MD_WALK_EMPTY (MD_WALK_START|MD_WALK_END) /* Empty element */ |
| 26 | |
| 27 | /* Typedef for md_walk callback function */ |
| 28 | typedef void (*walkFunc)(struct element *, void *, int); |
| 29 | |
| 30 | |
| 31 | /* |
| 32 | * Structure to keep track of the position on each track that |
| 33 | * is being merged. |
| 34 | */ |
| 35 | struct sequenceState { |
| 36 | int nmerge; /* Number of tracks in trackPos to merge */ |
| 37 | struct trackPos *track_ptrs; /* Position pointers */ |
| 38 | struct rootElement *root; /* Root to be returned first */ |
| 39 | unsigned long endtime; /* End time */ |
| 40 | }; |
| 41 | struct trackPos { |
| 42 | int len; /* Total length of this container element */ |
| 43 | int count; /* Current position count */ |
| 44 | struct element **currel; /* Pointer to current position */ |
| 45 | }; |
| 46 | |
| 47 | void md_walk(struct containerElement *c, walkFunc fn, void *arg, int flags); |
| 48 | int iscontainer(struct element *el); |
| 49 | struct sequenceState *md_sequence_init(struct rootElement *root); |
| 50 | struct element *md_sequence_next(struct sequenceState *seq); |
| 51 | void md_sequence_end(struct sequenceState *seq); |
| 52 | unsigned long md_sequence_end_time(struct sequenceState *seq); |