Browse Source

Update juce

tags/2018-04-16
falkTX 10 years ago
parent
commit
3f05eae6f4
72 changed files with 896 additions and 674 deletions
  1. +1
    -1
      libs/juce/source/modules/juce_audio_basics/juce_module_info
  2. +31
    -1
      libs/juce/source/modules/juce_audio_basics/midi/juce_MidiMessage.cpp
  3. +7
    -43
      libs/juce/source/modules/juce_audio_basics/midi/juce_MidiMessage.h
  4. +1
    -1
      libs/juce/source/modules/juce_audio_basics/sources/juce_AudioSource.h
  5. +105
    -84
      libs/juce/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp
  6. +19
    -12
      libs/juce/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h
  7. +1
    -1
      libs/juce/source/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h
  8. +1
    -1
      libs/juce/source/modules/juce_audio_devices/juce_module_info
  9. +17
    -5
      libs/juce/source/modules/juce_audio_devices/native/juce_MidiDataConcatenator.h
  10. +3
    -7
      libs/juce/source/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp
  11. +7
    -1
      libs/juce/source/modules/juce_audio_devices/native/juce_win32_Midi.cpp
  12. +1
    -1
      libs/juce/source/modules/juce_audio_formats/format/juce_AudioSubsectionReader.h
  13. +1
    -1
      libs/juce/source/modules/juce_audio_formats/juce_module_info
  14. +42
    -4
      libs/juce/source/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp
  15. +24
    -35
      libs/juce/source/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp
  16. +1
    -1
      libs/juce/source/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h
  17. +53
    -57
      libs/juce/source/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
  18. +1
    -1
      libs/juce/source/modules/juce_audio_plugin_client/juce_module_info
  19. +15
    -58
      libs/juce/source/modules/juce_audio_processors/format_types/juce_VST3Common.h
  20. +26
    -25
      libs/juce/source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp
  21. +10
    -7
      libs/juce/source/modules/juce_audio_processors/juce_audio_processors.cpp
  22. +1
    -1
      libs/juce/source/modules/juce_audio_processors/juce_module_info
  23. +1
    -1
      libs/juce/source/modules/juce_audio_processors/processors/juce_PluginDescription.h
  24. +1
    -1
      libs/juce/source/modules/juce_audio_utils/juce_module_info
  25. +2
    -2
      libs/juce/source/modules/juce_core/containers/juce_NamedValueSet.h
  26. +1
    -1
      libs/juce/source/modules/juce_core/juce_core.cpp
  27. +1
    -1
      libs/juce/source/modules/juce_core/juce_core.h
  28. +1
    -1
      libs/juce/source/modules/juce_core/juce_module_info
  29. +39
    -15
      libs/juce/source/modules/juce_core/native/java/JuceAppActivity.java
  30. +45
    -37
      libs/juce/source/modules/juce_core/native/juce_android_JNIHelpers.h
  31. +13
    -11
      libs/juce/source/modules/juce_core/native/juce_android_Network.cpp
  32. +18
    -27
      libs/juce/source/modules/juce_core/native/juce_linux_Network.cpp
  33. +12
    -13
      libs/juce/source/modules/juce_core/native/juce_mac_Network.mm
  34. +5
    -0
      libs/juce/source/modules/juce_core/native/juce_posix_SharedCode.h
  35. +30
    -30
      libs/juce/source/modules/juce_core/native/juce_win32_Network.cpp
  36. +32
    -37
      libs/juce/source/modules/juce_core/native/juce_win32_SystemStats.cpp
  37. +18
    -4
      libs/juce/source/modules/juce_core/network/juce_URL.cpp
  38. +17
    -7
      libs/juce/source/modules/juce_core/network/juce_URL.h
  39. +1
    -1
      libs/juce/source/modules/juce_core/streams/juce_OutputStream.h
  40. +1
    -1
      libs/juce/source/modules/juce_core/system/juce_StandardHeader.h
  41. +51
    -40
      libs/juce/source/modules/juce_core/threads/juce_CriticalSection.h
  42. +1
    -1
      libs/juce/source/modules/juce_data_structures/app_properties/juce_PropertiesFile.h
  43. +1
    -1
      libs/juce/source/modules/juce_data_structures/juce_module_info
  44. +1
    -1
      libs/juce/source/modules/juce_events/broadcasters/juce_ActionBroadcaster.h
  45. +1
    -4
      libs/juce/source/modules/juce_events/broadcasters/juce_ActionListener.h
  46. +1
    -1
      libs/juce/source/modules/juce_events/juce_module_info
  47. +1
    -1
      libs/juce/source/modules/juce_events/messages/juce_NotificationType.h
  48. +9
    -8
      libs/juce/source/modules/juce_graphics/geometry/juce_Point.h
  49. +10
    -0
      libs/juce/source/modules/juce_graphics/geometry/juce_Rectangle.h
  50. +14
    -1
      libs/juce/source/modules/juce_graphics/images/juce_Image.cpp
  51. +13
    -0
      libs/juce/source/modules/juce_graphics/images/juce_Image.h
  52. +1
    -1
      libs/juce/source/modules/juce_graphics/juce_module_info
  53. +5
    -1
      libs/juce/source/modules/juce_graphics/native/juce_mac_CoreGraphicsContext.mm
  54. +5
    -0
      libs/juce/source/modules/juce_graphics/native/juce_mac_Fonts.mm
  55. +1
    -1
      libs/juce/source/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.h
  56. +1
    -1
      libs/juce/source/modules/juce_gui_basics/commands/juce_KeyPressMappingSet.h
  57. +2
    -2
      libs/juce/source/modules/juce_gui_basics/components/juce_Component.h
  58. +1
    -1
      libs/juce/source/modules/juce_gui_basics/juce_module_info
  59. +10
    -9
      libs/juce/source/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp
  60. +5
    -1
      libs/juce/source/modules/juce_gui_basics/native/juce_linux_Windowing.cpp
  61. +30
    -14
      libs/juce/source/modules/juce_gui_basics/native/juce_win32_Windowing.cpp
  62. +16
    -0
      libs/juce/source/modules/juce_gui_basics/properties/juce_PropertyComponent.h
  63. +15
    -7
      libs/juce/source/modules/juce_gui_basics/widgets/juce_Slider.cpp
  64. +18
    -6
      libs/juce/source/modules/juce_gui_basics/widgets/juce_Slider.h
  65. +6
    -5
      libs/juce/source/modules/juce_gui_basics/widgets/juce_TreeView.cpp
  66. +1
    -1
      libs/juce/source/modules/juce_gui_basics/widgets/juce_TreeView.h
  67. +9
    -4
      libs/juce/source/modules/juce_gui_basics/windows/juce_CallOutBox.cpp
  68. +5
    -0
      libs/juce/source/modules/juce_gui_basics/windows/juce_CallOutBox.h
  69. +1
    -1
      libs/juce/source/modules/juce_gui_basics/windows/juce_ComponentPeer.h
  70. +33
    -21
      libs/juce/source/modules/juce_gui_basics/windows/juce_ThreadWithProgressWindow.cpp
  71. +21
    -1
      libs/juce/source/modules/juce_gui_basics/windows/juce_ThreadWithProgressWindow.h
  72. +1
    -1
      libs/juce/source/modules/juce_gui_extra/juce_module_info

+ 1
- 1
libs/juce/source/modules/juce_audio_basics/juce_module_info View File

@@ -1,7 +1,7 @@
{
"id": "juce_audio_basics",
"name": "JUCE audio and midi data classes",
"version": "3.0.2",
"version": "3.0.4",
"description": "Classes for audio buffer manipulation, midi message handling, synthesis, etc",
"website": "http://www.juce.com/juce",
"license": "GPL/Commercial",


+ 31
- 1
libs/juce/source/modules/juce_audio_basics/midi/juce_MidiMessage.cpp View File

@@ -155,7 +155,7 @@ MidiMessage::MidiMessage (const MidiMessage& other, const double newTimeStamp)
MidiMessage::MidiMessage (const void* srcData, int sz, int& numBytesUsed, const uint8 lastStatusByte, double t)
: timeStamp (t)
{
const uint8* src = static_cast <const uint8*> (srcData);
const uint8* src = static_cast<const uint8*> (srcData);
unsigned int byte = (unsigned int) *src;
if (byte < 0x80)
@@ -658,6 +658,36 @@ String MidiMessage::getTextFromTextMetaEvent() const
CharPointer_UTF8 (textData + getMetaEventLength()));
}
MidiMessage MidiMessage::textMetaEvent (int type, StringRef text)
{
jassert (type > 0 && type < 16)
MidiMessage result;
const size_t textSize = text.text.sizeInBytes() - 1;
uint8 header[8];
size_t n = sizeof (header);
header[--n] = (uint8) (textSize & 0x7f);
for (size_t i = textSize; (i >>= 7) != 0;)
header[--n] = (uint8) ((i & 0x7f) | 0x80);
header[--n] = (uint8) type;
header[--n] = 0xff;
const size_t headerLen = sizeof (header) - n;
uint8* const dest = result.allocateSpace ((int) (headerLen + textSize));
result.size = (int) (headerLen + textSize);
memcpy (dest, header + n, headerLen);
memcpy (dest + headerLen, text.text.getAddress(), textSize);
return result;
}
bool MidiMessage::isTrackNameEvent() const noexcept { const uint8* data = getRawData(); return (data[1] == 3) && (*data == 0xff); }
bool MidiMessage::isTempoMetaEvent() const noexcept { const uint8* data = getRawData(); return (data[1] == 81) && (*data == 0xff); }
bool MidiMessage::isMidiChannelMetaEvent() const noexcept { const uint8* data = getRawData(); return (data[1] == 0x20) && (*data == 0xff) && (data[2] == 1); }


+ 7
- 43
libs/juce/source/modules/juce_audio_basics/midi/juce_MidiMessage.h View File

@@ -168,9 +168,7 @@ public:
bool isForChannel (int channelNumber) const noexcept;
/** Changes the message's midi channel.
This won't do anything for non-channel messages like sysexes.
@param newChannelNumber the channel number to change it to, in the range 1 to 16
*/
void setChannel (int newChannelNumber) noexcept;
@@ -181,17 +179,13 @@ public:
bool isSysEx() const noexcept;
/** Returns a pointer to the sysex data inside the message.
If this event isn't a sysex event, it'll return 0.
@see getSysExDataSize
*/
const uint8* getSysExData() const noexcept;
/** Returns the size of the sysex data.
This value excludes the 0xf0 header byte and the 0xf7 at the end.
@see getSysExData
*/
int getSysExDataSize() const noexcept;
@@ -252,15 +246,12 @@ public:
bool isNoteOnOrOff() const noexcept;
/** Returns the midi note number for note-on and note-off messages.
If the message isn't a note-on or off, the value returned is undefined.
@see isNoteOff, getMidiNoteName, getMidiNoteInHertz, setNoteNumber
*/
int getNoteNumber() const noexcept;
/** Changes the midi note number of a note-on or note-off message.
If the message isn't a note on or off, this will do nothing.
*/
void setNoteNumber (int newNoteNumber) noexcept;
@@ -320,16 +311,12 @@ public:
//==============================================================================
/** Returns true if the message is a program (patch) change message.
@see getProgramChangeNumber, getGMInstrumentName
*/
bool isProgramChange() const noexcept;
/** Returns the new program number of a program change message.
If the message isn't a program change, the value returned will be
nonsense.
If the message isn't a program change, the value returned is undefined.
@see isProgramChange, getGMInstrumentName
*/
int getProgramChangeNumber() const noexcept;
@@ -344,7 +331,6 @@ public:
//==============================================================================
/** Returns true if the message is a pitch-wheel move.
@see getPitchWheelValue, pitchWheel
*/
bool isPitchWheel() const noexcept;
@@ -433,7 +419,6 @@ public:
/** Returns the controller number of a controller message.
The name of the controller can be looked up using the getControllerName() method.
Note that the value returned is invalid for messages that aren't controller changes.
@see isController, getControllerName, getControllerValue
@@ -443,7 +428,6 @@ public:
/** Returns the controller value from a controller message.
A value 0 to 127 is returned to indicate the new controller position.
Note that the value returned is invalid for messages that aren't controller changes.
@see isController, getControllerNumber
@@ -467,13 +451,11 @@ public:
int value) noexcept;
/** Checks whether this message is an all-notes-off message.
@see allNotesOff
*/
bool isAllNotesOff() const noexcept;
/** Checks whether this message is an all-sound-off message.
@see allSoundOff
*/
bool isAllSoundOff() const noexcept;
@@ -520,13 +502,11 @@ public:
int getMetaEventType() const noexcept;
/** Returns a pointer to the data in a meta-event.
@see isMetaEvent, getMetaEventLength
*/
const uint8* getMetaEventData() const noexcept;
/** Returns the length of the data for a meta-event.
@see isMetaEvent, getMetaEventData
*/
int getMetaEventLength() const noexcept;
@@ -539,29 +519,28 @@ public:
bool isEndOfTrackMetaEvent() const noexcept;
/** Creates an end-of-track meta-event.
@see isEndOfTrackMetaEvent
*/
static MidiMessage endOfTrack() noexcept;
/** Returns true if this is an 'track name' meta-event.
You can use the getTextFromTextMetaEvent() method to get the track's name.
*/
bool isTrackNameEvent() const noexcept;
/** Returns true if this is a 'text' meta-event.
@see getTextFromTextMetaEvent
*/
bool isTextMetaEvent() const noexcept;
/** Returns the text from a text meta-event.
@see isTextMetaEvent
*/
String getTextFromTextMetaEvent() const;
/** Creates a text meta-event. */
static MidiMessage textMetaEvent (int type, StringRef text);
//==============================================================================
/** Returns true if this is a 'tempo' meta-event.
@see getTempoMetaEventTickLength, getTempoSecondsPerQuarterNote
@@ -660,7 +639,6 @@ public:
//==============================================================================
/** Returns true if this is a midi start event.
@see midiStart
*/
bool isMidiStart() const noexcept;
@@ -669,7 +647,6 @@ public:
static MidiMessage midiStart() noexcept;
/** Returns true if this is a midi continue event.
@see midiContinue
*/
bool isMidiContinue() const noexcept;
@@ -678,7 +655,6 @@ public:
static MidiMessage midiContinue() noexcept;
/** Returns true if this is a midi stop event.
@see midiStop
*/
bool isMidiStop() const noexcept;
@@ -687,7 +663,6 @@ public:
static MidiMessage midiStop() noexcept;
/** Returns true if this is a midi clock event.
@see midiClock, songPositionPointer
*/
bool isMidiClock() const noexcept;
@@ -696,13 +671,11 @@ public:
static MidiMessage midiClock() noexcept;
/** Returns true if this is a song-position-pointer message.
@see getSongPositionPointerMidiBeat, songPositionPointer
*/
bool isSongPositionPointer() const noexcept;
/** Returns the midi beat-number of a song-position-pointer message.
@see isSongPositionPointer, songPositionPointer
*/
int getSongPositionPointerMidiBeat() const noexcept;
@@ -719,23 +692,18 @@ public:
//==============================================================================
/** Returns true if this is a quarter-frame midi timecode message.
@see quarterFrame, getQuarterFrameSequenceNumber, getQuarterFrameValue
*/
bool isQuarterFrame() const noexcept;
/** Returns the sequence number of a quarter-frame midi timecode message.
This will be a value between 0 and 7.
@see isQuarterFrame, getQuarterFrameValue, quarterFrame
*/
int getQuarterFrameSequenceNumber() const noexcept;
/** Returns the value from a quarter-frame message.
This will be the lower nybble of the message's data-byte, a value
between 0 and 15
This will be the lower nybble of the message's data-byte, a value between 0 and 15
*/
int getQuarterFrameValue() const noexcept;
@@ -747,7 +715,6 @@ public:
static MidiMessage quarterFrame (int sequenceNumber, int value) noexcept;
/** SMPTE timecode types.
Used by the getFullFrameParameters() and fullFrame() methods.
*/
enum SmpteTimecodeType
@@ -758,8 +725,7 @@ public:
fps30 = 3
};
/** Returns true if this is a full-frame midi timecode message.
*/
/** Returns true if this is a full-frame midi timecode message. */
bool isFullFrame() const noexcept;
/** Extracts the timecode information from a full-frame midi timecode message.
@@ -773,8 +739,7 @@ public:
int& frames,
SmpteTimecodeType& timecodeType) const noexcept;
/** Creates a full-frame MTC message.
*/
/** Creates a full-frame MTC message. */
static MidiMessage fullFrame (int hours,
int minutes,
int seconds,
@@ -799,7 +764,6 @@ public:
};
/** Checks whether this is an MMC message.
If it is, you can use the getMidiMachineControlCommand() to find out its type.
*/
bool isMidiMachineControlMessage() const noexcept;


+ 1
- 1
libs/juce/source/modules/juce_audio_basics/sources/juce_AudioSource.h View File

@@ -65,7 +65,7 @@ struct JUCE_API AudioSourceChannelInfo
Only the samples specified by the startSample and numSamples members of this structure
should be affected by the call.
The contents of the buffer when it is passed to the the AudioSource::getNextAudioBlock()
The contents of the buffer when it is passed to the AudioSource::getNextAudioBlock()
method can be treated as the input if the source is performing some kind of filter operation,
but should be cleared if this is not the case - the clearActiveBufferRegion() is
a handy way of doing this.


+ 105
- 84
libs/juce/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp View File

@@ -114,7 +114,7 @@ void AudioDeviceManager::createDeviceTypesIfNeeded()
{
if (availableDeviceTypes.size() == 0)
{
OwnedArray <AudioIODeviceType> types;
OwnedArray<AudioIODeviceType> types;
createAudioDeviceTypes (types);
for (int i = 0; i < types.size(); ++i)
@@ -127,7 +127,7 @@ void AudioDeviceManager::createDeviceTypesIfNeeded()
}
}
const OwnedArray <AudioIODeviceType>& AudioDeviceManager::getAvailableDeviceTypes()
const OwnedArray<AudioIODeviceType>& AudioDeviceManager::getAvailableDeviceTypes()
{
scanDevicesIfNeeded();
return availableDeviceTypes;
@@ -147,13 +147,13 @@ void AudioDeviceManager::audioDeviceListChanged()
}
//==============================================================================
static void addIfNotNull (OwnedArray <AudioIODeviceType>& list, AudioIODeviceType* const device)
static void addIfNotNull (OwnedArray<AudioIODeviceType>& list, AudioIODeviceType* const device)
{
if (device != nullptr)
list.add (device);
}
void AudioDeviceManager::createAudioDeviceTypes (OwnedArray <AudioIODeviceType>& list)
void AudioDeviceManager::createAudioDeviceTypes (OwnedArray<AudioIODeviceType>& list)
{
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_WASAPI());
addIfNotNull (list, AudioIODeviceType::createAudioIODeviceType_DirectSound());
@@ -181,7 +181,7 @@ void AudioDeviceManager::addAudioDeviceType (AudioIODeviceType* newDeviceType)
//==============================================================================
String AudioDeviceManager::initialise (const int numInputChannelsNeeded,
const int numOutputChannelsNeeded,
const XmlElement* const e,
const XmlElement* const xml,
const bool selectDefaultDeviceOnFailure,
const String& preferredDefaultDeviceName,
const AudioDeviceSetup* preferredSetupOptions)
@@ -191,106 +191,127 @@ String AudioDeviceManager::initialise (const int numInputChannelsNeeded,
numInputChansNeeded = numInputChannelsNeeded;
numOutputChansNeeded = numOutputChannelsNeeded;
if (e != nullptr && e->hasTagName ("DEVICESETUP"))
{
lastExplicitSettings = new XmlElement (*e);
if (xml != nullptr && xml->hasTagName ("DEVICESETUP"))
return initialiseFromXML (*xml, selectDefaultDeviceOnFailure,
preferredDefaultDeviceName, preferredSetupOptions);
String error;
AudioDeviceSetup setup;
return initialiseDefault (preferredDefaultDeviceName, preferredSetupOptions);
}
if (preferredSetupOptions != nullptr)
setup = *preferredSetupOptions;
String AudioDeviceManager::initialiseDefault (const String& preferredDefaultDeviceName,
const AudioDeviceSetup* preferredSetupOptions)
{
AudioDeviceSetup setup;
if (e->getStringAttribute ("audioDeviceName").isNotEmpty())
{
setup.inputDeviceName = setup.outputDeviceName
= e->getStringAttribute ("audioDeviceName");
}
else
if (preferredSetupOptions != nullptr)
{
setup = *preferredSetupOptions;
}
else if (preferredDefaultDeviceName.isNotEmpty())
{
for (int j = availableDeviceTypes.size(); --j >= 0;)
{
setup.inputDeviceName = e->getStringAttribute ("audioInputDeviceName");
setup.outputDeviceName = e->getStringAttribute ("audioOutputDeviceName");
}
AudioIODeviceType* const type = availableDeviceTypes.getUnchecked(j);
currentDeviceType = e->getStringAttribute ("deviceType");
const StringArray outs (type->getDeviceNames (false));
if (findType (currentDeviceType) == nullptr)
{
if (AudioIODeviceType* const type = findType (setup.inputDeviceName, setup.outputDeviceName))
currentDeviceType = type->getTypeName();
else if (availableDeviceTypes.size() > 0)
currentDeviceType = availableDeviceTypes.getUnchecked(0)->getTypeName();
for (int i = 0; i < outs.size(); ++i)
{
if (outs[i].matchesWildcard (preferredDefaultDeviceName, true))
{
setup.outputDeviceName = outs[i];
break;
}
}
const StringArray ins (type->getDeviceNames (true));
for (int i = 0; i < ins.size(); ++i)
{
if (ins[i].matchesWildcard (preferredDefaultDeviceName, true))
{
setup.inputDeviceName = ins[i];
break;
}
}
}
}
setup.bufferSize = e->getIntAttribute ("audioDeviceBufferSize");
setup.sampleRate = e->getDoubleAttribute ("audioDeviceRate");
insertDefaultDeviceNames (setup);
return setAudioDeviceSetup (setup, false);
}
setup.inputChannels .parseString (e->getStringAttribute ("audioDeviceInChans", "11"), 2);
setup.outputChannels.parseString (e->getStringAttribute ("audioDeviceOutChans", "11"), 2);
String AudioDeviceManager::initialiseFromXML (const XmlElement& xml,
const bool selectDefaultDeviceOnFailure,
const String& preferredDefaultDeviceName,
const AudioDeviceSetup* preferredSetupOptions)
{
lastExplicitSettings = new XmlElement (xml);
setup.useDefaultInputChannels = ! e->hasAttribute ("audioDeviceInChans");
setup.useDefaultOutputChannels = ! e->hasAttribute ("audioDeviceOutChans");
String error;
AudioDeviceSetup setup;
error = setAudioDeviceSetup (setup, true);
if (preferredSetupOptions != nullptr)
setup = *preferredSetupOptions;
midiInsFromXml.clear();
forEachXmlChildElementWithTagName (*e, c, "MIDIINPUT")
midiInsFromXml.add (c->getStringAttribute ("name"));
if (xml.getStringAttribute ("audioDeviceName").isNotEmpty())
{
setup.inputDeviceName = setup.outputDeviceName
= xml.getStringAttribute ("audioDeviceName");
}
else
{
setup.inputDeviceName = xml.getStringAttribute ("audioInputDeviceName");
setup.outputDeviceName = xml.getStringAttribute ("audioOutputDeviceName");
}
const StringArray allMidiIns (MidiInput::getDevices());
currentDeviceType = xml.getStringAttribute ("deviceType");
for (int i = allMidiIns.size(); --i >= 0;)
setMidiInputEnabled (allMidiIns[i], midiInsFromXml.contains (allMidiIns[i]));
if (findType (currentDeviceType) == nullptr)
{
if (AudioIODeviceType* const type = findType (setup.inputDeviceName, setup.outputDeviceName))
currentDeviceType = type->getTypeName();
else if (availableDeviceTypes.size() > 0)
currentDeviceType = availableDeviceTypes.getUnchecked(0)->getTypeName();
}
if (error.isNotEmpty() && selectDefaultDeviceOnFailure)
error = initialise (numInputChannelsNeeded, numOutputChannelsNeeded, 0,
false, preferredDefaultDeviceName);
setup.bufferSize = xml.getIntAttribute ("audioDeviceBufferSize");
setup.sampleRate = xml.getDoubleAttribute ("audioDeviceRate");
setDefaultMidiOutput (e->getStringAttribute ("defaultMidiOutput"));
setup.inputChannels .parseString (xml.getStringAttribute ("audioDeviceInChans", "11"), 2);
setup.outputChannels.parseString (xml.getStringAttribute ("audioDeviceOutChans", "11"), 2);
return error;
}
else
{
AudioDeviceSetup setup;
setup.useDefaultInputChannels = ! xml.hasAttribute ("audioDeviceInChans");
setup.useDefaultOutputChannels = ! xml.hasAttribute ("audioDeviceOutChans");
if (preferredSetupOptions != nullptr)
{
setup = *preferredSetupOptions;
}
else if (preferredDefaultDeviceName.isNotEmpty())
{
for (int j = availableDeviceTypes.size(); --j >= 0;)
{
AudioIODeviceType* const type = availableDeviceTypes.getUnchecked(j);
error = setAudioDeviceSetup (setup, true);
const StringArray outs (type->getDeviceNames (false));
midiInsFromXml.clear();
for (int i = 0; i < outs.size(); ++i)
{
if (outs[i].matchesWildcard (preferredDefaultDeviceName, true))
{
setup.outputDeviceName = outs[i];
break;
}
}
forEachXmlChildElementWithTagName (xml, c, "MIDIINPUT")
midiInsFromXml.add (c->getStringAttribute ("name"));
const StringArray ins (type->getDeviceNames (true));
const StringArray allMidiIns (MidiInput::getDevices());
for (int i = 0; i < ins.size(); ++i)
{
if (ins[i].matchesWildcard (preferredDefaultDeviceName, true))
{
setup.inputDeviceName = ins[i];
break;
}
}
}
}
for (int i = allMidiIns.size(); --i >= 0;)
setMidiInputEnabled (allMidiIns[i], midiInsFromXml.contains (allMidiIns[i]));
insertDefaultDeviceNames (setup);
return setAudioDeviceSetup (setup, false);
}
if (error.isNotEmpty() && selectDefaultDeviceOnFailure)
error = initialise (numInputChansNeeded, numOutputChansNeeded,
nullptr, false, preferredDefaultDeviceName);
setDefaultMidiOutput (xml.getStringAttribute ("defaultMidiOutput"));
return error;
}
String AudioDeviceManager::initialiseWithDefaultDevices (int numInputChannelsNeeded,
int numOutputChannelsNeeded)
{
lastExplicitSettings = nullptr;
return initialise (numInputChannelsNeeded, numOutputChannelsNeeded,
nullptr, false, String(), nullptr);
}
void AudioDeviceManager::insertDefaultDeviceNames (AudioDeviceSetup& setup) const
@@ -880,7 +901,7 @@ void AudioDeviceManager::setDefaultMidiOutput (const String& deviceName)
{
if (defaultMidiOutputName != deviceName)
{
Array <AudioIODeviceCallback*> oldCallbacks;
Array<AudioIODeviceCallback*> oldCallbacks;
{
const ScopedLock sl (audioCallbackLock);
@@ -915,7 +936,7 @@ void AudioDeviceManager::setDefaultMidiOutput (const String& deviceName)
void AudioDeviceManager::playTestSound()
{
{ // cunningly nested to swap, unlock and delete in that order.
ScopedPointer <AudioSampleBuffer> oldSound;
ScopedPointer<AudioSampleBuffer> oldSound;
{
const ScopedLock sl (audioCallbackLock);


+ 19
- 12
libs/juce/source/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h View File

@@ -191,7 +191,11 @@ public:
const XmlElement* savedState,
bool selectDefaultDeviceOnFailure,
const String& preferredDefaultDeviceName = String(),
const AudioDeviceSetup* preferredSetupOptions = 0);
const AudioDeviceSetup* preferredSetupOptions = nullptr);
/** Resets everything to a default device setup, clearing any stored settings. */
String initialiseWithDefaultDevices (int numInputChannelsNeeded,
int numOutputChannelsNeeded);
/** Returns some XML representing the current state of the manager.
@@ -383,7 +387,7 @@ public:
/** Returns a list of the types of device supported.
*/
const OwnedArray <AudioIODeviceType>& getAvailableDeviceTypes();
const OwnedArray<AudioIODeviceType>& getAvailableDeviceTypes();
//==============================================================================
/** Creates a list of available types.
@@ -394,7 +398,7 @@ public:
You can override this if your app needs to do something specific, like avoid
using DirectSound devices, etc.
*/
virtual void createAudioDeviceTypes (OwnedArray <AudioIODeviceType>& types);
virtual void createAudioDeviceTypes (OwnedArray<AudioIODeviceType>& types);
/** Adds a new device type to the list of types.
The manager will take ownership of the object that is passed-in.
@@ -446,30 +450,30 @@ public:
private:
//==============================================================================
OwnedArray <AudioIODeviceType> availableDeviceTypes;
OwnedArray <AudioDeviceSetup> lastDeviceTypeConfigs;
OwnedArray<AudioIODeviceType> availableDeviceTypes;
OwnedArray<AudioDeviceSetup> lastDeviceTypeConfigs;
AudioDeviceSetup currentSetup;
ScopedPointer <AudioIODevice> currentAudioDevice;
Array <AudioIODeviceCallback*> callbacks;
ScopedPointer<AudioIODevice> currentAudioDevice;
Array<AudioIODeviceCallback*> callbacks;
int numInputChansNeeded, numOutputChansNeeded;
String currentDeviceType;
BigInteger inputChannels, outputChannels;
ScopedPointer <XmlElement> lastExplicitSettings;
ScopedPointer<XmlElement> lastExplicitSettings;
mutable bool listNeedsScanning;
bool useInputNames;
Atomic<int> inputLevelMeasurementEnabledCount;
double inputLevel;
ScopedPointer <AudioSampleBuffer> testSound;
ScopedPointer<AudioSampleBuffer> testSound;
int testSoundPosition;
AudioSampleBuffer tempBuffer;
StringArray midiInsFromXml;
OwnedArray <MidiInput> enabledMidiInputs;
Array <MidiInputCallback*> midiCallbacks;
OwnedArray<MidiInput> enabledMidiInputs;
Array<MidiInputCallback*> midiCallbacks;
StringArray midiCallbackDevices;
String defaultMidiOutputName;
ScopedPointer <MidiOutput> defaultMidiOutput;
ScopedPointer<MidiOutput> defaultMidiOutput;
CriticalSection audioCallbackLock, midiCallbackLock;
double cpuUsageMs, timeToCpuScale;
@@ -500,6 +504,9 @@ private:
double chooseBestSampleRate (double preferred) const;
int chooseBestBufferSize (int preferred) const;
void insertDefaultDeviceNames (AudioDeviceSetup&) const;
String initialiseDefault (const String& preferredDefaultDeviceName, const AudioDeviceSetup*);
String initialiseFromXML (const XmlElement&, bool selectDefaultDeviceOnFailure,
const String& preferredDefaultDeviceName, const AudioDeviceSetup*);
AudioIODeviceType* findType (const String& inputName, const String& outputName);
AudioIODeviceType* findType (const String& typeName);


+ 1
- 1
libs/juce/source/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h View File

@@ -118,7 +118,7 @@ public:
/**
A class for receiving events when audio devices are inserted or removed.
You can register a AudioIODeviceType::Listener with an~AudioIODeviceType object
You can register an AudioIODeviceType::Listener with an~AudioIODeviceType object
using the AudioIODeviceType::addListener() method, and it will be called when
devices of that type are added or removed.


+ 1
- 1
libs/juce/source/modules/juce_audio_devices/juce_module_info View File

@@ -1,7 +1,7 @@
{
"id": "juce_audio_devices",
"name": "JUCE audio and midi I/O device classes",
"version": "3.0.2",
"version": "3.0.4",
"description": "Classes to play and record from audio and midi i/o devices.",
"website": "http://www.juce.com/juce",
"license": "GPL/Commercial",


+ 17
- 5
libs/juce/source/modules/juce_audio_devices/native/juce_MidiDataConcatenator.h View File

@@ -123,6 +123,14 @@ private:
{
if (pendingBytes > 0 && *d >= 0x80)
{
if (*d == 0xf7)
{
*dest++ = *d++;
++pendingBytes;
--numBytes;
break;
}
if (*d >= 0xfa || *d == 0xf8)
{
callback.handleIncomingMidiMessage (input, MidiMessage (*d, time));
@@ -131,11 +139,15 @@ private:
}
else
{
if (*d == 0xf7)
pendingBytes = 0;
int used = 0;
const MidiMessage m (d, numBytes, used, 0, time);
if (used > 0)
{
*dest++ = *d++;
pendingBytes++;
--numBytes;
callback.handleIncomingMidiMessage (input, m);
numBytes -= used;
d += used;
}
break;
@@ -144,7 +156,7 @@ private:
else
{
*dest++ = *d++;
pendingBytes++;
++pendingBytes;
--numBytes;
}
}


+ 3
- 7
libs/juce/source/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp View File

@@ -502,13 +502,9 @@ public:
outputNames.clear();
outputIds.clear();
if (juce_libjackHandle == nullptr)
{
juce_libjackHandle = dlopen ("libjack.so", RTLD_LAZY);
if (juce_libjackHandle == nullptr)
return;
}
if (juce_libjackHandle == nullptr) juce_libjackHandle = dlopen ("libjack.so.0", RTLD_LAZY);
if (juce_libjackHandle == nullptr) juce_libjackHandle = dlopen ("libjack.so", RTLD_LAZY);
if (juce_libjackHandle == nullptr) return;
jack_status_t status;


+ 7
- 1
libs/juce/source/modules/juce_audio_devices/native/juce_win32_Midi.cpp View File

@@ -478,6 +478,12 @@ void MidiOutput::sendMessageNow (const MidiMessage& message)
}
else
{
midiOutShortMsg (handle->handle, *(unsigned int*) message.getRawData());
for (int i = 0; i < 50; ++i)
{
if (midiOutShortMsg (handle->handle, *(unsigned int*) message.getRawData()) != MIDIERR_NOTREADY)
break;
Sleep (1);
}
}
}

+ 1
- 1
libs/juce/source/modules/juce_audio_formats/format/juce_AudioSubsectionReader.h View File

@@ -43,7 +43,7 @@ class JUCE_API AudioSubsectionReader : public AudioFormatReader
{
public:
//==============================================================================
/** Creates a AudioSubsectionReader for a given data source.
/** Creates an AudioSubsectionReader for a given data source.
@param sourceReader the source reader from which we'll be taking data
@param subsectionStartSample the sample within the source reader which will be


+ 1
- 1
libs/juce/source/modules/juce_audio_formats/juce_module_info View File

@@ -1,7 +1,7 @@
{
"id": "juce_audio_formats",
"name": "JUCE audio file format codecs",
"version": "3.0.2",
"version": "3.0.4",
"description": "Classes for reading and writing various audio file formats.",
"website": "http://www.juce.com/juce",
"license": "GPL/Commercial",


+ 42
- 4
libs/juce/source/modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp View File

@@ -124,8 +124,7 @@ struct AAXClasses
case 6: return AAX_eStemFormat_5_1;
case 7: return AAX_eStemFormat_7_0_DTS;
case 8: return AAX_eStemFormat_7_1_DTS;
default: jassertfalse; break; // hmm - not a valid number of chans..
default: jassertfalse; break;
}
return AAX_eStemFormat_None;
@@ -139,17 +138,45 @@ struct AAXClasses
case AAX_eStemFormat_Mono: return 1;
case AAX_eStemFormat_Stereo: return 2;
case AAX_eStemFormat_LCR: return 3;
case AAX_eStemFormat_LCRS:
case AAX_eStemFormat_Quad: return 4;
case AAX_eStemFormat_5_0: return 5;
case AAX_eStemFormat_5_1: return 6;
case AAX_eStemFormat_5_1:
case AAX_eStemFormat_6_0: return 6;
case AAX_eStemFormat_6_1:
case AAX_eStemFormat_7_0_SDDS:
case AAX_eStemFormat_7_0_DTS: return 7;
case AAX_eStemFormat_7_1_SDDS:
case AAX_eStemFormat_7_1_DTS: return 8;
default: jassertfalse; break; // hmm - not a valid number of chans..
default: jassertfalse; break;
}
return 0;
}
static const char* getSpeakerArrangementString (AAX_EStemFormat format) noexcept
{
switch (format)
{
case AAX_eStemFormat_Mono: return "M";
case AAX_eStemFormat_Stereo: return "L R";
case AAX_eStemFormat_LCR: return "L C R";
case AAX_eStemFormat_LCRS: return "L C R S";
case AAX_eStemFormat_Quad: return "L R Ls Rs";
case AAX_eStemFormat_5_0: return "L C R Ls Rs";
case AAX_eStemFormat_5_1: return "L C R Ls Rs LFE";
case AAX_eStemFormat_6_0: return "L C R Ls Cs Rs";
case AAX_eStemFormat_6_1: return "L C R Ls Cs Rs LFE";
case AAX_eStemFormat_7_0_SDDS: return "L Lc C Rc R Ls Rs";
case AAX_eStemFormat_7_1_SDDS: return "L Lc C Rc R Ls Rs LFE";
case AAX_eStemFormat_7_0_DTS: return "L C R Lss Rss Lsr Rsr";
case AAX_eStemFormat_7_1_DTS: return "L C R Lss Rss Lsr Rsr LFE";
default: break;
}
return nullptr;
}
//==============================================================================
struct JUCELibraryRefCount
{
@@ -652,6 +679,7 @@ struct AAXClasses
void audioProcessorChanged (AudioProcessor* processor) override
{
++mNumPlugInChanges;
check (Controller()->SetSignalLatency (processor->getLatencySamples()));
}
@@ -855,6 +883,9 @@ struct AAXClasses
AudioProcessor& audioProcessor = getPluginInstance();
audioProcessor.setSpeakerArrangement (getSpeakerArrangementString (inputStemFormat),
getSpeakerArrangementString (outputStemFormat));
audioProcessor.setPlayConfigDetails (numberOfInputChannels, numberOfOutputChannels, sampleRate, lastBufferSize);
audioProcessor.prepareToPlay (sampleRate, lastBufferSize);
@@ -931,6 +962,13 @@ struct AAXClasses
// This value needs to match the RTAS wrapper's Type ID, so that
// the host knows that the RTAS/AAX plugins are equivalent.
properties->AddProperty (AAX_eProperty_PlugInID_Native, 'jcaa' + channelConfigIndex);
properties->AddProperty (AAX_eProperty_PlugInID_AudioSuite, 'jyaa' + channelConfigIndex);
#if JucePlugin_AAXDisableMultiMono
properties->AddProperty (AAX_eProperty_Constraint_MultiMonoSupport, false);
#else
properties->AddProperty (AAX_eProperty_Constraint_MultiMonoSupport, true);
#endif
check (desc.AddProcessProc_Native (algorithmProcessCallback, properties));
}


+ 24
- 35
libs/juce/source/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp View File

@@ -203,10 +203,8 @@ public:
{
public:
//==============================================================================
JuceCustomUIView (AudioProcessor* const filter_,
JucePlugInProcess* const process_)
: filter (filter_),
process (process_)
JuceCustomUIView (AudioProcessor* ap, JucePlugInProcess* p)
: filter (ap), process (p)
{
// setting the size in here crashes PT for some reason, so keep it simple..
}
@@ -237,7 +235,7 @@ public:
r.bottom = editorComp->getHeight();
SetRect (&r);
if ((oldRect.right != r.right) || (oldRect.bottom != r.bottom))
if (oldRect.right != r.right || oldRect.bottom != r.bottom)
startTimer (50);
}
}
@@ -269,8 +267,6 @@ public:
#endif
wrapper = nullptr;
wrapper = new EditorCompWrapper (hostWindow, editorComp, this);
process->touchAllParameters();
}
}
else
@@ -774,23 +770,13 @@ protected:
// xxx is there an RTAS equivalent?
}
void touchAllParameters()
{
for (int i = 0; i < juceFilter->getNumParameters(); ++i)
{
audioProcessorParameterChangeGestureBegin (0, i);
audioProcessorParameterChanged (0, i, juceFilter->getParameter (i));
audioProcessorParameterChangeGestureEnd (0, i);
}
}
public:
// Need to use an intermediate class here rather than inheriting from AsyncUpdater, so that it can
// be deleted before shutting down juce in our destructor.
class InternalAsyncUpdater : public AsyncUpdater
{
public:
InternalAsyncUpdater (JucePlugInProcess& owner_) : owner (owner_) {}
InternalAsyncUpdater (JucePlugInProcess& p) : owner (p) {}
void handleAsyncUpdate() { owner.handleAsyncUpdate(); }
private:
@@ -927,29 +913,32 @@ public:
for (int i = 0; i < numConfigs; ++i)
{
CEffectType* const type
= new CEffectTypeRTAS ('jcaa' + i,
JucePlugin_RTASProductId,
JucePlugin_RTASCategory);
if (channelConfigs[i][0] <= 8 && channelConfigs[i][1] <= 8)
{
CEffectType* const type
= new CEffectTypeRTAS ('jcaa' + i,
JucePlugin_RTASProductId,
JucePlugin_RTASCategory);
type->DefineTypeNames (createRTASName().toRawUTF8());
type->DefineSampleRateSupport (eSupports48kAnd96kAnd192k);
type->DefineTypeNames (createRTASName().toRawUTF8());
type->DefineSampleRateSupport (eSupports48kAnd96kAnd192k);
type->DefineStemFormats (getFormatForChans (channelConfigs [i][0] != 0 ? channelConfigs [i][0] : channelConfigs [i][1]),
getFormatForChans (channelConfigs [i][1] != 0 ? channelConfigs [i][1] : channelConfigs [i][0]));
type->DefineStemFormats (getFormatForChans (channelConfigs [i][0] != 0 ? channelConfigs [i][0] : channelConfigs [i][1]),
getFormatForChans (channelConfigs [i][1] != 0 ? channelConfigs [i][1] : channelConfigs [i][0]));
#if ! JucePlugin_RTASDisableBypass
type->AddGestalt (pluginGestalt_CanBypass);
#endif
#if ! JucePlugin_RTASDisableBypass
type->AddGestalt (pluginGestalt_CanBypass);
#endif
#if JucePlugin_RTASDisableMultiMono
type->AddGestalt (pluginGestalt_DoesntSupportMultiMono);
#endif
#if JucePlugin_RTASDisableMultiMono
type->AddGestalt (pluginGestalt_DoesntSupportMultiMono);
#endif
type->AddGestalt (pluginGestalt_SupportsVariableQuanta);
type->AttachEffectProcessCreator (createNewProcess);
type->AddGestalt (pluginGestalt_SupportsVariableQuanta);
type->AttachEffectProcessCreator (createNewProcess);
AddEffectType (type);
AddEffectType (type);
}
}
}


+ 1
- 1
libs/juce/source/modules/juce_audio_plugin_client/Standalone/juce_StandaloneFilterWindow.h View File

@@ -105,7 +105,7 @@ public:
const int y = settings->getIntValue ("windowY", -100);
if (x != -100 && y != -100)
setBoundsConstrained (Rectangle<int> (x, y, getWidth(), getHeight()));
setBoundsConstrained (juce::Rectangle<int> (x, y, getWidth(), getHeight()));
else
centreWithSize (getWidth(), getHeight());
}


+ 53
- 57
libs/juce/source/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp View File

@@ -176,7 +176,9 @@ public:
toString128 (info.title, p.getParameterName (index));
toString128 (info.shortTitle, p.getParameterName (index, 8));
toString128 (info.units, p.getParameterLabel (index));
info.stepCount = (Steinberg::int32) p.getParameterNumSteps (index);
const int numSteps = p.getParameterNumSteps (index);
info.stepCount = (Steinberg::int32) (numSteps > 0 && numSteps < 0x7fffffff ? numSteps - 1 : 0);
info.defaultNormalizedValue = p.getParameterDefaultValue (index);
info.unitId = Vst::kRootUnitId;
info.flags = p.isParameterAutomatable (index) ? Vst::ParameterInfo::kCanAutomate : 0;
@@ -752,78 +754,72 @@ public:
tresult PLUGIN_API setIoMode (Vst::IoMode) override { return kNotImplemented; }
tresult PLUGIN_API getRoutingInfo (Vst::RoutingInfo&, Vst::RoutingInfo&) override { return kNotImplemented; }
tresult PLUGIN_API setState (IBStream* state) override
bool readFromMemoryStream (IBStream* state) const
{
if (state != nullptr)
FUnknownPtr<MemoryStream> s (state);
if (s != nullptr
&& s->getData() != nullptr
&& s->getSize() > 0
&& s->getSize() < 1024 * 1024 * 100) // (some hosts seem to return junk for the size)
{
// Reset to the beginning of the stream:
if (state->seek (0, IBStream::kIBSeekSet, nullptr) != kResultTrue)
return kResultFalse;
// Adobe Audition CS6 hack to avoid trying to use corrupted streams:
if (getHostType().isAdobeAudition())
if (s->getSize() >= 5 && memcmp (s->getData(), "VC2!E", 5) == 0)
return kResultFalse;
Steinberg::int64 end = -1;
pluginInstance->setStateInformation (s->getData(), (int) s->getSize());
return true;
}
if (end < 0)
{
FUnknownPtr<ISizeableStream> s (state);
return false;
}
if (s != nullptr)
s->getStreamSize (end);
}
bool readFromUnknownStream (IBStream* state) const
{
MemoryOutputStream allData;
{
const size_t bytesPerBlock = 4096;
HeapBlock<char> buffer (bytesPerBlock);
if (end < 0)
for (;;)
{
FUnknownPtr<MemoryStream> s (state);
int32 bytesRead = 0;
if (s != nullptr)
if (state->read (buffer, (int32) bytesPerBlock, &bytesRead) == kResultTrue && bytesRead > 0)
{
if (getHostType().isAdobeAudition())
{
// Adobe Audition CS6 hack to avoid trying to use corrupted streams:
bool failed = true;
if (const char* const data = s->getData())
{
if (s->getSize() >= 5 && data[0] != 'V' && data[1] != 'C'
&& data[2] != '2' && data[3] != '!' && data[4] != 'E')
{
failed = false;
}
}
else
{
jassertfalse;
}
if (failed)
return kResultFalse;
}
end = (Steinberg::int64) s->getSize();
allData.write (buffer, bytesRead);
continue;
}
break;
}
}
if (end <= 0)
return kResultFalse;
const size_t dataSize = allData.getDataSize();
// Try reading the data, and setting the plugin state:
Steinberg::int32 numBytes = (Steinberg::int32) jmin ((Steinberg::int64) std::numeric_limits<Steinberg::int32>::max(), end);
if (dataSize > 0 && dataSize < 0x7fffffff)
{
pluginInstance->setStateInformation (allData.getData(), (int) dataSize);
return true;
}
Array<char> buff;
buff.ensureStorageAllocated ((int) numBytes);
void* buffer = buff.getRawDataPointer();
return false;
}
if (state->read (buffer, numBytes, &numBytes) == kResultTrue
&& buffer != nullptr
&& numBytes > 0)
{
pluginInstance->setStateInformation (buffer, (int) numBytes);
return kResultTrue;
}
tresult PLUGIN_API setState (IBStream* state) override
{
if (state == nullptr)
return kInvalidArgument;
return kResultFalse;
}
FUnknownPtr<IBStream> stateRefHolder (state); // just in case the caller hasn't properly ref-counted the stream object
return kInvalidArgument;
if (state->seek (0, IBStream::kIBSeekSet, nullptr) == kResultTrue)
if (readFromMemoryStream (state) || readFromUnknownStream (state))
return kResultTrue;
return kResultFalse;
}
tresult PLUGIN_API getState (IBStream* state) override
@@ -1084,7 +1080,7 @@ public:
tresult PLUGIN_API process (Vst::ProcessData& data) override
{
if (pluginInstance == nullptr || processContext.sampleRate <= 0.0)
if (pluginInstance == nullptr)
return kResultFalse;
if (data.processContext != nullptr)


+ 1
- 1
libs/juce/source/modules/juce_audio_plugin_client/juce_module_info View File

@@ -1,7 +1,7 @@
{
"id": "juce_audio_plugin_client",
"name": "JUCE audio plugin wrapper classes",
"version": "3.0.2",
"version": "3.0.4",
"description": "Classes for building VST, VST3, RTAS, AAX and AU plugins.",
"website": "http://www.juce.com/juce",
"license": "GPL/Commercial",


+ 15
- 58
libs/juce/source/modules/juce_audio_processors/format_types/juce_VST3Common.h View File

@@ -27,11 +27,11 @@
//==============================================================================
#define JUCE_DECLARE_VST3_COM_REF_METHODS \
Steinberg::uint32 JUCE_CALLTYPE addRef() override { return (Steinberg::uint32) ++refCount; } \
Steinberg::uint32 JUCE_CALLTYPE release() override { const int r = --refCount; if (r == 0) delete this; return (Steinberg::uint32) r; }
Steinberg::uint32 PLUGIN_API addRef() override { return (Steinberg::uint32) ++refCount; } \
Steinberg::uint32 PLUGIN_API release() override { const int r = --refCount; if (r == 0) delete this; return (Steinberg::uint32) r; }
#define JUCE_DECLARE_VST3_COM_QUERY_METHODS \
Steinberg::tresult PLUGIN_API JUCE_CALLTYPE queryInterface (const Steinberg::TUID, void** obj) override \
Steinberg::tresult PLUGIN_API queryInterface (const Steinberg::TUID, void** obj) override \
{ \
jassertfalse; \
*obj = nullptr; \
@@ -51,6 +51,14 @@ static bool doUIDsMatch (const Steinberg::TUID a, const Steinberg::TUID b) noexc
return Steinberg::kResultOk; \
}
#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; \
}
//==============================================================================
static juce::String toString (const Steinberg::char8* string) noexcept { return juce::String (string); }
static juce::String toString (const Steinberg::char16* string) noexcept { return juce::String (juce::CharPointer_UTF16 ((juce::CharPointer_UTF16::CharType*) string)); }
@@ -70,19 +78,15 @@ static Steinberg::Vst::TChar* toString (const juce::String& source) noexcept
}
#if JUCE_WINDOWS
static const Steinberg::FIDString defaultVST3WindowType = Steinberg::kPlatformTypeHWND;
static const Steinberg::FIDString defaultVST3WindowType = Steinberg::kPlatformTypeHWND;
#else
static const Steinberg::FIDString defaultVST3WindowType = Steinberg::kPlatformTypeNSView;
static const Steinberg::FIDString defaultVST3WindowType = Steinberg::kPlatformTypeNSView;
#endif
//==============================================================================
/** The equivalent numChannels and speaker arrangements should always
match between this function and fillWithCorrespondingSpeakerArrangements().
There can only be 1 arrangement per channel count. (i.e.: 4 channels == k31Cine OR k40Cine)
@see fillWithCorrespondingSpeakerArrangements
/** For the sake of simplicity, there can only be 1 arrangement type per channel count.
i.e.: 4 channels == k31Cine OR k40Cine
*/
static Steinberg::Vst::SpeakerArrangement getArrangementForNumChannels (int numChannels) noexcept
{
@@ -116,53 +120,6 @@ static Steinberg::Vst::SpeakerArrangement getArrangementForNumChannels (int numC
return (Steinberg::Vst::SpeakerArrangement) bi.toInt64();
}
/** The equivalent numChannels and speaker arrangements should always
match between this function and getArrangementForNumChannels().
There can only be 1 arrangement per channel count. (i.e.: 4 channels == k31Cine OR k40Cine)
@see getArrangementForNumChannels
*/
static void fillWithCorrespondingSpeakerArrangements (Array<Steinberg::Vst::SpeakerArrangement>& destination,
int numChannels)
{
using namespace Steinberg::Vst::SpeakerArr;
destination.clearQuick();
if (numChannels <= 0)
{
destination.add (kEmpty);
return;
}
// The order of the arrangement checks must be descending, since most plugins test for
/// the first arrangement to match their number of specified channels.
if (numChannels > 24)
{
juce::BigInteger bi;
bi.setRange (0, jmin (numChannels, (int) (sizeof (Steinberg::Vst::SpeakerArrangement) * 8)), true);
destination.add ((Steinberg::Vst::SpeakerArrangement) bi.toInt64());
}
if (numChannels >= 24) destination.add ((Steinberg::Vst::SpeakerArrangement) 1929904127); // k222
if (numChannels >= 14) destination.add (k131);
if (numChannels >= 13) destination.add (k130);
if (numChannels >= 12) destination.add (k111);
if (numChannels >= 11) destination.add (k101);
if (numChannels >= 10) destination.add (k91);
if (numChannels >= 9) destination.add (k90);
if (numChannels >= 8) destination.add (k71CineFullFront);
if (numChannels >= 7) destination.add (k61Cine);
if (numChannels >= 6) destination.add (k51);
if (numChannels >= 5) destination.add (k50);
if (numChannels >= 4) destination.add (k31Cine);
if (numChannels >= 3) destination.add (k30Cine);
if (numChannels >= 2) destination.add (kStereo);
if (numChannels >= 1) destination.add (kMono);
}
//==============================================================================
template <class ObjectType>
class ComSmartPtr


+ 26
- 25
libs/juce/source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp View File

@@ -98,7 +98,7 @@ static void fillDescriptionWith (PluginDescription& description, ObjectType& obj
description.version = toString (object.version).trim();
description.category = toString (object.subCategories).trim();
if (description.manufacturerName.isEmpty())
if (description.manufacturerName.trim().isEmpty())
description.manufacturerName = toString (object.vendor).trim();
}
@@ -459,13 +459,13 @@ public:
{
*obj = nullptr;
if (! doIdsMatch (cid, iid))
if (! doUIDsMatch (cid, iid))
{
jassertfalse;
return kInvalidArgument;
}
if (doIdsMatch (cid, Vst::IMessage::iid) && doIdsMatch (iid, Vst::IMessage::iid))
if (doUIDsMatch (cid, Vst::IMessage::iid) && doUIDsMatch (iid, Vst::IMessage::iid))
{
ComSmartPtr<Message> m (new Message (*this, attributeList));
messageQueue.add (m);
@@ -473,7 +473,7 @@ public:
*obj = m;
return kResultOk;
}
else if (doIdsMatch (cid, Vst::IAttributeList::iid) && doIdsMatch (iid, Vst::IAttributeList::iid))
else if (doUIDsMatch (cid, Vst::IAttributeList::iid) && doUIDsMatch (iid, Vst::IAttributeList::iid))
{
ComSmartPtr<AttributeList> l (new AttributeList (this));
l->addRef();
@@ -526,7 +526,7 @@ public:
//==============================================================================
tresult PLUGIN_API queryInterface (const TUID iid, void** obj) override
{
if (doIdsMatch (iid, Vst::IAttributeList::iid))
if (doUIDsMatch (iid, Vst::IAttributeList::iid))
{
*obj = attributeList.get();
return kResultOk;
@@ -539,6 +539,7 @@ public:
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)
*obj = nullptr;
return kNotImplemented;
@@ -550,12 +551,6 @@ private:
String appName;
VST3PluginInstance* owner;
//==============================================================================
static bool doIdsMatch (const TUID a, const TUID b) noexcept
{
return std::memcmp (a, b, sizeof (TUID)) == 0;
}
//==============================================================================
class Message : public Vst::IMessage
{
@@ -1206,7 +1201,7 @@ public:
setOpaque (true);
setVisible (true);
view->setFrame (this);
warnOnFailure (view->setFrame (this));
ViewRect rect;
warnOnFailure (view->getSize (&rect));
@@ -1215,7 +1210,7 @@ public:
~VST3PluginWindow()
{
view->removed();
warnOnFailure (view->removed());
getAudioProcessor()->editorBeingDeleted (this);
#if JUCE_MAC
@@ -1273,7 +1268,7 @@ public:
}
else
{
view->getSize (&rect);
warnOnFailure (view->getSize (&rect));
}
#if JUCE_WINDOWS
@@ -1485,12 +1480,6 @@ public:
{
using namespace Vst;
const int numInputs = getNumInputChannels();
const int numOutputs = getNumOutputChannels();
// Needed for having the same sample rate in processBlock(); some plugins need this!
setPlayConfigDetails (numInputs, numOutputs, sampleRate, estimatedSamplesPerBlock);
ProcessSetup setup;
setup.symbolicSampleSize = kSample32;
setup.maxSamplesPerBlock = estimatedSamplesPerBlock;
@@ -1504,16 +1493,28 @@ public:
editController->setComponentHandler (host);
setStateForAllBusses (true);
Array<SpeakerArrangement> inArrangements, outArrangements;
fillWithCorrespondingSpeakerArrangements (inArrangements, numInputs);
fillWithCorrespondingSpeakerArrangements (outArrangements, numOutputs);
for (int i = 0; i < numInputAudioBusses; ++i)
inArrangements.add (getArrangementForNumChannels (jmax (0, (int) getBusInfo (true, true, i).channelCount)));
for (int i = 0; i < numOutputAudioBusses; ++i)
outArrangements.add (getArrangementForNumChannels (jmax (0, (int) getBusInfo (false, true, i).channelCount)));
warnOnFailure (processor->setBusArrangements (inArrangements.getRawDataPointer(), numInputAudioBusses,
outArrangements.getRawDataPointer(), numOutputAudioBusses));
// Update the num. busses in case the configuration has been modified by the plugin. (May affect number of channels!):
numInputAudioBusses = getNumSingleDirectionBussesFor (component, true, true);
numOutputAudioBusses = getNumSingleDirectionBussesFor (component, false, true);
// Needed for having the same sample rate in processBlock(); some plugins need this!
setPlayConfigDetails (getNumSingleDirectionChannelsFor (component, true, true),
getNumSingleDirectionChannelsFor (component, false, true),
sampleRate, estimatedSamplesPerBlock);
setStateForAllBusses (true);
warnOnFailure (component->setActive (true));
warnOnFailure (processor->setProcessing (true));
}
@@ -1716,7 +1717,7 @@ public:
if (head != nullptr)
{
ScopedPointer<Steinberg::MemoryStream> s (createMemoryStreamForState (*head, "IComponent"));
ComSmartPtr<Steinberg::MemoryStream> s (createMemoryStreamForState (*head, "IComponent"));
if (s != nullptr && component != nullptr)
component->setState (s);


+ 10
- 7
libs/juce/source/modules/juce_audio_processors/juce_audio_processors.cpp View File

@@ -119,15 +119,18 @@ struct AutoResizingNSViewComponentWithParent : public AutoResizingNSViewCompone
{
if (NSView* parent = (NSView*) getView())
{
if (NSView* child = [[parent subviews] firstObject])
if ([[parent subviews] count] > 0)
{
NSRect f = [parent frame];
NSSize newSize = [child frame].size;
if (f.size.width != newSize.width || f.size.height != newSize.height)
if (NSView* child = [[parent subviews] objectAtIndex: 0])
{
f.size = newSize;
[parent setFrame: f];
NSRect f = [parent frame];
NSSize newSize = [child frame].size;
if (f.size.width != newSize.width || f.size.height != newSize.height)
{
f.size = newSize;
[parent setFrame: f];
}
}
}
}


+ 1
- 1
libs/juce/source/modules/juce_audio_processors/juce_module_info View File

@@ -1,7 +1,7 @@
{
"id": "juce_audio_processors",
"name": "JUCE audio plugin hosting classes",
"version": "3.0.2",
"version": "3.0.4",
"description": "Classes for loading and playing VST, AU, or internally-generated audio processors.",
"website": "http://www.juce.com/juce",
"license": "GPL/Commercial",


+ 1
- 1
libs/juce/source/modules/juce_audio_processors/processors/juce_PluginDescription.h View File

@@ -102,7 +102,7 @@ public:
/** True if the plug-in is part of a multi-type container, e.g. a VST Shell. */
bool hasSharedContainer;
/** Returns true if the two descriptions refer the the same plug-in.
/** Returns true if the two descriptions refer to the same plug-in.
This isn't quite as simple as them just having the same file (because of
shell plug-ins).


+ 1
- 1
libs/juce/source/modules/juce_audio_utils/juce_module_info View File

@@ -1,7 +1,7 @@
{
"id": "juce_audio_utils",
"name": "JUCE extra audio utility classes",
"version": "3.0.2",
"version": "3.0.4",
"description": "Classes for audio-related GUI and miscellaneous tasks.",
"website": "http://www.juce.com/juce",
"license": "GPL/Commercial",


+ 2
- 2
libs/juce/source/modules/juce_core/containers/juce_NamedValueSet.h View File

@@ -76,14 +76,14 @@ public:
/** Changes or adds a named value.
@returns true if a value was changed or added; false if the
value was already set the the value passed-in.
value was already set the value passed-in.
*/
bool set (Identifier name, const var& newValue);
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
/** Changes or adds a named value.
@returns true if a value was changed or added; false if the
value was already set the the value passed-in.
value was already set the value passed-in.
*/
bool set (Identifier name, var&& newValue);
#endif


+ 1
- 1
libs/juce/source/modules/juce_core/juce_core.cpp View File

@@ -133,7 +133,6 @@ namespace juce
#include "network/juce_MACAddress.cpp"
#include "network/juce_NamedPipe.cpp"
#include "network/juce_Socket.cpp"
#include "network/juce_URL.cpp"
#include "network/juce_IPAddress.cpp"
#include "streams/juce_BufferedInputStream.cpp"
#include "streams/juce_FileInputSource.cpp"
@@ -219,5 +218,6 @@ namespace juce
#include "threads/juce_ChildProcess.cpp"
#include "threads/juce_HighResolutionTimer.cpp"
#include "network/juce_URL.cpp"
}

+ 1
- 1
libs/juce/source/modules/juce_core/juce_core.h View File

@@ -64,7 +64,7 @@
//=============================================================================
/** Config: JUCE_LOG_ASSERTIONS
If this flag is enabled, the the jassert and jassertfalse macros will always use Logger::writeToLog()
If this flag is enabled, the jassert and jassertfalse macros will always use Logger::writeToLog()
to write a message when an assertion happens.
Enabling it will also leave this turned on in release builds. When it's disabled,


+ 1
- 1
libs/juce/source/modules/juce_core/juce_module_info View File

@@ -1,7 +1,7 @@
{
"id": "juce_core",
"name": "JUCE core classes",
"version": "3.0.2",
"version": "3.0.4",
"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",


+ 39
- 15
libs/juce/source/modules/juce_core/native/java/JuceAppActivity.java View File

@@ -589,10 +589,34 @@ public final class JuceAppActivity extends Activity
//==============================================================================
public static class HTTPStream
{
public HTTPStream (HttpURLConnection connection_) throws IOException
public HTTPStream (HttpURLConnection connection_,
int[] statusCode, StringBuffer responseHeaders) throws IOException
{
connection = connection_;
inputStream = new BufferedInputStream (connection.getInputStream());
try
{
inputStream = new BufferedInputStream (connection.getInputStream());
}
catch (IOException e)
{
if (connection.getResponseCode() < org.apache.http.HttpStatus.SC_BAD_REQUEST)
throw e;
}
finally
{
statusCode[0] = connection.getResponseCode();
}
if (statusCode[0] >= org.apache.http.HttpStatus.SC_BAD_REQUEST)
inputStream = connection.getErrorStream();
else
inputStream = connection.getInputStream();
for (java.util.Map.Entry<String, java.util.List<String>> entry : connection.getHeaderFields().entrySet())
if (entry.getKey() != null && entry.getValue() != null)
responseHeaders.append (entry.getKey() + ": "
+ android.text.TextUtils.join (",", entry.getValue()) + "\n");
}
public final void release()
@@ -634,30 +658,31 @@ public final class JuceAppActivity extends Activity
private long position;
}
public static final HTTPStream createHTTPStream (String address, boolean isPost, byte[] postData,
String headers, int timeOutMs,
java.lang.StringBuffer responseHeaders)
public static final HTTPStream createHTTPStream (String address,
boolean isPost, byte[] postData, String headers,
int timeOutMs, int[] statusCode,
StringBuffer responseHeaders)
{
try
{
HttpURLConnection connection = (HttpURLConnection) (new URL (address).openConnection());
HttpURLConnection connection = (HttpURLConnection) (new URL(address)
.openConnection());
if (connection != null)
{
try
{
if (isPost)
{
connection.setConnectTimeout (timeOutMs);
connection.setDoOutput (true);
connection.setChunkedStreamingMode (0);
connection.setRequestMethod("POST");
connection.setConnectTimeout(timeOutMs);
connection.setDoOutput(true);
connection.setChunkedStreamingMode(0);
OutputStream out = connection.getOutputStream();
out.write (postData);
out.write(postData);
out.flush();
}
return new HTTPStream (connection);
return new HTTPStream (connection, statusCode, responseHeaders);
}
catch (Throwable e)
{
@@ -665,8 +690,7 @@ public final class JuceAppActivity extends Activity
}
}
}
catch (Throwable e)
{}
catch (Throwable e) {}
return null;
}


+ 45
- 37
libs/juce/source/modules/juce_core/native/juce_android_JNIHelpers.h View File

@@ -251,7 +251,7 @@ extern AndroidSystem android;
class ThreadLocalJNIEnvHolder
{
public:
ThreadLocalJNIEnvHolder()
ThreadLocalJNIEnvHolder() noexcept
: jvm (nullptr)
{
zeromem (threads, sizeof (threads));
@@ -269,18 +269,19 @@ public:
addEnv (env);
}
JNIEnv* attach()
JNIEnv* attach() noexcept
{
JNIEnv* env = nullptr;
jvm->AttachCurrentThread (&env, nullptr);
if (env != nullptr)
addEnv (env);
if (JNIEnv* env = attachToCurrentThread())
{
SpinLock::ScopedLockType sl (addRemoveLock);
return addEnv (env);
}
return env;
jassertfalse;
return nullptr;
}
void detach()
void detach() noexcept
{
jvm->DetachCurrentThread();
@@ -294,54 +295,61 @@ public:
JNIEnv* getOrAttach() noexcept
{
JNIEnv* env = get();
if (JNIEnv* env = get())
return env;
if (env == nullptr)
env = attach();
SpinLock::ScopedLockType sl (addRemoveLock);
jassert (env != nullptr);
return env;
}
if (JNIEnv* env = get())
return env;
JNIEnv* get() const noexcept
{
const pthread_t thisThread = pthread_self();
for (int i = 0; i < maxThreads; ++i)
if (threads[i] == thisThread)
return envs[i];
if (JNIEnv* env = attachToCurrentThread())
return addEnv (env);
return nullptr;
}
enum { maxThreads = 32 };
private:
JavaVM* jvm;
enum { maxThreads = 32 };
pthread_t threads [maxThreads];
JNIEnv* envs [maxThreads];
SpinLock addRemoveLock;
void addEnv (JNIEnv* env)
JNIEnv* addEnv (JNIEnv* env) noexcept
{
SpinLock::ScopedLockType sl (addRemoveLock);
const pthread_t thisThread = pthread_self();
if (get() == nullptr)
for (int i = 0; i < maxThreads; ++i)
{
const pthread_t thisThread = pthread_self();
for (int i = 0; i < maxThreads; ++i)
if (threads[i] == 0)
{
if (threads[i] == 0)
{
envs[i] = env;
threads[i] = thisThread;
return;
}
envs[i] = env;
threads[i] = thisThread;
return env;
}
}
jassertfalse; // too many threads!
return nullptr;
}
JNIEnv* get() const noexcept
{
const pthread_t thisThread = pthread_self();
for (int i = 0; i < maxThreads; ++i)
if (threads[i] == thisThread)
return envs[i];
return nullptr;
}
JNIEnv* attachToCurrentThread()
{
JNIEnv* env = nullptr;
jvm->AttachCurrentThread (&env, nullptr);
return env;
}
};
@@ -357,7 +365,7 @@ extern ThreadLocalJNIEnvHolder threadLocalJNIEnvHolder;
METHOD (setClipboardContent, "setClipboardContent", "(Ljava/lang/String;)V") \
METHOD (excludeClipRegion, "excludeClipRegion", "(Landroid/graphics/Canvas;FFFF)V") \
METHOD (renderGlyph, "renderGlyph", "(CLandroid/graphics/Paint;Landroid/graphics/Matrix;Landroid/graphics/Rect;)[I") \
STATICMETHOD (createHTTPStream, "createHTTPStream", "(Ljava/lang/String;Z[BLjava/lang/String;ILjava/lang/StringBuffer;)L" JUCE_ANDROID_ACTIVITY_CLASSPATH "$HTTPStream;") \
STATICMETHOD (createHTTPStream, "createHTTPStream", "(Ljava/lang/String;Z[BLjava/lang/String;I[ILjava/lang/StringBuffer;)L" JUCE_ANDROID_ACTIVITY_CLASSPATH "$HTTPStream;") \
METHOD (launchURL, "launchURL", "(Ljava/lang/String;)V") \
METHOD (showMessageBox, "showMessageBox", "(Ljava/lang/String;Ljava/lang/String;J)V") \
METHOD (showOkCancelBox, "showOkCancelBox", "(Ljava/lang/String;Ljava/lang/String;J)V") \


+ 13
- 11
libs/juce/source/modules/juce_core/native/juce_android_Network.cpp View File

@@ -71,6 +71,7 @@ public:
WebInputStream (String address, bool isPost, const MemoryBlock& postData,
URL::OpenStreamProgressCallback* progressCallback, void* progressCallbackContext,
const String& headers, int timeOutMs, StringPairArray* responseHeaders)
: statusCode (0)
{
if (! address.contains ("://"))
address = "http://" + address;
@@ -91,6 +92,9 @@ public:
// thread. You'll need to move your networking code to a background thread to keep it happy..
jassert (Thread::getCurrentThread() != nullptr);
jintArray statusCodeArray = env->NewIntArray (1);
jassert (statusCodeArray != 0);
stream = GlobalRef (env->CallStaticObjectMethod (JuceAppActivity,
JuceAppActivity.createHTTPStream,
javaString (address).get(),
@@ -98,8 +102,14 @@ public:
postDataArray,
javaString (headers).get(),
(jint) timeOutMs,
statusCodeArray,
responseHeaderBuffer.get()));
jint* const statusCodeElements = env->GetIntArrayElements (statusCodeArray, 0);
statusCode = statusCodeElements[0];
env->ReleaseIntArrayElements (statusCodeArray, statusCodeElements, 0);
env->DeleteLocalRef (statusCodeArray);
if (postDataArray != 0)
env->DeleteLocalRef (postDataArray);
@@ -135,6 +145,8 @@ public:
}
//==============================================================================
bool isError() const { return stream == nullptr; }
bool isExhausted() override { return stream != nullptr && stream.callBooleanMethod (HTTPStream.isExhausted); }
int64 getTotalLength() override { return stream != nullptr ? stream.callLongMethod (HTTPStream.getTotalLength) : 0; }
int64 getPosition() override { return stream != nullptr ? stream.callLongMethod (HTTPStream.getPosition) : 0; }
@@ -162,18 +174,8 @@ public:
//==============================================================================
GlobalRef stream;
int statusCode;
private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (WebInputStream)