diff data/midi/rtmidi/RtMidi.h @ 565:3086876472dc

* rtmidi & activity updates
author Chris Cannam
date Tue, 24 Feb 2009 17:25:55 +0000
parents ecce042cc374
children b0533d195c83
line wrap: on
line diff
--- a/data/midi/rtmidi/RtMidi.h	Tue Feb 24 11:39:45 2009 +0000
+++ b/data/midi/rtmidi/RtMidi.h	Tue Feb 24 17:25:55 2009 +0000
@@ -8,7 +8,7 @@
     RtMidi WWW site: http://music.mcgill.ca/~gary/rtmidi/
 
     RtMidi: realtime MIDI i/o C++ classes
-    Copyright (c) 2003-2007 Gary P. Scavone
+    Copyright (c) 2003-2009 Gary P. Scavone
 
     Permission is hereby granted, free of charge, to any person
     obtaining a copy of this software and associated documentation files
@@ -35,7 +35,7 @@
 */
 /**********************************************************************/
 
-// RtMidi: Version 1.0.7
+// RtMidi: Version 1.0.8
 
 #ifndef RTMIDI_H
 #define RTMIDI_H
@@ -48,7 +48,7 @@
  public:
 
   //! Pure virtual openPort() function.
-  virtual void openPort( unsigned int portNumber = 0 ) = 0;
+  virtual void openPort( unsigned int portNumber = 0, const std::string portName = std::string( "RtMidi" ) ) = 0;
 
   //! Pure virtual openVirtualPort() function.
   virtual void openVirtualPort( const std::string portName = std::string( "RtMidi" ) ) = 0;
@@ -91,7 +91,7 @@
     to open a virtual input port to which other MIDI software clients
     can connect.
 
-    by Gary P. Scavone, 2003-2004.
+    by Gary P. Scavone, 2003-2008.
 */
 /**********************************************************************/
 
@@ -105,11 +105,11 @@
   //! User callback function type definition.
   typedef void (*RtMidiCallback)( double timeStamp, std::vector<unsigned char> *message, void *userData);
 
-  //! Default constructor.
+  //! Default constructor that allows an optional client name.
   /*!
       An exception will be thrown if a MIDI system initialization error occurs.
   */
-  RtMidiIn(std::string inputName = std::string("RtMidi Input Client"));
+  RtMidiIn( const std::string clientName = std::string( "RtMidi Input Client") );
 
   //! If a MIDI connection is still open, it will be closed by the destructor.
   ~RtMidiIn();
@@ -119,7 +119,7 @@
       An optional port number greater than 0 can be specified.
       Otherwise, the default or first port found is opened.
   */
-  void openPort( unsigned int portNumber = 0 );
+  void openPort( unsigned int portNumber = 0, const std::string Portname = std::string( "RtMidi Input" ) );
 
   //! Create a virtual input port, with optional name, to allow software connections (OS X and ALSA only).
   /*!
@@ -200,6 +200,7 @@
   // the MIDI input handling function or thread.
   struct RtMidiInData {
     std::queue<MidiMessage> queue;
+    MidiMessage message;
     unsigned int queueLimit;
     unsigned char ignoreFlags;
     bool doInput;
@@ -208,16 +209,18 @@
     bool usingCallback;
     void *userCallback;
     void *userData;
+    bool continueSysex;
 
     // Default constructor.
     RtMidiInData()
       : queueLimit(1024), ignoreFlags(7), doInput(false), firstMessage(true),
-        apiData(0), usingCallback(false), userCallback(0), userData(0) {}
+        apiData(0), usingCallback(false), userCallback(0), userData(0),
+        continueSysex(false) {}
   };
 
  private:
 
-  void initialize(std::string name);
+  void initialize( const std::string& clientName );
   RtMidiInData inputData_;
 
 };
@@ -232,7 +235,7 @@
     the connection.  Create multiple instances of this class to
     connect to more than one MIDI device at the same time.
 
-    by Gary P. Scavone, 2003-2004.
+    by Gary P. Scavone, 2003-2008.
 */
 /**********************************************************************/
 
@@ -240,11 +243,11 @@
 {
  public:
 
-  //! Default constructor.
+  //! Default constructor that allows an optional client name.
   /*!
       An exception will be thrown if a MIDI system initialization error occurs.
   */
-  RtMidiOut(std::string outputName = "RtMidi Output Client");
+  RtMidiOut( const std::string clientName = std::string( "RtMidi Output Client" ) );
 
   //! The destructor closes any open MIDI connections.
   ~RtMidiOut();
@@ -256,7 +259,7 @@
       exception is thrown if an error occurs while attempting to make
       the port connection.
   */
-  void openPort( unsigned int portNumber = 0 );
+  void openPort( unsigned int portNumber = 0, const std::string portName = std::string( "RtMidi Output" ) );
 
   //! Close an open MIDI connection (if one exists).
   void closePort();
@@ -290,7 +293,7 @@
 
  private:
 
-  void initialize(std::string name);
+  void initialize( const std::string& clientName );
 };
 
 #endif