- notification lifecycle fixes - replace some notifications with delegates
- fix osw profile switch issue
This commit is contained in:
1 parent
cd6e08956c
commit
6bc142a07b
12 files changed
+89
-96
No files matched your search
@@ -34,7 +34,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
|
- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
|
||||||
- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
|
- (void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
|
||||||
- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
|
- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
|
||||||
- (void) updateGuidelinesForOnScreenWidget:(OnScreenWidgetView* )widget;
|
- (void)updateGuidelinesForOnScreenWidget:(OnScreenWidgetView* )widget;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
@@ -32,11 +32,6 @@
|
|||||||
|
|
||||||
|
|
||||||
- (id) initWithView:(UIView*)view controllerSup:(ControllerSupport*)controllerSupport streamConfig:(StreamConfiguration*)streamConfig oscLevel:(int)oscLevel {
|
- (id) initWithView:(UIView*)view controllerSup:(ControllerSupport*)controllerSupport streamConfig:(StreamConfiguration*)streamConfig oscLevel:(int)oscLevel {
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
||||||
selector:@selector(handleMovingOnScreenWidgetNotification:)
|
|
||||||
name:@"OnScreenWidgetMovedByTouch"
|
|
||||||
object:nil];
|
|
||||||
|
|
||||||
|
|
||||||
_view = view;
|
_view = view;
|
||||||
_view.multipleTouchEnabled = false;
|
_view.multipleTouchEnabled = false;
|
||||||
@@ -121,12 +116,7 @@
|
|||||||
[self._view addSubview: verticalGuideline];
|
[self._view addSubview: verticalGuideline];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) handleMovingOnScreenWidgetNotification: (NSNotification *)notification{
|
- (void)updateGuidelinesForOnScreenWidget:(OnScreenWidgetView* )widget{
|
||||||
OnScreenWidgetView* widget = notification.object;
|
|
||||||
[self updateGuidelinesForOnScreenWidget:widget];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) updateGuidelinesForOnScreenWidget: (OnScreenWidgetView* )widget{
|
|
||||||
/* have guidelines follow wherever the user is touching on the screen */
|
/* have guidelines follow wherever the user is touching on the screen */
|
||||||
horizontalGuideline.hidden = verticalGuideline.hidden = NO;
|
horizontalGuideline.hidden = verticalGuideline.hidden = NO;
|
||||||
horizontalGuideline.center = verticalGuideline.center = CGPointMake(CGRectGetMidX(widget.frame), CGRectGetMidY(widget.frame));
|
horizontalGuideline.center = verticalGuideline.center = CGPointMake(CGRectGetMidX(widget.frame), CGRectGetMidY(widget.frame));
|
||||||
@@ -349,5 +339,4 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -19,6 +19,12 @@ import UIKit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc protocol OnScreenWidgetGuidelineUpdateDelegate: AnyObject {
|
||||||
|
func updateGuidelinesForOnScreenWidget(_ sender: Any)
|
||||||
|
}
|
||||||
|
@objc public weak var guidelineDelegate: OnScreenWidgetGuidelineUpdateDelegate?
|
||||||
|
|
||||||
|
|
||||||
enum WidgetTypeEnum: UInt8 {
|
enum WidgetTypeEnum: UInt8 {
|
||||||
case uninitialized = 0
|
case uninitialized = 0
|
||||||
case button = 1
|
case button = 1
|
||||||
@@ -1079,7 +1085,7 @@ import UIKit
|
|||||||
// center = currentLocation;
|
// center = currentLocation;
|
||||||
//NSLog("x coord: %f, y coord: %f", self.frame.origin.x, self.frame.origin.y)
|
//NSLog("x coord: %f, y coord: %f", self.frame.origin.x, self.frame.origin.y)
|
||||||
if OnScreenWidgetView.editMode {
|
if OnScreenWidgetView.editMode {
|
||||||
NotificationCenter.default.post(name: Notification.Name("OnScreenWidgetMovedByTouch"), object:self) // inform the layoutOnScreenControl to update guideLines for this widget view
|
guidelineDelegate?.updateGuidelinesForOnScreenWidget(self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,12 @@
|
|||||||
|
|
||||||
@protocol UserInteractionDelegate <NSObject>
|
@protocol UserInteractionDelegate <NSObject>
|
||||||
|
|
||||||
- (void) userInteractionBegan;
|
- (void)userInteractionBegan;
|
||||||
- (void) userInteractionEnded;
|
- (void)userInteractionEnded;
|
||||||
- (void) streamExitRequested;
|
- (void)streamExitRequested;
|
||||||
- (void) toggleStatsOverlay;
|
- (void)toggleStatsOverlay;
|
||||||
- (void) localMousePointerMode;
|
- (void)localMousePointerMode;
|
||||||
- (void) toggleMouseVisible;
|
- (void)toggleMouseVisible;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@@ -57,6 +57,10 @@
|
|||||||
|
|
||||||
- (OnScreenControlsLevel) getCurrentOscState;
|
- (OnScreenControlsLevel) getCurrentOscState;
|
||||||
|
|
||||||
|
- (void)keyboardWillShow:(NSNotification *)notification;
|
||||||
|
- (void)keyboardWillHide;
|
||||||
|
|
||||||
|
|
||||||
#if !TARGET_OS_TV
|
#if !TARGET_OS_TV
|
||||||
- (void) updateCursorLocation:(CGPoint)location isMouse:(BOOL)isMouse;
|
- (void) updateCursorLocation:(CGPoint)location isMouse:(BOOL)isMouse;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -104,15 +104,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
keyboardToggleRecognizer.tapDownTimeThreshold = 0.2; // tap down time threshold in seconds.
|
keyboardToggleRecognizer.tapDownTimeThreshold = 0.2; // tap down time threshold in seconds.
|
||||||
keyboardToggleRecognizer.delaysTouchesBegan = NO;
|
keyboardToggleRecognizer.delaysTouchesBegan = NO;
|
||||||
keyboardToggleRecognizer.delaysTouchesEnded = NO;
|
keyboardToggleRecognizer.delaysTouchesEnded = NO;
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
NSLog(@"setup streamView %f", CACurrentMediaTime());
|
||||||
selector:@selector(keyboardWillShow:)
|
|
||||||
name:UIKeyboardWillShowNotification
|
|
||||||
object:nil];
|
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
||||||
selector:@selector(keyboardWillHide:)
|
|
||||||
name:UIKeyboardWillHideNotification
|
|
||||||
object:nil];
|
|
||||||
|
|
||||||
// if(settings.touchMode.intValue == NativeTouchOnly) [self addGestureRecognizer:keyboardToggleRecognizer]; //keep legacy approach in pure native mode
|
// if(settings.touchMode.intValue == NativeTouchOnly) [self addGestureRecognizer:keyboardToggleRecognizer]; //keep legacy approach in pure native mode
|
||||||
// else [self->streamFrameTopLayerView addGestureRecognizer:keyboardToggleRecognizer]; //add to the superview in other modes
|
// else [self->streamFrameTopLayerView addGestureRecognizer:keyboardToggleRecognizer]; //add to the superview in other modes
|
||||||
@@ -233,11 +225,11 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
self.frame = liftedStreamFrame;
|
self.frame = liftedStreamFrame;
|
||||||
isInputingText = true;
|
isInputingText = true;
|
||||||
}
|
}
|
||||||
// NSLog(@"keyboard will show");
|
NSLog(@"keyboard will show %f", CACurrentMediaTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
// this method also deals with recovering streamview when local keyboard is turned off
|
// this method also deals with recovering streamview when local keyboard is turned off
|
||||||
- (void)keyboardWillHide:(NSNotification *)notification{
|
- (void)keyboardWillHide{
|
||||||
|
|
||||||
if(isInputingText){
|
if(isInputingText){
|
||||||
CGRect liftedStreamFrame = self.frame;
|
CGRect liftedStreamFrame = self.frame;
|
||||||
@@ -246,7 +238,6 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
self.frame = liftedStreamFrame;
|
self.frame = liftedStreamFrame;
|
||||||
isInputingText = false;
|
isInputingText = false;
|
||||||
}
|
}
|
||||||
// NSLog(@"keyboard will hide");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
<string>armv7</string>
|
<string>armv7</string>
|
||||||
</array>
|
</array>
|
||||||
<key>UIRequiresFullScreen</key>
|
<key>UIRequiresFullScreen</key>
|
||||||
<false/>
|
<true/>
|
||||||
<key>UIStatusBarHidden</key>
|
<key>UIStatusBarHidden</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>UISupportedInterfaceOrientations</key>
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ extern int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size,
|
|||||||
|
|
||||||
- (id)initWithView:(StreamView*)view callbacks:(id<ConnectionCallbacks>)callbacks streamAspectRatio:(float)aspectRatio useFramePacing:(BOOL)useFramePacing
|
- (id)initWithView:(StreamView*)view callbacks:(id<ConnectionCallbacks>)callbacks streamAspectRatio:(float)aspectRatio useFramePacing:(BOOL)useFramePacing
|
||||||
{
|
{
|
||||||
|
NSLog(@"initializing video decoder %f", CACurrentMediaTime());
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
|
||||||
_view = view;
|
_view = view;
|
||||||
@@ -145,8 +146,8 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)stop
|
- (void)stop{
|
||||||
{
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||||
[_displayLink invalidate];
|
[_displayLink invalidate];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
/**
|
/**
|
||||||
This view controller provides the user interface which allows the user to position on screen controller buttons anywhere they'd like on the screen. It also provides the user with the abilities to undo a change, save the on screen controller layout for later retrieval, and load previously saved controller layouts
|
This view controller provides the user interface which allows the user to position on screen controller buttons anywhere they'd like on the screen. It also provides the user with the abilities to undo a change, save the on screen controller layout for later retrieval, and load previously saved controller layouts
|
||||||
*/
|
*/
|
||||||
@interface LayoutOnScreenControlsViewController : UIViewController
|
@interface LayoutOnScreenControlsViewController : UIViewController <OnScreenWidgetGuidelineUpdateDelegate>
|
||||||
- (void)profileRefresh;
|
- (void)profileRefresh;
|
||||||
- (void)reloadOnScreenWidgetViews;
|
- (void)reloadOnScreenWidgetViews;
|
||||||
- (void)presentProfilesTableView;
|
- (void)presentProfilesTableView;
|
||||||
|
|||||||
+36
-39
@@ -79,6 +79,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void) reloadOnScreenWidgetViews {
|
- (void) reloadOnScreenWidgetViews {
|
||||||
|
NSLog(@"reloadOnScreenWidgets %f", CACurrentMediaTime());
|
||||||
OnScreenWidgetView.editMode = true;
|
OnScreenWidgetView.editMode = true;
|
||||||
[self->selectedWidgetView.stickBallLayer removeFromSuperlayer];
|
[self->selectedWidgetView.stickBallLayer removeFromSuperlayer];
|
||||||
[self->selectedWidgetView.crossMarkLayer removeFromSuperlayer];
|
[self->selectedWidgetView.crossMarkLayer removeFromSuperlayer];
|
||||||
@@ -101,6 +102,7 @@
|
|||||||
OnScreenButtonState* buttonState = [profilesManager unarchiveButtonStateEncoded:buttonStateEncoded];
|
OnScreenButtonState* buttonState = [profilesManager unarchiveButtonStateEncoded:buttonStateEncoded];
|
||||||
if(buttonState.buttonType == CustomOnScreenWidget){
|
if(buttonState.buttonType == CustomOnScreenWidget){
|
||||||
OnScreenWidgetView* widgetView = [[OnScreenWidgetView alloc] initWithCmdString:buttonState.name buttonLabel:buttonState.alias shape:buttonState.widgetShape]; //reconstruct widgetView
|
OnScreenWidgetView* widgetView = [[OnScreenWidgetView alloc] initWithCmdString:buttonState.name buttonLabel:buttonState.alias shape:buttonState.widgetShape]; //reconstruct widgetView
|
||||||
|
widgetView.guidelineDelegate = (id<OnScreenWidgetGuidelineUpdateDelegate>)self;
|
||||||
widgetView.translatesAutoresizingMaskIntoConstraints = NO; // weird but this is mandatory, or you will find no key views added to the right place
|
widgetView.translatesAutoresizingMaskIntoConstraints = NO; // weird but this is mandatory, or you will find no key views added to the right place
|
||||||
widgetView.widthFactor = buttonState.widthFactor;
|
widgetView.widthFactor = buttonState.widthFactor;
|
||||||
widgetView.heightFactor = buttonState.heightFactor;
|
widgetView.heightFactor = buttonState.heightFactor;
|
||||||
@@ -166,38 +168,7 @@
|
|||||||
if (![profilesManager profileName:DEFAULT_TEMPLATE_NAME alreadyExistIn:allProfiles]){
|
if (![profilesManager profileName:DEFAULT_TEMPLATE_NAME alreadyExistIn:allProfiles]){
|
||||||
[profilesManager importDefaultTemplates];
|
[profilesManager importDefaultTemplates];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
||||||
selector:@selector(legacyOscLayerTapped:)
|
|
||||||
name:@"LegacyOscCALayerSelectedNotification"
|
|
||||||
object:nil];
|
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
||||||
selector:@selector(handleProfileTablViewDismiss)
|
|
||||||
name:@"OscLayoutTableViewCloseNotification"
|
|
||||||
object:nil];
|
|
||||||
|
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
||||||
selector:@selector(reloadOnScreenWidgetViews)
|
|
||||||
name:@"OscLayoutProfileSelctedInTableView" // This is a special notification for reloading the on screen keyboard buttons. which can't be executed by _oscProfilesTableViewController.needToUpdateOscLayoutTVC code block, and has to be triggered by a notification
|
|
||||||
object:nil];
|
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
||||||
selector:@selector(widgetViewTapped:)
|
|
||||||
name:@"OnScreenWidgetViewSelected"
|
|
||||||
object:nil];
|
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
||||||
selector:@selector(handleMovingOnScreenWidgetNotification:)
|
|
||||||
name:@"OnScreenWidgetMovedByTouch"
|
|
||||||
object:nil];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(OSCLayoutChanged) name:@"OSCLayoutChanged" object:nil]; // used to notifiy this view controller that the user made a change to the OSC layout so that the VC can either fade in or out its 'Undo button' which will signify to the user whether there are any OSC layout changes to undo
|
|
||||||
|
|
||||||
/* This will animate the toolbar with a subtle up and down motion intended to telegraph to the user that they can hide the toolbar if they wish*/
|
/* This will animate the toolbar with a subtle up and down motion intended to telegraph to the user that they can hide the toolbar if they wish*/
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||||
|
|
||||||
@@ -230,15 +201,42 @@
|
|||||||
vibrationGenerator = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium];
|
vibrationGenerator = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleMedium];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)viewDidDisappear:(BOOL)animated{
|
||||||
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||||
|
}
|
||||||
|
|
||||||
- (void) viewDidAppear:(BOOL)animated {
|
- (void)viewDidAppear:(BOOL)animated {
|
||||||
OnScreenWidgetView.editMode = true;
|
OnScreenWidgetView.editMode = true;
|
||||||
selectedWidgetView = nil;
|
selectedWidgetView = nil;
|
||||||
widgetPanelStoredCenter = self.widgetPanelStack.center;
|
widgetPanelStoredCenter = self.widgetPanelStack.center;
|
||||||
[super viewDidAppear:animated];
|
[super viewDidAppear:animated];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) viewWillAppear:(BOOL)animated{
|
- (void)viewWillAppear:(BOOL)animated{
|
||||||
|
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
|
selector:@selector(legacyOscLayerTapped:)
|
||||||
|
name:@"LegacyOscCALayerSelectedNotification"
|
||||||
|
object:nil];
|
||||||
|
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
|
selector:@selector(handleProfileTablViewDismiss)
|
||||||
|
name:@"OscLayoutTableViewCloseNotification"
|
||||||
|
object:nil];
|
||||||
|
|
||||||
|
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
|
selector:@selector(reloadOnScreenWidgetViews)
|
||||||
|
name:@"OscLayoutProfileSelctedInTableView" // This is a special notification for reloading the on screen keyboard buttons. which can't be executed by _oscProfilesTableViewController.needToUpdateOscLayoutTVC code block, and has to be triggered by a notification
|
||||||
|
object:nil];
|
||||||
|
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
|
selector:@selector(widgetViewTapped:)
|
||||||
|
name:@"OnScreenWidgetViewSelected"
|
||||||
|
object:nil];
|
||||||
|
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(OSCLayoutChanged) name:@"OSCLayoutChanged" object:nil]; // used to notifiy this view controller that the user made a change to the OSC layout so that the VC can either fade in or out its 'Undo button' which will signify to the user whether there are any OSC layout changes to undo
|
||||||
|
|
||||||
OnScreenWidgetView.editMode = true;
|
OnScreenWidgetView.editMode = true;
|
||||||
[self handleMissingToolBarIcon:toolbarRootView];
|
[self handleMissingToolBarIcon:toolbarRootView];
|
||||||
[self profileRefresh];
|
[self profileRefresh];
|
||||||
@@ -830,8 +828,7 @@
|
|||||||
|
|
||||||
|
|
||||||
- (void)setupWidgetPanel{
|
- (void)setupWidgetPanel{
|
||||||
//[self handleMissingToolBarIcon];
|
self.widgetPanelStack.hidden = _quickSwitchEnabled;
|
||||||
self.widgetPanelStack.hidden = NO;
|
|
||||||
self.loadConfigTipLabel.hidden = NO;
|
self.loadConfigTipLabel.hidden = NO;
|
||||||
|
|
||||||
self.widgetPanelStack.layoutMargins = UIEdgeInsetsMake(10, 10, 10, 10);
|
self.widgetPanelStack.layoutMargins = UIEdgeInsetsMake(10, 10, 10, 10);
|
||||||
@@ -1020,14 +1017,14 @@
|
|||||||
|
|
||||||
#pragma mark - Touch
|
#pragma mark - Touch
|
||||||
|
|
||||||
- (void) handleMovingOnScreenWidgetNotification: (NSNotification *)notification{
|
- (void)updateGuidelinesForOnScreenWidget:(id)sender{
|
||||||
OnScreenWidgetView* widget = notification.object;
|
OnScreenWidgetView* widget = (OnScreenWidgetView* )sender;
|
||||||
|
[self.layoutOSC updateGuidelinesForOnScreenWidget:widget];
|
||||||
[self.view bringSubviewToFront:widget];
|
[self.view bringSubviewToFront:widget];
|
||||||
trashCanButton.tintColor = [self layerOverlapWithTrashcanButton:widget.layer] ? [UIColor redColor] : trashCanStoryBoardColor;
|
trashCanButton.tintColor = [self layerOverlapWithTrashcanButton:widget.layer] ? [UIColor redColor] : trashCanStoryBoardColor;
|
||||||
self.undoButton.alpha = 1.0;
|
self.undoButton.alpha = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (BOOL) widgetPanelTouched:(UITouch *)touch{
|
- (BOOL) widgetPanelTouched:(UITouch *)touch{
|
||||||
CGPoint touchPoint = [touch locationInView:_widgetPanelStack];
|
CGPoint touchPoint = [touch locationInView:_widgetPanelStack];
|
||||||
UIView *touchedView = [_widgetPanelStack hitTest:touchPoint withEvent:nil];
|
UIView *touchedView = [_widgetPanelStack hitTest:touchPoint withEvent:nil];
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ const double NAV_BAR_HEIGHT = 50;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void) viewDidDisappear:(BOOL)animated{
|
- (void) viewDidDisappear:(BOOL)animated{
|
||||||
[super viewWillDisappear:animated];
|
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"OscLayoutTableViewCloseNotification" object:self]; // notify other view that oscLayoutManager is closing
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"OscLayoutTableViewCloseNotification" object:self]; // notify other view that oscLayoutManager is closing
|
||||||
|
[super viewDidDisappear:animated];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -305,18 +305,6 @@ BOOL isCustomResolution(CGSize res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void)deviceOrientationDidChange{
|
|
||||||
double delayInSeconds = 1.0;
|
|
||||||
// Convert the delay into a dispatch_time_t value
|
|
||||||
dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
|
|
||||||
// Perform some task after the delay
|
|
||||||
dispatch_after(delayTime, dispatch_get_main_queue(), ^{
|
|
||||||
// Code to execute after the delay
|
|
||||||
// [self updateResolutionTable];
|
|
||||||
// since we have viewWillTransitionToSize being called back both when orientation changed & app window size changed, resoltion update is dprecated here
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)viewDidDisappear:(BOOL)animated{
|
- (void)viewDidDisappear:(BOOL)animated{
|
||||||
[super viewDidDisappear:NO];
|
[super viewDidDisappear:NO];
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName:@"SettingsViewClosedNotification" object:self]; // notify other view that settings view just closed
|
[[NSNotificationCenter defaultCenter] postNotificationName:@"SettingsViewClosedNotification" object:self]; // notify other view that settings view just closed
|
||||||
@@ -1174,10 +1162,6 @@ BOOL isCustomResolution(CGSize res) {
|
|||||||
[self.view addGestureRecognizer:slideToCloseSettingsViewRecognizer];
|
[self.view addGestureRecognizer:slideToCloseSettingsViewRecognizer];
|
||||||
|
|
||||||
justEnteredSettingsViewDoNotOpenOscLayoutTool = true;
|
justEnteredSettingsViewDoNotOpenOscLayoutTool = true;
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
||||||
selector:@selector(deviceOrientationDidChange) // handle orientation change since i made portrait mode available
|
|
||||||
name:UIDeviceOrientationDidChangeNotification
|
|
||||||
object:nil];
|
|
||||||
|
|
||||||
// Always run settings in dark mode because we want the light fonts
|
// Always run settings in dark mode because we want the light fonts
|
||||||
if (@available(iOS 13.0, tvOS 13.0, *)) {
|
if (@available(iOS 13.0, tvOS 13.0, *)) {
|
||||||
@@ -1411,7 +1395,7 @@ BOOL isCustomResolution(CGSize res) {
|
|||||||
|
|
||||||
// init CustomOSC stuff
|
// init CustomOSC stuff
|
||||||
/* sets a reference to the correct 'LayoutOnScreenControlsViewController' depending on whether the user is on an iPhone or iPad */
|
/* sets a reference to the correct 'LayoutOnScreenControlsViewController' depending on whether the user is on an iPhone or iPad */
|
||||||
self.layoutOnScreenControlsVC = [[LayoutOnScreenControlsViewController alloc] init];
|
// self.layoutOnScreenControlsVC = [[LayoutOnScreenControlsViewController alloc] init];
|
||||||
BOOL isIPhone = ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone);
|
BOOL isIPhone = ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone);
|
||||||
if (isIPhone) {
|
if (isIPhone) {
|
||||||
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"iPhone" bundle:nil];
|
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"iPhone" bundle:nil];
|
||||||
|
|||||||
@@ -107,7 +107,7 @@
|
|||||||
|
|
||||||
[self.view addGestureRecognizer:_oscLayoutTapRecoginizer]; //
|
[self.view addGestureRecognizer:_oscLayoutTapRecoginizer]; //
|
||||||
/* sets a reference to the correct 'LayoutOnScreenControlsViewController' depending on whether the user is on an iPhone or iPad */
|
/* sets a reference to the correct 'LayoutOnScreenControlsViewController' depending on whether the user is on an iPhone or iPad */
|
||||||
_layoutOnScreenControlsVC = [[LayoutOnScreenControlsViewController alloc] init];
|
// _layoutOnScreenControlsVC = [[LayoutOnScreenControlsViewController alloc] init];
|
||||||
BOOL isIPhone = ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone);
|
BOOL isIPhone = ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone);
|
||||||
if (isIPhone) {
|
if (isIPhone) {
|
||||||
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"iPhone" bundle:nil];
|
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"iPhone" bundle:nil];
|
||||||
@@ -267,6 +267,17 @@
|
|||||||
selector:@selector(expandSettingsView) // //force expand settings view to update resolution table, and all setting includes current fullscreen resolution will be updated.
|
selector:@selector(expandSettingsView) // //force expand settings view to update resolution table, and all setting includes current fullscreen resolution will be updated.
|
||||||
name:@"SettingsOverlayButtonPressedNotification"
|
name:@"SettingsOverlayButtonPressedNotification"
|
||||||
object:nil];
|
object:nil];
|
||||||
|
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
|
selector:@selector(keyboardWillShow:)
|
||||||
|
name:UIKeyboardWillShowNotification
|
||||||
|
object:nil];
|
||||||
|
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
|
selector:@selector(keyboardWillHide)
|
||||||
|
name:UIKeyboardWillHideNotification
|
||||||
|
object:nil];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -433,12 +444,12 @@
|
|||||||
name:UIApplicationWillResignActiveNotification
|
name:UIApplicationWillResignActiveNotification
|
||||||
object:nil];
|
object:nil];
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver: self
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
selector: @selector(applicationDidBecomeActive:)
|
selector: @selector(applicationDidBecomeActive:)
|
||||||
name: UIApplicationDidBecomeActiveNotification
|
name: UIApplicationDidBecomeActiveNotification
|
||||||
object: nil];
|
object: nil];
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver: self
|
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||||
selector: @selector(applicationDidEnterBackground:)
|
selector: @selector(applicationDidEnterBackground:)
|
||||||
name: UIApplicationDidEnterBackgroundNotification
|
name: UIApplicationDidEnterBackgroundNotification
|
||||||
object: nil];
|
object: nil];
|
||||||
@@ -468,6 +479,15 @@
|
|||||||
[self.view addSubview:_tipLabel];
|
[self.view addSubview:_tipLabel];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)keyboardWillShow:(NSNotification *)notification{
|
||||||
|
[_streamView keyboardWillShow:notification];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)keyboardWillHide{
|
||||||
|
[_streamView keyboardWillHide];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void)openWidgetLayoutTool{
|
- (void)openWidgetLayoutTool{
|
||||||
[self->_streamView disableOnScreenControls];
|
[self->_streamView disableOnScreenControls];
|
||||||
[self->_streamView clearOnScreenKeyboardButtons]; // clear all onScreenKeyboardButtons before entering edit mode
|
[self->_streamView clearOnScreenKeyboardButtons]; // clear all onScreenKeyboardButtons before entering edit mode
|
||||||
|
|||||||
Reference in new issue
Block a user