Browse Source

AU type fix and iOS multi-touch index fix.

tags/2021-05-28
Julian Storer 14 years ago
parent
commit
88a5393c28
2 changed files with 21 additions and 10 deletions
  1. +4
    -4
      src/audio/plugin_host/formats/juce_AudioUnitPluginFormat.mm
  2. +17
    -6
      src/native/mac/juce_ios_UIViewComponentPeer.mm

+ 4
- 4
src/audio/plugin_host/formats/juce_AudioUnitPluginFormat.mm View File

@@ -72,10 +72,10 @@ namespace AudioUnitFormatHelpers
const String osTypeToString (OSType type)
{
const juce_wchar s[4] = { (juce_wchar) (((uint32) type) >> 24),
(juce_wchar) (((uint32) type) >> 16),
(juce_wchar) (((uint32) type) >> 8),
(juce_wchar) ((uint32) type) };
const juce_wchar s[4] = { (juce_wchar) ((type >> 24) & 0xff),
(juce_wchar) ((type >> 16) & 0xff),
(juce_wchar) ((type >> 8) & 0xff),
(juce_wchar) (type & 0xff) };
return String (s, 4);
}


+ 17
- 6
src/native/mac/juce_ios_UIViewComponentPeer.mm View File

@@ -745,8 +745,11 @@ void UIViewComponentPeer::handleTouches (UIEvent* event, const bool isDown, cons
if (touchIndex < 0)
{
touchIndex = currentTouches.size();
currentTouches.add (touch);
for (touchIndex = 0; touchIndex < currentTouches.size(); ++touchIndex)
if (currentTouches.getUnchecked (touchIndex) == nil)
break;
currentTouches.set (touchIndex, touch);
}
if (isDown)
@@ -757,14 +760,22 @@ void UIViewComponentPeer::handleTouches (UIEvent* event, const bool isDown, cons
}
else if (isUp)
{
currentTouches.remove (touchIndex);
if (currentTouches.size() == 0)
currentModifiers = currentModifiers.withoutMouseButtons();
currentTouches.set (touchIndex, nil);
int totalActiveTouches = 0;
for (int j = currentTouches.size(); --j >= 0;)
if (currentTouches.getUnchecked(j) != nil)
++totalActiveTouches;
if (totalActiveTouches == 0)
isCancel = true;
}
if (isCancel)
{
currentTouches.clear();
currentModifiers = currentModifiers.withoutMouseButtons();
}
handleMouseEvent (touchIndex, pos, currentModifiers, time);
}


Loading…
Cancel
Save