refactor: disable verbose logging and remove gesture handlers
This commit is contained in:
1 parent
8f25081bbb
commit
a87969d5b8
2 files changed
+5
-97
No files matched your search
@@ -26,7 +26,7 @@
|
|||||||
#include <mach/mach_time.h>
|
#include <mach/mach_time.h>
|
||||||
|
|
||||||
// Define for extra logging related to frame pacing
|
// Define for extra logging related to frame pacing
|
||||||
#define DISPLAYLINK_VERBOSE
|
//#define DISPLAYLINK_VERBOSE
|
||||||
|
|
||||||
// Private libavformat API for writing the AV1 Codec Configuration Box
|
// Private libavformat API for writing the AV1 Codec Configuration Box
|
||||||
extern int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size,
|
extern int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size,
|
||||||
|
|||||||
@@ -81,13 +81,10 @@
|
|||||||
CustomTapGestureRecognizer *_oscLayoutTapRecoginizer;
|
CustomTapGestureRecognizer *_oscLayoutTapRecoginizer;
|
||||||
LayoutOnScreenControlsViewController *_layoutOnScreenControlsVC;
|
LayoutOnScreenControlsViewController *_layoutOnScreenControlsVC;
|
||||||
ToolboxViewController* toolBoxViewController;
|
ToolboxViewController* toolBoxViewController;
|
||||||
UISwipeGestureRecognizer *_topSwipeRecognizer;
|
|
||||||
UISwipeGestureRecognizer *_topSwipeUpRecognizer;
|
|
||||||
#else
|
#else
|
||||||
UITapGestureRecognizer *_menuTapGestureRecognizer;
|
UITapGestureRecognizer *_menuTapGestureRecognizer;
|
||||||
UITapGestureRecognizer *_menuDoubleTapGestureRecognizer;
|
UITapGestureRecognizer *_menuDoubleTapGestureRecognizer;
|
||||||
UITapGestureRecognizer *_playPauseTapGestureRecognizer;
|
UITapGestureRecognizer *_playPauseTapGestureRecognizer;
|
||||||
UITapGestureRecognizer *_remoteDoubleSelectRecognizer;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,14 +303,6 @@
|
|||||||
Log(LOG_I, @"Play/Pause button pressed -- backing out of stream");
|
Log(LOG_I, @"Play/Pause button pressed -- backing out of stream");
|
||||||
[self returnToMainFrame];
|
[self returnToMainFrame];
|
||||||
}
|
}
|
||||||
- (void)remoteSelectButtonDoublePressed:(id)sender {
|
|
||||||
Log(LOG_I, @"Select button double-tapped -- toggling stats");
|
|
||||||
if (!self->_statsUpdateTimer) {
|
|
||||||
[self showStats];
|
|
||||||
} else {
|
|
||||||
[self hideStats];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
- (void)popFirstLaunchTip {
|
- (void)popFirstLaunchTip {
|
||||||
@@ -411,7 +400,7 @@
|
|||||||
if(_settings.externalDisplayMode.intValue == 2) _streamVideoRenderView = _streamView;
|
if(_settings.externalDisplayMode.intValue == 2) _streamVideoRenderView = _streamView;
|
||||||
else {
|
else {
|
||||||
//NSLog(@"renderView separated from streamView");
|
//NSLog(@"renderView separated from streamView");
|
||||||
_streamVideoRenderView = [[StreamView alloc] initWithFrame:self.view.frame];
|
_streamVideoRenderView = (StreamView*)[[UIView alloc] initWithFrame:self.view.frame];
|
||||||
_streamVideoRenderView.bounds = _streamView.bounds;
|
_streamVideoRenderView.bounds = _streamView.bounds;
|
||||||
_streamVideoRenderView.userInteractionEnabled = false; // this will prevent renderView from intrecepting touchEvents which shall be interacting with streamView
|
_streamVideoRenderView.userInteractionEnabled = false; // this will prevent renderView from intrecepting touchEvents which shall be interacting with streamView
|
||||||
}
|
}
|
||||||
@@ -421,7 +410,7 @@
|
|||||||
if([self isFirstLaunch]) [self popFirstLaunchTip];
|
if([self isFirstLaunch]) [self popFirstLaunchTip];
|
||||||
|
|
||||||
#if TARGET_OS_TV
|
#if TARGET_OS_TV
|
||||||
if (!_menuTapGestureRecognizer || !_menuDoubleTapGestureRecognizer || !_playPauseTapGestureRecognizer || !_remoteDoubleSelectRecognizer) {
|
if (!_menuTapGestureRecognizer || !_menuDoubleTapGestureRecognizer || !_playPauseTapGestureRecognizer) {
|
||||||
_menuTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(controllerPauseButtonPressed:)];
|
_menuTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(controllerPauseButtonPressed:)];
|
||||||
_menuTapGestureRecognizer.allowedPressTypes = @[@(UIPressTypeMenu)];
|
_menuTapGestureRecognizer.allowedPressTypes = @[@(UIPressTypeMenu)];
|
||||||
|
|
||||||
@@ -432,36 +421,15 @@
|
|||||||
_menuDoubleTapGestureRecognizer.numberOfTapsRequired = 2;
|
_menuDoubleTapGestureRecognizer.numberOfTapsRequired = 2;
|
||||||
[_menuTapGestureRecognizer requireGestureRecognizerToFail:_menuDoubleTapGestureRecognizer];
|
[_menuTapGestureRecognizer requireGestureRecognizerToFail:_menuDoubleTapGestureRecognizer];
|
||||||
_menuDoubleTapGestureRecognizer.allowedPressTypes = @[@(UIPressTypeMenu)];
|
_menuDoubleTapGestureRecognizer.allowedPressTypes = @[@(UIPressTypeMenu)];
|
||||||
|
|
||||||
_remoteDoubleSelectRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(remoteSelectButtonDoublePressed:)];
|
|
||||||
_remoteDoubleSelectRecognizer.numberOfTapsRequired = 2;
|
|
||||||
_remoteDoubleSelectRecognizer.allowedPressTypes = @[@(UIPressTypeSelect)];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[self.view addGestureRecognizer:_menuTapGestureRecognizer];
|
[self.view addGestureRecognizer:_menuTapGestureRecognizer];
|
||||||
[self.view addGestureRecognizer:_menuDoubleTapGestureRecognizer];
|
[self.view addGestureRecognizer:_menuDoubleTapGestureRecognizer];
|
||||||
[self.view addGestureRecognizer:_playPauseTapGestureRecognizer];
|
[self.view addGestureRecognizer:_playPauseTapGestureRecognizer];
|
||||||
[self.view addGestureRecognizer:_remoteDoubleSelectRecognizer];
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
_topSwipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(topSwiped)];
|
//[self configSwipeGestures]; // swipe & exit gesture configured here
|
||||||
_topSwipeRecognizer.direction = UISwipeGestureRecognizerDirectionDown;
|
//[self configOscLayoutTool]; //_oscLayoutTapRecoginizer will be added or removed to the view here
|
||||||
_topSwipeRecognizer.numberOfTouchesRequired = 2;
|
|
||||||
_topSwipeRecognizer.enabled = TRUE;
|
|
||||||
[self.view addGestureRecognizer:_topSwipeRecognizer];
|
|
||||||
|
|
||||||
_topSwipeUpRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(topSwipedUp)];
|
|
||||||
_topSwipeUpRecognizer.direction = UISwipeGestureRecognizerDirectionUp;
|
|
||||||
_topSwipeUpRecognizer.numberOfTouchesRequired = 2;
|
|
||||||
_topSwipeUpRecognizer.enabled = FALSE;
|
|
||||||
// This is added to the _overlayView when displayed
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if TARGET_OS_TV
|
|
||||||
// we need to tell the other remote handler in RelativeTouchHandler to wait for our double-select
|
|
||||||
RelativeTouchHandler *touchHandler = (RelativeTouchHandler *)[_streamView touchHandler];
|
|
||||||
UIGestureRecognizer *remotePressRecognizer = [touchHandler remotePressRecognizer];
|
|
||||||
[remotePressRecognizer requireGestureRecognizerToFail:_remoteDoubleSelectRecognizer];
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_tipLabel = [[UILabel alloc] init];
|
_tipLabel = [[UILabel alloc] init];
|
||||||
@@ -671,8 +639,6 @@
|
|||||||
#else
|
#else
|
||||||
[_overlayView setFont:[UIFont systemFontOfSize:12 weight:UIFontWeightMedium]];
|
[_overlayView setFont:[UIFont systemFontOfSize:12 weight:UIFontWeightMedium]];
|
||||||
|
|
||||||
_topSwipeUpRecognizer.enabled = TRUE;
|
|
||||||
[_overlayView addGestureRecognizer:_topSwipeUpRecognizer];
|
|
||||||
#endif
|
#endif
|
||||||
int opacity = MAX([_settings.graphOpacity intValue], 60);
|
int opacity = MAX([_settings.graphOpacity intValue], 60);
|
||||||
[_overlayView setAlpha:(float)opacity / 100.0];
|
[_overlayView setAlpha:(float)opacity / 100.0];
|
||||||
@@ -704,11 +670,6 @@
|
|||||||
[_statsUpdateTimer invalidate];
|
[_statsUpdateTimer invalidate];
|
||||||
_statsUpdateTimer = nil;
|
_statsUpdateTimer = nil;
|
||||||
|
|
||||||
#if !TARGET_OS_TV
|
|
||||||
_topSwipeRecognizer.enabled = FALSE;
|
|
||||||
_topSwipeUpRecognizer.enabled = FALSE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
[self.navigationController popToRootViewControllerAnimated:YES];
|
[self.navigationController popToRootViewControllerAnimated:YES];
|
||||||
|
|
||||||
_extWindow = nil;
|
_extWindow = nil;
|
||||||
@@ -867,58 +828,6 @@
|
|||||||
[self returnToMainFrame];
|
[self returnToMainFrame];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)topSwiped {
|
|
||||||
Log(LOG_I, @"User swiped/cicked down for stats");
|
|
||||||
[self showStats];
|
|
||||||
|
|
||||||
#if !TARGET_OS_TV
|
|
||||||
_topSwipeRecognizer.enabled = FALSE;
|
|
||||||
_topSwipeUpRecognizer.enabled = TRUE;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)showStats {
|
|
||||||
if (self->_statsUpdateTimer == nil) {
|
|
||||||
self->_statsUpdateTimer = [NSTimer scheduledTimerWithTimeInterval:1.0f
|
|
||||||
target:self
|
|
||||||
selector:@selector(updateStatsOverlay)
|
|
||||||
userInfo:nil
|
|
||||||
repeats:YES];
|
|
||||||
[self->_statsUpdateTimer fire];
|
|
||||||
|
|
||||||
if (_settings.enableGraphs) {
|
|
||||||
[self.imguiView start];
|
|
||||||
[self.imguiView show];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)topSwipedUp {
|
|
||||||
Log(LOG_I, @"User swiped up to hide stats");
|
|
||||||
[self hideStats];
|
|
||||||
|
|
||||||
#if !TARGET_OS_TV
|
|
||||||
_topSwipeRecognizer.enabled = TRUE;
|
|
||||||
_topSwipeUpRecognizer.enabled = FALSE;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)hideStats {
|
|
||||||
if (self->_statsUpdateTimer != nil) {
|
|
||||||
[_statsUpdateTimer invalidate];
|
|
||||||
_statsUpdateTimer = nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_overlayView != nil) {
|
|
||||||
[_overlayView setHidden:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_settings.enableGraphs) {
|
|
||||||
[self.imguiView hide];
|
|
||||||
[self.imguiView stop];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void) connectionStarted {
|
- (void) connectionStarted {
|
||||||
Log(LOG_I, @"Connection started");
|
Log(LOG_I, @"Connection started");
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
@@ -933,7 +842,6 @@
|
|||||||
[self->_controllerSupport connectionEstablished];
|
[self->_controllerSupport connectionEstablished];
|
||||||
|
|
||||||
if (self->_settings.statsOverlayEnabled) {
|
if (self->_settings.statsOverlayEnabled) {
|
||||||
[self topSwiped];
|
|
||||||
self->_statsUpdateTimer = [NSTimer scheduledTimerWithTimeInterval:1.0f
|
self->_statsUpdateTimer = [NSTimer scheduledTimerWithTimeInterval:1.0f
|
||||||
target:self
|
target:self
|
||||||
selector:@selector(updateStatsOverlay)
|
selector:@selector(updateStatsOverlay)
|
||||||
|
|||||||
Reference in new issue
Block a user