From f7b20f813d3d8dedf52632370599d7fa485ccffb Mon Sep 17 00:00:00 2001 From: Guillaume Rousse Date: Sat, 7 Sep 2019 09:39:54 +0200 Subject: enforce space usage for indentation --- monitor-parse-edid | 62 +++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/monitor-parse-edid b/monitor-parse-edid index 7fd5fe4..ba14847 100755 --- a/monitor-parse-edid +++ b/monitor-parse-edid @@ -47,22 +47,22 @@ if ($length % 128 == 0 && $length >= 128 && $length <= 128 * 254) { foreach my $raw_edid (@raw_edids) { my $edid = parse_edid($raw_edid, $verbose); if (my $err = check_parsed_edid($edid)) { - die "$err\n"; + die "$err\n"; } $edid->{file} = $file if $file; if ($raw_perl) { - use Data::Dumper; - $Data::Dumper::Sortkeys = 1; - my $s = Dumper($edid); - $s =~ s/.*? = \{/+{/; # remove variable name we don't want - $s =~ s/};$/}/m; - print $s; + use Data::Dumper; + $Data::Dumper::Sortkeys = 1; + my $s = Dumper($edid); + $s =~ s/.*? = \{/+{/; # remove variable name we don't want + $s =~ s/};$/}/m; + print $s; } elsif ($MonitorsDB) { - my $s = to_MonitorsDB($edid); - print "$s\n" if $s; + my $s = to_MonitorsDB($edid); + print "$s\n" if $s; } else { - print_edid($edid, $verbose); + print_edid($edid, $verbose); } } @@ -88,36 +88,36 @@ sub print_edid { # this is a number, despite the official name containing "flag": print "EDID extension blocks: $edid->{extension_flag}\n"; printf "Screen size: %.1f cm x %.1f cm (%3.2f inches%s)\n", - $edid->{max_size_horizontal}, - $edid->{max_size_vertical}, - $edid->{diagonal_size}, - $edid->{ratio_name} ? sprintf(", aspect ratio %s = %.2f", $edid->{ratio_name}, $edid->{ratio}) : - $edid->{ratio} ? sprintf(", aspect ratio %.2f", $edid->{ratio}) : ''; - + $edid->{max_size_horizontal}, + $edid->{max_size_vertical}, + $edid->{diagonal_size}, + $edid->{ratio_name} ? sprintf(", aspect ratio %s = %.2f", $edid->{ratio_name}, $edid->{ratio}) : + $edid->{ratio} ? sprintf(", aspect ratio %.2f", $edid->{ratio}) : ''; + print "Gamma: ", $edid->{gamma} / 100 + 1, "\n"; printf "%s signal\n", $edid->{video_input_definition}{digital} ? 'Digital' : 'Analog'; if ($verbose) { - foreach (@{$edid->{established_timings} || []}) { - print "Standard resolution: $_->{X}x$_->{Y} @ $_->{vfreq} Hz (established timing)\n" if !$_->{interlace}; - } - foreach (@{$edid->{standard_timings} || []}) { - print "Standard resolution: $_->{X}x$_->{Y} @ $_->{vfreq} Hz, ratio $_->{ratio}", - $edid->{ratio_name} && index($edid->{ratio_name}, $_->{ratio}) == -1 ? ' (!)' : '', - "\n"; - } + foreach (@{$edid->{established_timings} || []}) { + print "Standard resolution: $_->{X}x$_->{Y} @ $_->{vfreq} Hz (established timing)\n" if !$_->{interlace}; + } + foreach (@{$edid->{standard_timings} || []}) { + print "Standard resolution: $_->{X}x$_->{Y} @ $_->{vfreq} Hz, ratio $_->{ratio}", + $edid->{ratio_name} && index($edid->{ratio_name}, $_->{ratio}) == -1 ? ' (!)' : '', + "\n"; + } } if ($edid->{monitor_range}) { - printf "Max video bandwidth: %u MHz\n", $edid->{monitor_range}{pixel_clock_max} if $edid->{monitor_range}{pixel_clock_max}; - print "\n"; - printf "\tHorizSync %u-%u\n", $edid->{monitor_range}{horizontal_min}, $edid->{monitor_range}{horizontal_max}; - printf "\tVertRefresh %u-%u\n", $edid->{monitor_range}{vertical_min}, $edid->{monitor_range}{vertical_max}; + printf "Max video bandwidth: %u MHz\n", $edid->{monitor_range}{pixel_clock_max} if $edid->{monitor_range}{pixel_clock_max}; + print "\n"; + printf "\tHorizSync %u-%u\n", $edid->{monitor_range}{horizontal_min}, $edid->{monitor_range}{horizontal_max}; + printf "\tVertRefresh %u-%u\n", $edid->{monitor_range}{vertical_min}, $edid->{monitor_range}{vertical_max}; } foreach my $h (@{$edid->{detailed_timings}}) { - print "\n"; - print "\t", $h->{ModeLine_comment}, $h->{bad_ratio} ? ' (bad ratio)' : '', "\n"; - print "\tModeLine ", $h->{ModeLine}, "\n"; + print "\n"; + print "\t", $h->{ModeLine_comment}, $h->{bad_ratio} ? ' (bad ratio)' : '', "\n"; + print "\tModeLine ", $h->{ModeLine}, "\n"; } } -- cgit v1.2.1