mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-09 04:57:06 +03:00
Display plugin update
This commit is contained in:
25
plugin/SqueezeESP32/Graphics.pm
Normal file
25
plugin/SqueezeESP32/Graphics.pm
Normal file
@@ -0,0 +1,25 @@
|
||||
package Plugins::SqueezeESP32::Graphics;
|
||||
|
||||
use strict;
|
||||
|
||||
use base qw(Slim::Display::Squeezebox2);
|
||||
|
||||
=comment
|
||||
sub bytesPerColumn {
|
||||
return 4;
|
||||
}
|
||||
=cut
|
||||
|
||||
sub displayHeight {
|
||||
return 32;
|
||||
}
|
||||
|
||||
sub displayWidth {
|
||||
return shift->widthOverride(@_) || 128;
|
||||
}
|
||||
|
||||
sub vfdmodel {
|
||||
return 'graphic-128x32';
|
||||
}
|
||||
|
||||
1;
|
||||
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;
|
||||
27
plugin/SqueezeESP32/Plugin.pm
Normal file
27
plugin/SqueezeESP32/Plugin.pm
Normal file
@@ -0,0 +1,27 @@
|
||||
package Plugins::SqueezeESP32::Plugin;
|
||||
|
||||
use strict;
|
||||
|
||||
use base qw(Slim::Plugin::Base);
|
||||
use Slim::Utils::Prefs;
|
||||
use Slim::Utils::Log;
|
||||
|
||||
my $prefs = preferences('plugin.squeezeesp32');
|
||||
|
||||
$prefs->init();
|
||||
|
||||
my $log = Slim::Utils::Log->addLogCategory({
|
||||
'category' => 'plugin.squeezeesp32',
|
||||
'defaultLevel' => 'INFO',
|
||||
'description' => Slim::Utils::Strings::string('SqueezeESP32'),
|
||||
});
|
||||
|
||||
sub initPlugin {
|
||||
my $class = shift;
|
||||
|
||||
$class->SUPER::initPlugin(@_);
|
||||
Slim::Networking::Slimproto::addPlayerClass($class, 100, 'squeeze2esp32', { client => 'Plugins::SqueezeESP32::Player', display => 'Plugins::SqueezeESP32::Graphics' });
|
||||
$log->info("Added class 100 for SqueezeESP32");
|
||||
}
|
||||
|
||||
1;
|
||||
13
plugin/SqueezeESP32/Text.pm
Normal file
13
plugin/SqueezeESP32/Text.pm
Normal file
@@ -0,0 +1,13 @@
|
||||
package Plugins::SqueezeESP32::Text;
|
||||
|
||||
use strict;
|
||||
|
||||
use base qw(Slim::Display::Text);
|
||||
|
||||
# we don't want the special Noritake codes
|
||||
sub vfdmodel {
|
||||
return 'squeezeslave'';
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
13
plugin/SqueezeESP32/install.xml
Normal file
13
plugin/SqueezeESP32/install.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version='1.0' standalone='yes'?>
|
||||
<extensions>
|
||||
<defaultState>enabled</defaultState>
|
||||
<email>philippe_44@outlook.com</email>
|
||||
<targetApplication>
|
||||
<minVersion>7.9</minVersion>
|
||||
<maxVersion>*.*</maxVersion>
|
||||
<id>SlimServer</id>
|
||||
</targetApplication>
|
||||
<module>Plugins::SqueezeESP32::Plugin</module>
|
||||
<version>0.1</version>
|
||||
<creator>Philippe</creator>
|
||||
</extensions>
|
||||
2
plugin/SqueezeESP32/strings.txt
Normal file
2
plugin/SqueezeESP32/strings.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
WELCOME_TO_SQUEEZEESP32
|
||||
EN Welcome to SqueezeESP32
|
||||
Reference in New Issue
Block a user