equalizer - release

This commit is contained in:
Philippe G
2020-04-17 08:03:17 -07:00
parent 7e4c0d2ac4
commit 394d6b6465
17 changed files with 283 additions and 9 deletions

Binary file not shown.

View File

@@ -15,6 +15,12 @@ sub hasIR { 0 }
sub init {
my $client = shift;
$prefs->client($client)->init( {
eq => [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
}
);
$client->SUPER::init(@_);
Plugins::SqueezeESP32::Plugin::config_artwork($client);
}
@@ -55,6 +61,7 @@ sub reconnect {
my $client = shift;
$client->pluginData('artwork_md5', '');
$client->SUPER::reconnect(@_);
Plugins::SqueezeESP32::Plugin::send_equalizer($client);
}
1;

View File

@@ -30,7 +30,7 @@ sub page {
sub prefs {
my ($class, $client) = @_;
my @prefs = qw(width small_VU spectrum artwork);
my @prefs = qw(width small_VU spectrum artwork eq);
return ($prefs->client($client), @prefs);
}
@@ -55,6 +55,13 @@ sub handler {
$client->display->modes($client->display->build_modes);
$client->display->update;
my $eq = $cprefs->get('eq');
for my $i (0 .. $#{$eq}) {
$eq->[$i] = $paramRef->{"pref_eq.$i"};
}
$cprefs->set('eq', $eq);
Plugins::SqueezeESP32::Plugin::send_equalizer($client);
# force update or disable artwork
if ($artwork->{'enable'}) {
Plugins::SqueezeESP32::Plugin::update_artwork($client, 1);
@@ -72,6 +79,7 @@ sub handler {
# logic of "Settings" is beyond me and I really hate it
$paramRef->{'pref_spectrum'} = $cprefs->get('spectrum');
$paramRef->{'pref_artwork'} = $cprefs->get('artwork');
$paramRef->{'pref_eq'} = $cprefs->get('eq');
return $class->SUPER::handler($client, $paramRef);
}

View File

@@ -56,8 +56,6 @@ sub onNotification {
my $client = $request->client;
my $reqstr = $request->getRequestString();
$log->info("artwork update notification $reqstr");
#my $path = $request->getParam('_path');
update_artwork($client);
}
@@ -108,6 +106,14 @@ sub send_artwork {
}
}
sub send_equalizer {
my ($client) = @_;
my $equalizer = $prefs->client($client)->get('eq');
my $size = @$equalizer;
my $data = pack("c[$size]", @{$equalizer});
$client->sendFrame( eqlz => \$data );
}
sub config_artwork {
my ($client) = @_;
my $artwork = $prefs->client($client)->get('artwork');

View File

@@ -10,6 +10,6 @@
<name>PLUGIN_SQUEEZEESP32</name>
<description>PLUGIN_SQUEEZEESP32_DESC</description>
<module>Plugins::SqueezeESP32::Plugin</module>
<version>0.72</version>
<version>0.80</version>
<creator>Philippe</creator>
</extensions>

View File

@@ -14,7 +14,7 @@ PLUGIN_SQUEEZEESP32_DESC
EN Adds a new player id (100) to enable display with SqueezeESP32
PLUGIN_SQUEEZEESP32_PLAYERSETTINGS
EN Display (ESP32)
EN ESP32 settings
PLUGIN_SQUEEZEESP32_WIDTH
EN Screen width
@@ -69,3 +69,7 @@ PLUGIN_SQUEEZEESP32_ARTWORK_X
PLUGIN_SQUEEZEESP32_ARTWORK_Y
EN Y
PLUGIN_SQUEEZEESP32_EQUALIZER
EN Parametric equalizer

View File

@@ -1,10 +1,10 @@
<?xml version='1.0' standalone='yes'?>
<extensions>
<plugins>
<plugin version="0.72" name="SqueezeESP32" minTarget="7.5" maxTarget="*">
<plugin version="0.80" name="SqueezeESP32" minTarget="7.5" maxTarget="*">
<link>https://github.com/sle118/squeezelite-esp32</link>
<creator>Philippe</creator>
<sha>50679aff5e938359342d3a4d8251dcd25fab3eff</sha>
<sha>91e29c4380ce11728692f1cdabab080d1924a8d3</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>