Reformat Metal files Rewrite Metal render loop to not use DisplayLink so we can use the amazing afterMinimumDuration API call Improve frame drop algorithm Misc fixes to HDR <-> SDR switching, deprecation warning cleanup Fix AVSB mode Fix renderingBackend selected value Add Rendering Backend setting to iPhone Let users choose which renderer to use. Refactor metrics into a singleton Fix tvOS build Port moonlight-qt's Metal renderer Bump imgui to latest Misc tweaks and refactoring Switch iOS to use Opus float32 audio, in line with other clients. It was already being sent from the server as float32, so this is simply decoding it with less loss of dynamic range. Give FrameQueue a faster data structure and full test coverage. Remove pts frame pacing, it's not a fit for iOS. Don't allow very transparent opacity for middle stats overlay box Change wording to select button instead of remote button Add tvOS gesture for double-clicking remote button to show/hide stats Remove kVTDecodeFrame_1xRealTimePlayback, this was found to seriously impact decode times Move decode time stat out of async block Enabe FQ logging Misc cleanup/fixes iPad: 26 will require UIRequiresFullScreen to be false, and for all orientations to be supported Updated iPhone and iPad settings panels Add setting for graph opacity. Enable stats and graphs to be toggled via two finger swipe Fix wait time in displaylink, fix settings spacing, stats fixes Settings for frame queue size, graphs. Misc refactoring and cleanup Bump moonlight-common-c Improve logging readability Fix host frametime and frame queue stats to be recorded during input not output. Show min/max/avg decode time Add bytes per frame graph Started on settings changes, both modes working very well Misc refactoring, move graphs around, both pacing functions working well Set frameDropTarget to 2 always Use raw RTP timestamps without converting to floating point for even more accurate playback Standard frame pacing: remove +3 logic Switch to NSRunLoopCommonModes for displayLink Add frame pacing algorithm based on moonlight-qt's Pacer class as a simpler baseline Switch to os_unfair_lock, misc tweaks Large refactor that now uses VTDecompressionSession based on PR535 from felipejfc. This now allows more control over queue size and allows dropping arbitrary frames, but introduces a lot of new problems bump moonlight-common-c to fix 32-bit rollover issue LiWait timing graph Add displaylink interval graph Graphs checkpoint ImGui graph working checkpoint ImGui working checkpoint Add pending frames to stats, add a define for verbose logging DisplayLink WIP Add imgui & implot modules Frame pacing: alternate method based on thieman's pullFrames thread Frame pacing: simplify displayLink, support passing targetTimestamp down to the sample buffer Point to my common-c with some timing changes. Add stats gestures: 2-finger swipe down to show stats, and 2-finger swipe up to hide Limit refresh rate to 60 when in low power mode Display screen refresh rate in stats overlay, remove decode time and explain why it can't be measured Adjust the refresh rate of the display to match the stream framerate and improve battery life Don't use presentationTimeMs when creating CMSampleTimingInfo Fix overlayView build for iOS Refactor CADisplayLink callback for improved frame delivery. Support a user-configurable buffered frame count. [opt] Use UILabel for stats overlay
269 lines
8.3 KiB
Perl
Executable File
269 lines
8.3 KiB
Perl
Executable File
#!/usr/bin/env perl
|
|
#
|
|
# Don't try to follow the logic in here, XML::Twig allows for some real nonsense
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use Getopt::Long qw(GetOptions);
|
|
use Pod::Usage qw(pod2usage);
|
|
use XML::Twig;
|
|
|
|
my $inSettings = 0;
|
|
my @list = ();
|
|
my @clipboard = ();
|
|
my $help = 0;
|
|
my $after;
|
|
my $move;
|
|
my $to;
|
|
|
|
GetOptions(
|
|
'help|?' => \$help,
|
|
'add-after=s' => \$after,
|
|
'move=s' => \$move,
|
|
'to=s' => \$to,
|
|
) or pod2usage(2);
|
|
pod2usage(1) if $help || ($move && !$to) || (!$move && $to);
|
|
|
|
my $xml = shift || pod2usage(2);
|
|
|
|
my $twig = XML::Twig->new(
|
|
twig_handlers => {
|
|
'#COMMENT' => sub {
|
|
my ($t, $comment) = @_;
|
|
if ($comment->{comment} eq 'Settings View Controller') {
|
|
$inSettings = 1;
|
|
}
|
|
else {
|
|
$inSettings = 0;
|
|
}
|
|
},
|
|
label => sub {
|
|
my ($t, $label) = @_;
|
|
if ($inSettings) {
|
|
push @list, [ label => $label ];
|
|
}
|
|
},
|
|
segmentedControl => sub {
|
|
my ($t, $control) = @_;
|
|
if ($inSettings) {
|
|
push @list, [ control => $control ];
|
|
}
|
|
},
|
|
slider => sub {
|
|
my ($t, $slider) = @_;
|
|
if ($inSettings) {
|
|
push @list, [ slider => $slider ];
|
|
}
|
|
},
|
|
view => sub {
|
|
my ($t, $view) = @_;
|
|
if ($inSettings) {
|
|
push @list, [ view => $view ];
|
|
}
|
|
},
|
|
},
|
|
comments => 'process',
|
|
keep_atts_order => 1,
|
|
pretty_print => 'indented',
|
|
empty_tags => 'normal',
|
|
);
|
|
|
|
$twig->parsefile($xml);
|
|
|
|
if ($after) {
|
|
do_after($twig, $after);
|
|
}
|
|
elsif ($move && $to) {
|
|
do_move($twig, $move, $to);
|
|
}
|
|
|
|
do_output($twig);
|
|
|
|
sub do_after {
|
|
my ($twig, $after) = @_;
|
|
|
|
my $LABEL_TEMPLATE = qq{
|
|
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="New Label Template" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="%s">
|
|
<rect key="frame" x="16" y="999" width="35" height="21"></rect>
|
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"></autoresizingMask>
|
|
<fontDescription key="fontDescription" type="system" pointSize="17"></fontDescription>
|
|
<color key="textColor" red="0.93902439019999995" green="0.9625305918" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"></color>
|
|
<nil key="highlightedColor"></nil>
|
|
</label>};
|
|
|
|
my $CONTROL_TEMPLATE = qq{
|
|
<segmentedControl opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="%s" userLabel="New Control Template">
|
|
<rect key="frame" x="16" y="999" width="459" height="28"></rect>
|
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"></autoresizingMask>
|
|
<segments>
|
|
<segment title="No"></segment>
|
|
<segment title="Yes"></segment>
|
|
</segments>
|
|
<color key="tintColor" red="0.6716768742" green="0.61711704730000005" blue="0.99902987480000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"></color>
|
|
<color key="selectedSegmentTintColor" red="0.6716768742" green="0.61711704730000005" blue="0.99902987480000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"></color>
|
|
</segmentedControl>};
|
|
|
|
my @to_add = (
|
|
[ label => XML::Twig::Elt->parse( sprintf($LABEL_TEMPLATE, generate_id()) ) ],
|
|
[ control => XML::Twig::Elt->parse( sprintf($CONTROL_TEMPLATE, generate_id()) ) ],
|
|
);
|
|
|
|
# Find where to insert them
|
|
for (my $i = 0; $i < scalar @list; $i++) {
|
|
my ($type, $e) = @{$list[$i]};
|
|
if ($type eq 'label' && ($e->att('text') // q{}) eq $after) {
|
|
($type, $e) = @{$list[$i + 1]};
|
|
|
|
# paste the block to a new location
|
|
for my $tm (@to_add) {
|
|
$tm->[1]->paste(after => $e);
|
|
$e = $tm->[1];
|
|
}
|
|
|
|
# also move the block in the ordering list, which is where the y values are adjusted
|
|
$i += 2;
|
|
splice(@list, $i, 0, @to_add);
|
|
}
|
|
}
|
|
}
|
|
|
|
sub do_move {
|
|
my ($twig, $move, $to) = @_;
|
|
|
|
my @to_move = ();
|
|
|
|
# Pull out the bits to move
|
|
for (my $i = 0; $i < scalar @list; $i++) {
|
|
my ($type, $e) = @{$list[$i]};
|
|
if ($type eq 'label' && ($e->att('text') // q{}) eq $move) {
|
|
# move this item and the next one (the control)
|
|
push @to_move, [ $type => $e->cut ];
|
|
($type, $e) = @{$list[$i + 1]};
|
|
push @to_move, [ $type => $e->cut ];
|
|
splice(@list, $i, 2);
|
|
last;
|
|
}
|
|
}
|
|
|
|
# Find where to insert them
|
|
for (my $i = 0; $i < scalar @list; $i++) {
|
|
my ($type, $e) = @{$list[$i]};
|
|
if ($type eq 'label' && ($e->att('text') // q{}) eq $to) {
|
|
($type, $e) = @{$list[$i + 1]};
|
|
|
|
# paste the block to a new location
|
|
for my $tm (@to_move) {
|
|
$tm->[1]->paste(after => $e);
|
|
$e = $tm->[1];
|
|
}
|
|
|
|
# also move the block in the ordering list, which is where the y values are adjusted
|
|
$i += 2;
|
|
splice(@list, $i, 0, @to_move);
|
|
}
|
|
}
|
|
}
|
|
|
|
sub do_output {
|
|
my $twig = shift;
|
|
|
|
# first label
|
|
my $x = 16;
|
|
my $y = 20;
|
|
|
|
# spacing
|
|
my $label_to_control = 29;
|
|
my $control_to_label = 35;
|
|
my $label_to_label = 43;
|
|
my $slider_to_next = 29;
|
|
my $view_to_next = 43;
|
|
my $seen_rdv = 0;
|
|
my $last = q{};
|
|
|
|
printf STDERR "%30s %s %s\n\n", q{}, "auto", "current";
|
|
|
|
for my $row (@list) {
|
|
my ($type, $e) = @{$row};
|
|
my $rect = $e->has_child('rect');
|
|
my $orig_y = $rect->att('y');
|
|
|
|
$rect->set_att(x => $x);
|
|
$rect->set_att(y => $y);
|
|
|
|
if ($type eq "label") {
|
|
my $text = $e->att('userLabel') // $e->att('text') // "(unknown label)";
|
|
printf STDERR "%30s %d %4d\n", $text, $y, $orig_y;
|
|
|
|
if ($text =~ /Caption/) { # space after captions is a bit larger
|
|
$y += $label_to_label;
|
|
}
|
|
else {
|
|
$y += $label_to_control;
|
|
}
|
|
}
|
|
elsif ($type eq "control") {
|
|
my ($userLabel) = $e->att('userLabel') // "(unknown control)";
|
|
printf STDERR "%30s %d %4d\n", $userLabel, $y, $orig_y;
|
|
|
|
$y += $control_to_label;
|
|
}
|
|
elsif ($type eq "slider") {
|
|
printf STDERR "%30s %d %4d\n", "slider", $y, $orig_y;
|
|
$y += $slider_to_next;
|
|
}
|
|
elsif ($type eq "view") {
|
|
my $customClass = $e->att('customClass') // q{};
|
|
if ($customClass && $customClass eq "UIScrollView") {
|
|
# This is the entire view, so we're done
|
|
last;
|
|
}
|
|
|
|
printf STDERR "%30s %d %4d\n", "view", $y, $orig_y;
|
|
$y += $view_to_next;
|
|
}
|
|
$last = $type;
|
|
}
|
|
|
|
# Output the entire XML with our changes
|
|
$twig->print;
|
|
}
|
|
|
|
sub generate_id {
|
|
# generate an id of the form K4A-oH-Bs0
|
|
my $chars = [ split //, 'abcdefghiklmnopqrstuvwxyzABCDEFGHIKLMNOPQRSTUVWXYZ0123456789' ];
|
|
|
|
my $random_fragment = sub {
|
|
my $length = shift;
|
|
return '' if $length < 1;
|
|
my $fragment = '';
|
|
$fragment .= $chars->[int(rand(scalar @{$chars}))] for (1..$length);
|
|
return $fragment;
|
|
};
|
|
|
|
return join '-', (
|
|
$random_fragment->(3),
|
|
$random_fragment->(2),
|
|
$random_fragment->(3),
|
|
);
|
|
}
|
|
|
|
=pod
|
|
|
|
=head1 NAME
|
|
|
|
SettingsHelper.pl - Less painful storyboard settings elements
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
SettingsHelper.pl [options] [iPad.storyboard] > New.storyboard
|
|
|
|
Run with no options to display the list of items in a storyboard.
|
|
|
|
Options:
|
|
--add-after LABEL Insert a new empty label + control pair after the given label (and its control)
|
|
--move FROM --to TO Move the first label and control after the "to" label
|
|
--help This help message.
|
|
|
|
=cut
|