mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-07 03:57:07 +03:00
Display plugin update
This commit is contained in:
37
plugin/SqueezeESP32/Player.pm
Normal file
37
plugin/SqueezeESP32/Player.pm
Normal file
@@ -0,0 +1,37 @@
|
||||
package Plugins::SqueezeESP32::Player;
|
||||
|
||||
use strict;
|
||||
use base qw(Slim::Player::SqueezePlay);
|
||||
|
||||
use Slim::Utils::Log;
|
||||
use Slim::Utils::Prefs;
|
||||
|
||||
my $prefs = preferences('plugin.squeezeesp32');
|
||||
|
||||
sub model { 'squeezeesp32' }
|
||||
sub modelName { 'SqueezeESP32' }
|
||||
sub hasIR { 0 }
|
||||
|
||||
# We need to implement this to allow us to receive SETD commands
|
||||
# and we need SETD to support custom display widths
|
||||
sub directBodyFrame { 1 }
|
||||
|
||||
# Allow the player to define it's display width (and probably more)
|
||||
sub playerSettingsFrame {
|
||||
my $client = shift;
|
||||
my $data_ref = shift;
|
||||
|
||||
my $value;
|
||||
my $id = unpack('C', $$data_ref);
|
||||
|
||||
# New SETD command 0xfe for display width
|
||||
if ($id == 0xfe) {
|
||||
$value = (unpack('CC', $$data_ref))[1];
|
||||
if ($value > 10 && $value < 200) {
|
||||
$client->display->widthOverride(1, $value);
|
||||
$client->update;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
Reference in New Issue
Block a user