diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index 0688a90c16..ddc47e1975 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -1540,12 +1540,12 @@ RelativeTime::~RelativeTime() noexcept { } -const RelativeTime RelativeTime::milliseconds (const int milliseconds) noexcept { return RelativeTime (milliseconds * 0.001); } +const RelativeTime RelativeTime::milliseconds (const int milliseconds) noexcept { return RelativeTime (milliseconds * 0.001); } const RelativeTime RelativeTime::milliseconds (const int64 milliseconds) noexcept { return RelativeTime (milliseconds * 0.001); } -const RelativeTime RelativeTime::minutes (const double numberOfMinutes) noexcept { return RelativeTime (numberOfMinutes * 60.0); } -const RelativeTime RelativeTime::hours (const double numberOfHours) noexcept { return RelativeTime (numberOfHours * (60.0 * 60.0)); } -const RelativeTime RelativeTime::days (const double numberOfDays) noexcept { return RelativeTime (numberOfDays * (60.0 * 60.0 * 24.0)); } -const RelativeTime RelativeTime::weeks (const double numberOfWeeks) noexcept { return RelativeTime (numberOfWeeks * (60.0 * 60.0 * 24.0 * 7.0)); } +const RelativeTime RelativeTime::minutes (const double numberOfMinutes) noexcept { return RelativeTime (numberOfMinutes * 60.0); } +const RelativeTime RelativeTime::hours (const double numberOfHours) noexcept { return RelativeTime (numberOfHours * (60.0 * 60.0)); } +const RelativeTime RelativeTime::days (const double numberOfDays) noexcept { return RelativeTime (numberOfDays * (60.0 * 60.0 * 24.0)); } +const RelativeTime RelativeTime::weeks (const double numberOfWeeks) noexcept { return RelativeTime (numberOfWeeks * (60.0 * 60.0 * 24.0 * 7.0)); } int64 RelativeTime::inMilliseconds() const noexcept { return (int64) (seconds * 1000.0); } double RelativeTime::inMinutes() const noexcept { return seconds / 60.0; } @@ -4736,7 +4736,7 @@ const var& NamedValueSet::operator[] (const Identifier& name) const const var NamedValueSet::getWithDefault (const Identifier& name, const var& defaultReturnValue) const { - const var* v = getVarPointer (name); + const var* const v = getVarPointer (name); return v != nullptr ? *v : defaultReturnValue; } @@ -4855,7 +4855,7 @@ DynamicObject::~DynamicObject() bool DynamicObject::hasProperty (const Identifier& propertyName) const { - var* const v = properties.getVarPointer (propertyName); + const var* const v = properties.getVarPointer (propertyName); return v != nullptr && ! v->isMethod(); } @@ -17511,12 +17511,12 @@ void ValueTree::SharedObject::setProperty (const Identifier& name, const var& ne } else { - var* const existingValue = properties.getVarPointer (name); + const var* const existingValue = properties.getVarPointer (name); if (existingValue != nullptr) { if (*existingValue != newValue) - undoManager->perform (new SetPropertyAction (this, name, newValue, properties [name], false, false)); + undoManager->perform (new SetPropertyAction (this, name, newValue, *existingValue, false, false)); } else { @@ -42368,7 +42368,7 @@ void Component::sendLookAndFeelChange() const Colour Component::findColour (const int colourId, const bool inheritFromParent) const { - var* const v = properties.getVarPointer (ComponentHelpers::getColourPropertyId (colourId)); + const var* const v = properties.getVarPointer (ComponentHelpers::getColourPropertyId (colourId)); if (v != nullptr) return Colour ((int) *v); @@ -76123,21 +76123,22 @@ void DropShadower::updateShadows() // callbacks during this loop, so use a weak ref to watch out for this.. WeakReference sw (shadowWindows[i]); - if (sw == nullptr) - return; + if (sw != nullptr) + sw->setAlwaysOnTop (owner->isAlwaysOnTop()); - sw->setAlwaysOnTop (owner->isAlwaysOnTop()); + if (sw != nullptr) + sw->setVisible (isOwnerVisible); - if (sw == nullptr) - return; - - switch (i) + if (sw != nullptr) { - case 0: sw->setBounds (x - shadowEdge, y, shadowEdge, h); break; - case 1: sw->setBounds (x + w, y, shadowEdge, h); break; - case 2: sw->setBounds (x, y, w, shadowEdge); break; - case 3: sw->setBounds (x, owner->getBottom(), w, shadowEdge); break; - default: break; + switch (i) + { + case 0: sw->setBounds (x - shadowEdge, y, shadowEdge, h); break; + case 1: sw->setBounds (x + w, y, shadowEdge, h); break; + case 2: sw->setBounds (x, y, w, shadowEdge); break; + case 3: sw->setBounds (x, owner->getBottom(), w, shadowEdge); break; + default: break; + } } if (sw == nullptr) @@ -77268,7 +77269,8 @@ bool OpenGLComponent::makeCurrentContextActive() if (context != nullptr) { - updateContextPosition(); + if (! useThread) + updateContextPosition(); if (context->makeActive()) newOpenGLContextCreated(); @@ -77389,6 +77391,8 @@ bool OpenGLComponent::renderAndSwapBuffers() void OpenGLComponent::stopRendering() { + componentWatcher->cancelPendingUpdate(); + if (renderThread != nullptr) renderThread->stopThread (5000); @@ -268246,13 +268250,13 @@ namespace const int deviceIndexToOpen) { snd_seq_t* returnedHandle = nullptr; - snd_seq_t* seqHandle; + snd_seq_t* seqHandle = nullptr; if (snd_seq_open (&seqHandle, "default", forInput ? SND_SEQ_OPEN_INPUT : SND_SEQ_OPEN_OUTPUT, 0) == 0) { - snd_seq_system_info_t* systemInfo; - snd_seq_client_info_t* clientInfo; + snd_seq_system_info_t* systemInfo = nullptr; + snd_seq_client_info_t* clientInfo = nullptr; if (snd_seq_system_info_malloc (&systemInfo) == 0) { @@ -268290,19 +268294,26 @@ namespace if (sourcePort != -1) { - snd_seq_set_client_name (seqHandle, - forInput ? "Juce Midi Input" - : "Juce Midi Output"); + if (forInput) + { + snd_seq_set_client_name (seqHandle, "Juce Midi Input"); + + const int portId = snd_seq_create_simple_port (seqHandle, "Juce Midi In Port", + SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE, + SND_SEQ_PORT_TYPE_MIDI_GENERIC); - const int portId - = snd_seq_create_simple_port (seqHandle, - forInput ? "Juce Midi In Port" - : "Juce Midi Out Port", - forInput ? (SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE) - : (SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ), - SND_SEQ_PORT_TYPE_MIDI_GENERIC); + snd_seq_connect_from (seqHandle, portId, sourceClient, sourcePort); + } + else + { + snd_seq_set_client_name (seqHandle, "Juce Midi Output"); - snd_seq_connect_from (seqHandle, portId, sourceClient, sourcePort); + const int portId = snd_seq_create_simple_port (seqHandle, "Juce Midi Out Port", + SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ, + SND_SEQ_PORT_TYPE_MIDI_GENERIC); + + snd_seq_connect_to (seqHandle, portId, sourceClient, sourcePort); + } returnedHandle = seqHandle; } @@ -274272,19 +274283,18 @@ void UIViewComponentPeer::handleTouches (UIEvent* event, const bool isDown, cons currentTouches.add (touch); } - if ([touch phase] == UITouchPhaseBegan - || [touch phase] == UITouchPhaseStationary - || [touch phase] == UITouchPhaseMoved) + if (isDown) { currentModifiers = currentModifiers.withoutMouseButtons(); handleMouseEvent (touchIndex, pos, currentModifiers, time); currentModifiers = currentModifiers.withoutMouseButtons().withFlags (ModifierKeys::leftButtonModifier); } - else if ([touch phase] == UITouchPhaseEnded - || [touch phase] == UITouchPhaseCancelled) + else if (isUp) { - currentModifiers = currentModifiers.withoutMouseButtons(); currentTouches.remove (touchIndex); + + if (currentTouches.size() == 0) + currentModifiers = currentModifiers.withoutMouseButtons(); } if (isCancel) diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 2a237d8baa..79e76c405b 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -73,7 +73,7 @@ namespace JuceDummyNamespace {} */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 53 -#define JUCE_BUILDNUMBER 81 +#define JUCE_BUILDNUMBER 82 /** Current Juce version number. @@ -8860,11 +8860,16 @@ public: /** If this variant is a method pointer, this invokes it on a target object. */ const var invoke (const var& targetObject, const var* arguments, int numArguments) const; - /** Returns true if this var has the same value as the one supplied. */ + /** Returns true if this var has the same value as the one supplied. + Note that this ignores the type, so a string var "123" and an integer var with the + value 123 are considered to be equal. + @see equalsWithSameType + */ bool equals (const var& other) const noexcept; /** Returns true if this var has the same value and type as the one supplied. - This differs from equals() because e.g. "0" and 0 will be considered different. + This differs from equals() because e.g. "123" and 123 will be considered different. + @see equals */ bool equalsWithSameType (const var& other) const noexcept; @@ -8905,7 +8910,9 @@ private: ValueUnion value; }; +/** Compares the values of two var objects, using the var::equals() comparison. */ bool operator== (const var& v1, const var& v2) noexcept; +/** Compares the values of two var objects, using the var::equals() comparison. */ bool operator!= (const var& v1, const var& v2) noexcept; bool operator== (const var& v1, const String& v2); bool operator!= (const var& v1, const String& v2); @@ -22635,6 +22642,11 @@ public: */ const String getThreadName() const { return threadName_; } + /** Changes the name of the caller thread. + Different OSes may place different length or content limits on this name. + */ + static void setCurrentThreadName (const String& newThreadName); + /** Returns the number of currently-running threads. @returns the number of Thread objects known to be currently running. @@ -22668,7 +22680,6 @@ private: void closeThreadHandle(); void killThread(); void threadEntryPoint(); - static void setCurrentThreadName (const String& name); static bool setThreadPriority (void* handle, int priority); JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Thread); diff --git a/src/audio/plugin_client/VST/juce_VST_Wrapper.cpp b/src/audio/plugin_client/VST/juce_VST_Wrapper.cpp index 30fcede9d9..10a65b75e0 100644 --- a/src/audio/plugin_client/VST/juce_VST_Wrapper.cpp +++ b/src/audio/plugin_client/VST/juce_VST_Wrapper.cpp @@ -239,13 +239,10 @@ namespace void registerMouseWheelHook() { - #ifndef WH_MOUSE_LL - #define WH_MOUSE_LL 14 - #endif - if (mouseHookUsers++ == 0) - mouseWheelHook = SetWindowsHookEx (WH_MOUSE_LL, mouseWheelHookCallback, - (HINSTANCE) PlatformUtilities::getCurrentModuleInstanceHandle(), 0); + mouseWheelHook = SetWindowsHookEx (7 /*WH_MOUSE*/, mouseWheelHookCallback, + (HINSTANCE) PlatformUtilities::getCurrentModuleInstanceHandle(), + GetCurrentThreadId()); } void unregisterMouseWheelHook() diff --git a/src/audio/plugin_client/VST/juce_VST_Wrapper.mm b/src/audio/plugin_client/VST/juce_VST_Wrapper.mm index 6bbe138e06..ce58a5d144 100644 --- a/src/audio/plugin_client/VST/juce_VST_Wrapper.mm +++ b/src/audio/plugin_client/VST/juce_VST_Wrapper.mm @@ -203,25 +203,23 @@ void setNativeHostWindowSize (void* nsWindow, Component* component, int newWidth #if JUCE_64BIT NSView* hostView = (NSView*) nsWindow; - if (hostView != 0) + if (hostView != nil) { // xxx is this necessary, or do the hosts detect a change in the child view and do this automatically? [hostView setFrameSize: NSMakeSize ([hostView frame].size.width + (newWidth - component->getWidth()), [hostView frame].size.height + (newHeight - component->getHeight()))]; } #else - NSWindow* hostWindow = (NSWindow*) nsWindow; - if (hostWindow != 0) + + HIViewRef dummyView = (HIViewRef) (void*) (pointer_sized_int) + component->getProperties() ["dummyViewRef"].toString().getHexValue64(); + if (dummyView != 0) { - // Can't use the cocoa NSWindow resizing code, or it messes up in Live. - Rect r; - GetWindowBounds ((WindowRef) [hostWindow windowRef], kWindowContentRgn, &r); - r.right += newWidth - component->getWidth(); - r.bottom += newHeight - component->getHeight(); - SetWindowBounds ((WindowRef) [hostWindow windowRef], kWindowContentRgn, &r); - - r.left = r.top = 0; - InvalWindowRect ((WindowRef) [hostWindow windowRef], &r); + HIRect frameRect; + HIViewGetFrame (dummyView, &frameRect); + frameRect.size.width = newWidth; + frameRect.size.height = newHeight; + HIViewSetFrame (dummyView, &frameRect); } #endif } diff --git a/src/containers/juce_DynamicObject.cpp b/src/containers/juce_DynamicObject.cpp index 69386ba8ff..4771acec6a 100644 --- a/src/containers/juce_DynamicObject.cpp +++ b/src/containers/juce_DynamicObject.cpp @@ -41,7 +41,7 @@ DynamicObject::~DynamicObject() bool DynamicObject::hasProperty (const Identifier& propertyName) const { - var* const v = properties.getVarPointer (propertyName); + const var* const v = properties.getVarPointer (propertyName); return v != nullptr && ! v->isMethod(); } diff --git a/src/containers/juce_NamedValueSet.cpp b/src/containers/juce_NamedValueSet.cpp index b41fa02294..048e059bfd 100644 --- a/src/containers/juce_NamedValueSet.cpp +++ b/src/containers/juce_NamedValueSet.cpp @@ -123,7 +123,7 @@ const var& NamedValueSet::operator[] (const Identifier& name) const const var NamedValueSet::getWithDefault (const Identifier& name, const var& defaultReturnValue) const { - const var* v = getVarPointer (name); + const var* const v = getVarPointer (name); return v != nullptr ? *v : defaultReturnValue; } diff --git a/src/containers/juce_ValueTree.cpp b/src/containers/juce_ValueTree.cpp index 7c66dae2f8..6a5bb2ce79 100644 --- a/src/containers/juce_ValueTree.cpp +++ b/src/containers/juce_ValueTree.cpp @@ -340,12 +340,12 @@ void ValueTree::SharedObject::setProperty (const Identifier& name, const var& ne } else { - var* const existingValue = properties.getVarPointer (name); + const var* const existingValue = properties.getVarPointer (name); if (existingValue != nullptr) { if (*existingValue != newValue) - undoManager->perform (new SetPropertyAction (this, name, newValue, properties [name], false, false)); + undoManager->perform (new SetPropertyAction (this, name, newValue, *existingValue, false, false)); } else { diff --git a/src/containers/juce_Variant.h b/src/containers/juce_Variant.h index 778895e999..f7296b8db9 100644 --- a/src/containers/juce_Variant.h +++ b/src/containers/juce_Variant.h @@ -143,11 +143,16 @@ public: const var invoke (const var& targetObject, const var* arguments, int numArguments) const; //============================================================================== - /** Returns true if this var has the same value as the one supplied. */ + /** Returns true if this var has the same value as the one supplied. + Note that this ignores the type, so a string var "123" and an integer var with the + value 123 are considered to be equal. + @see equalsWithSameType + */ bool equals (const var& other) const noexcept; /** Returns true if this var has the same value and type as the one supplied. - This differs from equals() because e.g. "0" and 0 will be considered different. + This differs from equals() because e.g. "123" and 123 will be considered different. + @see equals */ bool equalsWithSameType (const var& other) const noexcept; @@ -188,7 +193,9 @@ private: ValueUnion value; }; +/** Compares the values of two var objects, using the var::equals() comparison. */ bool operator== (const var& v1, const var& v2) noexcept; +/** Compares the values of two var objects, using the var::equals() comparison. */ bool operator!= (const var& v1, const var& v2) noexcept; bool operator== (const var& v1, const String& v2); bool operator!= (const var& v1, const String& v2); diff --git a/src/core/juce_RelativeTime.cpp b/src/core/juce_RelativeTime.cpp index e1024f13ba..dd37f35957 100644 --- a/src/core/juce_RelativeTime.cpp +++ b/src/core/juce_RelativeTime.cpp @@ -47,12 +47,12 @@ RelativeTime::~RelativeTime() noexcept } //============================================================================== -const RelativeTime RelativeTime::milliseconds (const int milliseconds) noexcept { return RelativeTime (milliseconds * 0.001); } +const RelativeTime RelativeTime::milliseconds (const int milliseconds) noexcept { return RelativeTime (milliseconds * 0.001); } const RelativeTime RelativeTime::milliseconds (const int64 milliseconds) noexcept { return RelativeTime (milliseconds * 0.001); } -const RelativeTime RelativeTime::minutes (const double numberOfMinutes) noexcept { return RelativeTime (numberOfMinutes * 60.0); } -const RelativeTime RelativeTime::hours (const double numberOfHours) noexcept { return RelativeTime (numberOfHours * (60.0 * 60.0)); } -const RelativeTime RelativeTime::days (const double numberOfDays) noexcept { return RelativeTime (numberOfDays * (60.0 * 60.0 * 24.0)); } -const RelativeTime RelativeTime::weeks (const double numberOfWeeks) noexcept { return RelativeTime (numberOfWeeks * (60.0 * 60.0 * 24.0 * 7.0)); } +const RelativeTime RelativeTime::minutes (const double numberOfMinutes) noexcept { return RelativeTime (numberOfMinutes * 60.0); } +const RelativeTime RelativeTime::hours (const double numberOfHours) noexcept { return RelativeTime (numberOfHours * (60.0 * 60.0)); } +const RelativeTime RelativeTime::days (const double numberOfDays) noexcept { return RelativeTime (numberOfDays * (60.0 * 60.0 * 24.0)); } +const RelativeTime RelativeTime::weeks (const double numberOfWeeks) noexcept { return RelativeTime (numberOfWeeks * (60.0 * 60.0 * 24.0 * 7.0)); } //============================================================================== int64 RelativeTime::inMilliseconds() const noexcept { return (int64) (seconds * 1000.0); } diff --git a/src/core/juce_StandardHeader.h b/src/core/juce_StandardHeader.h index 34d5848f6f..5ef1766c33 100644 --- a/src/core/juce_StandardHeader.h +++ b/src/core/juce_StandardHeader.h @@ -33,7 +33,7 @@ */ #define JUCE_MAJOR_VERSION 1 #define JUCE_MINOR_VERSION 53 -#define JUCE_BUILDNUMBER 81 +#define JUCE_BUILDNUMBER 82 /** Current Juce version number. diff --git a/src/gui/components/juce_Component.cpp b/src/gui/components/juce_Component.cpp index ac797aa756..4a5e9bb5d7 100644 --- a/src/gui/components/juce_Component.cpp +++ b/src/gui/components/juce_Component.cpp @@ -2038,7 +2038,7 @@ void Component::sendLookAndFeelChange() const Colour Component::findColour (const int colourId, const bool inheritFromParent) const { - var* const v = properties.getVarPointer (ComponentHelpers::getColourPropertyId (colourId)); + const var* const v = properties.getVarPointer (ComponentHelpers::getColourPropertyId (colourId)); if (v != nullptr) return Colour ((int) *v); diff --git a/src/gui/components/special/juce_DropShadower.cpp b/src/gui/components/special/juce_DropShadower.cpp index 360461ec14..278d16393f 100644 --- a/src/gui/components/special/juce_DropShadower.cpp +++ b/src/gui/components/special/juce_DropShadower.cpp @@ -260,21 +260,22 @@ void DropShadower::updateShadows() // callbacks during this loop, so use a weak ref to watch out for this.. WeakReference sw (shadowWindows[i]); - if (sw == nullptr) - return; - - sw->setAlwaysOnTop (owner->isAlwaysOnTop()); + if (sw != nullptr) + sw->setAlwaysOnTop (owner->isAlwaysOnTop()); - if (sw == nullptr) - return; + if (sw != nullptr) + sw->setVisible (isOwnerVisible); - switch (i) + if (sw != nullptr) { - case 0: sw->setBounds (x - shadowEdge, y, shadowEdge, h); break; - case 1: sw->setBounds (x + w, y, shadowEdge, h); break; - case 2: sw->setBounds (x, y, w, shadowEdge); break; - case 3: sw->setBounds (x, owner->getBottom(), w, shadowEdge); break; - default: break; + switch (i) + { + case 0: sw->setBounds (x - shadowEdge, y, shadowEdge, h); break; + case 1: sw->setBounds (x + w, y, shadowEdge, h); break; + case 2: sw->setBounds (x, y, w, shadowEdge); break; + case 3: sw->setBounds (x, owner->getBottom(), w, shadowEdge); break; + default: break; + } } if (sw == nullptr) diff --git a/src/gui/components/special/juce_OpenGLComponent.cpp b/src/gui/components/special/juce_OpenGLComponent.cpp index fc72f0b47c..5faa2a8926 100644 --- a/src/gui/components/special/juce_OpenGLComponent.cpp +++ b/src/gui/components/special/juce_OpenGLComponent.cpp @@ -295,7 +295,8 @@ bool OpenGLComponent::makeCurrentContextActive() if (context != nullptr) { - updateContextPosition(); + if (! useThread) + updateContextPosition(); if (context->makeActive()) newOpenGLContextCreated(); @@ -416,6 +417,8 @@ bool OpenGLComponent::renderAndSwapBuffers() void OpenGLComponent::stopRendering() { + componentWatcher->cancelPendingUpdate(); + if (renderThread != nullptr) renderThread->stopThread (5000); diff --git a/src/native/linux/juce_linux_Midi.cpp b/src/native/linux/juce_linux_Midi.cpp index 2ac605d375..52fc6f9579 100644 --- a/src/native/linux/juce_linux_Midi.cpp +++ b/src/native/linux/juce_linux_Midi.cpp @@ -36,13 +36,13 @@ namespace const int deviceIndexToOpen) { snd_seq_t* returnedHandle = nullptr; - snd_seq_t* seqHandle; + snd_seq_t* seqHandle = nullptr; if (snd_seq_open (&seqHandle, "default", forInput ? SND_SEQ_OPEN_INPUT : SND_SEQ_OPEN_OUTPUT, 0) == 0) { - snd_seq_system_info_t* systemInfo; - snd_seq_client_info_t* clientInfo; + snd_seq_system_info_t* systemInfo = nullptr; + snd_seq_client_info_t* clientInfo = nullptr; if (snd_seq_system_info_malloc (&systemInfo) == 0) { @@ -80,19 +80,26 @@ namespace if (sourcePort != -1) { - snd_seq_set_client_name (seqHandle, - forInput ? "Juce Midi Input" - : "Juce Midi Output"); - - const int portId - = snd_seq_create_simple_port (seqHandle, - forInput ? "Juce Midi In Port" - : "Juce Midi Out Port", - forInput ? (SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE) - : (SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ), - SND_SEQ_PORT_TYPE_MIDI_GENERIC); - - snd_seq_connect_from (seqHandle, portId, sourceClient, sourcePort); + if (forInput) + { + snd_seq_set_client_name (seqHandle, "Juce Midi Input"); + + const int portId = snd_seq_create_simple_port (seqHandle, "Juce Midi In Port", + SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE, + SND_SEQ_PORT_TYPE_MIDI_GENERIC); + + snd_seq_connect_from (seqHandle, portId, sourceClient, sourcePort); + } + else + { + snd_seq_set_client_name (seqHandle, "Juce Midi Output"); + + const int portId = snd_seq_create_simple_port (seqHandle, "Juce Midi Out Port", + SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ, + SND_SEQ_PORT_TYPE_MIDI_GENERIC); + + snd_seq_connect_to (seqHandle, portId, sourceClient, sourcePort); + } returnedHandle = seqHandle; } diff --git a/src/native/mac/juce_ios_UIViewComponentPeer.mm b/src/native/mac/juce_ios_UIViewComponentPeer.mm index 85fe3362fc..5062dc85a5 100644 --- a/src/native/mac/juce_ios_UIViewComponentPeer.mm +++ b/src/native/mac/juce_ios_UIViewComponentPeer.mm @@ -749,19 +749,18 @@ void UIViewComponentPeer::handleTouches (UIEvent* event, const bool isDown, cons currentTouches.add (touch); } - if ([touch phase] == UITouchPhaseBegan - || [touch phase] == UITouchPhaseStationary - || [touch phase] == UITouchPhaseMoved) + if (isDown) { currentModifiers = currentModifiers.withoutMouseButtons(); handleMouseEvent (touchIndex, pos, currentModifiers, time); currentModifiers = currentModifiers.withoutMouseButtons().withFlags (ModifierKeys::leftButtonModifier); } - else if ([touch phase] == UITouchPhaseEnded - || [touch phase] == UITouchPhaseCancelled) + else if (isUp) { - currentModifiers = currentModifiers.withoutMouseButtons(); currentTouches.remove (touchIndex); + + if (currentTouches.size() == 0) + currentModifiers = currentModifiers.withoutMouseButtons(); } if (isCancel) diff --git a/src/threads/juce_Thread.h b/src/threads/juce_Thread.h index 91c384b7a1..6e50e4647d 100644 --- a/src/threads/juce_Thread.h +++ b/src/threads/juce_Thread.h @@ -257,6 +257,11 @@ public: */ const String getThreadName() const { return threadName_; } + /** Changes the name of the caller thread. + Different OSes may place different length or content limits on this name. + */ + static void setCurrentThreadName (const String& newThreadName); + //============================================================================== /** Returns the number of currently-running threads. @@ -292,7 +297,6 @@ private: void closeThreadHandle(); void killThread(); void threadEntryPoint(); - static void setCurrentThreadName (const String& name); static bool setThreadPriority (void* handle, int priority); JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Thread);