| @@ -87,5 +87,5 @@ | |||||
| #if JUCE_BUILD_GUI | #if JUCE_BUILD_GUI | ||||
| #include "../modules/juce_gui_basics/juce_gui_basics.cpp" | #include "../modules/juce_gui_basics/juce_gui_basics.cpp" | ||||
| #include "../modules/juce_gui_extra/juce_gui_extra.cpp" | #include "../modules/juce_gui_extra/juce_gui_extra.cpp" | ||||
| #include "../modules/juce_gui_audio/juce_gui_audio.cpp" | |||||
| #include "../modules/juce_audio_utils/juce_audio_utils.cpp" | |||||
| #endif | #endif | ||||
| @@ -57,7 +57,7 @@ | |||||
| #include "modules/juce_audio_devices/juce_audio_devices.h" | #include "modules/juce_audio_devices/juce_audio_devices.h" | ||||
| #include "modules/juce_cryptography/juce_cryptography.h" | #include "modules/juce_cryptography/juce_cryptography.h" | ||||
| #include "modules/juce_gui_extra/juce_gui_extra.h" | #include "modules/juce_gui_extra/juce_gui_extra.h" | ||||
| #include "modules/juce_gui_audio/juce_gui_audio.h" | |||||
| #include "modules/juce_audio_utils/juce_audio_utils.h" | |||||
| //============================================================================== | //============================================================================== | ||||
| @@ -217,10 +217,10 @@ public: | |||||
| opening the device | opening the device | ||||
| @see close | @see close | ||||
| */ | */ | ||||
| virtual const String open (const BigInteger& inputChannels, | |||||
| const BigInteger& outputChannels, | |||||
| double sampleRate, | |||||
| int bufferSizeSamples) = 0; | |||||
| virtual String open (const BigInteger& inputChannels, | |||||
| const BigInteger& outputChannels, | |||||
| double sampleRate, | |||||
| int bufferSizeSamples) = 0; | |||||
| /** Closes and releases the device if it's open. */ | /** Closes and releases the device if it's open. */ | ||||
| virtual void close() = 0; | virtual void close() = 0; | ||||
| @@ -256,7 +256,7 @@ public: | |||||
| virtual bool isPlaying() = 0; | virtual bool isPlaying() = 0; | ||||
| /** Returns the last error that happened if anything went wrong. */ | /** Returns the last error that happened if anything went wrong. */ | ||||
| virtual const String getLastError() = 0; | |||||
| virtual String getLastError() = 0; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** Returns the buffer size that the device is currently using. | /** Returns the buffer size that the device is currently using. | ||||
| @@ -133,10 +133,10 @@ public: | |||||
| int getNumBufferSizesAvailable() { return 10; } | int getNumBufferSizesAvailable() { return 10; } | ||||
| int getBufferSizeSamples (int index) { return getDefaultBufferSize() + index * 128; } | int getBufferSizeSamples (int index) { return getDefaultBufferSize() + index * 128; } | ||||
| const String open (const BigInteger& inputChannels, | |||||
| const BigInteger& outputChannels, | |||||
| double requestedSampleRate, | |||||
| int bufferSize) | |||||
| String open (const BigInteger& inputChannels, | |||||
| const BigInteger& outputChannels, | |||||
| double requestedSampleRate, | |||||
| int bufferSize) | |||||
| { | { | ||||
| close(); | close(); | ||||
| @@ -221,7 +221,7 @@ public: | |||||
| double getCurrentSampleRate() { return sampleRate; } | double getCurrentSampleRate() { return sampleRate; } | ||||
| BigInteger getActiveOutputChannels() const { return activeOutputChans; } | BigInteger getActiveOutputChannels() const { return activeOutputChans; } | ||||
| BigInteger getActiveInputChannels() const { return activeInputChans; } | BigInteger getActiveInputChannels() const { return activeInputChans; } | ||||
| const String getLastError() { return lastError; } | |||||
| String getLastError() { return lastError; } | |||||
| bool isPlaying() { return isRunning && callback != 0; } | bool isPlaying() { return isRunning && callback != 0; } | ||||
| void start (AudioIODeviceCallback* newCallback) | void start (AudioIODeviceCallback* newCallback) | ||||
| @@ -73,10 +73,10 @@ public: | |||||
| int getBufferSizeSamples (int index) { return getDefaultBufferSize(); } | int getBufferSizeSamples (int index) { return getDefaultBufferSize(); } | ||||
| int getDefaultBufferSize() { return 1024; } | int getDefaultBufferSize() { return 1024; } | ||||
| const String open (const BigInteger& inputChannels, | |||||
| const BigInteger& outputChannels, | |||||
| double sampleRate, | |||||
| int bufferSize) | |||||
| String open (const BigInteger& inputChannels, | |||||
| const BigInteger& outputChannels, | |||||
| double sampleRate, | |||||
| int bufferSize) | |||||
| { | { | ||||
| close(); | close(); | ||||
| @@ -175,15 +175,8 @@ public: | |||||
| } | } | ||||
| } | } | ||||
| bool isPlaying() | |||||
| { | |||||
| return isRunning && callback != nullptr; | |||||
| } | |||||
| const String getLastError() | |||||
| { | |||||
| return lastError; | |||||
| } | |||||
| bool isPlaying() { return isRunning && callback != nullptr; } | |||||
| String getLastError() { return lastError; } | |||||
| private: | private: | ||||
| //================================================================================================== | //================================================================================================== | ||||
| @@ -716,10 +716,10 @@ public: | |||||
| return n; | return n; | ||||
| } | } | ||||
| const String open (const BigInteger& inputChannels, | |||||
| const BigInteger& outputChannels, | |||||
| double sampleRate, | |||||
| int bufferSizeSamples) | |||||
| String open (const BigInteger& inputChannels, | |||||
| const BigInteger& outputChannels, | |||||
| double sampleRate, | |||||
| int bufferSizeSamples) | |||||
| { | { | ||||
| close(); | close(); | ||||
| @@ -754,7 +754,7 @@ public: | |||||
| bool isOpen() { return isOpen_; } | bool isOpen() { return isOpen_; } | ||||
| bool isPlaying() { return isStarted && internal.error.isEmpty(); } | bool isPlaying() { return isStarted && internal.error.isEmpty(); } | ||||
| const String getLastError() { return internal.error; } | |||||
| String getLastError() { return internal.error; } | |||||
| int getCurrentBufferSizeSamples() { return internal.bufferSize; } | int getCurrentBufferSizeSamples() { return internal.bufferSize; } | ||||
| double getCurrentSampleRate() { return internal.sampleRate; } | double getCurrentSampleRate() { return internal.sampleRate; } | ||||
| @@ -201,8 +201,8 @@ public: | |||||
| int getBufferSizeSamples (int index) { return getDefaultBufferSize(); } | int getBufferSizeSamples (int index) { return getDefaultBufferSize(); } | ||||
| int getDefaultBufferSize() { return client != 0 ? JUCE_NAMESPACE::jack_get_buffer_size (client) : 0; } | int getDefaultBufferSize() { return client != 0 ? JUCE_NAMESPACE::jack_get_buffer_size (client) : 0; } | ||||
| const String open (const BigInteger& inputChannels, const BigInteger& outputChannels, | |||||
| double sampleRate, int bufferSizeSamples) | |||||
| String open (const BigInteger& inputChannels, const BigInteger& outputChannels, | |||||
| double sampleRate, int bufferSizeSamples) | |||||
| { | { | ||||
| if (client == 0) | if (client == 0) | ||||
| { | { | ||||
| @@ -312,7 +312,7 @@ public: | |||||
| int getCurrentBufferSizeSamples() { return getBufferSizeSamples (0); } | int getCurrentBufferSizeSamples() { return getBufferSizeSamples (0); } | ||||
| double getCurrentSampleRate() { return getSampleRate (0); } | double getCurrentSampleRate() { return getSampleRate (0); } | ||||
| int getCurrentBitDepth() { return 32; } | int getCurrentBitDepth() { return 32; } | ||||
| const String getLastError() { return lastError; } | |||||
| String getLastError() { return lastError; } | |||||
| BigInteger getActiveOutputChannels() const | BigInteger getActiveOutputChannels() const | ||||
| { | { | ||||
| @@ -920,10 +920,10 @@ public: | |||||
| return 512; | return 512; | ||||
| } | } | ||||
| const String open (const BigInteger& inputChannels, | |||||
| const BigInteger& outputChannels, | |||||
| double sampleRate, | |||||
| int bufferSizeSamples) | |||||
| String open (const BigInteger& inputChannels, | |||||
| const BigInteger& outputChannels, | |||||
| double sampleRate, | |||||
| int bufferSizeSamples) | |||||
| { | { | ||||
| isOpen_ = true; | isOpen_ = true; | ||||
| @@ -1003,7 +1003,7 @@ public: | |||||
| return isStarted; | return isStarted; | ||||
| } | } | ||||
| const String getLastError() | |||||
| String getLastError() | |||||
| { | { | ||||
| return lastError; | return lastError; | ||||
| } | } | ||||
| @@ -155,10 +155,10 @@ public: | |||||
| int getBufferSizeSamples (int index) { return bufferSizes [index]; } | int getBufferSizeSamples (int index) { return bufferSizes [index]; } | ||||
| int getDefaultBufferSize() { return preferredSize; } | int getDefaultBufferSize() { return preferredSize; } | ||||
| const String open (const BigInteger& inputChannels, | |||||
| const BigInteger& outputChannels, | |||||
| double sr, | |||||
| int bufferSizeSamples) | |||||
| String open (const BigInteger& inputChannels, | |||||
| const BigInteger& outputChannels, | |||||
| double sr, | |||||
| int bufferSizeSamples) | |||||
| { | { | ||||
| close(); | close(); | ||||
| currentCallback = nullptr; | currentCallback = nullptr; | ||||
| @@ -612,7 +612,7 @@ public: | |||||
| lastCallback->audioDeviceStopped(); | lastCallback->audioDeviceStopped(); | ||||
| } | } | ||||
| const String getLastError() { return error; } | |||||
| String getLastError() { return error; } | |||||
| bool hasControlPanel() const { return true; } | bool hasControlPanel() const { return true; } | ||||
| bool showControlPanel() | bool showControlPanel() | ||||
| @@ -812,9 +812,9 @@ public: | |||||
| close(); | close(); | ||||
| } | } | ||||
| const String open (const BigInteger& inputChannels, | |||||
| const BigInteger& outputChannels, | |||||
| double sampleRate, int bufferSizeSamples) | |||||
| String open (const BigInteger& inputChannels, | |||||
| const BigInteger& outputChannels, | |||||
| double sampleRate, int bufferSizeSamples) | |||||
| { | { | ||||
| lastError = openDevice (inputChannels, outputChannels, sampleRate, bufferSizeSamples); | lastError = openDevice (inputChannels, outputChannels, sampleRate, bufferSizeSamples); | ||||
| isOpen_ = lastError.isEmpty(); | isOpen_ = lastError.isEmpty(); | ||||
| @@ -916,7 +916,7 @@ public: | |||||
| } | } | ||||
| bool isPlaying() { return isStarted && isOpen_ && isThreadRunning(); } | bool isPlaying() { return isStarted && isOpen_ && isThreadRunning(); } | ||||
| const String getLastError() { return lastError; } | |||||
| String getLastError() { return lastError; } | |||||
| //============================================================================== | //============================================================================== | ||||
| StringArray inChannels, outChannels; | StringArray inChannels, outChannels; | ||||
| @@ -707,11 +707,11 @@ public: | |||||
| int getInputLatencyInSamples() { return latencyIn; } | int getInputLatencyInSamples() { return latencyIn; } | ||||
| BigInteger getActiveOutputChannels() const { return outputDevice != nullptr ? outputDevice->channels : BigInteger(); } | BigInteger getActiveOutputChannels() const { return outputDevice != nullptr ? outputDevice->channels : BigInteger(); } | ||||
| BigInteger getActiveInputChannels() const { return inputDevice != nullptr ? inputDevice->channels : BigInteger(); } | BigInteger getActiveInputChannels() const { return inputDevice != nullptr ? inputDevice->channels : BigInteger(); } | ||||
| const String getLastError() { return lastError; } | |||||
| String getLastError() { return lastError; } | |||||
| const String open (const BigInteger& inputChannels, const BigInteger& outputChannels, | |||||
| double sampleRate, int bufferSizeSamples) | |||||
| String open (const BigInteger& inputChannels, const BigInteger& outputChannels, | |||||
| double sampleRate, int bufferSizeSamples) | |||||
| { | { | ||||
| close(); | close(); | ||||
| lastError = String::empty; | lastError = String::empty; | ||||
| @@ -57,7 +57,7 @@ void TextButton::colourChanged() | |||||
| repaint(); | repaint(); | ||||
| } | } | ||||
| const Font TextButton::getFont() | |||||
| Font TextButton::getFont() | |||||
| { | { | ||||
| return Font (jmin (15.0f, getHeight() * 0.6f)); | return Font (jmin (15.0f, getHeight() * 0.6f)); | ||||
| } | } | ||||
| @@ -87,7 +87,7 @@ public: | |||||
| Note that you'll need to set the font's size appropriately, too. | Note that you'll need to set the font's size appropriately, too. | ||||
| */ | */ | ||||
| virtual const Font getFont(); | |||||
| virtual Font getFont(); | |||||
| protected: | protected: | ||||