Browse Source

Fixed an obscure utf8 string comparison problem. Added a few C++11 tweaks. Improved VST host default folder detection. Win32 file browser filter fix. Introjucer VS2005 compiler bug workaround.

tags/2021-05-28
jules 13 years ago
parent
commit
1a5bdda7f1
8 changed files with 26 additions and 18 deletions
  1. +1
    -1
      extras/Introjucer/Source/Project/jucer_ProjectInformationComponent.h
  2. +2
    -3
      modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
  3. +1
    -1
      modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp
  4. +3
    -1
      modules/juce_core/containers/juce_Array.h
  5. +1
    -1
      modules/juce_core/containers/juce_ArrayAllocationBase.h
  6. +17
    -0
      modules/juce_core/containers/juce_OwnedArray.h
  7. +0
    -10
      modules/juce_core/text/juce_CharPointer_UTF8.h
  8. +1
    -1
      modules/juce_gui_basics/native/juce_win32_FileChooser.cpp

+ 1
- 1
extras/Introjucer/Source/Project/jucer_ProjectInformationComponent.h View File

@@ -33,7 +33,7 @@
*/
class ProjectInformationComponent : public Component,
public ChangeListener,
public Button::Listener
public ButtonListener
{
public:
//==============================================================================


+ 2
- 3
modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp View File

@@ -2902,7 +2902,8 @@ FileSearchPath VSTPluginFormat::getDefaultLocationsToSearch()
#elif JUCE_WINDOWS
const String programFiles (File::getSpecialLocation (File::globalApplicationsDirectory).getFullPathName());
return FileSearchPath (programFiles + "\\Steinberg\\VstPlugins");
return FileSearchPath (PlatformUtilities::getRegistryValue ("HKLM\\Software\\VST\\VSTPluginsPath",
programFiles + "\\Steinberg\\VstPlugins"));
#elif JUCE_LINUX
return FileSearchPath ("/usr/lib/vst");
#endif
@@ -2912,7 +2913,5 @@ FileSearchPath VSTPluginFormat::getDefaultLocationsToSearch()
END_JUCE_NAMESPACE
#endif
#undef log
#endif

+ 1
- 1
modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.cpp View File

@@ -561,7 +561,7 @@ void MidiKeyboardComponent::drawUpDownButton (Graphics& g, int w, int h,
case horizontalKeyboard: angle = movesOctavesUp ? 0.0f : 0.5f; break;
case verticalKeyboardFacingLeft: angle = movesOctavesUp ? 0.25f : 0.75f; break;
case verticalKeyboardFacingRight: angle = movesOctavesUp ? 0.75f : 0.25f; break;
default: break;
default: jassertfalse; angle = 0; break;
}
Path path;


+ 3
- 1
modules/juce_core/containers/juce_Array.h View File

@@ -142,7 +142,9 @@ public:
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
Array& operator= (Array&& other) noexcept
{
swapWithArray (other);
data = static_cast <ArrayAllocationBase<ElementType, TypeOfCriticalSectionToUse>&&> (other.data);
numUsed = other.numUsed;
other.numUsed = 0;
return *this;
}
#endif


+ 1
- 1
modules/juce_core/containers/juce_ArrayAllocationBase.h View File

@@ -53,7 +53,7 @@ public:
}
/** Destructor. */
~ArrayAllocationBase()
~ArrayAllocationBase() noexcept
{
}


+ 17
- 0
modules/juce_core/containers/juce_OwnedArray.h View File

@@ -73,6 +73,23 @@ public:
clear (true);
}
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
OwnedArray (OwnedArray&& other) noexcept
: data (static_cast <ArrayAllocationBase <ObjectClass*, TypeOfCriticalSectionToUse>&&> (other.data)),
numUsed (other.numUsed)
{
other.numUsed = 0;
}
OwnedArray& operator= (OwnedArray&& other) noexcept
{
data = static_cast <ArrayAllocationBase <ObjectClass*, TypeOfCriticalSectionToUse>&&> (other.data);
numUsed = other.numUsed;
other.numUsed = 0;
return *this;
}
#endif
//==============================================================================
/** Clears the array, optionally deleting the objects inside it first. */
void clear (const bool deleteObjects = true)


+ 0
- 10
modules/juce_core/text/juce_CharPointer_UTF8.h View File

@@ -446,16 +446,6 @@ public:
return CharacterFunctions::compareIgnoreCaseUpTo (*this, other, maxChars);
}
/** Compares this string with another one, up to a specified number of characters. */
int compareIgnoreCaseUpTo (const CharPointer_UTF8& other, const int maxChars) const noexcept
{
#if JUCE_WINDOWS
return strnicmp (data, other.data, (size_t) maxChars);
#else
return strncasecmp (data, other.data, maxChars);
#endif
}
/** Returns the character index of a substring, or -1 if it isn't found. */
template <typename CharPointer>
int indexOf (const CharPointer& stringToFind) const noexcept


+ 1
- 1
modules/juce_gui_basics/native/juce_win32_FileChooser.cpp View File

@@ -232,7 +232,7 @@ void FileChooser::showPlatformDialog (Array<File>& results, const String& title_
HeapBlock<WCHAR> filters;
filters.calloc (filterSpaceNumChars);
const int bytesWritten = filter.copyToUTF16 (filters.getData(), filterSpaceNumChars * sizeof (WCHAR));
filter.copyToUTF16 (filters + (bytesWritten / sizeof (WCHAR)) + 1,
filter.copyToUTF16 (filters + (bytesWritten / sizeof (WCHAR)),
(int) ((filterSpaceNumChars - 1) * sizeof (WCHAR) - bytesWritten));
OPENFILENAMEW of = { 0 };


Loading…
Cancel
Save