mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
CVFD: make ShowText() use const char* to avoid ugly casts
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1549 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -260,7 +260,7 @@ printf("CVFD::showServicename: %s\n", name.c_str());
|
||||
if (mode != MODE_TVRADIO)
|
||||
return;
|
||||
|
||||
ShowText((char *) name.c_str());
|
||||
ShowText(name.c_str());
|
||||
wake_up();
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ void CVFD::showTime(bool force)
|
||||
hour = t->tm_hour;
|
||||
minute = t->tm_min;
|
||||
strftime(timestr, 20, "%H:%M", t);
|
||||
ShowText((char *) timestr);
|
||||
ShowText(timestr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -391,7 +391,7 @@ void CVFD::showMenuText(const int /*position*/, const char * ptext, const int /*
|
||||
if (mode != MODE_MENU_UTF8)
|
||||
return;
|
||||
|
||||
ShowText((char *) ptext);
|
||||
ShowText(ptext);
|
||||
wake_up();
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ void CVFD::showAudioTrack(const std::string & /*artist*/, const std::string & ti
|
||||
if (mode != MODE_AUDIO)
|
||||
return;
|
||||
printf("CVFD::showAudioTrack: %s\n", title.c_str());
|
||||
ShowText((char *) title.c_str());
|
||||
ShowText(title.c_str());
|
||||
wake_up();
|
||||
|
||||
#ifdef HAVE_LCD
|
||||
@@ -467,7 +467,7 @@ void CVFD::setMode(const MODES m, const char * const title)
|
||||
#endif
|
||||
|
||||
if(strlen(title))
|
||||
ShowText((char *) title);
|
||||
ShowText(title);
|
||||
mode = m;
|
||||
setlcdparameter();
|
||||
|
||||
@@ -669,23 +669,25 @@ void CVFD::ShowIcon(vfd_icon icon, bool show)
|
||||
perror(show ? "IOC_VFD_SET_ICON" : "IOC_VFD_CLEAR_ICON");
|
||||
}
|
||||
|
||||
void CVFD::ShowText(char * str)
|
||||
void CVFD::ShowText(const char *str)
|
||||
{
|
||||
int len = strlen(str);
|
||||
int i, ret;
|
||||
int i = 0, ret;
|
||||
|
||||
printf("CVFD::ShowText: [%s]\n", str);
|
||||
for(i = len-1; i > 0; i--) {
|
||||
if(str[i] == ' ')
|
||||
str[i] = 0;
|
||||
else
|
||||
break;
|
||||
if (len > 0)
|
||||
{
|
||||
for (i = len; i > 0; i--) {
|
||||
if (str[i - 1] != ' ')
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!strcmp(str, text) || len > 255)
|
||||
if (((int)strlen(text) == i && !strncmp(str, text, i)) || len > 255)
|
||||
return;
|
||||
|
||||
strcpy(text, str);
|
||||
strncpy(text, str, i);
|
||||
text[i] = '\0';
|
||||
|
||||
//printf("****************************** CVFD::ShowText: %s\n", str);
|
||||
//FIXME !!
|
||||
|
@@ -144,7 +144,7 @@ class CVFD
|
||||
void Unlock();
|
||||
void Clear();
|
||||
void ShowIcon(vfd_icon icon, bool show);
|
||||
void ShowText(char * str);
|
||||
void ShowText(const char *str);
|
||||
MODES getMode(void) { return mode; };
|
||||
#ifdef LCD_UPDATE
|
||||
private:
|
||||
|
@@ -428,7 +428,7 @@ void CVideoSettings::nextMode(void)
|
||||
text = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].valname;
|
||||
|
||||
while(1) {
|
||||
CVFD::getInstance()->ShowText((char *)text);
|
||||
CVFD::getInstance()->ShowText(text);
|
||||
int res = ShowHintUTF(LOCALE_VIDEOMENU_VIDEOMODE, text, 450, 2);
|
||||
|
||||
if(disp_cur && res != messages_return::handled)
|
||||
@@ -455,7 +455,7 @@ void CVideoSettings::nextMode(void)
|
||||
}
|
||||
else if(res == messages_return::cancel_info) {
|
||||
g_settings.video_Mode = VIDEOMENU_VIDEOMODE_OPTIONS[curmode].key;
|
||||
//CVFD::getInstance()->ShowText((char *)text);
|
||||
//CVFD::getInstance()->ShowText(text);
|
||||
videoDecoder->SetVideoSystem(g_settings.video_Mode);
|
||||
//return;
|
||||
disp_cur = 1;
|
||||
|
@@ -2074,7 +2074,7 @@ int CNeutrinoApp::run(int argc, char **argv)
|
||||
CVFD::getInstance()->init(font.filename, font.name);
|
||||
|
||||
CVFD::getInstance()->Clear();
|
||||
CVFD::getInstance()->ShowText((char *) g_Locale->getText(LOCALE_NEUTRINO_STARTING));
|
||||
CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_NEUTRINO_STARTING));
|
||||
|
||||
//zapit start parameters
|
||||
Z_start_arg ZapStart_arg;
|
||||
@@ -3517,7 +3517,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
|
||||
|
||||
printf("entering off state\n");
|
||||
mode = mode_off;
|
||||
//CVFD::getInstance()->ShowText((char *) g_Locale->getText(LOCALE_MAINMENU_SHUTDOWN));
|
||||
//CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_SHUTDOWN));
|
||||
|
||||
system("/etc/init.d/rcK");
|
||||
system("/bin/sync");
|
||||
@@ -3624,7 +3624,7 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode)
|
||||
funNotifier->changeNotify(NONEXISTANT_LOCALE, (void *) &fspeed);
|
||||
delete funNotifier;
|
||||
}
|
||||
//CVFD::getInstance()->ShowText((char *) g_Locale->getText(LOCALE_MAINMENU_REBOOT));
|
||||
//CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_MAINMENU_REBOOT));
|
||||
delete frameBuffer;
|
||||
|
||||
#if 0 /* FIXME this next hack to test, until we find real crash on exit reason */
|
||||
|
Reference in New Issue
Block a user