Graphics.pm 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. package Plugins::SqueezeESP32::Graphics;
  2. use strict;
  3. use base qw(Slim::Display::Squeezebox2);
  4. my $VISUALIZER_NONE = 0;
  5. my @modes = (
  6. # mode 0
  7. { desc => ['BLANK'],
  8. bar => 0, secs => 0, width => 128,
  9. params => [$VISUALIZER_NONE] },
  10. # mode 1
  11. { desc => ['PROGRESS_BAR'],
  12. bar => 1, secs => 0, width => 128,
  13. params => [$VISUALIZER_NONE] },
  14. # mode 2
  15. { desc => ['ELAPSED'],
  16. bar => 0, secs => 1, width => 128,
  17. params => [$VISUALIZER_NONE] },
  18. # mode 3
  19. { desc => ['ELAPSED', 'AND', 'PROGRESS_BAR'],
  20. bar => 1, secs => 1, width => 128,
  21. params => [$VISUALIZER_NONE] },
  22. # mode 4
  23. { desc => ['REMAINING'],
  24. bar => 0, secs => -1, width => 128,
  25. params => [$VISUALIZER_NONE] },
  26. # mode 5
  27. { desc => ['CLOCK'],
  28. bar => 0, secs => 0, width => 128, clock => 1,
  29. params => [$VISUALIZER_NONE] },
  30. # mode 6
  31. { desc => ['SETUP_SHOWBUFFERFULLNESS'],
  32. bar => 0, secs => 0, width => 128, fullness => 1,
  33. params => [$VISUALIZER_NONE] },
  34. );
  35. sub modes {
  36. return \@modes;
  37. }
  38. sub nmodes {
  39. return $#modes;
  40. }
  41. # I don't think LMS renderer handles properly screens other than 32 pixels. It
  42. # seems that all we get is a 32 pixel-tall data with anything else padded to 0
  43. # i.e. if we try 64 pixels height, bytes 0..3 and 4..7 will contains the same
  44. # pattern than the 32 pixels version, where one would have expected bytes 4..7
  45. # to be empty
  46. =comment
  47. sub bytesPerColumn {
  48. return 4;
  49. }
  50. =cut
  51. sub displayHeight {
  52. return 32;
  53. }
  54. sub displayWidth {
  55. return shift->widthOverride(@_) || 128;
  56. }
  57. sub vfdmodel {
  58. return 'graphic-128x32';
  59. }
  60. 1;