Player.pm 834 B

12345678910111213141516171819202122232425262728293031323334353637
  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. sub model { 'squeezeesp32' }
  8. sub modelName { 'SqueezeESP32' }
  9. sub hasIR { 0 }
  10. # We need to implement this to allow us to receive SETD commands
  11. # and we need SETD to support custom display widths
  12. sub directBodyFrame { 1 }
  13. # Allow the player to define it's display width (and probably more)
  14. sub playerSettingsFrame {
  15. my $client = shift;
  16. my $data_ref = shift;
  17. my $value;
  18. my $id = unpack('C', $$data_ref);
  19. # New SETD command 0xfe for display width
  20. if ($id == 0xfe) {
  21. $value = (unpack('CC', $$data_ref))[1];
  22. if ($value > 10 && $value < 200) {
  23. $client->display->widthOverride(1, $value);
  24. $client->update;
  25. }
  26. }
  27. }
  28. 1;