Player.pm 884 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package Plugins::SqueezeESP32::Player;
  2. use strict;
  3. use base qw(Slim::Player::SqueezePlay);
  4. use Slim::Utils::Log;
  5. use Slim::Utils::Prefs;
  6. my $prefs = preferences('plugin.squeezeesp32');
  7. my $log = logger('plugin.squeezeesp32');
  8. sub model { 'squeezeesp32' }
  9. sub modelName { 'SqueezeESP32' }
  10. sub hasIR { 0 }
  11. # Allow the player to define it's display width (and probably more)
  12. sub playerSettingsFrame {
  13. my $client = shift;
  14. my $data_ref = shift;
  15. my $value;
  16. my $id = unpack('C', $$data_ref);
  17. # New SETD command 0xfe for display width
  18. if ($id == 0xfe) {
  19. $value = (unpack('CC', $$data_ref))[1];
  20. if ($value > 100 && $value < 400) {
  21. $client->display->widthOverride(1, $value);
  22. $client->update;
  23. }
  24. $log->info("Setting player width $value for ", $client->name);
  25. }
  26. $client->SUPER::playerSettingsFrame($data_ref);
  27. }
  28. sub hasScrolling {
  29. return 1;
  30. }
  31. 1;