mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
driver/vfd.cpp: add support to switch scroll on/off
This commit is contained in:
@@ -41,6 +41,9 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include <daemonc/remotecontrol.h>
|
#include <daemonc/remotecontrol.h>
|
||||||
|
#include <system/helpers.h>
|
||||||
|
#include <zapit/debug.h>
|
||||||
|
|
||||||
#include <cs_api.h>
|
#include <cs_api.h>
|
||||||
extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */
|
extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */
|
||||||
|
|
||||||
@@ -697,29 +700,23 @@ void CVFD::ShowIcon(fp_icon icon, bool show)
|
|||||||
perror(show ? "IOC_FP_SET_ICON" : "IOC_FP_CLEAR_ICON");
|
perror(show ? "IOC_FP_SET_ICON" : "IOC_FP_CLEAR_ICON");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVFD::ShowText(const char *str)
|
void CVFD::ShowText(const char * str)
|
||||||
{
|
{
|
||||||
int len = strlen(str);
|
char flags[2] = { FP_FLAG_ALIGN_LEFT, 0 };
|
||||||
int i = 0, ret;
|
|
||||||
|
|
||||||
printf("CVFD::ShowText: [%s]\n", str);
|
if (g_settings.lcd_scroll)
|
||||||
if (len > 0)
|
flags[0] |= FP_FLAG_SCROLL_ON | FP_FLAG_SCROLL_SIO | FP_FLAG_SCROLL_DELAY;
|
||||||
{
|
|
||||||
for (i = len; i > 0; i--) {
|
|
||||||
if (str[i - 1] != ' ')
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (((int)strlen(text) == i && !strncmp(str, text, i)) || len > 255)
|
std::string txt = std::string(flags) + str;
|
||||||
|
txt = trim(txt);
|
||||||
|
printf("CVFD::ShowText: [%s]\n", txt.c_str() + 1);
|
||||||
|
|
||||||
|
size_t len = txt.length();
|
||||||
|
if (txt == text || len > 255)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
strncpy(text, str, i);
|
text = txt;
|
||||||
text[i] = '\0';
|
int ret = ioctl(fd, IOC_FP_SET_TEXT, len > 1 ? txt.c_str() : NULL);
|
||||||
|
|
||||||
//printf("****************************** CVFD::ShowText: %s\n", str);
|
|
||||||
//FIXME !!
|
|
||||||
ret = ioctl(fd, IOC_FP_SET_TEXT, len ? str : NULL);
|
|
||||||
if(ret < 0)
|
if(ret < 0)
|
||||||
perror("IOC_FP_SET_TEXT");
|
perror("IOC_FP_SET_TEXT");
|
||||||
}
|
}
|
||||||
|
@@ -90,7 +90,7 @@ class CVFD
|
|||||||
unsigned int switch_name_time_cnt;
|
unsigned int switch_name_time_cnt;
|
||||||
int fd;
|
int fd;
|
||||||
int brightness;
|
int brightness;
|
||||||
char text[256];
|
std::string text;
|
||||||
|
|
||||||
void count_down();
|
void count_down();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user