@@ -22,13 +22,20 @@ | |||
============================================================================== | |||
*/ | |||
AudioSampleBuffer::AudioSampleBuffer() noexcept | |||
: numChannels (0), size (0), allocatedBytes (0), | |||
channels (static_cast<float**> (preallocatedChannelSpace)), | |||
isClear (false) | |||
{ | |||
} | |||
AudioSampleBuffer::AudioSampleBuffer (const int numChans, | |||
const int numSamples) noexcept | |||
: numChannels (numChans), | |||
size (numSamples) | |||
{ | |||
jassert (numSamples >= 0); | |||
jassert (numChans > 0); | |||
jassert (numChans >= 0); | |||
allocateData(); | |||
} | |||
@@ -63,7 +70,7 @@ void AudioSampleBuffer::allocateData() | |||
const size_t channelListSize = sizeof (float*) * (size_t) (numChannels + 1); | |||
allocatedBytes = (size_t) numChannels * (size_t) size * sizeof (float) + channelListSize + 32; | |||
allocatedData.malloc (allocatedBytes); | |||
channels = reinterpret_cast <float**> (allocatedData.getData()); | |||
channels = reinterpret_cast<float**> (allocatedData.getData()); | |||
float* chan = (float*) (allocatedData + channelListSize); | |||
for (int i = 0; i < numChannels; ++i) | |||
@@ -83,7 +90,8 @@ AudioSampleBuffer::AudioSampleBuffer (float* const* dataToReferTo, | |||
size (numSamples), | |||
allocatedBytes (0) | |||
{ | |||
jassert (numChans > 0); | |||
jassert (dataToReferTo != nullptr); | |||
jassert (numChans >= 0); | |||
allocateChannels (dataToReferTo, 0); | |||
} | |||
@@ -96,7 +104,8 @@ AudioSampleBuffer::AudioSampleBuffer (float* const* dataToReferTo, | |||
allocatedBytes (0), | |||
isClear (false) | |||
{ | |||
jassert (numChans > 0); | |||
jassert (dataToReferTo != nullptr); | |||
jassert (numChans >= 0); | |||
allocateChannels (dataToReferTo, startSample); | |||
} | |||
@@ -104,7 +113,8 @@ void AudioSampleBuffer::setDataToReferTo (float** dataToReferTo, | |||
const int newNumChannels, | |||
const int newNumSamples) noexcept | |||
{ | |||
jassert (newNumChannels > 0); | |||
jassert (dataToReferTo != nullptr); | |||
jassert (newNumChannels >= 0); | |||
allocatedBytes = 0; | |||
allocatedData.free(); | |||
@@ -121,12 +131,12 @@ void AudioSampleBuffer::allocateChannels (float* const* const dataToReferTo, int | |||
// (try to avoid doing a malloc here, as that'll blow up things like Pro-Tools) | |||
if (numChannels < (int) numElementsInArray (preallocatedChannelSpace)) | |||
{ | |||
channels = static_cast <float**> (preallocatedChannelSpace); | |||
channels = static_cast<float**> (preallocatedChannelSpace); | |||
} | |||
else | |||
{ | |||
allocatedData.malloc ((size_t) numChannels + 1, sizeof (float*)); | |||
channels = reinterpret_cast <float**> (allocatedData.getData()); | |||
channels = reinterpret_cast<float**> (allocatedData.getData()); | |||
} | |||
for (int i = 0; i < numChannels; ++i) | |||
@@ -171,7 +181,7 @@ void AudioSampleBuffer::setSize (const int newNumChannels, | |||
const bool clearExtraSpace, | |||
const bool avoidReallocating) noexcept | |||
{ | |||
jassert (newNumChannels > 0); | |||
jassert (newNumChannels >= 0); | |||
jassert (newNumSamples >= 0); | |||
if (newNumSamples != size || newNumChannels != numChannels) | |||
@@ -34,6 +34,10 @@ | |||
class JUCE_API AudioSampleBuffer | |||
{ | |||
public: | |||
//============================================================================== | |||
/** Creates an empty buffer with 0 channels and 0 length. */ | |||
AudioSampleBuffer() noexcept; | |||
//============================================================================== | |||
/** Creates a buffer with a specified number of channels and samples. | |||
@@ -93,12 +97,12 @@ public: | |||
using an external data buffer, in which case boths buffers will just point to the same | |||
shared block of data. | |||
*/ | |||
AudioSampleBuffer (const AudioSampleBuffer& other) noexcept; | |||
AudioSampleBuffer (const AudioSampleBuffer&) noexcept; | |||
/** Copies another buffer onto this one. | |||
This buffer's size will be changed to that of the other buffer. | |||
*/ | |||
AudioSampleBuffer& operator= (const AudioSampleBuffer& other) noexcept; | |||
AudioSampleBuffer& operator= (const AudioSampleBuffer&) noexcept; | |||
/** Destructor. | |||
This will free any memory allocated by the buffer. | |||
@@ -493,14 +497,14 @@ public: | |||
//============================================================================== | |||
#ifndef DOXYGEN | |||
// Note that these methods have now been replaced by getReadPointer() and getWritePointer() | |||
JUCE_DEPRECATED (const float* getSampleData (int channel) const) { return getReadPointer (channel); } | |||
JUCE_DEPRECATED (const float* getSampleData (int channel, int index) const) { return getReadPointer (channel, index); } | |||
JUCE_DEPRECATED (float* getSampleData (int channel)) { return getWritePointer (channel); } | |||
JUCE_DEPRECATED (float* getSampleData (int channel, int index)) { return getWritePointer (channel, index); } | |||
JUCE_DEPRECATED_WITH_BODY (const float* getSampleData (int channel) const, { return getReadPointer (channel); }) | |||
JUCE_DEPRECATED_WITH_BODY (const float* getSampleData (int channel, int index) const, { return getReadPointer (channel, index); }) | |||
JUCE_DEPRECATED_WITH_BODY (float* getSampleData (int channel), { return getWritePointer (channel); }) | |||
JUCE_DEPRECATED_WITH_BODY (float* getSampleData (int channel, int index), { return getWritePointer (channel, index); }) | |||
// These have been replaced by getArrayOfReadPointers() and getArrayOfWritePointers() | |||
JUCE_DEPRECATED (const float** getArrayOfChannels() const) { return getArrayOfReadPointers(); } | |||
JUCE_DEPRECATED (float** getArrayOfChannels()) { return getArrayOfWritePointers(); } | |||
JUCE_DEPRECATED_WITH_BODY (const float** getArrayOfChannels() const, { return getArrayOfReadPointers(); }) | |||
JUCE_DEPRECATED_WITH_BODY (float** getArrayOfChannels(), { return getArrayOfWritePointers(); }) | |||
#endif | |||
private: | |||
@@ -513,7 +517,7 @@ private: | |||
bool isClear; | |||
void allocateData(); | |||
void allocateChannels (float* const* dataToReferTo, int offset); | |||
void allocateChannels (float* const*, int offset); | |||
JUCE_LEAK_DETECTOR (AudioSampleBuffer) | |||
}; | |||
@@ -53,8 +53,8 @@ namespace FloatVectorHelpers | |||
static forcedinline ParallelType load1 (Type v) noexcept { return _mm_load1_ps (&v); } | |||
static forcedinline ParallelType loadA (const Type* v) noexcept { return _mm_load_ps (v); } | |||
static forcedinline ParallelType loadU (const Type* v) noexcept { return _mm_loadu_ps (v); } | |||
static forcedinline void storeA (Type* dest, ParallelType a) noexcept { return _mm_store_ps (dest, a); } | |||
static forcedinline void storeU (Type* dest, ParallelType a) noexcept { return _mm_storeu_ps (dest, a); } | |||
static forcedinline void storeA (Type* dest, ParallelType a) noexcept { _mm_store_ps (dest, a); } | |||
static forcedinline void storeU (Type* dest, ParallelType a) noexcept { _mm_storeu_ps (dest, a); } | |||
static forcedinline ParallelType add (ParallelType a, ParallelType b) noexcept { return _mm_add_ps (a, b); } | |||
static forcedinline ParallelType sub (ParallelType a, ParallelType b) noexcept { return _mm_sub_ps (a, b); } | |||
@@ -75,8 +75,8 @@ namespace FloatVectorHelpers | |||
static forcedinline ParallelType load1 (Type v) noexcept { return _mm_load1_pd (&v); } | |||
static forcedinline ParallelType loadA (const Type* v) noexcept { return _mm_load_pd (v); } | |||
static forcedinline ParallelType loadU (const Type* v) noexcept { return _mm_loadu_pd (v); } | |||
static forcedinline void storeA (Type* dest, ParallelType a) noexcept { return _mm_store_pd (dest, a); } | |||
static forcedinline void storeU (Type* dest, ParallelType a) noexcept { return _mm_storeu_pd (dest, a); } | |||
static forcedinline void storeA (Type* dest, ParallelType a) noexcept { _mm_store_pd (dest, a); } | |||
static forcedinline void storeU (Type* dest, ParallelType a) noexcept { _mm_storeu_pd (dest, a); } | |||
static forcedinline ParallelType add (ParallelType a, ParallelType b) noexcept { return _mm_add_pd (a, b); } | |||
static forcedinline ParallelType sub (ParallelType a, ParallelType b) noexcept { return _mm_sub_pd (a, b); } | |||
@@ -134,8 +134,8 @@ namespace FloatVectorHelpers | |||
static forcedinline ParallelType load1 (Type v) noexcept { return vld1q_dup_f32 (&v); } | |||
static forcedinline ParallelType loadA (const Type* v) noexcept { return vld1q_f32 (v); } | |||
static forcedinline ParallelType loadU (const Type* v) noexcept { return vld1q_f32 (v); } | |||
static forcedinline void storeA (Type* dest, ParallelType a) noexcept { return vst1q_f32 (dest, a); } | |||
static forcedinline void storeU (Type* dest, ParallelType a) noexcept { return vst1q_f32 (dest, a); } | |||
static forcedinline void storeA (Type* dest, ParallelType a) noexcept { vst1q_f32 (dest, a); } | |||
static forcedinline void storeU (Type* dest, ParallelType a) noexcept { vst1q_f32 (dest, a); } | |||
static forcedinline ParallelType add (ParallelType a, ParallelType b) noexcept { return vaddq_f32 (a, b); } | |||
static forcedinline ParallelType sub (ParallelType a, ParallelType b) noexcept { return vsubq_f32 (a, b); } | |||
@@ -156,8 +156,8 @@ namespace FloatVectorHelpers | |||
static forcedinline ParallelType load1 (Type v) noexcept { return v; } | |||
static forcedinline ParallelType loadA (const Type* v) noexcept { return *v; } | |||
static forcedinline ParallelType loadU (const Type* v) noexcept { return *v; } | |||
static forcedinline void storeA (Type* dest, ParallelType a) noexcept { return *dest = a; } | |||
static forcedinline void storeU (Type* dest, ParallelType a) noexcept { return *dest = a; } | |||
static forcedinline void storeA (Type* dest, ParallelType a) noexcept { *dest = a; } | |||
static forcedinline void storeU (Type* dest, ParallelType a) noexcept { *dest = a; } | |||
static forcedinline ParallelType add (ParallelType a, ParallelType b) noexcept { return a + b; } | |||
static forcedinline ParallelType sub (ParallelType a, ParallelType b) noexcept { return a - b; } | |||
@@ -549,9 +549,9 @@ void FloatVectorOperations::negate (double* dest, const double* src, int num) no | |||
void JUCE_CALLTYPE FloatVectorOperations::convertFixedToFloat (float* dest, const int* src, float multiplier, int num) noexcept | |||
{ | |||
#if JUCE_USE_ARM_NEON | |||
JUCE_PERFORM_NEON_OP_SRC_DEST (dest[i] = src[i] * multiplier, | |||
vmulq_n_f32 (vcvtq_f32_s32 (vld1q_s32 (src)), multiplier), | |||
JUCE_LOAD_NONE) | |||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = src[i] * multiplier, | |||
vmulq_n_f32 (vcvtq_f32_s32 (vld1q_s32 (src)), multiplier), | |||
JUCE_LOAD_NONE, JUCE_INCREMENT_SRC_DEST, ) | |||
#else | |||
JUCE_PERFORM_VEC_OP_SRC_DEST (dest[i] = src[i] * multiplier, | |||
Mode::mul (mult, _mm_cvtepi32_ps (_mm_loadu_si128 ((const __m128i*) src))), | |||
@@ -1,7 +1,7 @@ | |||
{ | |||
"id": "juce_audio_basics", | |||
"name": "JUCE audio and midi data classes", | |||
"version": "3.0.4", | |||
"version": "3.0.5", | |||
"description": "Classes for audio buffer manipulation, midi message handling, synthesis, etc", | |||
"website": "http://www.juce.com/juce", | |||
"license": "GPL/Commercial", | |||
@@ -31,7 +31,6 @@ BufferingAudioSource::BufferingAudioSource (PositionableAudioSource* s, | |||
backgroundThread (thread), | |||
numberOfSamplesToBuffer (jmax (1024, bufferSizeSamples)), | |||
numberOfChannels (numChannels), | |||
buffer (numChannels, 0), | |||
bufferValidStart (0), | |||
bufferValidEnd (0), | |||
nextPlayPos (0), | |||
@@ -25,8 +25,7 @@ | |||
ChannelRemappingAudioSource::ChannelRemappingAudioSource (AudioSource* const source_, | |||
const bool deleteSourceWhenDeleted) | |||
: source (source_, deleteSourceWhenDeleted), | |||
requiredNumberOfChannels (2), | |||
buffer (2, 16) | |||
requiredNumberOfChannels (2) | |||
{ | |||
remappedInfo.buffer = &buffer; | |||
remappedInfo.startSample = 0; | |||
@@ -23,9 +23,7 @@ | |||
*/ | |||
MixerAudioSource::MixerAudioSource() | |||
: tempBuffer (2, 0), | |||
currentSampleRate (0.0), | |||
bufferSizeExpected (0) | |||
: currentSampleRate (0.0), bufferSizeExpected (0) | |||
{ | |||
} | |||
@@ -28,14 +28,12 @@ ResamplingAudioSource::ResamplingAudioSource (AudioSource* const inputSource, | |||
: input (inputSource, deleteInputWhenDeleted), | |||
ratio (1.0), | |||
lastRatio (1.0), | |||
buffer (numChannels_, 0), | |||
bufferPos (0), | |||
sampsInBuffer (0), | |||
subSampleOffset (0), | |||
numChannels (numChannels_) | |||
{ | |||
jassert (input != nullptr); | |||
zeromem (coefficients, sizeof (coefficients)); | |||
} | |||
@@ -90,10 +90,10 @@ void Synthesiser::clearVoices() | |||
voices.clear(); | |||
} | |||
void Synthesiser::addVoice (SynthesiserVoice* const newVoice) | |||
SynthesiserVoice* Synthesiser::addVoice (SynthesiserVoice* const newVoice) | |||
{ | |||
const ScopedLock sl (lock); | |||
voices.add (newVoice); | |||
return voices.add (newVoice); | |||
} | |||
void Synthesiser::removeVoice (const int index) | |||
@@ -108,10 +108,10 @@ void Synthesiser::clearSounds() | |||
sounds.clear(); | |||
} | |||
void Synthesiser::addSound (const SynthesiserSound::Ptr& newSound) | |||
SynthesiserSound* Synthesiser::addSound (const SynthesiserSound::Ptr& newSound) | |||
{ | |||
const ScopedLock sl (lock); | |||
sounds.add (newSound); | |||
return sounds.add (newSound); | |||
} | |||
void Synthesiser::removeSound (const int index) | |||
@@ -294,7 +294,7 @@ public: | |||
it later on when no longer needed. The caller should not retain a pointer to the | |||
voice. | |||
*/ | |||
void addVoice (SynthesiserVoice* newVoice); | |||
SynthesiserVoice* addVoice (SynthesiserVoice* newVoice); | |||
/** Deletes one of the voices. */ | |||
void removeVoice (int index); | |||
@@ -311,10 +311,10 @@ public: | |||
/** Adds a new sound to the synthesiser. | |||
The object passed in is reference counted, so will be deleted when it is removed | |||
from the synthesiser, and when no voices are still using it. | |||
The object passed in is reference counted, so will be deleted when the | |||
synthesiser and all voices are no longer using it. | |||
*/ | |||
void addSound (const SynthesiserSound::Ptr& newSound); | |||
SynthesiserSound* addSound (const SynthesiserSound::Ptr& newSound); | |||
/** Removes and deletes one of the sounds. */ | |||
void removeSound (int index); | |||
@@ -95,7 +95,6 @@ AudioDeviceManager::AudioDeviceManager() | |||
useInputNames (false), | |||
inputLevel (0), | |||
testSoundPosition (0), | |||
tempBuffer (2, 2), | |||
cpuUsageMs (0), | |||
timeToCpuScale (0) | |||
{ | |||
@@ -1,7 +1,7 @@ | |||
{ | |||
"id": "juce_audio_devices", | |||
"name": "JUCE audio and midi I/O device classes", | |||
"version": "3.0.4", | |||
"version": "3.0.5", | |||
"description": "Classes to play and record from audio and midi i/o devices.", | |||
"website": "http://www.juce.com/juce", | |||
"license": "GPL/Commercial", | |||
@@ -1026,8 +1026,7 @@ public: | |||
AudioIODeviceCombiner (const String& deviceName) | |||
: AudioIODevice (deviceName, "CoreAudio"), | |||
Thread (deviceName), callback (nullptr), | |||
currentSampleRate (0), currentBufferSize (0), active (false), | |||
fifos (1, 1) | |||
currentSampleRate (0), currentBufferSize (0), active (false) | |||
{ | |||
} | |||
@@ -731,8 +731,6 @@ public: | |||
isStarted (false), | |||
bufferSizeSamples (0), | |||
sampleRate (0.0), | |||
inputBuffers (1, 1), | |||
outputBuffers (1, 1), | |||
callback (nullptr) | |||
{ | |||
if (outputDeviceIndex_ >= 0) | |||
@@ -871,8 +869,8 @@ private: | |||
bool isStarted; | |||
String lastError; | |||
OwnedArray <DSoundInternalInChannel> inChans; | |||
OwnedArray <DSoundInternalOutChannel> outChans; | |||
OwnedArray<DSoundInternalInChannel> inChans; | |||
OwnedArray<DSoundInternalOutChannel> outChans; | |||
WaitableEvent startEvent; | |||
int bufferSizeSamples; | |||
@@ -316,7 +316,7 @@ String getDeviceID (IMMDevice* const device) | |||
EDataFlow getDataFlow (const ComSmartPtr<IMMDevice>& device) | |||
{ | |||
EDataFlow flow = eRender; | |||
ComSmartPtr <IMMEndpoint> endPoint; | |||
ComSmartPtr<IMMEndpoint> endPoint; | |||
if (check (device.QueryInterface (endPoint))) | |||
(void) check (endPoint->GetDataFlow (&flow)); | |||
@@ -338,7 +338,7 @@ void copyWavFormat (WAVEFORMATEXTENSIBLE& dest, const WAVEFORMATEX* const src) n | |||
class WASAPIDeviceBase | |||
{ | |||
public: | |||
WASAPIDeviceBase (const ComSmartPtr <IMMDevice>& d, const bool exclusiveMode) | |||
WASAPIDeviceBase (const ComSmartPtr<IMMDevice>& d, const bool exclusiveMode) | |||
: device (d), | |||
sampleRate (0), | |||
defaultSampleRate (0), | |||
@@ -352,7 +352,7 @@ public: | |||
{ | |||
clientEvent = CreateEvent (0, false, false, _T("JuceWASAPI")); | |||
ComSmartPtr <IAudioClient> tempClient (createClient()); | |||
ComSmartPtr<IAudioClient> tempClient (createClient()); | |||
if (tempClient == nullptr) | |||
return; | |||
@@ -453,17 +453,17 @@ public: | |||
} | |||
//============================================================================== | |||
ComSmartPtr <IMMDevice> device; | |||
ComSmartPtr <IAudioClient> client; | |||
ComSmartPtr<IMMDevice> device; | |||
ComSmartPtr<IAudioClient> client; | |||
double sampleRate, defaultSampleRate; | |||
int numChannels, actualNumChannels; | |||
int minBufferSize, defaultBufferSize, latencySamples; | |||
DWORD mixFormatChannelMask; | |||
const bool useExclusiveMode; | |||
Array <double> rates; | |||
Array<double> rates; | |||
HANDLE clientEvent; | |||
BigInteger channels; | |||
Array <int> channelMaps; | |||
Array<int> channelMaps; | |||
UINT32 actualBufferSize; | |||
int bytesPerSample; | |||
bool sampleRateHasChanged; | |||
@@ -472,7 +472,7 @@ public: | |||
private: | |||
//============================================================================== | |||
class SessionEventCallback : public ComBaseClassHelper <IAudioSessionEvents> | |||
class SessionEventCallback : public ComBaseClassHelper<IAudioSessionEvents> | |||
{ | |||
public: | |||
SessionEventCallback (WASAPIDeviceBase& d) : owner (d) {} | |||
@@ -498,8 +498,8 @@ private: | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SessionEventCallback) | |||
}; | |||
ComSmartPtr <IAudioSessionControl> audioSessionControl; | |||
ComSmartPtr <SessionEventCallback> sessionEventCallback; | |||
ComSmartPtr<IAudioSessionControl> audioSessionControl; | |||
ComSmartPtr<SessionEventCallback> sessionEventCallback; | |||
void createSessionEventCallback() | |||
{ | |||
@@ -525,16 +525,13 @@ private: | |||
} | |||
//============================================================================== | |||
const ComSmartPtr <IAudioClient> createClient() | |||
ComSmartPtr<IAudioClient> createClient() | |||
{ | |||
ComSmartPtr <IAudioClient> client; | |||
ComSmartPtr<IAudioClient> client; | |||
if (device != nullptr) | |||
{ | |||
HRESULT hr = device->Activate (__uuidof (IAudioClient), CLSCTX_INPROC_SERVER, | |||
nullptr, (void**) client.resetAndGetPointerAddress()); | |||
logFailure (hr); | |||
} | |||
logFailure (device->Activate (__uuidof (IAudioClient), CLSCTX_INPROC_SERVER, | |||
nullptr, (void**) client.resetAndGetPointerAddress())); | |||
return client; | |||
} | |||
@@ -607,7 +604,7 @@ private: | |||
class WASAPIInputDevice : public WASAPIDeviceBase | |||
{ | |||
public: | |||
WASAPIInputDevice (const ComSmartPtr <IMMDevice>& d, const bool exclusiveMode) | |||
WASAPIInputDevice (const ComSmartPtr<IMMDevice>& d, const bool exclusiveMode) | |||
: WASAPIDeviceBase (d, exclusiveMode), | |||
reservoir (1, 1) | |||
{ | |||
@@ -635,11 +632,11 @@ public: | |||
reservoir.reset(); | |||
} | |||
template <class SourceType> | |||
template<class SourceType> | |||
void updateFormatWithType (SourceType*) | |||
{ | |||
typedef AudioData::Pointer <AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst> NativeType; | |||
converter = new AudioData::ConverterInstance <AudioData::Pointer <SourceType, AudioData::LittleEndian, AudioData::Interleaved, AudioData::Const>, NativeType> (actualNumChannels, 1); | |||
typedef AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::NonConst> NativeType; | |||
converter = new AudioData::ConverterInstance<AudioData::Pointer<SourceType, AudioData::LittleEndian, AudioData::Interleaved, AudioData::Const>, NativeType> (actualNumChannels, 1); | |||
} | |||
void updateFormat (bool isFloat) | |||
@@ -712,10 +709,10 @@ public: | |||
} | |||
} | |||
ComSmartPtr <IAudioCaptureClient> captureClient; | |||
ComSmartPtr<IAudioCaptureClient> captureClient; | |||
MemoryBlock reservoir; | |||
int reservoirSize, reservoirCapacity; | |||
ScopedPointer <AudioData::Converter> converter; | |||
ScopedPointer<AudioData::Converter> converter; | |||
private: | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WASAPIInputDevice) | |||
@@ -725,7 +722,7 @@ private: | |||
class WASAPIOutputDevice : public WASAPIDeviceBase | |||
{ | |||
public: | |||
WASAPIOutputDevice (const ComSmartPtr <IMMDevice>& d, const bool exclusiveMode) | |||
WASAPIOutputDevice (const ComSmartPtr<IMMDevice>& d, const bool exclusiveMode) | |||
: WASAPIDeviceBase (d, exclusiveMode) | |||
{ | |||
} | |||
@@ -747,11 +744,11 @@ public: | |||
renderClient = nullptr; | |||
} | |||
template <class DestType> | |||
template<class DestType> | |||
void updateFormatWithType (DestType*) | |||
{ | |||
typedef AudioData::Pointer <AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const> NativeType; | |||
converter = new AudioData::ConverterInstance <NativeType, AudioData::Pointer <DestType, AudioData::LittleEndian, AudioData::Interleaved, AudioData::NonConst> > (1, actualNumChannels); | |||
typedef AudioData::Pointer<AudioData::Float32, AudioData::NativeEndian, AudioData::NonInterleaved, AudioData::Const> NativeType; | |||
converter = new AudioData::ConverterInstance<NativeType, AudioData::Pointer<DestType, AudioData::LittleEndian, AudioData::Interleaved, AudioData::NonConst> > (1, actualNumChannels); | |||
} | |||
void updateFormat (bool isFloat) | |||
@@ -801,8 +798,8 @@ public: | |||
} | |||
} | |||
ComSmartPtr <IAudioRenderClient> renderClient; | |||
ScopedPointer <AudioData::Converter> converter; | |||
ComSmartPtr<IAudioRenderClient> renderClient; | |||
ScopedPointer<AudioData::Converter> converter; | |||
private: | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WASAPIOutputDevice) | |||
@@ -839,7 +836,7 @@ public: | |||
bool initialise() | |||
{ | |||
latencyIn = latencyOut = 0; | |||
Array <double> ratesIn, ratesOut; | |||
Array<double> ratesIn, ratesOut; | |||
if (createDevices()) | |||
{ | |||
@@ -1087,7 +1084,7 @@ public: | |||
const ScopedLock sl (startStopLock); | |||
if (isStarted) | |||
callback->audioDeviceIOCallback (const_cast <const float**> (inputBuffers), numInputBuffers, | |||
callback->audioDeviceIOCallback (const_cast<const float**> (inputBuffers), numInputBuffers, | |||
outputBuffers, numOutputBuffers, bufferSize); | |||
else | |||
outs.clear(); | |||
@@ -1095,7 +1092,7 @@ public: | |||
if (outputDevice != nullptr) | |||
{ | |||
outputDevice->copyBuffers (const_cast <const float**> (outputBuffers), numOutputBuffers, bufferSize, *this); | |||
outputDevice->copyBuffers (const_cast<const float**> (outputBuffers), numOutputBuffers, bufferSize, *this); | |||
if (outputDevice->sampleRateHasChanged) | |||
{ | |||
@@ -1124,8 +1121,8 @@ private: | |||
double defaultSampleRate; | |||
int minBufferSize, defaultBufferSize; | |||
int latencyIn, latencyOut; | |||
Array <double> sampleRates; | |||
Array <int> bufferSizes; | |||
Array<double> sampleRates; | |||
Array<int> bufferSizes; | |||
// Active state... | |||
bool isOpen_, isStarted; | |||
@@ -1141,11 +1138,11 @@ private: | |||
//============================================================================== | |||
bool createDevices() | |||
{ | |||
ComSmartPtr <IMMDeviceEnumerator> enumerator; | |||
ComSmartPtr<IMMDeviceEnumerator> enumerator; | |||
if (! check (enumerator.CoCreateInstance (__uuidof (MMDeviceEnumerator)))) | |||
return false; | |||
ComSmartPtr <IMMDeviceCollection> deviceCollection; | |||
ComSmartPtr<IMMDeviceCollection> deviceCollection; | |||
if (! check (enumerator->EnumAudioEndpoints (eAll, DEVICE_STATE_ACTIVE, deviceCollection.resetAndGetPointerAddress()))) | |||
return false; | |||
@@ -1155,7 +1152,7 @@ private: | |||
for (UINT32 i = 0; i < numDevices; ++i) | |||
{ | |||
ComSmartPtr <IMMDevice> device; | |||
ComSmartPtr<IMMDevice> device; | |||
if (! check (deviceCollection->Item (i, device.resetAndGetPointerAddress()))) | |||
continue; | |||
@@ -1255,9 +1252,12 @@ public: | |||
int getIndexOfDevice (AudioIODevice* device, bool asInput) const | |||
{ | |||
jassert (hasScanned); // need to call scanForDevices() before doing this | |||
WASAPIAudioIODevice* const d = dynamic_cast <WASAPIAudioIODevice*> (device); | |||
return d == nullptr ? -1 : (asInput ? inputDeviceIds.indexOf (d->inputDeviceId) | |||
: outputDeviceIds.indexOf (d->outputDeviceId)); | |||
if (WASAPIAudioIODevice* const d = dynamic_cast<WASAPIAudioIODevice*> (device)) | |||
return asInput ? inputDeviceIds.indexOf (d->inputDeviceId) | |||
: outputDeviceIds.indexOf (d->outputDeviceId); | |||
return -1; | |||
} | |||
bool hasSeparateInputsAndOutputs() const { return true; } | |||
@@ -1301,7 +1301,7 @@ private: | |||
{ | |||
public: | |||
ChangeNotificationClient (WASAPIAudioIODeviceType& d) | |||
: ComBaseClassHelper <IMMNotificationClient> (0), device (d) {} | |||
: ComBaseClassHelper<IMMNotificationClient> (0), device (d) {} | |||
HRESULT STDMETHODCALLTYPE OnDeviceAdded (LPCWSTR) { return notify(); } | |||
HRESULT STDMETHODCALLTYPE OnDeviceRemoved (LPCWSTR) { return notify(); } | |||
@@ -1360,7 +1360,7 @@ private: | |||
const String defaultRenderer (getDefaultEndpoint (enumerator, false)); | |||
const String defaultCapture (getDefaultEndpoint (enumerator, true)); | |||
ComSmartPtr <IMMDeviceCollection> deviceCollection; | |||
ComSmartPtr<IMMDeviceCollection> deviceCollection; | |||
UINT32 numDevices = 0; | |||
if (! (check (enumerator->EnumAudioEndpoints (eAll, DEVICE_STATE_ACTIVE, deviceCollection.resetAndGetPointerAddress())) | |||
@@ -1369,7 +1369,7 @@ private: | |||
for (UINT32 i = 0; i < numDevices; ++i) | |||
{ | |||
ComSmartPtr <IMMDevice> device; | |||
ComSmartPtr<IMMDevice> device; | |||
if (! check (deviceCollection->Item (i, device.resetAndGetPointerAddress()))) | |||
continue; | |||
@@ -1381,7 +1381,7 @@ private: | |||
String name; | |||
{ | |||
ComSmartPtr <IPropertyStore> properties; | |||
ComSmartPtr<IPropertyStore> properties; | |||
if (! check (device->OpenPropertyStore (STGM_READ, properties.resetAndGetPointerAddress()))) | |||
continue; | |||
@@ -26,7 +26,6 @@ AudioSourcePlayer::AudioSourcePlayer() | |||
: source (nullptr), | |||
sampleRate (0), | |||
bufferSize (0), | |||
tempBuffer (2, 8), | |||
lastGain (1.0f), | |||
gain (1.0f) | |||
{ | |||
@@ -49,6 +49,7 @@ namespace FlacNamespace | |||
#pragma clang diagnostic push | |||
#pragma clang diagnostic ignored "-Wconversion" | |||
#pragma clang diagnostic ignored "-Wshadow" | |||
#pragma clang diagnostic ignored "-Wdeprecated-register" | |||
#endif | |||
#if JUCE_INTEL | |||
@@ -104,7 +105,6 @@ class FlacReader : public AudioFormatReader | |||
public: | |||
FlacReader (InputStream* const in) | |||
: AudioFormatReader (in, flacFormatName), | |||
reservoir (2, 0), | |||
reservoirStart (0), | |||
samplesInReservoir (0), | |||
scanningForLength (false) | |||
@@ -40,6 +40,7 @@ namespace OggVorbisNamespace | |||
#pragma clang diagnostic push | |||
#pragma clang diagnostic ignored "-Wconversion" | |||
#pragma clang diagnostic ignored "-Wshadow" | |||
#pragma clang diagnostic ignored "-Wdeprecated-register" | |||
#endif | |||
#include "oggvorbis/vorbisenc.h" | |||
@@ -106,7 +107,6 @@ class OggReader : public AudioFormatReader | |||
public: | |||
OggReader (InputStream* const inp) | |||
: AudioFormatReader (inp, oggFormatName), | |||
reservoir (2, 4096), | |||
reservoirStart (0), | |||
samplesInReservoir (0) | |||
{ | |||
@@ -140,8 +140,7 @@ public: | |||
bitsPerSample = 16; | |||
sampleRate = info->rate; | |||
reservoir.setSize ((int) numChannels, | |||
(int) jmin (lengthInSamples, (int64) reservoir.getNumSamples())); | |||
reservoir.setSize ((int) numChannels, (int) jmin (lengthInSamples, (int64) 4096)); | |||
} | |||
} | |||
@@ -1,7 +1,7 @@ | |||
{ | |||
"id": "juce_audio_formats", | |||
"name": "JUCE audio file format codecs", | |||
"version": "3.0.4", | |||
"version": "3.0.5", | |||
"description": "Classes for reading and writing various audio file formats.", | |||
"website": "http://www.juce.com/juce", | |||
"license": "GPL/Commercial", | |||
@@ -865,8 +865,12 @@ struct AAXClasses | |||
audioProcessor.isParameterAutomatable (parameterIndex)); | |||
parameter->AddShortenedName (audioProcessor.getParameterName (parameterIndex, 4).toRawUTF8()); | |||
parameter->SetNumberOfSteps ((uint32_t) audioProcessor.getParameterNumSteps (parameterIndex)); | |||
parameter->SetType (AAX_eParameterType_Continuous); | |||
const int parameterNumSteps = audioProcessor.getParameterNumSteps (parameterIndex); | |||
parameter->SetNumberOfSteps ((uint32_t) parameterNumSteps); | |||
parameter->SetType (parameterNumSteps > 1000 ? AAX_eParameterType_Continuous | |||
: AAX_eParameterType_Discrete); | |||
mParameterManager.AddParameter (parameter); | |||
} | |||
} | |||
@@ -42,6 +42,7 @@ | |||
#pragma clang diagnostic ignored "-Wdeprecated-declarations" | |||
#pragma clang diagnostic ignored "-Wsign-conversion" | |||
#pragma clang diagnostic ignored "-Wconversion" | |||
#pragma clang diagnostic ignored "-Woverloaded-virtual" | |||
#endif | |||
#include "../utility/juce_IncludeSystemHeaders.h" | |||
@@ -32,7 +32,7 @@ extern AudioProcessor* JUCE_CALLTYPE createPluginFilter(); | |||
A class that can be used to run a simple standalone application containing your filter. | |||
Just create one of these objects in your JUCEApplicationBase::initialise() method, and | |||
let it do its work. It will create your filter object using the same createFilter() function | |||
let it do its work. It will create your filter object using the same createPluginFilter() function | |||
that the other plugin wrappers use. | |||
*/ | |||
class StandaloneFilterWindow : public DocumentWindow, | |||
@@ -93,7 +93,7 @@ public: | |||
if (data.fromBase64Encoding (settings->getValue ("filterState")) | |||
&& data.getSize() > 0) | |||
{ | |||
filter->setStateInformation (data.getData(), data.getSize()); | |||
filter->setStateInformation (data.getData(), (int) data.getSize()); | |||
} | |||
} | |||
@@ -207,7 +207,7 @@ public: | |||
if (fc.getResult().loadFileAsData (data)) | |||
{ | |||
filter->setStateInformation (data.getData(), data.getSize()); | |||
filter->setStateInformation (data.getData(), (int) data.getSize()); | |||
} | |||
else | |||
{ | |||
@@ -63,8 +63,10 @@ | |||
#pragma clang diagnostic push | |||
#pragma clang diagnostic ignored "-Wconversion" | |||
#pragma clang diagnostic ignored "-Wshadow" | |||
#pragma clang diagnostic ignored "-Wdeprecated-register" | |||
#pragma clang diagnostic ignored "-Wunused-parameter" | |||
#pragma clang diagnostic ignored "-Wdeprecated-writable-strings" | |||
#pragma clang diagnostic ignored "-Wnon-virtual-dtor" | |||
#endif | |||
/* These files come with the Steinberg VST SDK - to get them, you'll need to | |||
@@ -85,6 +87,15 @@ | |||
#error "It looks like you're trying to include an out-of-date VSTSDK version - make sure you have at least version 2.4" | |||
#endif | |||
#ifndef JUCE_VST3_CAN_REPLACE_VST2 | |||
#define JUCE_VST3_CAN_REPLACE_VST2 1 | |||
#endif | |||
#if JucePlugin_Build_VST3 && JUCE_VST3_CAN_REPLACE_VST2 | |||
#include <pluginterfaces/base/funknown.h> | |||
namespace juce { extern Steinberg::FUID getJuceVST3ComponentIID(); } | |||
#endif | |||
#ifdef __clang__ | |||
#pragma clang diagnostic pop | |||
#endif | |||
@@ -398,6 +409,21 @@ public: | |||
return 0; | |||
} | |||
VstIntPtr vendorSpecific (VstInt32 lArg, VstIntPtr lArg2, void* ptrArg, float floatArg) override | |||
{ | |||
(void) lArg; (void) lArg2; (void) ptrArg; (void) floatArg; | |||
#if JucePlugin_Build_VST3 && JUCE_VST3_CAN_REPLACE_VST2 | |||
if ((lArg == 'stCA' || lArg == 'stCa') && lArg2 == 'FUID' && ptrArg != nullptr) | |||
{ | |||
memcpy (ptrArg, getJuceVST3ComponentIID(), 16); | |||
return 1; | |||
} | |||
#endif | |||
return 0; | |||
} | |||
bool getInputProperties (VstInt32 index, VstPinProperties* properties) | |||
{ | |||
if (filter == nullptr || index >= JucePlugin_MaxNumInputChannels) | |||
@@ -219,7 +219,7 @@ void detachComponentFromWindowRef (Component* comp, void* window, bool isNSView) | |||
} | |||
#endif | |||
(void) isNSView; | |||
(void) isNSView; (void) window; | |||
comp->removeFromDesktop(); | |||
} | |||
} | |||
@@ -55,6 +55,9 @@ | |||
#undef Point | |||
#undef Component | |||
namespace juce | |||
{ | |||
using namespace Steinberg; | |||
//============================================================================== | |||
@@ -75,15 +78,12 @@ private: | |||
}; | |||
//============================================================================== | |||
namespace juce | |||
{ | |||
#if JUCE_MAC | |||
extern void initialiseMac(); | |||
extern void* attachComponentToWindowRef (Component*, void* parent, bool isNSView); | |||
extern void detachComponentFromWindowRef (Component*, void* window, bool isNSView); | |||
extern void setNativeHostWindowSize (void* window, Component*, int newWidth, int newHeight, bool isNSView); | |||
#endif | |||
} | |||
#if JUCE_MAC | |||
extern void initialiseMac(); | |||
extern void* attachComponentToWindowRef (Component*, void* parent, bool isNSView); | |||
extern void detachComponentFromWindowRef (Component*, void* window, bool isNSView); | |||
extern void setNativeHostWindowSize (void* window, Component*, int newWidth, int newHeight, bool isNSView); | |||
#endif | |||
//============================================================================== | |||
class JuceAudioProcessor : public FUnknown | |||
@@ -109,14 +109,6 @@ private: | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JuceAudioProcessor) | |||
}; | |||
#define TEST_FOR_COMMON_BASE_AND_RETURN_IF_VALID(CommonClassType, SourceClassType) \ | |||
if (doUIDsMatch (iid, CommonClassType::iid)) \ | |||
{ \ | |||
addRef(); \ | |||
*obj = (CommonClassType*) static_cast<SourceClassType*> (this); \ | |||
return Steinberg::kResultOk; \ | |||
} | |||
//============================================================================== | |||
class JuceVST3EditController : public Vst::EditController, | |||
public Vst::IMidiMapping, | |||
@@ -135,19 +127,19 @@ public: | |||
//============================================================================== | |||
REFCOUNT_METHODS (ComponentBase) | |||
tresult PLUGIN_API queryInterface (const TUID iid, void** obj) override | |||
tresult PLUGIN_API queryInterface (const TUID targetIID, void** obj) override | |||
{ | |||
TEST_FOR_AND_RETURN_IF_VALID (FObject) | |||
TEST_FOR_AND_RETURN_IF_VALID (JuceVST3EditController) | |||
TEST_FOR_AND_RETURN_IF_VALID (Vst::IEditController) | |||
TEST_FOR_AND_RETURN_IF_VALID (Vst::IEditController2) | |||
TEST_FOR_AND_RETURN_IF_VALID (Vst::IConnectionPoint) | |||
TEST_FOR_AND_RETURN_IF_VALID (Vst::IMidiMapping) | |||
TEST_FOR_COMMON_BASE_AND_RETURN_IF_VALID (IPluginBase, Vst::IEditController) | |||
TEST_FOR_COMMON_BASE_AND_RETURN_IF_VALID (IDependent, Vst::IEditController) | |||
TEST_FOR_COMMON_BASE_AND_RETURN_IF_VALID (FUnknown, Vst::IEditController) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, FObject) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, JuceVST3EditController) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, Vst::IEditController) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, Vst::IEditController2) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, Vst::IConnectionPoint) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, Vst::IMidiMapping) | |||
TEST_FOR_COMMON_BASE_AND_RETURN_IF_VALID (targetIID, IPluginBase, Vst::IEditController) | |||
TEST_FOR_COMMON_BASE_AND_RETURN_IF_VALID (targetIID, IDependent, Vst::IEditController) | |||
TEST_FOR_COMMON_BASE_AND_RETURN_IF_VALID (targetIID, FUnknown, Vst::IEditController) | |||
if (doUIDsMatch (iid, JuceAudioProcessor::iid)) | |||
if (doUIDsMatch (targetIID, JuceAudioProcessor::iid)) | |||
{ | |||
audioProcessor->addRef(); | |||
*obj = audioProcessor; | |||
@@ -579,6 +571,8 @@ public: | |||
processSetup.processMode = Vst::kRealtime; | |||
processSetup.sampleRate = 44100.0; | |||
processSetup.symbolicSampleSize = Vst::kSample32; | |||
pluginInstance->setPlayHead (this); | |||
} | |||
~JuceVST3Component() | |||
@@ -601,17 +595,17 @@ public: | |||
JUCE_DECLARE_VST3_COM_REF_METHODS | |||
tresult PLUGIN_API queryInterface (const TUID iid, void** obj) override | |||
tresult PLUGIN_API queryInterface (const TUID targetIID, void** obj) override | |||
{ | |||
TEST_FOR_AND_RETURN_IF_VALID (IPluginBase) | |||
TEST_FOR_AND_RETURN_IF_VALID (JuceVST3Component) | |||
TEST_FOR_AND_RETURN_IF_VALID (Vst::IComponent) | |||
TEST_FOR_AND_RETURN_IF_VALID (Vst::IAudioProcessor) | |||
TEST_FOR_AND_RETURN_IF_VALID (Vst::IUnitInfo) | |||
TEST_FOR_AND_RETURN_IF_VALID (Vst::IConnectionPoint) | |||
TEST_FOR_COMMON_BASE_AND_RETURN_IF_VALID (FUnknown, Vst::IComponent) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, IPluginBase) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, JuceVST3Component) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, Vst::IComponent) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, Vst::IAudioProcessor) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, Vst::IUnitInfo) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, Vst::IConnectionPoint) | |||
TEST_FOR_COMMON_BASE_AND_RETURN_IF_VALID (targetIID, FUnknown, Vst::IComponent) | |||
if (doUIDsMatch (iid, JuceAudioProcessor::iid)) | |||
if (doUIDsMatch (targetIID, JuceAudioProcessor::iid)) | |||
{ | |||
comPluginInstance->addRef(); | |||
*obj = comPluginInstance; | |||
@@ -1086,6 +1080,9 @@ public: | |||
return kResultFalse; | |||
#endif | |||
preparePlugin (getPluginInstance().getSampleRate(), | |||
getPluginInstance().getBlockSize()); | |||
return kResultTrue; | |||
} | |||
@@ -1311,8 +1308,12 @@ private: | |||
void preparePlugin (double sampleRate, int bufferSize) | |||
{ | |||
getPluginInstance().setPlayConfigDetails (JucePlugin_MaxNumInputChannels, | |||
JucePlugin_MaxNumOutputChannels, | |||
Vst::BusInfo inputBusInfo, outputBusInfo; | |||
audioInputs.first()->getInfo (inputBusInfo); | |||
audioOutputs.first()->getInfo (outputBusInfo); | |||
getPluginInstance().setPlayConfigDetails (inputBusInfo.channelCount, | |||
outputBusInfo.channelCount, | |||
sampleRate, bufferSize); | |||
getPluginInstance().prepareToPlay (sampleRate, bufferSize); | |||
@@ -1322,6 +1323,11 @@ private: | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JuceVST3Component) | |||
}; | |||
#if JucePlugin_Build_VST3 && JUCE_VST3_CAN_REPLACE_VST2 | |||
Steinberg::FUID getJuceVST3ComponentIID(); | |||
Steinberg::FUID getJuceVST3ComponentIID() { return JuceVST3Component::iid; } | |||
#endif | |||
//============================================================================== | |||
#if JUCE_MSVC | |||
#pragma warning (push, 0) | |||
@@ -1447,7 +1453,7 @@ bool shutdownModule() | |||
{ | |||
if (--numBundleRefs == 0) | |||
{ | |||
for (size_t i = 0; i < bundleRefs.size(); ++i) | |||
for (int i = 0; i < bundleRefs.size(); ++i) | |||
CFRelease (bundleRefs.getUnchecked (i)); | |||
bundleRefs.clear(); | |||
@@ -1476,7 +1482,7 @@ static FUnknown* createControllerInstance (Vst::IHostApplication* host) | |||
//============================================================================== | |||
class JucePluginFactory; | |||
JucePluginFactory* globalFactory = nullptr; | |||
static JucePluginFactory* globalFactory = nullptr; | |||
//============================================================================== | |||
class JucePluginFactory : public IPluginFactory3 | |||
@@ -1522,12 +1528,12 @@ public: | |||
//============================================================================== | |||
JUCE_DECLARE_VST3_COM_REF_METHODS | |||
tresult PLUGIN_API queryInterface (const TUID iid, void** obj) override | |||
tresult PLUGIN_API queryInterface (const TUID targetIID, void** obj) override | |||
{ | |||
TEST_FOR_AND_RETURN_IF_VALID (IPluginFactory3) | |||
TEST_FOR_AND_RETURN_IF_VALID (IPluginFactory2) | |||
TEST_FOR_AND_RETURN_IF_VALID (IPluginFactory) | |||
TEST_FOR_AND_RETURN_IF_VALID (FUnknown) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, IPluginFactory3) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, IPluginFactory2) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, IPluginFactory) | |||
TEST_FOR_AND_RETURN_IF_VALID (targetIID, FUnknown) | |||
jassertfalse; // Something new? | |||
*obj = nullptr; | |||
@@ -1676,21 +1682,23 @@ private: | |||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JucePluginFactory) | |||
}; | |||
} // juce namespace | |||
//============================================================================== | |||
#ifndef JucePlugin_Vst3ComponentFlags | |||
#if JucePlugin_IsSynth | |||
#define JucePlugin_Vst3ComponentFlags Vst::kSimpleModeSupported | |||
#else | |||
#define JucePlugin_Vst3ComponentFlags 0 | |||
#endif | |||
#if JucePlugin_IsSynth | |||
#define JucePlugin_Vst3ComponentFlags Vst::kSimpleModeSupported | |||
#else | |||
#define JucePlugin_Vst3ComponentFlags 0 | |||
#endif | |||
#endif | |||
#ifndef JucePlugin_Vst3Category | |||
#if JucePlugin_IsSynth | |||
#define JucePlugin_Vst3Category Vst::PlugType::kInstrumentSynth | |||
#else | |||
#define JucePlugin_Vst3Category Vst::PlugType::kFx | |||
#endif | |||
#if JucePlugin_IsSynth | |||
#define JucePlugin_Vst3Category Vst::PlugType::kInstrumentSynth | |||
#else | |||
#define JucePlugin_Vst3Category Vst::PlugType::kFx | |||
#endif | |||
#endif | |||
//============================================================================== | |||
@@ -84,6 +84,7 @@ namespace juce | |||
JUCE_AUTORELEASEPOOL | |||
{ | |||
#if JUCE_64BIT | |||
(void) isHIView; | |||
NSView* parentView = (NSView*) windowRef; | |||
#if JucePlugin_EditorRequiresKeyboardFocus | |||
@@ -196,6 +197,7 @@ namespace juce | |||
static void detachComponentFromWindowRef (Component* comp, void* nsWindow, bool isHIView) | |||
{ | |||
#if JUCE_64BIT | |||
(void) nsWindow; (void) isHIView; | |||
comp->removeFromDesktop(); | |||
#else | |||
//treat NSView like 64bit | |||
@@ -242,25 +244,27 @@ namespace juce | |||
static void setNativeHostWindowSize (void* nsWindow, Component* component, int newWidth, int newHeight, bool isHIView) | |||
{ | |||
(void) nsWindow; (void) isHIView; | |||
JUCE_AUTORELEASEPOOL | |||
{ | |||
#if JUCE_64BIT | |||
component->setSize (newWidth, newHeight); | |||
#else | |||
if (! isHIView) | |||
{ //Treat NSView like 64bit: | |||
#if JUCE_64BIT | |||
component->setSize (newWidth, newHeight); | |||
} | |||
else if (HIViewRef dummyView = (HIViewRef) (void*) (pointer_sized_int) | |||
component->getProperties() ["dummyViewRef"].toString().getHexValue64()) | |||
{ | |||
HIRect frameRect; | |||
HIViewGetFrame (dummyView, &frameRect); | |||
frameRect.size.width = newWidth; | |||
frameRect.size.height = newHeight; | |||
HIViewSetFrame (dummyView, &frameRect); | |||
} | |||
#endif | |||
#else | |||
if (! isHIView) | |||
{ //Treat NSView like 64bit: | |||
component->setSize (newWidth, newHeight); | |||
} | |||
else if (HIViewRef dummyView = (HIViewRef) (void*) (pointer_sized_int) | |||
component->getProperties() ["dummyViewRef"].toString().getHexValue64()) | |||
{ | |||
HIRect frameRect; | |||
HIViewGetFrame (dummyView, &frameRect); | |||
frameRect.size.width = newWidth; | |||
frameRect.size.height = newHeight; | |||
HIViewSetFrame (dummyView, &frameRect); | |||
} | |||
#endif | |||
} | |||
} | |||
} // (juce namespace) | |||
@@ -1,7 +1,7 @@ | |||
{ | |||
"id": "juce_audio_plugin_client", | |||
"name": "JUCE audio plugin wrapper classes", | |||
"version": "3.0.4", | |||
"version": "3.0.5", | |||
"description": "Classes for building VST, VST3, RTAS, AAX and AU plugins.", | |||
"website": "http://www.juce.com/juce", | |||
"license": "GPL/Commercial", | |||
@@ -91,7 +91,8 @@ namespace | |||
{ | |||
MSG& msg = *(MSG*) lParam; | |||
if (nCode == HC_ACTION && offerKeyMessageToJUCEWindow (msg)) | |||
if (nCode == HC_ACTION && wParam == PM_REMOVE | |||
&& offerKeyMessageToJUCEWindow (msg)) | |||
{ | |||
zerostruct (msg); | |||
msg.message = WM_USER; | |||
@@ -523,14 +523,16 @@ public: | |||
for (int i = 0; i < numOutputBusses; ++i) | |||
{ | |||
AudioBufferList* const abl = getAudioBufferListForBus(i); | |||
abl->mNumberBuffers = numOutputBusChannels; | |||
for (int j = 0; j < numOutputBusChannels; ++j) | |||
if (AudioBufferList* const abl = getAudioBufferListForBus(i)) | |||
{ | |||
abl->mBuffers[j].mNumberChannels = 1; | |||
abl->mBuffers[j].mDataByteSize = sizeof (float) * numSamples; | |||
abl->mBuffers[j].mData = buffer.getWritePointer (i * numOutputBusChannels + j); | |||
abl->mNumberBuffers = numOutputBusChannels; | |||
for (int j = 0; j < numOutputBusChannels; ++j) | |||
{ | |||
abl->mBuffers[j].mNumberChannels = 1; | |||
abl->mBuffers[j].mDataByteSize = sizeof (float) * numSamples; | |||
abl->mBuffers[j].mData = buffer.getWritePointer (i * numOutputBusChannels + j); | |||
} | |||
} | |||
} | |||
@@ -43,16 +43,16 @@ static bool doUIDsMatch (const Steinberg::TUID a, const Steinberg::TUID b) noexc | |||
return std::memcmp (a, b, sizeof (Steinberg::TUID)) == 0; | |||
} | |||
#define TEST_FOR_AND_RETURN_IF_VALID(ClassType) \ | |||
if (doUIDsMatch (iid, ClassType::iid)) \ | |||
#define TEST_FOR_AND_RETURN_IF_VALID(iidToTest, ClassType) \ | |||
if (doUIDsMatch (iidToTest, ClassType::iid)) \ | |||
{ \ | |||
addRef(); \ | |||
*obj = dynamic_cast<ClassType*> (this); \ | |||
return Steinberg::kResultOk; \ | |||
} | |||
#define TEST_FOR_COMMON_BASE_AND_RETURN_IF_VALID(CommonClassType, SourceClassType) \ | |||
if (doUIDsMatch (iid, CommonClassType::iid)) \ | |||
#define TEST_FOR_COMMON_BASE_AND_RETURN_IF_VALID(iidToTest, CommonClassType, SourceClassType) \ | |||
if (doUIDsMatch (iidToTest, CommonClassType::iid)) \ | |||
{ \ | |||
addRef(); \ | |||
*obj = (CommonClassType*) static_cast<SourceClassType*> (this); \ | |||
@@ -43,6 +43,7 @@ | |||
#pragma clang diagnostic ignored "-Wconversion" | |||
#pragma clang diagnostic ignored "-Woverloaded-virtual" | |||
#pragma clang diagnostic ignored "-Wshadow" | |||
#pragma clang diagnostic ignored "-Wdeprecated-register" | |||
#endif | |||
/* These files come with the Steinberg VST3 SDK - to get them, you'll need to | |||
@@ -534,14 +534,14 @@ public: | |||
return kResultOk; | |||
} | |||
TEST_FOR_AND_RETURN_IF_VALID (Vst::IComponentHandler) | |||
TEST_FOR_AND_RETURN_IF_VALID (Vst::IComponentHandler2) | |||
TEST_FOR_AND_RETURN_IF_VALID (Vst::IComponentHandler3) | |||
TEST_FOR_AND_RETURN_IF_VALID (Vst::IContextMenuTarget) | |||
TEST_FOR_AND_RETURN_IF_VALID (Vst::IHostApplication) | |||
TEST_FOR_AND_RETURN_IF_VALID (Vst::IParamValueQueue) | |||
TEST_FOR_AND_RETURN_IF_VALID (Vst::IUnitHandler) | |||
TEST_FOR_COMMON_BASE_AND_RETURN_IF_VALID (FUnknown, Vst::IComponentHandler) | |||
TEST_FOR_AND_RETURN_IF_VALID (iid, Vst::IComponentHandler) | |||
TEST_FOR_AND_RETURN_IF_VALID (iid, Vst::IComponentHandler2) | |||
TEST_FOR_AND_RETURN_IF_VALID (iid, Vst::IComponentHandler3) | |||
TEST_FOR_AND_RETURN_IF_VALID (iid, Vst::IContextMenuTarget) | |||
TEST_FOR_AND_RETURN_IF_VALID (iid, Vst::IHostApplication) | |||
TEST_FOR_AND_RETURN_IF_VALID (iid, Vst::IParamValueQueue) | |||
TEST_FOR_AND_RETURN_IF_VALID (iid, Vst::IUnitHandler) | |||
TEST_FOR_COMMON_BASE_AND_RETURN_IF_VALID (iid, FUnknown, Vst::IComponentHandler) | |||
*obj = nullptr; | |||
return kNotImplemented; | |||
@@ -1,7 +1,7 @@ | |||
{ | |||
"id": "juce_audio_processors", | |||
"name": "JUCE audio plugin hosting classes", | |||
"version": "3.0.4", | |||
"version": "3.0.5", | |||
"description": "Classes for loading and playing VST, AU, or internally-generated audio processors.", | |||
"website": "http://www.juce.com/juce", | |||
"license": "GPL/Commercial", | |||
@@ -33,6 +33,10 @@ | |||
This derives from the AudioProcessor class, and adds some extra functionality | |||
that helps when wrapping dynamically loaded plugins. | |||
This class is not needed when writing plugins, and you should never need to derive | |||
your own sub-classes from it. The plugin hosting classes use it internally and will | |||
return AudioPluginInstance objects which wrap external plugins. | |||
@see AudioProcessor, AudioPluginFormat | |||
*/ | |||
class JUCE_API AudioPluginInstance : public AudioProcessor | |||
@@ -923,9 +923,7 @@ void AudioProcessorGraph::Node::setParentGraph (AudioProcessorGraph* const graph | |||
//============================================================================== | |||
AudioProcessorGraph::AudioProcessorGraph() | |||
: lastNodeId (0), | |||
renderingBuffers (1, 1), | |||
currentAudioInputBuffer (nullptr), | |||
currentAudioOutputBuffer (1, 1), | |||
currentMidiInputBuffer (nullptr) | |||
{ | |||
} | |||
@@ -1,7 +1,7 @@ | |||
{ | |||
"id": "juce_audio_utils", | |||
"name": "JUCE extra audio utility classes", | |||
"version": "3.0.4", | |||
"version": "3.0.5", | |||
"description": "Classes for audio-related GUI and miscellaneous tasks.", | |||
"website": "http://www.juce.com/juce", | |||
"license": "GPL/Commercial", | |||
@@ -28,8 +28,7 @@ AudioProcessorPlayer::AudioProcessorPlayer() | |||
blockSize (0), | |||
isPrepared (false), | |||
numInputChans (0), | |||
numOutputChans (0), | |||
tempBuffer (1, 1) | |||
numOutputChans (0) | |||
{ | |||
} | |||
@@ -117,7 +117,7 @@ public: | |||
HashFunctionType hashFunction = HashFunctionType()) | |||
: hashFunctionToUse (hashFunction), totalNumItems (0) | |||
{ | |||
slots.insertMultiple (0, nullptr, numberOfSlots); | |||
hashSlots.insertMultiple (0, nullptr, numberOfSlots); | |||
} | |||
/** Destructor. */ | |||
@@ -135,9 +135,9 @@ public: | |||
{ | |||
const ScopedLockType sl (getLock()); | |||
for (int i = slots.size(); --i >= 0;) | |||
for (int i = hashSlots.size(); --i >= 0;) | |||
{ | |||
HashEntry* h = slots.getUnchecked(i); | |||
HashEntry* h = hashSlots.getUnchecked(i); | |||
while (h != nullptr) | |||
{ | |||
@@ -145,7 +145,7 @@ public: | |||
h = h->nextEntry; | |||
} | |||
slots.set (i, nullptr); | |||
hashSlots.set (i, nullptr); | |||
} | |||
totalNumItems = 0; | |||
@@ -166,7 +166,7 @@ public: | |||
{ | |||
const ScopedLockType sl (getLock()); | |||
for (const HashEntry* entry = slots.getUnchecked (generateHashFor (keyToLookFor)); entry != nullptr; entry = entry->nextEntry) | |||
for (const HashEntry* entry = hashSlots.getUnchecked (generateHashFor (keyToLookFor)); entry != nullptr; entry = entry->nextEntry) | |||
if (entry->key == keyToLookFor) | |||
return entry->value; | |||
@@ -179,7 +179,7 @@ public: | |||
{ | |||
const ScopedLockType sl (getLock()); | |||
for (const HashEntry* entry = slots.getUnchecked (generateHashFor (keyToLookFor)); entry != nullptr; entry = entry->nextEntry) | |||
for (const HashEntry* entry = hashSlots.getUnchecked (generateHashFor (keyToLookFor)); entry != nullptr; entry = entry->nextEntry) | |||
if (entry->key == keyToLookFor) | |||
return true; | |||
@@ -192,7 +192,7 @@ public: | |||
const ScopedLockType sl (getLock()); | |||
for (int i = getNumSlots(); --i >= 0;) | |||
for (const HashEntry* entry = slots.getUnchecked(i); entry != nullptr; entry = entry->nextEntry) | |||
for (const HashEntry* entry = hashSlots.getUnchecked(i); entry != nullptr; entry = entry->nextEntry) | |||
if (entry->value == valueToLookFor) | |||
return true; | |||
@@ -209,7 +209,7 @@ public: | |||
const ScopedLockType sl (getLock()); | |||
const int hashIndex = generateHashFor (newKey); | |||
HashEntry* const firstEntry = slots.getUnchecked (hashIndex); | |||
HashEntry* const firstEntry = hashSlots.getUnchecked (hashIndex); | |||
for (HashEntry* entry = firstEntry; entry != nullptr; entry = entry->nextEntry) | |||
{ | |||
@@ -220,7 +220,7 @@ public: | |||
} | |||
} | |||
slots.set (hashIndex, new HashEntry (newKey, newValue, firstEntry)); | |||
hashSlots.set (hashIndex, new HashEntry (newKey, newValue, firstEntry)); | |||
++totalNumItems; | |||
if (totalNumItems > (getNumSlots() * 3) / 2) | |||
@@ -232,7 +232,7 @@ public: | |||
{ | |||
const ScopedLockType sl (getLock()); | |||
const int hashIndex = generateHashFor (keyToRemove); | |||
HashEntry* entry = slots.getUnchecked (hashIndex); | |||
HashEntry* entry = hashSlots.getUnchecked (hashIndex); | |||
HashEntry* previous = nullptr; | |||
while (entry != nullptr) | |||
@@ -246,7 +246,7 @@ public: | |||
if (previous != nullptr) | |||
previous->nextEntry = entry; | |||
else | |||
slots.set (hashIndex, entry); | |||
hashSlots.set (hashIndex, entry); | |||
--totalNumItems; | |||
} | |||
@@ -265,7 +265,7 @@ public: | |||
for (int i = getNumSlots(); --i >= 0;) | |||
{ | |||
HashEntry* entry = slots.getUnchecked(i); | |||
HashEntry* entry = hashSlots.getUnchecked(i); | |||
HashEntry* previous = nullptr; | |||
while (entry != nullptr) | |||
@@ -279,7 +279,7 @@ public: | |||
if (previous != nullptr) | |||
previous->nextEntry = entry; | |||
else | |||
slots.set (i, entry); | |||
hashSlots.set (i, entry); | |||
--totalNumItems; | |||
} | |||
@@ -301,7 +301,7 @@ public: | |||
HashMap newTable (newNumberOfSlots); | |||
for (int i = getNumSlots(); --i >= 0;) | |||
for (const HashEntry* entry = slots.getUnchecked(i); entry != nullptr; entry = entry->nextEntry) | |||
for (const HashEntry* entry = hashSlots.getUnchecked(i); entry != nullptr; entry = entry->nextEntry) | |||
newTable.set (entry->key, entry->value); | |||
swapWith (newTable); | |||
@@ -313,7 +313,7 @@ public: | |||
*/ | |||
inline int getNumSlots() const noexcept | |||
{ | |||
return slots.size(); | |||
return hashSlots.size(); | |||
} | |||
//============================================================================== | |||
@@ -324,7 +324,7 @@ public: | |||
const ScopedLockType lock1 (getLock()); | |||
const typename OtherHashMapType::ScopedLockType lock2 (otherHashMap.getLock()); | |||
slots.swapWith (otherHashMap.slots); | |||
hashSlots.swapWith (otherHashMap.hashSlots); | |||
std::swap (totalNumItems, otherHashMap.totalNumItems); | |||
} | |||
@@ -400,7 +400,7 @@ public: | |||
if (index >= hashMap.getNumSlots()) | |||
return false; | |||
entry = hashMap.slots.getUnchecked (index++); | |||
entry = hashMap.hashSlots.getUnchecked (index++); | |||
} | |||
return true; | |||
@@ -437,7 +437,7 @@ private: | |||
friend class Iterator; | |||
HashFunctionType hashFunctionToUse; | |||
Array <HashEntry*> slots; | |||
Array<HashEntry*> hashSlots; | |||
int totalNumItems; | |||
TypeOfCriticalSectionToUse lock; | |||
@@ -355,7 +355,7 @@ File File::getChildFile (StringRef relativePath) const | |||
if (isAbsolutePath (relativePath)) | |||
return File (String (relativePath.text)); | |||
if (relativePath.text[0] != '.') | |||
if (relativePath[0] != '.') | |||
return File (addTrailingSeparator (fullPath) + relativePath); | |||
String path (fullPath); | |||
@@ -368,11 +368,11 @@ File File::getChildFile (StringRef relativePath) const | |||
while (relativePath[0] == '.') | |||
{ | |||
const juce_wchar secondChar = relativePath.text[1]; | |||
const juce_wchar secondChar = relativePath[1]; | |||
if (secondChar == '.') | |||
{ | |||
const juce_wchar thirdChar = relativePath.text[2]; | |||
const juce_wchar thirdChar = relativePath[2]; | |||
if (thirdChar == 0 || thirdChar == separator) | |||
{ | |||
@@ -1,7 +1,7 @@ | |||
{ | |||
"id": "juce_core", | |||
"name": "JUCE core classes", | |||
"version": "3.0.4", | |||
"version": "3.0.5", | |||
"description": "The essential set of basic JUCE classes, as required by all the other JUCE modules. Includes text, container, memory, threading and i/o functionality.", | |||
"website": "http://www.juce.com/juce", | |||
"license": "ISC Permissive", | |||
@@ -35,7 +35,7 @@ | |||
Contains some static helper functions for manipulating the MS Windows registry | |||
(Only available on Windows, of course!) | |||
*/ | |||
class WindowsRegistry | |||
class JUCE_API WindowsRegistry | |||
{ | |||
public: | |||
/** These values can be used to specify whether the 32- or 64-bit registry should be used. | |||
@@ -59,48 +59,48 @@ public: | |||
The path is a string for the entire path of a value in the registry, | |||
e.g. "HKEY_CURRENT_USER\Software\foo\bar" | |||
*/ | |||
static String getValue (const String& regValuePath, | |||
const String& defaultValue = String::empty, | |||
WoW64Mode mode = WoW64_Default); | |||
static String JUCE_CALLTYPE getValue (const String& regValuePath, | |||
const String& defaultValue = String::empty, | |||
WoW64Mode mode = WoW64_Default); | |||
/** Reads a binary block from the registry. | |||
The path is a string for the entire path of a value in the registry, | |||
e.g. "HKEY_CURRENT_USER\Software\foo\bar" | |||
@returns a DWORD indicating the type of the key. | |||
*/ | |||
static uint32 getBinaryValue (const String& regValuePath, MemoryBlock& resultData, WoW64Mode mode = WoW64_Default); | |||
static uint32 JUCE_CALLTYPE getBinaryValue (const String& regValuePath, MemoryBlock& resultData, WoW64Mode mode = WoW64_Default); | |||
/** Sets a registry value as a string. | |||
This will take care of creating any groups needed to get to the given registry value. | |||
*/ | |||
static bool setValue (const String& regValuePath, const String& value, WoW64Mode mode = WoW64_Default); | |||
static bool JUCE_CALLTYPE setValue (const String& regValuePath, const String& value, WoW64Mode mode = WoW64_Default); | |||
/** Sets a registry value as a DWORD. | |||
This will take care of creating any groups needed to get to the given registry value. | |||
*/ | |||
static bool setValue (const String& regValuePath, uint32 value, WoW64Mode mode = WoW64_Default); | |||
static bool JUCE_CALLTYPE setValue (const String& regValuePath, uint32 value, WoW64Mode mode = WoW64_Default); | |||
/** Sets a registry value as a QWORD. | |||
This will take care of creating any groups needed to get to the given registry value. | |||
*/ | |||
static bool setValue (const String& regValuePath, uint64 value, WoW64Mode mode = WoW64_Default); | |||
static bool JUCE_CALLTYPE setValue (const String& regValuePath, uint64 value, WoW64Mode mode = WoW64_Default); | |||
/** Sets a registry value as a binary block. | |||
This will take care of creating any groups needed to get to the given registry value. | |||
*/ | |||
static bool setValue (const String& regValuePath, const MemoryBlock& value, WoW64Mode mode = WoW64_Default); | |||
static bool JUCE_CALLTYPE setValue (const String& regValuePath, const MemoryBlock& value, WoW64Mode mode = WoW64_Default); | |||
/** Returns true if the given value exists in the registry. */ | |||
static bool valueExists (const String& regValuePath, WoW64Mode mode = WoW64_Default); | |||
static bool JUCE_CALLTYPE valueExists (const String& regValuePath, WoW64Mode mode = WoW64_Default); | |||
/** Returns true if the given key exists in the registry. */ | |||
static bool keyExists (const String& regValuePath, WoW64Mode mode = WoW64_Default); | |||
static bool JUCE_CALLTYPE keyExists (const String& regValuePath, WoW64Mode mode = WoW64_Default); | |||
/** Deletes a registry value. */ | |||
static void deleteValue (const String& regValuePath, WoW64Mode mode = WoW64_Default); | |||
static void JUCE_CALLTYPE deleteValue (const String& regValuePath, WoW64Mode mode = WoW64_Default); | |||
/** Deletes a registry key (which is registry-talk for 'folder'). */ | |||
static void deleteKey (const String& regKeyPath, WoW64Mode mode = WoW64_Default); | |||
static void JUCE_CALLTYPE deleteKey (const String& regKeyPath, WoW64Mode mode = WoW64_Default); | |||
/** Creates a file association in the registry. | |||
@@ -119,13 +119,13 @@ public: | |||
association in HKEY_CURRENT_USER. | |||
@param mode the WoW64 mode to use for choosing the database | |||
*/ | |||
static bool registerFileAssociation (const String& fileExtension, | |||
const String& symbolicDescription, | |||
const String& fullDescription, | |||
const File& targetExecutable, | |||
int iconResourceNumber, | |||
bool registerForCurrentUserOnly, | |||
WoW64Mode mode = WoW64_Default); | |||
static bool JUCE_CALLTYPE registerFileAssociation (const String& fileExtension, | |||
const String& symbolicDescription, | |||
const String& fullDescription, | |||
const File& targetExecutable, | |||
int iconResourceNumber, | |||
bool registerForCurrentUserOnly, | |||
WoW64Mode mode = WoW64_Default); | |||
// DEPRECATED: use the other methods with a WoW64Mode parameter of WoW64_64bit instead. | |||
JUCE_DEPRECATED (static String getValueWow64 (const String&, const String& defaultValue = String::empty)); | |||
@@ -42,11 +42,6 @@ String SystemStats::getOperatingSystemName() | |||
return "Linux"; | |||
} | |||
String SystemStats::getDeviceDescription() | |||
{ | |||
return String(); | |||
} | |||
bool SystemStats::isOperatingSystem64Bit() | |||
{ | |||
#if JUCE_64BIT | |||
@@ -66,16 +61,26 @@ namespace LinuxStatsHelpers | |||
File ("/proc/cpuinfo").readLines (lines); | |||
for (int i = lines.size(); --i >= 0;) // (NB - it's important that this runs in reverse order) | |||
if (lines[i].startsWithIgnoreCase (key)) | |||
if (lines[i].upToFirstOccurrenceOf (":", false, false).trim().equalsIgnoreCase (key)) | |||
return lines[i].fromFirstOccurrenceOf (":", false, false).trim(); | |||
return String(); | |||
} | |||
} | |||
String SystemStats::getDeviceDescription() | |||
{ | |||
return LinuxStatsHelpers::getCpuInfo ("Hardware"); | |||
} | |||
String SystemStats::getCpuVendor() | |||
{ | |||
return LinuxStatsHelpers::getCpuInfo ("vendor_id"); | |||
String v (LinuxStatsHelpers::getCpuInfo ("vendor_id")); | |||
if (v.isEmpty()) | |||
v = LinuxStatsHelpers::getCpuInfo ("model name"); | |||
return v; | |||
} | |||
int SystemStats::getCpuSpeedInMegaherz() | |||
@@ -270,7 +270,7 @@ private: | |||
addMethod (@selector (connection:didReceiveResponse:), didReceiveResponse, "v@:@@"); | |||
addMethod (@selector (connection:didFailWithError:), didFailWithError, "v@:@@"); | |||
addMethod (@selector (connection:didReceiveData:), didReceiveData, "v@:@@"); | |||
addMethod (@selector (connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:totalBytesExpectedToWrite:), | |||
addMethod (@selector (connection:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:), | |||
connectionDidSendBodyData, "v@:@iii"); | |||
addMethod (@selector (connectionDidFinishLoading:), connectionDidFinishLoading, "v@:@"); | |||
addMethod (@selector (connection:willSendRequest:redirectResponse:), willSendRequest, "@@:@@"); | |||
@@ -31,13 +31,17 @@ | |||
live in juce_posix_SharedCode.h! | |||
*/ | |||
#if JUCE_IOS | |||
bool isIOSAppActive = true; | |||
#endif | |||
//============================================================================== | |||
JUCE_API bool JUCE_CALLTYPE Process::isForegroundProcess() | |||
{ | |||
#if JUCE_MAC | |||
return [NSApp isActive]; | |||
#else | |||
return true; // xxx change this if more than one app is ever possible on iOS! | |||
return isIOSAppActive; | |||
#endif | |||
} | |||
@@ -144,48 +144,48 @@ struct RegistryKeyWrapper | |||
JUCE_DECLARE_NON_COPYABLE (RegistryKeyWrapper) | |||
}; | |||
uint32 WindowsRegistry::getBinaryValue (const String& regValuePath, MemoryBlock& result, WoW64Mode mode) | |||
uint32 JUCE_CALLTYPE WindowsRegistry::getBinaryValue (const String& regValuePath, MemoryBlock& result, WoW64Mode mode) | |||
{ | |||
return RegistryKeyWrapper::getBinaryValue (regValuePath, result, (DWORD) mode); | |||
} | |||
String WindowsRegistry::getValue (const String& regValuePath, const String& defaultValue, WoW64Mode mode) | |||
String JUCE_CALLTYPE WindowsRegistry::getValue (const String& regValuePath, const String& defaultValue, WoW64Mode mode) | |||
{ | |||
return RegistryKeyWrapper::getValue (regValuePath, defaultValue, (DWORD) mode); | |||
} | |||
bool WindowsRegistry::setValue (const String& regValuePath, const String& value, WoW64Mode mode) | |||
bool JUCE_CALLTYPE WindowsRegistry::setValue (const String& regValuePath, const String& value, WoW64Mode mode) | |||
{ | |||
return RegistryKeyWrapper::setValue (regValuePath, REG_SZ, value.toWideCharPointer(), | |||
CharPointer_UTF16::getBytesRequiredFor (value.getCharPointer()), mode); | |||
} | |||
bool WindowsRegistry::setValue (const String& regValuePath, const uint32 value, WoW64Mode mode) | |||
bool JUCE_CALLTYPE WindowsRegistry::setValue (const String& regValuePath, const uint32 value, WoW64Mode mode) | |||
{ | |||
return RegistryKeyWrapper::setValue (regValuePath, REG_DWORD, &value, sizeof (value), (DWORD) mode); | |||
} | |||
bool WindowsRegistry::setValue (const String& regValuePath, const uint64 value, WoW64Mode mode) | |||
bool JUCE_CALLTYPE WindowsRegistry::setValue (const String& regValuePath, const uint64 value, WoW64Mode mode) | |||
{ | |||
return RegistryKeyWrapper::setValue (regValuePath, REG_QWORD, &value, sizeof (value), (DWORD) mode); | |||
} | |||
bool WindowsRegistry::setValue (const String& regValuePath, const MemoryBlock& value, WoW64Mode mode) | |||
bool JUCE_CALLTYPE WindowsRegistry::setValue (const String& regValuePath, const MemoryBlock& value, WoW64Mode mode) | |||
{ | |||
return RegistryKeyWrapper::setValue (regValuePath, REG_BINARY, value.getData(), value.getSize(), (DWORD) mode); | |||
} | |||
bool WindowsRegistry::valueExists (const String& regValuePath, WoW64Mode mode) | |||
bool JUCE_CALLTYPE WindowsRegistry::valueExists (const String& regValuePath, WoW64Mode mode) | |||
{ | |||
return RegistryKeyWrapper::valueExists (regValuePath, (DWORD) mode); | |||
} | |||
bool WindowsRegistry::keyExists (const String& regValuePath, WoW64Mode mode) | |||
bool JUCE_CALLTYPE WindowsRegistry::keyExists (const String& regValuePath, WoW64Mode mode) | |||
{ | |||
return RegistryKeyWrapper::keyExists (regValuePath, (DWORD) mode); | |||
} | |||
void WindowsRegistry::deleteValue (const String& regValuePath, WoW64Mode mode) | |||
void JUCE_CALLTYPE WindowsRegistry::deleteValue (const String& regValuePath, WoW64Mode mode) | |||
{ | |||
const RegistryKeyWrapper key (regValuePath, true, (DWORD) mode); | |||
@@ -193,7 +193,7 @@ void WindowsRegistry::deleteValue (const String& regValuePath, WoW64Mode mode) | |||
RegDeleteValue (key.key, key.wideCharValueName); | |||
} | |||
void WindowsRegistry::deleteKey (const String& regKeyPath, WoW64Mode mode) | |||
void JUCE_CALLTYPE WindowsRegistry::deleteKey (const String& regKeyPath, WoW64Mode mode) | |||
{ | |||
const RegistryKeyWrapper key (regKeyPath, true, (DWORD) mode); | |||
@@ -201,13 +201,13 @@ void WindowsRegistry::deleteKey (const String& regKeyPath, WoW64Mode mode) | |||
RegDeleteKey (key.key, key.wideCharValueName); | |||
} | |||
bool WindowsRegistry::registerFileAssociation (const String& fileExtension, | |||
const String& symbolicDescription, | |||
const String& fullDescription, | |||
const File& targetExecutable, | |||
const int iconResourceNumber, | |||
const bool registerForCurrentUserOnly, | |||
WoW64Mode mode) | |||
bool JUCE_CALLTYPE WindowsRegistry::registerFileAssociation (const String& fileExtension, | |||
const String& symbolicDescription, | |||
const String& fullDescription, | |||
const File& targetExecutable, | |||
const int iconResourceNumber, | |||
const bool registerForCurrentUserOnly, | |||
WoW64Mode mode) | |||
{ | |||
const char* const root = registerForCurrentUserOnly ? "HKEY_CURRENT_USER\\Software\\Classes\\" | |||
: "HKEY_CLASSES_ROOT\\"; | |||
@@ -555,7 +555,13 @@ bool ChildProcess::start (const String& command, int streamFlags) | |||
bool ChildProcess::start (const StringArray& args, int streamFlags) | |||
{ | |||
return start (args.joinIntoString (" "), streamFlags); | |||