commit 83ec24d23a66e2fba8672ed4b2b9477163375373
parent b14857848055eece64070eb509b24657a66bac32
Author: Mark McCurry <mark.d.mccurry@gmail.com>
Date: Fri, 5 Jun 2009 19:07:47 -0400
Added todo notes and fixed indentation
Diffstat:
2 files changed, 48 insertions(+), 45 deletions(-)
diff --git a/src/Seq/MIDIEvents.h b/src/Seq/MIDIEvents.h
@@ -25,6 +25,9 @@
#include "../globals.h"
#define NUM_MIDI_TRACKS NUM_MIDI_CHANNELS
+/**storage the midi events from midi file or sequencer
+ * \todo this looks quite like a remake of a linked list
+ * if it is, then it should be rewritten to use <list>*/
class MIDIEvents{
friend class MIDIFile;
public:
diff --git a/src/Seq/Sequencer.h b/src/Seq/Sequencer.h
@@ -26,63 +26,63 @@
#include "MIDIEvents.h"
#include "MIDIFile.h"
-/**The Sequencer*/
+/**The Sequencer
+ * \todo restructure some of this code*/
class Sequencer:public MIDIEvents{
public:
/**Constructor*/
- Sequencer();
- /**Destructor
- * \todo investigate deletelist, it looks suspicious*/
- ~Sequencer();
-
- //these 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);
-
- /**Gets an event \todo better description
+ Sequencer();
+ /**Destructor*/
+ ~Sequencer();
+
+ //these 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);
+
+ /**Gets an event \todo better description
*
* this is only for player
- * @return 1 if this must be called at least once more
- * 0 if there are no more notes for the current time
- * -1 if there are no notes*/
- int getevent(char ntrack, int *midich,int *type,int *par1, int *par2);
-
- /**Imports a given midifile
+ * @return 1 if this must be called at least once more
+ * 0 if there are no more notes for the current time
+ * -1 if there are no notes*/
+ int getevent(char ntrack, int *midich,int *type,int *par1, int *par2);
+
+ /**Imports a given midifile
* @return 0 if ok or -1 if there is a error loading file*/
- int importmidifile(const 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);
-
+ int importmidifile(const 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;
+ 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)
- //these must be double, because the float's precision is too low
- //and all these represent the time in seconds
- } playtime[NUM_MIDI_TRACKS];
+ /* 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)
+ //these must be double, because the float's precision is too low
+ //and all these represent the time in seconds
+ } playtime[NUM_MIDI_TRACKS];
- void resettime(timestruct *t);
- void updatecounter(timestruct *t);//this updates the timer values
+ void resettime(timestruct *t);
+ void updatecounter(timestruct *t);//this updates the timer values
- /* Player only*/
+ /* Player only*/
- struct {
- event ev;
- double time;
- } nextevent[NUM_MIDI_TRACKS];
-
- double realplayspeed;
+ struct {
+ event ev;
+ double time;
+ } nextevent[NUM_MIDI_TRACKS];
+
+ double realplayspeed;
};