stage manager & display orientation lock for iPhone
This commit is contained in:
1 parent
6bc142a07b
commit
357a907838
7 files changed
+33
-35
No files matched your search
@@ -795,7 +795,7 @@ const int FrontViewPositionNone = 0xff;
|
||||
[self setupMenuSeparator];
|
||||
}
|
||||
|
||||
- (bool)isIphone{
|
||||
- (bool)isIPhone{
|
||||
return ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone);
|
||||
}
|
||||
|
||||
@@ -807,22 +807,20 @@ const int FrontViewPositionNone = 0xff;
|
||||
else return UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskPortraitUpsideDown;
|
||||
}
|
||||
|
||||
- (BOOL)menuExpanded{
|
||||
return _frontViewPosition != FrontViewPositionLeft;
|
||||
}
|
||||
|
||||
// tested on iOS17.
|
||||
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
|
||||
// Return the supported interface orientations acoordingly
|
||||
if(!_isStreaming){
|
||||
if([self isIphone]) return UIInterfaceOrientationMaskAll; //always try to lock orientaion to landscape in mainFrameView.
|
||||
else return UIInterfaceOrientationMaskAll; //always try to lock current orientaion in mainFrameView for iPad in order to prevent bug.
|
||||
}
|
||||
|
||||
//lock the orientation accordingly after streaming is started
|
||||
DataManager* dataMan = [[DataManager alloc] init];
|
||||
Settings *currentSettings = [dataMan retrieveSettings];
|
||||
|
||||
if(currentSettings.unlockDisplayOrientation){
|
||||
return UIInterfaceOrientationMaskAll; // 90 Degree rotation will be allowed in streaming or app view
|
||||
}
|
||||
else return [self getCurrentOrientation]; // 90 Degree rotation not allowed in streaming or app view
|
||||
NSLog(@"orientation unlocked: %d", currentSettings.unlockDisplayOrientation);
|
||||
|
||||
if(currentSettings.unlockDisplayOrientation) return UIInterfaceOrientationMaskAll;
|
||||
else return [self isIPhone] ? UIInterfaceOrientationMaskLandscape : [self getCurrentOrientation];
|
||||
}
|
||||
|
||||
- (void)viewDidLayoutSubviews{
|
||||
|
||||
@@ -1310,7 +1310,8 @@ BOOL isCustomResolution(CGSize res) {
|
||||
[self updateResolutionDisplayLabel];
|
||||
|
||||
// Unlock Display Orientation setting
|
||||
bool unlockDisplayOrientationSelectorEnabled = [self isFullScreenRequired];//need "requires fullscreen" enabled in the app bunddle to make runtime orientation limitation woring
|
||||
// bool unlockDisplayOrientationSelectorEnabled = [self isFullScreenRequired];//need "requires fullscreen" enabled in the app bunddle to make runtime orientation limitation woring
|
||||
bool unlockDisplayOrientationSelectorEnabled = true;
|
||||
if(unlockDisplayOrientationSelectorEnabled) [self.unlockDisplayOrientationSelector setSelectedSegmentIndex:currentSettings.unlockDisplayOrientation ? 1 : 0];
|
||||
else [self.unlockDisplayOrientationSelector setSelectedSegmentIndex:1]; // can't lock screen orientation in this mode = Display Orientation always unlocked
|
||||
[self.unlockDisplayOrientationSelector setEnabled:unlockDisplayOrientationSelectorEnabled];
|
||||
@@ -1960,7 +1961,6 @@ BOOL isCustomResolution(CGSize res) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void) saveSettings {
|
||||
DataManager* dataMan = [[DataManager alloc] init];
|
||||
NSInteger framerate = [self getChosenFrameRate];
|
||||
|
||||
Reference in new issue
Block a user