Merge remote-tracking branch 'check/cst-next'

needs build- and functional fixes

Conflicts:
	configure.ac
	data/icons/shutdown.jpg
	data/icons/start.jpg
	data/locale/deutsch.locale
	data/locale/english.locale
	lib/libmd5sum/md5.c
	src/driver/scanepg.cpp
	src/driver/streamts.cpp
	src/driver/vfd.cpp
	src/driver/vfd.h
	src/driver/volume.cpp
	src/eitd/dmx.cpp
	src/eitd/xmlutil.cpp
	src/gui/Makefile.am
	src/gui/audiomute.cpp
	src/gui/channellist.cpp
	src/gui/dboxinfo.cpp
	src/gui/epgview.cpp
	src/gui/eventlist.cpp
	src/gui/filebrowser.cpp
	src/gui/hdd_menu.cpp
	src/gui/infoviewer.cpp
	src/gui/infoviewer_bb.cpp
	src/gui/infoviewer_bb.h
	src/gui/keybind_setup.cpp
	src/gui/luainstance.cpp
	src/gui/luainstance.h
	src/gui/miscsettings_menu.cpp
	src/gui/moviebrowser.cpp
	src/gui/movieplayer.cpp
	src/gui/osd_progressbar_setup.cpp
	src/gui/osd_progressbar_setup.h
	src/gui/osd_setup.cpp
	src/gui/osdlang_setup.cpp
	src/gui/personalize.cpp
	src/gui/plugins.cpp
	src/gui/plugins.h
	src/gui/scan.cpp
	src/gui/scan_setup.cpp
	src/gui/update_settings.cpp
	src/gui/user_menue.cpp
	src/gui/user_menue_setup.cpp
	src/gui/videosettings.cpp
	src/gui/widget/buttons.cpp
	src/gui/widget/menue.cpp
	src/gui/widget/menue.h
	src/gui/widget/progresswindow.cpp
	src/neutrino.cpp
	src/neutrino_menue.cpp
	src/nhttpd/yhttpd.cpp
	src/system/helpers.cpp
	src/system/locals.h
	src/system/locals_intern.h
	src/system/setting_helpers.cpp
	src/zapit/lib/zapitclient.cpp
	src/zapit/src/fastscan.cpp
	src/zapit/src/frontend.cpp
	src/zapit/src/getservices.cpp
	src/zapit/src/scan.cpp
	src/zapit/src/scannit.cpp
	src/zapit/src/scanpmt.cpp
	src/zapit/src/transponder.cpp
	src/zapit/src/zapit.cpp
This commit is contained in:
Stefan Seyfried
2014-12-25 18:03:08 +01:00
423 changed files with 23934 additions and 12351 deletions

View File

@@ -62,17 +62,54 @@ CVFD::CVFD()
m_progressLocal = 0;
#endif // VFD_UPDATE
has_lcd = 1;
has_lcd = true;
has_led_segment = false;
fd = open("/dev/display", O_RDONLY);
if(fd < 0) {
perror("/dev/display");
has_lcd = 0;
has_lcd = false;
has_led_segment = false;
}
#ifdef BOXMODEL_APOLLO
if (fd >= 0) {
int ret = ioctl(fd, IOC_FP_GET_DISPLAY_CAPS, &caps);
if (ret < 0) {
perror("IOC_FP_GET_DISPLAY_CAPS");
printf("VFD: please update driver!\n");
support_text = true;
support_numbers = true;
} else {
switch (caps.display_type) {
case FP_DISPLAY_TYPE_NONE:
has_lcd = false;
has_led_segment = false;
break;
case FP_DISPLAY_TYPE_LED_SEGMENT:
has_lcd = false;
has_led_segment = true;
break;
default:
has_lcd = true;
has_led_segment = false;
break;
}
support_text = (caps.display_type != FP_DISPLAY_TYPE_LED_SEGMENT &&
caps.text_support != FP_DISPLAY_TEXT_NONE);
support_numbers = caps.number_support;
}
}
#else
support_text = true;
support_numbers = true;
#endif
text.clear();
clearClock = 0;
mode = MODE_TVRADIO;
switch_name_time_cnt = 0;
timeout_cnt = 0;
service_number = -1;
}
CVFD::~CVFD()
@@ -117,7 +154,8 @@ void CVFD::count_down() {
}
void CVFD::wake_up() {
if(!has_lcd) return;
if(fd < 0) return;
if (atoi(g_settings.lcd_setting_dim_time.c_str()) > 0) {
timeout_cnt = atoi(g_settings.lcd_setting_dim_time.c_str());
g_settings.lcd_setting_dim_brightness > -1 ?
@@ -128,6 +166,7 @@ void CVFD::wake_up() {
if(g_settings.lcd_info_line){
switch_name_time_cnt = g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR] + 10;
}
}
void* CVFD::TimeThread(void *)
@@ -159,7 +198,7 @@ void CVFD::init(const char * /*fontfile*/, const char * /*fontname*/)
void CVFD::setlcdparameter(int dimm, const int power)
{
if(!has_lcd) return;
if(fd < 0) return;
if(dimm < 0)
dimm = 0;
@@ -182,13 +221,14 @@ printf("CVFD::setlcdparameter dimm %d power %d\n", dimm, power);
void CVFD::setlcdparameter(void)
{
if(!has_lcd) return;
if(fd < 0) return;
last_toggle_state_power = g_settings.lcd_setting[SNeutrinoSettings::LCD_POWER];
setlcdparameter((mode == MODE_STANDBY) ? g_settings.lcd_setting[SNeutrinoSettings::LCD_STANDBY_BRIGHTNESS] : (mode == MODE_SHUTDOWN) ? g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS] : g_settings.lcd_setting[SNeutrinoSettings::LCD_BRIGHTNESS],
last_toggle_state_power);
}
void CVFD::setled(int led1, int led2){
void CVFD::setled(int led1, int led2)
{
int ret = -1;
if(led1 != -1){
@@ -220,40 +260,43 @@ void CVFD::setled(bool on_off)
int led1 = -1, led2 = -1;
if(on_off){//on
switch(g_settings.led_rec_mode){
switch(g_settings.led_rec_mode) {
case 1:
led1 = FP_LED_1_ON; led2 = FP_LED_2_ON;
break;
led1 = FP_LED_1_ON; led2 = FP_LED_2_ON;
break;
case 2:
led1 = FP_LED_1_ON;
break;
led1 = FP_LED_1_ON;
break;
case 3:
led2 = FP_LED_2_ON;
break;
led2 = FP_LED_2_ON;
break;
default:
break;
break;
}
}
else {//off
switch(g_settings.led_rec_mode){
break;
switch(g_settings.led_rec_mode) {
case 1:
led1 = FP_LED_1_OFF; led2 = FP_LED_2_OFF;
break;
case 2:
led1 = FP_LED_1_OFF;
break;
led1 = FP_LED_1_OFF;
break;
case 3:
led2 = FP_LED_2_OFF;
break;
led2 = FP_LED_2_OFF;
break;
default:
led1 = FP_LED_1_OFF; led2 = FP_LED_2_OFF;
break;
led1 = FP_LED_1_OFF; led2 = FP_LED_2_OFF;
break;
}
}
setled(led1, led2);
}
void CVFD::setled(void)
{
if(!has_lcd) return;
if(fd < 0) return;
int led1 = -1, led2 = -1;
int select = 0;
@@ -265,33 +308,38 @@ void CVFD::setled(void)
switch(select){
case 0:
led1 = FP_LED_1_OFF; led2 = FP_LED_2_OFF;
break;
led1 = FP_LED_1_OFF; led2 = FP_LED_2_OFF;
break;
case 1:
led1 = FP_LED_1_ON; led2 = FP_LED_2_ON;
break;
led1 = FP_LED_1_ON; led2 = FP_LED_2_ON;
break;
case 2:
led1 = FP_LED_1_ON; led2 = FP_LED_2_OFF;
break;
led1 = FP_LED_1_ON; led2 = FP_LED_2_OFF;
break;
case 3:
led1 = FP_LED_1_OFF; led2 = FP_LED_2_ON;
break;
led1 = FP_LED_1_OFF; led2 = FP_LED_2_ON;
break;
default:
break;
break;
}
setled(led1, led2);
}
void CVFD::showServicename(const std::string & name) // UTF-8
void CVFD::showServicename(const std::string & name, int number) // UTF-8
{
if(!has_lcd) return;
if(fd < 0) return;
printf("CVFD::showServicename: %s\n", name.c_str());
servicename = name;
service_number = number;
if (mode != MODE_TVRADIO)
return;
ShowText(name.c_str());
if (support_text)
ShowText(name.c_str());
else
ShowNumber(service_number);
wake_up();
}
@@ -303,11 +351,11 @@ void CVFD::showTime(bool force)
if(!has_lcd)
return;
#endif
if(has_lcd && mode == MODE_SHUTDOWN) {
if(fd >= 0 && mode == MODE_SHUTDOWN) {
ShowIcon(FP_ICON_CAM1, false);
return;
}
if (has_lcd && showclock) {
if (fd >= 0 && showclock) {
if (mode == MODE_STANDBY || ( g_settings.lcd_info_line && (MODE_TVRADIO == mode))) {
char timestr[21];
struct timeb tm;
@@ -319,8 +367,15 @@ void CVFD::showTime(bool force)
if(force || ( switch_name_time_cnt == 0 && ((hour != t->tm_hour) || (minute != t->tm_min))) ) {
hour = t->tm_hour;
minute = t->tm_min;
strftime(timestr, 20, "%H:%M", t);
ShowText(timestr);
if (support_text) {
strftime(timestr, 20, "%H:%M", t);
ShowText(timestr);
} else if (support_numbers && has_led_segment) {
ShowNumber((t->tm_hour*100) + t->tm_min);
#ifdef BOXMODEL_APOLLO
ioctl(fd, IOC_FP_SET_COLON, 0x01);
#endif
}
}
}
}
@@ -342,8 +397,10 @@ void CVFD::showTime(bool force)
clearClock = 0;
if(has_lcd)
ShowIcon(FP_ICON_CAM1, false);
setled();
}
recstatus = tmp_recstatus;
}
@@ -351,13 +408,13 @@ void CVFD::showRCLock(int /*duration*/)
{
}
void CVFD::showVolume(const char vol, const bool /*perform_update*/)
void CVFD::showVolume(const char vol, const bool force_update)
{
static int oldpp = 0;
if(!has_lcd) return;
ShowIcon(FP_ICON_MUTE, muted);
if(vol == volume)
if(!force_update && vol == volume)
return;
volume = vol;
@@ -368,7 +425,7 @@ void CVFD::showVolume(const char vol, const bool /*perform_update*/)
int pp = (vol * 8 + 50) / 100;
if(pp > 8) pp = 8;
if(oldpp != pp) {
if(force_update || oldpp != pp) {
printf("CVFD::showVolume: %d, bar %d\n", (int) vol, pp);
int i;
int j = 0x00000200;
@@ -419,7 +476,7 @@ void CVFD::showPercentOver(const unsigned char perc, const bool /*perform_update
void CVFD::showMenuText(const int /*position*/, const char * ptext, const int /*highlight*/, const bool /*utf_encoded*/)
{
if(!has_lcd) return;
if(fd < 0) return;
if (mode != MODE_MENU_UTF8)
return;
@@ -429,7 +486,7 @@ void CVFD::showMenuText(const int /*position*/, const char * ptext, const int /*
void CVFD::showAudioTrack(const std::string & /*artist*/, const std::string & title, const std::string & /*album*/)
{
if(!has_lcd) return;
if(fd < 0) return;
if (mode != MODE_AUDIO)
return;
printf("CVFD::showAudioTrack: %s\n", title.c_str());
@@ -437,15 +494,16 @@ printf("CVFD::showAudioTrack: %s\n", title.c_str());
wake_up();
#ifdef HAVE_LCD
fonts.menu->RenderString(0,22, 125, artist.c_str() , CLCDDisplay::PIXEL_ON, 0, true); // UTF-8
fonts.menu->RenderString(0,35, 125, album.c_str() , CLCDDisplay::PIXEL_ON, 0, true); // UTF-8
fonts.menu->RenderString(0,48, 125, title.c_str() , CLCDDisplay::PIXEL_ON, 0, true); // UTF-8
fonts.menu->RenderString(0,22, 125, artist.c_str() , CLCDDisplay::PIXEL_ON);
fonts.menu->RenderString(0,35, 125, album.c_str() , CLCDDisplay::PIXEL_ON);
fonts.menu->RenderString(0,48, 125, title.c_str() , CLCDDisplay::PIXEL_ON);
#endif
}
void CVFD::showAudioPlayMode(AUDIOMODES m)
{
if(!has_lcd) return;
if(fd < 0) return;
switch(m) {
case AUDIO_MODE_PLAY:
ShowIcon(FP_ICON_PLAY, true);
@@ -487,7 +545,13 @@ void CVFD::showAudioProgress(const char /*perc*/, bool /*isMuted*/)
void CVFD::setMode(const MODES m, const char * const title)
{
if(!has_lcd) return;
if(fd < 0) return;
// Clear colon in display if it is still there
#ifdef BOXMODEL_APOLLO
if (support_numbers && has_led_segment)
ioctl(fd, IOC_FP_SET_COLON, 0x00);
#endif
if(mode == MODE_AUDIO)
ShowIcon(FP_ICON_MP3, false);
@@ -541,7 +605,7 @@ void CVFD::setMode(const MODES m, const char * const title)
break;
case MODE_MENU_UTF8:
showclock = false;
//fonts.menutitle->RenderString(0,28, 140, title, CLCDDisplay::PIXEL_ON, 0, true); // UTF-8
//fonts.menutitle->RenderString(0,28, 140, title, CLCDDisplay::PIXEL_ON);
break;
case MODE_SHUTDOWN:
showclock = false;
@@ -584,7 +648,7 @@ void CVFD::setMode(const MODES m, const char * const title)
void CVFD::setBrightness(int bright)
{
if(!has_lcd) return;
if(!has_lcd && !has_led_segment) return;
g_settings.lcd_setting[SNeutrinoSettings::LCD_BRIGHTNESS] = bright;
setlcdparameter();
@@ -601,7 +665,7 @@ int CVFD::getBrightness()
void CVFD::setBrightnessStandby(int bright)
{
if(!has_lcd) return;
if(!has_lcd && !has_led_segment) return;
g_settings.lcd_setting[SNeutrinoSettings::LCD_STANDBY_BRIGHTNESS] = bright;
setlcdparameter();
@@ -617,7 +681,7 @@ int CVFD::getBrightnessStandby()
void CVFD::setBrightnessDeepStandby(int bright)
{
if(!has_lcd) return;
if(!has_lcd && !has_led_segment) return;
g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS] = bright;
setlcdparameter();
@@ -646,7 +710,7 @@ int CVFD::getPower()
void CVFD::togglePower(void)
{
if(!has_lcd) return;
if(fd < 0) return;
last_toggle_state_power = 1 - last_toggle_state_power;
setlcdparameter((mode == MODE_STANDBY) ? g_settings.lcd_setting[SNeutrinoSettings::LCD_STANDBY_BRIGHTNESS] : (mode == MODE_SHUTDOWN) ? g_settings.lcd_setting[SNeutrinoSettings::LCD_DEEPSTANDBY_BRIGHTNESS] : g_settings.lcd_setting[SNeutrinoSettings::LCD_BRIGHTNESS],
@@ -672,19 +736,19 @@ void CVFD::pause()
void CVFD::Lock()
{
if(!has_lcd) return;
if(fd < 0) return;
creat("/tmp/vfd.locked", 0);
}
void CVFD::Unlock()
{
if(!has_lcd) return;
if(fd < 0) return;
unlink("/tmp/vfd.locked");
}
void CVFD::Clear()
{
if(!has_lcd) return;
if(fd < 0) return;
int ret = ioctl(fd, IOC_FP_CLEAR_ALL, 0);
if(ret < 0)
perror("IOC_FP_SET_TEXT");
@@ -703,6 +767,9 @@ void CVFD::ShowIcon(fp_icon icon, bool show)
void CVFD::ShowText(const char * str)
{
if (fd < 0 || !support_text)
return;
char flags[2] = { FP_FLAG_ALIGN_LEFT, 0 };
if (! str) {
printf("CVFD::ShowText: str is NULL!\n");
@@ -722,11 +789,31 @@ void CVFD::ShowText(const char * str)
text = txt;
int ret = ioctl(fd, IOC_FP_SET_TEXT, len > 1 ? txt.c_str() : NULL);
if(ret < 0)
if(ret < 0) {
support_text = false;
perror("IOC_FP_SET_TEXT");
}
}
void CVFD::ShowNumber(int number)
{
if (fd < 0 || (!support_text && !support_numbers))
return;
if (number < 0)
return;
#ifdef BOXMODEL_APOLLO
int ret = ioctl(fd, IOC_FP_SET_NUMBER, number);
if(ret < 0) {
support_numbers = false;
perror("IOC_FP_SET_NUMBER");
}
#endif
}
#ifdef VFD_UPDATE
/*****************************************************************************************/
// showInfoBox
/*****************************************************************************************/
@@ -772,12 +859,12 @@ void CVFD::showInfoBox(const char * const title, const char * const text ,int au
// paint title
if(!m_infoBoxTitle.empty())
{
int width = fonts.menu->getRenderWidth(m_infoBoxTitle.c_str(),true);
int width = fonts.menu->getRenderWidth(m_infoBoxTitle);
if(width > 100)
width = 100;
int start_pos = (120-width) /2;
display.draw_fill_rect (start_pos, EPG_INFO_WINDOW_POS-4, start_pos+width+5, EPG_INFO_WINDOW_POS+10, CLCDDisplay::PIXEL_OFF);
fonts.menu->RenderString(start_pos+4,EPG_INFO_WINDOW_POS+5, width+5, m_infoBoxTitle.c_str(), CLCDDisplay::PIXEL_ON, 0, true); // UTF-8
fonts.menu->RenderString(start_pos+4,EPG_INFO_WINDOW_POS+5, width+5, m_infoBoxTitle.c_str(), CLCDDisplay::PIXEL_ON);
}
// paint info
@@ -789,7 +876,7 @@ void CVFD::showInfoBox(const char * const title, const char * const text ,int au
{
text_line.clear();
while ( m_infoBoxText[pos] != '\n' &&
((fonts.menu->getRenderWidth(text_line.c_str(), true) < EPG_INFO_TEXT_WIDTH-10) || !m_infoBoxAutoNewline )&&
((fonts.menu->getRenderWidth(text_line) < EPG_INFO_TEXT_WIDTH-10) || !m_infoBoxAutoNewline )&&
(pos < length)) // UTF-8
{
if ( m_infoBoxText[pos] >= ' ' && m_infoBoxText[pos] <= '~' ) // any char between ASCII(32) and ASCII (126)
@@ -797,7 +884,7 @@ void CVFD::showInfoBox(const char * const title, const char * const text ,int au
pos++;
}
//printf("[lcdd] line %d:'%s'\r\n",line,text_line.c_str());
fonts.menu->RenderString(EPG_INFO_TEXT_POS+1,EPG_INFO_TEXT_POS+(line*EPG_INFO_FONT_HEIGHT)+EPG_INFO_FONT_HEIGHT+3, EPG_INFO_TEXT_WIDTH, text_line.c_str(), CLCDDisplay::PIXEL_ON, 0, true); // UTF-8
fonts.menu->RenderString(EPG_INFO_TEXT_POS+1,EPG_INFO_TEXT_POS+(line*EPG_INFO_FONT_HEIGHT)+EPG_INFO_FONT_HEIGHT+3, EPG_INFO_TEXT_WIDTH, text_line.c_str(), CLCDDisplay::PIXEL_ON);
if ( m_infoBoxText[pos] == '\n' )
pos++; // remove new line
}
@@ -839,7 +926,7 @@ void CVFD::showFilelist(int flist_pos,CFileList* flist,const char * const mainDi
if(m_fileListPos > size)
m_fileListPos = size-1;
int width = fonts.menu->getRenderWidth(m_fileListHeader.c_str(), true);
int width = fonts.menu->getRenderWidth(m_fileListHeader);
if(width>110)
width=110;
fonts.menu->RenderString((120-width)/2, 11, width+5, m_fileListHeader.c_str(), CLCDDisplay::PIXEL_ON);
@@ -944,11 +1031,11 @@ void CVFD::showProgressBar(int global, const char * const text,int show_escape,i
display.draw_fill_rect (0,12,120,64, CLCDDisplay::PIXEL_OFF);
// paint progress header
int width = fonts.menu->getRenderWidth(m_progressHeaderGlobal.c_str(),true);
int width = fonts.menu->getRenderWidth(m_progressHeaderGlobal);
if(width > 100)
width = 100;
int start_pos = (120-width) /2;
fonts.menu->RenderString(start_pos, 12+12, width+10, m_progressHeaderGlobal.c_str(), CLCDDisplay::PIXEL_ON,0,true);
fonts.menu->RenderString(start_pos, 12+12, width+10, m_progressHeaderGlobal.c_str(), CLCDDisplay::PIXEL_ON);
// paint global bar
int marker_length = (PROG_GLOB_POS_WIDTH * m_progressGlobal)/100;
@@ -1015,11 +1102,11 @@ void CVFD::showProgressBar2(int local,const char * const text_local ,int global
display.draw_fill_rect (0,12,120,64, CLCDDisplay::PIXEL_OFF);
// paint global header
int width = fonts.menu->getRenderWidth(m_progressHeaderGlobal.c_str(),true);
int width = fonts.menu->getRenderWidth(m_progressHeaderGlobal);
if(width > 100)
width = 100;
int start_pos = (120-width) /2;
fonts.menu->RenderString(start_pos, PROG2_GLOB_POS_Y-3, width+10, m_progressHeaderGlobal.c_str(), CLCDDisplay::PIXEL_ON,0,true);
fonts.menu->RenderString(start_pos, PROG2_GLOB_POS_Y-3, width+10, m_progressHeaderGlobal.c_str(), CLCDDisplay::PIXEL_ON);
// paint global bar
int marker_length = (PROG2_GLOB_POS_WIDTH * m_progressGlobal)/100;
@@ -1028,11 +1115,11 @@ void CVFD::showProgressBar2(int local,const char * const text_local ,int global
display.draw_fill_rect (PROG2_GLOB_POS_X+1+marker_length, PROG2_GLOB_POS_Y+1, PROG2_GLOB_POS_X+PROG2_GLOB_POS_WIDTH-1, PROG2_GLOB_POS_Y+PROG2_GLOB_POS_HEIGTH-1, CLCDDisplay::PIXEL_OFF);
// paint local header
width = fonts.menu->getRenderWidth(m_progressHeaderLocal.c_str(),true);
width = fonts.menu->getRenderWidth(m_progressHeaderLocal);
if(width > 100)
width = 100;
start_pos = (120-width) /2;
fonts.menu->RenderString(start_pos, PROG2_LOCAL_POS_Y + PROG2_LOCAL_POS_HEIGTH +10 , width+10, m_progressHeaderLocal.c_str(), CLCDDisplay::PIXEL_ON,0,true);
fonts.menu->RenderString(start_pos, PROG2_LOCAL_POS_Y + PROG2_LOCAL_POS_HEIGTH +10 , width+10, m_progressHeaderLocal.c_str(), CLCDDisplay::PIXEL_ON);
// paint local bar
marker_length = (PROG2_LOCAL_POS_WIDTH * m_progressLocal)/100;