Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Source/CrossPlatformUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ void *binaryDataToUrlBookmark(const void * data, size_t size);

juce::URL generateUpdatedURL (juce::URL& urlToUse);

int getMaximumOutputNumberOfChannels();
bool setPreferredOutputNumberOfChannels(int count);
#endif
14 changes: 14 additions & 0 deletions Source/CrossPlatformUtilsIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@



#import <AVFoundation/AVFoundation.h>

#import <UIKit/UIView.h>

#include "../JuceLibraryCode/JuceHeader.h"
Expand Down Expand Up @@ -108,6 +110,18 @@ bool urlBookmarkToBinaryData(void * bookmark, const void * & retdata, size_t & r
return returl;
}

int getMaximumOutputNumberOfChannels()
{
auto* session = [AVAudioSession sharedInstance];
return [session maximumOutputNumberOfChannels];
}

bool setPreferredOutputNumberOfChannels(int count)
{
auto* session = [AVAudioSession sharedInstance];
NSError* error;
return [session setPreferredOutputNumberOfChannels:count error:&error];
}


#endif
3 changes: 3 additions & 0 deletions Source/SonoStandaloneFilterApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,9 @@ class SonobusStandaloneFilterApp : public JUCEApplication, public Timer
return;
};

#if JUCE_IOS
setPreferredOutputNumberOfChannels(getMaximumOutputNumberOfChannels());
#endif

if (!doHeadless) {
mainWindow.reset (createWindow());
Expand Down
9 changes: 9 additions & 0 deletions Source/SonobusPluginEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "LatencyMatchView.h"
#include "SuggestNewGroupView.h"
#include "SonoCallOutBox.h"
#include "CrossPlatformUtils.h"

#include <sstream>

#if JUCE_ANDROID
Expand Down Expand Up @@ -1938,6 +1940,8 @@ void SonobusAudioProcessorEditor::timerCallback(int timerid)

#if JUCE_IOS
if (JUCEApplicationBase::isStandaloneApp()) {
getAudioDeviceManager()->addChangeListener(this);

bool iaaconn = isInterAppAudioConnected();
if (iaaconn != iaaConnected) {
iaaConnected = iaaconn;
Expand Down Expand Up @@ -5174,6 +5178,11 @@ void SonobusAudioProcessorEditor::changeListenerCallback (ChangeBroadcaster* sou
} else if (source == &(processor.getTransportSource())) {
updateTransportState();
}
#if JUCE_IOS
else if (source == getAudioDeviceManager()) {
setPreferredOutputNumberOfChannels(getMaximumOutputNumberOfChannels());
}
#endif
}

class SonobusAudioProcessorEditor::TrimFileJob : public ThreadPoolJob
Expand Down