Updated RtAudio/RtMidi for new release, plus additional documentation updates.

This commit is contained in:
Gary Scavone
2019-04-18 09:18:19 -04:00
parent 38970124ec
commit b6143915a9
14 changed files with 1545 additions and 872 deletions

View File

@@ -1,5 +1,5 @@
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_INIT(STK, 4.6.0, gary@music.mcgill.ca, stk) AC_INIT(STK, 4.6.1, gary@music.mcgill.ca, stk)
AC_CONFIG_AUX_DIR(config) AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(src/Stk.cpp) AC_CONFIG_SRCDIR(src/Stk.cpp)
AC_CONFIG_FILES(Makefile src/Makefile projects/demo/Makefile projects/effects/Makefile projects/ragamatic/Makefile projects/examples/Makefile projects/examples/libMakefile projects/eguitar/Makefile) AC_CONFIG_FILES(Makefile src/Makefile projects/demo/Makefile projects/effects/Makefile projects/ragamatic/Makefile projects/examples/Makefile projects/examples/libMakefile projects/eguitar/Makefile)

View File

@@ -2,7 +2,7 @@ The Synthesis ToolKit in C++ (STK)
By Perry R. Cook and Gary P. Scavone, 1995--2019. By Perry R. Cook and Gary P. Scavone, 1995--2019.
v.4.6.1 (18 April 2017) v.4.6.1 (18 April 2019)
- see github site for complete details (github.com/thestk/stk) - see github site for complete details (github.com/thestk/stk)
- various documentation updates - various documentation updates
- new Recorder (flute a la Verge) class (thanks to Mathias Bredholt) - new Recorder (flute a la Verge) class (thanks to Mathias Bredholt)

View File

@@ -7,6 +7,7 @@
and OSS), Macintosh OS X (CoreAudio and Jack), and Windows and OSS), Macintosh OS X (CoreAudio and Jack), and Windows
(DirectSound, ASIO and WASAPI) operating systems. (DirectSound, ASIO and WASAPI) operating systems.
RtAudio GitHub site: https://github.com/thestk/rtaudio
RtAudio WWW site: http://www.music.mcgill.ca/~gary/rtaudio/ RtAudio WWW site: http://www.music.mcgill.ca/~gary/rtaudio/
RtAudio: realtime audio i/o C++ classes RtAudio: realtime audio i/o C++ classes
@@ -45,7 +46,21 @@
#ifndef __RTAUDIO_H #ifndef __RTAUDIO_H
#define __RTAUDIO_H #define __RTAUDIO_H
#define RTAUDIO_VERSION "5.0.0" #define RTAUDIO_VERSION "5.1.0"
#if defined _WIN32 || defined __CYGWIN__
#if defined(RTAUDIO_EXPORT)
#define RTAUDIO_DLL_PUBLIC __declspec(dllexport)
#else
#define RTAUDIO_DLL_PUBLIC
#endif
#else
#if __GNUC__ >= 4
#define RTAUDIO_DLL_PUBLIC __attribute__( (visibility( "default" )) )
#else
#define RTAUDIO_DLL_PUBLIC
#endif
#endif
#include <string> #include <string>
#include <vector> #include <vector>
@@ -179,6 +194,7 @@ static const RtAudioStreamStatus RTAUDIO_OUTPUT_UNDERFLOW = 0x2; // The output
\param userData A pointer to optional data provided by the client \param userData A pointer to optional data provided by the client
when opening the stream (default = NULL). when opening the stream (default = NULL).
\return
To continue normal stream operation, the RtAudioCallback function To continue normal stream operation, the RtAudioCallback function
should return a value of zero. To stop the stream and drain the should return a value of zero. To stop the stream and drain the
output buffer, the function should return a value of one. To abort output buffer, the function should return a value of one. To abort
@@ -200,7 +216,7 @@ typedef int (*RtAudioCallback)( void *outputBuffer, void *inputBuffer,
*/ */
/************************************************************************/ /************************************************************************/
class RtAudioError : public std::runtime_error class RTAUDIO_DLL_PUBLIC RtAudioError : public std::runtime_error
{ {
public: public:
//! Defined RtAudioError types. //! Defined RtAudioError types.
@@ -260,7 +276,7 @@ typedef void (*RtAudioErrorCallback)( RtAudioError::Type type, const std::string
class RtApi; class RtApi;
class RtAudio class RTAUDIO_DLL_PUBLIC RtAudio
{ {
public: public:
@@ -271,11 +287,12 @@ class RtAudio
LINUX_PULSE, /*!< The Linux PulseAudio API. */ LINUX_PULSE, /*!< The Linux PulseAudio API. */
LINUX_OSS, /*!< The Linux Open Sound System API. */ LINUX_OSS, /*!< The Linux Open Sound System API. */
UNIX_JACK, /*!< The Jack Low-Latency Audio Server API. */ UNIX_JACK, /*!< The Jack Low-Latency Audio Server API. */
MACOSX_CORE, /*!< Macintosh OS-X CoreAudio API. */ MACOSX_CORE, /*!< Macintosh OS-X Core Audio API. */
WINDOWS_WASAPI, /*!< The Microsoft WASAPI API. */ WINDOWS_WASAPI, /*!< The Microsoft WASAPI API. */
WINDOWS_ASIO, /*!< The Steinberg Audio Stream I/O API. */ WINDOWS_ASIO, /*!< The Steinberg Audio Stream I/O API. */
WINDOWS_DS, /*!< The Microsoft DirectSound API. */ WINDOWS_DS, /*!< The Microsoft DirectSound API. */
RTAUDIO_DUMMY /*!< A compilable but non-functional API. */ RTAUDIO_DUMMY, /*!< A compilable but non-functional API. */
NUM_APIS /*!< Number of values in this enum. */
}; };
//! The public device information structure for returning queried values. //! The public device information structure for returning queried values.
@@ -387,6 +404,29 @@ class RtAudio
*/ */
static void getCompiledApi( std::vector<RtAudio::Api> &apis ); static void getCompiledApi( std::vector<RtAudio::Api> &apis );
//! Return the name of a specified compiled audio API.
/*!
This obtains a short lower-case name used for identification purposes.
This value is guaranteed to remain identical across library versions.
If the API is unknown, this function will return the empty string.
*/
static std::string getApiName( RtAudio::Api api );
//! Return the display name of a specified compiled audio API.
/*!
This obtains a long name used for display purposes.
If the API is unknown, this function will return the empty string.
*/
static std::string getApiDisplayName( RtAudio::Api api );
//! Return the compiled audio API having the given name.
/*!
A case insensitive comparison will check the specified name
against the list of compiled APIs, and return the one which
matches. On failure, the function returns UNSPECIFIED.
*/
static RtAudio::Api getCompiledApiByName( const std::string &name );
//! The class constructor. //! The class constructor.
/*! /*!
The constructor performs minor initialization tasks. An exception The constructor performs minor initialization tasks. An exception
@@ -583,6 +623,7 @@ class RtAudio
#endif #endif
#include <windows.h> #include <windows.h>
#include <process.h> #include <process.h>
#include <stdint.h>
typedef uintptr_t ThreadHandle; typedef uintptr_t ThreadHandle;
typedef CRITICAL_SECTION StreamMutex; typedef CRITICAL_SECTION StreamMutex;
@@ -651,7 +692,6 @@ class S24 {
return *this; return *this;
} }
S24( const S24& v ) { *this = v; }
S24( const double& d ) { *this = (int) d; } S24( const double& d ) { *this = (int) d; }
S24( const float& f ) { *this = (int) f; } S24( const float& f ) { *this = (int) f; }
S24( const signed short& s ) { *this = (int) s; } S24( const signed short& s ) { *this = (int) s; }
@@ -671,7 +711,7 @@ class S24 {
#include <sstream> #include <sstream>
class RtApi class RTAUDIO_DLL_PUBLIC RtApi
{ {
public: public:
@@ -864,7 +904,6 @@ public:
void startStream( void ); void startStream( void );
void stopStream( void ); void stopStream( void );
void abortStream( void ); void abortStream( void );
long getStreamLatency( void );
// This function is intended for internal use only. It must be // This function is intended for internal use only. It must be
// public because it is called by the internal callback handler, // public because it is called by the internal callback handler,
@@ -900,7 +939,6 @@ public:
void startStream( void ); void startStream( void );
void stopStream( void ); void stopStream( void );
void abortStream( void ); void abortStream( void );
long getStreamLatency( void );
// This function is intended for internal use only. It must be // This function is intended for internal use only. It must be
// public because it is called by the internal callback handler, // public because it is called by the internal callback handler,
@@ -935,7 +973,6 @@ public:
void startStream( void ); void startStream( void );
void stopStream( void ); void stopStream( void );
void abortStream( void ); void abortStream( void );
long getStreamLatency( void );
// This function is intended for internal use only. It must be // This function is intended for internal use only. It must be
// public because it is called by the internal callback handler, // public because it is called by the internal callback handler,
@@ -973,7 +1010,6 @@ public:
void startStream( void ); void startStream( void );
void stopStream( void ); void stopStream( void );
void abortStream( void ); void abortStream( void );
long getStreamLatency( void );
// This function is intended for internal use only. It must be // This function is intended for internal use only. It must be
// public because it is called by the internal callback handler, // public because it is called by the internal callback handler,
@@ -1003,7 +1039,7 @@ class RtApiWasapi : public RtApi
{ {
public: public:
RtApiWasapi(); RtApiWasapi();
~RtApiWasapi(); virtual ~RtApiWasapi();
RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_WASAPI; } RtAudio::Api getCurrentApi( void ) { return RtAudio::WINDOWS_WASAPI; }
unsigned int getDeviceCount( void ); unsigned int getDeviceCount( void );

View File

@@ -5,7 +5,8 @@
This class implements some common functionality for the realtime This class implements some common functionality for the realtime
MIDI input/output subclasses RtMidiIn and RtMidiOut. MIDI input/output subclasses RtMidiIn and RtMidiOut.
RtMidi WWW site: http://music.mcgill.ca/~gary/rtmidi/ RtMidi GitHub site: https://github.com/thestk/rtmidi
RtMidi WWW site: http://www.music.mcgill.ca/~gary/rtmidi/
RtMidi: realtime MIDI i/o C++ classes RtMidi: realtime MIDI i/o C++ classes
Copyright (c) 2003-2019 Gary P. Scavone Copyright (c) 2003-2019 Gary P. Scavone
@@ -43,7 +44,21 @@
#ifndef RTMIDI_H #ifndef RTMIDI_H
#define RTMIDI_H #define RTMIDI_H
#define RTMIDI_VERSION "3.0.0" #if defined _WIN32 || defined __CYGWIN__
#if defined(RTMIDI_EXPORT)
#define RTMIDI_DLL_PUBLIC __declspec(dllexport)
#else
#define RTMIDI_DLL_PUBLIC
#endif
#else
#if __GNUC__ >= 4
#define RTMIDI_DLL_PUBLIC __attribute__( (visibility( "default" )) )
#else
#define RTMIDI_DLL_PUBLIC
#endif
#endif
#define RTMIDI_VERSION "4.0.0"
#include <exception> #include <exception>
#include <iostream> #include <iostream>
@@ -60,7 +75,7 @@
*/ */
/************************************************************************/ /************************************************************************/
class RtMidiError : public std::exception class RTMIDI_DLL_PUBLIC RtMidiError : public std::exception
{ {
public: public:
//! Defined RtMidiError types. //! Defined RtMidiError types.
@@ -79,8 +94,9 @@ class RtMidiError : public std::exception
}; };
//! The constructor. //! The constructor.
RtMidiError( const std::string& message, Type type = RtMidiError::UNSPECIFIED ) throw() : message_(message), type_(type) {} RtMidiError( const std::string& message, Type type = RtMidiError::UNSPECIFIED ) throw()
: message_(message), type_(type) {}
//! The destructor. //! The destructor.
virtual ~RtMidiError( void ) throw() {} virtual ~RtMidiError( void ) throw() {}
@@ -88,10 +104,10 @@ class RtMidiError : public std::exception
virtual void printMessage( void ) const throw() { std::cerr << '\n' << message_ << "\n\n"; } virtual void printMessage( void ) const throw() { std::cerr << '\n' << message_ << "\n\n"; }
//! Returns the thrown error message type. //! Returns the thrown error message type.
virtual const Type& getType(void) const throw() { return type_; } virtual const Type& getType( void ) const throw() { return type_; }
//! Returns the thrown error message string. //! Returns the thrown error message string.
virtual const std::string& getMessage(void) const throw() { return message_; } virtual const std::string& getMessage( void ) const throw() { return message_; }
//! Returns the thrown error message as a c-style string. //! Returns the thrown error message as a c-style string.
virtual const char* what( void ) const throw() { return message_.c_str(); } virtual const char* what( void ) const throw() { return message_.c_str(); }
@@ -113,10 +129,9 @@ typedef void (*RtMidiErrorCallback)( RtMidiError::Type type, const std::string &
class MidiApi; class MidiApi;
class RtMidi class RTMIDI_DLL_PUBLIC RtMidi
{ {
public: public:
//! MIDI API specifier arguments. //! MIDI API specifier arguments.
enum Api { enum Api {
UNSPECIFIED, /*!< Search for a working compiled API. */ UNSPECIFIED, /*!< Search for a working compiled API. */
@@ -124,7 +139,8 @@ class RtMidi
LINUX_ALSA, /*!< The Advanced Linux Sound Architecture API. */ LINUX_ALSA, /*!< The Advanced Linux Sound Architecture API. */
UNIX_JACK, /*!< The JACK Low-Latency MIDI Server API. */ UNIX_JACK, /*!< The JACK Low-Latency MIDI Server API. */
WINDOWS_MM, /*!< The Microsoft Multimedia MIDI API. */ WINDOWS_MM, /*!< The Microsoft Multimedia MIDI API. */
RTMIDI_DUMMY /*!< A compilable but non-functional API. */ RTMIDI_DUMMY, /*!< A compilable but non-functional API. */
NUM_APIS /*!< Number of values in this enum. */
}; };
//! A static function to determine the current RtMidi version. //! A static function to determine the current RtMidi version.
@@ -138,6 +154,29 @@ class RtMidi
*/ */
static void getCompiledApi( std::vector<RtMidi::Api> &apis ) throw(); static void getCompiledApi( std::vector<RtMidi::Api> &apis ) throw();
//! Return the name of a specified compiled MIDI API.
/*!
This obtains a short lower-case name used for identification purposes.
This value is guaranteed to remain identical across library versions.
If the API is unknown, this function will return the empty string.
*/
static std::string getApiName( RtMidi::Api api );
//! Return the display name of a specified compiled MIDI API.
/*!
This obtains a long name used for display purposes.
If the API is unknown, this function will return the empty string.
*/
static std::string getApiDisplayName( RtMidi::Api api );
//! Return the compiled MIDI API having the given name.
/*!
A case insensitive comparison will check the specified name
against the list of compiled APIs, and return the one which
matches. On failure, the function returns UNSPECIFIED.
*/
static RtMidi::Api getCompiledApiByName( const std::string &name );
//! Pure virtual openPort() function. //! Pure virtual openPort() function.
virtual void openPort( unsigned int portNumber = 0, const std::string &portName = std::string( "RtMidi" ) ) = 0; virtual void openPort( unsigned int portNumber = 0, const std::string &portName = std::string( "RtMidi" ) ) = 0;
@@ -153,6 +192,9 @@ class RtMidi
//! Pure virtual closePort() function. //! Pure virtual closePort() function.
virtual void closePort( void ) = 0; virtual void closePort( void ) = 0;
void setClientName( const std::string &clientName );
void setPortName( const std::string &portName );
//! Returns true if a port is open and false if not. //! Returns true if a port is open and false if not.
/*! /*!
Note that this only applies to connections made with the openPort() Note that this only applies to connections made with the openPort()
@@ -168,10 +210,8 @@ class RtMidi
virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 ) = 0; virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 ) = 0;
protected: protected:
RtMidi(); RtMidi();
virtual ~RtMidi(); virtual ~RtMidi();
MidiApi *rtapi_; MidiApi *rtapi_;
}; };
@@ -188,8 +228,6 @@ class RtMidi
time. With the OS-X, Linux ALSA, and JACK MIDI APIs, it is also time. With the OS-X, Linux ALSA, and JACK MIDI APIs, it is also
possible to open a virtual input port to which other MIDI software possible to open a virtual input port to which other MIDI software
clients can connect. clients can connect.
by Gary P. Scavone, 2003-2019.
*/ */
/**********************************************************************/ /**********************************************************************/
@@ -207,12 +245,12 @@ class RtMidi
// //
// **************************************************************** // // **************************************************************** //
class RtMidiIn : public RtMidi class RTMIDI_DLL_PUBLIC RtMidiIn : public RtMidi
{ {
public: public:
//! User callback function type definition. //! User callback function type definition.
typedef void (*RtMidiCallback)( double timeStamp, std::vector<unsigned char> *message, void *userData); typedef void (*RtMidiCallback)( double timeStamp, std::vector<unsigned char> *message, void *userData );
//! Default constructor that allows an optional api, client name and queue size. //! Default constructor that allows an optional api, client name and queue size.
/*! /*!
@@ -335,7 +373,6 @@ class RtMidiIn : public RtMidi
protected: protected:
void openMidiApi( RtMidi::Api api, const std::string &clientName, unsigned int queueSizeLimit ); void openMidiApi( RtMidi::Api api, const std::string &clientName, unsigned int queueSizeLimit );
}; };
/**********************************************************************/ /**********************************************************************/
@@ -349,15 +386,12 @@ class RtMidiIn : public RtMidi
connect to more than one MIDI device at the same time. With the connect to more than one MIDI device at the same time. With the
OS-X, Linux ALSA and JACK MIDI APIs, it is also possible to open a OS-X, Linux ALSA and JACK MIDI APIs, it is also possible to open a
virtual port to which other MIDI software clients can connect. virtual port to which other MIDI software clients can connect.
by Gary P. Scavone, 2003-2019.
*/ */
/**********************************************************************/ /**********************************************************************/
class RtMidiOut : public RtMidi class RTMIDI_DLL_PUBLIC RtMidiOut : public RtMidi
{ {
public: public:
//! Default constructor that allows an optional client name. //! Default constructor that allows an optional client name.
/*! /*!
An exception will be thrown if a MIDI system initialization error occurs. An exception will be thrown if a MIDI system initialization error occurs.
@@ -458,7 +492,7 @@ class RtMidiOut : public RtMidi
// //
// **************************************************************** // // **************************************************************** //
class MidiApi class RTMIDI_DLL_PUBLIC MidiApi
{ {
public: public:
@@ -468,6 +502,8 @@ class MidiApi
virtual void openPort( unsigned int portNumber, const std::string &portName ) = 0; virtual void openPort( unsigned int portNumber, const std::string &portName ) = 0;
virtual void openVirtualPort( const std::string &portName ) = 0; virtual void openVirtualPort( const std::string &portName ) = 0;
virtual void closePort( void ) = 0; virtual void closePort( void ) = 0;
virtual void setClientName( const std::string &clientName ) = 0;
virtual void setPortName( const std::string &portName ) = 0;
virtual unsigned int getPortCount( void ) = 0; virtual unsigned int getPortCount( void ) = 0;
virtual std::string getPortName( unsigned int portNumber ) = 0; virtual std::string getPortName( unsigned int portNumber ) = 0;
@@ -489,7 +525,7 @@ protected:
void *errorCallbackUserData_; void *errorCallbackUserData_;
}; };
class MidiInApi : public MidiApi class RTMIDI_DLL_PUBLIC MidiInApi : public MidiApi
{ {
public: public:
@@ -502,15 +538,15 @@ class MidiInApi : public MidiApi
// A MIDI structure used internally by the class to store incoming // A MIDI structure used internally by the class to store incoming
// messages. Each message represents one and only one MIDI message. // messages. Each message represents one and only one MIDI message.
struct MidiMessage { struct MidiMessage {
std::vector<unsigned char> bytes; std::vector<unsigned char> bytes;
//! Time in seconds elapsed since the previous message //! Time in seconds elapsed since the previous message
double timeStamp; double timeStamp;
// Default constructor. // Default constructor.
MidiMessage() MidiMessage()
:bytes(0), timeStamp(0.0) {} : bytes(0), timeStamp(0.0) {}
}; };
struct MidiQueue { struct MidiQueue {
@@ -520,12 +556,11 @@ class MidiInApi : public MidiApi
MidiMessage *ring; MidiMessage *ring;
// Default constructor. // Default constructor.
MidiQueue() MidiQueue()
:front(0), back(0), ringSize(0), ring(0) {} : front(0), back(0), ringSize(0), ring(0) {}
bool push(const MidiMessage&); bool push( const MidiMessage& );
bool pop(std::vector<unsigned char>*, double*); bool pop( std::vector<unsigned char>*, double* );
unsigned int size(unsigned int *back=0, unsigned int size( unsigned int *back=0, unsigned int *front=0 );
unsigned int *front=0);
}; };
// The RtMidiInData structure is used to pass private class data to // The RtMidiInData structure is used to pass private class data to
@@ -543,17 +578,16 @@ class MidiInApi : public MidiApi
bool continueSysex; bool continueSysex;
// Default constructor. // Default constructor.
RtMidiInData() RtMidiInData()
: ignoreFlags(7), doInput(false), firstMessage(true), : ignoreFlags(7), doInput(false), firstMessage(true), apiData(0), usingCallback(false),
apiData(0), usingCallback(false), userCallback(0), userData(0), userCallback(0), userData(0), continueSysex(false) {}
continueSysex(false) {}
}; };
protected: protected:
RtMidiInData inputData_; RtMidiInData inputData_;
}; };
class MidiOutApi : public MidiApi class RTMIDI_DLL_PUBLIC MidiOutApi : public MidiApi
{ {
public: public:
@@ -573,12 +607,12 @@ inline void RtMidiIn :: openPort( unsigned int portNumber, const std::string &po
inline void RtMidiIn :: openVirtualPort( const std::string &portName ) { rtapi_->openVirtualPort( portName ); } inline void RtMidiIn :: openVirtualPort( const std::string &portName ) { rtapi_->openVirtualPort( portName ); }
inline void RtMidiIn :: closePort( void ) { rtapi_->closePort(); } inline void RtMidiIn :: closePort( void ) { rtapi_->closePort(); }
inline bool RtMidiIn :: isPortOpen() const { return rtapi_->isPortOpen(); } inline bool RtMidiIn :: isPortOpen() const { return rtapi_->isPortOpen(); }
inline void RtMidiIn :: setCallback( RtMidiCallback callback, void *userData ) { ((MidiInApi *)rtapi_)->setCallback( callback, userData ); } inline void RtMidiIn :: setCallback( RtMidiCallback callback, void *userData ) { static_cast<MidiInApi *>(rtapi_)->setCallback( callback, userData ); }
inline void RtMidiIn :: cancelCallback( void ) { ((MidiInApi *)rtapi_)->cancelCallback(); } inline void RtMidiIn :: cancelCallback( void ) { static_cast<MidiInApi *>(rtapi_)->cancelCallback(); }
inline unsigned int RtMidiIn :: getPortCount( void ) { return rtapi_->getPortCount(); } inline unsigned int RtMidiIn :: getPortCount( void ) { return rtapi_->getPortCount(); }
inline std::string RtMidiIn :: getPortName( unsigned int portNumber ) { return rtapi_->getPortName( portNumber ); } inline std::string RtMidiIn :: getPortName( unsigned int portNumber ) { return rtapi_->getPortName( portNumber ); }
inline void RtMidiIn :: ignoreTypes( bool midiSysex, bool midiTime, bool midiSense ) { ((MidiInApi *)rtapi_)->ignoreTypes( midiSysex, midiTime, midiSense ); } inline void RtMidiIn :: ignoreTypes( bool midiSysex, bool midiTime, bool midiSense ) { static_cast<MidiInApi *>(rtapi_)->ignoreTypes( midiSysex, midiTime, midiSense ); }
inline double RtMidiIn :: getMessage( std::vector<unsigned char> *message ) { return ((MidiInApi *)rtapi_)->getMessage( message ); } inline double RtMidiIn :: getMessage( std::vector<unsigned char> *message ) { return static_cast<MidiInApi *>(rtapi_)->getMessage( message ); }
inline void RtMidiIn :: setErrorCallback( RtMidiErrorCallback errorCallback, void *userData ) { rtapi_->setErrorCallback(errorCallback, userData); } inline void RtMidiIn :: setErrorCallback( RtMidiErrorCallback errorCallback, void *userData ) { rtapi_->setErrorCallback(errorCallback, userData); }
inline RtMidi::Api RtMidiOut :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); } inline RtMidi::Api RtMidiOut :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); }
@@ -588,207 +622,8 @@ inline void RtMidiOut :: closePort( void ) { rtapi_->closePort(); }
inline bool RtMidiOut :: isPortOpen() const { return rtapi_->isPortOpen(); } inline bool RtMidiOut :: isPortOpen() const { return rtapi_->isPortOpen(); }
inline unsigned int RtMidiOut :: getPortCount( void ) { return rtapi_->getPortCount(); } inline unsigned int RtMidiOut :: getPortCount( void ) { return rtapi_->getPortCount(); }
inline std::string RtMidiOut :: getPortName( unsigned int portNumber ) { return rtapi_->getPortName( portNumber ); } inline std::string RtMidiOut :: getPortName( unsigned int portNumber ) { return rtapi_->getPortName( portNumber ); }
inline void RtMidiOut :: sendMessage( const std::vector<unsigned char> *message ) { ((MidiOutApi *)rtapi_)->sendMessage( &message->at(0), message->size() ); } inline void RtMidiOut :: sendMessage( const std::vector<unsigned char> *message ) { static_cast<MidiOutApi *>(rtapi_)->sendMessage( &message->at(0), message->size() ); }
inline void RtMidiOut :: sendMessage( const unsigned char *message, size_t size ) { ((MidiOutApi *)rtapi_)->sendMessage( message, size ); } inline void RtMidiOut :: sendMessage( const unsigned char *message, size_t size ) { static_cast<MidiOutApi *>(rtapi_)->sendMessage( message, size ); }
inline void RtMidiOut :: setErrorCallback( RtMidiErrorCallback errorCallback, void *userData ) { rtapi_->setErrorCallback(errorCallback, userData); } inline void RtMidiOut :: setErrorCallback( RtMidiErrorCallback errorCallback, void *userData ) { rtapi_->setErrorCallback(errorCallback, userData); }
// **************************************************************** //
//
// MidiInApi and MidiOutApi subclass prototypes.
//
// **************************************************************** //
#if !defined(__LINUX_ALSA__) && !defined(__UNIX_JACK__) && !defined(__MACOSX_CORE__) && !defined(__WINDOWS_MM__)
#define __RTMIDI_DUMMY__
#endif
#if defined(__MACOSX_CORE__)
class MidiInCore: public MidiInApi
{
public:
MidiInCore( const std::string &clientName, unsigned int queueSizeLimit );
~MidiInCore( void );
RtMidi::Api getCurrentApi( void ) { return RtMidi::MACOSX_CORE; };
void openPort( unsigned int portNumber, const std::string &portName );
void openVirtualPort( const std::string &portName );
void closePort( void );
unsigned int getPortCount( void );
std::string getPortName( unsigned int portNumber );
protected:
void initialize( const std::string& clientName );
};
class MidiOutCore: public MidiOutApi
{
public:
MidiOutCore( const std::string &clientName );
~MidiOutCore( void );
RtMidi::Api getCurrentApi( void ) { return RtMidi::MACOSX_CORE; };
void openPort( unsigned int portNumber, const std::string &portName );
void openVirtualPort( const std::string &portName );
void closePort( void );
unsigned int getPortCount( void );
std::string getPortName( unsigned int portNumber );
void sendMessage( const unsigned char *message, size_t size );
protected:
void initialize( const std::string& clientName );
};
#endif
#if defined(__UNIX_JACK__)
class MidiInJack: public MidiInApi
{
public:
MidiInJack( const std::string &clientName, unsigned int queueSizeLimit );
~MidiInJack( void );
RtMidi::Api getCurrentApi( void ) { return RtMidi::UNIX_JACK; };
void openPort( unsigned int portNumber, const std::string &portName );
void openVirtualPort( const std::string &portName );
void closePort( void );
unsigned int getPortCount( void );
std::string getPortName( unsigned int portNumber );
protected:
std::string clientName;
void connect( void );
void initialize( const std::string& clientName );
};
class MidiOutJack: public MidiOutApi
{
public:
MidiOutJack( const std::string &clientName );
~MidiOutJack( void );
RtMidi::Api getCurrentApi( void ) { return RtMidi::UNIX_JACK; };
void openPort( unsigned int portNumber, const std::string &portName );
void openVirtualPort( const std::string &portName );
void closePort( void );
unsigned int getPortCount( void );
std::string getPortName( unsigned int portNumber );
void sendMessage( const unsigned char *message, size_t size );
protected:
std::string clientName;
void connect( void );
void initialize( const std::string& clientName );
};
#endif
#if defined(__LINUX_ALSA__)
class MidiInAlsa: public MidiInApi
{
public:
MidiInAlsa( const std::string &clientName, unsigned int queueSizeLimit );
~MidiInAlsa( void );
RtMidi::Api getCurrentApi( void ) { return RtMidi::LINUX_ALSA; };
void openPort( unsigned int portNumber, const std::string &portName );
void openVirtualPort( const std::string &portName );
void closePort( void );
unsigned int getPortCount( void );
std::string getPortName( unsigned int portNumber );
protected:
void initialize( const std::string& clientName );
};
class MidiOutAlsa: public MidiOutApi
{
public:
MidiOutAlsa( const std::string &clientName );
~MidiOutAlsa( void );
RtMidi::Api getCurrentApi( void ) { return RtMidi::LINUX_ALSA; };
void openPort( unsigned int portNumber, const std::string &portName );
void openVirtualPort( const std::string &portName );
void closePort( void );
unsigned int getPortCount( void );
std::string getPortName( unsigned int portNumber );
void sendMessage( const unsigned char *message, size_t size );
protected:
void initialize( const std::string& clientName );
};
#endif
#if defined(__WINDOWS_MM__)
class MidiInWinMM: public MidiInApi
{
public:
MidiInWinMM( const std::string &clientName, unsigned int queueSizeLimit );
~MidiInWinMM( void );
RtMidi::Api getCurrentApi( void ) { return RtMidi::WINDOWS_MM; };
void openPort( unsigned int portNumber, const std::string &portName );
void openVirtualPort( const std::string &portName );
void closePort( void );
unsigned int getPortCount( void );
std::string getPortName( unsigned int portNumber );
protected:
void initialize( const std::string& clientName );
};
class MidiOutWinMM: public MidiOutApi
{
public:
MidiOutWinMM( const std::string &clientName );
~MidiOutWinMM( void );
RtMidi::Api getCurrentApi( void ) { return RtMidi::WINDOWS_MM; };
void openPort( unsigned int portNumber, const std::string &portName );
void openVirtualPort( const std::string &portName );
void closePort( void );
unsigned int getPortCount( void );
std::string getPortName( unsigned int portNumber );
void sendMessage( const unsigned char *message, size_t size );
protected:
void initialize( const std::string& clientName );
};
#endif
#if defined(__RTMIDI_DUMMY__)
class MidiInDummy: public MidiInApi
{
public:
MidiInDummy( const std::string &/*clientName*/, unsigned int queueSizeLimit ) : MidiInApi( queueSizeLimit ) { errorString_ = "MidiInDummy: This class provides no functionality."; error( RtMidiError::WARNING, errorString_ ); }
RtMidi::Api getCurrentApi( void ) { return RtMidi::RTMIDI_DUMMY; }
void openPort( unsigned int /*portNumber*/, const std::string &/*portName*/ ) {}
void openVirtualPort( const std::string &/*portName*/ ) {}
void closePort( void ) {}
unsigned int getPortCount( void ) { return 0; }
std::string getPortName( unsigned int /*portNumber*/ ) { return ""; }
protected:
void initialize( const std::string& /*clientName*/ ) {}
};
class MidiOutDummy: public MidiOutApi
{
public:
MidiOutDummy( const std::string &/*clientName*/ ) { errorString_ = "MidiOutDummy: This class provides no functionality."; error( RtMidiError::WARNING, errorString_ ); }
RtMidi::Api getCurrentApi( void ) { return RtMidi::RTMIDI_DUMMY; }
void openPort( unsigned int /*portNumber*/, const std::string &/*portName*/ ) {}
void openVirtualPort( const std::string &/*portName*/ ) {}
void closePort( void ) {}
unsigned int getPortCount( void ) { return 0; }
std::string getPortName( unsigned int /*portNumber*/ ) { return ""; }
void sendMessage( const unsigned char * /*message*/, size_t /*size*/ ) {}
protected:
void initialize( const std::string& /*clientName*/ ) {}
};
#endif
#endif #endif

View File

@@ -1,5 +1,5 @@
# Tcl/Tk Demo GUI for the Synthesis Toolkit (STK) # Tcl/Tk Demo GUI for the Synthesis Toolkit (STK)
# by Gary P. Scavone, CCRMA, Stanford University, 1995--2017. # by Gary P. Scavone, CCRMA, CAML, Stanford & McGill Universities, 1995--2019.
# Set initial control values # Set initial control values
set pitch 64.0 set pitch 64.0

View File

@@ -1,6 +1,6 @@
The Synthesis ToolKit in C++ (STK) The Synthesis ToolKit in C++ (STK)
By Perry R. Cook and Gary P. Scavone, 1995--2017. By Perry R. Cook and Gary P. Scavone, 1995--2019.
EFFECTS PROJECT: EFFECTS PROJECT:

View File

@@ -13,7 +13,7 @@
Stanford, bearing the names of Karplus and/or Stanford, bearing the names of Karplus and/or
Strong. Strong.
by Perry R. Cook and Gary P. Scavone, 1995--2017. by Perry R. Cook and Gary P. Scavone, 1995--2019.
*/ */
/***************************************************/ /***************************************************/

View File

@@ -24,7 +24,7 @@ namespace stk {
Stanford, bearing the names of Karplus and/or Stanford, bearing the names of Karplus and/or
Strong. Strong.
by Perry R. Cook and Gary P. Scavone, 1995--2017. by Perry R. Cook and Gary P. Scavone, 1995--2019.
*/ */
/***************************************************/ /***************************************************/

View File

@@ -8,7 +8,7 @@
sample rates. You can specify the maximum polyphony (maximum sample rates. You can specify the maximum polyphony (maximum
number of simultaneous voices) in Tabla.h. number of simultaneous voices) in Tabla.h.
by Perry R. Cook and Gary P. Scavone, 1995--2017. by Perry R. Cook and Gary P. Scavone, 1995--2019.
*/ */
/***************************************************/ /***************************************************/

View File

@@ -17,7 +17,7 @@ namespace stk {
sample rates. You can specify the maximum polyphony (maximum sample rates. You can specify the maximum polyphony (maximum
number of simultaneous voices) in Tabla.h. number of simultaneous voices) in Tabla.h.
by Perry R. Cook and Gary P. Scavone, 1995--2017. by Perry R. Cook and Gary P. Scavone, 1995--2019.
*/ */
/***************************************************/ /***************************************************/

View File

@@ -8,7 +8,7 @@
sample rates. You can specify the maximum polyphony (maximum sample rates. You can specify the maximum polyphony (maximum
number of simultaneous voices) in VoicDrum.h. number of simultaneous voices) in VoicDrum.h.
by Perry R. Cook and Gary P. Scavone, 1995--2017. by Perry R. Cook and Gary P. Scavone, 1995--2019.
*/ */
/***************************************************/ /***************************************************/

View File

@@ -17,7 +17,7 @@ namespace stk {
sample rates. You can specify the maximum polyphony (maximum sample rates. You can specify the maximum polyphony (maximum
number of simultaneous voices) in VoicDrum.h. number of simultaneous voices) in VoicDrum.h.
by Perry R. Cook and Gary P. Scavone, 1995--2017. by Perry R. Cook and Gary P. Scavone, 1995--2019.
*/ */
/***************************************************/ /***************************************************/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff