From: Manuel B. <man...@us...> - 2003-08-28 21:27:05
|
Update of /cvsroot/openmsx/openMSX/src/serial In directory sc8-pr-cvs1:/tmp/cvs-serv27962/src/serial Modified Files: MidiInReader.cc MidiInReader.hh RS232Tester.cc RS232Tester.hh Log Message: MIDI-in, RS232-tester-input and RS232-tester output filename are now configurable Index: MidiInReader.cc =================================================================== RCS file: /cvsroot/openmsx/openMSX/src/serial/MidiInReader.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- MidiInReader.cc 9 Aug 2003 20:48:42 -0000 1.3 +++ MidiInReader.cc 28 Aug 2003 21:26:56 -0000 1.4 @@ -9,7 +9,10 @@ namespace openmsx { MidiInReader::MidiInReader() - : thread(this), connector(NULL), lock(1) + : thread(this), connector(NULL), lock(1), + readFilenameSetting("midi-in-readfilename", + "filename of the file where the MIDI input is read from", + "/dev/midi") { PluggingController::instance()->registerPluggable(this); } @@ -23,7 +26,7 @@ // Pluggable void MidiInReader::plug(Connector* connector_, const EmuTime& time) { - file = fopen("/dev/midi", "rb"); + file = fopen(readFilenameSetting.getValue().c_str(), "rb"); if (!file) { return; } Index: MidiInReader.hh =================================================================== RCS file: /cvsroot/openmsx/openMSX/src/serial/MidiInReader.hh,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- MidiInReader.hh 9 Aug 2003 20:48:42 -0000 1.3 +++ MidiInReader.hh 28 Aug 2003 21:26:56 -0000 1.4 @@ -10,6 +10,7 @@ #include "Thread.hh" #include "Schedulable.hh" #include "Semaphore.hh" +#include "Settings.hh" using std::list; @@ -45,6 +46,8 @@ MidiInConnector* connector; list<byte> queue; Semaphore lock; // to protect queue + + StringSetting readFilenameSetting; }; Index: RS232Tester.cc =================================================================== RCS file: /cvsroot/openmsx/openMSX/src/serial/RS232Tester.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- RS232Tester.cc 9 Aug 2003 20:48:42 -0000 1.2 +++ RS232Tester.cc 28 Aug 2003 21:26:56 -0000 1.3 @@ -9,7 +9,13 @@ namespace openmsx { RS232Tester::RS232Tester() - : thread(this), connector(NULL), lock(1) + : thread(this), connector(NULL), lock(1), + rs232InputFilenameSetting("rs232-inputfilename", + "filename of the file where the RS232 input is read from", + "rs232-input"), + rs232OutputFilenameSetting("rs232-outputfilename", + "filename of the file where the RS232 output is written to", + "rs232-output") { PluggingController::instance()->registerPluggable(this); } @@ -24,10 +30,10 @@ void RS232Tester::plug(Connector* connector_, const EmuTime& time) { // output - outFile.open("rs232-output"); + outFile.open(rs232OutputFilenameSetting.getValue().c_str()); // input - inFile = fopen("rs232-input", "rb"); + inFile = fopen(rs232OutputFilenameSetting.getValue().c_str(), "rb"); if (!inFile) { return; } Index: RS232Tester.hh =================================================================== RCS file: /cvsroot/openmsx/openMSX/src/serial/RS232Tester.hh,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- RS232Tester.hh 9 Aug 2003 20:48:42 -0000 1.3 +++ RS232Tester.hh 28 Aug 2003 21:26:56 -0000 1.4 @@ -11,6 +11,7 @@ #include "Thread.hh" #include "Schedulable.hh" #include "Semaphore.hh" +#include "Settings.hh" using std::list; using std::ofstream; @@ -52,6 +53,9 @@ Semaphore lock; // to protect queue ofstream outFile; + + StringSetting rs232InputFilenameSetting; + StringSetting rs232OutputFilenameSetting; }; } // namespace openmsx |