From 629f7701612fa78272ba8d5ad0b6c9582ed8b831 Mon Sep 17 00:00:00 2001 From: Gary Scavone Date: Fri, 11 Oct 2013 15:08:05 +0200 Subject: Release 1.0.1 tarball --- configure | 2 +- doc/html/RtError_8h-source.html | 8 +- doc/html/RtMidi_8h-source.html | 8 +- doc/html/annotated.html | 12 +- doc/html/classRtError-members.html | 14 +- doc/html/classRtError.html | 48 +-- doc/html/classRtMidi-members.html | 2 +- doc/html/classRtMidi.html | 6 +- doc/html/classRtMidiIn-members.html | 28 +- doc/html/classRtMidiIn.html | 197 ++++++------ doc/html/classRtMidiOut-members.html | 18 +- doc/html/classRtMidiOut.html | 112 +++---- doc/html/doxygen.css | 245 ++++++++++++--- doc/html/doxygen.png | Bin 2352 -> 1576 bytes doc/html/files.html | 2 +- doc/html/functions.html | 11 +- doc/html/functions_enum.html | 25 ++ doc/html/functions_func.html | 43 +++ doc/html/functions_type.html | 25 ++ doc/html/hierarchy.html | 2 +- doc/html/index.html | 104 +++---- doxygen/html/MidiFileIn_8cpp-source.html | 350 ---------------------- doxygen/html/MidiFileIn_8h-source.html | 93 ------ doxygen/html/RtError_8h-source.html | 63 ---- doxygen/html/RtMidi_8cpp-source.html | 482 ------------------------------ doxygen/html/RtMidi_8h-source.html | 145 --------- doxygen/html/Stk_8cpp-source.html | 128 -------- doxygen/html/Stk_8h-source.html | 162 ---------- doxygen/html/annotated.html | 29 -- doxygen/html/classMidiFileIn-members.html | 44 --- doxygen/html/classMidiFileIn.html | 296 ------------------ doxygen/html/classMidiFileIn.png | Bin 307 -> 0 bytes doxygen/html/classRtError-members.html | 27 -- doxygen/html/classRtError.html | 56 ---- doxygen/html/classRtMidi-members.html | 21 -- doxygen/html/classRtMidi.html | 44 --- doxygen/html/classRtMidi.png | Bin 412 -> 0 bytes doxygen/html/classRtMidiIn-members.html | 32 -- doxygen/html/classRtMidiIn.html | 281 ----------------- doxygen/html/classRtMidiIn.png | Bin 300 -> 0 bytes doxygen/html/classRtMidiOut-members.html | 29 -- doxygen/html/classRtMidiOut.html | 166 ---------- doxygen/html/classRtMidiOut.png | Bin 317 -> 0 bytes doxygen/html/classStk-members.html | 35 --- doxygen/html/classStk.html | 232 -------------- doxygen/html/classStk.png | Bin 313 -> 0 bytes doxygen/html/classStkError-members.html | 26 -- doxygen/html/classStkError.html | 53 ---- doxygen/html/doxygen.css | 49 --- doxygen/html/doxygen.png | Bin 2352 -> 0 bytes doxygen/html/files.html | 32 -- doxygen/html/functions.html | 65 ---- doxygen/html/hierarchy.html | 33 -- doxygen/html/index.html | 24 -- doxygen/html/midiin_8cpp-source.html | 83 ----- doxygen/html/miditime_8cpp-source.html | 93 ------ doxygen/html/newRtMidi_8h-source.html | 148 --------- doxygen/html/oldRtMidi_8cpp-source.html | 385 ------------------------ doxygen/html/oldRtMidi_8h-source.html | 163 ---------- doxygen/html/playsmf_8cpp-source.html | 117 -------- 60 files changed, 596 insertions(+), 4302 deletions(-) create mode 100644 doc/html/functions_enum.html create mode 100644 doc/html/functions_func.html create mode 100644 doc/html/functions_type.html delete mode 100755 doxygen/html/MidiFileIn_8cpp-source.html delete mode 100755 doxygen/html/MidiFileIn_8h-source.html delete mode 100755 doxygen/html/RtError_8h-source.html delete mode 100755 doxygen/html/RtMidi_8cpp-source.html delete mode 100755 doxygen/html/RtMidi_8h-source.html delete mode 100755 doxygen/html/Stk_8cpp-source.html delete mode 100755 doxygen/html/Stk_8h-source.html delete mode 100755 doxygen/html/annotated.html delete mode 100755 doxygen/html/classMidiFileIn-members.html delete mode 100755 doxygen/html/classMidiFileIn.html delete mode 100755 doxygen/html/classMidiFileIn.png delete mode 100755 doxygen/html/classRtError-members.html delete mode 100755 doxygen/html/classRtError.html delete mode 100755 doxygen/html/classRtMidi-members.html delete mode 100755 doxygen/html/classRtMidi.html delete mode 100755 doxygen/html/classRtMidi.png delete mode 100755 doxygen/html/classRtMidiIn-members.html delete mode 100755 doxygen/html/classRtMidiIn.html delete mode 100755 doxygen/html/classRtMidiIn.png delete mode 100755 doxygen/html/classRtMidiOut-members.html delete mode 100755 doxygen/html/classRtMidiOut.html delete mode 100755 doxygen/html/classRtMidiOut.png delete mode 100755 doxygen/html/classStk-members.html delete mode 100755 doxygen/html/classStk.html delete mode 100755 doxygen/html/classStk.png delete mode 100755 doxygen/html/classStkError-members.html delete mode 100755 doxygen/html/classStkError.html delete mode 100755 doxygen/html/doxygen.css delete mode 100755 doxygen/html/doxygen.png delete mode 100755 doxygen/html/files.html delete mode 100755 doxygen/html/functions.html delete mode 100755 doxygen/html/hierarchy.html delete mode 100755 doxygen/html/index.html delete mode 100755 doxygen/html/midiin_8cpp-source.html delete mode 100755 doxygen/html/miditime_8cpp-source.html delete mode 100755 doxygen/html/newRtMidi_8h-source.html delete mode 100755 doxygen/html/oldRtMidi_8cpp-source.html delete mode 100755 doxygen/html/oldRtMidi_8h-source.html delete mode 100755 doxygen/html/playsmf_8cpp-source.html diff --git a/configure b/configure index dc53eae..de5e6ce 100755 --- a/configure +++ b/configure @@ -3311,7 +3311,7 @@ echo "$as_me:$LINENO: checking for MIDI API" >&5 echo $ECHO_N "checking for MIDI API... $ECHO_C" >&6 case $host in *-*-linux*) - midi_api=_D__LINUX_ALSA__ + midi_api=-D__LINUX_ALSASEQ__ echo "$as_me:$LINENO: checking for snd_seq_open in -lasound" >&5 diff --git a/doc/html/RtError_8h-source.html b/doc/html/RtError_8h-source.html index db0f4ce..4985841 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 9bda7a2..39be019 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.0, 17 September 2004
+00038 // RtMidi: Version 1.0.1, 20 September 2004
 00039 
 00040 #ifndef RTMIDI_H
 00041 #define RTMIDI_H
@@ -49,7 +49,7 @@
 00088 {
 00089  public:
 00090 
-00092   typedef void (*RtMidiCallback)( double timeStamp, std::vector<unsigned char> *message, void *userData);
+00092   typedef void (*RtMidiCallback)( double timeStamp, std::vector<unsigned char> *message, void *userData);
 00093 
 00095 
 00098   RtMidiIn();
@@ -63,7 +63,7 @@
 00117   void openVirtualPort();
 00118 
 00120 
-00126   void setCallback( RtMidiCallback callback, void *userData = 0 );
+00126   void setCallback( RtMidiCallback callback, void *userData = 0 );
 00127 
 00129 
 00133   void cancelCallback();
diff --git a/doc/html/annotated.html b/doc/html/annotated.html
index 3ad461c..677ed14 100644
--- a/doc/html/annotated.html
+++ b/doc/html/annotated.html
@@ -7,12 +7,12 @@
 
Tutorial   Class/Enum List   File List   Compound Members  

- -

RtMidi Compound List

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

RtMidi Class 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 f3bb904..c73c5a9 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 395a949..cbf8ee9 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,29 +16,35 @@ 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 18e99aa..a6b2f32 100644 --- a/doc/html/classRtMidi-members.html +++ b/doc/html/classRtMidi-members.html @@ -7,7 +7,7 @@
Tutorial   Class/Enum List   File List   Compound Members  

- +

RtMidi Member List

This is the complete list of members for RtMidi, including all inherited members.

diff --git a/doc/html/classRtMidi.html b/doc/html/classRtMidi.html index e7be341..1b78b92 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> @@ -23,7 +23,7 @@


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 f03b7c1..dab2552 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
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

diff --git a/doc/html/classRtMidiIn.html b/doc/html/classRtMidiIn.html index ced103b..4255030 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,55 +21,68 @@ 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

-

- +

+

-
+ - - + + @@ -85,23 +98,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

-

- +

+

-
+ - - + + @@ -117,23 +130,23 @@ 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.

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

- +

+

-
+ - - + + @@ -149,27 +162,27 @@ Implements RtMidi.
void RtMidiIn::openVirtualPort    ) 

-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).

-

- +

+

-
+ - - + + - + - + @@ -189,21 +202,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.

-

- +

+

-
+ - - + + @@ -219,22 +232,22 @@ 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.

-

- +

+

-
+ - - + + @@ -250,22 +263,22 @@ Subsequent incoming MIDI messages will be written to the queue and can be retrie
std::string RtMidiIn::getPortName unsigned int   portNumber = 0 portNumber = 0  ) 

-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.

-

- +

+

-
+ - - + + @@ -281,33 +294,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.

-

- +

+

-
+ - + - + - + - + - + @@ -327,22 +340,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.

-

- +

+

-
+ - - + + @@ -358,7 +371,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 451ad23..9416f1a 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
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

diff --git a/doc/html/classRtMidiOut.html b/doc/html/classRtMidiOut.html index 3c75b27..025e8a2 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,43 +21,51 @@ 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

-

- +

+

-
+ - - + + @@ -73,23 +81,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

-

- +

+

-
+ - - + + @@ -105,23 +113,23 @@ 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.

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

- +

+

-
+ - - + + @@ -137,22 +145,22 @@ Implements RtMidi.
void RtMidiOut::openVirtualPort    ) 

-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.

-

- +

+

-
+ - - + + @@ -168,22 +176,22 @@ This function creates a virtual MIDI output port to which other software applica
std::string RtMidiOut::getPortName unsigned int   portNumber portNumber  ) 

-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.

-

- +

+

-
+ - - + + @@ -199,7 +207,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 8cb8b2e..0ce7521 100644 --- a/doc/html/doxygen.css +++ b/doc/html/doxygen.css @@ -1,49 +1,212 @@ -H1 { text-align: center; } +H1 { + text-align: center; + font-family: Arial, Helvetica, sans-serif; +} +H2 { + font-family: Geneva, Arial, Helvetica, sans-serif; +} CAPTION { font-weight: bold } -A.qindex {} -A.qindexRef {} +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.el { text-decoration: none; font-weight: bold } A.elRef { font-weight: bold } -A.code { text-decoration: none; font-weight: normal; color: #4444ee } -A.codeRef { font-weight: normal; color: #4444ee } +A.code { text-decoration: none; font-weight: normal; color: #1A419D} +A.codeRef { font-weight: normal; color: #1A419D} A:hover { text-decoration: none; background-color: #f2f2ff } DL.el { margin-left: -1cm } -DIV.fragment { width: 100%; border: none; background-color: #eeeeee } +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.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } -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; } +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; } 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 } -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 } +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; +} diff --git a/doc/html/doxygen.png b/doc/html/doxygen.png index 96ae72c..9da55f9 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 7be5c13..0c11128 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 1195328..116c8a9 100644 --- a/doc/html/functions.html +++ b/doc/html/functions.html @@ -7,8 +7,11 @@
Tutorial   Class/Enum List   File List   Compound Members  

- -

RtMidi Compound Members

Here is a list of all documented class members with links to the class documentation for each member:
RtError.h [code]
RtMidi.h [code]
+ +
©2003-2004 Gary P. Scavone, McGill University. All Rights Reserved.
+ Maintained by Gary P. Scavone, gary at music.mcgill.ca
+ + + diff --git a/doc/html/functions_func.html b/doc/html/functions_func.html new file mode 100644 index 0000000..cc2ad93 --- /dev/null +++ b/doc/html/functions_func.html @@ -0,0 +1,43 @@ + + +The RtMidi Tutorial + + + +
+Tutorial   Class/Enum List   File List   Compound Members  
+
+ + + +

+

+
+ + + +
©2003-2004 Gary P. Scavone, McGill University. All Rights Reserved.
+ Maintained by Gary P. Scavone, gary at music.mcgill.ca
+ + + diff --git a/doc/html/functions_type.html b/doc/html/functions_type.html new file mode 100644 index 0000000..956c842 --- /dev/null +++ b/doc/html/functions_type.html @@ -0,0 +1,25 @@ + + +The RtMidi Tutorial + + + +
+Tutorial   Class/Enum List   File List   Compound Members  
+
+ + + +

+

+
+ + + +
©2003-2004 Gary P. Scavone, McGill University. All Rights Reserved.
+ Maintained by Gary P. Scavone, gary at music.mcgill.ca
+ + + diff --git a/doc/html/hierarchy.html b/doc/html/hierarchy.html index 548d919..818124a 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 5972b27..df11852 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,14 +24,12 @@ 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 (17 September 2004): Version 1.0.0 (154 kB tar/gzipped)

    -Getting Started

    +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 (20 September 2004): Version 1.0.1 (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"
    +
    #include "RtMidi.h" int main() { @@ -49,14 +47,13 @@ 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" @@ -121,12 +118,11 @@ 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" @@ -179,15 +175,14 @@ 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 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.

    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> @@ -216,7 +211,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"; @@ -224,7 +219,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'; @@ -238,12 +233,11 @@ 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" @@ -252,7 +246,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'; } @@ -288,16 +282,16 @@ 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:

    - + @@ -306,26 +300,26 @@ In order to compile RtMidi for a speci
    OS: Audio API: Preprocessor Definition: Library or Framework: Example Compiler Statement:
    Linux ALSA __LINUX_ALSA__ asound, pthread g++ -Wall -D__LINUX_ALSA__ -o midiinfo midiinfo.cpp RtMidi.cpp -lasound -lpthread
    Linux ALSA Sequencer __LINUX_ALSASEQ__ asound, pthread g++ -Wall -D__LINUX_ALSASEQ__ -o midiinfo midiinfo.cpp RtMidi.cpp -lasound -lpthread
    Macintosh OS X CoreAudio __MACOSX_CORE__ pthread, stdc++, CoreAudio g++ -Wall -D__MACOSX_CORE__ -o midiinfo midiinfo.cpp RtMidi.cpp -framework CoreMidi -lpthread
    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.
    diff --git a/doxygen/html/MidiFileIn_8cpp-source.html b/doxygen/html/MidiFileIn_8cpp-source.html deleted file mode 100755 index a7109dd..0000000 --- a/doxygen/html/MidiFileIn_8cpp-source.html +++ /dev/null @@ -1,350 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    MidiFileIn.cpp

    00001 /**********************************************************************/
    -00016 /**********************************************************************/
    -00017 
    -00018 #include "MidiFileIn.h"
    -00019 #include <iostream>
    -00020 
    -00021 MidiFileIn :: MidiFileIn( std::string fileName )
    -00022 {
    -00023   // Attempt to open the file.
    -00024   file_.open( fileName.c_str(), std::ios::in );
    -00025   if ( !file_ ) {
    -00026     errorString_ << "MidiFileIn: error opening or finding file (" <<  fileName << ").";
    -00027     handleError( errorString_.str(), StkError::FILE_NOT_FOUND );
    -00028   }
    -00029 
    -00030   // Parse header info.
    -00031   char chunkType[4];
    -00032   char buffer[4];
    -00033   SINT32 *length;
    -00034   if ( !file_.read( chunkType, 4 ) ) goto error;
    -00035   if ( !file_.read( buffer, 4 ) ) goto error;
    -00036   length = (SINT32 *) &buffer;
    -00037   if ( strncmp( chunkType, "MThd", 4 ) || ( *length != 6 ) ) {
    -00038     errorString_ << "MidiFileIn: file (" <<  fileName << ") does not appear to be a MIDI file!";
    -00039     handleError( errorString_.str(), StkError::FILE_UNKNOWN_FORMAT );
    -00040   }
    -00041 
    -00042   // Read the MIDI file format.
    -00043   SINT16 *data;
    -00044   if ( !file_.read( buffer, 2 ) ) goto error;
    -00045   data = (SINT16 *) &buffer;
    -00046   if ( *data < 0 || *data > 2 ) {
    -00047     errorString_ << "MidiFileIn: the file (" <<  fileName << ") format is invalid!";
    -00048     handleError( errorString_.str(), StkError::FILE_ERROR );
    -00049   }
    -00050   format_ = *data;
    -00051 
    -00052   // Read the number of tracks.
    -00053   if ( !file_.read( buffer, 2 ) ) goto error;
    -00054   if ( format_ == 0 && *data != 1 ) {
    -00055     errorString_ << "MidiFileIn: invalid number of tracks (>1) for a file format = 0!";
    -00056     handleError( errorString_.str(), StkError::FILE_ERROR );
    -00057   }
    -00058   nTracks_ = *data;
    -00059 
    -00060   // Read the beat division.
    -00061   if ( !file_.read( buffer, 2 ) ) goto error;
    -00062   division_ = (int) *data;
    -00063   double tickrate;
    -00064   usingTimeCode_ = false;
    -00065   if ( *data & 0x8000 ) {
    -00066     // Determine ticks per second from time-code formats.
    -00067     tickrate = (double) -(*data & 0x7F00);
    -00068     // If frames per second value is 29, it really should be 29.97.
    -00069     if ( tickrate == 29.0 ) tickrate = 29.97;
    -00070     tickrate *= (*data & 0x00FF);
    -00071     usingTimeCode_ = true;
    -00072   }
    -00073   else {
    -00074     tickrate = (double) (*data & 0x7FFF); // ticks per quarter note
    -00075   }
    -00076 
    -00077   // Now locate the track offsets and lengths.  If not using time
    -00078   // code, we can initialize the "tick time" using a default tempo of
    -00079   // 120 beats per minute.  We will then check for tempo meta-events
    -00080   // afterward.
    -00081   for ( unsigned int i=0; i<nTracks_; i++ ) {
    -00082     if ( !file_.read( chunkType, 4 ) ) goto error;
    -00083     if ( strncmp( chunkType, "MTrk", 4 ) ) goto error;
    -00084     if ( !file_.read( buffer, 4 ) ) goto error;
    -00085     length = (SINT32 *) &buffer;
    -00086     trackLengths_.push_back( *length );
    -00087     trackOffsets_.push_back( file_.tellg() );
    -00088     trackPointers_.push_back( file_.tellg() );
    -00089     trackStatus_.push_back( 0 );
    -00090     file_.seekg( *length, std::ios_base::cur );
    -00091     if ( usingTimeCode_ ) tickSeconds_.push_back( (double) (1.0 / tickrate) );
    -00092     else tickSeconds_.push_back( (double) (0.5 / tickrate) );
    -00093   }
    -00094 
    -00095   // Save the initial tickSeconds parameter.
    -00096   TempoChange tempoEvent;
    -00097   tempoEvent.count = 0;
    -00098   tempoEvent.tickSeconds = tickSeconds_[0];
    -00099   tempoEvents_.push_back( tempoEvent );
    -00100 
    -00101   // If format 1 and not using time code, parse and save the tempo map
    -00102   // on track 0.
    -00103   if ( format_ == 1 && !usingTimeCode_ ) {
    -00104     std::vector<unsigned char> event;
    -00105     unsigned long value, count;
    -00106 
    -00107     // We need to temporarily change the usingTimeCode_ value here so
    -00108     // that the getNextEvent() function doesn't try to check the tempo
    -00109     // map (which we're creating here).
    -00110     usingTimeCode_ = true;
    -00111     count = getNextEvent( &event, 0 );
    -00112     while ( event.size() ) {
    -00113       if ( ( event.size() == 6 ) && ( event[0] == 0xff ) &&
    -00114            ( event[1] == 0x51 ) && ( event[2] == 0x03 ) ) {
    -00115         tempoEvent.count = count;
    -00116         value = ( event[3] << 16 ) + ( event[4] << 8 ) + event[5];
    -00117         tempoEvent.tickSeconds = (double) (0.000001 * value / tickrate);
    -00118         if ( count > tempoEvents_.back().count )
    -00119           tempoEvents_.push_back( tempoEvent );
    -00120         else
    -00121           tempoEvents_.back() = tempoEvent;
    -00122       }
    -00123       count += getNextEvent( &event, 0 );
    -00124     }
    -00125     rewindTrack( 0 );
    -00126     for ( unsigned int i=0; i<nTracks_; i++ ) {
    -00127       trackCounters_.push_back( 0 );
    -00128       trackTempoIndex_.push_back( 0 );
    -00129     }
    -00130     // Change the time code flag back!
    -00131     usingTimeCode_ = false;
    -00132   }
    -00133 
    -00134   return;
    -00135 
    -00136  error:
    -00137   errorString_ << "MidiFileIn: error reading from file (" <<  fileName << ").";
    -00138   handleError( errorString_.str(), StkError::FILE_ERROR );
    -00139 }
    -00140 
    -00141 MidiFileIn :: ~MidiFileIn()
    -00142 {
    -00143   // An ifstream object implicitly closes itself during destruction
    -00144   // but we'll make an explicit call to "close" anyway.
    -00145   file_.close(); 
    -00146 }
    -00147 
    -00148 int MidiFileIn :: getFileFormat() const
    -00149 {
    -00150   return format_;
    -00151 }
    -00152 
    -00153 unsigned int MidiFileIn :: getNumberOfTracks() const
    -00154 {
    -00155   return nTracks_;
    -00156 }
    -00157 
    -00158 int MidiFileIn :: getDivision() const
    -00159 {
    -00160   return division_;
    -00161 }
    -00162 
    -00163 void MidiFileIn :: rewindTrack( unsigned int track )
    -00164 {
    -00165   if ( track >= nTracks_ ) {
    -00166     errorString_ << "MidiFileIn::getNextEvent: invalid track argument (" <<  track << ").";
    -00167     handleError( errorString_.str(), StkError::FUNCTION_ARGUMENT );
    -00168   }
    -00169 
    -00170   trackPointers_[track] = trackOffsets_[track];
    -00171   trackStatus_[track] = 0;
    -00172   tickSeconds_[track] = tempoEvents_[0].tickSeconds;
    -00173 }
    -00174 
    -00175 double MidiFileIn :: getTickSeconds( unsigned int track )
    -00176 {
    -00177   // Return the current tick value in seconds for the given track.
    -00178   if ( track >= nTracks_ ) {
    -00179     errorString_ << "MidiFileIn::getTickSeconds: invalid track argument (" <<  track << ").";
    -00180     handleError( errorString_.str(), StkError::FUNCTION_ARGUMENT );
    -00181   }
    -00182 
    -00183   return tickSeconds_[track];
    -00184 }
    -00185 
    -00186 unsigned long MidiFileIn :: getNextEvent( std::vector<unsigned char> *event, unsigned int track )
    -00187 {
    -00188   // Fill the user-provided vector with the next event in the
    -00189   // specified track (default = 0) and return the event delta time in
    -00190   // ticks.  This function assumes that the stored track pointer is
    -00191   // positioned at the start of a track event.  If the track has
    -00192   // reached its end, the event vector size will be zero.
    -00193   //
    -00194   // If we have a format 0 or 2 file and we're not using timecode, we
    -00195   // should check every meta-event for tempo changes and make
    -00196   // appropriate updates to the tickSeconds_ parameter if so.
    -00197   //
    -00198   // If we have a format 1 file and we're not using timecode, keep a
    -00199   // running sum of ticks for each track and update the tickSeconds_
    -00200   // parameter as needed based on the stored tempo map.
    -00201 
    -00202   if ( track >= nTracks_ ) {
    -00203     errorString_ << "MidiFileIn::getNextEvent: invalid track argument (" <<  track << ").";
    -00204     handleError( errorString_.str(), StkError::FUNCTION_ARGUMENT );
    -00205   }
    -00206 
    -00207   event->clear();
    -00208   // Check for the end of the track.
    -00209   if ( (trackPointers_[track] - trackOffsets_[track]) >= trackLengths_[track] )
    -00210     return 0;
    -00211 
    -00212   unsigned long ticks = 0, bytes = 0;
    -00213   bool isTempoEvent = false;
    -00214 
    -00215   // Read the event delta time.
    -00216   file_.seekg( trackPointers_[track], std::ios_base::beg );
    -00217   if ( !readVariableLength( &ticks ) ) goto error;
    -00218 
    -00219   // Parse the event stream to determine the event length.
    -00220   unsigned char c;
    -00221   if ( !file_.read( (char *)&c, 1 ) ) goto error;
    -00222   switch ( c ) {
    -00223 
    -00224   case 0xFF: // A Meta-Event
    -00225     unsigned long position;
    -00226     trackStatus_[track] = 0;
    -00227     event->push_back( c );
    -00228     if ( !file_.read( (char *)&c, 1 ) ) goto error;
    -00229     event->push_back( c );
    -00230     if ( format_ != 1 && ( c == 0x51 ) ) isTempoEvent = true;
    -00231     position = file_.tellg();
    -00232     if ( !readVariableLength( &bytes ) ) goto error;
    -00233     bytes += ( (unsigned long)file_.tellg() - position );
    -00234     file_.seekg( position, std::ios_base::beg );
    -00235     break;
    -00236 
    -00237   case 0xF0 || 0xF7: // The start or continuation of a Sysex event
    -00238     trackStatus_[track] = 0;
    -00239     event->push_back( c );
    -00240     position = file_.tellg();
    -00241     if ( !readVariableLength( &bytes ) ) goto error;
    -00242     bytes += ( (unsigned long)file_.tellg() - position );
    -00243     file_.seekg( position, std::ios_base::beg );
    -00244     break;
    -00245 
    -00246   default: // Should be a MIDI channel event
    -00247     if ( c & 0x80 ) { // MIDI status byte
    -00248       if ( c > 0xF0 ) goto error;
    -00249       trackStatus_[track] = c;
    -00250       event->push_back( c );
    -00251       c &= 0xF0;
    -00252       if ( (c == 0xC0) || (c == 0xD0) ) bytes = 1;
    -00253       else bytes = 2;
    -00254     }
    -00255     else if ( trackStatus_[track] & 0x80 ) { // Running status
    -00256       event->push_back( trackStatus_[track] );
    -00257       event->push_back( c );
    -00258       c = trackStatus_[track] & 0xF0;
    -00259       if ( (c != 0xC0) && (c != 0xD0) ) bytes = 1;
    -00260     }
    -00261     else goto error;
    -00262 
    -00263   }
    -00264 
    -00265   // Read the rest of the event into the event vector.
    -00266   for ( unsigned long i=0; i<bytes; i++ ) {
    -00267     if ( !file_.read( (char *)&c, 1 ) ) goto error;
    -00268     event->push_back( c );
    -00269   }
    -00270 
    -00271   if ( !usingTimeCode_ ) {
    -00272     if ( isTempoEvent ) {
    -00273       // Parse the tempo event and update tickSeconds_[track].
    -00274       double tickrate = (double) (division_ & 0x7FFF);
    -00275       unsigned long value = ( event->at(3) << 16 ) + ( event->at(4) << 8 ) + event->at(5);
    -00276       tickSeconds_[track] = (double) (0.000001 * value / tickrate);
    -00277     }
    -00278 
    -00279     if ( format_ == 1 ) {
    -00280       // Update track counter and check the tempo map.
    -00281       trackCounters_[track] += ticks;
    -00282       TempoChange tempoEvent = tempoEvents_[ trackTempoIndex_[track] ];
    -00283       if ( trackCounters_[track] >= tempoEvent.count ) {
    -00284         trackTempoIndex_[track]++;
    -00285         tickSeconds_[track] = tempoEvent.tickSeconds;
    -00286       }
    -00287     }
    -00288   }
    -00289 
    -00290   // Save the current track pointer value.
    -00291   trackPointers_[track] = file_.tellg();
    -00292 
    -00293   return ticks;
    -00294 
    -00295  error:
    -00296   errorString_ << "MidiFileIn::getNextEvent: file read error!";
    -00297   handleError( errorString_.str(), StkError::FILE_ERROR );
    -00298   return 0;
    -00299 }
    -00300 
    -00301 unsigned long MidiFileIn :: getNextMidiEvent( std::vector<unsigned char> *midiEvent, unsigned int track )
    -00302 {
    -00303   // Fill the user-provided vector with the next MIDI event in the
    -00304   // specified track (default = 0) and return the event delta time in
    -00305   // ticks.  Meta-Events preceeding this event are skipped and ignored.
    -00306   if ( track >= nTracks_ ) {
    -00307     errorString_ << "MidiFileIn::getNextMidiEvent: invalid track argument (" <<  track << ").";
    -00308     handleError( errorString_.str(), StkError::FUNCTION_ARGUMENT );
    -00309   }
    -00310 
    -00311   unsigned long ticks = getNextEvent( midiEvent, track );
    -00312   while ( midiEvent->size() && ( midiEvent->at(0) >= 0xF0 ) ) {
    -00313     for ( unsigned int i=0; i<midiEvent->size(); i++ )
    -00314       std::cout << "event byte = " << i << ", value = " << (int)midiEvent->at(i) << std::endl;
    -00315     ticks = getNextEvent( midiEvent, track );
    -00316   }
    -00317 
    -00318   for ( unsigned int i=0; i<midiEvent->size(); i++ )
    -00319   std::cout << "event byte = " << i << ", value = " << (int)midiEvent->at(i) << std::endl;
    -00320 
    -00321   return ticks;
    -00322 }
    -00323 
    -00324 bool MidiFileIn :: readVariableLength( unsigned long *value )
    -00325 {
    -00326   // It is assumed that this function is called with the file read
    -00327   // pointer positioned at the start of a variable-length value.  The
    -00328   // function returns "true" if the value is successfully parsed and
    -00329   // "false" otherwise.
    -00330   *value = 0;
    -00331   char c;
    -00332 
    -00333   if ( !file_.read( &c, 1 ) ) return false;
    -00334   *value = (unsigned long) c;
    -00335   if ( *value & 0x80 ) {
    -00336     *value &= 0x7f;
    -00337     do {
    -00338       if ( !file_.read( &c, 1 ) ) return false;
    -00339       *value = ( *value << 7 ) + ( c & 0x7f );
    -00340     } while ( c & 0x80 );
    -00341   }
    -00342 
    -00343   return true;
    -00344 } 
    -

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/MidiFileIn_8h-source.html b/doxygen/html/MidiFileIn_8h-source.html deleted file mode 100755 index 235fda2..0000000 --- a/doxygen/html/MidiFileIn_8h-source.html +++ /dev/null @@ -1,93 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    MidiFileIn.h

    00001 /**********************************************************************/
    -00016 /**********************************************************************/
    -00017 
    -00018 #ifndef STK_MIDIFILEIN_H
    -00019 #define STK_MIDIFILEIN_H
    -00020 
    -00021 #include "Stk.h"
    -00022 #include <string>
    -00023 #include <vector>
    -00024 #include <fstream>
    -00025 #include <sstream>
    -00026 
    -00027 class MidiFileIn : public Stk
    -00028 {
    -00029  public:
    -00031 
    -00035   MidiFileIn( std::string fileName );
    -00036 
    -00038   ~MidiFileIn();
    -00039 
    -00041   int getFileFormat() const;
    -00042 
    -00044   unsigned int getNumberOfTracks() const;
    -00045 
    -00047 
    -00052   int getDivision() const;
    -00053 
    -00055 
    -00059   void rewindTrack( unsigned int track = 0 );
    -00060 
    -00062 
    -00069   double getTickSeconds( unsigned int track = 0 );
    -00070 
    -00072 
    -00084   unsigned long getNextEvent( std::vector<unsigned char> *event, unsigned int track = 0 );
    -00085 
    -00087 
    -00097   unsigned long getNextMidiEvent( std::vector<unsigned char> *midiEvent, unsigned int track = 0 );
    -00098 
    -00099  protected:
    -00100 
    -00101   // This protected class function is used for reading variable-length
    -00102   // MIDI file values. It is assumed that this function is called with
    -00103   // the file read pointer positioned at the start of a
    -00104   // variable-length value.  The function returns true if the value is
    -00105   // successfully parsed.  Otherwise, it returns false.
    -00106   bool readVariableLength( unsigned long *value );
    -00107 
    -00108   std::ifstream file_;
    -00109   unsigned int nTracks_;
    -00110   int format_;
    -00111   int division_;
    -00112   bool usingTimeCode_;
    -00113   std::vector<double> tickSeconds_;
    -00114   std::vector<long> trackPointers_;
    -00115   std::vector<long> trackOffsets_;
    -00116   std::vector<long> trackLengths_;
    -00117   std::vector<char> trackStatus_;
    -00118   std::ostringstream errorString_;
    -00119 
    -00120   // This structure and the following variables are used to save and
    -00121   // keep track of a format 1 tempo map (and the initial tickSeconds
    -00122   // parameter for formats 0 and 2).
    -00123   struct TempoChange { 
    -00124     unsigned long count;
    -00125     double tickSeconds;
    -00126   };
    -00127   std::vector<TempoChange> tempoEvents_;
    -00128   std::vector<unsigned long> trackCounters_;
    -00129   std::vector<unsigned int> trackTempoIndex_;
    -00130 };
    -00131 
    -00132 #endif
    -

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/RtError_8h-source.html b/doxygen/html/RtError_8h-source.html deleted file mode 100755 index ce20468..0000000 --- a/doxygen/html/RtError_8h-source.html +++ /dev/null @@ -1,63 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    RtError.h

    00001 /************************************************************************/
    -00010 /************************************************************************/
    -00011 
    -00012 #ifndef RTERROR_H
    -00013 #define RTERROR_H
    -00014 
    -00015 #include <iostream>
    -00016 #include <string>
    -00017 
    -00018 class RtError
    -00019 {
    -00020 public:
    -00022   enum Type {
    -00023     WARNING,
    -00024     DEBUG_WARNING,
    -00025     UNSPECIFIED,
    -00026     NO_DEVICES_FOUND,
    -00027     INVALID_DEVICE,
    -00028     INVALID_STREAM,
    -00029     MEMORY_ERROR,
    -00030     INVALID_PARAMETER,
    -00031     DRIVER_ERROR,
    -00032     SYSTEM_ERROR,
    -00033     THREAD_ERROR
    -00034   };
    -00035 
    -00036 protected:
    -00037   std::string message_;
    -00038   Type type_;
    -00039 
    -00040 public:
    -00042   RtError(const std::string& message, Type type = RtError::UNSPECIFIED) : message_(message), type_(type) {}
    -00043 
    -00045   virtual ~RtError(void) {}
    -00046 
    -00048   virtual void printMessage(void) { std::cout << '\n' << message_ << "\n\n"; }
    -00049 
    -00051   virtual const Type& getType(void) { return type_; }
    -00052 
    -00054   virtual const std::string& getMessage(void) { return message_; }
    -00055 };
    -00056 
    -00057 #endif
    -

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/RtMidi_8cpp-source.html b/doxygen/html/RtMidi_8cpp-source.html deleted file mode 100755 index 1b65b96..0000000 --- a/doxygen/html/RtMidi_8cpp-source.html +++ /dev/null @@ -1,482 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    RtMidi.cpp

    00001 /**********************************************************************/
    -00010 /**********************************************************************/
    -00011 
    -00012 #include "RtMidi.h"
    -00013 #include <sstream>
    -00014 
    -00015 RtMidi :: RtMidi()
    -00016   : apiData_( 0 ), connected_( false )
    -00017 {
    -00018 }
    -00019 
    -00020 void RtMidi :: error( RtError::Type type )
    -00021 {
    -00022   if (type == RtError::WARNING) {
    -00023     std::cerr << '\n' << errorString_ << "\n\n";
    -00024   }
    -00025   else if (type == RtError::DEBUG_WARNING) {
    -00026 #if defined(__RTMIDI_DEBUG__)
    -00027     std::cerr << '\n' << errorString_ << "\n\n";
    -00028 #endif
    -00029   }
    -00030   else {
    -00031     std::cerr << '\n' << errorString_ << "\n\n";
    -00032     throw RtError( errorString_, type );
    -00033   }
    -00034 }
    -00035 
    -00036 RtMidiIn :: RtMidiIn() : RtMidi()
    -00037 {
    -00038 }
    -00039 
    -00040 RtMidiIn :: RtMidiIn( unsigned int portNumber, RtMidiCallback callback, void *userData ) : RtMidi()
    -00041 
    -00042 {
    -00043   // Attempt to make the connection.
    -00044   this->openPort( portNumber, callback, userData );
    -00045 }
    -00046 
    -00047 RtMidiIn :: ~RtMidiIn()
    -00048 {
    -00049   closePort();
    -00050 }
    -00051 
    -00052 RtMidiOut :: RtMidiOut() : RtMidi()
    -00053 {
    -00054 }
    -00055 
    -00056 RtMidiOut :: RtMidiOut( unsigned int portNumber ) : RtMidi()
    -00057 {
    -00058   // Attempt to make the connection.
    -00059   this->openPort( portNumber );
    -00060 }
    -00061 
    -00062 RtMidiOut :: ~RtMidiOut()
    -00063 {
    -00064   closePort();
    -00065 }
    -00066 
    -00067 
    -00068 #if defined(__MACOSX_CORE__)
    -00069 
    -00070 // The CoreMIDI API is based on the use of a callback function for
    -00071 // MIDI input.  We convert the system specific time stamps to delta
    -00072 // time values.
    -00073 
    -00074 // OS-X CoreMIDI header files.
    -00075 #include <CoreMIDI/CoreMIDI.h>
    -00076 #include <CoreAudio/HostTime.h>
    -00077 
    -00078 // A structure to hold variables related to the CoreMIDI API
    -00079 // implementation.
    -00080 struct CoreMidiData {
    -00081   MIDIClientRef client;
    -00082   MIDIPortRef port;
    -00083   MIDIEndpointRef destinationId;
    -00084 };
    -00085 
    -00086 void midiInputCallback( const MIDIPacketList *list, void *procRef, void *srcRef )
    -00087 {
    -00088   RtMidiIn::RtMidiInData *data = static_cast<RtMidiIn::RtMidiInData *> (procRef);
    -00089 
    -00090   bool continueSysex = false;
    -00091   unsigned char status;
    -00092   unsigned short nBytes, iByte, size;
    -00093   unsigned long long time;
    -00094   RtMidiIn::MidiMessage message;
    -00095   const MIDIPacket *packet = &list->packet[0];
    -00096   for ( unsigned int i=0; i<list->numPackets; ++i ) {
    -00097 
    -00098     // My interpretation of the CoreMIDI documentation: all message
    -00099     // types, except sysex, are complete within a packet and there may
    -00100     // be several of them in a single packet.  Sysex messages can be
    -00101     // broken across multiple packets but are bundled alone within a
    -00102     // packet.  I'm assuming that sysex messages, if segmented, must
    -00103     // be complete within the same MIDIPacketList.
    -00104 
    -00105     nBytes = packet->length;
    -00106     if ( nBytes == 0 ) continue;
    -00107 
    -00108     // Calculate time stamp.
    -00109     message.timeStamp = 0.0;
    -00110     time = packet->timeStamp;
    -00111     time -= data->lastTime;
    -00112     data->lastTime = packet->timeStamp;
    -00113     time = AudioConvertHostTimeToNanos( time );
    -00114     message.timeStamp = time * 0.000000001;
    -00115 
    -00116     iByte = 0;
    -00117     if ( continueSysex ) {
    -00118       // We have a continuing, segmented sysex message.
    -00119       if ( !(data->ignoreFlags & 0x01) ) {
    -00120         // If we're not ignoring sysex messages, copy the entire packet.
    -00121         message.bytes.assign( packet->data, &packet->data[nBytes] );
    -00122       }
    -00123       if ( packet->data[nBytes] == 0xF7 ) continueSysex = false;
    -00124       if ( !continueSysex ) {
    -00125         // If not a continuing sysex message, invoke the user callback function or queue the message.
    -00126         if ( data->usingCallback && message.bytes.size() > 0 ) {
    -00127           RtMidiIn::RtMidiCallback callback = (RtMidiIn::RtMidiCallback) data->userCallback;
    -00128           callback( message.timeStamp, &message.bytes, data->userData );
    -00129         }
    -00130         else {
    -00131           // As long as we haven't reached our queue size limit, push the message.
    -00132           if ( data->queueLimit > data->queue.size() )
    -00133             data->queue.push( message );
    -00134           else
    -00135             std::cerr << "\nRtMidiIn: message queue limit reached!!\n\n";
    -00136         }
    -00137         message.bytes.clear();
    -00138       }
    -00139     }
    -00140     else {
    -00141       while ( iByte < nBytes ) {
    -00142         size = 0;
    -00143         // We are expecting that the next byte in the packet is a status byte.
    -00144         status = packet->data[iByte];
    -00145         if ( !(status & 0x80) ) break;
    -00146         // Determine the number of bytes in the MIDI message.
    -00147         if ( status < 0xC0 ) size = 3;
    -00148         else if ( status < 0xE0 ) size = 2;
    -00149         else if ( status < 0xF0 ) size = 3;
    -00150         else if ( status == 0xF0 ) {
    -00151           // A MIDI sysex
    -00152           if ( data->ignoreFlags & 0x01 ) {
    -00153             size = 0;
    -00154             iByte = nBytes;
    -00155           }
    -00156           else size = nBytes - iByte;
    -00157           if ( packet->data[nBytes] == 0xF7 ) continueSysex = false;
    -00158         }
    -00159         else if ( status < 0xF3 ) {
    -00160           if ( status == 0xF1 && (data->ignoreFlags & 0x02) ) {
    -00161             // A MIDI time code message and we're ignoring it.
    -00162             size = 0;
    -00163             iByte += 3;
    -00164           }
    -00165           else size = 3;
    -00166         }
    -00167         else if ( status == 0xF3 ) size = 2;
    -00168         else if ( status == 0xFE && (data->ignoreFlags & 0x04) ) {
    -00169           // A MIDI active sensing message and we're ignoring it.
    -00170           size = 0;
    -00171           iByte += 1;
    -00172         }
    -00173         else size = 1;
    -00174 
    -00175         // Copy the MIDI data to our vector.
    -00176         if ( size ) {
    -00177           message.bytes.assign( &packet->data[iByte], &packet->data[iByte+size] );
    -00178           if ( !continueSysex ) {
    -00179             // If not a continuing sysex message, invoke the user callback function or queue the message.
    -00180             if ( data->usingCallback ) {
    -00181               RtMidiIn::RtMidiCallback callback = (RtMidiIn::RtMidiCallback) data->userCallback;
    -00182               callback( message.timeStamp, &message.bytes, data->userData );
    -00183             }
    -00184             else {
    -00185               // As long as we haven't reached our queue size limit, push the message.
    -00186               if ( data->queueLimit > data->queue.size() )
    -00187                 data->queue.push( message );
    -00188               else
    -00189                 std::cerr << "\nRtMidiIn: message queue limit reached!!\n\n";
    -00190             }
    -00191             message.bytes.clear();
    -00192           }
    -00193           iByte += size;
    -00194         }
    -00195       }
    -00196     }
    -00197     packet = MIDIPacketNext(packet);
    -00198   }
    -00199 }
    -00200 
    -00201 void RtMidiIn :: openPort( unsigned int portNumber, RtMidiCallback callback, void *userData )
    -00202 {
    -00203   if ( connected_ ) {
    -00204     errorString_ = "RtMidiIn::openPort: a valid connection already exists!";
    -00205     error( RtError::WARNING );
    -00206     return;
    -00207   }
    -00208 
    -00209   unsigned int nSrc = MIDIGetNumberOfSources();
    -00210   if (nSrc < 1) {
    -00211     errorString_ = "RtMidiIn::openPort: no MIDI input sources found!";
    -00212     error( RtError::NO_DEVICES_FOUND );
    -00213   }
    -00214 
    -00215   std::ostringstream ost;
    -00216   if ( portNumber >= nSrc ) {
    -00217     ost << "RtMidiIn::openPort: the 'portNumber' argument (" << portNumber << ") is invalid.";
    -00218     errorString_ = ost.str();
    -00219     error( RtError::INVALID_PARAMETER );
    -00220   }
    -00221 
    -00222   MIDIClientRef client;
    -00223   OSStatus result = MIDIClientCreate( CFSTR("RtMidi Input Client"), NULL, NULL, &client );
    -00224   if ( result != noErr ) {
    -00225     errorString_ = "RtMidiIn::openPort: error creating OS-X MIDI client object.";
    -00226     error( RtError::DRIVER_ERROR );
    -00227   }
    -00228 
    -00229   MIDIPortRef port;
    -00230   result = MIDIInputPortCreate( client, CFSTR("RtMidi Virtual MIDI Input Port"), midiInputCallback, (void *)&inputData_, &port );
    -00231   if ( result != noErr ) {
    -00232     MIDIClientDispose( client );
    -00233     errorString_ = "RtMidiIn::openPort: error creating OS-X MIDI input port.";
    -00234     error( RtError::DRIVER_ERROR );
    -00235   }
    -00236 
    -00237   // Get the desired input source identifier.
    -00238   MIDIEndpointRef src = MIDIGetSource( portNumber );
    -00239   if ( src == NULL ) {
    -00240     MIDIPortDispose( port );
    -00241     MIDIClientDispose( client );
    -00242     errorString_ = "RtMidiIn::openPort: error getting MIDI input source reference.";
    -00243     error( RtError::DRIVER_ERROR );
    -00244   }
    -00245 
    -00246   // Make the connection.
    -00247   result = MIDIPortConnectSource(port, src, NULL );
    -00248   if ( result != noErr ) {
    -00249     MIDIPortDispose( port );
    -00250     MIDIClientDispose( client );
    -00251     errorString_ = "RtMidiIn::openPort: error connecting OS-X MIDI input port.";
    -00252     error( RtError::DRIVER_ERROR );
    -00253   }
    -00254 
    -00255   // Save our api-specific connection information.
    -00256   CoreMidiData *data = (CoreMidiData *) new CoreMidiData;
    -00257   data->client = client;
    -00258   data->port = port;
    -00259   apiData_ = (void *) data;
    -00260 
    -00261   if ( callback ) {
    -00262     inputData_.userCallback = (void *) callback;
    -00263     inputData_.userData = userData;
    -00264     inputData_.usingCallback = true;
    -00265   }
    -00266 
    -00267   inputData_.lastTime = AudioGetCurrentHostTime();
    -00268 
    -00269   connected_ = true;
    -00270 }
    -00271 
    -00272 void RtMidiIn :: closePort( void )
    -00273 {
    -00274   if ( connected_ ) {
    -00275     CoreMidiData *data = static_cast<CoreMidiData *> (apiData_);
    -00276     MIDIClientDispose( data->client );
    -00277     MIDIPortDispose( data->port );
    -00278     delete data;
    -00279     apiData_ = 0;
    -00280   }
    -00281 
    -00282   connected_ = false;
    -00283 }
    -00284 
    -00285 unsigned int RtMidiIn :: getPortCount()
    -00286 {
    -00287   return MIDIGetNumberOfSources();
    -00288 }
    -00289 
    -00290 std::string RtMidiIn :: getPortName( unsigned int portNumber )
    -00291 {
    -00292   CFStringRef nameRef;
    -00293   MIDIEndpointRef portRef;
    -00294   std::ostringstream ost;
    -00295   char name[128];
    -00296 
    -00297   if ( portNumber >= MIDIGetNumberOfSources() ) {
    -00298     ost << "RtMidiIn::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid.";
    -00299     errorString_ = ost.str();
    -00300     error( RtError::INVALID_PARAMETER );
    -00301   }
    -00302   portRef = MIDIGetSource( portNumber );
    -00303 
    -00304   MIDIObjectGetStringProperty( portRef, kMIDIPropertyName, &nameRef );
    -00305   CFStringGetCString( nameRef, name, sizeof(name), 0);
    -00306   CFRelease( nameRef );
    -00307   std::string stringName = name;
    -00308   return stringName;
    -00309 }
    -00310 
    -00311 void RtMidiIn :: setQueueSizeLimit( unsigned int queueSize )
    -00312 {
    -00313   inputData_.queueLimit = queueSize;
    -00314 }
    -00315 
    -00316 void RtMidiIn :: ignoreTypes( bool midiSysex, bool midiTime, bool midiSense )
    -00317 {
    -00318   inputData_.ignoreFlags = 0;
    -00319   if ( midiSysex ) inputData_.ignoreFlags = 0x01;
    -00320   if ( midiTime ) inputData_.ignoreFlags |= 0x02;
    -00321   if ( midiSense ) inputData_.ignoreFlags |= 0x04;
    -00322 }
    -00323 
    -00324 double RtMidiIn :: getMessage( std::vector<unsigned char> *message )
    -00325 {
    -00326   message->clear();
    -00327   if ( !connected_ ) {
    -00328     errorString_ = "RtMidiIn::getNextMessage: a port is not open!";
    -00329     error( RtError::WARNING );
    -00330     return 0.0;
    -00331   }
    -00332 
    -00333   if ( inputData_.usingCallback ) {
    -00334     errorString_ = "RtMidiIn::getNextMessage: a user callback is currently set for this port.";
    -00335     error( RtError::WARNING );
    -00336     return 0.0;
    -00337   }
    -00338 
    -00339   if ( inputData_.queue.size() == 0 ) return 0.0;
    -00340 
    -00341   // Copy queued message to the vector pointer argument and then "pop" it.
    -00342   std::vector<unsigned char> *bytes = &(inputData_.queue.front().bytes);
    -00343   message->assign( bytes->begin(), bytes->end() );
    -00344   double deltaTime = inputData_.queue.front().timeStamp;
    -00345   inputData_.queue.pop();
    -00346 
    -00347   return deltaTime;
    -00348 }
    -00349 
    -00350 unsigned int RtMidiOut :: getPortCount()
    -00351 {
    -00352   return MIDIGetNumberOfDestinations();
    -00353 }
    -00354 
    -00355 std::string RtMidiOut :: getPortName( unsigned int portNumber )
    -00356 {
    -00357   CFStringRef nameRef;
    -00358   MIDIEndpointRef portRef;
    -00359   std::ostringstream ost;
    -00360   char name[128];
    -00361 
    -00362   if ( portNumber >= MIDIGetNumberOfDestinations() ) {
    -00363     ost << "RtMidiOut::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid.";
    -00364     errorString_ = ost.str();
    -00365     error( RtError::INVALID_PARAMETER );
    -00366   }
    -00367   portRef = MIDIGetDestination( portNumber );
    -00368 
    -00369   MIDIObjectGetStringProperty( portRef, kMIDIPropertyName, &nameRef );
    -00370   CFStringGetCString( nameRef, name, sizeof(name), 0);
    -00371   CFRelease( nameRef );
    -00372   std::string stringName = name;
    -00373   return stringName;
    -00374 }
    -00375 
    -00376 void RtMidiOut :: openPort( unsigned int portNumber )
    -00377 {
    -00378   if ( connected_ ) {
    -00379     errorString_ = "RtMidiOut::openPort: a valid connection already exists!";
    -00380     error( RtError::WARNING );
    -00381     return;
    -00382   }
    -00383 
    -00384   unsigned int nDest = MIDIGetNumberOfDestinations();
    -00385   if (nDest < 1) {
    -00386     errorString_ = "RtMidiOut::openPort: no MIDI output destinations found!";
    -00387     error( RtError::NO_DEVICES_FOUND );
    -00388   }
    -00389 
    -00390   std::ostringstream ost;
    -00391   if ( portNumber >= nDest ) {
    -00392     ost << "RtMidiOut::openPort: the 'portNumber' argument (" << portNumber << ") is invalid.";
    -00393     errorString_ = ost.str();
    -00394     error( RtError::INVALID_PARAMETER );
    -00395   }
    -00396 
    -00397   MIDIClientRef client;
    -00398   OSStatus result = MIDIClientCreate( CFSTR("RtMidi Output Client"), NULL, NULL, &client );
    -00399   if ( result != noErr ) {
    -00400     errorString_ = "RtMidiOut::openPort: error creating OS-X MIDI client object.";
    -00401     error( RtError::DRIVER_ERROR );
    -00402   }
    -00403 
    -00404   MIDIPortRef port;
    -00405   result = MIDIOutputPortCreate( client, CFSTR("RtMidi Virtual MIDI Output Port"), &port );
    -00406   if ( result != noErr ) {
    -00407     MIDIClientDispose( client );
    -00408     errorString_ = "RtMidiOut::openPort: error creating OS-X MIDI output port.";
    -00409     error( RtError::DRIVER_ERROR );
    -00410   }
    -00411 
    -00412   // Get the desired output port identifier.
    -00413   MIDIEndpointRef destinationId = MIDIGetDestination( portNumber );
    -00414   if ( destinationId == NULL ) {
    -00415     MIDIPortDispose( port );
    -00416     MIDIClientDispose( client );
    -00417     errorString_ = "RtMidiOut::openPort: error getting MIDI output destination reference.";
    -00418     error( RtError::DRIVER_ERROR );
    -00419   }
    -00420 
    -00421   // Save our api-specific connection information.
    -00422   CoreMidiData *data = (CoreMidiData *) new CoreMidiData;
    -00423   data->client = client;
    -00424   data->port = port;
    -00425   data->destinationId = destinationId;
    -00426   apiData_ = (void *) data;
    -00427 
    -00428   connected_ = true;
    -00429 }
    -00430 
    -00431 void RtMidiOut :: closePort( void )
    -00432 {
    -00433   if ( connected_ ) {
    -00434     CoreMidiData *data = static_cast<CoreMidiData *> (apiData_);
    -00435     MIDIClientDispose( data->client );
    -00436     MIDIPortDispose( data->port );
    -00437     delete data;
    -00438     apiData_ = 0;
    -00439   }
    -00440 
    -00441   connected_ = false;
    -00442 }
    -00443 
    -00444 void RtMidiOut :: sendMessage( std::vector<unsigned char> *message )
    -00445 {
    -00446   if ( !connected_ ) {
    -00447     errorString_ = "RtMidiOut::sendMessage: a port is not open!";
    -00448     error( RtError::WARNING );
    -00449     return;
    -00450   }
    -00451 
    -00452   unsigned int nBytes = message->size();
    -00453   // Pad the buffer for extra (unknown) structure data.
    -00454   Byte buffer[nBytes+32];
    -00455   MIDIPacketList *pktlist = (MIDIPacketList *) buffer;
    -00456   MIDIPacket *curPacket = MIDIPacketListInit( pktlist );
    -00457 
    -00458   MIDITimeStamp timeStamp = 0;
    -00459   curPacket = MIDIPacketListAdd( pktlist, sizeof(buffer), curPacket, timeStamp, nBytes, &message->at(0) );
    -00460 
    -00461   CoreMidiData *data = static_cast<CoreMidiData *> (apiData_);
    -00462   OSStatus result = MIDISend( data->port, data->destinationId, pktlist );
    -00463   if ( result != noErr ) {
    -00464     errorString_ = "RtMidiOut::sendMessage: error sending MIDI message.";
    -00465     error( RtError::WARNING );
    -00466   }
    -00467 }
    -00468 
    -00469 #endif
    -00470 
    -

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/RtMidi_8h-source.html b/doxygen/html/RtMidi_8h-source.html deleted file mode 100755 index 5a60461..0000000 --- a/doxygen/html/RtMidi_8h-source.html +++ /dev/null @@ -1,145 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    RtMidi.h

    00001 /**********************************************************************/
    -00010 /**********************************************************************/
    -00011 
    -00012 #ifndef RTMIDI_H
    -00013 #define RTMIDI_H
    -00014 
    -00015 #include "RtError.h"
    -00016 #include <string>
    -00017 
    -00018 class RtMidi
    -00019 {
    -00020  protected:
    -00021 
    -00022   RtMidi();
    -00023 
    -00024   // A basic error reporting function for internal use in the RtMidi
    -00025   // subclasses.  The behavior of this function can be modified to
    -00026   // suit specific needs.
    -00027   void error( RtError::Type type );
    -00028 
    -00029   void *apiData_;
    -00030   bool connected_;
    -00031   std::string errorString_;
    -00032 };
    -00033 
    -00034 /**********************************************************************/
    -00048 /**********************************************************************/
    -00049 
    -00050 #include <vector>
    -00051 #include <queue>
    -00052 
    -00053 class RtMidiIn : public RtMidi
    -00054 {
    -00055  public:
    -00056 
    -00058   typedef void (*RtMidiCallback)( double timeStamp, std::vector<unsigned char> *message, void *userData);
    -00059 
    -00061   RtMidiIn();
    -00062 
    -00064 
    -00070   RtMidiIn( unsigned int portNumber, RtMidiCallback callback = 0, void *userData = 0  );
    -00071 
    -00073   ~RtMidiIn();
    -00074 
    -00076 
    -00084   void openPort( unsigned int portNumber = 0, RtMidiCallback callback = 0, void *userData = 0 );
    -00085 
    -00087   void closePort( void );
    -00088 
    -00090   unsigned int getPortCount();
    -00091 
    -00093   std::string getPortName( unsigned int portNumber = 0 );
    -00094 
    -00096 
    -00100   void setQueueSizeLimit( unsigned int queueSize );
    -00101 
    -00103 
    -00110   void ignoreTypes( bool midiSysex = true, bool midiTime = true, bool midiSense = true );
    -00111 
    -00113 
    -00120   double getMessage( std::vector<unsigned char> *message );
    -00121 
    -00122   // A MIDI structure used internally by the class to store incoming
    -00123   // messages.  Each message represents one and only one MIDI message.
    -00124   struct MidiMessage { 
    -00125     std::vector<unsigned char> bytes; 
    -00126     double timeStamp;
    -00127 
    -00128     // Default constructor.
    -00129     MidiMessage()
    -00130       :bytes(3), timeStamp(0.0) {}
    -00131   };
    -00132 
    -00133   // The RtMidiInData structure is used to pass private class data to
    -00134   // the MIDI input handling function or thread.
    -00135   struct RtMidiInData {
    -00136     unsigned long long lastTime;
    -00137     std::queue<MidiMessage> queue;
    -00138     unsigned int queueLimit;
    -00139     unsigned char ignoreFlags;
    -00140     bool usingCallback;
    -00141     void *userCallback;
    -00142     void *userData;
    -00143 
    -00144     // Default constructor.
    -00145     RtMidiInData()
    -00146       : lastTime(0), queueLimit(1024), ignoreFlags(7),
    -00147          usingCallback(false), userCallback(0), userData(0) {}
    -00148   };
    -00149 
    -00150  private:
    -00151 
    -00152   RtMidiInData inputData_;
    -00153 
    -00154 };
    -00155 
    -00156 /**********************************************************************/
    -00168 /**********************************************************************/
    -00169 
    -00170 class RtMidiOut : public RtMidi
    -00171 {
    -00172  public:
    -00173 
    -00175   RtMidiOut();
    -00176 
    -00178 
    -00182   RtMidiOut( unsigned int portNumber );
    -00183 
    -00185   ~RtMidiOut();
    -00186 
    -00188 
    -00194   void openPort( unsigned int portNumber = 0 );
    -00195 
    -00197   void closePort();
    -00198 
    -00200   unsigned int getPortCount();
    -00201 
    -00203   std::string getPortName( unsigned int portNumber );
    -00204 
    -00206 
    -00210   void sendMessage( std::vector<unsigned char> *message );
    -00211 
    -00212 };
    -00213 
    -00214 #endif
    -

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/Stk_8cpp-source.html b/doxygen/html/Stk_8cpp-source.html deleted file mode 100755 index 09312fc..0000000 --- a/doxygen/html/Stk_8cpp-source.html +++ /dev/null @@ -1,128 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    Stk.cpp

    00001 /***************************************************/
    -00013 /***************************************************/
    -00014 
    -00015 #include "Stk.h"
    -00016 
    -00017 StkFloat Stk :: srate_ = (StkFloat) SRATE;
    -00018 std::string Stk :: rawwavepath_ = RAWWAVE_PATH;
    -00019 const Stk::StkFormat Stk :: STK_SINT8 = 1;
    -00020 const Stk::StkFormat Stk :: STK_SINT16 = 2;
    -00021 const Stk::StkFormat Stk :: STK_SINT32 = 8;
    -00022 const Stk::StkFormat Stk :: STK_FLOAT32 = 16;
    -00023 const Stk::StkFormat Stk :: STK_FLOAT64 = 32;
    -00024 
    -00025 void Stk :: setRawwavePath(std::string path)
    -00026 {
    -00027   if ( !path.empty() )
    -00028     rawwavepath_ = path;
    -00029 
    -00030   // Make sure the path includes a "/"
    -00031   if ( rawwavepath_[rawwavepath_.length()-1] != '/' )
    -00032     rawwavepath_ += "/";
    -00033 }
    -00034 
    -00035 void Stk :: swap16(unsigned char *ptr)
    -00036 {
    -00037   register unsigned char val;
    -00038 
    -00039   // Swap 1st and 2nd bytes
    -00040   val = *(ptr);
    -00041   *(ptr) = *(ptr+1);
    -00042   *(ptr+1) = val;
    -00043 }
    -00044 
    -00045 void Stk :: swap32(unsigned char *ptr)
    -00046 {
    -00047   register unsigned char val;
    -00048 
    -00049   // Swap 1st and 4th bytes
    -00050   val = *(ptr);
    -00051   *(ptr) = *(ptr+3);
    -00052   *(ptr+3) = val;
    -00053 
    -00054   //Swap 2nd and 3rd bytes
    -00055   ptr += 1;
    -00056   val = *(ptr);
    -00057   *(ptr) = *(ptr+1);
    -00058   *(ptr+1) = val;
    -00059 }
    -00060 
    -00061 void Stk :: swap64(unsigned char *ptr)
    -00062 {
    -00063   register unsigned char val;
    -00064 
    -00065   // Swap 1st and 8th bytes
    -00066   val = *(ptr);
    -00067   *(ptr) = *(ptr+7);
    -00068   *(ptr+7) = val;
    -00069 
    -00070   // Swap 2nd and 7th bytes
    -00071   ptr += 1;
    -00072   val = *(ptr);
    -00073   *(ptr) = *(ptr+5);
    -00074   *(ptr+5) = val;
    -00075 
    -00076   // Swap 3rd and 6th bytes
    -00077   ptr += 1;
    -00078   val = *(ptr);
    -00079   *(ptr) = *(ptr+3);
    -00080   *(ptr+3) = val;
    -00081 
    -00082   // Swap 4th and 5th bytes
    -00083   ptr += 1;
    -00084   val = *(ptr);
    -00085   *(ptr) = *(ptr+1);
    -00086   *(ptr+1) = val;
    -00087 }
    -00088 
    -00089 #if (defined(__OS_IRIX__) || defined(__OS_LINUX__) || defined(__OS_MACOSX__))
    -00090   #include <unistd.h>
    -00091 #elif defined(__OS_WINDOWS__)
    -00092   #include <windows.h>
    -00093 #endif
    -00094 
    -00095 void Stk :: sleep(unsigned long milliseconds)
    -00096 {
    -00097 #if defined(__OS_WINDOWS__)
    -00098   Sleep((DWORD) milliseconds);
    -00099 #elif (defined(__OS_IRIX__) || defined(__OS_LINUX__) || defined(__OS_MACOSX__))
    -00100   usleep( (unsigned long) (milliseconds * 1000.0) );
    -00101 #endif
    -00102 }
    -00103 
    -00104 void Stk :: handleError( const std::string& message, StkError::Type type )
    -00105 {
    -00106   if ( type == StkError::WARNING ) {
    -00107     std::cerr << '\n' << message << "\n\n";
    -00108   }
    -00109   else if ( type == StkError::DEBUG_WARNING ) {
    -00110 #if defined( __STK_DEBUG__ )
    -00111     std::cerr << '\n' << message << "\n\n";
    -00112 #endif
    -00113   }
    -00114   else {
    -00115     // Print error message before throwing.
    -00116     std::cerr << '\n' << message << "\n\n";
    -00117     throw StkError(message, type);
    -00118   }
    -00119 }
    -

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/Stk_8h-source.html b/doxygen/html/Stk_8h-source.html deleted file mode 100755 index 45a46a1..0000000 --- a/doxygen/html/Stk_8h-source.html +++ /dev/null @@ -1,162 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    Stk.h

    00001 /***************************************************/
    -00013 /***************************************************/
    -00014 
    -00015 #ifndef STK_STK_H
    -00016 #define STK_STK_H
    -00017 
    -00018 #include <string>
    -00019 #include <iostream>
    -00020 
    -00021 // Most data in STK is passed and calculated with the
    -00022 // following user-definable floating-point type.  You
    -00023 // can change this to "float" if you prefer or perhaps
    -00024 // a "long double" in the future.
    -00025 typedef double StkFloat;
    -00026 
    -00028 
    -00033 class StkError
    -00034 {
    -00035 public:
    -00036   enum Type { 
    -00037     WARNING,
    -00038     DEBUG_WARNING,
    -00039     FUNCTION_ARGUMENT,
    -00040     FILE_NOT_FOUND,
    -00041     FILE_UNKNOWN_FORMAT,
    -00042     FILE_ERROR,
    -00043     PROCESS_THREAD,
    -00044     PROCESS_SOCKET,
    -00045     PROCESS_SOCKET_IPADDR,
    -00046     AUDIO_SYSTEM,
    -00047     MIDI_SYSTEM,
    -00048     UNSPECIFIED
    -00049   };
    -00050 
    -00051 protected:
    -00052   std::string message_;
    -00053   Type type_;
    -00054 
    -00055 public:
    -00057   StkError( const std::string& message, Type type = StkError::UNSPECIFIED ) : message_(message), type_(type) {}
    -00058 
    -00060   virtual ~StkError(void) {}
    -00061 
    -00063   virtual void printMessage(void) { std::cout << '\n' << message_ << "\n\n"; }
    -00064 
    -00066   virtual const Type& getType(void) { return type_; }
    -00067 
    -00069   virtual const std::string& getMessage(void) { return message_; }
    -00070 };
    -00071 
    -00072 class Stk
    -00073 {
    -00074 public:
    -00075 
    -00076   typedef unsigned long StkFormat;
    -00077   static const StkFormat STK_SINT8;   
    -00078   static const StkFormat STK_SINT16;  
    -00079   static const StkFormat STK_SINT32;  
    -00080   static const StkFormat STK_FLOAT32; 
    -00081   static const StkFormat STK_FLOAT64; 
    -00083 
    -00084   static StkFloat sampleRate(void) { return srate_; }
    -00085 
    -00087 
    -00095   static void setSampleRate(StkFloat rate) { if (rate > 0.0) srate_ = rate; }
    -00096 
    -00098   static std::string rawwavePath(void) { return rawwavepath_; }
    -00099 
    -00101   static void setRawwavePath(std::string path);
    -00102 
    -00104   static void swap16(unsigned char *ptr);
    -00105 
    -00107   static void swap32(unsigned char *ptr);
    -00108 
    -00110   static void swap64(unsigned char *ptr);
    -00111 
    -00113   static void sleep(unsigned long milliseconds);
    -00114 
    -00115 private:
    -00116   static StkFloat srate_;
    -00117   static std::string rawwavepath_;
    -00118 
    -00119 protected:
    -00120 
    -00122   static void handleError( const std::string& message, StkError::Type type );
    -00123 
    -00124 };
    -00125 
    -00126 // Here are a few other useful typedefs.
    -00127 typedef signed short SINT16;
    -00128 typedef signed int SINT32;
    -00129 typedef float FLOAT32;
    -00130 typedef double FLOAT64;
    -00131 
    -00132 // Boolean values
    -00133 #define FALSE 0
    -00134 #define TRUE 1
    -00135 
    -00136 // The default sampling rate.
    -00137 #define SRATE (StkFloat) 44100.0
    -00138 
    -00139 // The default real-time audio input and output buffer size.  If
    -00140 // clicks are occuring in the input and/or output sound stream, a
    -00141 // larger buffer size may help.  Larger buffer sizes, however, result
    -00142 // in more latency.
    -00143 #define RT_BUFFER_SIZE 512
    -00144 
    -00145 // The default rawwave path value is set with the preprocessor
    -00146 // definition RAWWAVE_PATH.  This can be specified as an argument to
    -00147 // the configure script, in an integrated development environment, or
    -00148 // below.  The global STK rawwave path variable can be dynamically set
    -00149 // with the Stk::setRawwavePath() function.  This value is
    -00150 // concatenated to the beginning of all references to rawwave files in
    -00151 // various STK classes.  If you wish to move the rawwaves directory to
    -00152 // a different location in your file system, you will need to set this
    -00153 // path definition appropriately.
    -00154 #if !defined(RAWWAVE_PATH)
    -00155   #define RAWWAVE_PATH "../../rawwaves/"
    -00156 #endif
    -00157 
    -00158 #define PI (MY_FLOAT) 3.14159265359
    -00159 #define TWO_PI (MY_FLOAT) (MY_FLOAT) (2 * PI)
    -00160 
    -00161 #define ONE_OVER_128 (MY_FLOAT) 0.0078125
    -00162 
    -00163 #if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)
    -00164   #define __OS_WINDOWS__
    -00165   #define __STK_REALTIME__
    -00166 #elif defined(__LINUX_OSS__) || defined(__LINUX_ALSA__) || defined(__LINUX_JACK__)
    -00167   #define __OS_LINUX__
    -00168   #define __STK_REALTIME__
    -00169 #elif defined(__IRIX_AL__)
    -00170   #define __OS_IRIX__
    -00171   #define __STK_REALTIME__
    -00172 #elif defined(__MACOSX_CORE__)
    -00173   #define __OS_MACOSX__
    -00174   #define __STK_REALTIME__
    -00175 #endif
    -00176 
    -00177 //#define __STK_DEBUG__
    -00178 
    -00179 #endif
    -

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/annotated.html b/doxygen/html/annotated.html deleted file mode 100755 index 02a08e7..0000000 --- a/doxygen/html/annotated.html +++ /dev/null @@ -1,29 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    STK Compound List

    Here are the classes, structs, unions and interfaces with brief descriptions: - - - - - - - -
    MidiFileInA standard MIDI file reading/parsing 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
    StkSTK base class
    StkErrorSTK error handling class
    -
    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/classMidiFileIn-members.html b/doxygen/html/classMidiFileIn-members.html deleted file mode 100755 index 85c5512..0000000 --- a/doxygen/html/classMidiFileIn-members.html +++ /dev/null @@ -1,44 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    MidiFileIn Member List

    This is the complete list of members for MidiFileIn, including all inherited members. - - - - - - - - - - - - - - - - - - - - - - - -
    getDivision() constMidiFileIn
    getFileFormat() constMidiFileIn
    getNextEvent(std::vector< unsigned char > *event, unsigned int track=0)MidiFileIn
    getNextMidiEvent(std::vector< unsigned char > *midiEvent, unsigned int track=0)MidiFileIn
    getNumberOfTracks() constMidiFileIn
    getTickSeconds(unsigned int track=0)MidiFileIn
    handleError(const std::string &message, StkError::Type type)Stk [protected, static]
    MidiFileIn(std::string fileName)MidiFileIn
    rawwavePath(void)Stk [inline, static]
    rewindTrack(unsigned int track=0)MidiFileIn
    sampleRate(void)Stk [inline, static]
    setRawwavePath(std::string path)Stk [static]
    setSampleRate(StkFloat rate)Stk [inline, static]
    sleep(unsigned long milliseconds)Stk [static]
    STK_FLOAT32Stk [static]
    STK_FLOAT64Stk [static]
    STK_SINT16Stk [static]
    STK_SINT32Stk [static]
    STK_SINT8Stk [static]
    swap16(unsigned char *ptr)Stk [static]
    swap32(unsigned char *ptr)Stk [static]
    swap64(unsigned char *ptr)Stk [static]
    ~MidiFileIn()MidiFileIn

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/classMidiFileIn.html b/doxygen/html/classMidiFileIn.html deleted file mode 100755 index e03bb48..0000000 --- a/doxygen/html/classMidiFileIn.html +++ /dev/null @@ -1,296 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    MidiFileIn Class Reference

    A standard MIDI file reading/parsing class. -More... -

    -#include <MidiFileIn.h> -

    -

    Inheritance diagram for MidiFileIn: -

    - -Stk - -List of all members. - - - - - - - - - - - - - - - - - - - - -

    Public Member Functions

     MidiFileIn (std::string fileName)
     Default constructor.

    ~MidiFileIn ()
     Class destructor.

    -int getFileFormat () const
     Return the MIDI file format (0, 1, or 2).

    -unsigned int getNumberOfTracks () const
     Return the number of tracks in the MIDI file.

    int getDivision () const
     Return the MIDI file division value from the file header.

    void rewindTrack (unsigned int track=0)
     Move the specified track event reader to the beginning of its track.

    double getTickSeconds (unsigned int track=0)
     Get the current value, in seconds, of delta-time ticks for the specified track.

    unsigned long getNextEvent (std::vector< unsigned char > *event, unsigned int track=0)
     Fill the user-provided vector with the next event in the specified track and return the event delta-time in ticks.

    unsigned long getNextMidiEvent (std::vector< unsigned char > *midiEvent, unsigned int track=0)
     Fill the user-provided vector with the next MIDI channel event in the specified track and return the event delta time in ticks.

    -

    Detailed Description

    -A standard MIDI file reading/parsing class. -

    -This class can be used to read events from a standard MIDI file. Event bytes are copied to a C++ vector and must be subsequently interpreted by the user. The function getNextMidiEvent() skips meta and sysex events, returning only MIDI channel messages. Event delta-times are returned in the form of "ticks" and a function is provided to determine the current "seconds per tick". Tempo changes are internally tracked by the class and reflected in the values returned by the function getTickSeconds().

    -by Gary P. Scavone, 2003. -

    - -

    -Definition at line 27 of file MidiFileIn.h.


    Constructor & Destructor Documentation

    -

    - - - - -
    - - - - - - - - - - -
    MidiFileIn::MidiFileIn std::string   fileName
    -
    - - - - - -
    -   - - -

    -Default constructor. -

    -If an error occurs while opening or parsing the file header, an StkError exception will be thrown. -

    -Definition at line 21 of file MidiFileIn.cpp. -

    -References getNextEvent(), Stk::handleError(), and rewindTrack().

    -


    Member Function Documentation

    -

    - - - - -
    - - - - - - - - - -
    int MidiFileIn::getDivision   const
    -
    - - - - - -
    -   - - -

    -Return the MIDI file division value from the file header. -

    -Note that this value must be "parsed" in accordance with the MIDI File Specification. In particular, if the MSB is set, the file uses time-code representations for delta-time values. -

    -Definition at line 158 of file MidiFileIn.cpp.

    -

    - - - - -
    - - - - - - - - - - -
    void MidiFileIn::rewindTrack unsigned int   track = 0
    -
    - - - - - -
    -   - - -

    -Move the specified track event reader to the beginning of its track. -

    -The relevant track tempo value is reset as well. If an invalid track number is specified, an StkError exception will be thrown. -

    -Definition at line 163 of file MidiFileIn.cpp. -

    -References Stk::handleError(). -

    -Referenced by MidiFileIn().

    -

    - - - - -
    - - - - - - - - - - -
    double MidiFileIn::getTickSeconds unsigned int   track = 0
    -
    - - - - - -
    -   - - -

    -Get the current value, in seconds, of delta-time ticks for the specified track. -

    -This value can change as events are read (via "Set Tempo" Meta-Events). Therefore, one should call this function after every call to getNextEvent() or getNextMidiEvent(). If an invalid track number is specified, an StkError exception will be thrown. -

    -Definition at line 175 of file MidiFileIn.cpp. -

    -References Stk::handleError().

    -

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    unsigned long MidiFileIn::getNextEvent std::vector< unsigned char > *   event,
    unsigned int   track = 0
    -
    - - - - - -
    -   - - -

    -Fill the user-provided vector with the next event in the specified track and return the event delta-time in ticks. -

    -MIDI File events consist of a delta time and a sequence of event bytes. This function returns the delta-time value and writes the subsequent event bytes directly to the event vector. The user must parse the event bytes in accordance with the MIDI File Specification. All returned MIDI channel events are complete ... a status byte is provided even when running status is used in the file. If the track has reached its end, no bytes will be written and the event vector size will be zero. If an invalid track number is specified or an error occurs while reading the file, an StkError exception will be thrown. -

    -Definition at line 186 of file MidiFileIn.cpp. -

    -References Stk::handleError(). -

    -Referenced by getNextMidiEvent(), and MidiFileIn().

    -

    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    unsigned long MidiFileIn::getNextMidiEvent std::vector< unsigned char > *   midiEvent,
    unsigned int   track = 0
    -
    - - - - - -
    -   - - -

    -Fill the user-provided vector with the next MIDI channel event in the specified track and return the event delta time in ticks. -

    -All returned MIDI events are complete ... a status byte is provided even when running status is used in the file. Meta and sysex events in the track are skipped though "Set Tempo" events are properly parsed for use by the getTickSeconds() function. If the track has reached its end, no bytes will be written and the event vector size will be zero. If an invalid track number is specified or an error occurs while reading the file, an StkError exception will be thrown. -

    -Definition at line 301 of file MidiFileIn.cpp. -

    -References getNextEvent(), and Stk::handleError().

    -


    The documentation for this class was generated from the following files: -
    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/classMidiFileIn.png b/doxygen/html/classMidiFileIn.png deleted file mode 100755 index 13082f0..0000000 Binary files a/doxygen/html/classMidiFileIn.png and /dev/null differ diff --git a/doxygen/html/classRtError-members.html b/doxygen/html/classRtError-members.html deleted file mode 100755 index da67c30..0000000 --- a/doxygen/html/classRtError-members.html +++ /dev/null @@ -1,27 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    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]

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/classRtError.html b/doxygen/html/classRtError.html deleted file mode 100755 index 535c495..0000000 --- a/doxygen/html/classRtError.html +++ /dev/null @@ -1,56 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    RtError Class Reference

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

    -#include <RtError.h> -

    -List of all members. - - - - - - - - - - - - - - - -

    Public 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.

    -


    Detailed Description

    -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. -

    - -

    -Definition at line 18 of file RtError.h.


    The documentation for this class was generated from the following file: -
    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/classRtMidi-members.html b/doxygen/html/classRtMidi-members.html deleted file mode 100755 index dc1fd95..0000000 --- a/doxygen/html/classRtMidi-members.html +++ /dev/null @@ -1,21 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    RtMidi Member List

    This is the complete list of members for RtMidi, including all inherited members. -

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/classRtMidi.html b/doxygen/html/classRtMidi.html deleted file mode 100755 index dc7efe0..0000000 --- a/doxygen/html/classRtMidi.html +++ /dev/null @@ -1,44 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    RtMidi Class Reference

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

    -#include <RtMidi.h> -

    -

    Inheritance diagram for RtMidi: -

    - -RtMidiIn -RtMidiOut - -List of all members. - -
    -

    Detailed Description

    -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.

    -by Gary P. Scavone, 2003. -

    - -

    -Definition at line 18 of file RtMidi.h.


    The documentation for this class was generated from the following files: -
    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/classRtMidi.png b/doxygen/html/classRtMidi.png deleted file mode 100755 index 4114caf..0000000 Binary files a/doxygen/html/classRtMidi.png and /dev/null differ diff --git a/doxygen/html/classRtMidiIn-members.html b/doxygen/html/classRtMidiIn-members.html deleted file mode 100755 index c314e0c..0000000 --- a/doxygen/html/classRtMidiIn-members.html +++ /dev/null @@ -1,32 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    RtMidiIn Member List

    This is the complete list of members for RtMidiIn, including all inherited members. - - - - - - - - - - - -
    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, RtMidiCallback callback=0, void *userData=0)RtMidiIn
    RtMidiCallback typedefRtMidiIn
    RtMidiIn()RtMidiIn
    RtMidiIn(unsigned int portNumber, RtMidiCallback callback=0, void *userData=0)RtMidiIn
    setQueueSizeLimit(unsigned int queueSize)RtMidiIn
    ~RtMidiIn()RtMidiIn

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/classRtMidiIn.html b/doxygen/html/classRtMidiIn.html deleted file mode 100755 index 9af2a2e..0000000 --- a/doxygen/html/classRtMidiIn.html +++ /dev/null @@ -1,281 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    RtMidiIn Class Reference

    A realtime MIDI input class. -More... -

    -#include <RtMidi.h> -

    -

    Inheritance diagram for RtMidiIn: -

    - -RtMidi - -List of all members. - - - - - - - - - - - - - - - - - - - - - - - - - -

    Public Types

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


    Public Member Functions

    RtMidiIn ()
     Default constructor.

     RtMidiIn (unsigned int portNumber, RtMidiCallback callback=0, void *userData=0)
     An overloaded constructor which can be used to open a MIDI input port during instantiation.

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

    void openPort (unsigned int portNumber=0, RtMidiCallback callback=0, void *userData=0)
     Open a MIDI input connection and optionally set a user callback function.

    -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. -

    -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.

    -by Gary P. Scavone, 2003. -

    - -

    -Definition at line 53 of file RtMidi.h.


    Constructor & Destructor Documentation

    -

    - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    RtMidiIn::RtMidiIn unsigned int   portNumber,
    RtMidiCallback   callback = 0,
    void *   userData = 0
    -
    - - - - - -
    -   - - -

    -An overloaded constructor which can be used to open a MIDI input port during instantiation. -

    -If the optional RtMidiCallback argument is non-NULL, the callback function will be invoked whenever MIDI input messages become available. An exception is thrown if an error occurs while attempting to make the port connection. -

    -Definition at line 40 of file RtMidi.cpp. -

    -References openPort().

    -


    Member Function Documentation

    -

    - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    void RtMidiIn::openPort unsigned int   portNumber = 0,
    RtMidiCallback   callback = 0,
    void *   userData = 0
    -
    - - - - - -
    -   - - -

    -Open a MIDI input connection and optionally set a user callback function. -

    -An optional port number greater than 0 can be specified. Otherwise, the default or first port found is opened. If the optional RtMidiCallback argument is non-NULL, the callback function will be associated with the port and invoked whenever MIDI input messages become available. An exception is thrown if an error occurs while attempting to make the port connection. -

    -Referenced by RtMidiIn().

    -

    - - - - -
    - - - - - - - - - - -
    void RtMidiIn::setQueueSizeLimit unsigned int   queueSize
    -
    - - - - - -
    -   - - -

    -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.

    -

    - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    void RtMidiIn::ignoreTypes bool   midiSysex = true,
    bool   midiTime = true,
    bool   midiSense = true
    -
    - - - - - -
    -   - - -

    -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.

    -

    - - - - -
    - - - - - - - - - - -
    double RtMidiIn::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. -

    -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.

    -


    The documentation for this class was generated from the following files: -
    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/classRtMidiIn.png b/doxygen/html/classRtMidiIn.png deleted file mode 100755 index 224cf6d..0000000 Binary files a/doxygen/html/classRtMidiIn.png and /dev/null differ diff --git a/doxygen/html/classRtMidiOut-members.html b/doxygen/html/classRtMidiOut-members.html deleted file mode 100755 index af47f3d..0000000 --- a/doxygen/html/classRtMidiOut-members.html +++ /dev/null @@ -1,29 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    RtMidiOut Member List

    This is the complete list of members for RtMidiOut, including all inherited members. - - - - - - - - -
    closePort()RtMidiOut
    getPortCount()RtMidiOut
    getPortName(unsigned int portNumber)RtMidiOut
    openPort(unsigned int portNumber=0)RtMidiOut
    RtMidiOut()RtMidiOut
    RtMidiOut(unsigned int portNumber)RtMidiOut
    sendMessage(std::vector< unsigned char > *message)RtMidiOut
    ~RtMidiOut()RtMidiOut

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/classRtMidiOut.html b/doxygen/html/classRtMidiOut.html deleted file mode 100755 index bb5b0f9..0000000 --- a/doxygen/html/classRtMidiOut.html +++ /dev/null @@ -1,166 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    RtMidiOut Class Reference

    A realtime MIDI output class. -More... -

    -#include <RtMidi.h> -

    -

    Inheritance diagram for RtMidiOut: -

    - -RtMidi - -List of all members. - - - - - - - - - - - - - - - - - - -

    Public Member Functions

    RtMidiOut ()
     Default constructor.

     RtMidiOut (unsigned int portNumber)
     An overloaded constructor which opens a MIDI output port during instantiation.

    ~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).

    -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. -

    -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. -

    - -

    -Definition at line 170 of file RtMidi.h.


    Constructor & Destructor Documentation

    -

    - - - - -
    - - - - - - - - - - -
    RtMidiOut::RtMidiOut unsigned int   portNumber
    -
    - - - - - -
    -   - - -

    -An overloaded constructor which opens a MIDI output port during instantiation. -

    -An exception is thrown if an error occurs while attempting to make the port connection. -

    -Definition at line 56 of file RtMidi.cpp. -

    -References openPort().

    -


    Member Function Documentation

    -

    - - - - -
    - - - - - - - - - - -
    void RtMidiOut::openPort unsigned int   portNumber = 0
    -
    - - - - - -
    -   - - -

    -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. -

    -Referenced by RtMidiOut().

    -

    - - - - -
    - - - - - - - - - - -
    void RtMidiOut::sendMessage std::vector< unsigned char > *   message
    -
    - - - - - -
    -   - - -

    -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.

    -


    The documentation for this class was generated from the following files: -
    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/classRtMidiOut.png b/doxygen/html/classRtMidiOut.png deleted file mode 100755 index 6a41edc..0000000 Binary files a/doxygen/html/classRtMidiOut.png and /dev/null differ diff --git a/doxygen/html/classStk-members.html b/doxygen/html/classStk-members.html deleted file mode 100755 index c38fd67..0000000 --- a/doxygen/html/classStk-members.html +++ /dev/null @@ -1,35 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    Stk Member List

    This is the complete list of members for Stk, including all inherited members. - - - - - - - - - - - - - - -
    handleError(const std::string &message, StkError::Type type)Stk [protected, static]
    rawwavePath(void)Stk [inline, static]
    sampleRate(void)Stk [inline, static]
    setRawwavePath(std::string path)Stk [static]
    setSampleRate(StkFloat rate)Stk [inline, static]
    sleep(unsigned long milliseconds)Stk [static]
    STK_FLOAT32Stk [static]
    STK_FLOAT64Stk [static]
    STK_SINT16Stk [static]
    STK_SINT32Stk [static]
    STK_SINT8Stk [static]
    swap16(unsigned char *ptr)Stk [static]
    swap32(unsigned char *ptr)Stk [static]
    swap64(unsigned char *ptr)Stk [static]

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/classStk.html b/doxygen/html/classStk.html deleted file mode 100755 index f3cf78f..0000000 --- a/doxygen/html/classStk.html +++ /dev/null @@ -1,232 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    Stk Class Reference

    STK base class. -More... -

    -#include <Stk.h> -

    -

    Inheritance diagram for Stk: -

    - -MidiFileIn - -List of all members. - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    Static Public Member Functions

    -StkFloat sampleRate (void)
     Static method which returns the current STK sample rate.

    void setSampleRate (StkFloat rate)
     Static method which sets the STK sample rate.

    -std::string rawwavePath (void)
     Static method which returns the current rawwave path.

    -void setRawwavePath (std::string path)
     Static method which sets the STK rawwave path.

    -void swap16 (unsigned char *ptr)
     Static method which byte-swaps a 16-bit data type.

    -void swap32 (unsigned char *ptr)
     Static method which byte-swaps a 32-bit data type.

    -void swap64 (unsigned char *ptr)
     Static method which byte-swaps a 64-bit data type.

    -void sleep (unsigned long milliseconds)
     Static cross-platform method to sleep for a number of milliseconds.


    Static Public Attributes

    const StkFormat STK_SINT8 = 1
    const StkFormat STK_SINT16 = 2
    const StkFormat STK_SINT32 = 8
    const StkFormat STK_FLOAT32 = 16
    const StkFormat STK_FLOAT64 = 32

    Static Protected Member Functions

    -void handleError (const std::string &message, StkError::Type type)
     Function for error reporting and handling.

    -

    Detailed Description

    -STK base class. -

    -Nearly all STK classes inherit from this class. The global sample rate can be queried and modified via Stk. In addition, this class provides error handling and byte-swapping functions.

    -by Perry R. Cook and Gary P. Scavone, 1995 - 2003. -

    - -

    -Definition at line 72 of file Stk.h.


    Member Function Documentation

    -

    - - - - -
    - - - - - - - - - - -
    void Stk::setSampleRate StkFloat   rate [inline, static]
    -
    - - - - - -
    -   - - -

    -Static method which sets the STK sample rate. -

    -The sample rate set using this method is queried by all STK classes which depend on its value. It is initialized to the default SRATE set in Stk.h. Many STK classes use the sample rate during instantiation. Therefore, if you wish to use a rate which is different from the default rate, it is imperative that it be set BEFORE STK objects are instantiated. -

    -Definition at line 95 of file Stk.h.

    -


    Member Data Documentation

    -

    - - - - -
    - - -
    const Stk::StkFormat Stk::STK_SINT8 = 1 [static] -
    -
    - - - - - -
    -   - - -

    --128 to +127 -

    -Definition at line 19 of file Stk.cpp.

    -

    - - - - -
    - - -
    const Stk::StkFormat Stk::STK_SINT16 = 2 [static] -
    -
    - - - - - -
    -   - - -

    --32768 to +32767 -

    -Definition at line 20 of file Stk.cpp.

    -

    - - - - -
    - - -
    const Stk::StkFormat Stk::STK_SINT32 = 8 [static] -
    -
    - - - - - -
    -   - - -

    --2147483648 to +2147483647. -

    -Definition at line 21 of file Stk.cpp.

    -

    - - - - -
    - - -
    const Stk::StkFormat Stk::STK_FLOAT32 = 16 [static] -
    -
    - - - - - -
    -   - - -

    -Normalized between plus/minus 1.0. -

    -Definition at line 22 of file Stk.cpp.

    -

    - - - - -
    - - -
    const Stk::StkFormat Stk::STK_FLOAT64 = 32 [static] -
    -
    - - - - - -
    -   - - -

    -Normalized between plus/minus 1.0. -

    -Definition at line 23 of file Stk.cpp.

    -


    The documentation for this class was generated from the following files: -
    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/classStk.png b/doxygen/html/classStk.png deleted file mode 100755 index 84495a3..0000000 Binary files a/doxygen/html/classStk.png and /dev/null differ diff --git a/doxygen/html/classStkError-members.html b/doxygen/html/classStkError-members.html deleted file mode 100755 index 97d7df0..0000000 --- a/doxygen/html/classStkError-members.html +++ /dev/null @@ -1,26 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    StkError Member List

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

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/classStkError.html b/doxygen/html/classStkError.html deleted file mode 100755 index cfdb29f..0000000 --- a/doxygen/html/classStkError.html +++ /dev/null @@ -1,53 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    StkError Class Reference

    STK error handling class. -More... -

    -#include <Stk.h> -

    -List of all members. - - - - - - - - - - - - -

    Public Member Functions

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

    -virtual ~StkError (void)
     The destructor.

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

    -virtual const Type & getType (void)
     Returns the "thrown" error message type.

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

    -


    Detailed Description

    -STK error handling class. -

    -This is a fairly abstract exception handling class. There could be sub-classes to take care of more specific error conditions ... or not. -

    - -

    -Definition at line 33 of file Stk.h.


    The documentation for this class was generated from the following file: -
    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/doxygen.css b/doxygen/html/doxygen.css deleted file mode 100755 index 96680fb..0000000 --- a/doxygen/html/doxygen.css +++ /dev/null @@ -1,49 +0,0 @@ -H1 { text-align: center; } -CAPTION { font-weight: bold } -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: #4444ee } -A.codeRef { font-weight: normal; color: #4444ee } -A:hover { text-decoration: none; background-color: #f2f2ff } -DL.el { margin-left: -1cm } -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: #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 } -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/doxygen/html/doxygen.png b/doxygen/html/doxygen.png deleted file mode 100755 index 96ae72c..0000000 Binary files a/doxygen/html/doxygen.png and /dev/null differ diff --git a/doxygen/html/files.html b/doxygen/html/files.html deleted file mode 100755 index 981655b..0000000 --- a/doxygen/html/files.html +++ /dev/null @@ -1,32 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    STK File List

    Here is a list of all documented files with brief descriptions: - - - - - - - - - - -
    MidiFileIn.cpp [code]
    MidiFileIn.h [code]
    midiin.cpp [code]
    miditime.cpp [code]
    playsmf.cpp [code]
    RtError.h [code]
    RtMidi.cpp [code]
    RtMidi.h [code]
    Stk.cpp [code]
    Stk.h [code]
    -
    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/functions.html b/doxygen/html/functions.html deleted file mode 100755 index 48492e2..0000000 --- a/doxygen/html/functions.html +++ /dev/null @@ -1,65 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    STK Compound Members

    Here is a list of all documented class members with links to the class documentation for each member: -
    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/hierarchy.html b/doxygen/html/hierarchy.html deleted file mode 100755 index 3f2be16..0000000 --- a/doxygen/html/hierarchy.html +++ /dev/null @@ -1,33 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    STK Class Hierarchy

    This inheritance list is sorted roughly, but not completely, alphabetically: -
    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/index.html b/doxygen/html/index.html deleted file mode 100755 index e68c218..0000000 --- a/doxygen/html/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    STK Documentation

    -

    -

    -
    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/midiin_8cpp-source.html b/doxygen/html/midiin_8cpp-source.html deleted file mode 100755 index 267d6fb..0000000 --- a/doxygen/html/midiin_8cpp-source.html +++ /dev/null @@ -1,83 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    midiin.cpp

    00001 // midiin.cpp
    -00002 //
    -00003 // Simple program to read MIDI input from default port.
    -00004 //
    -00005 // by Gary Scavone, 2003.
    -00006 //
    -00007 // compile: g++ -Wall -D__MACOSX_CORE__ -o midiin midiin.cpp RtMidi.cpp Stk.cpp -framework CoreMIDI -framework CoreFoundation -framework CoreAudio
    -00008 
    -00009 #include <iostream>
    -00010 #include <unistd.h>
    -00011 #include <signal.h>
    -00012 #include "RtMidi.h"
    -00013 
    -00014 bool done;
    -00015 static void finish(int ignore){ done = true; }
    -00016 
    -00017 int main()
    -00018 {
    -00019   using namespace std;
    -00020   RtMidiIn midi;
    -00021   std::vector<unsigned char> message;
    -00022 
    -00023   if ( midi.getPortCount() < 1 ) {
    -00024     cout << "\nThere are no MIDI input sources available!\n";
    -00025     exit(0);
    -00026   }
    -00027 
    -00028   try {
    -00029     midi.openPort();
    -00030   }
    -00031   catch ( RtError & ) {
    -00032     // You might want to do something more useful here.
    -00033     cout << "\nAborting program!\n";
    -00034     goto cleanup;
    -00035   }
    -00036 
    -00037   // Install an interrupt handler function.
    -00038   (void) signal(SIGINT, finish);
    -00039 
    -00040   int nBytes, i, value;
    -00041   double stamp;
    -00042   done = false;
    -00043   cout << "Reading MIDI from default port ..." << endl;
    -00044   while ( !done ) {
    -00045     stamp = midi.getMessage( &message );
    -00046     nBytes = message.size();
    -00047     for ( i=0; i<nBytes; i++ ) {
    -00048       value = message[i];
    -00049       cout << "Byte " << i << " = " << value << ", ";
    -00050     }
    -00051     if ( nBytes > 0 )
    -00052       cout << "stamp = " << stamp << '\n';
    -00053 
    -00054     // Sleep for 10 milliseconds.
    -00055     usleep( 10000 );
    -00056   }
    -00057 
    -00058   cout << "Goodbye!" << endl;
    -00059 
    -00060  cleanup:
    -00061   midi.closePort();
    -00062   return 0;
    -00063 }
    -

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/miditime_8cpp-source.html b/doxygen/html/miditime_8cpp-source.html deleted file mode 100755 index cf274e6..0000000 --- a/doxygen/html/miditime_8cpp-source.html +++ /dev/null @@ -1,93 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    miditime.cpp

    00001 // miditime.cpp
    -00002 //
    -00003 // Simple program to output MIDI to the default port.
    -00004 //
    -00005 // by Gary Scavone, 2003.
    -00006 //
    -00007 // compile: g++ -Wall -o miditime miditime.cpp RtMidi.cpp -framework CoreMIDI -framework CoreFoundation -framework CoreAudio
    -00008 
    -00009 #include <iostream>
    -00010 #include <unistd.h>
    -00011 #include <signal.h>
    -00012 #include "RtMidi.h"
    -00013 
    -00014 bool done;
    -00015 static void finish(int ignore){ done = true; }
    -00016 
    -00017 int main()
    -00018 {
    -00019   using namespace std;
    -00020   RtMidi midi( RtMidi::ABSOLUTE_TIME );
    -00021 
    -00022   if ( midi.getPortCount( RtMidi::MIDI_OUTPUT ) < 1 ) {
    -00023     cout << "\nThere are no MIDI output destinations available!\n";
    -00024     exit(0);
    -00025   }
    -00026 
    -00027   try {
    -00028     midi.openPort( RtMidi::MIDI_OUTPUT );
    -00029   }
    -00030   catch ( RtError & ) {
    -00031     // You might want to do something more useful here.
    -00032     cout << "\nAborting program!\n";
    -00033     midi.closePort();
    -00034     exit(0);
    -00035   }
    -00036 
    -00037   // Install an interrupt handler function.
    -00038   (void) signal(SIGINT, finish);
    -00039 
    -00040   RtMidi::MidiMessage message;
    -00041   message.bytes.push_back( 144 );
    -00042   message.bytes.push_back( 64 );
    -00043   message.bytes.push_back( 80 );
    -00044 
    -00045   cout << "Scheduling for 1 second later ..." << endl;
    -00046   timeval tvTime;
    -00047   if ( gettimeofday( &tvTime, NULL ) == 0 ) {
    -00048     message.timeStamp = (double) tvTime.tv_sec + 1.0;
    -00049     message.timeStamp += (double) (tvTime.tv_usec * 0.000001);
    -00050   }
    -00051   //message.timeStamp = 1.0;
    -00052   midi.sendMessage( &message );
    -00053 
    -00054   // Sleep for 0.5 seconds.
    -00055   usleep( 1000000 );
    -00056 
    -00057   cout << "1 second has passed ..." << endl;
    -00058 
    -00059   // Sleep another 1.0 seconds.
    -00060   usleep( 1000000 );
    -00061 
    -00062   cout << "Turning note off ... ";
    -00063 
    -00064   // Turn the note off.
    -00065   message.timeStamp = 0.0;
    -00066   message.bytes[2] = 0;
    -00067   midi.sendMessage( &message );
    -00068 
    -00069   midi.closePort();
    -00070 
    -00071   cout << "Goodbye!" << endl;
    -00072   return 0;
    -00073 }
    -

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/newRtMidi_8h-source.html b/doxygen/html/newRtMidi_8h-source.html deleted file mode 100755 index 971238f..0000000 --- a/doxygen/html/newRtMidi_8h-source.html +++ /dev/null @@ -1,148 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    newRtMidi.h

    00001 /**********************************************************************/
    -00012 /**********************************************************************/
    -00013 
    -00014 #ifndef RTMIDI_H
    -00015 #define RTMIDI_H
    -00016 
    -00017 #include <vector>
    -00018 #include <string>
    -00019 #include "RtError.h"
    -00020 
    -00021 // Operating system dependent thread functionality.
    -00022 #if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)
    -00023   #include <windows.h>
    -00024   #include <process.h>
    -00025 
    -00026   typedef unsigned long ThreadHandle;
    -00027   typedef CRITICAL_SECTION Mutex;
    -00028 
    -00029 #else // Various unix flavors with pthread support.
    -00030   #include <pthread.h>
    -00031 
    -00032   typedef pthread_t ThreadHandle;
    -00033   typedef pthread_mutex_t Mutex;
    -00034 
    -00035 #endif
    -00036 
    -00037 // OS-X CoreMIDI header files.
    -00038 #include <CoreMIDI/CoreMIDI.h>
    -00039 #include <CoreAudio/HostTime.h>
    -00040 
    -00041 // Issues yet to resolve:
    -00042 // - how do we make this cross-platform
    -00043 //   - no subclasses
    -00044 //   - instead, attempt an optional api argument for oss/alsa selection
    -00045 // - do we keep both input and output functionality here?
    -00046 //
    -00047 //   - RtMidiIn, RtMidiOut
    -00048 //
    -00049 // - what do we call the ignore() function?
    -00050 
    -00051 
    -00052 
    -00053 class RtMidi
    -00054 {
    -00055  public:
    -00056 
    -00058   enum PortType { RTMIDI_INPUT, RTMIDI_OUTPUT };
    -00059 
    -00061   typedef void (*RtMidiCallback)( std::vector<unsigned char> *message, void *userData);
    -00062 
    -00064   RtMidi();
    -00065 
    -00067 
    -00071   RtMidi( PortType type, unsigned int portNumber = 0 );
    -00072 
    -00074   ~RtMidi();
    -00075 
    -00077 
    -00083   void openPort( PortType type, unsigned int portNumber = 0 );
    -00084 
    -00086   void closePort( void );
    -00087 
    -00089   unsigned int getPortCount( PortType type );
    -00090 
    -00092   std::string getPortName( PortType type, unsigned int portNumber );
    -00093 
    -00095   void setInputCallback( RtMidiCallback callback, void *userData);
    -00096 
    -00097   void setInputQueueSize( unsigned int queueSize );
    -00098 
    -00100 
    -00107   void setIgnoreTypes( bool midiSysex = true, bool midiSense = true, bool midiTime = true );
    -00108 
    -00110 
    -00117   double getMessage( std::vector<unsigned char> *message );
    -00118 
    -00120 
    -00124   void sendMessage( std::vector<unsigned char> *message );
    -00125 
    -00126   // A MIDI structure used internally by the class to store incoming
    -00127   // messages.  Each message represents one and only one MIDI message.
    -00128   struct MidiMessage { 
    -00129     std::vector<unsigned char> bytes; 
    -00130     double timeStamp;
    -00131 
    -00132     // Default constructor.
    -00133     MidiMessage()
    -00134       :bytes(3), timeStamp(0.0) {}
    -00135   };
    -00136 
    -00137   // This public structure is used to pass private class data to the
    -00138   // MIDI input callback function or thread.
    -00139   struct RtMidiCallbackInfo {
    -00140     unsigned int writeIndex;
    -00141     unsigned long lastTime;
    -00142     MidiMessage buffer[nMessages];
    -00143     Mutex mutex;
    -00144     bool usingCallback;
    -00145     void *userCallback;
    -00146     void *userData;
    -00147 
    -00148     // Default constructor.
    -00149     RtMidiCallbackInfo()
    -00150       : writeIndex(0), doDeltaTime(true), lastTime(0),
    -00151          usingCallback(false), userCallback(0), userData(0) {}
    -00152   };
    -00153 
    -00154  private:
    -00155 
    -00156   // A basic error reporting function for internal use in the RtMidi
    -00157   // class.  The behavior of this function can be modified to suit
    -00158   // specific needs.
    -00159   void error( RtError::Type type );
    -00160   
    -00161   MidiMessage currentMessage_;
    -00162   unsigned int nMessages;
    -00163   unsigned int readIndex_;
    -00164   MIDIClientRef client_;
    -00165   MIDIPortRef port_;
    -00166   MIDIEndpointRef destinationId_;
    -00167   RtMidiCallbackInfo callbackInfo_;
    -00168   bool connected_;
    -00169   bool isInputPort_;
    -00170   std::string errorString_;
    -00171 
    -00172 };
    -00173 
    -00174 #endif
    -

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/oldRtMidi_8cpp-source.html b/doxygen/html/oldRtMidi_8cpp-source.html deleted file mode 100755 index 90c3f47..0000000 --- a/doxygen/html/oldRtMidi_8cpp-source.html +++ /dev/null @@ -1,385 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    oldRtMidi.cpp

    00001 // RtMidi class declaration
    -00002 // Realtime MIDI input/output class.
    -00003 //
    -00004 // This class provides access to a single MIDI input or output port.
    -00005 // Create multiple instances of this class to connect to more than
    -00006 // one MIDI device at the same time.
    -00007 //
    -00008 // by Gary P. Scavone, 2003.
    -00009 
    -00010 #include "RtMidi.h"
    -00011 #include <sstream>
    -00012 #include <sys/time.h>
    -00013 
    -00014 void midiInputCallback( const MIDIPacketList *list, void *procRef, void *srcRef )
    -00015 {
    -00016   RtMidi::RtMidiCallbackInfo *info = static_cast<RtMidi::RtMidiCallbackInfo *> (procRef);
    -00017 
    -00018   RtMidi::MidiMessage *message;
    -00019   const MIDIPacket *packet = &list->packet[0];
    -00020   for ( unsigned int i=0; i<list->numPackets; ++i ) {
    -00021 
    -00022     // For the moment, we're limiting ourselves to basic MIDI messages
    -00023     // and ignoring the (real) possibility that multiple MIDI messages
    -00024     // can be packed into a single MIDIPacket.  FIXME!!!
    -00025     if ( packet->length > 3 ) continue;
    -00026 
    -00027     message = static_cast<RtMidi::MidiMessage *> (&info->buffer[info->writeIndex++]);
    -00028     message->bytes.assign( packet->data, &packet->data[packet->length] );
    -00029 
    -00030     // - have status byte:
    -00031     //   - look for subsequent data bytes of known number (unless sysex ... unknown number)
    -00032     //   - if find a system realtime:
    -00033     //     - copy incomplete message to next buffer
    -00034     //     - clear current buffer and write realtime message
    -00035     //     - continue parsing data bytes
    -00036     // while !finished parsing:
    -00037     //   if data byte
    -00038     // if ( incomplete ) {
    -00039     //  for ( int i = 0; i < packet->length; i++ ) {
    -00040     //    if while ( packet->data[
    -00041     //  }
    -00042     //}
    -00043 
    -00044     // Calculate time stamp.
    -00045     message->timeStamp = 0.0;
    -00046     if ( info->doDeltaTime ) {
    -00047       unsigned long time = packet->timeStamp;
    -00048       time -= info->lastTime;
    -00049       info->lastTime = packet->timeStamp;
    -00050       time = AudioConvertHostTimeToNanos( time );
    -00051       message->timeStamp = time * 0.000000001;
    -00052     }
    -00053     else { // absolute time in seconds since midnight (0 hour), January 1, 1970
    -00054       timeval time;
    -00055       if ( gettimeofday( &time, NULL ) != 0 ) {
    -00056         std::cerr << "RtMidi: error in midiInputCallback calculating time stamp.";
    -00057       }
    -00058       else {
    -00059         message->timeStamp = (double) time.tv_sec;
    -00060         message->timeStamp += (double) (time.tv_usec * 0.000001);
    -00061       }
    -00062     }
    -00063 
    -00064     if ( info->writeIndex >= nMessages )
    -00065       info->writeIndex = 0;
    -00066 
    -00067     if ( info->usingCallback ) {
    -00068       RtMidi::RtMidiCallback callback = (RtMidi::RtMidiCallback) info->userCallback;
    -00069       callback( message, info->userData );
    -00070     }
    -00071 
    -00072     packet = MIDIPacketNext(packet);
    -00073   }
    -00074 }
    -00075 
    -00076 RtMidi :: RtMidi( TimeType time )
    -00077 {
    -00078   if ( time == ABSOLUTE_TIME ) callbackInfo_.doDeltaTime = false;
    -00079   callbackInfo_.lastTime = AudioGetCurrentHostTime();
    -00080   readIndex_ = 0;
    -00081   connected_ = false;
    -00082 }
    -00083 
    -00084 RtMidi :: RtMidi( PortType type, unsigned int portNumber, TimeType time )
    -00085 {
    -00086   if ( time == ABSOLUTE_TIME ) callbackInfo_.doDeltaTime = false;
    -00087   callbackInfo_.lastTime = AudioGetCurrentHostTime();
    -00088   readIndex_ = 0;
    -00089   connected_ = false;
    -00090 
    -00091   // Attempt to make the connection.
    -00092   this->openPort( type, portNumber );
    -00093 }
    -00094 
    -00095 RtMidi :: ~RtMidi()
    -00096 {
    -00097   if ( connected_ ) {
    -00098     MIDIClientDispose( client_ );
    -00099     MIDIPortDispose( port_ );
    -00100   }
    -00101 }
    -00102 
    -00103 void RtMidi :: openPort( PortType type, unsigned int portNumber )
    -00104 {
    -00105   if ( connected_ ) {
    -00106     errorString_ = "RtMidi::openPort: a valid connection already exists.";
    -00107     error( RtError::WARNING );
    -00108     return;
    -00109   }
    -00110 
    -00111   if ( portNumber < 0 ) {
    -00112     errorString_ = "RtMidi::openPort: the 'portNumber' argument must be greater than zero.";
    -00113     error( RtError::INVALID_PARAMETER );
    -00114   }
    -00115 
    -00116   std::ostringstream ost;
    -00117   if ( type == MIDI_INPUT ) {
    -00118     unsigned int nSrc = MIDIGetNumberOfSources();
    -00119     if (nSrc < 1) {
    -00120       errorString_ = "RtMidi::openPort: no MIDI input sources found!";
    -00121       error( RtError::NO_DEVICES_FOUND );
    -00122     }
    -00123 
    -00124     if ( portNumber >= nSrc ) {
    -00125       ost << "RtMidi::openPort: the 'portNumber' argument (" << portNumber << ") is invalid.";
    -00126       errorString_ = ost.str();
    -00127       error( RtError::INVALID_PARAMETER );
    -00128     }
    -00129 
    -00130     OSStatus result = MIDIClientCreate( CFSTR("RtMidi Input Client"), NULL, NULL, &client_ );
    -00131     if ( result != noErr ) {
    -00132       errorString_ = "RtMidi::openPort: error creating OS-X MIDI client object.";
    -00133       error( RtError::DRIVER_ERROR );
    -00134     }
    -00135 
    -00136     result = MIDIInputPortCreate( client_, CFSTR("RtMidi Virtual MIDI Input Port"), midiInputCallback, (void *)&callbackInfo_, &port_ );
    -00137     if ( result != noErr ) {
    -00138       MIDIClientDispose( client_ );
    -00139       errorString_ = "RtMidi::openPort: error creating OS-X MIDI input port.";
    -00140       error( RtError::DRIVER_ERROR );
    -00141     }
    -00142 
    -00143     // Get the desired input source identifier.
    -00144     MIDIEndpointRef src = MIDIGetSource( portNumber );
    -00145     if ( src == NULL ) {
    -00146       MIDIPortDispose( port_ );
    -00147       MIDIClientDispose( client_ );
    -00148       errorString_ = "RtMidi::openPort: error getting MIDI input source reference.";
    -00149       error( RtError::DRIVER_ERROR );
    -00150     }
    -00151 
    -00152     // Make the connection.
    -00153     result = MIDIPortConnectSource(port_, src, NULL );
    -00154     if ( result != noErr ) {
    -00155       MIDIPortDispose( port_ );
    -00156       MIDIClientDispose( client_ );
    -00157       errorString_ = "RtMidi::openPort: error connecting OS-X MIDI input port.";
    -00158       error( RtError::DRIVER_ERROR );
    -00159     }
    -00160 
    -00161     isInputPort_ = true;
    -00162     callbackInfo_.lastTime = AudioGetCurrentHostTime();
    -00163   }
    -00164   else { // MIDI_OUTPUT
    -00165     unsigned int nDest = MIDIGetNumberOfDestinations();
    -00166     if (nDest < 1) {
    -00167       errorString_ = "RtMidi::openPort: no MIDI output destinations found!";
    -00168       error( RtError::NO_DEVICES_FOUND );
    -00169     }
    -00170 
    -00171     if ( portNumber >= nDest ) {
    -00172       ost << "RtMidi::openPort: the 'portNumber' argument (" << portNumber << ") is invalid.";
    -00173       errorString_ = ost.str();
    -00174       error( RtError::INVALID_PARAMETER );
    -00175     }
    -00176 
    -00177     OSStatus result = MIDIClientCreate( CFSTR("RtMidi Output Client"), NULL, NULL, &client_ );
    -00178     if ( result != noErr ) {
    -00179       errorString_ = "RtMidi::openPort: error creating OS-X MIDI client object.";
    -00180       error( RtError::DRIVER_ERROR );
    -00181     }
    -00182 
    -00183     result = MIDIOutputPortCreate( client_, CFSTR("RtMidi Virtual MIDI Output Port"), &port_ );
    -00184     if ( result != noErr ) {
    -00185       MIDIClientDispose( client_ );
    -00186       errorString_ = "RtMidi::openPort: error creating OS-X MIDI output port.";
    -00187       error( RtError::DRIVER_ERROR );
    -00188     }
    -00189 
    -00190     // Get the desired output port identifier.
    -00191     destinationId_ = MIDIGetDestination( portNumber );
    -00192     if ( destinationId_ == NULL ) {
    -00193       MIDIPortDispose( port_ );
    -00194       MIDIClientDispose( client_ );
    -00195       errorString_ = "RtMidi::openPort: error getting MIDI output destination reference.";
    -00196       error( RtError::DRIVER_ERROR );
    -00197     }
    -00198 
    -00199     isInputPort_ = false;
    -00200   }
    -00201 
    -00202   connected_ = true;
    -00203 }
    -00204 
    -00205 void RtMidi :: closePort( void )
    -00206 {
    -00207   if ( connected_ ) {
    -00208     MIDIClientDispose( client_ );
    -00209     MIDIPortDispose( port_ );
    -00210   }
    -00211   else {
    -00212     errorString_ = "RtMidi::closePort: a port connection was not open!";
    -00213     error( RtError::WARNING );
    -00214   }
    -00215   connected_ = false;
    -00216 }
    -00217 
    -00218 unsigned int RtMidi :: getPortCount( PortType type )
    -00219 {
    -00220   if ( type == MIDI_INPUT )
    -00221     return MIDIGetNumberOfSources();
    -00222   else // MIDI_OUTPUT
    -00223     return MIDIGetNumberOfDestinations();
    -00224 }
    -00225 
    -00226 std::string RtMidi :: getPortName( PortType type, unsigned int portNumber )
    -00227 {
    -00228   CFStringRef nameRef;
    -00229   MIDIEndpointRef portRef;
    -00230   std::ostringstream ost;
    -00231   char name[128];
    -00232   if ( type == MIDI_INPUT ) {
    -00233     if ( portNumber < 0 || portNumber >= MIDIGetNumberOfSources() ) {
    -00234       ost << "RtMidi::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid.";
    -00235       errorString_ = ost.str();
    -00236       error( RtError::INVALID_PARAMETER );
    -00237     }
    -00238     portRef = MIDIGetSource( portNumber );
    -00239   }
    -00240   else { // MIDI_OUTPUT
    -00241     if ( portNumber < 0 || portNumber >= MIDIGetNumberOfDestinations() ) {
    -00242       ost << "RtMidi::getPortName: the 'portNumber' argument (" << portNumber << ") is invalid.";
    -00243       errorString_ = ost.str();
    -00244       error( RtError::INVALID_PARAMETER );
    -00245     }
    -00246     portRef = MIDIGetDestination( portNumber );
    -00247   }
    -00248 
    -00249   MIDIObjectGetStringProperty( portRef, kMIDIPropertyName, &nameRef );
    -00250   CFStringGetCString( nameRef, name, sizeof(name), 0);
    -00251   CFRelease( nameRef );
    -00252   std::string stringName = name;
    -00253   return stringName;
    -00254 }
    -00255 
    -00256 void RtMidi :: setInputCallback( RtMidiCallback callback, void *userData)
    -00257 {
    -00258   callbackInfo_.userCallback = (void *) callback;
    -00259   callbackInfo_.userData = userData;
    -00260   callbackInfo_.usingCallback = true;
    -00261 }
    -00262 
    -00263 const RtMidi::MidiMessage* RtMidi :: getMessage( void )
    -00264 {
    -00265   currentMessage_.bytes.clear();
    -00266   if ( !connected_ ) {
    -00267     errorString_ = "RtMidi::getNextMessage: a port is not open!";
    -00268     error( RtError::WARNING );
    -00269     return &currentMessage_;
    -00270   }
    -00271 
    -00272   if ( !isInputPort_ ) {
    -00273     errorString_ = "RtMidi::getNextMessage: this is not an input port!";
    -00274     error( RtError::WARNING );
    -00275     return &currentMessage_;
    -00276   }
    -00277 
    -00278   if ( callbackInfo_.usingCallback ) {
    -00279     errorString_ = "RtMidi::getNextMessage: a user callback is currently set for this port.";
    -00280     error( RtError::WARNING );
    -00281     return &currentMessage_;
    -00282   }
    -00283 
    -00284   if ( readIndex_ == callbackInfo_.writeIndex ) return &currentMessage_;
    -00285 
    -00286   currentMessage_ = callbackInfo_.buffer[readIndex_++];
    -00287   if ( readIndex_ >= nMessages ) readIndex_ = 0;
    -00288 
    -00289   return &currentMessage_;
    -00290 }
    -00291 
    -00292 bool RtMidi :: sendMessage( const MidiMessage *message )
    -00293 {
    -00294   if ( !connected_ ) {
    -00295     errorString_ = "RtMidi::sendMessage: a port is not open!";
    -00296     error( RtError::WARNING );
    -00297     return false;
    -00298   }
    -00299 
    -00300   if ( isInputPort_ ) {
    -00301     errorString_ = "RtMidi::sendMessage: this is not an output port!";
    -00302     error( RtError::WARNING );
    -00303     return false;
    -00304   }
    -00305 
    -00306   unsigned int nBytes = message->bytes.size();
    -00307   // Pad the buffer for extra (unknown) structure data.
    -00308   Byte buffer[nBytes+32];
    -00309   MIDIPacketList *pktlist = (MIDIPacketList *) buffer;
    -00310   MIDIPacket *curPacket = MIDIPacketListInit( pktlist );
    -00311 
    -00312   MIDITimeStamp timeStamp = 0;
    -00313   // If a non-zero delta or absolute time, convert to CoreMIDI's host time.
    -00314   if ( message->timeStamp != 0.0 ) {
    -00315     if ( callbackInfo_.doDeltaTime ) {
    -00316       timeStamp = AudioConvertHostTimeToNanos( AudioGetCurrentHostTime() );
    -00317       timeStamp += (UInt64) (message->timeStamp * 1000000000.0);
    -00318       timeStamp = AudioConvertNanosToHostTime( timeStamp );
    -00319     }
    -00320     else {
    -00321       timeval tvTime;
    -00322       double time;
    -00323       if ( gettimeofday( &tvTime, NULL ) != 0 ) {
    -00324         errorString_ = "RtMidi::sendMessage: error calculating time stamp.";
    -00325         error( RtError::WARNING );
    -00326       }
    -00327       else {
    -00328         time = (double) tvTime.tv_sec;
    -00329         time += (double) (tvTime.tv_usec * 0.000001);
    -00330         time = message->timeStamp - time;
    -00331         if ( time > 0.0 ) {
    -00332           timeStamp = AudioConvertHostTimeToNanos( AudioGetCurrentHostTime() );
    -00333           timeStamp += (UInt64) (time * 1000000000.0);
    -00334           timeStamp = AudioConvertNanosToHostTime( timeStamp );
    -00335         }
    -00336       }
    -00337     }
    -00338   }
    -00339   curPacket = MIDIPacketListAdd( pktlist, sizeof(buffer), curPacket, timeStamp, nBytes, &message->bytes[0]);
    -00340 
    -00341   OSStatus result = MIDISend( port_, destinationId_, pktlist );
    -00342   if ( result != noErr ) {
    -00343     errorString_ = "RtMidi::sendMessage: error sending MIDI message.";
    -00344     error( RtError::WARNING );
    -00345     return false;
    -00346   }
    -00347 
    -00348   return true;
    -00349 }
    -00350 
    -00351 void RtMidi :: error( RtError::Type type )
    -00352 {
    -00353   if (type == RtError::WARNING) {
    -00354     std::cerr << '\n' << errorString_ << "\n\n";
    -00355   }
    -00356   else if (type == RtError::DEBUG_WARNING) {
    -00357 #if defined(__RTMIDI_DEBUG__)
    -00358     std::cerr << '\n' << errorString_ << "\n\n";
    -00359 #endif
    -00360   }
    -00361   else {
    -00362     std::cerr << '\n' << errorString_ << "\n\n";
    -00363     throw RtError( errorString_, type );
    -00364   }
    -00365 }
    -

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/oldRtMidi_8h-source.html b/doxygen/html/oldRtMidi_8h-source.html deleted file mode 100755 index 26ea396..0000000 --- a/doxygen/html/oldRtMidi_8h-source.html +++ /dev/null @@ -1,163 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    oldRtMidi.h

    00001 /**********************************************************************/
    -00011 /**********************************************************************/
    -00012 
    -00013 #ifndef RTMIDI_H
    -00014 #define RTMIDI_H
    -00015 
    -00016 #include <vector>
    -00017 #include <string>
    -00018 #include "RtError.h"
    -00019 
    -00020 // Operating system dependent thread functionality.
    -00021 #if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)
    -00022   #include <windows.h>
    -00023   #include <process.h>
    -00024 
    -00025   typedef unsigned long ThreadHandle;
    -00026   typedef CRITICAL_SECTION Mutex;
    -00027 
    -00028 #else // Various unix flavors with pthread support.
    -00029   #include <pthread.h>
    -00030 
    -00031   typedef pthread_t ThreadHandle;
    -00032   typedef pthread_mutex_t Mutex;
    -00033 
    -00034 #endif
    -00035 
    -00036 // OS-X CoreMIDI header files.
    -00037 #include <CoreMIDI/CoreMIDI.h>
    -00038 #include <CoreAudio/HostTime.h>
    -00039 
    -00040 // Set the size of the circular MIDI input message buffer.
    -00041 const unsigned int nMessages = 100;
    -00042 
    -00043 class RtMidi
    -00044 {
    -00045  public:
    -00046 
    -00047   // A MIDI message structure.  Each message represents one and only
    -00048   // one MIDI message.  Given the variable length of the bytes member,
    -00049   // this structure can contain sysex messages of arbitrary length.
    -00050   struct MidiMessage { 
    -00051     std::vector<unsigned char> bytes; 
    -00052     double timeStamp;
    -00053 
    -00054     // Default constructor.
    -00055     MidiMessage()
    -00056       :bytes(3), timeStamp(0.0) {}
    -00057   };
    -00058 
    -00059   // Defined MIDI port types.
    -00060   enum PortType { MIDI_INPUT, MIDI_OUTPUT };
    -00061 
    -00062   // Defined MIDI time stamp types.  Times are saved in a
    -00063   // double-precision floating-point variable.  Delta time is in
    -00064   // seconds (between events).  Absolute time is in seconds since
    -00065   // midnight (0 hour), January 1, 1970.
    -00066   enum TimeType { DELTA_TIME, ABSOLUTE_TIME };
    -00067 
    -00068   // User callback function type definition.
    -00069   typedef void (*RtMidiCallback)( MidiMessage *message, void *userData);
    -00070 
    -00071   // Default constructor.
    -00072   RtMidi( TimeType time = DELTA_TIME );
    -00073 
    -00074   // An overloaded constructor which can be used to open a MIDI port
    -00075   // during instantiation.  An exception is thrown if an error occurs
    -00076   // while attempting to make the port connection.
    -00077   RtMidi( PortType type, unsigned int portNumber = 0, TimeType time = DELTA_TIME );
    -00078 
    -00079   // The destructor closes any open MIDI connections.
    -00080   ~RtMidi();
    -00081 
    -00082   // Open a MIDI connection of the specified type.  An optional port
    -00083   // number greater than 0 can be specified.  Otherwise, the default
    -00084   // or first port found is opened.  An exception is thrown if an
    -00085   // error occurs while attempting to make the port connection.
    -00086   void openPort( PortType type, unsigned int portNumber = 0 );
    -00087 
    -00088   // Close an open MIDI connection (if one exists).
    -00089   void closePort( void );
    -00090 
    -00091   // Return the number of available MIDI ports of the specified type.
    -00092   unsigned int getPortCount( PortType type );
    -00093 
    -00094   // Return a string identifier for the specified MIDI port type and number.
    -00095   std::string getPortName( PortType type, unsigned int portNumber );
    -00096 
    -00097   // Set a user-defined callback function for notification of Midi input.
    -00098   void setInputCallback( RtMidiCallback callback, void *userData);
    -00099 
    -00100   // Return a reference to a vector containing the next available
    -00101   // incoming MIDI message.  This function returns immediately whether
    -00102   // a new message is available or not.  A valid message is indicated
    -00103   // by a non-zero vector size in the MidiMessage structure.  An
    -00104   // exception is thrown if an error occurs during message retrieval
    -00105   // or an input connection was not previously established.
    -00106   const RtMidi::MidiMessage *getMessage( void );
    -00107 
    -00108   // Send a single message out an open MIDI port.  If the message time
    -00109   // stamp is non-zero, the message will be scheduled for output
    -00110   // accordingly.  Otherwise, it will be output immediately.  An
    -00111   // exception is thrown if an error occurs during output or an output
    -00112   // connection was not previously established.
    -00113   bool sendMessage( const MidiMessage *message );
    -00114 
    -00115   // This public structure is used to pass private class data to the
    -00116   // MIDI input callback function or thread.
    -00117   struct RtMidiCallbackInfo {
    -00118     unsigned int writeIndex;
    -00119     bool doDeltaTime;
    -00120     unsigned long lastTime;
    -00121     MidiMessage buffer[nMessages];
    -00122     Mutex mutex;
    -00123     bool usingCallback;
    -00124     void *userCallback;
    -00125     void *userData;
    -00126 
    -00127     // Default constructor.
    -00128     RtMidiCallbackInfo()
    -00129       : writeIndex(0), doDeltaTime(true), lastTime(0),
    -00130          usingCallback(false), userCallback(0), userData(0) {}
    -00131   };
    -00132 
    -00133  private:
    -00134 
    -00135   // A basic error reporting function for internal use in the RtMidi
    -00136   // class.  The behavior of this function can be modified to suit
    -00137   // specific needs.
    -00138   void error( RtError::Type type );
    -00139   
    -00140   MidiMessage currentMessage_;
    -00141   unsigned int readIndex_;
    -00142   MIDIClientRef client_;
    -00143   MIDIPortRef port_;
    -00144   MIDIEndpointRef destinationId_;
    -00145   RtMidiCallbackInfo callbackInfo_;
    -00146   bool connected_;
    -00147   bool isInputPort_;
    -00148   std::string errorString_;
    -00149 
    -00150 };
    -00151 
    -00152 #endif
    -

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - diff --git a/doxygen/html/playsmf_8cpp-source.html b/doxygen/html/playsmf_8cpp-source.html deleted file mode 100755 index 5db53c4..0000000 --- a/doxygen/html/playsmf_8cpp-source.html +++ /dev/null @@ -1,117 +0,0 @@ - - -The Synthesis ToolKit in C++ (STK) - - - -
    -  

    -Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial

    -
    - -

    playsmf.cpp

    00001 // playsmf.cpp
    -00002 //
    -00003 // Simple program to test the MidiFileIn class by reading and playing
    -00004 // a single track from a given Standard MIDI file.
    -00005 //
    -00006 // by Gary Scavone, 2003.
    -00007 //
    -00008 // compile: g++ -Wall -o playsmf playsmf.cpp RtMidi.o MidiFileIn.cpp Stk.cpp -framework CoreMIDI -framework CoreFoundation -framework CoreAudio
    -00009 
    -00010 #include "MidiFileIn.h"
    -00011 #include "RtMidi.h"
    -00012 #include <signal.h>
    -00013 #include <unistd.h>
    -00014 
    -00015 bool done = false;
    -00016 static void finish(int ignore){ done = true; }
    -00017 
    -00018 void usage(void) {
    -00019   // Error function in case of incorrect command-line
    -00020   // argument specifications.
    -00021   std::cout << "\nusage: testmidi file track\n";
    -00022   std::cout << "   where file = a standard MIDI file,\n";
    -00023   std::cout << "   and track = the track to play (0 = 1st track).\n\n";
    -00024   exit(0);
    -00025 }
    -00026 
    -00027 int main( int argc, char *argv[] )
    -00028 {
    -00029   if ( argc != 3 ) usage();
    -00030 
    -00031   RtMidiOut midi;
    -00032 
    -00033   if ( midi.getPortCount() < 1 ) {
    -00034     std::cout << "\nThere are no MIDI output destinations available!\n\n";
    -00035     exit(0);
    -00036   }
    -00037 
    -00038   try {
    -00039     midi.openPort();
    -00040   }
    -00041   catch ( RtError & ) {
    -00042     // You might want to do something more useful here.
    -00043     std::cout << "\nAborting program!\n";
    -00044     exit(0);
    -00045   }
    -00046 
    -00047   // Install an interrupt handler function.  Type "ctrl-c" to quit the
    -00048   // program.
    -00049   (void) signal(SIGINT, finish);
    -00050   
    -00051   try {
    -00052     MidiFileIn midiFile( argv[1] );
    -00053 
    -00054     // Print a little information about the file.
    -00055     std::cout << "\nThe MIDI file (" << argv[1] << ") information:\n";
    -00056     std::cout << "  - format = " << midiFile.getFileFormat() << "\n";
    -00057     std::cout << "  - tracks = " << midiFile.getNumberOfTracks() << "\n";
    -00058     std::cout << "  - seconds / ticks = " << midiFile.getTickSeconds() << "\n";
    -00059 
    -00060     unsigned int track = (unsigned int) atoi( argv[2] );
    -00061     if ( midiFile.getNumberOfTracks() <= track ) {
    -00062       std::cout << "\nInvalid track number ... playing track 0.\n";
    -00063       track = 0;
    -00064     }
    -00065 
    -00066     std::cout << "\nPress <enter> to start reading/playing.\n";
    -00067     char input;
    -00068     std::cin.get(input);
    -00069     
    -00070     std::vector<unsigned char> event;
    -00071     unsigned long ticks = midiFile.getNextMidiEvent( &event, track );
    -00072     while ( !done && event.size() ) {
    -00073 
    -00074       // Pause for the MIDI event delta time.
    -00075       Stk::sleep( (unsigned long) (ticks * midiFile.getTickSeconds() * 1000 ) );
    -00076 
    -00077       midi.sendMessage( &event );
    -00078 
    -00079       // Get a new event.
    -00080       ticks = midiFile.getNextMidiEvent( &event, track );
    -00081     }
    -00082 
    -00083     // Send a "reset" to the synthesizer.
    -00084     event.clear();
    -00085     event.push_back( 0xff );
    -00086     midi.sendMessage( &event );
    -00087   }
    -00088   catch ( StkError & ) {
    -00089     // You might want to do something more useful here.
    -00090     std::cout << "\nAborting program!\n";
    -00091     midi.closePort();
    -00092     exit(0);
    -00093   }
    -00094 
    -00095   std::cout << "Goodbye!\n";
    -00096   return 0;
    -00097 }
    -

    - - - - -
    The Synthesis ToolKit in C++ (STK)
    ©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.
    - - - -- cgit v1.2.3