improve display

This commit is contained in:
philippe44
2020-01-07 19:56:31 -08:00
parent b34b3ad08e
commit 1409e1ccbe
7 changed files with 55 additions and 5 deletions

View File

@@ -23,7 +23,7 @@
#include "esp_log.h"
#define LINELEN 60
#define LINELEN 40
#define TAG "display"
//Change special LCD chars to something more printable on screen
@@ -94,7 +94,8 @@ void vfd_data( unsigned short *data, int bytes_read) {
int addr = 0; /* counter */
if (bytes_read % 2) bytes_read--; /* even number of bytes */
display_data = &(data[6]); /* display data starts at byte 12 */
// if we use Noritake VFD codes, display data starts at 12
display_data = &(data[5]); /* display data starts at byte 10 */
memset(ddram, ' ', LINELEN * 2);

View File

@@ -452,7 +452,7 @@ static void process_dsco(u8_t *pkt, int len) {
static void process_vfdc(u8_t *pkt, int len) {
LOG_DEBUG("VFDC %u", len);
vfd_data( pkt + 4, len - 4);
vfd_data( pkt, len - 4);
}
static void process_setd(u8_t *pkt, int len) {

37
plugin/Player.pm Normal file
View 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;

View File

@@ -20,8 +20,8 @@ sub initPlugin {
my $class = shift;
$class->SUPER::initPlugin(@_);
Slim::Networking::Slimproto::addPlayerClass($class, 100, 'squeeze2esp32', { client => 'Slim::Player::SqueezePlay', display => 'Slim::Display::Text' });
LOG_INFO("Added class 100 for SqueezeESP32");
Slim::Networking::Slimproto::addPlayerClass($class, 100, 'squeeze2esp32', { client => 'Plugins::SqueezeESP32::Player', display => 'Plugins::SqueezeESP32::Text' });
$log->info("Added class 100 for SqueezeESP32");
}
1;

Binary file not shown.

10
plugin/Text.pm Normal file
View File

@@ -0,0 +1,10 @@
package Plugins::SqueezeESP32::Text;
use strict;
use base qw(Slim::Display::Text);
# we don't want the special Noritake codes
sub vfdmodel { 'squeezeslave' }
1;

2
plugin/strings.txt Normal file
View File

@@ -0,0 +1,2 @@
WELCOME_TO_SQUEEZEESP32
EN Welcome to SqueezeESP32