add player type 101 - release

This commit is contained in:
Philippe G
2020-10-06 22:28:01 -07:00
parent 797a21ee9f
commit 6ae47a908b
7 changed files with 27 additions and 40 deletions

View File

@@ -92,11 +92,15 @@ sub init {
$client->SUPER::init(@_);
$client->config_artwork;
}
$client->send_equalizer;
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] } );
$client->SUPER::initPrefs;
}
@@ -146,6 +150,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;