tweak statsOverlay
This commit is contained in:
1 parent
adce543c45
commit
0e51a49898
6 files changed
+55
-39
No files matched your search
@@ -375,25 +375,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"[ Toggle stats overlay & graphs ]" : {
|
"[ Toggle stats overlay ]" : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"zh-Hans" : {
|
"zh-Hans" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "translated",
|
"state" : "translated",
|
||||||
"value" : "[ 切换统计覆盖层和图表 ]"
|
"value" : "[ 切换统计覆盖层 ]"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"zh-Hant" : {
|
"zh-Hant" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "translated",
|
"state" : "translated",
|
||||||
"value" : "[ 切換統計覆蓋層和圖表 ]"
|
"value" : "[ 切換統計覆蓋層 ]"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"zh-HK" : {
|
"zh-HK" : {
|
||||||
"stringUnit" : {
|
"stringUnit" : {
|
||||||
"state" : "translated",
|
"state" : "translated",
|
||||||
"value" : "[ 切換統計覆蓋層和圖表 ]"
|
"value" : "[ 切換統計覆蓋層 ]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -467,7 +467,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"%u ms (variance: %u ms)" : {
|
"%u ms (var: %u ms)" : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
"zh-Hans" : {
|
"zh-Hans" : {
|
||||||
@@ -2079,29 +2079,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"FPS: %5.2f Network dropped frames: %.2f%% Network latency: %@" : {
|
|
||||||
"extractionState" : "manual",
|
|
||||||
"localizations" : {
|
|
||||||
"zh-Hans" : {
|
|
||||||
"stringUnit" : {
|
|
||||||
"state" : "translated",
|
|
||||||
"value" : "帧率: %5.2f 网络丢帧: %.2f%% 网络延迟: %@"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"zh-Hant" : {
|
|
||||||
"stringUnit" : {
|
|
||||||
"state" : "translated",
|
|
||||||
"value" : "FPS:%5.2f 網路掉幀:%.2f%% 網路延遲:%@"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"zh-HK" : {
|
|
||||||
"stringUnit" : {
|
|
||||||
"state" : "translated",
|
|
||||||
"value" : "FPS:%5.2f 網路掉幀:%.2f%% 網路延遲:%@"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"framePacingStackTip" : {
|
"framePacingStackTip" : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
@@ -4880,6 +4857,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"simplifiedOsdText" : {
|
||||||
|
"extractionState" : "manual",
|
||||||
|
"localizations" : {
|
||||||
|
"en" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "FPS: %6.2f Dropped frames: %.1f%% Bitrate: %5.1f Mbps Latency: %@"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hans" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "帧率: %6.2f 丢帧: %.1f%% 码率: %5.1f Mbps 延迟: %@"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-Hant" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "FPS: %6.2f 掉幀: %.1f%% 位元速率: %5.1f Mbps 延遲: %@"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"zh-HK" : {
|
||||||
|
"stringUnit" : {
|
||||||
|
"state" : "translated",
|
||||||
|
"value" : "FPS: %6.2f 掉幀: %.1f%% 位元速率: %5.1f Mbps 延遲: %@"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"Size" : {
|
"Size" : {
|
||||||
"extractionState" : "manual",
|
"extractionState" : "manual",
|
||||||
"localizations" : {
|
"localizations" : {
|
||||||
|
|||||||
@@ -169,7 +169,7 @@
|
|||||||
uint32_t rtt, variance;
|
uint32_t rtt, variance;
|
||||||
NSString* latencyString;
|
NSString* latencyString;
|
||||||
if (LiGetEstimatedRttInfo(&rtt, &variance)) {
|
if (LiGetEstimatedRttInfo(&rtt, &variance)) {
|
||||||
latencyString = [LocalizationHelper localizedStringForKey:@"%u ms (variance: %u ms)", rtt, variance];
|
latencyString = [LocalizationHelper localizedStringForKey:@"%u ms (var: %u ms)", rtt, variance];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
latencyString = @"N/A";
|
latencyString = @"N/A";
|
||||||
@@ -205,9 +205,10 @@
|
|||||||
double avgVideoMbps = [_connection getBwTracker].averageMbps;
|
double avgVideoMbps = [_connection getBwTracker].averageMbps;
|
||||||
double peakVideoMbps = [_connection getBwTracker].peakMbps;
|
double peakVideoMbps = [_connection getBwTracker].peakMbps;
|
||||||
|
|
||||||
if(overlayLevel == 1) return [LocalizationHelper localizedStringForKey:@"FPS: %5.2f Network dropped frames: %.2f%% Network latency: %@",
|
if(overlayLevel == 1) return [LocalizationHelper localizedStringForKey:@"simplifiedOsdText",
|
||||||
fps,
|
fps,
|
||||||
stats.networkDroppedFrames / interval,
|
stats.networkDroppedFrames / interval,
|
||||||
|
avgVideoMbps,
|
||||||
latencyString];
|
latencyString];
|
||||||
else {
|
else {
|
||||||
if (framePacingMode == FramePacingModeLegacy || framePacingMode == FramePacingModeOff) {
|
if (framePacingMode == FramePacingModeLegacy || framePacingMode == FramePacingModeOff) {
|
||||||
|
|||||||
@@ -38,5 +38,6 @@
|
|||||||
- (NSInteger)requestForBitrate:(NSInteger)bitrateKbps;
|
- (NSInteger)requestForBitrate:(NSInteger)bitrateKbps;
|
||||||
#endif
|
#endif
|
||||||
- (void)fillResolutionTable:(CGSize*)resolutionTable externalDisplayMode:(NSInteger)externalDisplayMode;
|
- (void)fillResolutionTable:(CGSize*)resolutionTable externalDisplayMode:(NSInteger)externalDisplayMode;
|
||||||
|
- (bool)isIPhone;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -1540,7 +1540,7 @@ static NSMutableSet* hostList;
|
|||||||
[self setupNavBar];
|
[self setupNavBar];
|
||||||
|
|
||||||
// Set the gesture
|
// Set the gesture
|
||||||
if(![self isIPhonePortrait]) [self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer]; // to prevent buggy settings view in iphone portrait mode;
|
[self.view addGestureRecognizer:self.revealViewController.panGestureRecognizer];
|
||||||
|
|
||||||
// Get callbacks associated with the viewController
|
// Get callbacks associated with the viewController
|
||||||
[self.revealViewController setDelegate:self];
|
[self.revealViewController setDelegate:self];
|
||||||
|
|||||||
@@ -355,6 +355,8 @@
|
|||||||
_settings = [[[DataManager alloc] init] getSettings]; //StreamFrameViewController retrieve the settings here.
|
_settings = [[[DataManager alloc] init] getSettings]; //StreamFrameViewController retrieve the settings here.
|
||||||
}
|
}
|
||||||
overlayLevel = _settings.statsOverlayLevel.intValue;
|
overlayLevel = _settings.statsOverlayLevel.intValue;
|
||||||
|
[self setupOverlayView];
|
||||||
|
|
||||||
if(viewIsBeingResized) viewIsBeingResized = false;
|
if(viewIsBeingResized) viewIsBeingResized = false;
|
||||||
else [self configOscLayoutTool];
|
else [self configOscLayoutTool];
|
||||||
[self updateToolboxSpecialEntries];
|
[self updateToolboxSpecialEntries];
|
||||||
@@ -871,13 +873,13 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updateOverlayText:(NSString*)text {
|
- (void)setupOverlayView{
|
||||||
if (_overlayView == nil) {
|
if (_overlayView == nil) {
|
||||||
_overlayView = [[PaddedLabel alloc] initWithFrame:CGRectZero];
|
_overlayView = [[PaddedLabel alloc] initWithFrame:CGRectZero];
|
||||||
[_overlayView setTextInsets:UIEdgeInsetsMake(10, 15, 10, 15)];
|
[_overlayView setTextInsets:UIEdgeInsetsMake([_mainFrameViewcontroller isIPhone]?4:6, 12, [_mainFrameViewcontroller isIPhone]?4:6, 12)];
|
||||||
[_overlayView setUserInteractionEnabled:NO];
|
[_overlayView setUserInteractionEnabled:NO];
|
||||||
[_overlayView setNumberOfLines:100];
|
[_overlayView setNumberOfLines:100];
|
||||||
[_overlayView.layer setCornerRadius:12];
|
[_overlayView.layer setCornerRadius:[_mainFrameViewcontroller isIPhone]?7:10];
|
||||||
[_overlayView.layer setMasksToBounds:YES];
|
[_overlayView.layer setMasksToBounds:YES];
|
||||||
|
|
||||||
// HACK: If not using stats overlay, center the text
|
// HACK: If not using stats overlay, center the text
|
||||||
@@ -890,13 +892,19 @@
|
|||||||
#if TARGET_OS_TV
|
#if TARGET_OS_TV
|
||||||
[_overlayView setFont:[UIFont systemFontOfSize:24 weight:UIFontWeightMedium]];
|
[_overlayView setFont:[UIFont systemFontOfSize:24 weight:UIFontWeightMedium]];
|
||||||
#else
|
#else
|
||||||
[_overlayView setFont:[UIFont systemFontOfSize:12 weight:UIFontWeightMedium]];
|
[_overlayView setFont:[UIFont systemFontOfSize: [_mainFrameViewcontroller isIPhone]?10:12 weight:UIFontWeightMedium]];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
[_overlayView setAlpha:(float)[_settings.graphOpacity intValue]/ 100.0];
|
[_overlayView setAlpha:(float)[_settings.graphOpacity intValue]/ 100.0];
|
||||||
[self.view addSubview:_overlayView];
|
[self.view addSubview:_overlayView];
|
||||||
}
|
}
|
||||||
|
if (@available(iOS 13.0, *)) {
|
||||||
|
if(overlayLevel == 1) _overlayView.font = [UIFont monospacedSystemFontOfSize:[_mainFrameViewcontroller isIPhone]?10:12 weight:UIFontWeightMedium];
|
||||||
|
}
|
||||||
|
|
||||||
|
[_overlayView setHidden:YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)updateOverlayText:(NSString*)text {
|
||||||
if (text != nil) {
|
if (text != nil) {
|
||||||
// We set our bounds to the maximum width in order to work around a bug where
|
// We set our bounds to the maximum width in order to work around a bug where
|
||||||
// sizeToFit interacts badly with the UITextView's line breaks, causing the
|
// sizeToFit interacts badly with the UITextView's line breaks, causing the
|
||||||
@@ -907,7 +915,7 @@
|
|||||||
_overlayView.frame.size.height)];
|
_overlayView.frame.size.height)];
|
||||||
[_overlayView setText:text];
|
[_overlayView setText:text];
|
||||||
[_overlayView sizeToFit];
|
[_overlayView sizeToFit];
|
||||||
[_overlayView setCenter:CGPointMake(self.view.frame.size.width / 2, (12 + (_overlayView.frame.size.height / 2)))];
|
[_overlayView setCenter:CGPointMake(self.view.frame.size.width / 2, (4 + (_overlayView.frame.size.height / 2)))];
|
||||||
[_overlayView setHidden:NO];
|
[_overlayView setHidden:NO];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -1491,7 +1499,7 @@
|
|||||||
- (void)toggleStatsOverlay{
|
- (void)toggleStatsOverlay{
|
||||||
// Toggle the values on the current in-memory settings object for a temporary effect
|
// Toggle the values on the current in-memory settings object for a temporary effect
|
||||||
_settings.statsOverlayEnabled = !_settings.statsOverlayEnabled;
|
_settings.statsOverlayEnabled = !_settings.statsOverlayEnabled;
|
||||||
_settings.enableGraphs = _settings.statsOverlayEnabled;
|
// _settings.enableGraphs = _settings.statsOverlayEnabled;
|
||||||
|
|
||||||
// Reconfigure the UI using the current in-memory settings, without reloading from disk
|
// Reconfigure the UI using the current in-memory settings, without reloading from disk
|
||||||
[self reConfigStreamViewRealtimeAndReloadSettings:NO];
|
[self reConfigStreamViewRealtimeAndReloadSettings:NO];
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import UIKit
|
|||||||
"widgetLayoutTool":SwiftLocalizationHelper.localizedString(forKey: "[ On-screen widget tool ]"),
|
"widgetLayoutTool":SwiftLocalizationHelper.localizedString(forKey: "[ On-screen widget tool ]"),
|
||||||
"bringUpSoftKeyboard":SwiftLocalizationHelper.localizedString(forKey: "[ Bring up soft keyboard ]"),
|
"bringUpSoftKeyboard":SwiftLocalizationHelper.localizedString(forKey: "[ Bring up soft keyboard ]"),
|
||||||
"enterPip":SwiftLocalizationHelper.localizedString(forKey: "[ Enter picture-in-picture mode ]"),
|
"enterPip":SwiftLocalizationHelper.localizedString(forKey: "[ Enter picture-in-picture mode ]"),
|
||||||
"toggleStatsOverlay":SwiftLocalizationHelper.localizedString(forKey: "[ Toggle stats overlay & graphs ]"),
|
"toggleStatsOverlay":SwiftLocalizationHelper.localizedString(forKey: "[ Toggle stats overlay ]"),
|
||||||
"disconnectAndQuitApp":SwiftLocalizationHelper.localizedString(forKey: "[ Disconnect & quit app ]")
|
"disconnectAndQuitApp":SwiftLocalizationHelper.localizedString(forKey: "[ Disconnect & quit app ]")
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user