Added new versions of RtAudio and RtMidi, updated RtWvIn and RtWvOut for new API, updated demo project for new API.

This commit is contained in:
garyscavone
2023-08-04 09:44:26 -04:00
parent 2af2f1c816
commit 8b29e0ea6d
15 changed files with 4225 additions and 2579 deletions

View File

@@ -9,7 +9,7 @@
RtMidi WWW site: http://www.music.mcgill.ca/~gary/rtmidi/
RtMidi: realtime MIDI i/o C++ classes
Copyright (c) 2003-2021 Gary P. Scavone
Copyright (c) 2003-2023 Gary P. Scavone
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
@@ -58,7 +58,24 @@
#endif
#endif
#define RTMIDI_VERSION "5.0.0"
#define RTMIDI_VERSION_MAJOR 6
#define RTMIDI_VERSION_MINOR 0
#define RTMIDI_VERSION_PATCH 0
#define RTMIDI_VERSION_BETA 0
#define RTMIDI_TOSTRING2(n) #n
#define RTMIDI_TOSTRING(n) RTMIDI_TOSTRING2(n)
#if RTMIDI_VERSION_BETA > 0
#define RTMIDI_VERSION RTMIDI_TOSTRING(RTMIDI_VERSION_MAJOR) \
"." RTMIDI_TOSTRING(RTMIDI_VERSION_MINOR) \
"." RTMIDI_TOSTRING(RTMIDI_VERSION_PATCH) \
"beta" RTMIDI_TOSTRING(RTMIDI_VERSION_BETA)
#else
#define RTMIDI_VERSION RTMIDI_TOSTRING(RTMIDI_VERSION_MAJOR) \
"." RTMIDI_TOSTRING(RTMIDI_VERSION_MINOR) \
"." RTMIDI_TOSTRING(RTMIDI_VERSION_PATCH)
#endif
#include <exception>
#include <iostream>
@@ -86,12 +103,12 @@ class RTMIDI_DLL_PUBLIC RtMidiError : public std::exception
UNSPECIFIED, /*!< The default, unspecified error type. */
NO_DEVICES_FOUND, /*!< No devices found on system. */
INVALID_DEVICE, /*!< An invalid device ID was specified. */
MEMORY_ERROR, /*!< An error occured during memory allocation. */
MEMORY_ERROR, /*!< An error occurred during memory allocation. */
INVALID_PARAMETER, /*!< An invalid parameter was specified to a function. */
INVALID_USE, /*!< The function was called incorrectly. */
DRIVER_ERROR, /*!< A system driver error occured. */
SYSTEM_ERROR, /*!< A system error occured. */
THREAD_ERROR /*!< A thread error occured. */
DRIVER_ERROR, /*!< A system driver error occurred. */
SYSTEM_ERROR, /*!< A system error occurred. */
THREAD_ERROR /*!< A thread error occurred. */
};
//! The constructor.
@@ -144,6 +161,8 @@ class RTMIDI_DLL_PUBLIC RtMidi
WINDOWS_MM, /*!< The Microsoft Multimedia MIDI API. */
RTMIDI_DUMMY, /*!< A compilable but non-functional API. */
WEB_MIDI_API, /*!< W3C Web MIDI API. */
WINDOWS_UWP, /*!< The Microsoft Universal Windows Platform MIDI API. */
ANDROID_AMIDI, /*!< Native Android MIDI API. */
NUM_APIS /*!< Number of values in this enum. */
};
@@ -206,9 +225,9 @@ class RTMIDI_DLL_PUBLIC RtMidi
*/
virtual bool isPortOpen( void ) const = 0;
//! Set an error callback function to be invoked when an error has occured.
//! Set an error callback function to be invoked when an error has occurred.
/*!
The callback function will be called whenever an error has occured. It is best
The callback function will be called whenever an error has occurred. It is best
to set the error callback function before opening a port.
*/
virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 ) = 0;
@@ -373,9 +392,9 @@ class RTMIDI_DLL_PUBLIC RtMidiIn : public RtMidi
*/
double getMessage( std::vector<unsigned char> *message );
//! Set an error callback function to be invoked when an error has occured.
//! Set an error callback function to be invoked when an error has occurred.
/*!
The callback function will be called whenever an error has occured. It is best
The callback function will be called whenever an error has occurred. It is best
to set the error callback function before opening a port.
*/
virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 );
@@ -491,9 +510,9 @@ class RTMIDI_DLL_PUBLIC RtMidiOut : public RtMidi
*/
void sendMessage( const unsigned char *message, size_t size );
//! Set an error callback function to be invoked when an error has occured.
//! Set an error callback function to be invoked when an error has occurred.
/*!
The callback function will be called whenever an error has occured. It is best
The callback function will be called whenever an error has occurred. It is best
to set the error callback function before opening a port.
*/
virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 );
@@ -559,7 +578,7 @@ class RTMIDI_DLL_PUBLIC MidiInApi : public MidiApi
void setCallback( RtMidiIn::RtMidiCallback callback, void *userData );
void cancelCallback( void );
virtual void ignoreTypes( bool midiSysex, bool midiTime, bool midiSense );
double getMessage( std::vector<unsigned char> *message );
virtual double getMessage( std::vector<unsigned char> *message );
virtual void setBufferSize( unsigned int size, unsigned int count );
// A MIDI structure used internally by the class to store incoming