From b2694d0b8be5919ece4dcb9df2d11d1a51c2f071 Mon Sep 17 00:00:00 2001 From: Gary Scavone Date: Fri, 11 Oct 2013 15:10:46 +0200 Subject: Release 1.0.3 tarball --- doc/html/RtError_8h-source.html | 8 +- doc/html/RtMidi_8h-source.html | 255 ++++++++++++++++++----------------- doc/html/annotated.html | 12 +- doc/html/classRtError-members.html | 14 +- doc/html/classRtError.html | 48 +++---- doc/html/classRtMidi-members.html | 7 +- doc/html/classRtMidi.html | 22 ++- doc/html/classRtMidiIn-members.html | 28 ++-- doc/html/classRtMidiIn.html | 211 ++++++++++++++--------------- doc/html/classRtMidiOut-members.html | 18 +-- doc/html/classRtMidiOut.html | 126 +++++++++-------- doc/html/doxygen.css | 245 ++++++--------------------------- doc/html/doxygen.png | Bin 1576 -> 2352 bytes doc/html/files.html | 2 +- doc/html/functions.html | 21 ++- doc/html/hierarchy.html | 2 +- doc/html/index.html | 106 ++++++++------- 17 files changed, 488 insertions(+), 637 deletions(-) (limited to 'doc') diff --git a/doc/html/RtError_8h-source.html b/doc/html/RtError_8h-source.html index 4985841..db0f4ce 100644 --- a/doc/html/RtError_8h-source.html +++ b/doc/html/RtError_8h-source.html @@ -7,7 +7,7 @@
Tutorial   Class/Enum List   File List   Compound Members  

- +

RtError.h

00001 /************************************************************************/
 00010 /************************************************************************/
 00011 
@@ -20,7 +20,7 @@
 00018 class RtError
 00019 {
 00020 public:
-00022   enum Type {
+00022   enum Type {
 00023     WARNING,
 00024     DEBUG_WARNING,
 00025     UNSPECIFIED,
@@ -36,7 +36,7 @@
 00035 
 00036 protected:
 00037   std::string message_;
-00038   Type type_;
+00038   Type type_;
 00039 
 00040 public:
 00042   RtError(const std::string& message, Type type = RtError::UNSPECIFIED) : message_(message), type_(type) {}
@@ -45,7 +45,7 @@
 00046 
 00048   virtual void printMessage(void) { std::cout << '\n' << message_ << "\n\n"; }
 00049 
-00051   virtual const Type& getType(void) { return type_; }
+00051   virtual const Type& getType(void) { return type_; }
 00052 
 00054   virtual const std::string& getMessage(void) { return message_; }
 00055 };
diff --git a/doc/html/RtMidi_8h-source.html b/doc/html/RtMidi_8h-source.html
index 402a828..f8e4af9 100644
--- a/doc/html/RtMidi_8h-source.html
+++ b/doc/html/RtMidi_8h-source.html
@@ -7,11 +7,11 @@
 
Tutorial   Class/Enum List   File List   Compound Members  

- +

RtMidi.h

00001 /**********************************************************************/
 00036 /**********************************************************************/
 00037 
-00038 // RtMidi: Version 1.0.2, 21 September 2004
+00038 // RtMidi: Version 1.0.3, ??
 00039 
 00040 #ifndef RTMIDI_H
 00041 #define RTMIDI_H
@@ -21,140 +21,149 @@
 00045 
 00046 class RtMidi
 00047 {
-00048  protected:
+00048  public:
 00049 
-00050   RtMidi();
-00051 
-00052   virtual ~RtMidi() {};
-00053 
-00054   // A basic error reporting function for internal use in the RtMidi
-00055   // subclasses.  The behavior of this function can be modified to
-00056   // suit specific needs.
-00057   void error( RtError::Type type );
+00051   virtual void openPort( unsigned int portNumber = 0 ) = 0;
+00052 
+00054   virtual void openVirtualPort() = 0;
+00055 
+00057   virtual unsigned int getPortCount() = 0;
 00058 
-00059   virtual void openPort( unsigned int portNumber = 0 ) = 0;
-00060 
-00061   void *apiData_;
-00062   bool connected_;
-00063   std::string errorString_;
-00064 };
-00065 
-00066 /**********************************************************************/
-00082 /**********************************************************************/
-00083 
-00084 #include <vector>
-00085 #include <queue>
-00086 
-00087 class RtMidiIn : public RtMidi
-00088 {
-00089  public:
-00090 
-00092   typedef void (*RtMidiCallback)( double timeStamp, std::vector<unsigned char> *message, void *userData);
-00093 
-00095 
-00098   RtMidiIn();
-00099 
-00101   ~RtMidiIn();
-00102 
+00060   virtual std::string getPortName( unsigned int portNumber = 0 ) = 0;
+00061 
+00063   virtual void closePort( void ) = 0;
+00064 
+00065  protected:
+00066 
+00067   RtMidi();
+00068   virtual ~RtMidi() {};
+00069 
+00070   // A basic error reporting function for internal use in the RtMidi
+00071   // subclasses.  The behavior of this function can be modified to
+00072   // suit specific needs.
+00073   void error( RtError::Type type );
+00074 
+00075   void *apiData_;
+00076   bool connected_;
+00077   std::string errorString_;
+00078 };
+00079 
+00080 /**********************************************************************/
+00096 /**********************************************************************/
+00097 
+00098 #include <vector>
+00099 #include <queue>
+00100 
+00101 class RtMidiIn : public RtMidi
+00102 {
+00103  public:
 00104 
-00108   void openPort( unsigned int portNumber = 0 );
+00106   typedef void (*RtMidiCallback)( double timeStamp, std::vector<unsigned char> *message, void *userData);
+00107 
 00109 
-00111 
-00117   void openVirtualPort();
+00112   RtMidiIn();
+00113 
+00115   ~RtMidiIn();
+00116 
 00118 
-00120 
-00126   void setCallback( RtMidiCallback callback, void *userData = 0 );
-00127 
-00129 
-00133   void cancelCallback();
+00122   void openPort( unsigned int portNumber = 0 );
+00123 
+00125 
+00131   void openVirtualPort();
+00132 
 00134 
-00136   void closePort( void );
-00137 
-00139   unsigned int getPortCount();
-00140 
-00142 
-00145   std::string getPortName( unsigned int portNumber = 0 );
-00146 
+00140   void setCallback( RtMidiCallback callback, void *userData = 0 );
+00141 
+00143 
+00147   void cancelCallback();
 00148 
-00152   void setQueueSizeLimit( unsigned int queueSize );
-00153 
-00155 
-00162   void ignoreTypes( bool midiSysex = true, bool midiTime = true, bool midiSense = true );
-00163 
-00165 
-00172   double getMessage( std::vector<unsigned char> *message );
-00173 
-00174   // A MIDI structure used internally by the class to store incoming
-00175   // messages.  Each message represents one and only one MIDI message.
-00176   struct MidiMessage { 
-00177     std::vector<unsigned char> bytes; 
-00178     double timeStamp;
+00150   void closePort( void );
+00151 
+00153   unsigned int getPortCount();
+00154 
+00156 
+00159   std::string getPortName( unsigned int portNumber = 0 );
+00160 
+00162 
+00166   void setQueueSizeLimit( unsigned int queueSize );
+00167 
+00169 
+00176   void ignoreTypes( bool midiSysex = true, bool midiTime = true, bool midiSense = true );
+00177 
 00179 
-00180     // Default constructor.
-00181     MidiMessage()
-00182       :bytes(3), timeStamp(0.0) {}
-00183   };
-00184 
-00185   // The RtMidiInData structure is used to pass private class data to
-00186   // the MIDI input handling function or thread.
-00187   struct RtMidiInData {
-00188     std::queue<MidiMessage> queue;
-00189     unsigned int queueLimit;
-00190     unsigned char ignoreFlags;
-00191     bool doInput;
-00192     bool firstMessage;
-00193     void *apiData;
-00194     bool usingCallback;
-00195     void *userCallback;
-00196     void *userData;
-00197 
-00198     // Default constructor.
-00199     RtMidiInData()
-00200       : queueLimit(1024), ignoreFlags(7), doInput(false), firstMessage(true),
-00201         apiData(0), usingCallback(false), userCallback(0), userData(0) {}
-00202   };
-00203 
-00204  private:
-00205 
-00206   void initialize( void );
-00207   RtMidiInData inputData_;
-00208 
-00209 };
-00210 
-00211 /**********************************************************************/
-00223 /**********************************************************************/
+00186   double getMessage( std::vector<unsigned char> *message );
+00187 
+00188   // A MIDI structure used internally by the class to store incoming
+00189   // messages.  Each message represents one and only one MIDI message.
+00190   struct MidiMessage { 
+00191     std::vector<unsigned char> bytes; 
+00192     double timeStamp;
+00193 
+00194     // Default constructor.
+00195     MidiMessage()
+00196       :bytes(3), timeStamp(0.0) {}
+00197   };
+00198 
+00199   // The RtMidiInData structure is used to pass private class data to
+00200   // the MIDI input handling function or thread.
+00201   struct RtMidiInData {
+00202     std::queue<MidiMessage> queue;
+00203     unsigned int queueLimit;
+00204     unsigned char ignoreFlags;
+00205     bool doInput;
+00206     bool firstMessage;
+00207     void *apiData;
+00208     bool usingCallback;
+00209     void *userCallback;
+00210     void *userData;
+00211 
+00212     // Default constructor.
+00213     RtMidiInData()
+00214       : queueLimit(1024), ignoreFlags(7), doInput(false), firstMessage(true),
+00215         apiData(0), usingCallback(false), userCallback(0), userData(0) {}
+00216   };
+00217 
+00218  private:
+00219 
+00220   void initialize( void );
+00221   RtMidiInData inputData_;
+00222 
+00223 };
 00224 
-00225 class RtMidiOut : public RtMidi
-00226 {
-00227  public:
-00228 
-00230 
-00233   RtMidiOut();
-00234 
-00236   ~RtMidiOut();
-00237 
-00239 
-00245   void openPort( unsigned int portNumber = 0 );
-00246 
-00248   void closePort();
-00249 
+00225 /**********************************************************************/
+00237 /**********************************************************************/
+00238 
+00239 class RtMidiOut : public RtMidi
+00240 {
+00241  public:
+00242 
+00244 
+00247   RtMidiOut();
+00248 
+00250   ~RtMidiOut();
 00251 
-00259   void openVirtualPort();
+00253 
+00259   void openPort( unsigned int portNumber = 0 );
 00260 
-00262   unsigned int getPortCount();
+00262   void closePort();
 00263 
 00265 
-00268   std::string getPortName( unsigned int portNumber );
-00269 
-00271 
-00275   void sendMessage( std::vector<unsigned char> *message );
-00276 
-00277  private:
-00278 
-00279   void initialize( void );
-00280 };
-00281 
-00282 #endif
+00273   void openVirtualPort();
+00274 
+00276   unsigned int getPortCount();
+00277 
+00279 
+00282   std::string getPortName( unsigned int portNumber );
+00283 
+00285 
+00289   void sendMessage( std::vector<unsigned char> *message );
+00290 
+00291  private:
+00292 
+00293   void initialize( void );
+00294 };
+00295 
+00296 #endif
 

diff --git a/doc/html/annotated.html b/doc/html/annotated.html index 677ed14..3ad461c 100644 --- a/doc/html/annotated.html +++ b/doc/html/annotated.html @@ -7,12 +7,12 @@
Tutorial   Class/Enum List   File List   Compound Members  

- -

RtMidi Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
- - - - + +

RtMidi Compound List

Here are the classes, structs, unions and interfaces with brief descriptions:
RtErrorException handling class for RtAudio & RtMidi
RtMidiAn abstract base class for realtime MIDI input/output
RtMidiInA realtime MIDI input class
RtMidiOutA realtime MIDI output class
+ + + +
RtErrorException handling class for RtAudio & RtMidi
RtMidiAn abstract base class for realtime MIDI input/output
RtMidiInA realtime MIDI input class
RtMidiOutA realtime MIDI output class

diff --git a/doc/html/classRtError-members.html b/doc/html/classRtError-members.html index c73c5a9..f3bb904 100644 --- a/doc/html/classRtError-members.html +++ b/doc/html/classRtError-members.html @@ -7,14 +7,14 @@
Tutorial   Class/Enum List   File List   Compound Members  

- +

RtError Member List

This is the complete list of members for RtError, including all inherited members. - - - - - - + + + + + +
getMessage(void)RtError [inline, virtual]
getType(void)RtError [inline, virtual]
printMessage(void)RtError [inline, virtual]
RtError(const std::string &message, Type type=RtError::UNSPECIFIED)RtError [inline]
Type enum nameRtError
~RtError(void)RtError [inline, virtual]
getMessage(void)RtError [inline, virtual]
getType(void)RtError [inline, virtual]
printMessage(void)RtError [inline, virtual]
RtError(const std::string &message, Type type=RtError::UNSPECIFIED)RtError [inline]
Type enum nameRtError
~RtError(void)RtError [inline, virtual]

diff --git a/doc/html/classRtError.html b/doc/html/classRtError.html index cbf8ee9..395a949 100644 --- a/doc/html/classRtError.html +++ b/doc/html/classRtError.html @@ -7,8 +7,8 @@
Tutorial   Class/Enum List   File List   Compound Members  

- -

RtError Class Reference

Exception handling class for RtAudio & RtMidi. + +

RtError Class Reference

Exception handling class for RtAudio & RtMidi. More...

#include <RtError.h> @@ -16,35 +16,29 @@ List of all members.

- - - + + - - - - - - - - - - - - - - - + + + + + + + + + +

Public Types

enum  Type
 Defined RtError types.

enum  Type
 Defined RtError types.


Public Member Functions

RtError (const std::string &message, Type type=RtError::UNSPECIFIED)
 The constructor.

-virtual ~RtError (void)
 The destructor.

-virtual void printMessage (void)
 Prints "thrown" error message to stdout.

-virtual const TypegetType (void)
 Returns the "thrown" error message type.

-virtual const std::string & getMessage (void)
 Returns the "thrown" error message string.

RtError (const std::string &message, Type type=RtError::UNSPECIFIED)
 The constructor.

+virtual ~RtError (void)
 The destructor.

+virtual void printMessage (void)
 Prints "thrown" error message to stdout.

+virtual const TypegetType (void)
 Returns the "thrown" error message type.

+virtual const std::string & getMessage (void)
 Returns the "thrown" error message string.


Detailed Description

-Exception handling class for RtAudio & RtMidi. +Exception handling class for RtAudio & RtMidi.

-The RtError class is quite simple but it does allow errors to be "caught" by RtError::Type. See the RtAudio and RtMidi documentation to know which methods can "throw" an RtError. +The RtError class is quite simple but it does allow errors to be "caught" by RtError::Type. See the RtAudio and RtMidi documentation to know which methods can "throw" an RtError.


The documentation for this class was generated from the following file: diff --git a/doc/html/classRtMidi-members.html b/doc/html/classRtMidi-members.html index a6b2f32..a100873 100644 --- a/doc/html/classRtMidi-members.html +++ b/doc/html/classRtMidi-members.html @@ -7,8 +7,13 @@
Tutorial   Class/Enum List   File List   Compound Members  

- +

RtMidi Member List

This is the complete list of members for RtMidi, including all inherited members. + + + + +
closePort(void)=0RtMidi [pure virtual]
getPortCount()=0RtMidi [pure virtual]
getPortName(unsigned int portNumber=0)=0RtMidi [pure virtual]
openPort(unsigned int portNumber=0)=0RtMidi [pure virtual]
openVirtualPort()=0RtMidi [pure virtual]

diff --git a/doc/html/classRtMidi.html b/doc/html/classRtMidi.html index 1b78b92..e903fbe 100644 --- a/doc/html/classRtMidi.html +++ b/doc/html/classRtMidi.html @@ -7,8 +7,8 @@
Tutorial   Class/Enum List   File List   Compound Members  

- -

RtMidi Class Reference

An abstract base class for realtime MIDI input/output. + +

RtMidi Class Reference

An abstract base class for realtime MIDI input/output. More...

#include <RtMidi.h> @@ -21,9 +21,25 @@ List of all members.

+ + + + + + + + + + +

Public Member Functions

+virtual void openPort (unsigned int portNumber=0)=0
 Pure virtual openPort() function.

+virtual void openVirtualPort ()=0
 Pure virtual openVirtualPort() function.

+virtual unsigned int getPortCount ()=0
 Pure virtual getPortCount() function.

+virtual std::string getPortName (unsigned int portNumber=0)=0
 Pure virtual getPortName() function.

+virtual void closePort (void)=0
 Pure virtual closePort() function.


Detailed Description

-An abstract base class for realtime MIDI input/output. +An abstract base class for realtime MIDI input/output.

This class implements some common functionality for the realtime MIDI input/output subclasses RtMidiIn and RtMidiOut.

RtMidi WWW site: http://music.mcgill.ca/~gary/rtmidi/

diff --git a/doc/html/classRtMidiIn-members.html b/doc/html/classRtMidiIn-members.html index dab2552..2091a77 100644 --- a/doc/html/classRtMidiIn-members.html +++ b/doc/html/classRtMidiIn-members.html @@ -7,21 +7,21 @@

Tutorial   Class/Enum List   File List   Compound Members  

- +

RtMidiIn Member List

This is the complete list of members for RtMidiIn, including all inherited members. - - - - - - - - - - - - - + + + + + + + + + + + + +
cancelCallback()RtMidiIn
closePort(void)RtMidiIn
getMessage(std::vector< unsigned char > *message)RtMidiIn
getPortCount()RtMidiIn
getPortName(unsigned int portNumber=0)RtMidiIn
ignoreTypes(bool midiSysex=true, bool midiTime=true, bool midiSense=true)RtMidiIn
openPort(unsigned int portNumber=0)RtMidiIn [virtual]
openVirtualPort()RtMidiIn
RtMidiCallback typedefRtMidiIn
RtMidiIn()RtMidiIn
setCallback(RtMidiCallback callback, void *userData=0)RtMidiIn
setQueueSizeLimit(unsigned int queueSize)RtMidiIn
~RtMidiIn()RtMidiIn
cancelCallback()RtMidiIn
closePort(void)RtMidiIn [virtual]
getMessage(std::vector< unsigned char > *message)RtMidiIn
getPortCount()RtMidiIn [virtual]
getPortName(unsigned int portNumber=0)RtMidiIn [virtual]
ignoreTypes(bool midiSysex=true, bool midiTime=true, bool midiSense=true)RtMidiIn
openPort(unsigned int portNumber=0)RtMidiIn [virtual]
openVirtualPort()RtMidiIn [virtual]
RtMidiCallback typedefRtMidiIn
RtMidiIn()RtMidiIn
setCallback(RtMidiCallback callback, void *userData=0)RtMidiIn
setQueueSizeLimit(unsigned int queueSize)RtMidiIn
~RtMidiIn()RtMidiIn

diff --git a/doc/html/classRtMidiIn.html b/doc/html/classRtMidiIn.html index 4255030..57bd429 100644 --- a/doc/html/classRtMidiIn.html +++ b/doc/html/classRtMidiIn.html @@ -7,8 +7,8 @@
Tutorial   Class/Enum List   File List   Compound Members  

- -

RtMidiIn Class Reference

A realtime MIDI input class. + +

RtMidiIn Class Reference

A realtime MIDI input class. More...

#include <RtMidi.h> @@ -21,68 +21,55 @@ List of all members.

- - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + +

Public Types

-typedef void(* RtMidiCallback )(double timeStamp, std::vector< unsigned char > *message, void *userData)
 User callback function type definition.

+typedef void(* RtMidiCallback )(double timeStamp, std::vector< unsigned char > *message, void *userData)
 User callback function type definition.


Public Member Functions

 RtMidiIn ()
 Default constructor.

~RtMidiIn ()
 If a MIDI connection is still open, it will be closed by the destructor.

void openPort (unsigned int portNumber=0)
 Open a MIDI input connection.

void openVirtualPort ()
 Create a virtual input port to allow software connections (OS X and ALSA only).

void setCallback (RtMidiCallback callback, void *userData=0)
 Set a callback function to be invoked for incoming MIDI messages.

void cancelCallback ()
 Cancel use of the current callback function (if one exists).

-void closePort (void)
 Close an open MIDI connection (if one exists).

-unsigned int getPortCount ()
 Return the number of available MIDI input ports.

std::string getPortName (unsigned int portNumber=0)
 Return a string identifier for the specified MIDI input port number.

void setQueueSizeLimit (unsigned int queueSize)
 Set the maximum number of MIDI messages to be saved in the queue.

void ignoreTypes (bool midiSysex=true, bool midiTime=true, bool midiSense=true)
 Specify whether certain MIDI message types should be queued or ignored during input.

double getMessage (std::vector< unsigned char > *message)
 Fill the user-provided vector with the data bytes for the next available MIDI message in the input queue and return the event delta-time in seconds.

 RtMidiIn ()
 Default constructor.

~RtMidiIn ()
 If a MIDI connection is still open, it will be closed by the destructor.

void openPort (unsigned int portNumber=0)
 Open a MIDI input connection.

void openVirtualPort ()
 Create a virtual input port to allow software connections (OS X and ALSA only).

void setCallback (RtMidiCallback callback, void *userData=0)
 Set a callback function to be invoked for incoming MIDI messages.

void cancelCallback ()
 Cancel use of the current callback function (if one exists).

+void closePort (void)
 Close an open MIDI connection (if one exists).

+unsigned int getPortCount ()
 Return the number of available MIDI input ports.

std::string getPortName (unsigned int portNumber=0)
 Return a string identifier for the specified MIDI input port number.

void setQueueSizeLimit (unsigned int queueSize)
 Set the maximum number of MIDI messages to be saved in the queue.

void ignoreTypes (bool midiSysex=true, bool midiTime=true, bool midiSense=true)
 Specify whether certain MIDI message types should be queued or ignored during input.

double getMessage (std::vector< unsigned char > *message)
 Fill the user-provided vector with the data bytes for the next available MIDI message in the input queue and return the event delta-time in seconds.


Detailed Description

-A realtime MIDI input class. +A realtime MIDI input class.

This class provides a common, platform-independent API for realtime MIDI input. It allows access to a single MIDI input port. Incoming MIDI messages are either saved to a queue for retrieval using the getMessage() function or immediately passed to a user-specified callback function. Create multiple instances of this class to connect to more than one MIDI device at the same time. With the OS-X and Linux ALSA MIDI APIs, it is also possible to open a virtual input port to which other MIDI software clients can connect.

by Gary P. Scavone, 2003-2004.


Constructor & Destructor Documentation

-

- +

+

-
+ - - + + @@ -98,23 +85,23 @@ by Gary P. Scavone, 2003-2004.
RtMidiIn::RtMidiIn  )  

-Default constructor. +Default constructor.

An exception will be thrown if a MIDI system initialization error occurs.


Member Function Documentation

-

- +

+

-
+ - - + + @@ -130,24 +117,24 @@ An exception will be thrown if a MIDI system initialization error occurs.

-Open a MIDI input connection. +Open a MIDI input connection.

An optional port number greater than 0 can be specified. Otherwise, the default or first port found is opened.

-Implements RtMidi. +Implements RtMidi.

void RtMidiIn::openPort unsigned int  portNumber = 0  )   portNumber = 0 [virtual]
-

- +

+

- +Implements RtMidi.
+ - - - + + +
void RtMidiIn::openVirtualPort  )   [virtual]
@@ -162,27 +149,29 @@ Implements RtMidi.

-Create a virtual input port to allow software connections (OS X and ALSA only). +Create a virtual input port to allow software connections (OS X and ALSA only). +

+This function creates a virtual MIDI input port to which other software applications can connect. This type of functionality is currently only supported by the Macintosh OS-X and Linux ALSA APIs (the function does nothing for the other APIs).

-This function creates a virtual MIDI input port to which other software applications can connect. This type of functionality is currently only supported by the Macintosh OS-X and Linux ALSA APIs (the function does nothing for the other APIs).

-

- +

+

-
+ - - + + - + - + @@ -202,21 +191,21 @@ This function creates a virtual MIDI input port to which other software applicat
void RtMidiIn::setCallback RtMidiCallback  callback, RtMidiCallback   callback,
void *  userData = 0  userData = 0

-Set a callback function to be invoked for incoming MIDI messages. +Set a callback function to be invoked for incoming MIDI messages.

The callback function will be called whenever an incoming MIDI message is received. While not absolutely necessary, it is best to set the callback function before opening a MIDI port to avoid leaving some messages in the queue.

-

- +

+

-
+ - - + + @@ -232,23 +221,23 @@ The callback function will be called whenever an incoming MIDI message is receiv
void RtMidiIn::cancelCallback  )  

-Cancel use of the current callback function (if one exists). +Cancel use of the current callback function (if one exists).

Subsequent incoming MIDI messages will be written to the queue and can be retrieved with the getMessage function.

-

- +

+

- +Implements RtMidi.
+ - - - + + +
std::string RtMidiIn::getPortName unsigned int  portNumber = 0  )   portNumber = 0 [virtual]
@@ -263,22 +252,24 @@ Subsequent incoming MIDI messages will be written to the queue and can be retrie

-Return a string identifier for the specified MIDI input port number. +Return a string identifier for the specified MIDI input port number. +

+An exception is thrown if an invalid port specifier is provided.

-An exception is thrown if an invalid port specifier is provided.

-

- +

+

-
+ - - + + @@ -294,33 +285,33 @@ An exception is thrown if an invalid port specifier is provided.
void RtMidiIn::setQueueSizeLimit unsigned int  queueSize  )   queueSize

-Set the maximum number of MIDI messages to be saved in the queue. +Set the maximum number of MIDI messages to be saved in the queue.

If the queue size limit is reached, incoming messages will be ignored. The default limit is 1024.

-

- +

+

-
+ - + - + - + - + - + @@ -340,22 +331,22 @@ If the queue size limit is reached, incoming messages will be ignored. The defau
void RtMidiIn::ignoreTypes bool  midiSysex = true,   midiSysex = true,
bool  midiTime = true,   midiTime = true,
bool  midiSense = true  midiSense = true

-Specify whether certain MIDI message types should be queued or ignored during input. +Specify whether certain MIDI message types should be queued or ignored during input.

By default, MIDI timing and active sensing messages are ignored during message input because of their relative high data rates. MIDI sysex messages are ignored by default as well. Variable values of "true" imply that the respective message type will be ignored.

-

- +

+

-
+ - - + + @@ -371,7 +362,7 @@ By default, MIDI timing and active sensing messages are ignored during message i diff --git a/doc/html/classRtMidiOut-members.html b/doc/html/classRtMidiOut-members.html index 9416f1a..e9e25bf 100644 --- a/doc/html/classRtMidiOut-members.html +++ b/doc/html/classRtMidiOut-members.html @@ -7,16 +7,16 @@
Tutorial   Class/Enum List   File List   Compound Members  

- +

RtMidiOut Member List

This is the complete list of members for RtMidiOut, including all inherited members.
double RtMidiIn::getMessage std::vector< unsigned char > *  message  )   message

-Fill the user-provided vector with the data bytes for the next available MIDI message in the input queue and return the event delta-time in seconds. +Fill the user-provided vector with the data bytes for the next available MIDI message in the input queue and return the event delta-time in seconds.

This function returns immediately whether a new message is available or not. A valid message is indicated by a non-zero vector size. An exception is thrown if an error occurs during message retrieval or an input connection was not previously established.

- - - - - - - - + + + + + + + +
closePort()RtMidiOut
getPortCount()RtMidiOut
getPortName(unsigned int portNumber)RtMidiOut
openPort(unsigned int portNumber=0)RtMidiOut [virtual]
openVirtualPort()RtMidiOut
RtMidiOut()RtMidiOut
sendMessage(std::vector< unsigned char > *message)RtMidiOut
~RtMidiOut()RtMidiOut
closePort()RtMidiOut [virtual]
getPortCount()RtMidiOut [virtual]
getPortName(unsigned int portNumber)RtMidiOut [virtual]
openPort(unsigned int portNumber=0)RtMidiOut [virtual]
openVirtualPort()RtMidiOut [virtual]
RtMidiOut()RtMidiOut
sendMessage(std::vector< unsigned char > *message)RtMidiOut
~RtMidiOut()RtMidiOut

diff --git a/doc/html/classRtMidiOut.html b/doc/html/classRtMidiOut.html index 025e8a2..b83984a 100644 --- a/doc/html/classRtMidiOut.html +++ b/doc/html/classRtMidiOut.html @@ -7,8 +7,8 @@
Tutorial   Class/Enum List   File List   Compound Members  

- -

RtMidiOut Class Reference

A realtime MIDI output class. + +

RtMidiOut Class Reference

A realtime MIDI output class. More...

#include <RtMidi.h> @@ -21,51 +21,43 @@ List of all members.

- - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + +

Public Member Functions

 RtMidiOut ()
 Default constructor.

~RtMidiOut ()
 The destructor closes any open MIDI connections.

void openPort (unsigned int portNumber=0)
 Open a MIDI output connection.

-void closePort ()
 Close an open MIDI connection (if one exists).

void openVirtualPort ()
 Create a virtual output port to allow software connections (OS X and ALSA only).

-unsigned int getPortCount ()
 Return the number of available MIDI output ports.

std::string getPortName (unsigned int portNumber)
 Return a string identifier for the specified MIDI port type and number.

void sendMessage (std::vector< unsigned char > *message)
 Immediately send a single message out an open MIDI output port.

 RtMidiOut ()
 Default constructor.

~RtMidiOut ()
 The destructor closes any open MIDI connections.

void openPort (unsigned int portNumber=0)
 Open a MIDI output connection.

+void closePort ()
 Close an open MIDI connection (if one exists).

void openVirtualPort ()
 Create a virtual output port to allow software connections (OS X and ALSA only).

+unsigned int getPortCount ()
 Return the number of available MIDI output ports.

std::string getPortName (unsigned int portNumber)
 Return a string identifier for the specified MIDI port type and number.

void sendMessage (std::vector< unsigned char > *message)
 Immediately send a single message out an open MIDI output port.


Detailed Description

-A realtime MIDI output class. +A realtime MIDI output class.

This class provides a common, platform-independent API for MIDI output. It allows one to probe available MIDI output ports, to connect to one such port, and to send MIDI bytes immediately over 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.


Constructor & Destructor Documentation

-

- +

+

-
+ - - + + @@ -81,23 +73,23 @@ by Gary P. Scavone, 2003-2004.
RtMidiOut::RtMidiOut  )  

-Default constructor. +Default constructor.

An exception will be thrown if a MIDI system initialization error occurs.


Member Function Documentation

-

- +

+

-
+ - - + + @@ -113,24 +105,24 @@ An exception will be thrown if a MIDI system initialization error occurs.

-Open a MIDI output connection. +Open a MIDI output connection.

An optional port number greater than 0 can be specified. Otherwise, the default or first port found is opened. An exception is thrown if an error occurs while attempting to make the port connection.

-Implements RtMidi. +Implements RtMidi.

void RtMidiOut::openPort unsigned int  portNumber = 0  )   portNumber = 0 [virtual]
-

- +

+

- +Implements RtMidi.
+ - - - + + +
void RtMidiOut::openVirtualPort  )   [virtual]
@@ -145,23 +137,25 @@ Implements RtMidi.

-Create a virtual output port to allow software connections (OS X and ALSA only). +Create a virtual output port to allow software connections (OS X and ALSA only). +

+This function creates a virtual MIDI output port to which other software applications can connect. This type of functionality is currently only supported by the Macintosh OS-X and Linux ALSA APIs (the function does nothing with the other APIs). An exception is thrown if an error occurs while attempting to create the virtual port.

-This function creates a virtual MIDI output port to which other software applications can connect. This type of functionality is currently only supported by the Macintosh OS-X and Linux ALSA APIs (the function does nothing with the other APIs). An exception is thrown if an error occurs while attempting to create the virtual port.

-

- +

+

- +Implements RtMidi.
+ - - - + + +
std::string RtMidiOut::getPortName unsigned int  portNumber  )   portNumber [virtual]
@@ -176,22 +170,24 @@ This function creates a virtual MIDI output port to which other software applica

-Return a string identifier for the specified MIDI port type and number. +Return a string identifier for the specified MIDI port type and number. +

+An exception is thrown if an invalid port specifier is provided.

-An exception is thrown if an invalid port specifier is provided.

-

- +

+

-
+ - - + + @@ -207,7 +203,7 @@ An exception is thrown if an invalid port specifier is provided. diff --git a/doc/html/doxygen.css b/doc/html/doxygen.css index 0ce7521..8cb8b2e 100644 --- a/doc/html/doxygen.css +++ b/doc/html/doxygen.css @@ -1,212 +1,49 @@ -H1 { - text-align: center; - font-family: Arial, Helvetica, sans-serif; -} -H2 { - font-family: Geneva, Arial, Helvetica, sans-serif; -} +H1 { text-align: center; } CAPTION { font-weight: bold } -DIV.qindex { - width: 100%; - background-color: #eeeeff; - border: 1px solid #B0B0B0; - text-align: center; - margin: 2px; - padding: 2px; -} -A.qindex { - text-decoration: none; - font-weight: bold; - color: #1A419D; - padding: 2px; -} -A.qindex:visited { - text-decoration: none; - font-weight: bold; - color: #1A419D - padding: 2px; -} -A.qindex:hover { - text-decoration: none; - background-color: #ddddff; - padding: 2px; -} -A.qindexHL { - text-decoration: none; - font-weight: bold; - background-color: #6666cc; - color: #ffffff; - padding: 2 6px; - border: 1px double #9295C2; - } -A.qindexHL:hover { - text-decoration: none; - background-color: #6666cc; - color: #ffffff; - padding: 2px 6px; -} -A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } +A.qindex {} +A.qindexRef {} A.el { text-decoration: none; font-weight: bold } A.elRef { font-weight: bold } -A.code { text-decoration: none; font-weight: normal; color: #1A419D} -A.codeRef { font-weight: normal; color: #1A419D} +A.code { text-decoration: none; font-weight: normal; color: #4444ee } +A.codeRef { font-weight: normal; color: #4444ee } A:hover { text-decoration: none; background-color: #f2f2ff } DL.el { margin-left: -1cm } -PRE.fragment { - border: 1px solid #CCCCCC; - background-color: #f5f5f5; - margin-top: 4px; - margin-bottom: 4px; - margin-left: 2px; - margin-right: 8px; - padding-left: 6px; - padding-right: 6px; - padding-top: 4px; - padding-bottom: 4px; -} -DIV.fragment { - border: 1px solid #CCCCCC; - background-color: #f5f5f5; - padding: 6px; -} +DIV.fragment { width: 100%; border: none; background-color: #eeeeee } DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } -TD.md { background-color: #F4F4FB; font-weight: bold; } -TD.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; } -TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; } +TD.md { background-color: #f2f2ff; font-weight: bold; } +TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; } +TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; } DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold } DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller } -BODY { - background: white; - color: black; - margin-right: 20px; - margin-left: 20px; -} -TD.indexkey { - background-color: #eeeeff; - font-weight: bold; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -TD.indexvalue { - background-color: #eeeeff; - font-style: italic; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -TR.memlist { - background-color: #f0f0f0; -} -P.formulaDsp { text-align: center; } -IMG.formulaDsp { } -IMG.formulaInl { vertical-align: middle; } -SPAN.keyword { color: #008000 } -SPAN.keywordtype { color: #604020 } -SPAN.keywordflow { color: #e08000 } -SPAN.comment { color: #800000 } -SPAN.preprocessor { color: #806020 } -SPAN.stringliteral { color: #002080 } -SPAN.charliteral { color: #008080 } -.mdTable { - border: 1px solid #868686; - background-color: #F4F4FB; -} -.mdRow { - padding: 8px 10px; -} -.mdescLeft { - font-size: smaller; - font-family: Arial, Helvetica, sans-serif; - background-color: #FAFAFA; - padding-left: 8px; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; -} -.mdescRight { - font-size: smaller; - font-family: Arial, Helvetica, sans-serif; - font-style: italic; - background-color: #FAFAFA; - padding-left: 4px; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; - padding-bottom: 0px; - padding-right: 8px; -} -.memItemLeft { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-family: Geneva, Arial, Helvetica, sans-serif; - font-size: 12px; -} -.memItemRight { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-family: Geneva, Arial, Helvetica, sans-serif; - font-size: 13px; -} -.search { color: #003399; - font-weight: bold; -} -FORM.search { - margin-bottom: 0px; - margin-top: 0px; -} -INPUT.search { font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #eeeeff; -} -TD.tiny { font-size: 75%; -} -a { - color: #252E78; -} -a:visited { - color: #3D2185; -} +BODY { background: white; color: black } +TD.indexkey { + background-color: #eeeeff; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px +} +TD.indexvalue { + background-color: #eeeeff; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px +} +span.keyword { color: #008000 } +span.keywordtype { color: #604020 } +span.keywordflow { color: #e08000 } +span.comment { color: #800000 } +span.preprocessor { color: #806020 } +span.stringliteral { color: #002080 } +span.charliteral { color: #008080 } diff --git a/doc/html/doxygen.png b/doc/html/doxygen.png index 9da55f9..96ae72c 100644 Binary files a/doc/html/doxygen.png and b/doc/html/doxygen.png differ diff --git a/doc/html/files.html b/doc/html/files.html index 0c11128..7be5c13 100644 --- a/doc/html/files.html +++ b/doc/html/files.html @@ -7,7 +7,7 @@
Tutorial   Class/Enum List   File List   Compound Members  

- +

RtMidi File List

Here is a list of all documented files with brief descriptions:
void RtMidiOut::sendMessage std::vector< unsigned char > *  message  )   message

-Immediately send a single message out an open MIDI output port. +Immediately send a single message out an open MIDI output port.

An exception is thrown if an error occurs during output or an output connection was not previously established.

diff --git a/doc/html/functions.html b/doc/html/functions.html index 116c8a9..e26ca3d 100644 --- a/doc/html/functions.html +++ b/doc/html/functions.html @@ -7,30 +7,27 @@
Tutorial   Class/Enum List   File List   Compound Members  

- - - -

-Here is a list of all documented class members with links to the class documentation for each member:

    + +

    RtMidi Compound Members

    Here is a list of all documented class members with links to the class documentation for each member: diff --git a/doc/html/hierarchy.html b/doc/html/hierarchy.html index 818124a..548d919 100644 --- a/doc/html/hierarchy.html +++ b/doc/html/hierarchy.html @@ -7,7 +7,7 @@
    Tutorial   Class/Enum List   File List   Compound Members  

    - +

    RtMidi Class Hierarchy

    This inheritance list is sorted roughly, but not completely, alphabetically:
    • RtError
    • RtMidi diff --git a/doc/html/index.html b/doc/html/index.html index 132d499..cc0f2d3 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -7,11 +7,11 @@
      Tutorial   Class/Enum List   File List   Compound Members  

      - -

      The RtMidi Tutorial

      + +

      The RtMidi Tutorial

      -

      Introduction    Download    Getting Started    Error Handling    Probing Ports    MIDI Output    MIDI Input    Virtual Ports    Compiling    Debugging    API Notes    License

      -Introduction

      +
      Introduction    Download    Getting Started    Error Handling    Probing Ports    MIDI Output    MIDI Input    Virtual Ports    Compiling    Debugging    API Notes    License

      +Introduction

      RtMidi is a set of C++ classes (RtMidiIn and RtMidiOut) which provide a common API (Application Programming Interface) for realtime MIDI input/output across Linux (ALSA), Macintosh OS X, SGI, and Windows (Multimedia Library) operating systems. RtMidi significantly simplifies the process of interacting with computer MIDI hardware and software. It was designed with the following goals:

      • @@ -24,12 +24,14 @@ only two header files and one source file for easy inclusion in programming proj MIDI device enumeration

      -MIDI input and output functionality are separated into two classes, RtMidiIn and RtMidiOut. Each class instance supports only a single MIDI connection. RtMidi does not provide timing functionality (i.e., output messages are sent immediately). Input messages are timestamped with delta times in seconds (via a double floating point type). MIDI data is passed to the user as raw bytes using an std::vector<unsigned char>.

      -Download

      -Latest Release (21 September 2004): Version 1.0.2 (111 kB tar/gzipped)

      -Getting Started

      -The first thing that must be done when using RtMidi is to create an instance of the RtMidiIn or RtMidiOut subclasses. RtMidi is an abstract base class, which itself cannot be instantiated. Each default constructor attempts to establish any necessary "connections" with the underlying MIDI system. RtMidi uses C++ exceptions to report errors, necessitating try/catch blocks around many member functions. An RtError can be thrown during instantiation in some circumstances. A warning message may also be reported if no MIDI devices are found during instantiation. The RtMidi classes have been designed to work with "hot pluggable" or virtual (software) MIDI devices, making it is possible to connect or start MIDI devices after the classes have been instantiated. The following code example demonstrates default object construction and destruction:

      -

      #include "RtMidi.h" +MIDI input and output functionality are separated into two classes, RtMidiIn and RtMidiOut. Each class instance supports only a single MIDI connection. RtMidi does not provide timing functionality (i.e., output messages are sent immediately). Input messages are timestamped with delta times in seconds (via a double floating point type). MIDI data is passed to the user as raw bytes using an std::vector<unsigned char>.

      +Download

      +Latest Release (22 November 2004): Version 1.0.3

      +Getting Started

      +The first thing that must be done when using RtMidi is to create an instance of the RtMidiIn or RtMidiOut subclasses. RtMidi is an abstract base class, which itself cannot be instantiated. Each default constructor attempts to establish any necessary "connections" with the underlying MIDI system. RtMidi uses C++ exceptions to report errors, necessitating try/catch blocks around many member functions. An RtError can be thrown during instantiation in some circumstances. A warning message may also be reported if no MIDI devices are found during instantiation. The RtMidi classes have been designed to work with "hot pluggable" or virtual (software) MIDI devices, making it possible to connect to MIDI devices that may not have been present when the classes were instantiated. The following code example demonstrates default object construction and destruction:

      +

      +
      +#include "RtMidi.h"
       
       int main()
       {
      @@ -47,13 +49,14 @@ The first thing that must be done when using // Clean up
         delete midiin;
       }
      -

      -Obviously, this example doesn't demonstrate any of the real functionality of RtMidi. However, all uses of RtMidi must begin with construction and must end with class destruction. Further, it is necessary that all class methods which can throw a C++ exception be called within a try/catch block.

      -Error Handling

      -RtMidi uses a C++ exception handler called RtError, which is declared and defined in RtError.h. The RtError class is quite simple but it does allow errors to be "caught" by RtError::Type. Many RtMidi methods can "throw" an RtError, most typically if a driver error occurs or an invalid function argument is specified. There are a number of cases within RtMidi where warning messages may be displayed but an exception is not thrown. There is a protected RtMidi method, error(), which can be modified to globally control how these messages are handled and reported. By default, error messages are not automatically displayed in RtMidi unless the preprocessor definition __RTMIDI_DEBUG__ is defined. Messages associated with caught exceptions can be displayed with, for example, the RtError::printMessage() function.

      -Probing Ports

      +

      +Obviously, this example doesn't demonstrate any of the real functionality of RtMidi. However, all uses of RtMidi must begin with construction and must end with class destruction. Further, it is necessary that all class methods which can throw a C++ exception be called within a try/catch block.

      +Error Handling

      +RtMidi uses a C++ exception handler called RtError, which is declared and defined in RtError.h. The RtError class is quite simple but it does allow errors to be "caught" by RtError::Type. Many RtMidi methods can "throw" an RtError, most typically if a driver error occurs or an invalid function argument is specified. There are a number of cases within RtMidi where warning messages may be displayed but an exception is not thrown. There is a protected RtMidi method, error(), which can be modified to globally control how these messages are handled and reported. By default, error messages are not automatically displayed in RtMidi unless the preprocessor definition __RTMIDI_DEBUG__ is defined. Messages associated with caught exceptions can be displayed with, for example, the RtError::printMessage() function.

      +Probing Ports

      A programmer may wish to query the available MIDI ports before deciding which to use. The following example outlines how this can be done.

      -

      // midiinfo.cpp +
      +// midiinfo.cpp
       
       #include <iostream>
       #include "RtMidi.h"
      @@ -118,11 +121,12 @@ A programmer may wish to query the available MIDI ports before deciding which to
       
         return 0;
       }
      -

      -MIDI Output

      +

      +MIDI Output

      The RtMidiOut class provides simple functionality to immediately send messages over a MIDI connection. No timing functionality is provided.

      In the following example, we omit necessary error checking and details regarding OS-dependent sleep functions. For a complete example, see the midiout.cpp program in the tests directory.

      -

      // midiout.cpp +
      +// midiout.cpp
       
       #include <iostream>
       #include "RtMidi.h"
      @@ -175,14 +179,15 @@ In the following example, we omit necessary error checking and details regarding
       
         return 0;
       }
      -

      -MIDI Input

      +

      +MIDI Input

      The RtMidiIn class uses an internal callback function or thread to receive incoming MIDI messages from a port or device. These messages are then either queued and read by the user via calls to the RtMidiIn::getMessage() function or immediately passed to a user-specified callback function (which must be "registered" using the RtMidiIn::setCallback() function). We'll provide examples of both usages.

      -The RtMidiIn class provides the RtMidiIn::ignoreTypes() function to specify that certain MIDI message types be ignored. By default, sysem exclusive, timing, and active sensing messages are ignored.

      -Queued MIDI Input

      -The RtMidiIn::getMessage() function does not block. If a MIDI message is available in the queue, it is copied to the user-provided std::vector<unsigned char> container. When no MIDI message is available, the function returns an empty container. The default maximum MIDI queue size is 1024 messages. This value may be modified with the RtMidiIn::setQueueSizeLimit() function. If the maximum queue size limit is reached, subsequent MIDI messages are discarded until the queue size is reduced.

      +The RtMidiIn class provides the RtMidiIn::ignoreTypes() function to specify that certain MIDI message types be ignored. By default, sysem exclusive, timing, and active sensing messages are ignored.

      +Queued MIDI Input

      +The RtMidiIn::getMessage() function does not block. If a MIDI message is available in the queue, it is copied to the user-provided std::vector<unsigned char> container. When no MIDI message is available, the function returns an empty container. The default maximum MIDI queue size is 1024 messages. This value may be modified with the RtMidiIn::setQueueSizeLimit() function. If the maximum queue size limit is reached, subsequent incoming MIDI messages are discarded until the queue size is reduced.

      In the following example, we omit some necessary error checking and details regarding OS-dependent sleep functions. For a more complete example, see the qmidiin.cpp program in the tests directory.

      -

      // qmidiin.cpp +
      +// qmidiin.cpp
       
       #include <iostream>
       #include <signal.h>
      @@ -211,7 +216,7 @@ In the following example, we omit some necessary error checking and details rega
       
         // Install an interrupt handler function.
         done = false;
      -  (void) signal(SIGINT, finish);
      +  (void) signal(SIGINT, finish);
       
         // Periodically check input queue.
         std::cout << "Reading MIDI from port ... quit with Ctrl-C.\n";
      @@ -219,7 +224,7 @@ In the following example, we omit some necessary error checking and details rega
           stamp = midiin->getMessage( &message );
           nBytes = message.size();
           for ( i=0; i<nBytes; i++ )
      -      std::cout << "Byte " << i << " = " << (int)message[i] << ", ";
      +      std::cout << "Byte " << i << " = " << (int)message[i] << ", ";
           if ( nBytes > 0 )
             std::cout << "stamp = " << stamp << '\n';
       
      @@ -233,11 +238,12 @@ In the following example, we omit some necessary error checking and details rega
       
         return 0;
       }
      -

      -MIDI Input with User Callback

      +

      +MIDI Input with User Callback

      When set, a user-provided callback function will be invoked after the input of a complete MIDI message. It is possible to provide a pointer to user data which can be accessed in the callback function (not shown here). It is necessary to set the callback function immediately after opening the port to avoid having incoming messages written to the queue (which is not emptied when a callback function is set). If you are worried about this happening, you can check the queue using the RtMidi::getMessage() function to verify it is empty (after the callback function is set).

      In the following example, we omit some necessary error checking. For a more complete example, see the cmidiin.cpp program in the tests directory.

      -

      // cmidiin.cpp +
      +// cmidiin.cpp
       
       #include <iostream>
       #include "RtMidi.h"
      @@ -246,7 +252,7 @@ In the following example, we omit some necessary error checking. For a more comp
       {
         unsigned int nBytes = message->size();
         for ( unsigned int i=0; i<nBytes; i++ )
      -    std::cout << "Byte " << i << " = " << (int)message->at(i) << ", ";
      +    std::cout << "Byte " << i << " = " << (int)message->at(i) << ", ";
         if ( nBytes > 0 )
           std::cout << "stamp = " << deltatime << '\n';
       }
      @@ -282,10 +288,10 @@ In the following example, we omit some necessary error checking. For a more comp
       
         return 0;
       }
      -

      -Virtual Ports

      -The Linux ALSA and Macintosh CoreMIDI APIs allow for the establishment of virtual input and output MIDI ports to which other software clients can connect. RtMidi incorporates this functionality with the RtMidiIn::openVirtualPort() and RtMidiOut::openVirtualPort() functions. Any messages sent with the RtMidiOut::sendMessage() function will also be transmitted through an open virtual output port. If a virtual input port is open and a user callback function is set, the callback function will be invoked when messages arrive via that port. If a callback function is not set, the user must poll the input queue to check whether messages have arrived. No notification is provided for the establishment of a client connection via a virtual port.

      -Compiling

      +

      +Virtual Ports

      +The Linux ALSA and Macintosh CoreMIDI APIs allow for the establishment of virtual input and output MIDI ports to which other software clients can connect. RtMidi incorporates this functionality with the RtMidiIn::openVirtualPort() and RtMidiOut::openVirtualPort() functions. Any messages sent with the RtMidiOut::sendMessage() function will also be transmitted through an open virtual output port. If a virtual input port is open and a user callback function is set, the callback function will be invoked when messages arrive via that port. If a callback function is not set, the user must poll the input queue to check whether messages have arrived. No notification is provided for the establishment of a client connection via a virtual port.

      +Compiling

      In order to compile RtMidi for a specific OS and API, it is necessary to supply the appropriate preprocessor definition and library within the compiler statement:

RtError.h [code]
RtMidi.h [code]
@@ -300,26 +306,26 @@ In order to compile RtMidi for a speci
Windows Multimedia Library __WINDOWS_MM__ winmm.lib, multithreaded compiler specific

-The example compiler statements above could be used to compile the probe.cpp example file, assuming that midiinfo.cpp, RtMidi.h, RtError.h, and RtMidi.cpp all exist in the same directory.

-Debugging

-If you are having problems getting RtMidi to run on your system, try passing the preprocessor definition __RTMIDI_DEBUG__ to the compiler (or uncomment the definition at the bottom of RtMidi.h). A variety of warning messages will be displayed which may help in determining the problem. Also try using the programs included in the test directory. The program midiinfo displays the queried capabilities of all MIDI ports found.

-API Notes

-RtMidi is designed to provide a common API across the various supported operating systems and audio libraries. Despite that, some issues should be mentioned with regard to each.

-Linux:

-RtMidi for Linux was developed using the Fedora distribution. A decision was made to not include support for the OSS API because the OSS API provides such limited functionality and because ALSA support is now incorporated in the Linux kernel. RtMidi uses the ALSA sequencer API, which allows for virtual software input and output ports.

-Macintosh OS X (CoreAudio):

-The Apple CoreMidi API allows for the establishment of virtual input and output ports to which other software applications can connect.

-Irix (SGI):

-The Irix version of RtMidi was written and tested on an SGI Indy running Irix version 6.5.4 and the MD audio library.

-Windows (Multimedia Library):

-The Windows Multimedia library MIDI calls used in RtMidi do not make use of streaming functionality. RtMidi was originally developed with Visual C++ version 6.0.

-License

+The example compiler statements above could be used to compile the probe.cpp example file, assuming that midiinfo.cpp, RtMidi.h, RtError.h, and RtMidi.cpp all exist in the same directory.

+Debugging

+If you are having problems getting RtMidi to run on your system, try passing the preprocessor definition __RTMIDI_DEBUG__ to the compiler (or uncomment the definition at the bottom of RtMidi.h). A variety of warning messages will be displayed which may help in determining the problem. Also try using the programs included in the test directory. The program midiinfo displays the queried capabilities of all MIDI ports found.

+API Notes

+RtMidi is designed to provide a common API across the various supported operating systems and audio libraries. Despite that, some issues should be mentioned with regard to each.

+Linux:

+RtMidi for Linux was developed using the Fedora distribution. A decision was made to not include support for the OSS API because the OSS API provides such limited functionality and because ALSA support is now incorporated in the Linux kernel. RtMidi uses the ALSA sequencer API, which allows for virtual software input and output ports.

+Macintosh OS X (CoreAudio):

+The Apple CoreMidi API allows for the establishment of virtual input and output ports to which other software applications can connect.

+Irix (SGI):

+The Irix version of RtMidi was written and tested on an SGI Indy running Irix version 6.5.4 and the MD audio library.

+Windows (Multimedia Library):

+The Windows Multimedia library MIDI calls used in RtMidi do not make use of streaming functionality. RtMidi was originally developed with Visual C++ version 6.0.

+License

RtMidi: realtime MIDI i/o C++ classes
Copyright (c) 2003-2004 Gary P. Scavone

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Any person wishing to distribute modifications to the Software is requested to send the modifications to the original developer so that they can be incorporated into the canonical version.

-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
©2003-2004 Gary P. Scavone, McGill University. All Rights Reserved.
-- cgit v1.2.3