mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-10 13:37:03 +03:00
equalizer fix
This commit is contained in:
@@ -91,12 +91,19 @@ sub init {
|
||||
}
|
||||
|
||||
$client->SUPER::init(@_);
|
||||
$client->config_artwork;
|
||||
}
|
||||
main::INFOLOG && $log->is_info && $log->info("SqueezeESP player connected: " . $client->id);
|
||||
}
|
||||
|
||||
sub initPrefs {
|
||||
my $client = shift;
|
||||
|
||||
$sprefs->client($client)->init($defaultPrefs);
|
||||
|
||||
$prefs->client($client)->init( {
|
||||
equalizer => [(0) x 10],
|
||||
artwork => 0,
|
||||
} );
|
||||
|
||||
$client->SUPER::initPrefs;
|
||||
}
|
||||
|
||||
@@ -146,6 +153,15 @@ sub treble {
|
||||
return $value;
|
||||
}
|
||||
|
||||
sub send_equalizer {
|
||||
my ($client, $equalizer) = @_;
|
||||
|
||||
$equalizer ||= $prefs->client($client)->get('equalizer') || [(0) x 10];
|
||||
my $size = @$equalizer;
|
||||
my $data = pack("c[$size]", @{$equalizer});
|
||||
$client->sendFrame( eqlz => \$data );
|
||||
}
|
||||
|
||||
sub update_equalizer {
|
||||
my ($client, $value, $index) = @_;
|
||||
return if $client->tone_update;
|
||||
@@ -240,8 +256,11 @@ sub config_artwork {
|
||||
|
||||
sub reconnect {
|
||||
my $client = shift;
|
||||
$client->pluginData('artwork_md5', '');
|
||||
$client->SUPER::reconnect(@_);
|
||||
|
||||
$client->pluginData('artwork_md5', '');
|
||||
$client->config_artwork;
|
||||
$client->send_equalizer;
|
||||
}
|
||||
|
||||
# Change the analog output mode between headphone and sub-woofer
|
||||
|
||||
Reference in New Issue
Block a user