From 38c64a78409388fbf3a8d29745b4783d10c20049 Mon Sep 17 00:00:00 2001 From: Julian Storer Date: Mon, 4 Oct 2010 18:32:25 +0100 Subject: [PATCH] Minor tweaks to LookAndFeel, VST wrapper. --- .../wrapper/VST/juce_VST_Wrapper.cpp | 19 ++++++++++--------- juce_amalgamated.cpp | 9 +++++---- juce_amalgamated.h | 8 ++++++-- src/core/juce_MathsFunctions.h | 2 +- .../filebrowser/juce_FileListComponent.cpp | 2 +- .../filebrowser/juce_FileTreeComponent.cpp | 2 +- .../lookandfeel/juce_LookAndFeel.cpp | 3 ++- .../components/lookandfeel/juce_LookAndFeel.h | 6 +++++- src/text/juce_String.cpp | 2 +- 9 files changed, 32 insertions(+), 21 deletions(-) diff --git a/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp b/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp index ed1de0e496..e457bec73b 100644 --- a/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp +++ b/extras/audio plugins/wrapper/VST/juce_VST_Wrapper.cpp @@ -439,6 +439,10 @@ public: { result = 1; } + else if (strcmp (text, "openCloseAnyThread" == 0) + { + result = -1; + } return result; } @@ -591,7 +595,7 @@ public: { if (outputs[j] == chan) { - chan = (float*) juce_malloc (sizeof (float) * blockSize * 2); + chan = new float [blockSize * 2]; tempChannels.set (i, chan); break; } @@ -1429,7 +1433,6 @@ private: int numInChans, numOutChans; HeapBlock channels; Array tempChannels; // see note in processReplacing() - bool hasCreatedTempChannels; bool shouldDeleteEditor; //============================================================================== @@ -1481,14 +1484,12 @@ private: void deleteTempChannels() { for (int i = tempChannels.size(); --i >= 0;) - juce_free (tempChannels.getUnchecked(i)); + delete[] (tempChannels.getUnchecked(i)); tempChannels.clear(); if (filter != 0) tempChannels.insertMultiple (0, 0, filter->getNumInputChannels() + filter->getNumOutputChannels()); - - hasCreatedTempChannels = false; } const String getHostName() @@ -1499,13 +1500,13 @@ private: return host; } -#if JUCE_MAC + #if JUCE_MAC void* hostWindow; -#elif JUCE_LINUX + #elif JUCE_LINUX Window hostWindow; -#else + #else HWND hostWindow; -#endif + #endif }; //============================================================================== diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 83fdc016cb..972b529713 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -11774,7 +11774,7 @@ public: static void copyChars (juce_wchar* const dest, const juce_wchar* const src, const size_t numChars) throw() { - jassert (src != 0 & dest != 0); + jassert (src != 0 && dest != 0); memcpy (dest, src, numChars * sizeof (juce_wchar)); dest [numChars] = 0; } @@ -59083,7 +59083,7 @@ public: &icon, fileSize, modTime, isDirectory, highlighted, - index); + index, owner); } void mouseDown (const MouseEvent& e) @@ -59825,7 +59825,7 @@ public: file.getFileName(), &icon, fileSize, modTime, isDirectory, isSelected(), - indexInContentsList); + indexInContentsList, owner); } void itemClicked (const MouseEvent& e) @@ -67444,7 +67444,8 @@ void LookAndFeel::drawFileBrowserRow (Graphics& g, int width, int height, const String& fileTimeDescription, const bool isDirectory, const bool isItemSelected, - const int /*itemIndex*/) + const int /*itemIndex*/, + DirectoryContentsDisplayComponent&) { if (isItemSelected) g.fillAll (findColour (DirectoryContentsDisplayComponent::highlightColourId)); diff --git a/juce_amalgamated.h b/juce_amalgamated.h index ecb9c9645f..029d4da2f3 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -1125,7 +1125,7 @@ template inline int numElementsInArray (Type& array) { (void) array; // (required to avoid a spurious warning in MS compilers) - return static_cast (sizeof (array) / sizeof (array[0])); + return static_cast (sizeof (array) / sizeof (0[array])); } // Some useful maths functions that aren't always present with all compilers and build settings. @@ -55025,7 +55025,8 @@ public: const String& fileTimeDescription, bool isDirectory, bool isItemSelected, - int itemIndex); + int itemIndex, + DirectoryContentsDisplayComponent& component); virtual Button* createFileBrowserGoUpButton(); @@ -55350,6 +55351,9 @@ private: bool flatOnTop, bool flatOnBottom) throw(); + // This has been deprecated - see the new parameter list.. + virtual int drawFileBrowserRow (Graphics&, int, int, const String&, Image*, const String&, const String&, bool, bool, int) { return 0; } + LookAndFeel (const LookAndFeel&); LookAndFeel& operator= (const LookAndFeel&); }; diff --git a/src/core/juce_MathsFunctions.h b/src/core/juce_MathsFunctions.h index 066bf3f9a1..3b79634492 100644 --- a/src/core/juce_MathsFunctions.h +++ b/src/core/juce_MathsFunctions.h @@ -176,7 +176,7 @@ template inline int numElementsInArray (Type& array) { (void) array; // (required to avoid a spurious warning in MS compilers) - return static_cast (sizeof (array) / sizeof (array[0])); + return static_cast (sizeof (array) / sizeof (0[array])); } //============================================================================== diff --git a/src/gui/components/filebrowser/juce_FileListComponent.cpp b/src/gui/components/filebrowser/juce_FileListComponent.cpp index 3cf56888b8..580710ece9 100644 --- a/src/gui/components/filebrowser/juce_FileListComponent.cpp +++ b/src/gui/components/filebrowser/juce_FileListComponent.cpp @@ -109,7 +109,7 @@ public: &icon, fileSize, modTime, isDirectory, highlighted, - index); + index, owner); } void mouseDown (const MouseEvent& e) diff --git a/src/gui/components/filebrowser/juce_FileTreeComponent.cpp b/src/gui/components/filebrowser/juce_FileTreeComponent.cpp index e35db5c8c6..2202675dd2 100644 --- a/src/gui/components/filebrowser/juce_FileTreeComponent.cpp +++ b/src/gui/components/filebrowser/juce_FileTreeComponent.cpp @@ -153,7 +153,7 @@ public: file.getFileName(), &icon, fileSize, modTime, isDirectory, isSelected(), - indexInContentsList); + indexInContentsList, owner); } void itemClicked (const MouseEvent& e) diff --git a/src/gui/components/lookandfeel/juce_LookAndFeel.cpp b/src/gui/components/lookandfeel/juce_LookAndFeel.cpp index 69f0ed5c2f..1194c896c4 100644 --- a/src/gui/components/lookandfeel/juce_LookAndFeel.cpp +++ b/src/gui/components/lookandfeel/juce_LookAndFeel.cpp @@ -2575,7 +2575,8 @@ void LookAndFeel::drawFileBrowserRow (Graphics& g, int width, int height, const String& fileTimeDescription, const bool isDirectory, const bool isItemSelected, - const int /*itemIndex*/) + const int /*itemIndex*/, + DirectoryContentsDisplayComponent&) { if (isItemSelected) g.fillAll (findColour (DirectoryContentsDisplayComponent::highlightColourId)); diff --git a/src/gui/components/lookandfeel/juce_LookAndFeel.h b/src/gui/components/lookandfeel/juce_LookAndFeel.h index 718ae5d6cf..a4a1125055 100644 --- a/src/gui/components/lookandfeel/juce_LookAndFeel.h +++ b/src/gui/components/lookandfeel/juce_LookAndFeel.h @@ -309,7 +309,8 @@ public: const String& fileTimeDescription, bool isDirectory, bool isItemSelected, - int itemIndex); + int itemIndex, + DirectoryContentsDisplayComponent& component); virtual Button* createFileBrowserGoUpButton(); @@ -658,6 +659,9 @@ private: bool flatOnTop, bool flatOnBottom) throw(); + // This has been deprecated - see the new parameter list.. + virtual int drawFileBrowserRow (Graphics&, int, int, const String&, Image*, const String&, const String&, bool, bool, int) { return 0; } + LookAndFeel (const LookAndFeel&); LookAndFeel& operator= (const LookAndFeel&); }; diff --git a/src/text/juce_String.cpp b/src/text/juce_String.cpp index 360aea73c5..3ee8a75e8e 100644 --- a/src/text/juce_String.cpp +++ b/src/text/juce_String.cpp @@ -137,7 +137,7 @@ public: static void copyChars (juce_wchar* const dest, const juce_wchar* const src, const size_t numChars) throw() { - jassert (src != 0 & dest != 0); + jassert (src != 0 && dest != 0); memcpy (dest, src, numChars * sizeof (juce_wchar)); dest [numChars] = 0; }