Browse Source

Changes to VST code to help compiling in 64-bit mode.

tags/2021-05-28
Julian Storer 14 years ago
parent
commit
7dd208a8b1
9 changed files with 89 additions and 124 deletions
  1. +39
    -57
      juce_amalgamated.cpp
  2. +4
    -2
      juce_amalgamated.h
  3. +1
    -1
      src/audio/plugin_client/AU/juce_AU_Wrapper.mm
  4. +2
    -4
      src/audio/plugin_client/VST/juce_VST_Wrapper.mm
  5. +0
    -1
      src/audio/plugin_client/juce_IncludeCharacteristics.h
  6. +6
    -6
      src/audio/processors/juce_AudioProcessor.cpp
  7. +33
    -51
      src/containers/juce_Variant.cpp
  8. +2
    -0
      src/containers/juce_Variant.h
  9. +2
    -2
      src/core/juce_StandardHeader.h

+ 39
- 57
juce_amalgamated.cpp View File

@@ -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<var>& 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<var>& 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<var>& 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;)
{


+ 4
- 2
juce_amalgamated.h View File

@@ -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;


+ 1
- 1
src/audio/plugin_client/AU/juce_AU_Wrapper.mm View File

@@ -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


+ 2
- 4
src/audio/plugin_client/VST/juce_VST_Wrapper.mm View File

@@ -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()


+ 0
- 1
src/audio/plugin_client/juce_IncludeCharacteristics.h View File

@@ -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


+ 6
- 6
src/audio/processors/juce_AudioProcessor.cpp View File

@@ -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;)
{


+ 33
- 51
src/containers/juce_Variant.cpp View File

@@ -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<var>& 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<var>& 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<var>& 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;
}
}


+ 2
- 0
src/containers/juce_Variant.h View File

@@ -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;


+ 2
- 2
src/core/juce_StandardHeader.h View File

@@ -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.


Loading…
Cancel
Save