add plugin and fix loudness = 0 disable equalizer

This commit is contained in:
philippe44
2023-08-28 18:59:17 -07:00
parent 85a3bf8836
commit 809b55579f
8 changed files with 76 additions and 7 deletions

View File

@@ -115,6 +115,7 @@ sub initPrefs {
$prefs->client($client)->init( {
equalizer => [(0) x 10],
loudness => 0,
artwork => undef,
led_config => 0,
led_visualizer => 0,
@@ -216,6 +217,14 @@ sub send_equalizer {
$client->sendFrame( eqlz => \$data );
}
sub send_loudness {
my ($client, $loudness) = @_;
$loudness ||= $prefs->client($client)->get('loudness') || 0;
my $data = pack("c1", $loudness);
$client->sendFrame( loud => \$data );
}
sub update_equalizer {
my ($client, $value, $index) = @_;
return if $client->tone_update;
@@ -318,6 +327,7 @@ sub reconnect {
$client->pluginData('artwork_md5', '');
$client->config_artwork if $client->display->isa("Plugins::SqueezeESP32::Graphics");
$client->send_equalizer;
$client->send_loudness;
}
# Change the analog output mode between headphone and sub-woofer