//------------------------------------------------------------------------- // Filename: sequence.hh // Version: $Id: sequence.hh,v 1.1.2.2 1999/06/09 10:14:03 erik Exp $ // Copyright: Copyright (C) 1999, Erik Mouw (J.A.K.Mouw@its.tudelft.nl) // Author: Erik Mouw // Description: MIDI sequence class // Created at: Sat May 15 14:55:46 1999 // Modified by: Erik Mouw // Modified at: Wed May 26 17:02:53 1999 //------------------------------------------------------------------------- // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // 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. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // #ident "$Id: sequence.hh,v 1.1.2.2 1999/06/09 10:14:03 erik Exp $" #ifndef musica_sequence_hh #define musica_sequence_hh #include "track.hh" #include "mididevice.hh" static const int maxMidiTracks = 32; class midiSequence { private: int numTracks; int division; // delta time / quarter note int frames; // frames / second int units; // units / frame midiTrack *tracks[maxMidiTracks]; long int currentTimes[maxMidiTracks]; long int nextTimes[maxMidiTracks]; long int allCurrentTime; long int allNextTime; int currentTrack; int nextTrack; void updateState(void); public: // constructor midiSequence(void); // destructor ~midiSequence(void); void setDivision(int d) { frames = units = -1; division = d; }; void setDivision(int f, int u) { division = -1; frames = f; units = u; }; int getDivision(void); int addTrack(midiTrack *track); int getNumTracks(void) { return(numTracks); }; void rewind(void); long int getCurrentTime(void) { return(allCurrentTime); }; long int getNextTime(void) { return(allNextTime); }; long int getDeltaTime(void); void play(midiDevice *device, midiPlayer *player); }; #endif