1
/* notearray.h - NoteArray class, which holds an array of notes
2
Copyright (C) 1998 Antonio Larrosa Jimenez
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
Send comments and bug fixes to antlarr@arrakis.es
19
or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain
21
***************************************************************************/
26
// This class holds a resizeable array of noteon/off events, it can increase it size, but
27
// it doesn't decreases it until destruction :-)
31
ulong ms; // ms from beginning of song
33
int cmd; // 0 note off, 1 note on, 2 change patch
34
int note; // if cmd==2 then the patch is stored in "note"
45
noteCmd *it; // the iterator
47
noteCmd *pointerTo(ulong pos);
53
void at(ulong pos, ulong ms,int chn,int cmd,int note);
54
void at(ulong pos, noteCmd s);
57
void add(ulong ms,int chn,int cmd,int note);
59
void iteratorBegin(void) { it=data; };
60
noteCmd *get(void) { return it; };
62
void moveIteratorTo(ulong ms,int *pgm=NULL);
63
// call next() until the next event is over ms milliseconds
64
// and puts in pgm[16] the instruments used at this moment