[Scummvm-cvs-logs] CVS: scummvm/sound mididrv.h,1.13,1.14 midistreamer.cpp,1.5,1.6 midistreamer.h,1.3,1.4

Jamieson Christian jamieson630 at users.sourceforge.net
Sat Dec 21 13:33:04 CET 2002


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv5451/sound

Modified Files:
	mididrv.h midistreamer.cpp midistreamer.h 
Log Message:
MidiStreamer no longer derives from MidiDriver.
Removed MidiStreamer methods that weren't actually needed.
That's one layer of indirection removed from Simon music.

Index: mididrv.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mididrv.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- mididrv.h	18 Dec 2002 07:48:35 -0000	1.13
+++ mididrv.h	21 Dec 2002 21:32:45 -0000	1.14
@@ -27,22 +27,10 @@
 
 class MidiChannel;
 
-struct MidiEvent {
-	uint32 delta;
-	uint32 event;
-};
-
 // Abstract MIDI Driver Class
 class MidiDriver {
 
 public:
-	// Special events that can be inserted in a MidiEvent.
-	// event = (ME_xxx<<24) | <24-bit data associated with event>
-	enum {
-		ME_NONE = 0,
-		ME_TEMPO = 1,
-	};
-
 	// Error codes returned by open.
 	// Can be converted to a string with getErrorName()
 	enum {

Index: midistreamer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/midistreamer.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- midistreamer.cpp	11 Dec 2002 16:09:57 -0000	1.5
+++ midistreamer.cpp	21 Dec 2002 21:32:45 -0000	1.6
@@ -86,7 +86,7 @@
 		close();
 
 	int res = _target->open();
-	if (res && res != MERR_ALREADY_OPEN)
+	if (res && res != MidiDriver::MERR_ALREADY_OPEN)
 		return res;
 
 	_event_index = _event_count = _delay = 0;
@@ -121,7 +121,7 @@
 	switch (prop) {
 
 	// 16-bit time division according to standard midi specification
-	case PROP_TIMEDIV:
+	case MidiDriver::PROP_TIMEDIV:
 		_ticks_per_beat = (uint16)param;
 		return 1;
 	}

Index: midistreamer.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/midistreamer.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- midistreamer.h	11 Dec 2002 16:09:58 -0000	1.3
+++ midistreamer.h	21 Dec 2002 21:32:45 -0000	1.4
@@ -26,16 +26,25 @@
 
 #include "mididrv.h"
 
-class MidiStreamer : public MidiDriver {
+struct MidiEvent {
+	uint32 delta;
+	uint32 event;
+};
+
+class MidiStreamer {
 public:
-	/* called whenever the midi driver is in streaming mode,
-	 * and more midi commands need to be generated
-	 * return 0 to tell the mididriver that the end of stream was reached
-	 */
+	// Called whenever more MIDI commands need to be generated.
+	// Return 0 to tell MidiStreamer that end of stream was reached.
 	typedef int StreamCallback (void *param, MidiEvent * ev, int num);
 
-private:
+	// Special events that can be inserted in a MidiEvent.
+	// event = (ME_xxx<<24) | <24-bit data associated with event>
+	enum {
+		ME_NONE = 0,
+		ME_TEMPO = 1,
+	};
 
+private:
 	MidiDriver *_target;
 	StreamCallback *_stream_proc;
 	void *_stream_param;
@@ -55,23 +64,14 @@
 	void on_timer();
 
 public:
-
 	MidiStreamer (MidiDriver *target);
 
 	int open();
 	void close();
 	void send(uint32 b) { if (_isOpen) _target->send (b); }
 	uint32 property(int prop, uint32 param);
-	void setPitchBendRange (byte channel, uint range) { _target->setPitchBendRange (channel, range); }
-
 	void pause(bool p) { _paused = p; }
 	void set_stream_callback(void *param, StreamCallback *sc);
-
-	void setTimerCallback (void *timer_param, void (*timer_proc) (void *)) { }
-	uint32 getBaseTempo (void) { return _target->getBaseTempo(); }
-
-	MidiChannel *allocateChannel() { return NULL; }
-	MidiChannel *getPercussionChannel() { return NULL; }
 };
 
 #endif





More information about the Scummvm-git-logs mailing list