From e40fc849149dd97c248866a4a1d026dda5e57b62 Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Mon, 7 Mar 2011 19:01:11 +0000 Subject: clean3 --- .../synti/zynaddsubfx/Seq/Sequencer.h | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 attic/muse_qt4_evolution/synti/zynaddsubfx/Seq/Sequencer.h (limited to 'attic/muse_qt4_evolution/synti/zynaddsubfx/Seq/Sequencer.h') diff --git a/attic/muse_qt4_evolution/synti/zynaddsubfx/Seq/Sequencer.h b/attic/muse_qt4_evolution/synti/zynaddsubfx/Seq/Sequencer.h new file mode 100644 index 00000000..82ebe495 --- /dev/null +++ b/attic/muse_qt4_evolution/synti/zynaddsubfx/Seq/Sequencer.h @@ -0,0 +1,84 @@ +/* + ZynAddSubFX - a software synthesizer + + Sequencer.h - The Sequencer + Copyright (C) 2003-2005 Nasca Octavian Paul + Author: Nasca Octavian Paul + + This program is free software; you can redistribute it and/or modify + it under the terms of version 2 of the GNU General Public License + 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 (version 2) for more details. + + You should have received a copy of the GNU General Public License (version 2) + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef SEQUENCER_H +#define SEQUENCER_H + +#include "../globals.h" +#include "MIDIEvents.h" +#include "MIDIFile.h" + +class Sequencer:public MIDIEvents{ + public: + Sequencer(); + ~Sequencer(); + + //theese functions are called by the master and are ignored if the recorder/player are stopped + void recordnote(char chan, char note, char vel); + void recordcontroller(char chan,unsigned int type,int par); + + //this is only for player + //it returns 1 if this must be called at least once more + //it returns 0 if there are no more notes for the current time + //or -1 if there is no note + int getevent(char ntrack, int *midich,int *type,int *par1, int *par2); + + //returns 0 if ok or -1 if there is a error loading file + int importmidifile(char *filename); + + void startplay(); + void stopplay(); + + + int play; + int playspeed;//viteza de rulare (0.1x-10x), 0=1.0x, 128=10x + void setplayspeed(int speed); + + private: + + MIDIFile midifile; + + /* Timer */ + struct timestruct{ + double abs;//the time from the begining of the track + double rel;//the time difference between the last and the current event + double last;//the time of the last event (absolute, since 1 Jan 1970) + //theese must be double, because the float's precision is too low + //and all theese represents the time in seconds + } playtime[NUM_MIDI_TRACKS]; + + void resettime(timestruct *t); + void updatecounter(timestruct *t);//this updates the timer values + + /* Player only*/ + + struct { + event ev; + double time; + } nextevent[NUM_MIDI_TRACKS]; + + double realplayspeed; + +}; + + +#endif + -- cgit v1.2.3