1st artwork version

This commit is contained in:
philippe44
2020-03-18 23:42:44 -07:00
parent 126d3f4e04
commit 5e5dc9ba29
15 changed files with 158 additions and 79 deletions

View File

@@ -71,7 +71,12 @@ sub displayWidth {
}
if ($display->widthOverride) {
return $display->widthOverride + ($display->modes->[$mode || 0]{_width} || 0);
my $artwork = $prefs->client($client)->get('artwork');
if ($artwork->{'enable'} && $artwork->{'y'} < 32) {
return $artwork->{x} + ($display->modes->[$mode || 0]{_width} || 0);
} else {
return $display->widthOverride + ($display->modes->[$mode || 0]{_width} || 0);
}
} else {
return $display->modes->[$mode || 0]{width};
}
@@ -101,9 +106,21 @@ sub build_modes {
my $cprefs = $prefs->client($client);
my $width = shift || $cprefs->get('width') || 128;
my $artwork = $cprefs->get('artwork');
# if artwork is in main display, reduce width
$width = $artwork->{'x'} - 1 if $artwork->{'enable'} && $artwork->{y} < 32;
my $small_VU = $cprefs->get('small_VU');
my $spectrum = $cprefs->get('spectrum');
my $small_spectrum_pos = { x => $width - int ($spectrum->{small}->{size} * $width / 100),
width => int ($spectrum->{small}->{size} * $width / 100),
};
my $small_VU_pos = { x => $width - int ($small_VU * $width / 100),
width => int ($small_VU * $width / 100),
};
my @modes = (
# mode 0
{ desc => ['BLANK'],
@@ -135,14 +152,14 @@ sub build_modes {
params => [$VISUALIZER_NONE] },
# mode 7
{ desc => ['VISUALIZER_VUMETER_SMALL'],
bar => 0, secs => 0, width => $width, _width => int -($small_VU*$width/100),
bar => 0, secs => 0, width => $width, _width => -$small_VU_pos->{'width'},
# extra parameters (width, height, col (< 0 = from right), row (< 0 = from bottom), left_space)
params => [$VISUALIZER_VUMETER, int ($small_VU*$width/100), 32, int -($small_VU*$width/100), 0, 2] },
params => [$VISUALIZER_VUMETER, $small_VU_pos->{'width'}, 32, $small_VU_pos->{'x'}, 0, 2] },
# mode 8
{ desc => ['VISUALIZER_SPECTRUM_ANALYZER_SMALL'],
bar => 0, secs => 0, width => $width, _width => int -($spectrum->{small}->{size}*$width/100),
bar => 0, secs => 0, width => $width, _width => -$small_spectrum_pos->{'width'},
# extra parameters (width, height, col (< 0 = from right), row (< 0 = from bottom), left_space, bars)
params => [$VISUALIZER_SPECTRUM_ANALYZER, int ($spectrum->{small}->{size}*$width/100), 32, int -($spectrum->{small}->{size}*$width/100), 0, 2, int ($spectrum->{small}->{size}/100*$width/$spectrum->{small}->{band}), $spectrum->{scale}] },
params => [$VISUALIZER_SPECTRUM_ANALYZER, $small_spectrum_pos->{width}, 32, $small_spectrum_pos->{'x'}, 0, 2, $small_spectrum_pos->{'width'} / $spectrum->{small}->{band}, $spectrum->{scale}] },
# mode 9
{ desc => ['VISUALIZER_VUMETER'],
bar => 0, secs => 0, width => $width,