Browse Source

Updade juce

tags/2018-04-16
falkTX 9 years ago
parent
commit
d807208b0c
17 changed files with 52 additions and 15 deletions
  1. +2
    -2
      libs/juce/source/modules/juce_audio_devices/native/juce_android_OpenSL.cpp
  2. +10
    -4
      libs/juce/source/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp
  3. +1
    -1
      libs/juce/source/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp
  4. +1
    -0
      libs/juce/source/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm
  5. +1
    -0
      libs/juce/source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp
  6. +1
    -0
      libs/juce/source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp
  7. +1
    -0
      libs/juce/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
  8. +4
    -0
      libs/juce/source/modules/juce_audio_processors/processors/juce_PluginDescription.cpp
  9. +5
    -0
      libs/juce/source/modules/juce_audio_processors/processors/juce_PluginDescription.h
  10. +9
    -0
      libs/juce/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp
  11. +2
    -1
      libs/juce/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.h
  12. +1
    -1
      libs/juce/source/modules/juce_audio_processors/utilities/juce_AudioProcessorParameters.cpp
  13. +1
    -1
      libs/juce/source/modules/juce_audio_utils/gui/juce_BluetoothMidiDevicePairingDialogue.h
  14. +2
    -2
      libs/juce/source/modules/juce_core/system/juce_PlatformDefs.h
  15. +1
    -1
      libs/juce/source/modules/juce_core/system/juce_StandardHeader.h
  16. +1
    -1
      libs/juce/source/modules/juce_graphics/native/juce_android_Fonts.cpp
  17. +9
    -1
      libs/juce/source/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm

+ 2
- 2
libs/juce/source/modules/juce_audio_devices/native/juce_android_OpenSL.cpp View File

@@ -131,8 +131,8 @@ public:
outputBuffer.setSize (jmax (1, numOutputChannels), actualBufferSize);
outputBuffer.clear();
const int audioBuffersToEnqueue = hasLowLatencyAudioPath ? buffersToEnqueueForLowLatency
: buffersToEnqueueSlowAudio;
const int audioBuffersToEnqueue = hasLowLatencyAudioPath() ? buffersToEnqueueForLowLatency
: buffersToEnqueueSlowAudio;
DBG ("OpenSL: numInputChannels = " << numInputChannels
<< ", numOutputChannels = " << numOutputChannels


+ 10
- 4
libs/juce/source/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp View File

@@ -352,14 +352,20 @@ public:
int getLatencyFromDevice (AudioObjectPropertyScope scope) const
{
UInt32 lat = 0;
UInt32 size = sizeof (lat);
UInt32 latency = 0;
UInt32 size = sizeof (latency);
AudioObjectPropertyAddress pa;
pa.mElement = kAudioObjectPropertyElementMaster;
pa.mSelector = kAudioDevicePropertyLatency;
pa.mScope = scope;
AudioObjectGetPropertyData (deviceID, &pa, 0, nullptr, &size, &lat);
return (int) lat;
AudioObjectGetPropertyData (deviceID, &pa, 0, nullptr, &size, &latency);
UInt32 safetyOffset = 0;
size = sizeof (safetyOffset);
pa.mSelector = kAudioDevicePropertySafetyOffset;
AudioObjectGetPropertyData (deviceID, &pa, 0, nullptr, &size, &safetyOffset);
return (int) (latency + safetyOffset);
}
int getBitDepthFromDevice (AudioObjectPropertyScope scope) const


+ 1
- 1
libs/juce/source/modules/juce_audio_formats/codecs/juce_AiffAudioFormat.cpp View File

@@ -249,7 +249,7 @@ namespace AiffFileHelpers
data += isGenre ? 118 : 50;
if (data[0] == 0)
if (data < dataEnd && data[0] == 0)
{
if (data + 52 < dataEnd && isValidTag (data + 50)) data += 50;
else if (data + 120 < dataEnd && isValidTag (data + 118)) data += 118;


+ 1
- 0
libs/juce/source/modules/juce_audio_processors/format_types/juce_AudioUnitPluginFormat.mm View File

@@ -374,6 +374,7 @@ public:
^ ((int) componentDesc.componentSubType)
^ ((int) componentDesc.componentManufacturer);
desc.lastFileModTime = Time();
desc.lastInfoUpdateTime = Time::getCurrentTime();
desc.pluginFormatName = "AudioUnit";
desc.category = AudioUnitFormatHelpers::getCategory (componentDesc.componentType);
desc.manufacturerName = manufacturer;


+ 1
- 0
libs/juce/source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp View File

@@ -220,6 +220,7 @@ public:
desc.fileOrIdentifier = module->file.getFullPathName();
desc.uid = getUID();
desc.lastFileModTime = module->file.getLastModificationTime();
desc.lastInfoUpdateTime = Time::getCurrentTime();
desc.pluginFormatName = "LADSPA";
desc.category = getCategory();
desc.manufacturerName = plugin != nullptr ? String (plugin->Maker) : String();


+ 1
- 0
libs/juce/source/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp View File

@@ -110,6 +110,7 @@ static void createPluginDescription (PluginDescription& description,
{
description.fileOrIdentifier = pluginFile.getFullPathName();
description.lastFileModTime = pluginFile.getLastModificationTime();
description.lastInfoUpdateTime = Time::getCurrentTime();
description.manufacturerName = company;
description.name = name;
description.descriptiveName = name;


+ 1
- 0
libs/juce/source/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp View File

@@ -804,6 +804,7 @@ public:
desc.fileOrIdentifier = module->file.getFullPathName();
desc.uid = getUID();
desc.lastFileModTime = module->file.getLastModificationTime();
desc.lastInfoUpdateTime = Time::getCurrentTime();
desc.pluginFormatName = "VST";
desc.category = getCategory();


+ 4
- 0
libs/juce/source/modules/juce_audio_processors/processors/juce_PluginDescription.cpp View File

@@ -44,6 +44,7 @@ PluginDescription::PluginDescription (const PluginDescription& other)
version (other.version),
fileOrIdentifier (other.fileOrIdentifier),
lastFileModTime (other.lastFileModTime),
lastInfoUpdateTime (other.lastInfoUpdateTime),
uid (other.uid),
isInstrument (other.isInstrument),
numInputChannels (other.numInputChannels),
@@ -64,6 +65,7 @@ PluginDescription& PluginDescription::operator= (const PluginDescription& other)
uid = other.uid;
isInstrument = other.isInstrument;
lastFileModTime = other.lastFileModTime;
lastInfoUpdateTime = other.lastInfoUpdateTime;
numInputChannels = other.numInputChannels;
numOutputChannels = other.numOutputChannels;
hasSharedContainer = other.hasSharedContainer;
@@ -108,6 +110,7 @@ XmlElement* PluginDescription::createXml() const
e->setAttribute ("uid", String::toHexString (uid));
e->setAttribute ("isInstrument", isInstrument);
e->setAttribute ("fileTime", String::toHexString (lastFileModTime.toMilliseconds()));
e->setAttribute ("infoUpdateTime", String::toHexString (lastInfoUpdateTime.toMilliseconds()));
e->setAttribute ("numInputs", numInputChannels);
e->setAttribute ("numOutputs", numOutputChannels);
e->setAttribute ("isShell", hasSharedContainer);
@@ -129,6 +132,7 @@ bool PluginDescription::loadFromXml (const XmlElement& xml)
uid = xml.getStringAttribute ("uid").getHexValue32();
isInstrument = xml.getBoolAttribute ("isInstrument", false);
lastFileModTime = Time (xml.getStringAttribute ("fileTime").getHexValue64());
lastInfoUpdateTime = Time (xml.getStringAttribute ("infoUpdateTime").getHexValue64());
numInputChannels = xml.getIntAttribute ("numInputs");
numOutputChannels = xml.getIntAttribute ("numOutputs");
hasSharedContainer = xml.getBoolAttribute ("isShell", false);


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

@@ -81,6 +81,11 @@ public:
*/
Time lastFileModTime;
/** The last time that this information was updated. This would typically have
been during a scan when this plugin was first tested or found to have changed.
*/
Time lastInfoUpdateTime;
/** A unique ID for the plug-in.
Note that this might not be unique between formats, e.g. a VST and some


+ 9
- 0
libs/juce/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp View File

@@ -263,6 +263,7 @@ struct PluginSorter
case KnownPluginList::sortByManufacturer: diff = first->manufacturerName.compareNatural (second->manufacturerName); break;
case KnownPluginList::sortByFormat: diff = first->pluginFormatName.compare (second->pluginFormatName); break;
case KnownPluginList::sortByFileSystemLocation: diff = lastPathPart (first->fileOrIdentifier).compare (lastPathPart (second->fileOrIdentifier)); break;
case KnownPluginList::sortByInfoUpdateTime: diff = compare (first->lastInfoUpdateTime, second->lastInfoUpdateTime); break;
default: break;
}
@@ -278,6 +279,14 @@ private:
return path.replaceCharacter ('\\', '/').upToLastOccurrenceOf ("/", false, false);
}
static int compare (Time a, Time b) noexcept
{
if (a < b) return -1;
if (b < a) return 1;
return 0;
}
const KnownPluginList::SortMethod method;
const int direction;


+ 2
- 1
libs/juce/source/modules/juce_audio_processors/scanning/juce_KnownPluginList.h View File

@@ -136,7 +136,8 @@ public:
sortByCategory,
sortByManufacturer,
sortByFormat,
sortByFileSystemLocation
sortByFileSystemLocation,
sortByInfoUpdateTime
};
//==============================================================================


+ 1
- 1
libs/juce/source/modules/juce_audio_processors/utilities/juce_AudioProcessorParameters.cpp View File

@@ -136,7 +136,7 @@ AudioParameterChoice::AudioParameterChoice (String pid, String nm, const StringA
AudioParameterChoice::~AudioParameterChoice() {}
int AudioParameterChoice::limitRange (int v) const noexcept { return jlimit (0, choices.size() - 1, v); }
float AudioParameterChoice::convertTo0to1 (int v) const noexcept { return limitRange (v) / (float) choices.size(); }
float AudioParameterChoice::convertTo0to1 (int v) const noexcept { return jlimit (0.0f, 1.0f, (v + 0.5f) / (float) choices.size()); }
int AudioParameterChoice::convertFrom0to1 (float v) const noexcept { return limitRange ((int) (v * (float) choices.size())); }
float AudioParameterChoice::getValue() const { return convertTo0to1 (roundToInt (value)); }


+ 1
- 1
libs/juce/source/modules/juce_audio_utils/gui/juce_BluetoothMidiDevicePairingDialogue.h View File

@@ -63,7 +63,7 @@ public:
higher, and additionally only if the device itself supports MIDI
over Bluetooth.
On deskrop platforms, this will typically be false as the bluetooth
On desktop platforms, this will typically be false as the bluetooth
pairing is not done inside the app but by other means.
@return true if the Bluetooth MIDI pairing dialogue is available,


+ 2
- 2
libs/juce/source/modules/juce_core/system/juce_PlatformDefs.h View File

@@ -164,13 +164,13 @@
#define JUCE_STRINGIFY(item) JUCE_STRINGIFY_MACRO_HELPER (item)
//==============================================================================
#ifdef JUCE_COMPILER_SUPPORTS_STATIC_ASSERT
#if JUCE_COMPILER_SUPPORTS_STATIC_ASSERT
/** A compile-time assertion macro.
If the expression parameter is false, the macro will cause a compile error. (The actual error
message that the compiler generates may be completely bizarre and seem to have no relation to
the place where you put the static_assert though!)
*/
#define static_jassert(expression) static_assert (expression);
#define static_jassert(expression) static_assert(expression, #expression);
#else
#ifndef DOXYGEN
namespace juce


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

@@ -52,8 +52,8 @@
//==============================================================================
#include <vector> // included before platform defs to provide a definition of _LIBCPP_VERSION
#include "juce_PlatformDefs.h"
#include "juce_CompilerSupport.h"
#include "juce_PlatformDefs.h"
//==============================================================================
// Now we'll include some common OS headers..


+ 1
- 1
libs/juce/source/modules/juce_graphics/native/juce_android_Fonts.cpp View File

@@ -165,7 +165,7 @@ public:
}
AndroidTypeface (const void* data, size_t size)
: Typeface (String(), String())
: Typeface (String (static_cast<uint64> (reinterpret_cast<uintptr_t> (data))), String())
{
JNIEnv* const env = getEnv();


+ 9
- 1
libs/juce/source/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm View File

@@ -1090,7 +1090,15 @@ public:
static float getMousePressure (NSEvent* e) noexcept
{
return (float) e.pressure;
@try
{
if (e.type != NSMouseEntered && e.type != NSMouseExited)
return (float) e.pressure;
}
@catch (NSException* e) {}
@finally {}
return 0.0f;
}
static Point<float> getMousePos (NSEvent* e, NSView* view)


Loading…
Cancel
Save