diff --git a/VoidLink/Base.lproj/iPad.storyboard b/VoidLink/Base.lproj/iPad.storyboard index 80ddac45..edc5735f 100644 --- a/VoidLink/Base.lproj/iPad.storyboard +++ b/VoidLink/Base.lproj/iPad.storyboard @@ -1360,16 +1360,16 @@ - + - + @@ -1494,6 +1494,26 @@ + + + + + + + + + + + + + + + @@ -1521,6 +1541,8 @@ + + diff --git a/VoidLink/Base.lproj/iPhone.storyboard b/VoidLink/Base.lproj/iPhone.storyboard index 1dc675dd..faacc571 100644 --- a/VoidLink/Base.lproj/iPhone.storyboard +++ b/VoidLink/Base.lproj/iPhone.storyboard @@ -2214,16 +2214,16 @@ - + - + @@ -2277,6 +2277,26 @@ + + + + + + + + + + + + + + + @@ -2304,6 +2324,8 @@ + + diff --git a/VoidLink/Database/DataManager.h b/VoidLink/Database/DataManager.h index 3c2efe89..c06734b8 100644 --- a/VoidLink/Database/DataManager.h +++ b/VoidLink/Database/DataManager.h @@ -127,6 +127,7 @@ typedef NS_ENUM(NSInteger, WidgetSizeTransition) { edgeSlidingSensitivity:(CGFloat)edgeSlidingSensitivity audioEngine:(NSInteger)audioEngine appendLeftClick:(BOOL)appendLeftClick + duckOtherApps:(BOOL)duckOtherApps backgroundSessionTimer:(NSInteger)backgroundSessionTimer; - (NSArray*) getHosts; diff --git a/VoidLink/Database/DataManager.m b/VoidLink/Database/DataManager.m index a1c03f0a..0fe30730 100644 --- a/VoidLink/Database/DataManager.m +++ b/VoidLink/Database/DataManager.m @@ -110,6 +110,7 @@ edgeSlidingSensitivity:(CGFloat)edgeSlidingSensitivity audioEngine:(NSInteger)audioEngine appendLeftClick:(BOOL)appendLeftClick + duckOtherApps:(BOOL)duckOtherApps backgroundSessionTimer:(NSInteger)backgroundSessionTimer{ [_managedObjectContext performBlockAndWait:^{ @@ -170,6 +171,7 @@ settingsToSave.edgeSlidingSensitivity = [NSNumber numberWithFloat:edgeSlidingSensitivity]; settingsToSave.audioEngine = [NSNumber numberWithInteger:audioEngine]; settingsToSave.appendLeftClick = appendLeftClick; + settingsToSave.duckOtherApps = duckOtherApps; settingsToSave.rememberFoldState = rememberFoldState; [self saveData]; }]; diff --git a/VoidLink/Database/TemporarySettings.h b/VoidLink/Database/TemporarySettings.h index 300c7221..1ca791c2 100644 --- a/VoidLink/Database/TemporarySettings.h +++ b/VoidLink/Database/TemporarySettings.h @@ -84,6 +84,7 @@ @property (nonatomic, retain) NSNumber * edgeSlidingSensitivity; @property (nonatomic, retain) NSNumber * audioEngine; @property (nonatomic) BOOL appendLeftClick; +@property (nonatomic) BOOL duckOtherApps; @property (nonatomic, retain) NSNumber * framePacingMode; - (id) initFromSettings:(Settings*)settings; diff --git a/VoidLink/Database/TemporarySettings.m b/VoidLink/Database/TemporarySettings.m index 005e863a..353bc642 100644 --- a/VoidLink/Database/TemporarySettings.m +++ b/VoidLink/Database/TemporarySettings.m @@ -141,6 +141,7 @@ self.uniqueId = settings.uniqueId; self.audioEngine = settings.audioEngine; self.appendLeftClick = settings.appendLeftClick; + self.duckOtherApps = settings.duckOtherApps; #endif return self; diff --git a/VoidLink/Limelight.xcdatamodeld/VoidLink v1.0.xcdatamodel/contents b/VoidLink/Limelight.xcdatamodeld/VoidLink v1.0.xcdatamodel/contents index 72711279..0ae9a686 100644 --- a/VoidLink/Limelight.xcdatamodeld/VoidLink v1.0.xcdatamodel/contents +++ b/VoidLink/Limelight.xcdatamodeld/VoidLink v1.0.xcdatamodel/contents @@ -31,6 +31,7 @@ + diff --git a/VoidLink/Stream/Connection.m b/VoidLink/Stream/Connection.m index a3e4647c..a18dbb82 100644 --- a/VoidLink/Stream/Connection.m +++ b/VoidLink/Stream/Connection.m @@ -284,16 +284,20 @@ int ArInit(int audioConfiguration, POPUS_MULTISTREAM_CONFIGURATION opusConfig, v // Start playback SDL_PauseAudioDevice(audioDevice, 0); + // [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:nil]; + + // return 0; // System audio engine initialization DataManager* dataMan = [[DataManager alloc] init]; TemporarySettings* tempSettings = [dataMan getSettings]; bool useBluetoothD2P = tempSettings.useBuiltinMic || !tempSettings.redirectMic; AVAudioSessionCategoryOptions bluetoothAudioOption = useBluetoothD2P ? AVAudioSessionCategoryOptionAllowBluetoothA2DP : AVAudioSessionCategoryOptionAllowBluetooth; + AVAudioSessionCategoryOptions volumeMixOption = tempSettings.duckOtherApps ? AVAudioSessionCategoryOptionDuckOthers : AVAudioSessionCategoryOptionMixWithOthers; AVAudioSession *session = [AVAudioSession sharedInstance]; [session setCategory:tempSettings.redirectMic ? AVAudioSessionCategoryPlayAndRecord : AVAudioSessionCategoryPlayback mode:AVAudioSessionModeDefault - options:AVAudioSessionCategoryOptionMixWithOthers|AVAudioSessionCategoryOptionDefaultToSpeaker|bluetoothAudioOption + options:volumeMixOption|bluetoothAudioOption error:nil]; if(tempSettings.redirectMic) if(@available(iOS 13.0, *)) [session setAllowHapticsAndSystemSoundsDuringRecording:YES error:nil]; [session setActive:YES error:nil]; diff --git a/VoidLink/ViewControllers/MainFrameViewController.m b/VoidLink/ViewControllers/MainFrameViewController.m index 09275b22..cbd1d7e6 100644 --- a/VoidLink/ViewControllers/MainFrameViewController.m +++ b/VoidLink/ViewControllers/MainFrameViewController.m @@ -1192,6 +1192,7 @@ static NSMutableSet* hostList; [settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.citrixX1MouseStack]; [settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.externalDisplayModeStack]; [settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.audioConfigStack]; + [settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.duckOtherAppStack]; [settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.pipStack]; [settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.appThemeStack]; [settingsViewController.renderingBackendSelector setEnabled:!_settingsExpandedInStreamView]; diff --git a/VoidLink/ViewControllers/SettingsViewController.h b/VoidLink/ViewControllers/SettingsViewController.h index 6c62d381..4ec296b1 100644 --- a/VoidLink/ViewControllers/SettingsViewController.h +++ b/VoidLink/ViewControllers/SettingsViewController.h @@ -184,6 +184,9 @@ @property (strong, nonatomic) IBOutlet UIStackView *appendLeftClickStack; @property (strong, nonatomic) IBOutlet UISwitch *appendLeftClickSwitch; +@property (strong, nonatomic) IBOutlet UIStackView *duckOtherAppStack; +@property (strong, nonatomic) IBOutlet UISwitch *duckOtherAppSwitch; + @property (strong, nonatomic) IBOutlet UIStackView *testStack; @property (nonatomic, strong) MicHandler *micHandler; diff --git a/VoidLink/ViewControllers/SettingsViewController.m b/VoidLink/ViewControllers/SettingsViewController.m index 37afc950..b45a2e9b 100644 --- a/VoidLink/ViewControllers/SettingsViewController.m +++ b/VoidLink/ViewControllers/SettingsViewController.m @@ -791,6 +791,7 @@ BOOL isCustomResolution(int resolutionSelected) { [self addSetting:self.redirectMicStack ofId:@"redirectMicStack" withInfoTag:YES withDynamicLabel:NO to:audioSection]; [self addSetting:self.useBuiltinMicStack ofId:@"useBuiltinMicStack" withInfoTag:YES withDynamicLabel:NO to:audioSection]; [self addSetting:self.micVolumeStack ofId:@"micVolumeStack" withInfoTag:NO withDynamicLabel:YES to:audioSection]; + [self addSetting:self.duckOtherAppStack ofId:@"duckOtherAppStack" withInfoTag:NO withDynamicLabel:NO to:audioSection]; // [self addSetting:self.audioEngineStack ofId:@"audioEngineStack" withInfoTag:YES withDynamicLabel:NO to:audioSection]; // cancel audio engine selector due to system engine is unable to playback multi-channel audio [self addSetting:self.audioConfigStack ofId:@"audioConfigStack" withInfoTag:NO withDynamicLabel:NO to:audioSection]; @@ -1715,6 +1716,8 @@ BOOL isCustomResolution(int resolutionSelected) { [self.localVolumeSlider addTarget:self action:@selector(localVolumeSliderMoved:) forControlEvents:UIControlEventValueChanged]; [self localVolumeSliderMoved:self.localVolumeSlider]; + [self.duckOtherAppSwitch setOn:self->tempSettings.duckOtherApps]; + [self.micVolumeSlider setValue:self->tempSettings.micVolume.floatValue*100]; [self.micVolumeSlider addTarget:self action:@selector(micVolumeSliderMoved:) forControlEvents:UIControlEventValueChanged]; [self micVolumeSliderMoved:self.self.micVolumeSlider]; @@ -2871,6 +2874,7 @@ BOOL isCustomResolution(int resolutionSelected) { CGFloat edgeSlidingSensitivity = self.edgeSlidingSensitivitySlider.value; NSInteger audioEngine = self.audioEngineSelector.selectedSegmentIndex; BOOL appendLeftClick = self.appendLeftClickSwitch.isOn; + BOOL duckOtherApps = self.duckOtherAppSwitch.isOn; NSInteger backgroundSessionTimer = self.backgroundSessionTimerSlider.value == self.backgroundSessionTimerSlider.maximumValue ? (uint32_t) INT16_MAX : (uint32_t)self.backgroundSessionTimerSlider.value; [dataMan saveSettingsWithBitrate:_bitrate @@ -2927,6 +2931,7 @@ BOOL isCustomResolution(int resolutionSelected) { edgeSlidingSensitivity:edgeSlidingSensitivity audioEngine:audioEngine appendLeftClick:appendLeftClick + duckOtherApps:duckOtherApps backgroundSessionTimer:backgroundSessionTimer]; } diff --git a/VoidLink/mul.lproj/iPad.xcstrings b/VoidLink/mul.lproj/iPad.xcstrings index 1d29bc0a..1e58bfa1 100644 --- a/VoidLink/mul.lproj/iPad.xcstrings +++ b/VoidLink/mul.lproj/iPad.xcstrings @@ -4663,6 +4663,36 @@ } } }, + "YPA-7E-Cdl.text" : { + "comment" : "Class = \"UILabel\"; text = \"Duck Other Apps\"; ObjectID = \"YPA-7E-Cdl\";", + "extractionState" : "extracted_with_value", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "Duck Other Apps" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "降低其他App音量" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "降低其他App音量" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "降低其他App音量" + } + } + } + }, "yY7-Sf-Zes.segmentTitles[0]" : { "comment" : "Class = \"UISegmentedControl\"; yY7-Sf-Zes.segmentTitles[0] = \"Slide From Left Edge\"; ObjectID = \"yY7-Sf-Zes\";", "extractionState" : "extracted_with_value", diff --git a/VoidLink/mul.lproj/iPhone.xcstrings b/VoidLink/mul.lproj/iPhone.xcstrings index e2cb18e0..4ab8ec20 100644 --- a/VoidLink/mul.lproj/iPhone.xcstrings +++ b/VoidLink/mul.lproj/iPhone.xcstrings @@ -1447,6 +1447,36 @@ } } }, + "CEd-Wx-Gml.text" : { + "comment" : "Class = \"UILabel\"; text = \"Duck Other Apps\"; ObjectID = \"CEd-Wx-Gml\";", + "extractionState" : "extracted_with_value", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "new", + "value" : "Duck Other Apps" + } + }, + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "降低其他App音量" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "降低其他App音量" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "降低其他App音量" + } + } + } + }, "ci6-ak-aCa.text" : { "comment" : "Class = \"UILabel\"; text = \"Custom Resolution\"; ObjectID = \"ci6-ak-aCa\";", "extractionState" : "extracted_with_value",