diff --git a/data/cables.xml b/data/cables.xml index 6ea231499..610fa2fc8 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -266,6 +266,9 @@ + + + @@ -309,6 +312,7 @@ + diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index b6fa01057..9f16814e2 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -96,6 +96,7 @@ GENRE.TRAVEL_HOBBIES.5 Kochen GENRE.TRAVEL_HOBBIES.6 Einkauf GENRE.TRAVEL_HOBBIES.7 Garten GENRE.UNKNOWN Unbekannt +adzap Werbezapper apidselector.head Sprachauswahl audio.srs_algo Art audio.srs_algo_heavy stark @@ -537,7 +538,7 @@ flashupdate.proxyusername Benutzername flashupdate.proxyusername_hint1 Geben Sie den Proxy-Benutzernamen ein flashupdate.proxyusername_hint2 Ein leerer Eintrag bedeutet keine Authentifizierung flashupdate.read_directory_not_exist Das Backupverzeichnis %s \nexistiert nicht! -flashupdate.read_no_available_space Der maximal verfügbare Platz in %s \nbeträgt %d KB, es werden aber %d KB benötigt.\n \nDer Vorgang wird abgebrochen, wählen sie bitte einen anderen Datenträger! +flashupdate.read_no_available_space Der maximal verfügbare Platz in %s \nbeträgt %s KB, es werden aber %s KB benötigt.\n \nDer Vorgang wird abgebrochen, wählen sie bitte einen anderen Datenträger! flashupdate.read_volume_error Die Größe des Datenträgers %s \nkann nicht ermittelt werden! flashupdate.readflash ganzes Flashimage auslesen flashupdate.readflashmtd einzelne Partition auslesen @@ -740,6 +741,7 @@ mainmenu.channels Kanalliste mainmenu.clearsectionsd Lösche EPG Cache mainmenu.games Spiele mainmenu.head Hauptmenü +mainmenu.lua Plugins mainmenu.media Multimedia mainmenu.movieplayer Movieplayer mainmenu.pausesectionsd EPG auslesen @@ -756,6 +758,7 @@ mainmenu.shutdown Ausschalten mainmenu.shutdown_menu Ausschalt Optionen mainmenu.sleeptimer SleepTimer mainmenu.standby Standby +mainmenu.tools Werkzeuge mainmenu.tvmode TV-Modus mainmenu.tvradio_switch TV-Radio Umschaltung mainsettings.audio Audio @@ -954,6 +957,7 @@ menu.hint_leds_record Definiert, ob die Power-LEDs blinken sollen, wenn eine Auf menu.hint_leds_standby Definiert den Status der Power-LEDs im Standby menu.hint_leds_tv Definiert den Status der Power-LEDs im TV-Modus menu.hint_load Laden der Neutrino-HD-Einstellungen aus einer Datei +menu.hint_lua Plugins ausführen menu.hint_make_hdlist Bei aktiver Option wird ein Bouquet namens 'HD' erzeugt, in dem alle HD-Sender zusammengefasst sind menu.hint_make_newlist Nach einer Kanalsuche wird ein Bouquet namens 'neue Kanäle' erzeugt menu.hint_make_removedlist Nach einer Kanalsuche wird ein Bouquet namens 'gelöschte Kanäle' erzeugt @@ -1163,6 +1167,7 @@ menu.hint_theme Wählen Sie ein vordefiniertes Farbschema, speichern oder laden menu.hint_timeouts Gibt an, nach welcher Zeit in Sekunden die Menüs oder Infofenster sich automatisch schließen (0 deaktiviert) menu.hint_timers Hinzufügen, entfernen und bearbeiten geplanter Aufnahmen oder anderer Timer menu.hint_timezone Wählen Sie ihre Zeitzone aus +menu.hint_tools Werkzeuge ausführen menu.hint_tvmode Schaltet zum TV-Modus menu.hint_tvradio_switch Schaltet zwischen TV- und Radio-Modus um menu.hint_vfd Frontdisplay und Power-LEDs @@ -1607,6 +1612,7 @@ personalize.pinhint Personalisierungs PIN Code eingeben personalize.pinprotect ja personalize.pinstatus mit PIN personalize.plugins Plugins +personalize.usermenu_plugin_types Anzuzeigende Plugin-Typen wählen personalize.usermenu_preferred_buttons Bevorzugte Tasten zuweisen personalize.usermenu_show_cancel Zeige Schalter "Abbrechen" personalize.visible sichtbar @@ -1967,6 +1973,7 @@ usermenu.head Benutzermenü usermenu.item_bar ---- Trennung ---- usermenu.item_epg_misc EPG Funktionen usermenu.item_none (frei) +usermenu.item_plugin_types Plugin-Typen usermenu.item_vtxt Teletext usermenu.msg_info_is_empty Es wurde kein Name für dieses Menü vergeben.\nVerwende Standardname:\n usermenu.msg_warning_name Sie haben mehrere Menüpunkte für dieses Menü angelegt,\naber keinen neuen Namen festgelegt.\nEs ist daher empfohlen, einen neuen Namen zu vergeben! diff --git a/data/locale/english.locale b/data/locale/english.locale index acd442a5c..a9bba0440 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -96,6 +96,7 @@ GENRE.TRAVEL_HOBBIES.5 cooking GENRE.TRAVEL_HOBBIES.6 advertisement/shopping GENRE.TRAVEL_HOBBIES.7 gardening GENRE.UNKNOWN unknown +adzap AdZap apidselector.head Select language audio.srs_algo Type audio.srs_algo_heavy Heavy @@ -537,7 +538,7 @@ flashupdate.proxyusername Username flashupdate.proxyusername_hint1 enter the proxyserver username flashupdate.proxyusername_hint2 a empty entry means no proxy-auth flashupdate.read_directory_not_exist The backup directory %s \ndoes not exist! -flashupdate.read_no_available_space The maximum available space in %s \nis %d KB, but there are %d KB required.\n \nThe operation is canceled, please choose another medium! +flashupdate.read_no_available_space The maximum available space in %s \nis %s KB, but there are %s KB required.\n \nThe operation is canceled, please choose another medium! flashupdate.read_volume_error The size of the volume %s \ncan not be determined! flashupdate.readflash Read whole image flashupdate.readflashmtd Read one partition @@ -740,6 +741,7 @@ mainmenu.channels Channels mainmenu.clearsectionsd Clear EPG Cache mainmenu.games Games mainmenu.head Main Menu +mainmenu.lua Plugins mainmenu.media Media mainmenu.movieplayer Movieplayer mainmenu.pausesectionsd Read EPG @@ -756,6 +758,7 @@ mainmenu.shutdown Shutdown (deep standby) mainmenu.shutdown_menu Shutdown mainmenu.sleeptimer SleepTimer mainmenu.standby Standby +mainmenu.tools Tools mainmenu.tvmode TV-Mode mainmenu.tvradio_switch TV-Radio Switch mainsettings.audio Audio @@ -954,6 +957,7 @@ menu.hint_leds_record LEDs state when box recording menu.hint_leds_standby LEDs state in soft-standby mode menu.hint_leds_tv Working LEDs state menu.hint_load Load Neutrino-HD GUI settings from file +menu.hint_lua Run Plugins menu.hint_make_hdlist Auto-create HD channel list based on\nchannel type and name menu.hint_make_newlist Create list of recently added channels menu.hint_make_removedlist Create list of recently removed channels @@ -1163,6 +1167,7 @@ menu.hint_theme Select pre-defined color theme\nSave or load theme from files menu.hint_timeouts Configure time to hide GUI windows\nin seconds menu.hint_timers Add/Remove/Edit scheduled\nrecording, reminders etc. menu.hint_timezone Select your timezone +menu.hint_tools Run tools menu.hint_tvmode Switch box to TV mode menu.hint_tvradio_switch Switches between TV and Radio mode menu.hint_vfd Frontpanel LEDS, VFD options @@ -1607,6 +1612,7 @@ personalize.pinhint Enter the Personalization PIN Code personalize.pinprotect Yes personalize.pinstatus Require PIN personalize.plugins Plugins +personalize.usermenu_plugin_types Choose Plugin types to show personalize.usermenu_preferred_buttons Assigning of preferred keys personalize.usermenu_show_cancel Show "Cancel"-Button personalize.visible Visible @@ -1967,6 +1973,7 @@ usermenu.head User menu usermenu.item_bar ---- Boarder ---- usermenu.item_epg_misc EPG functions usermenu.item_none (empty) +usermenu.item_plugin_types Plugin types usermenu.item_vtxt Videotext usermenu.msg_info_is_empty You don't have definied a name for this menu!\nUsing default name:\n usermenu.msg_warning_name You have more than one items created for this menu,\nbut none new name for this menue defined.\nIt is recommended to enter a new name! diff --git a/lib/timerdclient/timerdclient.cpp b/lib/timerdclient/timerdclient.cpp index 1d441efba..5a9b68e97 100644 --- a/lib/timerdclient/timerdclient.cpp +++ b/lib/timerdclient/timerdclient.cpp @@ -34,6 +34,7 @@ #define VALGRIND_PARANOIA(x) {} #endif +int CTimerdClient::adzap_eventID = 0; unsigned char CTimerdClient::getVersion () const { return CTimerdMsg::ACTVERSION; @@ -262,7 +263,11 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, return -1; } } - + bool adzaptimer = false; + if(evType == CTimerd::TIMER_ADZAP){ + evType = CTimerd::TIMER_ZAPTO; + adzaptimer = true; + } CTimerd::TransferEventInfo tei; CTimerd::TransferRecordingInfo tri; CTimerdMsg::commandAddTimer msgAddTimer; @@ -282,7 +287,8 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, } /* else if(evType == CTimerd::TIMER_NEXTPROGRAM || evType == CTimerd::TIMER_ZAPTO || */ else if (evType == CTimerd::TIMER_ZAPTO || - evType == CTimerd::TIMER_IMMEDIATE_RECORD ) + evType == CTimerd::TIMER_IMMEDIATE_RECORD || + evType == CTimerd::TIMER_ADZAP) { CTimerd::EventInfo *ei=static_cast(data); tei.apids = ei->apids; @@ -330,13 +336,19 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, CTimerdMsg::responseAddTimer response; receive_data((char*)&response, sizeof(response)); close_connection(); - + + if(adzaptimer){ + adzap_eventID = response.eventID;//set adzap flag + } return( response.eventID); } //------------------------------------------------------------------------- void CTimerdClient::removeTimerEvent( int evId) { + if(evId == adzap_eventID) + adzap_eventID = 0;//reset adzap flag + CTimerdMsg::commandRemoveTimer msgRemoveTimer; VALGRIND_PARANOIA(msgRemoveTimer); diff --git a/lib/timerdclient/timerdclient.h b/lib/timerdclient/timerdclient.h index 16bdcad77..59a41b260 100644 --- a/lib/timerdclient/timerdclient.h +++ b/lib/timerdclient/timerdclient.h @@ -61,6 +61,7 @@ class CTimerdClient:private CBasicClient void registerEvent(unsigned int eventID, unsigned int clientID, const char * const udsName); void unRegisterEvent(unsigned int eventID, unsigned int clientID); + static int adzap_eventID; bool isTimerdAvailable(); // check if timerd is running @@ -151,6 +152,18 @@ class CTimerdClient:private CBasicClient eventInfo.recordingSafety = false; return addTimerEvent(CTimerd::TIMER_ZAPTO, &eventInfo, announcetime, alarmtime, stoptime); }; + // adds new adzap timer event //pseudo TIMER_ADZAP + int addAdZaptoTimerEvent(const t_channel_id channel_id, time_t alarmtime) + { + CTimerd::EventInfo eventInfo; + eventInfo.channel_id = channel_id; + eventInfo.epgID = 1; + eventInfo.epg_starttime = 0; + eventInfo.apids = 0; + eventInfo.recordingSafety = false; + return addTimerEvent(CTimerd::TIMER_ADZAP, &eventInfo, 0, alarmtime, 0); + }; + #if 0 int addNextProgramTimerEvent(CTimerd::EventInfo eventInfo,time_t alarmtime, time_t announcetime = 0, time_t stoptime = 0) diff --git a/lib/timerdclient/timerdtypes.h b/lib/timerdclient/timerdtypes.h index a57a2009f..a741318d6 100644 --- a/lib/timerdclient/timerdtypes.h +++ b/lib/timerdclient/timerdtypes.h @@ -33,9 +33,9 @@ #include #define REMINDER_MESSAGE_MAXLEN 31 -#define EXEC_PLUGIN_NAME_MAXLEN 31 -#define RECORD_DIR_MAXLEN 100 -#define EPG_TITLE_MAXLEN 50 +#define EXEC_PLUGIN_NAME_MAXLEN 256 +#define RECORD_DIR_MAXLEN 1024 +#define EPG_TITLE_MAXLEN 51 #define TIMERD_APIDS_CONF 0x00 #define TIMERD_APIDS_STD 0x01 @@ -68,7 +68,8 @@ class CTimerd TIMER_REMIND, TIMER_SLEEPTIMER, TIMER_EXEC_PLUGIN, - TIMER_IMMEDIATE_RECORD + TIMER_IMMEDIATE_RECORD, + TIMER_ADZAP }; enum CTimerEventStates diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 1c36a75a4..423d5c4f6 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -895,6 +895,14 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 *msg = NeutrinoMessages::EVT_HDMI_CEC_STANDBY; *data = 0; break; + case NeutrinoMessages::EVT_SET_MUTE : + *msg = NeutrinoMessages::EVT_SET_MUTE; + *data = *(char*) p; + break; + case NeutrinoMessages::EVT_SET_VOLUME : + *msg = NeutrinoMessages::EVT_SET_VOLUME; + *data = *(char*) p; + break; default: printf("[neutrino] event INITID_HTTPD - unknown eventID 0x%x\n", emsg.eventID ); } diff --git a/src/driver/record.cpp b/src/driver/record.cpp index e934b7c9b..586545ee3 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -143,25 +143,25 @@ int CRecordInstance::GetStatus() record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) { - int fd; - std::string tsfile; - time_t msg_start_time = time(0); CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_RECORDING_START)); if ((!(autoshift && g_settings.auto_timeshift)) && g_settings.recording_startstop_msg) hintBox.paint(); - tsfile = std::string(filename) + ".ts"; + wakeup_hdd(Directory.c_str()); + std::string tsfile = std::string(filename) + ".ts"; printf("%s: file %s vpid %x apid %x\n", __FUNCTION__, tsfile.c_str(), allpids.PIDs.vpid, apids[0]); - fd = open(tsfile.c_str(), O_CREAT | O_RDWR | O_LARGEFILE | O_TRUNC , S_IRWXO | S_IRWXG | S_IRWXU); + int fd = open(tsfile.c_str(), O_CREAT | O_RDWR | O_LARGEFILE | O_TRUNC , S_IRWXO | S_IRWXG | S_IRWXU); if(fd < 0) { perror(tsfile.c_str()); hintBox.hide(); return RECORD_INVALID_DIRECTORY; } + SaveXml(); + CGenPsi psi; numpids = 0; if (allpids.PIDs.vpid != 0){ @@ -219,16 +219,17 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) record = NULL; close(fd); unlink(tsfile.c_str()); + std::string xmlfile = std::string(filename) + ".xml"; + unlink(xmlfile.c_str()); hintBox.hide(); return RECORD_FAILURE; } -printf("CRecordInstance::Start: fe %d demux %d\n", frontend->getNumber(), channel->getRecordDemux()); + printf("CRecordInstance::Start: fe %d demux %d\n", frontend->getNumber(), channel->getRecordDemux()); if(!autoshift) CFEManager::getInstance()->lockFrontend(frontend, channel);//FIXME testing start_time = time(0); - SaveXml(); CCamManager::getInstance()->Start(channel->getChannelID(), CCamManager::RECORD); @@ -1360,7 +1361,7 @@ void CRecordManager::StartTimeshift() if(res) { CMoviePlayerGui::getInstance().exec(NULL, tmode); - if(g_settings.temp_timeshift && !g_settings.auto_timeshift) + if(g_settings.temp_timeshift && !g_settings.auto_timeshift && autoshift) ShowMenu(); } } diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index 60d453e65..6dbc7c84b 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -80,6 +80,15 @@ void CVolume::setvol(int vol) CZapit::getInstance()->SetVolume(vol); } +void CVolume::setVolumeExt(int vol) +{ + g_settings.current_volume = vol; + CZapit::getInstance()->SetVolume(vol); + CVFD::getInstance()->showVolume(vol); + if (CNeutrinoApp::getInstance()->isMuted() && vol > 0) + CAudioMute::getInstance()->AudioMute(false, true); +} + void CVolume::setVolume(const neutrino_msg_t key) { if (!g_RCInput) /* don't die... */ diff --git a/src/driver/volume.h b/src/driver/volume.h index ecf019734..430ed7444 100644 --- a/src/driver/volume.h +++ b/src/driver/volume.h @@ -48,6 +48,7 @@ class CVolume : public CChangeObserver void setvol(int vol); void setVolume(const neutrino_msg_t key); + void setVolumeExt(int vol); void SetCurrentPid(int pid) { apid = pid; } void SetCurrentChannel(t_channel_id id) { channel_id = id; } diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 43ac5e5d8..72985a68b 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -2327,6 +2327,24 @@ void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEve unlockEvents(); } +/* invalidate current/next events, if current event times expired */ +void CEitManager::checkCurrentNextEvent(void) +{ + time_t curtime = time(NULL); + writeLockEvents(); + if (scanning || !myCurrentEvent || myCurrentEvent->times.empty()) { + unlockEvents(); + return; + } + if ((long)(myCurrentEvent->times.begin()->startzeit + myCurrentEvent->times.begin()->dauer) < (long)curtime) { + delete myCurrentEvent; + myCurrentEvent = NULL; + delete myNextEvent; + myNextEvent = NULL; + } + unlockEvents(); +} + /* send back the current and next event for the channel id passed to it * Works like that: * - if the currently running program is requested, return myCurrentEvent and myNextEvent, @@ -2350,6 +2368,8 @@ void CEitManager::getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSecti uniqueServiceKey &= 0xFFFFFFFFFFFFULL; + checkCurrentNextEvent(); + readLockEvents(); /* if the currently running program is requested... */ if (uniqueServiceKey == messaging_current_servicekey) { @@ -2608,6 +2628,7 @@ bool CEitManager::getActualEPGServiceKey(const t_channel_id channel_id, CEPGData dprintf("[commandActualEPGchannelID] Request of current EPG for " PRINTF_CHANNEL_ID_TYPE "\n", channel_id); t_channel_id uniqueServiceKey = channel_id & 0xFFFFFFFFFFFFULL; + checkCurrentNextEvent(); readLockEvents(); if (uniqueServiceKey == messaging_current_servicekey) { if (myCurrentEvent) { diff --git a/src/eitd/sectionsd.h b/src/eitd/sectionsd.h index 3d3d398c1..fd81bc4f7 100644 --- a/src/eitd/sectionsd.h +++ b/src/eitd/sectionsd.h @@ -42,6 +42,7 @@ class CEitManager : public OpenThreads::Thread, public OpenThreads::Mutex static OpenThreads::Mutex m; static CEitManager * manager; + void checkCurrentNextEvent(void); CEitManager(); /* main thread function */ diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index a6f424b2a..48b208061 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -37,7 +37,7 @@ using namespace std; -CBuildInfo::CBuildInfo() : CComponentsWindow(1, 1, 700, 500, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) +CBuildInfo::CBuildInfo() : CComponentsWindow(0, 0, 700, 500, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) { initVarBuildInfo(); } @@ -45,10 +45,8 @@ CBuildInfo::CBuildInfo() : CComponentsWindow(1, 1, 700, 500, LOCALE_BUILDINFO_ME //init all var members void CBuildInfo::initVarBuildInfo() { - x = frameBuffer->getScreenWidth(true)/2 - width/2; - y = frameBuffer->getScreenHeight(true)/2 -height/2; - - append_v_offset = 1; + doCenter(); + font = NULL; setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); InitInfoItems(); diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 40e32cab6..c70d7cdcf 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2130,7 +2130,7 @@ void CChannelList::paintHead() if (g_Sectionsd->getIsTimeSet()) { if (headerClock == NULL) { - headerClock = new CComponentsFrmClock(0, 0, 0, 0, "%H:%M"); + headerClock = new CComponentsFrmClock(0, 0, 0, 0, "%H:%M", true); headerClock->setClockBlink("%H %M"); headerClock->setClockIntervall(1); diff --git a/src/gui/color.cpp b/src/gui/color.cpp index cc0d42f90..641ad3108 100644 --- a/src/gui/color.cpp +++ b/src/gui/color.cpp @@ -66,7 +66,7 @@ void recalcColor(unsigned char &orginal, int fade) color=255; if(color<0) color=0; - orginal = color; + orginal = (unsigned char)color; } void protectColor( unsigned char &r, unsigned char &g, unsigned char &b, bool protect ) @@ -89,130 +89,138 @@ void fadeColor(unsigned char &r, unsigned char &g, unsigned char &b, int fade, b protectColor(r,g,b, protect); } -unsigned char getBrightnessRGB(fb_pixel_t color) +uint8_t getBrightnessRGB(fb_pixel_t color) { RgbColor rgb; - rgb.r = (color & 0x00FF0000) >> 16; - rgb.g = (color & 0x0000FF00) >> 8; - rgb.b = color & 0x000000FF; + rgb.r = (uint8_t)((color & 0x00FF0000) >> 16); + rgb.g = (uint8_t)((color & 0x0000FF00) >> 8); + rgb.b = (uint8_t) (color & 0x000000FF); return rgb.r > rgb.g ? (rgb.r > rgb.b ? rgb.r : rgb.b) : (rgb.g > rgb.b ? rgb.g : rgb.b); } -fb_pixel_t changeBrightnessRGBRel(fb_pixel_t color, int br) +fb_pixel_t changeBrightnessRGBRel(fb_pixel_t color, int br, bool transp) { int br_ = (int)getBrightnessRGB(color); br_ += br; if (br_ < 0) br_ = 0; if (br_ > 255) br_ = 255; - return changeBrightnessRGB(color, (unsigned char)br_); + return changeBrightnessRGB(color, (uint8_t)br_, transp); } -void changeBrightnessRGBRel2(RgbColor *rgb, int br) +fb_pixel_t changeBrightnessRGB(fb_pixel_t color, uint8_t br, bool transp) { - fb_pixel_t color = (((rgb->r << 16) & 0x00FF0000) | - ((rgb->g << 8) & 0x0000FF00) | - ((rgb->b ) & 0x000000FF)); - int br_ = (int)getBrightnessRGB(color); - br_ += br; - if (br_ < 0) br_ = 0; - if (br_ > 255) br_ = 255; - HsvColor hsv; - Rgb2Hsv(rgb, &hsv); - hsv.v = br_; - Hsv2Rgb(&hsv, rgb); + uint8_t tr = SysColor2Hsv(color, &hsv); + hsv.v = (float)br / (float)255; + if (!transp) + tr = 0xFF; + return Hsv2SysColor(&hsv, tr); } -fb_pixel_t changeBrightnessRGB(fb_pixel_t color, unsigned char br) +fb_pixel_t Hsv2SysColor(HsvColor *hsv, uint8_t tr) { - HsvColor hsv; RgbColor rgb; - - unsigned char tr; - tr = (color & 0xFF000000) >> 24; - rgb.r = (color & 0x00FF0000) >> 16; - rgb.g = (color & 0x0000FF00) >> 8; - rgb.b = color & 0x000000FF; - - Rgb2Hsv(&rgb, &hsv); - hsv.v = br; - Hsv2Rgb(&hsv, &rgb); - + Hsv2Rgb(hsv, &rgb); return (((tr << 24) & 0xFF000000) | ((rgb.r << 16) & 0x00FF0000) | ((rgb.g << 8) & 0x0000FF00) | ((rgb.b ) & 0x000000FF)); } +uint8_t SysColor2Hsv(fb_pixel_t color, HsvColor *hsv) +{ + uint8_t tr; + RgbColor rgb; + tr = (uint8_t)((color & 0xFF000000) >> 24); + rgb.r = (uint8_t)((color & 0x00FF0000) >> 16); + rgb.g = (uint8_t)((color & 0x0000FF00) >> 8); + rgb.b = (uint8_t) (color & 0x000000FF); + Rgb2Hsv(&rgb, hsv); + return tr; +} + void Hsv2Rgb(HsvColor *hsv, RgbColor *rgb) { - unsigned char region, remainder, p, q, t; + float f_H = hsv->h; + float f_S = hsv->s; + float f_V = hsv->v; + if (f_S == 0) { + rgb->r = (uint8_t)(f_V * 255); + rgb->g = (uint8_t)(f_V * 255); + rgb->b = (uint8_t)(f_V * 255); - if (hsv->s == 0) { - rgb->r = hsv->v; - rgb->g = hsv->v; - rgb->b = hsv->v; - return; + } else { + float f_R; + float f_G; + float f_B; + float hh = f_H; + if (hh >= 360) hh = 0; + hh /= 60; + int i = (int)hh; + float ff = hh - (float)i; + float p = f_V * (1 - f_S); + float q = f_V * (1 - (f_S * ff)); + float t = f_V * (1 - (f_S * (1 - ff))); + + switch (i) { + case 0: + f_R = f_V; f_G = t; f_B = p; + break; + case 1: + f_R = q; f_G = f_V; f_B = p; + break; + case 2: + f_R = p; f_G = f_V; f_B = t; + break; + case 3: + f_R = p; f_G = q; f_B = f_V; + break; + case 4: + f_R = t; f_G = p; f_B = f_V; + break; + case 5: + default: + f_R = f_V; f_G = p; f_B = q; + break; + } + rgb->r = (uint8_t)(f_R * 255); + rgb->g = (uint8_t)(f_G * 255); + rgb->b = (uint8_t)(f_B * 255); } - - region = hsv->h / 43; - remainder = (hsv->h - (region * 43)) * 6; - - p = (hsv->v * (255 - hsv->s)) >> 8; - q = (hsv->v * (255 - ((hsv->s * remainder) >> 8))) >> 8; - t = (hsv->v * (255 - ((hsv->s * (255 - remainder)) >> 8))) >> 8; - - switch (region) { - case 0: - rgb->r = hsv->v; rgb->g = t; rgb->b = p; - break; - case 1: - rgb->r = q; rgb->g = hsv->v; rgb->b = p; - break; - case 2: - rgb->r = p; rgb->g = hsv->v; rgb->b = t; - break; - case 3: - rgb->r = p; rgb->g = q; rgb->b = hsv->v; - break; - case 4: - rgb->r = t; rgb->g = p; rgb->b = hsv->v; - break; - default: - rgb->r = hsv->v; rgb->g = p; rgb->b = q; - break; - } - - return; } void Rgb2Hsv(RgbColor *rgb, HsvColor *hsv) { - unsigned char rgbMin, rgbMax; + float f_R = (float)rgb->r / (float)255; + float f_G = (float)rgb->g / (float)255; + float f_B = (float)rgb->b / (float)255; - rgbMin = rgb->r < rgb->g ? (rgb->r < rgb->b ? rgb->r : rgb->b) : (rgb->g < rgb->b ? rgb->g : rgb->b); - rgbMax = rgb->r > rgb->g ? (rgb->r > rgb->b ? rgb->r : rgb->b) : (rgb->g > rgb->b ? rgb->g : rgb->b); + float min = f_R < f_G ? (f_R < f_B ? f_R : f_B) : (f_G < f_B ? f_G : f_B); + float max = f_R > f_G ? (f_R > f_B ? f_R : f_B) : (f_G > f_B ? f_G : f_B); + float delta = max - min; - hsv->v = rgbMax; - if (hsv->v == 0) { - hsv->h = 0; - hsv->s = 0; - return; + float f_V = max; + float f_H = 0; + float f_S = 0; + + if (delta == 0) { //gray + f_S = 0; + f_H = 0; + } else { + f_S = (delta / max); + if (f_R >= max) + f_H = (f_G - f_B) / delta; + else if (f_G >= max) + f_H = 2 + (f_B - f_R) / delta; + else + f_H = 4 + (f_R - f_G) / delta; + + f_H *= 60; + if (f_H < 0) + f_H += 360; } - - hsv->s = 255 * long(rgbMax - rgbMin) / hsv->v; - if (hsv->s == 0) { - hsv->h = 0; - return; - } - - if (rgbMax == rgb->r) - hsv->h = 0 + 43 * (rgb->g - rgb->b) / (rgbMax - rgbMin); - else if (rgbMax == rgb->g) - hsv->h = 85 + 43 * (rgb->b - rgb->r) / (rgbMax - rgbMin); - else - hsv->h = 171 + 43 * (rgb->r - rgb->g) / (rgbMax - rgbMin); - - return; + hsv->h = f_H; + hsv->s = f_S; + hsv->v = f_V; } diff --git a/src/gui/color.h b/src/gui/color.h index f25513b9b..a9a45313d 100644 --- a/src/gui/color.h +++ b/src/gui/color.h @@ -120,22 +120,24 @@ int convertSetupAlpha2Alpha(unsigned char alpha); void fadeColor(unsigned char &r, unsigned char &g, unsigned char &b, int fade, bool protect=true); typedef struct { - unsigned char r; - unsigned char g; - unsigned char b; + uint8_t r; + uint8_t g; + uint8_t b; } RgbColor; typedef struct { - unsigned char h; - unsigned char s; - unsigned char v; + float h; + float s; + float v; } HsvColor; -unsigned char getBrightnessRGB(fb_pixel_t color); +uint8_t getBrightnessRGB(fb_pixel_t color); -fb_pixel_t changeBrightnessRGBRel(fb_pixel_t color, int br); -fb_pixel_t changeBrightnessRGB(fb_pixel_t color, unsigned char br); -void changeBrightnessRGBRel2(RgbColor *rgb, int br); +fb_pixel_t changeBrightnessRGBRel(fb_pixel_t color, int br, bool transp=true); +fb_pixel_t changeBrightnessRGB(fb_pixel_t color, uint8_t br, bool transp=true); + +fb_pixel_t Hsv2SysColor(HsvColor *hsv, uint8_t tr=0xFF); +uint8_t SysColor2Hsv(fb_pixel_t color, HsvColor *hsv); void Hsv2Rgb(HsvColor *hsv, RgbColor *rgb); void Rgb2Hsv(RgbColor *rgb, HsvColor *hsv); diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index a2d688000..c9c49528a 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -56,8 +56,8 @@ void CComponents::clearSavedScreen() void CComponents::initVarBasic() { - x = saved_screen.x = 1; - y = saved_screen.y = 1; + x = saved_screen.x = 0; + y = saved_screen.y = 0; cc_xr = x; cc_yr = y; height = saved_screen.dy = CC_HEIGHT_MIN; diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 7ae3f9490..37bda8853 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -110,8 +110,8 @@ void CComponentsForm::initVarForm() //CComponentsForm v_cc_items.clear(); cc_item_type = CC_ITEMTYPE_FRM; - append_h_offset = 0; - append_v_offset = 0; + append_x_offset = 0; + append_y_offset = 0; } void CComponentsForm::addCCItem(CComponentsItem* cc_Item) @@ -303,7 +303,7 @@ void CComponentsForm::paintCCItems() //set required x-position to item: //append vertical if (xpos == CC_APPEND){ - auto_x += append_h_offset; + auto_x += append_x_offset; cc_item->setRealXPos(auto_x + xpos); auto_x += w_item; } @@ -320,7 +320,7 @@ void CComponentsForm::paintCCItems() //set required y-position to item //append hor if (ypos == CC_APPEND){ - auto_y += append_v_offset; + auto_y += append_y_offset; cc_item->setRealYPos(auto_y + ypos); auto_y += h_item; } diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index bbd60e263..d532cdbfc 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -39,8 +39,8 @@ class CComponentsForm : public CComponentsItem ///generates next possible index for an item, see also cc_item_index, getIndex(), setIndex() int genIndex(); - int append_h_offset; - int append_v_offset; + int append_x_offset; + int append_y_offset; public: CComponentsForm(); @@ -70,7 +70,7 @@ class CComponentsForm : public CComponentsItem ///return size (count) of available items virtual size_t size(){return v_cc_items.size();}; - virtual void setAppendOffset(const int &h_offset, const int& v_offset){append_h_offset = h_offset; append_v_offset = v_offset;}; + virtual void setAppendOffset(const int &x_offset, const int& y_offset){append_x_offset = x_offset; append_y_offset = y_offset;}; }; #endif diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index c3d6e6bfe..e329ed275 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -76,11 +76,10 @@ void CComponentsFrmClock::initVarClock( const int& x_pos, const int& y_pos, cons cl_thread = 0; cl_interval = 1; - activeClock = true; cl_blink_str = ""; paintClock = false; - activeClock = activ; + activeClock = activ; if (activeClock) startThread(); } @@ -373,3 +372,12 @@ Font** CComponentsFrmClock::getClockFont() return cl_font; } + +void CComponentsFrmClock::setClockActiv(bool activ/* = true*/) +{ + activeClock = activ; + if (activ && !cl_thread) + startThread(); + if (!activ && cl_thread) + stopThread(); +} diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index f9065f877..81e0e7a59 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -94,7 +94,7 @@ class CComponentsFrmClock : public CComponentsForm public: CComponentsFrmClock( const int& x_pos = 1, const int& y_pos = 1, const int& w = 200, const int& h = 48, - const char* format_str = "%H:%M", bool activ=true, bool has_shadow = CC_SHADOW_OFF, + const char* format_str = "%H:%M", bool activ=false, bool has_shadow = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); virtual ~CComponentsFrmClock(); @@ -134,7 +134,7 @@ class CComponentsFrmClock : public CComponentsForm virtual void refresh() { initCCLockItems(); } ///set clock activ/inactiv - virtual void setClockActiv(bool activ = true){activeClock = activ;}; + virtual void setClockActiv(bool activ = true); }; #endif diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index f03a2f37e..59d5c6154 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -27,7 +27,7 @@ #include #include -#include "cc_frm.h" +#include "cc_frm_footer.h" using namespace std; diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h new file mode 100644 index 000000000..dd96a02bd --- /dev/null +++ b/src/gui/components/cc_frm_footer.h @@ -0,0 +1,53 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + Classes for generic GUI-related components. + Copyright (C) 2012, 2013, 2014, Thilo Graf 'dbt' + + License: GPL + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef __CC_FORM_FOOTER_H__ +#define __CC_FORM_FOOTER_H__ + + +#include "cc_frm_header.h" + +/*! +CComponentsFooter, sub class of CComponentsHeader provides prepared container for footer +Is mostly usable like a header but without caption, and context button icons. +*/ +class CComponentsFooter : public CComponentsHeader +{ + protected: + void initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, + const int& buttons = 0, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + public: + CComponentsFooter(); + CComponentsFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, + const int& buttons = 0, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); +}; + +#endif diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 96b32f9c4..7756b269e 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -32,7 +32,7 @@ //! Sub class of CComponentsForm. Shows a header with prepared items. /*! -CComponentsHeader provides prepared items like icon, caption and context button icons +CComponentsHeader provides prepared items like icon, caption and context button icons, mostly for usage in menues or simple windows */ class CComponentsHeader : public CComponentsForm { @@ -176,9 +176,9 @@ class CComponentsHeader : public CComponentsForm virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; -//! Sub class of CComponentsHeader. Shows a header with prepared items. +//! Sub class of CComponentsHeader. /*! -CComponentsHeaderLocalized provides prepared items like icon, caption and context button icons +CComponentsHeaderLocalized provides prepared items like icon, caption and context button icons, mostly for usage in menues or simple windows Caption is defined with locales. */ class CComponentsHeaderLocalized : public CComponentsHeader @@ -194,28 +194,4 @@ class CComponentsHeaderLocalized : public CComponentsHeader fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); }; - -/*! -CComponentsFooter provides prepared container for footer -Is mostly usable like a header but without caption, and context button icons. -*/ -class CComponentsFooter : public CComponentsHeader -{ - protected: - void initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, - const int& buttons = 0, - bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, - fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); - public: - CComponentsFooter(); - CComponentsFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, - const int& buttons = 0, - bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, - fb_pixel_t color_body = COL_INFOBAR_SHADOW_PLUS_1, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); -}; - #endif diff --git a/src/gui/components/cc_frm_icons.cpp b/src/gui/components/cc_frm_icons.cpp index 1092491f2..aa6b84d92 100644 --- a/src/gui/components/cc_frm_icons.cpp +++ b/src/gui/components/cc_frm_icons.cpp @@ -35,36 +35,34 @@ using namespace std; //sub class CComponentsIconForm inherit from CComponentsForm CComponentsIconForm::CComponentsIconForm() { - initVarIconForm(); + initVarIconForm(1, 1, 0, 0, vector()); } - -CComponentsIconForm::CComponentsIconForm(const int x_pos, const int y_pos, const int w, const int h, const std::vector &v_icon_names, bool has_shadow, - fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) +CComponentsIconForm::CComponentsIconForm( const int &x_pos, const int &y_pos, const int &w, const int &h, + const std::vector &v_icon_names, + bool has_shadow, + fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) { - initVarIconForm(); + initVarIconForm(x_pos, y_pos, w, h, v_icon_names, has_shadow, color_frame, color_body, color_shadow); +} + +void CComponentsIconForm::initVarIconForm( const int &x_pos, const int &y_pos, const int &w, const int &h, + const std::vector &v_icon_names, + bool has_shadow, + fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) +{ + cc_item_type = CC_ITEMTYPE_FRM_ICONFORM; x = x_pos; y = y_pos; width = w; height = h; + v_icons = v_icon_names; shadow = has_shadow; col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; - - v_icons = v_icon_names; -} -void CComponentsIconForm::initVarIconForm() -{ - cc_item_type = CC_ITEMTYPE_FRM_ICONFORM; - - //set default width and height to 0, this causes a dynamic adaptation of width and height of form - width = 0; - height = 0; - - v_icons.clear(); ccif_offset = 2; ccif_icon_align = CC_ICONS_FRM_ALIGN_LEFT; } diff --git a/src/gui/components/cc_frm_icons.h b/src/gui/components/cc_frm_icons.h index c33755719..83b86c5f8 100644 --- a/src/gui/components/cc_frm_icons.h +++ b/src/gui/components/cc_frm_icons.h @@ -25,7 +25,6 @@ #define __CC_FORM_ICONS_H__ #include "cc_frm.h" -#include "cc_frm_icons.h" class CComponentsIconForm : public CComponentsForm { @@ -35,12 +34,20 @@ class CComponentsIconForm : public CComponentsForm void initMaxHeight(int *pheight); protected: - void initVarIconForm(); + void initVarIconForm( const int &x_pos, const int &y_pos, const int &w, const int &h, + const std::vector &v_icon_names, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); public: CComponentsIconForm(); - CComponentsIconForm(const int x_pos, const int y_pos, const int w, const int h, const std::vector &v_icon_names, bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + CComponentsIconForm( const int &x_pos, const int &y_pos, const int &w, const int &h, + const std::vector &v_icon_names, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); // ~CComponentsIconForm(); //inherited from CComponentsForm void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index df2e1d27d..1b2d21295 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -63,7 +63,7 @@ CSignalBar::CSignalBar(const int& xpos, const int& ypos, const int& w, const int void CSignalBar::initDimensions() { //set current required dimensions and font size - sb_item_height = max(height, SB_MIN_HEIGHT) - 2*fr_thickness - append_h_offset; + sb_item_height = max(height, SB_MIN_HEIGHT) - 2*fr_thickness - append_x_offset; sb_item_top = height/2 - sb_item_height/2; if (sb_scale_height == -1) sb_scale_height = sb_item_height; @@ -99,8 +99,8 @@ void CSignalBar::initVarSigBar() { corner_rad = 0; corner_type = 0; - append_h_offset = 2; - append_v_offset = 2; + append_x_offset = 2; + append_y_offset = 2; height = SB_MIN_HEIGHT; sb_scale_height = -1; @@ -148,9 +148,9 @@ void CSignalBar::initSBarValue() } //move and set dimensions - int vlbl_x = sb_scale->getXPos() + sb_scale_width + append_v_offset; + int vlbl_x = sb_scale->getXPos() + sb_scale_width + append_y_offset; int vlbl_h = sb_scale->getHeight(); - int vlbl_y = sb_item_height/2 + sb_item_top - vlbl_h/2 - append_h_offset; + int vlbl_y = sb_item_height/2 + sb_item_top - vlbl_h/2 - append_x_offset; sb_vlbl->setDimensionsAll(vlbl_x, vlbl_y, sb_vlbl_width, vlbl_h); //set current text and body color color @@ -176,7 +176,7 @@ void CSignalBar::initSBarName() //move and set dimensions int lbl_x = sb_vlbl->getXPos()+ sb_vlbl->getWidth(); int lbl_h = sb_vlbl->getHeight(); - int lbl_y = sb_item_height/2 + sb_item_top - lbl_h/2 - append_h_offset; + int lbl_y = sb_item_height/2 + sb_item_top - lbl_h/2 - append_x_offset; sb_lbl->setDimensionsAll(lbl_x, lbl_y, sb_lbl_width, lbl_h); //set current text and body color @@ -308,7 +308,7 @@ void CSignalBox::initSignalItems() // int corr_y = sbx_bar_height%2; // int sb_h = sbx_bar_height - corr_y; - int sbar_h = sbx_bar_height - fr_thickness - append_v_offset/2; + int sbar_h = sbx_bar_height - fr_thickness - append_y_offset/2; int sbar_w = sbx_bar_width - 2*fr_thickness; int sbar_x = sbx_bar_x + fr_thickness; int scale_h = sbar_h * 76 / 100; diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index cdc596f99..f5021d580 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -63,11 +63,24 @@ CComponentsWindow::CComponentsWindow( const int& x_pos, const int& y_pos, const initVarWindow(x_pos, y_pos, w, h, caption, iconname, has_shadow, color_frame, color_body, color_shadow); } -CComponentsWindowMax::CComponentsWindowMax(const string& caption, const string& iconname) - :CComponentsWindow(0, 0, 0, 0, caption, iconname){}; +CComponentsWindowMax::CComponentsWindowMax( const string& caption, + const string& iconname, + bool has_shadow, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow) + :CComponentsWindow(0, 0, 0, 0, caption, + iconname, has_shadow, color_frame, color_body, color_shadow){}; -CComponentsWindowMax::CComponentsWindowMax(neutrino_locale_t locale_caption, const string& iconname) - :CComponentsWindow(0, 0, 0, 0, locale_caption != NONEXISTANT_LOCALE ? g_Locale->getText(locale_caption) : "", iconname){}; +CComponentsWindowMax::CComponentsWindowMax( neutrino_locale_t locale_caption, + const string& iconname, + bool has_shadow, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow) + :CComponentsWindow(0, 0, 0, 0, + locale_caption != NONEXISTANT_LOCALE ? g_Locale->getText(locale_caption) : "", + iconname, has_shadow, color_frame, color_body, color_shadow){}; void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const int& w, const int& h, const string& caption, @@ -80,13 +93,14 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const //CComponentsForm cc_item_type = CC_ITEMTYPE_FRM_WINDOW; - //using current screen settings for default dimensions, do use full screen if default values for width/height = 0 - int w_tmp = frameBuffer->getScreenWidth(w == 0 ? true : false); - int h_tmp = frameBuffer->getScreenHeight(h == 0 ? true : false); - width = w == 0 ? w_tmp : w; - height = h == 0 ? h_tmp : h; - x = x_pos; - y = y_pos; + //using current screen settings for default dimensions, + //do use full screen (from osd-settings) if default values for width/height = 0 + x = x_pos; + y = y_pos; + width = w; + height = h; + initWindowSize(); + initWindowPos(); ccw_caption = caption; ccw_icon_name = iconname; @@ -110,9 +124,31 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const initCCWItems(); } +void CComponentsWindow::initWindowSize() +{ + if (cc_parent) + return; + + if (width == 0) + width = frameBuffer->getScreenWidth(); + if (height == 0) + height = frameBuffer->getScreenHeight(); +} + +void CComponentsWindow::initWindowPos() +{ + if (cc_parent) + return; + + if (x == 0) + x = frameBuffer->getScreenX(); + if (y == 0) + y = frameBuffer->getScreenY(); +} + void CComponentsWindow::doCenter(){ - x = cc_parent ? cc_parent->getWidth() - width/2 : frameBuffer->getScreenWidth(true)/2 - width/2; - y = cc_parent ? cc_parent->getHeight() - height/2 : frameBuffer->getScreenHeight(true)/2 -height/2; + x = cc_parent ? cc_parent->getWidth() - width/2 : getScreenStartX(width); + y = cc_parent ? cc_parent->getHeight() - height/2 : getScreenStartY(height); } void CComponentsWindow::setWindowCaption(neutrino_locale_t locale_text, const int& align_mode) @@ -129,7 +165,7 @@ void CComponentsWindow::initHeader() //set header properties //TODO: assigned properties with internal header objekt have no effect! if (ccw_head){ ccw_head->setWidth(width-2*fr_thickness); -// ccw_head->setPos(0, 0); + ccw_head->setPos(0, 0); ccw_head->setIcon(ccw_icon_name); ccw_head->setCaption(ccw_caption, ccw_align_mode); ccw_head->setDefaultButtons(ccw_buttons); @@ -176,10 +212,6 @@ void CComponentsWindow::initCCWItems() #ifdef DEBUG_CC printf("[CComponentsWindow] [%s - %d] init items...\n", __func__, __LINE__); #endif - initHeader(); - initFooter(); - initBody(); - //add/remove header if required if (ccw_show_header){ initHeader(); @@ -200,6 +232,8 @@ void CComponentsWindow::initCCWItems() } } + initBody(); + //add header, body and footer items only one time if (ccw_head) if (!ccw_head->isAdded()) diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index 43e22724f..d658bd090 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -27,6 +27,7 @@ #include "cc_frm.h" #include "cc_frm_icons.h" #include "cc_frm_header.h" +#include "cc_frm_footer.h" //! Sub class of CComponentsForm. Shows a window with prepared items. /*! @@ -91,6 +92,10 @@ class CComponentsWindow : public CComponentsForm fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); ///allow centering of window on screen, mostly senseful for window object without parent void doCenter(); + ///initialize width and height + void initWindowSize(); + ///initialize position + void initWindowPos(); public: enum @@ -158,13 +163,19 @@ class CComponentsWindow : public CComponentsForm class CComponentsWindowMax : public CComponentsWindow { public: - ///simple constructor for CComponentsWindow, provides parameters for caption as string and icon, position of window is general centered and bound - ///to current screen settings, this shows a window over full screen - CComponentsWindowMax(const std::string& caption, const std::string& iconname = ""); + ///simple constructor for CComponentsWindow, provides parameters for caption as string and icon, this shows a centered window based up current screen settings + CComponentsWindowMax( const std::string& caption, const std::string& iconname = "", + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); - ///simple constructor for CComponentsWindow, provides parameters for caption from locales and icon, position of window is general centered and bound - ///to current screen settings, this shows a window over full screen - CComponentsWindowMax(neutrino_locale_t locale_caption, const std::string& iconname = ""); + ///simple constructor for CComponentsWindow, provides parameters for caption from locales and icon, this shows a centered window based up current screen settings + CComponentsWindowMax( neutrino_locale_t locale_caption, const std::string& iconname = "", + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); }; #endif diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index ea9e661e3..94f7af613 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -40,26 +40,32 @@ using namespace std; //------------------------------------------------------------------------------------------------------- //sub class CComponentsPicture from CComponentsItem -CComponentsPicture::CComponentsPicture( const int x_pos, const int y_pos, const int w, const int h, - const std::string& image_name, const int alignment, bool has_shadow, +CComponentsPicture::CComponentsPicture( const int &x_pos, const int &y_pos, const int &w, const int &h, + const std::string& image_name, const int &alignment, bool has_shadow, fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) { - init(x_pos, y_pos, image_name, alignment, has_shadow, color_frame, color_background, color_shadow); - - width = w; - height = h; - pic_paint_mode = CC_PIC_IMAGE_MODE_AUTO, - - initVarPicture(); + init(x_pos, y_pos, w, h, image_name, alignment, has_shadow, color_frame, color_background, color_shadow); } -void CComponentsPicture::init( int x_pos, int y_pos, const string& image_name, const int alignment, bool has_shadow, +void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, const int &h, const string& image_name, const int &alignment, bool has_shadow, fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) { //CComponents, CComponentsItem cc_item_type = CC_ITEMTYPE_PICTURE; + //CComponents + x = pic_x = x_pos; + y = pic_y = y_pos; + height = h; + width = w; + shadow = has_shadow; + shadow_w = SHADOW_OFFSET; + col_frame = color_frame; + col_body = color_background; + col_shadow = color_shadow; + //CComponentsPicture + pic_paint_mode = CC_PIC_IMAGE_MODE_AUTO, pic_name = image_name; pic_align = alignment; pic_offset = 1; @@ -72,33 +78,24 @@ void CComponentsPicture::init( int x_pos, int y_pos, const string& image_name, c if (pic_name.empty()) pic_width = pic_height = 0; - //CComponents - x = pic_x = x_pos; - y = pic_y = y_pos; - height = 0; - width = 0; - shadow = has_shadow; - shadow_w = SHADOW_OFFSET; - col_frame = color_frame; - col_body = color_background; - col_shadow = color_shadow; + initCCItem(); } void CComponentsPicture::setPicture(const std::string& picture_name) { pic_name = picture_name; - initVarPicture(); + initCCItem(); } void CComponentsPicture::setPictureAlign(const int alignment) { - pic_align = alignment; - initVarPicture(); + pic_align = alignment; + initCCItem(); } -void CComponentsPicture::initVarPicture() +void CComponentsPicture::initCCItem() { pic_width = pic_height = 0; pic_painted = false; @@ -146,6 +143,11 @@ void CComponentsPicture::initVarPicture() int sw = (shadow ? shadow_w :0); width = max(max(pic_width, pic_max_w), width) + sw ; height = max(max(pic_height, pic_max_h), height) + sw ; + +#ifdef DEBUG_CC + printf("[CComponentsPicture] %s initialized Image: ====>> %s\n\titem x = %d\n\tdx = %d (image dx = %d)\n\titem y = %d\n\titem dy = %d (image dy = %d)\n", + __func__, pic_name.c_str(), x, width, pic_width, y, height, pic_height); +#endif } void CComponentsPicture::initPosition() @@ -181,7 +183,7 @@ void CComponentsPicture::paintPicture() if (do_paint && cc_allow_paint){ #ifdef DEBUG_CC - printf(" [CComponentsPicture] %s: paint image: %s (do_paint=%d)\n", __func__, pic_name.c_str(), do_paint); + printf(" [CComponentsPicture] %s: paint image: %s (do_paint=%d) with mode %d\n", __func__, pic_name.c_str(), do_paint, pic_paint_mode); #endif if (pic_paint_mode == CC_PIC_IMAGE_MODE_OFF) pic_painted = frameBuffer->paintIcon(pic_name, pic_x, pic_y, 0 /*pic_max_h*/, pic_offset, pic_paint, pic_paintBg, col_body); @@ -195,7 +197,7 @@ void CComponentsPicture::paintPicture() void CComponentsPicture::paint(bool do_save_bg) { - initVarPicture(); + initCCItem(); paintInit(do_save_bg); paintPicture(); } @@ -207,9 +209,9 @@ void CComponentsPicture::hide(bool no_restore) } -CComponentsChannelLogo::CComponentsChannelLogo( const int x_pos, const int y_pos, const int w, const int h, +CComponentsChannelLogo::CComponentsChannelLogo( const int &x_pos, const int &y_pos, const int &w, const int &h, const uint64_t& channelId, const std::string& channelName, - const int alignment, bool has_shadow, + const int &alignment, bool has_shadow, fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow) :CComponentsPicture(x_pos, y_pos, w, h, "", alignment, has_shadow, @@ -246,11 +248,11 @@ void CComponentsChannelLogo::initVarPictureChannellLogo() if (!has_logo) pic_name = tmp_logo; -// #ifdef DEBUG_CC +#ifdef DEBUG_CC printf("\t[CComponentsChannelLogo] %s: init image: %s (has_logo=%d, channel_id=%" PRIu64 ")\n", __func__, pic_name.c_str(), has_logo, channel_id); -// #endif +#endif - initVarPicture(); + initCCItem(); } void CComponentsChannelLogo::paint(bool do_save_bg) diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index dd45ec449..0b2710be9 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -43,9 +43,6 @@ Picture is usable like each other CCItems. class CComponentsPicture : public CComponentsItem { protected: - ///initialize all required attributes - void initVarPicture(); - ///some internal modes for icon and image handling enum { @@ -62,25 +59,36 @@ class CComponentsPicture : public CComponentsItem bool pic_paint, pic_paintBg, pic_painted, do_paint; int pic_align, pic_x, pic_y, pic_width, pic_height; int pic_max_w, pic_max_h, pic_paint_mode; - - void init( const int x_pos, const int y_pos, const std::string& image_name, const int alignment, bool has_shadow, - fb_pixel_t color_frame, fb_pixel_t color_background, fb_pixel_t color_shadow); - + + void init( const int &x_pos, const int &y_pos, const int &w, const int &h, + const std::string& image_name, + const int &alignment, + bool has_shadow, + fb_pixel_t color_frame, + fb_pixel_t color_background, + fb_pixel_t color_shadow); + + ///initialize all required attributes + void initCCItem(); ///initialize position of picture object dependendly from settings void initPosition(); void paintPicture(); - + public: - CComponentsPicture( const int x_pos, const int y_pos, const int w, const int h, - const std::string& image_name, const int alignment = CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); - + CComponentsPicture( const int &x_pos, const int &y_pos, const int &w, const int &h, + const std::string& image_name, + const int &alignment = CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_background = 0, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + virtual inline void setPictureOffset(const unsigned char offset){pic_offset = offset;}; virtual inline void setPicturePaint(bool paint_p){pic_paint = paint_p;}; virtual inline void setPicturePaintBackground(bool paintBg){pic_paintBg = paintBg;}; virtual void setPicture(const std::string& picture_name); virtual void setPictureAlign(const int alignment); - + virtual inline bool isPicPainted(){return pic_painted;}; virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); virtual void hide(bool no_restore = false); @@ -101,10 +109,14 @@ class CComponentsChannelLogo : public CComponentsPicture, CPictureViewer bool has_logo; public: - CComponentsChannelLogo( const int x_pos, const int y_pos, const int w, const int h, - const uint64_t& channelId =0, const std::string& channelName = "", - const int alignment = CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + CComponentsChannelLogo( const int &x_pos, const int &y_pos, const int &w, const int &h, + const uint64_t& channelId =0, + const std::string& channelName = "", + const int &alignment = CC_ALIGN_HOR_CENTER | CC_ALIGN_VER_CENTER, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_background = 0, + fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); void setChannel(const uint64_t& channelId, const std::string& channelName); void setPicture(const std::string& picture_name); diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 2c68707e1..1683fae10 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -36,6 +36,8 @@ #include #include #include +#include +#include #include #include @@ -436,19 +438,25 @@ static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) { return a.startTime< b.startTime; } - +bool CEpgData::isCurrentEPG(const t_channel_id channel_id) +{ + t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + if(( epg_done!= -1 ) && live_channel_id == channel_id){ + return true; + } + return false; +} int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_startzeit, bool doLoop, bool callFromfollowlist ) { int res = menu_return::RETURN_REPAINT; - static uint64_t id; - static time_t startzeit; + static uint64_t id = 0; + static time_t startzeit = 0; call_fromfollowlist = callFromfollowlist; if (a_startzeit) startzeit=*a_startzeit; id=a_id; - int height; - height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); + int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); GetEPGData(channel_id, id, &startzeit ); if (doLoop) @@ -470,7 +478,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start hide(); return res; } - // Calculate offset for the title when logo appears. int pic_offx = 0; std::string lname; @@ -653,29 +660,10 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start int showPos = 0; textCount = epgText.size(); showText(showPos, sy + toph); - + bool wzap = isCurrentEPG(channel_id); // show Timer Event Buttons - showTimerEventBar (true); - - //show Content&Component for Dolby & 16:9 - int dummy_h,dummy_w; - frameBuffer->getIconSize(NEUTRINO_ICON_16_9_GREY, &dummy_w, &dummy_h); - if (dummy_h == 16 && dummy_w == 26){ // show only standard icon size - if (hasComponentTags) - { - for (unsigned int i=0; i< tags.size(); i++) - { - if ( tags[i].streamContent == 1 && (tags[i].componentType == 2 || tags[i].componentType == 3) ) - { - frameBuffer->paintIcon(NEUTRINO_ICON_16_9 ,ox+sx-(ICON_LARGE_WIDTH+2)-(ICON_LARGE_WIDTH+2),sy + oy+5 ); - } - else if ( tags[i].streamContent == 2 && tags[i].componentType == 5 ) - { - frameBuffer->paintIcon(NEUTRINO_ICON_DD, ox+sx-(ICON_LARGE_WIDTH+2), sy + oy+5); - } - } - } - } + showTimerEventBar (true,wzap); + //show progressbar if ( epg_done!= -1 ) { @@ -784,6 +772,29 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start else showText(showPos, sy + toph); break; + case CRCInput::RC_page_up: + if(isCurrentEPG(channel_id)){ + if(g_settings.wzap_time> 14) + g_settings.wzap_time+=5; + else + g_settings.wzap_time++; + if(g_settings.wzap_time>60) + g_settings.wzap_time = 0; + showTimerEventBar(true, true); + } + break; + case CRCInput::RC_page_down: + if(isCurrentEPG(channel_id)){ + if(g_settings.wzap_time> 19) + g_settings.wzap_time-=5; + else + g_settings.wzap_time--; + + if(g_settings.wzap_time<0) + g_settings.wzap_time = 60; + showTimerEventBar(true, true); + } + break; // 31.05.2002 dirch record timer case CRCInput::RC_red: @@ -871,12 +882,18 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start { //CTimerdClient timerdclient; if (g_Timerd->isTimerdAvailable()) - { - g_Timerd->addZaptoTimerEvent(channel_id, + { + if(!g_Timerd->adzap_eventID && g_settings.wzap_time && isCurrentEPG(channel_id)){ + g_Timerd->addAdZaptoTimerEvent(channel_id, + time (NULL) + (g_settings.wzap_time * 60)); + loop = false; + }else{ + g_Timerd->addZaptoTimerEvent(channel_id, epgData.epg_times.startzeit - (g_settings.zapto_pre_time * 60), epgData.epg_times.startzeit - ANNOUNCETIME - (g_settings.zapto_pre_time * 60), 0, epgData.eventID, epgData.epg_times.startzeit, 0); - ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + ShowMsg(LOCALE_TIMER_EVENTTIMED_TITLE, LOCALE_TIMER_EVENTTIMED_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + } timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else @@ -1139,7 +1156,7 @@ const struct button_label EpgButtons[] = }; -void CEpgData::showTimerEventBar (bool pshow) +void CEpgData::showTimerEventBar (bool pshow, bool webzap) { int x,y,h,fh; @@ -1159,13 +1176,18 @@ void CEpgData::showTimerEventBar (bool pshow) return; } frameBuffer->paintBoxRel(sx,y,ox,h, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM);//round - /* 2 * ICON_LARGE_WIDTH for potential 16:9 and DD icons */ int aw = ox - 20 - 2 * (ICON_LARGE_WIDTH + 2); + std::string tmp_but_name; + if(g_settings.wzap_time && webzap && !g_Timerd->adzap_eventID){ + tmp_but_name = g_Locale->getText(LOCALE_ADZAP); + tmp_but_name += " "+ to_string(g_settings.wzap_time) + " "; + tmp_but_name += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); + } if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) - ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 3:2, EpgButtons, aw, h); + ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 3:2, EpgButtons, aw, h,"",false,COL_INFOBAR_SHADOW_TEXT,tmp_but_name.empty() ? NULL:tmp_but_name.c_str(),1); else - ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 2:1, &EpgButtons[1], aw, h); + ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 2:1, &EpgButtons[1], aw, h,"",false,COL_INFOBAR_SHADOW_TEXT,tmp_but_name.empty() ? NULL:tmp_but_name.c_str(),0); #if 0 // Button: Timer Record & Channelswitch diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 7492a79b3..c15b00f5d 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -87,7 +87,8 @@ class CEpgData void showText( int startPos, int ypos ); bool hasFollowScreenings(const t_channel_id channel_id, const std::string & title); int FollowScreenings(const t_channel_id channel_id, const std::string & title); - void showTimerEventBar(bool show); + void showTimerEventBar(bool show, bool webzap=false); + bool isCurrentEPG(const t_channel_id channel_id); public: diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index b6aea2b14..de70b0111 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -74,11 +74,11 @@ const CMenuOptionChooser::keyval HDD_FILESYS_OPTIONS[HDD_FILESYS_OPTION_COUNT] = { 1, LOCALE_HDD_REISER }, { 2, LOCALE_OPTIONS_OFF } }; -#define HDD_SLEEP_OPTION_COUNT 7 +#define HDD_SLEEP_OPTION_COUNT 6 const CMenuOptionChooser::keyval HDD_SLEEP_OPTIONS[HDD_SLEEP_OPTION_COUNT] = { { 0, LOCALE_OPTIONS_OFF }, - { 12, LOCALE_HDD_1MIN }, + //{ 12, LOCALE_HDD_1MIN }, { 60, LOCALE_HDD_5MIN }, { 120, LOCALE_HDD_10MIN }, { 240, LOCALE_HDD_20MIN }, @@ -291,6 +291,9 @@ int CHDDDestExec::exec(CMenuTarget* /*parent*/, const std::string&) const char hdidle[] = "/sbin/hd-idle"; bool have_hdidle = !access(hdidle, X_OK); + if (g_settings.hdd_sleep < 60) + g_settings.hdd_sleep = 60; + if (have_hdidle) { system("kill $(pidof hd-idle)"); int sleep_seconds = g_settings.hdd_sleep; @@ -675,7 +678,11 @@ _remount: #ifndef ASSUME_MDEV f = fopen("/proc/sys/kernel/hotplug", "w"); if(f) { +#ifdef ASSUME_MDEV + fprintf(f, "/sbin/mdev\n"); +#else fprintf(f, "/sbin/hotplug\n"); +#endif fclose(f); } #else diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 4d980e519..297334d67 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -181,7 +181,7 @@ void CImageInfo::ShowWindow() { CComponentsFooter *footer = NULL; if (cc_win == NULL){ - cc_win = new CComponentsWindowMax(LOCALE_IMAGEINFO_HEAD, NEUTRINO_ICON_INFO); + cc_win = new CComponentsWindowMax(LOCALE_IMAGEINFO_HEAD, NEUTRINO_ICON_INFO, CC_SHADOW_ON); cc_win->setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); footer = cc_win->getFooterObject(); footer->setColorBody(COL_INFOBAR_SHADOW_PLUS_1); diff --git a/src/gui/imageinfo.h b/src/gui/imageinfo.h index 46e7615eb..150c6dc9e 100644 --- a/src/gui/imageinfo.h +++ b/src/gui/imageinfo.h @@ -63,7 +63,7 @@ class CImageInfo : public CMenuTarget std::string getLicenseText(); void ShowWindow(); void ScrollLic(bool scrollDown); - + CComponentsWindowMax *cc_win; CComponentsForm *cc_info; CComponentsPIP *cc_tv; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index ceec4b7ed..2c99bed85 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -228,10 +228,15 @@ void CInfoViewer::start () ChanNameY = BoxStartY + (ChanHeight / 2) + SHADOW_OFFSET; //oberkante schatten? ChanInfoX = BoxStartX + (ChanWidth / 3); - time_height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getHeight()+5; + time_height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getHeight(); time_left_width = 2 * g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getWidth(); /* still a kludge */ time_dot_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(":"); time_width = time_left_width* 2+ time_dot_width; + + if (clock) { + delete clock; + clock = NULL; + } } void CInfoViewer::changePB() @@ -266,7 +271,6 @@ void CInfoViewer::paintTime (bool show_dot) if (clock == NULL){ clock = new CComponentsFrmClock(); clock->doPaintBg(false); - clock->setClockActiv(false); } clock->setColorBody(COL_INFOBAR_PLUS_0); @@ -513,6 +517,7 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe infoViewerBB->is_visible = true; ChannelName = Channel; + t_channel_id old_channel_id = channel_id; channel_id = Channel_Id; /* showChannelLogo() changes this, so better reset it every time... */ @@ -592,6 +597,7 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe loop(show_dot); aspectRatio = 0; fileplay = 0; + channel_id = old_channel_id; } void CInfoViewer::reset_allScala() @@ -777,8 +783,11 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con if(ChannelName.empty()) chann_size = 1; chname_width += (chname_width/chann_size/2); + + int tmpY = ((ChanNameY + time_height) - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getDigitOffset() + + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getDigitOffset()); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString( - ChanNameX + 10 + ChanNumWidth + chname_width, ChanNameY + time_height -SHADOW_OFFSET/2, + ChanNameX + 10 + ChanNumWidth + chname_width, tmpY, BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 - ChanNumWidth - chname_width, prov_name, color /*COL_INFOBAR_TEXT*/, 0, true); // UTF-8 } @@ -933,7 +942,8 @@ void CInfoViewer::loop(bool show_dot) res = messages_return::cancel_info; } } - } else if (fileplay && !CMoviePlayerGui::getInstance().timeshift /* && ( (msg == (neutrino_msg_t) g_settings.mpkey_pause) || (msg == (neutrino_msg_t) g_settings.mpkey_rewind) || (msg == (neutrino_msg_t) g_settings.mpkey_play) || (msg == (neutrino_msg_t) g_settings.mpkey_forward) || (msg == (neutrino_msg_t) g_settings.mpkey_stop)) */ ) { + } else if (fileplay || CMoviePlayerGui::getInstance().timeshift) { + /* this debug message will only hit in movieplayer mode, where console is * spammed to death anyway... */ printf("%s:%d msg:%08lx, data: %08lx\n", __func__, __LINE__, (long)msg, (long)data); @@ -951,6 +961,7 @@ void CInfoViewer::loop(bool show_dot) CMoviePlayerGui::getInstance().start_timeshift = false; } #endif +#if 0 else if (CMoviePlayerGui::getInstance().timeshift && ((msg == (neutrino_msg_t) g_settings.mpkey_rewind) || \ (msg == (neutrino_msg_t) g_settings.mpkey_forward) || \ (msg == (neutrino_msg_t) g_settings.mpkey_pause) || \ @@ -961,6 +972,7 @@ void CInfoViewer::loop(bool show_dot) g_RCInput->postMsg (msg, data); res = messages_return::cancel_info; } +#endif } if (hideIt) { @@ -1283,8 +1295,9 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data) } else if (data == lcdUpdateTimer) { //printf("CInfoViewer::handleMsg: lcdUpdateTimer\n"); if (is_visible) { - if (fileplay) { + if (fileplay || CMoviePlayerGui::getInstance().timeshift) CMoviePlayerGui::getInstance().UpdatePosition(); + if (fileplay) { char runningRest[32]; // %d can be 10 digits max... int curr_pos = CMoviePlayerGui::getInstance().GetPosition(); int duration = CMoviePlayerGui::getInstance().GetDuration(); @@ -1553,17 +1566,17 @@ void CInfoViewer::display_Info(const char *current, const char *next, pb_shadow = 0; timescale->setShadowOnOff(false); } + int tmpY = CurrInfoY - height - ChanNameY + time_height - + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getDigitOffset()/3; switch(g_settings.infobar_progressbar) //set progressbar position { case SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_BELOW_CH_NAME: - pb_starty = CurrInfoY - ((pb_h * 2) + (pb_h / 6)) ; pb_h = (pb_h/3); -// pb_color = 0; + pb_starty = ChanNameY + (tmpY-pb_h)/2; break; case SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_BELOW_CH_NAME_SMALL: - pb_starty = CurrInfoY - ((pb_h * 2) + (pb_h / 5)) ; pb_h = (pb_h/5); -// pb_color = 0; + pb_starty = ChanNameY + (tmpY-pb_h)/2; break; case SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_BETWEEN_EVENTS: pb_starty = CurrInfoY + ((pb_h / 3)-(pb_h/5)) ; diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 5ea5dd0fd..ec54bfa19 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -963,6 +963,10 @@ int CLuaInstance::MenuAddItem(lua_State *L) options_count++; } lua_pop(L, 1); + if (options_count == 0) { + m->m->addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, "ERROR! (options_count)", NONEXISTANT_LOCALE)); + return 0; + } CMenuOptionChooser::keyval_ext *kext = (CMenuOptionChooser::keyval_ext *)calloc(options_count, sizeof(CMenuOptionChooser::keyval_ext)); m->tofree.push_back(kext); @@ -1224,7 +1228,7 @@ int CLuaInstance::MessageboxExec(lua_State *L) const char *val = lua_tostring(L, -2); table_key mb[] = { { "center1", CMessageBox::mbBtnAlignCenter1 }, - { "center2", CMessageBox::mbBtnAlignCenter1 }, + { "center2", CMessageBox::mbBtnAlignCenter2 }, { "left", CMessageBox::mbBtnAlignLeft }, { "right", CMessageBox::mbBtnAlignRight }, { NULL, 0 } diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 3871aef22..6acd8b237 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -72,7 +72,6 @@ extern cVideo * videoDecoder; extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern CInfoClock *InfoClock; -extern bool has_hdd; #define TIMESHIFT_SECONDS 3 @@ -383,8 +382,7 @@ bool CMoviePlayerGui::SelectFile() full_name = ""; printf("CMoviePlayerGui::SelectFile: isBookmark %d timeshift %d isMovieBrowser %d\n", isBookmark, timeshift, isMovieBrowser); - if (has_hdd) - wakeup_hdd(g_settings.network_nfs_recordingdir.c_str()); + wakeup_hdd(g_settings.network_nfs_recordingdir.c_str()); if (timeshift) { t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); @@ -535,6 +533,7 @@ void CMoviePlayerGui::PlayFile(void) //CTimeOSD FileTime; position = 0, duration = 0; + speed = 1; playstate = CMoviePlayerGui::STOPPED; printf("Startplay at %d seconds\n", startposition/1000); @@ -601,7 +600,13 @@ void CMoviePlayerGui::PlayFile(void) /* playback->Start() starts paused */ if(timeshift == 3) { + speed = -1; playback->SetSpeed(-1); + playstate = CMoviePlayerGui::REW; + if (!FileTime.IsVisible() && !time_forced) { + FileTime.switchMode(position, duration); + time_forced = true; + } } else if(!timeshift || !g_settings.timeshift_pause) { playback->SetSpeed(1); } diff --git a/src/gui/personalize.cpp b/src/gui/personalize.cpp index f8c9b2584..9aaac7edf 100644 --- a/src/gui/personalize.cpp +++ b/src/gui/personalize.cpp @@ -195,8 +195,6 @@ const CMenuOptionChooser::keyval PERSONALIZE_PROTECT_MODE_OPTIONS[CPersonalizeGu { CPersonalizeGui::PERSONALIZE_PROTECT_MODE_PIN_PROTECTED , LOCALE_PERSONALIZE_PINPROTECT },// The menu/option is protected by a PIN }; - - CPersonalizeGui::CPersonalizeGui() : CPINProtection(g_settings.personalize_pincode) { width = 0; @@ -453,7 +451,17 @@ void CPersonalizeGui::ShowUserMenu(CMenuWidget* p_widget, vectoraddItem(GenericMenuSeparatorLine); + p_widget->addItem(GenericMenuSeparator); p_widget->addItem(new CMenuOptionChooser(LOCALE_PERSONALIZE_USERMENU_SHOW_CANCEL, &g_settings.personalize[SNeutrinoSettings::P_UMENU_SHOW_CANCEL], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); + + pluginSelectionMenu = new CMenuWidget(LOCALE_PERSONALIZE_USERMENU_PLUGIN_TYPES, NEUTRINO_ICON_SETTINGS); + pluginSelectionMenu->addIntroItems(LOCALE_MAINMENU_SETTINGS); + pluginSelectionMenu->addItem(new CMenuOptionChooser(LOCALE_MAINMENU_GAMES, &g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_GAMES], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); + pluginSelectionMenu->addItem(new CMenuOptionChooser(LOCALE_MAINMENU_TOOLS, &g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_TOOLS], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); + pluginSelectionMenu->addItem(new CMenuOptionChooser(LOCALE_MAINMENU_SCRIPTS, &g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_SCRIPTS], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); + pluginSelectionMenu->addItem(new CMenuOptionChooser(LOCALE_MAINMENU_LUA, &g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_LUA], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); + + p_widget->addItem(new CMenuForwarder(LOCALE_PERSONALIZE_USERMENU_PLUGIN_TYPES, true, NULL, pluginSelectionMenu)); } diff --git a/src/gui/personalize.h b/src/gui/personalize.h index cb537d4b4..817176cb9 100644 --- a/src/gui/personalize.h +++ b/src/gui/personalize.h @@ -146,6 +146,7 @@ class CPersonalizeGui : public CMenuTarget, public CChangeObserver, public CPINP CMenuWidget* fkeyMenu; CMenuWidget* plMenu; CMenuWidget* tmpW; + CMenuWidget *pluginSelectionMenu; int width, widget_count, shortcut, options_count; bool show_usermenu, show_pin_setup; diff --git a/src/gui/pluginlist.cpp b/src/gui/pluginlist.cpp index 4d3434d47..990f59f70 100644 --- a/src/gui/pluginlist.cpp +++ b/src/gui/pluginlist.cpp @@ -134,6 +134,8 @@ int CPluginList::exec(CMenuTarget* parent, const std::string & /*actionKey*/) tmp->number = count; tmp->name = g_PluginList->getName(count); tmp->desc = g_PluginList->getDescription(count); + if (tmp->desc == "") + tmp->desc = "---"; pluginlist.push_back(tmp); } } @@ -310,7 +312,7 @@ void CPluginList::paintHead() if (pluginlisttype == CPlugins::P_TYPE_GAME) header.setIcon(NEUTRINO_ICON_GAMES); - else if (pluginlisttype == CPlugins::P_TYPE_SCRIPT) + else header.setIcon(NEUTRINO_ICON_SHELL); header.paint(CC_SAVE_SCREEN_NO); @@ -322,6 +324,8 @@ void CPluginList::paint() width = w_max( 500, 0 ); height = h_max( 526, 50 ); // 2*25 pixel frei listmaxshow = (height-theight-0)/fheight; + if (pluginlist.size() < listmaxshow) + listmaxshow = pluginlist.size(); height = theight+0+listmaxshow*fheight; // recalc height x=getScreenStartX( width ); y=getScreenStartY( height ); @@ -355,11 +359,10 @@ void CPluginList::paintItems() CPluginList::result_ CPluginList::pluginSelected() { + hide(); g_PluginList->startPlugin(pluginlist[selected]->number,0); if (!g_PluginList->getScriptOutput().empty()) { - hide(); - //ShowMsg(LOCALE_PLUGINS_RESULT, Latin1_to_UTF8(g_PluginList->getScriptOutput()), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); } paint(); diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index 49592b4e5..8e5f27a0b 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -130,7 +130,7 @@ void CPlugins::scanDir(const char *dir) new_plugin.pluginfile.append(".sh"); else if (new_plugin.type == CPlugins::P_TYPE_LUA) new_plugin.pluginfile.append(".lua"); - else + else // CPlugins::P_TYPE_GAME or CPlugins::P_TYPE_TOOL new_plugin.pluginfile.append(".so"); // We do not check if new_plugin.pluginfile exists since .cfg in // PLUGINDIR_VAR can overwrite settings in read only dir diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 75bc5bf1b..58ca0a506 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -615,7 +615,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } else if (actionKey == "running_clock"){ if (clock_r == NULL){ - clock_r = new CComponentsFrmClock(100, 50, 0, 50, "%H.%M:%S"); + clock_r = new CComponentsFrmClock(100, 50, 0, 50, "%H.%M:%S", true); clock_r->setClockFont(SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME); clock_r->setClockIntervall(1); // clock_r->doPaintBg(false); diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 4016b39f7..12abe4efb 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -261,6 +261,7 @@ CTimerList::CTimerList() listmaxshow = 0; Timer = new CTimerdClient(); skipEventID=0; + timerNew_message = ""; /* most probable default */ saved_dispmode = (int)CVFD::MODE_TVRADIO; @@ -321,7 +322,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) else if (timerNew.eventType == CTimerd::TIMER_ZAPTO || timerNew.eventType == CTimerd::TIMER_RECORD) { - if (strcmp(timerNew_channel_name, "---")==0) + if (timerNew_channel_name == "---") return menu_return::RETURN_REPAINT; if (timerNew.eventType==CTimerd::TIMER_RECORD) { @@ -338,7 +339,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) data= &eventinfo; } else if (timerNew.eventType==CTimerd::TIMER_REMIND) - data= timerNew.message; + data = (void*)timerNew_message.c_str(); else if (timerNew.eventType==CTimerd::TIMER_EXEC_PLUGIN) { if (strcmp(timerNew.pluginName, "---") == 0) @@ -369,7 +370,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) "%n", &timerNew.channel_id, &delta); - strncpy(timerNew_channel_name, &(key[3 + delta + 1]), 29); + timerNew_channel_name = std::string(key + 3 + delta + 1); g_RCInput->postMsg(CRCInput::RC_timeout, 0); // leave underlying menu also g_RCInput->postMsg(CRCInput::RC_timeout, 0); // leave underlying menu also return menu_return::RETURN_EXIT; @@ -1211,19 +1212,23 @@ int CTimerList::newTimer() CMenuWidget mm(LOCALE_TIMERLIST_MODESELECT, NEUTRINO_ICON_SETTINGS); mm.addItem(new CMenuForwarder(LOCALE_TIMERLIST_MODETV, true, NULL, &mctv)); mm.addItem(new CMenuForwarder(LOCALE_TIMERLIST_MODERADIO, true, NULL, &mcradio)); - strcpy(timerNew_channel_name,"---"); + timerNew_channel_name = "---"; CMenuForwarder* m6 = new CMenuForwarder(LOCALE_TIMERLIST_CHANNEL, true, timerNew_channel_name, &mm); CMenuForwarder* m7 = new CMenuForwarder(LOCALE_TIMERLIST_RECORDING_DIR, true,timerNew.recordingDir, this, "rec_dir2", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); CMenuOptionChooser* m8 = new CMenuOptionChooser(LOCALE_TIMERLIST_STANDBY, &timerNew_standby_on, TIMERLIST_STANDBY_OPTIONS, TIMERLIST_STANDBY_OPTION_COUNT, false); - std::string timerNew_message(timerNew.message); + timerNew_message = std::string(timerNew.message); CStringInputSMS timerSettings_msg(LOCALE_TIMERLIST_MESSAGE, &timerNew_message, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.,:!?/ "); - CMenuForwarder *m9 = new CMenuForwarder(LOCALE_TIMERLIST_MESSAGE, false, timerNew.message, &timerSettings_msg ); + CMenuForwarder *m9 = new CMenuForwarder(LOCALE_TIMERLIST_MESSAGE, false, timerNew_message, &timerSettings_msg ); strcpy(timerNew.pluginName,"---"); - CPluginChooser plugin_chooser(LOCALE_TIMERLIST_PLUGIN, CPlugins::P_TYPE_SCRIPT | CPlugins::P_TYPE_TOOL, timerNew.pluginName); + CPluginChooser plugin_chooser(LOCALE_TIMERLIST_PLUGIN, CPlugins::P_TYPE_SCRIPT | CPlugins::P_TYPE_TOOL +#if ENABLE_LUA + | CPlugins::P_TYPE_LUA +#endif + , timerNew.pluginName); CMenuForwarder *m10 = new CMenuForwarder(LOCALE_TIMERLIST_PLUGIN, false, timerNew.pluginName, &plugin_chooser); diff --git a/src/gui/timerlist.h b/src/gui/timerlist.h index 067d942bb..c05c7f486 100644 --- a/src/gui/timerlist.h +++ b/src/gui/timerlist.h @@ -63,8 +63,9 @@ class CTimerList : public CMenuTarget CTimerd::TimerList timerlist; // List of timers CTimerd::responseGetTimer timerNew; int timerNew_standby_on; - char timerNew_channel_name[30]; + std::string timerNew_channel_name; std::string m_weekdaysStr; + std::string timerNew_message; int timer_apids_dflt; int timer_apids_std; diff --git a/src/gui/update.cpp b/src/gui/update.cpp index e030b0f2b..a9596ebd3 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -55,6 +55,7 @@ #include #include #include +#include #include @@ -584,6 +585,8 @@ bool CFlashExpert::checkSize(int mtd, std::string &backupFile) return false; } backupRequiredSize = ((bused * bsize) / 1024ULL) * 2ULL; // twice disk space for summarized image + dprintf(DEBUG_INFO, "##### [%s] backupRequiredSize: %" PRIu64 ", btotal: %" PRIu64 ", bused: %" PRIu64 ", bsize: %ld\n", + __func__, backupRequiredSize, btotal, bused, bsize); } else #endif @@ -598,11 +601,11 @@ bool CFlashExpert::checkSize(int mtd, std::string &backupFile) uint64_t backupMaxSize = (btotal - bused) * (uint64_t)bsize; uint64_t res = 10; // Reserved 10% of available space backupMaxSize = (backupMaxSize - ((backupMaxSize * res) / 100ULL)) / 1024ULL; - printf("##### [%s] backupMaxSize: %" PRIu64 ", btotal: %" PRIu64 ", bused: %" PRIu64 ", bsize: %ld\n", + dprintf(DEBUG_INFO, "##### [%s] backupMaxSize: %" PRIu64 ", btotal: %" PRIu64 ", bused: %" PRIu64 ", bsize: %ld\n", __func__, backupMaxSize, btotal, bused, bsize); if (backupMaxSize < backupRequiredSize) { - snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_NO_AVAILABLE_SPACE), path.c_str(), backupMaxSize, backupRequiredSize); + snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_NO_AVAILABLE_SPACE), path.c_str(), to_string(backupMaxSize).c_str(), to_string(backupRequiredSize).c_str()); ShowHint(LOCALE_MESSAGEBOX_ERROR, errMsg); return false; } diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index db0abe2ce..96ddfb889 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -126,7 +126,11 @@ bool CUserMenu::showUserMenu(int button) CDBoxInfoWidget *boxinfo = NULL; CNeutrinoApp * neutrino = NULL; CPluginList * games = NULL; + CPluginList * tools = NULL; CPluginList * scripts = NULL; +#if ENABLE_LUA + CPluginList * lua = NULL; +#endif std::string txt = g_settings.usermenu_text[button]; neutrino_locale_t caption = user_menu[button].caption; @@ -297,6 +301,14 @@ bool CUserMenu::showUserMenu(int button) menu_item = new CMenuForwarder(LOCALE_MAINMENU_GAMES, g_PluginList->hasPlugin(CPlugins::P_TYPE_GAME), NULL, games, "-1", key, icon ); menu->addItem(menu_item, false); break; + case SNeutrinoSettings::ITEM_TOOLS: + menu_items++; + menu_prev = SNeutrinoSettings::ITEM_TOOLS; + tools = new CPluginList(LOCALE_MAINMENU_TOOLS,CPlugins::P_TYPE_TOOL); + keyhelper.get(&key,&icon); + menu_item = new CMenuForwarder(LOCALE_MAINMENU_TOOLS, g_PluginList->hasPlugin(CPlugins::P_TYPE_TOOL), NULL, tools, "-1", key, icon ); + menu->addItem(menu_item, false); + break; case SNeutrinoSettings::ITEM_SCRIPTS: menu_items++; menu_prev = SNeutrinoSettings::ITEM_SCRIPTS; @@ -305,25 +317,42 @@ bool CUserMenu::showUserMenu(int button) menu_item = new CMenuForwarder(LOCALE_MAINMENU_SCRIPTS, g_PluginList->hasPlugin(CPlugins::P_TYPE_SCRIPT), NULL, scripts, "-1", key, icon ); menu->addItem(menu_item, false); break; - case SNeutrinoSettings::ITEM_PLUGIN: +#if ENABLE_LUA + case SNeutrinoSettings::ITEM_LUA: + menu_items++; + menu_prev = SNeutrinoSettings::ITEM_LUA; + lua = new CPluginList(LOCALE_MAINMENU_LUA,CPlugins::P_TYPE_LUA); + keyhelper.get(&key,&icon); + menu_item = new CMenuForwarder(LOCALE_MAINMENU_LUA, g_PluginList->hasPlugin(CPlugins::P_TYPE_LUA), NULL, lua, "-1", key, icon ); + menu->addItem(menu_item, false); + break; +#endif + case SNeutrinoSettings::ITEM_PLUGIN_TYPES: { char id[5]; int cnt = 0; for (unsigned int count = 0; count < (unsigned int) g_PluginList->getNumberOfPlugins(); count++) { - bool show = g_PluginList->getType(count) == CPlugins::P_TYPE_TOOL || - g_PluginList->getType(count) == CPlugins::P_TYPE_LUA; + bool show = false; + if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_GAMES]) + show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_GAME; + if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_TOOLS]) + show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_TOOL; + if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_SCRIPTS]) + show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_SCRIPT; + if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_LUA]) + show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_LUA; + if (show && !g_PluginList->isHidden(count)) { sprintf(id, "%d", count); menu_items++; - menu_prev = SNeutrinoSettings::ITEM_PLUGIN; + menu_prev = SNeutrinoSettings::ITEM_PLUGIN_TYPES; neutrino_msg_t d_key = g_PluginList->getKey(count); //printf("[neutrino usermenu] plugin %d, set key %d...\n", count, g_PluginList->getKey(count)); StreamFeaturesChanger = new CStreamFeaturesChangeExec(); keyhelper.get(&key,&icon, d_key); menu_item = new CMenuForwarder(g_PluginList->getName(count), true, NULL, StreamFeaturesChanger, id, key, icon); - menu->addItem(menu_item, 0); cnt++; } diff --git a/src/gui/user_menue_setup.cpp b/src/gui/user_menue_setup.cpp index 967b5666b..2c7ae6de2 100644 --- a/src/gui/user_menue_setup.cpp +++ b/src/gui/user_menue_setup.cpp @@ -79,7 +79,7 @@ const CMenuOptionChooser::keyval USERMENU_ITEM_OPTIONS[USERMENU_ITEM_OPTION_COUN { SNeutrinoSettings::ITEM_REMOTE, LOCALE_RCLOCK_MENUEADD }, { SNeutrinoSettings::ITEM_FAVORITS, LOCALE_FAVORITES_MENUEADD }, { SNeutrinoSettings::ITEM_TECHINFO, LOCALE_EPGMENU_STREAMINFO }, - { SNeutrinoSettings::ITEM_PLUGIN, LOCALE_TIMERLIST_PLUGIN }, + { SNeutrinoSettings::ITEM_PLUGIN_TYPES, LOCALE_USERMENU_ITEM_PLUGIN_TYPES }, { SNeutrinoSettings::ITEM_VTXT, LOCALE_USERMENU_ITEM_VTXT }, { SNeutrinoSettings::ITEM_IMAGEINFO, LOCALE_SERVICEMENU_IMAGEINFO }, { SNeutrinoSettings::ITEM_BOXINFO, LOCALE_EXTRA_DBOXINFO }, @@ -89,7 +89,9 @@ const CMenuOptionChooser::keyval USERMENU_ITEM_OPTIONS[USERMENU_ITEM_OPTION_COUN { SNeutrinoSettings::ITEM_SCRIPTS, LOCALE_MAINMENU_SCRIPTS }, { SNeutrinoSettings::ITEM_RECORD, LOCALE_TIMERLIST_TYPE_RECORD }, { SNeutrinoSettings::ITEM_YOUTUBE, LOCALE_MOVIEPLAYER_YTPLAYBACK }, - { SNeutrinoSettings::ITEM_FILEPLAY, LOCALE_MOVIEPLAYER_FILEPLAYBACK } + { SNeutrinoSettings::ITEM_FILEPLAY, LOCALE_MOVIEPLAYER_FILEPLAYBACK }, + { SNeutrinoSettings::ITEM_TOOLS, LOCALE_MAINMENU_TOOLS }, + { SNeutrinoSettings::ITEM_LUA, LOCALE_MAINMENU_LUA } }; int CUserMenuSetup::exec(CMenuTarget* parent, const std::string &) diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index 11b767864..95df6e3ba 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -139,7 +139,10 @@ int paintButtons( const int &x, if (content[i].locale) { buttontext[i] = g_Locale->getText(content[i].locale); //text width - fwidth[i] = font->getRenderWidth(buttontext[i], true); + if (alt_buttontext != NULL && i == buttontext_id) + fwidth[i] = font->getRenderWidth(alt_buttontext, true); //...with an alternate buttontext + else + fwidth[i] = font->getRenderWidth(buttontext[i], true); w_text += fwidth[i]; count_labels++; } else { diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index 772528232..1461a7fcc 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -75,6 +75,7 @@ #define NEUTRINO_ICON_BUTTON_PLUS "plus" #define NEUTRINO_ICON_BUTTON_MINUS "minus" +#define NEUTRINO_ICON_BLUE "icon_blue" #define NEUTRINO_ICON_GREEN "icon_green" #define NEUTRINO_ICON_RED "icon_red" #define NEUTRINO_ICON_YELLOW "icon_yellow" diff --git a/src/gui/widget/keychooser.cpp b/src/gui/widget/keychooser.cpp index 41f325273..ed146b8fa 100644 --- a/src/gui/widget/keychooser.cpp +++ b/src/gui/widget/keychooser.cpp @@ -53,7 +53,7 @@ public: keyvalue = k; }; - virtual const char * getString(void) + virtual const char * getName(void) { the_text = g_Locale->getText(LOCALE_KEYCHOOSERMENU_CURRENTKEY); the_text += ": "; diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 02a15d5c3..b026f679f 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -818,7 +818,7 @@ void CMenuWidget::checkHints() { GenericMenuBack->setHint("", NONEXISTANT_LOCALE); for (unsigned int i= 0; i< items.size(); i++) { - if(!items[i]->hintIcon.empty() || items[i]->hint != NONEXISTANT_LOCALE) { + if(!items[i]->hintIcon.empty() || items[i]->hint != NONEXISTANT_LOCALE || !items[i]->hintText.empty()) { has_hints = true; break; } @@ -1133,7 +1133,7 @@ void CMenuWidget::paintHint(int pos) CMenuItem* item = items[pos]; - if (item->hintIcon.empty() && item->hint == NONEXISTANT_LOCALE) { + if (item->hintIcon.empty() && item->hint == NONEXISTANT_LOCALE && item->hintText.empty()) { if (info_box) { savescreen ? info_box->hide(false) : info_box->kill(); hint_painted = false; @@ -1141,7 +1141,7 @@ void CMenuWidget::paintHint(int pos) return; } - if (item->hint == NONEXISTANT_LOCALE) + if (item->hint == NONEXISTANT_LOCALE && item->hintText.empty()) return; int iheight = item->getHeight(); @@ -1168,7 +1168,7 @@ void CMenuWidget::paintHint(int pos) } //init infobox - std::string str = g_Locale->getText(item->hint); + std::string str = item->hintText.empty() ? g_Locale->getText(item->hint) : item->hintText; if (info_box){ info_box->setDimensionsAll(x, ypos2, iwidth, hint_height); info_box->setFrameThickness(2); @@ -1814,7 +1814,8 @@ int CMenuOptionLanguageChooser::paint( bool selected ) //------------------------------------------------------------------------------------------------------------------------------- CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) { - option_string_ptr = &Option; + option_string = &Option; + option = NULL; name = Text; nameString = ""; active = Active; @@ -1828,7 +1829,8 @@ CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, CMenuForwarder::CMenuForwarder(const std::string& Text, const bool Active, const std::string &Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) { - option_string_ptr = &Option; + option_string = &Option; + option = NULL; name = NONEXISTANT_LOCALE; nameString = Text; active = Active; @@ -1842,8 +1844,8 @@ CMenuForwarder::CMenuForwarder(const std::string& Text, const bool Active, const CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const char * const Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) { - option_string = Option ? Option : ""; - option_string_ptr = &option_string; + option_string = NULL; + option = Option; name = Text; nameString = ""; active = Active; @@ -1857,8 +1859,8 @@ CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, CMenuForwarder::CMenuForwarder(const std::string& Text, const bool Active, const char * const Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic) { - option_string = Option ? Option : ""; - option_string_ptr = &option_string; + option_string = NULL; + option = Option; name = NONEXISTANT_LOCALE; nameString = Text; active = Active; @@ -1882,9 +1884,20 @@ void CMenuForwarder::setName(const neutrino_locale_t t) nameString = ""; } +void CMenuForwarder::setOption(const char * const Option) +{ + option = Option; + option_string = NULL; + if (used && x != -1) + paint(); +} + void CMenuForwarder::setOption(const std::string &Option) { - option_string = Option; + option = NULL; + option_string = &Option; + if (used && x != -1) + paint(); } int CMenuForwarder::getHeight(void) const @@ -1924,9 +1937,11 @@ int CMenuForwarder::exec(CMenuTarget* parent) std::string CMenuForwarder::getOption(void) { - if (!option_string_ptr->empty()) - return *option_string_ptr; - if (jumpTarget) + if (option) + return (std::string)option; + else if (option_string) + return *option_string; + else if (jumpTarget) return jumpTarget->getValue(); return ""; } diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 7a9b85de3..420c312a2 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -210,8 +210,8 @@ class CMenuForwarder : public CMenuItem std::string actionKey; protected: - std::string option_string; - const std::string * option_string_ptr; + const char * option; + const std::string * option_string; CMenuTarget * jumpTarget; virtual std::string getOption(void); @@ -243,6 +243,7 @@ class CMenuForwarder : public CMenuItem int exec(CMenuTarget* parent); bool isSelectable(void) const { return active; } void setOption(const std::string &Option); + void setOption(const char * const Option); void setName(const std::string& text); void setName(const neutrino_locale_t text); }; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d45f7e195..e75c8d5a8 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -129,7 +129,6 @@ int old_b_id = -1; CHintBox * reloadhintBox = 0; -bool has_hdd; CInfoClock *InfoClock; int allow_flash = 1; @@ -462,6 +461,8 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.show_mute_icon = configfile.getInt32("show_mute_icon" ,0); g_settings.infobar_show_res = configfile.getInt32("infobar_show_res", 0 ); g_settings.infobar_show_dd_available = configfile.getInt32("infobar_show_dd_available", 1 ); + g_settings.wzap_time = configfile.getInt32("wzap_time", 3 ); + g_settings.infobar_show_tuner = configfile.getInt32("infobar_show_tuner", 1 ); g_settings.radiotext_enable = configfile.getBool("radiotext_enable" , false); //audio @@ -983,6 +984,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("show_mute_icon" , g_settings.show_mute_icon); configfile.setInt32("infobar_show_res" , g_settings.infobar_show_res ); configfile.setInt32("infobar_show_dd_available" , g_settings.infobar_show_dd_available ); + configfile.setInt32("wzap_time" , g_settings.wzap_time ); configfile.setInt32("infobar_show_tuner" , g_settings.infobar_show_tuner ); configfile.setBool("radiotext_enable" , g_settings.radiotext_enable); //audio @@ -2943,9 +2945,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) break; } } - if(has_hdd) { - wakeup_hdd(g_settings.network_nfs_recordingdir.c_str()); - } + wakeup_hdd(recordingDir); } if( g_settings.recording_zap_on_announce && (mode != mode_standby) && (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID())) { @@ -3155,6 +3155,14 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) return messages_return::handled; } + else if (msg == NeutrinoMessages::EVT_SET_MUTE) { + g_audioMute->AudioMute((int)data, true); + return messages_return::handled; + } + else if (msg == NeutrinoMessages::EVT_SET_VOLUME) { + g_volume->setVolumeExt((int)data); + return messages_return::handled; + } if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000)) delete [] (unsigned char*) data; @@ -3192,7 +3200,9 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) frameBuffer->paintBackground(); videoDecoder->ShowPicture(DATADIR "/neutrino/icons/shutdown.jpg"); + CEpgScan::getInstance()->Stop(); if(g_settings.epg_save /* && timeset && g_Sectionsd->getIsTimeSet ()*/) { + g_Sectionsd->setPauseScanning(true); saveEpg(true);// true CVFD::MODE_SHUTDOWN } CVFD::getInstance()->setMode(CVFD::MODE_SHUTDOWN); diff --git a/src/neutrinoMessages.h b/src/neutrinoMessages.h index c64acf6af..6e84eb915 100644 --- a/src/neutrinoMessages.h +++ b/src/neutrinoMessages.h @@ -155,6 +155,9 @@ struct NeutrinoMessages { /* sectionsd */ EVT_EIT_COMPLETE = CRCInput::RC_WithData + 24, /* data: (t_channel_id *) */ EVT_BACK_ZAP_COMPLETE = CRCInput::RC_WithData + 25, /* data: (t_channel_id *) */ + + EVT_SET_MUTE = CRCInput::RC_WithData + 28, + EVT_SET_VOLUME = CRCInput::RC_WithData + 29 }; enum { diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index a958d2779..2ada22cad 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -195,11 +195,25 @@ void CNeutrinoApp::InitMenuMain() mf->setHint(NEUTRINO_ICON_HINT_GAMES, LOCALE_MENU_HINT_GAMES); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_GAMES]); + //tools + bool show_tools = g_PluginList->hasPlugin(CPlugins::P_TYPE_TOOL); + mf = new CMenuForwarder(LOCALE_MAINMENU_TOOLS, show_tools, NULL, new CPluginList(LOCALE_MAINMENU_TOOLS,CPlugins::P_TYPE_TOOL)); + mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_TOOLS); + personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TOOLS]); + //scripts bool show_scripts = g_PluginList->hasPlugin(CPlugins::P_TYPE_SCRIPT); mf = new CMenuForwarder(LOCALE_MAINMENU_SCRIPTS, show_scripts, NULL, new CPluginList(LOCALE_MAINMENU_SCRIPTS,CPlugins::P_TYPE_SCRIPT)); mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_SCRIPTS); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SCRIPTS]); + +#if ENABLE_LUA + //lua + bool show_lua = g_PluginList->hasPlugin(CPlugins::P_TYPE_LUA); + mf = new CMenuForwarder(LOCALE_MAINMENU_LUA, show_lua, NULL, new CPluginList(LOCALE_MAINMENU_LUA,CPlugins::P_TYPE_LUA)); + mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_LUA); + personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_LUA]); +#endif } //separator diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index 2632352cc..7eae99bb2 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -199,6 +199,11 @@ http://dbox/control/screenshot + + 43. Signalstärke anzeigen + + http://dbox/control/signal +     @@ -1777,19 +1782,6 @@ ok
  -
- - -
41. Plugins neu laden
-
Handler: http://dbox/control/reloadplugins
-
-Parameter: keine
-Rückgabe: ok
-
-Die Pluginliste wird neu geladen. - - -
@@ -1840,6 +1832,28 @@ Beispiel:
>>>http://dbox/control/screenshot?osd=0&video=1
ok
  + + + +
43. Signalstärke zeigen
+
Handler: http://dbox/control/signal
+
+Parameter: keine oder sig, snr, ber

+Rückgabe:
+SIG: 100
+SNR: 90
+BER: 0
+
+Signalstärke SIG in %, SNR in % und BER wird ausgegeben. +Wird ein spezieller Wert als Parameter angegeben, wird keine Beschreibung ausgegeben. +
+
+Beispiel:
+
+>>>http://dbox/control/signal?sig
+100
+   

diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index af5565d66..0b7e9ff5b 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -49,6 +49,8 @@ #include "neutrinoapi.h" #include "controlapi.h" #include +#include + extern cVideo * videoDecoder; extern CPlugins *g_PluginList;//for relodplugins @@ -161,6 +163,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"epgsearch", &CControlAPI::EpgSearchTXTCGI, ""}, {"epg", &CControlAPI::EpgCGI, ""}, {"zapto", &CControlAPI::ZaptoCGI, "text/plain"}, + {"signal", &CControlAPI::SignalInfoCGI, "text/plain"}, {"getonidsid", &CControlAPI::GetChannel_IDCGI, "text/plain"}, {"currenttpchannels", &CControlAPI::GetTPChannel_IDCGI, "text/plain"}, // boxcontrol - system @@ -212,7 +215,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= // settings {"config", &CControlAPI::ConfigCGI, "text/plain"}, // filehandling - {"file", &CControlAPI::FileCGI, "+xml"}, + {"file", &CControlAPI::FileCGI, "+xml"} }; @@ -780,12 +783,14 @@ void CControlAPI::VolumeCGI(CyhookHandler *hh) } else if (hh->ParamList["1"].compare("mute") == 0) { - NeutrinoAPI->Zapit->muteAudio(true); + char mute = 1; + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_SET_MUTE, CEventServer::INITID_HTTPD, (void *)&mute, sizeof(char)); hh->SendOk(); } else if (hh->ParamList["1"].compare("unmute") == 0) { - NeutrinoAPI->Zapit->muteAudio(false); + char mute = 0; + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_SET_MUTE, CEventServer::INITID_HTTPD, (void *)&mute, sizeof(char)); hh->SendOk(); } else if (hh->ParamList["1"].compare("status") == 0) { // Mute status @@ -793,7 +798,7 @@ void CControlAPI::VolumeCGI(CyhookHandler *hh) } else if(hh->ParamList["1"]!="") { //set volume char vol = atol( hh->ParamList["1"].c_str() ); - NeutrinoAPI->Zapit->setVolume(vol,vol); + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_SET_VOLUME, CEventServer::INITID_HTTPD, (void *)&vol, sizeof(char)); hh->SendOk(); } else @@ -1392,7 +1397,7 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_forat ) struct tm *tmStartZeit = localtime(&eventIterator->startTime); if(xml_forat){ hh->printf("\t"); - hh->printf("\t\t%s\n",NeutrinoAPI->GetServiceName(eventIterator->channelID).c_str()); + hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(NeutrinoAPI->GetServiceName(eventIterator->channelID).c_str()).c_str());; hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(epg.title.c_str()).c_str()); hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(epg.info1.c_str()).c_str()); hh->printf("\t\t%s\n",ZapitTools::UTF8_to_UTF8XML(epg.info2.c_str()).c_str()); @@ -1760,6 +1765,40 @@ void CControlAPI::SendChannelList(CyhookHandler *hh, bool currentTP) } } +//----------------------------------------------------------------------------- +void CControlAPI::SignalInfoCGI(CyhookHandler *hh) +{ + CFrontend *frontend = CFEManager::getInstance()->getLiveFE(); + if(frontend){ + bool parame_empty = false; + + if (hh->ParamList["1"].empty()) + parame_empty = true; + + if ( parame_empty || (hh->ParamList["1"] == "sig") ){ + unsigned int sig = frontend->getSignalStrength() & 0xFFFF; + sig = (sig & 0xFFFF) * 100 / 65535; + if (parame_empty) + hh->printf("SIG: "); + hh->printf("%3u\n", sig); + } + if ( parame_empty || (hh->ParamList["1"] == "snr") ){ + unsigned int snr = frontend->getSignalNoiseRatio() & 0xFFFF; + snr = (snr & 0xFFFF) * 100 / 65535; + if (parame_empty) + hh->printf("SNR: "); + hh->printf("%3u\n", snr); + } + if ( parame_empty || (hh->ParamList["1"] == "ber") ){ + unsigned int ber = frontend->getBitErrorRate(); + if (parame_empty) + hh->printf("BER: "); + hh->printf("%3u\n", ber); + } + }else + hh->SendError(); +} + //----------------------------------------------------------------------------- void CControlAPI::SendStreamInfo(CyhookHandler *hh) { diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.h b/src/nhttpd/tuxboxapi/coolstream/controlapi.h index 33d969ae6..ce7f7d9a3 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.h +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.h @@ -111,6 +111,8 @@ private: void logoCGI(CyhookHandler *hh); void ConfigCGI(CyhookHandler *hh); void FileCGI(CyhookHandler *hh); + void SignalInfoCGI(CyhookHandler *hh); + protected: static const unsigned int PLUGIN_DIR_COUNT = 7; diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp index 3d711bbfb..ccb69a078 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp @@ -132,6 +132,8 @@ CNeutrinoAPI::CNeutrinoAPI() EventServer->registerEvent2( NeutrinoMessages::RELOAD_SETUP, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");//reload neutrino conf EventServer->registerEvent2( NeutrinoMessages::EVT_HDMI_CEC_VIEW_ON, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); EventServer->registerEvent2( NeutrinoMessages::EVT_HDMI_CEC_STANDBY, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); + EventServer->registerEvent2( NeutrinoMessages::EVT_SET_MUTE, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); + EventServer->registerEvent2( NeutrinoMessages::EVT_SET_VOLUME, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); } //------------------------------------------------------------------------- diff --git a/src/nhttpd/web/Y_Blocks.txt b/src/nhttpd/web/Y_Blocks.txt index f10a0d762..d9fc4081a 100644 --- a/src/nhttpd/web/Y_Blocks.txt +++ b/src/nhttpd/web/Y_Blocks.txt @@ -347,7 +347,7 @@ function do_submit()
- + diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 173750aaa..56230142c 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.8.0.44 -date=09.08.2013 +version=2.8.0.59 +date=12.02.2014 type=Release info=Port CST diff --git a/src/nhttpd/web/languages/Deutsch b/src/nhttpd/web/languages/Deutsch index 8673724a9..3ce68695e 100644 --- a/src/nhttpd/web/languages/Deutsch +++ b/src/nhttpd/web/languages/Deutsch @@ -99,6 +99,8 @@ bc.menue.switch_to_radio=Zum Radio umschalten bc.menue.webinf_slavebox=Webinterface der SlaveBox bc.menue.volumen_display=Lautstärke Anzeige +bc.menue.signal=Signalstärke + ========= Boxcontrol bc.control.freemem=FreeMem bc.control.lock=sperren diff --git a/src/nhttpd/web/languages/English b/src/nhttpd/web/languages/English index c5ff7241a..7bd7a6689 100644 --- a/src/nhttpd/web/languages/English +++ b/src/nhttpd/web/languages/English @@ -101,6 +101,8 @@ bc.menue.switch_to_radio=switch to Radio bc.menue.webinf_slavebox=Webinterface der SlaveBox bc.menue.volumen_display=volumen display +bc.menue.signal=Signal strength + ========= Boxcontrol bc.control.freemem=FreeMem bc.control.lock=lock diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 1251a5837..bc921b764 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -39,6 +40,9 @@ #include #include #include +#include +#include +#include #include #include @@ -77,12 +81,24 @@ bool file_exists(const char *filename) void wakeup_hdd(const char *hdd_dir) { - if(!check_dir(hdd_dir)){ + if(!check_dir(hdd_dir) && hdd_get_standby(hdd_dir)){ std::string wakeup_file = hdd_dir; wakeup_file += "/.wakeup"; + int fd = open(wakeup_file.c_str(), O_SYNC | O_WRONLY | O_CREAT | O_TRUNC); + if (fd >= 0) { + unsigned char buf[512]; + memset(buf, 0xFF, sizeof(buf)); + for (int i = 0; i < 20; i++) { + if (write(fd, buf, sizeof(buf)) < 0) { + perror("write to .wakeup"); + break; + } + } + fdatasync(fd); + close(fd); + } + hdd_flush(hdd_dir); remove(wakeup_file.c_str()); - creat(wakeup_file.c_str(),S_IREAD|S_IWRITE); - sync(); } } //use for script with full path @@ -576,3 +592,73 @@ bool CFileHelpers::removeDir(const char *Dir) errno = 0; return true; } + +static int hdd_open_dev(const char * fname) +{ + FILE * fp; + struct mntent * mnt; + dev_t dev; + struct stat st; + int fd = -1; + + if (stat(fname, &st) != 0) { + perror(fname); + return fd; + } + + dev = st.st_dev; + fp = setmntent("/proc/mounts", "r"); + if (fp == NULL) { + perror("setmntent"); + return fd; + } + + while ((mnt = getmntent(fp)) != NULL) { + if (stat(mnt->mnt_fsname, &st) != 0) + continue; + if (S_ISBLK(st.st_mode) && st.st_rdev == dev) { + printf("[hdd] file [%s] -> dev [%s]\n", fname, mnt->mnt_fsname); + fd = open(mnt->mnt_fsname, O_RDONLY|O_NONBLOCK); + if (fd < 0) + perror(mnt->mnt_fsname); + break; + } + } + endmntent(fp); + return fd; +} + +bool hdd_get_standby(const char * fname) +{ + bool standby = false; + + int fd = hdd_open_dev(fname); + if (fd >= 0) { + unsigned char args[4] = {WIN_CHECKPOWERMODE1,0,0,0}; + int ret = ioctl(fd, HDIO_DRIVE_CMD, args); + if (ret) { + args[0] = WIN_CHECKPOWERMODE2; + ret = ioctl(fd, HDIO_DRIVE_CMD, args); + } + if ((ret == 0) && (args[2] != 0xFF)) + standby = true; + + printf("[hdd] %s\n", standby ? "standby" : "active"); + close(fd); + } + return standby; +} + +void hdd_flush(const char * fname) +{ + int fd = hdd_open_dev(fname); + if (fd >= 0) { + printf("[hdd] flush buffers...\n"); + fsync(fd); + if (ioctl(fd, BLKFLSBUF, NULL)) + perror("BLKFLSBUF"); + else + ioctl(fd, HDIO_DRIVE_CMD, NULL); + close(fd); + } +} diff --git a/src/system/helpers.h b/src/system/helpers.h index b0623a56a..161544b27 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -43,6 +43,9 @@ void mySleep(int sec); std::string find_executable(const char *name); +bool hdd_get_standby(const char * fname); +void hdd_flush(const char * fname); + std::string getPathName(std::string &path); std::string getBaseName(std::string &path); std::string getFileName(std::string &file); diff --git a/src/system/locals.h b/src/system/locals.h index de3214792..3b580d346 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -123,6 +123,7 @@ typedef enum LOCALE_GENRE_TRAVEL_HOBBIES_6, LOCALE_GENRE_TRAVEL_HOBBIES_7, LOCALE_GENRE_UNKNOWN, + LOCALE_ADZAP, LOCALE_APIDSELECTOR_HEAD, LOCALE_AUDIO_SRS_ALGO, LOCALE_AUDIO_SRS_ALGO_HEAVY, @@ -767,6 +768,7 @@ typedef enum LOCALE_MAINMENU_CLEARSECTIONSD, LOCALE_MAINMENU_GAMES, LOCALE_MAINMENU_HEAD, + LOCALE_MAINMENU_LUA, LOCALE_MAINMENU_MEDIA, LOCALE_MAINMENU_MOVIEPLAYER, LOCALE_MAINMENU_PAUSESECTIONSD, @@ -783,6 +785,7 @@ typedef enum LOCALE_MAINMENU_SHUTDOWN_MENU, LOCALE_MAINMENU_SLEEPTIMER, LOCALE_MAINMENU_STANDBY, + LOCALE_MAINMENU_TOOLS, LOCALE_MAINMENU_TVMODE, LOCALE_MAINMENU_TVRADIO_SWITCH, LOCALE_MAINSETTINGS_AUDIO, @@ -981,6 +984,7 @@ typedef enum LOCALE_MENU_HINT_LEDS_STANDBY, LOCALE_MENU_HINT_LEDS_TV, LOCALE_MENU_HINT_LOAD, + LOCALE_MENU_HINT_LUA, LOCALE_MENU_HINT_MAKE_HDLIST, LOCALE_MENU_HINT_MAKE_NEWLIST, LOCALE_MENU_HINT_MAKE_REMOVEDLIST, @@ -1190,6 +1194,7 @@ typedef enum LOCALE_MENU_HINT_TIMEOUTS, LOCALE_MENU_HINT_TIMERS, LOCALE_MENU_HINT_TIMEZONE, + LOCALE_MENU_HINT_TOOLS, LOCALE_MENU_HINT_TVMODE, LOCALE_MENU_HINT_TVRADIO_SWITCH, LOCALE_MENU_HINT_VFD, @@ -1634,6 +1639,7 @@ typedef enum LOCALE_PERSONALIZE_PINPROTECT, LOCALE_PERSONALIZE_PINSTATUS, LOCALE_PERSONALIZE_PLUGINS, + LOCALE_PERSONALIZE_USERMENU_PLUGIN_TYPES, LOCALE_PERSONALIZE_USERMENU_PREFERRED_BUTTONS, LOCALE_PERSONALIZE_USERMENU_SHOW_CANCEL, LOCALE_PERSONALIZE_VISIBLE, @@ -1994,6 +2000,7 @@ typedef enum LOCALE_USERMENU_ITEM_BAR, LOCALE_USERMENU_ITEM_EPG_MISC, LOCALE_USERMENU_ITEM_NONE, + LOCALE_USERMENU_ITEM_PLUGIN_TYPES, LOCALE_USERMENU_ITEM_VTXT, LOCALE_USERMENU_MSG_INFO_IS_EMPTY, LOCALE_USERMENU_MSG_WARNING_NAME, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d0ab34f5a..6c0202f73 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -123,6 +123,7 @@ const char * locale_real_names[] = "GENRE.TRAVEL_HOBBIES.6", "GENRE.TRAVEL_HOBBIES.7", "GENRE.UNKNOWN", + "adzap", "apidselector.head", "audio.srs_algo", "audio.srs_algo_heavy", @@ -767,6 +768,7 @@ const char * locale_real_names[] = "mainmenu.clearsectionsd", "mainmenu.games", "mainmenu.head", + "mainmenu.lua", "mainmenu.media", "mainmenu.movieplayer", "mainmenu.pausesectionsd", @@ -783,6 +785,7 @@ const char * locale_real_names[] = "mainmenu.shutdown_menu", "mainmenu.sleeptimer", "mainmenu.standby", + "mainmenu.tools", "mainmenu.tvmode", "mainmenu.tvradio_switch", "mainsettings.audio", @@ -981,6 +984,7 @@ const char * locale_real_names[] = "menu.hint_leds_standby", "menu.hint_leds_tv", "menu.hint_load", + "menu.hint_lua", "menu.hint_make_hdlist", "menu.hint_make_newlist", "menu.hint_make_removedlist", @@ -1190,6 +1194,7 @@ const char * locale_real_names[] = "menu.hint_timeouts", "menu.hint_timers", "menu.hint_timezone", + "menu.hint_tools", "menu.hint_tvmode", "menu.hint_tvradio_switch", "menu.hint_vfd", @@ -1634,6 +1639,7 @@ const char * locale_real_names[] = "personalize.pinprotect", "personalize.pinstatus", "personalize.plugins", + "personalize.usermenu_plugin_types", "personalize.usermenu_preferred_buttons", "personalize.usermenu_show_cancel", "personalize.visible", @@ -1994,6 +2000,7 @@ const char * locale_real_names[] = "usermenu.item_bar", "usermenu.item_epg_misc", "usermenu.item_none", + "usermenu.item_plugin_types", "usermenu.item_vtxt", "usermenu.msg_info_is_empty", "usermenu.msg_warning_name", diff --git a/src/system/settings.cpp b/src/system/settings.cpp index 63e96586a..098c47c80 100644 --- a/src/system/settings.cpp +++ b/src/system/settings.cpp @@ -47,7 +47,9 @@ const struct personalize_settings_t personalize_settings[SNeutrinoSettings::P_SE {"personalize_media" , CPersonalizeGui::PERSONALIZE_MODE_VISIBLE}, {"personalize_games" , CPersonalizeGui::PERSONALIZE_MODE_NOTVISIBLE}, + {"personalize_tools" , CPersonalizeGui::PERSONALIZE_MODE_NOTVISIBLE}, {"personalize_scripts" , CPersonalizeGui::PERSONALIZE_MODE_NOTVISIBLE}, + {"personalize_lua" , CPersonalizeGui::PERSONALIZE_MODE_NOTVISIBLE}, {"personalize_settings" , CPersonalizeGui::PERSONALIZE_PROTECT_MODE_NOT_PROTECTED}, {"personalize_service" , CPersonalizeGui::PERSONALIZE_PROTECT_MODE_NOT_PROTECTED}, {"personalize_sleeptimer" , CPersonalizeGui::PERSONALIZE_MODE_VISIBLE}, @@ -103,6 +105,12 @@ const struct personalize_settings_t personalize_settings[SNeutrinoSettings::P_SE //user menu {"personalize_usermenu_show_cancel" , true}, + + //plugin types + {"personalize_usermenu_plugin_type_games" , false}, + {"personalize_usermenu_plugin_type_tools" , true}, + {"personalize_usermenu_plugin_type_scripts" , false}, + {"personalize_usermenu_plugin_type_lua" , true}, }; CScanSettings::CScanSettings(void) diff --git a/src/system/settings.h b/src/system/settings.h index 2e9cf5ab8..f12790261 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -100,6 +100,7 @@ struct SNeutrinoSettings int infobar_show_res; int infobar_show_tuner; int infobar_show_dd_available; + int wzap_time; //audio int audio_AnalogMode; int audio_DolbyDigital; @@ -182,7 +183,9 @@ struct SNeutrinoSettings P_MAIN_MEDIA, P_MAIN_GAMES, + P_MAIN_TOOLS, P_MAIN_SCRIPTS, + P_MAIN_LUA, P_MAIN_SETTINGS, P_MAIN_SERVICE, P_MAIN_SLEEPTIMER, @@ -239,6 +242,12 @@ struct SNeutrinoSettings //user menu P_UMENU_SHOW_CANCEL, + //plugins types + P_UMENU_PLUGIN_TYPE_GAMES, + P_UMENU_PLUGIN_TYPE_TOOLS, + P_UMENU_PLUGIN_TYPE_SCRIPTS, + P_UMENU_PLUGIN_TYPE_LUA, + P_SETTINGS_MAX }; @@ -654,7 +663,7 @@ struct SNeutrinoSettings ITEM_VTXT = 11, ITEM_TECHINFO = 13, ITEM_REMOTE = 14, - ITEM_PLUGIN = 15, + ITEM_PLUGIN_TYPES = 15, ITEM_IMAGEINFO = 16, ITEM_BOXINFO = 17, ITEM_CAM = 18, @@ -663,6 +672,8 @@ struct SNeutrinoSettings ITEM_SCRIPTS = 21, ITEM_YOUTUBE = 22, ITEM_FILEPLAY = 23, + ITEM_TOOLS = 24, + ITEM_LUA = 25, ITEM_MAX // MUST be always the last in the list } USER_ITEM; std::string usermenu_text[BUTTON_MAX]; diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 0c2f7135d..6d08e8391 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1147,13 +1147,13 @@ CTimerEvent_Record::CTimerEvent_Record(CConfigFile *config, int iId): eventInfo.epgID = config->getInt64("EVENT_INFO_EPG_ID_"+id); dprintf("read EVENT_INFO_EPG_ID_%s %ld\n",id.c_str(),(long)eventInfo.epgID); - eventInfo.epg_starttime = config->getInt64("EVENT_INFO_EPG_STARTTIME_"+id); + eventInfo.epg_starttime = (long int)config->getInt64("EVENT_INFO_EPG_STARTTIME_"+id); dprintf("read EVENT_INFO_EPG_STARTTIME_%s %ld\n",id.c_str(),(long)eventInfo.epg_starttime); eventInfo.channel_id = config->getInt64("EVENT_INFO_CHANNEL_ID_"+id); dprintf("read EVENT_INFO_CHANNEL_ID_%s %ld\n",id.c_str(),(long)eventInfo.channel_id); - eventInfo.apids = config->getInt32("EVENT_INFO_APIDS_"+id); + eventInfo.apids = (unsigned char)config->getInt32("EVENT_INFO_APIDS_"+id); dprintf("read EVENT_INFO_APIDS_%s 0x%X (%p)\n",id.c_str(),eventInfo.apids,&eventInfo.apids); recordingDir = config->getString("REC_DIR_"+id); @@ -1286,6 +1286,9 @@ void CTimerEvent_Zapto::announceEvent() //------------------------------------------------------------ void CTimerEvent_Zapto::fireEvent() { + if(CTimerdClient::adzap_eventID == eventID) + CTimerdClient::adzap_eventID = 0;//reset adzap flag + CTimerManager::getInstance()->getEventServer()->sendEvent(CTimerdClient::EVT_ZAPTO, CEventServer::INITID_TIMERD, &eventInfo, diff --git a/src/zapit/include/zapit/frontend_c.h b/src/zapit/include/zapit/frontend_c.h index 227cdab0c..ad35e03fd 100644 --- a/src/zapit/include/zapit/frontend_c.h +++ b/src/zapit/include/zapit/frontend_c.h @@ -227,7 +227,11 @@ class CFrontend return (currentTransponder.TP_id == 0) || (tpid == currentTransponder.TP_id); } - void setTsidOnid(transponder_id_t newid) { currentTransponder.TP_id = newid; } + void setTsidOnid(transponder_id_t newid) + { + if (!usecount) + currentTransponder.TP_id = newid; + } uint32_t getRate (); void Lock(); diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 4c5b4574b..5a929c07d 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -1710,7 +1710,8 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) SendPMT(); } else { live_fe->setTsidOnid(0); - ZapIt(lock_channel_id); + if (!ZapIt(lock_channel_id)) + SendEvent(CZapitClient::EVT_ZAP_FAILED, &lock_channel_id, sizeof(lock_channel_id)); lock_channel_id = 0; }
Wellcome to yWeb
Welcome to yWeb
{=L:language=} + + + + +
..
+ +
+
SNR %
+ + + + + +
..
+
+
+
BER
+
+ + {=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;slavebox=}~~

Switch to

@@ -155,6 +249,7 @@ function init(){ diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css index a2283ebe7..b9f71adfe 100644 --- a/src/nhttpd/web/Y_Main.css +++ b/src/nhttpd/web/Y_Main.css @@ -557,6 +557,30 @@ tr { margin-top: 10px; border: #FF8e42 solid 1px; } +.y_text_boxcontrol_table_progress { + width: 114px; + height: 12px; + padding: 0; + margin-bottom: 5px; + border: #FF8e42 solid 1px; + border-top: 0 none; + + background: #ffffff; /* Old browsers */ + background: -moz-linear-gradient(left, #ff0000 0%, #ffff00 74%, #ffff00 75%, #00ff00 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, right top, color-stop(0%,#ff0000), color-stop(74%,#ffff00), color-stop(75%,#ffff00), color-stop(100%,#00ff00)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(left, #ff0000 0%,#ffff00 74%,#ffff00 75%,#00ff00 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(left, #ff0000 0%,#ffff00 74%,#ffff00 75%,#00ff00 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(left, #ff0000 0%,#ffff00 74%,#ffff00 75%,#00ff00 100%); /* IE10+ */ + background: linear-gradient(to right, #ff0000 0%,#ffff00 74%,#ffff00 75%,#00ff00 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff0000', endColorstr='#00ff00',GradientType=1 ); /* IE6-9 */ +} +.y_text_boxcontrol_div_progress { + width: 112px; + border: #FF8e42 solid 1px; + font-size: 9px; + margin-top: 5px; + margin-bottom: -1px; +} .y_epg_info { border: 1px solid #CCCCCC; background-color: white; diff --git a/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm b/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm index 1e98c9d64..ade978061 100644 --- a/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm +++ b/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm @@ -15,6 +15,10 @@ function goUrl(_url){ } $("out").update(res); } +function standby(_standby){ + var _cec = (document.getElementById('checkCEC').checked == true) ? "on" : "off"; + goUrl("/control/standby?"+_standby+"&cec="+_cec); +} //]]> @@ -32,9 +36,10 @@ function goUrl(_url){
- - + + + CEC:
{=L:bc.control.playback=}{=L:bc.control.recording_mode=}