mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-01-27 12:50:49 +03:00
add SSD1322 + few tweaks - release
This commit is contained in:
Binary file not shown.
@@ -77,7 +77,7 @@ sub displayWidth {
|
||||
|
||||
if ($display->widthOverride) {
|
||||
my $artwork = $prefs->client($client)->get('artwork');
|
||||
if ($artwork->{'enable'} && $artwork->{'y'} < 32 && $client->isPlaying) {
|
||||
if ($artwork->{'enable'} && $artwork->{'y'} < 32 && ($client->isPlaying || $client->isPaused)) {
|
||||
return $artwork->{x} + ($display->modes->[$mode || 0]{_width} || 0);
|
||||
} else {
|
||||
return $display->widthOverride + ($display->modes->[$mode || 0]{_width} || 0);
|
||||
@@ -168,45 +168,58 @@ sub build_modes {
|
||||
# mode 9
|
||||
{ desc => ['VISUALIZER_VUMETER'],
|
||||
bar => 0, secs => 0, width => $width,
|
||||
params => [$VISUALIZER_VUMETER_ESP32, 0] },
|
||||
params => [$VISUALIZER_VUMETER_ESP32, $width, 0] },
|
||||
# mode 10
|
||||
{ desc => ['VISUALIZER_ANALOG_VUMETER'],
|
||||
bar => 0, secs => 0, width => $width,
|
||||
params => [$VISUALIZER_VUMETER_ESP32, 1] },
|
||||
params => [$VISUALIZER_VUMETER_ESP32, $width, 1] },
|
||||
# mode 11
|
||||
{ desc => ['VISUALIZER_SPECTRUM_ANALYZER'],
|
||||
bar => 0, secs => 0, width => $width,
|
||||
# extra parameters (bars)
|
||||
params => [$VISUALIZER_SPECTRUM_ANALYZER_ESP32, int ($width/$spectrum->{full}->{band}), $spectrum->{scale}] },
|
||||
params => [$VISUALIZER_SPECTRUM_ANALYZER_ESP32, $width, int ($width/$spectrum->{full}->{band}), $spectrum->{scale}] },
|
||||
);
|
||||
|
||||
my @extra = (
|
||||
# mode E1
|
||||
{ desc => ['VISUALIZER_VUMETER', 'AND', 'ELAPSED'],
|
||||
bar => 0, secs => 1, width => $width,
|
||||
params => [$VISUALIZER_VUMETER_ESP32, 0] },
|
||||
params => [$VISUALIZER_VUMETER_ESP32, $width, 0] },
|
||||
# mode E2
|
||||
{ desc => ['VISUALIZER_ANALOG_VUMETER', 'AND', 'ELAPSED'],
|
||||
bar => 0, secs => 1, width => $width,
|
||||
params => [$VISUALIZER_VUMETER_ESP32, 1] },
|
||||
params => [$VISUALIZER_VUMETER_ESP32, $width, 1] },
|
||||
# mode E3
|
||||
{ desc => ['VISUALIZER_SPECTRUM_ANALYZER', 'AND', 'ELAPSED'],
|
||||
bar => 0, secs => 1, width => $width,
|
||||
# extra parameters (bars)
|
||||
params => [$VISUALIZER_SPECTRUM_ANALYZER_ESP32, int ($width/$spectrum->{full}->{band}), $spectrum->{scale}] },
|
||||
params => [$VISUALIZER_SPECTRUM_ANALYZER_ESP32, $width, int ($width/$spectrum->{full}->{band}), $spectrum->{scale}] },
|
||||
# mode E4
|
||||
{ desc => ['VISUALIZER_VUMETER', 'AND', 'REMAINING'],
|
||||
bar => 0, secs => -1, width => $width,
|
||||
params => [$VISUALIZER_VUMETER_ESP32, 0] },
|
||||
params => [$VISUALIZER_VUMETER_ESP32, $width, 0] },
|
||||
# mode E5
|
||||
{ desc => ['VISUALIZER_ANALOG_VUMETER', 'AND', 'REMAINING'],
|
||||
bar => 0, secs => -1, width => $width,
|
||||
params => [$VISUALIZER_VUMETER_ESP32, 1] },
|
||||
params => [$VISUALIZER_VUMETER_ESP32, $width, 1] },
|
||||
# mode E6
|
||||
{ desc => ['VISUALIZER_SPECTRUM_ANALYZER', 'AND', 'REMAINING'],
|
||||
bar => 0, secs => -1, width => $width,
|
||||
# extra parameters (bars)
|
||||
params => [$VISUALIZER_SPECTRUM_ANALYZER_ESP32, int ($width/$spectrum->{full}->{band}), $spectrum->{scale}] },
|
||||
params => [$VISUALIZER_SPECTRUM_ANALYZER_ESP32, $width, int ($width/$spectrum->{full}->{band}), $spectrum->{scale}] },
|
||||
# mode E7
|
||||
{ desc => ['VISUALIZER_VUMETER', 'AND', 'PROGRESS_BAR', 'AND', 'REMAINING'],
|
||||
bar => 1, secs => -1, width => $width,
|
||||
params => [$VISUALIZER_VUMETER_ESP32, $width, 0] },
|
||||
# mode E8
|
||||
{ desc => ['VISUALIZER_ANALOG_VUMETER', 'AND', 'PROGRESS_BAR', 'AND', 'REMAINING'],
|
||||
bar => 1, secs => -1, width => $width,
|
||||
params => [$VISUALIZER_VUMETER_ESP32, $width, 1] },
|
||||
# mode E9
|
||||
{ desc => ['VISUALIZER_SPECTRUM_ANALYZER', 'AND', 'PROGRESS_BAR', 'AND', 'REMAINING'],
|
||||
bar => 1, secs => -1, width => $width,
|
||||
# extra parameters (bars)
|
||||
params => [$VISUALIZER_SPECTRUM_ANALYZER_ESP32, $width, int ($width/$spectrum->{full}->{band}), $spectrum->{scale}] },
|
||||
);
|
||||
|
||||
@modes = (@modes, @extra) if $cprefs->get('height') > 32;
|
||||
|
||||
@@ -35,8 +35,22 @@ sub initPlugin {
|
||||
|
||||
Slim::Control::Request::subscribe( sub { onNotification(@_) }, [ ['newmetadata'] ] );
|
||||
Slim::Control::Request::subscribe( sub { onNotification(@_) }, [ ['playlist'], ['open', 'newsong'] ]);
|
||||
Slim::Control::Request::subscribe( \&onStopClear, [ ['playlist'], ['stop', 'clear'] ]);
|
||||
}
|
||||
|
||||
sub onStopClear {
|
||||
my $request = shift;
|
||||
my $client = $request->client;
|
||||
my $artwork = $prefs->client($client)->get('artwork');
|
||||
|
||||
if ($client->model eq 'squeezeesp32' && $artwork->{'enable'}) {
|
||||
my $reqstr = $request->getRequestString();
|
||||
$log->info("artwork stop/clear $reqstr");
|
||||
$client->pluginData('artwork_md5', '')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub onNotification {
|
||||
my $request = shift;
|
||||
my $client = $request->client;
|
||||
@@ -56,8 +70,7 @@ sub update_artwork {
|
||||
|
||||
return unless $client->model eq 'squeezeesp32' && $artwork->{'enable'};
|
||||
|
||||
my $s = $artwork->{'y'} >= 32 ? $cprefs->get('height') - $artwork->{'y'} : 32;
|
||||
$s = min($s, $cprefs->get('width') - $artwork->{'x'});
|
||||
my $s = min($cprefs->get('height') - $artwork->{'y'}, $cprefs->get('width') - $artwork->{'x'});
|
||||
|
||||
my $path = 'music/current/cover_' . $s . 'x' . $s . '_o.jpg';
|
||||
my $body = Slim::Web::Graphics::artworkRequest($client, $path, $params, \&send_artwork, undef, HTTP::Response->new);
|
||||
|
||||
@@ -10,6 +10,6 @@
|
||||
<name>PLUGIN_SQUEEZEESP32</name>
|
||||
<description>PLUGIN_SQUEEZEESP32_DESC</description>
|
||||
<module>Plugins::SqueezeESP32::Plugin</module>
|
||||
<version>0.61</version>
|
||||
<version>0.70</version>
|
||||
<creator>Philippe</creator>
|
||||
</extensions>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?xml version='1.0' standalone='yes'?>
|
||||
<extensions>
|
||||
<plugins>
|
||||
<plugin version="0.61" name="SqueezeESP32" minTarget="7.5" maxTarget="*">
|
||||
<plugin version="0.70" name="SqueezeESP32" minTarget="7.5" maxTarget="*">
|
||||
<link>https://github.com/sle118/squeezelite-esp32</link>
|
||||
<creator>Philippe</creator>
|
||||
<sha>5c45fed832e6f79f709bef5f2da511071d1c776e</sha>
|
||||
<sha>2a8cb954928e0cd8f521acd94b90ce9f34a7a1f0</sha>
|
||||
<email>philippe_44@outlook.com</email>
|
||||
<desc lang="EN">SqueezeESP32 additional player id (100)</desc>
|
||||
<url>http://github.com/sle118/squeezelite-esp32/raw/master/plugin/SqueezeESP32.zip</url>
|
||||
|
||||
Reference in New Issue
Block a user