summaryrefslogtreecommitdiff
path: root/libs/backends
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-10-04 14:51:05 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-10-04 14:51:05 -0400
commit4dc63966f0872efe768dad61eb9b8785d06b92d1 (patch)
treee54104d57d6c2da7840979181368151fd0819c96 /libs/backends
parent297e80e020da94a56984b20782584bb1dd96ea34 (diff)
globally remove all trailing whitespace from ardour code base.
Paul Davis was responsible for introducing almost all of this.
Diffstat (limited to 'libs/backends')
-rw-r--r--libs/backends/asio/asio_backend.cc2
-rw-r--r--libs/backends/coreaudio/coremidi_io.h8
-rw-r--r--libs/backends/jack/jack_api.cc2
-rw-r--r--libs/backends/jack/jack_audiobackend.cc24
-rw-r--r--libs/backends/jack/jack_audiobackend.h20
-rw-r--r--libs/backends/jack/jack_connection.cc2
-rw-r--r--libs/backends/jack/jack_connection.h2
-rw-r--r--libs/backends/jack/jack_portengine.cc6
-rw-r--r--libs/backends/jack/jack_session.cc2
-rw-r--r--libs/backends/jack/jack_session.h2
-rw-r--r--libs/backends/jack/jack_utils.cc4
-rw-r--r--libs/backends/wavesaudio/portmidi/pmutil.h36
-rw-r--r--libs/backends/wavesaudio/portmidi/portmidi.h196
-rw-r--r--libs/backends/wavesaudio/portmidi/porttime.h8
-rw-r--r--libs/backends/wavesaudio/portmidi/src/pm_common/pminternal.h22
-rw-r--r--libs/backends/wavesaudio/portmidi/src/pm_common/pmutil.c26
-rw-r--r--libs/backends/wavesaudio/portmidi/src/pm_common/portmidi.c176
-rw-r--r--libs/backends/wavesaudio/portmidi/src/pm_mac/pmmac.c6
-rw-r--r--libs/backends/wavesaudio/portmidi/src/pm_mac/pmmacosxcm.c154
-rw-r--r--libs/backends/wavesaudio/portmidi/src/pm_mac/readbinaryplist.c218
-rw-r--r--libs/backends/wavesaudio/portmidi/src/pm_mac/readbinaryplist.h4
-rw-r--r--libs/backends/wavesaudio/portmidi/src/pm_win/pmwin.c16
-rw-r--r--libs/backends/wavesaudio/portmidi/src/pm_win/pmwinmm.c74
-rw-r--r--libs/backends/wavesaudio/portmidi/src/porttime/ptmacosx_mach.c8
-rw-r--r--libs/backends/wavesaudio/portmidi/src/porttime/ptwinmm.c6
-rw-r--r--libs/backends/wavesaudio/waves_audiobackend.cc212
-rw-r--r--libs/backends/wavesaudio/waves_audiobackend.h72
-rw-r--r--libs/backends/wavesaudio/waves_audiobackend.latency.cc10
-rw-r--r--libs/backends/wavesaudio/waves_audiobackend.midi.cc40
-rw-r--r--libs/backends/wavesaudio/waves_audiobackend.port_engine.cc64
-rw-r--r--libs/backends/wavesaudio/waves_audioport.cc8
-rw-r--r--libs/backends/wavesaudio/waves_audioport.h4
-rw-r--r--libs/backends/wavesaudio/waves_dataport.cc12
-rw-r--r--libs/backends/wavesaudio/waves_dataport.h10
-rw-r--r--libs/backends/wavesaudio/waves_midi_device.cc34
-rw-r--r--libs/backends/wavesaudio/waves_midi_device.h2
-rw-r--r--libs/backends/wavesaudio/waves_midi_device_manager.cc10
-rw-r--r--libs/backends/wavesaudio/waves_midi_device_manager.h8
-rw-r--r--libs/backends/wavesaudio/waves_midi_event.cc24
-rw-r--r--libs/backends/wavesaudio/waves_midi_event.h2
-rw-r--r--libs/backends/wavesaudio/waves_midiport.cc4
-rw-r--r--libs/backends/wavesaudio/waves_midiport.h2
-rw-r--r--libs/backends/wavesaudio/wavesapi/BasicTypes/WCFourCC.h10
-rw-r--r--libs/backends/wavesaudio/wavesapi/BasicTypes/WTByteOrder.h16
-rw-r--r--libs/backends/wavesaudio/wavesapi/BasicTypes/WUComPtr.h4
-rw-r--r--libs/backends/wavesaudio/wavesapi/BasicTypes/WUDefines.h34
-rw-r--r--libs/backends/wavesaudio/wavesapi/BasicTypes/WUTypes.h26
-rw-r--r--libs/backends/wavesaudio/wavesapi/MiscUtils/MinMaxUtilities.h6
-rw-r--r--libs/backends/wavesaudio/wavesapi/MiscUtils/UMicroseconds.h6
-rw-r--r--libs/backends/wavesaudio/wavesapi/MiscUtils/WCFixedString.h62
-rw-r--r--libs/backends/wavesaudio/wavesapi/MiscUtils/WUErrors.h58
-rw-r--r--libs/backends/wavesaudio/wavesapi/MiscUtils/pthread_utils.h2
-rw-r--r--libs/backends/wavesaudio/wavesapi/Threads/WCThreadSafe.h18
-rw-r--r--libs/backends/wavesaudio/wavesapi/WavesPublicAPI/1.0/WavesPublicAPI_Defines.h6
-rw-r--r--libs/backends/wavesaudio/wavesapi/WavesPublicAPI/wstdint.h2
-rw-r--r--libs/backends/wavesaudio/wavesapi/devicemanager/IncludeWindows.h2
-rw-r--r--libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.h12
-rw-r--r--libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.h22
-rw-r--r--libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.h2
59 files changed, 915 insertions, 915 deletions
diff --git a/libs/backends/asio/asio_backend.cc b/libs/backends/asio/asio_backend.cc
index 8d546ca582..90df11c2c1 100644
--- a/libs/backends/asio/asio_backend.cc
+++ b/libs/backends/asio/asio_backend.cc
@@ -113,7 +113,7 @@ ASIOBackend::ASIOBackend (AudioEngine& e, AudioBackendInfo& info)
ASIOBackend::~ASIOBackend ()
{
-#if 0
+#if 0
delete _pcmio; _pcmio = 0; // TODO
delete _midiio; _midiio = 0; // TODO
#endif
diff --git a/libs/backends/coreaudio/coremidi_io.h b/libs/backends/coreaudio/coremidi_io.h
index 21806ab4fd..b09261cbf9 100644
--- a/libs/backends/coreaudio/coremidi_io.h
+++ b/libs/backends/coreaudio/coremidi_io.h
@@ -36,9 +36,9 @@
namespace ARDOUR {
typedef struct _CoreMIDIPacket {
- MIDITimeStamp timeStamp;
- UInt16 length;
- Byte data[256];
+ MIDITimeStamp timeStamp;
+ UInt16 length;
+ Byte data[256];
#if 0 // unused
_CoreMIDIPacket (MIDITimeStamp t, Byte *d, UInt16 l)
: timeStamp(t)
@@ -52,7 +52,7 @@ typedef struct _CoreMIDIPacket {
}
}
#endif
- _CoreMIDIPacket (const MIDIPacket *other)
+ _CoreMIDIPacket (const MIDIPacket *other)
: timeStamp(other->timeStamp)
, length (other->length)
{
diff --git a/libs/backends/jack/jack_api.cc b/libs/backends/jack/jack_api.cc
index ce1109c7f0..b63b1c1f69 100644
--- a/libs/backends/jack/jack_api.cc
+++ b/libs/backends/jack/jack_api.cc
@@ -66,7 +66,7 @@ instantiate (const std::string& arg1, const std::string& arg2)
return 0;
}
-static int
+static int
deinstantiate ()
{
backend.reset ();
diff --git a/libs/backends/jack/jack_audiobackend.cc b/libs/backends/jack/jack_audiobackend.cc
index c3ce0b0d6c..5de12294e1 100644
--- a/libs/backends/jack/jack_audiobackend.cc
+++ b/libs/backends/jack/jack_audiobackend.cc
@@ -72,7 +72,7 @@ JACKAudioBackend::~JACKAudioBackend()
}
string
-JACKAudioBackend::name() const
+JACKAudioBackend::name() const
{
return X_("JACK");
}
@@ -127,7 +127,7 @@ JACKAudioBackend::enumerate_devices () const
all_devices.insert (make_pair (_target_driver, std::set<string>()));
}
- /* store every device we've found, by driver name.
+ /* store every device we've found, by driver name.
*
* This is so we do not confuse ALSA, FFADO, netjack etc. devices
* with each other.
@@ -160,7 +160,7 @@ JACKAudioBackend::available_sample_rates (const string& device) const
return f;
}
- /* if JACK is not already running, just list a bunch of reasonable
+ /* if JACK is not already running, just list a bunch of reasonable
values and let the future sort it all out.
*/
@@ -339,7 +339,7 @@ JACKAudioBackend::device_name () const
if (!_jack_connection->in_control()) {
return "???"; // JACK has no way (as of fall 2013) to return
// the device name
- }
+ }
return _target_device;
}
@@ -441,7 +441,7 @@ JACKAudioBackend::systemic_output_latency () const
return _target_systemic_output_latency;
}
-size_t
+size_t
JACKAudioBackend::raw_buffer_size(DataType t)
{
std::map<DataType,size_t>::const_iterator s = _raw_buffer_sizes.find(t);
@@ -504,7 +504,7 @@ JACKAudioBackend::_start (bool for_latency_measurement)
if (!available()) {
if (_jack_connection->in_control()) {
- /* we will be starting JACK, so set up the
+ /* we will be starting JACK, so set up the
command that JACK will use when it (auto-)starts
*/
setup_jack_startup_command (for_latency_measurement);
@@ -522,7 +522,7 @@ JACKAudioBackend::_start (bool for_latency_measurement)
jack_sample_rate_callback (jack_get_sample_rate (_priv_jack));
jack_bufsize_callback (jack_get_buffer_size (_priv_jack));
- /* Now that we have buffer size and sample rate established, the engine
+ /* Now that we have buffer size and sample rate established, the engine
can go ahead and do its stuff
*/
@@ -606,8 +606,8 @@ JACKAudioBackend::transport_locate (framepos_t where)
jack_transport_locate (_priv_jack, where);
}
-framepos_t
-JACKAudioBackend::transport_frame () const
+framepos_t
+JACKAudioBackend::transport_frame () const
{
GET_PRIVATE_JACK_POINTER_RET (_priv_jack, 0);
return jack_get_current_transport_frame (_priv_jack);
@@ -1018,8 +1018,8 @@ JACKAudioBackend::disconnected (const char* why)
}
}
-float
-JACKAudioBackend::dsp_load() const
+float
+JACKAudioBackend::dsp_load() const
{
GET_PRIVATE_JACK_POINTER_RET(_priv_jack,0);
return jack_cpu_load (_priv_jack);
@@ -1137,7 +1137,7 @@ JACKAudioBackend::speed_and_position (double& speed, framepos_t& position)
jack_transport_state_t state;
bool starting;
- /* this won't be called if the port engine in use is not JACK, so we do
+ /* this won't be called if the port engine in use is not JACK, so we do
not have to worry about the type of PortEngine::private_handle()
*/
diff --git a/libs/backends/jack/jack_audiobackend.h b/libs/backends/jack/jack_audiobackend.h
index 5319c52587..7e860df3b8 100644
--- a/libs/backends/jack/jack_audiobackend.h
+++ b/libs/backends/jack/jack_audiobackend.h
@@ -42,7 +42,7 @@ class JACKAudioBackend : public AudioBackend {
public:
JACKAudioBackend (AudioEngine& e, AudioBackendInfo& info, boost::shared_ptr<JackConnection>);
~JACKAudioBackend ();
-
+
/* AUDIOBACKEND API */
std::string name() const;
@@ -120,7 +120,7 @@ class JACKAudioBackend : public AudioBackend {
void update_latencies ();
static bool already_configured();
-
+
/* PORTENGINE API */
const std::string& my_name() const;
@@ -148,7 +148,7 @@ class JACKAudioBackend : public AudioBackend {
int disconnect_all (PortHandle);
int connect (const std::string& src, const std::string& dst);
int disconnect (const std::string& src, const std::string& dst);
-
+
/* MIDI */
std::vector<std::string> enumerate_midi_options () const;
@@ -182,7 +182,7 @@ class JACKAudioBackend : public AudioBackend {
/* Latency management
*/
-
+
void set_latency_range (PortHandle, bool for_playback, LatencyRange);
LatencyRange get_latency_range (PortHandle, bool for_playback);
@@ -220,7 +220,7 @@ class JACKAudioBackend : public AudioBackend {
static void _freewheel_callback (int , void *arg);
static void _latency_callback (jack_latency_callback_mode_t, void*);
static void _session_callback (jack_session_event_t *event, void *arg);
-
+
void jack_timebase_callback (jack_transport_state_t, pframes_t, jack_position_t*, int);
int jack_sync_callback (jack_transport_state_t, jack_position_t*);
int jack_bufsize_callback (pframes_t);
@@ -232,7 +232,7 @@ class JACKAudioBackend : public AudioBackend {
void set_jack_callbacks ();
int reconnect_to_jack ();
-
+
struct ThreadData {
JACKAudioBackend* engine;
boost::function<void()> f;
@@ -241,7 +241,7 @@ class JACKAudioBackend : public AudioBackend {
ThreadData (JACKAudioBackend* e, boost::function<void()> fp, size_t stacksz)
: engine (e) , f (fp) , stacksize (stacksz) {}
};
-
+
void* process_thread ();
static void* _start_process_thread (void*);
@@ -265,7 +265,7 @@ class JACKAudioBackend : public AudioBackend {
typedef std::set<std::string> DeviceList;
typedef std::map<std::string,DeviceList> DriverDeviceMap;
-
+
mutable DriverDeviceMap all_devices;
PBD::ScopedConnection disconnect_connection;
@@ -284,7 +284,7 @@ class JACKAudioBackend : public AudioBackend {
void when_connected_to_jack ();
PBD::ScopedConnection jack_connection_connection;
- /* Object to manage interactions with Session in a way that
+ /* Object to manage interactions with Session in a way that
keeps JACK out of libardour directly
*/
@@ -297,4 +297,4 @@ class JACKAudioBackend : public AudioBackend {
} // namespace
#endif /* __ardour_audiobackend_h__ */
-
+
diff --git a/libs/backends/jack/jack_connection.cc b/libs/backends/jack/jack_connection.cc
index af938ad21b..acc32c4400 100644
--- a/libs/backends/jack/jack_connection.cc
+++ b/libs/backends/jack/jack_connection.cc
@@ -59,7 +59,7 @@ JackConnection::JackConnection (const std::string& arg1, const std::string& arg2
, _probed_buffer_size (0)
, _probed_sample_rate (0)
{
- /* See if the server is already up
+ /* See if the server is already up
*/
EnvironmentalProtectionAgency* global_epa = EnvironmentalProtectionAgency::get_global_epa ();
diff --git a/libs/backends/jack/jack_connection.h b/libs/backends/jack/jack_connection.h
index 3b0ccb8d46..f0fb2c1fdb 100644
--- a/libs/backends/jack/jack_connection.h
+++ b/libs/backends/jack/jack_connection.h
@@ -41,6 +41,6 @@ class JackConnection {
uint32_t _probed_sample_rate; // when not in control
};
-} // namespace
+} // namespace
#endif /* __libardour_jack_connection_h__ */
diff --git a/libs/backends/jack/jack_portengine.cc b/libs/backends/jack/jack_portengine.cc
index 8aa489dbca..257feb2bf2 100644
--- a/libs/backends/jack/jack_portengine.cc
+++ b/libs/backends/jack/jack_portengine.cc
@@ -315,8 +315,8 @@ JACKAudioBackend::get_ports (const string& port_name_pattern, DataType type, Por
GET_PRIVATE_JACK_POINTER_RET (_priv_jack,0);
- const char** ports = jack_get_ports (_priv_jack, port_name_pattern.c_str(),
- ardour_data_type_to_jack_port_type (type),
+ const char** ports = jack_get_ports (_priv_jack, port_name_pattern.c_str(),
+ ardour_data_type_to_jack_port_type (type),
ardour_port_flags_to_jack_flags (flags));
if (ports == 0) {
@@ -419,7 +419,7 @@ PortEngine::PortHandle
JACKAudioBackend::register_port (const std::string& shortname, ARDOUR::DataType type, ARDOUR::PortFlags flags)
{
GET_PRIVATE_JACK_POINTER_RET (_priv_jack, 0);
- return jack_port_register (_priv_jack, shortname.c_str(),
+ return jack_port_register (_priv_jack, shortname.c_str(),
ardour_data_type_to_jack_port_type (type),
ardour_port_flags_to_jack_flags (flags),
0);
diff --git a/libs/backends/jack/jack_session.cc b/libs/backends/jack/jack_session.cc
index c9ee8c61e0..8495a5971f 100644
--- a/libs/backends/jack/jack_session.cc
+++ b/libs/backends/jack/jack_session.cc
@@ -89,7 +89,7 @@ JACKSession::session_event (jack_session_event_t* event)
}
}
- /* this won't be called if the port engine in use is not JACK, so we do
+ /* this won't be called if the port engine in use is not JACK, so we do
not have to worry about the type of PortEngine::private_handle()
*/
diff --git a/libs/backends/jack/jack_session.h b/libs/backends/jack/jack_session.h
index 996ab1fd6b..89b03d2e5d 100644
--- a/libs/backends/jack/jack_session.h
+++ b/libs/backends/jack/jack_session.h
@@ -33,7 +33,7 @@ class JACKSession : public ARDOUR::SessionHandlePtr
public:
JACKSession (ARDOUR::Session* s);
~JACKSession ();
-
+
void session_event (jack_session_event_t* event);
void timebase_callback (jack_transport_state_t /*state*/,
ARDOUR::pframes_t /*nframes*/,
diff --git a/libs/backends/jack/jack_utils.cc b/libs/backends/jack/jack_utils.cc
index 2ea110d6d7..029b922f73 100644
--- a/libs/backends/jack/jack_utils.cc
+++ b/libs/backends/jack/jack_utils.cc
@@ -536,7 +536,7 @@ ARDOUR::get_jack_server_dir_paths (vector<std::string>& server_dir_paths)
#ifdef PLATFORM_WINDOWS
// N.B. The #define (immediately below) can be safely removed once we know that this code builds okay with mingw
#ifdef COMPILER_MSVC
- IShellLinkA *pISL = NULL;
+ IShellLinkA *pISL = NULL;
IPersistFile *ppf = NULL;
// Mixbus creates a Windows shortcut giving the location of its
@@ -940,7 +940,7 @@ ARDOUR::write_jack_config_file (const std::string& config_file_path, const strin
}
vector<string>
-ARDOUR::enumerate_midi_options ()
+ARDOUR::enumerate_midi_options ()
{
if (midi_options.empty()) {
#ifdef HAVE_ALSA
diff --git a/libs/backends/wavesaudio/portmidi/pmutil.h b/libs/backends/wavesaudio/portmidi/pmutil.h
index ef5ee4bf84..88ebf145ed 100644
--- a/libs/backends/wavesaudio/portmidi/pmutil.h
+++ b/libs/backends/wavesaudio/portmidi/pmutil.h
@@ -1,5 +1,5 @@
-/* pmutil.h -- some helpful utilities for building midi
- applications that use PortMidi
+/* pmutil.h -- some helpful utilities for building midi
+ applications that use PortMidi
*/
#ifdef __cplusplus
@@ -17,18 +17,18 @@ typedef void PmQueue;
This queue implementation uses the "light pipe" algorithm which
operates correctly even with multi-processors and out-of-order
memory writes. (see Alexander Dokumentov, "Lock-free Interprocess
- Communication," Dr. Dobbs Portal, http://www.ddj.com/,
+ Communication," Dr. Dobbs Portal, http://www.ddj.com/,
articleID=189401457, June 15, 2006. This algorithm requires
that messages be translated to a form where no words contain
zeros. Each word becomes its own "data valid" tag. Because of
- this translation, we cannot return a pointer to data still in
- the queue when the "peek" method is called. Instead, a buffer
- is preallocated so that data can be copied there. Pm_QueuePeek()
- dequeues a message into this buffer and returns a pointer to
+ this translation, we cannot return a pointer to data still in
+ the queue when the "peek" method is called. Instead, a buffer
+ is preallocated so that data can be copied there. Pm_QueuePeek()
+ dequeues a message into this buffer and returns a pointer to
it. A subsequent Pm_Dequeue() will copy from this buffer.
This implementation does not try to keep reader/writer data in
- separate cache lines or prevent thrashing on cache lines.
+ separate cache lines or prevent thrashing on cache lines.
However, this algorithm differs by doing inserts/removals in
units of messages rather than units of machine words. Some
performance improvement might be obtained by not clearing data
@@ -40,20 +40,20 @@ typedef void PmQueue;
an overflow, the sender writes the current tail position to a field.
The receiver must acknowlege receipt by zeroing the field. The sender
will not send more until the field is zeroed.
-
+
Pm_QueueDestroy() destroys the queue and frees its storage.
*/
PMEXPORT PmQueue *Pm_QueueCreate(long num_msgs, int32_t bytes_per_msg);
PMEXPORT PmError Pm_QueueDestroy(PmQueue *queue);
-/*
+/*
Pm_Dequeue() removes one item from the queue, copying it into msg.
Returns 1 if successful, and 0 if the queue is empty.
Returns pmBufferOverflow if what would have been the next thing
in the queue was dropped due to overflow. (So when overflow occurs,
the receiver can receive a queue full of messages before getting the
- overflow report. This protocol ensures that the reader will be
+ overflow report. This protocol ensures that the reader will be
notified when data is lost due to overflow.
*/
PMEXPORT PmError Pm_Dequeue(PmQueue *queue, void *msg);
@@ -61,7 +61,7 @@ PMEXPORT PmError Pm_Dequeue(PmQueue *queue, void *msg);
/*
Pm_Enqueue() inserts one item into the queue, copying it from msg.
- Returns pmNoError if successful and pmBufferOverflow if the queue was
+ Returns pmNoError if successful and pmBufferOverflow if the queue was
already full. If pmBufferOverflow is returned, the overflow flag is set.
*/
PMEXPORT PmError Pm_Enqueue(PmQueue *queue, void *msg);
@@ -73,11 +73,11 @@ PMEXPORT PmError Pm_Enqueue(PmQueue *queue, void *msg);
Either condition may change immediately because a parallel
enqueue or dequeue operation could be in progress. Furthermore,
- Pm_QueueEmpty() is optimistic: it may say false, when due to
+ Pm_QueueEmpty() is optimistic: it may say false, when due to
out-of-order writes, the full message has not arrived. Therefore,
Pm_Dequeue() could still return 0 after Pm_QueueEmpty() returns
false. On the other hand, Pm_QueueFull() is pessimistic: if it
- returns false, then Pm_Enqueue() is guaranteed to succeed.
+ returns false, then Pm_Enqueue() is guaranteed to succeed.
Error conditions: Pm_QueueFull() returns pmBadPtr if queue is NULL.
Pm_QueueEmpty() returns FALSE if queue is NULL.
@@ -91,12 +91,12 @@ PMEXPORT int Pm_QueueEmpty(PmQueue *queue);
or NULL if the queue is empty. The item is not removed from the queue.
Pm_QueuePeek() will not indicate when an overflow occurs. If you want
to get and check pmBufferOverflow messages, use the return value of
- Pm_QueuePeek() *only* as an indication that you should call
+ Pm_QueuePeek() *only* as an indication that you should call
Pm_Dequeue(). At the point where a direct call to Pm_Dequeue() would
return pmBufferOverflow, Pm_QueuePeek() will return NULL but internally
clear the pmBufferOverflow flag, enabling Pm_Enqueue() to resume
enqueuing messages. A subsequent call to Pm_QueuePeek()
- will return a pointer to the first message *after* the overflow.
+ will return a pointer to the first message *after* the overflow.
Using this as an indication to call Pm_Dequeue(), the first call
to Pm_Dequeue() will return pmBufferOverflow. The second call will
return success, copying the same message pointed to by the previous
@@ -106,14 +106,14 @@ PMEXPORT int Pm_QueueEmpty(PmQueue *queue);
data to decide who should be called to receive it. (2) when you need
to know a message is ready but cannot accept the message.
- Note that Pm_QueuePeek() is not a fast check, so if possible, you
+ Note that Pm_QueuePeek() is not a fast check, so if possible, you
might as well just call Pm_Dequeue() and accept the data if it is there.
*/
PMEXPORT void *Pm_QueuePeek(PmQueue *queue);
/*
Pm_SetOverflow() allows the writer (enqueuer) to signal an overflow
- condition to the reader (dequeuer). E.g. when transfering data from
+ condition to the reader (dequeuer). E.g. when transfering data from
the OS to an application, if the OS indicates a buffer overrun,
Pm_SetOverflow() can be used to insure that the reader receives a
pmBufferOverflow result from Pm_Dequeue(). Returns pmBadPtr if queue
diff --git a/libs/backends/wavesaudio/portmidi/portmidi.h b/libs/backends/wavesaudio/portmidi/portmidi.h
index e07991e0d6..50f74adcb0 100644
--- a/libs/backends/wavesaudio/portmidi/portmidi.h
+++ b/libs/backends/wavesaudio/portmidi/portmidi.h
@@ -33,20 +33,20 @@ extern "C" {
*/
/*
- * The text above constitutes the entire PortMidi license; however,
+ * The text above constitutes the entire PortMidi license; however,
* the PortMusic community also makes the following non-binding requests:
*
* 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. It is also
- * requested that these non-binding requests be included along with the
+ * requested that these non-binding requests be included along with the
* license above.
*/
/* CHANGELOG FOR PORTMIDI
* (see ../CHANGELOG.txt)
*
- * NOTES ON HOST ERROR REPORTING:
+ * NOTES ON HOST ERROR REPORTING:
*
* PortMidi errors (of type PmError) are generic, system-independent errors.
* When an error does not map to one of the more specific PmErrors, the
@@ -54,27 +54,27 @@ extern "C" {
* retained a more specific system-dependent error code. The caller can
* get more information by calling Pm_HasHostError() to test if there is
* a pending host error, and Pm_GetHostErrorText() to get a text string
- * describing the error. Host errors are reported on a per-device basis
- * because only after you open a device does PortMidi have a place to
- * record the host error code. I.e. only
- * those routines that receive a (PortMidiStream *) argument check and
- * report errors. One exception to this is that Pm_OpenInput() and
+ * describing the error. Host errors are reported on a per-device basis
+ * because only after you open a device does PortMidi have a place to
+ * record the host error code. I.e. only
+ * those routines that receive a (PortMidiStream *) argument check and
+ * report errors. One exception to this is that Pm_OpenInput() and
* Pm_OpenOutput() can report errors even though when an error occurs,
* there is no PortMidiStream* to hold the error. Fortunately, both
* of these functions return any error immediately, so we do not really
* need per-device error memory. Instead, any host error code is stored
- * in a global, pmHostError is returned, and the user can call
+ * in a global, pmHostError is returned, and the user can call
* Pm_GetHostErrorText() to get the error message (and the invalid stream
- * parameter will be ignored.) The functions
+ * parameter will be ignored.) The functions
* pm_init and pm_term do not fail or raise
* errors. The job of pm_init is to locate all available devices so that
* the caller can get information via PmDeviceInfo(). If an error occurs,
* the device is simply not listed as available.
*
* Host errors come in two flavors:
- * a) host error
+ * a) host error
* b) host error during callback
- * These can occur w/midi input or output devices. (b) can only happen
+ * These can occur w/midi input or output devices. (b) can only happen
* asynchronously (during callback routines), whereas (a) only occurs while
* synchronously running PortMidi and any resulting system dependent calls.
* Both (a) and (b) are reported by the next read or write call. You can
@@ -84,7 +84,7 @@ extern "C" {
* NOTES ON COMPILE-TIME SWITCHES
*
* DEBUG assumes stdio and a console. Use this if you want automatic, simple
- * error reporting, e.g. for prototyping. If you are using MFC or some
+ * error reporting, e.g. for prototyping. If you are using MFC or some
* other graphical interface with no console, DEBUG probably should be
* undefined.
* PM_CHECK_ERRORS more-or-less takes over error checking for return values,
@@ -97,7 +97,7 @@ extern "C" {
#include <stdint.h>
#else
#ifndef INT32_DEFINED
-// rather than having users install a special .h file for windows,
+// rather than having users install a special .h file for windows,
// just put the required definitions inline here. porttime.h uses
// these too, so the definitions are (unfortunately) duplicated there
typedef int int32_t;
@@ -109,7 +109,7 @@ typedef unsigned int uint32_t;
#ifdef _WINDLL
#define PMEXPORT __declspec(dllexport)
#else
-#define PMEXPORT
+#define PMEXPORT
#endif
#ifndef FALSE
@@ -128,10 +128,10 @@ typedef enum {
pmNoData = 0, /**< A "no error" return that also indicates no data avail. */
pmGotData = 1, /**< A "no error" return that also indicates data available */
pmHostError = -10000,
- pmInvalidDeviceId, /** out of range or
- * output device when input is requested or
+ pmInvalidDeviceId, /** out of range or
+ * output device when input is requested or
* input device when output is requested or
- * device is already opened
+ * device is already opened
*/
pmInsufficientMemory,
pmBufferTooSmall,
@@ -169,11 +169,11 @@ typedef void PortMidiStream;
asynchronously where the client does not
explicitly call a function, and therefore cannot receive an error code.
The client can test for a pending error using Pm_HasHostError(). If true,
- the error can be accessed and cleared by calling Pm_GetErrorText().
+ the error can be accessed and cleared by calling Pm_GetErrorText().
Errors are also cleared by calling other functions that can return
errors, e.g. Pm_OpenInput(), Pm_OpenOutput(), Pm_Read(), Pm_Write(). The
client does not need to call Pm_HasHostError(). Any pending error will be
- reported the next time the client performs an explicit function call on
+ reported the next time the client performs an explicit function call on
the stream, e.g. an input or output operation. Until the error is cleared,
no new error codes will be obtained, even for a different stream.
*/
@@ -181,19 +181,19 @@ PMEXPORT int Pm_HasHostError( PortMidiStream * stream );
/** Translate portmidi error number into human readable message.
- These strings are constants (set at compile time) so client has
+ These strings are constants (set at compile time) so client has
no need to allocate storage
*/
PMEXPORT const char *Pm_GetErrorText( PmError errnum );
/** Translate portmidi host error into human readable message.
These strings are computed at run time, so client has to allocate storage.
- After this routine executes, the host error is cleared.
+ After this routine executes, the host error is cleared.
*/
PMEXPORT void Pm_GetHostErrorText(char * msg, unsigned int len);
#define HDRLENGTH 50
-#define PM_HOST_ERROR_MSG_LEN 256u /* any host error msg will occupy less
+#define PM_HOST_ERROR_MSG_LEN 256u /* any host error msg will occupy less
than this number of characters */
/**
@@ -205,7 +205,7 @@ PMEXPORT void Pm_GetHostErrorText(char * msg, unsigned int len);
typedef int PmDeviceID;
#define pmNoDevice -1
typedef struct {
- int structVersion; /**< this internal structure version */
+ int structVersion; /**< this internal structure version */
const char *interf; /**< underlying MIDI API, e.g. MMSystem or DirectX */
const char *name; /**< device name, e.g. USB MidiSport 1x1 */
int input; /**< true iff input is available */
@@ -221,24 +221,24 @@ PMEXPORT int Pm_CountDevices( void );
Return the default device ID or pmNoDevice if there are no devices.
The result (but not pmNoDevice) can be passed to Pm_OpenMidi().
-
+
The default device can be specified using a small application
named pmdefaults that is part of the PortMidi distribution. This
program in turn uses the Java Preferences object created by
java.util.prefs.Preferences.userRoot().node("/PortMidi"); the
- preference is set by calling
+ preference is set by calling
prefs.put("PM_RECOMMENDED_OUTPUT_DEVICE", prefName);
or prefs.put("PM_RECOMMENDED_INPUT_DEVICE", prefName);
-
+
In the statements above, prefName is a string describing the
MIDI device in the form "interf, name" where interf identifies
the underlying software system or API used by PortMdi to access
- devices and name is the name of the device. These correspond to
+ devices and name is the name of the device. These correspond to
the interf and name fields of a PmDeviceInfo. (Currently supported
- interfaces are "MMSystem" for Win32, "ALSA" for Linux, and
+ interfaces are "MMSystem" for Win32, "ALSA" for Linux, and
"CoreMIDI" for OS X, so in fact, there is no choice of interface.)
- In "interf, name", the strings are actually substrings of
- the full interface and name strings. For example, the preference
+ In "interf, name", the strings are actually substrings of
+ the full interface and name strings. For example, the preference
"Core, Sport" will match a device with interface "CoreMIDI"
and name "In USB MidiSport 1x1". It will also match "CoreMIDI"
and "In USB MidiSport 2x2". The devices are enumerated in device
@@ -248,14 +248,14 @@ PMEXPORT int Pm_CountDevices( void );
the entire preference string is interpreted as a name, and the
interface part is the empty string, which matches anything.
- On the MAC, preferences are stored in
+ On the MAC, preferences are stored in
/Users/$NAME/Library/Preferences/com.apple.java.util.prefs.plist
which is a binary file. In addition to the pmdefaults program,
there are utilities that can read and edit this preference file.
- On the PC,
+ On the PC,
- On Linux,
+ On Linux,
*/
PMEXPORT PmDeviceID Pm_GetDefaultInputDeviceID( void );
@@ -271,7 +271,7 @@ typedef PmTimestamp (*PmTimeProcPtr)(void *time_info);
/** TRUE if t1 before t2 */
#define PmBefore(t1,t2) ((t1-t2) < 0)
-/**
+/**
\defgroup grp_device Input/Output Devices Handling
@{
*/
@@ -306,18 +306,18 @@ PMEXPORT const PmDeviceInfo* Pm_GetDeviceInfo( PmDeviceID id );
outputDriverInfo is never required for correct operation. If not used
outputDriverInfo should be NULL.
- For input, the buffersize specifies the number of input events to be
- buffered waiting to be read using Pm_Read(). For output, buffersize
- specifies the number of output events to be buffered waiting for output.
+ For input, the buffersize specifies the number of input events to be
+ buffered waiting to be read using Pm_Read(). For output, buffersize
+ specifies the number of output events to be buffered waiting for output.
(In some cases -- see below -- PortMidi does not buffer output at all
and merely passes data to a lower-level API, in which case buffersize
is ignored.)
-
- latency is the delay in milliseconds applied to timestamps to determine
- when the output should actually occur. (If latency is < 0, 0 is assumed.)
+
+ latency is the delay in milliseconds applied to timestamps to determine
+ when the output should actually occur. (If latency is < 0, 0 is assumed.)
If latency is zero, timestamps are ignored and all output is delivered
immediately. If latency is greater than zero, output is delayed until the
- message timestamp plus the latency. (NOTE: the time is measured relative
+ message timestamp plus the latency. (NOTE: the time is measured relative
to the time source indicated by time_proc. Timestamps are absolute,
not relative delays or offsets.) In some cases, PortMidi can obtain
better timing than your application by passing timestamps along to the
@@ -325,7 +325,7 @@ PMEXPORT const PmDeviceInfo* Pm_GetDeviceInfo( PmDeviceID id );
data to audio data by matching midi latency to the audio buffer latency.
time_proc is a pointer to a procedure that returns time in milliseconds. It
- may be NULL, in which case a default millisecond timebase (PortTime) is
+ may be NULL, in which case a default millisecond timebase (PortTime) is
used. If the application wants to use PortTime, it should start the timer
(call Pt_Start) before calling Pm_OpenInput or Pm_OpenOutput. If the
application tries to start the timer *after* Pm_OpenInput or Pm_OpenOutput,
@@ -384,7 +384,7 @@ PMEXPORT PmError Pm_OpenOutput( PortMidiStream** stream,
Or you may be using a sequencer or drum-machine for MIDI clock information but want to
exclude any notes it may play.
*/
-
+
/* Filter bit-mask definitions */
/** filter active sensing messages (0xFE): */
#define PM_FILT_ACTIVE (1 << 0x0E)
@@ -443,7 +443,7 @@ PMEXPORT PmError Pm_SetFilter( PortMidiStream* stream, int32_t filters );
Multiple channels should be OR'd together, like
Pm_SetChannelMask(Pm_Channel(10) | Pm_Channel(11))
- Note that channels are numbered 0 to 15 (not 1 to 16). Most
+ Note that channels are numbered 0 to 15 (not 1 to 16). Most
synthesizer and interfaces number channels starting at 1, but
PortMidi numbers channels starting at 0.
@@ -460,10 +460,10 @@ PMEXPORT PmError Pm_SetChannelMask(PortMidiStream *stream, int mask);
any time.
*/
PMEXPORT PmError Pm_Abort( PortMidiStream* stream );
-
+
/**
Pm_Close() closes a midi stream, flushing any pending buffers.
- (PortMidi attempts to close open streams when the application
+ (PortMidi attempts to close open streams when the application
exits -- this is particularly difficult under Windows.)
*/
PMEXPORT PmError Pm_Close( PortMidiStream* stream );
@@ -473,22 +473,22 @@ PMEXPORT PmError Pm_Close( PortMidiStream* stream );
time_proc passed when the stream was opened. Typically, this
is used when the stream must be opened before the time_proc
reference is actually advancing. In this case, message timing
- may be erratic, but since timestamps of zero mean
+ may be erratic, but since timestamps of zero mean
"send immediately," initialization messages with zero timestamps
can be written without a functioning time reference and without
problems. Before the first MIDI message with a non-zero
timestamp is written to the stream, the time reference must
begin to advance (for example, if the time_proc computes time
- based on audio samples, time might begin to advance when an
+ based on audio samples, time might begin to advance when an
audio stream becomes active). After time_proc return values
- become valid, and BEFORE writing the first non-zero timestamped
+ become valid, and BEFORE writing the first non-zero timestamped
MIDI message, call Pm_Synchronize() so that PortMidi can observe
the difference between the current time_proc value and its
- MIDI stream time.
-
- In the more normal case where time_proc
- values advance continuously, there is no need to call
- Pm_Synchronize. PortMidi will always synchronize at the
+ MIDI stream time.
+
+ In the more normal case where time_proc
+ values advance continuously, there is no need to call
+ Pm_Synchronize. PortMidi will always synchronize at the
first output message and periodically thereafter.
*/
PmError Pm_Synchronize( PortMidiStream* stream );
@@ -498,7 +498,7 @@ PmError Pm_Synchronize( PortMidiStream* stream );
Pm_Message() encodes a short Midi message into a 32-bit word. If data1
and/or data2 are not present, use zero.
- Pm_MessageStatus(), Pm_MessageData1(), and
+ Pm_MessageStatus(), Pm_MessageData1(), and
Pm_MessageData2() extract fields from a 32-bit midi message.
*/
#define Pm_Message(status, data1, data2) \
@@ -516,61 +516,61 @@ typedef int32_t PmMessage; /**< see PmEvent */
structure carrying 4 bytes of the message, i.e. only the first
PmEvent carries the status byte.
- Note that MIDI allows nested messages: the so-called "real-time" MIDI
- messages can be inserted into the MIDI byte stream at any location,
+ Note that MIDI allows nested messages: the so-called "real-time" MIDI
+ messages can be inserted into the MIDI byte stream at any location,
including within a sysex message. MIDI real-time messages are one-byte
- messages used mainly for timing (see the MIDI spec). PortMidi retains
- the order of non-real-time MIDI messages on both input and output, but
+ messages used mainly for timing (see the MIDI spec). PortMidi retains
+ the order of non-real-time MIDI messages on both input and output, but
it does not specify exactly how real-time messages are processed. This
- is particulary problematic for MIDI input, because the input parser
- must either prepare to buffer an unlimited number of sysex message
- bytes or to buffer an unlimited number of real-time messages that
+ is particulary problematic for MIDI input, because the input parser
+ must either prepare to buffer an unlimited number of sysex message
+ bytes or to buffer an unlimited number of real-time messages that
arrive embedded in a long sysex message. To simplify things, the input
- parser is allowed to pass real-time MIDI messages embedded within a
- sysex message, and it is up to the client to detect, process, and
+ parser is allowed to pass real-time MIDI messages embedded within a
+ sysex message, and it is up to the client to detect, process, and
remove these messages as they arrive.
When receiving sysex messages, the sysex message is terminated
by either an EOX status byte (anywhere in the 4 byte messages) or
by a non-real-time status byte in the low order byte of the message.
- If you get a non-real-time status byte but there was no EOX byte, it
+ If you get a non-real-time status byte but there was no EOX byte, it
means the sysex message was somehow truncated. This is not
considered an error; e.g., a missing EOX can result from the user
disconnecting a MIDI cable during sysex transmission.
- A real-time message can occur within a sysex message. A real-time
- message will always occupy a full PmEvent with the status byte in
+ A real-time message can occur within a sysex message. A real-time
+ message will always occupy a full PmEvent with the status byte in
the low-order byte of the PmEvent message field. (This implies that
the byte-order of sysex bytes and real-time message bytes may not
be preserved -- for example, if a real-time message arrives after
3 bytes of a sysex message, the real-time message will be delivered
first. The first word of the sysex message will be delivered only
after the 4th byte arrives, filling the 4-byte PmEvent message field.
-
+
The timestamp field is observed when the output port is opened with
a non-zero latency. A timestamp of zero means "use the current time",
which in turn means to deliver the message with a delay of
latency (the latency parameter used when opening the output port.)
- Do not expect PortMidi to sort data according to timestamps --
- messages should be sent in the correct order, and timestamps MUST
+ Do not expect PortMidi to sort data according to timestamps --
+ messages should be sent in the correct order, and timestamps MUST
be non-decreasing. See also "Example" for Pm_OpenOutput() above.
- A sysex message will generally fill many PmEvent structures. On
+ A sysex message will generally fill many PmEvent structures. On
output to a PortMidiStream with non-zero latency, the first timestamp
- on sysex message data will determine the time to begin sending the
- message. PortMidi implementations may ignore timestamps for the
- remainder of the sysex message.
-
- On input, the timestamp ideally denotes the arrival time of the
- status byte of the message. The first timestamp on sysex message
- data will be valid. Subsequent timestamps may denote
- when message bytes were actually received, or they may be simply
+ on sysex message data will determine the time to begin sending the
+ message. PortMidi implementations may ignore timestamps for the
+ remainder of the sysex message.
+
+ On input, the timestamp ideally denotes the arrival time of the
+ status byte of the message. The first timestamp on sysex message
+ data will be valid. Subsequent timestamps may denote
+ when message bytes were actually received, or they may be simply
copies of the first timestamp.
- Timestamps for nested messages: If a real-time message arrives in
- the middle of some other message, it is enqueued immediately with
- the timestamp corresponding to its arrival time. The interrupted
- non-real-time message or 4-byte packet of sysex data will be enqueued
+ Timestamps for nested messages: If a real-time message arrives in
+ the middle of some other message, it is enqueued immediately with
+ the timestamp corresponding to its arrival time. The interrupted
+ non-real-time message or 4-byte packet of sysex data will be enqueued
later. The timestamp of interrupted data will be equal to that of
the interrupting real-time message to insure that timestamps are
non-decreasing.
@@ -580,7 +580,7 @@ typedef struct {
PmTimestamp timestamp;
} PmEvent;
-/**
+/**
@}
*/
/** \defgroup grp_io Reading and Writing Midi Messages
@@ -588,19 +588,19 @@ typedef struct {
*/
/**
Pm_Read() retrieves midi data into a buffer, and returns the number
- of events read. Result is a non-negative number unless an error occurs,
+ of events read. Result is a non-negative number unless an error occurs,
in which case a PmError value will be returned.
Buffer Overflow
- The problem: if an input overflow occurs, data will be lost, ultimately
- because there is no flow control all the way back to the data source.
- When data is lost, the receiver should be notified and some sort of
- graceful recovery should take place, e.g. you shouldn't resume receiving
+ The problem: if an input overflow occurs, data will be lost, ultimately
+ because there is no flow control all the way back to the data source.
+ When data is lost, the receiver should be notified and some sort of
+ graceful recovery should take place, e.g. you shouldn't resume receiving
in the middle of a long sysex message.
- With a lock-free fifo, which is pretty much what we're stuck with to
- enable portability to the Mac, it's tricky for the producer and consumer
+ With a lock-free fifo, which is pretty much what we're stuck with to
+ enable portability to the Mac, it's tricky for the producer and consumer
to synchronously reset the buffer and resume normal operation.
Solution: the buffer managed by PortMidi will be flushed when an overflow
@@ -613,20 +613,20 @@ typedef struct {
PMEXPORT int Pm_Read( PortMidiStream *stream, PmEvent *buffer, int32_t length );
/**
- Pm_Poll() tests whether input is available,
+ Pm_Poll() tests whether input is available,
returning TRUE, FALSE, or an error value.
*/
PMEXPORT PmError Pm_Poll( PortMidiStream *stream);
-/**
+/**
Pm_Write() writes midi data from a buffer. This may contain:
- - short messages
- or
+ - short messages
+ or
- sysex messages that are converted into a sequence of PmEvent
structures, e.g. sending data from a file or forwarding them
from midi input.
- Use Pm_WriteSysEx() to write a sysex message stored as a contiguous
+ Use Pm_WriteSysEx() to write a sysex message stored as a contiguous
array of bytes.
Sysex data may contain embedded real-time messages.
@@ -635,7 +635,7 @@ PMEXPORT PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, int32_t leng
/**
Pm_WriteShort() writes a timestamped non-system-exclusive midi message.
- Messages are delivered in order as received, and timestamps must be
+ Messages are delivered in order as received, and timestamps must be
non-decreasing. (But timestamps are ignored if the stream was opened
with latency = 0.)
*/
diff --git a/libs/backends/wavesaudio/portmidi/porttime.h b/libs/backends/wavesaudio/portmidi/porttime.h
index ff22de9d5a..c7b7aff218 100644
--- a/libs/backends/wavesaudio/portmidi/porttime.h
+++ b/libs/backends/wavesaudio/portmidi/porttime.h
@@ -9,7 +9,7 @@
#ifdef WIN32
#ifndef INT32_DEFINED
-// rather than having users install a special .h file for windows,
+// rather than having users install a special .h file for windows,
// just put the required definitions inline here. portmidi.h uses
// these too, so the definitions are (unfortunately) duplicated there
typedef int int32_t;
@@ -28,7 +28,7 @@ extern "C" {
#ifdef _WINDLL
#define PMEXPORT __declspec(dllexport)
#else
-#define PMEXPORT
+#define PMEXPORT
#endif
#endif
@@ -73,7 +73,7 @@ PMEXPORT PtError Pt_Stop();
*/
PMEXPORT int Pt_Started();
-/*
+/*
Pt_Time() returns the current time in ms.
*/
PMEXPORT PtTimestamp Pt_Time();
@@ -81,7 +81,7 @@ PMEXPORT PtTimestamp Pt_Time();
/*
Pt_Sleep() pauses, allowing other threads to run.
- duration is the length of the pause in ms. The true duration
+ duration is the length of the pause in ms. The true duration
of the pause may be rounded to the nearest or next clock tick
as determined by resolution in Pt_Start().
*/
diff --git a/libs/backends/wavesaudio/portmidi/src/pm_common/pminternal.h b/libs/backends/wavesaudio/portmidi/src/pm_common/pminternal.h
index 6b6242026d..9894c69681 100644
--- a/libs/backends/wavesaudio/portmidi/src/pm_common/pminternal.h
+++ b/libs/backends/wavesaudio/portmidi/src/pm_common/pminternal.h
@@ -30,11 +30,11 @@ void pm_free(void *ptr);
/* if an error occurs while opening or closing a midi stream, set these: */
extern int pm_hosterror;
extern char pm_hosterror_text[PM_HOST_ERROR_MSG_LEN];
-
+
struct pm_internal_struct;
/* these do not use PmInternal because it is not defined yet... */
-typedef PmError (*pm_write_short_fn)(struct pm_internal_struct *midi,
+typedef PmError (*pm_write_short_fn)(struct pm_internal_struct *midi,
PmEvent *buffer);
typedef PmError (*pm_begin_sysex_fn)(struct pm_internal_struct *midi,
PmTimestamp timestamp);
@@ -72,7 +72,7 @@ typedef struct {
pm_abort_fn abort; /* abort */
pm_close_fn close; /* close device */
pm_poll_fn poll; /* read pending midi events into portmidi buffer */
- pm_has_host_error_fn has_host_error; /* true when device has had host
+ pm_has_host_error_fn has_host_error; /* true when device has had host
error message */
pm_host_error_fn host_error; /* provide text readable host error message
for device (clears and resets) */
@@ -86,7 +86,7 @@ typedef struct {
PmDeviceInfo pub; /* some portmidi state also saved in here (for autmatic
device closing (see PmDeviceInfo struct) */
void *descriptor; /* ID number passed to win32 multimedia API open */
- void *internalDescriptor; /* points to PmInternal device, allows automatic
+ void *internalDescriptor; /* points to PmInternal device, allows automatic
device closing */
pm_fns_type dictionary;
} descriptor_node, *descriptor_type;
@@ -100,7 +100,7 @@ typedef uint32_t (*time_get_proc_type)(void *time_info);
typedef struct pm_internal_struct {
int device_id; /* which device is open (index to descriptors) */
short write_flag; /* MIDI_IN, or MIDI_OUT */
-
+
PmTimeProcPtr time_proc; /* where to get the time */
void *time_info; /* pass this to get_time() */
int32_t buffer_len; /* how big is the buffer or queue? */
@@ -110,12 +110,12 @@ typedef struct pm_internal_struct {
/* set to zero to get immediate, simple blocking output */
/* if latency is zero, timestamps will be ignored; */
/* if midi input device, this field ignored */
-
+
int sysex_in_progress; /* when sysex status is seen, this flag becomes
* true until EOX is seen. When true, new data is appended to the
- * stream of outgoing bytes. When overflow occurs, sysex data is
+ * stream of outgoing bytes. When overflow occurs, sysex data is
* dropped (until an EOX or non-real-timei status byte is seen) so
- * that, if the overflow condition is cleared, we don't start
+ * that, if the overflow condition is cleared, we don't start
* sending data from the middle of a sysex message. If a sysex
* message is filtered, sysex_in_progress is false, causing the
* message to be dropped. */
@@ -143,12 +143,12 @@ typedef struct pm_internal_struct {
/* defined by system specific implementation, e.g. pmwinmm, used by PortMidi */
-void pm_init(void);
-void pm_term(void);
+void pm_init(void);
+void pm_term(void);
/* defined by portMidi, used by pmwinmm */
PmError none_write_short(PmInternal *midi, PmEvent *buffer);
-PmError none_write_byte(PmInternal *midi, unsigned char byte,
+PmError none_write_byte(PmInternal *midi, unsigned char byte,
PmTimestamp timestamp);
PmTimestamp none_synchronize(PmInternal *midi);
diff --git a/libs/backends/wavesaudio/portmidi/src/pm_common/pmutil.c b/libs/backends/wavesaudio/portmidi/src/pm_common/pmutil.c
index a70fe2fa1f..859aa9c622 100644
--- a/libs/backends/wavesaudio/portmidi/src/pm_common/pmutil.c
+++ b/libs/backends/wavesaudio/portmidi/src/pm_common/pmutil.c
@@ -32,7 +32,7 @@ typedef struct {
PMEXPORT PmQueue *Pm_QueueCreate(long num_msgs, int32_t bytes_per_msg)
{
- int32_t int32s_per_msg =
+ int32_t int32s_per_msg =
(int32_t) (((bytes_per_msg + sizeof(int32_t) - 1) &
~(sizeof(int32_t) - 1)) / sizeof(int32_t));
PmQueueRep *queue = (PmQueueRep *) pm_alloc(sizeof(PmQueueRep));
@@ -70,11 +70,11 @@ PMEXPORT PmQueue *Pm_QueueCreate(long num_msgs, int32_t bytes_per_msg)
PMEXPORT PmError Pm_QueueDestroy(PmQueue *q)
{
PmQueueRep *queue = (PmQueueRep *) q;
-
+
/* arg checking */
- if (!queue || !queue->buffer || !queue->peek)
+ if (!queue || !queue->buffer || !queue->peek)
return pmBadPtr;
-
+
pm_free(queue->peek);
pm_free(queue->buffer);
pm_free(queue);
@@ -108,7 +108,7 @@ PMEXPORT PmError Pm_Dequeue(PmQueue *q, void *msg)
head = queue->head;
/* if writer overflows, it writes queue->overflow = tail+1 so that
- * when the reader gets to that position in the buffer, it can
+ * when the reader gets to that position in the buffer, it can
* return the overflow condition to the reader. The problem is that
* at overflow, things have wrapped around, so tail == head, and the
* reader will detect overflow immediately instead of waiting until
@@ -116,11 +116,11 @@ PMEXPORT PmError Pm_Dequeue(PmQueue *q, void *msg)
* point where tail == head. So the condition also checks that
* queue->buffer[head] is zero -- if so, then the buffer is now
* empty, and we're at the point in the msg stream where overflow
- * occurred. It's time to signal overflow to the reader. If
+ * occurred. It's time to signal overflow to the reader. If
* queue->buffer[head] is non-zero, there's a message there and we
* should read all the way around the buffer before signalling overflow.
* There is a write-order dependency here, but to fail, the overflow
- * field would have to be written while an entire buffer full of
+ * field would have to be written while an entire buffer full of
* writes are still pending. I'm assuming out-of-order writes are
* possible, but not that many.
*/
@@ -131,14 +131,14 @@ PMEXPORT PmError Pm_Dequeue(PmQueue *q, void *msg)
/* test to see if there is data in the queue -- test from back
* to front so if writer is simultaneously writing, we don't
- * waste time discovering the write is not finished
+ * waste time discovering the write is not finished
*/
for (i = queue->msg_size - 1; i >= 0; i--) {
if (!queue->buffer[head + i]) {
return pmNoData;
}
}
- memcpy(msg, (char *) &queue->buffer[head + 1],
+ memcpy(msg, (char *) &queue->buffer[head + 1],
sizeof(int32_t) * (queue->msg_size - 1));
/* fix up zeros */
i = queue->buffer[head];
@@ -185,7 +185,7 @@ PMEXPORT PmError Pm_Enqueue(PmQueue *q, void *msg)
int32_t *ptr;
int32_t *dest;
int rslt;
- if (!queue)
+ if (!queue)
return pmBadPtr;
/* no more enqueue until receiver acknowledges overflow */
if (queue->overflow) return pmBufferOverflow;
@@ -229,7 +229,7 @@ PMEXPORT int Pm_QueueEmpty(PmQueue *q)
PMEXPORT int Pm_QueueFull(PmQueue *q)
{
long tail;
- int i;
+ int i;
PmQueueRep *queue = (PmQueueRep *) q;
/* arg checking */
if (!queue)
@@ -257,7 +257,7 @@ PMEXPORT void *Pm_QueuePeek(PmQueue *q)
if (queue->peek_flag) {
return queue->peek;
}
- /* this is ugly: if peek_overflow is set, then Pm_Dequeue()
+ /* this is ugly: if peek_overflow is set, then Pm_Dequeue()
* returns immediately with pmBufferOverflow, but here, we
* want Pm_Dequeue() to really check for data. If data is
* there, we can return it
@@ -271,7 +271,7 @@ PMEXPORT void *Pm_QueuePeek(PmQueue *q)
queue->peek_flag = TRUE;
return queue->peek;
} else if (rslt == pmBufferOverflow) {
- /* when overflow is indicated, the queue is empty and the
+ /* when overflow is indicated, the queue is empty and the
* first message that was dropped by Enqueue (signalling
* pmBufferOverflow to its caller) would have been the next
* message in the queue. Pm_QueuePeek will return NULL, but
diff --git a/libs/backends/wavesaudio/portmidi/src/pm_common/portmidi.c b/libs/backends/wavesaudio/portmidi/src/pm_common/portmidi.c
index b262ba5391..0b75222a33 100644
--- a/libs/backends/wavesaudio/portmidi/src/pm_common/portmidi.c
+++ b/libs/backends/wavesaudio/portmidi/src/pm_common/portmidi.c
@@ -90,24 +90,24 @@ int pm_descriptor_max = 0;
int pm_descriptor_index = 0;
descriptor_type descriptors = NULL;
-/* pm_add_device -- describe interface/device pair to library
+/* pm_add_device -- describe interface/device pair to library
*
- * This is called at intialization time, once for each
+ * This is called at intialization time, once for each
* interface (e.g. DirectSound) and device (e.g. SoundBlaster 1)
* The strings are retained but NOT COPIED, so do not destroy them!
*
* returns pmInvalidDeviceId if device memory is exceeded
* otherwise returns pmNoError
*/
-PmError pm_add_device(char *interf, char *name, int input,
+PmError pm_add_device(char *interf, char *name, int input,
void *descriptor, pm_fns_type dictionary) {
if (pm_descriptor_index >= pm_descriptor_max) {
// expand descriptors
- descriptor_type new_descriptors = (descriptor_type)
+ descriptor_type new_descriptors = (descriptor_type)
pm_alloc(sizeof(descriptor_node) * (pm_descriptor_max + 32));
if (!new_descriptors) return pmInsufficientMemory;
if (descriptors) {
- memcpy(new_descriptors, descriptors,
+ memcpy(new_descriptors, descriptors,
sizeof(descriptor_node) * pm_descriptor_max);
free(descriptors);
}
@@ -124,19 +124,19 @@ PmError pm_add_device(char *interf, char *name, int input,
/* ID number passed to win32 multimedia API open */
descriptors[pm_descriptor_index].descriptor = descriptor;
-
+
/* points to PmInternal, allows automatic device closing */
descriptors[pm_descriptor_index].internalDescriptor = NULL;
descriptors[pm_descriptor_index].dictionary = dictionary;
-
+
pm_descriptor_index++;
-
+
return pmNoError;
}
-/* utility to look up device, given a pattern,
+/* utility to look up device, given a pattern,
note: pattern is modified
*/
int pm_find_default_device(char *pattern, int is_input)
@@ -162,7 +162,7 @@ int pm_find_default_device(char *pattern, int is_input)
id = i;
break;
}
- }
+ }
return id;
}
@@ -203,7 +203,7 @@ PmError pm_fail_timestamp_fn(PmInternal *midi, PmTimestamp timestamp) {
return pmBadPtr;
}
-PmError none_write_byte(PmInternal *midi, unsigned char byte,
+PmError none_write_byte(PmInternal *midi, unsigned char byte,
PmTimestamp timestamp) {
return pmBadPtr;
}
@@ -238,11 +238,11 @@ pm_fns_node pm_none_dictionary = {
none_write_flush,
none_synchronize,
none_open,
- none_abort,
+ none_abort,
none_close,
none_poll,
none_has_host_error,
- none_get_host_error
+ none_get_host_error
};
@@ -251,26 +251,26 @@ PMEXPORT const char *Pm_GetErrorText( PmError errnum ) {
switch(errnum)
{
- case pmNoError:
- msg = "";
+ case pmNoError:
+ msg = "";
break;
- case pmHostError:
- msg = "PortMidi: `Host error'";
+ case pmHostError:
+ msg = "PortMidi: `Host error'";
break;
- case pmInvalidDeviceId:
- msg = "PortMidi: `Invalid device ID'";
+ case pmInvalidDeviceId:
+ msg = "PortMidi: `Invalid device ID'";
break;
- case pmInsufficientMemory:
- msg = "PortMidi: `Insufficient memory'";
+ case pmInsufficientMemory:
+ msg = "PortMidi: `Insufficient memory'";
break;
- case pmBufferTooSmall:
- msg = "PortMidi: `Buffer too small'";
+ case pmBufferTooSmall:
+ msg = "PortMidi: `Buffer too small'";
break;
- case pmBadPtr:
- msg = "PortMidi: `Bad pointer'";
+ case pmBadPtr:
+ msg = "PortMidi: `Bad pointer'";
break;
- case pmInternalError:
- msg = "PortMidi: `Internal PortMidi Error'";
+ case pmInternalError:
+ msg = "PortMidi: `Internal PortMidi Error'";
break;
case pmBufferOverflow:
msg = "PortMidi: `Buffer overflow'";
@@ -281,8 +281,8 @@ PMEXPORT const char *Pm_GetErrorText( PmError errnum ) {
case pmBufferMaxSize:
msg = "PortMidi: `Buffer cannot be made larger'";
break;
- default:
- msg = "PortMidi: `Illegal error number'";
+ default:
+ msg = "PortMidi: `Illegal error number'";
break;
}
return msg;
@@ -313,7 +313,7 @@ PMEXPORT int Pm_HasHostError(PortMidiStream * stream) {
PmInternal * midi = (PmInternal *) stream;
pm_hosterror = (*midi->dictionary->has_host_error)(midi);
if (pm_hosterror) {
- midi->dictionary->host_error(midi, pm_hosterror_text,
+ midi->dictionary->host_error(midi, pm_hosterror_text,
PM_HOST_ERROR_MSG_LEN);
/* now error message is global */
return TRUE;
@@ -365,7 +365,7 @@ PMEXPORT int Pm_Read(PortMidiStream *stream, PmEvent *buffer, int32_t length) {
else if(!descriptors[midi->device_id].pub.opened)
err = pmBadPtr;
else if(!descriptors[midi->device_id].pub.input)
- err = pmBadPtr;
+ err = pmBadPtr;
/* First poll for data in the buffer...
* This either simply checks for data, or attempts first to fill the buffer
* with data from the MIDI hardware; this depends on the implementation.
@@ -375,7 +375,7 @@ PMEXPORT int Pm_Read(PortMidiStream *stream, PmEvent *buffer, int32_t length) {
if (err != pmNoError) {
if (err == pmHostError) {
- midi->dictionary->host_error(midi, pm_hosterror_text,
+ midi->dictionary->host_error(midi, pm_hosterror_text,
PM_HOST_ERROR_MSG_LEN);
pm_hosterror = TRUE;
}
@@ -413,7 +413,7 @@ PMEXPORT PmError Pm_Poll( PortMidiStream *stream )
if (err != pmNoError) {
if (err == pmHostError) {
- midi->dictionary->host_error(midi, pm_hosterror_text,
+ midi->dictionary->host_error(midi, pm_hosterror_text,
PM_HOST_ERROR_MSG_LEN);
pm_hosterror = TRUE;
}
@@ -425,7 +425,7 @@ PMEXPORT PmError Pm_Poll( PortMidiStream *stream )
/* this is called from Pm_Write and Pm_WriteSysEx to issue a
- * call to the system-dependent end_sysex function and handle
+ * call to the system-dependent end_sysex function and handle
* the error return
*/
static PmError pm_end_sysex(PmInternal *midi)
@@ -433,7 +433,7 @@ static PmError pm_end_sysex(PmInternal *midi)
PmError err = (*midi->dictionary->end_sysex)(midi, 0);
midi->sysex_in_progress = FALSE;
if (err == pmHostError) {
- midi->dictionary->host_error(midi, pm_hosterror_text,
+ midi->dictionary->host_error(midi, pm_hosterror_text,
PM_HOST_ERROR_MSG_LEN);
pm_hosterror = TRUE;
}
@@ -451,7 +451,7 @@ PMEXPORT PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, int32_t leng
PmError err = pmNoError;
int i;
int bits;
-
+
pm_hosterror = FALSE;
/* arg checking */
if(midi == NULL)
@@ -462,9 +462,9 @@ PMEXPORT PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, int32_t leng
err = pmBadPtr;
else
err = pmNoError;
-
+
if (err != pmNoError) goto pm_write_error;
-
+
if (midi->latency == 0) {
midi->now = 0;
} else {
@@ -479,12 +479,12 @@ PMEXPORT PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, int32_t leng
* dictionary->begin_sysex() followed by calls to
* dictionary->write_byte() and dictionary->write_realtime()
* until an end-of-sysex is detected, when we call
- * dictionary->end_sysex(). After an error occurs,
+ * dictionary->end_sysex(). After an error occurs,
* Pm_Write() continues to call functions. For example,
* it will continue to call write_byte() even after
* an error sending a sysex message, and end_sysex() will be
* called when an EOX or non-real-time status is found.
- * When errors are detected, Pm_Write() returns immediately,
+ * When errors are detected, Pm_Write() returns immediately,
* so it is possible that this will drop data and leave
* sysex messages in a partially transmitted state.
*/
@@ -500,21 +500,21 @@ PMEXPORT PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, int32_t leng
goto pm_write_error;
}
midi->sysex_in_progress = TRUE;
- if ((err = (*midi->dictionary->begin_sysex)(midi,
+ if ((err = (*midi->dictionary->begin_sysex)(midi,
buffer[i].timestamp)) != pmNoError)
goto pm_write_error;
if ((err = (*midi->dictionary->write_byte)(midi, MIDI_SYSEX,
- buffer[i].timestamp)) != pmNoError)
+ buffer[i].timestamp)) != pmNoError)
goto pm_write_error;
bits = 8;
/* fall through to continue sysex processing */
- } else if ((msg & MIDI_STATUS_MASK) &&
+ } else if ((msg & MIDI_STATUS_MASK) &&
(Pm_MessageStatus(msg) != MIDI_EOX)) {
/* a non-sysex message */
if (midi->sysex_in_progress) {
/* this should be a realtime message */
if (is_real_time(msg)) {
- if ((err = (*midi->dictionary->write_realtime)(midi,
+ if ((err = (*midi->dictionary->write_realtime)(midi,
&(buffer[i]))) != pmNoError)
goto pm_write_error;
} else {
@@ -526,7 +526,7 @@ PMEXPORT PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, int32_t leng
goto pm_write_error;
}
} else { /* regular short midi message */
- if ((err = (*midi->dictionary->write_short)(midi,
+ if ((err = (*midi->dictionary->write_short)(midi,
&(buffer[i]))) != pmNoError)
goto pm_write_error;
continue;
@@ -538,9 +538,9 @@ PMEXPORT PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, int32_t leng
(*midi->fill_offset_ptr) + 4 <= midi->fill_length &&
(msg & 0x80808080) == 0) { /* all data */
/* copy 4 bytes from msg to fill_base + fill_offset */
- unsigned char *ptr = midi->fill_base +
+ unsigned char *ptr = midi->fill_base +
*(midi->fill_offset_ptr);
- ptr[0] = msg; ptr[1] = msg >> 8;
+ ptr[0] = msg; ptr[1] = msg >> 8;
ptr[2] = msg >> 16; ptr[3] = msg >> 24;
(*midi->fill_offset_ptr) += 4;
continue;
@@ -548,7 +548,7 @@ PMEXPORT PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, int32_t leng
/* no acceleration, so do byte-by-byte copying */
while (bits < 32) {
unsigned char midi_byte = (unsigned char) (msg >> bits);
- if ((err = (*midi->dictionary->write_byte)(midi, midi_byte,
+ if ((err = (*midi->dictionary->write_byte)(midi, midi_byte,
buffer[i].timestamp)) != pmNoError)
goto pm_write_error;
if (midi_byte == MIDI_EOX) {
@@ -569,7 +569,7 @@ PMEXPORT PmError Pm_Write( PortMidiStream *stream, PmEvent *buffer, int32_t leng
err = (*midi->dictionary->write_flush)(midi, 0);
pm_write_error:
if (err == pmHostError) {
- midi->dictionary->host_error(midi, pm_hosterror_text,
+ midi->dictionary->host_error(midi, pm_hosterror_text,
PM_HOST_ERROR_MSG_LEN);
pm_hosterror = TRUE;
}
@@ -581,14 +581,14 @@ error_exit:
PMEXPORT PmError Pm_WriteShort(PortMidiStream *stream, PmTimestamp when, PmMessage msg)
{
PmEvent event;
-
+
event.timestamp = when;
event.message = msg;
return Pm_Write(stream, &event, 1);
}
-PMEXPORT PmError Pm_WriteSysEx(PortMidiStream *stream, PmTimestamp when,
+PMEXPORT PmError Pm_WriteSysEx(PortMidiStream *stream, PmTimestamp when,
unsigned char *msg)
{
/* allocate buffer space for PM_DEFAULT_SYSEX_BUFFER_SIZE bytes */
@@ -632,7 +632,7 @@ PMEXPORT PmError Pm_WriteSysEx(PortMidiStream *stream, PmTimestamp when,
}
/* I thought that I could do a pm_Write here and
* change this if to a loop, avoiding calls in Pm_Write
- * to the slower write_byte, but since
+ * to the slower write_byte, but since
* sysex_in_progress is true, this will not flush
* the buffer, and we'll infinite loop: */
/* err = Pm_Write(stream, buffer, 0);
@@ -649,7 +649,7 @@ PMEXPORT PmError Pm_WriteSysEx(PortMidiStream *stream, PmTimestamp when,
}
buffer[bufx].message = 0;
buffer[bufx].timestamp = when;
- }
+ }
/* keep inserting bytes until you find MIDI_EOX */
}
end_of_sysex:
@@ -677,20 +677,20 @@ PMEXPORT PmError Pm_OpenInput(PortMidiStream** stream,
PmError err = pmNoError;
pm_hosterror = FALSE;
*stream = NULL;
-
+
/* arg checking */
- if (inputDevice < 0 || inputDevice >= pm_descriptor_index)
+ if (inputDevice < 0 || inputDevice >= pm_descriptor_index)
err = pmInvalidDeviceId;
- else if (!descriptors[inputDevice].pub.input)
+ else if (!descriptors[inputDevice].pub.input)
err = pmInvalidDeviceId;
else if(descriptors[inputDevice].pub.opened)
err = pmInvalidDeviceId;
-
- if (err != pmNoError)
+
+ if (err != pmNoError)
goto error_return;
/* create portMidi internal data */
- midi = (PmInternal *) pm_alloc(sizeof(PmInternal));
+ midi = (PmInternal *) pm_alloc(sizeof(PmInternal));
*stream = midi;
if (!midi) {
err = pmInsufficientMemory;
@@ -710,15 +710,15 @@ PMEXPORT PmError Pm_OpenInput(PortMidiStream** stream,
if (!midi->queue) {
/* free portMidi data */
*stream = NULL;
- pm_free(midi);
+ pm_free(midi);
err = pmInsufficientMemory;
goto error_return;
}
midi->buffer_len = bufferSize; /* portMidi input storage */
midi->latency = 0; /* not used */
midi->sysex_in_progress = FALSE;
- midi->sysex_message = 0;
- midi->sysex_message_count = 0;
+ midi->sysex_message = 0;
+ midi->sysex_message_count = 0;
midi->filters = PM_FILT_ACTIVE;
midi->channel_mask = 0xFFFF;
midi->sync_time = 0;
@@ -755,26 +755,26 @@ PMEXPORT PmError Pm_OpenOutput(PortMidiStream** stream,
int32_t bufferSize,
PmTimeProcPtr time_proc,
void *time_info,
- int32_t latency )
+ int32_t latency )
{
PmInternal *midi;
PmError err = pmNoError;
pm_hosterror = FALSE;
*stream = NULL;
-
+
/* arg checking */
if (outputDevice < 0 || outputDevice >= pm_descriptor_index)
err = pmInvalidDeviceId;
- else if (!descriptors[outputDevice].pub.output)
+ else if (!descriptors[outputDevice].pub.output)
err = pmInvalidDeviceId;
else if (descriptors[outputDevice].pub.opened)
err = pmInvalidDeviceId;
- if (err != pmNoError)
+ if (err != pmNoError)
goto error_return;
/* create portMidi internal data */
- midi = (PmInternal *) pm_alloc(sizeof(PmInternal));
- *stream = midi;
+ midi = (PmInternal *) pm_alloc(sizeof(PmInternal));
+ *stream = midi;
if (!midi) {
err = pmInsufficientMemory;
goto error_return;
@@ -785,7 +785,7 @@ PMEXPORT PmError Pm_OpenOutput(PortMidiStream** stream,
/* if latency > 0, we need a time reference. If none is provided,
use PortTime library */
if (time_proc == NULL && latency != 0) {
- if (!Pt_Started())
+ if (!Pt_Started())
Pt_Start(1, 0, 0);
/* time_get does not take a parameter, so coerce */
midi->time_proc = (PmTimeProcPtr) Pt_Time;
@@ -815,7 +815,7 @@ PMEXPORT PmError Pm_OpenOutput(PortMidiStream** stream,
*stream = NULL;
descriptors[outputDevice].internalDescriptor = NULL;
/* free portMidi data */
- pm_free(midi);
+ pm_free(midi);
} else {
/* portMidi input open successful */
descriptors[outputDevice].pub.opened = TRUE;
@@ -871,8 +871,8 @@ PMEXPORT PmError Pm_Close( PortMidiStream *stream ) {
/* and the device should be in the opened state */
else if (!descriptors[midi->device_id].pub.opened)
err = pmBadPtr;
-
- if (err != pmNoError)
+
+ if (err != pmNoError)
goto error_return;
/* close the device */
@@ -881,7 +881,7 @@ PMEXPORT PmError Pm_Close( PortMidiStream *stream ) {
descriptors[midi->device_id].internalDescriptor = NULL;
descriptors[midi->device_id].pub.opened = FALSE;
if (midi->queue) Pm_QueueDestroy(midi->queue);
- pm_free(midi);
+ pm_free(midi);
error_return:
/* system dependent code must set pm_hosterror and
* pm_hosterror_text if a pmHostError occurs.
@@ -917,7 +917,7 @@ PMEXPORT PmError Pm_Abort( PortMidiStream* stream ) {
err = (*midi->dictionary->abort)(midi);
if (err == pmHostError) {
- midi->dictionary->host_error(midi, pm_hosterror_text,
+ midi->dictionary->host_error(midi, pm_hosterror_text,
PM_HOST_ERROR_MSG_LEN);
pm_hosterror = TRUE;
}
@@ -982,10 +982,10 @@ PMEXPORT PmError Pm_Abort( PortMidiStream* stream ) {
static void pm_flush_sysex(PmInternal *midi, PmTimestamp timestamp)
{
PmEvent event;
-
+
/* there may be nothing in the buffer */
if (midi->sysex_message_count == 0) return; /* nothing to flush */
-
+
event.message = midi->sysex_message;
event.timestamp = timestamp;
/* copied from pm_read_short, avoids filtering */
@@ -1004,23 +1004,23 @@ static void pm_flush_sysex(PmInternal *midi, PmTimestamp timestamp)
1) all short input messages must be sent to pm_read_short, which
enqueues them to a FIFO for the application.
2) each buffer of sysex bytes should be reported by calling pm_read_bytes
- (which sets midi->sysex_in_progress). After the eox byte,
+ (which sets midi->sysex_in_progress). After the eox byte,
pm_read_bytes will clear sysex_in_progress
*/
-/* pm_read_short is the place where all input messages arrive from
+/* pm_read_short is the place where all input messages arrive from
system-dependent code such as pmwinmm.c. Here, the messages
- are entered into the PortMidi input buffer.
+ are entered into the PortMidi input buffer.
*/
void pm_read_short(PmInternal *midi, PmEvent *event)
-{
+{
int status;
/* arg checking */
assert(midi != NULL);
/* midi filtering is applied here */
status = Pm_MessageStatus(event->message);
if (!pm_status_filtered(status, midi->filters)
- && (!is_real_time(status) ||
+ && (!is_real_time(status) ||
!pm_realtime_filtered(status, midi->filters))
&& !pm_channel_filtered(status, midi->channel_mask)) {
/* if sysex is in progress and we get a status byte, it had
@@ -1033,7 +1033,7 @@ void pm_read_short(PmInternal *midi, PmEvent *event)
* embedded in a sysex message
*/
if (is_real_time(status)) {
- midi->sysex_message |=
+ midi->sysex_message |=
(status << (8 * midi->sysex_message_count++));
if (midi->sysex_message_count == 4) {
pm_flush_sysex(midi, event->timestamp);
@@ -1052,7 +1052,7 @@ void pm_read_short(PmInternal *midi, PmEvent *event)
/*
* returns how many bytes processed
*/
-unsigned int pm_read_bytes(PmInternal *midi, const unsigned char *data,
+unsigned int pm_read_bytes(PmInternal *midi, const unsigned char *data,
int len, PmTimestamp timestamp)
{
int i = 0; /* index into data, must not be unsigned (!) */
@@ -1093,15 +1093,15 @@ unsigned int pm_read_bytes(PmInternal *midi, const unsigned char *data,
}
/* Now, i<len implies sysex_in_progress. If sysex_in_progress
* becomes false in the loop, there must have been an overflow
- * and we can just drop all remaining bytes
+ * and we can just drop all remaining bytes
*/
while (i < len && midi->sysex_in_progress) {
if (midi->sysex_message_count == 0 && i <= len - 4 &&
- ((event.message = (((PmMessage) data[i]) |
+ ((event.message = (((PmMessage) data[i]) |
(((PmMessage) data[i+1]) << 8) |
(((PmMessage) data[i+2]) << 16) |
(((PmMessage) data[i+3]) << 24))) &
- 0x80808080) == 0) { /* all data, no status */
+ 0x80808080) == 0) { /* all data, no status */
if (Pm_Enqueue(midi->queue, &event) == pmBufferOverflow) {
midi->sysex_in_progress = FALSE;
}
@@ -1110,11 +1110,11 @@ unsigned int pm_read_bytes(PmInternal *midi, const unsigned char *data,
while (i < len) {
/* send one byte at a time */
unsigned char byte = data[i++];
- if (is_real_time(byte) &&
+ if (is_real_time(byte) &&
pm_realtime_filtered(byte, midi->filters)) {
continue; /* real-time data is filtered, so omit */
}
- midi->sysex_message |=
+ midi->sysex_message |=
(byte << (8 * midi->sysex_message_count++));
if (byte == MIDI_EOX) {
midi->sysex_in_progress = FALSE;
diff --git a/libs/backends/wavesaudio/portmidi/src/pm_mac/pmmac.c b/libs/backends/wavesaudio/portmidi/src/pm_mac/pmmac.c
index bcef0d1f1c..8e049fa21f 100644
--- a/libs/backends/wavesaudio/portmidi/src/pm_mac/pmmac.c
+++ b/libs/backends/wavesaudio/portmidi/src/pm_mac/pmmac.c
@@ -1,7 +1,7 @@
/* pmmac.c -- PortMidi os-dependent code */
/* This file only needs to implement:
-pm_init(), which calls various routines to register the
+pm_init(), which calls various routines to register the
available midi devices,
Pm_GetDefaultInputDeviceID(), and
Pm_GetDefaultOutputDeviceID().
@@ -26,10 +26,10 @@ void pm_init()
pm_initialized = TRUE;
if (!err) {
pm_default_input_device_id = find_default_device(
- "/PortMidi/PM_RECOMMENDED_INPUT_DEVICE", TRUE,
+ "/PortMidi/PM_RECOMMENDED_INPUT_DEVICE", TRUE,
pm_default_input_device_id);
pm_default_output_device_id = find_default_device(
- "/PortMidi/PM_RECOMMENDED_OUTPUT_DEVICE", FALSE,
+ "/PortMidi/PM_RECOMMENDED_OUTPUT_DEVICE", FALSE,
pm_default_output_device_id);
}
}
diff --git a/libs/backends/wavesaudio/portmidi/src/pm_mac/pmmacosxcm.c b/libs/backends/wavesaudio/portmidi/src/pm_mac/pmmacosxcm.c
index b0a6825e67..6432d2b55d 100644
--- a/libs/backends/wavesaudio/portmidi/src/pm_mac/pmmacosxcm.c
+++ b/libs/backends/wavesaudio/portmidi/src/pm_mac/pmmacosxcm.c
@@ -1,13 +1,13 @@
/*
* Platform interface to the MacOS X CoreMIDI framework
- *
+ *
* Jon Parise <jparise at cmu.edu>
* and subsequent work by Andrew Zeldis and Zico Kolter
* and Roger B. Dannenberg
*
* $Id: pmmacosx.c,v 1.17 2002/01/27 02:40:40 jon Exp $
*/
-
+
/* Notes:
since the input and output streams are represented by MIDIEndpointRef
values and almost no other state, we store the MIDIEndpointRef on
@@ -16,7 +16,7 @@
the error text. We use a structure with two kinds of
host error: "error" and "callback_error". That way, asynchronous callbacks
do not interfere with other error information.
-
+
OS X does not seem to have an error-code-to-text function, so we will
just use text messages instead of error codes.
*/
@@ -45,21 +45,21 @@
#define MAX_BYTES_PER_S 14000
/* Apple reports that packets are dropped when the MIDI bytes/sec
- exceeds 15000. This is computed by "tracking the number of MIDI
+ exceeds 15000. This is computed by "tracking the number of MIDI
bytes scheduled into 1-second buckets over the last six seconds
- and averaging these counts."
+ and averaging these counts."
- This is apparently based on timestamps, not on real time, so
+ This is apparently based on timestamps, not on real time, so
we have to avoid constructing packets that schedule high speed
output even if the actual writes are delayed (which was my first
solution).
- The LIMIT_RATE symbol, if defined, enables code to modify
+ The LIMIT_RATE symbol, if defined, enables code to modify
timestamps as follows:
After each packet is formed, the next allowable timestamp is
computed as this_packet_time + this_packet_len * delay_per_byte
- This is the minimum timestamp allowed in the next packet.
+ This is the minimum timestamp allowed in the next packet.
Note that this distorts accurate timestamps somewhat.
*/
@@ -105,7 +105,7 @@ typedef struct midi_macosxcm_struct {
Byte sysex_buffer[SYSEX_BUFFER_SIZE]; /* temp storage for sysex data */
MIDITimeStamp sysex_timestamp; /* timestamp to use with sysex data */
/* allow for running status (is running status possible here? -rbd): -cpr */
- unsigned char last_command;
+ unsigned char last_command;
int32_t last_msg_length;
/* limit midi data rate (a CoreMidi requirement): */
UInt64 min_next_time; /* when can the next send take place? */
@@ -144,11 +144,11 @@ midi_length(int32_t msg)
static PmTimestamp midi_synchronize(PmInternal *midi)
{
midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
- UInt64 pm_stream_time_2 =
+ UInt64 pm_stream_time_2 =
AudioConvertHostTimeToNanos(AudioGetCurrentHostTime());
PmTimestamp real_time;
UInt64 pm_stream_time;
- /* if latency is zero and this is an output, there is no
+ /* if latency is zero and this is an output, there is no
time reference and midi_synchronize should never be called */
assert(midi->time_proc);
assert(!(midi->write_flag && midi->latency == 0));
@@ -166,7 +166,7 @@ static PmTimestamp midi_synchronize(PmInternal *midi)
static void
-process_packet(MIDIPacket *packet, PmEvent *event,
+process_packet(MIDIPacket *packet, PmEvent *event,
PmInternal *midi, midi_macosxcm_type m)
{
/* handle a packet of MIDI messages from CoreMIDI */
@@ -179,8 +179,8 @@ process_packet(MIDIPacket *packet, PmEvent *event,
(m->last_command == 0 &&
!(cur_packet_data[0] & MIDI_STATUS_MASK))) {
m->last_command = 0; /* no running status */
- unsigned int amt = pm_read_bytes(midi, cur_packet_data,
- remaining_length,
+ unsigned int amt = pm_read_bytes(midi, cur_packet_data,
+ remaining_length,
event->timestamp);
remaining_length -= amt;
cur_packet_data += amt;
@@ -204,14 +204,14 @@ process_packet(MIDIPacket *packet, PmEvent *event,
switch (cur_message_length) {
case 1:
event->message = Pm_Message(cur_packet_data[0], 0, 0);
- break;
+ break;
case 2:
- event->message = Pm_Message(cur_packet_data[0],
+ event->message = Pm_Message(cur_packet_data[0],
cur_packet_data[1], 0);
break;
case 3:
event->message = Pm_Message(cur_packet_data[0],
- cur_packet_data[1],
+ cur_packet_data[1],
cur_packet_data[2]);
break;
default:
@@ -235,12 +235,12 @@ process_packet(MIDIPacket *packet, PmEvent *event,
event->message = Pm_Message(m->last_command, 0, 0);
break;
case 2:
- event->message = Pm_Message(m->last_command,
+ event->message = Pm_Message(m->last_command,
cur_packet_data[0], 0);
break;
case 3:
- event->message = Pm_Message(m->last_command,
- cur_packet_data[0],
+ event->message = Pm_Message(m->last_command,
+ cur_packet_data[0],
cur_packet_data[1]);
break;
default:
@@ -267,7 +267,7 @@ readProc(const MIDIPacketList *newPackets, void *refCon, void *connRefCon)
unsigned int packetIndex;
uint32_t now;
unsigned int status;
-
+
#ifdef CM_DEBUG
printf("readProc: numPackets %d: ", newPackets->numPackets);
#endif
@@ -276,22 +276,22 @@ readProc(const MIDIPacketList *newPackets, void *refCon, void *connRefCon)
midi = (PmInternal *) connRefCon;
m = (midi_macosxcm_type) midi->descriptor;
assert(m);
-
+
/* synchronize time references every 100ms */
now = (*midi->time_proc)(midi->time_info);
- if (m->first_message || m->sync_time + 100 /*ms*/ < now) {
+ if (m->first_message || m->sync_time + 100 /*ms*/ < now) {
/* time to resync */
now = midi_synchronize(midi);
m->first_message = FALSE;
}
-
+
packet = (MIDIPacket *) &newPackets->packet[0];
- /* printf("readproc packet status %x length %d\n", packet->data[0],
+ /* printf("readproc packet status %x length %d\n", packet->data[0],
packet->length); */
for (packetIndex = 0; packetIndex < newPackets->numPackets; packetIndex++) {
/* Set the timestamp and dispatch this message */
event.timestamp = (PmTimestamp) /* explicit conversion */ (
- (AudioConvertHostTimeToNanos(packet->timeStamp) - m->delta) /
+ (AudioConvertHostTimeToNanos(packet->timeStamp) - m->delta) /
(UInt64) 1000000);
status = packet->data[0];
/* process packet as sysex data if it begins with MIDI_SYSEX, or
@@ -299,7 +299,7 @@ readProc(const MIDIPacketList *newPackets, void *refCon, void *connRefCon)
#ifdef CM_DEBUG
printf(" %d", packet->length);
#endif
- if (status == MIDI_SYSEX || status == MIDI_EOX ||
+ if (status == MIDI_SYSEX || status == MIDI_EOX ||
((!(status & MIDI_STATUS_MASK)) && !m->last_command)) {
/* previously was: !(status & MIDI_STATUS_MASK)) {
* but this could mistake running status for sysex data
@@ -325,10 +325,10 @@ midi_in_open(PmInternal *midi, void *driverInfo)
MIDIEndpointRef endpoint;
midi_macosxcm_type m;
OSStatus macHostError;
-
+
/* insure that we have a time_proc for timing */
if (midi->time_proc == NULL) {
- if (!Pt_Started())
+ if (!Pt_Started())
Pt_Start(1, 0, 0);
/* time_get does not take a parameter, so coerce */
midi->time_proc = (PmTimeProcPtr) Pt_Time;
@@ -360,14 +360,14 @@ midi_in_open(PmInternal *midi, void *driverInfo)
macHostError = MIDIPortConnectSource(portIn, endpoint, midi);
if (macHostError != noErr) {
pm_hosterror = macHostError;
- sprintf(pm_hosterror_text,
+ sprintf(pm_hosterror_text,
"Host error %ld: MIDIPortConnectSource() in midi_in_open()",
(long) macHostError);
midi->descriptor = NULL;
pm_free(m);
return pmHostError;
}
-
+
return pmNoError;
}
@@ -377,29 +377,29 @@ midi_in_close(PmInternal *midi)
MIDIEndpointRef endpoint;
OSStatus macHostError;
PmError err = pmNoError;
-
+
midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
-
+
if (!m) return pmBadPtr;
endpoint = (MIDIEndpointRef) (long) descriptors[midi->device_id].descriptor;
if (endpoint == NULL_REF) {
pm_hosterror = pmBadPtr;
}
-
+
/* shut off the incoming messages before freeing data structures */
macHostError = MIDIPortDisconnectSource(portIn, endpoint);
if (macHostError != noErr) {
pm_hosterror = macHostError;
- sprintf(pm_hosterror_text,
+ sprintf(pm_hosterror_text,
"Host error %ld: MIDIPortDisconnectSource() in midi_in_close()",
(long) macHostError);
err = pmHostError;
}
-
+
midi->descriptor = NULL;
pm_free(midi->descriptor);
-
+
return err;
}
@@ -430,7 +430,7 @@ midi_out_open(PmInternal *midi, void *driverInfo)
m->min_next_time = 0;
m->byte_count = 0;
m->us_per_host_tick = 1000000.0 / AudioGetHostClockFrequency();
- m->host_ticks_per_byte = (UInt64) (1000000.0 /
+ m->host_ticks_per_byte = (UInt64) (1000000.0 /
(m->us_per_host_tick * MAX_BYTES_PER_S));
return pmNoError;
}
@@ -441,10 +441,10 @@ midi_out_close(PmInternal *midi)
{
midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
if (!m) return pmBadPtr;
-
+
midi->descriptor = NULL;
pm_free(midi->descriptor);
-
+
return pmNoError;
}
@@ -471,7 +471,7 @@ midi_write_flush(PmInternal *midi, PmTimestamp timestamp)
{
OSStatus macHostError;
midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
- MIDIEndpointRef endpoint =
+ MIDIEndpointRef endpoint =
(MIDIEndpointRef) (long) descriptors[midi->device_id].descriptor;
assert(m);
assert(endpoint);
@@ -481,7 +481,7 @@ midi_write_flush(PmInternal *midi, PmTimestamp timestamp)
* 15KB/s. */
UInt64 now = AudioGetCurrentHostTime();
if (now < m->min_next_time) {
- usleep((useconds_t)
+ usleep((useconds_t)
((m->min_next_time - now) * m->us_per_host_tick));
}
macHostError = MIDISend(portOut, endpoint, m->packetList);
@@ -491,10 +491,10 @@ midi_write_flush(PmInternal *midi, PmTimestamp timestamp)
if (macHostError != noErr) goto send_packet_error;
}
return pmNoError;
-
+
send_packet_error:
pm_hosterror = macHostError;
- sprintf(pm_hosterror_text,
+ sprintf(pm_hosterror_text,
"Host error %ld: MIDISend() in midi_write()",
(long) macHostError);
return pmHostError;
@@ -503,37 +503,37 @@ send_packet_error:
static PmError
-send_packet(PmInternal *midi, Byte *message, unsigned int messageLength,
+send_packet(PmInternal *midi, Byte *message, unsigned int messageLength,
MIDITimeStamp timestamp)
{
PmError err;
midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
assert(m);
-
+
/* printf("add %d to packet %p len %d\n", message[0], m->packet, messageLength); */
- m->packet = MIDIPacketListAdd(m->packetList, sizeof(m->packetBuffer),
- m->packet, timestamp, messageLength,
+ m->packet = MIDIPacketListAdd(m->packetList, sizeof(m->packetBuffer),
+ m->packet, timestamp, messageLength,
message);
m->byte_count += messageLength;
if (m->packet == NULL) {
/* out of space, send the buffer and start refilling it */
/* make midi->packet non-null to fool midi_write_flush into sending */
- m->packet = (MIDIPacket *) 4;
+ m->packet = (MIDIPacket *) 4;
/* timestamp is 0 because midi_write_flush ignores timestamp since
* timestamps are already in packets. The timestamp parameter is here
- * because other API's need it. midi_write_flush can be called
+ * because other API's need it. midi_write_flush can be called
* from system-independent code that must be cross-API.
*/
if ((err = midi_write_flush(midi, 0)) != pmNoError) return err;
m->packet = MIDIPacketListInit(m->packetList);
assert(m->packet); /* if this fails, it's a programming error */
m->packet = MIDIPacketListAdd(m->packetList, sizeof(m->packetBuffer),
- m->packet, timestamp, messageLength,
+ m->packet, timestamp, messageLength,
message);
- assert(m->packet); /* can't run out of space on first message */
+ assert(m->packet); /* can't run out of space on first message */
}
return pmNoError;
-}
+}
static PmError
@@ -549,11 +549,11 @@ midi_write_short(PmInternal *midi, PmEvent *event)
if (m->packet == NULL) {
m->packet = MIDIPacketListInit(m->packetList);
- /* this can never fail, right? failure would indicate something
+ /* this can never fail, right? failure would indicate something
unrecoverable */
assert(m->packet);
}
-
+
/* compute timestamp */
if (when == 0) when = midi->now;
/* if latency == 0, midi->now is not valid. We will just set it to zero */
@@ -565,7 +565,7 @@ midi_write_short(PmInternal *midi, PmEvent *event)
message[1] = Pm_MessageData1(what);
message[2] = Pm_MessageData2(what);
messageLength = midi_length(what);
-
+
/* make sure we go foreward in time */
if (timestamp < m->min_next_time) timestamp = m->min_next_time;
@@ -580,14 +580,14 @@ midi_write_short(PmInternal *midi, PmEvent *event)
}
-static PmError
+static PmError
midi_begin_sysex(PmInternal *midi, PmTimestamp when)
{
UInt64 when_ns;
midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
assert(m);
m->sysex_byte_count = 0;
-
+
/* compute timestamp */
if (when == 0) when = midi->now;
/* if latency == 0, midi->now is not valid. We will just set it to zero */
@@ -597,7 +597,7 @@ midi_begin_sysex(PmInternal *midi, PmTimestamp when)
if (m->packet == NULL) {
m->packet = MIDIPacketListInit(m->packetList);
- /* this can never fail, right? failure would indicate something
+ /* this can never fail, right? failure would indicate something
unrecoverable */
assert(m->packet);
}
@@ -611,18 +611,18 @@ midi_end_sysex(PmInternal *midi, PmTimestamp when)
PmError err;
midi_macosxcm_type m = (midi_macosxcm_type) midi->descriptor;
assert(m);
-
+
/* make sure we go foreward in time */
- if (m->sysex_timestamp < m->min_next_time)
+ if (m->sysex_timestamp < m->min_next_time)
m->sysex_timestamp = m->min_next_time;
#ifdef LIMIT_RATE
- if (m->sysex_timestamp < m->last_time)
+ if (m->sysex_timestamp < m->last_time)
m->sysex_timestamp = m->last_time;
m->last_time = m->sysex_timestamp + m->sysex_byte_count *
m->host_ticks_per_byte;
#endif
-
+
/* now send what's in the buffer */
err = send_packet(midi, m->sysex_buffer, m->sysex_byte_count,
m->sysex_timestamp);
@@ -712,7 +712,7 @@ CFStringRef EndpointName(MIDIEndpointRef endpoint, bool isExternal)
{
CFMutableStringRef result = CFStringCreateMutable(NULL, 0);
CFStringRef str;
-
+
// begin with the endpoint's name
str = NULL;
MIDIObjectGetStringProperty(endpoint, kMIDIPropertyName, &str);
@@ -720,13 +720,13 @@ CFStringRef EndpointName(MIDIEndpointRef endpoint, bool isExternal)
CFStringAppend(result, str);
CFRelease(str);
}
-
+
MIDIEntityRef entity = NULL_REF;
MIDIEndpointGetEntity(endpoint, &entity);
if (entity == NULL_REF)
// probably virtual
return result;
-
+
if (CFStringGetLength(result) == 0) {
// endpoint name has zero length -- try the entity
str = NULL;
@@ -741,7 +741,7 @@ CFStringRef EndpointName(MIDIEndpointRef endpoint, bool isExternal)
MIDIEntityGetDevice(entity, &device);
if (device == NULL_REF)
return result;
-
+
str = NULL;
MIDIObjectGetStringProperty(device, kMIDIPropertyName, &str);
if (CFStringGetLength(result) == 0) {
@@ -785,7 +785,7 @@ static CFStringRef ConnectedEndpointName(MIDIEndpointRef endpoint)
CFStringRef str;
OSStatus err;
long i;
-
+
// Does the endpoint have connections?
CFDataRef connections = NULL;
long nConnected = 0;
@@ -826,7 +826,7 @@ static CFStringRef ConnectedEndpointName(MIDIEndpointRef endpoint)
}
if (anyStrings)
return result;
-
+
// Here, either the endpoint had no connections, or we failed to obtain names for any of them.
return EndpointName(endpoint, false);
}
@@ -849,7 +849,7 @@ char* cm_get_full_endpoint_name(MIDIEndpointRef endpoint)
defaultEncoding = CFStringGetSystemEncoding();
fullName = ConnectedEndpointName(endpoint);
-
+
#ifdef OLDCODE
/* get the entity and device info */
MIDIEndpointGetEntity(endpoint, &entity);
@@ -864,7 +864,7 @@ char* cm_get_full_endpoint_name(MIDIEndpointRef endpoint)
} else {
fullName = endpointName;
}
-#endif
+#endif
/* copy the string into our buffer */
if (fullName) {
newName = (char *) malloc(CFStringGetLength(fullName) + 1);
@@ -873,7 +873,7 @@ char* cm_get_full_endpoint_name(MIDIEndpointRef endpoint)
} else {
newName = NULL;
}
-
+
/* clean up */
#ifdef OLDCODE
if (endpointName) CFRelease(endpointName);
@@ -884,7 +884,7 @@ char* cm_get_full_endpoint_name(MIDIEndpointRef endpoint)
return newName;
}
-
+
pm_fns_node pm_macosx_in_dictionary = {
none_write_short,
@@ -956,7 +956,7 @@ PmError pm_macosxcm_init(void)
error_text = "MIDIInputPortCreate() in pm_macosxcm_init()";
goto error_return;
}
-
+
/* Create the output port */
macHostError = MIDIOutputPortCreate(client, CFSTR("Output port"), &portOut);
if (macHostError != noErr) {
@@ -974,7 +974,7 @@ PmError pm_macosxcm_init(void)
/* set the first input we see to the default */
if (pm_default_input_device_id == -1)
pm_default_input_device_id = pm_descriptor_index;
-
+
/* Register this device with PortMidi */
char* full_endpoint_name = cm_get_full_endpoint_name(endpoint);
if (full_endpoint_name != NULL) {
@@ -1004,10 +1004,10 @@ PmError pm_macosxcm_init(void)
}
}
return pmNoError;
-
+
error_return:
pm_hosterror = macHostError;
- sprintf(pm_hosterror_text, "Host error %ld: %s\n", (long) macHostError,
+ sprintf(pm_hosterror_text, "Host error %ld: %s\n", (long) macHostError,
error_text);
pm_macosxcm_term(); /* clear out any opened ports */
return pmHostError;
diff --git a/libs/backends/wavesaudio/portmidi/src/pm_mac/readbinaryplist.c b/libs/backends/wavesaudio/portmidi/src/pm_mac/readbinaryplist.c
index d8ed8fbabc..88830310e6 100644
--- a/libs/backends/wavesaudio/portmidi/src/pm_mac/readbinaryplist.c
+++ b/libs/backends/wavesaudio/portmidi/src/pm_mac/readbinaryplist.c
@@ -54,7 +54,7 @@ depth-first search to free nodes, you will free nodes twice. I decided
to allocate memory from blocks of 1024 bytes and keep the blocks in a
list associated with but private to this module. So the user should
access this module by calling:
- bplist_read_file() or bplist_read_user_pref() or
+ bplist_read_file() or bplist_read_user_pref() or
bplist_read_system_pref()
which returns a value. When you are done with the value, call
bplist_free_data()
@@ -89,14 +89,14 @@ memory requested or calls longjmp, so callers don't have to check.
/* there are 2 levels of error logging/printing:
* BPLIST_LOG and BPLIST_LOG_VERBOSE
* either or both can be set to non-zero to turn on
- * If BPLIST_LOG_VERBOSE is true, then BPLIST_LOG
+ * If BPLIST_LOG_VERBOSE is true, then BPLIST_LOG
* is also true.
- *
+ *
* In the code, logging is done by calling either
* bplist_log() or bplist_log_verbose(), which take
* parameters like printf but might be a no-op.
*/
-
+
/* #define BPLIST_LOG_VERBOSE 1 */
#if BPLIST_LOG_VERBOSE
@@ -439,7 +439,7 @@ value_ptr bplist_read_pldata(pldata_ptr data)
bplist_log("Bad binary plist: too short or invalid header.\n");
return NULL;
}
-
+
// read trailer
ptr = (uint8_t *) (data->data + data->len - kTRAILER_SIZE);
bplist.offset_int_size = ptr[6];
@@ -447,29 +447,29 @@ value_ptr bplist_read_pldata(pldata_ptr data)
bplist.object_count = convert_uint64(ptr + 8);
top_level_object = convert_uint64(ptr + 16);
bplist.offset_table_offset = convert_uint64(ptr + 24);
-
+
// Basic sanity checks
if (bplist.offset_int_size < 1 || bplist.offset_int_size > 8 ||
bplist.object_ref_size < 1 || bplist.object_ref_size > 8 ||
bplist.offset_table_offset < kHEADER_SIZE) {
bplist_log("Bad binary plist: trailer declared insane.\n");
- return NULL;
+ return NULL;
}
-
+
// Ensure offset table is inside file
uint64_t offsetTableSize = bplist.offset_int_size * bplist.object_count;
- if (offsetTableSize + bplist.offset_table_offset + kTRAILER_SIZE >
+ if (offsetTableSize + bplist.offset_table_offset + kTRAILER_SIZE >
data->len) {
bplist_log("Bad binary plist: offset table overlaps end of container.\n");
return NULL;
}
-
+
bplist.data_bytes = data->data;
bplist.length = data->len;
bplist.cache = NULL; /* dictionary is empty */
- bplist_log_verbose("Got a sane bplist with %llu items, offset_int_size: %u, object_ref_size: %u\n",
- bplist.object_count, bplist.offset_int_size,
+ bplist_log_verbose("Got a sane bplist with %llu items, offset_int_size: %u, object_ref_size: %u\n",
+ bplist.object_count, bplist.offset_int_size,
bplist.object_ref_size);
/* at this point, we are ready to do some parsing which allocates
memory for the result data structure. If memory allocation (using
@@ -494,17 +494,17 @@ static value_ptr extract_object(bplist_info_ptr bplist, uint64_t objectRef)
uint64_t offset;
value_ptr result = NULL;
uint8_t objectTag;
-
+
if (objectRef >= bplist->object_count) {
// Out-of-range object reference.
bplist_log("Bad binary plist: object index is out of range.\n");
return NULL;
}
-
+
// Use cached object if it exists
result = cache_lookup(bplist->cache, objectRef);
if (result != NULL) return result;
-
+
// Otherwise, find object in file.
offset = read_offset(bplist, objectRef);
if (offset > bplist->length) {
@@ -517,71 +517,71 @@ static value_ptr extract_object(bplist_info_ptr bplist, uint64_t objectRef)
case kTAG_SIMPLE:
result = extract_simple(bplist, offset);
break;
-
+
case kTAG_INT:
result = extract_int(bplist, offset);
break;
-
+
case kTAG_REAL:
result = extract_real(bplist, offset);
break;
-
+
case kTAG_DATE:
result = extract_date(bplist, offset);
break;
-
+
case kTAG_DATA:
result = extract_data(bplist, offset);
break;
-
+
case kTAG_ASCIISTRING:
result = extract_ascii_string(bplist, offset);
break;
-
+
case kTAG_UNICODESTRING:
result = extract_unicode_string(bplist, offset);
break;
-
+
case kTAG_UID:
result = extract_uid(bplist, offset);
break;
-
+
case kTAG_ARRAY:
result = extract_array(bplist, offset);
break;
-
+
case kTAG_DICTIONARY:
result = extract_dictionary(bplist, offset);
break;
-
+
default:
// Unknown tag.
- bplist_log("Bad binary plist: unknown tag 0x%X.\n",
+ bplist_log("Bad binary plist: unknown tag 0x%X.\n",
(objectTag & 0x0F) >> 4);
result = NULL;
}
-
+
// Cache and return result.
- if (result != NULL)
+ if (result != NULL)
cache_insert(&bplist->cache, objectRef, result);
return result;
}
-static uint64_t read_sized_int(bplist_info_ptr bplist, uint64_t offset,
+static uint64_t read_sized_int(bplist_info_ptr bplist, uint64_t offset,
uint8_t size)
{
- assert(bplist->data_bytes != NULL && size >= 1 && size <= 8 &&
+ assert(bplist->data_bytes != NULL && size >= 1 && size <= 8 &&
offset + size <= bplist->length);
-
+
uint64_t result = 0;
const uint8_t *byte = bplist->data_bytes + offset;
-
+
do {
// note that ints seem to be high-order first
result = (result << 8) | *byte++;
} while (--size);
-
+
return result;
}
@@ -589,35 +589,35 @@ static uint64_t read_sized_int(bplist_info_ptr bplist, uint64_t offset,
static uint64_t read_offset(bplist_info_ptr bplist, uint64_t index)
{
assert(index < bplist->object_count);
-
- return read_sized_int(bplist,
- bplist->offset_table_offset + bplist->offset_int_size * index,
+
+ return read_sized_int(bplist,
+ bplist->offset_table_offset + bplist->offset_int_size * index,
bplist->offset_int_size);
}
-static BOOL read_self_sized_int(bplist_info_ptr bplist, uint64_t offset,
+static BOOL read_self_sized_int(bplist_info_ptr bplist, uint64_t offset,
uint64_t *outValue, size_t *outSize)
{
uint32_t size;
int64_t value;
-
+
assert(bplist->data_bytes != NULL && offset < bplist->length);
-
+
size = 1 << (bplist->data_bytes[offset] & 0x0F);
if (size > 8) {
// Maximum allowable size in this implementation is 1<<3 = 8 bytes.
// This also happens to be the biggest we can handle.
return NO;
}
-
+
if (offset + 1 + size > bplist->length) {
// Out of range.
return NO;
}
-
+
value = read_sized_int(bplist, offset + 1, size);
-
+
if (outValue != NULL) *outValue = value;
if (outSize != NULL) *outSize = size + 1; // +1 for tag byte.
return YES;
@@ -628,21 +628,21 @@ static value_ptr extract_simple(bplist_info_ptr bplist, uint64_t offset)
{
assert(bplist->data_bytes != NULL && offset < bplist->length);
value_ptr value = value_create();
-
+
switch (bplist->data_bytes[offset]) {
case kVALUE_NULL:
value->tag = kVALUE_NULL;
return value;
-
+
case kVALUE_TRUE:
value->tag = kVALUE_TRUE;
return value;
-
+
case kVALUE_FALSE:
value->tag = kVALUE_FALSE;
return value;
}
-
+
// Note: kVALUE_FILLER is treated as invalid, because it, er, is.
bplist_log("Bad binary plist: invalid atom.\n");
free(value);
@@ -658,7 +658,7 @@ static value_ptr extract_int(bplist_info_ptr bplist, uint64_t offset)
if (!read_self_sized_int(bplist, offset, &value->uinteger, NULL)) {
bplist_log("Bad binary plist: invalid integer object.\n");
}
-
+
/* NOTE: originally, I sign-extended here. This was the wrong thing; it
turns out that negative ints are always stored as 64-bit, and smaller
ints are unsigned.
@@ -671,25 +671,25 @@ static value_ptr extract_real(bplist_info_ptr bplist, uint64_t offset)
{
value_ptr value = value_create();
uint32_t size;
-
+
assert(bplist->data_bytes != NULL && offset < bplist->length);
-
+
size = 1 << (bplist->data_bytes[offset] & 0x0F);
-
+
// FIXME: what to do if faced with other sizes for float/double?
- assert (sizeof (float) == sizeof (uint32_t) &&
+ assert (sizeof (float) == sizeof (uint32_t) &&
sizeof (double) == sizeof (uint64_t));
-
+
if (offset + 1 + size > bplist->length) {
- bplist_log("Bad binary plist: %s object overlaps end of container.\n",
+ bplist_log("Bad binary plist: %s object overlaps end of container.\n",
"floating-point number");
free(value);
return NULL;
}
-
+
if (size == sizeof (float)) {
// cast is ok because we know size is 4 bytes
- uint32_t i = (uint32_t) read_sized_int(bplist, offset + 1, size);
+ uint32_t i = (uint32_t) read_sized_int(bplist, offset + 1, size);
// Note that this handles byte swapping.
value_set_real(value, *(float *)&i);
return value;
@@ -711,22 +711,22 @@ static value_ptr extract_date(bplist_info_ptr bplist, uint64_t offset)
{
value_ptr value;
assert(bplist->data_bytes != NULL && offset < bplist->length);
-
+
// Data has size code like int and real, but only 3 (meaning 8 bytes) is valid.
if (bplist->data_bytes[offset] != kVALUE_FULLDATETAG) {
bplist_log("Bad binary plist: invalid size for date object.\n");
return NULL;
}
-
+
if (offset + 1 + sizeof (double) > bplist->length) {
- bplist_log("Bad binary plist: %s object overlaps end of container.\n",
+ bplist_log("Bad binary plist: %s object overlaps end of container.\n",
"date");
return NULL;
}
-
+
// FIXME: what to do if faced with other sizes for double?
assert (sizeof (double) == sizeof (uint64_t));
-
+
uint64_t date = read_sized_int(bplist, offset + 1, sizeof(double));
// Note that this handles byte swapping.
value = value_create();
@@ -735,13 +735,13 @@ static value_ptr extract_date(bplist_info_ptr bplist, uint64_t offset)
}
-uint64_t bplist_get_a_size(bplist_info_ptr bplist,
+uint64_t bplist_get_a_size(bplist_info_ptr bplist,
uint64_t *offset_ptr, char *msg)
{
uint64_t size = bplist->data_bytes[*offset_ptr] & 0x0F;
(*offset_ptr)++;
if (size == 0x0F) {
- // 0x0F means separate int size follows.
+ // 0x0F means separate int size follows.
// Smaller values are used for short data.
size_t extra; // the length of the data size we are about to read
if ((bplist->data_bytes[*offset_ptr] & 0xF0) != kTAG_INT) {
@@ -750,10 +750,10 @@ uint64_t bplist_get_a_size(bplist_info_ptr bplist,
msg);
return UINT64_MAX; // error
}
-
+
// read integer data as size, extra tells how many bytes to skip
if (!read_self_sized_int(bplist, *offset_ptr, &size, &extra)) {
- bplist_log("Bad binary plist: invalid %s object size tag.\n",
+ bplist_log("Bad binary plist: invalid %s object size tag.\n",
"data");
return UINT64_MAX; // error
}
@@ -761,7 +761,7 @@ uint64_t bplist_get_a_size(bplist_info_ptr bplist,
}
if (*offset_ptr + size > bplist->length) {
- bplist_log("Bad binary plist: %s object overlaps end of container.\n",
+ bplist_log("Bad binary plist: %s object overlaps end of container.\n",
"data");
return UINT64_MAX; // error
}
@@ -773,12 +773,12 @@ static value_ptr extract_data(bplist_info_ptr bplist, uint64_t offset)
{
uint64_t size;
value_ptr value;
-
+
assert(bplist->data_bytes != NULL && offset < bplist->length);
-
- if ((size = bplist_get_a_size(bplist, &offset, "data")) == UINT64_MAX)
+
+ if ((size = bplist_get_a_size(bplist, &offset, "data")) == UINT64_MAX)
return NULL;
-
+
value = value_create();
// cast is ok because we only allow files up to 100MB:
value_set_data(value, bplist->data_bytes + (size_t) offset, (size_t) size);
@@ -790,16 +790,16 @@ static value_ptr extract_ascii_string(bplist_info_ptr bplist, uint64_t offset)
{
uint64_t size;
value_ptr value; // return value
-
+
assert(bplist->data_bytes != NULL && offset < bplist->length);
-
+
if ((size = bplist_get_a_size(bplist, &offset, "ascii string")) ==
- UINT64_MAX)
+ UINT64_MAX)
return NULL;
value = value_create();
// cast is ok because we only allow 100MB files
- value_set_ascii_string(value, bplist->data_bytes + (size_t) offset,
+ value_set_ascii_string(value, bplist->data_bytes + (size_t) offset,
(size_t) size);
return value;
}
@@ -809,16 +809,16 @@ static value_ptr extract_unicode_string(bplist_info_ptr bplist, uint64_t offset)
{
uint64_t size;
value_ptr value;
-
+
assert(bplist->data_bytes != NULL && offset < bplist->length);
-
- if ((size = bplist_get_a_size(bplist, &offset, "unicode string")) ==
+
+ if ((size = bplist_get_a_size(bplist, &offset, "unicode string")) ==
UINT64_MAX)
return NULL;
-
+
value = value_create();
// cast is ok because we only allow 100MB files
- value_set_unicode_string(value, bplist->data_bytes + (size_t) offset,
+ value_set_unicode_string(value, bplist->data_bytes + (size_t) offset,
(size_t) size);
return value;
}
@@ -835,19 +835,19 @@ static value_ptr extract_uid(bplist_info_ptr bplist, uint64_t offset)
introspectable CF objects. In fact, it even seems to convert the CF$UID
dictionaries from XML plists on the fly.
*/
-
+
value_ptr value;
uint64_t uid;
-
+
if (!read_self_sized_int(bplist, offset, &uid, NULL)) {
bplist_log("Bad binary plist: invalid UID object.\n");
return NULL;
}
-
+
// assert(NO); // original code suggests using a string for a key
// but our dictionaries all use big ints for keys, so I don't know
// what to do here
-
+
// In practice, I believe this code is never executed by PortMidi.
// I changed it to do something and not raise compiler warnings, but
// not sure what the code should do.
@@ -855,7 +855,7 @@ static value_ptr extract_uid(bplist_info_ptr bplist, uint64_t offset)
value = value_create();
value_set_uid(value, uid);
// return [NSDictionary dictionaryWithObject:
- // [NSNumber numberWithUnsignedLongLong:value]
+ // [NSNumber numberWithUnsignedLongLong:value]
// forKey:"CF$UID"];
return value;
}
@@ -870,26 +870,26 @@ static value_ptr extract_array(bplist_info_ptr bplist, uint64_t offset)
value_ptr *array = NULL;
value_ptr value = NULL;
BOOL ok = YES;
-
+
assert(bplist->data_bytes != NULL && offset < bplist->length);
-
+
if ((count = bplist_get_a_size(bplist, &offset, "array")) == UINT64_MAX)
return NULL;
-
+
if (count > UINT64_MAX / bplist->object_ref_size - offset) {
// Offset overflow.
- bplist_log("Bad binary plist: %s object overlaps end of container.\n",
+ bplist_log("Bad binary plist: %s object overlaps end of container.\n",
"array");
return NULL;
}
-
+
size = bplist->object_ref_size * count;
if (size + offset > bplist->length) {
- bplist_log("Bad binary plist: %s object overlaps end of container.\n",
+ bplist_log("Bad binary plist: %s object overlaps end of container.\n",
"array");
return NULL;
}
-
+
// got count, the number of array elements
value = value_create();
@@ -900,12 +900,12 @@ static value_ptr extract_array(bplist_info_ptr bplist, uint64_t offset)
value_set_array(value, array, (size_t) count);
return value;
}
-
+
array = allocate(sizeof(value_ptr) * (size_t) count);
-
+
for (i = 0; i != count; ++i) {
bplist_log_verbose("[%u]\n", i);
- elementID = read_sized_int(bplist, offset + i * bplist->object_ref_size,
+ elementID = read_sized_int(bplist, offset + i * bplist->object_ref_size,
bplist->object_ref_size);
element = extract_object(bplist, elementID);
if (element != NULL) {
@@ -931,27 +931,27 @@ static value_ptr extract_dictionary(bplist_info_ptr bplist, uint64_t offset)
value_ptr value = NULL;
dict_ptr dict = NULL;
BOOL ok = YES;
-
+
assert(bplist->data_bytes != NULL && offset < bplist->length);
-
-
+
+
if ((count = bplist_get_a_size(bplist, &offset, "array")) == UINT64_MAX)
return NULL;
if (count > UINT64_MAX / (bplist->object_ref_size * 2) - offset) {
// Offset overflow.
- bplist_log("Bad binary plist: %s object overlaps end of container.\n",
+ bplist_log("Bad binary plist: %s object overlaps end of container.\n",
"dictionary");
return NULL;
}
-
+
size = bplist->object_ref_size * count * 2;
if (size + offset > bplist->length) {
- bplist_log("Bad binary plist: %s object overlaps end of container.\n",
+ bplist_log("Bad binary plist: %s object overlaps end of container.\n",
"dictionary");
return NULL;
}
-
+
value = value_create();
if (count == 0) {
value_set_dict(value, NULL);
@@ -961,7 +961,7 @@ static value_ptr extract_dictionary(bplist_info_ptr bplist, uint64_t offset)
for (i = 0; i != count; ++i) {
value_ptr key;
value_ptr val;
- elementID = read_sized_int(bplist, offset + i * bplist->object_ref_size,
+ elementID = read_sized_int(bplist, offset + i * bplist->object_ref_size,
bplist->object_ref_size);
key = extract_object(bplist, elementID);
if (key != NULL) {
@@ -970,9 +970,9 @@ static value_ptr extract_dictionary(bplist_info_ptr bplist, uint64_t offset)
ok = NO;
break;
}
-
- elementID = read_sized_int(bplist,
- offset + (i + count) * bplist->object_ref_size,
+
+ elementID = read_sized_int(bplist,
+ offset + (i + count) * bplist->object_ref_size,
bplist->object_ref_size);
val = extract_object(bplist, elementID);
if (val != NULL) {
@@ -985,7 +985,7 @@ static value_ptr extract_dictionary(bplist_info_ptr bplist, uint64_t offset)
if (ok) {
value_set_dict(value, dict);
}
-
+
return value;
}
@@ -1039,7 +1039,7 @@ value_ptr value_dict_lookup_using_path(value_ptr v, char *path)
}
return v;
}
-
+
/*************** functions for debugging ***************/
@@ -1055,9 +1055,9 @@ void plist_print(value_ptr v)
switch (v->tag & 0xF0) {
case kTAG_SIMPLE:
switch (v->tag) {
- case kVALUE_NULL:
+ case kVALUE_NULL:
printf("NULL@%p", v); break;
- case kVALUE_FALSE:
+ case kVALUE_FALSE:
printf("FALSE@%p", v); break;
case kVALUE_TRUE:
printf("TRUE@%p", v); break;
@@ -1112,4 +1112,4 @@ void plist_print(value_ptr v)
}
}
-
+
diff --git a/libs/backends/wavesaudio/portmidi/src/pm_mac/readbinaryplist.h b/libs/backends/wavesaudio/portmidi/src/pm_mac/readbinaryplist.h
index 577865996b..f1123c13d0 100644
--- a/libs/backends/wavesaudio/portmidi/src/pm_mac/readbinaryplist.h
+++ b/libs/backends/wavesaudio/portmidi/src/pm_mac/readbinaryplist.h
@@ -25,13 +25,13 @@ enum
kTAG_UID = 0x80,
kTAG_ARRAY = 0xA0,
kTAG_DICTIONARY = 0xD0,
-
+
// "simple" object values
kVALUE_NULL = 0x00,
kVALUE_FALSE = 0x08,
kVALUE_TRUE = 0x09,
kVALUE_FILLER = 0x0F,
-
+
kVALUE_FULLDATETAG = 0x33 // Dates are tagged with a whole byte.
};
diff --git a/libs/backends/wavesaudio/portmidi/src/pm_win/pmwin.c b/libs/backends/wavesaudio/portmidi/src/pm_win/pmwin.c
index 9d36f100a5..cd1f001b5f 100644
--- a/libs/backends/wavesaudio/portmidi/src/pm_win/pmwin.c
+++ b/libs/backends/wavesaudio/portmidi/src/pm_win/pmwin.c
@@ -1,7 +1,7 @@
/* pmwin.c -- PortMidi os-dependent code */
/* This file only needs to implement:
- pm_init(), which calls various routines to register the
+ pm_init(), which calls various routines to register the
available midi devices,
Pm_GetDefaultInputDeviceID(), and
Pm_GetDefaultOutputDeviceID().
@@ -75,7 +75,7 @@ static PmDeviceID pm_get_default_device_id(int is_input, char *key) {
}
}
/* Look in registry for a default device name pattern. */
- if (RegOpenKeyEx(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hkey) !=
+ if (RegOpenKeyEx(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hkey) !=
ERROR_SUCCESS) {
return id;
}
@@ -91,7 +91,7 @@ static PmDeviceID pm_get_default_device_id(int is_input, char *key) {
ERROR_SUCCESS) {
return id;
}
- if (RegQueryValueEx(hkey, key, NULL, &dwType, (LPBYTE)pattern, (LPDWORD)&pattern_max) !=
+ if (RegQueryValueEx(hkey, key, NULL, &dwType, (LPBYTE)pattern, (LPDWORD)&pattern_max) !=
ERROR_SUCCESS) {
return id;
}
@@ -118,7 +118,7 @@ static PmDeviceID pm_get_default_device_id(int is_input, char *key) {
PmDeviceID Pm_GetDefaultInputDeviceID() {
- return pm_get_default_device_id(TRUE,
+ return pm_get_default_device_id(TRUE,
"/P/M_/R/E/C/O/M/M/E/N/D/E/D_/I/N/P/U/T_/D/E/V/I/C/E");
}
@@ -129,14 +129,14 @@ PmDeviceID Pm_GetDefaultOutputDeviceID() {
}
-#include "stdio.h"
+#include "stdio.h"
void *pm_alloc(size_t s) {
- return malloc(s);
+ return malloc(s);
}
-void pm_free(void *ptr) {
- free(ptr);
+void pm_free(void *ptr) {
+ free(ptr);
}
diff --git a/libs/backends/wavesaudio/portmidi/src/pm_win/pmwinmm.c b/libs/backends/wavesaudio/portmidi/src/pm_win/pmwinmm.c
index 5872ee2ad9..511c3c652e 100644
--- a/libs/backends/wavesaudio/portmidi/src/pm_win/pmwinmm.c
+++ b/libs/backends/wavesaudio/portmidi/src/pm_win/pmwinmm.c
@@ -7,8 +7,8 @@
#endif
#ifndef _WIN32_WINNT
- /* without this define, InitializeCriticalSectionAndSpinCount is
- * undefined. This version level means "Windows 2000 and higher"
+ /* without this define, InitializeCriticalSectionAndSpinCount is
+ * undefined. This version level means "Windows 2000 and higher"
*/
#define _WIN32_WINNT 0x0500
#endif
@@ -40,14 +40,14 @@
/* callback routines */
static void CALLBACK winmm_in_callback(HMIDIIN hMidiIn,
- WORD wMsg, DWORD dwInstance,
+ WORD wMsg, DWORD dwInstance,
DWORD dwParam1, DWORD dwParam2);
static void CALLBACK winmm_streamout_callback(HMIDIOUT hmo, UINT wMsg,
- DWORD dwInstance, DWORD dwParam1,
+ DWORD dwInstance, DWORD dwParam1,
DWORD dwParam2);
#ifdef USE_SYSEX_BUFFERS
static void CALLBACK winmm_out_callback(HMIDIOUT hmo, UINT wMsg,
- DWORD dwInstance, DWORD dwParam1,
+ DWORD dwInstance, DWORD dwParam1,
DWORD dwParam2);
#endif
@@ -60,8 +60,8 @@ static void winmm_out_delete(PmInternal *midi); /* forward reference */
A note about buffers: WinMM seems to hold onto buffers longer than
one would expect, e.g. when I tried using 2 small buffers to send
long sysex messages, at some point WinMM held both buffers. This problem
-was fixed by making buffers bigger. Therefore, it seems that there should
-be enough buffer space to hold a whole sysex message.
+was fixed by making buffers bigger. Therefore, it seems that there should
+be enough buffer space to hold a whole sysex message.
The bufferSize passed into Pm_OpenInput (passed into here as buffer_len)
will be used to estimate the largest sysex message (= buffer_len * 4 bytes).
@@ -73,7 +73,7 @@ the size of max_sysex_len, but each at least 256 bytes.
For stream output, there will already be enough space in very short
buffers, so use them, but make sure there are at least 16.
-For input, use many small buffers rather than 2 large ones so that when
+For input, use many small buffers rather than 2 large ones so that when
there are short sysex messages arriving frequently (as in control surfaces)
there will be more free buffers to fill. Use max_sysex_len / 64 buffers,
but at least 16, of size 64 bytes each.
@@ -166,7 +166,7 @@ static void pm_winmm_general_inputs()
UINT i;
WORD wRtn;
midi_num_inputs = midiInGetNumDevs();
- midi_in_caps = (MIDIINCAPS *) pm_alloc(sizeof(MIDIINCAPS) *
+ midi_in_caps = (MIDIINCAPS *) pm_alloc(sizeof(MIDIINCAPS) *
midi_num_inputs);
if (midi_in_caps == NULL) {
/* if you can't open a particular system-level midi interface
@@ -197,7 +197,7 @@ static void pm_winmm_mapper_input()
capabilities) then you still should retrieve some formof
setup info. */
wRtn = midiInGetDevCaps((UINT) MIDIMAPPER,
- (LPMIDIINCAPS) & midi_in_mapper_caps,
+ (LPMIDIINCAPS) & midi_in_mapper_caps,
sizeof(MIDIINCAPS));
if (wRtn == MMSYSERR_NOERROR) {
pm_add_device("MMSystem", midi_in_mapper_caps.szPname, TRUE,
@@ -324,8 +324,8 @@ static MIDIHDR *allocate_buffer(long data_size)
#ifdef USE_SYSEX_BUFFERS
static MIDIHDR *allocate_sysex_buffer(long data_size)
{
- /* we're actually allocating more than data_size because the buffer
- * will include the MIDIEVENT header in addition to the data
+ /* we're actually allocating more than data_size because the buffer
+ * will include the MIDIEVENT header in addition to the data
*/
LPMIDIHDR hdr = (LPMIDIHDR) pm_alloc(MIDIHDR_SYSEX_SIZE(data_size));
MIDIEVENT *evt;
@@ -429,14 +429,14 @@ static LPMIDIHDR get_free_output_buffer(PmInternal *midi)
#ifdef DEBUG
printf("PortMidi warning: get_free_output_buffer() wait timed out after 1000ms\n");
#endif
- /* if we're trying to send a sysex message, maybe the
+ /* if we're trying to send a sysex message, maybe the
* message is too big and we need more message buffers.
* Expand the buffer pool by 128KB using 1024-byte buffers.
*/
/* first, expand the buffers array if necessary */
if (!m->buffers_expanded) {
LPMIDIHDR *new_buffers = (LPMIDIHDR *) pm_alloc(
- (m->num_buffers + NUM_EXPANSION_BUFFERS) *
+ (m->num_buffers + NUM_EXPANSION_BUFFERS) *
sizeof(LPMIDIHDR));
/* if no memory, we could return a no-memory error, but user
* probably will be unprepared to deal with it. Maybe the
@@ -445,7 +445,7 @@ static LPMIDIHDR get_free_output_buffer(PmInternal *midi)
*/
if (!new_buffers) continue;
/* copy buffers to new_buffers and replace buffers */
- memcpy(new_buffers, m->buffers,
+ memcpy(new_buffers, m->buffers,
m->num_buffers * sizeof(LPMIDIHDR));
pm_free(m->buffers);
m->buffers = new_buffers;
@@ -455,7 +455,7 @@ static LPMIDIHDR get_free_output_buffer(PmInternal *midi)
/* next, add one buffer and return it */
if (m->num_buffers < m->max_buffers) {
r = allocate_buffer(EXPANSION_BUFFER_LEN);
- /* again, if there's no memory, we may not really be
+ /* again, if there's no memory, we may not really be
* dead -- maybe the system is temporarily hung and
* we can just wait longer for a message buffer */
if (!r) continue;
@@ -564,7 +564,7 @@ static PmError winmm_in_open(PmInternal *midi, void *driverInfo)
m->next_buffer = 0; /* not used for input */
m->buffer_signal = 0; /* not used for input */
#ifdef USE_SYSEX_BUFFERS
- for (i = 0; i < NUM_SYSEX_BUFFERS; i++)
+ for (i = 0; i < NUM_SYSEX_BUFFERS; i++)
m->sysex_buffers[i] = NULL; /* not used for input */
m->next_sysex_buffer = 0; /* not used for input */
#endif
@@ -684,10 +684,10 @@ static void FAR PASCAL winmm_in_callback(
switch (wMsg) {
case MIM_DATA: {
- /* if this callback is reentered with data, we're in trouble.
- * It's hard to imagine that Microsoft would allow callbacks
- * to be reentrant -- isn't the model that this is like a
- * hardware interrupt? -- but I've seen reentrant behavior
+ /* if this callback is reentered with data, we're in trouble.
+ * It's hard to imagine that Microsoft would allow callbacks
+ * to be reentrant -- isn't the model that this is like a
+ * hardware interrupt? -- but I've seen reentrant behavior
* using a debugger, so it happens.
*/
long new_driver_time;
@@ -725,14 +725,14 @@ static void FAR PASCAL winmm_in_callback(
int remaining = lpMidiHdr->dwBytesRecorded;
EnterCriticalSection(&m->lock);
- /* printf("midi_in_callback -- lpMidiHdr %x, %d bytes, %2x...\n",
+ /* printf("midi_in_callback -- lpMidiHdr %x, %d bytes, %2x...\n",
lpMidiHdr, lpMidiHdr->dwBytesRecorded, *data); */
if (midi->time_proc)
dwParam2 = (*midi->time_proc)(midi->time_info);
/* can there be more than one message in one buffer? */
/* assume yes and iterate through them */
while (remaining > 0) {
- unsigned int amt = pm_read_bytes(midi, data + processed,
+ unsigned int amt = pm_read_bytes(midi, data + processed,
remaining, dwParam2);
remaining -= amt;
processed += amt;
@@ -914,7 +914,7 @@ static PmError winmm_out_open(PmInternal *midi, void *driverInfo)
if (pm_hosterror) goto close_device;
}
/* allocate buffers */
- if (allocate_buffers(m, output_buffer_len, num_buffers))
+ if (allocate_buffers(m, output_buffer_len, num_buffers))
goto free_buffers;
/* start device */
if (midi->latency != 0) {
@@ -1015,20 +1015,20 @@ static PmError winmm_write_flush(PmInternal *midi, PmTimestamp timestamp)
midiwinmm_type m = (midiwinmm_type) midi->descriptor;
assert(m);
if (m->hdr) {
- m->error = midiOutPrepareHeader(m->handle.out, m->hdr,
+ m->error = midiOutPrepareHeader(m->handle.out, m->hdr,
sizeof(MIDIHDR));
if (m->error) {
/* do not send message */
} else if (midi->latency == 0) {
/* As pointed out by Nigel Brown, 20Sep06, dwBytesRecorded
- * should be zero. This is set in get_free_sysex_buffer().
+ * should be zero. This is set in get_free_sysex_buffer().
* The msg length goes in dwBufferLength in spite of what
* Microsoft documentation says (or doesn't say). */
m->hdr->dwBufferLength = m->hdr->dwBytesRecorded;
m->hdr->dwBytesRecorded = 0;
m->error = midiOutLongMsg(m->handle.out, m->hdr, sizeof(MIDIHDR));
} else {
- m->error = midiStreamOut(m->handle.stream, m->hdr,
+ m->error = midiStreamOut(m->handle.stream, m->hdr,
sizeof(MIDIHDR));
}
midi->fill_base = NULL;
@@ -1166,7 +1166,7 @@ static PmError winmm_end_sysex(PmInternal *midi, PmTimestamp timestamp)
PmError rslt = pmNoError;
LPMIDIHDR hdr = m->hdr;
if (!hdr) return rslt; /* something bad happened earlier,
- do not report an error because it would have been
+ do not report an error because it would have been
reported (at least) once already */
/* a(n old) version of MIDI YOKE requires a zero byte after
* the sysex message, but do not increment dwBytesRecorded: */
@@ -1214,7 +1214,7 @@ static PmError winmm_write_byte(PmInternal *midi, unsigned char byte,
/* when buffer fills, Pm_WriteSysEx will revert to calling
* pmwin_write_byte, which expect to have space, so leave
* one byte free for pmwin_write_byte. Leave another byte
- * of space for zero after message to make early version of
+ * of space for zero after message to make early version of
* MIDI YOKE driver happy -- therefore dwBufferLength - 2 */
midi->fill_length = hdr->dwBufferLength - 2;
if (midi->latency != 0) {
@@ -1244,7 +1244,7 @@ static PmError winmm_write_byte(PmInternal *midi, unsigned char byte,
/* see if buffer is full, leave one byte extra for pad */
if (hdr->dwBytesRecorded >= hdr->dwBufferLength - 1) {
/* write what we've got and continue */
- rslt = winmm_end_sysex(midi, timestamp);
+ rslt = winmm_end_sysex(midi, timestamp);
}
return rslt;
}
@@ -1253,10 +1253,10 @@ static PmError winmm_write_byte(PmInternal *midi, unsigned char byte,
note: this code is here as an aid in case you want sysex buffers
to expand to hold large messages completely. If so, you
will want to change SYSEX_BYTES_PER_BUFFER above to some
- variable that remembers the buffer size. A good place to
+ variable that remembers the buffer size. A good place to
put this value would be in the hdr->dwUser field.
- rslt = resize_sysex_buffer(midi, m->sysex_byte_count,
+ rslt = resize_sysex_buffer(midi, m->sysex_byte_count,
m->sysex_byte_count * 2);
if (rslt == pmBufferMaxSize) /* if the buffer can't be resized */
@@ -1300,7 +1300,7 @@ static PmTimestamp winmm_synchronize(PmInternal *midi)
#ifdef USE_SYSEX_BUFFERS
/* winmm_out_callback -- recycle sysex buffers */
static void CALLBACK winmm_out_callback(HMIDIOUT hmo, UINT wMsg,
- DWORD dwInstance, DWORD dwParam1,
+ DWORD dwInstance, DWORD dwParam1,
DWORD dwParam2)
{
PmInternal *midi = (PmInternal *) dwInstance;
@@ -1314,11 +1314,11 @@ static void CALLBACK winmm_out_callback(HMIDIOUT hmo, UINT wMsg,
we leave them prepared
*/
/*
- printf("out_callback: hdr %x, wMsg %x, MOM_DONE %x\n",
+ printf("out_callback: hdr %x, wMsg %x, MOM_DONE %x\n",
hdr, wMsg, MOM_DONE);
*/
if (wMsg == MOM_DONE) {
- MMRESULT ret = midiOutUnprepareHeader(m->handle.out, hdr,
+ MMRESULT ret = midiOutUnprepareHeader(m->handle.out, hdr,
sizeof(MIDIHDR));
assert(ret == MMSYSERR_NOERROR);
}
@@ -1340,10 +1340,10 @@ static void CALLBACK winmm_streamout_callback(HMIDIOUT hmo, UINT wMsg,
/* Even if an error is pending, I think we should unprepare msgs and
signal their arrival
*/
- /* printf("streamout_callback: hdr %x, wMsg %x, MOM_DONE %x\n",
+ /* printf("streamout_callback: hdr %x, wMsg %x, MOM_DONE %x\n",
hdr, wMsg, MOM_DONE); */
if (wMsg == MOM_DONE) {
- MMRESULT ret = midiOutUnprepareHeader(m->handle.out, hdr,
+ MMRESULT ret = midiOutUnprepareHeader(m->handle.out, hdr,
sizeof(MIDIHDR));
assert(ret == MMSYSERR_NOERROR);
}
diff --git a/libs/backends/wavesaudio/portmidi/src/porttime/ptmacosx_mach.c b/libs/backends/wavesaudio/portmidi/src/porttime/ptmacosx_mach.c
index c23210e4dc..873a78f59d 100644
--- a/libs/backends/wavesaudio/portmidi/src/porttime/ptmacosx_mach.c
+++ b/libs/backends/wavesaudio/portmidi/src/porttime/ptmacosx_mach.c
@@ -55,8 +55,8 @@ static void *Pt_CallbackProc(void *p)
if (error != KERN_SUCCESS) {
mach_error("Couldn't set thread precedence policy", error);
}
-
-
+
+
/* to kill a process, just increment the pt_callback_proc_id */
/* printf("pt_callback_proc_id %d, id %d\n", pt_callback_proc_id, parameters->id); */
while (pt_callback_proc_id == parameters->id) {
@@ -80,7 +80,7 @@ PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
{
if (time_started_flag) return ptAlreadyStarted;
start_time = AudioGetCurrentHostTime();
-
+
if (callback) {
int res;
pt_callback_parameters *parms;
@@ -94,7 +94,7 @@ PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
res = pthread_create(&pt_thread_pid, NULL, Pt_CallbackProc, parms);
if (res != 0) return ptHostError;
}
-
+
time_started_flag = TRUE;
return ptNoError;
}
diff --git a/libs/backends/wavesaudio/portmidi/src/porttime/ptwinmm.c b/libs/backends/wavesaudio/portmidi/src/porttime/ptwinmm.c
index af4034c7cc..060920f8d0 100644
--- a/libs/backends/wavesaudio/portmidi/src/porttime/ptwinmm.c
+++ b/libs/backends/wavesaudio/portmidi/src/porttime/ptwinmm.c
@@ -15,12 +15,12 @@ static long time_resolution;
static MMRESULT timer_id;
static PtCallback *time_callback;
-void CALLBACK winmm_time_callback(UINT uID, UINT uMsg, DWORD_PTR dwUser,
+void CALLBACK winmm_time_callback(UINT uID, UINT uMsg, DWORD_PTR dwUser,
DWORD_PTR dw1, DWORD_PTR dw2)
{
(*time_callback)(Pt_Time(), (void *) dwUser);
}
-
+
PMEXPORT PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
{
@@ -31,7 +31,7 @@ PMEXPORT PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
time_started_flag = TRUE;
time_callback = callback;
if (callback) {
- timer_id = timeSetEvent(resolution, 1, winmm_time_callback,
+ timer_id = timeSetEvent(resolution, 1, winmm_time_callback,
(DWORD_PTR) userData, TIME_PERIODIC | TIME_CALLBACK_FUNCTION);
if (!timer_id) return ptHostError;
}
diff --git a/libs/backends/wavesaudio/waves_audiobackend.cc b/libs/backends/wavesaudio/waves_audiobackend.cc
index 8cd94c4e34..d7467c315e 100644
--- a/libs/backends/wavesaudio/waves_audiobackend.cc
+++ b/libs/backends/wavesaudio/waves_audiobackend.cc
@@ -99,7 +99,7 @@ void WavesAudioBackend::AudioDeviceManagerNotification (NotificationReason reaso
);
}
break;
-
+
default:
break;
};
@@ -135,7 +135,7 @@ WavesAudioBackend::WavesAudioBackend (AudioEngine& e)
WavesAudioBackend::~WavesAudioBackend ()
{
-
+
}
std::string
@@ -156,59 +156,59 @@ WavesAudioBackend::is_realtime () const
}
-bool
+bool
WavesAudioBackend::requires_driver_selection () const
-{
- return false;
+{
+ return false;
}
-std::vector<std::string>
+std::vector<std::string>
WavesAudioBackend::enumerate_drivers () const
-{
+{
// this backend does not suppose driver selection
assert (false);
- return std::vector<std::string> ();
+ return std::vector<std::string> ();
}
-int
+int
WavesAudioBackend::set_driver (const std::string& /*drivername*/)
{
//Waves audio backend does not suppose driver selection
assert (false);
- return -1;
+ return -1;
}
-std::vector<AudioBackend::DeviceStatus>
+std::vector<AudioBackend::DeviceStatus>
WavesAudioBackend::enumerate_devices () const
-{
+{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::enumerate_devices (): " << std::endl;
std::vector<DeviceStatus> devicesStatus;
- const DeviceInfoVec& deviceInfoList = _audio_device_manager.DeviceInfoList();
+ const DeviceInfoVec& deviceInfoList = _audio_device_manager.DeviceInfoList();
for (DeviceInfoVecConstIter deviceInfoIter = deviceInfoList.begin (); deviceInfoIter != deviceInfoList.end (); ++deviceInfoIter) {
// COMMENTED DBG LOGS */ std::cout << "\t Device found: " << (*deviceInfoIter)->m_DeviceName << std::endl;
devicesStatus.push_back (DeviceStatus ((*deviceInfoIter)->m_DeviceName, true));
}
-
+
return devicesStatus;
-}
+}
-std::vector<float>
+std::vector<float>
WavesAudioBackend::available_sample_rates (const std::string& device_name) const
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::available_sample_rates (): [" << device_name << "]" << std::endl;
std::vector<int> sr;
-
+
WTErr retVal = _audio_device_manager.GetDeviceSampleRates(device_name, sr);
-
+
if (eNoErr != retVal) {
std::cerr << "WavesAudioBackend::available_sample_rates (): Failed to find device [" << device_name << "]" << std::endl;
return std::vector<float> ();
@@ -217,21 +217,21 @@ WavesAudioBackend::available_sample_rates (const std::string& device_name) const
// COMMENTED DBG LOGS */ std::cout << "\tFound " << devInfo.m_AvailableSampleRates.size () << " sample rates for " << device_name << ":";
std::vector<float> sample_rates (sr.begin (), sr.end ());
-
+
// COMMENTED DBG LOGS */ for (std::vector<float>::iterator i = sample_rates.begin (); i != sample_rates.end (); ++i) std::cout << " " << *i; std::cout << std::endl;
return sample_rates;
}
-float WavesAudioBackend::default_sample_rate () const
-{
+float WavesAudioBackend::default_sample_rate () const
+{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::default_sample_rate (): " << AudioBackend::default_sample_rate () << std::endl;
- return AudioBackend::default_sample_rate ();
+ return AudioBackend::default_sample_rate ();
}
-std::vector<uint32_t>
+std::vector<uint32_t>
WavesAudioBackend::available_buffer_sizes (const std::string& device_name) const
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::available_buffer_sizes (): [" << device_name << "]" << std::endl;
@@ -254,12 +254,12 @@ WavesAudioBackend::available_buffer_sizes (const std::string& device_name) const
}
-uint32_t
+uint32_t
WavesAudioBackend::available_input_channel_count (const std::string& device_name) const
{
DeviceInfo devInfo;
WTErr err = _audio_device_manager.GetDeviceInfoByName(device_name, devInfo);
-
+
if (eNoErr != err) {
std::cerr << "WavesAudioBackend::available_input_channel_count (): Failed to find device [" << device_name << "]" << std::endl;
return 0;
@@ -272,12 +272,12 @@ WavesAudioBackend::available_input_channel_count (const std::string& device_name
}
-uint32_t
+uint32_t
WavesAudioBackend::available_output_channel_count (const std::string& device_name) const
{
DeviceInfo devInfo;
WTErr err = _audio_device_manager.GetDeviceInfoByName(device_name, devInfo);
-
+
if (eNoErr != err) {
std::cerr << "WavesAudioBackend::available_output_channel_count (): Failed to find device [" << device_name << "]" << std::endl;
return 0;
@@ -311,7 +311,7 @@ int
WavesAudioBackend::set_device_name (const std::string& device_name)
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::set_device_name (): " << device_name << std::endl;
-
+
if (_ports.size ()) {
std::cerr << "WavesAudioBackend::set_device_name (): There are unregistered ports left after [" << (_device ? _device->DeviceName () : std::string ("<NULL>")) << "]!" << std::endl;
for (size_t i = 0; i < _ports.size (); ++i) {
@@ -379,11 +379,11 @@ WavesAudioBackend::drop_device()
}
-int
+int
WavesAudioBackend::set_sample_rate (float sample_rate)
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::set_sample_rate (): " << sample_rate << std::endl;
-
+
WTErr retVal = eNoErr;
if (!_device) {
@@ -391,9 +391,9 @@ WavesAudioBackend::set_sample_rate (float sample_rate)
return -1;
}
-
+
bool device_needs_restart = _device->Streaming ();
-
+
if (device_needs_restart) {
retVal = _device->SetStreaming (false);
// COMMENTED DBG LOGS */ std::cout << "\t\t[" << _device->DeviceName() << "]->_device->SetStreaming (false);"<< std::endl;
@@ -402,9 +402,9 @@ WavesAudioBackend::set_sample_rate (float sample_rate)
return -1;
}
}
-
+
retVal = _device->SetCurrentSamplingRate ((int)sample_rate);
-
+
if (retVal != eNoErr) {
std::cerr << "WavesAudioBackend::set_sample_rate (): [" << _device->DeviceName() << "]->SetCurrentSamplingRate ((int)" << sample_rate << ") failed (" << retVal << ") !" << std::endl;
return -1;
@@ -415,7 +415,7 @@ WavesAudioBackend::set_sample_rate (float sample_rate)
// this means we are driven by device for buffer size
sample_rate = _device->CurrentSamplingRate ();
_sample_rate_change(sample_rate);
-
+
if (device_needs_restart) {
// COMMENTED DBG LOGS */ std::cout << "\t\t[" << _device->DeviceName() << "]->SetStreaming (true);"<< std::endl;
retVal = _device->SetStreaming (true);
@@ -428,7 +428,7 @@ WavesAudioBackend::set_sample_rate (float sample_rate)
}
-int
+int
WavesAudioBackend::set_buffer_size (uint32_t buffer_size)
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::set_buffer_size (" << buffer_size << "):"<< std::endl;
@@ -441,7 +441,7 @@ WavesAudioBackend::set_buffer_size (uint32_t buffer_size)
}
bool device_needs_restart = _device->Streaming ();
-
+
if (device_needs_restart) {
retVal = _device->SetStreaming (false);
// COMMENTED DBG LOGS */ std::cout << "\t\t[" << _device->DeviceName() << "]->SetStreaming (false);"<< std::endl;
@@ -450,20 +450,20 @@ WavesAudioBackend::set_buffer_size (uint32_t buffer_size)
return -1;
}
}
-
+
retVal = _device->SetCurrentBufferSize (buffer_size);
-
+
if (retVal != eNoErr) {
std::cerr << "WavesAudioBackend::set_buffer_size (): [" << _device->DeviceName() << "]->SetCurrentBufferSize (" << buffer_size << ") failed (" << retVal << ") !" << std::endl;
return -1;
}
-
+
// if call to set buffer is successful but device buffer size differs from the value we tried to set
// this means we are driven by device for buffer size
buffer_size = _device->CurrentBufferSize ();
_buffer_size_change(buffer_size);
-
+
if (device_needs_restart) {
// COMMENTED DBG LOGS */ std::cout << "\t\t[" << _device->DeviceName() << "]->SetStreaming (true);"<< std::endl;
retVal = _device->SetStreaming (true);
@@ -472,12 +472,12 @@ WavesAudioBackend::set_buffer_size (uint32_t buffer_size)
return -1;
}
}
-
+
return 0;
}
-int
+int
WavesAudioBackend::set_sample_format (SampleFormat sample_format)
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::set_sample_format (): " << sample_format << std::endl;
@@ -486,7 +486,7 @@ WavesAudioBackend::set_sample_format (SampleFormat sample_format)
return 0;
}
-int
+int
WavesAudioBackend::reset_device ()
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::_reset_device ():" << std::endl;
@@ -500,7 +500,7 @@ WavesAudioBackend::reset_device ()
}
-int
+int
WavesAudioBackend::_buffer_size_change (uint32_t new_buffer_size)
{
_buffer_size = new_buffer_size;
@@ -509,7 +509,7 @@ WavesAudioBackend::_buffer_size_change (uint32_t new_buffer_size)
}
-int
+int
WavesAudioBackend::_sample_rate_change (float new_sample_rate)
{
_sample_rate = new_sample_rate;
@@ -518,7 +518,7 @@ WavesAudioBackend::_sample_rate_change (float new_sample_rate)
}
-int
+int
WavesAudioBackend::set_interleaved (bool yn)
{
/*you can ignore them totally*/
@@ -527,7 +527,7 @@ WavesAudioBackend::set_interleaved (bool yn)
}
-int
+int
WavesAudioBackend::set_input_channels (uint32_t input_channels)
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::set_input_channels (): " << input_channels << std::endl;
@@ -537,7 +537,7 @@ WavesAudioBackend::set_input_channels (uint32_t input_channels)
}
-int
+int
WavesAudioBackend::set_output_channels (uint32_t output_channels)
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::set_output_channels (): " << output_channels << std::endl;
@@ -547,19 +547,19 @@ WavesAudioBackend::set_output_channels (uint32_t output_channels)
}
-std::string
+std::string
WavesAudioBackend::device_name () const
{
if (!_device) {
return "";
}
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::device_name (): " << _device->DeviceName () << std::endl;
-
+
return _device->DeviceName ();
}
-float
+float
WavesAudioBackend::sample_rate () const
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::sample_rate (): " << std::endl;
@@ -577,7 +577,7 @@ WavesAudioBackend::sample_rate () const
}
-uint32_t
+uint32_t
WavesAudioBackend::buffer_size () const
{
@@ -589,14 +589,14 @@ WavesAudioBackend::buffer_size () const
}
int size = _device->CurrentBufferSize ();
-
+
// COMMENTED DBG LOGS */ std::cout << "\t[" << _device->DeviceName () << "]->CurrentBufferSize () returned " << size << std::endl;
return (uint32_t)size;
}
-SampleFormat
+SampleFormat
WavesAudioBackend::sample_format () const
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::sample_format ()" << std::endl;
@@ -604,7 +604,7 @@ WavesAudioBackend::sample_format () const
}
-bool
+bool
WavesAudioBackend::interleaved () const
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::interleaved ()" << std::endl;
@@ -613,7 +613,7 @@ WavesAudioBackend::interleaved () const
}
-uint32_t
+uint32_t
WavesAudioBackend::input_channels () const
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::input_channels ()" << std::endl;
@@ -622,7 +622,7 @@ WavesAudioBackend::input_channels () const
}
-uint32_t
+uint32_t
WavesAudioBackend::output_channels () const
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::output_channels ()" << std::endl;
@@ -631,16 +631,16 @@ WavesAudioBackend::output_channels () const
}
-std::string
+std::string
WavesAudioBackend::control_app_name () const
{
- std::string app_name = "";
+ std::string app_name = "";
if (_device && !dynamic_cast<WCMRNativeAudioNoneDevice*> (_device)) {
app_name = "PortAudioMayKnowIt";
}
- return app_name;
+ return app_name;
}
@@ -652,9 +652,9 @@ WavesAudioBackend::launch_control_app ()
std::cerr << "WavesAudioBackend::launch_control_app (): No device is set!" << std::endl;
return;
}
-
+
WTErr err = _device->ShowConfigPanel (NULL);
-
+
if (eNoErr != err) {
std::cerr << "WavesAudioBackend::launch_control_app (): [" << _device->DeviceName () << "]->ShowConfigPanel () failed (" << err << ")!" << std::endl;
}
@@ -719,8 +719,8 @@ WavesAudioBackend::_start (bool for_latency_measurement)
void
-WavesAudioBackend::_audio_device_callback (const float* input_buffer,
- float* output_buffer,
+WavesAudioBackend::_audio_device_callback (const float* input_buffer,
+ float* output_buffer,
unsigned long nframes,
framepos_t sample_time,
uint64_t cycle_start_time_nanos)
@@ -741,21 +741,21 @@ WavesAudioBackend::_audio_device_callback (const float* input_buffer,
if (_call_thread_init_callback) {
_call_thread_init_callback = false;
// COMMENTED DBG LOGS */ std::cout << "\tAudioEngine::thread_init_callback() invoked for " << std::hex << pthread_self() << std::dec << " !" << std::endl;
-
+
/* There is the possibility that the thread this runs in may change from
* callback to callback, so do it every time.
*/
_main_thread = pthread_self ();
-
+
AudioEngine::thread_init_callback (this);
}
if ( !engine.thread_initialised_for_audio_processing () ) {
std::cerr << "\tWavesAudioBackend::_audio_device_callback (): It's an attempt to call process callback from the thread which didn't initialize it " << std::endl;
-
+
AudioEngine::thread_init_callback (this);
}
-
+
if (pthread_equal (_main_thread, pthread_self()) == 0) {
#ifdef PTW32_VERSION
std::cerr << "Process thread ID has changed. Expected thread: " << _main_thread.p << " current thread: " << pthread_self().p << std::dec << " !" << std::endl;
@@ -766,12 +766,12 @@ WavesAudioBackend::_audio_device_callback (const float* input_buffer,
}
engine.process_callback (nframes);
-
+
_write_audio_data_to_device (output_buffer, nframes);
_write_midi_data_to_devices (nframes);
-
+
uint64_t dsp_end_time_nanos = __get_time_nanos();
-
+
_dsp_load_accumulator -= *_dsp_load_history.begin();
_dsp_load_history.pop_front();
uint64_t dsp_load_nanos = dsp_end_time_nanos - dsp_start_time_nanos;
@@ -822,11 +822,11 @@ WavesAudioBackend::freewheel (bool start_stop)
}
_call_thread_init_callback = true;
_freewheel_thread ();
-
+
while (!engine.freewheeling()) {
sleep(0);
}
-
+
// freewheel thread was not activated successfully
if (_freewheel_thread_active == false) {
engine.freewheel_callback(false);
@@ -834,11 +834,11 @@ WavesAudioBackend::freewheel (bool start_stop)
}
else {
_freewheel_thread_active = false; // stop _freewheel_thread ()
-
+
while (engine.freewheeling()) {
sleep(0);
}
-
+
_call_thread_init_callback = true;
WTErr retval = _device->SetStreaming (true);
if (retval != eNoErr) {
@@ -853,12 +853,12 @@ WavesAudioBackend::freewheel (bool start_stop)
}
-void
+void
WavesAudioBackend::_freewheel_thread ()
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::_freewheel_thread ():" << std::endl;
if (!_freewheel_thread_active) { // Lets create it
-
+
// COMMENTED DBG LOGS */ std::cout << "\tCreating the thread _freewheel_thread () . . ." << std::endl;
pthread_attr_t attributes;
pthread_t thread_id;
@@ -869,7 +869,7 @@ WavesAudioBackend::_freewheel_thread ()
std::cerr << "WavesAudioBackend::freewheel_thread (): pthread_attr_init () failed!" << std::endl;
return;
}
-
+
if (pthread_attr_setstacksize (&attributes, __thread_stack_size ())) {
std::cerr << "WavesAudioBackend::freewheel_thread (): pthread_attr_setstacksize () failed!" << std::endl;
return;
@@ -878,10 +878,10 @@ WavesAudioBackend::_freewheel_thread ()
_freewheel_thread_active = true;
if ((pthread_create (&thread_id, &attributes, __start_process_thread, thread_data))) {
_freewheel_thread_active = false;
-
+
// release invoking thread
engine.freewheel_callback(true);
-
+
std::cerr << "WavesAudioBackend::freewheel_thread (): pthread_create () failed!" << std::endl;
return;
}
@@ -889,10 +889,10 @@ WavesAudioBackend::_freewheel_thread ()
// COMMENTED DBG LOGS */ std::cout << "\t. . . _freewheel_thread () complete." << std::endl;
return;
}
-
+
// notify angine that freewheeling is started
engine.freewheel_callback(true);
-
+
if (_call_thread_init_callback) {
_call_thread_init_callback = false;
AudioEngine::thread_init_callback (this);
@@ -901,10 +901,10 @@ WavesAudioBackend::_freewheel_thread ()
while (_freewheel_thread_active) {
engine.process_callback (_buffer_size);
}
-
+
// notify angine that freewheeling is stopped
engine.freewheel_callback(false);
-
+
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::_freewheel_thread (): FINISHED" << std::endl;
return;
}
@@ -921,7 +921,7 @@ WavesAudioBackend::dsp_load () const
}
float average_dsp_load = (float)_dsp_load_accumulator/_dsp_load_history_length;
-
+
return ( average_dsp_load / _audio_cycle_period_nanos)*100.0;
}
@@ -932,11 +932,11 @@ WavesAudioBackend::_init_dsp_load_history()
if((_sample_rate <= 0.0) || (_buffer_size <= 0.0)) {
return;
}
-
+
_audio_cycle_period_nanos = ((uint64_t)1000000000L * _buffer_size) / _sample_rate;
-
+
_dsp_load_accumulator = 0;
-
+
_dsp_load_history_length = (_sample_rate + _buffer_size - 1) / _buffer_size;
// COMMENTED DBG LOGS */ std::cout << "\t\t_dsp_load_history_length = " << _dsp_load_history_length << std::endl;
_dsp_load_history = std::list<uint64_t>(_dsp_load_history_length, 0);
@@ -951,7 +951,7 @@ WavesAudioBackend::transport_start ()
void
-WavesAudioBackend::transport_stop ()
+WavesAudioBackend::transport_stop ()
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::transport_stop (): " << std::endl;
}
@@ -961,7 +961,7 @@ TransportState
WavesAudioBackend::transport_state () const
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::transport_state (): " << std::endl;
- return TransportStopped;
+ return TransportStopped;
}
@@ -974,17 +974,17 @@ WavesAudioBackend::transport_locate (framepos_t pos)
framepos_t
WavesAudioBackend::transport_frame () const
-{
+{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::transport_frame (): " << std::endl;
- return 0;
+ return 0;
}
int
WavesAudioBackend::set_time_master (bool yn)
-{
+{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::set_time_master (): " << yn << std::endl;
- return 0;
+ return 0;
}
@@ -1022,7 +1022,7 @@ WavesAudioBackend::sample_time ()
{
// WARNING: This is approximate calculation. Implementation of accurate calculation is pending.
// http://kokkinizita.linuxaudio.org/papers/usingdll.pdf
-
+
return _sample_time_at_cycle_start + ((__get_time_nanos () - _cycle_start_time_nanos)*_sample_rate)/1000000000L;
}
@@ -1035,7 +1035,7 @@ WavesAudioBackend::__get_time_nanos ()
// the API should be a part of WCMRCoreAudioDeviceManager to give a chance of being tied to the
// audio device transport timeß.
return AudioConvertHostTimeToNanos (AudioGetCurrentHostTime ());
-
+
#elif PLATFORM_WINDOWS
LARGE_INTEGER Count;
QueryPerformanceCounter (&Count);
@@ -1055,7 +1055,7 @@ WavesAudioBackend::sample_time_at_cycle_start ()
pframes_t
WavesAudioBackend::samples_since_cycle_start ()
{
- pframes_t diff_sample_time;
+ pframes_t diff_sample_time;
diff_sample_time = sample_time () - _sample_time_at_cycle_start;
// COMMENTED DBG LOGS */ std::cout << "samples_since_cycle_start: " << diff_sample_time << std::endl;
@@ -1065,10 +1065,10 @@ WavesAudioBackend::samples_since_cycle_start ()
bool
WavesAudioBackend::get_sync_offset (pframes_t& /*offset*/) const
-{
+{
// COMMENTED DBG LOGS */ std::cout << "get_sync_offset: false" << std::endl;
- return false;
+ return false;
}
@@ -1090,7 +1090,7 @@ WavesAudioBackend::create_process_thread (boost::function<void ()> func)
std::cerr << "Cannot set thread attr init res = " << retVal << endmsg;
return -1;
}
-
+
if ((retVal = pthread_attr_setstacksize (&attributes, stacksize_aligned))) {
std::cerr << "Cannot set thread stack size (" << stacksize_aligned << ") res = " << retVal << endmsg;
return -1;
@@ -1131,7 +1131,7 @@ WavesAudioBackend::join_process_threads ()
++i) {
// COMMENTED DBG LOGS */ std::cout << "\t\t\tstopping thread " << std::hex << *i << std::dec << "...\n";
- void* status;
+ void* status;
if (pthread_join (*i, &status) != 0) {
std::cerr << "AudioEngine: cannot stop process thread !" << std::endl;
ret += -1;
@@ -1146,7 +1146,7 @@ WavesAudioBackend::join_process_threads ()
}
-bool
+bool
WavesAudioBackend::in_process_thread ()
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::in_process_thread ()" << std::endl;
@@ -1175,7 +1175,7 @@ WavesAudioBackend::__thread_stack_size ()
}
-uint32_t
+uint32_t
WavesAudioBackend::process_thread_count ()
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::process_thread_count (): returns " << _backend_threads.size () << std::endl;
@@ -1266,7 +1266,7 @@ uint64_t WavesAudioBackend::__performance_counter_frequency;
#endif
-int
+int
WavesAudioBackend::__instantiate (const std::string& arg1, const std::string& arg2)
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::__instantiate ():" << "[" << arg1 << "], [" << arg2 << "]" << std::endl;
@@ -1282,7 +1282,7 @@ WavesAudioBackend::__instantiate (const std::string& arg1, const std::string& ar
}
-int
+int
WavesAudioBackend::__deinstantiate ()
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::__deinstantiate ():" << std::endl;
diff --git a/libs/backends/wavesaudio/waves_audiobackend.h b/libs/backends/wavesaudio/waves_audiobackend.h
index 74322b1084..5ad952ad82 100644
--- a/libs/backends/wavesaudio/waves_audiobackend.h
+++ b/libs/backends/wavesaudio/waves_audiobackend.h
@@ -21,7 +21,7 @@
#define __libardour_waves_audiobackend_h__
#include <string>
-#include <vector>
+#include <vector>
#include <list>
#include <stdint.h>
@@ -76,17 +76,17 @@ class WavesMidiPort;
/* AUDIOBACKEND API */
virtual std::string name () const;
-
+
virtual bool is_realtime () const;
-
+
virtual bool requires_driver_selection () const;
-
+
virtual std::vector<std::string> enumerate_drivers () const;
-
+
virtual int set_driver (const std::string& /*drivername*/);
-
+
virtual std::vector<DeviceStatus> enumerate_devices () const;
-
+
virtual std::vector<float> available_sample_rates (const std::string& device) const;
virtual float default_sample_rate () const;
@@ -112,9 +112,9 @@ class WavesMidiPort;
virtual int set_sample_format (SampleFormat);
virtual int set_interleaved (bool yn);
-
+
virtual int set_input_channels (uint32_t);
-
+
virtual int set_output_channels (uint32_t);
virtual int set_systemic_input_latency (uint32_t);
@@ -127,21 +127,21 @@ class WavesMidiPort;
virtual int reset_device ();
virtual std::string device_name () const;
-
+
virtual float sample_rate () const;
-
+
virtual uint32_t buffer_size () const;
-
+
virtual SampleFormat sample_format () const;
-
+
virtual bool interleaved () const;
-
+
virtual uint32_t input_channels () const;
-
+
virtual uint32_t output_channels () const;
-
+
virtual uint32_t systemic_input_latency () const;
-
+
virtual uint32_t systemic_output_latency () const;
uint32_t systemic_midi_input_latency (std::string const) const { return 0; }
@@ -194,7 +194,7 @@ class WavesMidiPort;
virtual int usecs_per_cycle () const;
virtual size_t raw_buffer_size (DataType data_type);
-
+
virtual framepos_t sample_time ();
virtual framepos_t sample_time_at_cycle_start ();
@@ -222,9 +222,9 @@ class WavesMidiPort;
/* PORTENGINE API */
virtual void* private_handle () const;
-
+
virtual const std::string& my_name () const;
-
+
virtual bool available () const;
virtual uint32_t port_name_size () const;
@@ -246,7 +246,7 @@ class WavesMidiPort;
virtual int connect (const std::string& src, const std::string& dst);
virtual int disconnect (const std::string& src, const std::string& dst);
-
+
virtual int connect (PortHandle port_handle, const std::string& port_name);
virtual int disconnect (PortHandle port_handle, const std::string& port_name);
@@ -262,23 +262,23 @@ class WavesMidiPort;
virtual int get_connections (PortHandle port_handle, std::vector<std::string>&, bool process_callback_safe);
virtual int midi_event_get (pframes_t& timestamp, size_t& size, uint8_t** buf, void* port_buffer, uint32_t event_index);
-
+
virtual int midi_event_put (void* port_buffer, pframes_t timestamp, const uint8_t* buffer, size_t size);
-
+
virtual uint32_t get_midi_event_count (void* port_buffer);
-
+
virtual void midi_clear (void* port_buffer);
virtual bool can_monitor_input () const;
-
+
virtual int request_input_monitoring (PortHandle port_handle, bool);
-
+
virtual int ensure_input_monitoring (PortHandle port_handle, bool);
-
+
virtual bool monitoring_input (PortHandle port_handle);
virtual void set_latency_range (PortHandle port_handle, bool for_playback, LatencyRange);
-
+
virtual LatencyRange get_latency_range (PortHandle port_handle, bool for_playback);
virtual bool port_is_physical (PortHandle port_handle) const;
@@ -326,7 +326,7 @@ class WavesMidiPort;
WavesAudioBackend* engine;
boost::function<void ()> f;
size_t stacksize;
-
+
ThreadData (WavesAudioBackend* e, boost::function<void ()> fp, size_t stacksz)
: engine (e) , f (fp) , stacksize (stacksz) {}
};
@@ -339,11 +339,11 @@ class WavesMidiPort;
static void* __start_process_thread (void*);
static uint64_t __get_time_nanos ();
-
+
static size_t __thread_stack_size ();
- void _audio_device_callback (const float* input_audio_buffer,
- float* output_buffer,
+ void _audio_device_callback (const float* input_audio_buffer,
+ float* output_buffer,
unsigned long nframes,
framepos_t sample_time,
uint64_t cycle_start_time_nanos);
@@ -353,7 +353,7 @@ class WavesMidiPort;
// DO change sample rate and buffer size
int _buffer_size_change(uint32_t new_buffer_size);
int _sample_rate_change(float new_sample_rate);
-
+
int _register_system_audio_ports ();
int _register_system_midi_ports ();
@@ -374,7 +374,7 @@ class WavesMidiPort;
{
return std::find (_ports.begin (), _ports.end (), (WavesDataPort*)port_handle) != _ports.end ();
}
-
+
WavesDataPort* _find_port (const std::string& port_name) const;
void _freewheel_thread ();
@@ -395,7 +395,7 @@ class WavesMidiPort;
bool _freewheel_thread_active;
friend class WavesMidiDeviceManager;
-
+
std::list<uint64_t> _dsp_load_history;
size_t _dsp_load_history_length;
uint64_t _dsp_load_accumulator;
@@ -406,4 +406,4 @@ class WavesMidiPort;
} // namespace
#endif /* __libardour_waves_audiobackend_h__ */
-
+
diff --git a/libs/backends/wavesaudio/waves_audiobackend.latency.cc b/libs/backends/wavesaudio/waves_audiobackend.latency.cc
index 17f0e9609e..fd00912fae 100644
--- a/libs/backends/wavesaudio/waves_audiobackend.latency.cc
+++ b/libs/backends/wavesaudio/waves_audiobackend.latency.cc
@@ -23,7 +23,7 @@
using namespace ARDOUR;
-int
+int
WavesAudioBackend::set_systemic_input_latency (uint32_t systemic_input_latency)
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::set_systemic_input_latency (): " << systemic_input_latency << std::endl;
@@ -33,7 +33,7 @@ WavesAudioBackend::set_systemic_input_latency (uint32_t systemic_input_latency)
}
-int
+int
WavesAudioBackend::set_systemic_output_latency (uint32_t systemic_output_latency)
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::set_systemic_output_latency (): " << systemic_output_latency << std::endl;
@@ -42,7 +42,7 @@ WavesAudioBackend::set_systemic_output_latency (uint32_t systemic_output_latency
return 0;
}
-uint32_t
+uint32_t
WavesAudioBackend::systemic_input_latency () const
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::systemic_input_latency ()" << std::endl;
@@ -51,7 +51,7 @@ WavesAudioBackend::systemic_input_latency () const
}
-uint32_t
+uint32_t
WavesAudioBackend::systemic_output_latency () const
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::systemic_output_latency ()" << std::endl;
@@ -85,6 +85,6 @@ WavesAudioBackend::get_latency_range (PortHandle port_handle, bool for_playback)
std::cerr << "WavesAudioBackend::get_latency_range (): Failed to find port [" << std::hex << port_handle << std::dec << "]!" << std::endl;
LatencyRange lr = {0,0};
return lr;
- }
+ }
return ((WavesDataPort*)port_handle)->latency_range (for_playback);
}
diff --git a/libs/backends/wavesaudio/waves_audiobackend.midi.cc b/libs/backends/wavesaudio/waves_audiobackend.midi.cc
index 296f3564f9..334fefd1b6 100644
--- a/libs/backends/wavesaudio/waves_audiobackend.midi.cc
+++ b/libs/backends/wavesaudio/waves_audiobackend.midi.cc
@@ -36,7 +36,7 @@ const std::vector<std::string> WavesAudioBackend::__available_midi_options = boo
#endif
-std::vector<std::string>
+std::vector<std::string>
WavesAudioBackend::enumerate_midi_options () const
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::enumerate_midi_options ()" << std::endl;
@@ -44,7 +44,7 @@ WavesAudioBackend::enumerate_midi_options () const
}
-int
+int
WavesAudioBackend::set_midi_option (const std::string& option)
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::set_midi_option ( " << option << " )" << std::endl;
@@ -137,7 +137,7 @@ uint32_t
WavesAudioBackend::get_midi_event_count (void* port_buffer)
{
// COMMENTED FREQUENT DBG LOGS */ std::cout << "WavesAudioBackend::get_midi_event_count (): " << std::endl;
-
+
if (port_buffer == NULL) {
std::cerr << "WavesAudioBackend::get_midi_event_count () : NULL in the 'port_buffer' argument!\n";
return -1;
@@ -182,7 +182,7 @@ WavesAudioBackend::_changed_midi_devices ()
std::cerr << "WavesAudioBackend::_changed_midi_devices (): _register_system_midi_ports () failed!" << std::endl;
return;
}
-
+
manager.registration_callback ();
if (_midi_device_manager.stream (true)) {
@@ -245,9 +245,9 @@ WavesAudioBackend::_register_system_midi_ports ()
std::string port_name = "system_midi:" + (*it)->name () + " capture";
WavesDataPort* port = _find_port (port_name);
WavesMidiPort* midi_port = dynamic_cast<WavesMidiPort*> (port);
- if (midi_port && (midi_port->type () != DataType::MIDI ||
- midi_port->midi_device () != *it ||
- !midi_port->is_output () ||
+ if (midi_port && (midi_port->type () != DataType::MIDI ||
+ midi_port->midi_device () != *it ||
+ !midi_port->is_output () ||
!midi_port->is_physical () ||
!midi_port->is_terminal ())) {
std::cerr << "WavesAudioBackend::_register_system_midi_ports (): the port [" << midi_port->name () << "] is inconsystently constructed!" << std::endl;
@@ -263,16 +263,16 @@ WavesAudioBackend::_register_system_midi_ports ()
}
((WavesMidiPort*)port)->set_midi_device (*it);
}
- port->set_latency_range (lr, false);
+ port->set_latency_range (lr, false);
}
if ((*it)->is_output ()) {
std::string port_name = "system_midi:" + (*it)->name () + " playback";
WavesDataPort* port = _find_port (port_name);
WavesMidiPort* midi_port = dynamic_cast<WavesMidiPort*> (port);
- if (midi_port && (midi_port->type () != DataType::MIDI ||
- midi_port->midi_device () != *it ||
- !midi_port->is_input () ||
+ if (midi_port && (midi_port->type () != DataType::MIDI ||
+ midi_port->midi_device () != *it ||
+ !midi_port->is_input () ||
!midi_port->is_physical () ||
!midi_port->is_terminal ())) {
std::cerr << "WavesAudioBackend::_register_system_midi_ports (): the port [" << midi_port->name () << "] is inconsystently constructed!" << std::endl;
@@ -293,7 +293,7 @@ WavesAudioBackend::_register_system_midi_ports ()
port->set_latency_range (lr, true);
}
}
-
+
return 0;
}
@@ -304,18 +304,18 @@ WavesAudioBackend::_read_midi_data_from_devices ()
// COMMENTED FREQUENT DBG LOGS */ std::cout << "WavesAudioBackend::_read_midi_data_from_devices ():" << std::endl;
if (!_midi_device_manager.is_streaming ())
return 0;
-
+
_midi_device_manager.do_read ();
for (std::vector<WavesMidiPort*>::iterator it = _physical_midi_inputs.begin (); it != _physical_midi_inputs.end (); ++it) {
WavesMidiDevice* midi_device = (*it)->midi_device ();
-
+
WavesMidiBuffer& waves_midi_buffer = (*it)->buffer ();
waves_midi_buffer.clear ();
-
+
while (WavesMidiEvent *waves_midi_event = midi_device->dequeue_input_waves_midi_event ()) {
int32_t timestamp_st = _buffer_size - (_sample_time_at_cycle_start - waves_midi_event->timestamp ());
-
+
if (timestamp_st < 0) {
timestamp_st = 0;
} else if (timestamp_st >= (int32_t)_buffer_size) {
@@ -334,16 +334,16 @@ WavesAudioBackend::_write_midi_data_to_devices (pframes_t nframes)
{
if (!_midi_device_manager.is_streaming ())
return 0;
-
+
for (std::vector<WavesMidiPort*>::iterator it = _physical_midi_outputs.begin (); it != _physical_midi_outputs.end (); ++it) {
- WavesMidiDevice* midi_device = (*it)->midi_device ();
+ WavesMidiDevice* midi_device = (*it)->midi_device ();
WavesMidiBuffer &waves_midi_buffer = * (WavesMidiBuffer*) (*it)->get_buffer (nframes);
for (WavesMidiBufferIterator it = waves_midi_buffer.begin (); it != waves_midi_buffer.end ();) {
WavesMidiEvent* waves_midi_event = *it;
-
+
waves_midi_buffer.erase (it);
-
+
waves_midi_event->set_timestamp (_sample_time_at_cycle_start + waves_midi_event->timestamp () + nframes);
midi_device->enqueue_output_waves_midi_event (waves_midi_event);
}
diff --git a/libs/backends/wavesaudio/waves_audiobackend.port_engine.cc b/libs/backends/wavesaudio/waves_audiobackend.port_engine.cc
index 84340953da..203aa1f35d 100644
--- a/libs/backends/wavesaudio/waves_audiobackend.port_engine.cc
+++ b/libs/backends/wavesaudio/waves_audiobackend.port_engine.cc
@@ -34,7 +34,7 @@ int
WavesAudioBackend::set_port_name (PortHandle port_handle, const std::string& port_name)
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::set_port_name (): [" << std::hex << port_handle << std::dec << "], [" << port_name << "]" << std::endl;
-
+
if (!_registered (port_handle)) {
std::cerr << "WavesAudioBackend::set_port_name (): Failed to find port [" << std::hex << port_handle << std::dec << "]!" << std::endl;
return -1;
@@ -72,7 +72,7 @@ WavesAudioBackend::get_port_by_name (const std::string& port_name) const
}
-WavesDataPort*
+WavesDataPort*
WavesAudioBackend::_find_port (const std::string& port_name) const
{
for (std::vector<WavesDataPort*>::const_iterator it = _ports.begin (); it != _ports.end (); ++it) {
@@ -88,14 +88,14 @@ WavesAudioBackend::_find_port (const std::string& port_name) const
int
WavesAudioBackend::get_ports (const std::string& port_name_pattern, DataType type, PortFlags flags, std::vector<std::string>& port_names) const
{
-
+
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::get_ports (): \n\tPattern: [" << port_name_pattern << "]\n\tType: " << type << "\n\tFlags: " << flags << endl;
-
+
unsigned found_ports =0;
-
+
for (size_t i = 0; i < _ports.size (); ++i) {
WavesDataPort* port = _ports[i];
-
+
if ((port->type () == type) && flags == (port->flags () & flags)) {
port_names.push_back (port->name ());
found_ports++;
@@ -114,9 +114,9 @@ WavesAudioBackend::port_data_type (PortHandle port_handle) const
std::cerr << "WavesAudioBackend::port_data_type (): Failed to find port [" << std::hex << port_handle << std::dec << "]!" << std::endl;
return DataType::NIL;
}
-
+
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::port_data_type: " << endl;
-
+
return ((WavesAudioPort*)port_handle)->type ();
}
@@ -190,7 +190,7 @@ WavesAudioBackend::_register_port (const std::string& port_name, ARDOUR::DataTyp
std::cerr << "WavesAudioBackend::register_port () : Invalid data type (" << (uint32_t)type << ") applied to port [" << port_name << "]!" << std::endl;
return NULL;
}
-
+
_ports.push_back (port);
return port;
@@ -283,7 +283,7 @@ WavesAudioBackend::connect (const std::string& src_port_name, const std::string&
std::cerr << "WavesAudioBackend::connect: Failed to find source port " << src_port_name << " !" << std::endl;
return -1;
}
-
+
WavesDataPort* dst_port = _find_port (dst_port_name);
if (dst_port == NULL) {
std::cerr << "WavesAudioBackend::connect: Failed to find destination port " << dst_port_name << " !" << std::endl;
@@ -325,7 +325,7 @@ WavesAudioBackend::disconnect (PortHandle src_port_handle, const std::string& ds
std::cerr << "WavesAudioBackend::disconnect (): Failed to find source port [" << std::hex << src_port_handle << std::dec << "]!" << std::endl;
return -1;
}
-
+
// COMMENTED DBG LOGS */ std::cout << "\t[" << std::hex << src_port_handle << std::dec << "]" << std::endl;
// COMMENTED DBG LOGS */ std::cout << "\t[" << dst_port_name << "]" << std::endl;
@@ -364,7 +364,7 @@ WavesAudioBackend::disconnect (const std::string& src_port_name, const std::stri
std::cerr << "WavesAudioBackend::disconnect : Failed to find source port!\n";
return -1;
}
-
+
WavesDataPort* dst_port = _find_port (dst_port_name);
if (dst_port == NULL) {
std::cerr << "WavesAudioBackend::disconnect : Failed to find destination port!\n";
@@ -383,7 +383,7 @@ WavesAudioBackend::connected (PortHandle port_handle, bool process_callback_safe
std::cerr << "WavesAudioBackend::connected (): Failed to find port [" << std::hex << port_handle << std::dec << "]!" << std::endl;
return false;
}
-
+
return ((WavesDataPort*)port_handle)->is_connected ();
}
@@ -426,7 +426,7 @@ int
WavesAudioBackend::get_connections (PortHandle port_handle, std::vector<std::string>& names, bool process_callback_safe)
{
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::get_connections ()" << std::endl;
-
+
if (!_registered (port_handle)) {
std::cerr << "WavesAudioBackend::get_connections (): Failed to find port [" << std::hex << port_handle << std::dec << "]!" << std::endl;
return -1;
@@ -436,7 +436,7 @@ WavesAudioBackend::get_connections (PortHandle port_handle, std::vector<std::str
std::cerr << "WavesAudioBackend::get_connections () : Parameter 'names' is not empty!\n";
return -1;
}
-
+
const std::vector<WavesDataPort*>& connected_ports = ((WavesDataPort*)port_handle)->get_connections ();
for (std::vector<WavesDataPort*>::const_iterator it = connected_ports.begin (); it != connected_ports.end (); ++it) {
@@ -474,12 +474,12 @@ WavesAudioBackend::monitoring_input (PortHandle)
bool
WavesAudioBackend::port_is_physical (PortHandle port_handle) const
{
-
+
if (!_registered (port_handle)) {
std::cerr << "WavesAudioBackend::port_is_physical (): Failed to find port [" << std::hex << port_handle << std::dec << "]!" << std::endl;
return -1;
}
-
+
return (((WavesAudioPort*)port_handle)->flags () & IsPhysical) != 0;
}
@@ -488,7 +488,7 @@ void
WavesAudioBackend::get_physical_outputs (DataType type, std::vector<std::string>& names)
{
names.clear();
-
+
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::get_physical_outputs ():" << std::endl << "\tdatatype = " << type << std::endl;
switch (type) {
@@ -514,7 +514,7 @@ void
WavesAudioBackend::get_physical_inputs (DataType type, std::vector<std::string>& names)
{
names.clear();
-
+
// COMMENTED DBG LOGS */ std::cout << "WavesAudioBackend::get_physical_inputs ():" << std::endl << "\tdatatype = " << type << std::endl;
switch (type) {
case ARDOUR::DataType::AUDIO: {
@@ -571,8 +571,8 @@ WavesAudioBackend::get_buffer (PortHandle port_handle, pframes_t nframes)
if (port_handle == NULL) {
std::cerr << "WavesAudioBackend::get_buffer : Invalid port handler <NULL>!" << std::endl;
return NULL;
- }
-
+ }
+
return ((WavesAudioPort*)port_handle)->get_buffer (nframes);
}
@@ -584,10 +584,10 @@ WavesAudioBackend::_register_system_audio_ports ()
std::cerr << "WavesAudioBackend::_register_system_audio_ports (): No device is set!" << std::endl;
return -1;
}
-
+
std::vector<std::string> input_channels = _device->InputChannels ();
_max_input_channels = input_channels.size ();
-
+
uint32_t channels = (_input_channels ? _input_channels : input_channels.size ());
uint32_t port_number = 0;
@@ -595,44 +595,44 @@ WavesAudioBackend::_register_system_audio_ports ()
// Get latency for capture
lr.min = lr.max = _device->GetLatency (false) + _device->CurrentBufferSize () + _systemic_input_latency;
- for (std::vector<std::string>::iterator it = input_channels.begin ();
+ for (std::vector<std::string>::iterator it = input_channels.begin ();
(port_number < channels) && (it != input_channels.end ());
++it) {
-
+
std::ostringstream port_name(*it);
WavesDataPort* port = _register_port ("system:capture:" + port_name.str (), DataType::AUDIO ,
static_cast<PortFlags> (IsOutput | IsPhysical | IsTerminal));
-
+
if (port == NULL) {
std::cerr << "WavesAudioBackend::_create_system_audio_ports (): Failed registering port [" << port_name << "] for [" << _device->DeviceName () << "]" << std::endl;
return-1;
}
set_latency_range (port, false, lr);
}
-
+
std::vector<std::string> output_channels = _device->OutputChannels ();
_max_output_channels = output_channels.size ();
channels = (_output_channels ? _output_channels : _max_output_channels);
port_number = 0;
-
+
// Get latency for playback
lr.min = lr.max = _device->GetLatency (true) + _device->CurrentBufferSize () + _systemic_output_latency;
for (std::vector<std::string>::iterator it = output_channels.begin ();
(port_number < channels) && (it != output_channels.end ());
++it) {
-
+
std::ostringstream port_name(*it);
WavesDataPort* port = _register_port ("system:playback:" + port_name.str (), DataType::AUDIO ,
static_cast<PortFlags> (IsInput| IsPhysical | IsTerminal));
-
+
if (port == NULL) {
std::cerr << "WavesAudioBackend::_create_system_audio_ports (): Failed registering port ]" << port_name << "] for [" << _device->DeviceName () << "]" << std::endl;
return-1;
}
set_latency_range (port, true, lr);
}
-
+
return 0;
}
@@ -642,7 +642,7 @@ WavesAudioBackend::_unregister_system_audio_ports ()
{
std::vector<WavesAudioPort*> physical_audio_ports = _physical_audio_inputs;
physical_audio_ports.insert (physical_audio_ports.begin (), _physical_audio_outputs.begin (), _physical_audio_outputs.end ());
-
+
for (std::vector<WavesAudioPort*>::const_iterator it = physical_audio_ports.begin (); it != physical_audio_ports.end (); ++it) {
std::vector<WavesDataPort*>::iterator port_iterator = std::find (_ports.begin (), _ports.end (), *it);
if (port_iterator == _ports.end ()) {
diff --git a/libs/backends/wavesaudio/waves_audioport.cc b/libs/backends/wavesaudio/waves_audioport.cc
index 4918025bea..b8dac73137 100644
--- a/libs/backends/wavesaudio/waves_audioport.cc
+++ b/libs/backends/wavesaudio/waves_audioport.cc
@@ -24,7 +24,7 @@
using namespace ARDOUR;
WavesAudioPort::WavesAudioPort (const std::string& port_name, PortFlags flags)
- : WavesDataPort (port_name, flags)
+ : WavesDataPort (port_name, flags)
{
aligned_malloc ((void**)&_buffer, MAX_BUFFER_SIZE_BYTES, 32 /*32 byte alignment*/);
memset (_buffer, 0, MAX_BUFFER_SIZE_BYTES);
@@ -39,9 +39,9 @@ WavesAudioPort::~WavesAudioPort ()
void* WavesAudioPort::get_buffer (pframes_t nframes)
{
if (is_input ()) {
-
+
std::vector<WavesDataPort*>::const_iterator it = get_connections ().begin ();
-
+
if (it != get_connections ().end ()) {
/* In fact, the static casting to (const WavesAudioPort*) is not that safe.
* However, mixing the buffers is assumed in the time critical conditions.
@@ -53,7 +53,7 @@ void* WavesAudioPort::get_buffer (pframes_t nframes)
// use optimized function to fill the buffer intialy
ARDOUR::copy_vector (_buffer, ((const WavesAudioPort*)*it)->const_buffer (), nframes);
++it;
-
+
// mix the rest
for (; it != get_connections ().end (); ++it) {
Sample* tgt = buffer ();
diff --git a/libs/backends/wavesaudio/waves_audioport.h b/libs/backends/wavesaudio/waves_audioport.h
index d658dba868..aebcaf6ce5 100644
--- a/libs/backends/wavesaudio/waves_audioport.h
+++ b/libs/backends/wavesaudio/waves_audioport.h
@@ -22,7 +22,7 @@
#include "memory.h"
#include "waves_dataport.h"
-
+
namespace ARDOUR {
class WavesAudioPort : public WavesDataPort {
@@ -55,4 +55,4 @@ private:
} // namespace
#endif /* __libardour_waves_audioport_h__ */
-
+
diff --git a/libs/backends/wavesaudio/waves_dataport.cc b/libs/backends/wavesaudio/waves_dataport.cc
index b5485ac2b3..5e958279f9 100644
--- a/libs/backends/wavesaudio/waves_dataport.cc
+++ b/libs/backends/wavesaudio/waves_dataport.cc
@@ -26,9 +26,9 @@ WavesDataPort::WavesDataPort (const std::string& inport_name, PortFlags inflags)
: _name (inport_name)
, _flags (inflags)
{
- _capture_latency_range.min =
- _capture_latency_range.max =
- _playback_latency_range.min =
+ _capture_latency_range.min =
+ _capture_latency_range.max =
+ _playback_latency_range.min =
_playback_latency_range.max = 0;
}
@@ -63,7 +63,7 @@ int WavesDataPort::connect (WavesDataPort *port)
if (this == port) {
std::cerr << "WavesDataPort::connect (): attempt to connect port to itself!" << std::endl;
- return -1;
+ return -1;
}
if (is_connected (port)) {
@@ -106,7 +106,7 @@ int WavesDataPort::disconnect (WavesDataPort *port)
void WavesDataPort::_disconnect (WavesDataPort *port, bool api_call)
{
std::vector<WavesDataPort*>::iterator it = std::find (_connections.begin (), _connections.end (), port);
-
+
if (it != _connections.end ()) { // actually, it's supposed to be always true.
_connections.erase (it);
}
@@ -124,7 +124,7 @@ void WavesDataPort::_disconnect (WavesDataPort *port, bool api_call)
void WavesDataPort::disconnect_all ()
{
_disconnect_all ();
-
+
if (is_input()) {
_wipe_buffer();
}
diff --git a/libs/backends/wavesaudio/waves_dataport.h b/libs/backends/wavesaudio/waves_dataport.h
index a5b8243bbe..7db11056e9 100644
--- a/libs/backends/wavesaudio/waves_dataport.h
+++ b/libs/backends/wavesaudio/waves_dataport.h
@@ -22,7 +22,7 @@
#include "ardour/types.h"
#include "memory.h"
-
+
namespace ARDOUR {
class WavesDataPort {
@@ -34,7 +34,7 @@ public:
{
return _name;
}
-
+
int set_name (const std::string &name)
{
_name = name;
@@ -72,9 +72,9 @@ public:
}
int connect (WavesDataPort *port);
-
+
int disconnect (WavesDataPort *port);
-
+
void disconnect_all ();
bool inline is_connected (const WavesDataPort *port) const
@@ -113,4 +113,4 @@ private:
} // namespace
#endif /* __libardour_waves_dataport_h__ */
-
+
diff --git a/libs/backends/wavesaudio/waves_midi_device.cc b/libs/backends/wavesaudio/waves_midi_device.cc
index 9bb6661136..47f69da794 100644
--- a/libs/backends/wavesaudio/waves_midi_device.cc
+++ b/libs/backends/wavesaudio/waves_midi_device.cc
@@ -90,10 +90,10 @@ WavesMidiDevice::open (PmTimeProcPtr time_proc, void* time_info)
std::cerr << "WavesMidiDevice::open (): _input_queue = Pm_QueueCreate () failed for " << _pm_input_id << "-[" << name () << "]!" << std::endl;
return -1;
}
- }
+ }
// create stream
// COMMENTED DBG LOGS */ std::cout << " going to Pm_OpenInput : " << std::endl;
- if (pmNoError != Pm_OpenInput (&_input_pm_stream,
+ if (pmNoError != Pm_OpenInput (&_input_pm_stream,
_pm_input_id,
NULL,
1024,
@@ -108,9 +108,9 @@ WavesMidiDevice::open (PmTimeProcPtr time_proc, void* time_info)
return -1;
}
// COMMENTED DBG LOGS */ std::cout << " DONE : " << std::endl;
- }
- }
-
+ }
+ }
+
if (is_output () ) {
// COMMENTED DBG LOGS */ std::cout << "WavesMidiDevice::open (): OUTPUT" << _pm_output_id << "-[" << name () << "]" << std::endl;
@@ -127,8 +127,8 @@ WavesMidiDevice::open (PmTimeProcPtr time_proc, void* time_info)
}
// create stream
// COMMENTED DBG LOGS */ std::cout << " going to Pm_OpenOutput : " << std::endl;
- if (pmNoError != Pm_OpenOutput (&_output_pm_stream,
- _pm_output_id,
+ if (pmNoError != Pm_OpenOutput (&_output_pm_stream,
+ _pm_output_id,
NULL,
1024,
time_proc,
@@ -217,7 +217,7 @@ WavesMidiDevice::read_midi ()
if (NULL == _input_pm_stream) {
return;
}
-
+
while (Pm_Poll (_input_pm_stream) > 0) {
PmEvent pm_event; // just one message at a time
@@ -234,14 +234,14 @@ WavesMidiDevice::read_midi ()
DEBUG_TRACE (DEBUG::WavesMIDI, string_compose ("WavesMidiDevice::_read_midi (): [%1] new incomplete_waves_midi_event\n", name()));
_incomplete_waves_midi_event = new WavesMidiEvent (pm_event.timestamp);
}
-
+
WavesMidiEvent *nested_pm_event = _incomplete_waves_midi_event->append_data (pm_event);
if (nested_pm_event) {
Pm_Enqueue (_input_queue, &nested_pm_event);
DEBUG_TRACE (DEBUG::WavesMIDI, string_compose ("WavesMidiDevice::_read_midi (): [%1] : Pm_Enqueue (_input_queue, nested_pm_event)\n", name()));
}
-
+
switch ( _incomplete_waves_midi_event->state ()) {
case WavesMidiEvent::BROKEN:
delete _incomplete_waves_midi_event;
@@ -275,7 +275,7 @@ WavesMidiDevice::write_midi ()
PmError err;
WavesMidiEvent *waves_midi_event;
-
+
while (1 == Pm_Dequeue (_output_queue, &waves_midi_event)) {
if (waves_midi_event->sysex ()) {
// LATENCY compensation
@@ -297,28 +297,28 @@ WavesMidiDevice::write_midi ()
return;
}
-
+
int
WavesMidiDevice::enqueue_output_waves_midi_event (const WavesMidiEvent* waves_midi_event)
{
DEBUG_TRACE (DEBUG::WavesMIDI, string_compose ("WavesMidiDevice::enqueue_output_waves_midi_event () [%1]\n", name()));
-
+
if (waves_midi_event == NULL) {
error << "WavesMidiDevice::put_event_to_callback (): 'waves_midi_event' is NULL!" << endmsg;
return -1;
}
-
+
PmError err = Pm_Enqueue (_output_queue, &waves_midi_event);
-
+
if (0 > err) {
error << "WavesMidiDevice::put_event_to_callback (): Pm_Enqueue () failed (" << err << ")!" << endmsg;
return -1;
};
-
+
return 0;
}
-WavesMidiEvent*
+WavesMidiEvent*
WavesMidiDevice::dequeue_input_waves_midi_event ()
{
WavesMidiEvent* waves_midi_event;
diff --git a/libs/backends/wavesaudio/waves_midi_device.h b/libs/backends/wavesaudio/waves_midi_device.h
index ed5dbef231..430b3eab07 100644
--- a/libs/backends/wavesaudio/waves_midi_device.h
+++ b/libs/backends/wavesaudio/waves_midi_device.h
@@ -68,4 +68,4 @@ private:
} // namespace
#endif /* __libardour_waves_midi_device_h__ */
-
+
diff --git a/libs/backends/wavesaudio/waves_midi_device_manager.cc b/libs/backends/wavesaudio/waves_midi_device_manager.cc
index 344deeeea9..45044ea7a7 100644
--- a/libs/backends/wavesaudio/waves_midi_device_manager.cc
+++ b/libs/backends/wavesaudio/waves_midi_device_manager.cc
@@ -114,7 +114,7 @@ WavesMidiDeviceManager::stop ()
if ( _active == false ) {
return 0;
}
-
+
stream (false);
_delete_devices ();
@@ -128,16 +128,16 @@ WavesMidiDeviceManager::stop ()
return 0;
}
-void
+void
WavesMidiDeviceManager::__portmidi_callback (PtTimestamp timestamp, void * userData)
{
// COMMENTED FREQUENT DBG LOGS */ std::cout << "WavesMidiDeviceManager::__portmidi_callback ():" << std::endl;
WavesMidiDeviceManager *dm = (WavesMidiDeviceManager *)userData;
-
+
if (dm == NULL) {
return;
}
-
+
dm->_portmidi_callback (timestamp);
}
@@ -174,7 +174,7 @@ void WavesMidiDeviceManager::do_write ()
PmTimestamp
WavesMidiDeviceManager::__get_time_ms (void *time_info)
-{
+{
return ((WavesAudioBackend*)time_info)->sample_time ();
}
diff --git a/libs/backends/wavesaudio/waves_midi_device_manager.h b/libs/backends/wavesaudio/waves_midi_device_manager.h
index b218299a5e..fde4fc312f 100644
--- a/libs/backends/wavesaudio/waves_midi_device_manager.h
+++ b/libs/backends/wavesaudio/waves_midi_device_manager.h
@@ -31,7 +31,7 @@ public:
WavesMidiDeviceManager (WavesAudioBackend& audiobackend);
~WavesMidiDeviceManager ();
- inline const std::vector<WavesMidiDevice *>& devices () const
+ inline const std::vector<WavesMidiDevice *>& devices () const
{
return _devices;
}
@@ -51,10 +51,10 @@ private:
void _portmidi_callback (PtTimestamp timestamp);
/** __get_time_ms is given to Pm_Open functions (see WavesMidiDevice.cc)
* to provide the time in milliseconds using the time of audio
- * transport.
+ * transport.
* time_info is a pointer on the backend instance, which agregates the
* audio and miditransports. It's not checked for correctness to consume
- * no time.
+ * no time.
*/
static PmTimestamp __get_time_ms (void *time_info);
@@ -72,4 +72,4 @@ private:
} // namespace
#endif /* __libardour_waves_midi_device_manager_h__ */
-
+
diff --git a/libs/backends/wavesaudio/waves_midi_event.cc b/libs/backends/wavesaudio/waves_midi_event.cc
index f75946c6a4..70137c537b 100644
--- a/libs/backends/wavesaudio/waves_midi_event.cc
+++ b/libs/backends/wavesaudio/waves_midi_event.cc
@@ -30,7 +30,7 @@ WavesMidiEvent::WavesMidiEvent (PmTimestamp timestamp)
: _size (0)
, _timestamp (timestamp)
, _data (NULL)
- , _state (INCOMPLETE)
+ , _state (INCOMPLETE)
{
}
@@ -40,7 +40,7 @@ WavesMidiEvent::WavesMidiEvent (PmTimestamp timestamp, const uint8_t* data, size
: _size (datalen)
, _timestamp (timestamp)
, _data (data && datalen ? new uint8_t[ (datalen < sizeof (PmMessage)) ? sizeof (PmMessage) : datalen] : NULL)
- , _state (data && datalen ? COMPLETE : BROKEN)
+ , _state (data && datalen ? COMPLETE : BROKEN)
{
DEBUG_TRACE (DEBUG::WavesMIDI, string_compose ( "WavesMidiEvent::WavesMidiEvent (const WavesMidiEvent& source) : Size=%1---%2\n", _size, datalen));
if (_state == COMPLETE) {
@@ -68,7 +68,7 @@ WavesMidiEvent::WavesMidiEvent (const WavesMidiEvent& source)
: _size (source.size ())
, _timestamp (source.timestamp ())
, _data ((source.size () && source.const_data ()) ? new uint8_t[ (source.size () < sizeof (PmMessage)) ? sizeof (PmMessage) : source.size ()] : NULL)
- , _state (source.state () )
+ , _state (source.state () )
{
DEBUG_TRACE (DEBUG::WavesMIDI, string_compose ( "WavesMidiEvent::WavesMidiEvent (const WavesMidiEvent& source) : Size=%1---%2\n", _size, source.size ()));
DEBUG_TRACE (DEBUG::WavesMIDI, string_compose ( "\t\t\t Allocated Size=%1\n", ((source.size () < sizeof (PmMessage)) ? sizeof (PmMessage) : source.size ())));
@@ -101,24 +101,24 @@ WavesMidiEvent::~WavesMidiEvent ()
WavesMidiEvent *WavesMidiEvent::append_data (const PmEvent &midi_event)
{
switch ( _state ) {
- case INCOMPLETE:
+ case INCOMPLETE:
break;
default:
DEBUG_TRACE (DEBUG::WavesMIDI, "WavesMidiEvent::append_data (): NO case INCOMPLETE\n");
_state = BROKEN;
return NULL;
}
-
+
size_t message_size = _midi_message_size (midi_event.message);
uint8_t message_status = Pm_MessageStatus (midi_event.message);
-
+
if (_data == NULL) { // This is a first event to add
bool sysex = (message_status == SYSEX);
_data = new unsigned char [sysex ? PM_DEFAULT_SYSEX_BUFFER_SIZE : sizeof (PmMessage)];
if (!sysex)
{
DEBUG_TRACE (DEBUG::WavesMIDI, "WavesMidiEvent::append_data (): SHORT MSG\n");
- * (PmMessage*)_data = 0;
+ * (PmMessage*)_data = 0;
switch (message_size) {
case 1:
case 2:
@@ -127,7 +127,7 @@ WavesMidiEvent *WavesMidiEvent::append_data (const PmEvent &midi_event)
DEBUG_TRACE (DEBUG::WavesMIDI, string_compose ( "WavesMidiEvent::append_data (): size = %1\n", _size));
break;
default:
- DEBUG_TRACE (DEBUG::WavesMIDI, string_compose ( "WavesMidiEvent::append_data (): WRONG MESSAGE SIZE (%1 not %2) %3 [%4 %5 %6 %7] %8\n",
+ DEBUG_TRACE (DEBUG::WavesMIDI, string_compose ( "WavesMidiEvent::append_data (): WRONG MESSAGE SIZE (%1 not %2) %3 [%4 %5 %6 %7] %8\n",
message_size,
std::hex,
(int) ((unsigned char*)&midi_event)[0],
@@ -144,14 +144,14 @@ WavesMidiEvent *WavesMidiEvent::append_data (const PmEvent &midi_event)
return NULL;
}
}
-
+
// Now let's parse to sysex msg
if (message_status >= REAL_TIME_FIRST) { // Nested Real Time MIDI event
WavesMidiEvent *waves_midi_message = new WavesMidiEvent (midi_event.timestamp);
waves_midi_message->append_data (midi_event);
return waves_midi_message;
}
-
+
if (message_status >= STATUS_FIRST && (message_status != EOX) && _size) { // Certainly it's a broken SYSEX case
WavesMidiEvent *waves_midi_message = new WavesMidiEvent (midi_event.timestamp);
waves_midi_message->append_data (midi_event);
@@ -159,11 +159,11 @@ WavesMidiEvent *WavesMidiEvent::append_data (const PmEvent &midi_event)
}
const uint8_t* source_data ((uint8_t*)&midi_event.message);
-
+
for (size_t i = 0; i < sizeof (midi_event.message); ++i) {
_data[_size] = source_data[i];
_size++;
-
+
if (source_data[i] == EOX) { // Ended SYSEX message
_state = COMPLETE;
return NULL;
diff --git a/libs/backends/wavesaudio/waves_midi_event.h b/libs/backends/wavesaudio/waves_midi_event.h
index 95dff945a8..392cce02a4 100644
--- a/libs/backends/wavesaudio/waves_midi_event.h
+++ b/libs/backends/wavesaudio/waves_midi_event.h
@@ -39,7 +39,7 @@ public:
WavesMidiEvent (PmTimestamp timestamp, const uint8_t* data, size_t datalen);
WavesMidiEvent (const WavesMidiEvent& source);
~WavesMidiEvent ();
-
+
WavesMidiEvent *append_data (const PmEvent &midi_event);
inline State state () const { return _state; };
diff --git a/libs/backends/wavesaudio/waves_midiport.cc b/libs/backends/wavesaudio/waves_midiport.cc
index aac5be06ed..df9566ea7b 100644
--- a/libs/backends/wavesaudio/waves_midiport.cc
+++ b/libs/backends/wavesaudio/waves_midiport.cc
@@ -26,7 +26,7 @@ WavesMidiPort::WavesMidiPort (const std::string& port_name, PortFlags flags)
: WavesDataPort (port_name, flags)
, _midi_device (NULL)
, _waves_midi_buffer (port_name)
-{
+{
}
struct MidiEventSorter {
@@ -35,7 +35,7 @@ struct MidiEventSorter {
}
};
-void*
+void*
WavesMidiPort::get_buffer (pframes_t nframes)
{
if (is_input ()) {
diff --git a/libs/backends/wavesaudio/waves_midiport.h b/libs/backends/wavesaudio/waves_midiport.h
index f455856dee..4445e896a9 100644
--- a/libs/backends/wavesaudio/waves_midiport.h
+++ b/libs/backends/wavesaudio/waves_midiport.h
@@ -61,4 +61,4 @@ private:
} // namespace
#endif /* __libardour_waves_midiport_h__ */
-
+
diff --git a/libs/backends/wavesaudio/wavesapi/BasicTypes/WCFourCC.h b/libs/backends/wavesaudio/wavesapi/BasicTypes/WCFourCC.h
index d192ca5e07..cbb3e48e33 100644
--- a/libs/backends/wavesaudio/wavesapi/BasicTypes/WCFourCC.h
+++ b/libs/backends/wavesaudio/wavesapi/BasicTypes/WCFourCC.h
@@ -52,7 +52,7 @@ typedef uint32_t WTFourCharCode;
class WCFourCC
{
private:
- template<class _iter>
+ template<class _iter>
static WTFourCharCode stored_from_iter(_iter& i)
{
return s_stored_byte_order==wvNS::wvBO::byte_order_big_endian ? FOURCC_BIG(i[0], i[1], i[2], i[3]) : FOURCC_LITTLE(i[0], i[1], i[2], i[3]);
@@ -67,7 +67,7 @@ public:
// change this line will change the byte order in which WCFourCC keeps the four char code
static const wvNS::wvBO::byte_order_type s_stored_byte_order = wvNS::wvBO::compiler_byte_order;
- WCFourCC(const char a, const char b, const char c, const char d) :
+ WCFourCC(const char a, const char b, const char c, const char d) :
m_stored_value(s_stored_byte_order==wvNS::wvBO::compiler_byte_order ? FOURCC_BIG(a,b,c,d) : FOURCC_LITTLE(a,b,c,d))
{
#if kEnableWCFourCCDebug == 1
@@ -141,7 +141,7 @@ public:
{
return reinterpret_cast<char*>(&m_stored_value)[s_stored_byte_order==wvNS::wvBO::byte_order_little_endian ? 3-in_character_index : in_character_index];
}
-
+
static size_t size()
{
return sizeof(WTFourCharCode);
@@ -151,12 +151,12 @@ public:
{
return size();
}
-
+
static size_t capacity()
{
return size();
}
-
+
WCFixedString4 GetString() const
{
WCFixedString4 retVal;
diff --git a/libs/backends/wavesaudio/wavesapi/BasicTypes/WTByteOrder.h b/libs/backends/wavesaudio/wavesapi/BasicTypes/WTByteOrder.h
index beec1d2ab7..8b5c73578f 100644
--- a/libs/backends/wavesaudio/wavesapi/BasicTypes/WTByteOrder.h
+++ b/libs/backends/wavesaudio/wavesapi/BasicTypes/WTByteOrder.h
@@ -51,7 +51,7 @@
#define _BYTEORDER_BIG_ENDIAN 0
#endif // big/little switch
#else // if the compiler proparly has NOT set either __BIG_ENDIAN__ or __LITTLE_ENDIAN__
-// http://msdn.microsoft.com/en-us/library/b0084kay.aspx for all preprocessor defs. _M_X64: 64 bit. _M_IA64: Itanium 64bit
+// http://msdn.microsoft.com/en-us/library/b0084kay.aspx for all preprocessor defs. _M_X64: 64 bit. _M_IA64: Itanium 64bit
#if defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(__INTEL__) || defined(__x86_64__) || defined(_M_X64) || defined(_M_IA64)
#define _BYTEORDER_BIG_ENDIAN 0
#elif defined(_M_PPC) || defined(__POWERPC__ ) || defined(__ppc__)
@@ -86,7 +86,7 @@ namespace wvBO // namespace Waves::ByteOrder
// We try to use this static const rather than preprocessor symbols in our code wherever possible.
#if _BYTEORDER_BIG_ENDIAN == 1
static const byte_order_type compiler_byte_order = byte_order_big_endian;
-#else
+#else
static const byte_order_type compiler_byte_order = byte_order_little_endian;
#endif
@@ -113,8 +113,8 @@ namespace wvBO // namespace Waves::ByteOrder
return x;
}
inline uint64_t swap64(uint64_t x) // TODO: To be replaced
- {
- return
+ {
+ return
((x>>7*8)&0xFF)<<0*8 | ((x>>6*8)&0xFF)<<1*8 | ((x>>5*8)&0xFF)<<2*8 | ((x>>4*8)&0xFF)<<3*8 |
((x>>3*8)&0xFF)<<4*8 | ((x>>2*8)&0xFF)<<5*8 | ((x>>1*8)&0xFF)<<6*8 | ((x>>0*8)&0xFF)<<7*8 ;
}
@@ -144,12 +144,12 @@ namespace wvBO // namespace Waves::ByteOrder
// TODO
#endif // _BYTEORDER_ASM_GNUC_PPC
-#if _BYTEORDER_ASM_NONE
+#if _BYTEORDER_ASM_NONE
inline uint16_t swap16(uint16_t x) { return (x>>8) | ((x&0xFF)<<8); }
inline uint32_t swap32(uint32_t x) { return (x&0xFF)<<24 | (x&0xFF00)<<8 | (x&0xFF0000)>>8 | (x&0xFF000000)>>24; }
inline uint64_t swap64(uint64_t x)
- {
- return
+ {
+ return
((x>>7*8)&0xFF)<<0*8 | ((x>>6*8)&0xFF)<<1*8 | ((x>>5*8)&0xFF)<<2*8 | ((x>>4*8)&0xFF)<<3*8 |
((x>>3*8)&0xFF)<<4*8 | ((x>>2*8)&0xFF)<<5*8 | ((x>>1*8)&0xFF)<<6*8 | ((x>>0*8)&0xFF)<<7*8 ;
}
@@ -161,7 +161,7 @@ namespace wvBO // namespace Waves::ByteOrder
//---------------------------------------------------------------------------------
// order conversion functions
- // may want to overload for float and double as well.
+ // may want to overload for float and double as well.
// overload for signed ints is ambiguous and should be done only if no other choice exists.
// - - - - - - - - - - - - - - - - - - - -
inline uint16_t compiler_to_big_16(uint16_t x)
diff --git a/libs/backends/wavesaudio/wavesapi/BasicTypes/WUComPtr.h b/libs/backends/wavesaudio/wavesapi/BasicTypes/WUComPtr.h
index 90d42964f9..b66f720a34 100644
--- a/libs/backends/wavesaudio/wavesapi/BasicTypes/WUComPtr.h
+++ b/libs/backends/wavesaudio/wavesapi/BasicTypes/WUComPtr.h
@@ -26,7 +26,7 @@
#include "WavesPublicAPI/wstdint.h"
-typedef int32_t wvComPtr[2];
+typedef int32_t wvComPtr[2];
// ConvertDPtr has the exact format of a vfp callback function, but it is a local function, native only.
// It converts a pointer in either 32 bits or 64 bits to a place-holder of 64 bits in coefs/states/external memory.
@@ -102,7 +102,7 @@ inline uint32_t ComPtr_to_DSP( const intptr_t PtrToConvert, char* pDataStruct )
//////////////////////////////////////////////////////////////////////////
inline uint32_t DSP_to_ComPtr( const char* pDataStruct, intptr_t *ThePtr)
// pDataStruct is pointing to wvComPtr in the Coefs/States
-// the function reconstruct the pointer into ThePtr
+// the function reconstruct the pointer into ThePtr
{
*ThePtr = UnpackComPtr(*(reinterpret_cast<const wvComPtr *>(pDataStruct)));
diff --git a/libs/backends/wavesaudio/wavesapi/BasicTypes/WUDefines.h b/libs/backends/wavesaudio/wavesapi/BasicTypes/WUDefines.h
index 1279b33905..293f3bd247 100644
--- a/libs/backends/wavesaudio/wavesapi/BasicTypes/WUDefines.h
+++ b/libs/backends/wavesaudio/wavesapi/BasicTypes/WUDefines.h
@@ -28,7 +28,7 @@
// When changing wvNS value also do the same change in Objective_C_MangledNames.h
// because CWSAUCocoaViewFactoryAsString is hard coded there
-#define wvNS wvWavesV9_3
+#define wvNS wvWavesV9_3
#ifdef __APPLE__
#define ObjCNameSpace(__className__) wvWavesV9_3_ ## __className__
#endif
@@ -36,7 +36,7 @@
#ifdef INSIDE_NETSHELL
#define DllExport
#else
- #define DllExport WPAPI_DllExport
+ #define DllExport WPAPI_DllExport
#endif
#define __CDECL __WPAPI_CDECL
@@ -62,32 +62,32 @@
#define WIN_ONLY(__Something_only_for_windows__)
#define MAC_ONLY(__Something_only_for_mac__) __Something_only_for_mac__
-
+
#if defined(i386) || defined(__i386) || defined(__i386__)
#define kNumArchBits 32
#endif
#if defined(__x86_64) || defined(__x86_64__)
#define kNumArchBits 64
- #endif
+ #endif
#if (__i386 || __x86_64) && !defined(__LITTLE_ENDIAN__)
- #define __LITTLE_ENDIAN__
+ #define __LITTLE_ENDIAN__
#endif
#if !(__i386 || __x86_64) && !defined(__BIG_ENDIAN__)
#define __BIG_ENDIAN__
#endif
#ifdef __GNUC__
#define STD_EXCEPT_WIN std
- #define FAR
- #define PASCAL
+ #define FAR
+ #define PASCAL
// #define HINSTANCE void*
#define WINAPI
-
+
#else
-
+
#define DllExport_WinOnly
#define STD_EXCEPT_WIN std
- #define FAR
+ #define FAR
#define PASCAL // windows' pascal
#define HINSTANCE void*
#define WINAPI
@@ -125,7 +125,7 @@
#define WUNUSED_PARAM_ON_MAC(__SOME_UNUSED_PARAM__)
#define WUNUSED_PARAM_ON_WIN(__SOME_UNUSED_PARAM__) WUNUSED_PARAM(__SOME_UNUSED_PARAM__)
-#endif
+#endif
#ifdef __linux__
const char* const OS_NAME = "Linux";
@@ -135,18 +135,18 @@
#define DllExport_WinOnly
#define STD_EXCEPT_WIN std
- #define FAR
- #define PASCAL
+ #define FAR
+ #define PASCAL
// #define HINSTANCE void*
#define WINAPI
#if __i386 && !defined(__LITTLE_ENDIAN__)
- #define __LITTLE_ENDIAN__
+ #define __LITTLE_ENDIAN__
#endif
#if !__i386 && !defined(__BIG_ENDIAN__)
#define __BIG_ENDIAN__
#endif
#define THROW_SPEC(THROW_OBJ) throw (THROW_OBJ)
-
+
#if defined(__x86_64) || defined(__LP64__)
#error "64 bit not suported yet on linux"
#else
@@ -155,11 +155,11 @@
#endif
#ifndef _WU_DECL
- #define _WU_DECL __CDECL // the default is calling model is cdecl, but you can also set this macro from the outside to something different
+ #define _WU_DECL __CDECL // the default is calling model is cdecl, but you can also set this macro from the outside to something different
#endif
#ifndef _XML_DECL
- #define _XML_DECL __CDECL // the default is calling model is cdecl, but you can also set this macro from the outside to something different
+ #define _XML_DECL __CDECL // the default is calling model is cdecl, but you can also set this macro from the outside to something different
#endif
#ifndef kNumArchBits
diff --git a/libs/backends/wavesaudio/wavesapi/BasicTypes/WUTypes.h b/libs/backends/wavesaudio/wavesapi/BasicTypes/WUTypes.h
index 0351a86be0..e1d073db7f 100644
--- a/libs/backends/wavesaudio/wavesapi/BasicTypes/WUTypes.h
+++ b/libs/backends/wavesaudio/wavesapi/BasicTypes/WUTypes.h
@@ -36,16 +36,16 @@
Atoms
*********************************************************************************/
-#define WTSInt64 "WTSInt64 is obsolete, please use int64_t instead";
-#define WTUInt64 "WTUInt64 is obsolete, please use uint64_t instead";
-#define WTSInt32 "WTSInt32 is obsolete, please use int32_t instead";
-#define WTUInt32 "WTUInt32 is obsolete, please use uint32_t instead";
-#define WTSInt16 "WTSInt16 is obsolete, please use int16_t instead";
-#define WTUInt16 "WTUInt16 is obsolete, please use uint16_t instead";
-#define WTSInt8 "WTSInt8 is obsolete, please use int8_t instead";
-#define WTUInt8 "WTUInt8 is obsolete, please use uint8_t instead";
-#define WTFloat32 "WTFloat32 is obsolete, please use float instead";
-#define WTByte "WTByte is obsolete, please use uint8_t instead";
+#define WTSInt64 "WTSInt64 is obsolete, please use int64_t instead";
+#define WTUInt64 "WTUInt64 is obsolete, please use uint64_t instead";
+#define WTSInt32 "WTSInt32 is obsolete, please use int32_t instead";
+#define WTUInt32 "WTUInt32 is obsolete, please use uint32_t instead";
+#define WTSInt16 "WTSInt16 is obsolete, please use int16_t instead";
+#define WTUInt16 "WTUInt16 is obsolete, please use uint16_t instead";
+#define WTSInt8 "WTSInt8 is obsolete, please use int8_t instead";
+#define WTUInt8 "WTUInt8 is obsolete, please use uint8_t instead";
+#define WTFloat32 "WTFloat32 is obsolete, please use float instead";
+#define WTByte "WTByte is obsolete, please use uint8_t instead";
/********************************************************************************
Consts
@@ -122,7 +122,7 @@ enum WESystemFolders{
eCurrentFolder,
eRootFolder,
eLibrariesFolder,
- eAudioComponentsFolder, // MacOS only
+ eAudioComponentsFolder, // MacOS only
eCacheFolder,
eWavesCacheFolder,
eAppDataFolder,
@@ -184,7 +184,7 @@ enum WEManagerInitOptions
//********************************************************************************
// Files
-const uint32_t kMaxPathLength = 1023; // maximum length of a path
+const uint32_t kMaxPathLength = 1023; // maximum length of a path
const uint32_t kMaxFileNameLength = 255; // maximum length of a file name including extension
typedef WCFixedString<kMaxPathLength> WTPathString;
typedef WCFixedString<kMaxFileNameLength> WTFileNameString;
@@ -242,7 +242,7 @@ const WCOGLTextureRef kIllegalOGLTextureRef = 0;
const WCPluginViewRef kIllegalPluginViewRef = 0;
const WCMenuRef kIllegalWCMenuRef = 0;
-const intptr_t kIllegalTexturesMaster = -1;
+const intptr_t kIllegalTexturesMaster = -1;
typedef unsigned int WTTextureRef;
diff --git a/libs/backends/wavesaudio/wavesapi/MiscUtils/MinMaxUtilities.h b/libs/backends/wavesaudio/wavesapi/MiscUtils/MinMaxUtilities.h
index d4dc304ed6..d8e31d4f1f 100644
--- a/libs/backends/wavesaudio/wavesapi/MiscUtils/MinMaxUtilities.h
+++ b/libs/backends/wavesaudio/wavesapi/MiscUtils/MinMaxUtilities.h
@@ -58,7 +58,7 @@ template<class T> inline T WUMinMax(const T &Smallest, const T &Biggest, const T
#include <math.h>
#ifndef __GNUC__
-#define __abs(x) abs(x)
+#define __abs(x) abs(x)
#define __labs(x) labs(x)
#define __fabs(x) fabs(x)
#endif
@@ -87,8 +87,8 @@ template<class T> inline T WUMinMax(const T &Smallest, const T &Biggest, const T
// log2: on Windows there's no proper definition for log2, whereas on other platform there is.
#ifndef WUlog2
#if defined(PLATFORM_WINDOWS)
- #define WUlog2(x) (kdOneOverLog2 * log10((x)))
- #else
+ #define WUlog2(x) (kdOneOverLog2 * log10((x)))
+ #else
#define WUlog2(x) log2(x)
#endif
#endif
diff --git a/libs/backends/wavesaudio/wavesapi/MiscUtils/UMicroseconds.h b/libs/backends/wavesaudio/wavesapi/MiscUtils/UMicroseconds.h
index baf1a1170a..508ff12acb 100644
--- a/libs/backends/wavesaudio/wavesapi/MiscUtils/UMicroseconds.h
+++ b/libs/backends/wavesaudio/wavesapi/MiscUtils/UMicroseconds.h
@@ -29,7 +29,7 @@
#include "BasicTypes/WUDefines.h"
#include "BasicTypes/WUTypes.h"
-namespace wvNS {
+namespace wvNS {
// a wraper for Microseconds function from Timer.h
class DllExport UMicroseconds
{
@@ -62,7 +62,7 @@ public:
UMicroseconds& operator+=(const TimeKeeper in_timeToAdd) {theTime += in_timeToAdd; return *this;}
UMicroseconds& ReadTime();
-
+
TimeKeeper GetNativeTime() const {return theTime;}
operator uint64_t () {return static_cast<uint64_t>(theTime);}
operator double () const {return static_cast<const double>(theTime);}
@@ -120,5 +120,5 @@ inline void MicrosecondDelay(double amt)
} while ((now.MicroSeconds() - than.MicroSeconds()) < amt);
}
-} // namespace wvNS {
+} // namespace wvNS {
#endif //#ifndef __UMicroseconds_h__
diff --git a/libs/backends/wavesaudio/wavesapi/MiscUtils/WCFixedString.h b/libs/backends/wavesaudio/wavesapi/MiscUtils/WCFixedString.h
index 5b5a270c2b..5d2cc88beb 100644
--- a/libs/backends/wavesaudio/wavesapi/MiscUtils/WCFixedString.h
+++ b/libs/backends/wavesaudio/wavesapi/MiscUtils/WCFixedString.h
@@ -98,7 +98,7 @@ public:
if (in_index < m_MaxFixedStringLength)
return m_begin[in_index];
else
- return m_begin[m_MaxFixedStringLength]; // in_index was too big
+ return m_begin[m_MaxFixedStringLength]; // in_index was too big
}
char& operator[](const pos_t in_index)
@@ -106,7 +106,7 @@ public:
if (in_index < m_MaxFixedStringLength)
return m_begin[in_index];
else
- return m_begin[m_MaxFixedStringLength]; // in_index was too big
+ return m_begin[m_MaxFixedStringLength]; // in_index was too big
}
inline size_t resize(const size_t in_newSize)
@@ -236,7 +236,7 @@ public:
*m_end++ = *curr_char++;
#if kEnableDebug == 1
- if (curr_char < in_chars_end) // if there wasn't enough room for some appended chars
+ if (curr_char < in_chars_end) // if there wasn't enough room for some appended chars
{
m_begin[0] = '@'; // mark the string as overflowed
}
@@ -244,20 +244,20 @@ public:
*m_end = '\0';
}
- // append from a char* in_count chars, (no \0 is required to terminate the input string)
+ // append from a char* in_count chars, (no \0 is required to terminate the input string)
inline void append(const char* in_chars_begin, const size_t in_count)
{
append(in_chars_begin, in_chars_begin + in_count);
}
- // assign from a char* in_count chars, (no \0 is required to terminate the input string)
+ // assign from a char* in_count chars, (no \0 is required to terminate the input string)
inline void assign(const char* in_chars_begin, const size_t in_count)
{
clear();
append(in_chars_begin, in_chars_begin + in_count);
}
- // assign from a char* , (a \0 is required to terminate the input string)
+ // assign from a char* , (a \0 is required to terminate the input string)
inline void assign(const char* in_chars_ptr)
{
clear();
@@ -349,7 +349,7 @@ public:
*m_end++ = *pSource++;
#if kEnableDebug == 1
- if (*pSource != '\0') // if there wasn't enough room for some appended chars
+ if (*pSource != '\0') // if there wasn't enough room for some appended chars
{
m_begin[0] = '@'; // mark the string as overflowed
}
@@ -379,7 +379,7 @@ public:
WCFixedStringBase& operator<<(const size_t in_uint) {
return operator<<(static_cast<unsigned long long>(in_uint));
}
-#endif
+#endif
// WCFixedStringBase& operator<<(const unsigned char in_uint) {
// return operator<<(static_cast<const unsigned long long>(in_uint));
// }
@@ -392,13 +392,13 @@ public:
WCFixedStringBase& operator<<(const unsigned int in_uint) {
return operator<<(static_cast<uint64_t>(in_uint));
}
-#endif
+#endif
//
#if defined(PLATFORM_WINDOWS) || defined(__linux__) // both 32 & 64 bit
WCFixedStringBase& operator<<(const unsigned long in_uint) {
return operator<<(static_cast<uint64_t>(in_uint));
}
-#endif
+#endif
WCFixedStringBase& operator<<(const long long in_int)
{
@@ -514,7 +514,7 @@ public:
pos_t retVal = npos;
const char* pCurrChar = m_end;
- while (pCurrChar != m_begin)
+ while (pCurrChar != m_begin)
{
--pCurrChar;
if (*pCurrChar == in_char_to_find)
@@ -523,15 +523,15 @@ public:
break;
}
}
-
+
return retVal;
}
-
+
pos_t find(const char* in_chars_to_find, const pos_t in_start_from = 0) const
{
pos_t retVal = npos;
size_t to_find_size = ::strlen(in_chars_to_find);
-
+
if (to_find_size > 0 && to_find_size <= size() && in_start_from < size())
{
const char* pCurrChar = m_begin + in_start_from;
@@ -543,19 +543,19 @@ public:
retVal = (pCurrChar - m_begin);
break;
}
-
+
++pCurrChar;
}
}
-
+
return retVal;
}
-
+
pos_t rfind(const char* in_chars_to_find) const
{
pos_t retVal = npos;
size_t to_find_size = ::strlen(in_chars_to_find);
-
+
if (to_find_size > 0 && to_find_size <= size())
{
const char* pCurrChar = m_end - to_find_size;
@@ -567,19 +567,19 @@ public:
retVal = (pCurrChar - m_begin);
break;
}
-
+
--pCurrChar;
}
}
-
+
return retVal;
}
-
+
pos_t find_case_insensitive(const char* in_chars_to_find, const pos_t in_start_from = 0) const
{
pos_t retVal = npos;
size_t to_find_size = ::strlen(in_chars_to_find);
-
+
if (to_find_size > 0 && to_find_size <= size() && in_start_from < size())
{
const char* pCurrChar = m_begin + in_start_from;
@@ -591,20 +591,20 @@ public:
if (tolower(*(pCurrChar+i)) != tolower(in_chars_to_find[i]))
break;
}
-
+
if (i == to_find_size)
{
retVal = (pCurrChar - m_begin);
break;
}
-
+
++pCurrChar;
}
}
-
+
return retVal;
}
-
+
pos_t find_first_of(const char* in_possibe_chars_to_find, const pos_t in_start_from = 0) const
{
pos_t retVal = npos;
@@ -698,7 +698,7 @@ public:
bool retVal = ((size() - strlen(in_end_text)) == where) || (0 == ::strlen(in_end_text));
return retVal;
}
-
+
size_t replace(const char in_look_for, const char in_replace_with)
{
size_t retVal = 0;
@@ -770,11 +770,11 @@ public:
const char* end_buffer = out_buffer + (WUMin<size_t>(in_buffer_size - 1, m_end - m_begin));
while (cur_buffer < end_buffer)
*cur_buffer++ = *cur_fixed++;
-
+
*cur_buffer = '\0';
}
}
-
+
protected:
~WCFixedStringBase() {}
@@ -799,7 +799,7 @@ template<size_t kMaxFixedStringLength> class DllExport WCFixedString : public WC
{
public:
- inline WCFixedString() :
+ inline WCFixedString() :
WCFixedStringBase(m_fixedString, kMaxFixedStringLength)
{
}
@@ -889,7 +889,7 @@ typedef WCFixedString<511> WCFixedString511;
typedef WCFixedString<1023> WCFixedString1023;
typedef WCFixedString<2047> WCFixedString2047;
-template<size_t kSizeOfFirst, size_t kSizeOfSecond>
+template<size_t kSizeOfFirst, size_t kSizeOfSecond>
class WCFixedStringPair : public std::pair< WCFixedString<kSizeOfFirst>, WCFixedString<kSizeOfSecond> >
{
public:
diff --git a/libs/backends/wavesaudio/wavesapi/MiscUtils/WUErrors.h b/libs/backends/wavesaudio/wavesapi/MiscUtils/WUErrors.h
index c1f95ff54a..294ef0905f 100644
--- a/libs/backends/wavesaudio/wavesapi/MiscUtils/WUErrors.h
+++ b/libs/backends/wavesaudio/wavesapi/MiscUtils/WUErrors.h
@@ -44,11 +44,11 @@ const WTErr eNotJustANumber = -13; //!< expected a number and found one but
const WTErr eNegativeNumber = -14; //!< expected a positive number and found a negative
const WTErr eTimeOut = -15; //!< something timed out
const WTErr eCoreAudioFailed = -16; //!< Error in a core audio call
-const WTErr eSomeThingInitailzedTwice = -17;
-const WTErr eGenerateHelpInfo = -18;
-const WTErr eOutOfRangeNumber = -19;
-const WTErr eMacOnlyCode = -20;
-const WTErr eWinOnlyCode = -21;
+const WTErr eSomeThingInitailzedTwice = -17;
+const WTErr eGenerateHelpInfo = -18;
+const WTErr eOutOfRangeNumber = -19;
+const WTErr eMacOnlyCode = -20;
+const WTErr eWinOnlyCode = -21;
const WTErr eAppLaunchFailed = -22; //!< failed to launch an application
const WTErr eAppTerminateFailed = -23; //!< failed to terminate an application
const WTErr eAppReturnedError = -24; //!< Non zero exit code from application
@@ -57,7 +57,7 @@ const WTErr eNotEmpty = -26; //!< Something was expected to be
const WTErr eAsioFailed = -27;
// File Manager errors
-const WTErr eFMNoSuchVolume = -1001;
+const WTErr eFMNoSuchVolume = -1001;
const WTErr eFMFileNotFound = -1002;
const WTErr eFMFileAllreadyExists = -1003;
const WTErr eFMAllreadyOpenWithWritePerm = -1004;
@@ -71,8 +71,8 @@ const WTErr eFMReadFailed = -1011;
const WTErr eFMIllegalPathRef = -1012;
const WTErr eFMFileNotOpened = -1013;
const WTErr eFMFileSizeTooBig = -1014;
-const WTErr eFMNoSuchDomain = -1015;
-const WTErr eFMNoSuchSystemFolder = -1016;
+const WTErr eFMNoSuchDomain = -1015;
+const WTErr eFMNoSuchSystemFolder = -1016;
const WTErr eFMWrongParameters = -1017;
const WTErr eFMIsNotAFolder = -1018;
const WTErr eFMIsAFolder = -1019;
@@ -113,7 +113,7 @@ const WTErr eNotAValidApplication = -2012;
// Resource Manager errors
const WTErr eRMResNotFound = -3000;
-const WTErr eRMResExists = -3001; //!< a resource exist even though it's not expected to
+const WTErr eRMResExists = -3001; //!< a resource exist even though it's not expected to
const WTErr eRMContainerNotFound = -3002; //!< The container was not found in the list of containers
const WTErr eRMResRefNotFound = -3003; //!< The resRef was not found in container's resource list
const WTErr eRMInvalidResRef = -3004;
@@ -155,8 +155,8 @@ const WTErr eMemObjNotInitialized = -4004;
const WTErr eMemBuffTooShort = -4005; //!< the buffer in question did not have enough space for the operation
const WTErr eInstanciationFailed = -4006;
const WTErr eMemAddressSpaceError = -4007; //!< memory falls outside the legal address space
-const WTErr eMemBadPointer = -4008;
-const WTErr eMemOutOfMemory = -4009;
+const WTErr eMemBadPointer = -4008;
+const WTErr eMemOutOfMemory = -4009;
// XML Errors
const WTErr eXMLParserFailed = -6001;
@@ -168,24 +168,24 @@ const WTErr eXMLElementIncomplete = -6006; //!< XML parser did not complete bu
const WTErr eXMLAttribMissing = -6007;
// Preset errors
-const WTErr ePresetFileProblem = -7860;
-const WTErr eInvalidFileFormatProblem = -7861;
-const WTErr ePresetLockedProblem = -7862;
-const WTErr ePresetInfoNotFound = -7863;
-const WTErr eDuplicatePluginSpecificTag = -7959;
-const WTErr ePluginSpecifcNotExisting = -7960;
-const WTErr eBuffSizeToSmall = -7961;
-const WTErr eCreatingPopupWhereAnItemExists = -7962;
-const WTErr eDeletePluginSpecifcFailed = -7963;
-const WTErr eFactoryPresetNumOutOfRange = -7964;
-const WTErr eNoFactoryPresets = -7965;
-const WTErr eLoadPresetToPlugin_vec_empty = -7966;
-const WTErr eFactoryPresetNotFound = -7967;
-const WTErr eCantCreateUserPrefFile = -7968;
-const WTErr eDataFormatNotSupported = -7969;
-const WTErr eCantLoadProcessFunction = -7970;
-const WTErr eIllegalChunkIndex = -7971;
-const WTErr eIllegalChunkID = -7972;
+const WTErr ePresetFileProblem = -7860;
+const WTErr eInvalidFileFormatProblem = -7861;
+const WTErr ePresetLockedProblem = -7862;
+const WTErr ePresetInfoNotFound = -7863;
+const WTErr eDuplicatePluginSpecificTag = -7959;
+const WTErr ePluginSpecifcNotExisting = -7960;
+const WTErr eBuffSizeToSmall = -7961;
+const WTErr eCreatingPopupWhereAnItemExists = -7962;
+const WTErr eDeletePluginSpecifcFailed = -7963;
+const WTErr eFactoryPresetNumOutOfRange = -7964;
+const WTErr eNoFactoryPresets = -7965;
+const WTErr eLoadPresetToPlugin_vec_empty = -7966;
+const WTErr eFactoryPresetNotFound = -7967;
+const WTErr eCantCreateUserPrefFile = -7968;
+const WTErr eDataFormatNotSupported = -7969;
+const WTErr eCantLoadProcessFunction = -7970;
+const WTErr eIllegalChunkIndex = -7971;
+const WTErr eIllegalChunkID = -7972;
const WTErr eIllegalChunkVersion = -7973;
diff --git a/libs/backends/wavesaudio/wavesapi/MiscUtils/pthread_utils.h b/libs/backends/wavesaudio/wavesapi/MiscUtils/pthread_utils.h
index e5202ece7e..b370845112 100644
--- a/libs/backends/wavesaudio/wavesapi/MiscUtils/pthread_utils.h
+++ b/libs/backends/wavesaudio/wavesapi/MiscUtils/pthread_utils.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2014 John Emmas
+ Copyright (C) 2014 John Emmas
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/libs/backends/wavesaudio/wavesapi/Threads/WCThreadSafe.h b/libs/backends/wavesaudio/wavesapi/Threads/WCThreadSafe.h
index 403d23a102..4a24eab05d 100644
--- a/libs/backends/wavesaudio/wavesapi/Threads/WCThreadSafe.h
+++ b/libs/backends/wavesaudio/wavesapi/Threads/WCThreadSafe.h
@@ -64,7 +64,7 @@ const WTThreadSafetyType kpthreadsmutexThreadSafety = 1;
namespace wvThread
{
//#include "BasicTypes/WavesAPISetAligment.h"
- //Packing affects the layout of classes, and commonly, if packing changes across header files, there can be problems.
+ //Packing affects the layout of classes, and commonly, if packing changes across header files, there can be problems.
#ifdef PLATFORM_WINDOWS
#pragma pack(push)
#pragma pack(8)
@@ -136,7 +136,7 @@ namespace wvThread
public:
static const ThreadHandle Invalid;
protected:
- ThreadHandle(uintptr_t n) : m_oshandle(n) {}
+ ThreadHandle(uintptr_t n) : m_oshandle(n) {}
public:
ThreadHandle() : m_oshandle(Invalid.m_oshandle) {}
bool is_invalid() const { return !m_oshandle || m_oshandle==Invalid.m_oshandle; }
@@ -160,7 +160,7 @@ namespace wvThread
-
+
//--------------------------------------------------------
class DllExport noncopyableobject
{
@@ -219,7 +219,7 @@ namespace wvThread
//--------------------------------------------------------
// Thread Mutex class that is automatically initialized
- class ThreadMutex : public ThreadMutexInited
+ class ThreadMutex : public ThreadMutexInited
{
public:
ThreadMutex() {init();}
@@ -351,7 +351,7 @@ namespace wvThread
protected:
uintptr_t m_osThreadRef;
- WCThreadRef(uintptr_t n) : m_osThreadRef(n) {}
+ WCThreadRef(uintptr_t n) : m_osThreadRef(n) {}
friend DllExport bool operator==(const WCThreadRef& first, const WCThreadRef& second);
friend DllExport bool operator!=(const WCThreadRef& first, const WCThreadRef& second);
@@ -366,7 +366,7 @@ namespace wvThread
class DllExport WCAtomicLock
{
- public:
+ public:
WCAtomicLock() : m_the_lock(0) {}
bool obtain(const uint32_t in_num_trys = 1);
void release();
@@ -388,12 +388,12 @@ namespace wvThread
class WCStThreadMutexLocker
{
public:
- WCStThreadMutexLocker(wvNS::wvThread::ThreadMutexInited& in_mutex) :
+ WCStThreadMutexLocker(wvNS::wvThread::ThreadMutexInited& in_mutex) :
m_mutex(in_mutex)
{
m_mutex.obtain();
}
-
+
~WCStThreadMutexLocker()
{
m_mutex.release();
@@ -403,7 +403,7 @@ protected:
WCStThreadMutexLocker(const WCStThreadMutexLocker&);
WCStThreadMutexLocker& operator=(const WCStThreadMutexLocker&);
};
-
+
} // namespace wvThread
diff --git a/libs/backends/wavesaudio/wavesapi/WavesPublicAPI/1.0/WavesPublicAPI_Defines.h b/libs/backends/wavesaudio/wavesapi/WavesPublicAPI/1.0/WavesPublicAPI_Defines.h
index cb9f9c538c..24bfb10573 100644
--- a/libs/backends/wavesaudio/wavesapi/WavesPublicAPI/1.0/WavesPublicAPI_Defines.h
+++ b/libs/backends/wavesaudio/wavesapi/WavesPublicAPI/1.0/WavesPublicAPI_Defines.h
@@ -30,9 +30,9 @@
#define WPAPI_DllExport __attribute__ ((visibility("default")))
#define __WPAPI_CDECL
#define __WPAPI_STDCALL
-
+
#else
-
+
#define WPAPI_DllExport __declspec(export)
#define __WPAPI_CDECL
#define __WPAPI_STDCALL
@@ -46,7 +46,7 @@
#define WPAPI_DllExport __declspec(dllexport)
#define __WPAPI_CDECL __cdecl
#define __WPAPI_STDCALL __stdcall
-#endif
+#endif
#ifdef __linux__
diff --git a/libs/backends/wavesaudio/wavesapi/WavesPublicAPI/wstdint.h b/libs/backends/wavesaudio/wavesapi/WavesPublicAPI/wstdint.h
index 6e94cfbb17..71ef9bfe92 100644
--- a/libs/backends/wavesaudio/wavesapi/WavesPublicAPI/wstdint.h
+++ b/libs/backends/wavesaudio/wavesapi/WavesPublicAPI/wstdint.h
@@ -31,7 +31,7 @@
#endif
#ifdef __linux__
#if ! defined(__STDC_LIMIT_MACROS)
- #define __STDC_LIMIT_MACROS
+ #define __STDC_LIMIT_MACROS
#endif
#include <stddef.h>
diff --git a/libs/backends/wavesaudio/wavesapi/devicemanager/IncludeWindows.h b/libs/backends/wavesaudio/wavesapi/devicemanager/IncludeWindows.h
index 968604649f..53ed7e69bc 100644
--- a/libs/backends/wavesaudio/wavesapi/devicemanager/IncludeWindows.h
+++ b/libs/backends/wavesaudio/wavesapi/devicemanager/IncludeWindows.h
@@ -45,6 +45,6 @@
#include <winsock2.h>
#include <windows.h>
#include <objbase.h>
-#endif // #if PLATFORM_WINDOWS
+#endif // #if PLATFORM_WINDOWS
#endif // #ifndef __IncludeWindows_h__
diff --git a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.h b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.h
index 6821f25f58..4dae8abab6 100644
--- a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.h
+++ b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRAudioDeviceManager.h
@@ -64,7 +64,7 @@ struct DeviceInfo
DeviceInfo():
m_DeviceId(-1), m_DeviceName("Unknown"), m_MaxInputChannels(0), m_MaxOutputChannels(0)
{};
-
+
DeviceInfo(unsigned int deviceID, const std::string & deviceName):
m_DeviceId(deviceID), m_DeviceName(deviceName), m_MaxInputChannels(0), m_MaxOutputChannels(0)
{};
@@ -186,11 +186,11 @@ public:
virtual WTErr ShowConfigPanel (void *pParam);///< Show Control Panel - in case of ASIO this will work only with Active device!
virtual WTErr SendCustomCommand (int customCommand, void *pCommandParam); ///< Send a custom command to the audiodevice...
-
+
virtual uint32_t GetLatency (bool isInput); ///Get latency.
virtual WTErr UpdateDeviceInfo () = 0;
-
+
protected:
WCMRAudioDeviceManager *m_pMyManager; ///< The manager who's managing this device, can be used for sending notifications!
@@ -230,7 +230,7 @@ typedef enum eAudioDeviceFilter
class WCMRAudioDeviceManager : public WCRefManager
{
public://< Public functions for the class.
-
+
WCMRAudioDeviceManager(WCMRAudioDeviceManagerClient *pTheClient, eAudioDeviceFilter eCurAudioDeviceFilter); ///< constructor
virtual ~WCMRAudioDeviceManager(void); ///< Destructor
@@ -248,7 +248,7 @@ public://< Public functions for the class.
void NotifyClient (WCMRAudioDeviceManagerClient::NotificationReason forReason, void *pParam = NULL);
protected:
-
+
mutable wvNS::wvThread::ThreadMutex m_AudioDeviceInfoVecMutex; // mutex to lock device info list
DeviceInfoVec m_DeviceInfoVec;
@@ -264,7 +264,7 @@ private:
virtual WTErr getDeviceBufferSizesImpl(const std::string & deviceName, std::vector<int>& bufferSizes) const = 0;
virtual WTErr generateDeviceListImpl() = 0;
virtual WTErr updateDeviceListImpl() = 0;
-
+
WCMRAudioDeviceManagerClient *m_pTheClient; ///< The device manager's client, used to send notifications.
};
diff --git a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.h b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.h
index 8bbd7d8eff..e630a7d1a9 100644
--- a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.h
+++ b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRCoreAudioDeviceManager.h
@@ -37,7 +37,7 @@
#include <mach/mach.h>
-#include <CoreAudio/CoreAudio.h>
+#include <CoreAudio/CoreAudio.h>
//forward decl.
class WCMRCoreAudioDeviceManager;
@@ -47,9 +47,9 @@ class WCMRCoreAudioDeviceManager;
// This enum is for choosing filter for audio devices scan
typedef enum eCABS_Method
{
- eCABS_Simple = 0,
+ eCABS_Simple = 0,
eCABS_DestructiveCache,
- eCABS_CacheOnDeviceSet,
+ eCABS_CacheOnDeviceSet,
eCABS_MethodNum // Must be last
} eCABS_Method;
@@ -65,8 +65,8 @@ public:
virtual const std::string& DeviceName() const;///<Name?
virtual const std::vector<std::string>& InputChannels();///<Current Input Channel List? - note that this may change with change in sampling rate.
virtual const std::vector<std::string>& OutputChannels();///<Current Output Channel List? - note that this may change with change in sampling rate.
-
-
+
+
virtual const std::vector<int>& SamplingRates();///<Supported Sampling Rate List?
virtual int CurrentSamplingRate(); ///<Current Sampling rate.?
virtual WTErr SetCurrentSamplingRate(int newRate);///<Change Current Sampling Rate : This is a requset, might not be successful at run time!
@@ -90,11 +90,11 @@ public:
virtual int AudioCallback (float *pOutputBuffer, unsigned long framesPerBuffer, int64_t inSampleTime, uint64_t inCycleStartTime);
AudioDeviceID DeviceID () {return m_DeviceID;}
-
+
virtual uint32_t GetLatency (bool isInput); ///< Get latency.
virtual OSStatus GetStreamLatency(AudioDeviceID deviceID, bool isInput, std::vector<int>& latencies);
-
+
protected:
AudioDeviceID m_DeviceID; ///< The CoreAudio device id
@@ -186,23 +186,23 @@ public:
protected:
static OSStatus HardwarePropertyChangeCallback (AudioHardwarePropertyID inPropertyID, void* inClientData);
-
+
virtual WCMRAudioDevice* initNewCurrentDeviceImpl(const std::string & deviceName);
virtual void destroyCurrentDeviceImpl();
virtual WTErr generateDeviceListImpl();
virtual WTErr updateDeviceListImpl();
virtual WTErr getDeviceSampleRatesImpl(const std::string & deviceName, std::vector<int>& sampleRates) const;
virtual WTErr getDeviceBufferSizesImpl(const std::string & deviceName, std::vector<int>& bufferSizes) const;
-
+
bool m_UseMultithreading; ///< Flag indicates whether to use multi-threading for audio processing.
bool m_bNoCopyAudioBuffer;
-
+
private:
// helper functions for this class only
WTErr getDeviceAvailableSampleRates(DeviceID deviceId, std::vector<int>& sampleRates);
WTErr getDeviceMaxInputChannels(DeviceID deviceId, unsigned int& inputChannels);
WTErr getDeviceMaxOutputChannels(DeviceID deviceId, unsigned int& outputChannels);
-
+
WCMRAudioDevice* m_NoneDevice;
};
diff --git a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.h b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.h
index da2027466e..7579bfd2ff 100644
--- a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.h
+++ b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.h
@@ -89,7 +89,7 @@ protected:
PaError testStateValidness(int sampleRate, int bufferSize);
///////////////////////////////////////////////////////////
- static int TheCallback (const void *pInputBuffer, void *pOutputBuffer, unsigned long framesPerBuffer,
+ static int TheCallback (const void *pInputBuffer, void *pOutputBuffer, unsigned long framesPerBuffer,
const PaStreamCallbackTimeInfo* /*pTimeInfo*/, PaStreamCallbackFlags /*statusFlags*/, void *pUserData );
unsigned int m_DeviceID; ///< The PA device id