diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 37a1e453a1..3183e60dbc 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -4425,7 +4425,13 @@ public: static const VariantType_Object instance; void cleanUp (ValueUnion& data) const noexcept { if (data.objectValue != nullptr) data.objectValue->decReferenceCount(); } - void createCopy (ValueUnion& dest, const ValueUnion& source) const { dest.objectValue = source.objectValue; if (dest.objectValue != nullptr) dest.objectValue->incReferenceCount(); } + + void createCopy (ValueUnion& dest, const ValueUnion& source) const + { + dest.objectValue = source.objectValue; + if (dest.objectValue != nullptr) + dest.objectValue->incReferenceCount(); + } String toString (const ValueUnion& data) const { return "Object 0x" + String::toHexString ((int) (pointer_sized_int) data.objectValue); } bool toBool (const ValueUnion& data) const noexcept { return data.objectValue != 0; } @@ -4526,40 +4532,15 @@ var::var (const var& valueToCopy) : type (valueToCopy.type) type->createCopy (value, valueToCopy.value); } -var::var (const int value_) noexcept : type (&VariantType_Int::instance) -{ - value.intValue = value_; -} +var::var (const int value_) noexcept : type (&VariantType_Int::instance) { value.intValue = value_; } +var::var (const int64 value_) noexcept : type (&VariantType_Int64::instance) { value.int64Value = value_; } +var::var (const bool value_) noexcept : type (&VariantType_Bool::instance) { value.boolValue = value_; } +var::var (const double value_) noexcept : type (&VariantType_Double::instance) { value.doubleValue = value_; } +var::var (MethodFunction method_) noexcept : type (&VariantType_Method::instance) { value.methodValue = method_; } -var::var (const int64 value_) noexcept : type (&VariantType_Int64::instance) -{ - value.int64Value = value_; -} - -var::var (const bool value_) noexcept : type (&VariantType_Bool::instance) -{ - value.boolValue = value_; -} - -var::var (const double value_) noexcept : type (&VariantType_Double::instance) -{ - value.doubleValue = value_; -} - -var::var (const String& value_) : type (&VariantType_String::instance) -{ - new (value.stringValue) String (value_); -} - -var::var (const char* const value_) : type (&VariantType_String::instance) -{ - new (value.stringValue) String (value_); -} - -var::var (const wchar_t* const value_) : type (&VariantType_String::instance) -{ - new (value.stringValue) String (value_); -} +var::var (const String& value_) : type (&VariantType_String::instance) { new (value.stringValue) String (value_); } +var::var (const char* const value_) : type (&VariantType_String::instance) { new (value.stringValue) String (value_); } +var::var (const wchar_t* const value_) : type (&VariantType_String::instance) { new (value.stringValue) String (value_); } var::var (const Array& value_) : type (&VariantType_Array::instance) { @@ -4574,11 +4555,6 @@ var::var (ReferenceCountedObject* const object) : type (&VariantType_Object::in object->incReferenceCount(); } -var::var (MethodFunction method_) noexcept : type (&VariantType_Method::instance) -{ - value.methodValue = method_; -} - bool var::isVoid() const noexcept { return type->isVoid(); } bool var::isInt() const noexcept { return type->isInt(); } bool var::isInt64() const noexcept { return type->isInt64(); } @@ -4606,17 +4582,17 @@ void var::swapWith (var& other) noexcept std::swap (value, other.value); } -const var& var::operator= (const var& newValue) { type->cleanUp (value); type = newValue.type; type->createCopy (value, newValue.value); return *this; } -const var& var::operator= (const int newValue) { type->cleanUp (value); type = &VariantType_Int::instance; value.intValue = newValue; return *this; } -const var& var::operator= (const int64 newValue) { type->cleanUp (value); type = &VariantType_Int64::instance; value.int64Value = newValue; return *this; } -const var& var::operator= (const bool newValue) { type->cleanUp (value); type = &VariantType_Bool::instance; value.boolValue = newValue; return *this; } -const var& var::operator= (const double newValue) { type->cleanUp (value); type = &VariantType_Double::instance; value.doubleValue = newValue; return *this; } -const var& var::operator= (const char* const newValue) { var v (newValue); swapWith (v); return *this; } -const var& var::operator= (const wchar_t* const newValue) { var v (newValue); swapWith (v); return *this; } -const var& var::operator= (const String& newValue) { var v (newValue); swapWith (v); return *this; } -const var& var::operator= (const Array& newValue) { var v (newValue); swapWith (v); return *this; } -const var& var::operator= (ReferenceCountedObject* newValue) { var v (newValue); swapWith (v); return *this; } -const var& var::operator= (MethodFunction newValue) { var v (newValue); swapWith (v); return *this; } +const var& var::operator= (const var& v) { type->cleanUp (value); type = v.type; type->createCopy (value, v.value); return *this; } +const var& var::operator= (const int v) { type->cleanUp (value); type = &VariantType_Int::instance; value.intValue = v; return *this; } +const var& var::operator= (const int64 v) { type->cleanUp (value); type = &VariantType_Int64::instance; value.int64Value = v; return *this; } +const var& var::operator= (const bool v) { type->cleanUp (value); type = &VariantType_Bool::instance; value.boolValue = v; return *this; } +const var& var::operator= (const double v) { type->cleanUp (value); type = &VariantType_Double::instance; value.doubleValue = v; return *this; } +const var& var::operator= (const char* const v) { type->cleanUp (value); type = &VariantType_String::instance; new (value.stringValue) String (v); return *this; } +const var& var::operator= (const wchar_t* const v) { type->cleanUp (value); type = &VariantType_String::instance; new (value.stringValue) String (v); return *this; } +const var& var::operator= (const String& v) { type->cleanUp (value); type = &VariantType_String::instance; new (value.stringValue) String (v); return *this; } +const var& var::operator= (const Array& v) { var v2 (v); swapWith (v2); return *this; } +const var& var::operator= (ReferenceCountedObject* v) { var v2 (v); swapWith (v2); return *this; } +const var& var::operator= (MethodFunction v) { var v2 (v); swapWith (v2); return *this; } bool var::equals (const var& other) const noexcept { @@ -4641,6 +4617,11 @@ var var::operator[] (const Identifier& propertyName) const return o != nullptr ? o->getProperty (propertyName) : var::null; } +var var::operator[] (const char* const propertyName) const +{ + return operator[] (Identifier (propertyName)); +} + var var::invoke (const Identifier& method, const var* arguments, int numArguments) const { DynamicObject* const o = getDynamicObject(); @@ -4803,7 +4784,8 @@ var var::readFromStream (InputStream& input) return v; } - default: input.skipNextBytes (numBytes - 1); break; + default: + input.skipNextBytes (numBytes - 1); break; } } @@ -37126,11 +37108,11 @@ AudioProcessor::~AudioProcessor() // that it refers to is deleted.. jassert (activeEditor == nullptr); -#if JUCE_DEBUG + #if JUCE_DEBUG // This will fail if you've called beginParameterChangeGesture() for one // or more parameters without having made a corresponding call to endParameterChangeGesture... jassert (changingParams.countNumberOfSetBits() == 0); -#endif + #endif } void AudioProcessor::setPlayHead (AudioPlayHead* const newPlayHead) noexcept @@ -37204,12 +37186,12 @@ void AudioProcessor::beginParameterChangeGesture (int parameterIndex) { jassert (isPositiveAndBelow (parameterIndex, getNumParameters())); -#if JUCE_DEBUG + #if JUCE_DEBUG // This means you've called beginParameterChangeGesture twice in succession without a matching // call to endParameterChangeGesture. That might be fine in most hosts, but better to avoid doing it. jassert (! changingParams [parameterIndex]); changingParams.setBit (parameterIndex); -#endif + #endif for (int i = listeners.size(); --i >= 0;) { @@ -37229,13 +37211,13 @@ void AudioProcessor::endParameterChangeGesture (int parameterIndex) { jassert (isPositiveAndBelow (parameterIndex, getNumParameters())); -#if JUCE_DEBUG + #if JUCE_DEBUG // This means you've called endParameterChangeGesture without having previously called // endParameterChangeGesture. That might be fine in most hosts, but better to keep the // calls matched correctly. jassert (changingParams [parameterIndex]); changingParams.clearBit (parameterIndex); -#endif + #endif for (int i = listeners.size(); --i >= 0;) { diff --git a/juce_amalgamated.h b/juce_amalgamated.h index d3b8a50de3..91a531cbff 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -72,8 +72,8 @@ namespace JuceDummyNamespace {} See also SystemStats::getJUCEVersion() for a string version. */ #define JUCE_MAJOR_VERSION 1 -#define JUCE_MINOR_VERSION 53 -#define JUCE_BUILDNUMBER 107 +#define JUCE_MINOR_VERSION 54 +#define JUCE_BUILDNUMBER 2 /** Current Juce version number. @@ -8638,6 +8638,8 @@ public: /** If this variant is an object, this returns one of its properties. */ var operator[] (const Identifier& propertyName) const; + /** If this variant is an object, this returns one of its properties. */ + var operator[] (const char* propertyName) const; /** If this variant is an object, this invokes one of its methods with no arguments. */ var call (const Identifier& method) const; diff --git a/src/audio/plugin_client/AU/juce_AU_Wrapper.mm b/src/audio/plugin_client/AU/juce_AU_Wrapper.mm index f1467d94e8..37f00bb224 100644 --- a/src/audio/plugin_client/AU/juce_AU_Wrapper.mm +++ b/src/audio/plugin_client/AU/juce_AU_Wrapper.mm @@ -37,7 +37,7 @@ well as ones that can open a cocoa view. If this is enabled, you'll need to also add the AUCarbonBase files to your project. */ -#ifndef BUILD_AU_CARBON_UI +#if ! (defined (BUILD_AU_CARBON_UI) || JUCE_64BIT) #define BUILD_AU_CARBON_UI 1 #endif diff --git a/src/audio/plugin_client/VST/juce_VST_Wrapper.mm b/src/audio/plugin_client/VST/juce_VST_Wrapper.mm index ce58a5d144..839895ed9f 100644 --- a/src/audio/plugin_client/VST/juce_VST_Wrapper.mm +++ b/src/audio/plugin_client/VST/juce_VST_Wrapper.mm @@ -36,13 +36,10 @@ #include "../juce_PluginHeaders.h" #include "../juce_PluginHostType.h" -#if ! (JUCE_64BIT || defined (ADD_CARBON_BODGE)) - #define ADD_CARBON_BODGE 1 // see note below.. -#endif - //============================================================================== BEGIN_JUCE_NAMESPACE +#if ! JUCE_64BIT static void updateComponentPos (Component* const comp) { HIViewRef dummyView = (HIViewRef) (void*) (pointer_sized_int) @@ -66,6 +63,7 @@ static pascal OSStatus viewBoundsChangedEvent (EventHandlerCallRef, EventRef, vo updateComponentPos ((Component*) user); return noErr; } +#endif //============================================================================== void initialiseMac() diff --git a/src/audio/plugin_client/juce_IncludeCharacteristics.h b/src/audio/plugin_client/juce_IncludeCharacteristics.h index efb5a35c31..335ba053a2 100644 --- a/src/audio/plugin_client/juce_IncludeCharacteristics.h +++ b/src/audio/plugin_client/juce_IncludeCharacteristics.h @@ -94,7 +94,6 @@ //============================================================================== #if __LP64__ && (defined(__APPLE_CPP__) || defined(__APPLE_CC__)) // (disable VSTs and RTAS in a 64-bit mac build) - #undef JucePlugin_Build_VST #undef JucePlugin_Build_RTAS #endif diff --git a/src/audio/processors/juce_AudioProcessor.cpp b/src/audio/processors/juce_AudioProcessor.cpp index 6989f4ca3c..c9ea1583fc 100644 --- a/src/audio/processors/juce_AudioProcessor.cpp +++ b/src/audio/processors/juce_AudioProcessor.cpp @@ -50,11 +50,11 @@ AudioProcessor::~AudioProcessor() // that it refers to is deleted.. jassert (activeEditor == nullptr); -#if JUCE_DEBUG + #if JUCE_DEBUG // This will fail if you've called beginParameterChangeGesture() for one // or more parameters without having made a corresponding call to endParameterChangeGesture... jassert (changingParams.countNumberOfSetBits() == 0); -#endif + #endif } void AudioProcessor::setPlayHead (AudioPlayHead* const newPlayHead) noexcept @@ -128,12 +128,12 @@ void AudioProcessor::beginParameterChangeGesture (int parameterIndex) { jassert (isPositiveAndBelow (parameterIndex, getNumParameters())); -#if JUCE_DEBUG + #if JUCE_DEBUG // This means you've called beginParameterChangeGesture twice in succession without a matching // call to endParameterChangeGesture. That might be fine in most hosts, but better to avoid doing it. jassert (! changingParams [parameterIndex]); changingParams.setBit (parameterIndex); -#endif + #endif for (int i = listeners.size(); --i >= 0;) { @@ -153,13 +153,13 @@ void AudioProcessor::endParameterChangeGesture (int parameterIndex) { jassert (isPositiveAndBelow (parameterIndex, getNumParameters())); -#if JUCE_DEBUG + #if JUCE_DEBUG // This means you've called endParameterChangeGesture without having previously called // endParameterChangeGesture. That might be fine in most hosts, but better to keep the // calls matched correctly. jassert (changingParams [parameterIndex]); changingParams.clearBit (parameterIndex); -#endif + #endif for (int i = listeners.size(); --i >= 0;) { diff --git a/src/containers/juce_Variant.cpp b/src/containers/juce_Variant.cpp index 08ee49d393..931dc889da 100644 --- a/src/containers/juce_Variant.cpp +++ b/src/containers/juce_Variant.cpp @@ -240,7 +240,13 @@ public: static const VariantType_Object instance; void cleanUp (ValueUnion& data) const noexcept { if (data.objectValue != nullptr) data.objectValue->decReferenceCount(); } - void createCopy (ValueUnion& dest, const ValueUnion& source) const { dest.objectValue = source.objectValue; if (dest.objectValue != nullptr) dest.objectValue->incReferenceCount(); } + + void createCopy (ValueUnion& dest, const ValueUnion& source) const + { + dest.objectValue = source.objectValue; + if (dest.objectValue != nullptr) + dest.objectValue->incReferenceCount(); + } String toString (const ValueUnion& data) const { return "Object 0x" + String::toHexString ((int) (pointer_sized_int) data.objectValue); } bool toBool (const ValueUnion& data) const noexcept { return data.objectValue != 0; } @@ -347,40 +353,15 @@ var::var (const var& valueToCopy) : type (valueToCopy.type) type->createCopy (value, valueToCopy.value); } -var::var (const int value_) noexcept : type (&VariantType_Int::instance) -{ - value.intValue = value_; -} - -var::var (const int64 value_) noexcept : type (&VariantType_Int64::instance) -{ - value.int64Value = value_; -} - -var::var (const bool value_) noexcept : type (&VariantType_Bool::instance) -{ - value.boolValue = value_; -} - -var::var (const double value_) noexcept : type (&VariantType_Double::instance) -{ - value.doubleValue = value_; -} - -var::var (const String& value_) : type (&VariantType_String::instance) -{ - new (value.stringValue) String (value_); -} +var::var (const int value_) noexcept : type (&VariantType_Int::instance) { value.intValue = value_; } +var::var (const int64 value_) noexcept : type (&VariantType_Int64::instance) { value.int64Value = value_; } +var::var (const bool value_) noexcept : type (&VariantType_Bool::instance) { value.boolValue = value_; } +var::var (const double value_) noexcept : type (&VariantType_Double::instance) { value.doubleValue = value_; } +var::var (MethodFunction method_) noexcept : type (&VariantType_Method::instance) { value.methodValue = method_; } -var::var (const char* const value_) : type (&VariantType_String::instance) -{ - new (value.stringValue) String (value_); -} - -var::var (const wchar_t* const value_) : type (&VariantType_String::instance) -{ - new (value.stringValue) String (value_); -} +var::var (const String& value_) : type (&VariantType_String::instance) { new (value.stringValue) String (value_); } +var::var (const char* const value_) : type (&VariantType_String::instance) { new (value.stringValue) String (value_); } +var::var (const wchar_t* const value_) : type (&VariantType_String::instance) { new (value.stringValue) String (value_); } var::var (const Array& value_) : type (&VariantType_Array::instance) { @@ -395,11 +376,6 @@ var::var (ReferenceCountedObject* const object) : type (&VariantType_Object::in object->incReferenceCount(); } -var::var (MethodFunction method_) noexcept : type (&VariantType_Method::instance) -{ - value.methodValue = method_; -} - //============================================================================== bool var::isVoid() const noexcept { return type->isVoid(); } bool var::isInt() const noexcept { return type->isInt(); } @@ -429,17 +405,17 @@ void var::swapWith (var& other) noexcept std::swap (value, other.value); } -const var& var::operator= (const var& newValue) { type->cleanUp (value); type = newValue.type; type->createCopy (value, newValue.value); return *this; } -const var& var::operator= (const int newValue) { type->cleanUp (value); type = &VariantType_Int::instance; value.intValue = newValue; return *this; } -const var& var::operator= (const int64 newValue) { type->cleanUp (value); type = &VariantType_Int64::instance; value.int64Value = newValue; return *this; } -const var& var::operator= (const bool newValue) { type->cleanUp (value); type = &VariantType_Bool::instance; value.boolValue = newValue; return *this; } -const var& var::operator= (const double newValue) { type->cleanUp (value); type = &VariantType_Double::instance; value.doubleValue = newValue; return *this; } -const var& var::operator= (const char* const newValue) { var v (newValue); swapWith (v); return *this; } -const var& var::operator= (const wchar_t* const newValue) { var v (newValue); swapWith (v); return *this; } -const var& var::operator= (const String& newValue) { var v (newValue); swapWith (v); return *this; } -const var& var::operator= (const Array& newValue) { var v (newValue); swapWith (v); return *this; } -const var& var::operator= (ReferenceCountedObject* newValue) { var v (newValue); swapWith (v); return *this; } -const var& var::operator= (MethodFunction newValue) { var v (newValue); swapWith (v); return *this; } +const var& var::operator= (const var& v) { type->cleanUp (value); type = v.type; type->createCopy (value, v.value); return *this; } +const var& var::operator= (const int v) { type->cleanUp (value); type = &VariantType_Int::instance; value.intValue = v; return *this; } +const var& var::operator= (const int64 v) { type->cleanUp (value); type = &VariantType_Int64::instance; value.int64Value = v; return *this; } +const var& var::operator= (const bool v) { type->cleanUp (value); type = &VariantType_Bool::instance; value.boolValue = v; return *this; } +const var& var::operator= (const double v) { type->cleanUp (value); type = &VariantType_Double::instance; value.doubleValue = v; return *this; } +const var& var::operator= (const char* const v) { type->cleanUp (value); type = &VariantType_String::instance; new (value.stringValue) String (v); return *this; } +const var& var::operator= (const wchar_t* const v) { type->cleanUp (value); type = &VariantType_String::instance; new (value.stringValue) String (v); return *this; } +const var& var::operator= (const String& v) { type->cleanUp (value); type = &VariantType_String::instance; new (value.stringValue) String (v); return *this; } +const var& var::operator= (const Array& v) { var v2 (v); swapWith (v2); return *this; } +const var& var::operator= (ReferenceCountedObject* v) { var v2 (v); swapWith (v2); return *this; } +const var& var::operator= (MethodFunction v) { var v2 (v); swapWith (v2); return *this; } //============================================================================== bool var::equals (const var& other) const noexcept @@ -467,6 +443,11 @@ var var::operator[] (const Identifier& propertyName) const return o != nullptr ? o->getProperty (propertyName) : var::null; } +var var::operator[] (const char* const propertyName) const +{ + return operator[] (Identifier (propertyName)); +} + var var::invoke (const Identifier& method, const var* arguments, int numArguments) const { DynamicObject* const o = getDynamicObject(); @@ -631,7 +612,8 @@ var var::readFromStream (InputStream& input) return v; } - default: input.skipNextBytes (numBytes - 1); break; + default: + input.skipNextBytes (numBytes - 1); break; } } diff --git a/src/containers/juce_Variant.h b/src/containers/juce_Variant.h index 7d8041f007..9c9dc125c4 100644 --- a/src/containers/juce_Variant.h +++ b/src/containers/juce_Variant.h @@ -192,6 +192,8 @@ public: //============================================================================== /** If this variant is an object, this returns one of its properties. */ var operator[] (const Identifier& propertyName) const; + /** If this variant is an object, this returns one of its properties. */ + var operator[] (const char* propertyName) const; /** If this variant is an object, this invokes one of its methods with no arguments. */ var call (const Identifier& method) const; diff --git a/src/core/juce_StandardHeader.h b/src/core/juce_StandardHeader.h index a9212a5be5..66925e98ab 100644 --- a/src/core/juce_StandardHeader.h +++ b/src/core/juce_StandardHeader.h @@ -32,8 +32,8 @@ See also SystemStats::getJUCEVersion() for a string version. */ #define JUCE_MAJOR_VERSION 1 -#define JUCE_MINOR_VERSION 53 -#define JUCE_BUILDNUMBER 107 +#define JUCE_MINOR_VERSION 54 +#define JUCE_BUILDNUMBER 2 /** Current Juce version number.