|
@@ -4,36 +4,42 @@ use strict;
|
|
|
|
|
|
use base qw(Slim::Display::Squeezebox2);
|
|
|
|
|
|
+use Slim::Utils::Prefs;
|
|
|
+use Slim::Utils::Log;
|
|
|
+
|
|
|
+my $prefs = preferences('plugin.squeezeesp32');
|
|
|
+
|
|
|
my $VISUALIZER_NONE = 0;
|
|
|
+my $width = $prefs->get('width') || 128;
|
|
|
|
|
|
my @modes = (
|
|
|
# mode 0
|
|
|
{ desc => ['BLANK'],
|
|
|
- bar => 0, secs => 0, width => 128,
|
|
|
+ bar => 0, secs => 0, width => $width,
|
|
|
params => [$VISUALIZER_NONE] },
|
|
|
# mode 1
|
|
|
{ desc => ['PROGRESS_BAR'],
|
|
|
- bar => 1, secs => 0, width => 128,
|
|
|
+ bar => 1, secs => 0, width => $width,
|
|
|
params => [$VISUALIZER_NONE] },
|
|
|
# mode 2
|
|
|
{ desc => ['ELAPSED'],
|
|
|
- bar => 0, secs => 1, width => 128,
|
|
|
+ bar => 0, secs => 1, width => $width,
|
|
|
params => [$VISUALIZER_NONE] },
|
|
|
# mode 3
|
|
|
{ desc => ['ELAPSED', 'AND', 'PROGRESS_BAR'],
|
|
|
- bar => 1, secs => 1, width => 128,
|
|
|
+ bar => 1, secs => 1, width => $width,
|
|
|
params => [$VISUALIZER_NONE] },
|
|
|
# mode 4
|
|
|
{ desc => ['REMAINING'],
|
|
|
- bar => 0, secs => -1, width => 128,
|
|
|
+ bar => 0, secs => -1, width => $width,
|
|
|
params => [$VISUALIZER_NONE] },
|
|
|
# mode 5
|
|
|
{ desc => ['CLOCK'],
|
|
|
- bar => 0, secs => 0, width => 128, clock => 1,
|
|
|
+ bar => 0, secs => 0, width => $width, clock => 1,
|
|
|
params => [$VISUALIZER_NONE] },
|
|
|
# mode 6
|
|
|
{ desc => ['SETUP_SHOWBUFFERFULLNESS'],
|
|
|
- bar => 0, secs => 0, width => 128, fullness => 1,
|
|
|
+ bar => 0, secs => 0, width => $width, fullness => 1,
|
|
|
params => [$VISUALIZER_NONE] },
|
|
|
);
|
|
|
|
|
@@ -62,11 +68,11 @@ sub displayHeight {
|
|
|
}
|
|
|
|
|
|
sub displayWidth {
|
|
|
- return shift->widthOverride(@_) || 128;
|
|
|
+ return shift->widthOverride(@_) || $width;
|
|
|
}
|
|
|
|
|
|
sub vfdmodel {
|
|
|
- return 'graphic-128x32';
|
|
|
+ return 'graphic-'.$width.'x32';
|
|
|
}
|
|
|
|
|
|
1;
|