diff --git a/extras/audio plugin host/src/plugins/vst/juce_VSTPluginInstance.cpp b/extras/audio plugin host/src/plugins/vst/juce_VSTPluginInstance.cpp index 92bba8b3c4..2a10501d57 100644 --- a/extras/audio plugin host/src/plugins/vst/juce_VSTPluginInstance.cpp +++ b/extras/audio plugin host/src/plugins/vst/juce_VSTPluginInstance.cpp @@ -173,11 +173,10 @@ static Array activeWindows; //============================================================================== #if JUCE_MAC -namespace JUCE_NAMESPACE -{ - extern bool juce_isHIViewCreatedByJuce (HIViewRef view); - extern bool juce_isWindowCreatedByJuce (WindowRef window); -} +BEGIN_JUCE_NAMESPACE + extern bool juce_isHIViewCreatedByJuce (HIViewRef view); + extern bool juce_isWindowCreatedByJuce (WindowRef window); +END_JUCE_NAMESPACE #if JUCE_PPC static void* NewCFMFromMachO (void* const machofp) throw() @@ -791,8 +790,6 @@ void VSTPluginInstance::prepareToPlay (double sampleRate_, setLatencySamples (effect->initialDelay); - midiCollector.reset (sampleRate_); - juce_free (channels); channels = (float**) juce_calloc (sizeof (float*) * jmax (16, getNumOutputChannels() + 2, getNumInputChannels() + 2)); @@ -845,7 +842,6 @@ void VSTPluginInstance::releaseResources() setPower (false); } - midiCollector.reset (getSampleRate()); tempBuffer.setSize (1, 1); incomingMidi.clear(); @@ -1076,7 +1072,7 @@ public: closePluginWindow(); activeWindows.removeValue (this); - plugin.editorBeingDeleted (this); + plugin.editorBeingDeleted (this); } //============================================================================== diff --git a/extras/audio plugin host/src/plugins/vst/juce_VSTPluginInstance.h b/extras/audio plugin host/src/plugins/vst/juce_VSTPluginInstance.h index 52e8246e00..19d32ea98b 100644 --- a/extras/audio plugin host/src/plugins/vst/juce_VSTPluginInstance.h +++ b/extras/audio plugin host/src/plugins/vst/juce_VSTPluginInstance.h @@ -57,7 +57,7 @@ struct fxProgram; //============================================================================== /** - An instance of a plugin, created by a VSTPluginType. + An instance of a plugin, created by a VSTPluginFormat. */ class VSTPluginInstance : public AudioPluginInstance, @@ -128,7 +128,6 @@ public: juce_UseDebuggingNewOperator private: - friend class VSTPluginType; friend class VSTPluginWindow; friend class VSTPluginFormat; @@ -137,7 +136,6 @@ private: CriticalSection lock; bool wantsMidiMessages, initialised, isPowerOn; mutable StringArray programNames; - MidiMessageCollector midiCollector; AudioSampleBuffer tempBuffer; CriticalSection midiInLock; MidiBuffer incomingMidi; diff --git a/src/juce_appframework/gui/graphics/fonts/juce_Font.h b/src/juce_appframework/gui/graphics/fonts/juce_Font.h index b9db6e8c8a..914938a1ac 100644 --- a/src/juce_appframework/gui/graphics/fonts/juce_Font.h +++ b/src/juce_appframework/gui/graphics/fonts/juce_Font.h @@ -33,7 +33,6 @@ #define __JUCE_FONT_JUCEHEADER__ #include "juce_Typeface.h" -#include "../geometry/juce_Path.h" #include "../../../../juce_core/text/juce_StringArray.h" #include "../../../../juce_core/containers/juce_ReferenceCountedObject.h" #include "../../../../juce_core/containers/juce_OwnedArray.h" diff --git a/src/juce_appframework/gui/graphics/fonts/juce_Typeface.cpp b/src/juce_appframework/gui/graphics/fonts/juce_Typeface.cpp index 0ae2aa2f47..87307ed26e 100644 --- a/src/juce_appframework/gui/graphics/fonts/juce_Typeface.cpp +++ b/src/juce_appframework/gui/graphics/fonts/juce_Typeface.cpp @@ -277,57 +277,53 @@ const Path* Typeface::getOutlineForGlyph (const juce_wchar character) throw() const TypefaceGlyphInfo* Typeface::getGlyph (const juce_wchar character) throw() { - if (character > 0 && character < 128 && lookupTable [character] > 0) - return (const TypefaceGlyphInfo*) glyphs [(int)lookupTable [character]]; - - const TypefaceGlyphInfo* glyph = 0; + if (((unsigned int) character) < 128 && lookupTable [character] > 0) + return (const TypefaceGlyphInfo*) glyphs [(int) lookupTable [character]]; for (int i = 0; i < glyphs.size(); ++i) { - const TypefaceGlyphInfo* const g = (TypefaceGlyphInfo*) glyphs.getUnchecked(i); + const TypefaceGlyphInfo* const g = (const TypefaceGlyphInfo*) glyphs.getUnchecked(i); if (g->character == character) - { - glyph = g; - break; - } + return g; } - if (glyph == 0) + if (! isFullyPopulated) { - if (! isFullyPopulated) + findAndAddSystemGlyph (character); + + for (int i = 0; i < glyphs.size(); ++i) { - findAndAddSystemGlyph (character); + const TypefaceGlyphInfo* const g = (const TypefaceGlyphInfo*) glyphs.getUnchecked(i); - for (int i = 0; i < glyphs.size(); ++i) - { - const TypefaceGlyphInfo* const g = (TypefaceGlyphInfo*) glyphs.getUnchecked(i); - - if (g->character == character) - { - glyph = g; - break; - } - } - } - - if (glyph == 0) - { - if (CharacterFunctions::isWhitespace (character) && character != L' ') - glyph = getGlyph (L' '); - else if (character != defaultCharacter) - glyph = getGlyph (defaultCharacter); + if (g->character == character) + return g; } } - return glyph; + if (CharacterFunctions::isWhitespace (character) && character != L' ') + return getGlyph (L' '); + else if (character != defaultCharacter) + return getGlyph (defaultCharacter); + + return 0; } void Typeface::addGlyph (const juce_wchar character, const Path& path, const float horizontalSpacing) throw() { - if (character > 0 && character < 128) +#ifdef JUCE_DEBUG + for (int i = 0; i < glyphs.size(); ++i) + { + const TypefaceGlyphInfo* const g = (const TypefaceGlyphInfo*) glyphs.getUnchecked(i); + + if (g->character == character) + jassertfalse; + } +#endif + + if (((unsigned int) character) < 128) lookupTable [character] = (short) glyphs.size(); glyphs.add (new TypefaceGlyphInfo (character,