diff --git a/Limelight/Database/DataManager.h b/Limelight/Database/DataManager.h index 611df00d..f77b6c70 100644 --- a/Limelight/Database/DataManager.h +++ b/Limelight/Database/DataManager.h @@ -23,7 +23,8 @@ multiController:(BOOL)multiController audioOnPC:(BOOL)audioOnPC useHevc:(BOOL)useHevc - enableHdr:(BOOL)enableHdr; + enableHdr:(BOOL)enableHdr + btMouseSupport:(BOOL)btMouseSupport; - (NSArray*) getHosts; - (void) updateHost:(TemporaryHost*)host; diff --git a/Limelight/Database/DataManager.m b/Limelight/Database/DataManager.m index 22bb1296..fb7ae54c 100644 --- a/Limelight/Database/DataManager.m +++ b/Limelight/Database/DataManager.m @@ -63,7 +63,8 @@ multiController:(BOOL)multiController audioOnPC:(BOOL)audioOnPC useHevc:(BOOL)useHevc - enableHdr:(BOOL)enableHdr { + enableHdr:(BOOL)enableHdr + btMouseSupport:(BOOL)btMouseSupport { [_managedObjectContext performBlockAndWait:^{ Settings* settingsToSave = [self retrieveSettings]; @@ -78,6 +79,7 @@ settingsToSave.playAudioOnPC = audioOnPC; settingsToSave.useHevc = useHevc; settingsToSave.enableHdr = enableHdr; + settingsToSave.btMouseSupport = btMouseSupport; [self saveData]; }]; diff --git a/Limelight/Database/TemporarySettings.h b/Limelight/Database/TemporarySettings.h index 28caa35e..c249976b 100644 --- a/Limelight/Database/TemporarySettings.h +++ b/Limelight/Database/TemporarySettings.h @@ -24,6 +24,7 @@ @property (nonatomic) BOOL playAudioOnPC; @property (nonatomic) BOOL optimizeGames; @property (nonatomic) BOOL enableHdr; +@property (nonatomic) BOOL btMouseSupport; - (id) initFromSettings:(Settings*)settings; diff --git a/Limelight/Database/TemporarySettings.m b/Limelight/Database/TemporarySettings.m index 2e231af7..aec111a6 100644 --- a/Limelight/Database/TemporarySettings.m +++ b/Limelight/Database/TemporarySettings.m @@ -39,6 +39,7 @@ self.enableHdr = [[NSUserDefaults standardUserDefaults] boolForKey:@"enableHdr"]; self.optimizeGames = [[NSUserDefaults standardUserDefaults] boolForKey:@"optimizeGames"]; self.multiController = [[NSUserDefaults standardUserDefaults] boolForKey:@"multipleControllers"]; + self.btMouseSupport = [[NSUserDefaults standardUserDefaults] boolForKey:@"btMouseSupport"]; NSInteger _screenSize = [[NSUserDefaults standardUserDefaults] integerForKey:@"streamResolution"]; switch (_screenSize) { @@ -69,6 +70,7 @@ self.optimizeGames = settings.optimizeGames; self.multiController = settings.multiController; self.onscreenControls = settings.onscreenControls; + self.btMouseSupport = settings.btMouseSupport; #endif self.uniqueId = settings.uniqueId; self.streamingRemotely = settings.streamingRemotely; diff --git a/Limelight/Input/StreamView.m b/Limelight/Input/StreamView.m index bed2d1df..259f3172 100644 --- a/Limelight/Input/StreamView.m +++ b/Limelight/Input/StreamView.m @@ -54,6 +54,9 @@ - (void) setupStreamView:(ControllerSupport*)controllerSupport swipeDelegate:(id)swipeDelegate interactionDelegate:(id)interactionDelegate { self->interactionDelegate = interactionDelegate; + + TemporarySettings* settings = [[[DataManager alloc] init] getSettings]; + #if TARGET_OS_TV remotePressRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(remoteButtonPressed:)]; remotePressRecognizer.allowedPressTypes = @[@(UIPressTypeSelect)]; @@ -65,8 +68,7 @@ [self addGestureRecognizer:remoteLongPressRecognizer]; #else onScreenControls = [[OnScreenControls alloc] initWithView:self controllerSup:controllerSupport swipeDelegate:swipeDelegate]; - DataManager* dataMan = [[DataManager alloc] init]; - OnScreenControlsLevel level = (OnScreenControlsLevel)[[dataMan getSettings].onscreenControls integerValue]; + OnScreenControlsLevel level = (OnScreenControlsLevel)[settings.onscreenControls integerValue]; if (level == OnScreenControlsLevelAuto) { [controllerSupport initAutoOnScreenControlMode:onScreenControls]; } @@ -80,7 +82,10 @@ x1mouse = [[X1Mouse alloc] init]; x1mouse.delegate = self; - [x1mouse start]; + + if (settings.btMouseSupport) { + [x1mouse start]; + } } - (void)startInteractionTimer { diff --git a/Limelight/Limelight.xcdatamodeld/.xccurrentversion b/Limelight/Limelight.xcdatamodeld/.xccurrentversion index 8055370c..3ebeef5d 100644 --- a/Limelight/Limelight.xcdatamodeld/.xccurrentversion +++ b/Limelight/Limelight.xcdatamodeld/.xccurrentversion @@ -3,6 +3,6 @@ _XCCurrentVersionName - Moonlight v1.4.xcdatamodel + Moonlight v1.5.xcdatamodel diff --git a/Limelight/Limelight.xcdatamodeld/Moonlight v1.5.xcdatamodel/contents b/Limelight/Limelight.xcdatamodeld/Moonlight v1.5.xcdatamodel/contents new file mode 100644 index 00000000..89bac307 --- /dev/null +++ b/Limelight/Limelight.xcdatamodeld/Moonlight v1.5.xcdatamodel/contents @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Limelight/ViewControllers/SettingsViewController.h b/Limelight/ViewControllers/SettingsViewController.h index a3b8a074..825e65f5 100644 --- a/Limelight/ViewControllers/SettingsViewController.h +++ b/Limelight/ViewControllers/SettingsViewController.h @@ -19,6 +19,7 @@ @property (strong, nonatomic) IBOutlet UISegmentedControl *multiControllerSelector; @property (strong, nonatomic) IBOutlet UISegmentedControl *audioOnPCSelector; @property (strong, nonatomic) IBOutlet UISegmentedControl *hevcSelector; +@property (strong, nonatomic) IBOutlet UISegmentedControl *btMouseSelector; @property (strong, nonatomic) IBOutlet UIScrollView *scrollView; #pragma clang diagnostic push diff --git a/Limelight/ViewControllers/SettingsViewController.m b/Limelight/ViewControllers/SettingsViewController.m index aa6e7167..3e540d15 100644 --- a/Limelight/ViewControllers/SettingsViewController.m +++ b/Limelight/ViewControllers/SettingsViewController.m @@ -191,6 +191,7 @@ static const int bitrateTable[] = { [self.hevcSelector setEnabled:NO]; } + [self.btMouseSelector setSelectedSegmentIndex:currentSettings.btMouseSupport ? 1 : 0]; [self.optimizeSettingsSelector setSelectedSegmentIndex:currentSettings.optimizeGames ? 1 : 0]; [self.multiControllerSelector setSelectedSegmentIndex:currentSettings.multiController ? 1 : 0]; [self.audioOnPCSelector setSelectedSegmentIndex:currentSettings.playAudioOnPC ? 1 : 0]; @@ -290,6 +291,7 @@ static const int bitrateTable[] = { BOOL multiController = [self.multiControllerSelector selectedSegmentIndex] == 1; BOOL audioOnPC = [self.audioOnPCSelector selectedSegmentIndex] == 1; BOOL useHevc = [self.hevcSelector selectedSegmentIndex] == 1; + BOOL btMouseSupport = [self.btMouseSelector selectedSegmentIndex] == 1; [dataMan saveSettingsWithBitrate:_bitrate framerate:framerate height:height @@ -300,7 +302,8 @@ static const int bitrateTable[] = { multiController:multiController audioOnPC:audioOnPC useHevc:useHevc - enableHdr:NO]; + enableHdr:NO + btMouseSupport:btMouseSupport]; } - (void)didReceiveMemoryWarning { diff --git a/Moonlight TV/Info.plist b/Moonlight TV/Info.plist index 29fb98ea..3db1d234 100644 --- a/Moonlight TV/Info.plist +++ b/Moonlight TV/Info.plist @@ -2,6 +2,10 @@ + NSBluetoothPeripheralUsageDescription + Bluetooth access allows Moonlight to connect to Citrix X1 mice. + NSBluetoothAlwaysUsageDescription + Bluetooth access allows Moonlight to connect to Citrix X1 mice. CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName diff --git a/Moonlight TV/Settings.bundle/Root.plist b/Moonlight TV/Settings.bundle/Root.plist index 18959735..d843929b 100644 --- a/Moonlight TV/Settings.bundle/Root.plist +++ b/Moonlight TV/Settings.bundle/Root.plist @@ -144,6 +144,16 @@ DefaultValue + + Type + PSToggleSwitchSpecifier + Title + Citrix X1 Mouse Support + Key + btMouseSupport + DefaultValue + + diff --git a/Moonlight.xcodeproj/project.pbxproj b/Moonlight.xcodeproj/project.pbxproj index 31e50a64..da0e9652 100644 --- a/Moonlight.xcodeproj/project.pbxproj +++ b/Moonlight.xcodeproj/project.pbxproj @@ -165,6 +165,7 @@ 98608BDD22DC0C2C000E5672 /* Moonlight v1.4.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Moonlight v1.4.xcdatamodel"; sourceTree = ""; }; 9865DC3B2132922E0005B9B9 /* GameController.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameController.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS11.4.sdk/System/Library/Frameworks/GameController.framework; sourceTree = DEVELOPER_DIR; }; 986CCE6C2133E45300168291 /* Moonlight v1.2.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Moonlight v1.2.xcdatamodel"; sourceTree = ""; }; + 98783FEA242EAC5D00F00EF4 /* Moonlight v1.5.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Moonlight v1.5.xcdatamodel"; sourceTree = ""; }; 98878AE0206A226D00586E90 /* OSPortabilityDefs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSPortabilityDefs.h; sourceTree = ""; }; 9890CF6A203B7EE1006C4B06 /* libxml2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxml2.tbd; path = usr/lib/libxml2.tbd; sourceTree = SDKROOT; }; 9896219623D15C7000211983 /* X1Kit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = X1Kit.swift; path = X1Kit/Sources/X1Kit/X1Kit.swift; sourceTree = ""; }; @@ -1391,6 +1392,7 @@ FB290D0519B2C406004C83CF /* Limelight.xcdatamodeld */ = { isa = XCVersionGroup; children = ( + 98783FEA242EAC5D00F00EF4 /* Moonlight v1.5.xcdatamodel */, 98608BDD22DC0C2C000E5672 /* Moonlight v1.4.xcdatamodel */, 98517B1B21CE0A9000481377 /* Moonlight v1.3.xcdatamodel */, 986CCE6C2133E45300168291 /* Moonlight v1.2.xcdatamodel */, @@ -1401,7 +1403,7 @@ FB4678F21A51BDCB00377732 /* Limelight 0.3.0.xcdatamodel */, FB290D0619B2C406004C83CF /* Limelight.xcdatamodel */, ); - currentVersion = 98608BDD22DC0C2C000E5672 /* Moonlight v1.4.xcdatamodel */; + currentVersion = 98783FEA242EAC5D00F00EF4 /* Moonlight v1.5.xcdatamodel */; path = Limelight.xcdatamodeld; sourceTree = ""; versionGroupType = wrapper.xcdatamodel; diff --git a/iPad.storyboard b/iPad.storyboard index e648a235..34013869 100644 --- a/iPad.storyboard +++ b/iPad.storyboard @@ -202,6 +202,23 @@ + + + + + + + + + + + @@ -209,6 +226,7 @@ + diff --git a/iPhone.storyboard b/iPhone.storyboard index b0fd0da8..467faba0 100644 --- a/iPhone.storyboard +++ b/iPhone.storyboard @@ -221,6 +221,23 @@ + + + + + + + + + + + @@ -228,6 +245,7 @@ +