diff --git a/README.md b/README.md new file mode 100644 index 000000000..bc8176e3b --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Neutrino-HD ツ diff --git a/acinclude.m4 b/acinclude.m4 index 4eea0e04a..9ce0c1c9f 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -137,43 +137,58 @@ else fi TUXBOX_APPS_DIRECTORY_ONE(configdir,CONFIGDIR,localstatedir,/var,/tuxbox/config, - [--with-configdir=PATH ],[where to find the config files]) + [--with-configdir=PATH ],[where to find the config files]) TUXBOX_APPS_DIRECTORY_ONE(datadir,DATADIR,datadir,/share,/tuxbox, - [--with-datadir=PATH ],[where to find data]) + [--with-datadir=PATH ],[where to find data]) TUXBOX_APPS_DIRECTORY_ONE(fontdir,FONTDIR,datadir,/share,/fonts, - [--with-fontdir=PATH ],[where to find the fonts]) + [--with-fontdir=PATH ],[where to find the fonts]) TUXBOX_APPS_DIRECTORY_ONE(gamesdir,GAMESDIR,localstatedir,/var,/tuxbox/games, - [--with-gamesdir=PATH ],[where games data is stored]) + [--with-gamesdir=PATH ],[where games data is stored]) TUXBOX_APPS_DIRECTORY_ONE(libdir,LIBDIR,libdir,/lib,/tuxbox, - [--with-libdir=PATH ],[where to find the internal libs]) + [--with-libdir=PATH ],[where to find the internal libs]) TUXBOX_APPS_DIRECTORY_ONE(plugindir,PLUGINDIR,libdir,/lib,/tuxbox/plugins, - [--with-plugindir=PATH ],[where to find the plugins]) + [--with-plugindir=PATH ],[where to find the plugins]) + +TUXBOX_APPS_DIRECTORY_ONE(plugindir_var,PLUGINDIR_VAR,localstatedir,/var,/tuxbox/plugins, + [--with-plugindir_var=PATH ],[where to find the plugins in /var]) + +TUXBOX_APPS_DIRECTORY_ONE(plugindir_mnt,PLUGINDIR_MNT,mntdir,/mnt,/plugins, + [--with-plugindir_mnt=PATH ],[where to find the the extern plugins]) TUXBOX_APPS_DIRECTORY_ONE(luaplugindir,LUAPLUGINDIR,libdir,/lib,/tuxbox/luaplugins, - [--with-luaplugindir=PATH ],[where to find Lua plugins]) + [--with-luaplugindir=PATH ],[where to find Lua plugins]) TUXBOX_APPS_DIRECTORY_ONE(localedir,LOCALEDIR,datadir,/share, /tuxbox/neutrino/locale, - [--with-localedir=PATH ],[where to find the locale]) + [--with-localedir=PATH ],[where to find the locale]) -TUXBOX_APPS_DIRECTORY_ONE(themesdir,THEMESDIR,datadir,/share,/tuxbox/neutrino/themes, - [--with-themesdir=PATH ],[where to find the themes]) +TUXBOX_APPS_DIRECTORY_ONE(localedir_var,LOCALEDIR_VAR,localstatedir,/var,/tuxbox/locale, + [--with-localedir_var=PATH ],[where to find the locale in /var]) -TUXBOX_APPS_DIRECTORY_ONE(iconsdir,ICONSDIR,datadir,/share,/tuxbox/neutrino/icons, - [--with-iconsdir=PATH ],[where to find the icons]) +TUXBOX_APPS_DIRECTORY_ONE(themesdir,THEMESDIR,datadir,/share, /tuxbox/neutrino/themes, + [--with-themesdir=PATH ],[where to find the themes]) + +TUXBOX_APPS_DIRECTORY_ONE(themesdir_var,THEMESDIR_VAR,localstatedir,/var,/tuxbox/themes, + [--with-themesdir_var=PATH ],[where to find the themes in /var]) + +TUXBOX_APPS_DIRECTORY_ONE(iconsdir,ICONSDIR,datadir,/share, /tuxbox/neutrino/icons, + [--with-iconsdir=PATH ],[where to find the icons]) + +TUXBOX_APPS_DIRECTORY_ONE(iconsdir_var,ICONSDIR_VAR,localstatedir,/var,/tuxbox/icons, + [--with-iconsdir_var=PATH ],[where to find the icons in /var]) TUXBOX_APPS_DIRECTORY_ONE(private_httpddir,PRIVATE_HTTPDDIR,datadir,/share,/tuxbox/neutrino/httpd, - [--with-private_httpddir=PATH ],[where to find the the private httpd files]) + [--with-private_httpddir=PATH ],[where to find the the private httpd files]) TUXBOX_APPS_DIRECTORY_ONE(public_httpddir,PUBLIC_HTTPDDIR,localstatedir,/var,/httpd, - [--with-public_httpddir=PATH ],[where to find the the public httpd files]) + [--with-public_httpddir=PATH ],[where to find the the public httpd files]) TUXBOX_APPS_DIRECTORY_ONE(hosted_httpddir,HOSTED_HTTPDDIR,mntdir,/mnt,/hosted, - [--with-hosted_httpddir=PATH ],[where to find the the hosted files]) + [--with-hosted_httpddir=PATH ],[where to find the the hosted files]) ]) dnl automake <= 1.6 needs this specifications diff --git a/configure.ac b/configure.ac index e2d156dca..dbf867491 100644 --- a/configure.ac +++ b/configure.ac @@ -278,8 +278,10 @@ fi # hack to define a short filename also for out-of-tree build if test `dirname $0` = `pwd` || test "$0" = ./configure; then HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__file__=__FILE__' + HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__path_file__=__FILE__' else HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__file__="\"$(subst $(srcdir)/,,$(abspath $<))\""' + HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__path_file__="\"$(subst $(top_srcdir)/,,$(abspath $<))\""' fi AC_SUBST(HWLIB_CFLAGS) @@ -331,6 +333,7 @@ src/gui/Makefile src/gui/bedit/Makefile src/gui/components/Makefile src/gui/lua/Makefile +src/gui/moviebrowser/Makefile src/gui/widget/Makefile src/system/Makefile src/system/mtdutils/Makefile diff --git a/data/cables.xml b/data/cables.xml index 0e54cd3d8..debbe767f 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -512,22 +512,27 @@ - + - + - + - + + + + + + diff --git a/data/epgmap.xml b/data/epgmap.xml new file mode 100644 index 000000000..49cead598 --- /dev/null +++ b/data/epgmap.xml @@ -0,0 +1,19 @@ + + + + --rai1 + --rai1 + + --rai2 + --rai2 + + --rai3 + --rai3 + + --rai4 + + --raisport1 + --rainews24 + + --Das Erste + diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index 8e519e47d..d1bbad31a 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -86,6 +86,7 @@ install_DATA += \ help_small.png \ hidden.png \ hint_a_pic.png \ + hint_adzap.png \ hint_aplay.png \ hint_audio.png \ hint_back.png \ @@ -243,11 +244,14 @@ install_DATA += \ shell.png \ shutdown.jpg \ softupdate.png \ + star-off.png \ + star-on.png \ start.jpg \ streaming.png \ subt.png \ subt_gray.png \ timer.png \ + tmdb.png \ tuner_1.png \ tuner_2.png \ tuner_3.png \ diff --git a/data/icons/hint_adzap.png b/data/icons/hint_adzap.png new file mode 100644 index 000000000..164cffcb7 Binary files /dev/null and b/data/icons/hint_adzap.png differ diff --git a/data/icons/star-off.png b/data/icons/star-off.png new file mode 100644 index 000000000..d40be7f27 Binary files /dev/null and b/data/icons/star-off.png differ diff --git a/data/icons/star-on.png b/data/icons/star-on.png new file mode 100644 index 000000000..dec690428 Binary files /dev/null and b/data/icons/star-on.png differ diff --git a/data/icons/tmdb.png b/data/icons/tmdb.png new file mode 100644 index 000000000..a38816732 Binary files /dev/null and b/data/icons/tmdb.png differ diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 3b692d08f..b0edf96f2 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -108,6 +108,15 @@ GENRE.TRAVEL_HOBBIES.6 Einkauf GENRE.TRAVEL_HOBBIES.7 Garten GENRE.UNKNOWN Unbekannt adzap Werbezapper +adzap.announce In %d Sekunden wird umgeschaltet auf\n%s +adzap.cancel Deaktiviert +adzap.disable Aus +adzap.enable Ein (einmalig) +adzap.minute Minute +adzap.minutes Minuten +adzap.monitor Ein (dauerhaft) +adzap.switchback Zurückschalten nach +adzap.writedata Schreibe Status-Daten apidselector.head Sprachauswahl audio.srs_algo Art audio.srs_algo_heavy stark @@ -148,7 +157,7 @@ audiomenu.volume_step Lautstärke Schrittweite audioplayer.add Hinzufügen audioplayer.add_ic Icecast audioplayer.add_loc Lokale Radioliste -audioplayer.add_sc Shoutcast +audioplayer.add_sc SHOUTcast audioplayer.artist_title Interpret, Titel audioplayer.building_search_index Erstelle Suchindex audioplayer.button_select_title_by_id Suche n. ID @@ -157,7 +166,7 @@ audioplayer.defdir Start-Verz. audioplayer.delete entfernen audioplayer.deleteall Alle entfernen audioplayer.display_order Anzeige -audioplayer.enable_sc_metadata Aktiviere Shoutcast Meta-Daten Parsing +audioplayer.enable_sc_metadata Aktiviere SHOUTcast Meta-Daten Parsing audioplayer.fastforward schneller Vorl. audioplayer.follow Selektiere akt. Track audioplayer.head Audio Playlist @@ -246,6 +255,7 @@ channellist.foot_sort_freq Sortiert[freq] channellist.foot_sort_sat Sortiert[sat] channellist.head Alle Kanäle channellist.history Verlauf +channellist.history_clear Verlauf löschen channellist.keep_numbers Dauerhafte Kanalnummern channellist.make_hdlist Erzeuge Bouquet mit HD-Kanälen channellist.make_newlist Erzeuge Bouquet mit neuen Kanälen @@ -323,6 +333,7 @@ colormenu.timing Timeouts colormenusetup.menucontent Fensterinhalt colormenusetup.menucontent_inactive Fensterinhalt deaktiviert colormenusetup.menucontent_selected Fensterinhalt selektiert +colormenusetup.menufoot Fußleiste colormenusetup.menuhead Titelleiste colorstatusbar.text Infobar colorthememenu.head Theme auswählen @@ -378,6 +389,7 @@ epgviewer.genre Genre epgviewer.length Spieldauer (Min.) epgviewer.nodetailed Keine ausführlichen Informationen verfügbar epgviewer.notfound Keine Programminformationen (EPG) gefunden +epgviewer.select_screening Terminauswahl eventfinder.fsk Altersfreigabe Filter eventfinder.genre Genre Filter eventfinder.head EPG-Suche @@ -391,6 +403,7 @@ eventfinder.search_within_list Suche innerhalb Text eventfinder.searching Suche... eventfinder.start_search Suche starten eventlist.additional Zusatzinformationen +eventlist.epgplus EPG Plus anzeigen eventlist.name Eventliste eventlistbar.channelswitch Umschalten eventlistbar.eventsort Sortieren @@ -464,7 +477,8 @@ extra.saveconfig Neutrino Einstellungen: Sichern als extra.savekeys Speichere Tastenbelegung als extra.scrambled_message Verschlüsselung melden extra.show_mute_icon Mute-Icon bei Lautstärke 0 -extra.sms_channel SMS-Modus Kanal +extra.sms_channel SMS-Modus bei Kanalsuche +extra.sms_movie SMS-Modus bei Filmsuche extra.south Süden extra.start_tostandby Standby nach Boxstart extra.temp_timeshift Temporäres Timeshift @@ -717,6 +731,7 @@ fontsize.infobar_info Info fontsize.infobar_number Nummer fontsize.infobar_small Klein fontsize.menu Menütext +fontsize.menu_foot Fußleiste (in allen GUI-Elementen) fontsize.menu_hint Menü-Hilfe fontsize.menu_info Menüinfo fontsize.menu_title Menütitel @@ -765,6 +780,7 @@ hdd_statfs_recording nur während Aufnahme hdd_umount Aushängen hdd_umount_warn Laufwerk aushängen hdd_umounted Laufwerk entfernt +imageinfo.api API: imageinfo.creator Ersteller: imageinfo.date Datum: imageinfo.dokumentation Dokus: @@ -809,7 +825,7 @@ keybindingmenu.head Tasten-Belegungen bearbeiten keybindingmenu.lastchannel Letzter Kanal keybindingmenu.longkeypress_duration Langer Tastendruck keybindingmenu.misc Sonstige -keybindingmenu.mode_left_right_key_tv Funktion li/re Tasten im TV-Modus +keybindingmenu.mode_left_right_key_tv Funktion der li/re-Tasten keybindingmenu.mode_left_right_key_tv_infobar Infobar einblenden keybindingmenu.mode_left_right_key_tv_volume Lautstärkeregelung keybindingmenu.mode_left_right_key_tv_vzap Virtual Zap @@ -859,6 +875,7 @@ lcdmenu.dim_brightness nach Dimm-Timeout lcdmenu.dim_time Dimm-Timeout lcdmenu.head VFD/LED Einstellungen lcdmenu.lcdcontroler Helligkeit +lcdmenu.notify_rclock Benachrichtigung bei FB-Sperre lcdmenu.scroll Laufschrift lcdmenu.statusline Statuszeile lcdmenu.statusline.both Lautstärke/Fortschritt @@ -876,6 +893,10 @@ ledcontroler.off LED1 & LED2 aus ledcontroler.on.all LED1 & LED2 an ledcontroler.on.led1 LED1 an ledcontroler.on.led2 LED2 an +livestream.head Livestreams +livestream.read_data Lese Daten... +livestream.resolution Auflösung +livestream.scriptpath Script Verzeichnis lua.boolparam_deprecated1 Achtung! lua.boolparam_deprecated2 Die Verwendung von Zahl oder String lua.boolparam_deprecated3 für einen Boolean Parameter ist veraltet.\n Bitte nutzen Sie native Bool Werte zB: @@ -925,9 +946,18 @@ mainsettings.savesettingsnow Einstellungen jetzt speichern mainsettings.savesettingsnow_hint Einstellungen werden jetzt gespeichert,\nbitte warten... mainsettings.timezone Zeitzone mainsettings.video Video +mbkey.copy_onefile Film kopieren +mbkey.copy_several Film kopieren und teilen +mbkey.cover Filmcover erzeugen/löschen +mbkey.cut Film schneiden +mbkey.truncate Film kürzen menu.back Zurück menu.cancel Abbrechen menu.hint_a_pic Konfigurieren Sie den Audioplayer und den Bildbetrachter +menu.hint_adzap Der Werbezapper schaltet nach der eingestellten Zeit wieder auf den ursprünglichen Kanal zurück +menu.hint_adzap_active Der Werbezapper ist aktiv. Mit einem erneuten Aufruf wird er deaktiviert. +menu.hint_adzap_setup Einstellungen für den Werbezapper +menu.hint_adzap_writedata Schreibe Daten über den Status des Werbezappers nach /tmp/adzap.data menu.hint_aplay Audioplayer menu.hint_aplay_setup Ändern Sie Audioplayer-Einstellungen wie Titel-Anzeige, Startverzeichnis oder Bildschirmschoner. menu.hint_audio Audio-Ausgang, Dolby Digital und SRS TruVolume Optionen und mehr @@ -1010,6 +1040,7 @@ menu.hint_epg_save_standby Speichert die EPG-Daten auch, wenn in den Standby-Mod menu.hint_epg_scan Zu scannende Bouquets wählen. Aktuelles Bouquet beim Umschalten, markierte Bouquets oder alle Favoriten menu.hint_epg_scan_mode Aktivieren Sie den Hintergrundscan der EPG-Daten, wenn ein freier Tuner vorhanden ist menu.hint_eventlist_additional Definiert, ob zusätzliche Informationen im Hauptfenster angezeigt werden sollen +menu.hint_eventlist_epgplus Definiert, ob EPG Plus (Vorschau-Übersicht) mit der EPG-Taste angezeigt werden sollen menu.hint_eventlist_fonts Ändern Sie die Schriftgröße in der Event-Liste menu.hint_eventlist_setup Wählen Sie die Anzeigeoptionen für die Event-Liste menu.hint_extended Energiespar-, EPG-Speicher- und Lade-Optionen, HDMI-CEC, Startkanal und mehr @@ -1024,6 +1055,8 @@ menu.hint_font_gui Wählen Sie die Schriftart für die Menüs menu.hint_font_scaling Legen Sie die vertikale und horizontale Skalierung der Menüschrift fest menu.hint_font_ttx Wählen Sie die Schriftart für den Teletext menu.hint_fonts Konfigurieren Sie die Schriftart und die Schriftgrößen für die Menüs +menu.hint_foot_back Ändern Sie die Fußleisten-Hintergrundfarbe +menu.hint_foot_textcolor Ändern Sie die Fußleisten-Textfarbe menu.hint_games Zeige Liste der installierten Spiele menu.hint_hdd Formatierung und Prüfung der Datenträger menu.hint_hdd_apply Die veränderten Einstellungen zum Sleep- und Akustik-Modus werden übernommen @@ -1069,7 +1102,6 @@ menu.hint_key_binding In diesem Menü können Einstellungen für die Tasten der menu.hint_key_bouquetdown Weisen Sie eine Taste für das Zurückblättern in den Bouquets zu menu.hint_key_bouquetup Weisen Sie eine Taste für das Vorblättern in den Bouquets zu menu.hint_key_cancel Weisen Sie eine Taste für das Schließen der Menüs zu -menu.hint_key_channel_sms Wenn es aktiviert ist, können Sie die Nummern-Tasten in der Kanalliste nutzen, um im SMS-Style zu suchen menu.hint_key_channeldown Weisen Sie eine Taste für das Herunterschalten in der Kanalliste zu menu.hint_key_channellist Konfigurieren Sie die Tastenbelegung für die Kanalliste menu.hint_key_channelup Weisen Sie eine Taste für das Hochschalten in der Kanalliste zu @@ -1082,6 +1114,7 @@ menu.hint_key_list_end Weisen Sie eine Taste für den Wechsel zum Listenende zu menu.hint_key_list_start Weisen Sie eine Taste für den Wechsel zum Listenanfang zu menu.hint_key_load Laden Sie Ihre Tastenbelegungen aus einer Datei menu.hint_key_modechange Wählen Sie eine Taste für den Wechsel in den TV/Radio-Modus und für den Standby +menu.hint_key_moviebrowser Konfigurieren Sie die Tastenbelegung für den Moviebrowser menu.hint_key_movieplayer Konfigurieren Sie die Tastenbelegung für den Movieplayer menu.hint_key_mpaudio Weisen Sie eine Taste zu, um die Tonspuren in ihren Aufnahmen zu wechseln menu.hint_key_mpbookmark Weisen Sie eine Taste zu, um Merker in ihren Aufnahmen für den Neustart zu setzen @@ -1106,7 +1139,7 @@ menu.hint_key_quickzap Konfigurieren Sie die Tastenbelegung für die Schnellumsc menu.hint_key_record Konfigurieren Sie die Taste für den Aufnahmestart menu.hint_key_repeatblock Die Verzögerung nach einem Tastendruck bis die Box reagieren soll menu.hint_key_repeatblockgeneric Die Verzögerung zwischen den Tastewiederholungen bis die Box reagieren soll -menu.hint_key_right Wählen Sie die Funktion für die Tasten 'links' und 'rechts' im TV/Radio-Modus +menu.hint_key_right Wählen Sie die Funktion für die Tasten 'links' und 'rechts' im TV/Radio- und Movieplayer-Modus menu.hint_key_save Speichern Sie Ihre Tastenbelegungen in einer Datei ab menu.hint_key_screenshot Weisen Sie eine Taste zu, um Menü- und/oder TV-Screenshots zu speichern menu.hint_key_sort Weisen Sie eine Taste für das Sortieren in der Kanalliste zu @@ -1139,6 +1172,7 @@ menu.hint_make_removedlist Nach einer Kanalsuche wird ein Bouquet namens 'gelös menu.hint_make_webtvlist Bei aktiver Option wird ein Bouquet namens 'WebTV' erzeugt, in dem alle WebTV-Sender zusammengefasst sind menu.hint_manage_settings Sichern, Wiederherstellen und Auslieferungszustand wiederherstellen menu.hint_mb Ihre Aufnahmen +menu.hint_mbkey_cover Weisen Sie eine Taste zu, um Filmcover während der Wiedergabe zu erzeugen oder sie im Moviebrowser zu löschen menu.hint_media Abspielen von Musik, Internetradio und Filmen; Betrachten Sie Bilder menu.hint_menu_fonts Ändern Sie die Schriftgrößen im Menü menu.hint_menu_hints Zeigt Ihnen Hinweise zu den Menüpunkten an. Sie erreichen das auch jederzeit mit der Taste 'Hilfe' @@ -1150,6 +1184,7 @@ menu.hint_misc_energy Energieverbrauchs- und Standby-Optionen, verzögertes Auss menu.hint_misc_epg Diverse EPG-Einstellungen und Speicherverzeichnis für EPG-Daten menu.hint_misc_filebrowser Dateisystem, Dateirechte anzeigen im Dateibrowser, Startverzeichnisoptionen menu.hint_misc_general Standby-, Teletext- und Rotor-Einstellungen, Pluginverzeichnis auf externem Datenträger +menu.hint_misc_onlineservices Konfigurieren und steuern von Online-Diensten wie YouTube, SHOUTCast und TMDb menu.hint_misc_zapit Verwaltung der Start-Kanäle für den TV/Radio-Modus menu.hint_movie Wiedergabe von Filmen menu.hint_moviebrowser_setup Legen Sie Auswahl- und Anzeigeoptionen des MovieBrowsers fest @@ -1231,6 +1266,7 @@ menu.hint_progressbar_timescale_yellow Hier können Sie den gelben Farbanteil bu menu.hint_protection Schützen Sie Inhalte per PIN-Code\nStandard-PIN ist 0000 menu.hint_radiomode Schaltet zum Radio-Modus menu.hint_reboot Startet die Box neu\nDer Neustart erfolgt ohne Bestätigung! +menu.hint_record_already_found_check Prüft vor dem Setzen eines neues Aufnahmetimers, ob ein gleichnamiger Titel bereits vorhanden ist menu.hint_record_apid_ac3 Schließt bei einer Aufnahme die durch den Sender definierte Tonspur 'Dolby Digital' in die Aufnahme ein, sofern diese vorhanden ist menu.hint_record_apid_alt Sind weitere Tonspuren verfügbar, dann können diese hiermit bei einer Aufnahme entsprechend ein- bzw. ausgeschlossen werden menu.hint_record_apid_std Schließt bei einer Aufnahme die durch den Sender definierte Tonspur 'Standard' in die Aufnahme ein bzw. aus @@ -1361,6 +1397,8 @@ menu.hint_selected_text Ändern Sie die Textfarbe für ausgewählte Fensterinhal menu.hint_service Sendersuchlauf, Bouquet-Verwaltung, Software-Aktualisierung und mehr menu.hint_service_scan Automatischer / manueller Service Suchlauf menu.hint_settings Konfigurieren von Neutrino,\nNetzwerk, Video, Audio, OSD und mehr +menu.hint_shoutcast_dev_id Geben Sie die SHOUTcast Dev ID ein. Eine leere Eingabe schaltet die SHOUTcast-Unterstützung aus +menu.hint_shoutcast_enabled Schaltet die SHOUTcast-Unterstützung ein oder aus menu.hint_show_mute_icon Definiert, ob bei einem Lautstärkewert von 0 das Stumm-Symbol eingeblendet werden soll menu.hint_shutdown Setzen Sie Ihre Box in den Standby-Modus oder schalten Sie die Box komplett aus menu.hint_shutdown_count Die Zeit zum Herunterfahren in den Deep-Standby, wenn die Box im Standby-Modus ist @@ -1369,6 +1407,8 @@ menu.hint_shutdown_rcdelay Aktiviert den Deep-Standby, wenn die Power-Taste län menu.hint_shutdown_real Aktiviert den Standby-Modus. Ist diese Option deaktiviert, fährt die Box in den Deep-Standby menu.hint_sleeptimer Zeitschaltuhr auf Ihrer Box aktivieren\nDie Box fährt dann in den Standby-Modus menu.hint_sleeptimer_min Voreinstellung der Zeitschaltuhr auf Ihrer Box +menu.hint_sms_channel Wenn es aktiviert ist, können Sie die Nummern-Tasten in der Kanalliste nutzen, um im SMS-Style zu suchen +menu.hint_sms_movie Wenn es aktiviert ist, können Sie die Nummern-Tasten im Moviebrowser nutzen, um im SMS-Style zu suchen menu.hint_soft_restart Neustarten von Neutrino, ohne die Box neu zu starten menu.hint_softupdate_check Im Internet nach verfügbaren Updates suchen, herunterladen und installieren menu.hint_softupdate_check_local Lokal nach verfügbaren Updates suchen und installieren @@ -1386,6 +1426,8 @@ 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_tmdb_api_key Geben Sie den TMDb API Schlüssel ein. Eine leere Eingabe schaltet die TMDb-Unterstützung aus +menu.hint_tmdb_enabled Schaltet die TMDb-Unterstützung (themoviedb.org) ein bzw. 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 @@ -1399,6 +1441,7 @@ menu.hint_vfd_brightnessstandby Definiert die Helligkeit im Standby-Modus menu.hint_vfd_defaults Zurücksetzen der Helligkeitswerte auf die Standardeinstellungen menu.hint_vfd_dimtime Geben Sie einen Wert in Sekunden ein, nachdem sich das Display automatisch auf den gewünschten Wert dimmt menu.hint_vfd_infoline Wählen Sie, was in der Infozeile angezeigt werden soll +menu.hint_vfd_notify_rclock Zeigt eine Meldung im Display, wenn bei gesperrter Fernbedienung eine Taste gedrückt wird menu.hint_vfd_scroll Laufschrift im Display ein- oder ausschalten menu.hint_vfd_statusline Wählen Sie, was in der Statuszeile angezeigt werden soll menu.hint_video Video-Ausgang, Auflösung, Format, Seitenverhältnisse und mehr @@ -1422,7 +1465,9 @@ menu.hint_volume_pos Wählen Sie die Position der Lautstärkeanzeige aus menu.hint_volume_size Wählen Sie die Höhe der Lautstärkeanzeige menu.hint_webtv_setup Hier konfigurierte WebTV-Kanäle finden Sie in der Kanalverwaltung. menu.hint_window_size Kanalliste, EPG-Infos und einige andere Fenster werden mit diesem Faktor skaliert -menu.hint_ytplay Wiedergabe von ausgewählten Youtube Feeds +menu.hint_youtube_dev_id Geben Sie die YouTube Dev ID ein. Eine leere Eingabe schaltet die YouTube-Unterstützung aus +menu.hint_youtube_enabled Schaltet die YouTube-Unterstützung ein oder aus +menu.hint_ytplay Wiedergabe von ausgewählten YouTube Feeds menu.hint_ytplay_setup Konfigurieren Sie YouTube-spezifische Optionen wie maximale Ergebnisse bei Suchen oder Cache-Verzeichnis menu.hint_zap_cycle Wählen Sie, ob nur innerhalb des aktiven Bouquets umgeschaltet werden kann menu.next Weiter @@ -1500,6 +1545,7 @@ miscsettings.infobar_show_res_simple einfach miscsettings.infobar_show_sysfs_hdd Füllstandsanzeige (SysFS und HDD) miscsettings.infobar_show_tuner Aktiven Tuner anzeigen miscsettings.infoclock Uhr +miscsettings.onlineservices Online-Dienste miscsettings.progressbar Fortschrittsbalken miscsettings.progressbar_color Farbe miscsettings.progressbar_design Design @@ -1664,9 +1710,11 @@ moviebrowser.info_prevplaydate Letzte Wiedergabe moviebrowser.info_prodcountry Land moviebrowser.info_prodyear Jahr moviebrowser.info_quality Qualität +moviebrowser.info_rating Bewertung moviebrowser.info_recorddate Aufnahmedatum moviebrowser.info_serie Serie moviebrowser.info_size Dateigröße (MB) +moviebrowser.info_spacer Abstandshalter moviebrowser.info_title Titel moviebrowser.info_videoformat Bildformat moviebrowser.last_play_max_items Zeilen 'zuletzt aufgenommen' @@ -1698,7 +1746,7 @@ moviebrowser.serie_auto_create Serien automatisch zuordnen moviebrowser.serie_head Serie moviebrowser.serie_name Name ändern moviebrowser.short_audio Audio -moviebrowser.short_book Markierung +moviebrowser.short_book Mark. moviebrowser.short_channel Kanal moviebrowser.short_country Land moviebrowser.short_filename Name @@ -1713,9 +1761,11 @@ moviebrowser.short_path Pfad moviebrowser.short_prevplaydate Zuletzt moviebrowser.short_prodyear Jahr moviebrowser.short_quality Qualität +moviebrowser.short_rating Vote moviebrowser.short_recorddate Datum moviebrowser.short_serie Serie moviebrowser.short_size Größe +moviebrowser.short_spacer moviebrowser.short_title Titel moviebrowser.start_head Film starten von Position: moviebrowser.start_record_start Aufnahmestart @@ -1735,7 +1785,7 @@ moviebrowser.yt_cancel_transfer Download abbrechen? moviebrowser.yt_clear Liste leeren moviebrowser.yt_completed Vollständige Downloads moviebrowser.yt_concurrent_connections Gleichzeitige Verbindungen -moviebrowser.yt_error Fehler beim Laden des Youtube-Feeds +moviebrowser.yt_error Fehler beim Laden des YouTube-Feeds moviebrowser.yt_failed Fehlgeschlagene Downloads moviebrowser.yt_history Frühere Suchen moviebrowser.yt_max_history Max. Anzahl früherer Suchen @@ -1761,9 +1811,9 @@ movieplayer.bookmarkname Bookmark Name movieplayer.bookmarkname_hint1 Geben Sie den Namen für das neue Lesezeichen ein movieplayer.bookmarkname_hint2 movieplayer.chapters Kapitel -movieplayer.defplugin Start-Plugin movieplayer.fileplayback Abspielen (Multiformat) movieplayer.head Movieplayer +movieplayer.plugin Movieplayer-Plugin movieplayer.starting Wiedergabe starten... movieplayer.titles Titel movieplayer.toomanybookmarks Sie haben bereits zu viele Lesezeichen angelegt.\nEs muß erst ein anderes gelöscht werden. @@ -1780,7 +1830,7 @@ movieplayer.tshelp7 ca. 1 Minute vor movieplayer.tshelp8 ca. 5 Minuten zurück movieplayer.tshelp9 ca. 5 Minuten vor movieplayer.tsplayback TS Abspielen -movieplayer.ytplayback Youtube-Feed Wiedergabe +movieplayer.ytplayback YouTube-Feed Wiedergabe mpkey.audio Tonspuren mpkey.bookmark Markierungen mpkey.forward Vorlauf @@ -1985,6 +2035,7 @@ ping.unreachable ist nicht erreichbar (unerreichbar) pinprotection.head PIN-Abfrage pinprotection.wrongcode Geben Sie den Code nocheinmal ein! plugins.hdd_dir Externes Plugin-Verz. +plugins.no_plugin Kein Plugin plugins.result Pluginausgabe plugintype.disabled Deaktiviert plugintype.game Spiel @@ -1995,6 +2046,8 @@ rclock.locked Gesperrt rclock.lockmsg Die Fernbedienung wird gesperrt.\nUm die Sperre aufzuheben, bitte\n[rot] gefolgt von [%s]\nauf der Fernbedienung drücken. rclock.title Fernbedienung sperren rclock.unlockmsg Fernbedienung reaktiviert +recording.already_found %s\nwurde bereits gefunden. Trotzdem aufnehmen? +recording.already_found_check Prüfe Aufnahmen recording.is_running Folgende Aufnahme läuft bereits! Neue Aufnahme starten? recording.start Starte Aufnahme, bitte warten...! recording.startstop_msg Meldung bei Aufnahme Start/Ende @@ -2002,6 +2055,7 @@ recording.stop Beende Aufnahme, bitte warten...! recording.time_hour Stunde recording.time_hours Stunden recording.time_min Min +recordingmenu.already_found_check Prüfe, ob Titel bereits vorhanden recordingmenu.apids Tonspuren recordingmenu.apids_ac3 AC3 Tonspuren aufnehmen recordingmenu.apids_alt Alternative Tonspuren aufn. @@ -2037,6 +2091,12 @@ recordingmenu.vcr Videorekorder recordingmenu.vtxt_pid Teletext aufnehmen recordingmenu.zap_on_announce Umschalten bei Ankündigung recordtimer.announce Die Aufnahme beginnt in wenigen Minuten. +remotebox_add hinzufügen +remotebox_channel_na Kanal auf Remote-Box nicht verfügbar +remotebox_del löschen +remotebox_head Remote-Boxen +remotebox_ip Remote-Box IP +remotebox_mod bearbeiten reset_all Werkseinstellungen und Reboot reset_channels Lösche Kanäle reset_confirm Sind Sie sich sicher? @@ -2206,6 +2266,8 @@ settings.pos_top_left oben links settings.pos_top_right oben rechts settings.restore Image-Einstellungen: Wiederherstellen settings.restore_warn Alle Settings werden ersetzt.\nDie Box wird neu gestartet.\nWeiter? +shoutcast.dev_id SHOUTcast Dev ID +shoutcast.enabled SHOUTcast-Unterstützung shutdown.recording_query Aufnahme läuft. Trotzdem beenden? shutdowntimer.announce Die Box wird in 1 Min. heruntergefahren.\nShutdown abbrechen? sleeptimerbox.announce Die Box wird in 1 Min. in Standby-Betrieb gehen.\nStandby-Betrieb abbrechen? @@ -2299,6 +2361,7 @@ timerlist.type.execplugin Plugin ausführen timerlist.type.nextprogram Nächstes Programm timerlist.type.record Aufnahme timerlist.type.remind Erinnerung +timerlist.type.remotebox Remote-Aufnahme timerlist.type.shutdown Shutdown timerlist.type.sleeptimer Sleeptimer timerlist.type.standby Standby @@ -2325,6 +2388,9 @@ timing.infobar_radio Infobar (Radiobetrieb) timing.menu Menü timing.numericzap Umschalten mit Zifferntasten timing.volumebar Lautstärkeanzeige +tmdb.api_key TMDb API Schlüssel +tmdb.enabled TMDb-Unterstützung +tmdb.read_data Suche TMDB Daten... unicable.lnb Unicable Eingang unicable.qrg Unicable Frequenz unicable.scr Unicable SCR @@ -2343,6 +2409,7 @@ usermenu.button_green Benutzermenü 'grün' usermenu.button_red Benutzermenü 'rot' usermenu.button_yellow Benutzermenü 'gelb' usermenu.head Benutzermenü +usermenu.item_adzap Werbezapper usermenu.item_bar ---- Trennung ---- usermenu.item_epg_misc EPG Funktionen usermenu.item_none (frei) @@ -2358,7 +2425,7 @@ usermenu.name Name usermenu.title_blue Erweiterungen usermenu.title_green Tonwahl usermenu.title_red EPG -usermenu.title_yellow Bildregie +usermenu.title_yellow Bildoptionen video_mode_ok Video-Einstellungen OK? videomenu.43mode 4:3 Anzeigeverhalten videomenu.analog_auto AUTO @@ -2430,6 +2497,8 @@ wizard.welcome_head Willkommen zur Ersteinrichtung Ihres Receivers! wizard.welcome_text Wir gratulieren Ihnen zum Kauf Ihrer CST. In den nun folgenden\nSchritten begleiten wir Sie durch die Erstinstallation des Gerätes.\nWir wünschen Ihnen viel Freude mit dem wohl einzigartigsten Receiver!\nBeachten Sie: Ihre CST Set-Top-Box lässt sich bequem per Webinterface\nsteuern, um zum Beispiel die Timer-Verwaltung zu nutzen oder Live-TV im Web-Browser zu schauen.\nAchten Sie darauf, dass Ihre Gerät nicht von aussen zugänglich ist,\nda sonst ein Zugriff über das Internet nicht ausgeschlossen werden kann!\nNächster Schritt? word.from ab word.in in +youtube.dev_id YouTube Dev ID +youtube.enabled YouTube-Unterstützung zapit.scantype Service-Auswahl zapit.scantype.all Alle Services zapit.scantype.radio Nur Radio diff --git a/data/locale/english.locale b/data/locale/english.locale index 0232977a6..d370afc43 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -108,6 +108,15 @@ GENRE.TRAVEL_HOBBIES.6 advertisement/shopping GENRE.TRAVEL_HOBBIES.7 gardening GENRE.UNKNOWN unknown adzap AdZap +adzap.announce In %d seconds, the channel will be switched to\n%s +adzap.cancel Timer was cancelled +adzap.disable Off +adzap.enable On (once) +adzap.minute minute +adzap.minutes minutes +adzap.monitor On (durable) +adzap.switchback Switch back after +adzap.writedata Write status data apidselector.head Select language audio.srs_algo Type audio.srs_algo_heavy Heavy @@ -148,7 +157,7 @@ audiomenu.volume_step Volume step audioplayer.add Add audioplayer.add_ic Icecast audioplayer.add_loc Local radio list -audioplayer.add_sc Shoutcast +audioplayer.add_sc SHOUTcast audioplayer.artist_title Artist, Title audioplayer.building_search_index building search index audioplayer.button_select_title_by_id search by ID @@ -157,7 +166,7 @@ audioplayer.defdir start dir. audioplayer.delete Remove audioplayer.deleteall remove all audioplayer.display_order display order -audioplayer.enable_sc_metadata enable shoutcast meta data parsing +audioplayer.enable_sc_metadata enable SHOUTcast meta data parsing audioplayer.fastforward fast forw. audioplayer.follow auto select current audioplayer.head Audio Playlist @@ -246,6 +255,7 @@ channellist.foot_sort_freq sorted[freq] channellist.foot_sort_sat sorted[sat] channellist.head All Services channellist.history History +channellist.history_clear Clear history channellist.keep_numbers Persistent channel numbers channellist.make_hdlist Create list of HD channels channellist.make_newlist Create list of new channels @@ -323,6 +333,7 @@ colormenu.timing Timeouts colormenusetup.menucontent Content colormenusetup.menucontent_inactive Content inactive colormenusetup.menucontent_selected Content selected +colormenusetup.menufoot Footer colormenusetup.menuhead Header colorstatusbar.text Infobar colorthememenu.head Select theme @@ -378,6 +389,7 @@ epgviewer.genre Genre epgviewer.length Length (min.) epgviewer.nodetailed No detailed informations available epgviewer.notfound No EPG found +epgviewer.select_screening Select Screening eventfinder.fsk Age rating Filter eventfinder.genre Genre-Filter eventfinder.head Search in EPG @@ -391,6 +403,7 @@ eventfinder.search_within_list Search within eventfinder.searching Search for keyword in EPG... eventfinder.start_search Start Search eventlist.additional Additional informations +eventlist.epgplus Show EPG Plus eventlist.name Eventlist eventlistbar.channelswitch schedule eventlistbar.eventsort sorting @@ -464,7 +477,8 @@ extra.saveconfig Neutrino Settings: Save as extra.savekeys Save keys as extra.scrambled_message Scrambled Message extra.show_mute_icon mute-icon at volume 0 -extra.sms_channel sms-mode channel +extra.sms_channel SMS-mode channel +extra.sms_movie SMS-mode movie extra.south South extra.start_tostandby Startup to standby extra.temp_timeshift Temporary timeshift @@ -717,6 +731,7 @@ fontsize.infobar_info info fontsize.infobar_number Number fontsize.infobar_small Small fontsize.menu Menu text +fontsize.menu_foot Footer (in all GUI elements) fontsize.menu_hint Menu hints fontsize.menu_info Menu Info fontsize.menu_title Menu Title @@ -765,6 +780,7 @@ hdd_statfs_recording while recording only hdd_umount Unmount hdd_umount_warn unmount device hdd_umounted Device removed +imageinfo.api API: imageinfo.creator Creator: imageinfo.date Date: imageinfo.dokumentation Docs: @@ -809,7 +825,7 @@ keybindingmenu.head Edit Keybindings keybindingmenu.lastchannel Quick Zap keybindingmenu.longkeypress_duration Long key-press keybindingmenu.misc Misc -keybindingmenu.mode_left_right_key_tv Left/Right Key Behavior in TV-Mode +keybindingmenu.mode_left_right_key_tv Left/Right key behaviour keybindingmenu.mode_left_right_key_tv_infobar Show Infobar keybindingmenu.mode_left_right_key_tv_volume Volume Control keybindingmenu.mode_left_right_key_tv_vzap Virtual Zap @@ -859,6 +875,7 @@ lcdmenu.dim_brightness Brightness after dim timeout lcdmenu.dim_time Dim timeout lcdmenu.head VFD/LED Settings lcdmenu.lcdcontroler Brightness +lcdmenu.notify_rclock Notify when RC is locked lcdmenu.scroll Enable text scroll lcdmenu.statusline status line lcdmenu.statusline.both volume / playtime @@ -876,6 +893,10 @@ ledcontroler.off Led1 & Led2 off ledcontroler.on.all Led1 & Led2 on ledcontroler.on.led1 Led1 on ledcontroler.on.led2 Led2 on +livestream.head Live streams +livestream.read_data Read data... +livestream.resolution Resolution +livestream.scriptpath Script path lua.boolparam_deprecated1 Caution! lua.boolparam_deprecated2 The use of number or string lua.boolparam_deprecated3 for a Boolean parameter is deprecated.\n Please use native bool values eg. @@ -925,9 +946,18 @@ mainsettings.savesettingsnow Save settings now mainsettings.savesettingsnow_hint Saving settings,\nplease wait... mainsettings.timezone Timezone mainsettings.video Video +mbkey.copy_onefile Copy movie +mbkey.copy_several Copy and split movie +mbkey.cover Create/remove movie cover +mbkey.cut Cut movie +mbkey.truncate Truncate movie menu.back Back menu.cancel Cancel menu.hint_a_pic Configure audio player and picture viewer +menu.hint_adzap AdZap will switch back to the current channel when the selected time is up +menu.hint_adzap_active AdZap is active. With a new call it will be deactivated. +menu.hint_adzap_setup Settings for the AdZap service +menu.hint_adzap_writedata Write data according to adzap status to /tmp/adzap.data menu.hint_aplay Audio player menu.hint_aplay_setup Change title display, start directory, screen saver and more menu.hint_audio Audio output, DD\nSRS True volume options @@ -1010,6 +1040,7 @@ menu.hint_epg_save_standby Save EPG on soft standby mode menu.hint_epg_scan Select bouquets to scan epg, current on zap,\nall or selected favorites menu.hint_epg_scan_mode Enable background epg scan using free tuner menu.hint_eventlist_additional Show additional informations\nin main box +menu.hint_eventlist_epgplus Show EPG Plus (Eventlist overview) when pressing EPG key menu.hint_eventlist_fonts Change event list font sizes menu.hint_eventlist_setup Configure event list GUI options menu.hint_extended Power saving, EPG save/load options\nHDMI-CEC, Start channel, zap options @@ -1024,6 +1055,8 @@ menu.hint_font_gui Select font file to use for GUI menu.hint_font_scaling Set global vertical and horizontal\nGUI font scaling menu.hint_font_ttx Select font file to use for teletext menu.hint_fonts Configure GUI fonts and font sizes +menu.hint_foot_back Change GUI footer background color +menu.hint_foot_textcolor Change GUI window footer text color menu.hint_games Show list of installed games menu.hint_hdd Format / check data storage menu.hint_hdd_apply Apply sleep/noise parameters @@ -1069,7 +1102,6 @@ menu.hint_key_binding Re-define keys used for common operations menu.hint_key_bouquetdown Assign button to switch channel list\nto previous bouquet menu.hint_key_bouquetup Assign button to switch channel list\nto next bouquet menu.hint_key_cancel Assign button to close GUI window -menu.hint_key_channel_sms If enabled, numeric buttons in channel list\nused to search channel in SMS style menu.hint_key_channeldown Assign button for fast switch to previous\nchannel in channel list menu.hint_key_channellist Configure keybingdings for channel list menu.hint_key_channelup Assign button for fast switch to next\nchannel in channel list @@ -1082,6 +1114,7 @@ menu.hint_key_list_end Assign button to go do list end menu.hint_key_list_start Assign button to go to list start menu.hint_key_load Load keybindings from file menu.hint_key_modechange Change TV/Radio mode and standby keys +menu.hint_key_moviebrowser Configure keybingdings for movie browser menu.hint_key_movieplayer Configure keybingdings for movie player menu.hint_key_mpaudio Assign button to show audio selection\nin record/file playback mode menu.hint_key_mpbookmark Assign button to create bookmark\nwhile playing record @@ -1106,7 +1139,7 @@ menu.hint_key_quickzap Configure keybingdings for quick\nchannel switch menu.hint_key_record Assign button to start a recording menu.hint_key_repeatblock Delay after button press and before\nfirst key repeat menu.hint_key_repeatblockgeneric Delay between key repeats\nwhile button pressed -menu.hint_key_right Select 'right' function in live TV/Radio mode +menu.hint_key_right Select function for 'left' and 'right' keys in live TV/Radio mode and movieplayer mode menu.hint_key_save Save keybindings to file menu.hint_key_screenshot Assign button to save GUI and/or TV screenshot menu.hint_key_sort Assign button to change channel list sort order @@ -1139,6 +1172,7 @@ menu.hint_make_removedlist Create list of recently removed channels menu.hint_make_webtvlist Auto-create WebTV channel list based on\nchannel type and name menu.hint_manage_settings Backup, restore, revert to defaults\nFactory box reset menu.hint_mb Your recordings +menu.hint_mbkey_cover Assign button to create movie cover while playback or delete it in moviebrowser menu.hint_media Play movies, audio files\nWatch pictures menu.hint_menu_fonts Change menu font sizes menu.hint_menu_hints Show this hints. Also you can switch\nit any time using 'help' button @@ -1150,6 +1184,7 @@ menu.hint_misc_energy Enable soft-standby, delayed shutdown\ninactivity timers menu.hint_misc_epg Save/load EPG options, EPG cache options\nEPG save directory menu.hint_misc_filebrowser Filesystem encoding, file rights\ndeny directory leave menu.hint_misc_general Start to standby, cache teletext, swp rotor\nplugin hdd dir +menu.hint_misc_onlineservices Configure and control online services like YouTube, SHOUTCast and TMDb menu.hint_misc_zapit Initial TV/Radio channels menu.hint_movie Play movies menu.hint_moviebrowser_setup Set selection and display options. @@ -1231,6 +1266,7 @@ menu.hint_progressbar_timescale_yellow Choose the yellow portion of colored prog menu.hint_protection Protect content by PIN code\nDefault PIN 0000 menu.hint_radiomode Switch box to radio mode menu.hint_reboot Reboot box\nNo confirmation +menu.hint_record_already_found_check Checks before setting a new record timer if an eponymous title already exists menu.hint_record_apid_ac3 Record AC3 audio pids menu.hint_record_apid_alt Record alternative non-AC3 audio pids menu.hint_record_apid_std Record first audio pid @@ -1361,6 +1397,8 @@ menu.hint_selected_text Change selected item text color menu.hint_service Tuner setup, service scan,\nbouquet editor, software upgrade menu.hint_service_scan Auto / manual service scan menu.hint_settings Configure Neutrino\nNetwork, audio, video, OSD and more +menu.hint_shoutcast_dev_id Type your SHOUTcast Dev ID. An empty input disables SHOUTcast support +menu.hint_shoutcast_enabled Enable or disable SHOUTcast support menu.hint_show_mute_icon Show mute icon, when volume set to 0 menu.hint_shutdown Put your box in deep standby mode\nNo confirmation menu.hint_shutdown_count Time to put box in deep-standby\nfrom soft-standby mode @@ -1369,6 +1407,8 @@ menu.hint_shutdown_rcdelay Enable deep-standby, if power button\npressed more th menu.hint_shutdown_real Enable soft-standby mode\nIf disabled, power button put box to deep-standby menu.hint_sleeptimer Set timer to put your box\nin sleep mode menu.hint_sleeptimer_min Default setting for sleeptimer +menu.hint_sms_channel If enabled, numeric buttons in channel list used to search channel in SMS style +menu.hint_sms_movie If enabled, numeric buttons in moviebrowser used to search movie in SMS style menu.hint_soft_restart Restart Neutrino without reboot menu.hint_softupdate_check Check online update, download and flash firmware menu.hint_softupdate_check_local Select and flash firmware from local file @@ -1386,6 +1426,8 @@ 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_tmdb_api_key Type your TMDb API key. An empty input disables TMDb support +menu.hint_tmdb_enabled Enable or disable TMDb support (themoviedb.org) menu.hint_tools Run tools menu.hint_tvmode Switch box to TV mode menu.hint_tvradio_switch Switches between TV and Radio mode @@ -1399,6 +1441,7 @@ menu.hint_vfd_brightnessstandby Brightness in soft-standby mode menu.hint_vfd_defaults Restore default brightness values menu.hint_vfd_dimtime Auto-dim time, in seconds menu.hint_vfd_infoline Choose what to display in main VFD line +menu.hint_vfd_notify_rclock Displays a notification when a key is pressed while remote control is locked menu.hint_vfd_scroll Enable or disable text scrolling on VFD menu.hint_vfd_statusline Choose what to display in short\nVFD status line menu.hint_video Video output, resolution, format\nAspect ratio, fast mode switch options @@ -1422,7 +1465,9 @@ menu.hint_volume_pos Select volume indicator position menu.hint_volume_size Select volume indicator height menu.hint_webtv_setup WebTV channels configured here will be available in the standard channel lists. menu.hint_window_size Channellist, EPG-infos and some other windows are scaled by this factor -menu.hint_ytplay Play selected youtube feeds +menu.hint_youtube_dev_id Type your YouTube Dev ID. An empty input disables YouTube support +menu.hint_youtube_enabled Enable or disable YouTube support +menu.hint_ytplay Play selected YouTube feeds menu.hint_ytplay_setup Configure YouTube-specific options, e.g. an upper limit for search results menu.hint_zap_cycle When swithing channels, stay in current bouquet menu.next Next @@ -1500,6 +1545,7 @@ miscsettings.infobar_show_res_simple simple miscsettings.infobar_show_sysfs_hdd Fill level (SysFS and HDD) miscsettings.infobar_show_tuner Display active tuner miscsettings.infoclock Clock +miscsettings.onlineservices Online services miscsettings.progressbar Progressbar miscsettings.progressbar_color Color miscsettings.progressbar_design Design @@ -1664,9 +1710,11 @@ moviebrowser.info_prevplaydate Last play date moviebrowser.info_prodcountry Country moviebrowser.info_prodyear Year moviebrowser.info_quality Quality +moviebrowser.info_rating Rating moviebrowser.info_recorddate Record date moviebrowser.info_serie Serie moviebrowser.info_size File size (MB) +moviebrowser.info_spacer Spacer moviebrowser.info_title Titel moviebrowser.info_videoformat Picture moviebrowser.last_play_max_items Number of lines last play @@ -1713,9 +1761,11 @@ moviebrowser.short_path Path moviebrowser.short_prevplaydate Last moviebrowser.short_prodyear Year moviebrowser.short_quality * (quality) +moviebrowser.short_rating Vote moviebrowser.short_recorddate Date moviebrowser.short_serie Serie moviebrowser.short_size MB +moviebrowser.short_spacer moviebrowser.short_title Title moviebrowser.start_head Start movie from: moviebrowser.start_record_start Movie start @@ -1735,7 +1785,7 @@ moviebrowser.yt_cancel_transfer Cancel download? moviebrowser.yt_clear Clear moviebrowser.yt_completed Completed downloads moviebrowser.yt_concurrent_connections Concurrent connections -moviebrowser.yt_error Failed to load youtube feed +moviebrowser.yt_error Failed to load YouTube feed moviebrowser.yt_failed Failed downloads moviebrowser.yt_history Search history moviebrowser.yt_max_history Max search history size @@ -1761,9 +1811,9 @@ movieplayer.bookmarkname Bookmarkname movieplayer.bookmarkname_hint1 Enter a name for your new bookmark movieplayer.bookmarkname_hint2 movieplayer.chapters Chapters -movieplayer.defplugin Start-Plugin movieplayer.fileplayback File play movieplayer.head Movieplayer +movieplayer.plugin Movieplayer plugin movieplayer.starting Starting playback... movieplayer.titles Titles movieplayer.toomanybookmarks There are too many bookmarks.\nYou need to delete one of them first. @@ -1780,7 +1830,7 @@ movieplayer.tshelp7 skip approx. 1 minute movieplayer.tshelp8 approx. 5 minutes back movieplayer.tshelp9 skip approx. 5 minutes movieplayer.tsplayback Play TS -movieplayer.ytplayback Youtube videoplayer +movieplayer.ytplayback YouTube videoplayer mpkey.audio Audiotracks mpkey.bookmark Bookmarks mpkey.forward Forward @@ -1985,6 +2035,7 @@ ping.unreachable is unreachable pinprotection.head Enter PIN code pinprotection.wrongcode PIN-Code was wrong! Try again. plugins.hdd_dir Plugin HDD dir. +plugins.no_plugin No plugin plugins.result plugin output plugintype.disabled Disabled plugintype.game Game @@ -1995,6 +2046,8 @@ rclock.locked Locked rclock.lockmsg Remote control will be locked.\nTo unlock, press\n[red] followed by [%s]\non your remote control. rclock.title Lock remote control rclock.unlockmsg Remote control unlocked +recording.already_found %s\nwas already found. Nevertheless start record? +recording.already_found_check Check recordings recording.is_running This channel already recording. Start new record? recording.start Start recording, please wait...! recording.startstop_msg Message when recording is start/stop @@ -2002,6 +2055,7 @@ recording.stop Stop recording, please wait...! recording.time_hour hour recording.time_hours hours recording.time_min min +recordingmenu.already_found_check Check, if title is already present recordingmenu.apids Audio streams recordingmenu.apids_ac3 record AC3 streams recordingmenu.apids_alt record alternative streams @@ -2037,6 +2091,12 @@ recordingmenu.vcr vcr recordingmenu.vtxt_pid record teletext recordingmenu.zap_on_announce zap on recording announce recordtimer.announce Recording starts in a few minutes +remotebox_add add +remotebox_channel_na Channel not available on Remote-Box +remotebox_del delete +remotebox_head Remote-Boxes +remotebox_ip Remote-Box IP +remotebox_mod modify reset_all Factory reset and reboot reset_channels Delete all channels reset_confirm Are you sure ? @@ -2206,6 +2266,8 @@ settings.pos_top_left top left settings.pos_top_right top right settings.restore Image-Settings: Restore settings.restore_warn This will replace all settings and reboot\nContinue ? +shoutcast.dev_id SHOUTcast Dev ID +shoutcast.enabled SHOUTcast support shutdown.recording_query You really want to to stop record ? shutdowntimer.announce Box will shutdown in 1 min.\nCancel Shutdown ? sleeptimerbox.announce Box will standby in 1 min.\nCancel Standby ? @@ -2299,6 +2361,7 @@ timerlist.type.execplugin Execute plugin timerlist.type.nextprogram Next program timerlist.type.record Record timerlist.type.remind Reminder +timerlist.type.remotebox Remote-Record timerlist.type.shutdown Shutdown timerlist.type.sleeptimer Sleeptimer timerlist.type.standby Standby @@ -2325,6 +2388,9 @@ timing.infobar_radio Infobar (radio mode) timing.menu Menu timing.numericzap Numeric Zap timing.volumebar Volume bar +tmdb.api_key TMDb API key +tmdb.enabled TMDb support +tmdb.read_data Search TMDB Data... unicable.lnb Unicable Input unicable.qrg Unicable Frequency unicable.scr Unicable SCR @@ -2343,6 +2409,7 @@ usermenu.button_green User menu green usermenu.button_red User menu red usermenu.button_yellow User menu yellow usermenu.head User menu +usermenu.item_adzap Adzap usermenu.item_bar ---- Boarder ---- usermenu.item_epg_misc EPG functions usermenu.item_none (empty) @@ -2358,7 +2425,7 @@ usermenu.name Name usermenu.title_blue Features usermenu.title_green Audio usermenu.title_red Event-List -usermenu.title_yellow Subservices +usermenu.title_yellow Video video_mode_ok Is this video mode working ok ? videomenu.43mode 4:3 Content mode videomenu.analog_auto AUTO @@ -2430,6 +2497,8 @@ wizard.welcome_head Welcome to the Setup Wizard wizard.welcome_text Next steps will guide you through initial installation of the device.\nImportant: Your CST set-top box can be conveniently controlled\nwith the web interface for timer management or live TV on the Web browser.\nDo not make it accessible to untrusted networks!\nDo you want to continue? word.from from word.in in +youtube.dev_id YouTube Dev ID +youtube.enabled YouTube support zapit.scantype scan for services zapit.scantype.all all services zapit.scantype.radio only radio diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index 1377a1be6..b9ffb8d1c 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -725,6 +725,7 @@ hdd_statfs_recording alleen tijdens opname hdd_umount Unmount hdd_umount_warn Apparaat ontkoppelen hdd_umounted Device verwijderd +imageinfo.api API: imageinfo.creator Ontwikkelaar: imageinfo.date Datum: imageinfo.dokumentation Documentatie: @@ -2196,6 +2197,7 @@ timing.infobar_radio Infobalk (radio modus) timing.menu Menu timing.numericzap Numeriek Zap timing.volumebar Volume balk +tmdb.read_data Zoeken TMDB data... unicable.lnb Invoer Unicable unicable.qrg Unicable Frequentie unicable.scr Unicable SCR diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index e1fd4f465..c42861e7f 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -8,21 +8,21 @@ EPGPlus.actions Akcie EPGPlus.bybouquet_mode buketmi EPGPlus.bypage_mode stranami EPGPlus.head Multi EPG -EPGPlus.next_bouquet nasl.buket +EPGPlus.next_bouquet Nasledujúci buket EPGPlus.options Možnosti EPGPlus.page_down Predchádzajúca strana EPGPlus.page_up Nasledujúca strana -EPGPlus.prev_bouquet predch.buket -EPGPlus.record Nahraj -EPGPlus.refresh_epg Obnov -EPGPlus.remind Pripomeň +EPGPlus.prev_bouquet Predchádzajúci buket +EPGPlus.record Nahrať +EPGPlus.refresh_epg Obnoviť +EPGPlus.remind Pripomenúť EPGPlus.scroll_mode pretáčanie EPGPlus.stretch_mode rozšírenie EPGPlus.swap_mode Zmena stránkovania EPGPlus.view_mode Spôsob zobrazenia -GENRE.ALL vypnuté -GENRE.ARTS umelecké -GENRE.ARTS.0 umenie/kultúra +GENRE.ALL vyp +GENRE.ARTS Umenie +GENRE.ARTS.0 umenie / kultúra GENRE.ARTS.1 divadlo GENRE.ARTS.10 umelecké/kultúrne maazíny GENRE.ARTS.11 móda @@ -32,16 +32,16 @@ GENRE.ARTS.4 ľudové umenie GENRE.ARTS.5 literatúra GENRE.ARTS.6 film/kino GENRE.ARTS.7 experimentálny film /video -GENRE.ARTS.8 prenosy/tlačovky +GENRE.ARTS.8 vysielanie/tlač GENRE.ARTS.9 nové média -GENRE.CHILDRENs_PROGRAMMES detské +GENRE.CHILDRENs_PROGRAMMES programy pre deti GENRE.CHILDRENs_PROGRAMMES.0 programy pre deti a mládež GENRE.CHILDRENs_PROGRAMMES.1 programy pre deti predškolského veku GENRE.CHILDRENs_PROGRAMMES.2 zábavné programy pre ľudí vo veku 6 – 14 rokov GENRE.CHILDRENs_PROGRAMMES.3 zábavné programy pre ľudí vo veku 10 – 16 rokov GENRE.CHILDRENs_PROGRAMMES.4 informačné a náučné školské programy GENRE.CHILDRENs_PROGRAMMES.5 animované programy -GENRE.DOCUS_MAGAZINES dokumentárne +GENRE.DOCUS_MAGAZINES dokumenty GENRE.DOCUS_MAGAZINES.0 dokumenty/magazíny GENRE.DOCUS_MAGAZINES.1 príroda/zvieratá/životné prostredie GENRE.DOCUS_MAGAZINES.2 technológie/prírodné vedy @@ -50,7 +50,7 @@ GENRE.DOCUS_MAGAZINES.4 zahraničie/výpravy GENRE.DOCUS_MAGAZINES.5 spoločenské/humanitné vedy GENRE.DOCUS_MAGAZINES.6 osveta GENRE.DOCUS_MAGAZINES.7 jazyky -GENRE.MOVIE filmové +GENRE.MOVIE film GENRE.MOVIE.0 kinofilm/dráma GENRE.MOVIE.1 kriminálny/napínavý GENRE.MOVIE.2 dobrodružný/western/vojenský @@ -60,7 +60,7 @@ GENRE.MOVIE.5 telenovela/melodráma/folklór GENRE.MOVIE.6 romantika GENRE.MOVIE.7 vážna dráma/klasika/náboženský/historický GENRE.MOVIE.8 filmy pre dospelých -GENRE.MUSIC_DANCE hudobné +GENRE.MUSIC_DANCE hudba GENRE.MUSIC_DANCE.0 hudba/tanec GENRE.MUSIC_DANCE.1 rock/pop GENRE.MUSIC_DANCE.2 vážna/klasická hudba @@ -68,28 +68,28 @@ GENRE.MUSIC_DANCE.3 národná/ľudová hudba GENRE.MUSIC_DANCE.4 jazz GENRE.MUSIC_DANCE.5 muzikál/opera GENRE.MUSIC_DANCE.6 balet -GENRE.NEWS spravodajské +GENRE.NEWS správy GENRE.NEWS.0 správy GENRE.NEWS.1 správy/počasie GENRE.NEWS.2 spravodajský magazín GENRE.NEWS.3 dokument GENRE.NEWS.4 diskusia/rozhovor/rokovanie -GENRE.SHOW estrádne +GENRE.SHOW Show GENRE.SHOW.0 estráda/telehra GENRE.SHOW.1 telehra/kvíz/súťaž GENRE.SHOW.2 varieté GENRE.SHOW.3 debata -GENRE.SOCIAL_POLITICAL spoločenské +GENRE.SOCIAL_POLITICAL sociálne GENRE.SOCIAL_POLITICAL.0 spoločenské a politické udalosti/obchod GENRE.SOCIAL_POLITICAL.1 magazíny/reportáže/dokumenty GENRE.SOCIAL_POLITICAL.2 ekonomické/spoločenské poradenstvo GENRE.SOCIAL_POLITICAL.3 významný ľudia -GENRE.SPORTS športové +GENRE.SPORTS športy GENRE.SPORTS.0 šport GENRE.SPORTS.1 mimoriadne udalosti (olimpiady, majstrovstvá sveta...) GENRE.SPORTS.10 jazdectvo -GENRE.SPORTS.11 vojenský šport -GENRE.SPORTS.2 športový magazín +GENRE.SPORTS.11 vojenské športy +GENRE.SPORTS.2 športové magazíny GENRE.SPORTS.3 futbal GENRE.SPORTS.4 tenis GENRE.SPORTS.5 skupinové športy @@ -97,7 +97,7 @@ GENRE.SPORTS.6 atletika GENRE.SPORTS.7 motorizmus GENRE.SPORTS.8 vodné športy GENRE.SPORTS.9 zimné športy -GENRE.TRAVEL_HOBBIES voľné chvíle +GENRE.TRAVEL_HOBBIES Voľný čas GENRE.TRAVEL_HOBBIES.0 cestovanie a odych GENRE.TRAVEL_HOBBIES.1 turistika/cestovanie GENRE.TRAVEL_HOBBIES.2 plavba @@ -107,7 +107,16 @@ GENRE.TRAVEL_HOBBIES.5 varenie GENRE.TRAVEL_HOBBIES.6 inzertovanie/nakupovanie GENRE.TRAVEL_HOBBIES.7 záhradkárstvo GENRE.UNKNOWN neznáme -adzap prepni za +adzap Prepnúť za +adzap.announce O %d sekúnd bude kanál prepnutý na\n%s +adzap.cancel Časovač bol zrušený +adzap.disable Vyp +adzap.enable Zap (raz) +adzap.minute minúta +adzap.minutes minút +adzap.monitor Zap (trvanlivý) +adzap.switchback Prepnúť späť po +adzap.writedata Zapísať stavové údaje apidselector.head Výber jazyka audio.srs_algo Režim audio.srs_algo_heavy Hrubý @@ -119,56 +128,56 @@ audio.srs_volume Východzia hlasitosť audiomenu.PCMOffset Zníženie hlasitosti PCM audiomenu.analog_mode Analógový režim audiomenu.analog_out Analógový výstup -audiomenu.auto_lang Automatický výber zvuku +audiomenu.auto_lang Automatický výber zvukovej stopy audiomenu.auto_subs Automatický výber titulkov audiomenu.avs avs -audiomenu.avsync A/V synch +audiomenu.avsync A/V synchronizácia audiomenu.avsync_am Hlavný zvuk audiomenu.clockrec Vzorkovanie audiomenu.dolbydigital Zvuk Dolby Digital -audiomenu.hdmi_dd Zvuk DD na HDMI +audiomenu.hdmi_dd Zvuk DD cez HDMI audiomenu.hdmi_dd_auto auto audiomenu.hdmi_dd_force nútene audiomenu.monoleft mono ľavý kanál audiomenu.monoright mono pravý kanál audiomenu.pref_lang Preferovaný jazyk -audiomenu.pref_lang_head Nastavenie jazyku zvuku/EPG -audiomenu.pref_languages Jazykové nastavenia +audiomenu.pref_lang_head Nastavenie jazyka zvuku / EPG +audiomenu.pref_languages Nastavenie zvuku a titulkov audiomenu.pref_subs Preferované titulky -audiomenu.pref_subs_head Nastavenie jazyku vybraných titulkov -audiomenu.spdif_dd Zvuk DD na SPDIF +audiomenu.pref_subs_head Nastavenie jazyka vybraných titulkov +audiomenu.spdif_dd Zvuk DD cez SPDIF audiomenu.stereo stereo audiomenu.volume_adjust Nastavená hlasitosť, v % -audiomenu.volume_adjustment Špecifické nastavenie hlasitosti kanála -audiomenu.volume_adjustment_ac3 AC3 prúdy -audiomenu.volume_adjustment_clear Vyčistiť uložené hodnoty -audiomenu.volume_adjustment_pcm PCM prúdy +audiomenu.volume_adjustment Špecifické nastavenie hlasitosti kanálu +audiomenu.volume_adjustment_ac3 AC3 zvuková stopa +audiomenu.volume_adjustment_clear Vymazať uložené hodnoty +audiomenu.volume_adjustment_pcm PCM zvuková stopa audiomenu.volume_start Počiatočná hlasitosť audiomenu.volume_step Krok hlasitosti -audioplayer.add pridaj +audioplayer.add Pridať audioplayer.add_ic Icecast audioplayer.add_loc Webrádio audioplayer.add_sc Shoutcast audioplayer.artist_title Umelec, Názov audioplayer.building_search_index Tvorenie vyhľadávacieho indexu -audioplayer.button_select_title_by_id hľadaj podľa ID -audioplayer.button_select_title_by_name hľadaj podľa názvu -audioplayer.defdir Východzí adresár -audioplayer.delete zmaž -audioplayer.deleteall zmaž všetko +audioplayer.button_select_title_by_id hľadať podľa ID +audioplayer.button_select_title_by_name hľadať podľa názvu +audioplayer.defdir Predvolená zložka +audioplayer.delete Zmazať +audioplayer.deleteall Všetko zmazať audioplayer.display_order Poradie -audioplayer.enable_sc_metadata Použi meta-data pre shoutcast -audioplayer.fastforward pretoč dopredu -audioplayer.follow Urob výber hraného +audioplayer.enable_sc_metadata Použiť meta-data pre shoutcast +audioplayer.fastforward pretočiť vpred +audioplayer.follow Výber aktuálnej stopy audioplayer.head Zoznam prehrávania audioplayer.highprio Vyššia priorita dekódovania audioplayer.jump_backwards skoč dozadu -audioplayer.jump_dialog_hint1 čas skoku +audioplayer.jump_dialog_hint1 Čas skoku audioplayer.jump_dialog_hint2 v sekundách. audioplayer.jump_dialog_title Zadaj čas skoku audioplayer.jump_forwards skoč dopredu audioplayer.keylevel funkcie klávesy -audioplayer.load_radio_stations Nahratie internetových rádií +audioplayer.load_radio_stations Načítanie internetových rádií audioplayer.name Prehrávač hudby audioplayer.pause pauza audioplayer.play spusti @@ -181,35 +190,35 @@ audioplayer.playlist_name_hint1 Zadajte názov súboru do zoznamu prehrávania audioplayer.playlist_name_hint2 Prípona .m3u bude doplnená automaticky audioplayer.reading_files Načítavam súbory audioplayer.receiving_list Načítavam zoznam, čakaj... -audioplayer.repeat_on Spusti režim opakovania -audioplayer.rewind pretoč dozadu -audioplayer.save_playlist ulož zoznam -audioplayer.select_title_by_name Vyber titul podľa názvu (SMS) -audioplayer.show_playlist Zobraz zoznam -audioplayer.shuffle náhodne -audioplayer.spectrum lcd a-spektrum -audioplayer.stop zastav +audioplayer.repeat_on Povoliť režim opakovania +audioplayer.rewind pretočiť dozadu +audioplayer.save_playlist uložiť zoznam +audioplayer.select_title_by_name Výber titulu podľa názvu (SMS) +audioplayer.show_playlist Zobraziť zoznam +audioplayer.shuffle Náhodne +audioplayer.spectrum LCD a-spektrum +audioplayer.stop Zastaviť audioplayer.title_artist Titul, Umelec -bookmarkmanager.delete zmaž -bookmarkmanager.name záložky -bookmarkmanager.rename premenuj -bookmarkmanager.select vyber -bouqueteditor.add pridaj +bookmarkmanager.delete Zmazať +bookmarkmanager.name Záložky +bookmarkmanager.rename Premenovať +bookmarkmanager.select Vybrať +bouqueteditor.add Pridať bouqueteditor.bouquetname Názov buketu -bouqueteditor.delete zmaž +bouqueteditor.delete Zmazať bouqueteditor.delete_question Vymazať kanál z buketu? -bouqueteditor.discardingchanges Zrušenie zmien. Prosím čakaj... -bouqueteditor.hide skri -bouqueteditor.lock zamkni -bouqueteditor.move presuň -bouqueteditor.move_to presuň do +bouqueteditor.discardingchanges Zrušenie zmien. Čakajte prosím... +bouqueteditor.hide Skryť +bouqueteditor.lock Zamknúť +bouqueteditor.move Presunúť +bouqueteditor.move_to Presunúť do bouqueteditor.name Úprava buketov bouqueteditor.newbouquetname Nový názov buketu -bouqueteditor.rename premenuj -bouqueteditor.return naspäť +bouqueteditor.rename Premenovať +bouqueteditor.return Naspäť bouqueteditor.savechanges? Uloženie týchto zmien? -bouqueteditor.savingchanges Ukladám zmeny. Prosím čakaj... -bouqueteditor.switch pridaj/odstráň +bouqueteditor.savingchanges Ukladám zmeny. Čakajte prosím... +bouqueteditor.switch Pridať/Odstrániť kanál bouqueteditor.switchmode TV/Rádio bouquetlist.head Bukety bouquetname.hdtv HD programy @@ -218,95 +227,97 @@ bouquetname.other Neznámy poskytovateľ bouquetname.removed Odstránené programy bouquetname.webtv WebTV kanály buildinfo.compiled_on Kompilované na: -buildinfo.compiled_with Verzia kompilera: -buildinfo.compiler_flags Príkazy kompilera: +buildinfo.compiled_with Verzia kompiléru +buildinfo.compiler_flags Znaky kompiléru buildinfo.creator Tvorca: buildinfo.kernel Verzia jadra: buildinfo.menu Build Informácie: cablesetup.provider Káblový poskytovateľ channellist.additional Rozšírené informácie -channellist.additional_off VYP -channellist.additional_on ZAP -channellist.additional_on_minitv ZAP (s MiniTV) +channellist.additional_off Vyp +channellist.additional_on Zap +channellist.additional_on_minitv Zap (s MiniTV) channellist.current_tp Aktuálny transpondér -channellist.edit Uprav -channellist.epgtext_align_left do ľava -channellist.epgtext_align_right do prava +channellist.edit Upraviť +channellist.epgtext_align_left doľava +channellist.epgtext_align_right doprava channellist.extended Grafické EPG v zozname -channellist.extended_colored s farebným ukazovateľom -channellist.extended_simple s jednoduchým ukazovateľom +channellist.extended_colored s farebným ukazateľom +channellist.extended_simple s jednoduchým ukazateľom channellist.favs Obľúbené channellist.foot Informácie programu -channellist.foot_freq Informácie kmitočtu +channellist.foot_freq Informácie frekvencie channellist.foot_next ďaľšia udalosť -channellist.foot_off VYP -channellist.foot_sort_alpha triediť[abeceda] -channellist.foot_sort_chnum triediť[číslo] -channellist.foot_sort_freq triediť[kmitočet] -channellist.foot_sort_sat triediť[satelit] +channellist.foot_off Vyp +channellist.foot_sort_alpha Triediť [abeceda] +channellist.foot_sort_chnum Triediť [číslo] +channellist.foot_sort_freq Triediť [frekvencia] +channellist.foot_sort_sat Triediť [satelit] channellist.head Všetky kanály channellist.history História channellist.keep_numbers Zachovať čísla predvolieb -channellist.make_hdlist Vytvor zoznam pre HD kanály -channellist.make_newlist Vytvor zoznam pre nové kanály -channellist.make_removedlist Vytvor zoznam pre odstránené kanály -channellist.make_webtvlist Vytvor zoznam pre WebTV kanály -channellist.new_zap_mode Okamžité prepínanie v zozname +channellist.make_hdlist Vytvoriť zoznam pre HD kanály +channellist.make_newlist Vytvoriť zoznam pre nové kanály +channellist.make_removedlist Vytvoriť buket odstránených kanálov +channellist.make_webtvlist Vytvoriť zoznam pre WebTV kanály +channellist.new_zap_mode Rýchle prepnutie v zozname channellist.new_zap_mode_active aktívne channellist.new_zap_mode_allow povolené channellist.new_zap_mode_off vypnuté -channellist.nonefound Nenájdený zoznam kanálov!\nVykonaj vyhľadanie kanálov\n(MENU -> Služby) +channellist.nonefound Zoznam staníc nenájdený!\nVykonajte prosím vyhľadanie staníc\n(MENU -> Služby) channellist.numeric_adjust Zadanie čísla na prepnutie channellist.provs Poskytovatelia channellist.recording_not_possible Nahrávanie nedostupné! -channellist.remember Posledne použité +channellist.remember Posledne použitý channellist.reset_all Odstrániť značku "Nový" pre všetky kanály channellist.reset_flags Odstrániť na kanály značku "Nový" channellist.sats Satelity -channellist.show_channellogo Zobraziť logo staníc -channellist.show_channelnumber Zobraziť čísla kanála +channellist.show_channellogo Zobraziť logo stanice +channellist.show_channelnumber Zobraziť čísla kanálov channellist.show_empty_favs Zobraziť aj prázdne obľúbené -channellist.show_infobox Zobraziť spodný InfoBox +channellist.show_infobox Zobraziť spodnú informačnú lištu channellist.since od -channellist.start spúšťa +channellist.start Spustiť ci.clock CI taktovanie (MHz) ci.empty Žiadny modul v šachte -ci.ignore_msg Ignoruj CA správy +ci.ignore_msg Ignorovať CA správy ci.init_failed Chybná inicializácia modulu ci.init_ok Inicializácia modulu ukončená ci.inserted Vložený modul do šachty ci.removed Odstránený modul zo šachty ci.reset Resetnúť ci.reset_standby Resetovať po spustení -ci.save_pincode Uložiť PIN kód +ci.save_pincode Uložiť PIN-kód ci.settings Podmienený prístup ci.timeout Čas čakania uplynul,\nvraciam sa do menu -ci.tuner Použiť CI len s tunerom: -ci.use Použiť CI +ci.tuner Použiť CI iba s tunerom: +ci.use Povoliť CI ci.waiting Čakám na odpoveď clock_background Zobraziť pozadie clock_seconds Zobraziť sekundy clock_size_height Výška zobrazenia clock_switch_off Skryť hodiny clock_switch_on Zobraziť hodiny -color.gradient Farebný gradient -color.gradient_a2b color A to B -color.gradient_b2a color B to A -color.gradient_d2l dark nach light -color.gradient_dld dark light dark -color.gradient_l2d light to dark -color.gradient_ldl light dark light +color.gradient Farebný prechod +color.gradient_a2b farba A do B +color.gradient_b2a farba B do A +color.gradient_d2l tmavá -> svetlá +color.gradient_dld tmavá svetlá tmavá +color.gradient_l2d svetlá -> tmavá +color.gradient_ldl svetlá tmavá svetlá color.gradient_mode_direction Smer -color.gradient_mode_direction_hor horizontálne -color.gradient_mode_direction_ver vertikálne -color.gradient_separator_enable Gradient pre Separator +color.gradient_mode_direction_hor horizontálny +color.gradient_mode_direction_ver vertikálny +color.gradient_separator_enable Oddelovacia čiara farebnej výplne colorchooser.alpha Priehľadnosť colorchooser.blue Modrý colorchooser.green Zelený colorchooser.red Červený -colorchooser.save Save +colorchooser.save Uložiť +colormenu.advanced_mode_off Predvolené hodnoty +colormenu.advanced_mode_on Rozšírené voľby colormenu.background Pozadie -colormenu.clock_textcolor Farba čílic +colormenu.clock_textcolor Farba číslic colormenu.contrast_fonts Kontrast písma colormenu.fade Miznúce menu colormenu.font Výber písma @@ -317,25 +328,25 @@ colormenu.osd_preset Druh TV colormenu.sd_preset CRT colormenu.textcolor Farba textu colormenu.themeselect Výber tém -colormenu.timing Čas zobrazenia na OSD +colormenu.timing Čas zobrazenia OSD colormenusetup.menucontent Obsahové okno colormenusetup.menucontent_inactive Neaktívne v obsahovom okne colormenusetup.menucontent_selected Vybrané v obsahovom okne colormenusetup.menuhead Hlavička colorstatusbar.text Text stavového riadku colorthememenu.head Výber vzhľadu -colorthememenu.head2 Nahraj vzhľad -colorthememenu.menu_hints Tipy boxu +colorthememenu.head2 Načítanie vzhľadu +colorthememenu.menu_hints Okno nápovedy colorthememenu.name Názov vzhľadu colorthememenu.neutrino_theme Neutrino colorthememenu.question Použiť vybraný vzhľad? colorthememenu.save Uložiť aktuálny vzhľad -colorthememenu.select1 Uživateľský vzhľad +colorthememenu.select1 Užívateľský vzhľad colorthememenu.select2 Predvolený vzhľad -cpu.freq Cpu kmitočet -cpu.freq_default Predvolený kmitočet -cpu.freq_normal Pracovný kmitočet -cpu.freq_standby Standby kmitočet +cpu.freq Frekvencia CPU +cpu.freq_default Predvolená frekvencia +cpu.freq_normal Pracovná frekvencia +cpu.freq_standby Pohotovostná frekvencia date.Apr Apr date.Aug Aug date.Dec Dec @@ -360,7 +371,7 @@ debug.level Úroveň debug.level_1 normálne debug.level_2 informatívne debug.level_3 detailne -epg.saving Uloženie EPG +epg.saving Ukladanie EPG epgextended.actors Herci epgextended.director Režisér epgextended.guests Hostia @@ -368,36 +379,36 @@ epgextended.original_title Originálny titul epgextended.presenter Produkcia epgextended.year_of_production Rok výroby epglist.noevents Programové informácie (EPG) sú nedostupné... -epgviewer.More_Screenings Podobné relácie na tomto kanály +epgviewer.More_Screenings Podobné relácie na tomto kanáli epgviewer.More_Screenings_short Ďaľšie vysielania epgviewer.age_rating Vekové obmedzenie epgviewer.audio Zvuk epgviewer.genre Žáner epgviewer.length Dĺžka (min.) epgviewer.nodetailed Detailné informácie sú nedostupné -epgviewer.notfound Nenájdené programové informácie (EPG) -eventfinder.fsk Filtrovať vek -eventfinder.genre Filtrovať žáner -eventfinder.head Hľadaj v EPG +epgviewer.notfound EPG nenájdené +eventfinder.fsk Filter hodnotenia veku +eventfinder.genre Filter žánru +eventfinder.head Hľadať v EPG eventfinder.history Hľadať históriu eventfinder.keyword Slovo eventfinder.max_history Max. počet výsledkov -eventfinder.search hľadaj +eventfinder.search Hľadať eventfinder.search_all_epg Všade -eventfinder.search_within_epg Hľadaj v EPG -eventfinder.search_within_list Hľadaj v zozname +eventfinder.search_within_epg Hľadať v EPG +eventfinder.search_within_list Hľadať v zozname eventfinder.searching Hľadám slovo v EPG... -eventfinder.start_search Spusti hľadanie -eventlist.additional Podrobnejšie informácie -eventlist.name Zoznam relácií -eventlistbar.channelswitch prepni -eventlistbar.eventsort triedenie -eventlistbar.recordevent nahraj -extra.add_to_bouquet Pridanie do buketu +eventfinder.start_search Spustiť hľadanie +eventlist.additional Podrobnejšie informácie EPG +eventlist.name Zoznam udalostí EPG +eventlistbar.channelswitch Prepnúť +eventlistbar.eventsort Triediť +eventlistbar.recordevent Nahrať +extra.add_to_bouquet Pridať do buketu extra.audio_run_player Stlačenie AUDIO spustí prehrávač -extra.auto_delete Auto-mazanie -extra.auto_timeshift Auto-nahrávanie, sec (0=vypnuté) -extra.cache_txt Zachytávanie teletextu +extra.auto_delete Automatické mazanie +extra.auto_timeshift Automatické nahrávanie, sekundy (0 = vypnuté) +extra.cache_txt Vyrovnávacia pamäť teletextu extra.chadded Aktuálny kanál bol pridaný do vybraného buketu....\n extra.chalreadyinbq Aktuálny kanál sa už nachádza vo vybranom bukete....\n extra.dboxinfo Informácie o systéme @@ -409,7 +420,7 @@ extra.dboxinfo_load Zaťaženie extra.dboxinfo_memory Pamäť extra.dboxinfo_ram RAM extra.dboxinfo_size Celkom -extra.dboxinfo_swap Swap +extra.dboxinfo_swap SWAP extra.dboxinfo_time Čas extra.dboxinfo_timeformat %F, %H:%M:%S extra.dboxinfo_uptime Beží @@ -429,42 +440,43 @@ extra.fec_9_10 9/10 extra.fec_auto Auto extra.key_current_transponder Aktuálny kľúč transpondéra extra.key_format_mode Mód obrazu -extra.key_help Tlačítko nápovedy +extra.key_help Tlačidlo nápovedy extra.key_list_end Na koniec extra.key_list_start Na začiatok -extra.key_next43mode Ďaľší pomer +extra.key_next43mode Nasledujúci pomer strán extra.key_pic_mode Formát obrazu extra.key_pic_size Zobrazenie formátu 4:3 -extra.key_pip_close Spustiť/Zastaviť PiP +extra.key_pip_close Spustiť / Zastaviť PiP extra.key_pip_setup Nastavenie PiP extra.key_pip_swap Prehodiť PiP/Hlavný obraz -extra.key_plugin Tlačítko zobrazujúce doplnky -extra.key_record Tlačítko nahrávania -extra.key_screenshot Tlačítko zosnímania obrazovky +extra.key_plugin Tlačidlo zobrazujúce doplnky +extra.key_record Tlačidlo nahrávania +extra.key_screenshot Tlačidlo zosnímania obrazovky extra.key_switchformat Ďaľšie rozlíšenie extra.key_timeshift Časový posun -extra.key_unlock Odblokuj +extra.key_unlock Odblokovanie extra.ladirection Umiestnenie zem.šírky extra.latitude Zem.šírka [N/S] -extra.loadconfig Nahraj nastavenia z ... -extra.loadkeys Nahraj nastavenia kláves z ... +extra.loadconfig Neutrino-HD: Obnoviť nastavenia z... +extra.loadkeys Obnoviť nastavenia kláves z ... extra.lodirection Umiestnenie zem.dľžky extra.longitude Zem.dľžka [E/W] extra.menu_left_exit "Ľavý" = návrat menu extra.north Severne -extra.record_time Rýchly čas nahrávania (hodiny) -extra.record_time_ts Maximálna dĺžka časového posuvu +extra.record_time Maximálny čas nahrávania +extra.record_time_ts Maximálna dĺžka časového posunu extra.rotor_swap Vymeniť východ/západ motoru extra.rounded_corners Vzhľad rohov extra.rounded_corners_off hranatý extra.rounded_corners_on zaoblený -extra.saveconfig Ulož nastavenia ako ... -extra.savekeys Ulož nastavenia kláves -extra.scrambled_message Správa kódovania +extra.saveconfig Neutrino-HD: Uložiť nastavenia do... +extra.savekeys Uložiť nastavenia kláves do ... +extra.scrambled_message Správa o kódovaní extra.show_mute_icon Ikona umlčania pri hlasitosti 0 extra.sms_channel Mód SMS pre kanál +extra.sms_movie SMS filmový mód extra.south Južne -extra.start_tostandby Spustenie do stavu pripravenosti +extra.start_tostandby Spustenie do pohotovostného režimu extra.temp_timeshift Dočasný časový posun extra.timeshift_pause Pozastavenie časového posunu extra.tp_bandwidth Šírka pásma @@ -478,7 +490,7 @@ extra.tp_bandwidth_auto Auto extra.tp_coderate_hp Coderate(HP) extra.tp_coderate_lp Coderate(LP) extra.tp_constellation Konštelácia -extra.tp_delsys Odbavovací systém +extra.tp_delsys Systém príjmu extra.tp_delsys_dss DSS extra.tp_delsys_dtmb DTMB extra.tp_delsys_dvbc DVB-C @@ -491,8 +503,8 @@ extra.tp_delsys_isdbc ISDB-C extra.tp_delsys_isdbs ISDB-S extra.tp_delsys_isdbt ISDB-T extra.tp_delsys_turbo Turbo -extra.tp_fec FEC -extra.tp_freq Kmitočet +extra.tp_fec Korekcia chybovosti (FEC) +extra.tp_freq Frekvencia extra.tp_gi Ochranný interval extra.tp_gi_19_128 19/128 extra.tp_gi_19_256 19/256 @@ -522,14 +534,14 @@ extra.tp_mod_64 QAM/64 extra.tp_mod_8 8PSK extra.tp_mod_auto QAM/AUTO extra.tp_pilot Pilot -extra.tp_pilot_auto Automaticky (HW) -extra.tp_pilot_auto_sw Automaticky (SW) +extra.tp_pilot_auto Auto (HW) +extra.tp_pilot_auto_sw Auto (SW) extra.tp_pol Polarizácia extra.tp_pol_h H extra.tp_pol_l L extra.tp_pol_r R extra.tp_pol_v V -extra.tp_rate Symbolová rýchlosť +extra.tp_rate Symbolová rýchlosť (SR) extra.tp_transmit_mode Vysielací režim extra.tp_transmit_mode_16k 16K extra.tp_transmit_mode_1k 1K @@ -540,7 +552,7 @@ extra.tp_transmit_mode_8k 8K extra.tp_transmit_mode_auto Auto extra.tp_transmit_mode_c1 C1 extra.tp_transmit_mode_c3780 C3780 -extra.update_dir Adresár aktualizácie +extra.update_dir Zložka aktualizácie extra.use_gotoxx Použi gotoXX extra.volume_digits Hlasitoť číselne extra.volume_pos Ukazovateľ hlasitosti @@ -551,33 +563,33 @@ extra.zapit_fe_timeout Časový limit naladenia (1 = 10 msek) extra.zapit_hvoltage 18V pri točení motora extra.zapit_make_bouquet Vykonaj ostatné zoznamy kanálov extra.zapit_motor_speed Rýchlosť točenia (10 = 1st/sek) -extra.zapit_scanpids Vyhľadávanie s PIDmi -extra.zapit_sdt_changed Zmenené kanály, načítavam nastavenia. +extra.zapit_scanpids Vyhľadať a použiť PIDy (Packet Identifier) +extra.zapit_sdt_changed Kanály zmenené, načítavanie nastavenia... fan_speed Rýchlosť CPU ventilátora favorites.addchannel Aktuálny kanál bude pridaný \ndo buketu "Obľúbené". \nTo potrvá niekoľko sekúnd... favorites.bouquetname Obľúbené favorites.bqcreated Buket "Obľúbené" bol vytvorený...\n favorites.chadded Aktuálny kanál bol pridaný do obľúbených...\n favorites.chalreadyinbq Aktuálny kanál sa už nachádza v obľúbených...\n -favorites.copy Kopíruj buket do Obľúbených -favorites.finalhint \nPouži editor buketov pre dokonačenie\nzmien v obľúbených.\n -favorites.menueadd Pridaj kanál do obľúbených +favorites.copy Kopírovať buket do Obľúbených +favorites.finalhint \nPoužiť editor buketov pre dokončenie\nzmien v obľúbených.\n +favorites.menueadd Pridať kanál do obľúbených favorites.nobouquets Obľúbené sú dostupné len pri použití Buketov. filebrowser.add Pridať filebrowser.delete Zmazať -filebrowser.denydirectoryleave Hlavný adresár -filebrowser.dodelete1 zmaž +filebrowser.denydirectoryleave Hlavná zložka +filebrowser.dodelete1 Zmazať filebrowser.dodelete2 ? -filebrowser.filter.active filtruj -filebrowser.filter.inactive nefiltruj +filebrowser.filter.active Filtrovať +filebrowser.filter.inactive Nefiltrovať filebrowser.head Prehliadač súborov -filebrowser.mark označ -filebrowser.nextpage nasl.strana +filebrowser.mark Označiť +filebrowser.nextpage Nasl.strana filebrowser.pm Manažér prehrávania -filebrowser.prevpage pred.strana +filebrowser.prevpage Predch.strana filebrowser.scan Prehľadanie adesára -filebrowser.select výber -filebrowser.showrights Zobraz práva súborov +filebrowser.select Výber +filebrowser.showrights Zobraziť práva súborov filebrowser.sort.date (dátum) filebrowser.sort.name (súbory) filebrowser.sort.namedirsfirst (kat,súbory) @@ -591,89 +603,91 @@ flashupdate.apply_settings Preniesť aktuálne nastavenia do nového image? flashupdate.autocheck Automatická kontrola aktualizácií pri zavádzaní flashupdate.cantopenfile Otvorenie súboru nemožné flashupdate.cantopenmtd Otvorenie MTD-zariadenia nemožné -flashupdate.checkupdate_internet Skontrolovať aktualizácie on-line +flashupdate.checkupdate_internet Kontrola aktualizácie cez sieť flashupdate.checkupdate_local Lokálna aktualizácia -flashupdate.copy_image Kopítrovať Image do hlavnej pamäte +flashupdate.copy_image Kopíruje sa Image do hlavnej pamäte flashupdate.createimage Uložiť Image flashupdate.createimage_add_env Pridať "env" flashupdate.createimage_add_kernel Pridať "kernel" -flashupdate.createimage_add_root1 Pridať "root1" +flashupdate.createimage_add_root1 Pridať 'root1' flashupdate.createimage_add_spare Pridať "spare" flashupdate.createimage_add_u_boot Pridať "u-boot" flashupdate.createimage_add_uldr Pridať "uldr" -flashupdate.createimage_add_var Pridať "var" +flashupdate.createimage_add_var Pridať 'var' flashupdate.createimage_menu Uložiť aktuálny softvér flashupdate.createimage_options Nastavenia -flashupdate.createimage_other Vytvorenie Image pre %s STB +flashupdate.createimage_other Vytvoriť Image pre %s STB flashupdate.createimage_warning Bude vytvorený Image pre %s STB.\nTento Image bude možné spustiť iba na %s STB!\n \nSkutočne pokračovať ? flashupdate.currentversion_sep Aktuálna verzia -flashupdate.currentversiondate Dátum -flashupdate.currentversiontime Hodina +flashupdate.currentversiondate Dátum: +flashupdate.currentversiontime Hodina: flashupdate.erasefailed Vymazanie pamäte FLASH sa nepodarilo flashupdate.erasing Mazanie pamäte FLASH -flashupdate.experimentalimage Vybraný IMAGE je testovacou verziou\na môže spôsobiť chybu zavádzania po inštalácii.\n\nNaozaj chceš nainštalovať túto verziu? +flashupdate.experimentalimage Zvolený softvér je testovacou verziou\na môže spôsobiť chybu zavádzania po inštalácii.\n\nNaozaj chcete nainštalovať túto verziu? flashupdate.expertfunctions Doplnkové funkcie flashupdate.fileis0bytes Veľkosť súboru je 0 bajtov flashupdate.fileselector Výber súboru -flashupdate.flashreadyreboot Nainštalovanie IMAGE je správne.\nBox sa opätovne spustí. +flashupdate.flashreadyreboot Softvér bol úspešne nainštalovaný.\nPrijímač sa opätovne spustí. flashupdate.getinfofile Získavanie informácie o verzii -flashupdate.getinfofileerror Nie je možné zistiť verziu +flashupdate.getinfofileerror Nie je možné zistiť verziu aktualizácie! flashupdate.getupdatefile Získavanie aktualizácie -flashupdate.getupdatefileerror Nie je možná aktualizácia +flashupdate.getupdatefileerror Aktualizácia nie je možná! flashupdate.globalprogress Celkový postup: -flashupdate.head SW aktualizácia -flashupdate.md5check Kontrola IMAGE -flashupdate.md5sumerror IMAGE má chyby +flashupdate.head Aktualizácia softvéru +flashupdate.install_image Aktualizovať stiahnutý softvér? +flashupdate.install_package Nainštalovať stiahnutý balík? +flashupdate.md5check Kontrola softvéru +flashupdate.md5sumerror Softvér má chyby flashupdate.menu_apply_kernel Nahranie jadra (kernelu) flashupdate.menu_apply_settings Povoliť aplikovanie nastavení -flashupdate.mkfs_create_image Vytvoriť Image -flashupdate.mkfs_preparing_files Pripraviť súbory a adresáre +flashupdate.mkfs_create_image Vytvoriť zálohu +flashupdate.mkfs_preparing_files Pripraviť súbory a zložky flashupdate.mkfs_using_sumtool Použiť "sumtool" -flashupdate.msgbox Zistený nový súbor:\nDátum: %s, %s\nZákledné Image: %s\nTyp: %s\n\nNaozaj prevziať a nainštalovať\ntento súbor? -flashupdate.msgbox_manual Zistený nový súbor:\nDátum: %s, %s\nZákladné Image: %s\nTyp IMAGE: %s\n\nNaozaj nainštalovať\ntento súbor? +flashupdate.msgbox Nájdená nová verzia:\nDátum: %s, %s\nZákladný Image: %s\nTyp: %s\n\nChcete stiahnúť a nainštalovať\ntúto verziu? +flashupdate.msgbox_manual Nájdená nová verzia:\nDátum: %s, %s\nZákladný Image: %s\nTyp Image: %s\n\nChcete nainštalovať\ntúto verziu? flashupdate.mtdselector Výber partície flashupdate.namemode1 Názov súboru nastavení flashupdate.namemode1_default +settings.img flashupdate.namemode1_hostname_time +<Čas>+settings.img flashupdate.namemode1_orgname_time +<Čas>+settings.img -flashupdate.namemode2 Zálohovanie súboru +flashupdate.namemode2 Názov súboru zálohy flashupdate.namemode2_default +<Čas>.img flashupdate.namemode2_hostname_time +<Čas>+.img -flashupdate.new_found Nájdený nový IMAGE ! -flashupdate.new_notfound Žiadny nový IMAGE -flashupdate.noversion Kontrola verzie je momentálne podporovaná len pri aktualizácii cez web.\nSkutočne chcet inštalovať tento IMAGE? +flashupdate.new_found Dostupná nová aktualizácia! +flashupdate.new_notfound Aktualizácia nie je k dispozícii +flashupdate.noversion Kontrola verzie je momentálne podporovaná len pri aktualizácii cez web.\nSkutočne chcete inštalovať túto verziu? flashupdate.programmingflash Programovanie pamäte FLASH flashupdate.proxypassword Heslo -flashupdate.proxypassword_hint1 Vloženie hesla servera proxy +flashupdate.proxypassword_hint1 Vloženie hesla proxy servera flashupdate.proxypassword_hint2 Prázdne pole znamená nepoužitie hesla -flashupdate.proxyserver Názov servera proxy +flashupdate.proxyserver Názov proxy servera flashupdate.proxyserver_hint1 Vloženie názovu servera proxy alebo IP (host:port) flashupdate.proxyserver_hint2 Prázdne pole znamená nepoužitie proxy servera -flashupdate.proxyserver_sep Server proxy +flashupdate.proxyserver_sep Proxy server flashupdate.proxyusername Užívateľ -flashupdate.proxyusername_hint1 Vloženie mena uživateľa servera proxy +flashupdate.proxyusername_hint1 Vloženie mena užívateľa proxy servera flashupdate.proxyusername_hint2 Prázdne pole znamená nepoužite autorizácie -flashupdate.read_directory_not_exist Zálohovací adresár %s \nneexistuje! +flashupdate.read_directory_not_exist Zálohovacia zložka %s \nneexistuje! flashupdate.read_no_available_space Maximálna dostupná veľkosť miesta v %s \nje %d KB, potrebné sú ale %d KB.\n \nOperácia sa zruší, vyberte iný disk! flashupdate.read_volume_error Veľkosť disku %s \nnie je možné zistiť! -flashupdate.readflash Načítanie celého IMAGE z pamäte FLASH +flashupdate.readflash Načítanie celého softvéru z pamäte FLASH flashupdate.readflashmtd Uloženie jednej partície -flashupdate.ready Hotovo. +flashupdate.ready Hotovo flashupdate.reallyflashmtd Naozaj vykonať programovanie?\n\nV prípade výskytu chyby alebo nesprávneho súboru\n box nenabehne.\n\nNázov súboru: %s\nCieľ: %s flashupdate.savesuccess IMAGE bol úspešne uložený \nako %s. -flashupdate.selectimage Dostupné súbory +flashupdate.selectimage Dostupné verzie / súbory flashupdate.settings Aktualizácia nastavení -flashupdate.titlereadflash Načítanie pamäte FLASH -flashupdate.titlewriteflash Zapísanie pamäte FLASH -flashupdate.update_with_settings_del_skipped Adresár [%s] nebol vymazaný. Zadanie je preskočené. +flashupdate.titlereadflash Načítavanie pamäte FLASH +flashupdate.titlewriteflash Zapisovanie pamäte FLASH +flashupdate.update_with_settings_del_skipped Zložka [%s] nebola vymazaná. Zadanie je preskočené. flashupdate.update_with_settings_error Chyba FLASH pamäte!\n \nNový IMAGE má len %ld KB (ostáva %ld KB) do konca. \nnedostatok miesta pre dokončenie operácie.\n \nOperácia prerušená! flashupdate.update_with_settings_processed IMAGE sa spracováva... -flashupdate.update_with_settings_skipped Adresár [%s] nebol uložený. Zadanie je preskočené. +flashupdate.update_with_settings_skipped Zložka [%s] nebola uložená. Zadanie je prerušené. flashupdate.update_with_settings_successfully Nastavenie úspešne prevzaté.\nIMAGE sa môže nahrať. -flashupdate.update_with_settings_warning Pozor nahrávanie!\n \nNový IMAGE má len %ld KB (ostáva %ld KB) do konca. Pravdepodobne \n je málo miesta na dokončenie operácie...\n \nSkutočne chcete pokračovať? +flashupdate.update_with_settings_warning Varovanie flash pamäte!\n \nNový IMAGE má len %ld KB (ostáva %ld KB) do konca. Pravdepodobne \n je málo miesta na dokončenie operácie...\n \nSkutočne chcete pokračovať? flashupdate.updatemode Spôsob aktualizácie flashupdate.updatemode_internet Internet -flashupdate.updatemode_manual Lokálny adresár +flashupdate.updatemode_manual Lokálna zložka flashupdate.url_file Konfiguračný súbor flashupdate.versioncheck Kontrola verzie flashupdate.writeflash Zapísanie celého IMAGE do pamäte FLASH @@ -682,7 +696,7 @@ flashupdate.wrongbase Vaša verzia je odlišná.\nPokračovať? fontmenu.channellist Zoznam kanálov fontmenu.epg EPG fontmenu.eventlist Programový sprievodca -fontmenu.head Nastavenia písma +fontmenu.head Nastavenie písma fontmenu.infobar Informačná lišta fontmenu.menu Menu fontmenu.other Iné @@ -692,7 +706,7 @@ fontmenu.scaling_x_hint2 Vodorovne (v %) min 50 / max 200 fontmenu.scaling_y Zvislo (v %) fontmenu.scaling_y_hint2 Zvislo (v %) min 50 / max 200 fontmenu.sizes Veľkosti písma -fontsize.channel_num_zap priamy výber +fontsize.channel_num_zap Priamy výber fontsize.channellist Zoznam kanálov fontsize.channellist_descr Popis fontsize.channellist_event Prehľad relácií @@ -701,23 +715,23 @@ fontsize.epg_date Dátum EPG fontsize.epg_info1 Informácia EPG 1 fontsize.epg_info2 Informácia EPG 2 fontsize.epg_title Titul EPG -fontsize.eventlist_datetime Dátum/Čas EPG +fontsize.eventlist_datetime Dátum / Čas EPG fontsize.eventlist_event Udalosť EPG fontsize.eventlist_itemlarge Veľké EPG fontsize.eventlist_itemsmall Malé EPG fontsize.eventlist_title Titul EPG fontsize.filebrowser_item Položka prehliadača súborov -fontsize.hint Inicializácia písma,\nprosím čakaj... +fontsize.hint Inicializácia písma,\nčakajte prosím... fontsize.infobar_channame Názov kanálu fontsize.infobar_info Informácia na informačnej lište +fontsize.infobar_ng_ecminfo ECM Informácia fontsize.infobar_number Kanál na informačnej lište -fontsize.infobar_small Malá informačná lišta fontsize.menu Text menu fontsize.menu_hint Popis menu fontsize.menu_info Informačné menu fontsize.menu_title Titulok menu fontsize.subtitles Text titulkov -fsk.all Vypnuté +fsk.all vyp fsk.from_12 od 12 fsk.from_16 od 16 fsk.from_18 od 18 @@ -731,42 +745,43 @@ hdd_20min 20 minút hdd_30min 30 minút hdd_5min 5 minút hdd_60min 60 minút -hdd_activate Použi nastavenia +hdd_activate Použiť nastavenia hdd_check Kontrola súborového systému -hdd_check_failed Chyba kontroly disku ! -hdd_check_format_bad Kontrola diskov s formátom %s ak je nepodporovaný. -hdd_extended_settings Rozšírené nastavenia disku -hdd_fast rýchle +hdd_check_failed Chyba kontroly disku! +hdd_check_format_bad Kontrola diskov s formátom %s nie je podporovaná. +hdd_extended_settings Rozšírené nastavenie disku +hdd_fast Rýchlo hdd_format Formátovanie HDD -hdd_format_failed Chyba počas formátovania disku ! +hdd_format_failed Chyba formátovania disku! hdd_format_warn Naozaj formátovať? Všetky dáta budú stratené! hdd_fs Súborový systém hdd_fs_unknown neznámy hdd_manage Spravovanie HDD -hdd_middle stredne +hdd_middle Stredne hdd_mount Pripojenie hdd_mount_failed Chyba pripojenia. hdd_mount_ok Zariadenie pripravené k používaniu. hdd_mount_umount Pripojenie/Odpojenie hdd_noise Hlučnosť (AAM) -hdd_not_found Nenájdený disk +hdd_not_found Disk nenájdený hdd_removable_device Odstrániteľné zariadenie -hdd_set_recdir Použiť zariadenie k nahrávaniu ? -hdd_settings Nastavenia HDD/USB -hdd_sleep Čas uspania -hdd_slow pomaly +hdd_set_recdir Použiť zariadenie k nahrávaniu? +hdd_settings Nastavenie HDD / USB +hdd_sleep Čas uspania / vypnutia +hdd_slow Pomaly hdd_statfs Zadaná úroveň dotazu -hdd_statfs_always vždy +hdd_statfs_always Vždy hdd_statfs_recording len pri nahrávaní hdd_umount Odpojenie -hdd_umount_warn Chyba počas odpojenia disku ! +hdd_umount_warn Chyba odpájania disku! hdd_umounted Zariadenie odstránené +imageinfo.api API: imageinfo.creator Vytvoril: imageinfo.date Dátum: imageinfo.dokumentation Dokumentácia: imageinfo.forum Fórum: -imageinfo.head Informácia o IMAGE -imageinfo.homepage Domov: +imageinfo.head Informácie o softvéri +imageinfo.homepage Adresa: imageinfo.image Image: imageinfo.kernel Jadro: imageinfo.license Licencia: @@ -774,9 +789,7 @@ imageinfo.vcs Git: imageinfo.version Verzia: inetradio.name Internetové rádio infoviewer.epgnotload EPG informácie nie sú načítané... -infoviewer.epgwait čakám na informácie EPG... -infoviewer.eventlist Prehľad EPG -infoviewer.languages Zvuk +infoviewer.epgwait Načítavanie EPG informácie... infoviewer.motor_moving Nastavenie antény infoviewer.next Nasleduje infoviewer.nocurrent Nedostupné informácie pre aktuálny program @@ -784,16 +797,14 @@ infoviewer.noepg EPG je nedostupné infoviewer.notavailable Kanál (teraz) nedostupný infoviewer.now Teraz infoviewer.selecttime Časy začatia -infoviewer.streaminfo Infodoplnky infoviewer.subchan_disp_pos Zobrazenie podkanálov -infoviewer.subchan_infobar Celé info -infoviewer.subservice Doplnkové služby -infoviewer.waittime Načítavanie hodín... +infoviewer.subchan_infobar Infolišta +infoviewer.waittime Načítavanie času... ipsetup.hint_1 Použi 0...9 alebo klávesy NAHOR/NADOL ipsetup.hint_2 OK = uloženie, EXIT = zrušenie keybindingmenu.RC Nastavenie ovládača -keybindingmenu.addrecord Pridanie nahrávania -keybindingmenu.addremind Pridanie zmeny kanálu +keybindingmenu.addrecord Pridať časovač nahrávania +keybindingmenu.addremind Pridať časovač prepnutia keybindingmenu.allchannels_on_ok Všetky kanály keybindingmenu.bouquetchannels_on_ok Aktuálny buket keybindingmenu.bouquetdown Predchádzajúci buket @@ -804,17 +815,17 @@ keybindingmenu.cancel Zatvorenie zoznamu kanálov keybindingmenu.channeldown Nasledujúci kanál keybindingmenu.channellist Zoznam kanálov keybindingmenu.channelup Predchádzajúci kanál -keybindingmenu.edit Úprava -keybindingmenu.head Nastavenie klávesov -keybindingmenu.lastchannel Späť na posledný kanála +keybindingmenu.edit Upraviť nastavenia kláves +keybindingmenu.head Nastavenia kláves +keybindingmenu.lastchannel Späť na posledný kanál keybindingmenu.longkeypress_duration Dlhý stisk klávesy keybindingmenu.misc Rôzne -keybindingmenu.mode_left_right_key_tv Činnosť Ľavého/Pravého kurzora v TV režime -keybindingmenu.mode_left_right_key_tv_infobar Zobraz informačnú lištu +keybindingmenu.mode_left_right_key_tv Činnosť ľavého / pravého kurzora v TV režime +keybindingmenu.mode_left_right_key_tv_infobar Zobraziť informačnú lištu keybindingmenu.mode_left_right_key_tv_volume Ovládanie hlasitosti keybindingmenu.mode_left_right_key_tv_vzap Virtuálne prepnutie keybindingmenu.mode_left_right_key_tv_zap Prepnutie -keybindingmenu.modechange Zmena spôsobu +keybindingmenu.modechange Zmena režimu keybindingmenu.navigation Navigácia keybindingmenu.pagedown Nasledujúca strana keybindingmenu.pageup Predchádzajúca strana @@ -825,7 +836,7 @@ keybindingmenu.remotecontrol_hardware_coolstream CST keybindingmenu.remotecontrol_hardware_dbox d-box Nokia keybindingmenu.remotecontrol_hardware_msg_part1 Diaľkové ovládanie bolo zmenené z ' keybindingmenu.remotecontrol_hardware_msg_part2 ' na ' -keybindingmenu.remotecontrol_hardware_msg_part3 \nJe to správne ?\nProsím potvrdiť tento výber do 15 sekúnd použitím nového ovládača.\nInak bude výber vrátený. +keybindingmenu.remotecontrol_hardware_msg_part3 \nJe to správne ?\nPotvrďte prosím tento výber do 15 sekúnd použitím nového ovládača,\ninak bude výber zrušený. keybindingmenu.remotecontrol_hardware_philips Philips keybindingmenu.remotecontrol_hardware_tripledragon Triple Dragon keybindingmenu.repeatblock Základné oneskorenie @@ -834,48 +845,53 @@ keybindingmenu.sort Zmena poradia triedenia keybindingmenu.special_active Špeciálne klávesy keybindingmenu.subchanneldown Predchádzajúci podkanál keybindingmenu.subchannelup Nasledujúci podkanál -keybindingmenu.tvradiomode TV/Rádio +keybindingmenu.tvradiomode TV / Rádio keybindingmenu.video Obraz keybindingmenu.volume Hlasitosť keybindingmenu.volumedown Znížiť keybindingmenu.volumeup Zvýšiť keybindingmenu.zaphistory História prepínania buketov -keychooser.head Nastvenie nového klávesu -keychooser.text1 Stlač kláves -keychooser.text2 Čakám na stlačenie -keychoosermenu.currentkey aktuálny kláves -keychoosermenu.setnew Nastavenie nového klávesu +keychooser.head Nastavenie novej klávesy +keychooser.text1 Stlačte prosím klávesu +keychooser.text2 Čaká sa na stlačenie +keychoosermenu.currentkey Aktuálna klávesa +keychoosermenu.setnew Nastavenie novej klávesy keychoosermenu.setnone Zrušenie priradenia -languagesetup.head Nastavenie jazyka +languagesetup.head Jazyk / Časové pásmo languagesetup.osd Jazyk OSD -languagesetup.select Jazyk1 -lcd_info_line Zobrazenie v inforiadku +languagesetup.select Jazyk +lcd_info_line Zobrazenie v infolište lcd_info_line_channel Názov kanálu lcd_info_line_clock Hodiny lcdcontroler.brightness Jas -lcdcontroler.brightnessdeepstandby Jas v hlbokom spánku -lcdcontroler.brightnessstandby Jas v spánku -lcdmenu.dim_brightness Jas po zhasnutí +lcdcontroler.brightnessdeepstandby Jas vo vypnutom stave +lcdcontroler.brightnessstandby Jas v pohotovostnom režime +lcdmenu.dim_brightness Jas po uplynutí času zhasnutia lcdmenu.dim_time Čas zhasnutia lcdmenu.head Nastavenie VFD lcdmenu.lcdcontroler Jas +lcdmenu.notify_rclock Upozorniť na uzamknuté DO lcdmenu.scroll Povoliť pohyb textu lcdmenu.statusline Stavový riadok lcdmenu.statusline.both hlasitosť/odohratý čas -lcdmenu.statusline.playtime odohratý čas -lcdmenu.statusline.volume hlasitosť +lcdmenu.statusline.playtime Odohratý čas +lcdmenu.statusline.volume Hlasitosť ledcontroler.backlight Podsvietené tlačidlá ledcontroler.backlight.tv TV režim -ledcontroler.blink Blikať v hlbokom spánku ak je nastavený časovač -ledcontroler.menu Podsvietenie Power tlačítka -ledcontroler.mode.deepstandby Hlboký spánok +ledcontroler.blink Blikať pri vypnutí, ak je nastavený časovač +ledcontroler.menu Podsvietenie tlačidla napájania +ledcontroler.mode.deepstandby Vypnutie ledcontroler.mode.record Blikať pri nahrávaní -ledcontroler.mode.standby Pripravenosť +ledcontroler.mode.standby Pohotovostný režim ledcontroler.mode.tv TV režim ledcontroler.off Led1 a Led2 vyp. ledcontroler.on.all Led1 a Led2 zap. ledcontroler.on.led1 Led1 zap. ledcontroler.on.led2 Led2 zap. +livestream.head Online data +livestream.read_data Načítavanie dát... +livestream.resolution Rozlíšenie +livestream.scriptpath Script path lua.boolparam_deprecated1 Upozornenie! lua.boolparam_deprecated2 Použité číslo alebo reťazec lua.boolparam_deprecated3 pre Boolean parameter je zastarané.\n Prosím použiť prirodzenú bool hodnotu napr. @@ -883,54 +899,63 @@ lua.function_deprecated1 Upozornenie! lua.function_deprecated2 Funkcia lua.function_deprecated3 je kritická,\n prosím použiť lua.parameter_deprecated2 Parameter -lua.versionscheck1 Vaša Lua API veryia je zastaralá -lua.versionscheck2 Je vyžadovaná novšia +lua.versionscheck1 Verzia API je príliš stará +lua.versionscheck2 Je potrebná minimálne mainmenu.audioplayer Prehrávač hudby mainmenu.channels Zoznam kanálov -mainmenu.clearsectionsd Vyčistenie EPG zachytávania +mainmenu.clearsectionsd Vyčistenie uloženého EPG mainmenu.games Hry mainmenu.head Hlavné menu -mainmenu.lua Doplnky +mainmenu.lua Lua doplnky mainmenu.media Média mainmenu.movieplayer Prehrávač filmov mainmenu.pausesectionsd Načítavanie EPG mainmenu.pictureviewer Prehliadač obrázkov mainmenu.radiomode Rádio -mainmenu.reboot Reboot +mainmenu.reboot Reštartovať mainmenu.recording Nahrávanie mainmenu.recording_start Spustiť mainmenu.recording_stop Zastaviť mainmenu.scripts Skripty -mainmenu.service Služby +mainmenu.service Inštalácia / služby mainmenu.settings Nastavenia mainmenu.shutdown Vypnúť -mainmenu.shutdown_menu Nastavenie vypnutia +mainmenu.shutdown_menu Vypnutie... mainmenu.sleeptimer Časovač vypnutia -mainmenu.standby Pohotovostný stav +mainmenu.standby Pohotovostný režim mainmenu.tools Nástroje -mainmenu.tvmode TV -mainmenu.tvradio_switch Prepnutie TV-Rádio +mainmenu.tvmode TV mód +mainmenu.tvradio_switch Prepnutie TV / Rádio mainsettings.audio Zvuk mainsettings.head Nastavenia -mainsettings.keybinding Nastavenia kláves +mainsettings.keybinding Nastavenie kláves mainsettings.language Jazyk / Časové pásmo -mainsettings.lcd Zobrazovač VFD -mainsettings.manage Spravovanie nastavení -mainsettings.misc Iné nastavenia +mainsettings.lcd Predný panel / VFD +mainsettings.manage Správa nastavení +mainsettings.misc Rôzne nastavenia mainsettings.multimedia Multimédia mainsettings.network Sieť -mainsettings.osd Nastavenia OSD +mainsettings.osd Nastavenie OSD mainsettings.recording Nahrávanie -mainsettings.savesettingsnow Uloženie nastavenia -mainsettings.savesettingsnow_hint Ukladanie nastavení,\nprosím čakaj... +mainsettings.savesettingsnow Uloženie nastavení +mainsettings.savesettingsnow_hint Ukladanie nastavení,\nčakajte prosím... mainsettings.timezone Časová zóna mainsettings.video Obraz -menu.back späť -menu.cancel zrušiť -menu.hint_a_pic Nastavenie prehrávača hudby a obrázkového prehliadača +mbkey.copy_onefile Kopírovať film +mbkey.copy_several Kopírovať a rozdeliť film +mbkey.cover Vytvoriť/odstrániť náhľad filmu +mbkey.cut Vystrihnúť film +mbkey.truncate Skrátiť film +menu.back Späť +menu.cancel Zrušiť +menu.hint_a_pic Nastavenie prehrávača hudby, prehliadača obrázkov, WebTV, TS, YouTube +menu.hint_adzap Automatické prepnutie prepne späť na aktuálny kanál ak uplynie zvolený čas +menu.hint_adzap_active Automatické prepnutie je aktívne. Novým prepnutím bude deaktivované. +menu.hint_adzap_setup Nastavenia služby automatického prepnutia +menu.hint_adzap_writedata Zapísanie dát na základe stavu funkcie automatického prepnutia do zložky /tmp/adzap.data menu.hint_aplay Prehrávanie zvukových súborov -menu.hint_aplay_setup Zmena zobrazenia titulu, východzieho adresára, šetriča a ďaľšieho -menu.hint_audio Audio výstup, DD, SRS TrueVolume \nVoľby +menu.hint_aplay_setup Zmena zobrazenia titulu, predvolená zložka, šetrič obrazovky a ďaľšie +menu.hint_audio Zvukový výstup, Dolby Digital, SRS TrueVolume voľby a iné menu.hint_audio_adjust_vol_ac3 Špecifické nastavenie hlasitosti pre AC3 prúdy menu.hint_audio_adjust_vol_clear Vyčistenie všetkých uložených hodnôt pre PCM a AC3 prúdy menu.hint_audio_adjust_vol_pcm Špecifické nastavenie hlasitosti pre PCM prúdy @@ -943,50 +968,52 @@ menu.hint_audio_srs SRS TruVolume ovládanie hlasitosti \npoužitím zmien obsah menu.hint_audio_srs_algo Účinnosť ovládania, jemná alebo klasická menu.hint_audio_srs_nmgr Potlačovač šumu menu.hint_audio_srs_volume Referenčná úroveň citlivosti -menu.hint_audio_volstart Vždy nastaví zvolenú hodnotu hlasitosti pri spustení +menu.hint_audio_volstart Vždy nastaviť zvolenú hodnotu hlasitosti pri spustení menu.hint_audio_volstep Zvýšenie/zníženie kroku pre klávesy VOL +/- -menu.hint_audioplayer_defdir Prednastavený adresár prehrávača hudby -menu.hint_audioplayer_follow Pohyb vybraného ukazovateľa zoznamu prehrávania\nna aktuálne hrajúcu pieseň +menu.hint_audioplayer_defdir Prednastavená zložka prehrávača hudby +menu.hint_audioplayer_follow Pohyb vybraného ukazateľa zoznamu prehrávania\nna aktuálne hrajúcu pieseň menu.hint_audioplayer_highprio Zvýšenie priority prehrávania -menu.hint_audioplayer_order Zmena triedenia zonamu prehrávania +menu.hint_audioplayer_order Zmena triedenia zoznamu prehrávania menu.hint_audioplayer_playlist Zobrazenie položiek zoznamu prehrávania menu.hint_audioplayer_repeat Použiť opakovanie zoznamu prehrávania pri dosiahnutí konca menu.hint_audioplayer_sc_metadata Použije extrakciu meta-dát z prehrávaného zvuku menu.hint_audioplayer_title Použije SMS štýl vyhľadávania titulov v zozname prehrávania menu.hint_auto_lang Automatické prepnutie zvuku na preferovaný jazyk menu.hint_auto_subs Automatické spustenie titulkov pre preferovaný jazyk -menu.hint_back Návrat do predchádzajúcej položky.\nStlačenie MENU klávesy uzavrie všetky položky +menu.hint_back Návrat do predchádzajúcej položky.\nStlačením tlačidla MENU okamžite opustíte menu. menu.hint_back_brief Návrat do predchádzajúcej ponuky menu.hint_backlight Nastavenie podsvietených tlačidiel -menu.hint_backup Záloha konfigurácií a kanálov do vybraného adresára +menu.hint_backup Záloha konfigurácie a kanálov do vybranej zložky menu.hint_bedit Úprava obľúbených a buketov -menu.hint_buildinfo Informácie o kompileroch, kompilácii, jadre -menu.hint_cache_txt Spustenie zachytávania teletextu po prepnutí kanála +menu.hint_buildinfo Informácie o kompiléroch, kompilácii, jadre +menu.hint_cache_txt Spustenie vyrovnávacej pamäte teletextu po prepnutí kanálu menu.hint_cec_mode CEC režim -menu.hint_cec_standby Ováldanie externými CEC príkazami v pripravenosti -menu.hint_cec_view_on Ovládanie externými CEC príkazami pri sledovaní -menu.hint_channellist_additional Zobrazenie doplnkových informácií\nv hlavnom boxe +menu.hint_cec_standby Ovládanie externými CEC príkazmi v pohotovostnom režime +menu.hint_cec_view_on Ovládanie externými CEC príkazmi pri sledovaní TV +menu.hint_channellist_additional Zobrazenie doplnkových informácií\nv hlavnom okne menu.hint_channellist_epg_align Zarovnanie EPG udalostí menu.hint_channellist_extended Grafické zobrazenie aktuálnej udalosti menu.hint_channellist_fonts Zmena veľkosti písma zoznamu kanálov -menu.hint_channellist_foot Zobrazenie ďaľších informácií\nv dolnom boxe +menu.hint_channellist_foot Zobrazenie ďalších informácií\nv dolnom boxe menu.hint_channellist_mode Použiť vybraný režim zoznamu kanálov pri spustení ak posledný režim je TV menu.hint_channellist_mode_radio Použiť vybraný režim zoznamu kanálov pri spustení ak posledný režim je Radio menu.hint_channellist_setup Konfigurácia GUI volieb zonamu kanálov menu.hint_channellist_show_channellogo Zobrazenie loga staníc v zozname kanálov -menu.hint_channellist_show_channelnumber Zobrazenie čísla kanála v zozname kanálov +menu.hint_channellist_show_channelnumber Zobrazenie čísla kanálu v zozname kanálov menu.hint_channellist_show_empty_favs Zobrazenie / skrytie prázdnych buketov v obľúbených -menu.hint_channellist_show_infobox Zobrazenie / skrytie dolneho InfoBoxu zo zoznamu kanálov -menu.hint_channels Otvorí zoznam kanálov +menu.hint_channellist_show_infobox Zobraziť alebo skryť informačnú lištu na spodnom okraji v zozname kanálov +menu.hint_channels Otvoriť zoznam kanálov menu.hint_ci Nastavovacie menu podmieneného pristupu\npre váš CI CAM alebo vloženú Conax kartu menu.hint_clock_background Zobrazenie hodín s farbami témy vzhľadu menu.hint_clock_mode Zapnutie alebo vypnutie zobrazenia hodín -menu.hint_clock_seconds Zobraenie formátu času so sekundami +menu.hint_clock_seconds Zobrazenie formátu času so sekundami menu.hint_clock_size Nastavenie veľkosti informačných hodín. menu.hint_clock_textcolor Nastavenie ferieb číslic -menu.hint_color_gradient Prepne farebné prechody pre rôzne položky ponuky Zap/Vyp -menu.hint_color_gradient_direction Definujte smer farebného prechodu. -menu.hint_color_gradient_separator_enable Povoliť/zakázať farebný gradient pre menu oddeľovacích liniek +menu.hint_color_gradient Zapína alebo vypína farebné prechody pre rôzne položky ponuky +menu.hint_color_gradient_direction Definícia smeru farebnej výplne. +menu.hint_color_gradient_separator_enable Zakázať/povoliť farebnú výplä pre oddelovacie čiary +menu.hint_colored_events Použiť odlišnú farbu pre aktuálnu alebo nasledujúcu udalosť +menu.hint_colored_events_textcolor Zmena farby pre farebné udalosti v zozname kanálov a na informačnej lište menu.hint_colors Konfigurácia farieb GUI menu.hint_content_back Zmena farby podkladu GUI okna menu.hint_content_textcolor Zmena farby textu GUI okna @@ -994,29 +1021,29 @@ menu.hint_contrast_fonts Zvýraznenie kontrastu pisma (neúčinné pri podklade) menu.hint_dboxinfo Informácia o procesore a úložisku menu.hint_delete_channels Odstránenie všetkých kanálov menu.hint_delete_removed Vymazanie kanálov v bukete "Odstránené kanaly" -menu.hint_epg_cache Maximum dní pre zachytávanie ďaľších udalostí -menu.hint_epg_dir Výber adresára na disku alebo usb \npre uloženie EPG. -menu.hint_epg_extendedcache Maximálny čas zachytávania\npopisov doplňujúcich udalostí +menu.hint_epg_cache Maximálny počet dní pre ukladanie ďalších udalostí +menu.hint_epg_dir Výber zložky na disku alebo usb \npre uloženie EPG. +menu.hint_epg_extendedcache Maximálny čas ukladania\npopisov doplňujúcich udalostí menu.hint_epg_fonts Zmena veľkosti písma okna EPG podrobností -menu.hint_epg_max_events Maximum udalostí zachytávania. Po dosiahnutí hranice\nEPG cache odstráni nasledujúce udalosti -menu.hint_epg_old_events Hodiny po skončení udalosti aby sa označilo\nako staré a odstránilo sa zo zachytávania +menu.hint_epg_max_events Maximálny počet uložených udalostí. Po dosiahnutí hranice\nEPG cache odstráni nasledujúce udalosti +menu.hint_epg_old_events Hodiny po skončení udalosti, kedy sa označí\nako staré a odstráni sa z uložených menu.hint_epg_read Načíta uložené EPG údaje po zavedení z externého zariadenia -menu.hint_epg_save Uloženie zachyteného EPG na disk alebo usb\na načítanie po spustení -menu.hint_epg_save_frequently Uloženie zachyteného EPG v pravidelných intervaloch na externé zariadenie -menu.hint_epg_save_mode Kešovať EPG len pre kanály prítomné v obľúbených buketoch -menu.hint_epg_save_standby Uloženie EPG v režime pripravenosti +menu.hint_epg_save Uloženie EPG na disk alebo usb\pre načítanie po spustení +menu.hint_epg_save_frequently Ukladanie EPG v pravidelných intervaloch na externé zariadenie +menu.hint_epg_save_mode Ukladať EPG iba pre kanály uložené v obľúbených buketoch +menu.hint_epg_save_standby Uložiť EPG pred prechodom do pohotovostného režimu menu.hint_epg_scan Povolenie prehľadávania EPG na pozadí ak je voľný tuner -menu.hint_epg_scan_mode Výber výsledku príjmača pre spustenie prehľadania EPG +menu.hint_epg_scan_mode Výber výsledku prijímača pre spustenie prehľadania EPG menu.hint_eventlist_additional Zobrazí podrobnejšie informácie\nv hlavnom okne menu.hint_eventlist_fonts Zmena veľkosti písma zoznamu udalostí -menu.hint_eventlist_setup Konfigurácia GUI volieb zoznamu udalostí +menu.hint_eventlist_setup Konfigurácia GUI volieb zoznamu udalostí v EPG menu.hint_extended Správa napájania, voľby ukladania/nahrania EPG \nHDMI-CEC, štartovací kanál, voľby prepínania -menu.hint_factory Reset príjmača do výrobného stavu\nPríjmač sa musí rebotovať po resete +menu.hint_factory Reset prijímača do výrobného stavu. Prijímač sa musí po resete zreštartovať. menu.hint_fade Postupné miznutie GUI okien menu.hint_fan_speed Kontrola rýchlosti ventilátora -menu.hint_filebrowser_denydirectoryleave Nepovoliť prehliadaču súborov odísť z hlavného adresára +menu.hint_filebrowser_denydirectoryleave Nepovoliť prehliadaču súborov odísť z hlavnej zložky menu.hint_filebrowser_showrights Zobrazenie oprávnení súboru v prehliadači súborov -menu.hint_fileplay Prehrávanie rôznych obrazových súborov +menu.hint_fileplay Prehrávanie video súborov (mkv, mp4 atd.) menu.hint_filesystem_is_utf8 Kódovanie súborového systemu prehliadača súborov menu.hint_font_gui Výber súboru písma pre GUI menu.hint_font_scaling Zvislé a vodorovné nastavenie globálnej mierky písma @@ -1030,29 +1057,30 @@ menu.hint_hdd_fmt Výber formátu disku menu.hint_hdd_format Vytvorenie HDD partície a jej formátovanie menu.hint_hdd_noise Nastavenie Automatic Acoustic Management\nnie je podporované u všetkých zariadení menu.hint_hdd_sleep Výber času zastavenia disku pri neaktivite -menu.hint_hdd_statfs Určí kedy úroveň zaplnenia adresára nahrávania v "infovieweri" a ak je dostupné bude aktualizované na VFD +menu.hint_hdd_statfs Určiť úroveň zaplnenia zložky nahrávania v "infovieweri" a ak je dostupné, bude aktualizované na VFD menu.hint_hdd_tools Inicializácia HDD, kontrola súborového systému menu.hint_head_back Zmena farby podkladu nadpisu hlavičky menu.hint_head_textcolor Zmena farby nadpisu hlavičky menu.hint_imageinfo Informácia o inštalovanom programe -menu.hint_inact_timer Vypnutie príjmača pri neaktivite +menu.hint_inact_timer Vypnutie prijímača pri neaktivite menu.hint_inactive_back Zmena farby podkladu nektívnej položky menu.hint_inactive_textcolor Zmena farby textu neaktívnej položky menu.hint_inet_radio Internetové rádia -menu.hint_info Informácia o IMAGE, systéme, streame a podmienenom prístupe +menu.hint_info Informácia o softvéri, systéme, streame a podmienenom prístupe menu.hint_infobar_back Zmena farby podkladu informačnej lišty +menu.hint_infobar_buttons_usertitle Vynúti užívateľom definované názvy farebných tlačidiel menu.hint_infobar_casys áno: zobrazí všetko farebne,\n CA mini: jedna ikona zámku, CA mód: len aktívne systémy, nie: nezobrazí -menu.hint_infobar_casys_color Zmena farby pozadia CA-Systému -menu.hint_infobar_casys_dotmatrix Ihličkový CA-Systém v pozadí -menu.hint_infobar_casys_frame áno: CA-Systém s rámom +menu.hint_infobar_casys_color Zmena pozadia farby CA-Systému +menu.hint_infobar_casys_dotmatrix on: CA-Systém s bodmi v pozadí +menu.hint_infobar_casys_frame on: CA-Systém s rámom menu.hint_infobar_dd Zobrazenie DolbyDigital ikony menu.hint_infobar_filesys Zobrazenie úrovne obsadenia pamäte a disku menu.hint_infobar_fonts Zmena veľkosti fontu informačnej lišty -menu.hint_infobar_logo Voľby loga / signálu -menu.hint_infobar_logo_dir Výber adresára pre vyhľadanie loga kanálu +menu.hint_infobar_logo Zobrazenie loga, čísla kanálu a signálu; Voľby v [zátvorkách] budú zobrazené v malom informačnom okne +menu.hint_infobar_logo_dir Výber zložky pre vyhľadanie loga kanálu menu.hint_infobar_on_epg Zobrazenie informačnej lišty pri zmene aktuálnej udalosti EPG menu.hint_infobar_radiotext Zobrazí rádiotext okno -menu.hint_infobar_res Zobrazenie ikony rozlíšenia kanála +menu.hint_infobar_res Zobrazenie ikony rozlíšenia kanálu menu.hint_infobar_sat Zobrazenie aktuálneho satelitného alebo káblového poskytovateľa menu.hint_infobar_setup Nastavenie vlastností informačnej lišty menu.hint_infobar_textcolor Zmena farby textu informačnej lišty @@ -1066,7 +1094,6 @@ menu.hint_key_binding Predefinovanie kláves použitých pre príkazové operác menu.hint_key_bouquetdown Pridelenie klávesy pre zmenu zoznamu kanálov\ndo predchádzajúceho buketu menu.hint_key_bouquetup Pridelenie klávesy pre zmenu zoznamu kanálov\ndo nasledujúceho buketu menu.hint_key_cancel Pridelenie klávesy pre zatvorenie GUI okna -menu.hint_key_channel_sms Ak zapnuté, číselné klávesy v zozname kanálov\nsú použité na hľadanie kanála v SMS štýle menu.hint_key_channeldown Priradenie klávesy pre rýchlu zmenu na predchádzajúci\nkanál v zozname kanálov menu.hint_key_channellist Konfigurácia klávesových skratiek pre zoznam kanálov menu.hint_key_channelup Priradenie klávesy pre rýchlu zmenu na nasledujúci\nkanál v zozname kanálov @@ -1078,7 +1105,8 @@ menu.hint_key_left_exit Povolí návrat do predchádzajúceho menu s klávesou ' menu.hint_key_list_end Priradenie klávesy pre skok na koniec zoznamu menu.hint_key_list_start Priradenie klávesy pre skok na žačiatok zoznamu menu.hint_key_load Nahrá klávesové skratky zo súboru -menu.hint_key_modechange Zmena TV/Rádio režimu a kláves pripravenosti +menu.hint_key_modechange Zmena TV/Rádio režimu a kláves pohotovostného režimu +menu.hint_key_moviebrowser Konfigurácia priradenia kláves prehliadača filmov menu.hint_key_movieplayer Konfigurácia klávesových skratiek pre prehrávač filmov menu.hint_key_mpaudio Priradenie klávesy pre zobrazenie výberu zvuku\nv režime nahrávky menu.hint_key_mpbookmark Priradenie klávesy pre vytvorenie záložky\npočas nahrávky @@ -1096,10 +1124,10 @@ menu.hint_key_pic_mode_active Povolenie/zakázanie klávesy pre zmenu formátu o menu.hint_key_pic_size_active Povolenie/zakázanie klávesy pre zmenu správneho zobrazenia 4:3 menu.hint_key_pip_close Priradenie klávesy pre ukončenie PiP\nalebo spustenia ho na aktuálnom kanály menu.hint_key_pip_setup Priradenie klávesy pre konfiguráciu PiP -menu.hint_key_pip_swap Priradenie klávesy pre zmenu PiP a živého kanála +menu.hint_key_pip_swap Priradenie klávesy pre zmenu PiP a živého kanálu menu.hint_key_plugin Priradenie klávesy pre vykonanie jedného vyskúšania doplnku -menu.hint_key_poweroff Priradenie klávesy pre zmenu stavu napájania\n (pripravenosť/spánok <-> práca) -menu.hint_key_quickzap Konfigurácia klávesových skratiek pre rýchlu\nzmenu kanála +menu.hint_key_poweroff Priradenie klávesy pre zmenu stavu napájania\n (pohotovostný režim/vypnutie <-> práca) +menu.hint_key_quickzap Konfigurácia klávesových skratiek pre rýchlu\nzmenu kanálu menu.hint_key_record Priradenie klávesy pre spustenie nahrávania menu.hint_key_repeatblock Oneskorenie po stlačení klávesy a pred\nprvým opakovním povelu menu.hint_key_repeatblockgeneric Oneskorenie medzi opakovanim povelov\npočas stlačenia klávesy @@ -1110,46 +1138,47 @@ menu.hint_key_sort Priradenie klávesy pre zmenu triedenia zoznamu kanálov menu.hint_key_special_active Povolenie/zakázanie niektorých špeciálnych kláves menu.hint_key_subchanneldown Priradenie klávesy pre rýchlu zmenu\n do predchádzajúceho subkanálu menu.hint_key_subchannelup Priradenie klávesy pre rýchlu zmenu\n do nasledujúceho subkanálu -menu.hint_key_timeshift Priradenie klávesy pre spustenie časového posunu +menu.hint_key_timeshift Priradiť tlačidlo na spustenie časového nahrávania (timeshift) menu.hint_key_transponder Priradenie klávesy pre zobrazenie zoznamu kanálov\nz aktuálneho transpondéra menu.hint_key_tvradiomode Priradenie klávesy pre zmenu TV <> Rádio režimu -menu.hint_key_unlock Priradenie klávesy pre odomknutie poľa ak je zamknuté\nPre odomknutie stlačiť 'RED', potom počas 5 sekúnd to tlačítko +menu.hint_key_unlock Priradenie klávesy pre odomknutie poľa ak je zamknuté\nPre odomknutie stlačiť 'RED', potom počas 5 sekúnd to tlačidlo menu.hint_key_volumedown Priradenie klávesy pre zníženie hlasitosti menu.hint_key_volumeup Priradenie klávesy pre zvýšenie hlasitosti -menu.hint_keys Rýchlosť opakovania diaľkového ovládača\nÚprava väzieb tlačítok +menu.hint_keys Rýchlosť opakovania diaľkového ovládača\nÚprava väzieb tlačidiel menu.hint_lang_pref Konfigurácia preferovaného zvuku, EPG a jazyka titulkov menu.hint_language OSD jazyk, časové pásmo\nPreferovaný zvuk a jazyk titulkov -menu.hint_last_radio Spustenie príjmača na vybranom kanáli\nak posledný režim je Rádio -menu.hint_last_tv Spustenie príjmača na vybranom kanáli\nak posledný režim je TV -menu.hint_last_use Spustenie príjmača na poslednom použitom kanáli +menu.hint_last_radio Spustenie prijímača na vybranom kanáli\nak posledný režim je Rádio +menu.hint_last_tv Spustenie prijímača na vybranom kanáli\nak posledný režim je TV +menu.hint_last_use Spustenie prijímača na poslednom použitom kanáli menu.hint_leds_blink Blikanie LED v režime spánku menu.hint_leds_deepstandby Stav LED v režime spánku menu.hint_leds_record Stav LED počas nahrávania -menu.hint_leds_standby Stav LED v režime pripravenosti +menu.hint_leds_standby Stav LED v pohotovostnom režime menu.hint_leds_tv Funkčný stav LED -menu.hint_load Nahranie GUI nastavení zo súboru +menu.hint_load Načítanie Neutrino-HD nastavení grafického užívateľského rozhrania (GUI) zo súboru menu.hint_longkeypress_duration Stlačenie klávesy bude vyhodnotené ako "dlhý stisk klávesy" ak bude stlačené dlhšie ako špecifikovaný čas. menu.hint_lua Spustenie doplnkov -menu.hint_make_hdlist Automaticky vytvorí HD zoznam kanálov na základe\ntypu kanála a názvu -menu.hint_make_newlist Vytvorí zoznam nedávno pridaných kanálov -menu.hint_make_removedlist Vytvorí zoznam nedávno odstránených kanálov -menu.hint_make_webtvlist Automaticky vytvorí WebTV zoznam kanálov na základe\ntypu kanála a názvu -menu.hint_manage_settings Záloha, obnova, východzí stav\nVýrobné nastavenie príjmača -menu.hint_mb Vaše nahrávky +menu.hint_make_hdlist Automaticky vytvorí HD zoznam kanálov na základe\ntypu kanálu a názvu +menu.hint_make_newlist Vytvoriť zoznam nedávno pridaných kanálov +menu.hint_make_removedlist Vytvoriť zoznam nedávno odstránených kanálov +menu.hint_make_webtvlist Automaticky vytvorí WebTV zoznam kanálov na základe\ntypu kanálu a názvu +menu.hint_manage_settings Záloha, obnova, východzí stav, výrobné nastavenie prijímača +menu.hint_mb Vaše nahrávky, prehrávanie súborov .ts +menu.hint_mbkey_cover Priradiť tlačidlo na vytvorenie náhľadu filmu počas prehrávania alebo na vymazanie v prehliadači filmov menu.hint_media Prehrávanie filmov a hudby, prezeranie obrázkov menu.hint_menu_fonts Zmena veľkosti písma menu -menu.hint_menu_hints Zobrazí túto radu. Taktiež môžno zmeniť\nkedykoľvek použitím ´HELP´ tlačítka +menu.hint_menu_hints Zobrazí túto nápovedu. Taktiež môžno kedykoľvek zmeniť použitím tlačidla ´HELP´. menu.hint_menu_pos Výber umiestnenia menu menu.hint_menus Konfigurácia volieb ponuky menu.hint_misc_cec HDMI-CEC voľby menu.hint_misc_channellist HD/Nové/Odstránené zoznamy kanálov, cyklické prepnutie -menu.hint_misc_energy Použitie pripravenosti, oddialené vypnutie\nčasovače neaktivity -menu.hint_misc_epg Voľby uloženia/nahrania EPG, voľby zachytávania EPG,\nEPG adresár uloženia -menu.hint_misc_filebrowser Kódovanie súborového systemu, oprávnenia súboru,\nzákaz odstrániť adresáre -menu.hint_misc_general Spustenie do pripravenosti, zachytávanie teletextu, hdd adresár doplnkov,\núroveň debugovania +menu.hint_misc_energy Použitie pohotovostného režimu, oneskorené vypnutie\nčasovače neaktivity +menu.hint_misc_epg Voľby uloženia/načítania EPG, voľby ukladania EPG,\nEPG zložka uloženia +menu.hint_misc_filebrowser Kódovanie súborového systemu, oprávnenia súboru,\nzákaz odstrániť zložky +menu.hint_misc_general Spustenie do pohotovostného režimu, vyrovnávacia pamäť teletextu, hdd zložka doplnkov,\núroveň debugovania menu.hint_misc_zapit Východzie TV/Radio kanály menu.hint_movie Prehrávanie filmov -menu.hint_moviebrowser_setup Nastavenie výberu a volieb zobrazenia. +menu.hint_moviebrowser_setup Nastavenie výberu a volieb zobrazenia menu.hint_movieplayer_plugin Výber doplnku pre overenie s jedným potvrdením klávesy v režime prehrávača menu.hint_net_broadcast Zadanie adresy vysielania, ak netušíte použite IP adresu s koncom .255 menu.hint_net_dhcp Použije DHCP server pre automatickú konfiguráciu @@ -1157,39 +1186,41 @@ menu.hint_net_djmount Pripojenie UPnP zariadení ako filesystem\npodľa /media/0 menu.hint_net_dropbear Použitie ssh prístupu do boxu menu.hint_net_ftpd Použitie prenosu súboru cez FTP menu.hint_net_gateway Vloženie IP adresy brány smerovača -menu.hint_net_hostname Zmena hosťovacieho názvu príjmača +menu.hint_net_hostname Zmena hosťovacieho názvu prijímača menu.hint_net_if Výber interface pre konfiguráciu -menu.hint_net_ipaddress Vloženie IP adresy vášho príjmača -menu.hint_net_mount Konfigurácia, pripojenie a odpojenie sieťových zdielaní\nNFS a CIFS podpora +menu.hint_net_ipaddress Vloženie IP adresy vášho prijímača +menu.hint_net_mount Konfigurácia, pripojenie a odpojenie sieťových zdielaní. Podpora NFS a CIFS. menu.hint_net_nameserver Zadanie IP adresy DNS servera menu.hint_net_netmask Zadanie sieťovej masky, ak netušíte použite 255.255.255.0 menu.hint_net_nfs_mount Konfigurácia a pripojenie sieťových zdielaní menu.hint_net_nfs_umount Odpojenie sieťových zdielaných pripojení -menu.hint_net_ntp Konfigurácia synchronizácie času -menu.hint_net_ntpenable Použije synchronizáciu času pomocou NTP protokolu\nAk NTP synchronizácia nie je úspešná, bude použité DVB +menu.hint_net_ntp Konfigurácia synchronizácie času / hodín +menu.hint_net_ntpenable Použije synchronizáciu času pomocou NTP protokolu\nAk nebude NTP synchronizácia úspešná, použije sa sychronicácia cez DVB. menu.hint_net_ntprefresh Časový interval synchronizácie menu.hint_net_ntpserver Vloženie názvu NTP servera menu.hint_net_pass Vloženie kryptovacieho kľúča (WPA-PSK) menu.hint_net_proxy Ak používate proxy prístup k internetu\nnastavte tu on-line aktualizáciu software -menu.hint_net_proxypass Proxy uživateľské heslo\nak vyžaduje autorizáciu +menu.hint_net_proxypass Proxy užívateľské heslo\nak vyžaduje autorizáciu menu.hint_net_proxyserver Názov proxy servera menu.hint_net_proxyuser Proxy užívateľský názov\nak vyžaduje autorizáciu menu.hint_net_services Konfigurácia sieťových služieb:\nftp, Telnet, uPnp menu.hint_net_setupnow Použitie aktuálnych nastavení -menu.hint_net_setuponstartup Spustenie siete v čase spúštania príjmača +menu.hint_net_setuponstartup Spustenie siete v čase spúštania prijímača menu.hint_net_show Zobrazenie aktuálneho sieťového nastavenia menu.hint_net_ssid Zadanie SSID wireless siete\npre pripojenie sa k menu.hint_net_ssid_scan Vyhľadanie dostupných WLAN sietí -menu.hint_net_telnet Použitie telnet prihlásenia do vášho príjmača +menu.hint_net_telnet Použitie telnet prihlásenia do vášho prijímača menu.hint_net_test Test sieťového pripojenia: ping brány,\n názov servera a externé IP menu.hint_net_ushare Zdielanie pripojeného HDD cez uPnp menu.hint_net_xupnpd Zdielanie "Živých kanálov" cez uPnp menu.hint_network IP adresa, brána, DNS, Synch. času\nSieťové zdielanie a služby -menu.hint_new_zap_mode Povoliť prepnutie kanála počas prehliadania\n(prepnuť režim s 'MUTE' v zozname kanálov) -menu.hint_next Pokračovať na ďaľšie menu\nStlačenie MENU tlačítka zatvorí všetky ponuky -menu.hint_next_brief Pokračovať na ďaľšej ponuke +menu.hint_new_zap_mode Povoliť prepnutie kanálu počas prehliadania\n(mód prepnutia tlačidlom 'MUTE' v zozname kanálov) +menu.hint_next Pokračovanie na ďalšie menu\nStlačte tlačidlo menu pre ukončenie +menu.hint_next_brief Pokračovanie na ďalšie menu menu.hint_numeric_adjust Nastavenie režimu zoznamu kanálov na číselné prepnutie menu.hint_opkg Inštalovať alebo aktualizovať programové balíčky +menu.hint_opkg_feed_addresses_edit Upraviť adresy zdrojov +menu.hint_opkg_install_local_package Inštalácia balíka z USB, SD, zdieľanej alebo lokálnej zložky. menu.hint_opkg_upgrade Aktualizuje všetky inštalované balíčky na poslednú dostupnú verziu menu.hint_osd Farby, písma, veľkosť obrazu\nvzhľad a možnosti GUI menu.hint_osd_language Výber OSD jazyka @@ -1200,75 +1231,75 @@ menu.hint_parentallock_changepin Zmena PIN kódu menu.hint_parentallock_lockage Výber povoleného veku pre sledovanie menu.hint_parentallock_menu Zamknutie ponúk s pin kódom menu.hint_parentallock_prompt Konfigurácia keď sa Neutrino opýta na PIN kód -menu.hint_personalize Povolenie/zakázanie alebo Položky menu zabezpečenia\nKonfigurácia farebných tlačítok uživateľských ponúk -menu.hint_pictureviewer_defdir Východzí adresár prehliadača obrázkov +menu.hint_personalize Povolenie/zakázanie alebo Položky menu zabezpečenia\nKonfigurácia farebných tlačidiel užívateľských ponúk +menu.hint_pictureviewer_defdir Predvolená zložka prehliadača obrázkov menu.hint_pictureviewer_scaling Algoritmus mierky obrázku -menu.hint_pictureviewer_setup Konfigurácia správania sa prehliadača obrázkov +menu.hint_pictureviewer_setup Konfigurácia správania prehliadača obrázkov menu.hint_pictureviewer_slide_time Interval zmeny obrázka, v sekundách menu.hint_picview Sledovanie obrázkov -menu.hint_plugin_type_games Zobrazí hry v uživateľskom menu pri výbere 'Typy doplnkov' -menu.hint_plugin_type_lua Zobrazí doplnky v uživateľskom menu pri výbere 'Typy doplnkov' -menu.hint_plugin_type_scripts Zobrazí skripty v uživateľskom menu pri výbere 'Typy doplnkov' -menu.hint_plugin_type_tools Zobrazí nástroje v uživateľskom menu pri výbere 'Typy doplnkov' -menu.hint_plugins_hdd_dir Výber adresára pre nahranie doplnkov -menu.hint_power_leds Konfigurácia správania LED podsvietenia tlačítka napájania +menu.hint_plugin_type_games Zobrazí hry v užívateľskom menu pri výbere 'Typy doplnkov' +menu.hint_plugin_type_lua Zobrazí doplnky v užívateľskom menu pri výbere 'Typy doplnkov' +menu.hint_plugin_type_scripts Zobrazí skripty v užívateľskom menu pri výbere 'Typy doplnkov' +menu.hint_plugin_type_tools Zobrazí nástroje v užívateľskom menu pri výbere 'Typy doplnkov' +menu.hint_plugins_hdd_dir Výber zložky pre načítanie doplnkov +menu.hint_power_leds Konfigurácia správania LED podsvietenia tlačidla napájania menu.hint_pref_lang Výber preferovaných jayzkov zvuku a EPG\nvýber 'none' pre nepoužitie menu.hint_pref_subs Výber preferovaných jazykov titulkov\nvýber 'none' pre nepoužitie -menu.hint_progressbar Výber volieb pre ukazovateľ -menu.hint_progressbar_color Zobrazenie farebného ukazovateľa -menu.hint_progressbar_gradient Pridanie vertikálneho jasového gradientu do stavového ukazovateľa -menu.hint_progressbar_infobar_position Vyberie možnosti ukazovateľa v infobare +menu.hint_progressbar Výber volieb ukazateľa +menu.hint_progressbar_color Zobrazenie farebného ukazateľa +menu.hint_progressbar_gradient Pridanie vertikálneho jasového gradientu do stavového ukazateľa +menu.hint_progressbar_infobar_position Vyberie možnosti ukazateľa v infobare menu.hint_progressbar_preview Použiť OK na zmenu aktuálneho stavu infobaru menu.hint_progressbar_timescale_green Výber množstva zelenej vo farebnosti infobaru menu.hint_progressbar_timescale_invert Výber preferovaného farebného prechodu menu.hint_progressbar_timescale_red Výber množstva červenej vo farebnosti infobaru menu.hint_progressbar_timescale_yellow Výber množstva žltej vo farebnosti infobaru menu.hint_protection Ochrana obsahu PIN kódom\nVýchodzí PIN 0000 -menu.hint_radiomode Prepne príjmač do rádio režimu -menu.hint_reboot Reboot príjmača\nBez potvrdzovania +menu.hint_radiomode Prepne prijímač do režimu Rádio +menu.hint_reboot Reštart prijímača - bez potvrdzovania menu.hint_record_apid_ac3 Nahrá AC3 zvukové pidy menu.hint_record_apid_alt Nahrá ostatné zvukové pidy menu.hint_record_apid_std Nahrá prvý zvukový pid menu.hint_record_apids Konfigurácia volieb zvukových pidov pre nahrávanie menu.hint_record_apply Použije voľby nahrávania menu.hint_record_auto_cover Automatické vytvorenie náhľadu pre filmový prehliadač na nahranom prehrávaní -menu.hint_record_chandir Vytvorí adresár s názvom kanála\npre uloženie nahrávky -menu.hint_record_data Konfigurácia dátových služieb (TeleText, Titulky) pre nahrávanie +menu.hint_record_chandir Vytvoriť zložku s názvom kanálu\npre uloženie nahrávky +menu.hint_record_data Konfigurácia datových služieb (TeleText, Titulky) pre nahrávanie menu.hint_record_data_dvbsub Nahrá pid/stream s titulkami menu.hint_record_data_vtxt Nahrá pid/stream s teletextom -menu.hint_record_dir Výber adresára pre ukladanie nahrávok +menu.hint_record_dir Výber zložky pre ukladanie nahrávok menu.hint_record_end Zastaviť nahrávanie po max. čase alebo\npo čase ukončenia aktuálnej udalosti menu.hint_record_filename_template Upraiť dočasný názov menu.hint_record_slow_warn Zobrazenie upozornenia, ak nahrávací buffer je blízko k preplneniu menu.hint_record_startstop_msg Zobrazenie správy o začatí/ukončení nahrávania pri začatí alebo ukončení -menu.hint_record_tdir Výber adresára pre uloženie nahrávok časového posunu\nv režime dočasného časového posunu -menu.hint_record_time Čas nahrávania do konca ak\nsa použije nahrávanie s tlačitkom nahrávania (REC) -menu.hint_record_time_ts Dĺžka časového posuvu pred zastavením keď\nje použitý -menu.hint_record_timeafter Zastavenie nahrávania po ukonční udalosti\nv minútach -menu.hint_record_timebefore Spustenie nahrávania pred začatím udalosti\nv minútach +menu.hint_record_tdir Výber zložky pre uloženie nahrávok časového posunu\nv režime dočasného časového posunu +menu.hint_record_time Dĺžka nahrávania v prípade spustenia nahrávania tlačidlom nahrávania (REC) +menu.hint_record_time_ts Dĺžka časového posuvu pred zastavením keď je použitý +menu.hint_record_timeafter Zastavenie nahrávania po ukonční udalosti v minútach +menu.hint_record_timebefore Spustenie nahrávania pred začatím udalosti v minútach menu.hint_record_timer Konfigurácia volieb časového nahrávania menu.hint_record_timeshift Konfigurácia volieb časového posunu menu.hint_record_timeshift_auto Automatické spustenie časového posunu po zmene kanálu, v sekundách menu.hint_record_timeshift_delete Zmazanie súborov časového posunu po jeho zastavení menu.hint_record_timeshift_pause Spustenie prehrávania časoveho posunu v pauza móde -menu.hint_record_timeshift_temp Ak NIE, časový posun spustený ako\nnejaké priame nahrávanie -menu.hint_record_zap Prepnutie na kanál nahrávania\na zobrazenie oznámenia -menu.hint_record_zap_pre_time Pri prepnutí časovačov, zmena kanála pred spustením udalosti\nv minútach -menu.hint_recording Voľby nahrávania a časového posunu\nZabezpečenie časovača, voľby zvukových pidov +menu.hint_record_timeshift_temp Ak je vypnutý, časový posun sa spustí ako\nobyčajné nahrávanie +menu.hint_record_zap Prepnutie na nahrávaný kanál pri zobrazení oznámenia o začatí nahrávania +menu.hint_record_zap_pre_time Prepnutie na kanál pred začatím udalosti v časovači, v minútach. +menu.hint_recording Voľby nahrávania a časového posunu, zabezpečenie časovača, voľby zvukových pidov menu.hint_reload_channels Znovunačítanie kanálov z pamäte menu.hint_reload_plugins Znovunačítanie doplnkov z pamäte -menu.hint_reset Resetovanie GUI nastavení do východzích hodnôt\nKonfigurácia tunera a kanálov bez zmien -menu.hint_restore Obnova súborov z vybranej zálohy -menu.hint_rotor_swap Výmena umiestnenia motora výchd/západ \nv ovládaní motora +menu.hint_reset Resetovanie GUI nastavení do východzích hodnôt, konfigurácia tunera a kanálov bez zmien +menu.hint_restore Obnova konfigurácie a kanálov zo zvolenej zálohy +menu.hint_rotor_swap Výmena umiestnenia motora východ/západ v ovládaní motora menu.hint_rounded_corners Kruhové vykreslovanie alebo zaoblené rohy okien menu.hint_save_settings Uloženie všetkých nastavení do pamäte -menu.hint_saveas Uloženie GUI nastavení do súboru +menu.hint_saveas Uloženie Neutrino-HD nastavení grafického užívateľského rozhrania (GUI) do súboru menu.hint_scan_auto Prehľadanie vybraného satelitu menu.hint_scan_autoall Prehľadanie niektorých vybraných satelitov menu.hint_scan_autoall_select Pridá vybrané satelity do prehľadávania -menu.hint_scan_bouquet aktualizácia: pridá aktuálne bukety\nzmaž všetky:odstráni staré bukety, bez zmien: nepridá alebo nezmení +menu.hint_scan_bouquet aktualizácia: pridá aktuálne bukety\nzmazať všetky:odstráni staré bukety, bez zmien: nepridá alebo nezmení menu.hint_scan_bouquet_writenames Zapísanie názvov služieb do buketov \n nikdy -> len obľúbené -> len poskytovateľ -> oba -menu.hint_scan_bw Výber šírky pásma kanála +menu.hint_scan_bw Výber šírky pásma kanálu menu.hint_scan_cable Výber káblovej siete na prehľadanie menu.hint_scan_cable_simple Káblové prehľadávanie s možnosťou\nčíslovania kanálov poskytovateľom menu.hint_scan_commited Výber potvrdeného vstupu pre\ntento satelit @@ -1277,7 +1308,7 @@ menu.hint_scan_diseqc Výber vstupu DiSEqC prepínača pre\ntento satelit menu.hint_scan_diseqcorder Vykoná príkaz DiSEqC pre kaskádne prepínače menu.hint_scan_diseqcrepeat DiSEqC opakovania pre kaskádne prepínače menu.hint_scan_diseqctype Výber protokolu 'rozšírené' pre DiSEqC prepínač\n môžete použiť na nepotvrdené prepínače -menu.hint_scan_fast CanalDigitaal/TéléSAT/TV Vlaanderen vyhľadanie poskytovateľa\nPOZOR: nastavenie DiSEqC bude prepísané +menu.hint_scan_fast CanalDigitaal/TéléSAT/TV Vlaanderen/M7 Group vyhľadanie poskytovateľa. POZOR: nastavenie DiSEqC bude prepísané. menu.hint_scan_fastdiseqc Spustiť automatickú konfiguráciu DiSEqC menu.hint_scan_fastprov Výber poskytovateľa pre vyhľadávanie menu.hint_scan_fasttype Výber typu rýchleho vyhľadávania @@ -1287,7 +1318,7 @@ menu.hint_scan_felink Výber tuneru pre vzájomné prepojenie menu.hint_scan_femode Výber typu pripojeného tuneru menu.hint_scan_fesetup Konfigurácia tuneru(ov) menu.hint_scan_fetimeout Čas čakania na signál, v desatinách sekundy -menu.hint_scan_freq Zadanie kmitočtu transpondéra +menu.hint_scan_freq Zadanie frekvencie transpondéra menu.hint_scan_fta Pridá len Free-To-Air (nekódované) kanály menu.hint_scan_gi Výber ochranného intervalu pre tento pozemný kanál menu.hint_scan_hierarchy Výber hierarchie pre tento pozemný kanál @@ -1295,9 +1326,9 @@ menu.hint_scan_ladirection Výber umiestnenia zemepisnej šírky menu.hint_scan_latitude Zadanie vašej zemepisnej šírky menu.hint_scan_lnbconfig Konfigurácia LNB parameterov pre tento satelit menu.hint_scan_lodirection Výber umiestnenia zemepisnej dĺžky -menu.hint_scan_lofh Kmitočet oscilátora horného pásma LNB -menu.hint_scan_lofl Kmitočet oscilátora spodného pásma LNB -menu.hint_scan_lofs Kmitočet prepnutia pásma LNB +menu.hint_scan_lofh Frekvencia oscilátora horného pásma LNB +menu.hint_scan_lofl Frekvencia oscilátora spodného pásma LNB +menu.hint_scan_lofs Frekvencia prepnutia pásma LNB menu.hint_scan_logical Použije číslovanie predvolieb poskytovateľom menu.hint_scan_logical_hd Ak je dostupná SD a HD verzia kanálu\nvloží HD na začiatok zoznamu menu.hint_scan_longitude Zadanie vašej zemepisnej dĺžky @@ -1309,8 +1340,8 @@ menu.hint_scan_motor_speed Rýchlosť pohybu motora v 1/10 stupňa\nza sekundu menu.hint_scan_motorpos Výber čísla uloženej pozície pre\ntento satelit menu.hint_scan_nid Vloženie network ID (dekadicky) menu.hint_scan_nit Pridanie transpondérov zo sieťovej informácie -menu.hint_scan_pids Hľadanie a uloženie audio/video/PMT pidov -menu.hint_scan_pilot Výber parametra pilotu +menu.hint_scan_pids Hľadať a uložiť audio/video/PMT PIDy +menu.hint_scan_pilot Výber parametru pilotného signálu (áno - ON, nie - OFF) menu.hint_scan_pol Výber polarizácie transpondéra menu.hint_scan_rate Zadanie symbolovej rýchlosti transpondéra menu.hint_scan_reset_numbers Resetovanie existujúcich čísel kanálov\na prečíslovanie kanálov po vyhľadaní @@ -1325,8 +1356,8 @@ menu.hint_scan_satsetup Konfigurácia volieb satelitu menu.hint_scan_savesettings Uloženie konfigurácie tunera a natavení prehľadania\nTaktiež uložiť, ak spustíte hľadanie služieb menu.hint_scan_scantype Výber, aké typy kanálov hľadať menu.hint_scan_setup_fe Konfigurácia volieb vybraného vstupného dielu -menu.hint_scan_start Spustenie hľadania. Môžete použiť 'EXIT' tlačítko na zastavenie -menu.hint_scan_test Otestovanie signálu z tohto transpondéra +menu.hint_scan_start Spustenie hľadania. Môžete použiť 'EXIT' tlačidlo na zastavenie +menu.hint_scan_test Test signálu z tohto transpondéra menu.hint_scan_tpselect Výber transpondéra pre prehľadanie menu.hint_scan_transmit_mode Výber režimu prenosu pre tento pozemný kanál menu.hint_scan_uncommited Výber nepotvrdeného vstupu pre\ntento satelit @@ -1336,43 +1367,48 @@ menu.hint_scan_usalsall Nastavenie USALS označenia pre všetky satelity menu.hint_scan_useusals Použije USALS pre\ntento satelit menu.hint_scrambled_message Zobrazenie správy kódovania, pokiaľ kanál nebol dekódovaný menu.hint_screen_setup Konfigurácia okrajov obrazu -menu.hint_screensaver_delay Nastavte čas (v minútach), po ktorom sa šetrič obrazovky spustí alebo vypne -menu.hint_screensaver_dir Vyberte adresár v ktorom sa šetrič obrazovky spustí -menu.hint_screensaver_setup Konfigurácia možností šetríča obrazovky pre zvukový prehrávač a rádio režim -menu.hint_screensaver_timeout Zvoľte časový interval zmeny obrazovky v šetriči obrazovky +menu.hint_screensaver_delay Nastaví čas (v minútach) po ktorom sa spustí šetrič obrazovky +menu.hint_screensaver_dir Výber zložky v ktorej sa spustí šetrič obrazovky +menu.hint_screensaver_mode Voľba režimu šetriča obrazovky. +menu.hint_screensaver_random Povoliť/zakázať náhodnú voľbu obrázku. +menu.hint_screensaver_setup Konfigurácia volieb šetriča obrazovky pre prehrávač hudby a mód rádia +menu.hint_screensaver_timeout Výber času pre zmenu obrázkov v šetriči obrazovky menu.hint_screenshot_count Pokiaľ žiadny GUI na obrazovke, môže byť uložených 1-5\nsériových zosnímaní -menu.hint_screenshot_cover ZAP: Pokiaľ prehráva nahrávky, prepíše jedno\nzachytenie do zobrazenia v Prehliadači filmov -menu.hint_screenshot_dir Výber adresára pre uloženie zachyteného obrázku +menu.hint_screenshot_cover Zap: Pokiaľ prehráva nahrávky, prepíše jedno\nzachytenie do zobrazenia v Prehliadači filmov +menu.hint_screenshot_dir Výber zložky pre uloženie zachyteného obrázku menu.hint_screenshot_format Formát súboru pre uloženie zachyteného obrázku -menu.hint_screenshot_res Veľkosť zosnímania: veľkosť obrazového rozmeru aktuálneho kanála\nalebo veľkosť OSD (1280x720) +menu.hint_screenshot_res Veľkosť zosnímania: veľkosť obrazového rozmeru aktuálneho kanálu\nalebo veľkosť OSD (1280x720) menu.hint_screenshot_scale Pre obraz+OSD zosnímanie, mierka z obrazového rozlíšenia menu.hint_screenshot_setup Konfigurácia volieb zosnímania obrázku menu.hint_screenshot_video Vrátane živého obrazu v zosnímanom obrázku -menu.hint_scripts Spustenie zadaní +menu.hint_scripts Spustenie zadania menu.hint_selected_back Zmena farby podkladu označenej položky menu.hint_selected_text Zmena farby textu označenej položky menu.hint_service Nastavenie tuneru, vyhľadanie služieb,\núprava buketov, aktualizácia software -menu.hint_service_scan Nastavenie tuneru, vyhľadanie služieb +menu.hint_service_scan Automatické / manuálne vyhľadávanie staníc, FastScan, Test signálu menu.hint_settings Konfigurácia Neutrino, sieť, zvuk, obraz, OSD a iné menu.hint_show_mute_icon Zobrazenie ikony umlčania, ak nastavenie hlasitosťi bude 0 -menu.hint_shutdown Prepne váš príjmač do spánku\nBez potvrdzovania -menu.hint_shutdown_count Čas prepnutia príjmača do spánku\nz režimu pripravenosti -menu.hint_shutdown_menu Prepne Váš príjmač do pohotovstného alebo hlbokého spánku, nastaví časovač vypnutia -menu.hint_shutdown_rcdelay Použije režim spánku, ak tlačítko zapnutia\nje stlačené viac ako 1 sekundu -menu.hint_shutdown_real Použije režim pripravenosti\nAk sa nepoužije, tlačítko zapnutia prepne príjmač do spánku -menu.hint_sleeptimer Nastavenie časovača pre prechod vašeho príjmača\ndo režimu pripravenosti +menu.hint_shutdown Vypnutie prijímača - bez potvrdzovania +menu.hint_shutdown_count Čas prepnutia prijímača z pohotovostného režimu do stavu vypnutia +menu.hint_shutdown_menu Prepne prijímač do pohotovostného režimu alebo ho vypne, nastaví časovač vypnutia +menu.hint_shutdown_rcdelay Aktivuje vypnutie prijímača, ak je tlačidlo zapnutia\nstlačené viac ako 1 sekundu +menu.hint_shutdown_real Aktivuje pohotovostný režim\nAk je zakázané, tlačidlo zapnutia vypne prístroj +menu.hint_sleeptimer Nastavenie časovača pre prechod prijímača do pohotovostného režimu menu.hint_sleeptimer_min Prednastavené nastavenia pre časovač vypnutia +menu.hint_sms_channel Ak povolené, číselné klávesy v zozname kanálov budú použité pre vyhľadávanie kanálu v štýle SMS +menu.hint_sms_movie Ak povolené, číselné klávesy v prehliadači filmov budú použité pre vyhľadávanie filmu v štýle SMS menu.hint_soft_restart Reštartovanie Neutrino bez rebootu +menu.hint_soft_restart Reštartovanie Neutrino-HD bez rebootu menu.hint_softupdate_check Kontrola dostupných aktualizácií, stiahnutie a naprogramovanie firmware menu.hint_softupdate_check_local Výber a programovanie firmware z lokálneho súboru menu.hint_softupdate_createimage_menu Zálohovanie aktuálneho firmware vrátane všetkých nastavení menu.hint_softupdate_expert Oddelené partície z pamäte, čítanie/zapisovanie do pamäte menu.hint_softupdate_expert_read Načítanie oddelených partícií z pamäte (U-Boot 512kB, Kernel 4MB, SystemFS 28MB) menu.hint_softupdate_expert_write Zápis oddelených partícií do pamäte (U-Boot 512kB, Kernel 4MB, SystemFS 28MB, SystemFS+nastavenia) -menu.hint_softupdate_settings Adresár lokálnej aktualizácie a konfiguračný súbor pre nastavenie -menu.hint_standby Prepne príjmač do pohotovostného režimu -menu.hint_start_tostandby Zostane v režime pripravenosti po spustení -menu.hint_streaminfo Aktuálna informácia kanála: pidy, signál a kvalita,\nBitrate graf +menu.hint_softupdate_settings Zložka lokálnej aktualizácie a konfiguračný súbor pre nastavenie +menu.hint_standby Prepnutie prijímača do pohotovostného režimu +menu.hint_start_tostandby Zostane po spustení v pohotovostnom režime +menu.hint_streaminfo Aktuálna informácia kanálu: pidy, signál a kvalita,\nBitrate graf menu.hint_subchannel_pos Pozícia menu výberu sub-kanálov menu.hint_sw_update Aktualizácia software menu.hint_theme Výber prednastavených farebných vzhľadov\nUloženie alebo nahranie vzhľadu zo súborov @@ -1380,18 +1416,19 @@ menu.hint_timeouts Konfigurácia času zmiznutia GUI okien\nv sekundách menu.hint_timers Pridanie/Odstránenie/Upravenie plánovaného\nnahrávania, pripomienky atď. menu.hint_timezone Výber časového pásma menu.hint_tools Spustenie nástrojov -menu.hint_tvmode Prepne príjmač do TV režimu +menu.hint_tvmode Prepne prijímač do režimu TV menu.hint_tvradio_switch Prepínanie medzi TV a Rádio režimom -menu.hint_upnp Univerzálny Plug and Play prehliadač -menu.hint_vfd LED-ky predného panelu, VFD voľby -menu.hint_vfd_brightness Jas pri práci +menu.hint_upnp Univerzálny Plug & Play prehliadač +menu.hint_vfd LED diódy predného panelu, nastavenia VFD +menu.hint_vfd_brightness Definuje jas v TV režime menu.hint_vfd_brightness_setup Konfigurácia jasu zobrazovača predného panelu\npre rôzne režimy menu.hint_vfd_brightnessdeepstandby Jas v režime spánku menu.hint_vfd_brightnessdim Jas automatického stmavnutia -menu.hint_vfd_brightnessstandby Jas v režime pripravenosti +menu.hint_vfd_brightnessstandby Jas v pohotovostnom režime menu.hint_vfd_defaults Obnoví prednastavené hodnoty jasu menu.hint_vfd_dimtime Čas automatického stmavnutia, v sekundách menu.hint_vfd_infoline Vybrať si zobrazenie na hlavnom riadku VFD +menu.hint_vfd_notify_rclock Zobrazí upozornenie v prípade, že je stlačená klávesa a diaľkové ovládanie je v uzamknutom režime menu.hint_vfd_scroll Povolí alebo zakáže pohyb textu na VFD menu.hint_vfd_statusline Vybrať si krátke zobrazenie na \nstavovom riadku VFD menu.hint_video Obrazový výstup, rozlíšenie, formát\nPomer strán, voľby režimu rýchleho prepnutia @@ -1405,95 +1442,95 @@ menu.hint_video_format Pomer TV obrazu menu.hint_video_mode Obrazový režim HDMI výstupu menu.hint_video_modes VF klávesa bude cyklovať medzi zvolenými režimami menu.hint_video_modes_auto Povoliť režimy automatického výberu na základe obsahu -menu.hint_video_pip Veľkosť a umiestneie obrazu v obraze +menu.hint_video_pip Veľkosť a pozícia obrazu v obraze (PiP) menu.hint_video_saturation Zmena farebnosti obrázku menu.hint_video_scart_mode Výber režimu analógového výstupu pre SCART konektory menu.hint_video_sdosd Zapnúť/vypnúť OSD zorazenie na SD výstupe (scart, cinch) menu.hint_volume Konfigurácia volieb okna hlasitosti -menu.hint_volume_digits Číselné zobrazenie ukazovateľa hlasitosti ZAP/VYP +menu.hint_volume_digits Číselné zobrazenie ukazateľa hlasitosti Zap/Vyp menu.hint_volume_pos Výber pozície indikátora hlasitosti menu.hint_volume_size Výber výšky indikátora hlasitosti menu.hint_webtv_setup Tu nakonfigurované WebTV kanály budú k dispozícii v štandartnom zozname kanálov menu.hint_window_size Zoznam kanálov, EPG-Infp a niektoré iné okná sú zmenšené týmto faktorom menu.hint_ytplay Prehrávanie vybraných youtube videí -menu.hint_ytplay_setup Konfigurácia špecifických možností YouTube, napr. horná hranica výsledkov vyhľadávania +menu.hint_ytplay_setup Konfigurácia špecifických volieb YouTube, napr. horný limit výsledkov vyhľadávania menu.hint_zap_cycle Pri prepínaní kanálov zotrvať v aktuálnom bukete -menu.next ďaľej (MENU ukončí) -messagebox.back späť -messagebox.cancel zruš -messagebox.discard Zruš zmeny? +menu.next Ďalej +messagebox.back Späť +messagebox.cancel Zrušiť +messagebox.discard Zrušiť zmeny? messagebox.error Chyba -messagebox.feature_not_supported Funkcia nie je podporovaná! -messagebox.info Správa -messagebox.no nie -messagebox.ok ok -messagebox.yes áno -miscsettings.channellist Nastavenia zoznamu kanálov -miscsettings.channellist_epgtext_align Zarovnaj EPG text -miscsettings.colored_events Farebnosť udalostí +messagebox.feature_not_supported Táto vlastnosť nie je podporovaná. Kontaktujte prosím poskytovateľa vášho firmvéru! +messagebox.info Informácie +messagebox.no Nie +messagebox.ok OK +messagebox.yes Áno +miscsettings.channellist Nastavenie zoznamu kanálov +miscsettings.channellist_epgtext_align Zarovnať EPG text +miscsettings.colored_events Program farebne miscsettings.colored_events_0 žiadny miscsettings.colored_events_1 aktuálny miscsettings.colored_events_2 nasledujúci miscsettings.colored_events_channellist V zozname kanálov -miscsettings.colored_events_infobar V info lište +miscsettings.colored_events_infobar Na informačnej lište miscsettings.energy Energia -miscsettings.epg_cache Zachytávanie EPG (dni) +miscsettings.epg_cache Ukladanie EPG (dni) miscsettings.epg_cache_hint1 Ako dlho uchovávať dáta EPG v budúcnosti? -miscsettings.epg_cache_hint2 Nastavenie v dňoch. -miscsettings.epg_dir Adresár EPG -miscsettings.epg_extendedcache Podrobný popis udalosti (hodiny) -miscsettings.epg_extendedcache_hint1 Ako dlho zachytávať rozšírený -miscsettings.epg_extendedcache_hint2 popis udalosti (nastavenie v hodinách) -miscsettings.epg_head Nastavenia EPG +miscsettings.epg_cache_hint2 (Nastavenie v dňoch) +miscsettings.epg_dir Zložka EPG +miscsettings.epg_extendedcache Podrobný popis udalostí (hod.) +miscsettings.epg_extendedcache_hint1 Ako dlho ukladať rozšírený +miscsettings.epg_extendedcache_hint2 popis udalostí (nastavenie v hodinách) +miscsettings.epg_head Nastavenie EPG miscsettings.epg_max_events Maximum udalostí miscsettings.epg_max_events_hint1 Koľko udalostí bude uložených? -miscsettings.epg_max_events_hint2 normálne 6000, 0 pre zrušenie limitu -miscsettings.epg_old_events Odstráň neaktuálne EPG -miscsettings.epg_old_events_hint1 Ako dlho zapisovať dáta EPG po skončení? +miscsettings.epg_max_events_hint2 Normálne 6000, 0 pre zrušenie limitu +miscsettings.epg_old_events Odstrániť neaktuálne EPG (hod.) +miscsettings.epg_old_events_hint1 Ako dlho zapisovať EPG údaje po skončení? miscsettings.epg_old_events_hint2 Nastavenie v hodinách. -miscsettings.epg_read Obnoviť EPG pri zavádzaní -miscsettings.epg_save Ulož/Obnov EPG po reštarte +miscsettings.epg_read Obnoviť EPG po reštarte +miscsettings.epg_save Uložiť EPG pred vypnutím miscsettings.epg_save_frequently Periodické ukladanie EPG -miscsettings.epg_save_mode Len obľúbené -miscsettings.epg_save_standby Ulož EPG pri soft standby +miscsettings.epg_save_mode Iba obľúbené +miscsettings.epg_save_standby Uložiť EPG v pohotovostnom režime miscsettings.epg_scan Prehľadávanie EPG miscsettings.epg_scan_always Vždy -miscsettings.epg_scan_bouquets Prehľadanie EPG buketov +miscsettings.epg_scan_bouquets Prehľadávanie EPG buketov miscsettings.epg_scan_bq buket -miscsettings.epg_scan_fav favoritné +miscsettings.epg_scan_fav Obľúbené miscsettings.epg_scan_live Naživo miscsettings.epg_scan_sel Vybrané -miscsettings.epg_scan_standby Vspánku +miscsettings.epg_scan_standby V pohotovostnom režime miscsettings.general Hlavné nastavenia miscsettings.head Rôzne nastavenia -miscsettings.infobar Inforiadok +miscsettings.infobar Informačná lišta +miscsettings.infobar_buttons_usertitle Užívateľské názvy farebných kláves miscsettings.infobar_casystem_display Zobrazenie CA-Systému -miscsettings.infobar_casystem_dotmatrix Ihličkové zobrazenie CA -miscsettings.infobar_casystem_frame Orámované zobrazenie CA +miscsettings.infobar_casystem_dotmatrix CA displej s bodmi +miscsettings.infobar_casystem_frame CA displej s rámom miscsettings.infobar_casystem_mini CA mini miscsettings.infobar_casystem_mode CA mód -miscsettings.infobar_disp Zobrazovanie loga -miscsettings.infobar_disp_0 bez Loga -miscsettings.infobar_disp_1 Logo v číselnom boxe -miscsettings.infobar_disp_2 Logo+číslo kanála -miscsettings.infobar_disp_3 Logo+názov kanála+signál -miscsettings.infobar_disp_4 Logo+názov+číslo kanála -miscsettings.infobar_disp_5 Logo+signál -miscsettings.infobar_disp_6 Logo+číslo kanála+signál -miscsettings.infobar_disp_log len Logo -miscsettings.infobar_gradient_body Gradient EPG-area -miscsettings.infobar_gradient_bottom Gradient buttobar -miscsettings.infobar_gradient_top Gradient top -miscsettings.infobar_logo_hdd_dir Adresár loga +miscsettings.infobar_disp Zobraziť logo +miscsettings.infobar_disp_0 Názov kanálu [Číslo kanálu] +miscsettings.infobar_disp_1 Číslo kanálu, Názov kanálu [Logo] +miscsettings.infobar_disp_2 Logo [Číslo kanálu] +miscsettings.infobar_disp_3 Logo, Názov kanálu [Signál] +miscsettings.infobar_disp_4 Logo, Názov kanálu [Číslo kanálu] +miscsettings.infobar_disp_5 Logo [Signál] +miscsettings.infobar_disp_6 Číslo kanálu, Logo [Signál] +miscsettings.infobar_gradient_body Sklon plochy EPG +miscsettings.infobar_gradient_bottom Klesajúci +miscsettings.infobar_gradient_top Stúpajúci +miscsettings.infobar_logo_hdd_dir Zložka pre logo miscsettings.infobar_sat_display Zobrazenie satelitu v stavovom riadku miscsettings.infobar_show Zobraziť Info pri zmene EPG miscsettings.infobar_show_dd_available Zobraziť DD ak je dostupné miscsettings.infobar_show_res Zobraziť rozlišenie v stavovom riadku miscsettings.infobar_show_res_simple jednoduché -miscsettings.infobar_show_sysfs_hdd Zaplnenie (sysFS & HDD) +miscsettings.infobar_show_sysfs_hdd Indikátor zaplnenia (sysFS a HDD) miscsettings.infobar_show_tuner Zobraziť aktívny tuner miscsettings.infoclock Informačné hodiny -miscsettings.progressbar Ukazovateľ +miscsettings.progressbar Ukazateľ miscsettings.progressbar_color Farba miscsettings.progressbar_design Vzhľad miscsettings.progressbar_design_0 body @@ -1504,9 +1541,9 @@ miscsettings.progressbar_design_4 jednofarebne miscsettings.progressbar_design_long Vzhľad miscsettings.progressbar_gradient 3D efekt miscsettings.progressbar_infobar_position Pozícia -miscsettings.progressbar_infobar_position_0 štandartne -miscsettings.progressbar_infobar_position_1 pod názvom kanála -miscsettings.progressbar_infobar_position_2 úzky pod názvom kanála +miscsettings.progressbar_infobar_position_0 štandardne +miscsettings.progressbar_infobar_position_1 pod názvom kanálu +miscsettings.progressbar_infobar_position_2 úzky pod názvom kanálu miscsettings.progressbar_infobar_position_3 zúžený medzi EPG udalosťami miscsettings.progressbar_preview Náhľad miscsettings.progressbar_timescale Časová os @@ -1517,54 +1554,54 @@ miscsettings.progressbar_timescale_red červená miscsettings.progressbar_timescale_red_green z červenej do zelenej miscsettings.progressbar_timescale_yellow žltá miscsettings.radiotext RádioText -miscsettings.shutdown_count Vypnúť po -miscsettings.shutdown_count_hint1 Čas (v minútach) pre prepnutie zo stavu pripravenosti -miscsettings.shutdown_count_hint2 do hlbokého spánku (0=vypnuté) -miscsettings.shutdown_real Umožnenie pripravenosti +miscsettings.shutdown_count Vypnúť po (min.) +miscsettings.shutdown_count_hint1 Čas (v minútach) pre prepnutie z pohotovostného režimu +miscsettings.shutdown_count_hint2 do režimu vypnutia prístroja (0=vypnuté) +miscsettings.shutdown_real Povoliť pohotovostný režim miscsettings.shutdown_real_rcdelay Oneskorenie vypnutia miscsettings.sleeptimer Čas vypnutia pri neaktivite miscsettings.sleeptimer_min Prednastavený časovač vypnutia miscsettings.volume Hlasitosť -miscsettings.zapto_pre_time Korekcia času pred prepnutím (minuty) -motorcontrol.calc_positions Prepočítaj pozície -motorcontrol.disable_limit Vypni (soft) limity -motorcontrol.drive_mode režim pohybu +miscsettings.zapto_pre_time Korekcia času prepnutia kanálu +motorcontrol.calc_positions Prepočítať pozície +motorcontrol.disable_limit Vypnúť (soft) limity +motorcontrol.drive_mode Režim pohybu motorcontrol.drive_mode_auto Zastavenie pohybu Ručne/Auto -motorcontrol.east_limit Nastav východný (soft) limit -motorcontrol.enable_limit Zapni (soft) limity -motorcontrol.goto Choď na pozíciu motora (a) -motorcontrol.halt Zastav motor +motorcontrol.east_limit Nastaviť východný (soft) limit +motorcontrol.enable_limit Zapnúť (soft) limity +motorcontrol.goto Ísť na pozíciu motora (a) +motorcontrol.halt Zastaviť motor motorcontrol.head Satelitný vyhľadávač motorcontrol.install_menu Inštalačné menu motorcontrol.motor_pos (a) Pozícia motora: motorcontrol.movement (b) Presun: motorcontrol.msec ms -motorcontrol.network Informácie sieti -motorcontrol.no_mode nestará sa +motorcontrol.network Informácia siete +motorcontrol.no_mode nestarať sa motorcontrol.notdef Nepoužité motorcontrol.override Nahradiť pozíciu určenú pre -motorcontrol.pos_decrease Zníž pozíciu motora (a) -motorcontrol.pos_increase Zvýš pozíciu motora (a) -motorcontrol.ref_position Choď na referenčnú pozíciu +motorcontrol.pos_decrease Znížiť pozíciu motora (a) +motorcontrol.pos_increase Zvýšiť pozíciu motora (a) +motorcontrol.ref_position Ísť na referenčnú pozíciu motorcontrol.sat_pos Pozícia satelitu (krokovací režim): motorcontrol.settings Nastavenia ovládania motora motorcontrol.status Stav -motorcontrol.step_decrease Zníž veľkosť kroku (c) -motorcontrol.step_drive Prepni spôsob Krok/Posuv (b) +motorcontrol.step_decrease Znížiť veľkosť kroku (c) +motorcontrol.step_drive Prepnúť spôsob Krok/Posuv (b) motorcontrol.step_east Krok/Posuv motora na Východ (b,c) -motorcontrol.step_increase Zvýš veľkosť kroku (c) -motorcontrol.step_mode režim kroku +motorcontrol.step_increase Zvýšiť veľkosť kroku (c) +motorcontrol.step_mode Režim kroku motorcontrol.step_size (c) Veľkosť kroku: motorcontrol.step_west Krok/Posuv motora na Západ (b,c) -motorcontrol.stop_moving Zastav na signále (pohybovanie) -motorcontrol.stop_stopped Zastav na signále (zastavenie) -motorcontrol.store Ulož pozíciu motora (a) -motorcontrol.timed_mode čas pre režim kroku -motorcontrol.user_menu Uživateľské menu -motorcontrol.west_limit Nastav západný (soft) limit +motorcontrol.stop_moving Zastaviť na signále (pohybovanie) +motorcontrol.stop_stopped Zastaviť na signále (zastavenie) +motorcontrol.store Uložiť pozíciu motora (a) +motorcontrol.timed_mode Čas pre režim kroku +motorcontrol.user_menu Užívateľské menu +motorcontrol.west_limit Nastaviť západný (soft) limit moviebrowser.ask_rec_to_delete Vymazanie nahrávaných filmových stôp!\n[%s]\nSkutočne vykonať? moviebrowser.book_add Pridať záložku -moviebrowser.book_clear_all Vyčisti všetko +moviebrowser.book_clear_all Vyčistiť všetko moviebrowser.book_head Záložky moviebrowser.book_lastmoviestop Posledné prerušenie: moviebrowser.book_movieend Koniec filmu: @@ -1581,22 +1618,23 @@ moviebrowser.browser_row_head Nastavenia riadku moviebrowser.browser_row_item Položka stĺpca moviebrowser.browser_row_nr Počet stĺpcov moviebrowser.browser_row_width Šírka stĺpca [%] -moviebrowser.cache_dir Adresár cache -moviebrowser.copies Kopírovať skoky z filmu do nových súborov? -moviebrowser.copy Kopírovať skoky z filmu do nového súboru? -moviebrowser.copy_failed Kopírovanie zlyhalo, je tam skok záložiek a dostatok voľného miesta? +moviebrowser.cache_dir Zložka vyrovnávacej pamäte +moviebrowser.copies Kopírovať skoky z filmu do nových súborov ? +moviebrowser.copy Kopírovať skoky z filmu do nového súboru ? +moviebrowser.copy_failed Kopírovanie zlyhalo, je tam skok záložiek a dostatok voľného miesta ? moviebrowser.copying Kopírovanie, prosím čakajte ... -moviebrowser.cut Vystrihnúť skoky z filmu? -moviebrowser.cut_failed Vystrihovanie zlyhalo, je tam skok záložiek a dostatok voľného miesta? -moviebrowser.cutting Strihanie, prosím čakajte ... -moviebrowser.delete_all Zmazať všetky vybrané filmy bez akýchkoľvek otázok? -moviebrowser.delete_info Mazanie súborov, prosim čakajte... -moviebrowser.delete_screenshot Zmazať obrázok obrazovky? -moviebrowser.dir Adresár -moviebrowser.dir_head Doplnkové adresáre -moviebrowser.edit_book Zmeň záložku +moviebrowser.cut Vystrihnúť skoky z filmu ? +moviebrowser.cut_failed Vystrihovanie zlyhalo, je tam skok záložiek a dostatok voľného miesta ? +moviebrowser.cutting Strihanie filmu, prosím čakajte ... +moviebrowser.delete_all Vymazať všetky označené filmy bez opýtania? +moviebrowser.delete_info Mazanie súborov, prosim čakajte ... +moviebrowser.delete_screenshot Zmazať zachytený obrázok? +moviebrowser.dir Zložka +moviebrowser.directories Zložky +moviebrowser.directories_additional Dodatočné zložky +moviebrowser.edit_book Zmeniť záložku moviebrowser.edit_book_name_info1 Zadanie nového názovu záložky -moviebrowser.edit_book_name_info2 názov záložky +moviebrowser.edit_book_name_info2 Názov záložky moviebrowser.edit_book_pos_info1 Zadanie novej pozície moviebrowser.edit_book_pos_info2 ???? moviebrowser.edit_book_type_info1 Zadanie novej dĺžky skoku @@ -1609,20 +1647,30 @@ moviebrowser.foot_options Voľby moviebrowser.foot_play Štart filmu moviebrowser.foot_refresh Obnoviť zoznam moviebrowser.foot_sort Triedenie: -moviebrowser.head TS prehrávač filmov +moviebrowser.head Moje nahrávky moviebrowser.head_filter Filtrovanie filmov podľa kategórie: -moviebrowser.head_playlist Posledné pustený: -moviebrowser.head_recordlist Posledne nahraný: -moviebrowser.hide_series Skryť serialy -moviebrowser.hint_copy_onefile 11111 -moviebrowser.hint_copy_several 22222 -moviebrowser.hint_cut 33333 -moviebrowser.hint_jumpbackward Skok vzad o 5s\n '0' zruš -moviebrowser.hint_jumpforward Skok vpred o 5s\n '0' zruš -moviebrowser.hint_movieend Ukončenie sledovania za 5 s\n '0' zruš -moviebrowser.hint_newbook_backward Nový skok vzad \n 'MODRÝ' na koniec -moviebrowser.hint_newbook_forward Nový skok vpred\n 'MODRÝ' na koniec -moviebrowser.hint_truncate 44444 +moviebrowser.head_playlist Naposledy sledovaný: +moviebrowser.head_recordlist Naposledy nahraný: +moviebrowser.help_button_blue Znovunačítanie informácií o filmoch +moviebrowser.help_button_green Ukázať filter výberu +moviebrowser.help_button_left Zmena pohľadu +moviebrowser.help_button_menu Otvoriť hlavné menu +moviebrowser.help_button_mute Vymazať filmy +moviebrowser.help_button_okay Prehrať filmy +moviebrowser.help_button_play Označiť filmy +moviebrowser.help_button_red Zmena zoradenia +moviebrowser.help_button_right Zmena pohľadu +moviebrowser.help_button_yellow Prepnúť aktívne okno +moviebrowser.hide_series Skryť seriály +moviebrowser.hint_copy_onefile +moviebrowser.hint_copy_several +moviebrowser.hint_cut +moviebrowser.hint_jumpbackward Skok vzad o 5s\n '0' zrušiť +moviebrowser.hint_jumpforward Skok vpred o 5s\n '0' zrušiť +moviebrowser.hint_movieend Koniec filmu o 5 sekúnd\n'0' zrušiť +moviebrowser.hint_newbook_backward Nový skok späť spustený\n'%s' definuje koncovú pozíciu, '0' zrušiť +moviebrowser.hint_newbook_forward Nový skok vpred spustený\n'%s' definuje koncovú pozíciu, '0' zrušiť +moviebrowser.hint_truncate moviebrowser.info_audio Zvuk moviebrowser.info_channel Kanál moviebrowser.info_file Súbor @@ -1630,35 +1678,36 @@ moviebrowser.info_filename Názov moviebrowser.info_genre_major Žáner moviebrowser.info_genre_minor Vedľajší žáner moviebrowser.info_head Informácia o filme -moviebrowser.info_head_update Ulož zmeny vo všetkých informačných súboroch filmu +moviebrowser.info_head_update Uložiť zmeny vo všetkých informačných súboroch filmu moviebrowser.info_info1 Info 1 moviebrowser.info_info2 Info 2 moviebrowser.info_length Dĺžka (Min) moviebrowser.info_parental_lockage Rodičovský zámok moviebrowser.info_parental_lockage_0year vždy -moviebrowser.info_parental_lockage_12year 12 rokov -moviebrowser.info_parental_lockage_16year 16 rokov -moviebrowser.info_parental_lockage_18year 18 rokov -moviebrowser.info_parental_lockage_6year 6 rokov +moviebrowser.info_parental_lockage_12year do 12 rokov +moviebrowser.info_parental_lockage_16year do 16 rokov +moviebrowser.info_parental_lockage_18year do 18 rokov +moviebrowser.info_parental_lockage_6year do 6 rokov moviebrowser.info_parental_lockage_always nikdy -moviebrowser.info_path Adresár +moviebrowser.info_path Zložka moviebrowser.info_prevplaydate Dátum posledného pozerania moviebrowser.info_prodcountry Krajina moviebrowser.info_prodyear Rok moviebrowser.info_quality Kvalita +moviebrowser.info_rating Hodnotenie moviebrowser.info_recorddate Dátum nahrávky -moviebrowser.info_serie Serial +moviebrowser.info_serie Seriál moviebrowser.info_size Veľkosť (MB) moviebrowser.info_title Titul moviebrowser.info_videoformat Obraz -moviebrowser.last_play_max_items Počet liniek posledného prehrávania -moviebrowser.last_record_max_items Počet liniek posledného nahrávania -moviebrowser.load_default Nahrať prednastavené nastavenia +moviebrowser.last_play_max_items Počet posledných prehrávaní v zozname +moviebrowser.last_record_max_items Počet posledných nahrávaní v zozname +moviebrowser.load_default Obnoviť predvolené hodnoty moviebrowser.menu_copy_onefile Kopírovať film moviebrowser.menu_copy_several Kopírovať a rozdeliť film moviebrowser.menu_cut Vystrihnúť film moviebrowser.menu_cut_head Kopírovať, vystrihnúť a skrátiť -moviebrowser.menu_directories_head Adresáre +moviebrowser.menu_directories_head Zložky moviebrowser.menu_help_head Nápoveda moviebrowser.menu_main_bookmarks Záložky moviebrowser.menu_main_head Nastavenia @@ -1668,16 +1717,16 @@ moviebrowser.menu_parental_lock_activated_no nie moviebrowser.menu_parental_lock_activated_no_temp nie (dočasne) moviebrowser.menu_parental_lock_activated_yes áno moviebrowser.menu_parental_lock_head Blokovanie -moviebrowser.menu_parental_lock_rate_head Blokovať film z ... -moviebrowser.menu_save Ulož zmeny -moviebrowser.menu_save_all Spusti aktualizáciu informácií o súbore +moviebrowser.menu_parental_lock_rate_head Blokovať film +moviebrowser.menu_save Uložiť zmeny +moviebrowser.menu_save_all Spustiť aktualizáciu informácií o súbore moviebrowser.menu_truncate Skrátiť film moviebrowser.option_browser Možnosti prehliadača moviebrowser.reload_at_start Načítanie informácie o filme pri štarte -moviebrowser.remount_at_start Pripoj pri štarte -moviebrowser.scan_for_movies Hľadaj pre film ... -moviebrowser.serie_auto_create Automaticky vytvor serial -moviebrowser.serie_head Serialy +moviebrowser.remount_at_start Pripojiť pri štarte +moviebrowser.scan_for_movies Hľadať filmy ... +moviebrowser.serie_auto_create Automaticky doplniť seriály +moviebrowser.serie_head Seriály moviebrowser.serie_name Zmena názvu moviebrowser.short_audio Zvuk moviebrowser.short_book Kniha @@ -1691,26 +1740,27 @@ moviebrowser.short_info1 Info 1 moviebrowser.short_info2 Info 2 moviebrowser.short_length Min moviebrowser.short_parental_lockage Vek -moviebrowser.short_path Adresár -moviebrowser.short_prevplaydate Posledne +moviebrowser.short_path Zložka +moviebrowser.short_prevplaydate Posledné moviebrowser.short_prodyear Rok moviebrowser.short_quality * (kvalita) +moviebrowser.short_rating Hlasy moviebrowser.short_recorddate Dátum moviebrowser.short_serie Serial moviebrowser.short_size Veľkosť moviebrowser.short_title Titul moviebrowser.start_head Pozerať film od: moviebrowser.start_record_start Začiatok filmu -moviebrowser.truncate Orezať film? -moviebrowser.truncate_failed Orezanie zlyhalo. -moviebrowser.truncate_failed_playing Nemožné orezať prehrávanie filmu. -moviebrowser.truncating Orezávanie, čakajte prosím ... +moviebrowser.truncate Skrátiť film ? +moviebrowser.truncate_failed Chybné skrátenie. +moviebrowser.truncate_failed_playing Možnosť skrátiť prehrávanie filmu. +moviebrowser.truncating Skracovanie filmu, prosím čakajte ... moviebrowser.ts_only Zobraziť iba nahrávky moviebrowser.update_if_dest_empty_only Kopírovať len ak je cieľové miesto prázdne -moviebrowser.use_dir Použi adresár -moviebrowser.use_movie_dir Použi adresár filmov -moviebrowser.use_rec_dir Použi adresár nahrávania -moviebrowser.yt_cache Stiahnutia +moviebrowser.use_dir Použiť zložku +moviebrowser.use_movie_dir Použiť zložku filmov +moviebrowser.use_rec_dir Použiť zložku nahrávania +moviebrowser.yt_cache Stiahnuté moviebrowser.yt_cache_add Plánované \n%s\nsťahovanie. moviebrowser.yt_cancel Zrušiť všetko moviebrowser.yt_cancel_transfer Zrušiť sťahovanie? @@ -1721,10 +1771,10 @@ moviebrowser.yt_error Chyba načítania youtube videa moviebrowser.yt_failed Chybné sťahovania moviebrowser.yt_history Hľadať históriu moviebrowser.yt_max_history Maximálna veľkosť hľadania histórie -moviebrowser.yt_max_results Dosiahnuté maximum výsledkov +moviebrowser.yt_max_results Maximálny počet výsledkov moviebrowser.yt_most_popular Najpopulárnejšie dnes moviebrowser.yt_most_popular_all_time Najpopulárnejšie -moviebrowser.yt_next_results Ďaľšie výsledky +moviebrowser.yt_next_results Ďalšie výsledky moviebrowser.yt_orderby Triediť podľa moviebrowser.yt_orderby.published dátum zverejnenia moviebrowser.yt_orderby.rating obľúbenosť @@ -1737,15 +1787,15 @@ moviebrowser.yt_recently_featured Nedávno odporúčané moviebrowser.yt_region Región moviebrowser.yt_related Podobné videá moviebrowser.yt_search Hľadať slovo -moviecut.cancel Zrušiť editovanie filmu? +moviecut.cancel Zrušiť úpravu filmu? movieplayer.bookmark Záložky movieplayer.bookmarkname Názov záložky -movieplayer.bookmarkname_hint1 Vloženie názvu -movieplayer.bookmarkname_hint2 novej záložky? +movieplayer.bookmarkname_hint1 Vloženie názvu novej záložky +movieplayer.bookmarkname_hint2 movieplayer.chapters Kapitoly -movieplayer.defplugin Spustenie doplnku -movieplayer.fileplayback Súbor cez VLC +movieplayer.fileplayback Prehliadač súborov movieplayer.head Prehrávač filmov +movieplayer.plugin Doplnky Prhrávača filmov movieplayer.starting Spúšťa sa prehrávanie... movieplayer.titles Tituly movieplayer.toomanybookmarks Veľa záložiek.\nJe potrebné vymazať jednu najprv. @@ -1755,120 +1805,126 @@ movieplayer.tshelp11 asi 10 min dopredu movieplayer.tshelp12 Nápoveda: http://www.giggo.de/dbox2/movieplayer.html\n movieplayer.tshelp2 Výbrer zvukovej stopy movieplayer.tshelp3 Prerušenie/Pokračovanie -movieplayer.tshelp4 Vytvorí záložku -movieplayer.tshelp5 Zobrazí postup +movieplayer.tshelp4 Vytvoriť záložku +movieplayer.tshelp5 Zobraziť čas movieplayer.tshelp6 asi 1 min dozadu movieplayer.tshelp7 asi 1 min dopredu movieplayer.tshelp8 asi 5 min dozadu movieplayer.tshelp9 asi 5 min dopredu movieplayer.tsplayback Prehrať TS -movieplayer.ytplayback Prehrávanie youtube -mpkey.audio Zvuková stpopa -mpkey.bookmark Ulož záložku +movieplayer.ytplayback YouTube prehrávač +mpkey.audio Zvuková stopa +mpkey.bookmark Uložiť záložku mpkey.forward Dopredu -mpkey.goto Zadaj čas prehrávania -mpkey.next_repeat_mode ďaľší opakovací režim -mpkey.pause Preruš -mpkey.play Prehraj -mpkey.plugin Spusti doplnok +mpkey.goto Zadať čas prehrávania +mpkey.next_repeat_mode Ďalší opakovací režim +mpkey.pause Pozastaviť +mpkey.play Prehrať +mpkey.plugin Spustiť doplnok mpkey.rewind Dozadu -mpkey.stop Zastav +mpkey.stop Zastaviť mpkey.subtitle Titulky mpkey.time Zobrazenie času networkmenu.apply_settings Zmeny sa aplikujú... networkmenu.apply_settings_now Chcete teraz aplikovať zmeny? -networkmenu.broadcast Vysielanie -networkmenu.dhcp Prevzatie z DHCP +networkmenu.broadcast Vysielanie / Broadcast +networkmenu.dhcp Načítať IP adresu z DHCP networkmenu.error_no_address Strata %s adresy! networkmenu.gateway Predvolená brána networkmenu.hostname Názov hostiteľa -networkmenu.hostname_hint1 vložiť hostitela -networkmenu.hostname_hint2 pre zmenu potrebný Reboot +networkmenu.hostname_hint1 Vložiť hostiteľa, +networkmenu.hostname_hint2 pre zmenu potrebný reštart networkmenu.inactive_network Sieť neaktívna! -networkmenu.ipaddress Adresa IP -networkmenu.mount NFS/CIFS/FTPFS +networkmenu.ipaddress IP adresa +networkmenu.mount Úprava sieťových zložiek (NFS / CIFS) networkmenu.nameserver DNS networkmenu.netmask Maska podsiete -networkmenu.ntpenable Synchronizácia -networkmenu.ntprefresh Skontroluj po (min): +networkmenu.ntpenable Synchronizovať čas cez +networkmenu.ntprefresh Skontrolovať po (min): networkmenu.ntprefresh_hint1 Zosynchronizuje čas po (minúty) networkmenu.ntprefresh_hint2 Potrebný reštart boxu alebo reštart EPG networkmenu.ntpserver NTP server networkmenu.ntpserver_hint1 NTP server napr.: ntpl.ptb.de networkmenu.ntpserver_hint2 Potrebný reštart boxu alebo reštart EPG -networkmenu.ntptitle Aktualizácia hodín +networkmenu.ntptitle Synchronizácia času / hodín networkmenu.password Pre-Shared kľúč (PSK) networkmenu.reset_settings_now Chcete obnoviť predchádzajúce nastavenia? -networkmenu.select_if Interface +networkmenu.select_if Rozhranie networkmenu.services Sieťové služby -networkmenu.setupnow Použi nastavenia siete +networkmenu.setupnow Použiť nastavenia siete networkmenu.setuponstartup Nastavenie siete pri štarte -networkmenu.show Zobrazenie sieťového nastavenia +networkmenu.show Zobraziť nastavenia siete networkmenu.ssid Názov siete (SSID) networkmenu.ssid_scan Hľadanie WLAN sietí networkmenu.ssid_scan_error Nenájdené WLAN siete networkmenu.ssid_scan_wait Prebieha hľadanie WLAN sietí -networkmenu.test Otestovanie siete -neutrino_starting Spustenie Neutrina... -nfs.alreadymounted Adresár je už pripojený -nfs.automount Pripoj pri spustení -nfs.dir Adresár/zdielanie +networkmenu.test Test siete +neutrino_starting Start Neutrino... +nfs.alreadymounted Zložka je už pripojená +nfs.automount Pripojiť pri spustení +nfs.dir Zložka / Zdielanie nfs.ip IP servera NFS/CIFS -nfs.localdir Lokálny adresár -nfs.mount Pripoj adresár +nfs.localdir Lokálna zložka +nfs.mount Pripojiť sieťovú zložku nfs.mount_options Možnosti pripojenia nfs.mounterror Chyba pripojenia nfs.mounterror_notsup Nepodporovaný súborový systém -nfs.mountnow Pripoj teraz +nfs.mountnow Pripojiť teraz nfs.mountok Pripojenie úspešné -nfs.mounttimeout Chyba pripojenia: uplinul časový limit +nfs.mounttimeout Chyba pripojenia: uplynul časový limit nfs.password Heslo CIFS nfs.refresh_mac vyhľadať MAC adresu -nfs.remount Znovu pripoj +nfs.remount Znovu pripojiť nfs.type Typ nfs.type_cifs CIFS nfs.type_lufs FTPFS nfs.type_nfs NFS -nfs.umount Odpoj adresár -nfs.umounterror Chyba odpojenia adresára -nfs.username uživateľ CIFS +nfs.umount Odpojiť sieťovú zložku +nfs.umounterror Chyba odpojenia zložky +nfs.username Užívateľ CIFS nfsmenu.head Nastavenia NFS/CIFS/FTPFS nvod.percentage (prešlo: %d%% min) nvod.starting (spustenie za %d min) nvodselector.directormode Priamo nvodselector.head Výber času spustenia +nvodselector.starttime Voľba počiatočného času nvodselector.subservice Výber podkanálu -opkg.button.expert_off Štandartný mód +opkg.button.expert_off Štandardný mód opkg.button.expert_on Expertný mód opkg.button.info Informácia balíčka opkg.button.install Inštalovať balíček opkg.button.uninstall Odstrániť balíček -opkg.failure.install inštalácia zlyhala -opkg.failure.update aktualizácie zlyhala -opkg.failure.upgrade Upgrade zlyhalo -opkg.install.local.package Nainštalujte miestne balíček +opkg.enter.feed.address Vložte prosím adresu serveru, lokálnej alebo zdieľanej zložky! +opkg.enter.feed.address.example Príklad: http://pkg.nevis.neutrino-hd.com +opkg.failure.install Chyba inštalácie (%d) +opkg.failure.update Chyba aktualizácie (%d) +opkg.failure.upgrade Chyba aktualizovania (%d) +opkg.feed.addresses Adresy zdrojov +opkg.install.local.package Inštalácia lokálneho balíčku opkg.messagebox.reinstall Preinštalovať %s? opkg.messagebox.remove Odstrániť %s? -opkg.messagebox.size.error Nie je dostatok voľnej pamäte pre tento balík! -opkg.messagebox.updates.available Aktualizácia k dispozícii! -opkg.success.install inštalácia úspešne!\n Môže byť potrebné reštart neutríno. Teraz reštartovať? +opkg.messagebox.size.error Pre tento balíček nie je dostatok pamäte! +opkg.messagebox.updates.available Dostupné aktualizácie! +opkg.success.install Inštalácia dokončená!\n Je vyžadovaný reštart Neutrina. Reštartovať teraz? opkg.title Správa balíčkov +opkg.update.check Kontrola aktualizácií... +opkg.update.reading_lists Načítavanie zoznamu balíčkov... opkg.upgrade Aktualizovanie inštalovaných balíčkov -opkg.warning_3rdparty_packages Zahraničné balíčky by mohli poškodiť systém! Si si istý, že inštaláciu tohto balíka? -options.default obnov predvolené +opkg.warning_3rdparty_packages Balíčky tretích strán môžu poškodiť systém! Ste si istý inštaláciou tohoto balíčku? +options.default Obnoviť predvolené hodnoty options.fb FRAMEBUFFER -options.hint_default Nastaviť prednastavené hodnoty +options.hint_default Nastaviť späť na predvolené hodnoty. options.ntp_off DVB options.ntp_on NTP options.null nič options.off nie options.on áno -options.on.without_messages Bez správ +options.on.without_messages Bez hlásení options.serial SERIAL parentallock.bouquetmode Predvolené bukety parentallock.changepin Zmena PIN kódu parentallock.changepin_hint1 Zadanie Vášho nového bezpečnostného PIN kódu! -parentallock.changetolocked na zamknutie buketov +parentallock.changetolocked Na zamknutie buketov parentallock.defaultlocked zamknuté parentallock.defaultunlocked odomknuté parentallock.head Zadanie bezpečnostného PIN kódu @@ -1876,35 +1932,35 @@ parentallock.lockage Blokovanie parentallock.lockage12 od 12 rokov parentallock.lockage16 od 16 rokov parentallock.lockage18 od 18 rokov -parentallock.lockedchannel Kanál zamknutý... -parentallock.lockedprogram Program zamknutý (od %d rokov) +parentallock.lockedchannel Kanál uzamknutý... +parentallock.lockedprogram Program uzamknutý (od %d rokov) parentallock.menu Bezpečnosť -parentallock.never nikdy -parentallock.onsignal pri zistení zámku +parentallock.never Nikdy +parentallock.onsignal Pri zistení zámku parentallock.parentallock Rodičovský zámok parentallock.prompt Použitie PIN kódu parentallock.zaptime Čas zamknutia buketov (minúty) personalize.access Voľby prístupu personalize.apply_settings Použiť zmeny? -personalize.button_auto auto -personalize.button_blue modrý -personalize.button_green zelený -personalize.button_red červený -personalize.button_yellow žltý +personalize.button_auto Automaticky +personalize.button_blue Modré +personalize.button_green Zelené +personalize.button_red Červené +personalize.button_yellow Žlté personalize.disabled Nepoužité personalize.enabled Použité -personalize.head Osobné zohľadnenie +personalize.head Personalizácia menu personalize.help Nápoveda -personalize.help_line1 Vytvorenie osobného zohľadnenia umožnuje prispôsobiť +personalize.help_line1 Vytvorenie osobného nastavenia umožnuje prispôsobiť personalize.help_line2 dôležité ponuky, ktoré používate. Ponuky -personalize.help_line3 môžu byť viditelné, skryté, použité, nepoužité +personalize.help_line3 môžu byť viditeľné, skryté, použité, nepoužité personalize.help_line4 alebo chránené PIN-om. -personalize.help_line5 Prístup k osobnému zohľadneniu môže byť chránený +personalize.help_line5 Prístup k osobnému nastaveniu môže byť chránený personalize.help_line6 s PIN-om. PIN je totožný pre všetky chránené ponuky personalize.help_line7 (neplatí pre vekové obmedzenie). personalize.help_line8 Prednastavený PIN je: 0000 personalize.menuconfiguration Konfigurácia menu -personalize.menudisabledhint Požadovaná ponuka je momentálne nepoužitá!\nPre aktiváciu prosímt otvorte ponuku 'Osobné zohľadnenie'\nnájdenú v ponuke 'Nastavenia'! +personalize.menudisabledhint Požadovaná ponuka je momentálne neaktívna!\nPre aktiváciu prosím otvorte ponuku 'Personalizácia menu'\nv ponuke 'Nastavenia'! personalize.notprotected Nie personalize.notvisible Skryté personalize.pin PIN @@ -1912,13 +1968,13 @@ personalize.pin_in_use PIN prístup pre personalizáciu nastavenia personalize.pincode Osobný PIN personalize.pinhint Zadanie osobného PIN kódu personalize.pinprotect Áno -personalize.pinstatus vyžadujú PIN +personalize.pinstatus -vyžaduje sa PIN personalize.plugins Doplnky personalize.usermenu_plugin_types Výber Doplnku pre zobrazenie personalize.usermenu_preferred_buttons Priradenie preferovaných kláves -personalize.usermenu_show_cancel Zobraziť "Zrušiť" kláves +personalize.usermenu_show_cancel Zobraziť klávesu "Zrušiť" personalize.visible Viditeľné -pictureviewer.defdir Východzí adresár +pictureviewer.defdir Predvolená zložka pictureviewer.head Prehliadač obrázkov pictureviewer.help1 Spôsob menu pictureviewer.help10 Zobrazenie spôsobu @@ -1926,7 +1982,7 @@ pictureviewer.help11 Znovunačítanie obrázku pictureviewer.help12 Predchádzajúci obrázok pictureviewer.help13 Nasledujúci obrázok pictureviewer.help14 Zmenšenie -pictureviewer.help15 Zvečšenie +pictureviewer.help15 Zväčšenie pictureviewer.help16 Pohyb nahor pictureviewer.help17 Pohyb doľava pictureviewer.help18 Pohyb doprava @@ -1934,10 +1990,10 @@ pictureviewer.help19 Pohyb nadol pictureviewer.help2 Zobrazenie obrázku pictureviewer.help3 Zmena poradia triedenia pictureviewer.help30 Mód audio prehrávača -pictureviewer.help31 Spustenia prehrávania -pictureviewer.help32 Pauzy prehrávania -pictureviewer.help33 Zastavenia prehrávania -pictureviewer.help34 Ďaľší titul +pictureviewer.help31 Spustenie prehrávania +pictureviewer.help32 Pozastavenie prehrávania +pictureviewer.help33 Zastavenie prehrávania +pictureviewer.help34 Ďalší titul pictureviewer.help35 Predošlý titul pictureviewer.help4 Bez mierky obrázku pictureviewer.help5 Mód DIASHOW @@ -1949,79 +2005,80 @@ pictureviewer.resize.color_average rozšírené pictureviewer.resize.none žiadne pictureviewer.resize.simple jednoduché pictureviewer.scaling Prispôsobenie -pictureviewer.show zobraz +pictureviewer.show Zobraziť pictureviewer.slide_time Čas zobrazenia pri prezentácii pictureviewer.slideshow Prezentácia pictureviewer.sortorder.date Zmena poradia triedenia (dátum) pictureviewer.sortorder.filename Zmena poradia triedenia (názov súboru) -ping.ok odpovedal (ping) -ping.protocol je nedosiahnutý (chyba hostu alebo protokolu) -ping.socket je nedosiahnutý (chyba soketu) +ping.ok je dosiahnuteľný (ping) +ping.protocol nedosiahnuteľný (chyba hostu alebo protokolu) +ping.socket nedosiahnuteľný (chyba soketu) ping.unreachable neodpovedal pinprotection.head Zadanie PIN kódu pinprotection.wrongcode Nespávny PIN kód! Skúste znova. -plugins.hdd_dir Plugin adresár na HDD +plugins.hdd_dir Zložka pre externý doplnok +plugins.no_plugin Žiadny doplnok plugins.result Výstup doplnku plugintype.disabled Nepoužitý plugintype.game Hra plugintype.lua Lua doplnok plugintype.script Skript plugintype.tool Nástroj -rclock.lockmsg Váš ovládač boxu bude zablokovaný.\n\nPre odblokovanie stlačte [ČERVENÝ] \na [MENU] na Vašom ovládači. -rclock.menueadd Zamknutie DO -rclock.title Zamknutie Diaľkového Ovládača -rclock.unlockmsg Ovládač opäť funkčný. +rclock.locked Uzamknuté +rclock.lockmsg Diaľkový ovládač uzamknutý.\n\nPre odblokovanie stlačte [ČERVENÉ] \na [MENU] na Vašom ovládači. +rclock.title Uzamknutie diaľkového ovládača +rclock.unlockmsg Diaľkové ovládanie funkčné... recording.is_running Tento kanál sa nahráva. Spustiť nové nahrávanie? -recording.start Spustenie nahrávania, prosím čakajte...! -recording.startstop_msg Správa pri spustení alebo ukončení nahrávania -recording.stop Zastavenie nahrávania, prosím čakajte...! -recording.time_hour hodina -recording.time_hours hodín -recording.time_min min +recording.start Spúšťanie nahrávania, čakajte prosím...! +recording.startstop_msg Upozorniť o začatí / ukončení nahrávania +recording.stop Zastavenie nahrávania, čakajte prosím...! +recording.time_hour Hodina +recording.time_hours Hodín +recording.time_min Min recordingmenu.apids Predvolené zvukové stopy -recordingmenu.apids_ac3 Nahraj zvuk AC3 -recordingmenu.apids_alt Nahraj ostatné zvukové stopy -recordingmenu.apids_std Nahraj štandartný zvuk +recordingmenu.apids_ac3 Nahrať zvuk AC3 +recordingmenu.apids_alt Nahrať ostatné zvukové stopy +recordingmenu.apids_std Nahrať štandartný zvuk recordingmenu.auto_cover Automatický náhľad -recordingmenu.data_pids Dátové stopy -recordingmenu.defdir Adresár nahrávania -recordingmenu.dvbsub_pids Nahraj titulky -recordingmenu.end_of_recording_epg EPG akt.udalosť -recordingmenu.end_of_recording_max max. čas nahrávania -recordingmenu.end_of_recording_name Konečný čas nahrávania -recordingmenu.file disk (súbor) +recordingmenu.data_pids Datové stopy +recordingmenu.defdir Zložka pre nahrávanie +recordingmenu.dvbsub_pids Nahrať titulky +recordingmenu.end_of_recording_epg času udalosti v EPG +recordingmenu.end_of_recording_max max. času nahrávania +recordingmenu.end_of_recording_name Ukončiť nahrávanie podľa +recordingmenu.file Disk (súbor) recordingmenu.filename_template Dočasný názov -recordingmenu.filename_template_hint wildcards budú nahradené +recordingmenu.filename_template_hint Zástupné znaky súborov budú nahradené recordingmenu.filename_template_hint2 %C = kanál, %T = názov, %I = info, %d = dátum, %t = čas -recordingmenu.help Nahrávacie zariadenie:\n--------------------------------------\nserver:\npotrebný streamovaci SW na PC\n\(analóg) VCR:\npotrebný VCR (druhý SCART)\n\ndisk (súbor):\npotrebný pripojený sieťový NFS adresár\nalebo vnútorný HDD disk\nTS: použi SPTS režim(dBox2)\nPES: nepouži SPTS režim(dBox2)\n\n\nMaximálna veľkosť súboru:\n---------------------\nNFS V2: 2 GB (2048 MB)\nNFS V3: takmer nekonečné (0 MB)\nFAT: 2 GB (2048 MB)\nFAT32: 4 GB (4096 MB)\n\nPre NFS (UDP) sa doporučuje synchronizovaný zápis -recordingmenu.multimenu.ask_stop_all skutočne zastaviť všetky %d nahrávania? -recordingmenu.multimenu.info_stop_all %d z %d nahrávaní budú zastavené. -recordingmenu.multimenu.rec_akt nahrať aktuálny kanál -recordingmenu.multimenu.stop_all zastaviť všetky nahrávania +recordingmenu.help Nahrávacie zariadenie:\n--------------------------------------\nserver:\npotrebný streamovaci SW na PC\n\(analóg) VCR:\npotrebný VCR (druhý SCART)\n\ndisk (súbor):\npotrebná pripojená sieťová zložka NFS\nalebo vnútorný HDD disk\nTS: použi SPTS režim(dBox2)\nPES: nepouži SPTS režim(dBox2)\n\n\nMaximálna veľkosť súboru:\n---------------------\nNFS V2: 2 GB (2048 MB)\nNFS V3: takmer nekonečné (0 MB)\nFAT: 2 GB (2048 MB)\nFAT32: 4 GB (4096 MB)\n\nPre NFS (UDP) sa doporučuje synchronizovaný zápis +recordingmenu.multimenu.ask_stop_all Skutočne zastaviť všetky %d nahrávania? +recordingmenu.multimenu.info_stop_all %d z %d nahrávaní bude zastavených. +recordingmenu.multimenu.rec_akt Nahrať aktuálny kanál +recordingmenu.multimenu.stop_all Zastaviť všetky nahrávania recordingmenu.multimenu.timeshift Časový posun recordingmenu.off vypnuté recordingmenu.record_is_not_running Žiadne nahrávanie nebeží! recordingmenu.record_is_running Nahrávanie beží! -recordingmenu.save_in_channeldir Zapísanie do adresára kanálu +recordingmenu.save_in_channeldir Nahrávanie do zložky s názvom kanálu recordingmenu.server server recordingmenu.server_mac Adresa MAC servera -recordingmenu.setupnow Použi nastavenia -recordingmenu.slow_warn Použi pomalé nahrávacie upozornenie +recordingmenu.setupnow Použiť nastavenia +recordingmenu.slow_warn Upozorniť na pomalé nahrávanie recordingmenu.timeshift Časový posun -recordingmenu.tsdir Adresár časového posunu -recordingmenu.vcr videomagnetofón -recordingmenu.vtxt_pid Nahraj teletext -recordingmenu.zap_on_announce Informuj o zapnutí nahrávania +recordingmenu.tsdir Zložka časového posunu +recordingmenu.vcr Videorekordér +recordingmenu.vtxt_pid Nahrať teletext +recordingmenu.zap_on_announce Prepnúť na kanál pred začatím nahrávania recordtimer.announce Začatie nahrávania za pár minút. -reset_all Továrenské nastavenie +reset_all Továrenské nastavenia reset_channels Zmazanie všetkych kanálov reset_confirm Skutočne? reset_removed Zmazanie odstránených kanálov -reset_settings Návrat k prednastavenému nastaveniu -satsetup.auto_scan Automatické prehľadanie vybraného satelitu -satsetup.auto_scan_all Automatické prehľadanie vybraných satelitov +reset_settings Návrat k predvoleným nastaveniam +satsetup.auto_scan Automatické prehľadávanie vybraného satelitu +satsetup.auto_scan_all Automatické prehľadávanie vybraných satelitov satsetup.cable Káblové vyhľadávanie -satsetup.cable_nid Network ID +satsetup.cable_nid ID siete satsetup.comm_input Potvrdený vstup satsetup.diseqc DiSEqC satsetup.diseqc10 DiSEqC 1.0 @@ -2033,26 +2090,26 @@ satsetup.diseqc_input DiSEqC vstup satsetup.diseqc_order Poradie DiSEqC príkazu satsetup.diseqc_uncom_com Nepotvrdený/Potvrdený satsetup.diseqcrepeat DiSEqC opakovania -satsetup.extended Nastavenia DiSEqC -satsetup.extended_motor Nastavenia motora +satsetup.extended Nastavenie DiSEqC +satsetup.extended_motor Nastavenie motora satsetup.fastscan_all SD a HD satsetup.fastscan_auto_diseqc Spustiť automatickú konfiguráciu DiSEqC satsetup.fastscan_auto_diseqc_wait Prebieha automatická konfigurácia DiSEqC satsetup.fastscan_hd len HD -satsetup.fastscan_head Rýchle prehľadanie (Fast-SCAN) +satsetup.fastscan_head Rýchle prehľadávanie (FastScan) satsetup.fastscan_prov Poskytovateľ satsetup.fastscan_prov_cd_hd CanalDigitaal (HD) satsetup.fastscan_prov_cd_sd CanalDigitaal (SD) satsetup.fastscan_prov_hda AustriaSat (HD) satsetup.fastscan_prov_hello M7 Group (HU) -satsetup.fastscan_prov_skylink_c M7 Group (CZ) -satsetup.fastscan_prov_skylink_s M7 Group (SK) +satsetup.fastscan_prov_skylink_c M7 Group [Skylink] (CZ) +satsetup.fastscan_prov_skylink_s M7 Group [Skylink] (SK) satsetup.fastscan_prov_telesat_b TeleSAT Belgium satsetup.fastscan_prov_telesat_l TeleSAT Luxemburg satsetup.fastscan_prov_tvv_hd TV Vlaanderen (HD) satsetup.fastscan_prov_tvv_sd TV Vlaanderen (SD) satsetup.fastscan_sd len SD -satsetup.fastscan_type Typ prehľadania +satsetup.fastscan_type Typ prehľadávania satsetup.fastscan_update Automatická aktualizácia satsetup.fe_delsys_mode Režim odbavovacieho systému satsetup.fe_delsys_mode_auto Auto @@ -2061,21 +2118,21 @@ satsetup.fe_delsys_mode_sat Družica satsetup.fe_delsys_mode_terrestrial Pozemne satsetup.fe_mode Mód tuneru satsetup.fe_mode_independent Nezávislý -satsetup.fe_mode_link_loop Prepojený +satsetup.fe_mode_link_loop Prepojený [loop] satsetup.fe_mode_link_twin Dvojitý satsetup.fe_mode_master Hlavný satsetup.fe_mode_unused Nepoužitý satsetup.fe_setup Nastavenie tuneru -satsetup.lofh LNB horné pásmo -satsetup.lofl LNB spodné pásmo -satsetup.lofs LNB prepnutie pásma +satsetup.lofh LNB Horné pásmo +satsetup.lofl LNB Dolné pásmo +satsetup.lofs LNB Prepnutie pásma satsetup.logical_hd Preferovať HD kanály satsetup.logical_numbers Použiť logické čísla satsetup.manual_scan Ručné prehľadávanie satsetup.minidiseqc Mini-DiSEqC satsetup.motor_pos Pozícia v motore satsetup.nodiseqc bez DiSEqC -satsetup.reset_numbers Resetovať čísla kanálu +satsetup.reset_numbers Resetovať čísla kanálov satsetup.sat_setup Nastavenia vstupov a LNB pre satelity satsetup.satellite Satelit satsetup.select_sat Výber satelitov @@ -2086,13 +2143,13 @@ satsetup.unicable Unicable satsetup.usals_repeat Opakovanie USALS príkazu satsetup.use_bat Použitie BAT satsetup.use_fta_flag Len nekódované -satsetup.use_nit Použitie NIT +satsetup.use_nit Použiť NIT (Network Information Table) satsetup.use_usals Použitie USALS sc.empty Žiadna karta v čítačke sc.init_failed Chyba inicializácie karty -sc.init_ok Inicializácia karty kompletná +sc.init_ok Inicializácia karty dokončená sc.inserted Karta vložená do čítačky -sc.removed Karta odstránená z čítačky +sc.removed Karta vytiahnutá z čítačky sc.reset Reset karty sc.timeout Vypršanie času menu karty sc.waiting Čakanie na odpoveď karty @@ -2101,10 +2158,10 @@ scants.abort_header Prerušenie vyhľadávania scants.actcable Kábel: scants.acthybrid Hybrid: scants.actsatellite Satelit: -scants.actterrestrial Pozemne: +scants.actterrestrial Pozemné: scants.bouquet Bukety -scants.bouquet_create vytvor nový -scants.bouquet_erase zmaž všetky +scants.bouquet_create vytvoriť nový +scants.bouquet_erase zmazať všetky scants.bouquet_leave bez zmien scants.bouquet_satellite Satelitný Buket scants.bouquet_update aktualizácia @@ -2115,81 +2172,86 @@ scants.bouquet_writenames_never nikdy scants.bouquet_writenames_ubouquets obľúbené scants.channel Kanál: scants.failed Neúspešné prehľadávanie! -scants.finished Dokončené prehľadávanie transpondérov! -scants.freqdata Kmitočet: -scants.head Prehľadanie transpondéra +scants.finished Prehľadávanie dokončené! +scants.freqdata Frekvencia: +scants.head Prehľadávanie transpondéra scants.numberofdataservices Data scants.numberofradioservices Rádio scants.numberoftotalservices Celkom scants.numberoftvservices TV -scants.preverences_receiving_system Preferencie +scants.preverences_receiving_system Nastavenia scants.preverences_scan Mód hľadania scants.provider Poskytovateľ: -scants.select_tp Vyber transpondér -scants.startnow Spusti prehľadávanie -scants.test Otestovanie signálu +scants.select_tp Výber transpondéru +scants.startnow Spustiť prehľadávanie +scants.test Test signálu scants.transponders Transpondéry: scrambled_channel Kódovaný kanál screensaver.delay Oneskorenie -screensaver.dir Adresár +screensaver.dir Zložka screensaver.menu Šetrič obrazovky -screensaver.off Vypnutie šetriča -screensaver.timeout Zmena obrázkov +screensaver.mode Režim +screensaver.mode_clock Hodiny +screensaver.mode_clock_color Farebné hodiny +screensaver.mode_image Obrázky +screensaver.off Šetrič obrazovky +screensaver.random Náhodné obrázky +screensaver.timeout Zmena intervalu screensetup.lowerright zelený = dolný, pravý okraj screensetup.upperleft červený = horný, ľavý oraj screenshot.count Počet -screenshot.cover Vytvor obálku pre prehliadač filmov -screenshot.defdir Umiestnenie adresára +screenshot.cover Vytvoriť obálku pre prehliadač filmov +screenshot.defdir Umiestnenie zložky screenshot.format Formát -screenshot.info Screenshot kláves nepoužitý -screenshot.menu Obrázok obrazovky +screenshot.info Screenshot klávesa nepoužitá +screenshot.menu Snímok obrazovky screenshot.osd OSD rozlíšenie screenshot.res Rozlíšenie screenshot.scale Pomer screenshot.tv TV rozlíšenie screenshot.video Obraz na pozadí servicemenu.getplugins Načítanie doplnkov -servicemenu.getplugins_hint Načítavanie doplnkov,\nprosím čakaj... -servicemenu.head Služby -servicemenu.imageinfo Informácia o IMAGE +servicemenu.getplugins_hint Načítavanie doplnkov,\nčakajte prosím... +servicemenu.head Inštalácia / služby +servicemenu.imageinfo Informácie o softvéri servicemenu.reload Načítanie zoznamu kanálov -servicemenu.reload_hint Načítavanie zoznamu kanálov,\nprosím čakaj... -servicemenu.restart Reštart software -servicemenu.restart_hint Reštartovanie, prosím čakaj... -servicemenu.restart_refused_recording Neumožnené reštartovanie, prebieha nahrávanie -servicemenu.scants Hľadanie kanálov -servicemenu.update Aktualizácia software -settings.backup Záloha nastavení +servicemenu.reload_hint Načítavanie zoznamu kanálov,\nčakajte prosím... +servicemenu.restart Softvérový reštart +servicemenu.restart_hint Reštartovanie, čakajte prosím... +servicemenu.restart_refused_recording Prebieha nahrávanie... Reštart nie je povolený! +servicemenu.scants Prehľadávanie kanálov +servicemenu.update Aktualizácia softvéru +settings.backup Záloha: Uloženie nastavení settings.backup_failed Chybná záloha! settings.help Nápoveda -settings.menu_hints Zobrazí rady nápovedy +settings.menu_hints Zobraziť nápovedu settings.menu_pos Umiestnenie ponuky settings.menus Ponuky -settings.missingoptionsconffile Nastavenia Neutrino boli aktualizované.\nNové možosti budú mať prednastavené hodnoty. -settings.noconffile Nenájdené nastavenia Neutrino.\nPoužité budú prednastavené hodnoty. -settings.pos_bottom_center spodný stred -settings.pos_bottom_left ľavý spodok -settings.pos_bottom_right pravý spodok -settings.pos_default_center stred +settings.missingoptionsconffile Nastavenia Neutrino boli aktualizované.\nNové možnosti budú mať predvolené hodnoty. +settings.noconffile Nenájdené nastavenia Neutrino.\nPoužité budú predvolené hodnoty. +settings.pos_bottom_center v strede naspodu +settings.pos_bottom_left vľavo dole +settings.pos_bottom_right vpravo dole +settings.pos_default_center v strede settings.pos_higher_center spodný vyšší stred -settings.pos_top_center vrchný stred -settings.pos_top_left ľavý vrch -settings.pos_top_right pravý vrch -settings.restore Obnovenie nastavení -settings.restore_warn Budú nahradené všetky nastavenia a reštartujem sa\nPokračovať ? +settings.pos_top_center v strede navrchu +settings.pos_top_left vľavo hore +settings.pos_top_right vpravo hore +settings.restore Záloha: Obnovenie nastavení +settings.restore_warn Všetky nastavenia budú nahradené a vykoná sa reštart.\nPokračovať? shutdown.recording_query Skutočne prerušiť nahrávanie? shutdowntimer.announce Vypnutie boxu za minútu.\nZrušiť vypnutie? -sleeptimerbox.announce Do vypnutia ostáva minúta. -sleeptimerbox.hint1 Čas do vypnutia v minútach (000=vypnuté) -sleeptimerbox.hint2 Po uplinutí tohto času sa vypnem. -sleeptimerbox.hint3 Po uplinutí tohto času sa vypnem, ak sa nepoužije diaľkový ovládač +sleeptimerbox.announce Do vypnutia zostáva minúta. +sleeptimerbox.hint1 Čas do vypnutia v minútach (000 = vypnuté). +sleeptimerbox.hint2 Po uplynutí tohto času dôjde k vypnutiu prijímača. +sleeptimerbox.hint3 Po uplynutí tohto času dôjde k vypnutiu, ak sa nepoužije diaľkový ovládač. sleeptimerbox.title Časovač vypnutia sleeptimerbox.title2 Čas vypnutia pri neaktivite streaminfo.aratio Formát obrazu streaminfo.aratio_unknown Formát obrazu: neznámy streaminfo.audiotype Formát zvuku streaminfo.audiotype_unknown neznámy -streaminfo.average_bitrate priemer +streaminfo.average_bitrate Priemer streaminfo.bitrate Prenosová rýchlosť streaminfo.framerate Snímková rýchlosť streaminfo.framerate_unknown Snímková rýchlosť: neznáma @@ -2198,53 +2260,53 @@ streaminfo.not_available nedostupné streaminfo.resolution Rozlíšenie streaminfo.signal Parametre signálu streaming.busy Nahrávací proces aktívny.\nAk sa správa zobrazuje a nie je nič nahrávané,\nreštartujte Neutrino. -streaming.dir_not_writable Do nahrávacieho adresára nie je možné nahrávať.\nNahrávanie nebude pracovať. -streaming.overflow Pretečenie buferu nahrávania, zvážte zastavenie niekterých nahrávaní -streaming.slow System/HDD je pomalý, zvážte zastavenie niekterých nahrávaní -streaming.write_error Nahrávanie bolo prerušené\npretože vznikla chybu počas zapisovacieho procesu. +streaming.dir_not_writable Do zložky určenéj pre nahrávanie nie je možné zapisovať.\nNahrávanie nie je možné. +streaming.overflow Pretečenie buferu nahrávania, zvážte zastavenie niektorých nahrávaní +streaming.slow Systém/HDD je pomalý, zvážte zastavenie niektorých nahrávaní +streaming.write_error Nahrávanie prerušené z dôvodu chyby zápisu. stringinput.backspace Naspäť -stringinput.caps veľké/malé znaky -stringinput.clear všetko zmaž +stringinput.caps Veľké/Malé znaky +stringinput.clear Všetko zmazať stringinput.insert Vložiť stringinput.save Uložiť subtitles.charset Znaková sada subtitles.head Titulky subtitles.stop Vypnúť titulky terrestrialsetup.area Územie -terrestrialsetup.provider Pozemný prevádzkovateľ +terrestrialsetup.provider DVB-T poskytovateľ timer.eventrecord.msg Udalosť je naplánovaná na nahrávanie.\nPre úpravu plánu otvorte časovač nahrávania. timer.eventrecord.title Plánovač nahrávania -timer.eventtimed.msg Táto relácia je naplánovaná.\nBox bude zapnutý a prepnutý \nna tento kanál v stanovenom čase. +timer.eventtimed.msg Plánované pripomenutie.\nPrijímač sa v stanovenom čase zapne\na prepne na zvolený kanál. timer.eventtimed.title Plánovač udalostí -timerbar.channelswitch prepni -timerbar.recordevent nahraj +timerbar.channelswitch Prepnúť +timerbar.recordevent Nahrať timerlist.alarmtime Čas spustenia timerlist.apids PIDy zvuku -timerlist.apids_dflt nahrávanie normálnych zvukových stôp +timerlist.apids_dflt Nahrávanie normálnych zvukových stôp timerlist.ask_to_delete Zmazanie stôp časovača aktuálneho nahrávania!\nSkutočne vykonať? timerlist.bouquetselect Výber buketu timerlist.channel Kanál timerlist.channelselect Výber kanálu -timerlist.delete zmaž -timerlist.menumodify upravenie časovača -timerlist.menunew nový plán +timerlist.delete Zmazať +timerlist.menumodify Upravenie časovača +timerlist.menunew Nový plán timerlist.message Správa timerlist.moderadio Rádiové kanály timerlist.modeselect Výber typu timerlist.modetv Televízne kanály -timerlist.modify uprav +timerlist.modify Upraviť timerlist.name Časovač -timerlist.new nový plán +timerlist.new Nový plán timerlist.overlapping_timer Konflikt časovača. Vytvoriť plán aj tak? timerlist.plugin Doplnky timerlist.program.unknown Neznámy program -timerlist.recording_dir Adresár nahrávania -timerlist.reload obnov -timerlist.repeat Opakuj -timerlist.repeat.biweekly v dňoch voľna +timerlist.recording_dir Zložka nahrávania +timerlist.reload Obnoviť +timerlist.repeat Opakovať +timerlist.repeat.biweekly V dňoch voľna timerlist.repeat.byeventdescription pozrieť plán timerlist.repeat.daily denne -timerlist.repeat.fourweekly štyri krát týždenne +timerlist.repeat.fourweekly 4-krát týždenne timerlist.repeat.friday Pi timerlist.repeat.monday Po timerlist.repeat.monthly mesačne @@ -2257,31 +2319,31 @@ timerlist.repeat.unknown neznáme timerlist.repeat.wednesday St timerlist.repeat.weekdays v dňoch týždňa timerlist.repeat.weekly týždenne -timerlist.repeatcount Opakovania +timerlist.repeatcount Opakovanie timerlist.repeatcount.help1 Počet opakovaní timerlist.repeatcount.help2 ´0´ - stále opakuj -timerlist.save Ulož plán -timerlist.standby Stav pripravenosti -timerlist.standby.off zo stavu pripravenosti -timerlist.standby.on do stavu pripravenosti +timerlist.save Uložiť plán +timerlist.standby Akcia +timerlist.standby.off Opustiť pohotovostný režim +timerlist.standby.on Do pohotovostného režimu timerlist.stoptime Čas vypnutia timerlist.type Typ časovača -timerlist.type.execplugin spustenie doplnku +timerlist.type.execplugin Spustenie doplnku timerlist.type.nextprogram Nasledujúci program -timerlist.type.record nahrávanie -timerlist.type.remind pripomenutie -timerlist.type.shutdown vypnutie -timerlist.type.sleeptimer časové vypnutie -timerlist.type.standby pripravenosť -timerlist.type.unknown neznáme -timerlist.type.zapto prepnutie +timerlist.type.record Nahrávanie +timerlist.type.remind Pripomenutie +timerlist.type.shutdown Vypnutie +timerlist.type.sleeptimer Časové vypnutie +timerlist.type.standby Akcia +timerlist.type.unknown Neznáme +timerlist.type.zapto Prepnutie timerlist.weekdays V dňoch týždňa timerlist.weekdays.hint_1 Po Ut St Št Pi So Ne timerlist.weekdays.hint_2 'X'=plánované '-' neplánované -timersettings.record_safety_time_after Korekcia ukončenia nahrávania +timersettings.record_safety_time_after Korekcia času ukončenia nahrávania timersettings.record_safety_time_after.hint_1 Čas v min. (00=vypnuté), ktorý bude pripočítaný timersettings.record_safety_time_after.hint_2 po ukončení daného plánu -timersettings.record_safety_time_before Korekcia začiatku nahrávania +timersettings.record_safety_time_before Korekcia času začiatku nahrávania timersettings.record_safety_time_before.hint_1 Čass v min. (00=vypnuté), ktorý bude odpočítaný timersettings.record_safety_time_before.hint_2 pri spustení daného plánu timersettings.separator Nastavenie časovača @@ -2293,11 +2355,12 @@ timing.hint_2 na obrazovke TV (v sekundách) timing.infobar Stavový riadok timing.infobar_movieplayer Stavový riadok (filmový mód) timing.infobar_radio Stavový riadok (rádio mód) -timing.menu Menu +timing.menu Ponuka timing.numericzap Prepínanie číslami -timing.volumebar Ukazovateľ hlasitosti +timing.volumebar Ukazateľ hlasitosti +tmdb.read_data Vyhľadávanie údajov TMDB... unicable.lnb Vstup Unicable -unicable.qrg Kmitočet Unicable +unicable.qrg Frekvencia Unicable unicable.scr SCR Unicable unit.decimal . unit.long.years roky @@ -2309,24 +2372,29 @@ upnpbrowser.head UPnP prehliadač upnpbrowser.noservers Nenájdený UPnP server upnpbrowser.rescan Znova hľadať upnpbrowser.scanning Hľadanie UPnP serverov -usermenu.button_blue Uživateľské menu MODRÉ -usermenu.button_green Uživateľské menu ZELENÉ -usermenu.button_red Uživateľské menu ČERVENÉ -usermenu.button_yellow Uživateľské menu ŽLTÉ -usermenu.head Uživateľské menu +usermenu.button_blue Užívateľské menu MODRÉ +usermenu.button_green Užívateľské menu ZELENÉ +usermenu.button_red Užívateľské menu ČERVENÉ +usermenu.button_yellow Užívateľské menu ŽLTÉ +usermenu.head Užívateľské menu +usermenu.item_adzap AutPrep usermenu.item_bar --- Lemovanie --- usermenu.item_epg_misc Funkcie EPG -usermenu.item_none Nič +usermenu.item_none (prázdne) usermenu.item_plugin_types Typy doplnku usermenu.item_vtxt Teletext usermenu.items Položky menu usermenu.key Klávesa usermenu.key_select Priradená klávesa usermenu.msg_info_is_empty Nenadefinovaný názov pre toto menu!\nPoužije sa prednastavený názov:\n -usermenu.msg_warning_name Máte viac ako jednu položku vytvorené pro toto menu,\nale žiadny definovaný nový názov pro toto menu.\nDoporučujem vytvoriť nový názov! +usermenu.msg_warning_name Máte viac ako jednu položku vytvorenú pre toto menu,\nale žiadny definovaný nový názov pro toto menu.\nDoporučujem vytvoriť nový názov! usermenu.msg_warning_no_items Nedefinované žiadne položky!\nZresetovaný názov menu! usermenu.name Názov -video_mode_ok Video režim pracuje správne? +usermenu.title_blue Možnosti +usermenu.title_green Zvuk +usermenu.title_red Udalosti +usermenu.title_yellow Obraz +video_mode_ok Pracuje tento video režim správne? videomenu.43mode Zobrazenie formátu 4:3 videomenu.analog_auto AUTO videomenu.analog_cvbs CVBS @@ -2347,27 +2415,27 @@ videomenu.auto Automaticky videomenu.brightness Jas videomenu.cinch CINCH videomenu.contrast Kontrast -videomenu.dbdr MPEG2 deblock/dering -videomenu.dbdr_both deblock+dering -videomenu.dbdr_deblock deblock -videomenu.dbdr_none nič +videomenu.dbdr MPEG2 filter +videomenu.dbdr_both deBlock a deRing +videomenu.dbdr_deblock deBlock +videomenu.dbdr_none žiadne videomenu.enabled_modes Nastavenie režimov pre VF klávesu -videomenu.enabled_modes_auto Automatický výber použitých režimov +videomenu.enabled_modes_auto Automatický výber povolených režimov videomenu.fullscreen Celý obraz -videomenu.hdmi_cec Uživateľské ovládanie (HDMI-CEC) -videomenu.hdmi_cec_mode Mód HDMI-CEC +videomenu.hdmi_cec Ovládanie cez HDMI (HDMI-CEC) +videomenu.hdmi_cec_mode Režim HDMI-CEC videomenu.hdmi_cec_mode_off vyp -videomenu.hdmi_cec_mode_recorder ako Rekordér -videomenu.hdmi_cec_mode_tuner ako Tuner -videomenu.hdmi_cec_standby Použiť CEC v pripravenosti -videomenu.hdmi_cec_view_on Použiť CEC pri sledovaní -videomenu.hue Nasýtenie +videomenu.hdmi_cec_mode_recorder ako DVB-S/DVB-C rekordér +videomenu.hdmi_cec_mode_tuner ako DVB-S/DVB-C prijímač +videomenu.hdmi_cec_standby Použiť CEC v pohotovostnom režime +videomenu.hdmi_cec_view_on Použiť CEC pri sledovaní TV +videomenu.hue Odtieň videomenu.letterbox Letterbox videomenu.panscan Pan&Scan videomenu.panscan2 14:9 Pan&Scan -videomenu.pip PiP nastavenie -videomenu.pip_error Chybné spustenie PiP -videomenu.saturation Farebnosť +videomenu.pip Nastavenie PiP +videomenu.pip_error Chyba spustenia PiP +videomenu.saturation Nasýtenie videomenu.scart SCART videomenu.screensetup Nastavenie zobrazenia OSD videomenu.sdosd SD OSD @@ -2383,30 +2451,30 @@ videomenu.videoformat_43 4:3 videomenu.videomode Obrazový režim webtv.head WebTV webtv.xml WebTV XML súbory -webtv.xml.add Pridaj XML súbor -webtv.xml.del Odstráň XML súbor +webtv.xml.add Pridať XML súbor +webtv.xml.del Odstrániť XML súbor window_size Veľkosť okna v % -wizard.initial_settings Najdené ininicializačné nastavenia -wizard.install_settings Chcete inštalovať kanály pre Astra 19.2°E? +wizard.initial_settings Najdené základné nastavenia +wizard.install_settings Chcete inštalovať kanály pre Astru 19.2°E? wizard.setup Úvodná inštalácia wizard.setup_advanced Rozšírená wizard.setup_easy Jednoduchá wizard.setup_type Typ inštalácie wizard.setup_type_hint Jednoduché nastavenie pre CanalDigitaal/TĂ©lĂ©SAT/TV Vlaanderen alebo jednoduché káblové vyhľadávanie -wizard.welcome_head Vitajte v Sprievodcovi nastavenia -wizard.welcome_text Ďaľšie kroky prevedú základnú inštaláciu tohto zariadenia.\nChceš pokračovať?\nBlahoželáme k zakúpeniu CST. Nasledujúce \nkroky ťa prevedú počiatočnou inštaláciou nastavenia prístroja.\nPrajeme ti veľa radosti s týmto príjmačom!\nĎaľší krok ? +wizard.welcome_head Vitajte v sprievodcovi nastavení +wizard.welcome_text Nasledujúce kroky vás prevedú počiatočnou inštaláciou nastavenia prístroja.\nInformácia: Váš prijímač môžete pohodlne ovládať\ncez webové rozhranie pre správu časovača alebo živé vysielanie cez internetový prehliadač.\nPrístupové heslo nie je zatiaľ nastavené!\nNastavte ho za pomoci použitia príkazu "passwd" cez telnet rozhranie.\nChcete pokračovať? word.from z word.in v zapit.scantype Vyhľadávanie kanálov -zapit.scantype.all všetkých -zapit.scantype.radio len Rádio -zapit.scantype.tv len TV +zapit.scantype.all Všetky +zapit.scantype.radio Len Rádio +zapit.scantype.tv Len TV zapit.scantype.tvradio TV a Rádio -zapitsetup.channelmode Východzí TV zoznam kanálov -zapitsetup.channelmode_radio Východzí Radio zoznam kanálov -zapitsetup.head Nastavenia kanála spustenia +zapitsetup.channelmode Východzí zoznam TV kanálov +zapitsetup.channelmode_radio Východzí zoznam Rádio kanálov +zapitsetup.head Nastavenie kanálu pri spustení zapitsetup.info Kanál pri spustení zapitsetup.last_radio Rádiový kanál zapitsetup.last_tv TV kanál -zapitsetup.last_use posledný sledovaný kanál +zapitsetup.last_use Posledný sledovaný kanál zaptotimer.announce Minúta do zmeny kanálu. diff --git a/data/satellites.xml b/data/satellites.xml index f8c198fd2..2c276ec42 100644 --- a/data/satellites.xml +++ b/data/satellites.xml @@ -2200,7 +2200,6 @@ - @@ -2212,6 +2211,7 @@ + @@ -2234,8 +2234,9 @@ - + + @@ -2267,6 +2268,7 @@ + @@ -2274,12 +2276,12 @@ - + @@ -2506,8 +2508,7 @@ - - + @@ -2515,6 +2516,7 @@ + @@ -2533,12 +2535,10 @@ - - @@ -2549,9 +2549,8 @@ - + - @@ -2565,7 +2564,7 @@ - + @@ -2577,7 +2576,7 @@ - + @@ -2600,9 +2599,9 @@ - + - + diff --git a/data/themes/Bluemoon-3.0.theme b/data/themes/Bluemoon-3.0.theme new file mode 100644 index 000000000..1b18e72cf --- /dev/null +++ b/data/themes/Bluemoon-3.0.theme @@ -0,0 +1,67 @@ +clock_Digit_alpha=0 +clock_Digit_blue=80 +clock_Digit_green=80 +clock_Digit_red=80 +colored_events_alpha=0 +colored_events_blue=20 +colored_events_channellist=1 +colored_events_green=50 +colored_events_infobar=2 +colored_events_red=80 +infobar_Text_alpha=0 +infobar_Text_blue=80 +infobar_Text_green=80 +infobar_Text_red=80 +infobar_alpha=20 +infobar_blue=100 +infobar_casystem_alpha=20 +infobar_casystem_blue=20 +infobar_casystem_green=20 +infobar_casystem_red=20 +infobar_gradient_body=5 +infobar_gradient_body_direction=1 +infobar_gradient_bottom=1 +infobar_gradient_bottom_direction=1 +infobar_gradient_top=1 +infobar_gradient_top_direction=1 +infobar_green=60 +infobar_red=0 +menu_ButtonBar_gradient=0 +menu_ButtonBar_gradient_direction=1 +menu_Content_Selected_Text_alpha=0 +menu_Content_Selected_Text_blue=100 +menu_Content_Selected_Text_green=100 +menu_Content_Selected_Text_red=100 +menu_Content_Selected_alpha=20 +menu_Content_Selected_blue=80 +menu_Content_Selected_green=50 +menu_Content_Selected_red=20 +menu_Content_Text_alpha=0 +menu_Content_Text_blue=80 +menu_Content_Text_green=80 +menu_Content_Text_red=80 +menu_Content_alpha=20 +menu_Content_blue=20 +menu_Content_green=20 +menu_Content_inactive_Text_alpha=0 +menu_Content_inactive_Text_blue=20 +menu_Content_inactive_Text_green=50 +menu_Content_inactive_Text_red=80 +menu_Content_inactive_alpha=20 +menu_Content_inactive_blue=20 +menu_Content_inactive_green=20 +menu_Content_inactive_red=20 +menu_Content_red=20 +menu_Head_Text_alpha=0 +menu_Head_Text_blue=80 +menu_Head_Text_green=80 +menu_Head_Text_red=80 +menu_Head_alpha=20 +menu_Head_blue=100 +menu_Head_gradient=1 +menu_Head_gradient_direction=1 +menu_Head_green=60 +menu_Head_red=0 +menu_Hint_gradient=1 +menu_Hint_gradient_direction=1 +menu_Separator_gradient_enable=1 diff --git a/data/themes/Makefile.am b/data/themes/Makefile.am index 4947e59a2..8914d5b0e 100644 --- a/data/themes/Makefile.am +++ b/data/themes/Makefile.am @@ -1,6 +1,7 @@ installdir = $(THEMESDIR) install_DATA = \ + Bluemoon-3.0.theme \ Classic.theme \ Crema.theme \ DVB2000.theme \ diff --git a/lib/jsoncpp/jsoncpp.cpp b/lib/jsoncpp/jsoncpp.cpp index be5a16b3b..5c2825a2e 100644 --- a/lib/jsoncpp/jsoncpp.cpp +++ b/lib/jsoncpp/jsoncpp.cpp @@ -219,7 +219,11 @@ static int stackDepth_g = 0; // see readValue() namespace Json { +#if __cplusplus >= 201103L +typedef std::unique_ptr CharReaderPtr; +#else typedef std::auto_ptr CharReaderPtr; +#endif // Implementation of class Features // //////////////////////////////// @@ -3761,7 +3765,11 @@ Value& Path::make(Value& root) const { namespace Json { +#if __cplusplus >= 201103L +typedef std::unique_ptr StreamWriterPtr; +#else typedef std::auto_ptr StreamWriterPtr; +#endif static bool containsControlCharacter(const char* str) { while (*str) { diff --git a/lib/libcoolstream/playback_cs.h b/lib/libcoolstream/playback_cs.h index 399ef152a..c5eb51377 100644 --- a/lib/libcoolstream/playback_cs.h +++ b/lib/libcoolstream/playback_cs.h @@ -54,6 +54,7 @@ public: bool Open(playmode_t PlayMode); void Close(void); bool Start(char * filename, unsigned short vpid, int vtype, unsigned short apid, int audio_flag, unsigned int duration = 0); + bool Start(std::string filename, std::string headers = ""); bool Stop(void); bool SetAPid(unsigned short pid, int audio_flag); bool SetSpeed(int speed); @@ -66,7 +67,7 @@ public: void FindAllPids(playback_audio_pid_info_t *audiopids, uint16_t size, uint16_t *numpida); void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language); void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language); - bool SelectSubtitles(int pid); + bool SelectSubtitles(int pid, std::string charset = ""); void GetChapters(std::vector &positions, std::vector &titles); void RequestAbort(); void GetTitles(std::vector &playlists, std::vector &titles, int ¤t); diff --git a/lib/libcoolstream2/cs_api.h b/lib/libcoolstream2/cs_api.h index 6cb6b01a5..fe1b463da 100644 --- a/lib/libcoolstream2/cs_api.h +++ b/lib/libcoolstream2/cs_api.h @@ -17,6 +17,16 @@ typedef void (*cs_messenger) (unsigned int msg, unsigned int data); +#define CS_REVISION_CHIP_TYPE(a) (((a) >> 16) & 0xFFF0) +#define CS_REVISION_HW_VERSION_MAJOR(a) (((a) >> 8) & 0x00FF) +#define CS_REVISION_HW_HAS_CI(a) (!(CS_REVISION_HW_VERSION_MAJOR(a) & 0xC0)) +#define CS_REVISION_HW_VERSION_MINOR(a) (((a) >> 0) & 0x00FF) +#define CS_CHIP_APOLLO 0x8490 +#define CS_CHIP_SHINER 0x8470 +#define CS_CHIP_KRONOS_S 0x7540 +#define CS_CHIP_KRONOS_C 0x7550 +#define CS_CHIP_KRONOS_IP 0x7530 + enum CS_LOG_MODULE { CS_LOG_CI = 0, CS_LOG_HDMI_CEC, @@ -63,6 +73,8 @@ unsigned int cs_get_ts_output(void); int cs_set_ts_output(unsigned int port); int cs_set_ts_ci_clock(unsigned int speed); int cs_get_ts_ci_clock(unsigned int *speed); +int cs_set_ts_ci_clk_src(unsigned int clk_src); +int cs_get_ts_ci_clk_src(unsigned int *clk_src); int cs_set_ts_config(unsigned int port, tsrouter_hsdp_config_t *hsdp_config); int cs_get_ts_config(unsigned int port, tsrouter_hsdp_config_t *hsdp_config); int cs_set_tsp_config(unsigned int port, tsrouter_tsp_config_t *tsp_config); @@ -71,6 +83,8 @@ int cs_get_tsp_config(unsigned int port, tsrouter_tsp_config_t *tsp_config); // Serial nr and revision accessors unsigned long long cs_get_serial(void); unsigned int cs_get_revision(void); +unsigned int cs_get_chip_type(void); +bool cs_box_has_ci(void); unsigned int cs_get_chip_id(void); unsigned int cs_get_chip_rev_id(void); diff --git a/lib/libcoolstream2/playback_cs.h b/lib/libcoolstream2/playback_cs.h index e89fc576c..d0dfea272 100644 --- a/lib/libcoolstream2/playback_cs.h +++ b/lib/libcoolstream2/playback_cs.h @@ -55,6 +55,7 @@ public: bool Open(playmode_t PlayMode); void Close(void); bool Start(char * filename, unsigned short vpid, int vtype, unsigned short apid, int audio_flag, unsigned int duration = 0); + bool Start(std::string filename, std::string headers = ""); bool Stop(void); bool SetAPid(unsigned short pid, int audio_flag); bool SetSpeed(int speed); @@ -67,7 +68,7 @@ public: void FindAllPids(playback_audio_pid_info_t *audiopids, uint16_t size, uint16_t *numpida); void FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t *numpida, std::string *language); void FindAllSubs(uint16_t *pids, unsigned short *supported, uint16_t *numpida, std::string *language); - bool SelectSubtitles(int pid); + bool SelectSubtitles(int pid, std::string charset = ""); void GetChapters(std::vector &positions, std::vector &titles); void RequestAbort(); void GetTitles(std::vector &playlists, std::vector &titles, int ¤t); diff --git a/lib/libdvbsub/dvbsub.cpp b/lib/libdvbsub/dvbsub.cpp index 79f0d5763..648735757 100644 --- a/lib/libdvbsub/dvbsub.cpp +++ b/lib/libdvbsub/dvbsub.cpp @@ -115,7 +115,7 @@ printf("[dvb-sub] ***************************************** start, stopped %d pi pthread_mutex_lock(&readerMutex); pthread_cond_broadcast(&readerCond); pthread_mutex_unlock(&readerMutex); - printf("[dvb-sub] started with pid 0x%x\n", pid); + printf("[dvb-sub] started with pid 0x%x\n", dvbsub_pid); } return 1; @@ -280,9 +280,6 @@ static void* reader_thread(void * /*arg*/) sub_debug.print(Debug::VERBOSE, "%s changed to pid 0x%x\n", __FUNCTION__, dvbsub_pid); } - len = 0; - count = 0; - len = dmx->Read(tmp, 6, 1000); if(len <= 0) continue; diff --git a/lib/libdvbsub/dvbsubtitle.cpp b/lib/libdvbsub/dvbsubtitle.cpp index 7cbfb0caa..26f1e5f8f 100644 --- a/lib/libdvbsub/dvbsubtitle.cpp +++ b/lib/libdvbsub/dvbsubtitle.cpp @@ -130,7 +130,7 @@ void cDvbSubtitleBitmaps::Draw(int &min_x, int &min_y, int &max_x, int &max_y) double xc = (double) CFrameBuffer::getInstance()->getScreenWidth(true)/(double) 720; double yc = (double) CFrameBuffer::getInstance()->getScreenHeight(true)/(double) 576; xc = yc; //FIXME should we scale also to full width ? - int xf = xc * (double) 720; + int xf = int(xc * (double) 720); #endif for (i = 0; i < Count(); i++) { @@ -140,15 +140,15 @@ void cDvbSubtitleBitmaps::Draw(int &min_x, int &min_y, int &max_x, int &max_y) int xoff, yoff; #if 0 - int nw = width == 1280 ? ((double) width / xc) : ((double) width * xc); - int nh = (double) height * yc; + int nw = int(width == 1280 ? ((double) width / xc) : ((double) width * xc)); + int nh = int((double) height * yc); int xdiff = (wd > xf) ? ((wd - xf) / 2) : 0; - xoff = sub.rects[i]->x*xc + xstart + xdiff; + xoff = int(sub.rects[i]->x*xc + xstart + xdiff); if(sub.rects[i]->y < 576/2) { - yoff = ystart + sub.rects[i]->y*yc; + yoff = int(ystart + sub.rects[i]->y*yc); } else { - yoff = yend - ((width == 1280 ? 704:576) - (double) (sub.rects[i]->y + height))*yc - nh; + yoff = int(yend - ((width == 1280 ? 704:576) - (double) (sub.rects[i]->y + height))*yc - nh); if(yoff < ystart) yoff = ystart; } @@ -379,7 +379,7 @@ dbgconverter("cDvbSubtitleConverter::Action: PTS: %012llx STC: %012llx (%lld) ti // shown = true; } else if (Delta < WaitMs) - WaitMs = (Delta > SHOW_DELTA) ? Delta - SHOW_DELTA : Delta; + WaitMs = int((Delta > SHOW_DELTA) ? Delta - SHOW_DELTA : Delta); } else { diff --git a/lib/libdvbsub/tools.h b/lib/libdvbsub/tools.h index ed3a2dea3..3786d52aa 100644 --- a/lib/libdvbsub/tools.h +++ b/lib/libdvbsub/tools.h @@ -120,8 +120,8 @@ private: mutable int allocated; mutable int size; mutable T *data; - cVector(const cVector &Vector) {} // don't copy... - cVector &operator=(const cVector &Vector) { return *this; } // ...or assign this! +// cVector(const cVector &Vector) {} // don't copy... +// cVector &operator=(const cVector &Vector) { return *this; } // ...or assign this! void Realloc(int Index) const { if (++Index > allocated) { diff --git a/lib/timerdclient/timerdclient.cpp b/lib/timerdclient/timerdclient.cpp index afd342b81..376b5fe76 100644 --- a/lib/timerdclient/timerdclient.cpp +++ b/lib/timerdclient/timerdclient.cpp @@ -34,7 +34,6 @@ #define VALGRIND_PARANOIA(x) {} #endif -int CTimerdClient::adzap_eventID = 0; unsigned char CTimerdClient::getVersion () const { return CTimerdMsg::ACTVERSION; @@ -306,11 +305,6 @@ 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; @@ -330,8 +324,7 @@ 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_ADZAP) + evType == CTimerd::TIMER_IMMEDIATE_RECORD) { CTimerd::EventInfo *ei=static_cast(data); tei.apids = ei->apids; @@ -350,6 +343,7 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, tri.epg_starttime = ri->epg_starttime; tri.epgID = ri->epgID; tri.recordingSafety = ri->recordingSafety; + tri.autoAdjustToEPG = ri->autoAdjustToEPG; strncpy(tri.recordingDir, ri->recordingDir, RECORD_DIR_MAXLEN-1); length = sizeof( CTimerd::TransferRecordingInfo); data = &tri; @@ -380,18 +374,12 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, 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 157c8f0f0..94ae1b483 100644 --- a/lib/timerdclient/timerdclient.h +++ b/lib/timerdclient/timerdclient.h @@ -61,7 +61,6 @@ 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 @@ -112,7 +111,7 @@ class CTimerdClient:private CBasicClient // adds new record timer event int addRecordTimerEvent(const t_channel_id channel_id, time_t alarmtime, time_t stoptime, uint64_t epgID=0, time_t epg_starttime=0, time_t announcetime = 0, - unsigned char apids=TIMERD_APIDS_STD, bool safety=false,std::string recDir="", bool forceAdd=true) + unsigned char apids=TIMERD_APIDS_STD, bool safety=false,bool autoAdjust=false, std::string recDir="", bool forceAdd=true) { CTimerd::RecordingInfo eventInfo; eventInfo.channel_id = channel_id; @@ -120,6 +119,7 @@ class CTimerdClient:private CBasicClient eventInfo.epg_starttime = epg_starttime; eventInfo.apids = apids; eventInfo.recordingSafety = safety; + eventInfo.autoAdjustToEPG = autoAdjust; strncpy(eventInfo.recordingDir, recDir.c_str(), RECORD_DIR_MAXLEN); return addTimerEvent(CTimerd::TIMER_RECORD, &eventInfo, announcetime, alarmtime, stoptime,CTimerd::TIMERREPEAT_ONCE, 0,forceAdd); }; @@ -133,6 +133,7 @@ class CTimerdClient:private CBasicClient eventInfo.epg_starttime = epg_starttime; eventInfo.apids = apids; eventInfo.recordingSafety = false; + eventInfo.autoAdjustToEPG = false; return addTimerEvent(CTimerd::TIMER_IMMEDIATE_RECORD, &eventInfo, 0, alarmtime, stoptime); }; @@ -153,18 +154,6 @@ 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 a741318d6..040094c1e 100644 --- a/lib/timerdclient/timerdtypes.h +++ b/lib/timerdclient/timerdtypes.h @@ -68,8 +68,8 @@ class CTimerd TIMER_REMIND, TIMER_SLEEPTIMER, TIMER_EXEC_PLUGIN, - TIMER_IMMEDIATE_RECORD, - TIMER_ADZAP + TIMER_IMMEDIATE_RECORD, + TIMER_REMOTEBOX }; enum CTimerEventStates @@ -88,6 +88,7 @@ class CTimerd t_channel_id channel_id; unsigned char apids; bool recordingSafety; + bool autoAdjustToEPG; }; struct TransferEventInfo @@ -97,6 +98,7 @@ class CTimerd t_channel_id channel_id; unsigned char apids; bool recordingSafety; + bool autoAdjustToEPG; }; struct TransferRecordingInfo : TransferEventInfo @@ -117,6 +119,7 @@ class CTimerd epgID = e.epgID; epg_starttime = e.epg_starttime; recordingSafety = e.recordingSafety; + autoAdjustToEPG = e.autoAdjustToEPG; }; RecordingInfo& operator = (EventInfo& e) { @@ -125,6 +128,7 @@ class CTimerd epgID = e.epgID; epg_starttime = e.epg_starttime; recordingSafety = e.recordingSafety; + autoAdjustToEPG = e.autoAdjustToEPG; return *this; } unsigned char apids; @@ -158,6 +162,9 @@ class CTimerd char pluginName[EXEC_PLUGIN_NAME_MAXLEN]; //only filled if applicable char recordingDir[RECORD_DIR_MAXLEN]; //only filled if applicable char epgTitle[EPG_TITLE_MAXLEN]; //only filled if applicable + char remotebox_ip[16]; + int rem_pre; + int rem_post; bool operator< (const responseGetTimer& a) const { diff --git a/src/Makefile.am b/src/Makefile.am index ed805d518..8af131987 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -82,6 +82,7 @@ neutrino_LDADD = \ driver/pictureviewer/libneutrino_pictureviewer.a \ $(MTDUTILSLIBS) \ gui/movieinfo.o \ + gui/moviebrowser/mb.o \ gui/libneutrino_gui2.a \ gui/components/libneutrino_gui_components.a \ $(LUALIBS) \ diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index 9847f008a..cc38060e9 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -142,6 +142,16 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data if ((!is_video_started) && (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED)) g_RCInput->postMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false); + + //check epg fsk in onsignal mode + if ((!is_video_started) && + (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_ONSIGNAL)){ + CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; + CEitManager::getInstance()->getCurrentNextServiceKey(current_channel_id, currentNextInfo); + if(currentNextInfo.current_fsk && currentNextInfo.current_fsk >= g_settings.parentallock_lockage){ + g_RCInput->postMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, false); + } + } } } else { if ((msg == NeutrinoMessages::EVT_ZAP_COMPLETE) || (msg == NeutrinoMessages::EVT_ZAP_FAILED ) || @@ -501,26 +511,30 @@ void CRemoteControl::processAPIDnames() { has_unresolved_ctags= true; } - if ( strlen( current_PIDs.APIDs[count].desc ) == 3 ) + std::string tmp_desc = current_PIDs.APIDs[count].desc; + if ( tmp_desc.size() == 3 ) { // unaufgeloeste Sprache... - /* getISO639Description returns same pointer as input if nothing is found */ - if (current_PIDs.APIDs[count].desc != iso) - strcpy(current_PIDs.APIDs[count].desc, iso); + tmp_desc = iso; } if ( current_PIDs.APIDs[count].is_ac3 ) { if(!strstr(current_PIDs.APIDs[count].desc, " (AC3)")) - strncat(current_PIDs.APIDs[count].desc, " (AC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[count].desc)-1); + tmp_desc += " (AC3)"; has_ac3 = true; if(g_settings.audio_DolbyDigital && (ac3_found < 0)) ac3_found = count; } else if (current_PIDs.APIDs[count].is_aac && !strstr(current_PIDs.APIDs[count].desc, " (AAC)")) - strncat(current_PIDs.APIDs[count].desc, " (AAC)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[count].desc)-1); + tmp_desc += " (AAC)"; else if (current_PIDs.APIDs[count].is_eac3 && !strstr(current_PIDs.APIDs[count].desc, " (EAC3)")) - strncat(current_PIDs.APIDs[count].desc, " (EAC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[count].desc)-1); + tmp_desc += " (EAC3)"; + + if(!tmp_desc.empty()){ + strncpy(current_PIDs.APIDs[count].desc, tmp_desc.c_str(), DESC_MAX_LEN -1); + } + } #ifdef APID_DEBUG if (! current_PIDs.APIDs.empty()) @@ -544,13 +558,17 @@ void CRemoteControl::processAPIDnames() // workaround for buggy ZDF ctags / or buggy sectionsd/drivers , who knows... if(!tags[i].component.empty()) { - strncpy(current_PIDs.APIDs[j].desc, tags[i].component.c_str(), DESC_MAX_LEN-1); - if (current_PIDs.APIDs[j].is_ac3 && !strstr(current_PIDs.APIDs[j].desc, " (AC3)")) - strncat(current_PIDs.APIDs[j].desc, " (AC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[j].desc)-1); - else if (current_PIDs.APIDs[j].is_aac && !strstr(current_PIDs.APIDs[j].desc, " (AAC)")) - strncat(current_PIDs.APIDs[j].desc, " (AAC)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[j].desc)-1); - else if (current_PIDs.APIDs[j].is_eac3 && !strstr(current_PIDs.APIDs[j].desc, " (EAC3)")) - strncat(current_PIDs.APIDs[j].desc, " (EAC3)", DESC_MAX_LEN - strlen(current_PIDs.APIDs[j].desc)-1); + std::string tmp_desc2 = tags[i].component.c_str(); + if (current_PIDs.APIDs[j].is_ac3 && tmp_desc2.find(" (AC3)")) + tmp_desc2 += " (AC3)"; + else if (current_PIDs.APIDs[j].is_aac && tmp_desc2.find(" (AAC)")) + tmp_desc2 += " (AAC)"; + else if (current_PIDs.APIDs[j].is_eac3 && tmp_desc2.find(" (EAC3)")) + tmp_desc2 += " (EAC3)"; + + if(!tmp_desc2.empty()){ + strncpy(current_PIDs.APIDs[j].desc, tmp_desc2.c_str(), DESC_MAX_LEN -1); + } } current_PIDs.APIDs[j].component_tag = -1; break; diff --git a/src/driver/audiodec/ffmpegdec.cpp b/src/driver/audiodec/ffmpegdec.cpp index 4749f70e5..625aef79f 100644 --- a/src/driver/audiodec/ffmpegdec.cpp +++ b/src/driver/audiodec/ffmpegdec.cpp @@ -293,7 +293,6 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, seek_flags = 0; } av_seek_frame(avc, best_stream, pts, seek_flags); - skip = 0; // if a custom value was set we only jump once if (actSecsToSkip != 0) { *state=PLAY; diff --git a/src/driver/colorgradient.cpp b/src/driver/colorgradient.cpp index e9ed0e97e..ee8e91150 100644 --- a/src/driver/colorgradient.cpp +++ b/src/driver/colorgradient.cpp @@ -142,8 +142,10 @@ fb_pixel_t* CColorGradient::gradientOneColor(fb_pixel_t col, fb_pixel_t *gradien start_v = max_v; end_v = min_v; break; - default: + default:{ + free(gradientBuf); return 0; + } } int bSize1 = ((mode == gradientDark2Light2Dark) || (mode == gradientLight2Dark2Light)) ? bSize/2 : bSize; diff --git a/src/driver/fade.cpp b/src/driver/fade.cpp index 92a5fbe40..a0c2f45f7 100644 --- a/src/driver/fade.cpp +++ b/src/driver/fade.cpp @@ -28,7 +28,7 @@ #include #include -#ifdef HAVE_COOL_HARDWARE +#if HAVE_COOL_HARDWARE #include #endif @@ -61,6 +61,9 @@ void COSDFader::StartFadeIn() #endif frameBuffer->setBlendLevel(fadeValue); +#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE || (HAVE_COOL_HARDWARE && defined(BOXMODEL_APOLLO)) + usleep(60000); +#endif fadeTimer = g_RCInput->addTimer( FADE_TIME, false ); } @@ -90,10 +93,12 @@ void COSDFader::StopFade() if ( fadeIn || fadeOut ) { g_RCInput->killTimer(fadeTimer); #ifdef BOXMODEL_APOLLO - usleep(40000); frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_PER_PIXEL); // Global alpha multiplied with pixel alpha #else frameBuffer->setBlendMode(1); // Global alpha multiplied with pixel alpha +#endif +#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE || (HAVE_COOL_HARDWARE && defined(BOXMODEL_APOLLO)) + usleep(60000); #endif fadeIn = fadeOut = false; } @@ -122,6 +127,9 @@ bool COSDFader::FadeDone() frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_PER_PIXEL); // Global alpha multiplied with pixel alpha #else frameBuffer->setBlendMode(1); // Global alpha multiplied with pixel alpha +#endif +#if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE || (HAVE_COOL_HARDWARE && defined(BOXMODEL_APOLLO)) + usleep(60000); #endif } else frameBuffer->setBlendLevel(fadeValue); diff --git a/src/driver/fb_window.cpp b/src/driver/fb_window.cpp index 94cf1f344..2b5bb0028 100644 --- a/src/driver/fb_window.cpp +++ b/src/driver/fb_window.cpp @@ -69,6 +69,11 @@ void CFBWindow::paintBoxRel(const int _x, const int _y, const int _dx, const int frameBuffer->paintBoxRel(x + _x, y + _y, _dx, _dy, _col, radius, type); } +void CFBWindow::paintBoxFrame(int _x, int _y, int _dx, int _dy, int _px, const color_t _col, int radius, int type) +{ + frameBuffer->paintBoxFrame(x + _x, y + _y, _dx, _dy, _px, _col, radius, type); +} + void CFBWindow::paintVLineRel(int _x, int _y, int _dy, const color_t _col) { frameBuffer->paintVLineRel(x + _x, y + _y, _dy, _col); diff --git a/src/driver/fb_window.h b/src/driver/fb_window.h index 3cad57c77..5d9efc0f7 100644 --- a/src/driver/fb_window.h +++ b/src/driver/fb_window.h @@ -43,6 +43,7 @@ class CFBWindow ~CFBWindow(); void paintBoxRel(const int _x, const int _y, const int _dx, const int _dy, const color_t _col, int radius = 0, int type = 0xF); + void paintBoxFrame(int _x, int _y, int _dx, int _dy, int _px, const color_t _col, int radius = 0, int type = 0xf); void paintVLineRel(int _x, int _y, int _dy, const color_t _col); void paintHLineRel(int _x, int _dx, int _y, const color_t _col); bool paintIcon(const char * const _filename, const int _x, const int _y, const int _h = 0, const color_t _offset = 1); diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index e9e945f86..c43c2fab1 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -365,7 +365,6 @@ int UTF8ToUnicode(const char * &text, const bool utf8_encoded) // returns -1 on text++; if (((*text) & 0xc0) != 0x80) { - remaining_unicode_length = -1; return -1; // incomplete or corrupted character } unicode_value <<= 6; diff --git a/src/driver/fontrenderer.h b/src/driver/fontrenderer.h index e34b81366..c061a7934 100644 --- a/src/driver/fontrenderer.h +++ b/src/driver/fontrenderer.h @@ -100,7 +100,7 @@ class FBFontRenderClass FT_Library library; FTC_Manager cacheManager; /* the cache manager */ - FTC_ImageCache imageCache; /* the glyph image cache */ +// FTC_ImageCache imageCache; /* the glyph image cache */ FTC_SBitCache sbitsCache; /* the glyph small bitmaps cache */ FTC_FaceID getFaceID(const char * const family, const char * const style); diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 66d4b8a21..526e27371 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -545,11 +546,13 @@ int CFrameBuffer::setMode(unsigned int /*nxRes*/, unsigned int /*nyRes*/, unsign } stride = _fix.line_length; - printf("FB: %dx%dx%d line length %d. %s nevis GXA accelerator.\n", xRes, yRes, bpp, stride, -#ifdef USE_NEVIS_GXA - "Using" + printf("FB: %dx%dx%d line length %d. %s accelerator.\n", xRes, yRes, bpp, stride, +#if defined(USE_NEVIS_GXA) + "Using nevis GXA" +#elif defined(FB_HW_ACCELERATION) + "Using fb hw graphics" #else - "Not using" + "Not using graphics" #endif ); @@ -669,7 +672,7 @@ void CFrameBuffer::paintHLineRelInternal2Buf(const int& x, const int& dx, const *(dest++) = col; } -fb_pixel_t* CFrameBuffer::paintBoxRel2Buf(const int dx, const int dy, const fb_pixel_t col, fb_pixel_t* buf/* = NULL*/, int radius/* = 0*/, int type/* = CORNER_ALL*/) +fb_pixel_t* CFrameBuffer::paintBoxRel2Buf(const int dx, const int dy, const int w_align, const int offs_align, const fb_pixel_t col, fb_pixel_t* buf/* = NULL*/, int radius/* = 0*/, int type/* = CORNER_ALL*/) { if (!getActive()) return buf; @@ -680,13 +683,13 @@ fb_pixel_t* CFrameBuffer::paintBoxRel2Buf(const int dx, const int dy, const fb_p fb_pixel_t* pixBuf = buf; if (pixBuf == NULL) { - pixBuf = (fb_pixel_t*) cs_malloc_uncached(dx*dy*sizeof(fb_pixel_t)); + pixBuf = (fb_pixel_t*) cs_malloc_uncached(w_align*dy*sizeof(fb_pixel_t)); if (pixBuf == NULL) { dprintf(DEBUG_NORMAL, "[%s #%d] Error cs_malloc_uncached\n", __func__, __LINE__); return NULL; } } - memset((void*)pixBuf, '\0', dx*dy*sizeof(fb_pixel_t)); + memset((void*)pixBuf, '\0', w_align*dy*sizeof(fb_pixel_t)); if (type && radius) { setCornerFlags(type); @@ -707,16 +710,16 @@ fb_pixel_t* CFrameBuffer::paintBoxRel2Buf(const int dx, const int dy, const fb_p line++; continue; } - paintHLineRelInternal2Buf(ofl, dx-ofl-ofr, line, dx, col, pixBuf); + paintHLineRelInternal2Buf(ofl+offs_align, dx-ofl-ofr, line, w_align, col, pixBuf); line++; } } else { fb_pixel_t *bp = pixBuf; int line = 0; while (line < dy) { - for (int pos = 0; pos < dx; pos++) + for (int pos = offs_align; pos < dx+offs_align; pos++) *(bp + pos) = col; - bp += dx; + bp += w_align; line++; } } @@ -727,48 +730,84 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co const fb_pixel_t /*col*/, gradientData_t *gradientData, int radius, int type) { -#define MASK 0xFFFFFFFF + if (!getActive()) + return NULL; - fb_pixel_t* boxBuf = paintBoxRel2Buf(dx, dy, MASK, NULL, radius, type); - if (!boxBuf) - return NULL; + checkFbArea(x, y, dx, dy, true); + fb_pixel_t MASK = 0xFFFFFFFF; + int _dx = dx; + int w_align; + int offs_align; + +#ifdef BOXMODEL_APOLLO + if (_dx%4 != 0) { + w_align = GetWidth4FB_HW_ACC(x, _dx, true); + if (w_align < _dx) + _dx = w_align; + offs_align = w_align - _dx; + if ((x - offs_align) < 0) + offs_align = 0; + } + else { + w_align = _dx; + offs_align = 0; + } +#else + w_align = _dx; + offs_align = 0; +#endif + + fb_pixel_t* boxBuf = paintBoxRel2Buf(_dx, dy, w_align, offs_align, MASK, NULL, radius, type); + if (boxBuf == NULL) { + checkFbArea(x, y, dx, dy, false); + return NULL; + } fb_pixel_t *bp = boxBuf; fb_pixel_t *gra = gradientData->gradientBuf; gradientData->boxBuf = boxBuf; + gradientData->x = x - offs_align; + gradientData->dx = w_align; if (gradientData->direction == gradientVertical) { // vertical - for (int pos = 0; pos < dx; pos++) { + for (int pos = offs_align; pos < _dx+offs_align; pos++) { for(int count = 0; count < dy; count++) { if (*(bp + pos) == MASK) *(bp + pos) = (fb_pixel_t)(*(gra + count)); - bp += dx; + bp += w_align; } bp = boxBuf; } } else { // horizontal for (int line = 0; line < dy; line++) { - for (int pos = 0; pos < dx; pos++) { - if (*(bp + pos) == MASK) - *(bp + pos) = (fb_pixel_t)(*(gra + pos)); + int gra_pos = 0; + for (int pos = 0; pos < w_align; pos++) { + if ((*(bp + pos) == MASK) && (pos >= offs_align) && (gra_pos < _dx)) { + *(bp + pos) = (fb_pixel_t)(*(gra + gra_pos)); + gra_pos++; + } } - bp += dx; + bp += w_align; } } - if ((gradientData->mode & pbrg_noPaint) == pbrg_noPaint) + if ((gradientData->mode & pbrg_noPaint) == pbrg_noPaint) { + checkFbArea(x, y, dx, dy, false); return boxBuf; + } -// blit2FB(boxBuf, dx, dy, x, y); - blitBox2FB(boxBuf, dx, dy, x, y); + blitBox2FB(boxBuf, w_align, dy, x-offs_align, y); - if ((gradientData->mode & pbrg_noFree) == pbrg_noFree) + if ((gradientData->mode & pbrg_noFree) == pbrg_noFree) { + checkFbArea(x, y, dx, dy, false); return boxBuf; + } cs_free_uncached(boxBuf); + checkFbArea(x, y, dx, dy, false); return NULL; } @@ -780,9 +819,11 @@ void CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, const int return; if (dx == 0 || dy == 0) { - dprintf(DEBUG_NORMAL, "[CFrameBuffer] [%s - %d]: radius %d, start x %d y %d end x %d y %d\n", __FUNCTION__, __LINE__, radius, x, y, x+dx, y+dy); + dprintf(DEBUG_DEBUG, "[CFrameBuffer] [%s - %d]: radius %d, start x %d y %d end x %d y %d\n", __func__, __LINE__, radius, x, y, x+dx, y+dy); return; } + if (radius < 0) + dprintf(DEBUG_NORMAL, "[CFrameBuffer] [%s - %d]: WARNING! radius < 0 [%d] FIXME\n", __func__, __LINE__, radius); checkFbArea(x, y, dx, dy, true); @@ -974,6 +1015,18 @@ void CFrameBuffer::setIconBasePath(const std::string & iconPath) iconBasePath = iconPath; } +std::string CFrameBuffer::getIconPath(std::string icon_name, std::string file_type) +{ + std::string path, filetype; + filetype = "." + file_type; + path = std::string(ICONSDIR_VAR) + "/" + icon_name + filetype; + if (access(path.c_str(), F_OK)) + path = iconBasePath + "/" + icon_name + filetype; + if (icon_name.find("/", 0) != std::string::npos) + path = icon_name; + return path; +} + void CFrameBuffer::getIconSize(const char * const filename, int* width, int *height) { *width = 0; @@ -981,6 +1034,10 @@ void CFrameBuffer::getIconSize(const char * const filename, int* width, int *hei if(filename == NULL) return; + //check for full path, icon don't have full path, or ? + if (filename[0]== '/'){ + return; + } std::map::iterator it; @@ -1067,11 +1124,7 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in /* we cache and check original name */ it = icon_cache.find(filename); if(it == icon_cache.end()) { - std::string newname = std::string(ICONSDIR_VAR) + "/" + filename + ".png"; - if (access(newname.c_str(), F_OK)) - newname = iconBasePath + "/" + filename + ".png"; - if (filename.find("/", 0) != std::string::npos) - newname = filename; + std::string newname = getIconPath(filename); //printf("CFrameBuffer::paintIcon: check for %s\n", newname.c_str());fflush(stdout); data = g_PicViewer->getIcon(newname, &width, &height); @@ -1090,9 +1143,7 @@ bool CFrameBuffer::paintIcon(const std::string & filename, const int x, const in goto _display; } - newname = std::string(ICONSDIR_VAR) + "/" + filename + ".raw"; - if (access(newname.c_str(), F_OK)) - newname = iconBasePath + "/" + filename + ".raw"; + newname = getIconPath(filename, "raw"); int lfd = open(newname.c_str(), O_RDONLY); @@ -1330,9 +1381,11 @@ void CFrameBuffer::paintBoxFrame(const int x, const int y, const int dx, const i return; if (dx == 0 || dy == 0) { - printf("paintBoxFrame: radius %d, start x %d y %d end x %d y %d\n", radius, x, y, x+dx, y+dy); + dprintf(DEBUG_NORMAL, "[CFrameBuffer] [%s - %d]: radius %d, start x %d y %d end x %d y %d\n", __func__, __LINE__, radius, x, y, x+dx, y+dy); return; } + if (radius < 0) + dprintf(DEBUG_NORMAL, "[CFrameBuffer] [%s - %d]: WARNING! radius < 0 [%d] FIXIT\n", __func__, __LINE__, radius); setCornerFlags(type); int rad_tl = 0, rad_tr = 0, rad_bl = 0, rad_br = 0; @@ -1917,6 +1970,7 @@ void CFrameBuffer::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32 ioctl(fd, FBIO_IMAGE_BLT, &image); } #endif + //printf("\033[34m>>>>\033[0m [%s:%s:%d] FB_HW_ACCELERATION (image) x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); return; } @@ -1972,16 +2026,48 @@ void CFrameBuffer::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32 void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t height, uint32_t xoff, uint32_t yoff) { - checkFbArea(xoff, yoff, width, height, true); + uint32_t xc = (width > xRes) ? (uint32_t)xRes : width; + uint32_t yc = (height > yRes) ? (uint32_t)yRes : height; +#if defined(FB_HW_ACCELERATION) + if (!(width%4)) { + fb_image image; + image.dx = xoff; + image.dy = yoff; + image.width = xc; + image.height = yc; + image.cmap.len = 0; + image.depth = 32; + image.data = (const char*)boxBuf; + ioctl(fd, FBIO_IMAGE_BLT, &image); + //printf("\033[33m>>>>\033[0m [%s:%s:%d] FB_HW_ACCELERATION x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); + return; + } + printf("\033[31m>>>>\033[0m [%s:%s:%d] Not use FB_HW_ACCELERATION x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); +#elif defined(USE_NEVIS_GXA) + void* uKva = cs_phys_addr((void*)boxBuf); + if(uKva != NULL) { + OpenThreads::ScopedLock m_lock(mutex); + u32 cmd = GXA_CMD_BLT | GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(1) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(3); + _write_gxa(gxa_base, GXA_BMP1_TYPE_REG, (3 << 16) | width); + _write_gxa(gxa_base, GXA_BMP1_ADDR_REG, (unsigned int) uKva); + _write_gxa(gxa_base, cmd, GXA_POINT(xoff, yoff)); + _write_gxa(gxa_base, cmd, GXA_POINT(xc, yc)); + _write_gxa(gxa_base, cmd, GXA_POINT(0, 0)); + //printf("\033[33m>>>>\033[0m [%s:%s:%d] USE_NEVIS_GXA x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); + add_gxa_sync_marker(); + return; + } + printf("\033[31m>>>>\033[0m [%s:%s:%d] Not use USE_NEVIS_GXA x: %d, y: %d, w: %d, h: %d\n", __file__, __func__, __LINE__, xoff, yoff, xc, yc); +#endif uint32_t swidth = stride / sizeof(fb_pixel_t); fb_pixel_t *fbp = getFrameBufferPointer() + (swidth * yoff); fb_pixel_t* data = (fb_pixel_t*)boxBuf; uint32_t line = 0; - while (line < height) { - fb_pixel_t *pixpos = &data[line * width]; - for (uint32_t pos = xoff; pos < xoff + width; pos++) { + while (line < yc) { + fb_pixel_t *pixpos = &data[line * xc]; + for (uint32_t pos = xoff; pos < xoff + xc; pos++) { //don't paint backgroundcolor (*pixpos = 0x00000000) if (*pixpos) *(fbp + pos) = *pixpos; @@ -1990,8 +2076,6 @@ void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t fbp += swidth; line++; } - - checkFbArea(xoff, yoff, width, height, false); } void CFrameBuffer::displayRGB(unsigned char *rgbbuff, int x_size, int y_size, int x_pan, int y_pan, int x_offs, int y_offs, bool clearfb, int transp) @@ -2087,6 +2171,8 @@ bool CFrameBuffer::_checkFbArea(int _x, int _y, int _dx, int _dy, bool prev) if (v_fbarea.empty()) return true; + static bool firstMutePaint = true; + for (unsigned int i = 0; i < v_fbarea.size(); i++) { int ret = checkFbAreaElement(_x, _y, _dx, _dy, &v_fbarea[i]); if (ret == FB_PAINTAREA_MATCH_OK) { @@ -2096,10 +2182,14 @@ bool CFrameBuffer::_checkFbArea(int _x, int _y, int _dx, int _dy, bool prev) break; // waitForIdle(); fb_no_check = true; - if (prev) + if (prev) { + firstMutePaint = false; CAudioMute::getInstance()->hide(); - else - CAudioMute::getInstance()->paint(); + } + else { + if (!firstMutePaint) + CAudioMute::getInstance()->paint(); + } fb_no_check = false; break; default: diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index ffb9efb16..ca19f3d75 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -48,6 +48,8 @@ typedef struct gradientData_t fb_pixel_t* boxBuf; bool direction; int mode; + int x; + int dx; } gradientData_struct_t; #define CORNER_NONE 0x0 @@ -208,7 +210,7 @@ class CFrameBuffer : public sigc::trackable }; void paintPixel(int x, int y, const fb_pixel_t col); - fb_pixel_t* paintBoxRel2Buf(const int dx, const int dy, const fb_pixel_t col, fb_pixel_t* buf = NULL, int radius = 0, int type = CORNER_ALL); + fb_pixel_t* paintBoxRel2Buf(const int dx, const int dy, const int w_align, const int offs_align, const fb_pixel_t col, fb_pixel_t* buf = NULL, int radius = 0, int type = CORNER_ALL); fb_pixel_t* paintBoxRel(const int x, const int y, const int dx, const int dy, const fb_pixel_t col, gradientData_t *gradientData, int radius = 0, int type = CORNER_ALL); void paintBoxRel(const int x, const int y, const int dx, const int dy, const fb_pixel_t col, int radius = 0, int type = CORNER_ALL); @@ -226,6 +228,7 @@ class CFrameBuffer : public sigc::trackable void setIconBasePath(const std::string & iconPath); std::string getIconBasePath(){return iconBasePath;}; + std::string getIconPath(std::string icon_name, std::string file_type = "png"); void getIconSize(const char * const filename, int* width, int *height); /* h is the height of the target "window", if != 0 the icon gets centered in that window */ diff --git a/src/driver/moviecut.cpp b/src/driver/moviecut.cpp index 269e4e381..a4f8890cf 100644 --- a/src/driver/moviecut.cpp +++ b/src/driver/moviecut.cpp @@ -175,6 +175,9 @@ bool CMovieCut::truncateMovie(MI_MOVIE_INFO * minfo) minfo->length = minfo->bookmarks.end/60; minfo->bookmarks.end = 0; reset_atime(minfo->file.Name.c_str(), minfo->file.Time); + CMovieInfo cmovie; + cmovie.saveMovieInfo(*minfo); + WriteHeader(minfo->file.Name.c_str(), newsize/secsize*1000); return true; } @@ -238,8 +241,9 @@ int CMovieCut::read_psi(const char * spart, unsigned char * buf) return -1; } -void CMovieCut::save_info(CMovieInfo * cmovie, MI_MOVIE_INFO * minfo, char * dpart, off64_t spos, off64_t secsize) +void CMovieCut::save_info(MI_MOVIE_INFO * minfo, char * dpart, off64_t spos, off64_t secsize) { + CMovieInfo cmovie; MI_MOVIE_INFO ninfo = *minfo; ninfo.file.Name = dpart; ninfo.file.Size = spos; @@ -253,7 +257,7 @@ void CMovieCut::save_info(CMovieInfo * cmovie, MI_MOVIE_INFO * minfo, char * dpa ninfo.bookmarks.user[book_nr].length = 0; } } - cmovie->saveMovieInfo(ninfo); + cmovie.saveMovieInfo(ninfo); WriteHeader(ninfo.file.Name.c_str(), spos/secsize*1000); reset_atime(dpart, minfo->file.Time); } @@ -302,7 +306,7 @@ int CMovieCut::getInput() return retval; } -bool CMovieCut::cutMovie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie) +bool CMovieCut::cutMovie(MI_MOVIE_INFO * minfo) { struct mybook books[MI_MOVIE_BOOK_USER_MAX+2]; unsigned char psi[PSI_SIZE]; @@ -482,7 +486,7 @@ bool CMovieCut::cutMovie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie) tt1 = time(0); printf("CMovieCut::%s: total written %" PRId64 " tooks %ld secs end time %s", __func__, spos, tt1-tt, ctime(&tt1)); - save_info(cmovie, minfo, dpart, spos, secsize); + save_info(minfo, dpart, spos, secsize); retval = true; ret_err: if (srcfd >= 0) @@ -498,7 +502,7 @@ ret_err: return retval; } -bool CMovieCut::copyMovie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie, bool onefile) +bool CMovieCut::copyMovie(MI_MOVIE_INFO * minfo, bool onefile) { struct mybook books[MI_MOVIE_BOOK_USER_MAX+2]; struct stat64 s; @@ -619,13 +623,13 @@ bool CMovieCut::copyMovie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie, bool onefi if (!onefile) { close(dstfd); dstfd = -1; - save_info(cmovie, minfo, dpart, spos, secsize); + save_info(minfo, dpart, spos, secsize); time_t tt1 = time(0); printf("copy: ********* %s: total written %" PRId64 " took %ld secs\n", dpart, spos, tt1-tt); } } /* for all books */ if (onefile) { - save_info(cmovie, minfo, dpart, spos, secsize); + save_info(minfo, dpart, spos, secsize); time_t tt1 = time(0); printf("copy: ********* %s: total written %" PRId64 " took %ld secs\n", dpart, spos, tt1-tt); } diff --git a/src/driver/moviecut.h b/src/driver/moviecut.h index c996ebaab..f95aa58f4 100644 --- a/src/driver/moviecut.h +++ b/src/driver/moviecut.h @@ -41,7 +41,7 @@ class CMovieCut int find_gop(unsigned char *buf, int r); off64_t fake_read(int fd, unsigned char *buf, size_t size, off64_t fsize); int read_psi(const char * spart, unsigned char * buf); - void save_info(CMovieInfo * cmovie, MI_MOVIE_INFO * minfo, char * dpart, off64_t spos, off64_t secsize); + void save_info(MI_MOVIE_INFO * minfo, char * dpart, off64_t spos, off64_t secsize); void findNewName(const char * fname, char * dpart,size_t dpart_len); static int compare_book(const void *x, const void *y); int getInput(); @@ -52,8 +52,8 @@ class CMovieCut CMovieCut(); ~CMovieCut(); bool truncateMovie(MI_MOVIE_INFO * minfo); - bool cutMovie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie); - bool copyMovie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie, bool onefile); + bool cutMovie(MI_MOVIE_INFO * minfo); + bool copyMovie(MI_MOVIE_INFO * minfo, bool onefile); //int handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data); }; diff --git a/src/driver/netfile.cpp b/src/driver/netfile.cpp index d27da95a6..458e4dabf 100644 --- a/src/driver/netfile.cpp +++ b/src/driver/netfile.cpp @@ -419,7 +419,7 @@ int request_file(URL *url) send(url->fd, str, strlen(str), 0); if( (meta_int = parse_response(url, &id3, &tmp)) < 0) - return -1; + return meta_int; if(meta_int) { @@ -493,7 +493,7 @@ int request_file(URL *url) send(url->fd, str, strlen(str), 0); if( (meta_int = parse_response(url, &id3, &tmp)) < 0) - return -1; + return meta_int; if(meta_int) { @@ -1708,16 +1708,13 @@ int f_status(FILE *stream, void (*cb)(void*)) /* information into the CSTATE structure */ void ShoutCAST_ParseMetaData(char *md, CSTATE *state) { - #define SKIP(a) for(;(a && !isalnum(*a)); ++a) {}; - char *ptr; - /* abort if we were submitted a NULL pointer */ if((!md) || (!state)) return; dprintf(stderr, "ShoutCAST_ParseMetaData(%p : %s, %p)\n", md, md, state); - ptr = strstr(md, "StreamTitle="); + char *ptr = strstr(md, "StreamTitle="); if(ptr) { @@ -1727,13 +1724,13 @@ void ShoutCAST_ParseMetaData(char *md, CSTATE *state) if(!ptr) ptr = strstr(md, ", "); - + const int bufsize = 4095; /* no separator, simply copy everything into the 'title' field */ if(!ptr) { ptr = strchr(md, '='); - strncpy(state->title, ptr + 2, 4095); - state->title[4095] = '\0'; + strncpy(state->title, ptr + 2, bufsize); + state->title[bufsize] = '\0'; ptr = strchr(state->title, ';'); if(ptr) *(ptr - 1) = 0; @@ -1741,16 +1738,18 @@ void ShoutCAST_ParseMetaData(char *md, CSTATE *state) } else { - SKIP(ptr); - strcpy(state->title, ptr); + //SKIP() + for(int i = 0;(ptr && i < bufsize && !isalnum(*ptr)); ++ptr,i++){}; + + strncpy(state->title, ptr,bufsize); ptr = strchr(state->title, ';'); if(ptr) *(ptr - 1) = 0; ptr = strstr(md, "StreamTitle="); ptr = strchr(ptr, '\''); - strncpy(state->artist, ptr + 1, 4095); - state->artist[4095] = '\0'; + strncpy(state->artist, ptr + 1, bufsize); + state->artist[bufsize] = '\0'; ptr = strstr(state->artist, " - "); if(!ptr) ptr = strstr(state->artist, ", "); @@ -1801,6 +1800,10 @@ void ShoutCAST_MetaFilter(STREAM_FILTER *arg) FILTERDATA *filterdata = (FILTERDATA*)arg->user; int meta_int = filterdata->meta_int; int len = *arg->len; + if(len < 0){ + dprintf(stderr, "[%s] : error ---> len %i < 0\n",__func__, len); + return; + } char*buf = (char*)arg->buf; int meta_start; @@ -1815,6 +1818,12 @@ void ShoutCAST_MetaFilter(STREAM_FILTER *arg) if(filterdata->stored < filterdata->len) { int bsize = (filterdata->len + 1) - filterdata->stored; + printf("filterdata->len %i bsize %i len %i\n",filterdata->len,bsize,len); + /*check overload size*/ + if(bsize > len){ + dprintf(stderr, "[%s] : error ---> bsize %i > len %i\n",__func__,bsize, len); + return; + } /* if there is some meta data, extract it */ /* there can be zero size blocks too */ @@ -1883,7 +1892,12 @@ void ShoutCAST_MetaFilter(STREAM_FILTER *arg) //dprintf(stderr, "filter : metadata : \n\n\n----------\n%s\n----------\n\n\n", filterdata->meta_data); } - + /*check negative size*/ + if(len - b < 0) + { + dprintf(stderr, "[%s] : error ---> len - b %i\n",__func__,len-b); + return; + } /* remove the metadata and it's size indicator from the buffer */ memmove(buf + meta_start, buf + b, len - b ); diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index 4dc538f65..2f4a3722c 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -48,7 +48,7 @@ extern font_sizes_groups_struct font_sizes_groups[]; extern font_sizes_struct neutrino_font[]; extern const char * locale_real_names[]; /* #include */ -const font_sizes_struct signal_font = {LOCALE_FONTSIZE_INFOBAR_SMALL, 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}; +const font_sizes_struct signal_font = {NONEXISTANT_LOCALE, 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}; CNeutrinoFonts::CNeutrinoFonts() { @@ -102,7 +102,9 @@ CNeutrinoFonts::~CNeutrinoFonts() delete v_dyn_fonts[i].font; v_dyn_fonts.clear(); } - + if (!vDynSize.empty()) { + vDynSize.clear(); + } deleteDynFontExtAll(); } @@ -124,6 +126,9 @@ void CNeutrinoFonts::SetupDynamicFonts(bool initRenderClass/*=true*/) dynFontStyle[0] = g_dynFontRenderer->AddFont(fontDescr.filename.c_str()); fontDescr.name = g_dynFontRenderer->getFamily(fontDescr.filename.c_str()); + if (!vDynSize.empty()) { + vDynSize.clear(); + } dprintf(DEBUG_NORMAL, "[CNeutrinoFonts] [%s - %d] dynamic font family: %s\n", __func__, __LINE__, fontDescr.name.c_str()); dynFontStyle[1] = "Bold Regular"; @@ -161,6 +166,9 @@ void CNeutrinoFonts::SetupNeutrinoFonts(bool initRenderClass/*=true*/) old_fontDescr.name = fontDescr.name; fontDescr.name = ""; fontDescr.name = g_fontRenderer->getFamily(fontDescr.filename.c_str()); + if (!vDynSize.empty()) { + vDynSize.clear(); + } dprintf(DEBUG_NORMAL, "[CNeutrinoFonts] [%s - %d] standard font family: %s\n", __func__, __LINE__, fontDescr.name.c_str()); fontStyle[1] = "Bold Regular"; @@ -233,11 +241,22 @@ int CNeutrinoFonts::getFontHeight(Font* fnt) int CNeutrinoFonts::getDynFontSize(int dx, int dy, std::string text, int style) { - Font *dynFont = NULL; - int dynSize = 8; - bool dynFlag = false; - + int dynSize = dy/1.6; if (dx == 0) dx = 1280; + + if (!vDynSize.empty()) { + for (size_t i = 0; i < vDynSize.size(); i++) { + if ((vDynSize[i].dy == dy) && + (vDynSize[i].dx == dx) && + (vDynSize[i].style == style) && + (vDynSize[i].text == text)) { + dynSize = vDynSize[i].dynsize; + return dynSize; + } + } + } + Font *dynFont = NULL; + bool dynFlag = false; while (1) { if (dynFont) delete dynFont; @@ -264,9 +283,23 @@ int CNeutrinoFonts::getDynFontSize(int dx, int dy, std::string text, int style) break; } - if (dynFont) + if (dynFont){ delete dynFont; + if (!vDynSize.empty() && vDynSize.size() > 99) { + vDynSize.clear(); + } + if(dynSize){ + dyn_size_t v; + v.dx = dx; + v.dy = dy; + v.dynsize = dynSize; + v.style = style; + v.text = text; + vDynSize.push_back(v); + } + } + return dynSize; } diff --git a/src/driver/neutrinofonts.h b/src/driver/neutrinofonts.h index 6073f0dba..9be5cff4f 100644 --- a/src/driver/neutrinofonts.h +++ b/src/driver/neutrinofonts.h @@ -44,7 +44,7 @@ typedef struct font_sizes { typedef struct font_sizes_groups { const neutrino_locale_t groupname; - const unsigned int count; + const size_t count; const SNeutrinoSettings::FONT_TYPES *const content; const char * const actionkey; const neutrino_locale_t hint; @@ -55,6 +55,16 @@ class CNeutrinoFonts private: std::string fontStyle[3]; std::string dynFontStyle[3]; + typedef struct dyn_size_t + { + int dx; + int dy; + int dynsize; + int style; + std::string text; + } dyn_size_struct_t; + typedef std::vector v_dyn_size_t; + v_dyn_size_t vDynSize; typedef struct dyn_font_t { diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index 17d07c89b..7c81ef2ed 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -446,6 +446,7 @@ void CPictureViewer::showBusy (int sx, int sy, int width, char r, char g, char b m_busy_buffer = (unsigned char *) malloc (width * width * cpp); if (m_busy_buffer == NULL) { dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] Error: malloc\n", __func__, __LINE__); + cs_free_uncached (fb_buffer); return; } busy_buffer_wrk = m_busy_buffer; @@ -773,10 +774,11 @@ unsigned char * CPictureViewer::int_Resize(unsigned char *orgin, int ox, int oy, r+=q[0]; g+=q[1]; b+=q[2]; a+=q[3]; } } - p[0]= uint8_t(r/sq); - p[1]= uint8_t(g/sq); - p[2]= uint8_t(b/sq); - p[3]= uint8_t(a/sq); + int sq_tmp = sq ? sq : 1;//avoid division by zero + p[0]= uint8_t(r/sq_tmp); + p[1]= uint8_t(g/sq_tmp); + p[2]= uint8_t(b/sq_tmp); + p[3]= uint8_t(a/sq_tmp); } } }else @@ -795,9 +797,10 @@ unsigned char * CPictureViewer::int_Resize(unsigned char *orgin, int ox, int oy, r+=q[0]; g+=q[1]; b+=q[2]; } } - p[0]= uint8_t(r/sq); - p[1]= uint8_t(g/sq); - p[2]= uint8_t(b/sq); + int sq_tmp = sq ? sq : 1;//avoid division by zero + p[0]= uint8_t(r/sq_tmp); + p[1]= uint8_t(g/sq_tmp); + p[2]= uint8_t(b/sq_tmp); } } } diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index de67c0f60..e5ed9aa76 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -328,7 +328,8 @@ int CRCInput::messageLoop( bool anyKeyCancels, int timeout ) ( msg == CRCInput::RC_home ) || ( msg == CRCInput::RC_ok ) ) doLoop = false; - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else { @@ -881,6 +882,16 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 *msg = NeutrinoMessages::EVT_SET_VOLUME; *data = *(char*) p; break; + case NeutrinoMessages::RECORD_START : + *msg = NeutrinoMessages::RECORD_START; + *data = (unsigned long) p; + dont_delete_p = true; + break; + case NeutrinoMessages::RECORD_STOP : + *msg = NeutrinoMessages::RECORD_STOP; + *data = (unsigned long) p; + dont_delete_p = true; + break; default: printf("[neutrino] event INITID_HTTPD - unknown eventID 0x%x\n", emsg.eventID ); } @@ -1181,7 +1192,7 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 case NeutrinoMessages::EVT_NEXTEPG: { CSectionsdClient::CurrentNextInfo *cn = (CSectionsdClient::CurrentNextInfo *) p; - delete cn; + delete [] cn; p = NULL; break; } diff --git a/src/driver/record.cpp b/src/driver/record.cpp index e0e7ba6b3..fc3eb7f07 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -173,11 +173,11 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) } } for (unsigned int i = 0; i < recMovieInfo->audioPids.size(); i++) { - apids[numpids++] = recMovieInfo->audioPids[i].epgAudioPid; + apids[numpids++] = recMovieInfo->audioPids[i].AudioPid; if(channel->getAudioChannel(i)->audioChannelType == CZapitAudioChannel::EAC3){ - psi.addPid(recMovieInfo->audioPids[i].epgAudioPid, EN_TYPE_AUDIO_EAC3, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); + psi.addPid(recMovieInfo->audioPids[i].AudioPid, EN_TYPE_AUDIO_EAC3, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); }else - psi.addPid(recMovieInfo->audioPids[i].epgAudioPid, EN_TYPE_AUDIO, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); + psi.addPid(recMovieInfo->audioPids[i].AudioPid, EN_TYPE_AUDIO, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); if (numpids >= REC_MAX_APIDS) break; @@ -334,10 +334,10 @@ bool CRecordInstance::Update() record->AddPid(it->apid); for(unsigned int i = 0; i < allpids.APIDs.size(); i++) { if(allpids.APIDs[i].pid == it->apid) { - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; - audio_pids.epgAudioPid = allpids.APIDs[i].pid; - audio_pids.epgAudioPidName = allpids.APIDs[i].desc; + audio_pids.AudioPid = allpids.APIDs[i].pid; + audio_pids.AudioPidName = allpids.APIDs[i].desc; audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : allpids.APIDs[i].is_eac3 ? 7 : 0; audio_pids.selected = 0; recMovieInfo->audioPids.push_back(audio_pids); @@ -394,15 +394,20 @@ void CRecordInstance::ProcessAPIDnames() if (allpids.APIDs[count].component_tag != 0xFF) has_unresolved_ctags= true; - if ( strlen( allpids.APIDs[count].desc ) == 3 ) - strncpy( allpids.APIDs[count].desc, getISO639Description( allpids.APIDs[count].desc ),DESC_MAX_LEN -1 ); + std::string tmp_desc = allpids.APIDs[count].desc; + if ( strlen( allpids.APIDs[count].desc ) == 3 ){ + tmp_desc = getISO639Description( allpids.APIDs[count].desc ); + } - if ( allpids.APIDs[count].is_ac3 && !strstr(allpids.APIDs[count].desc, " (AC3)")) - strncat(allpids.APIDs[count].desc, " (AC3)", DESC_MAX_LEN - strlen(allpids.APIDs[count].desc) -1); - else if (allpids.APIDs[count].is_aac && !strstr(allpids.APIDs[count].desc, " (AAC)")) - strncat(allpids.APIDs[count].desc, " (AAC)", DESC_MAX_LEN - strlen(allpids.APIDs[count].desc) -1); - else if (allpids.APIDs[count].is_eac3 && !strstr(allpids.APIDs[count].desc, " (EAC3)")) - strncat(allpids.APIDs[count].desc, " (EAC3)", DESC_MAX_LEN - strlen(allpids.APIDs[count].desc) -1); + if ( allpids.APIDs[count].is_ac3 && tmp_desc.find(" (AC3)")) + tmp_desc += " (AC3)"; + else if (allpids.APIDs[count].is_aac && tmp_desc.find(" (AAC)")) + tmp_desc += " (AAC)"; + else if (allpids.APIDs[count].is_eac3 && tmp_desc.find(" (EAC3)")) + tmp_desc += " (EAC3)"; + if(!tmp_desc.empty()){ + strncpy( allpids.APIDs[count].desc, tmp_desc.c_str(),DESC_MAX_LEN -1) ; + } } if(has_unresolved_ctags && (epgid != 0)) { @@ -412,13 +417,18 @@ void CRecordInstance::ProcessAPIDnames() for(unsigned int j=0; j< allpids.APIDs.size(); j++) { if(allpids.APIDs[j].component_tag == tags[i].componentTag) { if(!tags[i].component.empty()) { - strncpy(allpids.APIDs[j].desc, tags[i].component.c_str(), DESC_MAX_LEN -1); - if (allpids.APIDs[j].is_ac3 && !strstr(allpids.APIDs[j].desc, " (AC3)")) - strncat(allpids.APIDs[j].desc, " (AC3)", DESC_MAX_LEN - strlen(allpids.APIDs[j].desc)-1); - else if (allpids.APIDs[j].is_aac && !strstr(allpids.APIDs[j].desc, " (AAC)")) - strncat(allpids.APIDs[j].desc, " (AAC)", DESC_MAX_LEN - strlen(allpids.APIDs[j].desc)-1); - else if (allpids.APIDs[j].is_eac3 && !strstr(allpids.APIDs[j].desc, " (EAC3)")) - strncat(allpids.APIDs[j].desc, " (EAC3)", DESC_MAX_LEN - strlen(allpids.APIDs[j].desc)-1); + std::string tmp_desc2; + tmp_desc2 = tags[i].component; + if (allpids.APIDs[j].is_ac3 && tmp_desc2.find(" (AC3)")) + tmp_desc2 += " (AC3)"; + else if (allpids.APIDs[j].is_aac && tmp_desc2.find(" (AAC)")) + tmp_desc2 += " (AAC)"; + else if (allpids.APIDs[j].is_eac3 && tmp_desc2.find(" (EAC3)")) + tmp_desc2 += " (EAC3)"; + + if(!tmp_desc2.empty()){ + strncpy(allpids.APIDs[j].desc, tmp_desc2.c_str(), DESC_MAX_LEN -1); + } } allpids.APIDs[j].component_tag = -1; break; @@ -559,9 +569,9 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis std::string tmpstring = channel->getName(); if (tmpstring.empty()) - recMovieInfo->epgChannel = "unknown"; + recMovieInfo->channelName = "unknown"; else - recMovieInfo->epgChannel = tmpstring; + recMovieInfo->channelName = tmpstring; tmpstring = "not available"; if (epgid != 0) { @@ -600,23 +610,23 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis tmpstring = epgTitle; } recMovieInfo->epgTitle = tmpstring; - recMovieInfo->epgId = channel->getChannelID(); + recMovieInfo->channelId = channel->getChannelID(); recMovieInfo->epgInfo1 = info1; recMovieInfo->epgInfo2 = info2; - recMovieInfo->epgEpgId = epgid; - recMovieInfo->epgMode = g_Zapit->getMode(); - recMovieInfo->epgVideoPid = allpids.PIDs.vpid; + recMovieInfo->epgId = epgid; + recMovieInfo->mode = g_Zapit->getMode(); + recMovieInfo->VideoPid = allpids.PIDs.vpid; recMovieInfo->VideoType = channel->type; - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; APIDList::iterator it; for(unsigned int i= 0; i< allpids.APIDs.size(); i++) { for(it = apid_list.begin(); it != apid_list.end(); ++it) { if(allpids.APIDs[i].pid == it->apid) { - audio_pids.epgAudioPid = allpids.APIDs[i].pid; - audio_pids.epgAudioPidName = allpids.APIDs[i].desc; + audio_pids.AudioPid = allpids.APIDs[i].pid; + audio_pids.AudioPidName = allpids.APIDs[i].desc; audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : allpids.APIDs[i].is_eac3 ? 7 : 0; - audio_pids.selected = (audio_pids.epgAudioPid == channel->getAudioPid()) ? 1 : 0; + audio_pids.selected = (audio_pids.AudioPid == channel->getAudioPid()) ? 1 : 0; recMovieInfo->audioPids.push_back(audio_pids); } } @@ -624,13 +634,13 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis /* FIXME sometimes no apid in xml ?? */ if(recMovieInfo->audioPids.empty() && !allpids.APIDs.empty()) { int i = 0; - audio_pids.epgAudioPid = allpids.APIDs[i].pid; - audio_pids.epgAudioPidName = allpids.APIDs[i].desc; + audio_pids.AudioPid = allpids.APIDs[i].pid; + audio_pids.AudioPidName = allpids.APIDs[i].desc; audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : allpids.APIDs[i].is_eac3 ? 7 : 0; audio_pids.selected = 1; recMovieInfo->audioPids.push_back(audio_pids); } - recMovieInfo->epgVTXPID = allpids.PIDs.vtxtpid; + recMovieInfo->VtxtPid = allpids.PIDs.vtxtpid; } record_error_msg_t CRecordInstance::MakeFileName(CZapitChannel * channel) @@ -695,8 +705,6 @@ record_error_msg_t CRecordInstance::MakeFileName(CZapitChannel * channel) MakeExtFileName(channel, ext_file_name); strcpy(&(filename[pos]), UTF8_TO_FILESYSTEM_ENCODING(ext_file_name.c_str())); - pos = strlen(filename); - if(autoshift) strncat(filename, "_temp",FILENAMEBUFFERSIZE - strlen(filename)-1); @@ -1851,6 +1859,7 @@ CStreamRec::CStreamRec(const CTimerd::RecordingInfo * const eventinfo, std::stri ofcx = NULL; stopped = true; interrupt = false; + bsfc = NULL; } CStreamRec::~CStreamRec() @@ -1871,9 +1880,11 @@ void CStreamRec::Close() } avformat_free_context(ofcx); } - + if (bsfc) + av_bitstream_filter_close(bsfc); ifcx = NULL; ofcx = NULL; + bsfc = NULL; } void CStreamRec::GetPids(CZapitChannel * channel) @@ -1881,16 +1892,15 @@ void CStreamRec::GetPids(CZapitChannel * channel) channel = channel; } -void CStreamRec::FillMovieInfo(CZapitChannel * channel, APIDList & apid_list) +void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_list*/) { - CRecordInstance::FillMovieInfo(channel, apid_list); recMovieInfo->VideoType = 0; for (unsigned i = 0; i < ofcx->nb_streams; i++) { AVStream *st = ofcx->streams[i]; AVCodecContext * codec = st->codec; if (codec->codec_type == AVMEDIA_TYPE_AUDIO) { - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0); AVDictionaryEntry *title = av_dict_get(st->metadata, "title", NULL, 0); @@ -1920,16 +1930,16 @@ void CStreamRec::FillMovieInfo(CZapitChannel * channel, APIDList & apid_list) } audio_pids.selected = 0; - audio_pids.epgAudioPidName = desc; - audio_pids.epgAudioPid = st->id; + audio_pids.AudioPidName = desc; + audio_pids.AudioPid = st->id; recMovieInfo->audioPids.push_back(audio_pids); - printf("%s: [AUDIO] 0x%x [%s]\n", __FUNCTION__, audio_pids.epgAudioPid, desc.c_str()); + printf("%s: [AUDIO] 0x%x [%s]\n", __FUNCTION__, audio_pids.AudioPid, desc.c_str()); } else if (codec->codec_type == AVMEDIA_TYPE_VIDEO) { - recMovieInfo->epgVideoPid = st->id; + recMovieInfo->VideoPid = st->id; if (codec->codec_id == AV_CODEC_ID_H264) recMovieInfo->VideoType = 1; - printf("%s: [VIDEO] 0x%x \n", __FUNCTION__, recMovieInfo->epgVideoPid); + printf("%s: [VIDEO] 0x%x\n", __FUNCTION__, recMovieInfo->VideoPid); } } } @@ -2003,13 +2013,14 @@ record_error_msg_t CStreamRec::Record() return ret; } + CRecordInstance::FillMovieInfo(channel, apid_list); if (!Open(channel) || !Start()) { Close(); hintBox.hide(); return RECORD_FAILURE; } - FillMovieInfo(channel, apid_list); + SaveXml(); if(recording_id == 0) { time_t now = time(NULL); @@ -2051,6 +2062,12 @@ bool CStreamRec::Open(CZapitChannel * channel) if (url.empty()) return false; + std::string pretty_name,headers; + if (!CMoviePlayerGui::getInstance(true).getLiveUrl(channel->getChannelID(), channel->getUrl(), channel->getScriptName(), url, pretty_name, recMovieInfo->epgInfo1, recMovieInfo->epgInfo2,headers)) { + printf("%s: getLiveUrl() [%s] failed!\n", __FUNCTION__, url.c_str()); + return false; + } + //av_log_set_level(AV_LOG_VERBOSE); av_register_all(); avcodec_register_all(); @@ -2058,17 +2075,27 @@ bool CStreamRec::Open(CZapitChannel * channel) printf("%s: Open input [%s]....\n", __FUNCTION__, url.c_str()); AVDictionary *options = NULL; + if (!headers.empty())//add cookies + av_dict_set(&options, "headers", headers.c_str(), 0); if (avformat_open_input(&ifcx, url.c_str(), NULL, &options) != 0) { printf("%s: Cannot open input [%s]!\n", __FUNCTION__, url.c_str()); + if (!headers.empty()) + av_dict_free(&options); return false; } + if (!headers.empty()) + av_dict_free(&options); if (avformat_find_stream_info(ifcx, NULL) < 0) { printf("%s: Cannot find stream info [%s]!\n", __FUNCTION__, channel->getUrl().c_str()); return false; } - if (!strstr(ifcx->iformat->name, "applehttp") && !strstr(ifcx->iformat->name, "mpegts")) { + if (!strstr(ifcx->iformat->name, "applehttp") && + !strstr(ifcx->iformat->name, "mpegts") && + !strstr(ifcx->iformat->name, "matroska") && + !strstr(ifcx->iformat->name, "avi") && + !strstr(ifcx->iformat->name, "mp4")) { printf("%s: not supported format [%s]!\n", __FUNCTION__, ifcx->iformat->name); return false; } @@ -2115,6 +2142,9 @@ bool CStreamRec::Open(CZapitChannel * channel) av_log_set_level(AV_LOG_VERBOSE); av_dump_format(ofcx, 0, ofcx->filename, 1); av_log_set_level(AV_LOG_WARNING); + bsfc = av_bitstream_filter_init("h264_mp4toannexb"); + if (!bsfc) + printf("%s: av_bitstream_filter_init h264_mp4toannexb failed!\n", __FUNCTION__); return true; } @@ -2127,7 +2157,10 @@ void CStreamRec::run() time_t tstart = time_monotonic(); time_started = tstart; start_time = time(0); - avformat_write_header(ofcx, NULL); + if (avformat_write_header(ofcx, NULL) < 0) { + printf("%s: avformat_write_header failed\n", __FUNCTION__); + return; + } double total = 0; while (!stopped) { @@ -2136,6 +2169,20 @@ void CStreamRec::run() break; if (pkt.stream_index < 0) continue; + + AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; + if (bsfc && codec->codec_id == CODEC_ID_H264) { + AVPacket newpkt = pkt; + + if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { + av_free_packet(&pkt); + newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); + pkt = newpkt; + } + } + pkt.pts = av_rescale_q(pkt.pts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); + pkt.dts = av_rescale_q(pkt.dts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); + av_write_frame(ofcx, &pkt); av_free_packet(&pkt); diff --git a/src/driver/record.h b/src/driver/record.h index 509cc46e2..23d3d0936 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -247,6 +247,7 @@ class CStreamRec : public CRecordInstance, OpenThreads::Thread private: AVFormatContext *ifcx; AVFormatContext *ofcx; + AVBitStreamFilterContext *bsfc; bool stopped; bool interrupt; time_t time_started; diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 903b05ef8..9edff63c8 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -57,6 +57,8 @@ #include #include #include +#include +#include /* experimental mode: * stream not possible, if record running @@ -112,7 +114,7 @@ bool CStreamInstance::Stop() return (OpenThreads::Thread::join() == 0); } -bool CStreamInstance::Send(ssize_t r) +bool CStreamInstance::Send(ssize_t r, unsigned char * _buf) { //OpenThreads::ScopedLock m_lock(mutex); stream_fds_t cfds; @@ -124,7 +126,7 @@ bool CStreamInstance::Send(ssize_t r) flags = MSG_DONTWAIT; for (stream_fds_t::iterator it = cfds.begin(); it != cfds.end(); ++it) { int i = 10; - unsigned char *b = buf; + unsigned char *b = _buf ? _buf : buf; ssize_t count = r; do { int ret = send(*it, b, count, flags); @@ -161,18 +163,23 @@ void CStreamInstance::RemoveClient(int clientfd) printf("CStreamInstance::RemoveClient: %d (count %d)\n", clientfd, (int)fds.size()); } +bool CStreamInstance::Open() +{ + CZapitChannel * tmpchan = CServiceManager::getInstance()->FindChannel(channel_id); + if (!tmpchan) + return false; + + dmx = new cDemux(tmpchan->getRecordDemux());//FIXME + if(!dmx) + return false; + return dmx->Open(DMX_TP_CHANNEL, NULL, DMX_BUFFER_SIZE); +} + void CStreamInstance::run() { printf("CStreamInstance::run: %" PRIx64 "\n", channel_id); set_threadname("n:streaminstance"); - CZapitChannel * tmpchan = CServiceManager::getInstance()->FindChannel(channel_id); - if (!tmpchan) - return; - - dmx = new cDemux(tmpchan->getRecordDemux());//FIXME - dmx->Open(DMX_TP_CHANNEL, NULL, DMX_BUFFER_SIZE); - /* pids here cannot be empty */ stream_pids_t::iterator it = pids.begin(); printf("CStreamInstance::run: add pid %x\n", *it); @@ -306,7 +313,7 @@ CFrontend * CStreamManager::FindFrontend(CZapitChannel * channel) for (streammap_iterator_t it = streams.begin(); it != streams.end(); ++it) frontends.insert(it->second->frontend); - for (std::set::iterator ft = frontends.begin(); ft != frontends.end(); ft++) + for (std::set::iterator ft = frontends.begin(); ft != frontends.end(); ++ft) CFEManager::getInstance()->lockFrontend(*ft); frontend = CFEManager::getInstance()->allocateFE(channel, true); @@ -340,7 +347,7 @@ CFrontend * CStreamManager::FindFrontend(CZapitChannel * channel) } CFEManager::getInstance()->Lock(); - for (std::set::iterator ft = frontends.begin(); ft != frontends.end(); ft++) + for (std::set::iterator ft = frontends.begin(); ft != frontends.end(); ++ft) CFEManager::getInstance()->unlockFrontend(*ft); if (unlock) @@ -416,7 +423,7 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid, CFro printf("CStreamManager::Parse: channel_id %" PRIx64 " [%s]\n", chid, channel->getName().c_str()); if (IS_WEBTV(chid)) - return false; + return true; frontend = FindFrontend(channel); if (!frontend) { @@ -499,13 +506,18 @@ bool CStreamManager::AddClient(int connfd) if (it != streams.end()) { it->second->AddClient(connfd); } else { - CStreamInstance * stream = new CStreamInstance(connfd, channel_id, pids); - stream->frontend = frontend; + CStreamInstance * stream; + if (IS_WEBTV(channel_id)) { + stream = new CStreamStream(connfd, channel_id, pids); + } else { + stream = new CStreamInstance(connfd, channel_id, pids); + stream->frontend = frontend; + } int sendsize = 10*IN_SIZE; unsigned int m = sizeof(sendsize); setsockopt(connfd, SOL_SOCKET, SO_SNDBUF, (void *)&sendsize, m); - if (stream->Start()) + if (stream->Open() && stream->Start()) streams.insert(streammap_pair_t(channel_id, stream)); else delete stream; @@ -587,7 +599,7 @@ void CStreamManager::run() printf("CStreamManager::run(): POLLHUP, fd %d\n", pfd[i].fd); RemoveClient(pfd[i].fd); if (streams.empty()) { - poll_timeout = -1; + poll_timeout = 2000; g_RCInput->postMsg(NeutrinoMessages::EVT_STREAM_STOP, 0); } } @@ -696,3 +708,214 @@ _error: close (listenfd); return false; } + +CStreamStream::CStreamStream(int clientfd, t_channel_id chid, stream_pids_t &_pids) + : CStreamInstance(clientfd, chid, _pids) +{ + ifcx = NULL; + ofcx = NULL; + bsfc = NULL; + avio_ctx = NULL; + stopped = true; + interrupt = false; +} + +CStreamStream::~CStreamStream() +{ + Stop(); + Close(); +} + +int CStreamStream::write_packet(void *opaque, uint8_t *buffer, int buf_size) +{ + CStreamStream * st = (CStreamStream *) opaque; + st->Send(buf_size, buffer); + return buf_size; +} + +int CStreamStream::Interrupt(void * data) +{ + CStreamStream * sr = (CStreamStream*) data; + if (sr->interrupt) + return 1; + return 0; +} + +void CStreamStream::Close() +{ + if (ifcx) + avformat_close_input(&ifcx); + + if (ofcx) + avformat_free_context(ofcx); + + if (buf) + av_freep(&buf); + + if (avio_ctx) + av_free(avio_ctx); + + if (bsfc) + av_bitstream_filter_close(bsfc); + + ifcx = NULL; + ofcx = NULL; + bsfc = NULL; + avio_ctx = NULL; +} + +bool CStreamStream::Open() +{ + CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); + if (!channel) + return false; + + std::string url = channel->getUrl(); + + if (url.empty()) + return false; + + std::string pretty_name, livestreamInfo1, livestreamInfo2, headers; + if (!CMoviePlayerGui::getInstance(true).getLiveUrl(channel->getChannelID(), channel->getUrl(), channel->getScriptName(), url, pretty_name, livestreamInfo1, livestreamInfo2,headers)) { + printf("%s: getLiveUrl() [%s] failed!\n", __FUNCTION__, url.c_str()); + return false; + } + + //av_log_set_level(AV_LOG_VERBOSE); + av_register_all(); + avcodec_register_all(); + avformat_network_init(); + + printf("%s: Open input [%s]....\n", __FUNCTION__, url.c_str()); + + AVDictionary *options = NULL; + if (!headers.empty()) + av_dict_set(&options, "headers", headers.c_str(), 0); + if (avformat_open_input(&ifcx, url.c_str(), NULL, &options) != 0) { + printf("%s: Cannot open input [%s]!\n", __FUNCTION__, channel->getUrl().c_str()); + if (!headers.empty()) + av_dict_free(&options); + return false; + } + if (!headers.empty()) + av_dict_free(&options); + + if (avformat_find_stream_info(ifcx, NULL) < 0) { + printf("%s: Cannot find stream info [%s]!\n", __FUNCTION__, channel->getUrl().c_str()); + return false; + } + if (!strstr(ifcx->iformat->name, "applehttp") && + !strstr(ifcx->iformat->name, "mpegts") && + !strstr(ifcx->iformat->name, "matroska") && + !strstr(ifcx->iformat->name, "avi") && + !strstr(ifcx->iformat->name, "mp4")) { + printf("%s: not supported format [%s]!\n", __FUNCTION__, ifcx->iformat->name); + return false; + } + + AVIOInterruptCB int_cb = { Interrupt, this }; + ifcx->interrupt_callback = int_cb; + + snprintf(ifcx->filename, sizeof(ifcx->filename), "%s", channel->getUrl().c_str()); + av_dump_format(ifcx, 0, ifcx->filename, 0); + + buf = (unsigned char *) av_malloc(IN_SIZE); + if (buf == NULL) { + perror("CStreamStream::Open: buf"); + return false; + } + avio_ctx = avio_alloc_context(buf, IN_SIZE, 1, this, NULL, &write_packet, NULL); + if (!avio_ctx) { + printf("%s: avio_alloc_context failed\n", __FUNCTION__); + return false; + } + + if (avformat_alloc_output_context2(&ofcx, NULL, "mpegts", NULL) < 0) { + printf("%s: avformat_alloc_output_context2 failed\n", __FUNCTION__); + return false; + } + ofcx->pb = avio_ctx; + + av_dict_copy(&ofcx->metadata, ifcx->metadata, 0); + int stid = 0x200; + for (unsigned i = 0; i < ifcx->nb_streams; i++) { + AVCodecContext * iccx = ifcx->streams[i]->codec; + + AVStream *ost = avformat_new_stream(ofcx, iccx->codec); + avcodec_copy_context(ost->codec, iccx); + av_dict_copy(&ost->metadata, ifcx->streams[i]->metadata, 0); + ost->time_base = iccx->time_base; + ost->id = stid++; + } + av_log_set_level(AV_LOG_VERBOSE); + av_dump_format(ofcx, 0, ofcx->filename, 1); + av_log_set_level(AV_LOG_WARNING); + bsfc = av_bitstream_filter_init("h264_mp4toannexb"); + if (!bsfc) + printf("%s: av_bitstream_filter_init h264_mp4toannexb failed!\n", __FUNCTION__); + + return true; +} + +bool CStreamStream::Start() +{ + if (!stopped) + return false; + + printf("%s: Starting...\n", __FUNCTION__); + stopped = false; + int ret = start(); + return (ret == 0); +} + +bool CStreamStream::Stop() +{ + if (stopped) + return false; + + printf("%s: Stopping...\n", __FUNCTION__); + interrupt = true; + stopped = true; + int ret = join(); + interrupt = false; + return (ret == 0); +} + +void CStreamStream::run() +{ + AVPacket pkt; + + printf("%s: Started.\n", __FUNCTION__); + if (avformat_write_header(ofcx, NULL) < 0) { + printf("%s: avformat_write_header failed\n", __FUNCTION__); + return; + } + + while (!stopped) { + av_init_packet(&pkt); + if (av_read_frame(ifcx, &pkt) < 0) + break; + if (pkt.stream_index < 0) + continue; + + AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; + if (bsfc && codec->codec_id == CODEC_ID_H264 ) { + AVPacket newpkt = pkt; + + if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { + av_free_packet(&pkt); + newpkt.buf = av_buffer_create(newpkt.data, newpkt.size, av_buffer_default_free, NULL, 0); + pkt = newpkt; + } + } + pkt.pts = av_rescale_q(pkt.pts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); + pkt.dts = av_rescale_q(pkt.dts, ifcx->streams[pkt.stream_index]->time_base, ofcx->streams[pkt.stream_index]->time_base); + + av_write_frame(ofcx, &pkt); + av_free_packet(&pkt); + } + + av_read_pause(ifcx); + av_write_trailer(ofcx); + printf("%s: Stopped.\n", __FUNCTION__); +} diff --git a/src/driver/streamts.h b/src/driver/streamts.h index 23f74c33d..da2708e51 100644 --- a/src/driver/streamts.h +++ b/src/driver/streamts.h @@ -31,12 +31,16 @@ #include #include +extern "C" { +#include +} + typedef std::set stream_pids_t; typedef std::set stream_fds_t; class CStreamInstance : public OpenThreads::Thread { - private: + protected: bool running; cDemux * dmx; CFrontend * frontend; @@ -47,15 +51,16 @@ class CStreamInstance : public OpenThreads::Thread stream_pids_t pids; stream_fds_t fds; - bool Send(ssize_t r); - void Close(); - void run(); + virtual bool Send(ssize_t r, unsigned char * _buf = NULL); + virtual void Close(); + virtual void run(); friend class CStreamManager; public: CStreamInstance(int clientfd, t_channel_id chid, stream_pids_t &pids); - ~CStreamInstance(); - bool Start(); - bool Stop(); + virtual ~CStreamInstance(); + virtual bool Open(); + virtual bool Start(); + virtual bool Stop(); void AddClient(int clientfd); void RemoveClient(int clientfd); bool HasFd(int fd); @@ -63,6 +68,31 @@ class CStreamInstance : public OpenThreads::Thread t_channel_id GetChannelId() { return channel_id; } }; +class CStreamStream : public CStreamInstance +{ + private: + AVFormatContext *ifcx; + AVFormatContext *ofcx; + AVBitStreamFilterContext *bsfc; + AVIOContext *avio_ctx; + + bool stopped; + bool interrupt; + void run(); + void Close(); + + public: + CStreamStream(int clientfd, t_channel_id chid, stream_pids_t &pids); + ~CStreamStream(); + + bool Open(); + bool Start(); + bool Stop(); + + static int Interrupt(void * data); + static int write_packet(void *opaque, uint8_t *buf, int buf_size); +}; + typedef std::pair streammap_pair_t; typedef std::map streammap_t; typedef streammap_t::iterator streammap_iterator_t; @@ -102,5 +132,4 @@ class CStreamManager : public OpenThreads::Thread int GetPort() { return port; } bool AddClient(int fd); }; - #endif diff --git a/src/driver/vfd.cpp b/src/driver/vfd.cpp index cee79f32f..f65391939 100644 --- a/src/driver/vfd.cpp +++ b/src/driver/vfd.cpp @@ -406,7 +406,7 @@ void CVFD::showTime(bool force) void CVFD::showRCLock(int duration) { - if (!has_lcd) + if (!has_lcd || !g_settings.lcd_notify_rclock) { sleep(duration); return; diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index a8407e172..c7c6c4a77 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -109,8 +109,8 @@ void CVolume::setVolume(const neutrino_msg_t key) hideVolscale(); showVolscale(); - neutrino_msg_data_t data; - uint64_t timeoutEnd; + neutrino_msg_data_t data = 0; + uint64_t timeoutEnd = 0; int vol = g_settings.current_volume; do { diff --git a/src/eitd/SIevents.cpp b/src/eitd/SIevents.cpp index 932d338ff..e57e96ee9 100644 --- a/src/eitd/SIevents.cpp +++ b/src/eitd/SIevents.cpp @@ -182,6 +182,8 @@ void SIevent::parse(Event &event) { int tsidonid = (transport_stream_id << 16) | original_network_id; time_t start_time = parseDVBtime(event.getStartTimeMjd(), event.getStartTimeBcd()); + extern long int secondsExtendedTextCache; + time_t now = time(NULL); running = event.getRunningStatus(); @@ -226,6 +228,8 @@ void SIevent::parse(Event &event) } case EXTENDED_EVENT_DESCRIPTOR: { + if(now && secondsExtendedTextCache && start_time > now + secondsExtendedTextCache) + continue; const ExtendedEventDescriptor *d = (ExtendedEventDescriptor*) *dit; std::string lang = d->getIso639LanguageCode(); std::transform(lang.begin(), lang.end(), lang.begin(), tolower); diff --git a/src/eitd/edvbstring.cpp b/src/eitd/edvbstring.cpp index 003e067bf..0e29d0456 100644 --- a/src/eitd/edvbstring.cpp +++ b/src/eitd/edvbstring.cpp @@ -2039,7 +2039,7 @@ std::string convertDVBUTF8(const char *data, int len, int table, int tsidonid) //printf("table %d tsidonid %04x twochar %d : %20s\n", table, tsidonid, twochar, data); switch(data[0]) { - case 1 ... 12: + case 1 ... 11: newtable=data[i++]+4; // eDebug("(1..12)text encoded in ISO-8859-%d",table); break; @@ -2060,7 +2060,7 @@ std::string convertDVBUTF8(const char *data, int len, int table, int tsidonid) } case 0x11:// Basic Multilingual Plane of ISO/IEC 10646-1 enc (UTF-16... Unicode) table = 65; - tsidonid = 0; +// tsidonid = 0; ++i; break; case 0x12: @@ -2078,6 +2078,8 @@ std::string convertDVBUTF8(const char *data, int len, int table, int tsidonid) ++i; {} //eDebug("unsup. Big5 subset of ISO/IEC 10646-1 enc."); break; + case 0x15: // UTF-8 encoding of ISO/IEC 10646-1 + return std::string((char*)data+1, len-1); case 0x1F: { #ifdef ENABLE_FREESATEPG @@ -2088,8 +2090,8 @@ std::string convertDVBUTF8(const char *data, int len, int table, int tsidonid) ++i; break; case 0x0: - case 0xD ... 0xF: - case 0x15 ... 0x1E: + case 0xC ... 0xF: + case 0x16 ... 0x1E: {} //eDebug("reserved %d", data[0]); ++i; break; @@ -2139,7 +2141,7 @@ std::string convertDVBUTF8(const char *data, int len, int table, int tsidonid) res[t++]=char(code); else if((table == 5) && (code == 0x8A)) res[t++]= 0x20; - else if ((code == 0x8A)) + else if (code == 0x8A) res[t++]= '\n'; // 0x8a is vertical tab. Just use newline for now. else if((code >= 0x80) && (code <= 0x9F)) continue; diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 6e8c6b4e5..605f7b8a1 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -87,7 +87,7 @@ static bool notify_complete = false; static unsigned int epg_save_frequently; static long secondsToCache; -static long secondsExtendedTextCache; +long int secondsExtendedTextCache = 0; static long oldEventsAre; static int scanning = 1; diff --git a/src/eitd/xmlutil.cpp b/src/eitd/xmlutil.cpp index 5c5835441..eb70b58db 100644 --- a/src/eitd/xmlutil.cpp +++ b/src/eitd/xmlutil.cpp @@ -306,7 +306,10 @@ bool readEventsFromFile(std::string &epgname, int &ev_count) onid = xmlGetNumericAttribute(service, "original_network_id", 16); tsid = xmlGetNumericAttribute(service, "transport_stream_id", 16); sid = xmlGetNumericAttribute(service, "service_id", 16); - + if(!onid || !tsid || !sid){ + service = xmlNextNode(service); + continue; + } event = xmlChildrenNode(service); while (event) { diff --git a/src/global.h b/src/global.h index 94e5a781c..65f55aff7 100644 --- a/src/global.h +++ b/src/global.h @@ -46,12 +46,6 @@ #define NEUTRINO_SCAN_SETTINGS_FILE CONFIGDIR "/scan.conf" #define NEUTRINO_PARENTALLOCKED_FILE DATADIR "/neutrino/.plocked" -#define ICONSDIR_VAR "/var/tuxbox/icons/" -#define LOCALEDIR_VAR "/var/tuxbox/locale" -#define THEMESDIR_VAR "/var/tuxbox/themes" -#define PLUGINDIR_VAR "/var/tuxbox/plugins" -#define PLUGINDIR_MNT "/mnt/plugins" - #define LOGODIR ICONSDIR "/logo" #define LOGODIR_VAR ICONSDIR_VAR "/logo" @@ -98,4 +92,8 @@ NEUTRINO_CPP CRadioText *g_Radiotext; #define ENABLE_GUI_MOUNT #endif +#ifndef TARGET_PREFIX +#define TARGET_PREFIX "" +#endif + #endif /* __neutrino_global_h__ */ diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 87c5c403a..72ce2d978 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -14,7 +14,7 @@ version.h: noinst_HEADERS = version.h .PHONY: version.h -SUBDIRS = bedit components widget +SUBDIRS = bedit components moviebrowser widget if ENABLE_LUA SUBDIRS += lua @@ -32,6 +32,7 @@ AM_CPPFLAGS += \ -I$(top_srcdir)/lib/connection \ -I$(top_srcdir)/lib/xmltree \ -I$(top_srcdir)/lib/libupnpclient \ + -I$(top_srcdir)/lib/jsoncpp/include \ @SIGC_CFLAGS@ \ @CURL_CFLAGS@ \ @FREETYPE_CFLAGS@ \ @@ -41,6 +42,7 @@ AM_CPPFLAGS += \ noinst_LIBRARIES = libtimerlist.a libneutrino_gui.a libneutrino_gui2.a libneutrino_gui_a_SOURCES = \ + adzap.cpp \ audio_select.cpp \ audio_setup.cpp \ audiomute.cpp \ @@ -57,6 +59,7 @@ libneutrino_gui_a_SOURCES = \ eventlist.cpp \ favorites.cpp \ filebrowser.cpp \ + followscreenings.cpp \ imageinfo.cpp \ info_menue.cpp \ infoviewer.cpp \ @@ -65,7 +68,6 @@ libneutrino_gui_a_SOURCES = \ mediaplayer.cpp \ mediaplayer_setup.cpp \ miscsettings_menu.cpp \ - moviebrowser.cpp \ movieinfo.cpp \ movieplayer.cpp \ network_service.cpp \ @@ -96,6 +98,7 @@ libneutrino_gui_a_SOURCES = \ subchannel_select.cpp \ themes.cpp \ timeosd.cpp \ + tmdb.cpp \ update.cpp \ update_menue.cpp \ update_settings.cpp \ diff --git a/src/gui/adzap.cpp b/src/gui/adzap.cpp new file mode 100644 index 000000000..0199bc779 --- /dev/null +++ b/src/gui/adzap.cpp @@ -0,0 +1,371 @@ +/* + adzap.cpp + + (C) 2012-2013 by martii + (C) 2016 Sven Hoefer (svenhoefer) + + 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define ZAPBACK_ALERT_PERIOD 15 // seconds +#define ADZAP_DATA "/tmp/adzap.data" + +static const struct button_label CAdZapMenuFooterButtons[] = { + //{ NEUTRINO_ICON_BUTTON_RED, LOCALE_ADZAP_DISABLE }, + { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_ADZAP_ENABLE }, + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_ADZAP_MONITOR } +}; +#define CAdZapMenuFooterButtonCount (sizeof(CAdZapMenuFooterButtons)/sizeof(button_label)) + +static CAdZapMenu *azm = NULL; + +CAdZapMenu *CAdZapMenu::getInstance() +{ + if (!azm) + azm = new CAdZapMenu(); + return azm; +} + +CAdZapMenu::CAdZapMenu() +{ + frameBuffer = CFrameBuffer::getInstance(); + width = 35; + + sem_init(&sem, 0, 0); + + pthread_t thr; + if (pthread_create(&thr, 0, CAdZapMenu::Run, this)) + fprintf(stderr, "ERROR: pthread_create(CAdZapMenu::CAdZapMenu)\n"); + else + pthread_detach(thr); + channelId = -1; + armed = false; + monitor = false; + alerted = false; +} + +static bool sortByDateTime(const CChannelEvent & a, const CChannelEvent & b) +{ + return a.startTime < b.startTime; +} + +void CAdZapMenu::Init() +{ + CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; + channelId = channelList ? channelList->getActiveChannel_ChannelID() : -1; + if(channelList) + channelName = channelList->getActiveChannelName(); + evtlist.clear(); + CEitManager::getInstance()->getEventsServiceKey(channelId & 0xFFFFFFFFFFFFULL, evtlist); + monitorLifeTime.tv_sec = 0; + if (!evtlist.empty()) + { + sort(evtlist.begin(), evtlist.end(), sortByDateTime); + monitorLifeTime.tv_sec = getMonitorLifeTime(); + Update(); + } + printf("CAdZapMenu::%s: monitorLifeTime.tv_sec: %d\n", __func__, (uint) monitorLifeTime.tv_sec); +} + +time_t CAdZapMenu::getMonitorLifeTime() +{ + if (evtlist.empty()) + return 0; + + CChannelEventList::iterator eli; + clock_gettime(CLOCK_REALTIME, &ts); + for (eli = evtlist.begin(); eli != evtlist.end(); ++eli) + { + if ((u_int) eli->startTime + (u_int) eli->duration > (u_int) ts.tv_sec) + return (uint) eli->startTime + eli->duration; + } + return 0; +} + +void CAdZapMenu::Update() +{ + clock_gettime(CLOCK_REALTIME, &zapBackTime); + zapBackTime.tv_sec += g_settings.adzap_zapBackPeriod - ZAPBACK_ALERT_PERIOD; + sem_post(&sem); +} + +void *CAdZapMenu::Run(void *arg) +{ + CAdZapMenu *me = (CAdZapMenu *) arg; + me->Run(); + pthread_exit(NULL); +} + +void CAdZapMenu::Run() +{ + set_threadname("CAdZapMenu::Run"); + while (true) + { + CChannelList *channelList = NULL; + t_channel_id curChannelId = -1; + + if (monitor) + { + clock_gettime(CLOCK_REALTIME, &ts); + ts.tv_sec += 1; + + sem_timedwait(&sem, &ts); + + if (monitor && (monitorLifeTime.tv_sec > ts.tv_sec)) + { + channelList = CNeutrinoApp::getInstance()->channelList; + curChannelId = channelList ? channelList->getActiveChannel_ChannelID() : -1; + if (!armed && (channelId != curChannelId)) + { + armed = true; + clock_gettime(CLOCK_REALTIME, &zapBackTime); + zapBackTime.tv_sec += g_settings.adzap_zapBackPeriod - ZAPBACK_ALERT_PERIOD; + alerted = false; + } + else if (channelId == curChannelId) + { + armed = false; + alerted = false; + } + } + else + { + monitor = false; + armed = false; + alerted = false; + } + } + else if (armed) + { + if (g_settings.adzap_writeData) + { + clock_gettime(CLOCK_REALTIME, &ts); + ts.tv_sec += 1; + + sem_timedwait(&sem, &ts); + } + else + sem_timedwait(&sem, &zapBackTime); + } + else + sem_wait(&sem); + + if (armed) + { + clock_gettime(CLOCK_REALTIME, &ts); + if (ts.tv_sec >= zapBackTime.tv_sec) + { + if (!channelList) + { + channelList = CNeutrinoApp::getInstance()->channelList; + curChannelId = channelList ? channelList->getActiveChannel_ChannelID() : -1; + } + if (!alerted) + { + if (channelId != curChannelId) + { + char name[1024]; + snprintf(name, sizeof(name)-1, g_Locale->getText(LOCALE_ADZAP_ANNOUNCE), ZAPBACK_ALERT_PERIOD, channelName.c_str()); + ShowHint(LOCALE_ADZAP, name); + } + alerted = true; + zapBackTime.tv_sec += ZAPBACK_ALERT_PERIOD; + } + else + { + alerted = false; + if ((channelId != curChannelId) && channelList) + channelList->zapTo_ChannelID(channelId); + armed = false; + } + } + } + + if (g_settings.adzap_writeData && (monitor || armed)) + WriteData(); + else + RemoveData(); + } +} + +void CAdZapMenu::WriteData() +{ + int zp = g_settings.adzap_zapBackPeriod; + clock_gettime(CLOCK_REALTIME, &ts); + long int zb = armed ? zapBackTime.tv_sec + ZAPBACK_ALERT_PERIOD - ts.tv_sec : 0; + + if (FILE *f = fopen(ADZAP_DATA, "w")) + { + fprintf(f, "%" PRIx64 "\n%s\n%d\n%d:%02d\n%ld\n%ld:%02ld\n", + channelId, + channelName.c_str(), + zp, + zp / 60, zp % 60, + zb, + zb / 60, zb % 60); + fclose(f); + } + else + printf("CAdZapMenu::%s: failed.\n", __func__); +} + +void CAdZapMenu::RemoveData() +{ + if (access(ADZAP_DATA, F_OK) == 0) + unlink(ADZAP_DATA); +} +int CAdZapMenu::exec(CMenuTarget *parent, const std::string & actionKey) +{ + Init(); + + int res = menu_return::RETURN_EXIT_ALL; + bool marked_ok = (actionKey.length() == 1 && g_settings.adzap_zapBackPeriod == (actionKey[0] - '0') * 60); + + if (actionKey == "enable" || marked_ok) + { + if (!monitor) + armed = true; + alerted = false; + Update(); + return res; + } + if (actionKey == "disable") + { + armed = false; + monitor = false; + alerted = false; + Update(); + return res; + } + if (actionKey == "monitor") + { + armed = false; + monitor = true; + alerted = false; + if (!evtlist.empty()) + monitorLifeTime.tv_sec = getMonitorLifeTime(); + printf("CAdZapMenu::%s: monitorLifeTime.tv_sec: %d\n", __func__, (uint) monitorLifeTime.tv_sec); + Update(); + return res; + } + if (actionKey == "adzap") + { + if (armed || monitor) { + armed = false; + monitor = false; + alerted = false; + Update(); + ShowHint(LOCALE_ADZAP, LOCALE_ADZAP_CANCEL, 450, 1); + return res; + } + } + if (actionKey.length() == 1) + { + g_settings.adzap_zapBackPeriod = actionKey[0] - '0'; + for (int shortcut = 1; shortcut < 10; shortcut++) + { + bool selected = (g_settings.adzap_zapBackPeriod == shortcut); + forwarders[shortcut - 1]->setMarked(selected); + forwarders[shortcut - 1]->iconName_Info_right = selected ? NEUTRINO_ICON_CHECKMARK : NULL; + } + nc->setMarked(false); + g_settings.adzap_zapBackPeriod *= 60; + return menu_return::RETURN_REPAINT; + } + + if (parent) + parent->hide(); + + monitor = false; + ShowMenu(); + + return res; +} + +void CAdZapMenu::ShowMenu() +{ + bool show_monitor = monitorLifeTime.tv_sec; + + CMenuWidget *menu = new CMenuWidget(LOCALE_ADZAP, NEUTRINO_ICON_SETTINGS, width); + //menu->addKey(CRCInput::RC_red, this, "disable"); + menu->addKey(CRCInput::RC_green, this, "enable"); + menu->addKey(CRCInput::RC_blue, this, "monitor"); + menu->addIntroItems(); + + CMenuOptionChooser *oc = new CMenuOptionChooser(LOCALE_ADZAP_WRITEDATA, &g_settings.adzap_writeData, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + oc->setHint(NEUTRINO_ICON_HINT_ADZAP, LOCALE_MENU_HINT_ADZAP_WRITEDATA); + menu->addItem(oc); + + menu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_ADZAP_SWITCHBACK)); + + neutrino_locale_t minute = LOCALE_ADZAP_MINUTE; + for (int shortcut = 1; shortcut < 10; shortcut++) { + char actionKey[2]; + actionKey[0] = '0' + shortcut; + actionKey[1] = 0; + bool selected = g_settings.adzap_zapBackPeriod == 60 * shortcut; + forwarders[shortcut - 1] = new CMenuForwarder(minute, true, NULL, this, actionKey, CRCInput::convertDigitToKey(shortcut)); + forwarders[shortcut - 1]->setMarked(selected); + forwarders[shortcut - 1]->iconName_Info_right = selected ? NEUTRINO_ICON_CHECKMARK : NULL; + forwarders[shortcut - 1]->setHint(NEUTRINO_ICON_HINT_ADZAP, ""); + menu->addItem(forwarders[shortcut - 1], selected); + minute = LOCALE_ADZAP_MINUTES; + } + + menu->addItem(GenericMenuSeparator); + + int zapBackPeriod = g_settings.adzap_zapBackPeriod / 60; + nc = new CMenuOptionNumberChooser(minute, &zapBackPeriod, true, 10, 120, this, CRCInput::RC_0); + nc->setMarked(g_settings.adzap_zapBackPeriod / 60 > 9); + nc->setHint(NEUTRINO_ICON_HINT_ADZAP, ""); + menu->addItem(nc); + + menu->setFooter(CAdZapMenuFooterButtons, CAdZapMenuFooterButtonCount - (show_monitor ? 0 : 1)); + menu->exec(NULL, ""); + menu->hide(); + delete menu; + Update(); +} + +bool CAdZapMenu::changeNotify(const neutrino_locale_t, void * data) +{ + int z = (*(int *)data); + g_settings.adzap_zapBackPeriod = z * 60; + for (int shortcut = 1; shortcut < 10; shortcut++) + forwarders[shortcut - 1]->setMarked(false); + nc->setMarked(true); + return false; +} diff --git a/src/gui/adzap.h b/src/gui/adzap.h new file mode 100644 index 000000000..078d18faf --- /dev/null +++ b/src/gui/adzap.h @@ -0,0 +1,66 @@ +/* + adzap.h + + (C) 2012-2013 by martii + (C) 2016 Sven Hoefer (svenhoefer) + + 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef __adzap__ +#define __adzap__ + +#include "widget/menue.h" +#include +#include +#include +#include + +class CAdZapMenu: public CMenuTarget, CChangeObserver +{ + private: + CFrameBuffer * frameBuffer; + int width; + bool armed; + bool alerted; + bool monitor; + struct timespec ts; + struct timespec zapBackTime; + std::string channelName; + CMenuForwarder *forwarders[9]; + CMenuOptionNumberChooser *nc; + CChannelEventList evtlist; + struct timespec monitorLifeTime; + t_channel_id channelId; + sem_t sem; + CAdZapMenu(); + void Init(); + time_t getMonitorLifeTime(); + void ShowMenu(); + void Update(); + void Run(void); + void WriteData(void); + void RemoveData(void); + static void *Run(void *arg); + public: + static CAdZapMenu *getInstance(); + int exec(CMenuTarget * parent, const std::string & actionKey); + bool changeNotify(const neutrino_locale_t, void * data); + bool isActive() { return (armed || monitor); }; +}; +#endif // __adzap__ diff --git a/src/gui/audio_select.cpp b/src/gui/audio_select.cpp index 51935640b..8d2adfba9 100644 --- a/src/gui/audio_select.cpp +++ b/src/gui/audio_select.cpp @@ -198,7 +198,7 @@ int CAudioSelectMenuHandler::doMenu () /* setting volume percent to zapit with channel_id/apid = 0 means current channel and pid */ CVolume::getInstance()->SetCurrentChannel(0); CVolume::getInstance()->SetCurrentPid(0); - int percent[p_count]; + int percent[p_count+1];//+1 avoid zero size for (uint i=0; i < p_count; i++) { percent[i] = CZapit::getInstance()->GetPidVolume(0, g_RemoteControl->current_PIDs.APIDs[i].pid, g_RemoteControl->current_PIDs.APIDs[i].is_ac3); AudioSelector.addItem(new CMenuOptionNumberChooser(g_RemoteControl->current_PIDs.APIDs[i].desc, diff --git a/src/gui/audiomute.cpp b/src/gui/audiomute.cpp index bedbb5094..d1c1885bf 100644 --- a/src/gui/audiomute.cpp +++ b/src/gui/audiomute.cpp @@ -86,7 +86,6 @@ void CAudioMute::AudioMute(int newValue, bool isEvent) */ if (!CInfoClock::getInstance()->isBlocked()){ CInfoClock::getInstance()->ClearDisplay(); - CInfoClock::getInstance()->paint();//avoids delay } frameBuffer->fbNoCheck(true); @@ -100,7 +99,6 @@ void CAudioMute::AudioMute(int newValue, bool isEvent) CInfoClock::getInstance()->ClearDisplay(); this->kill(); clearSavedScreen(); - CInfoClock::getInstance()->paint();//avoids delay }else this->hide(); frameBuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1); diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 3651b30e8..d9e67f3f6 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -255,7 +255,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_width = m_frameBuffer->getScreenWidthRel(); m_height = m_frameBuffer->getScreenHeightRel(); - m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight(); m_buttonHeight = std::max(25, m_sheight); m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); @@ -642,12 +642,10 @@ int CAudioPlayerGui::show() InputSelector.addItem(new CMenuForwarder( LOCALE_AUDIOPLAYER_ADD_IC, true, NULL, InetRadioInputChanger, cnt, CRCInput::convertDigitToKey(count + 1)), old_select == count); - if(g_settings.shoutcast_dev_id != "XXXXXXXXXXXXXXXX"){ - sprintf(cnt, "%d", ++count); - InputSelector.addItem(new CMenuForwarder( - LOCALE_AUDIOPLAYER_ADD_SC, true, NULL, InetRadioInputChanger, + sprintf(cnt, "%d", ++count); + InputSelector.addItem(new CMenuForwarder( + LOCALE_AUDIOPLAYER_ADD_SC, g_settings.shoutcast_enabled, NULL, InetRadioInputChanger, cnt, CRCInput::convertDigitToKey(count + 1)), old_select == count); - } //InputSelector.addItem(GenericMenuSeparator); hide(); @@ -771,7 +769,7 @@ int CAudioPlayerGui::show() int y1=(g_settings.screen_EndY- g_settings.screen_StartY)/2 + g_settings.screen_StartY; int h = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight(); w = std::max(w, g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getRenderWidth(selectedKey)); - m_frameBuffer->paintBoxRel(x1 - 7, y1 - h - 5, w + 14, h + 10, COL_MENUCONTENT_PLUS_6, RADIUS_SMALL); + m_frameBuffer->paintBoxRel(x1 - 7, y1 - h - 5, w + 14, h + 10, COL_FRAME_PLUS_0, RADIUS_SMALL); m_frameBuffer->paintBoxRel(x1 - 4, y1 - h - 3, w + 8, h + 6, COL_MENUCONTENTSELECTED_PLUS_0, RADIUS_SMALL); g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP] ->RenderString(x1,y1,w+1,selectedKey,COL_MENUCONTENTSELECTED_TEXT); @@ -1488,83 +1486,52 @@ void CAudioPlayerGui::paintItem(int pos) return; int ypos = m_y + m_title_height + m_theight + pos*m_fheight; - int c_rad_small; + unsigned int currpos = m_liststart + pos; + + bool i_selected = currpos == m_selected; + bool i_marked = currpos == (unsigned) m_current; + bool i_switch = false; //(currpos < m_playlist.size()) && (pos & 1); + int i_radius = RADIUS_NONE; + fb_pixel_t color; fb_pixel_t bgcolor; - if ((pos + m_liststart) == m_selected) - { - if ((pos + m_liststart) == (unsigned)m_current) - { - color = COL_MENUCONTENTSELECTED_TEXT_PLUS_2; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_2; - } - else - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } + getItemColors(color, bgcolor, i_selected, i_marked, i_switch); + + if (i_selected || i_marked) + i_radius = RADIUS_LARGE; + + if (i_selected) paintItemID3DetailsLine(pos); - c_rad_small = RADIUS_SMALL; - } - else - { - if (((pos + m_liststart) < m_playlist.size()) && (pos & 1)) - { - if ((pos + m_liststart) == (unsigned)m_current) - { - color = COL_MENUCONTENTDARK_TEXT_PLUS_2; - bgcolor = COL_MENUCONTENTDARK_PLUS_2; - } - else - { - color = COL_MENUCONTENTDARK_TEXT; - bgcolor = COL_MENUCONTENTDARK_PLUS_0; - } - } - else - { - if ((pos + m_liststart) == (unsigned)m_current) - { - color = COL_MENUCONTENT_TEXT_PLUS_2; - bgcolor = COL_MENUCONTENT_PLUS_2; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } - } - c_rad_small = 0; - } - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, COL_MENUCONTENT_PLUS_0); - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor, c_rad_small); + if (i_radius) + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, COL_MENUCONTENT_PLUS_0); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor, i_radius); - if ((pos + m_liststart) < m_playlist.size()) + if (currpos < m_playlist.size()) { char sNr[20]; - sprintf(sNr, "%2d : ", pos + m_liststart + 1); + sprintf(sNr, "%2d : ", currpos + 1); std::string tmp = sNr; - getFileInfoToDisplay(tmp, m_playlist[pos + m_liststart]); + getFileInfoToDisplay(tmp, m_playlist[currpos]); char dura[9]; if (m_inetmode) - snprintf(dura, 8, "%ldk", m_playlist[pos + m_liststart].MetaData.total_time); + snprintf(dura, 8, "%ldk", m_playlist[currpos].MetaData.total_time); else - snprintf(dura, 8, "%ld:%02ld", m_playlist[pos + m_liststart].MetaData.total_time / 60, - m_playlist[pos + m_liststart].MetaData.total_time % 60); + snprintf(dura, 8, "%ld:%02ld", m_playlist[currpos].MetaData.total_time / 60, + m_playlist[currpos].MetaData.total_time % 60); int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(dura) + 5; g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + 10, ypos + m_fheight, m_width - 30 - w, tmp, color, m_fheight); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + m_width - 15 - w, ypos + m_fheight, w, dura, color, m_fheight); - if ((pos + m_liststart) == m_selected) + if (currpos == m_selected) { if (m_state == CAudioPlayerGui::STOP) - CVFD::getInstance()->showAudioTrack(m_playlist[pos + m_liststart].MetaData.artist, - m_playlist[pos + m_liststart].MetaData.title, - m_playlist[pos + m_liststart].MetaData.album); + CVFD::getInstance()->showAudioTrack(m_playlist[currpos].MetaData.artist, + m_playlist[currpos].MetaData.title, + m_playlist[currpos].MetaData.album); } } } @@ -1653,8 +1620,8 @@ void CAudioPlayerGui::paintFoot() else top = m_y + (m_height - 2 * m_buttonHeight); - m_frameBuffer->paintBoxRel(m_x, top, m_width, 2 * m_buttonHeight, COL_INFOBAR_SHADOW_PLUS_1, c_rad_mid, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); - // why? m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_INFOBAR_SHADOW_PLUS_1); + m_frameBuffer->paintBoxRel(m_x, top, m_width, 2 * m_buttonHeight, COL_MENUFOOT_PLUS_0, c_rad_mid, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); + // why? m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_MENUFOOT_PLUS_0); int bwidth = m_width - (2*c_rad_mid); if (!m_playlist.empty()) @@ -1733,7 +1700,7 @@ void CAudioPlayerGui::paintInfo() title_height -= m_fheight; m_frameBuffer->paintBoxRel(m_x + 1, m_y + 1 , m_width - 2, title_height - 12, COL_MENUCONTENTSELECTED_PLUS_0, c_rad_mid); - m_frameBuffer->paintBoxFrame(m_x, m_y, m_width, title_height - 10, 2, COL_MENUCONTENT_PLUS_6, c_rad_mid); + m_frameBuffer->paintBoxFrame(m_x, m_y, m_width, title_height - 10, 2, COL_FRAME_PLUS_0, c_rad_mid); paintCover(); @@ -1794,21 +1761,24 @@ void CAudioPlayerGui::paint() { if (m_show_playlist) { - m_liststart = (m_selected / m_listmaxshow) * m_listmaxshow; + unsigned int tmp_max = m_listmaxshow; + if(!tmp_max) + tmp_max = 1; + m_liststart = (m_selected / tmp_max) * m_listmaxshow; paintHead(); for (unsigned int count=0; countpaintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_MENUCONTENT_PLUS_1); + m_frameBuffer->paintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); - int sbc = ((m_playlist.size() - 1) / m_listmaxshow) + 1; - int sbs = (m_selected / m_listmaxshow); + int sbc = ((m_playlist.size() - 1) / tmp_max) + 1; + int sbs = (m_selected / tmp_max); if (sbc < 1) sbc = 1; - m_frameBuffer->paintBoxRel(m_x + m_width - 13, ypos + 2 + sbs*(sb-4)/sbc , 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3, RADIUS_SMALL); + m_frameBuffer->paintBoxRel(m_x + m_width - 13, ypos + 2 + sbs*(sb-4)/sbc , 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_SMALL); } paintInfo(); @@ -1824,22 +1794,24 @@ void CAudioPlayerGui::clearItemID3DetailsLine () void CAudioPlayerGui::paintItemID3DetailsLine (int pos) { int xpos = m_x - ConnectLineBox_Width; - int ypos1 = m_y + m_title_height + m_theight+ 0 + pos*m_fheight + INFO_BOX_Y_OFFSET; - int ypos2 = m_y + (m_height - m_info_height) + INFO_BOX_Y_OFFSET; - int ypos1a = ypos1 + (m_fheight / 2) - 2; - int ypos2a = ypos2 + (m_info_height / 2) - 2; + int ypos1 = m_y + m_title_height + m_theight + pos*m_fheight; + int ypos2 = m_y + (m_height - m_info_height) + OFFSET_INTER; + int ypos1a = ypos1 + (m_fheight / 2); + int ypos2a = ypos2 + (m_info_height / 2); // clear details line if (dline != NULL) + { dline->kill(); + dline = NULL; + } // paint Line if detail info (and not valid list pos) and info box if (!m_playlist.empty() && (pos >= 0)) { //details line if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, m_fheight/2+1, m_fheight); - dline->setYPos(ypos1a); + dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, m_fheight/2, m_info_height-RADIUS_LARGE*2); dline->paint(false); // paint id3 infobox @@ -1847,8 +1819,8 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) ibox = new CComponentsInfoBox(m_x, ypos2, m_width, m_info_height); ibox->setFrameThickness(2); ibox->setCorner(RADIUS_LARGE); - ibox->setYPos(ypos2); ibox->setColorBody(COL_MENUCONTENTDARK_PLUS_0); + ibox->setTextColor(COL_MENUCONTENTDARK_TEXT); ibox->forceTextPaint(false); } @@ -2274,7 +2246,7 @@ bool CAudioPlayerGui::getNumericInput(neutrino_msg_t& msg, int& val) { sprintf(str, "%d", val); int w = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getRenderWidth(str); int h = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight(); - m_frameBuffer->paintBoxRel(x1 - 7, y1 - h - 5, w + 14, h + 10, COL_MENUCONTENT_PLUS_6); + m_frameBuffer->paintBoxRel(x1 - 7, y1 - h - 5, w + 14, h + 10, COL_FRAME_PLUS_0); m_frameBuffer->paintBoxRel(x1 - 4, y1 - h - 3, w + 8, h + 6, COL_MENUCONTENTSELECTED_PLUS_0); g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->RenderString(x1, y1, w + 1, str, COL_MENUCONTENTSELECTED_TEXT); while (true) diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index 6d8db5bbc..297f5605a 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -76,12 +76,11 @@ class RandomNumber public: RandomNumber() { - srand(time(0)); + std::srand(time(0)); } - int operator()(int n) - { - return (n * rand() / RAND_MAX); + int operator()(int n){ + return std::rand() / (1.0 + RAND_MAX) * n; } }; diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 3f829e2b8..4138c987d 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -66,27 +66,37 @@ CBEBouquetWidget::CBEBouquetWidget() void CBEBouquetWidget::paintItem(int pos) { - fb_pixel_t color; - fb_pixel_t bgcolor; int ypos = y+ theight+0 + pos*iheight; unsigned int current = liststart + pos; - if (current == selected) { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, RADIUS_LARGE); - } else { + bool i_selected = current == selected; + int i_radius = RADIUS_NONE; + + fb_pixel_t color; + fb_pixel_t bgcolor; + + getItemColors(color, bgcolor, i_selected); + + if (i_selected) + { + i_radius = RADIUS_LARGE; + } + else + { bool has_channels = true; if(current < Bouquets->size()) has_channels = (!(*Bouquets)[current]->tvChannels.empty() ) || (!(*Bouquets)[current]->radioChannels.empty()); - color = has_channels ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT; - bgcolor = has_channels ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor); + + if (!has_channels) + color = COL_MENUCONTENTINACTIVE_TEXT; } - if(current < Bouquets->size()) { - if ((current == selected) && (state == beMoving)) + if (i_radius) + frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, i_radius); + + if (current < Bouquets->size()) { + if ((i_selected) && (state == beMoving)) frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + 5, ypos, iheight); if ((*Bouquets)[current]->bHidden) @@ -117,7 +127,7 @@ void CBEBouquetWidget::paint() int ypos = y+ theight; int sb = iheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); int sbc= ((Bouquets->size()- 1)/ listmaxshow)+ 1; int sbs= (selected/listmaxshow); @@ -125,7 +135,7 @@ void CBEBouquetWidget::paint() sbc = 1; //scrollbar - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); + frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); } void CBEBouquetWidget::paintHead() @@ -366,12 +376,13 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* cancelMoveBouquet(); } } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) + { + // do nothing } else { CNeutrinoApp::getInstance()->handleMsg( msg, data ); - // kein canceling... } } hide(); diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 8a9ef7157..661d887c9 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -94,35 +94,40 @@ CBEChannelWidget::~CBEChannelWidget() void CBEChannelWidget::paintItem(int pos) { - fb_pixel_t color; - fb_pixel_t bgcolor; int ypos = y+ theight+0 + pos*iheight; unsigned int current = liststart + pos; - if(current == selected) { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; + bool i_selected = current == selected; + int i_radius = RADIUS_NONE; - if(current < Channels->size()) { - initItem2DetailsLine (pos, current); + fb_pixel_t color; + fb_pixel_t bgcolor; + + getItemColors(color, bgcolor, i_selected); + + if (i_selected) + { + if (current < Channels->size()) + { + initItem2DetailsLine(pos, current); paintDetails(current); } - - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, RADIUS_LARGE); - } else { - if(current < Channels->size() && ((*Channels)[current]->flags & CZapitChannel::NOT_PRESENT )) - color = COL_MENUCONTENTINACTIVE_TEXT;// extra color for channels not found in service - else - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor); + i_radius = RADIUS_LARGE; } + else + { + if (current < Channels->size() && ((*Channels)[current]->flags & CZapitChannel::NOT_PRESENT)) + color = COL_MENUCONTENTINACTIVE_TEXT; + } + + if (i_radius) + frameBuffer->paintBoxRel(x, ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width- 15, iheight, bgcolor, i_radius); if ((current == selected) && (state == beMoving)) { frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + 5, ypos, iheight); } - if(current < Channels->size()) { + if (current < Channels->size()) { if ((*Channels)[current]->bLocked) { frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + 22, ypos, iheight); } @@ -133,7 +138,6 @@ void CBEChannelWidget::paintItem(int pos) frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x+width- 15 - 28, ypos, fheight); else if (!(*Channels)[current]->getUrl().empty()) frameBuffer->paintIcon(NEUTRINO_ICON_STREAMING, x+width- 15 - 28, ypos, fheight); - } } @@ -157,7 +161,7 @@ void CBEChannelWidget::paint() int ypos = y+ theight; int sb = iheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); int sbc= ((Channels->size()- 1)/ listmaxshow)+ 1; int sbs= (selected/listmaxshow); @@ -167,7 +171,7 @@ void CBEChannelWidget::paint() if (sbh == 0) return; - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * sbh, 11, sbh, COL_MENUCONTENT_PLUS_3); + frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * sbh, 11, sbh, COL_SCROLLBAR_ACTIVE_PLUS_0); } void CBEChannelWidget::paintHead() @@ -221,6 +225,7 @@ void CBEChannelWidget::paintDetails(int index) //info box ibox->setText(str, CTextBox::AUTO_WIDTH | CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]); ibox->setColorBody(COL_MENUCONTENTDARK_PLUS_0); + ibox->setTextColor(COL_MENUCONTENTDARK_TEXT); ibox->paint(CC_SAVE_SCREEN_NO); } @@ -228,9 +233,9 @@ void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/) { int xpos = x - ConnectLineBox_Width; int ypos1 = y + theight+0 + pos*iheight; - int ypos2 = y + height + INFO_BOX_Y_OFFSET; - int ypos1a = ypos1 + (fheight/2)-2; - int ypos2a = ypos2 + (info_height/2)-2; + int ypos2 = y + height + OFFSET_INTER; + int ypos1a = ypos1 + (fheight/2); + int ypos2a = ypos2 + (info_height/2); if (dline) dline->kill(); //kill details line @@ -239,7 +244,7 @@ void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/) if (pos >= 0) { if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2+1, info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2, info_height-RADIUS_LARGE*2); dline->setYPos(ypos1a); //infobox @@ -447,7 +452,9 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* cancelMoveChannel(); } } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) + { + // do nothing } else { diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 2888bab7a..79896b0b1 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -106,33 +106,32 @@ bool CBEChannelSelectWidget::hasChanged() void CBEChannelSelectWidget::paintItem(uint32_t itemNr, int paintNr, bool pselected) { int ypos = y+ theight + paintNr*iheight; + int i_radius = RADIUS_NONE; fb_pixel_t color; fb_pixel_t bgcolor; + + getItemColors(color, bgcolor, pselected); + if (pselected) { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - - if(itemNr < getItemCount()) { + if (itemNr < getItemCount()) + { initItem2DetailsLine (paintNr, itemNr); paintDetails(itemNr); } - - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, RADIUS_LARGE); + i_radius = RADIUS_LARGE; } else { if (itemNr < getItemCount() && (Channels[itemNr]->flags & CZapitChannel::NOT_PRESENT)) color = COL_MENUCONTENTINACTIVE_TEXT; - else - color = COL_MENUCONTENT_TEXT; - - bgcolor = COL_MENUCONTENT_PLUS_0; - frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor); } + if (i_radius) + frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, i_radius); + if(itemNr < getItemCount()) { if( isChannelInBouquet(itemNr)) @@ -283,6 +282,7 @@ void CBEChannelSelectWidget::paintDetails(int index) //info box ibox->setText(str, CTextBox::AUTO_WIDTH | CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]); ibox->setColorBody(COL_MENUCONTENTDARK_PLUS_0); + ibox->setTextColor(COL_MENUCONTENTDARK_TEXT); ibox->paint(false); } @@ -290,9 +290,9 @@ void CBEChannelSelectWidget::initItem2DetailsLine (int pos, int /*ch_index*/) { int xpos = x - ConnectLineBox_Width; int ypos1 = y + theight+0 + pos*iheight; - int ypos2 = y + height + INFO_BOX_Y_OFFSET; - int ypos1a = ypos1 + (fheight/2)-2; - int ypos2a = ypos2 + (info_height/2)-2; + int ypos2 = y + height + OFFSET_INTER; + int ypos1a = ypos1 + (fheight/2); + int ypos2a = ypos2 + (info_height/2); if (dline) dline->kill(); //kill details line @@ -301,7 +301,7 @@ void CBEChannelSelectWidget::initItem2DetailsLine (int pos, int /*ch_index*/) if (pos >= 0) { if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2+1, info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2, info_height-RADIUS_LARGE*2); dline->setYPos(ypos1a); //infobox diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index a33e4ce0a..b8c395f70 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -226,7 +226,7 @@ const CBookmark * CBookmarkManager::getBookmark(CMenuTarget* parent) selected = 0; // Max width = 90; - footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+8; //initial height value for buttonbar + footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8; //initial height value for buttonbar theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); x=getScreenStartX( width ); @@ -364,25 +364,16 @@ void CBookmarkManager::paintItem(int pos) { int ypos = y+ theight+0 + pos*fheight*2; + unsigned int currpos = liststart + pos; + + bool i_selected = currpos == selected; + bool i_marked = false; + bool i_switch = false; //(currpos < bookmarks.size()) && (pos & 1); + fb_pixel_t color; fb_pixel_t bgcolor; - if (pos & 1) - { - color = COL_MENUCONTENTDARK_TEXT; - bgcolor = COL_MENUCONTENTDARK_PLUS_0; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } - - if (liststart + pos == selected) - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } + getItemColors(color, bgcolor, i_selected, i_marked, i_switch); int real_width=width; if (bookmarks.size()>listmaxshow) @@ -391,14 +382,14 @@ void CBookmarkManager::paintItem(int pos) } frameBuffer->paintBoxRel(x,ypos, real_width, 2*fheight, bgcolor); - if (liststart+posRenderString(x+10,ypos+fheight, real_width-10, theBookmark.getName(), color, fheight); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+2*fheight, real_width-10, theBookmark.getUrl(), color, fheight); // LCD Display - if (liststart+pos==selected) + if (i_selected) { CVFD::getInstance()->showMenuText(0, theBookmark.getName(), -1, true); // UTF-8 CVFD::getInstance()->showMenuText(1, theBookmark.getUrl(), -1, true); // UTF-8 @@ -434,19 +425,19 @@ const struct button_label BookmarkmanagerButtons[2] = void CBookmarkManager::paintFoot() { int ButtonWidth = (width - 20) / 4; - frameBuffer->paintBoxRel(x,y+height, width, footerHeight, COL_INFOBAR_SHADOW_PLUS_1); - frameBuffer->paintHLine(x, x+width, y, COL_INFOBAR_SHADOW_PLUS_0); + frameBuffer->paintBoxRel(x,y+height, width, footerHeight, COL_MENUFOOT_PLUS_0); + frameBuffer->paintHLine(x, x+width, y, COL_MENUFOOT_PLUS_0); if (bookmarks.empty()) { frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 1* ButtonWidth + 10, y+height); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR_TEXT); } else { ::paintButtons(x + 10, y + height + 4, width, 2, BookmarkmanagerButtons, footerHeight, ButtonWidth); frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 1* ButtonWidth + 10, y+height); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR_TEXT); } } @@ -468,13 +459,15 @@ void CBookmarkManager::paint() { int ypos = y+ theight; int sb = 2*fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - - int sbc= ((bookmarks.size()- 1)/ listmaxshow)+ 1; + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + unsigned int tmp_max = listmaxshow; + if(!tmp_max) + tmp_max = 1; + int sbc= ((bookmarks.size()- 1)/ tmp_max)+ 1; if (sbc < 1) sbc = 1; - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ page_nr * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); + frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ page_nr * (sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); } paintFoot(); diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 567438610..ca30b9797 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -413,7 +413,7 @@ int CBouquetList::show(bool bShowChannelList) favonly = !bShowChannelList; for(unsigned int count = 0; count < sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]);count++){ - int w_text = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(CBouquetListButtons[count].locale)); + int w_text = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(CBouquetListButtons[count].locale)); w_max_text = std::max(w_max_text, w_text); frameBuffer->getIconSize(CBouquetListButtons[count].button, &icol_w, &icol_h); w_max_icon = std::max(w_max_icon, icol_w); @@ -427,7 +427,7 @@ int CBouquetList::show(bool bShowChannelList) width = w_max (need_width, 20); height = h_max (16 * fheight, 40); - footerHeight = std::max(h_max_icon+8, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+8); + footerHeight = std::max(h_max_icon+8, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8); theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); listmaxshow = (height - theight - footerHeight)/fheight; height = theight + footerHeight + listmaxshow * fheight; // recalc height @@ -501,6 +501,12 @@ int CBouquetList::show(bool bShowChannelList) hide(); return CHANLIST_CHANGE_MODE; } + } else if(msg == CRCInput::RC_www) { + if(!favonly && bShowChannelList && CNeutrinoApp::getInstance()->GetChannelMode() != LIST_MODE_WEBTV) { + CNeutrinoApp::getInstance()->SetChannelMode(LIST_MODE_WEBTV); + hide(); + return CHANLIST_CHANGE_MODE; + } } else if ( msg == CRCInput::RC_setup) { if (!favonly && !Bouquets.empty()) { @@ -612,27 +618,44 @@ void CBouquetList::hide() void CBouquetList::paintItem(int pos) { int ypos = y+ theight+0 + pos*fheight; - fb_pixel_t color; - fb_pixel_t bgcolor; bool iscurrent = true; int npos = liststart + pos; const char * lname = NULL; - if(npos < (int) Bouquets.size()) + bool i_selected = npos == (int) selected; + int i_radius = RADIUS_NONE; + + fb_pixel_t color; + fb_pixel_t bgcolor; + + getItemColors(color, bgcolor, i_selected); + + if (i_selected) + i_radius = RADIUS_LARGE; + + if (i_radius) + frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor); + frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor, i_radius); + + if (npos < (int) Bouquets.size()) lname = (Bouquets[npos]->zapitBouquet && Bouquets[npos]->zapitBouquet->bFav) ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : Bouquets[npos]->channelList->getName(); - if (npos == (int) selected) { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor, RADIUS_LARGE); + if (i_selected) + { if(npos < (int) Bouquets.size()) CVFD::getInstance()->showMenuText(0, lname, -1, true); - } else { + } + else + { if(!favonly && (npos < (int) Bouquets.size())) iscurrent = !Bouquets[npos]->channelList->isEmpty(); - color = iscurrent ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT; - bgcolor = iscurrent ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; - frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor); + + if (!iscurrent) + { + //inactive colors? Is this correct? + color = COL_MENUCONTENTINACTIVE_TEXT; + //bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; + } } if(npos < (int) Bouquets.size()) { @@ -698,7 +721,7 @@ void CBouquetList::paint() ::paintButtons(x, y + (height - footerHeight), width, numbuttons, CBouquetListButtons, width, footerHeight); #endif if (favonly) - frameBuffer->paintBoxRel(x, y + (height - footerHeight), width, footerHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); //round + frameBuffer->paintBoxRel(x, y + (height - footerHeight), width, footerHeight, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); //round else ::paintButtons(x, y + (height - footerHeight), width, numbuttons, CBouquetListButtons, width, footerHeight); @@ -711,10 +734,10 @@ void CBouquetList::paint() int ypos = y+ theight; int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + int listmaxshow_tmp = listmaxshow ? listmaxshow : 1;//avoid division by zero + int sbc= ((bsize - 1)/ listmaxshow_tmp)+ 1; /* bsize is > 0, so sbc is also > 0 */ + int sbs= (selected/listmaxshow_tmp); - int sbc= ((bsize - 1)/ listmaxshow)+ 1; /* bsize is > 0, so sbc is also > 0 */ - int sbs= (selected/listmaxshow); - - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); + frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); } diff --git a/src/gui/bouquetlist.h b/src/gui/bouquetlist.h index 1ba8a199e..0682242c2 100644 --- a/src/gui/bouquetlist.h +++ b/src/gui/bouquetlist.h @@ -37,7 +37,6 @@ #include #include -#include #include #include @@ -88,7 +87,6 @@ class CBouquetList : public CListHelpers unsigned int liststart; unsigned int listmaxshow; unsigned int numwidth; - unsigned int maxpos; int fheight; // Fonthoehe Bouquetlist-Inhalt int theight; // Fonthoehe Bouquetlist-Titel int footerHeight; diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index a13420251..392f526f8 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -84,7 +84,7 @@ int CBuildInfo::exec(CMenuTarget* parent, const string & /*actionKey*/) res = menu_return::RETURN_EXIT_ALL; break; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; break; @@ -147,7 +147,7 @@ bool CBuildInfo::HasData() #if 0 CConfigFile data ('\t'); - data.loadConfig("/.version"); + data.loadConfig(TARGET_PREFIX "/.version"); build_info_t creator = {BI_TYPE_ID_CREATOR, LOCALE_BUILDINFO_CREATOR, data.getString("creator", "n/a")}; v_info.push_back(creator); #endif @@ -176,7 +176,7 @@ void CBuildInfo::InitInfoItems() //init info texts for(size_t i=0; igetText(v_info[i].caption), v_info[i].info_text, ccw_body); + CComponentsExtTextForm *info = new CComponentsExtTextForm(10, CC_APPEND, w_info, h_info, g_Locale->getText(v_info[i].caption), v_info[i].info_text, NULL, ccw_body); info->setLabelAndTextFont(font); info->setTextModes(CTextBox::TOP , CTextBox::AUTO_HIGH | CTextBox::TOP | CTextBox::AUTO_LINEBREAK_NO_BREAKCHARS); info->doPaintBg(false); diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index 8b3762fc0..389d8a6fb 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -104,7 +104,7 @@ int CCAMMenuHandler::doMainMenu() char name1[255]={0}; char str1[255]={0}; - int CiSlots = ca->GetNumberCISlots(); + int CiSlots = ca ? ca->GetNumberCISlots() : 0; CMenuWidget* cammenu = new CMenuWidget(LOCALE_CI_SETTINGS, NEUTRINO_ICON_SETTINGS); cammenu->addIntroItems(); @@ -171,7 +171,7 @@ int CCAMMenuHandler::doMainMenu() } i = 0; - int ScNum = ca->GetNumberSmartCardSlots(); + int ScNum = ca ? ca->GetNumberSmartCardSlots() : 0; printf("CCAMMenuHandler::doMainMenu sc slots: %d\n", ScNum); if(ScNum && CiSlots) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index e9aec4496..985a5eced 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -49,6 +49,7 @@ #include #include +#include #include #include #include @@ -63,7 +64,7 @@ #include #include #include -#include +#include #include #include @@ -108,7 +109,7 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl vlist = _vlist; new_zap_mode = 0; selected_chid = 0; - footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; //initial height value for buttonbar + footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+6; //initial height value for buttonbar theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getHeight(); fdescrheight = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getHeight(); @@ -126,6 +127,8 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl move_state = beDefault; edit_state = false; channelsChanged = false; + + paint_events_index = -2; } CChannelList::~CChannelList() @@ -157,6 +160,8 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to) return; size_t chanlist_size = to - from; + if (chanlist_size <= 0) // WTF??? + return; CChannelEventList events; if (displayNext) { @@ -184,16 +189,18 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to) for (uint32_t count = 0; count < chanlist_size; count++) p_requested_channels[count] = (*chanlist)[count + from]->getEpgID(); - CEitManager::getInstance()->getChannelEvents(events, p_requested_channels, chanlist_size); + CChannelEventList levents; + CEitManager::getInstance()->getChannelEvents(levents, p_requested_channels, chanlist_size); for (uint32_t count=0; count < chanlist_size; count++) { (*chanlist)[count + from]->currentEvent = CChannelEvent(); - for (CChannelEventList::iterator e = events.begin(); e != events.end(); ++e) { + for (CChannelEventList::iterator e = levents.begin(); e != levents.end(); ++e) { if (((*chanlist)[count + from]->getEpgID()&0xFFFFFFFFFFFFULL) == e->get_channel_id()) { (*chanlist)[count + from]->currentEvent = *e; break; } } } + levents.clear(); delete[] p_requested_channels; } } @@ -311,6 +318,7 @@ int CChannelList::doChannelMenu(void) bool empty = (*chanlist).empty(); bool allow_edit = (bouquet && bouquet->zapitBouquet && !bouquet->zapitBouquet->bOther && !bouquet->zapitBouquet->bWebtv); + bool got_history = (CNeutrinoApp::getInstance()->channelList->getLastChannels().size() > 1); int i = 0; snprintf(cnt, sizeof(cnt), "%d", i); @@ -328,6 +336,10 @@ int CChannelList::doChannelMenu(void) snprintf(cnt, sizeof(cnt), "%d", i); menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_RESET_ALL, reset_all, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++); + menu->addItem(GenericMenuSeparator); + snprintf(cnt, sizeof(cnt), "%d", i); + menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_HISTORY_CLEAR, got_history, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++); + menu->addItem(new CMenuSeparator(CMenuSeparator::LINE)); snprintf(cnt, sizeof(cnt), "%d", i); menu->addItem(new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++); @@ -411,7 +423,14 @@ int CChannelList::doChannelMenu(void) if(g_settings.make_new_list) CNeutrinoApp::getInstance()->MarkChannelsInit(); break; - case 5: // settings + case 5: // clear channel history + { + CNeutrinoApp::getInstance()->channelList->getLastChannels().clear(); + printf("%s:%d lastChList cleared\n", __FUNCTION__, __LINE__); + ret = -2; // exit channellist + } + break; + case 6: // settings { previous_channellist_additional = g_settings.channellist_additional; COsdSetup osd_setup; @@ -457,7 +476,7 @@ void CChannelList::calcSize() if (fheight == 0) fheight = 1; /* avoid div-by-zero crash on invalid font */ - footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+6; + footerHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+6; pig_on_win = ( (g_settings.channellist_additional == 2) /* with miniTV */ && (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_ts) ); // calculate width @@ -478,7 +497,7 @@ void CChannelList::calcSize() else info_height = 0; height = pig_on_win ? frameBuffer->getScreenHeight(): frameBuffer->getScreenHeightRel(); - height = height - info_height; + height = height - OFFSET_INTER - info_height; // calculate x position x = getScreenStartX(full_width); @@ -496,7 +515,7 @@ void CChannelList::calcSize() height = theight + listmaxshow*fheight + footerHeight; // calculate y position - y = getScreenStartY(height + info_height); + y = getScreenStartY(height + OFFSET_INTER + info_height); // calculate width/height of right info_zone and pip-box infozone_width = full_width - width; @@ -701,8 +720,9 @@ int CChannelList::show() loop = false; } } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { if (!edit_state) { + //FIXME: what about LIST_MODE_WEBTV? int newmode = msg == CRCInput::RC_sat ? LIST_MODE_SAT : LIST_MODE_FAV; CNeutrinoApp::getInstance()->SetChannelMode(newmode); res = CHANLIST_CHANGE_MODE; @@ -717,10 +737,13 @@ int CChannelList::show() if (selected + 1 < (*chanlist).size()) selected++; } - if (ret != 0) { - paint(); + if (ret == -2) // exit channellist + loop = false; + else { + if (ret != 0) + paint(); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); } - timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); } else if (!empty && msg == (neutrino_msg_t) g_settings.key_list_start) { actzap = updateSelection(0); @@ -907,6 +930,8 @@ int CChannelList::show() } } + paint_events(-2); // cancel paint_events thread + if (move_state == beMoving) cancelMoveChannel(); if (edit_state) @@ -953,7 +978,7 @@ void CChannelList::hide() CChannelLogo = NULL; } - frameBuffer->paintBackgroundBoxRel(x, y, full_width, height + info_height); + frameBuffer->paintBackgroundBoxRel(x, y, full_width, height + OFFSET_INTER + info_height); clearItem2DetailsLine(); CInfoClock::getInstance()->enableInfoClock(!CInfoClock::getInstance()->isBlocked()); } @@ -1284,6 +1309,7 @@ int CChannelList::numericZap(int key) bool showEPG = false; neutrino_msg_t msg; neutrino_msg_data_t data; + g_InfoViewer->setSwitchMode(CInfoViewer::IV_MODE_NUMBER_ZAP); while(1) { if (lastchan != chn) { @@ -1308,7 +1334,8 @@ int CChannelList::numericZap(int key) doZap = true; break; } - else if (msg == CRCInput::RC_favorites || msg == CRCInput::RC_sat || msg == CRCInput::RC_right) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg) || msg == CRCInput::RC_right) { + // do nothing } else if (CRCInput::isNumeric(msg)) { if (pos == 4) { @@ -1367,6 +1394,7 @@ int CChannelList::numericZap(int key) if (chan && showEPG) g_EventList->exec(chan->getChannelID(), chan->getName()); } + g_InfoViewer->resetSwitchMode(); return res; } @@ -1375,7 +1403,7 @@ CZapitChannel* CChannelList::getPrevNextChannel(int key, unsigned int &sl) if(sl >= (*chanlist).size()) sl = (*chanlist).size()-1; - CZapitChannel* channel = (*chanlist)[sl]; + CZapitChannel* channel = NULL; int bsize = bouquetList->Bouquets.size(); int bactive = bouquetList->getActiveBouquetNumber(); @@ -1508,14 +1536,17 @@ void CChannelList::paintDetails(int index) if (!g_settings.channellist_show_infobox) return; + int ypos = y + height + OFFSET_INTER; + int ypos_a = ypos + OFFSET_INNER_SMALL; + CChannelEvent *p_event = NULL; //colored_events init bool colored_event_C = (g_settings.theme.colored_events_channellist == 1); bool colored_event_N = (g_settings.theme.colored_events_channellist == 2); - frameBuffer->paintBoxRel(x+1, y + height + 1, full_width-2, info_height - 2, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE);//round - frameBuffer->paintBoxFrame(x, y + height, full_width, info_height, 2, COL_MENUCONTENT_PLUS_6, RADIUS_LARGE); + frameBuffer->paintBoxRel(x, ypos, full_width, info_height, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); + frameBuffer->paintBoxFrame(x, ypos, full_width, info_height, 2, COL_FRAME_PLUS_0, RADIUS_LARGE); if ((*chanlist).empty()) return; @@ -1565,7 +1596,7 @@ void CChannelList::paintDetails(int index) text3= text3+ " - "; xstart += g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text3); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, full_width - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + 2*fheight, full_width - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } if (!(text2.empty())) { @@ -1582,18 +1613,18 @@ void CChannelList::paintDetails(int index) } } #endif - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ fdescrheight+ fheight, full_width- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, ypos_a + fdescrheight+ fheight, full_width- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, full_width - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- seit_len, y+ height+ 5+ fheight, seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- noch_len, y+ height+ 5+ fdescrheight+ fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + fheight, full_width - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- seit_len, ypos_a + fheight , seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- noch_len, ypos_a + fdescrheight+ fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } else if (IS_WEBTV((*chanlist)[index]->getChannelID())) { - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, full_width - 30, (*chanlist)[index]->getDesc(), colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + fheight, full_width - 30, (*chanlist)[index]->getDesc(), colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); } if (IS_WEBTV((*chanlist)[index]->getChannelID())) { - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2*fheight + fdescrheight, full_width - 30, (*chanlist)[index]->getUrl(), COL_MENUCONTENTDARK_TEXT, 0, true); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + 2*fheight + fdescrheight, full_width - 30, (*chanlist)[index]->getUrl(), COL_MENUCONTENTDARK_TEXT, 0, true); } else if(g_settings.channellist_foot == 0) { transponder t; CServiceManager::getInstance()->GetTransponder((*chanlist)[index]->getTransponderId(), t); @@ -1604,7 +1635,7 @@ void CChannelList::paintDetails(int index) else desc = desc + " (" + CServiceManager::getInstance()->GetSatelliteName((*chanlist)[index]->getSatellitePosition()) + ")"; - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2*fheight +fdescrheight, full_width - 30, desc.c_str(), COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + 2*fheight +fdescrheight, full_width - 30, desc.c_str(), COL_MENUCONTENTDARK_TEXT); } else if( !displayNext && g_settings.channellist_foot == 1) { // next Event @@ -1618,8 +1649,8 @@ void CChannelList::paintDetails(int index) snprintf(buf, sizeof(buf), "%s", CurrentNext.next_name.c_str()); int from_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cFrom); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2*fheight+ fdescrheight, full_width - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_TEXT :COL_MENUCONTENTDARK_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- from_len, y+ height+ 5+ 2*fheight+ fdescrheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, ypos_a + 2*fheight+ fdescrheight, full_width - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_TEXT :COL_MENUCONTENTDARK_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- from_len, ypos_a + 2*fheight+ fdescrheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT); } } } @@ -1641,13 +1672,13 @@ void CChannelList::paintItem2DetailsLine (int pos) return; int xpos = x - ConnectLineBox_Width; - int ypos1 = y + theight + pos*fheight + (fheight/2)-2; - int ypos2 = y + height + (info_height/2)-2; + int ypos1 = y + theight + pos*fheight + (fheight/2); + int ypos2 = y + height + OFFSET_INTER + (info_height/2); // paint Line if detail info (and not valid list pos) if (pos >= 0) { if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1, ypos2, fheight/2+1, info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailLine(xpos, ypos1, ypos2, fheight/2, info_height-RADIUS_LARGE*2); dline->paint(false); } } @@ -1824,44 +1855,60 @@ void CChannelList::paintItem(int pos, const bool firstpaint) return; } int ypos = y+ theight + pos*fheight; - fb_pixel_t color; - fb_pixel_t bgcolor; - bool iscurrent = true; + bool is_available = true; bool paintbuttons = false; unsigned int curr = liststart + pos; - fb_pixel_t c_rad_small = 0; - if(curr < (*chanlist).size()) { + if (curr < (*chanlist).size()) + { if (edit_state) - iscurrent = !((*chanlist)[curr]->flags & CZapitChannel::NOT_PRESENT); + is_available = !((*chanlist)[curr]->flags & CZapitChannel::NOT_PRESENT); else - iscurrent = SameTP((*chanlist)[curr]); + is_available = SameTP((*chanlist)[curr]); } - if(selected >= (*chanlist).size()) + if (selected >= (*chanlist).size()) selected = (*chanlist).size()-1; - if (curr == selected) { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; + bool i_selected = curr == selected; + bool i_marked = getKey(curr) == CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber() && new_zap_mode != 2 /*active*/; + int i_radius = RADIUS_NONE; + + fb_pixel_t color; + fb_pixel_t ecolor; // we need one more color for displayNext + fb_pixel_t bgcolor; + + getItemColors(color, bgcolor, i_selected, i_marked); + ecolor = color; + + if (i_selected || i_marked) + i_radius = RADIUS_LARGE; + + if (i_selected) + { paintItem2DetailsLine (pos); paintDetails(curr); paintAdditionals(curr); - c_rad_small = RADIUS_LARGE; paintbuttons = true; } - else if (getKey(curr) == CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber() && new_zap_mode != 2/*active*/) + + if (displayNext) { - color = !displayNext ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT; - bgcolor = !displayNext ? COL_MENUCONTENT_PLUS_1 : COL_MENUCONTENTINACTIVE_PLUS_0; - c_rad_small = RADIUS_LARGE; - } else { - color = iscurrent ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT; - bgcolor = iscurrent ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; + /* + I think it's unnecessary to change colors in this case. + The user should know when he has pressed the blue button. + */ + if (g_settings.theme.colored_events_channellist == 2 /* next */) + ecolor = COL_COLORED_EVENTS_TEXT; + else + ecolor = COL_MENUCONTENTINACTIVE_TEXT; } - if(!firstpaint || (curr == selected) || getKey(curr) == CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber()) - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, c_rad_small); + if (!is_available) + color = COL_MENUCONTENTINACTIVE_TEXT; + + if (!firstpaint || i_selected || getKey(curr) == CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber()) + frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, i_radius); if(curr < (*chanlist).size()) { char nameAndDescription[255]; @@ -1869,8 +1916,6 @@ void CChannelList::paintItem(int pos, const bool firstpaint) CZapitChannel* chan = (*chanlist)[curr]; int prg_offset=0; int title_offset=0; - fb_pixel_t tcolor=(liststart + pos == selected) ? color : COL_MENUCONTENTINACTIVE_TEXT; - int xtheight=fheight-2; int rec_mode; if(g_settings.channellist_progressbar_design != CProgressBar::PB_OFF) { @@ -1919,7 +1964,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint) //paint buttons if (paintbuttons) - paintButtonBar(iscurrent); + paintButtonBar(is_available); int icon_space = r_icon_w+s_icon_w; @@ -1944,32 +1989,21 @@ void CChannelList::paintItem(int pos, const bool firstpaint) l = snprintf(nameAndDescription, sizeof(nameAndDescription), "%s", chan->getName().c_str()); int pb_space = prg_offset - title_offset; - CProgressBar pb(x+5+numwidth + title_offset, ypos + fheight/4 + 2, pb_space + 2, fheight/2 - 4, - 0, COL_MENUCONTENT_PLUS_0, COL_MENUCONTENTDARK_PLUS_0, COL_INFOBAR_PLUS_7, COL_INFOBAR_PLUS_3); + int pb_height = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getDigitHeight(); + CProgressBar pb(x+5+numwidth + title_offset, ypos + (fheight-pb_height)/2, pb_space + 2, pb_height, COL_MENUCONTENT_PLUS_0); pb.setType(CProgressBar::PB_TIMESCALE); pb.setDesign(g_settings.channellist_progressbar_design); pb.setCornerType(0); - pb.setFrameThickness(0); // no frame - pb.doPaintBg(false); // no background - int pb_max = pb_space - 4; - if (g_settings.progressbar_design != CProgressBar::PB_MONO) { - if (liststart + pos != selected) { - fb_pixel_t pbgcol = COL_MENUCONTENT_PLUS_1; - if (pbgcol == bgcolor) - pbgcol = COL_MENUCONTENT_PLUS_0; - pb.setStatusColors(COL_MENUCONTENT_PLUS_3, pbgcol); - } else { - fb_pixel_t pbgcol = COL_MENUCONTENTSELECTED_PLUS_0; - if (pbgcol == bgcolor) - pbgcol = COL_MENUCONTENT_PLUS_0; - pb.setStatusColors(COL_MENUCONTENTSELECTED_PLUS_2, pbgcol); - } - } else { - if (liststart + pos != selected) - pb.setStatusColors(COL_MENUCONTENT_PLUS_3, COL_MENUCONTENT_PLUS_1); - else - pb.setStatusColors(COL_MENUCONTENTSELECTED_PLUS_2, COL_MENUCONTENTSELECTED_PLUS_0); + pb.setStatusColors(COL_MENUCONTENT_PLUS_3, COL_MENUCONTENT_PLUS_1); + int pb_frame = 0; + if (g_settings.channellist_progressbar_design == CProgressBar::PB_MONO && !g_settings.progressbar_gradient) + { + // add small frame to mono progressbars w/o gradient for a better visibility + pb_frame = 1; } + pb.setFrameThickness(pb_frame); + pb.doPaintBg(false); + int pb_max = pb_space - 4; if (!(p_event->description.empty())) { snprintf(nameAndDescription+l, sizeof(nameAndDescription)-l,g_settings.channellist_epgtext_align_right ? " ":" - "); @@ -1988,10 +2022,10 @@ void CChannelList::paintItem(int pos, const bool firstpaint) if(g_settings.channellist_progressbar_design != CProgressBar::PB_OFF) { if(displayNext) { - struct tm *pStartZeit = localtime(&p_event->startTime); + struct tm *pStartZeit = localtime(&p_event->startTime); snprintf(tmp, sizeof(tmp), "%02d:%02d", pStartZeit->tm_hour, pStartZeit->tm_min); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x+ 5+ numwidth+ 6, ypos+ xtheight, width- numwidth- 20- 15 -prg_offset, tmp, tcolor); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x+ 5+ numwidth+ 6, ypos + fheight, width- numwidth- 20- 15 -prg_offset, tmp, ecolor, fheight); } else { @@ -2011,11 +2045,11 @@ void CChannelList::paintItem(int pos, const bool firstpaint) g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color); if (g_settings.channellist_epgtext_align_right) { // align right - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 20 - ch_desc_len - icon_space - 4, ypos + fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED_TEXT:(!displayNext ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT)); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 20 - ch_desc_len - icon_space - 4, ypos + fheight, ch_desc_len, p_event->description, ecolor); } else { // align left - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 5+ numwidth+ 10+ ch_name_len+ 5+prg_offset, ypos+ fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED_TEXT:(!displayNext ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT)); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 5+ numwidth+ 10+ ch_name_len+ 5+prg_offset, ypos+ fheight, ch_desc_len, p_event->description, ecolor); } } else { @@ -2164,14 +2198,14 @@ void CChannelList::paintBody() const int ypos = y+ theight; const int sb = height - theight - footerHeight; // paint scrollbar over full height of main box - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - - int sbc= (((*chanlist).size()- 1)/ listmaxshow)+ 1; - const int sbs= (selected/listmaxshow); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + unsigned int listmaxshow_tmp = listmaxshow ? listmaxshow : 1;//avoid division by zero + int sbc= (((*chanlist).size()- 1)/ listmaxshow_tmp)+ 1; + const int sbs= (selected/listmaxshow_tmp); if (sbc < 1) sbc = 1; - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); + frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); showChannelLogo(); if ((*chanlist).empty()) paintButtonBar(false); @@ -2256,9 +2290,70 @@ void CChannelList::paintPig (int _x, int _y, int w, int h) } void CChannelList::paint_events(int index) +{ + if (index == -2 && paint_events_index > -2) { + pthread_mutex_lock(&paint_events_mutex); + paint_events_index = index; + sem_post(&paint_events_sem); + pthread_join(paint_events_thr, NULL); + sem_destroy(&paint_events_sem); + pthread_mutex_unlock(&paint_events_mutex); + } else if (paint_events_index == -2) { + if (index == -2) + return; + // First paint_event. No need to lock. + pthread_mutexattr_t attr; + pthread_mutexattr_init(&attr); + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK_NP); + pthread_mutex_init(&paint_events_mutex, &attr); + + sem_init(&paint_events_sem, 0, 0); + paint_events_index = index; + if (!pthread_create(&paint_events_thr, NULL, paint_events, (void *) this)) + sem_post(&paint_events_sem); + else + paint_events_index = -2; + } else { + pthread_mutex_lock(&paint_events_mutex); + paint_events_index = index; + pthread_mutex_unlock(&paint_events_mutex); + sem_post(&paint_events_sem); + } +} + +void *CChannelList::paint_events(void *arg) +{ + CChannelList *me = (CChannelList *) arg; + me->paint_events(); + pthread_exit(NULL); +} + +void CChannelList::paint_events() +{ + set_threadname(__func__); + + while (paint_events_index != -2) { + sem_wait(&paint_events_sem); + if (paint_events_index < 0) + continue; + while(!sem_trywait(&paint_events_sem)); + int current_index = paint_events_index; + + CChannelEventList evtlist; + readEvents((*chanlist)[current_index]->getChannelID(), evtlist); + if (current_index == paint_events_index) { + pthread_mutex_lock(&paint_events_mutex); + if (current_index == paint_events_index) + paint_events_index = -1; + pthread_mutex_unlock(&paint_events_mutex); + paint_events(evtlist); + } + } +} + +void CChannelList::paint_events(CChannelEventList &evtlist) { ffheight = g_Font[eventFont]->getHeight(); - readEvents((*chanlist)[index]->getEpgID()); frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0); char startTime[10]; @@ -2320,8 +2415,6 @@ void CChannelList::paint_events(int index) } i++; } - if ( !evtlist.empty() ) - evtlist.clear(); } static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) @@ -2329,7 +2422,7 @@ static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) return a.startTime < b.startTime; } -void CChannelList::readEvents(const t_channel_id channel_id) +void CChannelList::readEvents(const t_channel_id channel_id, CChannelEventList &evtlist) { CEitManager::getInstance()->getEventsServiceKey(channel_id , evtlist); diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 21d2babda..49d057105 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -46,10 +46,13 @@ #include #include +#include +#include enum { LIST_MODE_FAV, LIST_MODE_PROV, + LIST_MODE_WEBTV, LIST_MODE_SAT, LIST_MODE_ALL, LIST_MODE_LAST @@ -81,7 +84,6 @@ private: unsigned int origPosition; unsigned int newPosition; bool channelsChanged; - bool favoritesChanged; unsigned int tuned; t_channel_id selected_chid; @@ -117,6 +119,11 @@ private: int infozone_height; int previous_channellist_additional; + int paint_events_index; + sem_t paint_events_sem; + pthread_t paint_events_thr; + pthread_mutex_t paint_events_mutex; + const char * unit_short_minute; CEPGData epgData; @@ -147,9 +154,11 @@ private: void calcSize(); std::string MaxChanNr(); void paintPig(int x, int y, int w, int h); + void paint_events(); void paint_events(int index); - CChannelEventList evtlist; - void readEvents(const t_channel_id channel_id); + void paint_events(CChannelEventList &evtlist); + static void *paint_events(void *arg); + void readEvents(const t_channel_id channel_id, CChannelEventList &evtlist); void showdescription(int index); typedef std::pair epg_pair; std::vector epgText; diff --git a/src/gui/color.cpp b/src/gui/color.cpp index 4b632f3d3..56382340d 100644 --- a/src/gui/color.cpp +++ b/src/gui/color.cpp @@ -228,3 +228,31 @@ void Rgb2Hsv(RgbColor *rgb, HsvColor *hsv) hsv->s = f_S; hsv->v = f_V; } + +void getItemColors(fb_pixel_t &t, fb_pixel_t &b, bool selected, bool marked, bool switch_background) +{ + if (selected && marked) + { + t = COL_MENUCONTENTSELECTED_TEXT_PLUS_2; + b = COL_MENUCONTENTSELECTED_PLUS_2; + return; + } + + if (selected) + { + t = COL_MENUCONTENTSELECTED_TEXT; + b = COL_MENUCONTENTSELECTED_PLUS_0; + return; + } + + if (marked) + { + t = COL_MENUCONTENT_TEXT_PLUS_2; + b = COL_MENUCONTENT_PLUS_2; + return; + } + + // default + t = switch_background ? COL_MENUCONTENTDARK_TEXT : COL_MENUCONTENT_TEXT; + b = switch_background ? COL_MENUCONTENTDARK_PLUS_0 : COL_MENUCONTENT_PLUS_0; +} diff --git a/src/gui/color.h b/src/gui/color.h index 5634a1e8e..61305ca4e 100644 --- a/src/gui/color.h +++ b/src/gui/color.h @@ -35,12 +35,13 @@ #include -#define COL_MAXFREE 254-8*12 - 1 -#define COL_NEUTRINO_TEXT 254-8*12 // 24 values +#define COL_MAXFREE 254-8*16 - 1 +#define COL_NEUTRINO_TEXT 254-8*16 // 32 values? +#define COL_MENUFOOT 254-8*11 #define COL_INFOBAR_CASYSTEM 254-8*10 #define COL_COLORED_EVENTS_CHANNELLIST 254-8*9 #define COL_COLORED_EVENTS_INFOBAR 254-8*8 -#define COL_INFOBAR_SHADOW 254-8*7 +#define COL_SHADOW 254-8*7 #define COL_INFOBAR 254-8*6 #define COL_MENUHEAD 254-8*5 #define COL_MENUCONTENT 254-8*4 @@ -51,8 +52,7 @@ #define COL_BACKGROUND 255 #ifdef FB_USE_PALETTE -#define COL_INFOBAR_SHADOW_PLUS_0 (COL_INFOBAR_SHADOW + 0) -#define COL_INFOBAR_SHADOW_PLUS_1 (COL_INFOBAR_SHADOW + 1) +#define COL_SHADOW_PLUS_0 (COL_SHADOW + 0) #define COL_INFOBAR_PLUS_0 (COL_INFOBAR + 0) #define COL_INFOBAR_PLUS_1 (COL_INFOBAR + 1) #define COL_INFOBAR_PLUS_3 (COL_INFOBAR + 3) @@ -73,10 +73,10 @@ #define COL_MENUCONTENTSELECTED_PLUS_0 (COL_MENUCONTENTSELECTED + 0) #define COL_MENUCONTENTSELECTED_PLUS_2 (COL_MENUCONTENTSELECTED + 2) #define COL_MENUCONTENTINACTIVE_PLUS_0 (COL_MENUCONTENTINACTIVE + 0) +#define COL_MENUFOOT_PLUS_0 (COL_MENUFOOT + 0) #define COL_BACKGROUND_PLUS_0 (COL_BACKGROUND + 0) #else -#define COL_INFOBAR_SHADOW_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR_SHADOW + 0)]) -#define COL_INFOBAR_SHADOW_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR_SHADOW + 1)]) +#define COL_SHADOW_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_SHADOW + 0)]) #define COL_INFOBAR_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 0)]) #define COL_INFOBAR_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 1)]) #define COL_INFOBAR_PLUS_3 (CFrameBuffer::getInstance()->realcolor[(COL_INFOBAR + 3)]) @@ -97,12 +97,13 @@ #define COL_MENUCONTENTSELECTED_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTSELECTED + 0)]) #define COL_MENUCONTENTSELECTED_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTSELECTED + 2)]) #define COL_MENUCONTENTINACTIVE_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTINACTIVE + 0)]) +#define COL_MENUFOOT_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUFOOT + 0)]) #define COL_BACKGROUND_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_BACKGROUND + 0)]) // text colors #define COL_COLORED_EVENTS_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 0)]) #define COL_INFOBAR_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 1)]) -#define COL_INFOBAR_SHADOW_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 2)]) +#define COL_MENUFOOT_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 2)]) #define COL_MENUHEAD_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 3)]) #define COL_MENUCONTENT_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 4)]) #define COL_MENUCONTENT_TEXT_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 5)]) @@ -118,6 +119,19 @@ #define COL_INFOCLOCK_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 15)]) #endif +// some wrappers to get more readability +#define COL_FRAME COL_MENUCONTENT_PLUS_6 +#define COL_FRAME_PLUS_0 COL_FRAME + +#define COL_SCROLLBAR_ACTIVE COL_MENUCONTENT_PLUS_3 +#define COL_SCROLLBAR_ACTIVE_PLUS_0 COL_SCROLLBAR_ACTIVE +#define COL_SCROLLBAR_PASSIVE COL_MENUCONTENT_PLUS_1 +#define COL_SCROLLBAR_PASSIVE_PLUS_0 COL_SCROLLBAR_PASSIVE + +#define COL_PROGRESSBAR_ACTIVE COL_MENUCONTENT_PLUS_7 +#define COL_PROGRESSBAR_ACTIVE_PLUS_0 COL_PROGRESSBAR_ACTIVE +#define COL_PROGRESSBAR_PASSIVE COL_MENUCONTENT_PLUS_1 +#define COL_PROGRESSBAR_PASSIVE_PLUS_0 COL_PROGRESSBAR_PASSIVE int convertSetupColor2RGB(unsigned char r, unsigned char g, unsigned char b); int convertSetupAlpha2Alpha(unsigned char alpha); @@ -147,4 +161,6 @@ uint8_t SysColor2Hsv(fb_pixel_t color, HsvColor *hsv); void Hsv2Rgb(HsvColor *hsv, RgbColor *rgb); void Rgb2Hsv(RgbColor *rgb, HsvColor *hsv); +void getItemColors(fb_pixel_t &t, fb_pixel_t &b, bool selected = false, bool marked = false, bool switch_background = false); + #endif diff --git a/src/gui/color_custom.h b/src/gui/color_custom.h new file mode 100644 index 000000000..2b3ccc800 --- /dev/null +++ b/src/gui/color_custom.h @@ -0,0 +1,60 @@ +#ifndef __color_custom__ +#define __color_custom__ + +#define COLOR_CUSTOM 0x0 +#ifdef FB_USE_PALETTE +/* +#define COL_WHITE (COLOR_CUSTOM + 0) +#define COL_RED (COLOR_CUSTOM + 1) +#define COL_GREEN (COLOR_CUSTOM + 2) +#define COL_BLUE (COLOR_CUSTOM + 3) +#define COL_YELLOW (COLOR_CUSTOM + 4) +#define COL_BLACK (COLOR_CUSTOM + 5) +*/ +#define COL_DARK_RED 0x02 +#define COL_DARK_GREEN 0x03 +#define COL_OLIVE 0x04 +#define COL_DARK_BLUE 0x05 +#define COL_LIGHT_GRAY 0x08 +#define COL_DARK_GRAY 0x09 +#define COL_RED 0x0A +#define COL_GREEN 0x0B +#define COL_YELLOW 0x0C +#define COL_BLUE 0x0D +#define COL_PURP 0x0E +#define COL_LIGHT_BLUE 0x0F +#define COL_WHITE 0x10 +#define COL_BLACK 0x11 +#else +#define COL_DARK_RED0 0x02 +#define COL_DARK_GREEN0 0x03 +#define COL_OLIVE0 0x04 +#define COL_DARK_BLUE0 0x05 +#define COL_LIGHT_GRAY0 0x08 +#define COL_DARK_GRAY0 0x09 +#define COL_RED0 0x0A +#define COL_GREEN0 0x0B +#define COL_YELLOW0 0x0C +#define COL_BLUE0 0x0D +#define COL_PURP0 0x0E +#define COL_LIGHT_BLUE0 0x0F +#define COL_WHITE0 0x10 +#define COL_BLACK0 0x11 + +#define COL_DARK_RED (CFrameBuffer::getInstance()->realcolor[0x02]) +#define COL_DARK_GREEN (CFrameBuffer::getInstance()->realcolor[0x03]) +#define COL_OLIVE (CFrameBuffer::getInstance()->realcolor[0x04]) +#define COL_DARK_BLUE (CFrameBuffer::getInstance()->realcolor[0x05]) +#define COL_LIGHT_GRAY (CFrameBuffer::getInstance()->realcolor[0x08]) +#define COL_DARK_GRAY (CFrameBuffer::getInstance()->realcolor[0x09]) +#define COL_RED (CFrameBuffer::getInstance()->realcolor[0x0A]) +#define COL_GREEN (CFrameBuffer::getInstance()->realcolor[0x0B]) +#define COL_YELLOW (CFrameBuffer::getInstance()->realcolor[0x0C]) +#define COL_BLUE (CFrameBuffer::getInstance()->realcolor[0x0D]) +#define COL_PURP (CFrameBuffer::getInstance()->realcolor[0x0E]) +#define COL_LIGHT_BLUE (CFrameBuffer::getInstance()->realcolor[0x0F]) +#define COL_WHITE (CFrameBuffer::getInstance()->realcolor[0x10]) +#define COL_BLACK (CFrameBuffer::getInstance()->realcolor[0x11]) +#endif + +#endif diff --git a/src/gui/components/cc_detailsline.cpp b/src/gui/components/cc_detailsline.cpp index 561f698a2..760b21fd6 100644 --- a/src/gui/components/cc_detailsline.cpp +++ b/src/gui/components/cc_detailsline.cpp @@ -61,7 +61,8 @@ void CComponentsDetailLine::initVarDline( const int& x_pos, const int& y_pos_top shadow_w = 1; //CComponentsDetailLine - thickness = 4; + thickness = 4; /* MUST be an even value! */ + cc_body_gradient_enable = false; } @@ -95,11 +96,14 @@ void CComponentsDetailLine::paint(bool do_save_bg) if (v_fbdata.empty()){ - int y_mark_top = y-h_mark_top/2+thickness/2; - int y_mark_down = y_down-h_mark_down/2+thickness/2; - int sw = shadow_w; + // reduce two times the shadow width, to avoid shadow overlaps + h_mark_down -= 2*sw; + + int y_mark_top = y-h_mark_top/2; + int y_mark_down = y_down-h_mark_down/2; + cc_fbdata_t fbdata[] = { /*buffered bg full width and height */ @@ -111,16 +115,16 @@ void CComponentsDetailLine::paint(bool do_save_bg) {true, CC_FBDATA_TYPE_BOX, x+width-thickness, y_mark_top+h_mark_top, thickness, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* horizontal item line - */ - {true, CC_FBDATA_TYPE_BOX, x, y, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness, width-2*thickness-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2, width-2*thickness-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* vertical connect line [ */ - {true, CC_FBDATA_TYPE_BOX, x, y+thickness, thickness, y_down-y-thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness+sw, sw, y_down-y-thickness-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y+thickness/2, thickness, y_down-y-thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2+sw, sw, y_down-y-thickness-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* horizontal info line - */ - {true, CC_FBDATA_TYPE_BOX, x, y_down, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+sw, y_down+thickness, width-thickness-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y_down-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+sw, y_down+thickness/2, width-thickness-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* vertical info mark | */ {true, CC_FBDATA_TYPE_BOX, x+width-thickness-sw, y_mark_down, thickness, h_mark_down, col_body, 0, 0, 0, NULL, NULL, NULL, false}, @@ -139,6 +143,6 @@ void CComponentsDetailLine::paint(bool do_save_bg) //so you can ensure correct applied system colors in relevant objects with unchanged instances. void CComponentsDetailLine::syncSysColors() { - col_body = COL_MENUCONTENT_PLUS_6; - col_shadow = COL_MENUCONTENTDARK_PLUS_0; + col_body = COL_FRAME_PLUS_0; + col_shadow = COL_SHADOW_PLUS_0; } diff --git a/src/gui/components/cc_detailsline.h b/src/gui/components/cc_detailsline.h index f9c314afd..dfea467bd 100644 --- a/src/gui/components/cc_detailsline.h +++ b/src/gui/components/cc_detailsline.h @@ -57,19 +57,22 @@ class CComponentsDetailLine : public CComponents public: CComponentsDetailLine( const int& x_pos = 1,const int& y_pos_top = 1, const int& y_pos_down = 1, const int& h_mark_top_ = CC_HEIGHT_MIN , const int& h_mark_down_ = CC_HEIGHT_MIN, - fb_pixel_t color_line = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_line = COL_FRAME_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ~CComponentsDetailLine(); ///set colors - inline void setColors(fb_pixel_t color_line, fb_pixel_t color_shadow){col_body = color_line; col_shadow = color_shadow;}; + void setColors(fb_pixel_t color_line, fb_pixel_t color_shadow){col_body = color_line; col_shadow = color_shadow;}; ///set colors with system settings void syncSysColors(); ///set property: lowest y position - inline void setYPosDown(const int& y_pos_down){y_down = y_pos_down;}; + void setYPosDown(const int& y_pos_down){y_down = y_pos_down;}; ///set property: height of top marker - inline void setHMarkTop(const int& h_mark_top_){h_mark_top = h_mark_top_;}; + void setHMarkTop(const int& h_mark_top_){h_mark_top = h_mark_top_;}; ///property: height of bottom marker - inline void setHMarkDown(const int& h_mark_down_){h_mark_down = h_mark_down_;}; + void setHMarkDown(const int& h_mark_down_){h_mark_down = h_mark_down_;}; + ///set all positions and dimensions of details line at once + void setDimensionsAll(const int& x_pos,const int& y_pos, const int& y_pos_down, const int& h_mark_top_ , const int& h_mark_down_) + {setXPos(x_pos); setYPos(y_pos); setYPosDown(y_pos_down); setHMarkTop(h_mark_top_); setHMarkDown(h_mark_down_);} ///paint all to screen void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 0b2a4456e..1296e19d7 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -38,8 +38,8 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) width = width_old = CC_WIDTH_MIN; col_body = col_body_old = COL_MENUCONTENT_PLUS_0; - col_shadow = col_shadow_old = COL_MENUCONTENTDARK_PLUS_0; - col_frame = col_frame_old = COL_MENUCONTENT_PLUS_6; + col_shadow = col_shadow_old = COL_SHADOW_PLUS_0; + col_frame = col_frame_old = COL_FRAME_PLUS_0; col_frame_sel = col_frame_sel_old = COL_MENUCONTENTSELECTED_PLUS_0; fr_thickness = fr_thickness_old = 0; @@ -49,7 +49,7 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) corner_rad = corner_rad_old = 0; shadow = CC_SHADOW_OFF; - shadow_w = shadow_w_old = SHADOW_OFFSET; + shadow_w = shadow_w_old = OFFSET_SHADOW; shadow_force = false; cc_paint_cache = false; @@ -71,6 +71,8 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) cc_body_gradient_saturation = 0xC0; cc_body_gradient_direction = cc_body_gradient_direction_old = CFrameBuffer::gradientVertical; + cc_gradient_bg_cleanup = true; + v_fbdata.clear(); } @@ -222,6 +224,11 @@ void CCDraw::setFrameThickness(const int& thickness, const int& thickness_sel) if (fr_thickness_sel != thickness_sel) fr_thickness_sel = thickness_sel; + + //ensure enabled frame if frame width > 0 + cc_enable_frame = false; + if (fr_thickness) + cc_enable_frame = true; } bool CCDraw::enableColBodyGradient(const int& enable_mode, const fb_pixel_t& sec_color, const int& direction) @@ -429,7 +436,7 @@ bool CCDraw::CheckFbData(const cc_fbdata_t& fbdata, const char* func, const int //screen area save fb_pixel_t* CCDraw::getScreen(int ax, int ay, int dx, int dy) { - if (dx * dy == 0) + if (dx < 1 || dy < 1 || dx * dy == 0) return NULL; dprintf(DEBUG_INFO, "[CCDraw] INFO! [%s - %d], ax = %d, ay = %d, dx = %d, dy = %d\n", __func__, __LINE__, ax, ay, dx, dy); @@ -534,16 +541,19 @@ void CCDraw::paintFbItems(bool do_save_bg) */ if (cc_enable_frame){ if (fbtype == CC_FBDATA_TYPE_FRAME) { - if (fbdata.frame_thickness > 0 && cc_allow_paint) + if (fbdata.frame_thickness > 0 && cc_allow_paint){ frameBuffer->paintBoxFrame(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, fbdata.frame_thickness, fbdata.color, fbdata.r, fbdata.rtype); + v_fbdata[i].is_painted = true; + } } } if (paint_bg){ if (fbtype == CC_FBDATA_TYPE_BACKGROUND){ frameBuffer->paintBackgroundBoxRel(x, y, fbdata.dx, fbdata.dy); + v_fbdata[i].is_painted = true; } } - if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && (!is_painted || shadow_force)) { + if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && ((!is_painted || !fbdata.is_painted)|| shadow_force)) { if (fbdata.enabled) { /* here we paint the shadow around the body * on 1st step we check for already cached screen buffer, if true @@ -560,6 +570,7 @@ void CCDraw::paintFbItems(bool do_save_bg) //if is paint cache enabled if (cc_paint_cache && fbdata.pixbuf == NULL) fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); + fbdata.is_painted = true; } } } @@ -590,15 +601,33 @@ void CCDraw::paintFbItems(bool do_save_bg) fbdata.gradient_data = getGradientData(); } - // if found empty gradient buffer, create it, otherwise paint from cache + // if found empty gradient buffer, create it, otherwise paint from gradient cache if (fbdata.gradient_data->boxBuf == NULL){ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint new gradient)...\033[0m\n", __func__, __LINE__); - fbdata.gradient_data->boxBuf = frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.gradient_data, fbdata.r, fbdata.rtype); - if (cc_paint_cache) + if (!fbdata.pixbuf){ + // on enabled clean up, paint blank screen before create gradient box, this prevents possible ghost text with hw acceleration + if (cc_gradient_bg_cleanup) + frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.r, fbdata.rtype); + + // create gradient buffer and paint gradient box + fbdata.gradient_data->boxBuf = frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.gradient_data, fbdata.r, fbdata.rtype); + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint and cache new gradient into gradient cache...\033[0m\n", __func__, __LINE__); + } + + /* On enabled paint cache or clean up, catch the screen into paint cache and clean up unused gradient buffer. + * If we don't do this, gradient cache is used. + */ + if (cc_paint_cache || cc_gradient_bg_cleanup){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], cache new created gradient into external cache...\033[0m\n", __func__, __LINE__); fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); + if (clearFbGradientData()) + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], remove unused gradient data...\033[0m\n", __func__, __LINE__); + } }else{ + //use gradient cache to repaint gradient box dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint cached gradient)...\033[0m\n", __func__, __LINE__); - frameBuffer->blitBox2FB(fbdata.gradient_data->boxBuf, fbdata.dx, fbdata.dy, fbdata.x, fbdata.y); + frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, true); + frameBuffer->blitBox2FB(fbdata.gradient_data->boxBuf, fbdata.gradient_data->dx, fbdata.dy, fbdata.gradient_data->x, fbdata.y); + frameBuffer->checkFbArea(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, false); } }else{ dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], paint default box)...\033[0m\n", __func__, __LINE__); @@ -607,7 +636,7 @@ void CCDraw::paintFbItems(bool do_save_bg) fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); } } - is_painted = true; + is_painted = v_fbdata[i].is_painted = true; } } } @@ -616,8 +645,6 @@ void CCDraw::paintFbItems(bool do_save_bg) OnAfterPaintLayers(); } - - void CCDraw::hide() { //restore saved screen background of item if available @@ -627,6 +654,7 @@ void CCDraw::hide() //restore screen from backround layer frameBuffer->waitForIdle("CCDraw::hide()"); frameBuffer->RestoreScreen(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].pixbuf); + v_fbdata[i].is_painted = false; } } } @@ -635,9 +663,10 @@ void CCDraw::hide() } //erase or paint over rendered objects -void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius) +void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const int& fblayer_type /*fbdata_type*/) { for(size_t i =0; i< v_fbdata.size() ;i++){ + if (fblayer_type == CC_FBDATA_TYPES || v_fbdata[i].fbdata_type & fblayer_type){ #if 0 if (bg_color != COL_BACKGROUND_PLUS_0) #endif @@ -660,15 +689,23 @@ void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius) bg_color, r, corner_type); - + v_fbdata[i].is_painted = false; #if 0 else frameBuffer->paintBackgroundBoxRel(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy); #endif + } } - firstPaint = true; - is_painted = false; + if (fblayer_type == CC_FBDATA_TYPES){ + firstPaint = true; + is_painted = false; + } +} + +void CCDraw::killShadow(const fb_pixel_t& bg_color, const int& corner_radius) +{ + kill(bg_color, corner_radius, CC_FBDATA_TYPE_SHADOW_BOX); } bool CCDraw::doPaintBg(bool do_paint) @@ -683,8 +720,10 @@ bool CCDraw::doPaintBg(bool do_paint) void CCDraw::enableShadow(int mode, const int& shadow_width, bool force_paint) { - if (shadow != mode) + if (shadow != mode){ + killShadow(); shadow = mode; + } if (shadow != CC_SHADOW_OFF) if (shadow_width != -1) setShadowWidth(shadow_width); diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 152a6359b..92178deb6 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -131,8 +131,6 @@ class CCDraw : public COSDFader, public CComponentsSignals ///property: background gradient direction int cc_body_gradient_direction, cc_body_gradient_direction_old; - //TODO: move into layers - int old_gradient_color; ///property: background gradient 2nd color fb_pixel_t cc_body_gradient_2nd_col, cc_body_gradient_2nd_col_old; @@ -142,6 +140,8 @@ class CCDraw : public COSDFader, public CComponentsSignals ///sub: get gradient data evaluted with current parameters gradientData_t* getGradientData(); + bool cc_gradient_bg_cleanup; + ///rendering of framebuffer elements at once, ///elements are contained in v_fbdata, presumes added frambuffer elements with paintInit(), ///parameter do_save_bg=true, saves background of element to pixel buffer, this can be restore with hide() @@ -231,12 +231,12 @@ class CCDraw : public COSDFader, public CComponentsSignals ///set shadow color virtual void setColorShadow(fb_pixel_t color){col_shadow = color;} ///set all basic framebuffer element colors at once - ///Note: Possible color values are defined in "gui/color.h" and "gui/customcolor.h" + ///Note: Possible color values are defined in "gui/color.h" and "gui/color_custom.h" virtual void setColorAll(fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow){col_frame = color_frame; col_body = color_body; col_shadow = color_shadow;}; ///set corner types ///Possible corner types are defined in CFrameBuffer (see: driver/framebuffer.h) - ///Note: default values are given from settings + ///Note: default values are given from settings and corner radius sizes are predefined in /system/settings.h virtual void setCornerType(const int& type); ///set corner radius and type virtual void setCorner(const int& radius, const int& type = CORNER_ALL); @@ -254,6 +254,8 @@ class CCDraw : public COSDFader, public CComponentsSignals virtual void enableShadow(int mode = CC_SHADOW_ON, const int& shadow_width = -1, bool force_paint = false); ///switch shadow off virtual void disableShadow(){enableShadow(CC_SHADOW_OFF);} + ///return current schadow width + int getShadowWidth(){return shadow_w;} ///paint caching for body and shadow, see also cc_paint_cache NOTE: has no effect if paint_bg = false virtual void enablePaintCache(bool enable = true); @@ -312,9 +314,45 @@ class CCDraw : public COSDFader, public CComponentsSignals */ virtual void hide(); - ///erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known - ///from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND_PLUS_0 (empty background) - virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1); + /**Erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known + * from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND_PLUS_0 (empty background) + * + * @return void + * + * @param[in] bg_color optional, color, default color is current screen + * @param[in] corner_radius optional, defined corner radius, default radius is the current defined radius + * @param[in] fblayer_type optional, defines layer that to remove, default all layers (cc_fbdata_t) will remove + * possible layer types are: + * @li CC_FBDATA_TYPE_BGSCREEN, + * @li CC_FBDATA_TYPE_BOX, + * @li CC_FBDATA_TYPE_SHADOW_BOX, + * @li CC_FBDATA_TYPE_FRAME, + * @li CC_FBDATA_TYPE_BACKGROUND, + * @see + * cc_types.h + * gui/color.h + * driver/framebuffer.h + * @todo + * Shadow paint must be reworked, because dimensions of shadow containes not the real defined size. Parts of item are killed too. + * + */ + virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1, const int& fblayer_type = CC_FBDATA_TYPES); + + /**Erase shadow around rendered item. + * This is similar with the kill() member, but shadow will be handled only. + * + * @return void + * + * @param[in] bg_color optional, color, default color is current screen + * @param[in] corner_radius optional, defined corner radius, default radius is the current defined radius + * + * @see + * kill() + */ + virtual void killShadow(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1); + + virtual void enableGradientBgCleanUp(bool enable = true) { cc_gradient_bg_cleanup = enable; }; + virtual void disableGradientBgCleanUp(){ enableGradientBgCleanUp(false); }; }; #endif diff --git a/src/gui/components/cc_extra.h b/src/gui/components/cc_extra.h index f63b75a75..68147e1b0 100644 --- a/src/gui/components/cc_extra.h +++ b/src/gui/components/cc_extra.h @@ -61,9 +61,9 @@ * @li ColorGradient::light * @li ColorGradient::normal (default) * @li CFrameBuffer::advanced -* @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6 +* @param[in] color_frame color of frame around box, default = COL_FRAME_PLUS_0 * @param[in] shadow_mode enable/disable shadow behind box, default = CC_SHADOW_OFF -* @param[in] color_shadow color of shadow, default = COL_MENUCONTENTDARK_PLUS_0 +* @param[in] color_shadow color of shadow, default = COL_SHADOW_PLUS_0 * * @return * True if painted @@ -86,9 +86,9 @@ bool paintBoxRel( const int& x, const int& gradient_direction = CFrameBuffer::gradientVertical, const int& gradient_intensity = CColorGradient::normal, const int& w_frame = 0, - const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, + const fb_pixel_t& color_frame = COL_FRAME_PLUS_0, int shadow_mode = CC_SHADOW_OFF, - const fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0); + const fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0); /** Paint a box on screen. * @param[in] x position @@ -108,9 +108,9 @@ bool paintBoxRel( const int& x, * @li CORNER_LEFT * @li CORNER_BOTTOM * @li CORNER_ALL -* @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6 +* @param[in] color_frame color of frame around box, default = COL_FRAME_PLUS_0 * @param[in] shadow_mode enable/disable shadow behind box, default = CC_SHADOW_OFF -* @param[in] color_shadow color of shadow, default = COL_MENUCONTENTDARK_PLUS_0 +* @param[in] color_shadow color of shadow, default = COL_SHADOW_PLUS_0 * * @return * True if painted @@ -129,9 +129,9 @@ bool paintBoxRel0( const int& x, const int& radius = 0, const int& corner_type = CORNER_NONE, const int& w_frame = 0, - const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, + const fb_pixel_t& color_frame = COL_FRAME_PLUS_0, int shadow_mode = CC_SHADOW_OFF, - const fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0); + const fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0); /** Paint a text box on screen. * @param[in] std::string& text @@ -139,7 +139,7 @@ bool paintBoxRel0( const int& x, * @param[in] y position * @param[in] dx witdh * @param[in] dy height -* @param[in] *font pointer to font type object, default = NULL, sets g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL] as default font +* @param[in] *font pointer to font type object, default = NULL, sets g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO] as default font * @param[in] color_body color of box, default = COL_MENUCONTENT_PLUS_0 * @param[in] font_style font style * @li CComponentsText::FONT_STYLE_REGULAR (default) @@ -173,9 +173,9 @@ bool paintBoxRel0( const int& x, * @li ColorGradient::light * @li ColorGradient::normal (default) * @li CFrameBuffer::advanced -* @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6 +* @param[in] color_frame color of frame around box, default = COL_FRAME_PLUS_0 * @param[in] shadow_mode enable/disable shadow behind box, default = CC_SHADOW_OFF -* @param[in] color_shadow color of shadow, default = COL_MENUCONTENTDARK_PLUS_0 +* @param[in] color_shadow color of shadow, default = COL_SHADOW_PLUS_0 * * @return * True if painted @@ -204,9 +204,9 @@ bool paintTextBoxRel( const std::string& text, const int& gradient_sec_col = COL_MENUCONTENT_PLUS_0, const int& gradient_direction = CFrameBuffer::gradientVertical, const int& gradient_intensity = CColorGradient::normal, - const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, + const fb_pixel_t& color_frame = COL_FRAME_PLUS_0, int shadow_mode = CC_SHADOW_OFF, - const fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0); + const fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0); /** Paint an image on screen. * @param[in] std::string& full path or filename @@ -248,9 +248,9 @@ bool paintTextBoxRel( const std::string& text, * @li ColorGradient::light * @li ColorGradient::normal (default) * @li CFrameBuffer::advanced -* @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6 +* @param[in] color_frame color of frame around box, default = COL_FRAME_PLUS_0 * @param[in] shadow_mode enable/disable shadow behind box, default = CC_SHADOW_OFF -* @param[in] color_shadow color of shadow, default = COL_MENUCONTENTDARK_PLUS_0 +* @param[in] color_shadow color of shadow, default = COL_SHADOW_PLUS_0 * * @return * True if painted @@ -270,7 +270,7 @@ bool paintImage( const std::string& image_name, const fb_pixel_t& color_body = 0, const int& radius = 0, const int& corner_type = CORNER_NONE, - const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, + const fb_pixel_t& color_frame = COL_FRAME_PLUS_0, int shadow_mode = CC_SHADOW_OFF, - const fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0); + const fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0); #endif diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 82b214568..6b6dabf6a 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -52,7 +52,7 @@ CComponentsForm::CComponentsForm( const int x_pos, const int y_pos, const int w, cc_yr = y; shadow = shadow_mode; - shadow_w = SHADOW_OFFSET; + shadow_w = OFFSET_SHADOW; corner_rad = RADIUS_LARGE; corner_type = CORNER_ALL; cc_item_index = 0; diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 94c488350..2efc89bf5 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -66,9 +66,9 @@ class CComponentsForm : public CComponentsItem CComponentsForm( const int x_pos = 0, const int y_pos = 0, const int w = 800, const int h = 600, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); virtual ~CComponentsForm(); ///paints current form on screen, for paint a page use paintPage() diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 403418664..b5fd5ddef 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -29,6 +29,7 @@ #include #include +#include #include #include "cc_frm_button.h" @@ -100,9 +101,9 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const width = w; height = h; shadow = shadow_mode; - shadow_w = SHADOW_OFFSET; + shadow_w = shadow ? OFFSET_SHADOW/2 : 0; //buttons are mostly small elements, so these elements should have a reasonable shadow width - cc_body_gradient_enable = CC_COLGRAD_OFF/*g_settings.gradiant*/; //gradient is prepared for use but disabled at the moment till some other parts of gui parts are provide gradient + cc_body_gradient_enable = CC_COLGRAD_OFF/*g_settings.gradiant*/; //TODO: gradient is prepared for use but disabled at the moment till some other parts of gui parts are provide gradient setColBodyGradient(cc_body_gradient_enable/*CColorGradient::gradientLight2Dark*/, CFrameBuffer::gradientVertical, CColorGradient::light); col_frame = color_frame; col_body = cc_body_gradient_enable? COL_DARK_GRAY : color_body; @@ -110,12 +111,12 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const cc_item_enabled = enabled; cc_item_selected = selected; - fr_thickness = 3; + fr_thickness = 0; //TODO: parts of the GUI still don't use framed buttons append_x_offset = 6; append_y_offset = 0; - corner_rad = 0; + corner_rad = RADIUS_SMALL; - cc_btn_capt_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_ENABLED : COL_INFOBAR_SHADOW_TEXT; + cc_btn_capt_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_ENABLED : COL_MENUFOOT_TEXT; cc_btn_capt_disable_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_DISABLED : COL_MENUCONTENTINACTIVE_TEXT; cc_btn_icon_obj = NULL; cc_btn_capt_obj = NULL; @@ -127,8 +128,8 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const cc_btn_result = -1; cc_btn_alias = -1; - initParent(parent); initCCBtnItems(); + initParent(parent); } void CComponentsButton::initIcon() @@ -142,29 +143,29 @@ void CComponentsButton::initIcon() } //initialize icon object + string::size_type pos = cc_btn_icon.find("/", 0); + if (pos == string::npos) + cc_btn_icon = frameBuffer->getIconPath(cc_btn_icon); + if (cc_btn_icon_obj == NULL){ - int y_icon = 0; - - string::size_type pos = cc_btn_icon.find("/", 0); - if (pos == string::npos) - cc_btn_icon = frameBuffer->getIconBasePath() + "/" + cc_btn_icon + ".png"; - - cc_btn_icon_obj = new CComponentsPictureScalable(fr_thickness, y_icon, cc_btn_icon, this); + cc_btn_icon_obj = new CComponentsPictureScalable(fr_thickness, 0, cc_btn_icon, this); cc_btn_icon_obj->SetTransparent(CFrameBuffer::TM_BLACK); - int h_icon = cc_btn_icon_obj->getHeight(); - - //get required icon height - int h_max = height-2*fr_thickness; - - //get current icon dimensions - if (h_icon > h_max) - cc_btn_icon_obj->setHeight(h_max, true); - - y_icon = height/2 - cc_btn_icon_obj->getHeight()/2; - - cc_btn_icon_obj->setYPos(y_icon); cc_btn_icon_obj->doPaintBg(false); } + + int y_icon = cc_btn_icon_obj->getYPos(); + int h_icon = cc_btn_icon_obj->getHeight(); + + //get required icon height + int h_max = height-2*fr_thickness; + + //get current icon dimensions + if (h_icon > h_max) + cc_btn_icon_obj->setHeight(h_max, true); + + y_icon = h_max/2 - cc_btn_icon_obj->getHeight()/2; + + cc_btn_icon_obj->setYPos(y_icon); } void CComponentsButton::initCaption() @@ -192,7 +193,7 @@ void CComponentsButton::initCaption() x_cap += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() : 0; int w_cap = width - fr_thickness - append_x_offset - x_cap - fr_thickness; - int h_cap = height*80/100/* - 2*fr_thickness*/; + int h_cap = height*65/100 /*- 2*fr_thickness*/; /*NOTE: paint of centered text in y direction without y_offset @@ -237,6 +238,11 @@ void CComponentsButton::initCaption() x_icon += fr_thickness + append_x_offset; cc_btn_icon_obj->setXPos(x_icon); w_icon = cc_btn_icon_obj->getWidth(); + /*in case of dynamic changed height of caption or button opbject itself, + *we must ensure centered y position of icon object + */ + int y_icon = height/2 - cc_btn_icon_obj->getHeight()/2; + cc_btn_icon_obj->setYPos(y_icon); } if (cc_btn_capt_obj){ cc_btn_capt_obj->setXPos(x_icon + w_icon + append_x_offset); diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index d665ac6ce..1b9123b41 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -36,9 +36,9 @@ #include #include -#define COL_BUTTON_BODY COL_INFOBAR_SHADOW_PLUS_1 -#define COL_BUTTON_TEXT_ENABLED COL_BLACK -#define COL_BUTTON_TEXT_DISABLED COL_LIGHT_GRAY +#define COL_BUTTON_BODY COL_MENUFOOT_PLUS_0 +#define COL_BUTTON_TEXT_ENABLED COL_MENUCONTENTSELECTED_PLUS_0 +#define COL_BUTTON_TEXT_DISABLED COL_MENUCONTENTINACTIVE_PLUS_0 //! Sub class of CComponentsForm. /*! @@ -103,7 +103,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const neutrino_locale_t& caption_locale, @@ -112,7 +112,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const neutrino_locale_t& caption_locale, @@ -121,7 +121,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption, @@ -130,7 +130,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_DARK_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///set text color virtual void setButtonTextColor(fb_pixel_t text_color, fb_pixel_t text_color_disabled = COL_MENUCONTENTINACTIVE_TEXT){cc_btn_capt_col = text_color; cc_btn_capt_disable_col = text_color_disabled;} @@ -204,7 +204,7 @@ class CComponentsButtonRed : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_RED; @@ -215,7 +215,7 @@ class CComponentsButtonRed : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_RED, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_RED; @@ -235,7 +235,7 @@ class CComponentsButtonGreen : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_GREEN; @@ -246,7 +246,7 @@ class CComponentsButtonGreen : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_GREEN, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_GREEN; @@ -266,7 +266,7 @@ class CComponentsButtonYellow : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW; @@ -277,7 +277,7 @@ class CComponentsButtonYellow : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_YELLOW, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_YELLOW; @@ -297,7 +297,7 @@ class CComponentsButtonBlue : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_BLUE; @@ -308,7 +308,7 @@ class CComponentsButtonBlue : public CComponentsButton bool selected = false, bool enabled = true, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsButton(x_pos, y_pos, w, h, caption_locale, NEUTRINO_ICON_BUTTON_BLUE, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_BUTTON_BLUE; diff --git a/src/gui/components/cc_frm_chain.cpp b/src/gui/components/cc_frm_chain.cpp index c6e666fe1..4910e469c 100644 --- a/src/gui/components/cc_frm_chain.cpp +++ b/src/gui/components/cc_frm_chain.cpp @@ -81,17 +81,13 @@ void CComponentsFrmChain::setDirection(int direction) void CComponentsFrmChain::initChainItems() { - //init required dimensions, preferred are current width and height - int w_tmp = width; - int h_tmp = height; - //exit if no item available if (v_cc_items.empty()) return; //set new values - w_tmp = append_x_offset; - h_tmp = append_y_offset; + int w_tmp = append_x_offset; + int h_tmp = append_y_offset; for (size_t i= 0; i< v_cc_items.size(); i++){ int x_item = v_cc_items[i]->getXPos(); diff --git a/src/gui/components/cc_frm_chain.h b/src/gui/components/cc_frm_chain.h index 2a13a14be..a33f63ed8 100644 --- a/src/gui/components/cc_frm_chain.h +++ b/src/gui/components/cc_frm_chain.h @@ -67,9 +67,9 @@ class CComponentsFrmChain : public CComponentsForm int direction = CC_DIR_X, CComponentsForm* parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t& color_frame = COL_FRAME_PLUS_0, fb_pixel_t& color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0); // ~CComponentsFrmChain(); //inherited from CComponentsForm ///defines mode for arrangement direction of items, see also chn_direction diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index e20ef0916..82c048943 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -61,7 +61,7 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, y = y_pos; shadow = shadow_mode; - shadow_w = SHADOW_OFFSET; + shadow_w = OFFSET_SHADOW; col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; @@ -316,13 +316,15 @@ bool CComponentsFrmClock::startClock() } if (cl_timer == NULL){ - cl_timer = new CComponentsTimer(); - dprintf(DEBUG_INFO, "[CComponentsFrmClock] [%s] init slot...\n", __func__); - cl_timer->OnTimer.connect(cl_sl); + cl_timer = new CComponentsTimer(0); + if (cl_timer->OnTimer.empty()){ + dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); + cl_timer->OnTimer.connect(cl_sl); + } } - cl_timer->setTimerIntervall(cl_interval); + cl_timer->setTimerInterval(cl_interval); - if (cl_timer->isRun()) + if (cl_timer->startTimer()) return true; return false; @@ -344,11 +346,9 @@ bool CComponentsFrmClock::stopClock() return false; } -bool CComponentsFrmClock::Start(bool do_save_bg) +bool CComponentsFrmClock::Start() { if (startClock()) { - //ensure paint of segements on first paint - paint(do_save_bg); paintClock = true; return true; } @@ -420,7 +420,7 @@ void CComponentsFrmClock::setHeight(const int& h) int f_height = cl_font->getHeight(); if (h != f_height){ - dprintf(DEBUG_NORMAL, "\033[33m[CComponentsFrmClock]\t[%s - %d], font height is different than current height [%d], using [%d] ...\033[0m\n", __func__, __LINE__, h, f_height); + dprintf(DEBUG_DEBUG, "\033[33m[CComponentsFrmClock]\t[%s - %d], font height is different than current height [%d], using [%d] ...\033[0m\n", __func__, __LINE__, h, f_height); CCDraw::setHeight(f_height); }else CCDraw::setHeight(h); diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index 8f5fe47b4..c46dc0bad 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -102,9 +102,9 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen const int& interval_seconds = 1, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_LIGHT_GRAY, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int font_style = CNeutrinoFonts::FONT_STYLE_BOLD ); virtual ~CComponentsFrmClock(); @@ -134,9 +134,9 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen virtual void setClockFormat(const char* prformat_str, const char* secformat_str = NULL); ///start and paint ticking clock - virtual bool Start(bool do_save_bg = CC_SAVE_SCREEN_NO); + virtual bool Start(); ///same like Start() but for usage as simple call without return value - virtual void unblock(/*bool do_save_bg = CC_SAVE_SCREEN_NO*/){Start(cc_save_bg);} + virtual void unblock(){Start();} ///stop ticking clock, but don't hide, use kill() or hide() to remove from screen virtual bool Stop(); ///same like Stop() but for usage as simple call without return value @@ -147,7 +147,7 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen ///returns true, if clock is running virtual bool isRun() const {return cl_timer ? true : false;}; ///set refresh interval in seconds, default value=1 (=1 sec) - virtual void setClockIntervall(const int& seconds){cl_interval = seconds;}; + virtual void setClockInterval(const int& seconds){cl_interval = seconds;}; ///show clock on screen virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 97b798795..81354cc6c 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -36,18 +36,20 @@ using namespace std; CComponentsExtTextForm::CComponentsExtTextForm( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& label_text, const std::string& text, + Font* font_text, CComponentsForm* parent, int shadow_mode, fb_pixel_t label_color, fb_pixel_t text_color, fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) { - initVarExtTextForm(x_pos, y_pos, w, h, label_text, text, parent, shadow_mode, label_color, text_color, color_frame, color_body, color_shadow); + initVarExtTextForm(x_pos, y_pos, w, h, label_text, text, font_text, parent, shadow_mode, label_color, text_color, color_frame, color_body, color_shadow); initCCTextItems(); } CComponentsExtTextFormLocalized::CComponentsExtTextFormLocalized(const int& x_pos, const int& y_pos, const int& w, const int& h, const neutrino_locale_t& locale_label_text, const neutrino_locale_t& locale_text, + Font* font_text, CComponentsForm* parent, int shadow_mode, fb_pixel_t label_color, @@ -55,12 +57,14 @@ CComponentsExtTextFormLocalized::CComponentsExtTextFormLocalized(const int& x_po fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) : CComponentsExtTextForm( x_pos, y_pos, w, h, g_Locale->getText(locale_label_text), g_Locale->getText(locale_text), + font_text, parent, shadow_mode, label_color, text_color, color_frame, color_body, color_shadow){}; void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& label_text, const std::string& text, + Font* font_text, CComponentsForm* parent, int shadow_mode, fb_pixel_t label_color, @@ -92,7 +96,7 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p ccx_text_obj = NULL; corner_type = 0; int dx = 0, dy = DEF_HEIGHT; - ccx_font = *(CNeutrinoFonts::getInstance()->getDynFont(dx, dy)); + ccx_font = font_text == NULL ? *(CNeutrinoFonts::getInstance()->getDynFont(dx, dy)) : g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]; ccx_label_align = ccx_text_align = CTextBox::NO_AUTO_LINEBREAK; initParent(parent); diff --git a/src/gui/components/cc_frm_ext_text.h b/src/gui/components/cc_frm_ext_text.h index 0bf45f508..aa148599f 100644 --- a/src/gui/components/cc_frm_ext_text.h +++ b/src/gui/components/cc_frm_ext_text.h @@ -68,23 +68,27 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen ///initialize basic variables void initVarExtTextForm(const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& label_text, const std::string& text, + Font* font_text, CComponentsForm* parent, int shadow_mode, fb_pixel_t label_color, fb_pixel_t text_color, - fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow); + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow); public: ///advanced constructor for CComponentsExtTextForm, provides parameters for the most required properties, and caption as string CComponentsExtTextForm( const int& x_pos = 1, const int& y_pos = 1, const int& w = 300, const int& h = 48, const std::string& label_text = "", const std::string& text = "", + Font* font_text = NULL, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, fb_pixel_t label_color = COL_MENUCONTENTINACTIVE_TEXT, fb_pixel_t text_color = COL_MENUCONTENT_TEXT, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); // ~CComponentsExtTextForm(); //inherited from CComponentsForm ///assigns texts for label and text, parameter as string, parameter Font is optional for required font type, default font is dependently from defined item height @@ -131,6 +135,9 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen ///sets the text modes (mainly text alignment) to the label and text object, see /gui/widget/textbox.h for possible modes void setTextModes(const int& label_mode, const int& text_mode); + ///return current font + Font* getFont(){return ccx_font;} + ///paint this item/form void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; @@ -141,11 +148,14 @@ class CComponentsExtTextFormLocalized : public CComponentsExtTextForm ///advanced constructor for CComponentsExtTextForm, provides parameters for the most required properties, and caption as locales CComponentsExtTextFormLocalized(const int& x_pos = 1, const int& y_pos = 1, const int& w = 300, const int& h = 48, const neutrino_locale_t& locale_label_text = NONEXISTANT_LOCALE, const neutrino_locale_t& locale_text = NONEXISTANT_LOCALE, + Font* font_text = NULL, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, fb_pixel_t label_color = COL_MENUCONTENTINACTIVE_TEXT, fb_pixel_t text_color = COL_MENUCONTENT_TEXT, - 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); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); }; #endif diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 50a22da54..d823ba3f3 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -25,8 +25,8 @@ #include #endif -#include #include +#include #include "cc_frm_footer.h" #include @@ -37,7 +37,7 @@ using namespace std; CComponentsFooter::CComponentsFooter(CComponentsForm* parent) { //CComponentsFooter - initVarFooter(1, 1, 0, 0, 0, parent); + initVarFooter(1, 1, 0, 0, 0, parent, CC_SHADOW_OFF, COL_FRAME_PLUS_0, COL_MENUFOOT_PLUS_0, COL_SHADOW_PLUS_0); } CComponentsFooter::CComponentsFooter( const int& x_pos, const int& y_pos, const int& w, const int& h, @@ -69,7 +69,6 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const width = w == 0 ? frameBuffer->getScreenWidth(true) : w; //init footer height - cch_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; height = max(h, cch_font->getHeight()); shadow = shadow_mode; @@ -118,7 +117,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont //footer as primary container (in this context '=this') and the parent for the button label container (chain object), //button label container (chain object) itself is concurrent the parent object for button objects. if (chain == NULL){ - chain = new CComponentsFrmChain(x_chain, CC_CENTERED, w_chain, height, 0, CC_DIR_X, this); + chain = new CComponentsFrmChain(x_chain, CC_CENTERED, w_chain, height, 0, CC_DIR_X, this, CC_SHADOW_OFF, COL_FRAME_PLUS_0, col_body); chain->setCorner(this->corner_rad, this->corner_type); chain->doPaintBg(false); } @@ -134,19 +133,19 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont //generate and add button objects passed from button label content with default width to chain object. for (size_t i= 0; i< label_count; i++){ string txt = content[i].text; - string btn_name = string(content[i].button); + string icon_name = string(content[i].button); //ignore item, if no text and icon are defined; - if (txt.empty() && btn_name.empty()){ + if (txt.empty() && icon_name.empty()){ dprintf(DEBUG_INFO, "[CComponentsFooter] [%s - %d] ignore item [%zu], no icon and text defined!\n", __func__, __LINE__, i); continue; } - CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, height-height/(btn_contour ? 4 : 3), txt, btn_name); + CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, (btn_contour ? height-2*fr_thickness : height), txt, icon_name); btn->setButtonFont(ccf_btn_font); btn->doPaintBg(btn_contour); btn->enableFrame(btn_contour); - btn->setButtonTextColor(COL_INFOBAR_SHADOW_TEXT); + btn->setButtonTextColor(COL_MENUFOOT_TEXT); btn->setButtonEventMsg(content[i].btn_msg); btn->setButtonResult(content[i].btn_result); btn->setButtonAlias(content[i].btn_alias); @@ -154,13 +153,13 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont //set button frames to icon color, predefined for available color buttons if (btn_auto_frame_col){ fb_pixel_t f_col = btn->getColorFrame(); - if (btn_name == NEUTRINO_ICON_BUTTON_RED) + if (icon_name == NEUTRINO_ICON_BUTTON_RED) f_col = COL_DARK_RED; - if (btn_name == NEUTRINO_ICON_BUTTON_GREEN) + if (icon_name == NEUTRINO_ICON_BUTTON_GREEN) f_col = COL_DARK_GREEN; - if (btn_name == NEUTRINO_ICON_BUTTON_YELLOW) + if (icon_name == NEUTRINO_ICON_BUTTON_YELLOW) f_col = COL_OLIVE; - if (btn_name == NEUTRINO_ICON_BUTTON_BLUE) + if (icon_name == NEUTRINO_ICON_BUTTON_BLUE) f_col = COL_DARK_BLUE; btn->setColorFrame(f_col); } diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 9b30a7be8..bf9a16e2a 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -26,6 +26,7 @@ #include "cc_frm_header.h" #include "cc_frm_button.h" +#include #include //for compatibility with 'button_label' type //for 'button_label' type with string @@ -59,13 +60,13 @@ Missing parameters are filled with default values and must be assigned afterward class CComponentsFooter : public CComponentsHeader { private: - void initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, - const int& buttons = 0, - CComponentsForm *parent = NULL, - int shadow_mode = 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); + void initVarFooter( const int& x_pos, const int& y_pos, const int& w, const int& h, + const int& buttons, + CComponentsForm *parent, + int shadow_mode, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow ); ///show button frame and background, default false bool btn_contour; @@ -84,9 +85,9 @@ class CComponentsFooter : public CComponentsHeader const int& buttons = 0, CComponentsForm *parent = NULL, int shadow_mode = 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); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUFOOT_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///add button labels with string label type as content, count as size_t, chain_width as int, label width as int void setButtonLabels(const struct button_label_s * const content, const size_t& label_count, const int& chain_width = 0, const int& label_width = 0); @@ -135,7 +136,7 @@ class CComponentsFooter : public CComponentsHeader const struct button_label * const content, const int& label_width = 0, const int& context_buttons = 0, - Font* font = NULL, + Font* font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT], bool do_save_bg = CC_SAVE_SCREEN_NO ); diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 3f75e2fb2..7cc4cbfae 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -43,7 +43,7 @@ using namespace std; CComponentsHeader::CComponentsHeader(CComponentsForm* parent) { //CComponentsHeader - initVarHeader(1, 1, 0, 0, "", "", 0, parent); + initVarHeader(1, 1, 0, 0, "", "", 0, parent, CC_SHADOW_OFF, COL_FRAME_PLUS_0, COL_MENUHEAD_PLUS_0, COL_SHADOW_PLUS_0); } CComponentsHeader::CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, @@ -86,6 +86,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const fb_pixel_t color_shadow) { cc_item_type = CC_ITEMTYPE_FRM_HEADER; + clear(); cc_txt_save_screen = false; x = x_old = x_pos; y = y_old = y_pos; @@ -103,7 +104,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const col_frame = col_frame_old = color_frame; col_body = col_body_old = color_body; col_shadow = col_shadow_old = color_shadow; - col_body = col_body_old = COL_MENUHEAD_PLUS_0; + cc_body_gradient_enable = cc_body_gradient_enable_old = g_settings.theme.menu_Head_gradient; cc_body_gradient_direction = cc_body_gradient_direction_old = g_settings.theme.menu_Head_gradient_direction; cc_body_gradient_mode = CColorGradient::gradientLight2Dark; @@ -194,7 +195,7 @@ void CComponentsHeader::setIcon(const char* icon_name) void CComponentsHeader::setIcon(const std::string& icon_name) { - cch_icon_name = icon_name; + cch_icon_name = icon_name; initIcon(); } @@ -203,10 +204,8 @@ void CComponentsHeader::initIcon() //init cch_icon_obj only if an icon available if (cch_icon_name.empty()) { cch_icon_w = 0; - if (cch_icon_obj){ - delete cch_icon_obj; - cch_icon_obj = NULL; - } + if (cch_icon_obj) + removeCCItem(cch_icon_obj); return; } diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 45354ca2e..d30280da8 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -40,15 +40,15 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen { private: ///member: init genaral variables, parameters for mostly used properties - void initVarHeader( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, - const std::string& caption = "header", - const std::string& = "", - const int& buttons = 0, - CComponentsForm *parent = NULL, - int shadow_mode = 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); + void initVarHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, + const std::string& caption, + const std::string& icon_name, + const int& buttons, + CComponentsForm *parent, + int shadow_mode, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow); protected: ///object: icon object, see also setIcon() @@ -124,9 +124,9 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen const int& buttons = 0, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); virtual ~CComponentsHeader(); @@ -262,9 +262,9 @@ class CComponentsHeaderLocalized : public CComponentsHeader const int& buttons = 0, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); }; #endif diff --git a/src/gui/components/cc_frm_icons.h b/src/gui/components/cc_frm_icons.h index c48fdd3ca..5a32f62c0 100644 --- a/src/gui/components/cc_frm_icons.h +++ b/src/gui/components/cc_frm_icons.h @@ -37,9 +37,9 @@ class CComponentsIconForm : public CComponentsFrmChain const std::vector &v_icon_names, CComponentsForm* parent, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); public: CComponentsIconForm(CComponentsForm *parent = NULL); @@ -47,8 +47,9 @@ class CComponentsIconForm : public CComponentsFrmChain const std::vector &v_icon_names, CComponentsForm *parent = NULL, int shadow_mode = 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); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); // ~CComponentsIconForm(); //inherited from CComponentsForm void addIcon(const std::string& icon_name); diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 51cc88594..953892245 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -63,7 +63,9 @@ CComponentsScrollBar::CComponentsScrollBar( const int &x_pos, const int &y_pos, const int& count, CComponentsForm* parent, int shadow_mode, - fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow) :CComponentsFrmChain(x_pos, y_pos, w, h, NULL, CC_DIR_Y, parent, shadow_mode, color_frame, color_body, color_shadow) { initVarSbForm(count); @@ -80,9 +82,8 @@ void CComponentsScrollBar::initVarSbForm(const int& count) sb_up_obj = sb_down_obj = NULL; sb_segments_obj = NULL; - string ftype = ".png"; - sb_up_icon = frameBuffer->getIconBasePath() + "/" + NEUTRINO_ICON_BUTTON_TOP + ftype; - sb_down_icon = frameBuffer->getIconBasePath() + "/" + NEUTRINO_ICON_BUTTON_DOWN + ftype; + sb_up_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_TOP) ; + sb_down_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_DOWN); sb_segments_count = count; sb_mark_id = 0; @@ -110,6 +111,7 @@ void CComponentsScrollBar::initTopNaviIcon() //initialize icon object if (sb_up_obj == NULL){ sb_up_obj = new CComponentsPicture(CC_CENTERED, fr_thickness, sb_up_icon, this); + sb_up_obj->SetTransparent(CFrameBuffer::TM_BLACK); sb_up_obj->doPaintBg(false); } sb_up_obj->setWidth(width-2*fr_thickness); @@ -120,6 +122,7 @@ void CComponentsScrollBar::initBottomNaviIcon() //initialize icon object if (sb_down_obj == NULL){ sb_down_obj = new CComponentsPicture(CC_CENTERED, CC_APPEND, sb_down_icon, this); + sb_down_obj->SetTransparent(CFrameBuffer::TM_BLACK); sb_down_obj->doPaintBg(false); } sb_down_obj->setWidth(width-2*fr_thickness); @@ -129,7 +132,7 @@ void CComponentsScrollBar::initSegments() { //init dimensions for segments int w_seg = width - 4*fr_thickness; - int h_seg = height - (sb_segments_count-1)*append_y_offset; +//never read int h_seg = height - (sb_segments_count-1)*append_y_offset; //calculate height of segment container int h_seg_obj = height - 2*sb_up_obj->getHeight() - 3*append_y_offset; @@ -150,7 +153,7 @@ void CComponentsScrollBar::initSegments() //set y position of 1st segment and set height of segments int y_seg = 1+ append_y_offset; - h_seg = sb_segments_obj->getHeight()/sb_segments_count - append_y_offset; + int h_seg = sb_segments_obj->getHeight()/sb_segments_count - append_y_offset; //create and add segments to segment container for(u_int8_t i=0; isetColorBody(COL_MENUCONTENTSELECTED_PLUS_0); + item->setColorBody(COL_SCROLLBAR_ACTIVE); +#if 0 item->enableColBodyGradient(CC_COLGRAD_COL_A_2_COL_B); item->setColBodyGradient(CColorGradient::gradientDark2Light2Dark, CFrameBuffer::gradientHorizontal); +#endif } else{ - item->setColorBody(COL_MENUCONTENT_PLUS_1); + item->setColorBody(COL_SCROLLBAR_PASSIVE); +#if 0 item->disableColBodyGradient(); +#endif } } diff --git a/src/gui/components/cc_frm_scrollbar.h b/src/gui/components/cc_frm_scrollbar.h index fdf26a308..731e83df5 100644 --- a/src/gui/components/cc_frm_scrollbar.h +++ b/src/gui/components/cc_frm_scrollbar.h @@ -64,8 +64,9 @@ class CComponentsScrollBar : public CComponentsFrmChain const int& count = 1, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_3, - fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_SCROLLBAR_ACTIVE_PLUS_0, + fb_pixel_t color_body = COL_SCROLLBAR_PASSIVE_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); // ~CComponentsScrollBar(); //inherited from CComponentsForm ///set marked segment, 1st = 0, 2nd = 1 ... diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index 27061c8b8..8677bf3e3 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -29,7 +29,6 @@ #include #include -#include #include "cc_frm_signalbars.h" #include @@ -40,17 +39,38 @@ using namespace std; CSignalBar::CSignalBar(CComponentsForm *parent) { - initVarSigBar(); - sb_name = "SIG"; - - initDimensions(); - initSBItems(); - initParent(parent); + initVarSigBar(0, 0, 100, SB_MIN_HEIGHT, NULL, "SIG", parent); } CSignalBar::CSignalBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const string& sbname, CComponentsForm *parent) { - initVarSigBar(); + initVarSigBar(xpos, ypos, w, h, frontend_ref, sbname, parent); +} + +void CSignalBar::initVarSigBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const std::string& sbname, CComponentsForm *parent) +{ + cc_item_type = CC_ITEMTYPE_FRM_SIGNALBAR; + + corner_rad = 0; + corner_type = 0; + append_x_offset = 2; + append_y_offset = 2; + + sb_scale_height = -1; + dy_font = CNeutrinoFonts::getInstance(); + + sb_caption_color= COL_MENUCONTENT_TEXT; + sb_active_color = COL_PROGRESSBAR_ACTIVE_PLUS_0; + sb_passive_color= COL_PROGRESSBAR_PASSIVE_PLUS_0; + sb_val_mode = CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT; + + sb_lastsig = 0; + sb_signal = 0; + + sb_scale = NULL; + sb_vlbl = NULL; + sb_lbl = NULL; + sb_frontend = frontend_ref; x = xpos; y = ypos; @@ -91,6 +111,8 @@ void CSignalBar::initSBItems() //and set required color for text to name label CSignalBox *sbx = static_cast(cc_parent); sb_caption_color = sbx->getTextColor(); + sb_active_color = sbx->getActiveColor(); + sb_passive_color = sbx->getPassiveColor(); } //init items scale, value and name @@ -99,29 +121,6 @@ void CSignalBar::initSBItems() initSBarName(); } -void CSignalBar::initVarSigBar() -{ - corner_rad = 0; - corner_type = 0; - append_x_offset = 2; - append_y_offset = 2; - height = SB_MIN_HEIGHT; - cc_item_type = CC_ITEMTYPE_FRM_SIGNALBAR; - sb_scale_height = -1; - dy_font = CNeutrinoFonts::getInstance(); - - sb_caption_color= COL_INFOBAR_TEXT; - sb_val_mode = CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT; - - sb_lastsig = 0; - sb_signal = 0; - - sb_frontend = NULL; - sb_scale = NULL; - sb_vlbl = NULL; - sb_lbl = NULL; -} - void CSignalBar::initSBarScale() { //create scale object if required @@ -132,11 +131,11 @@ void CSignalBar::initSBarScale() int scale_y = (sb_item_height/2 - sb_scale_height/2); sb_scale->setDimensionsAll(fr_thickness, scale_y, sb_scale_width, sb_scale_height); sb_scale->setColorBody(col_body); - + sb_scale->setActiveColor(sb_active_color); + sb_scale->setPassiveColor(sb_passive_color); //add scale object to container if(!sb_scale->isAdded()) addCCItem(sb_scale); - } void CSignalBar::initSBarValue() @@ -144,7 +143,7 @@ void CSignalBar::initSBarValue() //create value label object with basic properties if (sb_vlbl == NULL){ sb_vlbl = new CComponentsLabel(); - sb_vlbl->setText(REF_PERCENT_TXT, sb_val_mode, sb_font); + sb_vlbl->setText("0%", sb_val_mode, sb_font); } sb_vlbl->doPaintBg(false); @@ -187,7 +186,6 @@ void CSignalBar::initSBarName() sb_lbl->setTextColor(sb_caption_color); sb_lbl->setColorBody(col_body); - //add name label object to container if (!sb_lbl->isAdded()) addCCItem(sb_lbl); @@ -197,7 +195,9 @@ void CSignalBar::initSBarName() void CSignalBar::Refresh() { //get current value from frontend - sb_signal = sb_frontend->getSignalStrength(); + sb_signal = 0; + if (sb_frontend) + sb_signal = sb_frontend->getSignalStrength(); //reinit items with current values initSBItems(); @@ -247,7 +247,9 @@ void CSignalBar::paint(bool do_save_bg) void CSignalNoiseRatioBar::Refresh() { //get current value from frontend - sb_signal = sb_frontend->getSignalNoiseRatio(); + sb_signal = 0; + if (sb_frontend) + sb_signal = sb_frontend->getSignalNoiseRatio(); //reinit items with current values initSBItems(); @@ -260,7 +262,7 @@ CSignalBox::CSignalBox(const int& xpos, const int& ypos, const int& w, const int initVarSigBox(); vertical = vert; - sbx_frontend = (frontend_ref == NULL) ? CFEManager::getInstance()->getLiveFE() : frontend_ref; + sbx_frontend = frontend_ref; x = xpos; y = ypos; width = w; @@ -296,7 +298,9 @@ void CSignalBox::initVarSigBox() height = 3* SB_MIN_HEIGHT; sbx_bar_height = height/2; sbx_bar_x = corner_rad; - sbx_caption_color = COL_INFOBAR_TEXT; + sbx_caption_color = COL_MENUCONTENT_TEXT; + sbx_active_color = COL_PROGRESSBAR_ACTIVE_PLUS_0; + sbx_passive_color = COL_PROGRESSBAR_PASSIVE_PLUS_0; vertical = true; } @@ -317,12 +321,18 @@ void CSignalBox::initSignalItems() sbar->setDimensionsAll(sbar_x, 1, sbar_w, sbar_h); sbar->setFrontEnd(sbx_frontend); + sbar->setTextColor(sbx_caption_color); + sbar->setActiveColor(sbx_active_color); + sbar->setPassiveColor(sbx_passive_color); sbar->setCorner(0); sbar->setScaleHeight(scale_h); sbar->enableTboxSaveScreen(cc_txt_save_screen); snrbar->setDimensionsAll(vertical ? sbar_x : CC_APPEND, vertical ? CC_APPEND : 1, sbar_w, sbar_h); snrbar->setFrontEnd(sbx_frontend); + snrbar->setTextColor(sbx_caption_color); + snrbar->setActiveColor(sbx_active_color); + snrbar->setPassiveColor(sbx_passive_color); snrbar->setCorner(0); snrbar->setScaleHeight(scale_h); snrbar->enableTboxSaveScreen(cc_txt_save_screen); @@ -343,10 +353,8 @@ void CSignalBox::paintScale() void CSignalBox::paint(bool do_save_bg) { //paint frame and body - if (!is_painted){ - initSignalItems(); + if (!is_painted) paintForm(do_save_bg); - } //paint current signal value paintScale(); diff --git a/src/gui/components/cc_frm_signalbars.h b/src/gui/components/cc_frm_signalbars.h index 216b221af..69ce46e09 100644 --- a/src/gui/components/cc_frm_signalbars.h +++ b/src/gui/components/cc_frm_signalbars.h @@ -69,6 +69,10 @@ class CSignalBar : public CComponentsForm, public CCTextScreen CNeutrinoFonts *dy_font; ///property: text color, see also setTextColor() fb_pixel_t sb_caption_color; + ///property: active color, see also setActiveColor() + fb_pixel_t sb_active_color; + ///property: passive color, see also setPassiveColor() + fb_pixel_t sb_passive_color; ///property: item top position int sb_item_top; @@ -91,7 +95,7 @@ class CSignalBar : public CComponentsForm, public CCTextScreen uint16_t sb_signal; ///initialize all needed basich attributes and objects - void initVarSigBar(); + void initVarSigBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const std::string& sb_name, CComponentsForm *parent); ///initianlize position and dimensions of signalbar container void initDimensions(); ///initialize scale object @@ -116,11 +120,15 @@ class CSignalBar : public CComponentsForm, public CCTextScreen CSignalBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const std::string& sb_name = "SIG", CComponentsForm *parent = NULL); ///assigns the current used frontend, simplified a tuner object, see frontend_c.h - virtual void setFrontEnd(CFrontend *frontend_ref){sb_frontend = frontend_ref;}; + virtual void setFrontEnd(CFrontend *frontend_ref){if (sb_frontend != frontend_ref) {sb_lastsig = 0; sb_frontend = frontend_ref;}} ///assigns font for caption virtual void setTextFont(Font* font_text){sb_font = font_text;}; ///sets the caption color, see also property 'sb_caption_color' virtual void setTextColor(const fb_pixel_t& caption_color){ sb_caption_color = caption_color;}; + ///set active color, see also property 'sb_active_color' + virtual void setActiveColor(const fb_pixel_t& active_color){ sb_active_color = active_color;}; + ///set passive color, see also property 'sb_passive_color' + virtual void setPassiveColor(const fb_pixel_t& passive_color){ sb_passive_color = passive_color;}; ///assigns the height of scale virtual void setScaleHeight(const int& scale_height){sb_scale_height = scale_height;}; ///assigns the width of scale @@ -277,6 +285,10 @@ class CSignalBox : public CComponentsForm, public CCTextScreen int sbx_bar_x; ///property: text color, see also setTextColor() fb_pixel_t sbx_caption_color; + ///property: active color, see also setActiveColor() + fb_pixel_t sbx_active_color; + ///property: passive color, see also setPassiveColor() + fb_pixel_t sbx_passive_color; // true if vertical arrangement, false if horizontal bool vertical; @@ -291,18 +303,31 @@ class CSignalBox : public CComponentsForm, public CCTextScreen public: ///class constructor for signal noise ratio. - CSignalBox(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref = NULL, const bool vertical = true, CComponentsForm *parent = NULL, const std::string& sig_name = "SIG", const std::string& snr_name = "SNR" ); + CSignalBox(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const bool vertical = true, CComponentsForm *parent = NULL, const std::string& sig_name = "SIG", const std::string& snr_name = "SNR" ); ///returns the signal object, type = CSignalBar* CSignalBar* getScaleObject(){return sbar;}; ///returns the signal noise ratio object, type = CSignalNoiseRatioBar* CSignalNoiseRatioBar* getLabelObject(){return snrbar;}; + ///assigns the current used frontend, simplified a tuner object, see frontend_c.h + void setFrontEnd(CFrontend *frontend_ref){sbx_frontend = frontend_ref;} + ///sets the caption color of signalbars, see also property 'sbx_caption_color' void setTextColor(const fb_pixel_t& caption_color){ sbx_caption_color = caption_color;}; ///get caption color of signalbars, see also property 'sbx_caption_color' fb_pixel_t getTextColor(){return sbx_caption_color;}; + ///set active color of signalbars, see also property 'sbx_active_color' + void setActiveColor(const fb_pixel_t& active_color){ sbx_active_color = active_color;}; + ///get active color of signalbars, see also property 'sbx_active_color' + fb_pixel_t getActiveColor(){return sbx_active_color;}; + + ///set passive color of signalbars, see also property 'sbx_passive_color' + void setPassiveColor(const fb_pixel_t& passive_color){ sbx_passive_color = passive_color;}; + ///get passive color of signalbars, see also property 'sbx_passive_color' + fb_pixel_t getPassiveColor(){return sbx_passive_color;}; + ///paint items void paint(bool do_save_bg); diff --git a/src/gui/components/cc_frm_slider.h b/src/gui/components/cc_frm_slider.h index 97e5d7e98..afa7a13bf 100644 --- a/src/gui/components/cc_frm_slider.h +++ b/src/gui/components/cc_frm_slider.h @@ -67,9 +67,9 @@ class CComponentsSlider : public CComponentsForm const int& max_value = 100, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t& color_frame = COL_FRAME_PLUS_0, fb_pixel_t& color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t& color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t& color_shadow = COL_SHADOW_PLUS_0); // ~CComponentsSlider(); //inherited from CComponentsForm void setValuePos(const int& current_value); diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 56df2802b..6d52dd36f 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2012-2014 Thilo Graf 'dbt' + Copyright (C) 2012-2016 Thilo Graf 'dbt' Copyright (C) 2012, Michael Liebmann 'micha-bbg' License: GPL @@ -133,7 +133,7 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const ccw_icon_name = iconname; dprintf(DEBUG_DEBUG, "[CComponentsWindow] [%s - %d] icon name = %s\n", __func__, __LINE__, ccw_icon_name.c_str()); - + paint_bg = false; shadow = shadow_mode; col_frame = color_frame; col_body = color_body; @@ -144,6 +144,7 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const ccw_right_sidebar= NULL; ccw_body = NULL; ccw_footer = NULL; + ccw_button_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]; ccw_buttons = 0; //no header buttons ccw_show_footer = true; @@ -152,9 +153,9 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const ccw_show_l_sideber = false; ccw_show_r_sideber = false; ccw_w_sidebar = 40; - ccw_col_head = COL_MENUCONTENT_PLUS_0; + ccw_col_head = COL_MENUHEAD_PLUS_0; ccw_col_head_text = COL_MENUHEAD_TEXT; - ccw_col_footer = COL_INFOBAR_SHADOW_PLUS_1; + ccw_col_footer = COL_MENUFOOT_PLUS_0; page_scroll_mode = PG_SCROLL_M_OFF; //permanent disabled here, only in body used! @@ -167,9 +168,10 @@ void CComponentsWindow::initWindowSize() if (cc_parent) return; - if (width == 0) + if (width == 0 || (unsigned)width > frameBuffer->getScreenWidth()) width = frameBuffer->getScreenWidth(); - if (height == 0) + + if (height == 0 || (unsigned)height > frameBuffer->getScreenHeight()) height = frameBuffer->getScreenHeight(); } @@ -214,11 +216,13 @@ void CComponentsWindow::initFooter() //add of footer item happens initCCWItems() //set footer properties if (ccw_footer){ - ccw_footer->setPos(0, CC_APPEND); + ccw_footer->setPos(0, cc_yr + height - ccw_footer->getHeight()- fr_thickness); ccw_footer->setWidth(width-2*fr_thickness); - ccw_footer->enableShadow(shadow); - ccw_footer->setCorner(corner_rad, CORNER_BOTTOM); + ccw_footer->enableShadow(false/*shadow*/); + ccw_footer->setCorner(corner_rad-fr_thickness, CORNER_BOTTOM); + ccw_footer->setButtonFont(ccw_button_font); ccw_footer->setColorBody(ccw_col_footer); + ccw_footer->doPaintBg(true); } } @@ -238,7 +242,7 @@ void CComponentsWindow::initLeftSideBar() int h_sbar = height - h_header - h_footer - 2*fr_thickness; int w_sbar = ccw_w_sidebar; ccw_left_sidebar->setDimensionsAll(0, CC_APPEND, w_sbar, h_sbar); - ccw_left_sidebar->doPaintBg(false); + ccw_left_sidebar->doPaintBg(true); } } @@ -258,7 +262,7 @@ void CComponentsWindow::initRightSideBar() int h_sbar = height - h_header - h_footer - 2*fr_thickness; int w_sbar = ccw_w_sidebar; ccw_right_sidebar->setDimensionsAll(width - w_sbar, CC_APPEND, w_sbar, h_sbar); - ccw_right_sidebar->doPaintBg(false); + ccw_right_sidebar->doPaintBg(true); } } @@ -269,25 +273,33 @@ void CComponentsWindow::initBody() //add of body item happens initCCWItems() //set body properties if (ccw_body){ - ccw_body->setCornerType(0); + ccw_body->setCorner(corner_rad-fr_thickness/2, CORNER_NONE); int h_footer = 0; int h_header = 0; int w_l_sidebar = 0; int w_r_sidebar = 0; - if (ccw_footer) + if (ccw_footer){ h_footer = ccw_footer->getHeight(); - if (ccw_head) + } + if (ccw_head){ h_header = ccw_head->getHeight(); + } if (ccw_left_sidebar) w_l_sidebar = ccw_left_sidebar->getWidth(); if (ccw_right_sidebar) w_r_sidebar = ccw_right_sidebar->getWidth(); - int h_body = height - h_header - h_footer - 2*fr_thickness; + int h_body = height - h_header - h_footer - fr_thickness; int x_body = w_l_sidebar; int w_body = width-2*fr_thickness - w_l_sidebar - w_r_sidebar; - ccw_body->setDimensionsAll(x_body, CC_APPEND, w_body, h_body); - ccw_body->doPaintBg(false); + ccw_body->setDimensionsAll(x_body, h_header, w_body, h_body); + ccw_body->doPaintBg(true); + + //handle corner behavior + if (!ccw_show_header) + ccw_body->setCornerType(CORNER_TOP); + if (!ccw_show_footer) + ccw_body->setCornerType(ccw_body->getCornerType() | CORNER_BOTTOM); } } @@ -338,15 +350,19 @@ void CComponentsWindow::initCCWItems() //init window body core initBody(); - //add header, body and footer items only one time + /*Add header and footer items as first and body as last item. + Render of items occurs in listed order. So it's better for performance while render of window. + This is something more advantageously because all other items are contained inside body. + So we avoid possible delay while rendering of base items. It looks better on screen. + */ if (ccw_head) if (!ccw_head->isAdded()) addCCItem(ccw_head); - if (!ccw_body->isAdded()) - addCCItem(ccw_body); if (ccw_footer) if (!ccw_footer->isAdded()) addCCItem(ccw_footer); + if (!ccw_body->isAdded()) + addCCItem(ccw_body); } void CComponentsWindow::enableSidebar(const int& sidbar_type) diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index da09fb342..212db8ef7 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Classes for generic GUI-related components. - Copyright (C) 2012, 2013, 2014, Thilo Graf 'dbt' + Copyright (C) 2012-2016, Thilo Graf 'dbt' License: GPL @@ -89,6 +89,8 @@ class CComponentsWindow : public CComponentsForm fb_pixel_t ccw_col_head_text; ///footer bg color fb_pixel_t ccw_col_footer; + ///footer button font + Font* ccw_button_font; ///initialze header object void initHeader(); @@ -108,9 +110,9 @@ class CComponentsWindow : public CComponentsForm const std::string& iconname = "", CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///initialize width and height void initWindowSize(); ///initialize position @@ -133,9 +135,9 @@ class CComponentsWindow : public CComponentsForm const std::string& iconname = "", CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///advanced constructor for CComponentsWindow, provides parameters for the most required properties, and caption from locales, x_pos or y_pos = 0 will center window CComponentsWindow( const int& x_pos, const int& y_pos, const int& w, const int& h, @@ -143,9 +145,9 @@ class CComponentsWindow : public CComponentsForm const std::string& iconname = "", CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///add item to body object, also usable is addCCItem() to add items to the windo object int addWindowItem(CComponentsItem* cc_Item); @@ -190,6 +192,8 @@ class CComponentsWindow : public CComponentsForm ///set background to footer void setWindowFooterColor(const fb_pixel_t& color){ccw_col_footer = color;} + ///set font for footer buttons + void setWindowFooterFont(Font* font_type){ccw_button_font = font_type;} ///returns a pointer to the internal left side bar object, use this to get access to left sidebar properities CComponentsFrmChain* getLeftSidebarObject(){return ccw_left_sidebar;}; @@ -227,17 +231,17 @@ class CComponentsWindowMax : public CComponentsWindow CComponentsWindowMax( const std::string& caption, const std::string& iconname = "", CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///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 = "", CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); }; #endif diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 4f9b242c4..2e2f10891 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -55,6 +55,8 @@ CComponentsItem::CComponentsItem(CComponentsForm* parent) void CComponentsItem::initParent(CComponentsForm* parent) { + if (cc_parent == parent) + return; cc_parent = parent; if (cc_parent) cc_parent->addCCItem(this); @@ -65,8 +67,10 @@ void CComponentsItem::initParent(CComponentsForm* parent) // If backround is not required, it's possible to override this with variable paint_bg=false, use doPaintBg(true/false) to set this! void CComponentsItem::paintInit(bool do_save_bg) { - if (hasChanges()) + if (hasChanges()){ clearFbData(); + is_painted = false; //force repaint if required + } if (v_fbdata.empty()){ int th = fr_thickness; @@ -109,8 +113,8 @@ void CComponentsItem::paintInit(bool do_save_bg) {true, CC_FBDATA_TYPE_BGSCREEN, ix, iy, width+isw/2, height+isw/2, 0, 0, 0, 0, NULL, NULL, NULL, false}, //buffered bg {sh_r, CC_FBDATA_TYPE_SHADOW_BOX, ixsr, iy+isw/2, isw, height, col_shadow, corner_rad, corner_type & CORNER_RIGHT, 0, NULL, NULL, NULL, false}, //shadow right {sh_b, CC_FBDATA_TYPE_SHADOW_BOX, ix+isw/2, iysb, width, isw, col_shadow, corner_rad, corner_type & CORNER_BOTTOM, 0, NULL, NULL, NULL, false}, //shadow bottom - {true, CC_FBDATA_TYPE_FRAME, ix, iy, width, height, col_frame_cur, corner_rad, corner_type, th, NULL, NULL, NULL, false}, //frame {true, CC_FBDATA_TYPE_BOX, ix+th, iy+th, width-2*th, height-2*th, col_body, rad, corner_type, 0, NULL, NULL, NULL, false}, //body + {true, CC_FBDATA_TYPE_FRAME, ix, iy, width, height, col_frame_cur, corner_rad, corner_type, th, NULL, NULL, NULL, false} //frame }; for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++) { @@ -125,15 +129,15 @@ void CComponentsItem::paintInit(bool do_save_bg) } //erase or paint over rendered objects -void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent) +void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent, const int& fblayer_type) { if(cc_parent == NULL){ - CComponents::kill(bg_color, this->corner_rad); + CComponents::kill(bg_color, this->corner_rad, fblayer_type); }else{ if(ignore_parent) - CComponents::kill(bg_color, this->corner_rad); + CComponents::kill(bg_color, this->corner_rad, fblayer_type); else - CComponents::kill(cc_parent->getColorBody(), cc_parent->getCornerRadius()); + CComponents::kill(cc_parent->getColorBody(), cc_parent->getCornerRadius(), fblayer_type); } } @@ -143,8 +147,8 @@ void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent) void CComponentsItem::syncSysColors() { col_body = COL_MENUCONTENT_PLUS_0; - col_shadow = COL_MENUCONTENTDARK_PLUS_0; - col_frame = COL_MENUCONTENT_PLUS_6; + col_shadow = COL_SHADOW_PLUS_0; + col_frame = COL_FRAME_PLUS_0; } //returns current item element type, if no available, return -1 as unknown type diff --git a/src/gui/components/cc_item.h b/src/gui/components/cc_item.h index a3a713429..30fbf0442 100644 --- a/src/gui/components/cc_item.h +++ b/src/gui/components/cc_item.h @@ -79,10 +79,26 @@ class CComponentsItem : public CComponents ///set or unset focus of item, stand alone items without parent have always set focus to true, inside of a parent form object, always the last added item has focus virtual void setFocus(bool focus); - ///erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known - ///from CFrameBuffer but with possiblity to define color, default color is 0 (empty background) - ///NOTE: Items with parent binding use the parent background color as default! Set parameter 'ignore_parent=true' to ignore parent background color! - virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, bool ignore_parent = false); + /**Erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known + * from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND_PLUS_0 (empty background) + * + * @return void + * + * @param[in] bg_color optional, color, default color is current screen + * @param[in] ignore_parent optional, default = false, defines the behavior inside a form, if item is embedded current background color is used instead blank screen + * @param[in] fblayer_type optional, defines layer that to remove, default all layers (cc_fbdata_t) will remove + * possible layer types are: + * @li CC_FBDATA_TYPE_BGSCREEN, + * @li CC_FBDATA_TYPE_BOX, + * @li CC_FBDATA_TYPE_SHADOW_BOX, + * @li CC_FBDATA_TYPE_FRAME, + * @li CC_FBDATA_TYPE_BACKGROUND, + * @see + * cc_types.h + * gui/color.h + * driver/framebuffer.h + */ + virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, bool ignore_parent = false, const int& fblayer_type = CC_FBDATA_TYPES); ///get the current item type, see attribute cc_item_type above virtual int getItemType(); diff --git a/src/gui/components/cc_item_infobox.cpp b/src/gui/components/cc_item_infobox.cpp index 01a03fba3..4d3f785e9 100644 --- a/src/gui/components/cc_item_infobox.cpp +++ b/src/gui/components/cc_item_infobox.cpp @@ -57,6 +57,7 @@ CComponentsInfoBox::CComponentsInfoBox( const int& x_pos, height = h; shadow = shadow_mode; col_frame = color_frame; + cc_enable_frame = true; col_body = color_body; col_shadow = color_shadow; @@ -69,7 +70,7 @@ CComponentsInfoBox::CComponentsInfoBox( const int& x_pos, pic = NULL; cctext = NULL; pic_name = ""; - x_offset = 10; + x_offset = OFFSET_INNER_MID; initParent(parent); } @@ -154,7 +155,7 @@ void CComponentsInfoBox::paint(bool do_save_bg) //calculate vars for x-position and dimensions int tx = x_offset + x_text + pic_w; - int tw = width - x_offset - pic_w - 2*fr_thickness; + int tw = width - 2*x_offset - pic_w - 2*fr_thickness; int th = height-2*fr_thickness; cctext->setDimensionsAll(tx, y_text, tw, th); diff --git a/src/gui/components/cc_item_infobox.h b/src/gui/components/cc_item_infobox.h index 189dbb42c..d8f2345c5 100644 --- a/src/gui/components/cc_item_infobox.h +++ b/src/gui/components/cc_item_infobox.h @@ -41,7 +41,6 @@ InfoBox has been originally intended for displaying text information or menue hi but is also usable like each other CCItems. */ -#define INFO_BOX_Y_OFFSET 2 class CComponentsInfoBox : public CComponentsText { private: @@ -72,9 +71,9 @@ class CComponentsInfoBox : public CComponentsText CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_text = COL_MENUCONTENT_TEXT, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ~CComponentsInfoBox(); diff --git a/src/gui/components/cc_item_picture.cpp b/src/gui/components/cc_item_picture.cpp index c5ede3520..1fd538ac5 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -33,6 +33,7 @@ #include "cc_item_picture.h" #include #include +#include extern CPictureViewer * g_PicViewer; @@ -71,13 +72,13 @@ void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, cc_item_type = CC_ITEMTYPE_PICTURE; //CComponents - x = x_pos; - y = y_pos; - width = dx = w; - height = dy = h; + x = x_old = x_pos; + y = y_old = y_pos; + width = dx = dxc = w; + height = dy = dyc = h; pic_name = pic_name_old = image_name; shadow = shadow_mode; - shadow_w = SHADOW_OFFSET; + shadow_w = OFFSET_SHADOW; col_frame = color_frame; col_body = color_background; col_shadow = color_shadow; @@ -90,7 +91,7 @@ void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, cc_paint_cache = false; //bg keep_dx_aspect = false; keep_dy_aspect = false; - + need_init = true; initCCItem(); initParent(parent); } @@ -98,6 +99,7 @@ void CComponentsPicture::init( const int &x_pos, const int &y_pos, const int &w, void CComponentsPicture::clearCache() { if (image_cache){ + dprintf(DEBUG_DEBUG, "\033[32m[CComponentsPicture] %s - %d: clean up image cache %s\033[0m\n", __func__, __LINE__, pic_name.c_str()); delete[] image_cache; image_cache = NULL; } @@ -107,6 +109,9 @@ void CComponentsPicture::setPicture(const std::string& picture_name) { if (pic_name == picture_name) return; + width = dx = dxc = 0; + height = dy = dyc = 0; + need_init = true; clearCache(); pic_name = picture_name; initCCItem(); @@ -122,7 +127,10 @@ void CComponentsPicture::setPicture(const char* picture_name) void CComponentsPicture::setWidth(const int& w, bool keep_aspect) { - CComponentsItem::setWidth(w), + CComponentsItem::setWidth(w); + if (w == width && keep_aspect == keep_dy_aspect) + return; + need_init = true; do_scale = true; keep_dy_aspect = keep_aspect; initCCItem(); @@ -130,7 +138,10 @@ void CComponentsPicture::setWidth(const int& w, bool keep_aspect) void CComponentsPicture::setHeight(const int& h, bool keep_aspect) { - CComponentsItem::setHeight(h), + CComponentsItem::setHeight(h); + if (h == height && keep_aspect == keep_dx_aspect) + return; + need_init = true; do_scale = true; keep_dx_aspect = keep_aspect; initCCItem(); @@ -138,10 +149,12 @@ void CComponentsPicture::setHeight(const int& h, bool keep_aspect) void CComponentsPicture::initCCItem() { - if (pic_name.empty()){ - dprintf(DEBUG_INFO, "[CComponentsPicture] %s - %d : no image file assigned...\n", __func__, __LINE__); + if (pic_name.empty() || !need_init){ + dprintf(DEBUG_DEBUG, "[CComponentsPicture] %s - %d : no init required [file: %s] [need init: %d]...\n", __func__, __LINE__, pic_name.c_str(), need_init); return; } + //reset condition for new init + need_init = false; //check for path or name, set icon or image with full path, has no path, then use as icon and disble scale mode string::size_type pos = pic_name.find("/", 0); @@ -153,8 +166,13 @@ void CComponentsPicture::initCCItem() //use image/icon size as object dimension values frameBuffer->getIconSize(pic_name.c_str(), &width, &height); - /*if we have an image with full path => fallback to pv methode. + /* frameBuffer->getIconSize() normally evaluates only icon names, no paths. + * So it is possible that we have wrong dimension values. + * So we fall back to picture viewer methode. * That's always a cramp, why we don't have an unified solution in render classes? + * Anyway...this is only a workaround, otherwies it is possible, that dimension values are wrong or = 0 and + * this could lead to problems if external items are reliant on these values, + * and in worst case, no image would be painted! */ if (width == 0 || height == 0){ int dx_tmp, dy_tmp; @@ -164,43 +182,57 @@ void CComponentsPicture::initCCItem() if (height == 0) height = dy_tmp; } + /* leave init methode here if we in no scale mode + * otherwise goto next step! + */ return; } - else{ //initialized scaled size - //first get real image dimensions + else{ /* Here we are in scale mode + * first check current item dimensions (width/height) and for different values and + * check internal dimension values (dx/dy) and ensure that values are >0 + * real image size + */ if ((dx != width || dy != height) || (dx == 0 || dy == 0)) g_PicViewer->getSize(pic_name.c_str(), &dx, &dy); } - //ensure filled inital values + /* on next step check item dimensions (width/height) for 0 values + * and fill with current internal (dx/dy) dimension values. + * values <= 0 are not allowed + */ if (width == 0) width = dx; if (height == 0) height = dy; - //check dimensions, leave if dimensions are equal + /* on next step, check dimensions and + * leave if dimensions are equal + */ if (width == dx && height == dy) return; -#if 0 - //clean up possible cache on changed dimensions - clearCache(); -#endif - //temporarily vars - int w_2scale = width; - int h_2scale = height; - //resize image and set current dimensions - g_PicViewer->rescaleImageDimensions(&width, &height, w_2scale, h_2scale); - - //handle aspect ratio - if (keep_dx_aspect){ + /* finally handle scale behavior + * This evaluates the parameters given + * by setters setWidth/setHeight + * these steps are required to assign the current image dimensions to item dimensions + */ + if (keep_dx_aspect && dy){ float h_ratio = float(height)*100/(float)dy; width = int(h_ratio*(float)dx/100); +#ifdef BOXMODEL_APOLLO + if (do_scale && (width > 10 || height > 10)) + width = GetWidth4FB_HW_ACC(x+fr_thickness, width-2*fr_thickness)+2*fr_thickness; +#endif } - if (keep_dy_aspect){ + if (keep_dy_aspect & dx){ float w_ratio = float(width)*100/(float)dx; height = int(w_ratio*(float)dy/100); } + + //resize image and apply current assigned scale values + int w_2scale = width; + int h_2scale = height; + g_PicViewer->rescaleImageDimensions(&width, &height, w_2scale, h_2scale); } void CComponentsPicture::initPosition(int *x_position, int *y_position) @@ -217,7 +249,6 @@ void CComponentsPicture::initPosition(int *x_position, int *y_position) void CComponentsPicture::getSize(int* width_image, int *height_image) { - initCCItem(); *width_image = width; *height_image = height; } @@ -249,13 +280,15 @@ void CComponentsPicture::paintPicture() initPosition(&x_pic, &y_pic); x_pic += fr_thickness; y_pic += fr_thickness; + initCCItem(); - if (pic_name.empty()) + if (pic_name.empty()){ + clearCache(); return; + } if (cc_allow_paint){ - dprintf(DEBUG_INFO, "[CComponentsPicture] %s: paint image file: pic_name=%s\n", __func__, pic_name.c_str()); if (image_cache == NULL){ frameBuffer->SetTransparent(image_transparent); if (do_scale) @@ -263,10 +296,15 @@ void CComponentsPicture::paintPicture() else is_image_painted = frameBuffer->paintIcon(pic_name, x_pic, y_pic, height, 1, do_paint, paint_bg, col_body); frameBuffer->SetTransparentDefault(); - if (enable_cache) - image_cache = getScreen(x_pic, y_pic, width, height); + if (enable_cache && do_scale){ + dprintf(DEBUG_DEBUG, "\033[31m[CComponentsPicture] %s - %d: create cached image from pic_name=%s\033[0m\n", __func__, __LINE__, pic_name.c_str()); + dxc = width-2*fr_thickness; + dyc = height-2*fr_thickness; + image_cache = getScreen(x_pic, y_pic, dxc, dyc); + } }else{ - frameBuffer->RestoreScreen(x_pic, y_pic, width, height, image_cache); + dprintf(DEBUG_DEBUG, "\033[36m[CComponentsPicture] %s - %d: paint cached image from pic_name=%s\033[0m\n", __func__, __LINE__, pic_name.c_str()); + frameBuffer->RestoreScreen(x_pic, y_pic, dxc, dyc, image_cache); } } @@ -340,6 +378,9 @@ void CComponentsChannelLogo::init(const uint64_t& channelId, const std::string& } void CComponentsChannelLogo::setAltLogo(const std::string& picture_name) { + if (alt_pic_name == picture_name) + return; + need_init = true; alt_pic_name = picture_name; channel_id = 0; channel_name = ""; @@ -358,8 +399,15 @@ void CComponentsChannelLogo::setAltLogo(const char* picture_name) void CComponentsChannelLogo::setChannel(const uint64_t& channelId, const std::string& channelName) { - channel_id = channelId; + need_init = true; + if (channelId || !channelName.empty()){ + if ((channel_id == channelId) && (channel_name == channelName)) + need_init = false; + } + + channel_id = channelId; channel_name = channelName; + int dummy; has_logo = g_PicViewer->GetLogoName(channel_id, channel_name, pic_name, &dummy, &dummy); diff --git a/src/gui/components/cc_item_picture.h b/src/gui/components/cc_item_picture.h index a1865bcef..3aab7e11b 100644 --- a/src/gui/components/cc_item_picture.h +++ b/src/gui/components/cc_item_picture.h @@ -58,6 +58,9 @@ class CComponentsPicture : public CComponentsItem ///current original image dimensions int dx, dy; + ///cached image dimensions + int dxc, dyc; + ///property: name of image (without extensionn) full path to image (with extension), icon names to find in /widget/icons.h, icons will paint never scaled std::string pic_name, pic_name_old; @@ -75,6 +78,8 @@ class CComponentsPicture : public CComponentsItem ///sets internal option for keeping aspect, see also setHeight(), setWidth(), default value = false bool keep_dx_aspect; bool keep_dy_aspect; + ///helper: indicate for reinit + bool need_init; void init( const int &x_pos, const int &y_pos, const int &w, const int &h, const std::string& image_name, @@ -107,9 +112,9 @@ class CComponentsPicture : public CComponentsItem const std::string& image_name, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_NONE); /*! @@ -123,19 +128,21 @@ class CComponentsPicture : public CComponentsItem const std::string& image_name, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_NONE); virtual~CComponentsPicture() { - delete[]image_cache; + clearCache(); } ///sets an image name (unscaled icons only), full image path or url to an image file virtual void setPicture(const std::string& picture_name); ///sets an image name (unscaled icons only), full image path or url to an image file virtual void setPicture(const char* picture_name); + ///returns current assigned image name + std::string getPictureName(){return pic_name;} ///handle image size virtual void getSize(int* width_image, int *height_image); @@ -149,9 +156,9 @@ class CComponentsPicture : public CComponentsItem ///set height of object and image, value >0 causes scale of image, parameter keep_aspect = true causes scaling of width with same aspect, , default = false virtual void setHeight(const int& h, bool keep_aspect = false); ///set width of object and image related to current screen size, see also CComponentsItem::setWidthP(), parameter as uint8_t - virtual void setWidthP(const uint8_t& w_percent){CComponentsItem::setWidthP(w_percent), do_scale = true; initCCItem();} + virtual void setWidthP(const uint8_t& w_percent){CComponentsItem::setWidthP(w_percent), do_scale = true; need_init = hasChanges(); initCCItem();} ///set height of object and image related to current screen size, see also CComponentsItem::setHeightP(), parameter as uint8_t - virtual void setHeightP(const uint8_t& h_percent){CComponentsItem::setHeightP(h_percent), do_scale = true; initCCItem();} + virtual void setHeightP(const uint8_t& h_percent){CComponentsItem::setHeightP(h_percent), do_scale = true; need_init = hasChanges(); initCCItem();} ///return paint mode of internal image, true=image was painted, please do not to confuse with isPainted()! isPainted() is related to item itself. virtual inline bool isPicPainted(){return is_image_painted;}; @@ -189,9 +196,9 @@ class CComponentsPictureScalable : public CComponentsPicture const std::string& image_name, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_NONE) : CComponentsPicture(x_pos, y_pos, 0, 0, image_name, parent, shadow_mode, color_frame, color_background, color_shadow, transparent){}; }; @@ -224,9 +231,9 @@ class CComponentsChannelLogo : public CComponentsPicture const uint64_t& channelId =0, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_BLACK); /*! @@ -240,13 +247,14 @@ class CComponentsChannelLogo : public CComponentsPicture const uint64_t& channelId =0, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_BLACK); ///set channel id and/or channel name, NOTE: channel name is prefered void setChannel(const uint64_t& channelId, const std::string& channelName); + uint64_t getChannelID(){return channel_id;} ///set an alternate logo if no logo is available NOTE: value of has_logo will set to true void setAltLogo(const std::string& picture_name); @@ -272,9 +280,9 @@ class CComponentsChannelLogoScalable : public CComponentsChannelLogo const uint64_t& channelId =0, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_BLACK) : CComponentsChannelLogo(x_pos, y_pos, 0, 0, channelName, channelId, parent, shadow_mode, color_frame, color_background, color_shadow, transparent){}; }; diff --git a/src/gui/components/cc_item_progressbar.cpp b/src/gui/components/cc_item_progressbar.cpp index e11641e16..60ae59e6f 100644 --- a/src/gui/components/cc_item_progressbar.cpp +++ b/src/gui/components/cc_item_progressbar.cpp @@ -197,6 +197,7 @@ void CProgressBarCache::pbcClear() free((*it)->pbc_active); if ((*it)->pbc_passive) free((*it)->pbc_passive); + delete (*it); } pbCache.clear(); } @@ -465,7 +466,7 @@ void CProgressBar::paintProgress(bool do_save_bg) bool pb_invert = (pb_type == PB_REDRIGHT) || ((pb_type == PB_TIMESCALE) && g_settings.progressbar_timescale_invert); if (cc_allow_paint){ - if (pb_active_width != pb_last_width) { + if (!is_painted || (pb_active_width != pb_last_width)) { CProgressBarCache *pbc = CProgressBarCache::pbcLookup(pb_height, pb_max_width, pb_active_col, pb_passive_col, *pb_design, pb_invert, *pb_gradient, pb_red, pb_yellow, pb_green); if (pbc) pbc->pbcPaint(pb_x, pb_y, pb_active_width, pb_passive_width); diff --git a/src/gui/components/cc_item_progressbar.h b/src/gui/components/cc_item_progressbar.h index c3bcb40b5..c346d600e 100644 --- a/src/gui/components/cc_item_progressbar.h +++ b/src/gui/components/cc_item_progressbar.h @@ -100,9 +100,9 @@ class CProgressBar : public CComponentsItem const int h = -1, fb_pixel_t color_frame = 0, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, - const fb_pixel_t active_col = COL_INFOBAR_PLUS_7, - const fb_pixel_t passive_col = COL_INFOBAR_PLUS_3, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, + const fb_pixel_t active_col = COL_PROGRESSBAR_ACTIVE_PLUS_0, + const fb_pixel_t passive_col = COL_PROGRESSBAR_PASSIVE_PLUS_0, const int R = 40, const int G = 100, const int Y = 70, diff --git a/src/gui/components/cc_item_shapes.cpp b/src/gui/components/cc_item_shapes.cpp index d6c623b29..dffaca928 100644 --- a/src/gui/components/cc_item_shapes.cpp +++ b/src/gui/components/cc_item_shapes.cpp @@ -48,7 +48,7 @@ CComponentsShapeSquare::CComponentsShapeSquare( const int x_pos, const int y_pos width = width_old = w; height = height_old = h; shadow = shadow_mode; - shadow_w = SHADOW_OFFSET; + shadow_w = OFFSET_SHADOW; col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; @@ -76,7 +76,7 @@ CComponentsShapeCircle::CComponentsShapeCircle( int x_pos, int y_pos, int diam, y = y_pos; //width = height = d = diam; shadow = shadow_mode; - shadow_w = SHADOW_OFFSET; + shadow_w = OFFSET_SHADOW; col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; diff --git a/src/gui/components/cc_item_shapes.h b/src/gui/components/cc_item_shapes.h index 47e3ecf14..a1a48d97c 100644 --- a/src/gui/components/cc_item_shapes.h +++ b/src/gui/components/cc_item_shapes.h @@ -47,7 +47,9 @@ class CComponentsShapeCircle : public CComponentsItem CComponentsShapeCircle( const int x_pos, const int y_pos, const int diam, CComponentsForm *parent = NULL, int shadow_mode = 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); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///set property: diam inline void setDiam(const int& diam){d=width=height=diam, corner_rad=d/2;}; @@ -64,7 +66,9 @@ class CComponentsShapeSquare : public CComponentsItem CComponentsShapeSquare( const int x_pos, const int y_pos, const int w, const int h, CComponentsForm *parent = NULL, int shadow_mode = 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); + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index c554f1123..c851a49fa 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -88,8 +88,8 @@ void CComponentsText::initVarText( const int x_pos, const int y_pos, const int w iX = x = x_old = x_pos; //TODO: equalize inhertited member names iY = y = y_old = y_pos; - iWidth=width = w; - iHeight=height = h; + iWidth = width_old = width = w; + iHeight = height_old = height = h; /* we need a minimal borderwith of 1px because the edge-smoothing (or fontrenderer?) otherwise will paint single pixels outside the @@ -118,7 +118,7 @@ void CComponentsText::initCCText() { //set default font, if is no font definied if (ct_font == NULL) - ct_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; + ct_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]; //define height from font size height = max(height, ct_font->getHeight()); @@ -126,15 +126,18 @@ void CComponentsText::initCCText() //init CBox dimensions iWidth = width-2*fr_thickness; iHeight = height-2*fr_thickness; - iX = x + fr_thickness; - iY = y + fr_thickness; //using of real x/y values to paint textbox if this text object is bound in a parent form if (cc_parent){ int th_parent_fr = cc_parent->getFrameThickness(); iX = cc_xr + (x <= th_parent_fr ? th_parent_fr : 0); iY = cc_yr - (y <= th_parent_fr ? th_parent_fr : 0); + }else{ + iX = x; + iY = y; } + iX += fr_thickness; + iY += fr_thickness; //init textbox if (ct_textbox == NULL) @@ -177,7 +180,7 @@ void CComponentsText::initCCText() //ensure clean font rendering on transparency background ct_textbox->setTextRenderModeFullBG(!paint_bg); - dprintf(DEBUG_DEBUG, "[CComponentsText] [%s - %d] init text: %s [x %d, y %d, w %d, h %d]\n", __func__, __LINE__, ct_text.c_str(), this->iX, this->iY, this->iWidth, this->iHeight); +// dprintf(DEBUG_NORMAL, "[CComponentsText] [%s - %d] init text: %s [x %d x_old %d, y %d y_old %d, w %d, h %d]\n", __func__, __LINE__, ct_text.c_str(), this->x, x_old, this->y, y_old, this->iWidth, this->iHeight); } void CComponentsText::clearCCText() @@ -283,22 +286,26 @@ void CComponentsText::hide() void CComponentsText::setXPos(const int& xpos) { - iX = x = xpos; + CCDraw::setXPos(xpos); + iX = x; } void CComponentsText::setYPos(const int& ypos) { - iY = y = ypos; + CCDraw::setYPos(ypos); + iY = y; } void CComponentsText::setHeight(const int& h) { - iHeight = height = h; + CCDraw::setHeight(h); + iHeight = height; } void CComponentsText::setWidth(const int& w) { - iWidth = width = w; + CCDraw::setWidth(w); + iWidth = width; } //small helper to remove excessiv linbreaks diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index 5bf297212..dd26f02ad 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -86,7 +86,10 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox const int& font_style, CComponentsForm *parent, int shadow_mode, - fb_pixel_t color_text, fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow); + fb_pixel_t color_text, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow); ///destroy current CTextBox and CBox objects void clearCCText(); @@ -109,7 +112,10 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox const int& font_style = CComponentsText::FONT_STYLE_REGULAR, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_text = COL_MENUCONTENT_TEXT, 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); + fb_pixel_t color_text = COL_MENUCONTENT_TEXT, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); CComponentsText( CComponentsForm *parent, const int x_pos = 10, const int y_pos = 10, const int w = 150, const int h = 50, @@ -118,7 +124,10 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox Font* font_text = NULL, const int& font_style = CComponentsText::FONT_STYLE_REGULAR, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_text = COL_MENUCONTENT_TEXT, 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); + fb_pixel_t color_text = COL_MENUCONTENT_TEXT, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); virtual ~CComponentsText(); @@ -132,6 +141,13 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox virtual inline void setTextFont(Font* font_text){ct_font = font_text;}; ///set text color virtual void setTextColor(const fb_pixel_t& color_text); + ///set all basic framebuffer element colors at once + ///Note: Possible color values are defined in "gui/color.h" and "gui/color_custom.h" + virtual void setColorAll(fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, fb_pixel_t color_text = COL_MENUCONTENT_TEXT) + { + CCDraw::setColorAll(color_frame, color_body, color_shadow); + setTextColor(color_text); + }; ///get text color virtual inline fb_pixel_t getTextColor(){return ct_col_text;}; ///set text alignment, also see textbox.h for possible alignment modes @@ -157,6 +173,9 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox ///returns current text content of text/label object as std::string virtual std::string getText(){return ct_text;}; + ///return current font + Font* getFont(){return ct_font;} + ///set screen x-position, parameter as int virtual void setXPos(const int& xpos); ///set screen y-position, parameter as int @@ -247,9 +266,9 @@ class CComponentsLabel : public CComponentsText CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_text = COL_MENUCONTENTINACTIVE_TEXT, - fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0) + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) :CComponentsText(x_pos, y_pos, w, h, text, mode, font_text, font_style, parent, shadow_mode, color_text, color_frame, color_body, color_shadow) { cc_item_type = CC_ITEMTYPE_LABEL; diff --git a/src/gui/components/cc_item_tvpic.cpp b/src/gui/components/cc_item_tvpic.cpp index 4d038d897..e3cd41da8 100644 --- a/src/gui/components/cc_item_tvpic.cpp +++ b/src/gui/components/cc_item_tvpic.cpp @@ -60,7 +60,7 @@ CComponentsPIP::CComponentsPIP( const int x_pos, const int y_pos, const int perc width = percent*screen_w/100; height = percent*screen_h/100; shadow = shadow_mode; - shadow_w = SHADOW_OFFSET; + shadow_w = OFFSET_SHADOW; col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; diff --git a/src/gui/components/cc_item_tvpic.h b/src/gui/components/cc_item_tvpic.h index 1ffc0ebe8..373a88490 100644 --- a/src/gui/components/cc_item_tvpic.h +++ b/src/gui/components/cc_item_tvpic.h @@ -54,7 +54,7 @@ class CComponentsPIP : public CComponentsItem CComponentsPIP( const int x_pos = 0, const int y_pos = 0, const int percent = 30, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_BLACK, fb_pixel_t color_body = COL_BACKGROUND_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BACKGROUND_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ~CComponentsPIP(); ///set property: width of tv box in pixel diff --git a/src/gui/components/cc_signals.h b/src/gui/components/cc_signals.h index 4a8cf0bb2..feee1ef67 100644 --- a/src/gui/components/cc_signals.h +++ b/src/gui/components/cc_signals.h @@ -85,7 +85,7 @@ class CYourClass : sigc::trackable //<- not forget, requierd by destructor! */ #ifndef __CC_SIGNALS_H__ -#define __CC_SIGNALS_H____ +#define __CC_SIGNALS_H__ #include #include diff --git a/src/gui/components/cc_timer.cpp b/src/gui/components/cc_timer.cpp index f7cbfa4ad..966d0bcc2 100644 --- a/src/gui/components/cc_timer.cpp +++ b/src/gui/components/cc_timer.cpp @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Generic Timer. - Copyright (C) 2013, Thilo Graf 'dbt' + Copyright (C) 2013-2016, Thilo Graf 'dbt' License: GPL @@ -36,64 +36,72 @@ using namespace std; -CComponentsTimer::CComponentsTimer( const int& interval) +CComponentsTimer::CComponentsTimer(const int& interval) { tm_thread = 0; - tm_interval = interval; + tm_interval = interval; + + sl_stop_timer = sigc::mem_fun(*this, &CComponentsTimer::stopTimer); - sl = sigc::mem_fun(*this, &CComponentsTimer::stopTimer); if (interval > 0) startTimer(); } CComponentsTimer::~CComponentsTimer() { - if (stopTimer()) - dprintf(DEBUG_INFO,"[CComponentsTimer] [%s] timer stopped\n", __func__); + stopTimer(); +} + +void CComponentsTimer::runSharedTimerAction() +{ + //start loop + + while(tm_enable && tm_interval > 0) { + tm_mutex.lock(); + OnTimer(); + mySleep(tm_interval); + tm_mutex.unlock(); + } + + if (tm_thread) + stopThread(); } //thread handle -void* CComponentsTimer::initTimerThread(void *arg) +void* CComponentsTimer::initThreadAction(void *arg) { CComponentsTimer *timer = static_cast(arg); - //start loop - while(timer) { - timer->mutex.lock(); - timer->OnTimer(); - timer->mutex.unlock(); - mySleep(timer->tm_interval); - } + timer->runSharedTimerAction(); return 0; } //start up running timer with own thread, return true on succses -bool CComponentsTimer::startTimer() +void CComponentsTimer::initThread() { - void *ptr = static_cast(this); - - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,0); - pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS,0); + if (!tm_enable) + return; if(!tm_thread) { - int res = pthread_create (&tm_thread, NULL, initTimerThread, ptr) ; + void *ptr = static_cast(this); + + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,0); + pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS,0); + + int res = pthread_create (&tm_thread, NULL, initThreadAction, ptr); + if (res != 0){ dprintf(DEBUG_NORMAL,"\033[33m[CComponentsTimer] [%s - %d] ERROR! pthread_create\033[0m\n", __func__, __LINE__); - return false; - } - if (res == 0){ - dprintf(DEBUG_INFO,"\033[33m[CComponentsTimer] [%s - %d] timer thread [%lu] created with interval = %d\033[0m\n", __func__, __LINE__, pthread_self(), tm_interval); - CNeutrinoApp::getInstance()->OnBeforeRestart.connect(sl); - }else{ - dprintf(DEBUG_NORMAL, "\033[33m[CComponentsTimer] [%s - %d] ERROR! pthread_create\033[0m\n", __func__, __LINE__); + return; } + + if (res == 0) + CNeutrinoApp::getInstance()->OnBeforeRestart.connect(sl_stop_timer); } - return true; } -//stop ticking timer and kill thread, return true on succses -bool CComponentsTimer::stopTimer() +void CComponentsTimer::stopThread() { if(tm_thread) { int thres = pthread_cancel(tm_thread); @@ -108,10 +116,36 @@ bool CComponentsTimer::stopTimer() if (thres == 0){ tm_thread = 0; //ensure disconnect of unused slot - sl.disconnect(); - dprintf(DEBUG_INFO,"\033[33m[CComponentsTimer] [%s] timer thread terminated ...\033[0m\n", __func__); - return true; + while (!sl_stop_timer.empty()) + sl_stop_timer.disconnect(); } } +} + +bool CComponentsTimer::startTimer() +{ + tm_enable = true; + initThread(); + if(tm_thread) + return true; + return false; } + +bool CComponentsTimer::stopTimer() +{ + tm_enable = false; + stopThread(); + if(tm_thread == 0) + return true; + + return false; +} + +void CComponentsTimer::setTimerInterval(const int& seconds) +{ + if (tm_interval == seconds) + return; + + tm_interval = seconds; +} diff --git a/src/gui/components/cc_timer.h b/src/gui/components/cc_timer.h index 321a0b184..a653889c3 100644 --- a/src/gui/components/cc_timer.h +++ b/src/gui/components/cc_timer.h @@ -34,42 +34,96 @@ #include #include -//! Member of CComponents. Provides a generic timer class -/*! - +/**CComponentsTimer +* Member of CComponents. Provides a generic timer class +* @see +* CComponentsTimer() */ - class CComponentsTimer : public sigc::trackable { private: ///thread pthread_t tm_thread; + ///refresh interval in seconds int tm_interval; - ///init function to start timer in own thread - static void* initTimerThread(void *arg); - ///mutex for timer - OpenThreads::Mutex mutex; - ///slot for signals - sigc::slot0 sl; + ///init function to init shared timer action + static void* initThreadAction(void *arg); + + ///init function to start/stop timer in own thread + void initThread(); + void stopThread(); + + ///runs shared timer action provided inside OnTimer() signal + void runSharedTimerAction(); + + ///flag to control thread state + bool tm_enable; + + ///mutex for timer + OpenThreads::Mutex tm_mutex; + ///slot for restart signals + sigc::slot0 sl_stop_timer; public: - ///class constructor, parameter interval sets the interval in seconds, default value=1 (1 sec) + /**Constructor for timer class + * + * @param[in] interval + * @li int interval in seconds, default value=1 (1 sec) + * If init value for interval > 0, timer starts immediately + * @see + * setTimerInterval(); + */ CComponentsTimer(const int& interval = 1); ~CComponentsTimer(); - ///start timer thread, returns true on success, if false causes log output + /**Starts timer thread + * @return + * bool + * returns true, if timer is running in thread + * @see + * stopTimer() + */ bool startTimer(); - ///stop timer thread, returns true on success, if false causes log output + + /**Stops timer thread + * @return + * bool + * returns true, if timer thread stopped + * @see + * startTimer() + */ bool stopTimer(); - ///returns true, if timer is running in thread + /**get current timer status + * @return + * bool + * returns true, if timer is running in thread + * @see + * startTimer() + * stopTimer() + */ bool isRun() const {return tm_thread;}; - ///set another interval in seconds - void setTimerIntervall(const int& seconds){tm_interval = seconds;}; - ///signal for timer event, use this in your class where ever you need time controled actions - ///for more details see also CComponentsSignals for similar handlings + /**set interval in seconds + * @param[in] seconds + * @li int + * @return + * void + * @see + * tm_interval + */ + void setTimerInterval(const int& seconds); + + /**Provides a signal handler to receive any function or methode. + * Use this in your class where ever you need time controled actions. + * + * @param[in] seconds + * @li int + * @see + * CComponentsSignals for similar handlings. + * CComponentsFrmClock::startClock() + */ sigc::signal OnTimer; }; diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index cb135fe6a..549bf2c30 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -90,13 +90,13 @@ typedef struct cc_fbdata_t //fb data object layer types typedef enum { - CC_FBDATA_TYPE_BGSCREEN, - CC_FBDATA_TYPE_BOX, - CC_FBDATA_TYPE_SHADOW_BOX, - CC_FBDATA_TYPE_FRAME, - CC_FBDATA_TYPE_BACKGROUND, + CC_FBDATA_TYPE_BGSCREEN = 1, + CC_FBDATA_TYPE_BOX = 2, + CC_FBDATA_TYPE_SHADOW_BOX = 4, + CC_FBDATA_TYPE_FRAME = 8, + CC_FBDATA_TYPE_BACKGROUND = 16, - CC_FBDATA_TYPES + CC_FBDATA_TYPES = 32 }FBDATA_TYPES; //fb color gradient types diff --git a/src/gui/customcolor.h b/src/gui/customcolor.h deleted file mode 100644 index 8d5be708a..000000000 --- a/src/gui/customcolor.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef __custom_color__ -#define __custom_color__ - -#define COLOR_CUSTOM 0x0 -#ifdef FB_USE_PALETTE -/* -#define COL_WHITE (COLOR_CUSTOM + 0) -#define COL_RED (COLOR_CUSTOM + 1) -#define COL_GREEN (COLOR_CUSTOM + 2) -#define COL_BLUE (COLOR_CUSTOM + 3) -#define COL_YELLOW (COLOR_CUSTOM + 4) -#define COL_BLACK (COLOR_CUSTOM + 5) -*/ -#define COL_DARK_RED 0x02 -#define COL_DARK_GREEN 0x03 -#define COL_OLIVE 0x04 -#define COL_DARK_BLUE 0x05 -#define COL_LIGHT_GRAY 0x08 -#define COL_DARK_GRAY 0x09 -#define COL_RED 0x0A -#define COL_GREEN 0x0B -#define COL_YELLOW 0x0C -#define COL_BLUE 0x0D -#define COL_PURP 0x0E -#define COL_LIGHT_BLUE 0x0F -#define COL_WHITE 0x10 -#define COL_BLACK 0x11 -#else -#define COL_DARK_RED0 0x02 -#define COL_DARK_GREEN0 0x03 -#define COL_OLIVE0 0x04 -#define COL_DARK_BLUE0 0x05 -#define COL_LIGHT_GRAY0 0x08 -#define COL_DARK_GRAY0 0x09 -#define COL_RED0 0x0A -#define COL_GREEN0 0x0B -#define COL_YELLOW0 0x0C -#define COL_BLUE0 0x0D -#define COL_PURP0 0x0E -#define COL_LIGHT_BLUE0 0x0F -#define COL_WHITE0 0x10 -#define COL_BLACK0 0x11 - -#define COL_DARK_RED (CFrameBuffer::getInstance()->realcolor[0x02]) -#define COL_DARK_GREEN (CFrameBuffer::getInstance()->realcolor[0x03]) -#define COL_OLIVE (CFrameBuffer::getInstance()->realcolor[0x04]) -#define COL_DARK_BLUE (CFrameBuffer::getInstance()->realcolor[0x05]) -#define COL_LIGHT_GRAY (CFrameBuffer::getInstance()->realcolor[0x08]) -#define COL_DARK_GRAY (CFrameBuffer::getInstance()->realcolor[0x09]) -#define COL_RED (CFrameBuffer::getInstance()->realcolor[0x0A]) -#define COL_GREEN (CFrameBuffer::getInstance()->realcolor[0x0B]) -#define COL_YELLOW (CFrameBuffer::getInstance()->realcolor[0x0C]) -#define COL_BLUE (CFrameBuffer::getInstance()->realcolor[0x0D]) -#define COL_PURP (CFrameBuffer::getInstance()->realcolor[0x0E]) -#define COL_LIGHT_BLUE (CFrameBuffer::getInstance()->realcolor[0x0F]) -#define COL_WHITE (CFrameBuffer::getInstance()->realcolor[0x10]) -#define COL_BLACK (CFrameBuffer::getInstance()->realcolor[0x11]) -#endif - -#endif diff --git a/src/gui/dboxinfo.cpp b/src/gui/dboxinfo.cpp index e590a4c24..2ab97231b 100644 --- a/src/gui/dboxinfo.cpp +++ b/src/gui/dboxinfo.cpp @@ -33,7 +33,7 @@ #include #include -#include + #include #include @@ -67,7 +67,7 @@ CDBoxInfoWidget::CDBoxInfoWidget() height = 0; x = 0; y = 0; - + header = NULL; fontWidth = fm->getWidth(); sizeWidth = 6 * fm->getMaxDigitWidth() + fm->getRenderWidth(std::string(" MiB") + g_Locale->getText(LOCALE_UNIT_DECIMAL)); ;//9999.99 MiB @@ -76,6 +76,12 @@ CDBoxInfoWidget::CDBoxInfoWidget() nameWidth = fontWidth * 17; } +CDBoxInfoWidget::~CDBoxInfoWidget() +{ + delete header; + header = NULL; +} + int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &) { if (parent) @@ -125,7 +131,7 @@ int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &) res = menu_return::RETURN_EXIT_ALL; doLoop = false; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if(CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; doLoop = false; @@ -159,6 +165,7 @@ int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &) void CDBoxInfoWidget::hide() { + header->kill(); frameBuffer->paintBackgroundBoxRel(x,y, width,height); frameBuffer->blit(); } @@ -317,7 +324,6 @@ void CDBoxInfoWidget::paint() nameWidth += diff; } height = h_max(height, 0); - x = getScreenStartX(width); y = getScreenStartY(height); // fprintf(stderr, "CDBoxInfoWidget::CDBoxInfoWidget() x = %d, y = %d, width = %d height = %d\n", x, y, width, height); @@ -353,9 +359,13 @@ void CDBoxInfoWidget::paint() title += g_info.hw_caps->boxvendor; title += " "; title += g_info.hw_caps->boxname; + width = max(width, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(title, true) + 50); + x = getScreenStartX(width); - CComponentsHeader header(x, ypos, width, hheight, title, NEUTRINO_ICON_SHELL); - header.paint(CC_SAVE_SCREEN_NO); + if (!header) + header = new CComponentsHeader(x, ypos, width, hheight, title, NEUTRINO_ICON_SHELL); + if (!header->isPainted()) + header->paint(CC_SAVE_SCREEN_NO); //paint body frameBuffer->paintBoxRel(x, ypos+ hheight, width, height- hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); diff --git a/src/gui/dboxinfo.h b/src/gui/dboxinfo.h index 9ea51b6a2..5d92fa138 100644 --- a/src/gui/dboxinfo.h +++ b/src/gui/dboxinfo.h @@ -36,6 +36,7 @@ #include #include #include +#include #include class CDBoxInfoWidget : public CMenuTarget @@ -54,12 +55,13 @@ class CDBoxInfoWidget : public CMenuTarget int nameWidth; void paint(); - + CComponentsHeader *header; Font *fm, *ft; public: CDBoxInfoWidget(); + ~CDBoxInfoWidget(); void hide(); int exec(CMenuTarget* parent, const std::string & actionKey); diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index a65234f23..240c8fcc3 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -32,14 +32,17 @@ #include #include +#include #include #include +#include #include #include #include #include #include +#include #include #include #include "bouquetlist.h" @@ -126,8 +129,8 @@ void EpgPlus::Header::paint(const char * Name) { std::string head = Name ? Name : g_Locale->getText (LOCALE_EPGPLUS_HEAD); - CComponentsHeader header(this->x, this->y, this->width, this->font->getHeight()+4, head); - header.paint(CC_SAVE_SCREEN_NO); + CComponentsHeader _header(this->x, this->y, this->width, this->font->getHeight()+4, head); + _header.paint(CC_SAVE_SCREEN_NO); } int EpgPlus::Header::getUsedHeight() @@ -158,7 +161,7 @@ EpgPlus::TimeLine::~TimeLine() { } -void EpgPlus::TimeLine::paint (time_t startTime, int pduration) +void EpgPlus::TimeLine::paint (time_t _startTime, int pduration) { this->clearMark(); @@ -167,7 +170,7 @@ void EpgPlus::TimeLine::paint (time_t startTime, int pduration) this->currentDuration = pduration; int numberOfTicks = this->currentDuration / (60 * 60) * 2; int tickDist = (this->durationX) / numberOfTicks; - time_t tickTime = startTime; + time_t tickTime = _startTime; bool toggleColor = false; // display date of begin @@ -175,7 +178,7 @@ void EpgPlus::TimeLine::paint (time_t startTime, int pduration) , toggleColor ? COL_MENUCONTENT_PLUS_2 : COL_MENUCONTENT_PLUS_1); this->fontDate->RenderString (this->x + 4, this->y + this->fontDate->getHeight() - , this->width, EpgPlus::getTimeString (startTime, "%d-%b") , COL_MENUCONTENT_TEXT); + , this->width, EpgPlus::getTimeString (_startTime, "%d-%b") , COL_MENUCONTENT_TEXT); // paint ticks for (int i = 0; i < numberOfTicks; ++i, xPos += tickDist, tickTime += pduration / numberOfTicks) { @@ -214,7 +217,7 @@ void EpgPlus::TimeLine::paintGrid() } } -void EpgPlus::TimeLine::paintMark (time_t startTime, int pduration, int px, int pwidth) +void EpgPlus::TimeLine::paintMark (time_t _startTime, int pduration, int px, int pwidth) { // clear old mark this->clearMark(); @@ -224,14 +227,14 @@ void EpgPlus::TimeLine::paintMark (time_t startTime, int pduration, int px, int , pwidth, this->fontTime->getHeight() , COL_MENUCONTENTSELECTED_PLUS_0); // display start time before mark - std::string timeStr = EpgPlus::getTimeString (startTime, "%H:%M"); + std::string timeStr = EpgPlus::getTimeString (_startTime, "%H:%M"); int textWidth = this->fontTime->getRenderWidth (timeStr); this->fontTime->RenderString (px - textWidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight() , textWidth, timeStr, COL_MENUCONTENT_TEXT); // display end time after mark - timeStr = EpgPlus::getTimeString (startTime + pduration, "%H:%M"); + timeStr = EpgPlus::getTimeString (_startTime + pduration, "%H:%M"); textWidth = fontTime->getRenderWidth (timeStr); if (px + pwidth + textWidth < this->x + this->width) { @@ -282,9 +285,9 @@ EpgPlus::ChannelEventEntry::~ChannelEventEntry() { } -bool EpgPlus::ChannelEventEntry::isSelected (time_t selectedTime) const +bool EpgPlus::ChannelEventEntry::isSelected (time_t _selectedTime) const { - return (selectedTime >= this->channelEvent.startTime) && (selectedTime < this->channelEvent.startTime + time_t (this->channelEvent.duration)); + return (_selectedTime >= this->channelEvent.startTime) && (_selectedTime < this->channelEvent.startTime + time_t (this->channelEvent.duration)); } void EpgPlus::ChannelEventEntry::paint (bool pisSelected, bool toggleColor) @@ -363,7 +366,7 @@ EpgPlus::ChannelEntry::~ChannelEntry() this->channelEventEntries.clear(); } -void EpgPlus::ChannelEntry::paint (bool isSelected, time_t selectedTime) +void EpgPlus::ChannelEntry::paint (bool isSelected, time_t _selectedTime) { this->frameBuffer->paintBoxRel (this->x, this->y, this->width, this->font->getHeight(), isSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : COL_MENUCONTENT_PLUS_0); @@ -408,7 +411,7 @@ void EpgPlus::ChannelEntry::paint (bool isSelected, time_t selectedTime) for (TCChannelEventEntries::iterator It = this->channelEventEntries.begin(); It != this->channelEventEntries.end(); ++It) { - (*It)->paint (isSelected && (*It)->isSelected (selectedTime), toggleColor); + (*It)->paint (isSelected && (*It)->isSelected (_selectedTime), toggleColor); toggleColor = !toggleColor; } @@ -431,7 +434,7 @@ EpgPlus::Footer::Footer (CFrameBuffer * pframeBuffer, int px, int py, int pwidth this->x = px; this->y = py; this->width = pwidth; - this->buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+8; //TODO get height from buttons + this->buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8; //TODO get height from buttons } EpgPlus::Footer::~Footer() @@ -556,7 +559,6 @@ void EpgPlus::createChannelEntries (int selectedChannelEntryIndex) CEitManager::getInstance()->getEventsServiceKey(channel->getEpgID(), channelEventList); //printf("channelEventList size %d\n", channelEventList.size()); - int xPosEventEntry = this->eventsTableX; int widthEventEntry = 0; time_t lastEndTime = this->startTime; @@ -601,7 +603,7 @@ void EpgPlus::createChannelEntries (int selectedChannelEntryIndex) channelEntry->channelEventEntries.push_back (channelEventEntry); } // correct position - xPosEventEntry = this->eventsTableX + ((It->startTime - startTimeDiff - this->startTime) * this->eventsTableWidth) / this->duration; + int xPosEventEntry = this->eventsTableX + ((It->startTime - startTimeDiff - this->startTime) * this->eventsTableWidth) / this->duration; // correct width widthEventEntry = ((It->duration + startTimeDiff + endTimeDiff) * this->eventsTableWidth) / this->duration + 1; @@ -693,7 +695,7 @@ void EpgPlus::init() // if(icol_h < h2) // icol_h = h2; - int buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+8; //TODO get height from buttons/*std::max (icol_h+8, fonts[EPGPlus_footer_fontbuttons]->getHeight());*/ + int buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()+8; //TODO get height from buttons/*std::max (icol_h+8, fonts[EPGPlus_footer_fontbuttons]->getHeight());*/ int footerHeight = Footer::getUsedHeight() + buttonHeight; this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - horGap1Height - horGap2Height - footerHeight) / this->entryHeight; @@ -839,7 +841,7 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu refreshAll = true; break; } - else if ((msg == CRCInput::RC_page_down)) { + else if (msg == CRCInput::RC_page_down) { int selected = this->selectedChannelEntry->index; int prev_selected = selected; int step = this->maxNumberOfDisplayableEntries; @@ -1130,7 +1132,7 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu } } } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; loop = false; @@ -1240,7 +1242,7 @@ void EpgPlus::paint() int sliderKnobPosition = this->selectedChannelEntry == NULL ? 0 : (this->selectedChannelEntry->index / this->maxNumberOfDisplayableEntries); this->frameBuffer->paintBoxRel(this->sliderX + 2, this->sliderY + sliderKnobPosition * (sliderHeight-4)/tmp - , this->sliderWidth - 4, (sliderHeight-4)/tmp, COL_MENUCONTENT_PLUS_3); + , this->sliderWidth - 4, (sliderHeight-4)/tmp, COL_SCROLLBAR_ACTIVE_PLUS_0); } // -- EPG+ Menue Handler Class @@ -1301,6 +1303,11 @@ EpgPlus::MenuTargetAddRecordTimer::MenuTargetAddRecordTimer (EpgPlus * pepgPlus) this->epgPlus = pepgPlus; } +static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) +{ + return a.startTime < b.startTime; +} + int EpgPlus::MenuTargetAddRecordTimer::exec (CMenuTarget * /*parent*/, const std::string & /*actionKey*/) { TCChannelEventEntries::const_iterator It = this->epgPlus->getSelectedEvent(); @@ -1308,12 +1315,33 @@ int EpgPlus::MenuTargetAddRecordTimer::exec (CMenuTarget * /*parent*/, const std if ((It != this->epgPlus->selectedChannelEntry->channelEventEntries.end()) && (!(*It)->channelEvent.description.empty()) ) { - if (g_Timerd->isTimerdAvailable()) { - - g_Timerd->addRecordTimerEvent (this->epgPlus->selectedChannelEntry->channel->getChannelID(), (*It)->channelEvent.startTime, (*It)->channelEvent.startTime + (*It)->channelEvent.duration, (*It)->channelEvent.eventID, (*It)->channelEvent.startTime, (*It)->channelEvent.startTime - (ANNOUNCETIME + 120) - , TIMERD_APIDS_CONF, true); - ShowMsg (LOCALE_TIMER_EVENTRECORD_TITLE, g_Locale->getText (LOCALE_TIMER_EVENTRECORD_MSG) - , CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); // UTF-8 + bool doRecord = true; + if (g_settings.recording_already_found_check) + { + CHintBox loadBox(LOCALE_RECORDING_ALREADY_FOUND_CHECK, LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES); + loadBox.paint(); + CMovieBrowser moviebrowser; + const char *rec_title = (*It)->channelEvent.description.c_str(); + bool already_found = moviebrowser.gotMovie(rec_title); + loadBox.hide(); + if (already_found) + { + printf("already found in moviebrowser: %s\n", rec_title); + char message[1024]; + snprintf(message, sizeof(message)-1, g_Locale->getText(LOCALE_RECORDING_ALREADY_FOUND), rec_title); + doRecord = (ShowMsg(LOCALE_RECORDING_ALREADY_FOUND_CHECK, message, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes); + } + } + if (g_Timerd->isTimerdAvailable() && doRecord) + { + CChannelEventList evtlist; + CEitManager::getInstance()->getEventsServiceKey(this->epgPlus->selectedChannelEntry->channel->channel_id, evtlist); + sort(evtlist.begin(),evtlist.end(),sortByDateTime); + CFollowScreenings m(this->epgPlus->selectedChannelEntry->channel->channel_id, + (*It)->channelEvent.startTime, + (*It)->channelEvent.startTime + (*It)->channelEvent.duration, + (*It)->channelEvent.description, (*It)->channelEvent.eventID, TIMERD_APIDS_CONF, true, "", &evtlist); + m.exec(NULL, ""); } else printf ("timerd not available\n"); } diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 62c5e2952..13cbb9e23 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -26,6 +26,7 @@ #endif #include +#include #include #include @@ -45,8 +46,12 @@ #include #include #include -#include +#include +#include +#include #include +#include +#include #include #include @@ -117,6 +122,15 @@ CEpgData::CEpgData() { bigFonts = false; frameBuffer = CFrameBuffer::getInstance(); + tmdb_active = false; + mp_movie_info = NULL; + header = NULL; +} + +CEpgData::~CEpgData() +{ + delete header; + header = NULL; } void CEpgData::start() @@ -127,7 +141,7 @@ void CEpgData::start() topheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getHeight(); topboxheight = topheight + 6; botboxheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight() + 6; - buttonheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; + buttonheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight() + 6; if (buttonheight < 30) buttonheight = 30; // the buttons and icons need space oy-=buttonheight/2; @@ -161,7 +175,7 @@ void CEpgData::addTextToArray(const std::string & text, int screening) // UTF-8 } } -void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 +void CEpgData::processTextToArray(std::string text, int screening, bool has_cover) // UTF-8 { std::string aktLine = ""; std::string aktWord = ""; @@ -181,7 +195,7 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 // check the wordwidth - add to this line if size ok int aktWordWidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(aktWord); - if ((aktWordWidth+aktWidth)<(ox - 20 - 15)) + if ((aktWordWidth+aktWidth)<(ox - 20 - 15 - (has_cover? ((ox/4)+10) :0))) {//space ok, add aktWidth += aktWordWidth; aktLine += aktWord; @@ -216,12 +230,29 @@ void CEpgData::processTextToArray(std::string text, int screening) // UTF-8 addTextToArray( aktLine + aktWord, screening ); } -void CEpgData::showText( int startPos, int ypos ) +void CEpgData::showText(int startPos, int ypos, bool has_cover, bool fullClear) { // recalculate medlineheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getHeight(); medlinecount = sb / medlineheight; + std::string cover = "/tmp/tmdb.jpg"; //todo: maybe add a getCover()-function to tmdb class + int cover_max_width = ox/4; //25% + int cover_max_height = sb-(2*10); + int cover_width = 0; + int cover_height = 0; + int cover_offset = 0; + + if (has_cover) + { + g_PicViewer->getSize(cover.c_str(), &cover_width, &cover_height); + if (cover_width && cover_height) + { + g_PicViewer->rescaleImageDimensions(&cover_width, &cover_height, cover_max_width, cover_max_height); + cover_offset = cover_width + 10; + } + } + int textSize = epgText.size(); int y=ypos; const char tok = ' '; @@ -234,7 +265,32 @@ void CEpgData::showText( int startPos, int ypos ) continue; max_wday_w = std::max(max_wday_w, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getRenderWidth(std::string(g_Locale->getText(CLocaleManager::getWeekday(i))) + " ")); } - frameBuffer->paintBoxRel(sx, y, ox- 15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box + int offs = fullClear ? 0 : cover_offset; + frameBuffer->paintBoxRel(sx+offs, y, ox-15-offs, sb, COL_MENUCONTENT_PLUS_0); // background of the text box + + if (has_cover) { + if (!g_PicViewer->DisplayImage(cover ,sx+10 ,y+10+((sb-cover_height)/2), cover_width, cover_height, CFrameBuffer::TM_NONE)) { + cover_offset = 0; + frameBuffer->paintBoxRel(sx, y, ox-15, sb, COL_MENUCONTENT_PLUS_0); // background of the text box + } + } + int logo_offset = 0; + int icon_w = 0; + int icon_h = 0; + if (tmdb_active && startPos == 0) + { + frameBuffer->getIconSize(NEUTRINO_ICON_TMDB, &icon_w, &icon_h); + frameBuffer->paintIcon(NEUTRINO_ICON_TMDB, sx+10+cover_offset, y+(medlineheight-icon_h)/2); + logo_offset = icon_w + 10; + } + if (stars > 0 && startPos == 0) + { + frameBuffer->getIconSize(NEUTRINO_ICON_STAR_OFF, &icon_w, &icon_h); + for (int i = 0; i < 10; i++) + frameBuffer->paintIcon(NEUTRINO_ICON_STAR_OFF, sx+10+cover_offset+logo_offset + i*(icon_w+3), y+(medlineheight-icon_h)/2); + for (int i = 0; i < stars; i++) + frameBuffer->paintIcon(NEUTRINO_ICON_STAR_ON, sx+10+cover_offset+logo_offset + i*(icon_w+3), y+(medlineheight-icon_h)/2); + } for (int i = startPos; i < textSize && i < startPos + medlinecount; i++, y += medlineheight) { if(epgText[i].second){ @@ -261,16 +317,17 @@ void CEpgData::showText( int startPos, int ypos ) count = 0; } else{ - g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10, y+medlineheight, ox- 15- 15, epgText[i].first, COL_MENUCONTENT_TEXT); + g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10+cover_offset, y+medlineheight, ox-15-15-cover_offset, epgText[i].first, COL_MENUCONTENT_TEXT); } } + int sbc = ((textSize - 1)/ medlinecount) + 1; int sbs= (startPos+ 1)/ medlinecount; if (sbc < 1) sbc = 1; - frameBuffer->paintBoxRel(sx+ ox- 15, ypos, 15, sb, COL_MENUCONTENT_PLUS_1); // scrollbar bg - frameBuffer->paintBoxRel(sx+ ox- 13, ypos+ 2+ sbs*(sb-4)/sbc , 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); // scrollbar + frameBuffer->paintBoxRel(sx+ ox- 15, ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); // scrollbar bg + frameBuffer->paintBoxRel(sx+ ox- 13, ypos+ 2+ sbs*(sb-4)/sbc , 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); // scrollbar } #define GENRE_MOVIE_COUNT 9 @@ -447,7 +504,168 @@ bool CEpgData::isCurrentEPG(const t_channel_id channel_id) return false; } -int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_startzeit, bool doLoop, bool callFromfollowlist ) +int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool doLoop) +{ + int res = menu_return::RETURN_REPAINT; + + mp_movie_info = mi; + if (mp_movie_info == NULL) + return res; + + if (mp_movie_info->epgTitle.empty()) /* no epg info found */ + { + ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND)); // UTF-8 + hide(); + return res; + } + epgText.clear(); + epgData.title = mp_movie_info->epgTitle; + epgData.info1 = mp_movie_info->epgInfo1; + epgData.info2 = mp_movie_info->epgInfo2; + + epgData.itemDescriptions.clear(); + epgData.items.clear(); + epgData.fsk = mp_movie_info->parentalLockAge; + epgData.table_id = mp_movie_info->epgId; +#ifdef FULL_CONTENT_CLASSIFICATION + epgData.contentClassification.clear(); +#else + epgData.contentClassification = 0; +#endif + epgData.epg_times.dauer = mp_movie_info->length * 60; // we need the seconds + + extMovieInfo.clear(); + if ( !mp_movie_info->productionCountry.empty() || mp_movie_info->productionDate != 0) + { + extMovieInfo += mp_movie_info->productionCountry; + extMovieInfo += " "; + extMovieInfo += to_string(mp_movie_info->productionDate); + extMovieInfo += "\n"; + } + if (!mp_movie_info->serieName.empty()) + { + extMovieInfo += "\n"; + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_SERIE); + extMovieInfo += ": "; + extMovieInfo += mp_movie_info->serieName; + extMovieInfo += "\n"; + } + if (!mp_movie_info->channelName.empty()) + { + extMovieInfo += "\n"; + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_CHANNEL); + extMovieInfo += ": "; + extMovieInfo += mp_movie_info->channelName; + extMovieInfo += "\n"; + } + if (mp_movie_info->rating != 0) + { + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_RATING); + extMovieInfo += ": "; + extMovieInfo += to_string(mp_movie_info->rating / 10); + extMovieInfo += ","; + extMovieInfo += to_string(mp_movie_info->rating % 10); + extMovieInfo += "/10"; + extMovieInfo += "\n"; + } + if (mp_movie_info->quality != 0) + { + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_QUALITY); + extMovieInfo += ": "; + extMovieInfo += to_string(mp_movie_info->quality); + extMovieInfo += "\n"; + } + if (mp_movie_info->parentalLockAge != 0) + { + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE); + extMovieInfo += ": "; + extMovieInfo += to_string(mp_movie_info->parentalLockAge); + extMovieInfo += " "; + extMovieInfo += g_Locale->getText(LOCALE_UNIT_LONG_YEARS); + extMovieInfo += "\n"; + } + if (!mp_movie_info->audioPids.empty()) + { + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_AUDIO); + extMovieInfo += ": "; + for (unsigned int i = 0; i < mp_movie_info->audioPids.size(); i++) + { + if (i) + extMovieInfo += ", "; + extMovieInfo += mp_movie_info->audioPids[i].AudioPidName; + } + extMovieInfo += "\n"; + } + if (mp_movie_info->genreMajor != 0) + { + neutrino_locale_t locale_genre; + unsigned char i = (mp_movie_info->genreMajor & 0x0F0); + if (i >= 0x010 && i < 0x0B0) + { + i >>= 4; + i--; + locale_genre = genre_sub_classes_list[i][((mp_movie_info->genreMajor & 0x0F) < genre_sub_classes[i]) ? (mp_movie_info->genreMajor & 0x0F) : 0]; + } + else + locale_genre = LOCALE_GENRE_UNKNOWN; + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR); + extMovieInfo += ": "; + extMovieInfo += g_Locale->getText(locale_genre); + extMovieInfo += "\n"; + } + + extMovieInfo += "\n"; + + tm *date_tm = localtime(&mp_movie_info->dateOfLastPlay); + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_PREVPLAYDATE); + extMovieInfo += ": "; + extMovieInfo += strftime("%F", date_tm); + extMovieInfo += "\n"; + + date_tm = localtime(&mp_movie_info->file.Time); + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_RECORDDATE); + extMovieInfo += ": "; + extMovieInfo += strftime("%F", date_tm); + extMovieInfo += "\n"; + + extMovieInfo += "\n"; + + if (mp_movie_info->file.Size != 0) + { + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_SIZE); + extMovieInfo += ": "; + extMovieInfo += to_string(mp_movie_info->file.Size >> 20); + extMovieInfo += "\n"; + } + + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_PATH); + extMovieInfo += ": "; + extMovieInfo += mp_movie_info->file.getPath(); + extMovieInfo += "\n"; + + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_FILE); + extMovieInfo += ": "; + extMovieInfo += mp_movie_info->file.getFileName(); + extMovieInfo += "\n"; + + // this calculation is taken from timeosd.cpp + epg_done = (mp_duration && mp_duration > 100) ? (mp_position * 100 / mp_duration) : -1; + if (epg_done > 100) + epg_done = 100; + //printf("[%s:%d] epg_done: %d\n", __func__, __LINE__, epg_done); + + res = show(mp_movie_info->epgId >> 16, 0, 0, doLoop, false, true); + if(!epgTextSwitch.empty()) + { + mp_movie_info->epgInfo2 = epgTextSwitch; + CMovieInfo m_movieInfo; + //printf("#####[%s:%d] saveMovieInfo\n", __func__, __LINE__); + m_movieInfo.saveMovieInfo(*mp_movie_info); + } + return res; +} + +int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_startzeit, bool doLoop, bool callFromfollowlist, bool mp_info ) { int res = menu_return::RETURN_REPAINT; static uint64_t id = 0; @@ -457,18 +675,19 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start startzeit=*a_startzeit; id=a_id; - CComponentsHeader* header = NULL; - CComponentsPicture* headerPic = NULL; - CComponentsText* headerText = NULL; - - int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); + tmdb_active = false; + stars = 0; t_channel_id epg_id = channel_id; CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); if (channel) epg_id = channel->getEpgID(); + if (!mp_info) + GetEPGData(epg_id, id, &startzeit); - GetEPGData(epg_id, id, &startzeit ); + epgTextSwitch.clear(); + if (!mp_info) + extMovieInfo.clear(); if (doLoop) { if (!bigFonts && g_settings.bigFonts) { @@ -494,13 +713,11 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start int logo_w = 0; int logo_h = 0; int logo_w_max = ox / 4; - if(channel) { - if(g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(channel_id, channel->getName(), lname, &logo_w, &logo_h)) { - if((logo_h > (toph-4)) || (logo_w > logo_w_max)) { - g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, toph-4); - } - pic_offx = logo_w + 10; + if(g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(channel_id, g_Zapit->getChannelName(channel_id), lname, &logo_w, &logo_h)) { + if((logo_h > (toph-4)) || (logo_w > logo_w_max)) { + g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, toph-4); } + pic_offx = logo_w + 10; } int pos; @@ -519,6 +736,8 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } const int pic_h = 39; + if(!topboxheight) + start(); if (!text2.empty()) toph = 2 * topboxheight; @@ -572,7 +791,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // Add a blank line processTextToArray(""); - // 21.07.2005 - rainerk // Show extended information if ( !epgData.itemDescriptions.empty() && !epgData.items.empty()) { @@ -598,20 +816,23 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start sprintf(lengthInfo, "%d", epgData.epg_times.dauer / 60); processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_LENGTH)) + ": " + lengthInfo); // UTF-8 - // Show audio information - std::string audioInfo = ""; - CSectionsdClient::ComponentTagList tags; - bool hasComponentTags = CEitManager::getInstance()->getComponentTagsUniqueKey( epgData.eventID, tags); - if (hasComponentTags) + if (!mp_info) { - for (unsigned int i = 0; i < tags.size(); i++) - if (tags[i].streamContent == 2 && !tags[i].component.empty()) - audioInfo += tags[i].component + ", "; - - if (!audioInfo.empty()) + // Show audio information + std::string audioInfo = ""; + CSectionsdClient::ComponentTagList tags; + bool hasComponentTags = CEitManager::getInstance()->getComponentTagsUniqueKey( epgData.eventID, tags); + if (hasComponentTags) { - audioInfo.erase(audioInfo.size()-2); - processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AUDIO)) + ": " + audioInfo); // UTF-8 + for (unsigned int i = 0; i < tags.size(); i++) + if (tags[i].streamContent == 2 && !tags[i].component.empty()) + audioInfo += tags[i].component + ", "; + + if (!audioInfo.empty()) + { + audioInfo.erase(audioInfo.size()-2); + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AUDIO)) + ": " + audioInfo); // UTF-8 + } } } @@ -628,13 +849,17 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // -- display more screenings on the same channel // -- 2002-05-03 rasc has_follow_screenings = false; - if (hasFollowScreenings(channel_id, epgData.title)) { + if (!mp_info && hasFollowScreenings(channel_id, epgData.title)) { processTextToArray(""); // UTF-8 processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_MORE_SCREENINGS)) + ':'); // UTF-8 FollowScreenings(channel_id, epgData.title); has_follow_screenings = true; } + // show extended movie info + if (mp_info && !extMovieInfo.empty()) + processTextToArray(extMovieInfo); + /* neat for debugging duplicate event issues etc. */ char *epgid; if (asprintf(&epgid, "EPG ID:%04X.%02X", (int)((epgData.eventID)&0x0FFFF), epgData.table_id) >= 0) @@ -650,62 +875,63 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start //show the epg // header + logo int header_h = std::max(toph, logo_h); - header = new CComponentsHeader(sx, sy, ox, header_h); + if (!header){ + header = new CComponentsShapeSquare(sx, sy, ox, header_h); + header->setCorner(RADIUS_LARGE, CORNER_TOP); + } + header->setDimensionsAll(sx, sy, ox, header_h); + header->setColorBody(COL_MENUHEAD_PLUS_0); + header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); + + CComponentsPicture* headerPic = NULL; //NOTE: class CComponentsChannelLogo is preferred for channel logos if (pic_offx > 0) { headerPic = new CComponentsPicture(sx+10, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); headerPic->doPaintBg(false); } std::string textAll = (!text2.empty()) ? text1 + "\n" + text2 : text1; - headerText = new CComponentsText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); - headerText->doPaintBg(false); - headerText->setTextColor(COL_MENUHEAD_TEXT); + CComponentsText headerText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); + headerText.doPaintBg(false); + headerText.setTextColor(COL_MENUHEAD_TEXT); header->paint(CC_SAVE_SCREEN_NO); - headerText->paint(CC_SAVE_SCREEN_NO); + headerText.paint(CC_SAVE_SCREEN_NO); if (headerPic) headerPic->paint(CC_SAVE_SCREEN_NO); - //show date-time.... - frameBuffer->paintBoxRel(sx, sy+oy-botboxheight, ox, botboxheight, COL_MENUHEAD_PLUS_0); - std::string fromto; - int widthl,widthr; - fromto = epg_start; - fromto += " - "; - fromto += epg_end; - - widthl = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(fromto); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+40, sy+oy-3, widthl, fromto, COL_MENUHEAD_TEXT); - widthr = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(epg_date); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ox-40-widthr, sy+oy-3, widthr, epg_date, COL_MENUHEAD_TEXT); - int showPos = 0; textCount = epgText.size(); showText(showPos, sy + toph); - bool wzap = isCurrentEPG(channel_id); - // show Timer Event Buttons - showTimerEventBar (true,wzap); - - //show progressbar - if ( epg_done!= -1 ) + + // small bottom box + frameBuffer->paintBoxRel(sx, sy+oy-botboxheight, ox, botboxheight, COL_MENUHEAD_PLUS_0); + if (!mp_info) { - int pbx = sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1); - CProgressBar pb(pbx, sy+oy-height, 104, height-6); - pb.setType(CProgressBar::PB_TIMESCALE); - pb.setValues(epg_done, 100); - pb.paint(false); - } + static int iw = 0, ih = 0, io = 0; + if (!iw && !ih) + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_LEFT, &iw, &ih); + if (!io && iw) + io = iw + 10; - static int iw = 0, ih = 0; - if (!iw && !ih) - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_LEFT, &iw, &ih); + std::string fromto = epg_start + " - " + epg_end; - GetPrevNextEPGData( epgData.eventID, &epgData.epg_times.startzeit ); - if (!call_fromfollowlist) { - int iy = sy + oy - 3 - height/2 - iw/2; - if (prev_id) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_LEFT, sx + 5, iy); - if (next_id) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RIGHT, sx + ox - iw - 5, iy); + int widthl = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(fromto); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+10+io, sy+oy-3, widthl, fromto, COL_MENUHEAD_TEXT); + int widthr = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(epg_date); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ox-10-io-widthr, sy+oy-3, widthr, epg_date, COL_MENUHEAD_TEXT); + + GetPrevNextEPGData(epgData.eventID, &epgData.epg_times.startzeit); + if (!call_fromfollowlist) + { + int iy = sy + oy - botboxheight + (botboxheight - iw)/2; + if (prev_id) + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_LEFT, sx + 10, iy); + if (next_id) + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RIGHT, sx + ox - iw - 10, iy); + } } + showProgressBar(); + + // show Timer Event Buttons + showTimerEventBar(true, isCurrentEPG(channel_id), mp_info); if ( doLoop ) { @@ -715,7 +941,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start int scrollCount = 0; bool loop = true; - + bool epgTextSwitchClear = true; uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); while (loop) @@ -729,22 +955,35 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start switch ( msg ) { case NeutrinoMessages::EVT_TIMER: - if (data == g_InfoViewer->getUpdateTimer()) { - GetEPGData(channel_id, id, &startzeit, false); - if ( epg_done!= -1 ) { - int pbx = sx + 10 + widthl + 10 + ((ox-104-widthr-widthl-10-10-20)>>1); - CProgressBar pb(pbx, sy+oy-height, 104, height-6); - pb.setType(CProgressBar::PB_TIMESCALE); - pb.setValues(epg_done, 100); - pb.paint(false); - } - } - if(data == fader.GetFadeTimer()) { - if(fader.FadeDone()) + if (data == fader.GetFadeTimer()) { + if (fader.FadeDone()) loop = false; } else CNeutrinoApp::getInstance()->handleMsg(msg, data); + + if (!mp_info) + { + if (data == g_InfoViewer->getUpdateTimer()) + { + GetEPGData(channel_id, id, &startzeit, false); + showProgressBar(); + } + } + else if (epg_done != -1) + { + CMoviePlayerGui::getInstance().UpdatePosition(); + int mp_position = CMoviePlayerGui::getInstance().GetPosition(); + int mp_duration = CMoviePlayerGui::getInstance().GetDuration(); + + // this calculation is taken from timeosd.cpp + epg_done = (mp_duration && mp_duration > 100) ? (mp_position * 100 / mp_duration) : -1; + if (epg_done > 100) + epg_done = 100; + //printf("[%s:%d] epg_done: %d\n", __func__, __LINE__, epg_done); + + showProgressBar(); + } break; case NeutrinoMessages::EVT_CURRENTNEXT_EPG: if (/*!id && */ ((*(t_channel_id *) data) == (channel_id & 0xFFFFFFFFFFFFULL))) { @@ -754,69 +993,64 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start CNeutrinoApp::getInstance()->handleMsg(msg, data); break; case CRCInput::RC_left: - if ((prev_id != 0) && !call_fromfollowlist) + if ((prev_id != 0) && !call_fromfollowlist && !mp_info) { - frameBuffer->paintBoxRel(sx+ 5, sy+ oy- botboxheight+ 4, botboxheight- 8, botboxheight- 8, COL_MENUCONTENT_PLUS_1); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ 10, sy+ oy- 3, widthr, "<", COL_MENUCONTENT_TEXT_PLUS_1); - show(channel_id, prev_id, &prev_zeit, false); showPos=0; } break; - case CRCInput::RC_right: - if ((next_id != 0) && !call_fromfollowlist) + if ((next_id != 0) && !call_fromfollowlist && !mp_info) { - frameBuffer->paintBoxRel(sx+ ox- botboxheight+ 8- 5, sy+ oy- botboxheight+ 4, botboxheight- 8, botboxheight- 8, COL_MENUCONTENT_PLUS_1); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ ox- botboxheight+ 8, sy+ oy- 3, widthr, ">", COL_MENUCONTENT_TEXT_PLUS_1); - show(channel_id, next_id, &next_zeit, false); showPos=0; } break; - case CRCInput::RC_down: if (showPos+scrollCount 0) { + showPos -= scrollCount; + if (showPos < 0) + showPos = 0; + showText(showPos, sy + toph, tmdb_active, false); + } 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; + int zapBackPeriod = g_settings.adzap_zapBackPeriod / 60; + if (zapBackPeriod < 120) + zapBackPeriod++; + if (zapBackPeriod > 120) + zapBackPeriod = 120; + g_settings.adzap_zapBackPeriod = zapBackPeriod * 60; 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; + int zapBackPeriod = g_settings.adzap_zapBackPeriod / 60; + if (zapBackPeriod > 1) + zapBackPeriod--; + if (zapBackPeriod < 1) + zapBackPeriod = 1; + g_settings.adzap_zapBackPeriod = zapBackPeriod * 60; showTimerEventBar(true, true); } break; - - // 31.05.2002 dirch record timer case CRCInput::RC_red: - if (!g_settings.minimode && (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)) + if (mp_info) + { + epgTextSwitchClear = false; + loop = false; + break; + } + else if (!g_settings.minimode && (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)) { std::string recDir; //CTimerdClient timerdclient; @@ -863,14 +1097,39 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start if (lid != -1) recDir = g_settings.network_nfs[lid].local_dir; } - if (doRecord) + if (doRecord && g_settings.recording_already_found_check) + { + CHintBox loadBox(LOCALE_RECORDING_ALREADY_FOUND_CHECK, LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES); + loadBox.paint(); + CMovieBrowser moviebrowser; + const char *rec_title = epgData.title.c_str(); + bool already_found = moviebrowser.gotMovie(rec_title); + loadBox.hide(); + if (already_found) + { + printf("already found in moviebrowser: %s\n", rec_title); + char message[1024]; + snprintf(message, sizeof(message)-1, g_Locale->getText(LOCALE_RECORDING_ALREADY_FOUND), rec_title); + doRecord = (ShowMsg(LOCALE_RECORDING_ALREADY_FOUND_CHECK, message, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes); + } + } + if (doRecord && !call_fromfollowlist) + { + CFollowScreenings m(channel_id, + epgData.epg_times.startzeit, + epgData.epg_times.startzeit + epgData.epg_times.dauer, + epgData.title, epgData.eventID, TIMERD_APIDS_CONF, true, recDir, &evtlist); + m.exec(NULL, ""); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); + } + else if (doRecord) { if (g_Timerd->addRecordTimerEvent(channel_id, epgData.epg_times.startzeit, epgData.epg_times.startzeit + epgData.epg_times.dauer, epgData.eventID, epgData.epg_times.startzeit, epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ), - TIMERD_APIDS_CONF, true, recDir,false) == -1) + TIMERD_APIDS_CONF, true, epgData.epg_times.startzeit - (ANNOUNCETIME + 120) > time(NULL), recDir, false) == -1) { if (askUserOnTimerConflict(epgData.epg_times.startzeit - (ANNOUNCETIME + 120), epgData.epg_times.startzeit + epgData.epg_times.dauer)) @@ -880,7 +1139,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgData.epg_times.startzeit + epgData.epg_times.dauer, epgData.eventID, epgData.epg_times.startzeit, epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ), - TIMERD_APIDS_CONF, true, recDir,true); + TIMERD_APIDS_CONF, true, epgData.epg_times.startzeit - (ANNOUNCETIME + 120) > time(NULL), recDir, true); ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } @@ -894,28 +1153,63 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start printf("timerd not available\n"); } break; + case CRCInput::RC_info: + { + if (g_settings.tmdb_enabled) + { + showPos = 0; + if (!tmdb_active) { + cTmdb* tmdb = new cTmdb(epgData.title); + if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { + epgText_saved = epgText; + epgText.clear(); + tmdb_active = !tmdb_active; - // 31.05.2002 dirch zapto timer + epgTextSwitch = tmdb->getDescription(); + if (!tmdb->getCast().empty()) + epgTextSwitch += "\n\n"+(std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ACTORS)+":\n"+ tmdb->getCast()+"\n"; + + processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); + textCount = epgText.size(); + stars = tmdb->getStars(); + showText(showPos, sy + toph, tmdb_active); + } else { + ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + } + delete tmdb; + } else { + epgText = epgText_saved; + textCount = epgText.size(); + tmdb_active = !tmdb_active; + stars=0; + showText(showPos, sy + toph); + } + } + break; + } case CRCInput::RC_yellow: { - //CTimerdClient timerdclient; - if (g_Timerd->isTimerdAvailable()) - { - if(!g_Timerd->adzap_eventID && g_settings.wzap_time && isCurrentEPG(channel_id)){ - g_Timerd->addAdZaptoTimerEvent(channel_id, - time (NULL) + (g_settings.wzap_time * 60)); + if (!mp_info) + { + if (isCurrentEPG(channel_id)) + { + CAdZapMenu::getInstance()->exec(NULL, "enable"); 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); } - timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); + //CTimerdClient timerdclient; + else if (g_Timerd->isTimerdAvailable()) + { + 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); + + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); + } + else + printf("timerd not available\n"); } - else - printf("timerd not available\n"); break; } case CRCInput::RC_blue: @@ -942,7 +1236,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } break; } - case CRCInput::RC_info: case CRCInput::RC_help: bigFonts = bigFonts ? false : true; frameBuffer->paintBackgroundBoxRel(sx, sy, ox, oy); @@ -960,10 +1253,12 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() / BIG_FONT_FAKTOR)); } g_settings.bigFonts = bigFonts; - show(channel_id, id, &startzeit, false, call_fromfollowlist); + if (mp_info) + show(mp_movie_info->epgId >> 16, 0, 0, false, false, true); + else + show(channel_id, id, &startzeit, false, call_fromfollowlist); showPos=0; break; - case CRCInput::RC_ok: case CRCInput::RC_timeout: if(fader.StartFadeOut()) { @@ -972,23 +1267,21 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } else loop = false; break; - case CRCInput::RC_favorites: - case CRCInput::RC_sat: - if( !call_fromfollowlist){ - g_RCInput->postMsg (msg, 0); - loop = false; - } - break; - default: - // konfigurierbare Keys handlen... if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) { if(fader.StartFadeOut()) { timeoutEnd = CRCInput::calcTimeoutEnd( 1 ); msg = 0; } else loop = false; - } else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) { + } + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + if (!call_fromfollowlist) { + g_RCInput->postMsg (msg, 0); + loop = false; + } + } + else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) { g_RCInput->postMsg(msg, data); loop = false; res = menu_return::RETURN_EXIT_ALL; @@ -1005,14 +1298,11 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } hide(); fader.StopFade(); + if(epgTextSwitchClear) + epgTextSwitch.clear(); } if (headerPic) delete headerPic; - if (headerText) - delete headerText; - if (header) - delete header; - return res; } @@ -1165,30 +1455,59 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st return count; } +void CEpgData::showProgressBar() +{ + //show progressbar + if (epg_done != -1) + { + int w = 104; + int x = sx + (ox - w)/2; + int h = botboxheight - 12; + int y = sy + oy - botboxheight + (botboxheight - h)/2; + + CProgressBar pb(x, y, w, h); + pb.setType(CProgressBar::PB_TIMESCALE); + pb.setValues(epg_done, 100); + pb.paint(false); + } +} // // -- Just display or hide TimerEventbar // -- 2002-05-13 rasc // -const struct button_label EpgButtons[] = +#define EpgButtonsMax 4 +const struct button_label EpgButtons[][EpgButtonsMax] = { - { NEUTRINO_ICON_BUTTON_RED , LOCALE_TIMERBAR_RECORDEVENT }, - { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH }, - { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT } - + { // full view + { NEUTRINO_ICON_BUTTON_RED, LOCALE_TIMERBAR_RECORDEVENT }, + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH }, + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT }, + { NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_CHANNELLIST_ADDITIONAL } + }, + { // w/o followscreenings + { NEUTRINO_ICON_BUTTON_RED, LOCALE_TIMERBAR_RECORDEVENT }, + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH }, + { NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_CHANNELLIST_ADDITIONAL } + }, + { // movieplayer mode + { NEUTRINO_ICON_BUTTON_RED, LOCALE_EPG_SAVING }, + { NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_CHANNELLIST_ADDITIONAL } + } }; -void CEpgData::showTimerEventBar (bool pshow, bool webzap) - +void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) { - int x,y,h,fh; + int x, y, w, h, fh; int icol_w, icol_h; - x = sx + 10; + x = sx; y = sy + oy; + w = ox; - fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + // why we don't use buttonheight member? + fh = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight(); frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); h = std::max(fh, icol_h+4); @@ -1198,33 +1517,30 @@ void CEpgData::showTimerEventBar (bool pshow, bool webzap) frameBuffer->paintBackgroundBoxRel(sx,y,ox,h); 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,"",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,"",false,COL_INFOBAR_SHADOW_TEXT,tmp_but_name.empty() ? NULL:tmp_but_name.c_str(),0); -#if 0 - // Button: Timer Record & Channelswitch - if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) + std::string adzap_button; + if (adzap) { - pos = 0; - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RED, x+8+cellwidth*pos, y+h_offset ); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+29+cellwidth*pos, y+h-h_offset, w-30, g_Locale->getText(LOCALE_TIMERBAR_RECORDEVENT), COL_INFOBAR_TEXT); + adzap_button = g_Locale->getText(LOCALE_ADZAP); + adzap_button += " " + to_string(g_settings.adzap_zapBackPeriod / 60) + " "; + adzap_button += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); + } + bool tmdb = g_settings.tmdb_enabled; + bool fscr = (has_follow_screenings && !call_fromfollowlist); + if (mp_info) + ::paintButtons(x, y, w, tmdb ? 2 : 1, EpgButtons[2], w, h); + else + { + int c = EpgButtonsMax; + if (!tmdb) + c--; // reduce tmdb button + if (!fscr) + c--; // reduce blue button + if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) + ::paintButtons(x, y, w, c, EpgButtons[fscr ? 0 : 1], w, h, "", false, COL_MENUFOOT_TEXT, adzap ? adzap_button.c_str() : NULL, 1); + else + ::paintButtons(x, y, w, c, &EpgButtons[fscr ? 0 : 1][1], w, h, "", false, COL_MENUFOOT_TEXT, adzap ? adzap_button.c_str() : NULL, 0); } - // Button: Timer Channelswitch - pos = 2; - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x+8+cellwidth*pos, y+h_offset ); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+29+cellwidth*pos, y+h-h_offset, w-30, g_Locale->getText(LOCALE_TIMERBAR_CHANNELSWITCH), COL_INFOBAR_TEXT); -#endif } // -- EPG Data Viewer Menu Handler Class diff --git a/src/gui/epgview.h b/src/gui/epgview.h index c15b00f5d..051efff92 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -39,6 +39,7 @@ #include #include +#include #include "widget/menue.h" #include @@ -56,7 +57,7 @@ class CEpgData CChannelEventList evtlist; CChannelEventList followlist; CEPGData epgData; - + CComponentsShapeSquare* header; std::string epg_date; std::string epg_start; std::string epg_end; @@ -64,6 +65,8 @@ class CEpgData bool bigFonts; bool has_follow_screenings; bool call_fromfollowlist; + bool tmdb_active; + int stars; time_t tmp_curent_zeit; uint64_t prev_id; @@ -76,25 +79,33 @@ class CEpgData int textCount; typedef std::pair epg_pair; std::vector epgText; + std::vector epgText_saved; + std::string epgTextSwitch; + std::string extMovieInfo; int topheight,topboxheight; int buttonheight,botboxheight; int medlineheight,medlinecount; + MI_MOVIE_INFO *mp_movie_info; + void GetEPGData(const t_channel_id channel_id, uint64_t id, time_t* startzeit, bool clear = true ); void GetPrevNextEPGData( uint64_t id, time_t* startzeit ); void addTextToArray( const std::string & text, int screening ); - void processTextToArray(std::string text, int screening = 0); - void showText( int startPos, int ypos ); + void processTextToArray(std::string text, int screening = 0, bool has_cover = false); + void showText(int startPos, int ypos, bool has_cover = false, bool fullClear = true); 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, bool webzap=false); + void showTimerEventBar(bool show, bool adzap = false, bool mp_info = false); + void showProgressBar(); bool isCurrentEPG(const t_channel_id channel_id); public: CEpgData(); + ~CEpgData(); void start( ); - int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false ); + int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false, bool mp_info = false ); + int show_mp(MI_MOVIE_INFO *mi, int mp_position = 0, int mp_duration = 0, bool doLoop = true); void hide(); }; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 7f6560d49..ddb63f8cb 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include #include @@ -116,10 +118,13 @@ CEventList::CEventList() oldIndex = -1; oldEventID = -1; bgRightBoxPaint = false; + header = NULL; } CEventList::~CEventList() { + delete header; + header = NULL; } void CEventList::UpdateTimerList(void) @@ -267,7 +272,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna // Calculate iheight (we assume the red button is the largest one?) struct button_label tmp_button[1] = { { NEUTRINO_ICON_BUTTON_RED, LOCALE_EVENTLISTBAR_RECORDEVENT } }; - iheight = ::paintButtons(0, 0, 0, 1, tmp_button, 0, 0, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 0, false); + iheight = ::paintButtons(0, 0, 0, 1, tmp_button, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); // Calculate theight theight = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getHeight(); @@ -326,7 +331,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna bool dont_hide = false; paintHead(channel_id, channelname, channelname_prev, channelname_next); paint(channel_id); - showFunctionBar(true, channel_id); + showFunctionBar(channel_id); int oldselected = selected; @@ -358,14 +363,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna if (msg == CRCInput::RC_up || (int) msg == g_settings.key_pageup || msg == CRCInput::RC_down || (int) msg == g_settings.key_pagedown) { - bool paint_buttonbar = false; //function bar int prev_selected = selected; - // TODO: do we need this at all? Search button is always painted IIUC... - if ((g_settings.key_channelList_addremind != (int)CRCInput::RC_nokey) || - (g_settings.key_channelList_sort != (int)CRCInput::RC_nokey) || - ((g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) && - (g_settings.key_channelList_addrecord != (int)CRCInput::RC_nokey))) - paint_buttonbar = true; int new_sel = UpDownKey(evtlist, msg, listmaxshow, selected); if (new_sel >= 0) { selected = new_sel; @@ -380,7 +378,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna else paintItem(selected - liststart, channel_id); - showFunctionBar(paint_buttonbar, channel_id); + showFunctionBar(channel_id); } //sort else if (!showfollow && (msg == (neutrino_msg_t)g_settings.key_channelList_sort)) @@ -438,7 +436,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(evtlist[selected].channelID); - showFunctionBar(true, evtlist[selected].channelID); + showFunctionBar(evtlist[selected].channelID); continue; } std::string recDir = g_settings.network_nfs_recordingdir; @@ -463,40 +461,37 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna else recDir = ""; } - t_channel_id used_id = IS_WEBTV(channel_id) ? channel_id : evtlist[selected].channelID; - if (!recDir.empty()) //add/remove recording timer events and check/warn for conflicts + bool doRecord = true; + if (g_settings.recording_already_found_check) { - if (g_Timerd->addRecordTimerEvent(used_id, - evtlist[selected].startTime, - evtlist[selected].startTime + evtlist[selected].duration, - evtlist[selected].eventID, evtlist[selected].startTime, - evtlist[selected].startTime - (ANNOUNCETIME + 120), - TIMERD_APIDS_CONF, true, recDir,false) == -1) + CHintBox loadBox(LOCALE_RECORDING_ALREADY_FOUND_CHECK, LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES); + loadBox.paint(); + CMovieBrowser moviebrowser; + const char *rec_title = evtlist[selected].description.c_str(); + bool already_found = moviebrowser.gotMovie(rec_title); + loadBox.hide(); + if (already_found) { - if(askUserOnTimerConflict(evtlist[selected].startTime - (ANNOUNCETIME + 120), evtlist[selected].startTime + evtlist[selected].duration)) //check for timer conflict - { - g_Timerd->addRecordTimerEvent(used_id, - evtlist[selected].startTime, - evtlist[selected].startTime + evtlist[selected].duration, - evtlist[selected].eventID, evtlist[selected].startTime, - evtlist[selected].startTime - (ANNOUNCETIME + 120), - TIMERD_APIDS_CONF, true, recDir,true); - - //ask user whether the timer event should be set anyway - ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); - timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); - } - } - else - { - //ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); - timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); + printf("already found in moviebrowser: %s\n", rec_title); + char message[1024]; + snprintf(message, sizeof(message)-1, g_Locale->getText(LOCALE_RECORDING_ALREADY_FOUND), rec_title); + doRecord = (ShowMsg(LOCALE_RECORDING_ALREADY_FOUND_CHECK, message, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes); } } + t_channel_id used_id = IS_WEBTV(channel_id) ? channel_id : evtlist[selected].channelID; + if (!recDir.empty() && doRecord) //add/remove recording timer events and check/warn for conflicts + { + CFollowScreenings m(channel_id, + evtlist[selected].startTime, + evtlist[selected].startTime + evtlist[selected].duration, + evtlist[selected].description, evtlist[selected].eventID, TIMERD_APIDS_CONF, true, "", &evtlist); + m.exec(NULL, ""); + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); + } timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(used_id); - showFunctionBar(true, used_id); + showFunctionBar(used_id); } } else if ( msg == (neutrino_msg_t) g_settings.key_channelList_addremind )//add/remove zapto timer event @@ -508,7 +503,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(evtlist[selected].channelID); - showFunctionBar(true, evtlist[selected].channelID); + showFunctionBar(evtlist[selected].channelID); continue; } @@ -520,7 +515,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(evtlist[selected].channelID ); - showFunctionBar(true, evtlist[selected].channelID ); + showFunctionBar(evtlist[selected].channelID ); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) @@ -531,7 +526,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna paintHead(channel_id, channelname); readEvents(epg_id); paint(channel_id); - showFunctionBar(true, channel_id); + showFunctionBar(channel_id); } else { selected = oldselected; if(fader.StartFadeOut()) { @@ -594,15 +589,18 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna oldEventID = -1; bgRightBoxPaint = false; paint(channel_id); - showFunctionBar(true, channel_id); + showFunctionBar(channel_id); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else if (msg == CRCInput::RC_epg) { - hide(); - CEPGplusHandler eplus; - eplus.exec(NULL, ""); - loop = false; + if (g_settings.eventlist_epgplus) + { + hide(); + CEPGplusHandler eplus; + eplus.exec(NULL, ""); + loop = false; + } } else if (msg==CRCInput::RC_help || msg==CRCInput::RC_ok || msg==CRCInput::RC_info) { @@ -634,7 +632,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna oldEventID = -1; bgRightBoxPaint = false; paint(channel_id); - showFunctionBar(true, channel_id); + showFunctionBar(channel_id); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } } @@ -644,14 +642,15 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna oldIndex = -1; oldEventID = -1; bgRightBoxPaint = false; - in_search = findEvents(); + in_search = findEvents(channel_id, channelname); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; loop = false; - } else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) { + } + else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) { g_RCInput->postMsg(msg, data); loop = false; res = menu_return::RETURN_EXIT_ALL; @@ -711,40 +710,32 @@ CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChan void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) { + int ypos = y+ theight+0 + pos*fheight; + unsigned int currpos = liststart + pos; + + bool i_selected = currpos == selected; + bool i_marked = currpos == current_event; + int i_radius = RADIUS_NONE; + fb_pixel_t color; fb_pixel_t bgcolor; - int ypos = y+ theight+0 + pos*fheight; - unsigned int curpos = liststart + pos; - if(RADIUS_LARGE) - frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0, 0); + getItemColors(color, bgcolor, i_selected, i_marked); - if (curpos==selected) - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - else if (curpos == current_event ) - { - color = COL_MENUCONTENT_TEXT_PLUS_1; - bgcolor = COL_MENUCONTENT_PLUS_1; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } + if (i_selected || i_marked) + i_radius = RADIUS_LARGE; - if (!RADIUS_LARGE || (curpos==selected && RADIUS_LARGE) || (curpos==current_event && RADIUS_LARGE)) - frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor, RADIUS_LARGE); + if (i_radius) + frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor, i_radius); - if(curposgetText(CLocaleManager::getWeekday(tmStartZeit)); datetime1_str += strftime(", %H:%M", tmStartZeit); @@ -753,12 +744,12 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) if ( m_showChannel ) // show the channel if we made a event search only (which could be made through all channels ). { - t_channel_id channel = evtlist[curpos].channelID; + t_channel_id channel = evtlist[currpos].channelID; datetime1_str += " "; datetime1_str += CServiceManager::getInstance()->GetServiceName(channel); } - snprintf(tmpstr,sizeof(tmpstr), "[%d %s]", evtlist[curpos].duration / 60, unit_short_minute); + snprintf(tmpstr,sizeof(tmpstr), "[%d %s]", evtlist[currpos].duration / 60, unit_short_minute); duration_str = tmpstr; } @@ -767,7 +758,7 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x+5, ypos+ fheight1+3, fwidth1a, datetime1_str, color); - int seit = ( evtlist[curpos].startTime - time(NULL) ) / 60; + int seit = ( evtlist[currpos].startTime - time(NULL) ) / 60; if ( (seit> 0) && (seit<100) && (!duration_str.empty()) ) { char beginnt[100]; @@ -779,9 +770,9 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) // 2nd line // set status icons - t_channel_id channel_tmp = m_showChannel ? evtlist[curpos].channelID : channel_idI; + t_channel_id channel_tmp = m_showChannel ? evtlist[currpos].channelID : channel_idI; int timerID = -1; - CTimerd::CTimerEventTypes etype = isScheduled(channel_tmp, &evtlist[curpos],&timerID); + CTimerd::CTimerEventTypes etype = isScheduled(channel_tmp, &evtlist[currpos],&timerID); const char * icontype = etype == CTimerd::TIMER_ZAPTO ? NEUTRINO_ICON_ZAP : 0; if(etype == CTimerd::TIMER_RECORD){ icontype = NEUTRINO_ICON_REC;// NEUTRINO_ICON_RECORDING_EVENT_MARKER @@ -796,21 +787,21 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) } // detecting timer conflict and set start position of event text depending of possible painted icon - bool conflict = HasTimerConflicts(evtlist[curpos].startTime, evtlist[curpos].duration, &item_event_ID); + bool conflict = HasTimerConflicts(evtlist[currpos].startTime, evtlist[currpos].duration, &item_event_ID); int i2w = 0, i2h; - //printf ("etype %d , conflicts %d -> %s, conflict event_ID %d -> current event_ID %d\n", etype, conflict, evtlist[curpos].description.c_str(), item_event_ID, evtlist[curpos].eventID); + //printf ("etype %d , conflicts %d -> %s, conflict event_ID %d -> current event_ID %d\n", etype, conflict, evtlist[currpos].description.c_str(), item_event_ID, evtlist[currpos].eventID); //TODO: solution for zapto timer events - if (conflict && item_event_ID != evtlist[curpos].eventID) + if (conflict && item_event_ID != evtlist[currpos].eventID) { //paint_warning = true; - frameBuffer->getIconSize(NEUTRINO_ICON_IMPORTANT, &i2w, &i2h); - frameBuffer->paintIcon(NEUTRINO_ICON_IMPORTANT, x+iw+7, ypos + fheight1+3 - (fheight1 - i2h)/2, fheight1); - iw += i2w+4; + frameBuffer->getIconSize(NEUTRINO_ICON_IMPORTANT, &i2w, &i2h); + frameBuffer->paintIcon(NEUTRINO_ICON_IMPORTANT, x+iw+7, ypos + fheight1+3 - (fheight1 - i2h)/2, fheight1); + iw += i2w+4; } // paint 2nd line text - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x+10+iw, ypos+ fheight, width- 25- 20 -iw, evtlist[curpos].description, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x+10+iw, ypos+ fheight, width- 25- 20 -iw, evtlist[currpos].description, color); } } @@ -857,16 +848,19 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s int font_mid = SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE; int font_lr = SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE; - CComponentsFrmChain header(x, y, full_width, theight); - header.enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); - header.setCorner(RADIUS_LARGE, CORNER_TOP); + if (!header){ + header = new CComponentsFrmChain(x, y, full_width, theight); + header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); + header->setCorner(RADIUS_LARGE, CORNER_TOP); + } + header->clear(); int x_off = 10; int mid_width = full_width * 40 / 100; // 40% int side_width = ((full_width - mid_width) / 2) - (2 * x_off); //create an logo object - CComponentsChannelLogo* midLogo = new CComponentsChannelLogo(0, 0, _channelname, _channel_id, &header); + CComponentsChannelLogoScalable* midLogo = new CComponentsChannelLogoScalable(0, 0, _channelname, _channel_id, header); if (midLogo->hasLogo()) { //if logo object has found a logo and was ititialized, the hand it's size int w_logo = midLogo->getWidth(); @@ -885,24 +879,24 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s side_width = ((full_width - w_logo) / 2) - (4 * x_off); } else { - header.removeCCItem(midLogo); //remove/destroy logo object, if it is not available - CComponentsText *midText = new CComponentsText(CC_CENTERED, CC_CENTERED, mid_width, theight, _channelname, CTextBox::CENTER, g_Font[font_mid], CComponentsText::FONT_STYLE_REGULAR, &header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + header->removeCCItem(midLogo); //remove/destroy logo object, if it is not available + CComponentsText *midText = new CComponentsText(CC_CENTERED, CC_CENTERED, mid_width, theight, _channelname, CTextBox::CENTER, g_Font[font_mid], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); midText->doPaintBg(false); } if (!_channelname_prev.empty()) { - CComponentsText *lText = new CComponentsText(x_off, CC_CENTERED, side_width, theight, _channelname_prev, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, &header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + CComponentsText *lText = new CComponentsText(x_off, CC_CENTERED, side_width, theight, _channelname_prev, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); lText->doPaintBg(false); } if (!_channelname_next.empty()) { int name_w = std::min(g_Font[font_lr]->getRenderWidth(_channelname_next), side_width); int x_pos = full_width - name_w - x_off; - CComponentsText *rText = new CComponentsText(x_pos, CC_CENTERED, name_w, theight, _channelname_next, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, &header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + CComponentsText *rText = new CComponentsText(x_pos, CC_CENTERED, name_w, theight, _channelname_next, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); rText->doPaintBg(false); } - header.paint(CC_SAVE_SCREEN_NO); + header->paint(CC_SAVE_SCREEN_NO); } void CEventList::paint(t_channel_id channel_id) @@ -925,30 +919,24 @@ void CEventList::paint(t_channel_id channel_id) int ypos = y+ theight; int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); int sbc= ((evtlist.size()- 1)/ listmaxshow)+ 1; int sbs= (selected/listmaxshow); if (sbc < 1) sbc = 1; - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); + frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); } -void CEventList::showFunctionBar (bool show, t_channel_id channel_id) +void CEventList::showFunctionBar(t_channel_id channel_id) { int bx = x; int bw = full_width; int bh = iheight; int by = y + height - bh; - if (! show) { - // -- hide only? - frameBuffer->paintBackgroundBoxRel(bx,by,bw,bh); - return; - } - CColorKeyHelper keyhelper; //user_menue.h neutrino_msg_t dummy = CRCInput::RC_nokey; const char * icon = NULL; @@ -1028,12 +1016,11 @@ int CEventListHandler::exec(CMenuTarget* parent, const std::string &/*actionkey* } /************************************************************************************************/ -bool CEventList::findEvents(void) +bool CEventList::findEvents(t_channel_id channel_id, std::string channelname) /************************************************************************************************/ { bool res = false; int event = 0; - t_channel_id channel_id = 0; if((m_search_keyword.empty() || m_search_keyword == m_search_autokeyword) && evtlist[selected].eventID != 0) { @@ -1124,14 +1111,11 @@ bool CEventList::findEvents(void) } if(evtlist.empty()) { - if ( evtlist.empty() ) - { - CChannelEvent evt; - //evt.description = m_search_keyword + ": " + g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND); - evt.description = g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND); - evt.eventID = 0; - evtlist.push_back(evt); - } + CChannelEvent evt; + //evt.description = m_search_keyword + ": " + g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND); + evt.description = g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND); + evt.eventID = 0; + evtlist.push_back(evt); } if (current_event == (unsigned int)-1) current_event = 0; @@ -1144,7 +1128,7 @@ bool CEventList::findEvents(void) if(!m_search_keyword.empty()){ g_settings.epg_search_history.push_front(m_search_keyword); std::list::iterator it = g_settings.epg_search_history.begin(); - it++; + ++it; while (it != g_settings.epg_search_history.end()) { if (*it == m_search_keyword) it = g_settings.epg_search_history.erase(it); @@ -1157,9 +1141,12 @@ bool CEventList::findEvents(void) } } - paintHead(0, search_head_name); + if(event) + paintHead(0, search_head_name); + else + paintHead(channel_id, channelname); paint(); - showFunctionBar(true, channel_id); + showFunctionBar(channel_id); return(res); } diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index a5d9b9737..2c47b63e3 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -75,12 +75,11 @@ class CEventList : public CListHelpers t_channel_id m_search_channel_id; t_bouquet_id m_search_bouquet_id; bool m_showChannel; - int FunctionBarHeight; int oldIndex; event_id_t oldEventID; bool bgRightBoxPaint; - bool findEvents(void); + bool findEvents(t_channel_id channel_id, std::string channelname); // Eventfinder end CFrameBuffer *frameBuffer; @@ -91,25 +90,23 @@ class CEventList : public CListHelpers unsigned int current_event; unsigned int liststart; unsigned int listmaxshow; - unsigned int numwidth; int fheight; // Fonthoehe Channellist-Inhalt int fheight1,fheight2; int fwidth1,fwidth2; int theight; // Fonthoehe Channellist-Titel int iheight; // Height info bar - int key; std::string search_head_name; - int full_width, width, infozone_width, fw; - int height, infozone_height, fh; + int full_width, width, infozone_width; + int height; int x; int y; std::string infozone_text; int sort_mode; event_id_t item_event_ID; CComponentsText *cc_infozone; - + CComponentsFrmChain *header; const char * unit_short_minute; void paintItem(unsigned pos, t_channel_id channel_id = 0); @@ -117,7 +114,7 @@ class CEventList : public CListHelpers void paint(t_channel_id channel_id = 0); void paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev = "", std::string _channelname_next = ""); void hide(); - void showFunctionBar(bool show, t_channel_id channel_id); + void showFunctionBar(t_channel_id channel_id); int timerPre; int timerPost; diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 89de8df40..6b8c2e538 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -263,7 +263,7 @@ void CFileBrowser::fontInit() { fnt_title = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]; fnt_item = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]; - fnt_small = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; + fnt_foot = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]; width = frameBuffer->getScreenWidthRel(); height = frameBuffer->getScreenHeightRel(); x = getScreenStartX(width); @@ -272,7 +272,7 @@ void CFileBrowser::fontInit() fheight = fnt_item->getHeight(); if (fheight == 0) fheight = 1; /* avoid div by zero on invalid font */ - //foheight = fnt_small->getHeight()+6; //initial height value for buttonbar; TODO get value from buttonbar + //foheight = fnt_foot->getHeight()+6; //initial height value for buttonbar; TODO get value from buttonbar foheight = paintFoot(false); skwidth = 26; @@ -323,7 +323,7 @@ void CFileBrowser::ChangeDir(const std::string & filename, int selection) readDir(newpath, &allfiles); // filter CFileList::iterator file = allfiles.begin(); - for(; file != allfiles.end() ; file++) + for(; file != allfiles.end() ; ++file) { if (Filter != NULL && !file->isDir() && use_filter) { @@ -1168,38 +1168,36 @@ void CFileBrowser::hide() void CFileBrowser::paintItem(unsigned int pos) { int colwidth1, colwidth2, colwidth3; - int c_rad_small = 0; - fb_pixel_t color; - fb_pixel_t bgcolor; int ypos = y+ theight+0 + pos*fheight; CFile * actual_file = NULL; std::string fileicon; - unsigned int curr = liststart + pos; + unsigned int currpos = liststart + pos; - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0/*DARK*/); - - if (curr >= filelist.size()) + if (currpos >= filelist.size()) + { + // just paint an empty line + frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); return; - - actual_file = &filelist[curr]; - if (curr == selected) - { - color = actual_file->Marked ? COL_MENUCONTENTINACTIVE_TEXT : COL_MENUCONTENTSELECTED_TEXT; - bgcolor = actual_file->Marked ? COL_MENUCONTENTSELECTED_PLUS_2 : COL_MENUCONTENTSELECTED_PLUS_0; - c_rad_small = RADIUS_SMALL; - } - else if (actual_file->Marked) - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_2; - } - else - { - color = COL_MENUCONTENT_TEXT;//DARK; - bgcolor = COL_MENUCONTENT_PLUS_0;//DARK; } - frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, c_rad_small); + actual_file = &filelist[currpos]; + + bool i_selected = currpos == selected; + bool i_marked = actual_file->Marked; + bool i_switch = false; //(currpos < filelist.size()) && (pos & 1); + int i_radius = RADIUS_NONE; + + fb_pixel_t color; + fb_pixel_t bgcolor; + + getItemColors(color, bgcolor, i_selected, i_marked, i_switch); + + if (i_selected || i_marked) + i_radius = RADIUS_LARGE; + + if (i_radius) + frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, i_radius); if (g_settings.filebrowser_showrights == 0 && S_ISREG(actual_file->Mode)) colwidth2 = 0; @@ -1210,7 +1208,7 @@ void CFileBrowser::paintItem(unsigned int pos) if ( !actual_file->Name.empty() ) { - if (curr == selected) + if (currpos == selected) CVFD::getInstance()->showMenuText(0, FILESYSTEM_ENCODING_TO_UTF8_STRING(actual_file->getFileName()).c_str(), -1, true); // UTF-8 switch(actual_file->getType()) @@ -1375,10 +1373,10 @@ int CFileBrowser::paintFoot(bool show) std::string sort_text = g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT); sort_text += g_Locale->getText(sortByNames[g_settings.filebrowser_sortmethod]); - int sort_text_len = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT)); + int sort_text_len = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT)); int len = 0; for (int i = 0; i < FILEBROWSER_NUMBER_OF_SORT_VARIANTS; i++) - len = std::max(len, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(sortByNames[i]))); + len = std::max(len, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(sortByNames[i]))); sort_text_len += len; @@ -1417,7 +1415,7 @@ int CFileBrowser::paintFoot(bool show) if (filelist.empty()) { - frameBuffer->paintBoxRel(x, y + height - foheight, width, foheight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x, y + height - foheight, width, foheight, COL_MENUFOOT_PLUS_0, RADIUS_MID, CORNER_BOTTOM); return foheight; } if (playlistmode) @@ -1430,17 +1428,17 @@ int CFileBrowser::paintFoot(bool show) void CFileBrowser::paintSMSKey() { - int skheight = fnt_small->getHeight(); + int skheight = fnt_foot->getHeight(); //background - frameBuffer->paintBoxRel(x + width - skwidth, y + height - foheight, skwidth, foheight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM_RIGHT); + frameBuffer->paintBoxRel(x + width - skwidth, y + height - foheight, skwidth, foheight, COL_MENUFOOT_PLUS_0, RADIUS_MID, CORNER_BOTTOM_RIGHT); if(m_SMSKeyInput.getOldKey()!=0) { char cKey[2] = {m_SMSKeyInput.getOldKey(), 0}; cKey[0] = toupper(cKey[0]); - int len = fnt_small->getRenderWidth(cKey); - fnt_small->RenderString(x + width - skwidth, y + height - foheight + foheight/2 + skheight/2, len, cKey, COL_MENUHEAD_TEXT); + int len = fnt_foot->getRenderWidth(cKey); + fnt_foot->RenderString(x + width - skwidth, y + height - foheight + foheight/2 + skheight/2, len, cKey, COL_MENUHEAD_TEXT); } } @@ -1456,14 +1454,14 @@ void CFileBrowser::paint() //scrollbar int ypos = y+ theight; int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); int sbc= ((filelist.size()- 1)/ listmaxshow)+ 1; int sbs= (selected/listmaxshow); if (sbc < 1) sbc = 1; - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3, RADIUS_SMALL); + frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_SMALL); } void CFileBrowser::SMSInput(const neutrino_msg_t msg) diff --git a/src/gui/filebrowser.h b/src/gui/filebrowser.h index b0f640821..16e13b916 100644 --- a/src/gui/filebrowser.h +++ b/src/gui/filebrowser.h @@ -147,7 +147,7 @@ class CFileBrowser CFrameBuffer *frameBuffer; Font *fnt_title; Font *fnt_item; - Font *fnt_small; + Font *fnt_foot; CFileList selected_filelist; bool readDir(const std::string & dirname, CFileList* flist); diff --git a/src/gui/followscreenings.cpp b/src/gui/followscreenings.cpp new file mode 100644 index 000000000..292878930 --- /dev/null +++ b/src/gui/followscreenings.cpp @@ -0,0 +1,187 @@ +/* + Neutrino-GUI - DBoxII-Project + + Copyright (C) 2001 Steffen Hehn 'McClean' + Copyright (C) 2013 martii + Homepage: http://dbox.cyberphoria.org/ + + Kommentar: + + Diese GUI wurde von Grund auf neu programmiert und sollte nun vom + Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert + auf der Client-Server Idee, diese GUI ist also von der direkten DBox- + Steuerung getrennt. Diese wird dann von Daemons uebernommen. + + + 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifdef HAVE_CONFIG_H +#include +#endif + +//#include +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include + +CFollowScreenings::~CFollowScreenings() +{ + followlist.clear(); +} + +CChannelEventList *CFollowScreenings::getFollowScreenings(void) +{ + if (evtlist && followlist.empty()) { + CChannelEventList::iterator e; + for (e = evtlist->begin(); e != evtlist->end(); ++e) + { + if (e->startTime < starttime) // this includes the current event + continue; + if (! e->eventID) + continue; + if (e->description != title) + continue; + followlist.push_back(*e); + } + } + return &followlist; +} + +int CFollowScreenings::exec(CMenuTarget* /*parent*/, const std::string & actionKey) +{ + unsigned long a; + if (1 == sscanf(actionKey.c_str(), "%lu", &a)) { + int ix = 0; + CChannelEventList::iterator e; + for (e = followlist.begin(); e != followlist.end(); e++, ix++) + if ((time_t)a == e->startTime) { + time_t start = e->startTime - (ANNOUNCETIME + 120); + time_t stop = e->startTime + e->duration; + CTimerd::TimerList overlappingTimers = Timer.getOverlappingTimers(start, stop); + CTimerd::TimerList::iterator i; + for (i = overlappingTimers.begin(); i != overlappingTimers.end(); i++) + if (i->eventType == CTimerd::TIMER_RECORD) { + if (channel_id == i->channel_id && e->startTime == i->epg_starttime) { + Timer.removeTimerEvent(i->eventID); +#if 0 + if (followlist.size() > 1) + forwarders[ix]->iconName_Info_right = ""; + else + ShowMsg(LOCALE_TIMER_EVENTREMOVED_TITLE, LOCALE_TIMER_EVENTREMOVED_MSG, + CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); +#else + forwarders[ix]->iconName_Info_right = ""; +#endif + return menu_return::RETURN_REPAINT; + } + if (!SAME_TRANSPONDER(channel_id, i->channel_id)) { + if (!askUserOnTimerConflict(start, stop, channel_id)) + return menu_return::RETURN_REPAINT; + } + } + + if (g_Timerd->addRecordTimerEvent(channel_id, e->startTime, e->startTime + e->duration, e->eventID, + e->startTime, e->startTime - (ANNOUNCETIME + 120 ), apids, true, e->startTime - (ANNOUNCETIME + 120) > time(NULL), recDir, true) == -1) { + //FIXME -- no error handling, but this shouldn't happen ... + } else { +#if 0 + if (followlist.size() > 1) + forwarders[ix]->iconName_Info_right = NEUTRINO_ICON_REC; + else + ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, + CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); +#else + forwarders[ix]->iconName_Info_right = NEUTRINO_ICON_REC; +#endif + return menu_return::RETURN_REPAINT; + } + break; // for + } + return menu_return::RETURN_EXIT_ALL; + } + show(); + return menu_return::RETURN_EXIT_ALL; +} + +void CFollowScreenings::updateRightIcon(int ix, time_t start, unsigned int duration) { + time_t stop = start + duration; + start -= (ANNOUNCETIME + 120); + CTimerd::TimerList overlappingTimers = Timer.getOverlappingTimers(start, stop); + start += (ANNOUNCETIME + 120); + CTimerd::TimerList::iterator i; + for (i = overlappingTimers.begin(); i != overlappingTimers.end(); i++) + if (i->eventType == CTimerd::TIMER_RECORD) { + if (channel_id == i->channel_id && start == i->epg_starttime) { + forwarders[ix]->iconName_Info_right = NEUTRINO_ICON_REC; + return; + } + if (!SAME_TRANSPONDER(channel_id, i->channel_id)) { + forwarders[ix]->iconName_Info_right = NEUTRINO_ICON_IMPORTANT; + return; + } + } +} + +void CFollowScreenings::show() +{ + char actionstr[32]; + + getFollowScreenings(); + +#if 0 + if (followlist.size() == 1) { + snprintf(actionstr, sizeof(actionstr), "%lu", followlist.front().startTime); + exec(NULL, actionstr); + } else { +#endif + CMenuWidget m(LOCALE_EPGVIEWER_SELECT_SCREENING, NEUTRINO_ICON_SETTINGS); + const char *icon = NEUTRINO_ICON_BUTTON_RED; + neutrino_msg_t directKey = CRCInput::RC_red; + CChannelEventList::iterator e; + int i = 0; + for (e = followlist.begin(); e != followlist.end(); e++, i++) + { + struct tm *tmStartZeit = localtime(&(e->startTime)); + std::string screening_date = g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); + screening_date += '.'; + screening_date += strftime(" %d.", tmStartZeit); + screening_date += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); + screening_date += strftime(". %H:%M", tmStartZeit ); + snprintf(actionstr, sizeof(actionstr), "%lu", e->startTime); + forwarders.push_back(new CMenuForwarder(screening_date, true, NULL, this, actionstr, directKey, icon)); + updateRightIcon(i, e->startTime, e->duration); + m.addItem(forwarders[i]); + directKey = CRCInput::convertDigitToKey(1 + i); + icon = NULL; + } + m.enableSaveScreen(true); + m.exec(NULL, ""); +#if 0 + } +#endif +} + diff --git a/src/gui/followscreenings.h b/src/gui/followscreenings.h new file mode 100644 index 000000000..53e362e3e --- /dev/null +++ b/src/gui/followscreenings.h @@ -0,0 +1,80 @@ +/* + Neutrino-GUI - DBoxII-Project + + Copyright (C) 2001 Steffen Hehn 'McClean' + Copyright (C) 2013 martii + Homepage: http://dbox.cyberphoria.org/ + + Kommentar: + + Diese GUI wurde von Grund auf neu programmiert und sollte nun vom + Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert + auf der Client-Server Idee, diese GUI ist also von der direkten DBox- + Steuerung getrennt. Diese wird dann von Daemons uebernommen. + + + 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + + +#ifndef __followscreening_ +#define __followscreening_ + +#include "widget/menue.h" +#include +#include +#include +#include + +class CFollowScreenings : public CMenuTarget +{ + private: + CEPGData *epgData; + CChannelEventList *evtlist; + CChannelEventList followlist; + CTimerdClient Timer; + t_channel_id channel_id; + time_t starttime; + time_t stoptime; + std::string title; + uint64_t epgID; + unsigned char apids; + bool safety; + std::string recDir; + CTimerd::RecordingInfo eventInfo; + std::vector forwarders; + void updateRightIcon(int i, time_t start, unsigned int duration); + public: + CFollowScreenings(const t_channel_id Channel_id, time_t Starttime, time_t Stoptime, const std::string &Title, uint64_t EpgID=0, + unsigned char Apids=TIMERD_APIDS_STD, bool Safety=false, std::string RecDir="", CChannelEventList *Evtlist=NULL) : CMenuTarget () { + this->channel_id = Channel_id; + this->starttime = Starttime; + this->stoptime = Stoptime; + this->epgID = EpgID; + this->recDir = RecDir; + this->evtlist = Evtlist; + this->title = Title; + this->safety = Safety; + this->apids = Apids; + }; + ~CFollowScreenings(); + CChannelEventList *getFollowScreenings(void); + int exec(CMenuTarget *parent, const std::string & actionKey); + void show(); +}; +#endif + diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index f60f01101..c3876b2a9 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -1253,6 +1253,11 @@ int CHDDMenuHandler::checkDevice(std::string dev) int percent = 0, opercent = 0; char buf[256] = { 0 }; + bool loop; + uint64_t timeoutEnd; + neutrino_msg_t msg; + neutrino_msg_data_t data; + std::string devname = "/dev/" + dev; printf("CHDDMenuHandler::checkDevice: dev %s\n", dev.c_str()); @@ -1322,7 +1327,16 @@ int CHDDMenuHandler::checkDevice(std::string dev) progress->showGlobalStatus(100); progress->showStatusMessageUTF(buf); - sleep(2); + + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); + loop = true; + while (loop) + { + g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd); + if (msg == CRCInput::RC_timeout || msg == CRCInput::RC_ok || msg == CRCInput::RC_home) + loop = false; + } + progress->hide(); delete progress; diff --git a/src/gui/hdd_menu.h b/src/gui/hdd_menu.h index 2273dc209..617a7cb11 100644 --- a/src/gui/hdd_menu.h +++ b/src/gui/hdd_menu.h @@ -67,7 +67,7 @@ class CHDDMenuHandler : public CMenuTarget std::set kernel_fs_list; struct cmp_hdd_by_name: public binary_function { - bool operator() (const struct hdd_s c1, const struct hdd_s c2) + bool operator() (const struct hdd_s &c1, const struct hdd_s &c2) { return std::lexicographical_compare(c1.devname.begin(), c1.devname.end(), c2.devname.begin(), c2.devname.end()); }; diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 596419934..c3de0d622 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -38,9 +38,17 @@ #include #include #include +#include #include "version.h" #include #define LICENSEDIR DATADIR "/neutrino/license/" +#ifdef ENABLE_LUA +#include +#endif +#include + +#define VERSION_FILE TARGET_PREFIX "/.version" +#define Y_VERSION_FILE DATADIR "/neutrino/httpd/Y_Version.txt" using namespace std; @@ -62,12 +70,12 @@ void CImageInfo::Init(void) b_info = NULL; btn_red = NULL; item_offset = 10; - item_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]; - item_height = item_font->getHeight(); + item_font = NULL; + item_height = 0; license_txt = ""; v_info.clear(); - config.loadConfig("/.version"); + config.loadConfig(VERSION_FILE); } CImageInfo::~CImageInfo() @@ -105,7 +113,8 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) //init window object, add cc-items and paint all ShowWindow(); - + bool fadeout = false; + neutrino_msg_t postmsg = 0; neutrino_msg_t msg; while (1) { @@ -113,9 +122,23 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) uint64_t timeoutEnd = CRCInput::calcTimeoutEnd_MS(100); g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); + if ((msg == NeutrinoMessages::EVT_TIMER) && (data ==cc_win->GetFadeTimer())){ + if (cc_win->FadeDone()) + break; + continue; + } + if (fadeout && msg == CRCInput::RC_timeout){ + if (cc_win->StartFadeOut()){ + msg = menu_return::RETURN_EXIT_ALL; + continue; + } + else + break; + } + if(msg == CRCInput::RC_setup) { res = menu_return::RETURN_EXIT_ALL; - break; + fadeout = true; } else if (msg == CRCInput::RC_red){ // init temporarly vars @@ -151,10 +174,10 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) btn_red->kill(); btn_red->paint(false); } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { - g_RCInput->postMsg (msg, 0); + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + postmsg = msg; res = menu_return::RETURN_EXIT_ALL; - break; + fadeout = true; } else if ((msg == CRCInput::RC_up) || (msg == CRCInput::RC_page_up)) { ScrollLic(false); @@ -163,7 +186,7 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) ScrollLic(true); } else if (msg <= CRCInput::RC_MaxRC){ - break; + fadeout = true; } if ( msg > CRCInput::RC_MaxRC && msg != CRCInput::RC_timeout){ @@ -172,8 +195,10 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) } + if (postmsg) + g_RCInput->postMsg(postmsg, 0); + hide(); - return res; } @@ -189,7 +214,7 @@ void CImageInfo::ShowWindow() fb_pixel_t btn_col = /*g_settings.theme.Button_gradient ? COL_BUTTON_BODY :*/ footer->getColorBody(); //TODO: Button_gradient option btn_red = new CComponentsButtonRed(10, CC_CENTERED, 250, h_footer-h_footer/4, LOCALE_BUILDINFO_MENU, footer, false , true, false, footer->getColorBody(), btn_col); btn_red->doPaintBg(false); - btn_red->setButtonTextColor(COL_INFOBAR_SHADOW_TEXT); + btn_red->setButtonTextColor(COL_MENUFOOT_TEXT); btn_red->setColBodyGradient(CC_COLGRAD_OFF); } @@ -206,6 +231,7 @@ void CImageInfo::ShowWindow() InitInfoText(getLicenseText()); //paint window + cc_win->StartFadeIn(); cc_win->paint(CC_SAVE_SCREEN_NO); } @@ -276,6 +302,23 @@ void CImageInfo::InitInfoData() #endif image_info_t date = {LOCALE_IMAGEINFO_DATE, builddate}; v_info.push_back(date); + string s_api; +#ifdef ENABLE_LUA + s_api += "LUA " + to_string(LUA_API_VERSION_MAJOR) + "." + to_string(LUA_API_VERSION_MINOR); + s_api += ", "; +#endif + s_api += "yWeb "; + s_api += getYApi(); + s_api += ", "; + s_api += HTTPD_NAME; + s_api += + " "; + s_api += HTTPD_VERSION; + s_api += + ", "; + s_api += YHTTPD_NAME; + s_api += + " "; + s_api += YHTTPD_VERSION; + image_info_t api = {LOCALE_IMAGEINFO_API, s_api}; + v_info.push_back(api); if (uname(&uts_info) == 0) { image_info_t kernel = {LOCALE_IMAGEINFO_KERNEL, uts_info.release}; v_info.push_back(kernel); @@ -307,15 +350,19 @@ void CImageInfo::InitInfos() //set width, use size between left border and minitv cc_info->setWidth(cc_win->getWidth() - cc_tv->getWidth() - 2*item_offset); - //calculate initial height for info form - cc_info->setHeight(v_info.size()*item_height); - //create label and text items for (size_t i=0; igetWidth(), item_height, g_Locale->getText(v_info[i].caption), v_info[i].info_text); - item->setLabelAndTextFont(item_font); + CComponentsExtTextForm *item = new CComponentsExtTextForm(1, CC_APPEND, cc_info->getWidth(), 0, g_Locale->getText(v_info[i].caption), v_info[i].info_text); item->setLabelWidthPercent(20); + if (!item_font){ + item_font = item->getFont(); + //calculate initial height for info form + item_height = item_font->getHeight(); + } + item->setHeight(item_height); + cc_info->setHeight(v_info.size()*item_height); + if ((i == 0) && (item->getYPos() == CC_APPEND)) item->setYPos(1); @@ -408,6 +455,17 @@ void CImageInfo::hide() printf("[CImageInfo] [%s - %d] hide...\n", __FUNCTION__, __LINE__); if (cc_win){ cc_win->kill(); + cc_win->StopFade(); Clean(); } } + +string CImageInfo::getYApi() +{ + string ret; + config.loadConfig(Y_VERSION_FILE); + ret = config.getString("version", "n/a"); + config.loadConfig(VERSION_FILE); + return ret; +} + diff --git a/src/gui/imageinfo.h b/src/gui/imageinfo.h index 150c6dc9e..a243866b4 100644 --- a/src/gui/imageinfo.h +++ b/src/gui/imageinfo.h @@ -63,6 +63,7 @@ class CImageInfo : public CMenuTarget std::string getLicenseText(); void ShowWindow(); void ScrollLic(bool scrollDown); + std::string getYApi(); CComponentsWindowMax *cc_win; CComponentsForm *cc_info; diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index bd28a7f21..0971e2401 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -36,7 +36,7 @@ -CInfoClock::CInfoClock():CComponentsFrmClock( 1, 1, NULL, "%H:%M:%S", NULL, false, 1, NULL, CC_SHADOW_ON, COL_LIGHT_GRAY, COL_MENUCONTENT_PLUS_0,COL_MENUCONTENTDARK_PLUS_0) +CInfoClock::CInfoClock():CComponentsFrmClock( 1, 1, NULL, "%H:%M:%S", NULL, false, 1, NULL, CC_SHADOW_ON) { initCCLockItems(); } @@ -54,13 +54,13 @@ void CInfoClock::initCCLockItems() paint_bg = g_settings.infoClockBackground; //use current theme colors - setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENT_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); + setColorAll(COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); //set text color if (paint_bg){ cl_col_text = COL_MENUCONTENT_TEXT; setColorBody(COL_MENUCONTENT_PLUS_0); - enableShadow(CC_SHADOW_ON, 3); + enableShadow(CC_SHADOW_ON, OFFSET_SHADOW/2); }else{ cl_col_text = COL_INFOCLOCK_TEXT; setColorBody(COL_BACKGROUND_PLUS_0); diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 1093fd837..e7dc4a436 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -54,9 +54,9 @@ #include #include +#include #include #include -#include #include #include #include @@ -79,7 +79,7 @@ extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern CBouquetList * bouquetList; /* neutrino.cpp */ extern CPictureViewer * g_PicViewer; extern cVideo * videoDecoder; -extern CInfoClock *InfoClock; + #define LEFT_OFFSET 5 @@ -163,6 +163,9 @@ void CInfoViewer::Init() rt_x = rt_y = rt_h = rt_w = 0; infobar_txt = NULL; + + _livestreamInfo1.clear(); + _livestreamInfo2.clear(); } /* @@ -209,7 +212,7 @@ void CInfoViewer::start () BoxEndY = g_settings.screen_EndY - 10 - infoViewerBB->InfoHeightY_Info - infoViewerBB->bottom_bar_offset; BoxStartY = BoxEndY - InfoHeightY - ChanHeight / 2; - ChanNameY = BoxStartY + (ChanHeight / 2) + SHADOW_OFFSET; + ChanNameY = BoxStartY + (ChanHeight / 2) + OFFSET_SHADOW; ChanInfoX = BoxStartX + (ChanWidth / 3); initClock(); @@ -225,18 +228,17 @@ void CInfoViewer::ResetPB() } if (timescale){ - if (g_settings.infobar_progressbar == SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_DEFAULT) - timescale->kill(); - delete timescale; - timescale = NULL; + timescale->reset(); } } void CInfoViewer::changePB() { ResetPB(); - timescale = new CProgressBar(); - timescale->setType(CProgressBar::PB_TIMESCALE); + if (!timescale){ + timescale = new CProgressBar(); + timescale->setType(CProgressBar::PB_TIMESCALE); + } } void CInfoViewer::initClock() @@ -248,10 +250,9 @@ void CInfoViewer::initClock() if (clock == NULL){ clock = new CComponentsFrmClock(); clock->setClockFormat("%H:%M", "%H %M"); - clock->setClockIntervall(1); } - InfoClock->getInstance()->disableInfoClock(); + CInfoClock::getInstance()->disableInfoClock(); clock->enableColBodyGradient(gradient_top, COL_INFOBAR_PLUS_0); clock->doPaintBg(!gradient_top); clock->enableTboxSaveScreen(gradient_top); @@ -264,106 +265,119 @@ void CInfoViewer::initClock() void CInfoViewer::showRecordIcon (const bool show) { + /* FIXME if record or timeshift stopped while infobar visible, artifacts */ + CRecordManager * crm = CRecordManager::getInstance(); recordModeActive = crm->RecordingStatus(); - /* FIXME if record or timeshift stopped while infobar visible, artifacts */ if (recordModeActive) { - std::string Icon_Rec = NEUTRINO_ICON_REC_GRAY, Icon_Ts = NEUTRINO_ICON_AUTO_SHIFT_GRAY; - t_channel_id cci = g_RemoteControl->current_channel_id; + std::string rec_icon = NEUTRINO_ICON_REC_GRAY; + std::string ts_icon = NEUTRINO_ICON_AUTO_SHIFT_GRAY; + t_channel_id cci = g_RemoteControl->current_channel_id; /* global record mode */ int rec_mode = crm->GetRecordMode(); /* channel record mode */ int ccrec_mode = crm->GetRecordMode(cci); /* set 'active' icons for current channel */ - if (ccrec_mode & CRecordManager::RECMODE_TSHIFT) - Icon_Ts = NEUTRINO_ICON_AUTO_SHIFT; - if (ccrec_mode & CRecordManager::RECMODE_REC) - Icon_Rec = NEUTRINO_ICON_REC; + rec_icon = NEUTRINO_ICON_REC; - int records = crm->GetRecordCount(); - + if (ccrec_mode & CRecordManager::RECMODE_TSHIFT) + ts_icon = NEUTRINO_ICON_AUTO_SHIFT; - const int ChanName_X = BoxStartX + ChanWidth + SHADOW_OFFSET; - const int icon_space = 3, box_posY = 12; - int box_len = 0, rec_icon_posX = 0, ts_icon_posX = 0; + int records = crm->GetRecordCount(); - int rec_icon_w = 0, rec_icon_h = 0, ts_icon_w = 0, ts_icon_h = 0; - frameBuffer->getIconSize(Icon_Rec.c_str(), &rec_icon_w, &rec_icon_h); - frameBuffer->getIconSize(Icon_Ts.c_str(), &ts_icon_w, &ts_icon_h); + int txt_h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + int txt_w = 0; + + int box_x = BoxStartX + ChanWidth + 2*OFFSET_SHADOW; + int box_y = BoxStartY + OFFSET_SHADOW; + int box_w = 0; + int box_h = txt_h; + + int icon_space = OFFSET_SHADOW/2; + + int rec_icon_x = 0, rec_icon_w = 0, rec_icon_h = 0; + int ts_icon_x = 0, ts_icon_w = 0, ts_icon_h = 0; + + frameBuffer->getIconSize(rec_icon.c_str(), &rec_icon_w, &rec_icon_h); + frameBuffer->getIconSize(ts_icon.c_str(), &ts_icon_w, &ts_icon_h); - int chanH = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight () * (g_settings.screen_yres / 100); - if (chanH < rec_icon_h) - chanH = rec_icon_h; - const int box_posX = ChanName_X + SHADOW_OFFSET; + int icon_h = std::max(rec_icon_h, ts_icon_h); + box_h = std::max(box_h, icon_h+icon_space*2); + int icon_y = box_y + (box_h - icon_h)/2; + int txt_y = box_y + (box_h + txt_h)/2; + char records_msg[8]; - snprintf(records_msg, sizeof(records_msg)-1, "%d%s", records, "x"); - int TextWidth = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(records_msg) - * (g_settings.screen_xres / 100); if (rec_mode == CRecordManager::RECMODE_REC) { - box_len = rec_icon_w + TextWidth + icon_space*5; - rec_icon_posX = box_posX + icon_space*2; + snprintf(records_msg, sizeof(records_msg)-1, "%d%s", records, "x"); + txt_w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(records_msg); + + box_w = rec_icon_w + txt_w + icon_space*5; + rec_icon_x = box_x + icon_space*2; } else if (rec_mode == CRecordManager::RECMODE_TSHIFT) { - box_len = ts_icon_w + icon_space*4; - ts_icon_posX = box_posX + icon_space*2; + box_w = ts_icon_w + icon_space*4; + ts_icon_x = box_x + icon_space*2; } else if (rec_mode == CRecordManager::RECMODE_REC_TSHIFT) { - box_len = ts_icon_w + rec_icon_w + TextWidth + icon_space*7; - ts_icon_posX = box_posX + icon_space*2; - rec_icon_posX = ts_icon_posX + ts_icon_w + icon_space*2; + //subtract ts records--; snprintf(records_msg, sizeof(records_msg)-1, "%d%s", records, "x"); + txt_w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(records_msg); + + box_w = ts_icon_w + rec_icon_w + txt_w + icon_space*7; + ts_icon_x = box_x + icon_space*2; + rec_icon_x = ts_icon_x + ts_icon_w + icon_space*2; } if (show) { if (rec == NULL){ //TODO: full refactoring of this icon handler - rec = new CComponentsShapeSquare(box_posX, BoxStartY + box_posY , box_len, chanH, NULL, CC_SHADOW_ON, COL_RED, COL_INFOBAR_PLUS_0); + rec = new CComponentsShapeSquare(box_x, box_y , box_w, box_h, NULL, CC_SHADOW_ON, COL_RED, COL_INFOBAR_PLUS_0); rec->setFrameThickness(2); - rec->setShadowWidth(SHADOW_OFFSET/2); + rec->setShadowWidth(OFFSET_SHADOW/2); rec->setCorner(RADIUS_MIN, CORNER_ALL); } - if (rec->getWidth() != box_len) - rec->setWidth(box_len); + if (rec->getWidth() != box_w) + rec->setWidth(box_w); if (!rec->isPainted()) rec->paint(CC_SAVE_SCREEN_NO); if (rec_mode != CRecordManager::RECMODE_TSHIFT) - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (rec_icon_posX + rec_icon_w + icon_space, BoxStartY + box_posY + chanH, box_len, records_msg, COL_INFOBAR_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rec_icon_x + rec_icon_w + icon_space, txt_y, txt_w, records_msg, COL_INFOBAR_TEXT); if (rec_mode == CRecordManager::RECMODE_REC) { - frameBuffer->paintIcon(Icon_Rec, rec_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2); + frameBuffer->paintIcon(rec_icon, rec_icon_x, icon_y); } else if (rec_mode == CRecordManager::RECMODE_TSHIFT) { - frameBuffer->paintIcon(Icon_Ts, ts_icon_posX, BoxStartY + box_posY + (chanH - ts_icon_h)/2); + frameBuffer->paintIcon(ts_icon, ts_icon_x, icon_y); } else if (rec_mode == CRecordManager::RECMODE_REC_TSHIFT) { - frameBuffer->paintIcon(Icon_Rec, rec_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2); - frameBuffer->paintIcon(Icon_Ts, ts_icon_posX, BoxStartY + box_posY + (chanH - ts_icon_h)/2); + frameBuffer->paintIcon(rec_icon, rec_icon_x, icon_y); + frameBuffer->paintIcon(ts_icon, ts_icon_x, icon_y); } } else { if (rec_mode == CRecordManager::RECMODE_REC) - frameBuffer->paintBoxRel(rec_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2, rec_icon_w, rec_icon_h, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(rec_icon_x, icon_y, rec_icon_w, icon_h, COL_INFOBAR_PLUS_0); else if (rec_mode == CRecordManager::RECMODE_TSHIFT) - frameBuffer->paintBoxRel(ts_icon_posX, BoxStartY + box_posY + (chanH - ts_icon_h)/2, ts_icon_w, ts_icon_h, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(ts_icon_x, icon_y, ts_icon_w, icon_h, COL_INFOBAR_PLUS_0); else if (rec_mode == CRecordManager::RECMODE_REC_TSHIFT) - frameBuffer->paintBoxRel(ts_icon_posX, BoxStartY + box_posY + (chanH - rec_icon_h)/2, ts_icon_w + rec_icon_w + icon_space*2, rec_icon_h, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(ts_icon_x, icon_y, ts_icon_w + rec_icon_w + icon_space*2, icon_h, COL_INFOBAR_PLUS_0); } } } @@ -371,25 +385,26 @@ void CInfoViewer::showRecordIcon (const bool show) void CInfoViewer::paintBackground(int col_NumBox) { int c_rad_mid = RADIUS_MID; +#if 0 // kill left side int BoxEndInfoY = BoxEndY; if (showButtonBar) // add button bar and blinkenlights BoxEndInfoY += infoViewerBB->InfoHeightY_Info + infoViewerBB->bottom_bar_offset; -#if 0 // kill left side + frameBuffer->paintBackgroundBox(BoxStartX, BoxStartY + ChanHeight - 6, BoxStartX + ChanWidth / 3, - BoxEndInfoY + SHADOW_OFFSET); + BoxEndInfoY + OFFSET_SHADOW); // kill progressbar + info-line frameBuffer->paintBackgroundBox(BoxStartX + ChanWidth + 40, // 40 for the recording icon! BoxStartY, BoxEndX, BoxStartY + ChanHeight); // shadow for channel name, epg data... - frameBuffer->paintBox(BoxEndX - c_shadow_width, ChanNameY + SHADOW_OFFSET, - BoxEndX + SHADOW_OFFSET, BoxEndInfoY + SHADOW_OFFSET, - COL_INFOBAR_SHADOW_PLUS_0, c_rad_large, CORNER_RIGHT); - frameBuffer->paintBox(ChanInfoX + SHADOW_OFFSET, BoxEndInfoY - c_shadow_width, - BoxEndX - c_shadow_width, BoxEndInfoY + SHADOW_OFFSET, - COL_INFOBAR_SHADOW_PLUS_0, c_rad_large, CORNER_BOTTOM_LEFT); + frameBuffer->paintBox(BoxEndX - c_shadow_width, ChanNameY + OFFSET_SHADOW, + BoxEndX + OFFSET_SHADOW, BoxEndInfoY + OFFSET_SHADOW, + COL_SHADOW_PLUS_0, c_rad_large, CORNER_RIGHT); + frameBuffer->paintBox(ChanInfoX + OFFSET_SHADOW, BoxEndInfoY - c_shadow_width, + BoxEndX - c_shadow_width, BoxEndInfoY + OFFSET_SHADOW, + COL_SHADOW_PLUS_0, c_rad_large, CORNER_BOTTOM_LEFT); #endif // background for channel name/logo and clock paintHead(); @@ -398,10 +413,10 @@ void CInfoViewer::paintBackground(int col_NumBox) paintBody(); // number box - int y_numbox = body->getYPos()-ChanHeight-SHADOW_OFFSET; + int y_numbox = body->getYPos()-ChanHeight-OFFSET_SHADOW; if (numbox == NULL){ //TODO: move into an own member, paintNumBox() or so... numbox = new CComponentsShapeSquare(BoxStartX, y_numbox, ChanWidth, ChanHeight); - numbox->enableShadow(CC_SHADOW_ON, SHADOW_OFFSET, true); + numbox->enableShadow(CC_SHADOW_ON, OFFSET_SHADOW, true); }else numbox->setDimensionsAll(BoxStartX, y_numbox, ChanWidth, ChanHeight); numbox->setColorBody(g_settings.theme.infobar_gradient_top ? COL_MENUHEAD_PLUS_0 : col_NumBox); @@ -430,15 +445,29 @@ void CInfoViewer::paintHead() void CInfoViewer::paintBody() { - int h_body = InfoHeightY - header_height + (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); + int h_body = InfoHeightY - header_height - OFFSET_SHADOW; + infoViewerBB->initBBOffset(); + if (!zap_mode) + h_body += infoViewerBB->bottom_bar_offset; - if(zap_mode) - h_body -= (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); + int y_body = ChanNameY + header_height; - if (body == NULL) - body = new CComponentsShapeSquare(ChanInfoX, ChanNameY + header_height, BoxEndX-ChanInfoX, h_body); - else - body->setDimensionsAll(ChanInfoX, ChanNameY + header_height, BoxEndX-ChanInfoX, h_body); + if (body == NULL){ + body = new CComponentsShapeSquare(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); + } else { + if (txt_cur_event && txt_cur_start && txt_cur_event_rest && + txt_next_event && txt_next_start && txt_next_in) { + if (h_body != body->getHeight() || y_body != body->getYPos()){ + txt_cur_start->getCTextBoxObject()->clearScreenBuffer(); + txt_cur_event->getCTextBoxObject()->clearScreenBuffer(); + txt_cur_event_rest->getCTextBoxObject()->clearScreenBuffer(); + txt_next_start->getCTextBoxObject()->clearScreenBuffer(); + txt_next_event->getCTextBoxObject()->clearScreenBuffer(); + txt_next_in->getCTextBoxObject()->clearScreenBuffer(); + } + } + body->setDimensionsAll(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); + } //set corner and shadow modes, consider virtual zap mode body->setCorner(RADIUS_LARGE, (zap_mode) ? CORNER_BOTTOM : CORNER_NONE); @@ -508,7 +537,11 @@ void CInfoViewer::show_current_next(bool new_chan, int epgpos) loc = LOCALE_INFOVIEWER_EPGWAIT; else loc = LOCALE_INFOVIEWER_EPGNOTLOAD; - display_Info(g_Locale->getText(loc), NULL); + + _livestreamInfo1.clear(); + _livestreamInfo2.clear(); + if (!showLivestreamInfo()) + display_Info(g_Locale->getText(loc), NULL); } else { show_Data (); } @@ -517,7 +550,7 @@ void CInfoViewer::show_current_next(bool new_chan, int epgpos) void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channel_Id, const std::string &Channel, const std::string &g_file_epg, const std::string &g_file_epg1, const int duration, const int curr_pos, - const int repeat_mode) + const int repeat_mode, const int _zap_mode) { if (g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_LEFT || g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_RIGHT || @@ -532,6 +565,7 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe last_curr_id = last_next_id = 0; showButtonBar = true; fileplay = true; + zap_mode = _zap_mode; reset_allScala(); if (g_settings.radiotext_enable && g_Radiotext) { @@ -549,7 +583,7 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe current_channel_id = Channel_Id; /* showChannelLogo() changes this, so better reset it every time... */ - ChanNameX = BoxStartX + ChanWidth + SHADOW_OFFSET; + ChanNameX = BoxStartX + ChanWidth + OFFSET_SHADOW; paintBackground(COL_INFOBAR_PLUS_0); @@ -559,7 +593,8 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe showRecordIcon (show_dot); show_dot = !show_dot; - infoViewerBB->paintshowButtonBar(); + if (!zap_mode) + infoViewerBB->paintshowButtonBar(); int ChannelLogoMode = 0; if (g_settings.infobar_show_channellogo > 1) @@ -664,10 +699,14 @@ void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap, int epgpos) { + if(!calledFromNumZap && !(zap_mode & IV_MODE_DEFAULT)) + resetSwitchMode(); + std::string Channel = channel->getName(); t_satellite_position satellitePosition = channel->getSatellitePosition(); t_channel_id new_channel_id = channel->getChannelID(); int ChanNum = channel->number; + current_epg_id = channel->getEpgID(); if (g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_LEFT || @@ -719,7 +758,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap } /* showChannelLogo() changes this, so better reset it every time... */ - ChanNameX = BoxStartX + ChanWidth + SHADOW_OFFSET; + ChanNameX = BoxStartX + ChanWidth + OFFSET_SHADOW; paintBackground(col_NumBox); @@ -803,7 +842,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap if (g_settings.infobar_show_channellogo < 5 || !logo_ok) { if (ChannelLogoMode != 2) { //FIXME good color to display inactive for zap ? - //fb_pixel_t color = CNeutrinoApp::getInstance ()->channelList->SameTP(new_channel_id) ? COL_INFOBAR_TEXT : COL_INFOBAR_SHADOW_TEXT; + //fb_pixel_t color = CNeutrinoApp::getInstance ()->channelList->SameTP(new_channel_id) ? COL_INFOBAR_TEXT : COL_MENUFOOT_TEXT; fb_pixel_t color = COL_INFOBAR_TEXT; g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString( ChanNameX + 10 + ChanNumWidth, ChanNameY + header_height, @@ -889,6 +928,66 @@ void CInfoViewer::setInfobarTimeout(int timeout_ext) break; } } + +bool CInfoViewer::showLivestreamInfo() +{ + CZapitChannel * cc = CZapit::getInstance()->GetCurrentChannel(); + if (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv && + cc->getEpgID() == 0 && !cc->getScriptName().empty()) { + std::string livestreamInfo1 = ""; + std::string livestreamInfo2 = ""; + std::string tmp1 = ""; + CMoviePlayerGui::getInstance().getLivestreamInfo(&livestreamInfo1, &tmp1); + + if (!(videoDecoder->getBlank())) { + int xres, yres, framerate; + std::string tmp2; + videoDecoder->getPictureInfo(xres, yres, framerate); + switch (framerate) { + case 0: + tmp2 = "23.976fps"; + break; + case 1: + tmp2 = "24fps"; + break; + case 2: + tmp2 = "25fps"; + break; + case 3: + tmp2 = "29,976fps"; + break; + case 4: + tmp2 = "30fps"; + break; + case 5: + tmp2 = "50fps"; + break; + case 6: + tmp2 = "50,94fps"; + break; + case 7: + tmp2 = "60fps"; + break; + default: + tmp2 = g_Locale->getText(LOCALE_STREAMINFO_FRAMERATE_UNKNOWN); + break; + } + livestreamInfo2 = to_string(xres) + "x" + to_string(yres) + ", " + tmp2; + if (!tmp1.empty()) + livestreamInfo2 += (std::string)", " + tmp1; + } + + if (livestreamInfo1 != _livestreamInfo1 || livestreamInfo2 != _livestreamInfo2) { + display_Info(livestreamInfo1.c_str(), livestreamInfo2.c_str(), false); + _livestreamInfo1 = livestreamInfo1; + _livestreamInfo2 = livestreamInfo2; + infoViewerBB->showBBButtons(true /*paintFooter*/); + } + return true; + } + return false; +} + void CInfoViewer::loop(bool show_dot) { bool hideIt = true; @@ -904,9 +1003,14 @@ void CInfoViewer::loop(bool show_dot) if (isVolscale) CVolume::getInstance()->showVolscale(); + _livestreamInfo1.clear(); + _livestreamInfo2.clear(); + while (!(res & (messages_return::cancel_info | messages_return::cancel_all))) { g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd); + showLivestreamInfo(); + #ifdef ENABLE_PIP if ((msg == (neutrino_msg_t) g_settings.key_pip_close) || (msg == (neutrino_msg_t) g_settings.key_pip_setup) || @@ -918,21 +1022,51 @@ void CInfoViewer::loop(bool show_dot) if (msg == (neutrino_msg_t) g_settings.key_screenshot) { res = CNeutrinoApp::getInstance()->handleMsg(msg, data); - } else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + } else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = messages_return::cancel_info; - } - else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { - g_RCInput->postMsg (NeutrinoMessages::SHOW_EPG, 0); + } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { + if (fileplay) + { + CMoviePlayerGui::getInstance().setFromInfoviewer(true); + g_RCInput->postMsg (msg, data); + hideIt = true; + } + else + g_RCInput->postMsg (NeutrinoMessages::SHOW_EPG, 0); res = messages_return::cancel_info; } else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { if(fader.FadeDone()) res = messages_return::cancel_info; } else if ((msg == CRCInput::RC_ok) || (msg == CRCInput::RC_home) || (msg == CRCInput::RC_timeout)) { + if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && (msg == CRCInput::RC_ok)) + { + if (fileplay) + { + // in movieplayer mode process vzap keys in movieplayer.cpp + //printf("%s:%d: imitate VZAP; RC_ok\n", __func__, __LINE__); + CMoviePlayerGui::getInstance().setFromInfoviewer(true); + g_RCInput->postMsg (msg, data); + hideIt = true; + } + } if(fader.StartFadeOut()) timeoutEnd = CRCInput::calcTimeoutEnd (1); else res = messages_return::cancel_info; + } else if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && ((msg == CRCInput::RC_right) || (msg == CRCInput::RC_left ))) { + if (fileplay) + { + // in movieplayer mode process vzap keys in movieplayer.cpp + //printf("%s:%d: imitate VZAP; RC_left/right\n", __func__, __LINE__); + CMoviePlayerGui::getInstance().setFromInfoviewer(true); + g_RCInput->postMsg (msg, data); + hideIt = true; + } + else + setSwitchMode(IV_MODE_VIRTUAL_ZAP); + res = messages_return::cancel_all; + hideIt = true; } else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == sec_timer_id)) { showSNR (); if (timeset) @@ -946,10 +1080,6 @@ void CInfoViewer::loop(bool show_dot) infoViewerBB->showIcon_16_9(); //infoViewerBB->showIcon_CA_Status(0); infoViewerBB->showIcon_Resolution(); - } else if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && ((msg == CRCInput::RC_right) || (msg == CRCInput::RC_left ))) { - setSwitchMode(IV_MODE_VIRTUAL_ZAP); - res = messages_return::cancel_all; - hideIt = true; } else if ((msg == NeutrinoMessages::EVT_RECORDMODE) && (CMoviePlayerGui::getInstance().timeshift) && (CRecordManager::getInstance()->GetRecordCount() == 1)) { res = CNeutrinoApp::getInstance()->handleMsg(msg, data); @@ -990,15 +1120,21 @@ void CInfoViewer::loop(bool show_dot) /* 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); - if (msg < CRCInput::RC_Events) /* RC / Keyboard event */ + printf("%s:%d msg->MP: %08lx, data: %08lx\n", __func__, __LINE__, (long)msg, (long)data); + + bool volume_keys = ( + msg == CRCInput::RC_spkr + || msg == (neutrino_msg_t) g_settings.key_volumeup + || msg == (neutrino_msg_t) g_settings.key_volumedown + ); + + if (msg < CRCInput::RC_Events && !volume_keys) { g_RCInput->postMsg (msg, data); res = messages_return::cancel_info; } else res = CNeutrinoApp::getInstance()->handleMsg(msg, data); - } #if 0 else if (CMoviePlayerGui::getInstance().start_timeshift && (msg == NeutrinoMessages::EVT_TIMER)) { @@ -1160,7 +1296,7 @@ void CInfoViewer::killRadiotext() if (g_Radiotext->S_RtOsd) frameBuffer->paintBackgroundBox(rt_x, rt_y, rt_w, rt_h); rt_x = rt_y = rt_h = rt_w = 0; - InfoClock->enableInfoClock(true); + CInfoClock::getInstance()->enableInfoClock(true); } void CInfoViewer::showRadiotext() @@ -1172,15 +1308,15 @@ void CInfoViewer::showRadiotext() infoViewerBB->showIcon_RadioText(g_Radiotext->haveRadiotext()); if (g_Radiotext->S_RtOsd) { - InfoClock->enableInfoClock(false); + CInfoClock::getInstance()->enableInfoClock(false); // dimensions of radiotext window int /*yoff = 8,*/ ii = 0; rt_dx = BoxEndX - BoxStartX; rt_dy = 25; rt_x = BoxStartX; rt_y = g_settings.screen_StartY + 10; - rt_h = rt_y + 7 + rt_dy*(g_Radiotext->S_RtOsdRows+1)+SHADOW_OFFSET; - rt_w = rt_x+rt_dx+SHADOW_OFFSET; + rt_h = rt_y + 7 + rt_dy*(g_Radiotext->S_RtOsdRows+1)+OFFSET_SHADOW; + rt_w = rt_x+rt_dx+OFFSET_SHADOW; int lines = 0; for (int i = 0; i < g_Radiotext->S_RtOsdRows; i++) { @@ -1200,7 +1336,7 @@ void CInfoViewer::showRadiotext() sprintf(stext[0], g_Radiotext->RT_PTY == 0 ? "%s %s%s" : "%s (%s)%s", tr("Radiotext"), g_Radiotext->RT_PTY == 0 ? g_Radiotext->RDS_PTYN : g_Radiotext->ptynr2string(g_Radiotext->RT_PTY), ":"); // shadow - frameBuffer->paintBoxRel(rt_x+SHADOW_OFFSET, rt_y+SHADOW_OFFSET, rt_dx, rt_dy, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_TOP); + frameBuffer->paintBoxRel(rt_x+OFFSET_SHADOW, rt_y+OFFSET_SHADOW, rt_dx, rt_dy, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_TOP); frameBuffer->paintBoxRel(rt_x, rt_y, rt_dx, rt_dy, COL_INFOBAR_PLUS_0, RADIUS_LARGE, CORNER_TOP); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rt_x+10, rt_y+ 30, rt_dx-20, stext[0], COL_INFOBAR_TEXT, 0, RTisIsUTF); } @@ -1229,7 +1365,7 @@ void CInfoViewer::showRadiotext() } // Body if (lines) { - frameBuffer->paintBoxRel(rt_x+SHADOW_OFFSET, rt_y+rt_dy+SHADOW_OFFSET, rt_dx, 7+rt_dy* g_Radiotext->S_RtOsdRows, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(rt_x+OFFSET_SHADOW, rt_y+rt_dy+OFFSET_SHADOW, rt_dx, 7+rt_dy* g_Radiotext->S_RtOsdRows, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); frameBuffer->paintBoxRel(rt_x, rt_y+rt_dy, rt_dx, 7+rt_dy* g_Radiotext->S_RtOsdRows, COL_INFOBAR_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); // RT-Text roundloop @@ -1365,6 +1501,7 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data) if ((*(t_channel_id *) data) == current_channel_id) { if (is_visible && showButtonBar) { infoViewerBB->showIcon_DD(); + showLivestreamInfo(); infoViewerBB->showBBButtons(true /*paintFooter*/); // in case button text has changed } if (g_settings.radiotext_enable && g_Radiotext && !g_RemoteControl->current_PIDs.APIDs.empty() && ((CNeutrinoApp::getInstance()->getMode()) == NeutrinoMessages::mode_radio)) @@ -1518,12 +1655,15 @@ void CInfoViewer::showSNR () } if (sigbox == NULL){ int sigbox_offset = ChanWidth *10/100; - sigbox = new CSignalBox(BoxStartX + sigbox_offset, y_numbox+ChanHeight/2, ChanWidth - 2*sigbox_offset, ChanHeight/2, CFEManager::getInstance()->getLiveFE(), true, NULL, "S", "Q"); + sigbox = new CSignalBox(BoxStartX + sigbox_offset, y_numbox+ChanHeight/2, ChanWidth - 2*sigbox_offset, ChanHeight/2, NULL, true, NULL, "S", "Q"); sigbox->setTextColor(COL_INFOBAR_TEXT); + sigbox->setActiveColor(COL_INFOBAR_PLUS_7); + sigbox->setPassiveColor(COL_INFOBAR_PLUS_3); sigbox->setColorBody(numbox->getColorBody()); sigbox->doPaintBg(false); sigbox->enableTboxSaveScreen(numbox->getColBodyGradientMode()); } + sigbox->setFrontEnd(CFEManager::getInstance()->getLiveFE()); sigbox->paint(CC_SAVE_SCREEN_NO); } if(showButtonBar) @@ -1576,18 +1716,15 @@ void CInfoViewer::display_Info(const char *current, const char *next, if (pb_pos > -1) { int pb_w = 112; - int pb_startx = BoxEndX - pb_w - SHADOW_OFFSET; + int pb_startx = BoxEndX - pb_w - OFFSET_SHADOW; int pb_starty = ChanNameY - (pb_h + 10); - int pb_shadow = COL_INFOBAR_SHADOW_PLUS_0; - timescale->enableShadow(!g_settings.infobar_progressbar); - int pb_color = (g_settings.progressbar_design == CProgressBar::PB_MONO) ? COL_INFOBAR_PLUS_0 : COL_INFOBAR_SHADOW_PLUS_0; - if(g_settings.infobar_progressbar){ + if (g_settings.infobar_progressbar) + { pb_startx = xStart; pb_w = BoxEndX - 10 - xStart; - pb_shadow = 0; } int tmpY = CurrInfoY - height - ChanNameY + header_height - - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getDigitOffset()/3+SHADOW_OFFSET; + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getDigitOffset()/3+OFFSET_SHADOW; switch(g_settings.infobar_progressbar){ //set progressbar position case SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_BELOW_CH_NAME: pb_h = (pb_h/3); @@ -1610,18 +1747,23 @@ void CInfoViewer::display_Info(const char *current, const char *next, pb_p = pb_w; timescale->setDimensionsAll(pb_startx, pb_starty, pb_w, pb_h); - timescale->setColorAll(pb_color, pb_color, pb_shadow); + timescale->setActiveColor(COL_INFOBAR_PLUS_7); + timescale->setPassiveColor(g_settings.infobar_progressbar ? COL_INFOBAR_PLUS_1 : COL_INFOBAR_PLUS_0); + timescale->enableShadow(!g_settings.infobar_progressbar); timescale->setValues(pb_p, pb_w); - //printf("paintProgressBar(%d, %d, %d, %d)\n", BoxEndX - pb_w - SHADOW_OFFSET, ChanNameY - (pb_h + 10) , pb_w, pb_h); + //printf("paintProgressBar(%d, %d, %d, %d)\n", BoxEndX - pb_w - OFFSET_SHADOW, ChanNameY - (pb_h + 10) , pb_w, pb_h); + }else{ + if (g_settings.infobar_progressbar == SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_DEFAULT) + timescale->kill(); } int currTimeW = 0; int nextTimeW = 0; if (runningRest) - currTimeW = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth(runningRest)+10; + currTimeW = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth(runningRest)*2; if (nextDuration) - nextTimeW = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth(nextDuration)+10; + nextTimeW = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth(nextDuration)*2; int currTimeX = BoxEndX - currTimeW - 10; int nextTimeX = BoxEndX - nextTimeW - 10; @@ -1635,21 +1777,21 @@ void CInfoViewer::display_Info(const char *current, const char *next, txt_cur_event = new CComponentsTextTransp(NULL, xStart, CurrInfoY - height, currTimeX - xStart - 5, height); else txt_cur_event->setDimensionsAll(xStart, CurrInfoY - height, currTimeX - xStart - 5, height); + txt_cur_event->setText(current, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - - if (txt_cur_event_rest && txt_cur_event_rest->isPainted()) - txt_cur_event_rest->hide(); - if (txt_cur_event && txt_cur_event->isPainted()) + if (txt_cur_event->isPainted()) txt_cur_event->hide(); - txt_cur_event->paint(CC_SAVE_SCREEN_YES); - if (runningStart){ + + if (runningStart && starttimes){ if (txt_cur_start == NULL) txt_cur_start = new CComponentsTextTransp(NULL, InfoX, CurrInfoY - height, info_time_width, height); else txt_cur_start->setDimensionsAll(InfoX, CurrInfoY - height, info_time_width, height); txt_cur_start->setText(runningStart, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - txt_cur_start->paint(CC_SAVE_SCREEN_NO); + if (txt_cur_event->isPainted()) + txt_cur_event->hide(); + txt_cur_start->paint(CC_SAVE_SCREEN_YES); } if (runningRest){ @@ -1658,6 +1800,8 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_cur_event_rest->setDimensionsAll(currTimeX, CurrInfoY - height, currTimeW, height); txt_cur_event_rest->setText(runningRest, CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); + if (txt_cur_event_rest->isPainted()) + txt_cur_event_rest->hide(); txt_cur_event_rest->paint(CC_SAVE_SCREEN_YES); } } @@ -1670,15 +1814,19 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_next_event->setDimensionsAll(xStart, NextInfoY, nextTimeX - xStart - 5, height); txt_next_event->setText(next, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - txt_next_event->paint(CC_SAVE_SCREEN_NO); + if (txt_next_event->isPainted()) + txt_next_event->hide(); + txt_next_event->paint(CC_SAVE_SCREEN_YES); - if (nextStart){ + if (nextStart && starttimes){ if (txt_next_start == NULL) txt_next_start = new CComponentsTextTransp(NULL, InfoX, NextInfoY, info_time_width, height); else txt_next_start->setDimensionsAll(InfoX, NextInfoY, info_time_width, height); txt_next_start->setText(nextStart, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - txt_next_start->paint(CC_SAVE_SCREEN_NO); + if (txt_next_start->isPainted()) + txt_next_start->hide(); + txt_next_start->paint(CC_SAVE_SCREEN_YES); } if (nextDuration){ @@ -1687,7 +1835,9 @@ void CInfoViewer::display_Info(const char *current, const char *next, else txt_next_in->setDimensionsAll(nextTimeX, NextInfoY, nextTimeW, height); txt_next_in->setText(nextDuration, CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT); - txt_next_in->paint(CC_SAVE_SCREEN_NO); + if (txt_next_in->isPainted()) + txt_next_in->hide(); + txt_next_in->paint(CC_SAVE_SCREEN_YES); } } @@ -1775,7 +1925,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) if (info_CurrentNext.flags & CSectionsdClient::epgflags::has_current) { //printf("CInfoViewer::show_Data: ************************************************* runningPercent %d\n", runningPercent); if (!calledFromEvent || (oldrunningPercent != runningPercent)) { - frameBuffer->paintBoxRel(BoxEndX - 104, posy + 6, 108, 14, COL_INFOBAR_SHADOW_PLUS_0, 1); + frameBuffer->paintBoxRel(BoxEndX - 104, posy + 6, 108, 14, COL_SHADOW_PLUS_0, 1); frameBuffer->paintBoxRel(BoxEndX - 108, posy + 2, 108, 14, COL_INFOBAR_PLUS_0, 1); oldrunningPercent = runningPercent; } @@ -1785,7 +1935,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) frameBuffer->paintBackgroundBoxRel (BoxEndX - 108, posy, 112, height2); } #endif - infoViewerBB->showBBButtons(); + infoViewerBB->showBBButtons(calledFromEvent); } if ((info_CurrentNext.flags & CSectionsdClient::epgflags::not_broadcast) || @@ -1917,8 +2067,8 @@ void CInfoViewer::killInfobarText() if (infobar_txt->isPainted()) infobar_txt->kill(); delete infobar_txt; + infobar_txt = NULL; } - infobar_txt = NULL; } @@ -1947,12 +2097,22 @@ void CInfoViewer::showInfoFile() const int height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight() + 2; //create info object - if (infobar_txt == NULL) + if (infobar_txt == NULL){ infobar_txt = new CComponentsInfoBox(); + //set some properties for info object + infobar_txt->setCorner(RADIUS_SMALL); + infobar_txt->enableShadow(CC_SHADOW_ON, OFFSET_SHADOW/2); + infobar_txt->setTextColor(COL_INFOBAR_TEXT); + infobar_txt->setColorBody(COL_INFOBAR_PLUS_0); + infobar_txt->doPaintTextBoxBg(false); + infobar_txt->enableColBodyGradient(g_settings.theme.infobar_gradient_top, g_settings.theme.infobar_gradient_top ? COL_INFOBAR_PLUS_0 : header->getColorBody(), g_settings.theme.infobar_gradient_top_direction); + } //get text from file and set it to info object, exit and delete object if failed - bool new_text = infobar_txt->setTextFromFile(infobar_file, CTextBox::CENTER, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]); - if (!new_text){ + string old_txt = infobar_txt->getText(); + string new_txt = infobar_txt->getTextFromFile(infobar_file); + bool has_text = infobar_txt->setText(new_txt, CTextBox::CENTER, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]); + if (new_txt.empty()){ killInfobarText(); return; } @@ -1961,19 +2121,14 @@ void CInfoViewer::showInfoFile() if (infobar_txt->getWidth() != width) infobar_txt->kill(); - //set some properties for info object + //consider possible size change infobar_txt->setDimensionsAll(xStart, yStart, width, height); - infobar_txt->setCorner(RADIUS_SMALL); - infobar_txt->enableShadow(CC_SHADOW_ON, SHADOW_OFFSET/2); - infobar_txt->setTextColor(COL_INFOBAR_TEXT); - infobar_txt->setColorBody(COL_INFOBAR_PLUS_0); - infobar_txt->doPaintTextBoxBg(false); - - //paint info, don't save background, if already painted, global hide is also done by killTitle() - bool save_bg = !infobar_txt->isPainted(); - if (new_text || (zap_mode & IV_MODE_VIRTUAL_ZAP)) - infobar_txt->paint(save_bg); + //paint info if not painted or text has changed + if (has_text || (zap_mode & IV_MODE_VIRTUAL_ZAP)){ + if ((old_txt != new_txt) || !infobar_txt->isPainted()) + infobar_txt->paint(CC_SAVE_SCREEN_NO); + } } void CInfoViewer::killTitle() @@ -1982,20 +2137,25 @@ void CInfoViewer::killTitle() { is_visible = false; infoViewerBB->is_visible = false; - int bottom = BoxEndY + SHADOW_OFFSET + infoViewerBB->bottom_bar_offset; +#if 0 //unused + int bottom = BoxEndY + OFFSET_SHADOW + infoViewerBB->bottom_bar_offset; if (showButtonBar) bottom += infoViewerBB->InfoHeightY_Info; +#endif if (infoViewerBB->getFooter()) infoViewerBB->getFooter()->kill(); if (infoViewerBB->getCABar()) infoViewerBB->getCABar()->kill(); if (rec) rec->kill(); - //printf("killTitle(%d, %d, %d, %d)\n", BoxStartX, BoxStartY, BoxEndX+ SHADOW_OFFSET-BoxStartX, bottom-BoxStartY); - //frameBuffer->paintBackgroundBox(BoxStartX, BoxStartY, BoxEndX+ SHADOW_OFFSET, bottom); - if (infobar_txt) - infobar_txt->kill(); - numbox->kill(); + //printf("killTitle(%d, %d, %d, %d)\n", BoxStartX, BoxStartY, BoxEndX+ OFFSET_SHADOW-BoxStartX, bottom-BoxStartY); + //frameBuffer->paintBackgroundBox(BoxStartX, BoxStartY, BoxEndX+ OFFSET_SHADOW, bottom); + if (!(zap_mode & IV_MODE_VIRTUAL_ZAP)){ + if (infobar_txt) + infobar_txt->kill(); + numbox->kill(); + } + #if 0 //not really required to kill sigbox, numbox does this if (sigbox) sigbox->kill(); @@ -2006,11 +2166,11 @@ void CInfoViewer::killTitle() clock->kill(); #endif body->kill(); +#if 0 //not really required to kill epg infos, body does this if (txt_cur_event) txt_cur_event->kill(); if (txt_cur_event_rest) txt_cur_event_rest->kill(); -#if 0 //not really required to kill epg infos, body does this if (txt_cur_start) txt_cur_start->kill(); if (txt_next_start) @@ -2027,10 +2187,9 @@ void CInfoViewer::killTitle() g_Radiotext->S_RtOsd = g_Radiotext->haveRadiotext() ? 1 : 0; killRadiotext(); } - killInfobarText(); } showButtonBar = false; - InfoClock->getInstance()->enableInfoClock(); + CInfoClock::getInstance()->enableInfoClock(); } #if 0 diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index dacc27f24..3187d4c35 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -112,6 +112,8 @@ class CInfoViewer bool channellogoChange; uint32_t lcdUpdateTimer; int zap_mode; + std::string _livestreamInfo1; + std::string _livestreamInfo2; void paintBackground(int col_Numbox); void paintHead(); @@ -146,6 +148,8 @@ class CInfoViewer void reset_allScala(); void check_channellogo_ca_SettingsChange(); void sendNoEpg(const t_channel_id channel_id); + bool showLivestreamInfo(); + public: bool chanready; bool is_visible; @@ -166,7 +170,7 @@ class CInfoViewer void showMovieTitle(const int playState, const t_channel_id &channel_id, const std::string &title, const std::string &g_file_epg, const std::string &g_file_epg1, - const int duration, const int curr_pos, const int repeat_mode); + const int duration, const int curr_pos, const int repeat_mode, const int _zap_mode = IV_MODE_DEFAULT); void start(); void showEpgInfo(); diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index d474ebf6e..f7ebb3132 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -48,7 +48,6 @@ #include "gui/keybind_setup.h" #include #include -#include #include #include #include @@ -65,7 +64,7 @@ extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern cVideo * videoDecoder; -#define COL_INFOBAR_BUTTONS_BACKGROUND (COL_INFOBAR_SHADOW_PLUS_1) +#define COL_INFOBAR_BUTTONS_BACKGROUND (COL_MENUFOOT_PLUS_0) CInfoViewerBB::CInfoViewerBB() { @@ -108,7 +107,7 @@ void CInfoViewerBB::Init() bbButtonInfo[i].x = -1; } - InfoHeightY_Info = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 5; + InfoHeightY_Info = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight() + 5; initBBOffset(); changePB(); @@ -144,8 +143,9 @@ bool CInfoViewerBB::checkBBIcon(const char * const icon, int *w, int *h) void CInfoViewerBB::getBBIconInfo() { bbIconMaxH = 0; + initBBOffset(); BBarY = g_InfoViewer->BoxEndY + bottom_bar_offset; - BBarFontY = BBarY + InfoHeightY_Info - (InfoHeightY_Info - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()) / 2; /* center in buttonbar */ + BBarFontY = BBarY + InfoHeightY_Info - (InfoHeightY_Info - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight()) / 2; /* center in buttonbar */ bbIconMinX = g_InfoViewer->BoxEndX - 8; //should be 10px, but 2px will be reduced for each icon CNeutrinoApp* neutrino = CNeutrinoApp::getInstance(); @@ -221,8 +221,8 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_RED; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) { - text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_red, active); + if (mode == NeutrinoMessages::mode_ts) { + text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_red, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; } @@ -236,8 +236,8 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_GREEN; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) { - text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_green, active); + if (mode == NeutrinoMessages::mode_ts) { + text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_green, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; } @@ -251,8 +251,8 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_YELLOW; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) { - text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_yellow, active); + if (mode == NeutrinoMessages::mode_ts) { + text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_yellow, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; } @@ -266,8 +266,8 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_BLUE; frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) { - text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_blue, active); + if (mode == NeutrinoMessages::mode_ts) { + text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_blue, active, g_settings.infobar_buttons_usertitle); if (!text.empty()) break; } @@ -279,18 +279,13 @@ void CInfoViewerBB::getBBButtonInfo() default: break; } - //label audio control button in movieplayer/upnp mode - if (mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) + //label audio control button in movieplayer mode + if (mode == NeutrinoMessages::mode_ts && !CMoviePlayerGui::getInstance().timeshift) { - if (!CMoviePlayerGui::getInstance().timeshift) - { - if (text == g_Locale->getText(LOCALE_MPKEY_AUDIO) && !g_settings.infobar_buttons_usertitle) - { - text = CMoviePlayerGui::getInstance(mode == NeutrinoMessages::mode_webtv).CurrentAudioName(); - } - } + if (text == g_Locale->getText(LOCALE_MPKEY_AUDIO) && !g_settings.infobar_buttons_usertitle) + text = CMoviePlayerGui::getInstance(false).CurrentAudioName(); // use instance_mp } - bbButtonInfo[i].w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(text) + w + 10; + bbButtonInfo[i].w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(text) + w + 10; bbButtonInfo[i].cx = w + 5; bbButtonInfo[i].h = h; bbButtonInfo[i].text = text; @@ -412,6 +407,8 @@ void CInfoViewerBB::showBBButtons(bool paintFooter) frameBuffer->SaveScreen(buf_x, buf_y, buf_w, buf_h, pixbuf); paintFoot(); if (pixbuf != NULL) { + if (g_settings.theme.infobar_gradient_bottom) + frameBuffer->waitForIdle("CInfoViewerBB::showBBButtons"); frameBuffer->RestoreScreen(buf_x, buf_y, buf_w, buf_h, pixbuf); delete [] pixbuf; } @@ -433,8 +430,8 @@ void CInfoViewerBB::showBBButtons(bool paintFooter) if (bbButtonInfo[i].active) { frameBuffer->paintIcon(bbButtonInfo[i].icon, bbButtonInfo[i].x, BBarY, InfoHeightY_Info); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bbButtonInfo[i].x + bbButtonInfo[i].cx, BBarFontY, - bbButtonInfo[i].w - bbButtonInfo[i].cx, bbButtonInfo[i].text, COL_INFOBAR_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->RenderString(bbButtonInfo[i].x + bbButtonInfo[i].cx, BBarFontY, + bbButtonInfo[i].w - bbButtonInfo[i].cx, bbButtonInfo[i].text, COL_MENUFOOT_TEXT); } } } @@ -706,6 +703,7 @@ void CInfoViewerBB::showSysfsHdd() void CInfoViewerBB::showBarSys(int percent) { if (is_visible){ + sysscale->reset(); sysscale->doPaintBg(false); sysscale->setDimensionsAll(bbIconMinX, BBarY + InfoHeightY_Info / 2 - 2 - 6, hddwidth, 6); sysscale->setValues(percent, 100); @@ -716,6 +714,7 @@ void CInfoViewerBB::showBarSys(int percent) void CInfoViewerBB::showBarHdd(int percent) { if (is_visible) { + hddscale->reset(); hddscale->doPaintBg(false); if (percent >= 0){ hddscale->setDimensionsAll(bbIconMinX, BBarY + InfoHeightY_Info / 2 + 2 + 0, hddwidth, 6); @@ -723,7 +722,6 @@ void CInfoViewerBB::showBarHdd(int percent) hddscale->paint(); }else { frameBuffer->paintBoxRel(bbIconMinX, BBarY + InfoHeightY_Info / 2 + 2 + 0, hddwidth, 6, COL_INFOBAR_BUTTONS_BACKGROUND); - hddscale->reset(); } } } @@ -858,6 +856,7 @@ void CInfoViewerBB::showIcon_CA_Status(int notfirst) void CInfoViewerBB::paintCA_bar(int left, int right) { + initBBOffset(); int xcnt = (g_InfoViewer->BoxEndX - g_InfoViewer->ChanInfoX - (g_settings.infobar_casystem_frame ? 24 : 0)) / 4; int ycnt = (bottom_bar_offset - (g_settings.infobar_casystem_frame ? 14 : 0)) / 4; int ca_width = g_InfoViewer->BoxEndX - g_InfoViewer->ChanInfoX; diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index ee908e0d9..dd3167db7 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -140,7 +140,7 @@ const CMenuOptionChooser::keyval KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_OPTIONS[K { SNeutrinoSettings::VOLUME, LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_VOLUME }, { SNeutrinoSettings::INFOBAR, LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_INFOBAR } }; - +#if 0 //not used #define KEYBINDINGMENU_BOUQUETHANDLING_OPTION_COUNT 3 const CMenuOptionChooser::keyval KEYBINDINGMENU_BOUQUETHANDLING_OPTIONS[KEYBINDINGMENU_BOUQUETHANDLING_OPTION_COUNT] = { @@ -148,7 +148,7 @@ const CMenuOptionChooser::keyval KEYBINDINGMENU_BOUQUETHANDLING_OPTIONS[KEYBINDI { 1, LOCALE_KEYBINDINGMENU_BOUQUETLIST_ON_OK }, { 2, LOCALE_KEYBINDINGMENU_ALLCHANNELS_ON_OK } }; - +#endif typedef struct key_settings_t { const neutrino_locale_t keydescription; @@ -205,6 +205,11 @@ const key_settings_struct_t key_settings[CKeybindSetup::KEYBINDS_COUNT] = {LOCALE_EXTRA_KEY_PIC_MODE, &g_settings.key_pic_mode_active, LOCALE_MENU_HINT_KEY_PIC_MODE_ACTIVE }, {LOCALE_EXTRA_KEY_PIC_SIZE, &g_settings.key_pic_size_active, LOCALE_MENU_HINT_KEY_PIC_SIZE_ACTIVE }, {LOCALE_EXTRA_KEY_RECORD, &g_settings.key_record, LOCALE_MENU_HINT_KEY_RECORD }, + {LOCALE_MBKEY_COPY_ONEFILE, &g_settings.mbkey_copy_onefile, NONEXISTANT_LOCALE }, + {LOCALE_MBKEY_COPY_SEVERAL, &g_settings.mbkey_copy_several, NONEXISTANT_LOCALE }, + {LOCALE_MBKEY_CUT, &g_settings.mbkey_cut, NONEXISTANT_LOCALE }, + {LOCALE_MBKEY_TRUNCATE, &g_settings.mbkey_truncate, NONEXISTANT_LOCALE }, + {LOCALE_MBKEY_COVER, &g_settings.mbkey_cover, LOCALE_MENU_HINT_MBKEY_COVER }, }; // used by driver/rcinput.cpp @@ -375,6 +380,13 @@ void CKeybindSetup::showKeyBindSetup(CMenuWidget *bindSettings) mf->setHint("", LOCALE_MENU_HINT_KEY_MOVIEPLAYER); bindSettings->addItem(mf); + //moviebrowser + CMenuWidget* bindSettings_mbrowser = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, MN_WIDGET_ID_KEYSETUP_KEYBINDING_MOVIEBROWSER); + showKeyBindMoviebrowserSetup(bindSettings_mbrowser); + mf = new CMenuDForwarder(LOCALE_MOVIEBROWSER_HEAD, true, NULL, bindSettings_mbrowser, NULL, CRCInput::RC_nokey); + mf->setHint("", LOCALE_MENU_HINT_KEY_MOVIEBROWSER); + bindSettings->addItem(mf); + //video bindSettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_KEYBINDINGMENU_VIDEO)); for (int i = NKEY_NEXT43MODE; i <= NKEY_SWITCHFORMAT; i++) { @@ -442,7 +454,8 @@ void CKeybindSetup::showKeyBindSetup(CMenuWidget *bindSettings) bindSettings->addItem(new CMenuForwarder(key_settings[NKEY_HELP].keydescription, true, keychooser[NKEY_HELP]->getKeyName(), keychooser[NKEY_HELP])); bindSettings->addItem(new CMenuForwarder(key_settings[NKEY_RECORD].keydescription, true, keychooser[NKEY_RECORD]->getKeyName(), keychooser[NKEY_RECORD])); - // right key + bindSettings->addItem(new CMenuSeparator()); + // left/right keys mc = new CMenuOptionChooser(LOCALE_KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV, &g_settings.mode_left_right_key_tv, KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_OPTIONS, KEYBINDINGMENU_MODE_LEFT_RIGHT_KEY_TV_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_KEY_RIGHT); bindSettings->addItem(mc); @@ -477,7 +490,7 @@ void CKeybindSetup::showKeyBindChannellistSetup(CMenuWidget *bindSettings_chlist } CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_EXTRA_SMS_CHANNEL, &g_settings.sms_channel, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_KEY_CHANNEL_SMS); + mc->setHint("", LOCALE_MENU_HINT_SMS_CHANNEL); bindSettings_chlist->addItem(mc); } @@ -503,6 +516,21 @@ void CKeybindSetup::showKeyBindMovieplayerSetup(CMenuWidget *bindSettings_mplaye } } +void CKeybindSetup::showKeyBindMoviebrowserSetup(CMenuWidget *bindSettings_mbrowser) +{ + bindSettings_mbrowser->addIntroItems(LOCALE_MOVIEBROWSER_HEAD); + + for (int i = MBKEY_COPY_ONEFILE; i <= MBKEY_COVER; i++) { + CMenuForwarder * mf = new CMenuForwarder(key_settings[i].keydescription, true, keychooser[i]->getKeyName(), keychooser[i]); + mf->setHint("", key_settings[i].hint); + bindSettings_mbrowser->addItem(mf); + } + + CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_EXTRA_SMS_MOVIE, &g_settings.sms_movie, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_SMS_MOVIE); + bindSettings_mbrowser->addItem(mc); +} + void CKeybindSetup::showKeyBindSpecialSetup(CMenuWidget *bindSettings_special) { bindSettings_special->addIntroItems(LOCALE_KEYBINDINGMENU_SPECIAL_ACTIVE); @@ -571,7 +599,7 @@ bool CKeybindSetup::changeNotify(const neutrino_locale_t OptionName, void * /* d return false; } -const char *CKeybindSetup::getMoviePlayerButtonName(const neutrino_msg_t key, bool &active) +const char *CKeybindSetup::getMoviePlayerButtonName(const neutrino_msg_t key, bool &active, bool return_title) { active = false; for (unsigned int i = MPKEY_REWIND; i <= MPKEY_PLUGIN; i++) @@ -579,7 +607,10 @@ const char *CKeybindSetup::getMoviePlayerButtonName(const neutrino_msg_t key, bo if ((uint32_t)*key_settings[i].keyvalue_p == (unsigned int)key) { active = true; - return g_Locale->getText(key_settings[i].keydescription); + if (!return_title && (key_settings[i].keydescription == LOCALE_MPKEY_PLUGIN)) + return g_settings.movieplayer_plugin.c_str(); + else + return g_Locale->getText(key_settings[i].keydescription); } } return ""; diff --git a/src/gui/keybind_setup.h b/src/gui/keybind_setup.h index a43067ead..ff3cb1f17 100644 --- a/src/gui/keybind_setup.h +++ b/src/gui/keybind_setup.h @@ -90,12 +90,16 @@ class CKeybindSetup : public CMenuTarget, public CChangeObserver NKEY_PIC_MODE, NKEY_PIC_SIZE, NKEY_RECORD, + MBKEY_COPY_ONEFILE, + MBKEY_COPY_SEVERAL, + MBKEY_CUT, + MBKEY_TRUNCATE, + MBKEY_COVER, KEYBINDS_COUNT }; private: - CFrameBuffer *frameBuffer; CKeyChooser *keychooser[KEYBINDS_COUNT]; int width; @@ -105,6 +109,7 @@ class CKeybindSetup : public CMenuTarget, public CChangeObserver void showKeyBindChannellistSetup(CMenuWidget *bindSettings_chlist); void showKeyBindQuickzapSetup(CMenuWidget *bindSettings_qzap); void showKeyBindMovieplayerSetup(CMenuWidget *bindSettings_mplayer); + void showKeyBindMoviebrowserSetup(CMenuWidget *bindSettings_mbrowser); void showKeyBindSpecialSetup(CMenuWidget *bindSettings_special); public: @@ -112,7 +117,7 @@ class CKeybindSetup : public CMenuTarget, public CChangeObserver ~CKeybindSetup(); int exec(CMenuTarget* parent, const std::string & actionKey); bool changeNotify(const neutrino_locale_t OptionName, void * data); - static const char *getMoviePlayerButtonName(const neutrino_msg_t key, bool &active); + static const char *getMoviePlayerButtonName(const neutrino_msg_t key, bool &active, bool return_title = false); }; #endif diff --git a/src/gui/lua/Makefile.am b/src/gui/lua/Makefile.am index e3861cb76..05a3b91a8 100644 --- a/src/gui/lua/Makefile.am +++ b/src/gui/lua/Makefile.am @@ -32,10 +32,12 @@ libneutrino_gui_lua_a_SOURCES = \ lua_cc_window.cpp \ lua_configfile.cpp \ lua_curl.cpp \ + lua_filehelpers.cpp \ lua_hintbox.cpp \ lua_menue.cpp \ lua_messagebox.cpp \ lua_misc.cpp \ + lua_stringinput.cpp \ lua_threads.cpp \ lua_threads_copy.cpp \ lua_threads_functions.cpp \ diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index f95bdbc54..9c36a6594 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 39 +#define LUA_API_VERSION_MINOR 65 diff --git a/src/gui/lua/lua_cc_header.cpp b/src/gui/lua/lua_cc_header.cpp index c2273cde5..d75ef646e 100644 --- a/src/gui/lua/lua_cc_header.cpp +++ b/src/gui/lua/lua_cc_header.cpp @@ -74,9 +74,9 @@ int CLuaInstCCHeader::CCHeaderNew(lua_State *L) lua_Integer shadow_mode = CC_SHADOW_OFF; std::string caption, icon; - lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; + lua_Unsigned color_frame = (lua_Unsigned)COL_FRAME_PLUS_0; lua_Unsigned color_body = (lua_Unsigned)COL_MENUCONTENT_PLUS_0; - lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0; + lua_Unsigned color_shadow = (lua_Unsigned)COL_SHADOW_PLUS_0; tableLookup(L, "parent", (void**)&parent); tableLookup(L, "x", x); diff --git a/src/gui/lua/lua_cc_picture.cpp b/src/gui/lua/lua_cc_picture.cpp index 0e9c8bcbc..52e99c701 100644 --- a/src/gui/lua/lua_cc_picture.cpp +++ b/src/gui/lua/lua_cc_picture.cpp @@ -57,6 +57,8 @@ void CLuaInstCCPicture::CCPictureRegister(lua_State *L) { "hide", CLuaInstCCPicture::CCPictureHide }, { "setPicture", CLuaInstCCPicture::CCPictureSetPicture }, { "setCenterPos", CLuaInstCCPicture::CCPictureSetCenterPos }, + { "getHeight", CLuaInstCCPicture::CCPictureGetHeight }, + { "getWidth", CLuaInstCCPicture::CCPictureGetWidth }, { "__gc", CLuaInstCCPicture::CCPictureDelete }, { NULL, NULL } }; @@ -76,9 +78,9 @@ int CLuaInstCCPicture::CCPictureNew(lua_State *L) lua_Integer x=10, y=10, dx=100, dy=100; std::string image_name = ""; lua_Integer alignment = 0; - lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; + lua_Unsigned color_frame = (lua_Unsigned)COL_FRAME_PLUS_0; lua_Unsigned color_background = (lua_Unsigned)COL_MENUCONTENT_PLUS_0; - lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0; + lua_Unsigned color_shadow = (lua_Unsigned)COL_SHADOW_PLUS_0; /* transparency = CFrameBuffer::TM_BLACK (2): Transparency when black content ('pseudo' transparency) @@ -126,6 +128,26 @@ int CLuaInstCCPicture::CCPictureNew(lua_State *L) return 1; } +int CLuaInstCCPicture::CCPictureGetHeight(lua_State *L) +{ + CLuaCCPicture *D = CCPictureCheck(L, 1); + if (!D) return 0; + + int h = D->cp->getHeight(); + lua_pushinteger(L, h); + return 1; +} + +int CLuaInstCCPicture::CCPictureGetWidth(lua_State *L) +{ + CLuaCCPicture *D = CCPictureCheck(L, 1); + if (!D) return 0; + + int w = D->cp->getWidth(); + lua_pushinteger(L, w); + return 1; +} + int CLuaInstCCPicture::CCPicturePaint(lua_State *L) { lua_assert(lua_istable(L,1)); diff --git a/src/gui/lua/lua_cc_picture.h b/src/gui/lua/lua_cc_picture.h index 2fb7c3e14..8bbc697ad 100644 --- a/src/gui/lua/lua_cc_picture.h +++ b/src/gui/lua/lua_cc_picture.h @@ -46,6 +46,8 @@ class CLuaInstCCPicture static int CCPictureHide(lua_State *L); static int CCPictureSetPicture(lua_State *L); static int CCPictureSetCenterPos(lua_State *L); + static int CCPictureGetHeight(lua_State *L); + static int CCPictureGetWidth(lua_State *L); static int CCPictureDelete(lua_State *L); }; diff --git a/src/gui/lua/lua_cc_signalbox.cpp b/src/gui/lua/lua_cc_signalbox.cpp index 6f9253f13..ac8a2ac17 100644 --- a/src/gui/lua/lua_cc_signalbox.cpp +++ b/src/gui/lua/lua_cc_signalbox.cpp @@ -34,6 +34,8 @@ #include "lua_cc_window.h" #include "lua_cc_signalbox.h" +#include + CLuaInstCCSignalbox* CLuaInstCCSignalbox::getInstance() { static CLuaInstCCSignalbox* LuaInstCCSignalbox = NULL; @@ -82,7 +84,7 @@ int CLuaInstCCSignalbox::CCSignalBoxNew(lua_State *L) CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL; CLuaCCSignalBox **udata = (CLuaCCSignalBox **) lua_newuserdata(L, sizeof(CLuaCCSignalBox *)); *udata = new CLuaCCSignalBox(); - (*udata)->s = new CSignalBox(x, y, dx, dy, NULL, (vertical!=0)?true:false, pw); + (*udata)->s = new CSignalBox(x, y, dx, dy, CFEManager::getInstance()->getLiveFE(), (vertical!=0)?true:false, pw); (*udata)->parent = pw; luaL_getmetatable(L, "signalbox"); lua_setmetatable(L, -2); diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index a3717e76e..7e1ea5d36 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -77,15 +77,15 @@ int CLuaInstCCText::CCTextNew(lua_State *L) lua_assert(lua_istable(L,1)); CLuaCCWindow* parent = NULL; - lua_Integer x=10, y=10, dx=100, dy=100; + lua_Integer x=10, y=10, dx=-1, dy=-1; std::string text = ""; std::string tmpMode = ""; lua_Integer mode = CTextBox::AUTO_WIDTH; lua_Integer font_text = SNeutrinoSettings::FONT_TYPE_MENU; lua_Unsigned color_text = (lua_Unsigned)COL_MENUCONTENT_TEXT; - lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; + lua_Unsigned color_frame = (lua_Unsigned)COL_FRAME_PLUS_0; lua_Unsigned color_body = (lua_Unsigned)COL_MENUCONTENT_PLUS_0; - lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0; + lua_Unsigned color_shadow = (lua_Unsigned)COL_SHADOW_PLUS_0; tableLookup(L, "parent", (void**)&parent); tableLookup(L, "x", x); @@ -139,6 +139,16 @@ int CLuaInstCCText::CCTextNew(lua_State *L) } CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL; + if(pw){ + if(dy < 1) + dy = pw->getHeight(); + if(dx < 1) + dx = pw->getWidth(); + } + if(dx < 1) + dx = 100; + if(dy < 1) + dy = 100; CLuaCCText **udata = (CLuaCCText **) lua_newuserdata(L, sizeof(CLuaCCText *)); *udata = new CLuaCCText(); diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 7fe6617a2..7dc5e77bd 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -56,6 +56,7 @@ void CLuaInstCCWindow::CCWindowRegister(lua_State *L) { "header_height", CLuaInstCCWindow::CCWindowGetHeaderHeight_dep }, /* function 'header_height' is deprecated */ { "footer_height", CLuaInstCCWindow::CCWindowGetFooterHeight_dep }, /* function 'footer_height' is deprecated */ { "setCenterPos", CLuaInstCCWindow::CCWindowSetCenterPos }, + { "setDimensionsAll", CLuaInstCCWindow::CCWindowSetDimensionsAll }, { "__gc", CLuaInstCCWindow::CCWindowDelete }, { NULL, NULL } }; @@ -72,9 +73,9 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L) lua_assert(lua_istable(L,1)); std::string name, icon = std::string(NEUTRINO_ICON_INFO); - lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; + lua_Unsigned color_frame = (lua_Unsigned)COL_FRAME_PLUS_0; lua_Unsigned color_body = (lua_Unsigned)COL_MENUCONTENT_PLUS_0; - lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0; + lua_Unsigned color_shadow = (lua_Unsigned)COL_SHADOW_PLUS_0; std::string tmp1 = "false"; std::string btnRed = ""; std::string btnGreen = ""; @@ -160,7 +161,7 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L) buttons.push_back(btnSblue); } if (!buttons.empty()) - footer->setButtonLabels(buttons, dx-20, (dx-20) / (buttons.size()+1)); + footer->setButtonLabels(buttons, footer->getWidth(), footer->getWidth() / buttons.size()); } } @@ -248,10 +249,10 @@ int CLuaInstCCWindow::CCWindowPaintHeader(lua_State *L) if (!D) return 0; CComponentsHeader* header = D->w->getHeaderObject(); - if (header) + if (header){ D->w->showHeader(); - header->paint(); - + header->paint(); + } return 0; } @@ -295,6 +296,28 @@ int CLuaInstCCWindow::CCWindowGetFooterHeight(lua_State *L) return 1; } +int CLuaInstCCWindow::CCWindowSetDimensionsAll(lua_State *L) +{ + CLuaCCWindow *D = CCWindowCheck(L, 1); + if (!D) return 0; + lua_Integer x = luaL_checkint(L, 2); + lua_Integer y = luaL_checkint(L, 3); + lua_Integer w = luaL_checkint(L, 4); + lua_Integer h = luaL_checkint(L, 5); + if(x>-1 && y > -1 && w > 1 && h > 1){ + if (h > (lua_Integer)CFrameBuffer::getInstance()->getScreenHeight()) + h = (lua_Integer)CFrameBuffer::getInstance()->getScreenHeight(); + if (w > (lua_Integer)CFrameBuffer::getInstance()->getScreenWidth()) + w = (lua_Integer)CFrameBuffer::getInstance()->getScreenWidth(); + if(x > w) + x = 0; + if(y > h) + y = 0; + D->w->setDimensionsAll(x,y,w,h); + } + return 0; +} + int CLuaInstCCWindow::CCWindowSetCenterPos(lua_State *L) { lua_assert(lua_istable(L,1)); diff --git a/src/gui/lua/lua_cc_window.h b/src/gui/lua/lua_cc_window.h index 0e32bc386..98cd9ac86 100644 --- a/src/gui/lua/lua_cc_window.h +++ b/src/gui/lua/lua_cc_window.h @@ -51,6 +51,7 @@ class CLuaInstCCWindow static int CCWindowGetFooterHeight_dep(lua_State *L); // function 'footer_height' is deprecated static int CCWindowSetCenterPos(lua_State *L); static int CCWindowDelete(lua_State *L); + static int CCWindowSetDimensionsAll(lua_State *L); }; #endif //_LUACCWINDOW_H diff --git a/src/gui/lua/lua_curl.cpp b/src/gui/lua/lua_curl.cpp index c6a3f77a7..389aad1f9 100644 --- a/src/gui/lua/lua_curl.cpp +++ b/src/gui/lua/lua_curl.cpp @@ -137,8 +137,10 @@ int CLuaInstCurl::CurlDownload(lua_State *L) o, outputfile string when empty then save to string as secund return value A, userAgent string empty + P, postfields string empty v, verbose bool false s, silent bool false + h, header bool false connectTimeout number 20 ipv4 bool false ipv6 bool false @@ -219,6 +221,9 @@ Example: std::string userAgent = ""; tableLookup(L, "A", userAgent) || tableLookup(L, "userAgent", userAgent); + std::string postfields = "";//specify data to POST to server + tableLookup(L, "P", postfields) || tableLookup(L, "postfields", postfields); + bool verbose = false; tableLookup(L, "v", verbose) || tableLookup(L, "verbose", verbose); @@ -226,6 +231,9 @@ Example: if (!verbose) tableLookup(L, "s", silent) || tableLookup(L, "silent", silent); + bool pass_header = false;//pass headers to the data stream + tableLookup(L, "header", pass_header); + lua_Integer connectTimeout = 20; tableLookup(L, "connectTimeout", connectTimeout); @@ -261,6 +269,9 @@ Example: if (!userAgent.empty()) curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, userAgent.c_str()); + if (!postfields.empty()) + curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, postfields.c_str()); + if (ipv4 && ipv6) curl_easy_setopt(curl_handle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_WHATEVER); else if (ipv4) @@ -280,6 +291,7 @@ Example: curl_easy_setopt(curl_handle, CURLOPT_MAXREDIRS, (long)maxRedirs); curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, (silent)?1L:0L); curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, (verbose)?1L:0L); + curl_easy_setopt(curl_handle, CURLOPT_HEADER, (pass_header)?1L:0L); progressData pgd; diff --git a/src/gui/lua/lua_filehelpers.cpp b/src/gui/lua/lua_filehelpers.cpp new file mode 100644 index 000000000..c874087ac --- /dev/null +++ b/src/gui/lua/lua_filehelpers.cpp @@ -0,0 +1,496 @@ +/* + * lua file helpers functions + * + * (C) 2016 M. Liebmann (micha-bbg) + * + * 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 . + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "luainstance.h" +#include "lua_filehelpers.h" + +CLuaInstFileHelpers* CLuaInstFileHelpers::getInstance() +{ + static CLuaInstFileHelpers* LuaInstFileHelpers = NULL; + + if (!LuaInstFileHelpers) + LuaInstFileHelpers = new CLuaInstFileHelpers(); + return LuaInstFileHelpers; +} + +CLuaFileHelpers *CLuaInstFileHelpers::FileHelpersCheckData(lua_State *L, int n) +{ + return *(CLuaFileHelpers **) luaL_checkudata(L, n, LUA_FILEHELPER_CLASSNAME); +} + +void CLuaInstFileHelpers::LuaFileHelpersRegister(lua_State *L) +{ + luaL_Reg meth[] = { + { "new", CLuaInstFileHelpers::FileHelpersNew }, + { "cp", CLuaInstFileHelpers::FileHelpersCp }, + { "chmod", CLuaInstFileHelpers::FileHelpersChmod }, + { "touch", CLuaInstFileHelpers::FileHelpersTouch }, + { "rmdir", CLuaInstFileHelpers::FileHelpersRmdir }, + { "mkdir", CLuaInstFileHelpers::FileHelpersMkdir }, + { "readlink", CLuaInstFileHelpers::FileHelpersReadlink }, + { "ln", CLuaInstFileHelpers::FileHelpersLn }, + { "exist", CLuaInstFileHelpers::FileHelpersExist }, + { "__gc", CLuaInstFileHelpers::FileHelpersDelete }, + { NULL, NULL } + }; + + luaL_newmetatable(L, LUA_FILEHELPER_CLASSNAME); + luaL_setfuncs(L, meth, 0); + lua_pushvalue(L, -1); + lua_setfield(L, -1, "__index"); + lua_setglobal(L, LUA_FILEHELPER_CLASSNAME); +} + +int CLuaInstFileHelpers::FileHelpersNew(lua_State *L) +{ + CLuaFileHelpers **udata = (CLuaFileHelpers **) lua_newuserdata(L, sizeof(CLuaFileHelpers *)); + *udata = new CLuaFileHelpers(); + luaL_getmetatable(L, LUA_FILEHELPER_CLASSNAME); + lua_setmetatable(L, -2); + return 1; +} + +int CLuaInstFileHelpers::FileHelpersCp(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 2; + if (numargs < min_numargs) { + printf("luascript cp: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushboolean(L, false); + return 1; + } + + if (!lua_isstring(L, 2) || !lua_isstring(L, 3)) { + printf("%s: argument 1 or 2 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *from = luaL_checkstring(L, 2); + const char *to = luaL_checkstring(L, 3); + + const char *flags = ""; + if (numargs > min_numargs){ + if (!lua_isstring(L, 4)) { + printf("%s: argument 3 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + flags = luaL_checkstring(L, 4); + } + bool ret = false; + CFileHelpers fh; + fh.setConsoleQuiet(true); + ret = fh.cp(from, to, flags); + if (ret == false) { + helpersDebugInfo di; + fh.readDebugInfo(&di); + lua_Debug ar; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, di.msg.c_str(), di.file.c_str(), di.line); + } + + lua_pushboolean(L, ret); + return 1; +} + +int CLuaInstFileHelpers::FileHelpersChmod(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 2; + if (numargs < min_numargs) { + printf("luascript chmod: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushboolean(L, false); + return 1; + } + if (!lua_isstring(L, 2)) { + printf("%s: argument 1 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *file = luaL_checkstring(L, 2); + + int mode_i = luaL_checkint(L, 3); + /* Hack for convert lua number to octal */ + std::string mode_s = itoa(mode_i, 10); + mode_t mode = (mode_t)(strtol(mode_s.c_str(), (char **)NULL, 8) & 0x0FFF); + //printf("\n##### [%s:%d] str: %s, okt: %o \n \n", __func__, __LINE__, mode_s.c_str(), (int)mode); + + bool ret = true; + if (chmod(file, mode) != 0) { + ret = false; + lua_Debug ar; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + const char* s = strerror(errno); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, s, __path_file__, __LINE__); + } + + lua_pushboolean(L, ret); + return 1; +} + +int CLuaInstFileHelpers::FileHelpersTouch(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 1; + if (numargs < min_numargs) { + printf("luascript touch: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushboolean(L, false); + return 1; + } + if (!lua_isstring(L, 2)) { + printf("%s: argument 1 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *file = luaL_checkstring(L, 2); + + bool ret = true; + lua_Debug ar; + + if (!file_exists(file)) { + FILE *f = fopen(file, "w"); + if (f == NULL) { + ret = false; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + const char* s = strerror(errno); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, s, __path_file__, __LINE__); + lua_pushboolean(L, ret); + return 1; + } + fclose(f); + if (numargs == min_numargs) { + lua_pushboolean(L, ret); + return 1; + } + } + + time_t modTime; + if (numargs == min_numargs) + /* current time */ + modTime = time(NULL); + else + /* new time */ + modTime = (time_t)luaL_checkint(L, 3); + + utimbuf utb; + utb.actime = modTime; + utb.modtime = modTime; + if (utime(file, &utb) != 0) { + ret = false; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + const char* s = strerror(errno); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, s, __path_file__, __LINE__); + } + + lua_pushboolean(L, ret); + return 1; +} + +int CLuaInstFileHelpers::FileHelpersRmdir(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 1; + if (numargs < min_numargs) { + printf("luascript rmdir: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushboolean(L, false); + return 1; + } + if (!lua_isstring(L, 2)) { + printf("%s: argument 1 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *dir = luaL_checkstring(L, 2); + + bool ret = false; + CFileHelpers* fh = CFileHelpers::getInstance(); + fh->setConsoleQuiet(true); + ret = fh->removeDir(dir); + if (ret == false) { + helpersDebugInfo di; + fh->readDebugInfo(&di); + lua_Debug ar; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, di.msg.c_str(), di.file.c_str(), di.line); + } + + lua_pushboolean(L, ret); + return 1; +} + +int CLuaInstFileHelpers::FileHelpersMkdir(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 1; + if (numargs < min_numargs) { + printf("luascript mkdir: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushboolean(L, false); + return 1; + } + if (!lua_isstring(L, 2)) { + printf("%s: argument 1 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *dir = luaL_checkstring(L, 2); + + mode_t mode = 0755; + if (numargs > min_numargs) { + int mode_i = luaL_checkint(L, 3); + /* Hack for convert lua number to octal */ + std::string mode_s = itoa(mode_i, 10); + mode = (mode_t)(strtol(mode_s.c_str(), (char **)NULL, 8) & 0x0FFF); + //printf("\n##### [%s:%d] str: %s, okt: %o \n \n", __func__, __LINE__, mode_s.c_str(), (int)mode); + } + + bool ret = false; + CFileHelpers* fh = CFileHelpers::getInstance(); + fh->setConsoleQuiet(true); + ret = fh->createDir(dir, mode); + if (ret == false) { + helpersDebugInfo di; + fh->readDebugInfo(&di); + lua_Debug ar; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, di.msg.c_str(), di.file.c_str(), di.line); + } + + lua_pushboolean(L, ret); + return 1; +} + +int CLuaInstFileHelpers::FileHelpersReadlink(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 1; + if (numargs < min_numargs) { + printf("luascript readlink: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushnil(L); + return 1; + } + if (!lua_isstring(L, 2)) { + printf("%s: argument 1 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *link = luaL_checkstring(L, 2); + + char buf[PATH_MAX]; + memset(buf, '\0', sizeof(buf)); + if (readlink(link, buf, sizeof(buf)-1) == -1) { + lua_Debug ar; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + const char* s = strerror(errno); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, s, __path_file__, __LINE__); + + lua_pushnil(L); + return 1; + } + + lua_pushstring(L, buf); + return 1; +} + +int CLuaInstFileHelpers::FileHelpersLn(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 2; + if (numargs < min_numargs) { + printf("luascript ln: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushboolean(L, false); + return 1; + } + if (!lua_isstring(L, 2) || !lua_isstring(L, 3)) { + printf("%s: argument 1 or 2 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *src = luaL_checkstring(L, 2); + const char *link = luaL_checkstring(L, 3); + + const char *flags = ""; + if (numargs > min_numargs){ + if (!lua_isstring(L, 4)) { + printf("%s: argument 3 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + flags = luaL_checkstring(L, 4); + } + bool symlnk = (strchr(flags, 's') != NULL); + bool force = (strchr(flags, 'f') != NULL); + lua_Debug ar; + + if (!symlnk) { + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + const char* s = "Currently only supports symlinks."; + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, s, __path_file__, __LINE__); + lua_pushboolean(L, false); + return 1; + } + + bool ret = true; + if (symlink(src, link) != 0) { + if (force && (errno == EEXIST)) { + if (unlink(link) == 0) { + if (symlink(src, link) == 0) { + lua_pushboolean(L, ret); + return 1; + } + } + } + ret = false; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + const char* s = strerror(errno); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, s, __path_file__, __LINE__); + + } + + lua_pushboolean(L, ret); + return 1; +} + +int CLuaInstFileHelpers::FileHelpersExist(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + + int numargs = lua_gettop(L) - 1; + int min_numargs = 2; + if (numargs < min_numargs) { + printf("luascript exist: not enough arguments (%d, expected %d)\n", numargs, min_numargs); + lua_pushnil(L); + return 1; + } + + if (!lua_isstring(L, 2) || !lua_isstring(L, 3)) { + printf("%s: argument 1 or 2 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + bool ret = false; + bool err = false; + int errLine = 0; + std::string errMsg = ""; + + const char *file = luaL_checkstring(L, 2); + const char *flag = luaL_checkstring(L, 3); + + if (file_exists(file)) { + struct stat FileInfo; + if (lstat(file, &FileInfo) == -1) { + err = true; + errLine = __LINE__; + errMsg = (std::string)strerror(errno); + } + else if (strchr(flag, 'f') != NULL) { + if (S_ISREG(FileInfo.st_mode)) + ret = true; + } + else if (strchr(flag, 'l') != NULL) { + if (S_ISLNK(FileInfo.st_mode)) + ret = true; + } + else if (strchr(flag, 'd') != NULL) { + if (S_ISDIR(FileInfo.st_mode)) + ret = true; + } + else { + err = true; + errLine = __LINE__; + errMsg = (strlen(flag) == 0) ? "no" : "unknown"; + errMsg += " flag given."; + } + } + + if (err) { + lua_Debug ar; + lua_getstack(L, 1, &ar); + lua_getinfo(L, "Sl", &ar); + printf(">>> Lua script error [%s:%d] %s\n (error from neutrino: [%s:%d])\n", + ar.short_src, ar.currentline, errMsg.c_str(), __path_file__, errLine); + lua_pushnil(L); + return 1; + } + + lua_pushboolean(L, ret); + return 1; +} + + +int CLuaInstFileHelpers::FileHelpersDelete(lua_State *L) +{ + CLuaFileHelpers *D = FileHelpersCheckData(L, 1); + if (!D) return 0; + delete D; + return 0; +} diff --git a/src/gui/lua/lua_filehelpers.h b/src/gui/lua/lua_filehelpers.h new file mode 100644 index 000000000..853f9768e --- /dev/null +++ b/src/gui/lua/lua_filehelpers.h @@ -0,0 +1,53 @@ +/* + * lua file helpers functions + * + * (C) 2016 M. Liebmann (micha-bbg) + * + * 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 _LUAFILEHELPERS_H +#define _LUAFILEHELPERS_H + +class CLuaFileHelpers +{ + public: + CLuaFileHelpers() {}; + ~CLuaFileHelpers() {}; +}; + +class CLuaInstFileHelpers +{ + public: + + CLuaInstFileHelpers() {}; + ~CLuaInstFileHelpers() {}; + static CLuaInstFileHelpers* getInstance(); + static void LuaFileHelpersRegister(lua_State *L); + + private: + static CLuaFileHelpers *FileHelpersCheckData(lua_State *L, int n); + static int FileHelpersNew(lua_State *L); + static int FileHelpersCp(lua_State *L); + static int FileHelpersChmod(lua_State *L); + static int FileHelpersTouch(lua_State *L); + static int FileHelpersRmdir(lua_State *L); + static int FileHelpersMkdir(lua_State *L); + static int FileHelpersReadlink(lua_State *L); + static int FileHelpersLn(lua_State *L); + static int FileHelpersExist(lua_State *L); + static int FileHelpersDelete(lua_State *L); +}; + +#endif //_LUAFILEHELPERS_H diff --git a/src/gui/lua/lua_hintbox.cpp b/src/gui/lua/lua_hintbox.cpp index 900637777..cfa25f203 100644 --- a/src/gui/lua/lua_hintbox.cpp +++ b/src/gui/lua/lua_hintbox.cpp @@ -154,9 +154,9 @@ int CLuaInstHintbox::HintboxExec(lua_State *L) D->b->scroll_up(); else D->b->scroll_down(); - } else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + } else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if (msg == CRCInput::RC_mode) { - res = messages_return::handled; break; } else if ((msg == CRCInput::RC_next) || (msg == CRCInput::RC_prev)) { res = messages_return::cancel_all; diff --git a/src/gui/lua/lua_menue.cpp b/src/gui/lua/lua_menue.cpp index 0f3998402..b704b56c8 100644 --- a/src/gui/lua/lua_menue.cpp +++ b/src/gui/lua/lua_menue.cpp @@ -3,7 +3,7 @@ * * (C) 2014 by martii * (C) 2014-2015 M. Liebmann (micha-bbg) - * (C) 2014 Sven Hoefer (svenhoefer) + * (C) 2016 Sven Hoefer (svenhoefer) * (C) 2015 Jacek Jendrzej (SatBaby) * * This program is free software; you can redistribute it and/or @@ -56,8 +56,10 @@ bool CLuaMenuChangeObserver::changeNotify(lua_State *L, const std::string &luaAc lua_pushstring(L, optionValue); int status = lua_pcall(L, 2 /* two args */, 1 /* one result */, 0); if (status) { - fprintf(stderr, "[CLuaMenuChangeObserver::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1)); - DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:"); + bool isString = lua_isstring(L,-1); + const char *null = "NULL"; + fprintf(stderr, "[CLuaMenuChangeObserver::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1): null); + DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:"); } double res = lua_isnumber(L, -1) ? lua_tonumber(L, -1) : 0; return (((int)res == menu_return::RETURN_REPAINT) || ((int)res == menu_return::RETURN_EXIT_REPAINT)); @@ -135,8 +137,10 @@ int CLuaMenuForwarder::exec(CMenuTarget* /*parent*/, const std::string & /*actio lua_pushstring(L, luaId.c_str()); int status = lua_pcall(L, 1 /* one arg */, 1 /* one result */, 0); if (status) { - fprintf(stderr, "[CLuaMenuForwarder::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1)); - DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:"); + bool isString = lua_isstring(L,-1); + const char *null = "NULL"; + fprintf(stderr, "[CLuaMenuForwarder::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1):null); + DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:"); } if (lua_isnumber(L, -1)) res = (int) lua_tonumber(L, -1); @@ -158,6 +162,7 @@ void CLuaMenuFilebrowser::Init(std::string *_value, bool _dirMode) int CLuaMenuFilebrowser::exec(CMenuTarget* /*parent*/, const std::string& /*actionKey*/) { + int res = menu_return::RETURN_REPAINT; CFileBrowser fileBrowser; fileBrowser.Dir_Mode = dirMode; @@ -179,12 +184,16 @@ int CLuaMenuFilebrowser::exec(CMenuTarget* /*parent*/, const std::string& /*acti lua_pushstring(L, value->c_str()); int status = lua_pcall(L, 2 /* two arg */, 1 /* one result */, 0); if (status) { - fprintf(stderr, "[CLuaMenuFilebrowser::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1)); - DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:"); + bool isString = lua_isstring(L,-1); + const char *null = "NULL"; + fprintf(stderr, "[CLuaMenuFilebrowser::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1):null); + DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:"); } + if (lua_isnumber(L, -1)) + res = (int) lua_tonumber(L, -1); lua_pop(L, 1); } - return menu_return::RETURN_REPAINT; + return res; } CLuaMenuStringinput::CLuaMenuStringinput(lua_State *_L, std::string _luaAction, std::string _luaId, const char *_name, std::string *_value, int _size, std::string _valid_chars, CChangeObserver *_observ, const char *_icon, bool _sms) : CLuaMenuForwarder(_L, _luaAction, _luaId) @@ -205,6 +214,7 @@ void CLuaMenuStringinput::Init(const char *_name, std::string *_value, int _size int CLuaMenuStringinput::exec(CMenuTarget* /*parent*/, const std::string & /*actionKey*/) { + int res = menu_return::RETURN_REPAINT; CStringInput *i; if (sms) i = new CStringInputSMS((char *)name, value, size, @@ -222,12 +232,16 @@ int CLuaMenuStringinput::exec(CMenuTarget* /*parent*/, const std::string & /*act lua_pushstring(L, value->c_str()); int status = lua_pcall(L, 2 /* two arg */, 1 /* one result */, 0); if (status) { - fprintf(stderr, "[CLuaMenuStringinput::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1)); - DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:"); + bool isString = lua_isstring(L,-1); + const char *null = "NULL"; + fprintf(stderr, "[CLuaMenuStringinput::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1):null); + DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:"); } + if (lua_isnumber(L, -1)) + res = (int) lua_tonumber(L, -1); lua_pop(L, 2); } - return menu_return::RETURN_REPAINT; + return res; } CLuaMenuKeyboardinput::CLuaMenuKeyboardinput(lua_State *_L, std::string _luaAction, std::string _luaId, const char *_name, std::string *_value, int _size, CChangeObserver *_observ, const char *_icon, std::string _help, std::string _help2) : CLuaMenuForwarder(_L, _luaAction, _luaId) @@ -248,6 +262,7 @@ void CLuaMenuKeyboardinput::Init(const char *_name, std::string *_value, int _si int CLuaMenuKeyboardinput::exec(CMenuTarget* /*parent*/, const std::string & /*actionKey*/) { + int res = menu_return::RETURN_REPAINT; CKeyboardInput *i; i = new CKeyboardInput((char *)name, value, size, observ, icon, help, help2); i->exec(NULL, ""); @@ -260,12 +275,16 @@ int CLuaMenuKeyboardinput::exec(CMenuTarget* /*parent*/, const std::string & /*a lua_pushstring(L, value->c_str()); int status = lua_pcall(L, 2 /* two arg */, 1 /* one result */, 0); if (status) { - fprintf(stderr, "[CLuaMenuKeyboardinput::%s:%d] error in script: %s\n", __func__, __LINE__, lua_tostring(L, -1)); - DisplayErrorMessage(lua_tostring(L, -1), "Lua Script Error:"); + bool isString = lua_isstring(L,-1); + const char *null = "NULL"; + fprintf(stderr, "[CLuaMenuKeyboardinput::%s:%d] error in script: %s\n", __func__, __LINE__, isString ? lua_tostring(L, -1):null); + DisplayErrorMessage(isString ? lua_tostring(L, -1):null, "Lua Script Error:"); } + if (lua_isnumber(L, -1)) + res = (int) lua_tonumber(L, -1); lua_pop(L, 2); } - return menu_return::RETURN_REPAINT; + return res; } int CLuaInstMenu::MenuNew(lua_State *L) diff --git a/src/gui/lua/lua_messagebox.cpp b/src/gui/lua/lua_messagebox.cpp index 5be190692..303db0541 100644 --- a/src/gui/lua/lua_messagebox.cpp +++ b/src/gui/lua/lua_messagebox.cpp @@ -73,8 +73,6 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) std::string tmp; if (tableLookup(L, "align", tmp)) { - lua_pushvalue(L, -2); - const char *val = lua_tostring(L, -2); table_key mb[] = { { "center1", CMessageBox::mbBtnAlignCenter1 }, { "center2", CMessageBox::mbBtnAlignCenter2 }, @@ -83,11 +81,12 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) { NULL, 0 } }; for (int i = 0; mb[i].name; i++) - if (!strcmp(mb[i].name, val)) { + if (!strcmp(mb[i].name, tmp.c_str())) { show_buttons |= mb[i].code; break; } } + lua_pushstring(L, "buttons"); lua_gettable(L, -2); for (lua_pushnil(L); lua_next(L, -2); lua_pop(L, 2)) { @@ -109,6 +108,8 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) } } lua_pop(L, 1); + if ((show_buttons & 0xFF) == 0) + show_buttons |= CMessageBox::mbAll; table_key mbr[] = { { "yes", CMessageBox::mbrYes }, @@ -119,10 +120,8 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) { NULL, 0 } }; if (tableLookup(L, "default", tmp)) { - lua_pushvalue(L, -2); - const char *val = lua_tostring(L, -2); for (int i = 0; mbr[i].name; i++) - if (!strcmp(mbr[i].name, val)) { + if (!strcmp(mbr[i].name, tmp.c_str())) { default_button = mbr[i].code; break; } diff --git a/src/gui/lua/lua_misc.cpp b/src/gui/lua/lua_misc.cpp index 3514f19c8..9b965ae5d 100644 --- a/src/gui/lua/lua_misc.cpp +++ b/src/gui/lua/lua_misc.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -315,7 +316,8 @@ int CLuaInstMisc::checkVersion(lua_State *L) LUA_API_VERSION_MAJOR, LUA_API_VERSION_MINOR, g_Locale->getText(LOCALE_LUA_VERSIONSCHECK2), major, minor); - luaL_error(L, msg); + DisplayErrorMessage(msg, "Lua Script Error:"); + } lua_pushinteger(L, 1); /* for backward compatibility */ return 1; @@ -365,8 +367,7 @@ int CLuaInstMisc::MiscDelete(lua_State *L) deprecated functions --------------------------------------------------------------- */ -//#define MISC_FUNC_DEPRECATED miscFunctionDeprecated -#define MISC_FUNC_DEPRECATED(...) +#define MISC_FUNC_DEPRECATED miscFunctionDeprecated void CLuaInstMisc::miscFunctionDeprecated(lua_State *L, std::string oldFunc) { diff --git a/src/gui/lua/lua_stringinput.cpp b/src/gui/lua/lua_stringinput.cpp new file mode 100644 index 000000000..90e3023ed --- /dev/null +++ b/src/gui/lua/lua_stringinput.cpp @@ -0,0 +1,115 @@ +/* + * lua stringinput + * + * (C) 2016 Sven Hoefer (svenhoefer) + * (C) 2016 M. Liebmann (micha-bbg) + * + * 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 . + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "luainstance.h" +#include "lua_stringinput.h" + +CLuaInstStringInput* CLuaInstStringInput::getInstance() +{ + static CLuaInstStringInput* LuaInstStringInput = NULL; + + if (!LuaInstStringInput) + LuaInstStringInput = new CLuaInstStringInput(); + return LuaInstStringInput; +} + +void CLuaInstStringInput::StringInputRegister(lua_State *L) +{ + luaL_Reg meth[] = { + { "exec", CLuaInstStringInput::StringInputExec }, + { NULL, NULL } + }; + + luaL_newmetatable(L, "stringinput"); + luaL_setfuncs(L, meth, 0); + lua_pushvalue(L, -1); + lua_setfield(L, -1, "__index"); + lua_setglobal(L, "stringinput"); +} + +/* + local return_value = stringinput.exec{ + caption="Title", + value="value", + icon="settings", + valid_chars="0123456789", + size=4 + } +*/ +int CLuaInstStringInput::StringInputExec(lua_State *L) +{ + lua_assert(lua_istable(L,1)); + + std::string name; + tableLookup(L, "name", name) || tableLookup(L, "title", name) || tableLookup(L, "caption", name); + + std::string value; + tableLookup(L, "value", value); + + lua_Integer size = 30; + tableLookup(L, "size", size); + + // TODO: Locales? + + std::string valid_chars = "abcdefghijklmnopqrstuvwxyz0123456789!\"$%&/()=?-.@,_: "; + tableLookup(L, "valid_chars", valid_chars); + + // TODO: CChangeObserver? + + std::string icon = std::string(NEUTRINO_ICON_INFO); + tableLookup(L, "icon", icon); + + lua_Integer sms = 0; + tableLookup(L, "sms", sms); + + lua_Integer pin = 0; + tableLookup(L, "pin", pin); + + if (sms && pin) + dprintf(DEBUG_NORMAL, "[CLuaInstance][%s - %d]: 'sms' AND 'pin' is defined! 'pin' will be prefered.\n", __func__, __LINE__); + + CStringInput *i; + if (pin) + i = new CPINInput(name, &value, size, + NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, valid_chars.c_str(), NULL); + else if (sms) + i = new CStringInputSMS(name, &value, size, + NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, valid_chars.c_str(), NULL, icon.c_str()); + else + i = new CStringInput(name, &value, size, + NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, valid_chars.c_str(), NULL, icon.c_str()); + i->exec(NULL, ""); + delete i; + + lua_pushstring(L, value.c_str()); + + return 1; +} diff --git a/src/gui/lua/lua_stringinput.h b/src/gui/lua/lua_stringinput.h new file mode 100644 index 000000000..c49ad7dc0 --- /dev/null +++ b/src/gui/lua/lua_stringinput.h @@ -0,0 +1,44 @@ +/* + * lua stringinput + * + * (C) 2016 Sven Hoefer (svenhoefer) + * (C) 2016 M. Liebmann (micha-bbg) + * + * 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 _LUASTRINGINPUT_H +#define _LUASTRINGINPUT_H + +class CLuaStringInput +{ + public: + CStringInput *b; + CLuaStringInput(); + ~CLuaStringInput(); +}; + +class CLuaInstStringInput +{ + public: + CLuaInstStringInput() {}; + ~CLuaInstStringInput() {}; + static CLuaInstStringInput* getInstance(); + static void StringInputRegister(lua_State *L); + + private: + static int StringInputExec(lua_State *L); +}; + +#endif //_LUASTRINGINPUT_H diff --git a/src/gui/lua/lua_threads.cpp b/src/gui/lua/lua_threads.cpp index c4f7fdee3..6a63c8bd5 100644 --- a/src/gui/lua/lua_threads.cpp +++ b/src/gui/lua/lua_threads.cpp @@ -174,7 +174,7 @@ llthread_t *CLLThread::llthread_create(lua_State *L, const char *code, size_t co /* non-string error message. */ lua_pushfstring(L, "luaL_loadbuffer() failed to load Lua code: rc=%d", rc); } - /* llthread_destroy(_this); */ + llthread_destroy(_this); lua_error(L); return NULL; } diff --git a/src/gui/lua/lua_threads_functions.cpp b/src/gui/lua/lua_threads_functions.cpp index 3d8f210cc..ac8df53fb 100644 --- a/src/gui/lua/lua_threads_functions.cpp +++ b/src/gui/lua/lua_threads_functions.cpp @@ -263,7 +263,7 @@ int CLLThread::l_llthread_delete(lua_State *L) { llthread_t **pthis = (llthread_t **)luaL_checkudata(L, 1, LLTHREAD_TAG); luaL_argcheck (L, pthis != NULL, 1, "thread expected"); - if (*pthis == NULL) return 0; + if (pthis == NULL || *pthis == NULL) return 0; llthread_destroy(*pthis); *pthis = NULL; diff --git a/src/gui/lua/lua_video.cpp b/src/gui/lua/lua_video.cpp index 8ee09629f..dfef5c7e5 100644 --- a/src/gui/lua/lua_video.cpp +++ b/src/gui/lua/lua_video.cpp @@ -48,7 +48,11 @@ CLuaInstVideo* CLuaInstVideo::getInstance() CLuaVideo *CLuaInstVideo::VideoCheckData(lua_State *L, int n) { - return *(CLuaVideo **) luaL_checkudata(L, n, LUA_VIDEO_CLASSNAME); + void* ret = luaL_testudata(L, n, LUA_VIDEO_CLASSNAME); + if (ret == NULL) + return NULL; + else + return *(CLuaVideo **) ret; } void CLuaInstVideo::LuaVideoRegister(lua_State *L) @@ -149,10 +153,28 @@ int CLuaInstVideo::PlayFile(lua_State *L) printf("CLuaInstVideo::%s: not enough arguments (%d, expected 3)\n", __func__, numargs); return 0; } + const char *errmsg = "is not a string."; + if(!lua_isstring(L,2)){ + printf("CLuaInstVideo::%s: argument 1 %s\n", __func__, errmsg); + return 0; + } + if(!lua_isstring(L,3)){ + printf("CLuaInstVideo::%s: argument 2 %s\n", __func__, errmsg); + return 0; + } + if(numargs > 3 && !lua_isstring(L,4)){ + printf("CLuaInstVideo::%s: argument 3 %s\n", __func__, errmsg); + return 0; + } + if(numargs > 4 && !lua_isstring(L,5)){ + printf("CLuaInstVideo::%s: argument 4 %s\n", __func__, errmsg); + return 0; + } bool sp = false; if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) - sp = D->singlePlay; + if (D) + sp = D->singlePlay; if ((sp == false) && (CMoviePlayerGui::getInstance().getBlockedFromPlugin() == false)) CMoviePlayerGui::getInstance().setBlockedFromPlugin(true); @@ -216,7 +238,9 @@ bool CLuaInstVideo::execLuaInfoFunc(lua_State *L, int xres, int yres, int aspect lua_getstack(L, 1, &ar); lua_getinfo(L, "Sl", &ar); memset(msg, '\0', sizeof(msg)); - snprintf(msg, sizeof(msg)-1, "[%s:%d] error running function '%s': %s", ar.short_src, ar.currentline, D->infoFunc.c_str(), lua_tostring(L, -1)); + bool isString = lua_isstring(L,-1); + const char *null = "NULL"; + snprintf(msg, sizeof(msg)-1, "[%s:%d] error running function '%s': %s", ar.short_src, ar.currentline, D->infoFunc.c_str(), isString ? lua_tostring(L, -1):null); fprintf(stderr, "[CLuaInstVideo::%s:%d] %s\n", __func__, __LINE__, msg); DisplayErrorMessage(msg); return false; @@ -328,8 +352,7 @@ int CLuaInstVideo::VideoDelete(lua_State *L) deprecated functions --------------------------------------------------------------- */ -//#define VIDEO_FUNC_DEPRECATED videoFunctionDeprecated -#define VIDEO_FUNC_DEPRECATED(...) +#define VIDEO_FUNC_DEPRECATED videoFunctionDeprecated void CLuaInstVideo::videoFunctionDeprecated(lua_State *L, std::string oldFunc) { diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index f3bf6b45f..e7e0b80bc 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -44,10 +45,12 @@ #include "lua_cc_window.h" #include "lua_configfile.h" #include "lua_curl.h" +#include "lua_filehelpers.h" #include "lua_hintbox.h" #include "lua_menue.h" #include "lua_messagebox.h" #include "lua_misc.h" +#include "lua_stringinput.h" #include "lua_threads.h" #include "lua_video.h" @@ -149,6 +152,7 @@ static void set_lua_variables(lua_State *L) { "prog3", CRCInput::RC_prog3 }, { "prog4", CRCInput::RC_prog4 }, #endif + { "timeout", (lua_Integer)CRCInput::RC_timeout }, /* to check if it is in our range */ { "MaxRC", CRCInput::RC_MaxRC }, { NULL, 0 } @@ -159,13 +163,20 @@ static void set_lua_variables(lua_State *L) { { "COLORED_EVENTS_CHANNELLIST", MAGIC_COLOR | (COL_COLORED_EVENTS_CHANNELLIST) }, { "COLORED_EVENTS_INFOBAR", MAGIC_COLOR | (COL_COLORED_EVENTS_INFOBAR) }, - { "INFOBAR_SHADOW", MAGIC_COLOR | (COL_INFOBAR_SHADOW) }, + { "SHADOW", MAGIC_COLOR | (COL_SHADOW) }, +/* obsolete */ { "INFOBAR_SHADOW", MAGIC_COLOR | (COL_SHADOW) }, // just here to stay backward compatible { "INFOBAR", MAGIC_COLOR | (COL_INFOBAR) }, { "MENUHEAD", MAGIC_COLOR | (COL_MENUHEAD) }, { "MENUCONTENT", MAGIC_COLOR | (COL_MENUCONTENT) }, { "MENUCONTENTDARK", MAGIC_COLOR | (COL_MENUCONTENTDARK) }, { "MENUCONTENTSELECTED", MAGIC_COLOR | (COL_MENUCONTENTSELECTED) }, { "MENUCONTENTINACTIVE", MAGIC_COLOR | (COL_MENUCONTENTINACTIVE) }, + { "MENUFOOT", MAGIC_COLOR | (COL_MENUFOOT) }, + { "FRAME", MAGIC_COLOR | (COL_FRAME) }, + { "SCROLLBAR_ACTIVE", MAGIC_COLOR | (COL_SCROLLBAR_ACTIVE) }, + { "SCROLLBAR_PASSIVE", MAGIC_COLOR | (COL_SCROLLBAR_PASSIVE) }, + { "PROGRESSBAR_ACTIVE", MAGIC_COLOR | (COL_PROGRESSBAR_ACTIVE) }, + { "PROGRESSBAR_PASSIVE", MAGIC_COLOR | (COL_PROGRESSBAR_PASSIVE) }, { "BACKGROUND", MAGIC_COLOR | (COL_BACKGROUND) }, { "DARK_RED", MAGIC_COLOR | (COL_DARK_RED0) }, { "DARK_GREEN", MAGIC_COLOR | (COL_DARK_GREEN0) }, @@ -182,7 +193,7 @@ static void set_lua_variables(lua_State *L) { "BLACK", MAGIC_COLOR | (COL_BLACK0) }, { "COLORED_EVENTS_TEXT", (lua_Unsigned) (COL_COLORED_EVENTS_TEXT) }, { "INFOBAR_TEXT", (lua_Unsigned) (COL_INFOBAR_TEXT) }, - { "INFOBAR_SHADOW_TEXT", (lua_Unsigned) (COL_INFOBAR_SHADOW_TEXT) }, +/* obsolete */ { "INFOBAR_SHADOW_TEXT", (lua_Unsigned) (COL_MENUFOOT_TEXT) }, // just here to stay backward compatible { "MENUHEAD_TEXT", (lua_Unsigned) (COL_MENUHEAD_TEXT) }, { "MENUCONTENT_TEXT", (lua_Unsigned) (COL_MENUCONTENT_TEXT) }, { "MENUCONTENT_TEXT_PLUS_1", (lua_Unsigned) (COL_MENUCONTENT_TEXT_PLUS_1) }, @@ -195,6 +206,8 @@ static void set_lua_variables(lua_State *L) { "MENUCONTENTSELECTED_TEXT_PLUS_1", (lua_Unsigned) (COL_MENUCONTENTSELECTED_TEXT_PLUS_1) }, { "MENUCONTENTSELECTED_TEXT_PLUS_2", (lua_Unsigned) (COL_MENUCONTENTSELECTED_TEXT_PLUS_2) }, { "MENUCONTENTINACTIVE_TEXT", (lua_Unsigned) (COL_MENUCONTENTINACTIVE_TEXT) }, + { "MENUFOOT_TEXT", (lua_Unsigned) (COL_MENUFOOT_TEXT) }, + { "SHADOW_PLUS_0", (lua_Unsigned) (COL_SHADOW_PLUS_0) }, { "MENUHEAD_PLUS_0", (lua_Unsigned) (COL_MENUHEAD_PLUS_0) }, { "MENUCONTENT_PLUS_0", (lua_Unsigned) (COL_MENUCONTENT_PLUS_0) }, { "MENUCONTENT_PLUS_1", (lua_Unsigned) (COL_MENUCONTENT_PLUS_1) }, @@ -209,6 +222,12 @@ static void set_lua_variables(lua_State *L) { "MENUCONTENTSELECTED_PLUS_0", (lua_Unsigned) (COL_MENUCONTENTSELECTED_PLUS_0) }, { "MENUCONTENTSELECTED_PLUS_2", (lua_Unsigned) (COL_MENUCONTENTSELECTED_PLUS_2) }, { "MENUCONTENTINACTIVE_PLUS_0", (lua_Unsigned) (COL_MENUCONTENTINACTIVE_PLUS_0) }, + { "MENUFOOT_PLUS_0", (lua_Unsigned) (COL_MENUFOOT_PLUS_0) }, + { "FRAME_PLUS_0", (lua_Unsigned) (COL_FRAME_PLUS_0) }, + { "SCROLLBAR_ACTIVE_PLUS_0", (lua_Unsigned) (COL_SCROLLBAR_ACTIVE_PLUS_0) }, + { "SCROLLBAR_PASSIVE_PLUS_0", (lua_Unsigned) (COL_SCROLLBAR_PASSIVE_PLUS_0) }, + { "PROGRESSBAR_ACTIVE_PLUS_0", (lua_Unsigned) (COL_PROGRESSBAR_ACTIVE_PLUS_0) }, + { "PROGRESSBAR_PASSIVE_PLUS_0", (lua_Unsigned) (COL_PROGRESSBAR_PASSIVE_PLUS_0) }, { NULL, 0 } }; @@ -435,8 +454,10 @@ void CLuaInstance::runScript(const char *fileName, std::vector *arg /* run the script */ int status = luaL_loadfile(lua, fileName); if (status) { - fprintf(stderr, "[CLuaInstance::%s] Can't load file: %s\n", __func__, lua_tostring(lua, -1)); - DisplayErrorMessage(lua_tostring(lua, -1), "Lua Script Error:"); + bool isString = lua_isstring(lua,-1); + const char *null = "NULL"; + fprintf(stderr, "[CLuaInstance::%s] Can't load file: %s\n", __func__, isString ? lua_tostring(lua, -1):null); + DisplayErrorMessage(isString ? lua_tostring(lua, -1):null, "Lua Script Error:"); if (error_string) *error_string = std::string(lua_tostring(lua, -1)); return; @@ -466,8 +487,10 @@ void CLuaInstance::runScript(const char *fileName, std::vector *arg *result_string = std::string(lua_tostring(lua, -1)); if (status) { - fprintf(stderr, "[CLuaInstance::%s] error in script: %s\n", __func__, lua_tostring(lua, -1)); - DisplayErrorMessage(lua_tostring(lua, -1), "Lua Script Error:"); + bool isString = lua_isstring(lua,-1); + const char *null = "NULL"; + fprintf(stderr, "[CLuaInstance::%s] error in script: %s\n", __func__, isString ? lua_tostring(lua, -1):null); + DisplayErrorMessage(isString ? lua_tostring(lua, -1):null, "Lua Script Error:"); if (error_string) *error_string = std::string(lua_tostring(lua, -1)); /* restoreNeutrino at plugin crash, when blocked from plugin */ @@ -612,9 +635,11 @@ void LuaInstRegisterFunctions(lua_State *L, bool fromThreads/*=false*/) CLuaInstCCWindow::getInstance()->CCWindowRegister(L); CLuaInstConfigFile::getInstance()->LuaConfigFileRegister(L); CLuaInstCurl::getInstance()->LuaCurlRegister(L); + CLuaInstFileHelpers::getInstance()->LuaFileHelpersRegister(L); CLuaInstHintbox::getInstance()->HintboxRegister(L); CLuaInstMenu::getInstance()->MenuRegister(L); CLuaInstMessagebox::getInstance()->MessageboxRegister(L); + CLuaInstStringInput::getInstance()->StringInputRegister(L); CLuaInstMisc::getInstance()->LuaMiscRegister(L); CLuaInstVideo::getInstance()->LuaVideoRegister(L); if (!fromThreads) @@ -625,8 +650,10 @@ CLuaData *CLuaInstance::CheckData(lua_State *L, int narg) { luaL_checktype(L, narg, LUA_TUSERDATA); void *ud = luaL_checkudata(L, narg, className); - if (!ud) + if (!ud) { fprintf(stderr, "[CLuaInstance::%s] wrong type %p, %d, %s\n", __func__, L, narg, className); + return NULL; + } return *(CLuaData **)ud; // unbox pointer } @@ -682,9 +709,12 @@ int CLuaInstance::GCWindow(lua_State *L) else if (videoDecoder->getBlank()) CLuaInstVideo::getInstance()->channelRezap(L); - delete w->fbwin; - w->rcinput = NULL; - delete w; + if(w){ + if(w->fbwin) + delete w->fbwin; + w->rcinput = NULL; + delete w; + } return 0; } diff --git a/src/gui/lua/luainstance_helpers.h b/src/gui/lua/luainstance_helpers.h index 5b6dfb141..fa54bb690 100644 --- a/src/gui/lua/luainstance_helpers.h +++ b/src/gui/lua/luainstance_helpers.h @@ -2,7 +2,7 @@ * lua instance helper functions * * (C) 2013 Stefan Seyfried (seife) - * (C) 2014-2015 M. Liebmann (micha-bbg) + * (C) 2014-2016 M. Liebmann (micha-bbg) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -30,9 +30,10 @@ #define LUA_MISC_CLASSNAME "misc" #define LUA_CURL_CLASSNAME "curl" #define LUA_HEADER_CLASSNAME "header" +#define LUA_FILEHELPER_CLASSNAME "filehelpers" -//#define LUA_WIKI "http://wiki.tuxbox.org/....." -#define LUA_WIKI "https://slknet.de/wiki/w" +#define LUA_WIKI "https://wiki.neutrino-hd.de/wiki" +//#define LUA_WIKI "https://wiki.slknet.de/wiki" /* the magic color that tells us we are using one of the palette colors */ #define MAGIC_COLOR 0x42424200 diff --git a/src/gui/mediaplayer.cpp b/src/gui/mediaplayer.cpp index 3c55f267f..7d25e73a3 100644 --- a/src/gui/mediaplayer.cpp +++ b/src/gui/mediaplayer.cpp @@ -53,7 +53,7 @@ #include #include extern cVideo * videoDecoder; -extern CInfoClock *InfoClock; + CMediaPlayerMenu::CMediaPlayerMenu() { @@ -108,7 +108,7 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey) else if (actionKey == "movieplayer") { audiomute->enableMuteIcon(false); - InfoClock->enableInfoClock(false); + CInfoClock::getInstance()->enableInfoClock(false); int mode = CNeutrinoApp::getInstance()->getMode(); if( mode == NeutrinoMessages::mode_radio ) CFrameBuffer::getInstance()->stopFrame(); @@ -116,7 +116,7 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey) if( mode == NeutrinoMessages::mode_radio ) CFrameBuffer::getInstance()->showFrame("radiomode.jpg"); audiomute->enableMuteIcon(true); - InfoClock->enableInfoClock(true); + CInfoClock::getInstance()->enableInfoClock(true); return res; } @@ -154,20 +154,20 @@ int CMediaPlayerMenu::initMenuMedia(CMenuWidget *m, CPersonalizeGui *p) #endif CMenuWidget *moviePlayer = NULL; + bool enabled = !CMoviePlayerGui::getInstance().Playing(); if (usage_mode != MODE_VIDEO) { //audio player neutrino_msg_t audio_rc = usage_mode == MODE_AUDIO ? CRCInput::RC_audio : g_settings.easymenu ? CRCInput::RC_green : CRCInput::RC_red; - fw_audio = new CMenuForwarder(LOCALE_MAINMENU_AUDIOPLAYER, true, NULL, this, "audioplayer", audio_rc); + fw_audio = new CMenuForwarder(LOCALE_MAINMENU_AUDIOPLAYER, enabled, NULL, this, "audioplayer", audio_rc); fw_audio->setHint(NEUTRINO_ICON_HINT_APLAY, LOCALE_MENU_HINT_APLAY); //internet player neutrino_msg_t inet_rc = usage_mode == MODE_AUDIO ? CRCInput::RC_www : g_settings.easymenu ? CRCInput::RC_blue : CRCInput::RC_green; - fw_inet = new CMenuForwarder(LOCALE_INETRADIO_NAME, true, NULL, this, "inetplayer", inet_rc); + fw_inet = new CMenuForwarder(LOCALE_INETRADIO_NAME, enabled, NULL, this, "inetplayer", inet_rc); fw_inet->setHint(NEUTRINO_ICON_HINT_INET_RADIO, LOCALE_MENU_HINT_INET_RADIO); } - bool enabled = !CMoviePlayerGui::getInstance().Playing(); if (usage_mode == MODE_DEFAULT) { //movieplayer @@ -295,7 +295,7 @@ void CMediaPlayerMenu::showMoviePlayer(CMenuWidget *moviePlayer, CPersonalizeGui p->addItem(moviePlayer, fw_file, &g_settings.personalize[SNeutrinoSettings::P_MPLAYER_FILEPLAY]); //ytplayback if (!g_settings.easymenu) { - CMenuForwarder *fw_yt = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, true, NULL, &CMoviePlayerGui::getInstance(), "ytplayback", CRCInput::RC_yellow); + CMenuForwarder *fw_yt = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, g_settings.youtube_enabled, NULL, &CMoviePlayerGui::getInstance(), "ytplayback", CRCInput::RC_yellow); fw_yt->setHint(NEUTRINO_ICON_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY); p->addItem(moviePlayer, fw_yt, &g_settings.personalize[SNeutrinoSettings::P_MPLAYER_YTPLAY]); } diff --git a/src/gui/mediaplayer_setup.cpp b/src/gui/mediaplayer_setup.cpp index c2894739d..bb18e8333 100644 --- a/src/gui/mediaplayer_setup.cpp +++ b/src/gui/mediaplayer_setup.cpp @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 512950684..fd49866b0 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -99,11 +100,11 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) } else if(actionKey == "movieplayer_plugin") { - CMenuWidget MoviePluginSelector(LOCALE_MOVIEPLAYER_DEFPLUGIN, NEUTRINO_ICON_FEATURES); + CMenuWidget MoviePluginSelector(LOCALE_MOVIEPLAYER_PLUGIN, NEUTRINO_ICON_FEATURES); MoviePluginSelector.addItem(GenericMenuSeparator); - + MoviePluginSelector.addItem(new CMenuForwarder(LOCALE_PLUGINS_NO_PLUGIN, true, NULL, new CMoviePluginChangeExec(), "---", CRCInput::RC_red)); + MoviePluginSelector.addItem(GenericMenuSeparatorLine); char id[5]; - int cnt = 0; int enabled_count = 0; for(unsigned int count=0;count < (unsigned int) g_PluginList->getNumberOfPlugins();count++) { @@ -111,8 +112,7 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) { sprintf(id, "%d", count); enabled_count++; - MoviePluginSelector.addItem(new CMenuForwarder(g_PluginList->getName(count), true, NULL, new CMoviePluginChangeExec(), id, CRCInput::convertDigitToKey(count)), (cnt == 0)); - cnt++; + MoviePluginSelector.addItem(new CMenuForwarder(g_PluginList->getName(count), true, NULL, new CMoviePluginChangeExec(), id, CRCInput::convertDigitToKey(count))); } } @@ -135,11 +135,15 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) { return showMiscSettingsMenuChanlist(); } + else if(actionKey == "onlineservices") + { + return showMiscSettingsMenuOnlineServices(); + } return showMiscSettingsMenu(); } - +#if 0 //not used #define MISCSETTINGS_FB_DESTINATION_OPTION_COUNT 3 const CMenuOptionChooser::keyval MISCSETTINGS_FB_DESTINATION_OPTIONS[MISCSETTINGS_FB_DESTINATION_OPTION_COUNT] = { @@ -147,6 +151,7 @@ const CMenuOptionChooser::keyval MISCSETTINGS_FB_DESTINATION_OPTIONS[MISCSETTING { 1, LOCALE_OPTIONS_SERIAL }, { 2, LOCALE_OPTIONS_FB } }; +#endif #define MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTION_COUNT 2 const CMenuOptionChooser::keyval MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTIONS[MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTION_COUNT] = @@ -277,11 +282,16 @@ int CMiscMenue::showMiscSettingsMenu() mf->setHint("", LOCALE_MENU_HINT_MISC_ZAPIT); misc_menue.addItem(mf); + // onlineservices + mf = new CMenuForwarder(LOCALE_MISCSETTINGS_ONLINESERVICES, true, NULL, this, "onlineservices", CRCInput::RC_4); + mf->setHint("", LOCALE_MENU_HINT_MISC_ONLINESERVICES); + misc_menue.addItem(mf); + #ifdef CPU_FREQ //CPU CMenuWidget misc_menue_cpu("CPU", NEUTRINO_ICON_SETTINGS, width); showMiscSettingsMenuCPUFreq(&misc_menue_cpu); - misc_menue.addItem( new CMenuForwarder("CPU", true, NULL, &misc_menue_cpu, NULL, CRCInput::RC_4)); + misc_menue.addItem( new CMenuForwarder("CPU", true, NULL, &misc_menue_cpu, NULL, CRCInput::RC_5)); #endif /*CPU_FREQ*/ int res = misc_menue.exec(NULL, ""); @@ -544,6 +554,51 @@ int CMiscMenue::showMiscSettingsMenuChanlist() return res; } +// online services +int CMiscMenue::showMiscSettingsMenuOnlineServices() +{ + CMenuWidget *ms_oservices = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_MISCSETUP_ONLINESERVICES); + ms_oservices->addIntroItems(LOCALE_MISCSETTINGS_ONLINESERVICES); + + tmdb_onoff = new CMenuOptionChooser(LOCALE_TMDB_ENABLED, &g_settings.tmdb_enabled, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, check_tmdb_api_key()); + tmdb_onoff->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_TMDB_ENABLED); + ms_oservices->addItem(tmdb_onoff); + + changeNotify(LOCALE_TMDB_API_KEY, NULL); + CKeyboardInput tmdb_api_key_input(LOCALE_TMDB_API_KEY, &g_settings.tmdb_api_key, 32, this); + CMenuForwarder *mf = new CMenuForwarder(LOCALE_TMDB_API_KEY, true, tmdb_api_key_short, &tmdb_api_key_input); + mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_TMDB_API_KEY); + ms_oservices->addItem(mf); + + ms_oservices->addItem(GenericMenuSeparator); + + youtube_onoff = new CMenuOptionChooser(LOCALE_YOUTUBE_ENABLED, &g_settings.youtube_enabled, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, check_youtube_dev_id()); + youtube_onoff->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_YOUTUBE_ENABLED); + ms_oservices->addItem(youtube_onoff); + + changeNotify(LOCALE_YOUTUBE_DEV_ID, NULL); + CKeyboardInput youtube_dev_id_input(LOCALE_YOUTUBE_DEV_ID, &g_settings.youtube_dev_id, 38, this); + mf = new CMenuForwarder(LOCALE_YOUTUBE_DEV_ID, true, youtube_dev_id_short, &youtube_dev_id_input); + mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_YOUTUBE_DEV_ID); + ms_oservices->addItem(mf); + + ms_oservices->addItem(GenericMenuSeparator); + + shoutcast_onoff = new CMenuOptionChooser(LOCALE_SHOUTCAST_ENABLED, &g_settings.shoutcast_enabled, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, check_shoutcast_dev_id()); + shoutcast_onoff->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_SHOUTCAST_ENABLED); + ms_oservices->addItem(shoutcast_onoff); + + changeNotify(LOCALE_SHOUTCAST_DEV_ID, NULL); + CKeyboardInput shoutcast_dev_id_input(LOCALE_SHOUTCAST_DEV_ID, &g_settings.shoutcast_dev_id, 16, this); + mf = new CMenuForwarder(LOCALE_SHOUTCAST_DEV_ID, true, shoutcast_dev_id_short, &shoutcast_dev_id_input); + mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_SHOUTCAST_DEV_ID); + ms_oservices->addItem(mf); + + int res = ms_oservices->exec(NULL, ""); + delete ms_oservices; + return res; +} + #ifdef CPU_FREQ //CPU void CMiscMenue::showMiscSettingsMenuCPUFreq(CMenuWidget *ms_cpu) @@ -602,5 +657,32 @@ bool CMiscMenue::changeNotify(const neutrino_locale_t OptionName, void * /*data* ret = menu_return::RETURN_REPAINT; } #endif + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_TMDB_API_KEY)) + { + g_settings.tmdb_enabled = check_tmdb_api_key(); + if (g_settings.tmdb_enabled) + tmdb_api_key_short = g_settings.tmdb_api_key.substr(0, 8) + "..."; + else + tmdb_api_key_short.clear(); + tmdb_onoff->setActive(g_settings.tmdb_enabled); + } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_YOUTUBE_DEV_ID)) + { + g_settings.youtube_enabled = check_youtube_dev_id(); + if (g_settings.youtube_enabled) + youtube_dev_id_short = g_settings.youtube_dev_id.substr(0, 8) + "..."; + else + youtube_dev_id_short.clear(); + youtube_onoff->setActive(g_settings.youtube_enabled); + } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_SHOUTCAST_DEV_ID)) + { + g_settings.shoutcast_enabled = check_shoutcast_dev_id(); + if (g_settings.shoutcast_enabled) + shoutcast_dev_id_short = g_settings.shoutcast_dev_id.substr(0, 8) + "..."; + else + shoutcast_dev_id_short.clear(); + shoutcast_onoff->setActive(g_settings.shoutcast_enabled); + } return ret; } diff --git a/src/gui/miscsettings_menu.h b/src/gui/miscsettings_menu.h index 3439ed74a..8e5848ef8 100644 --- a/src/gui/miscsettings_menu.h +++ b/src/gui/miscsettings_menu.h @@ -41,12 +41,14 @@ class CMiscMenue : public CMenuTarget, CChangeObserver CFanControlNotifier *fanNotifier; CSectionsdConfigNotifier* sectionsdConfigNotifier; //COnOffNotifier* miscNotifier; - COnOffNotifier* miscEpgScanNotifier; CMenuOptionChooser * epg_save; CMenuOptionChooser * epg_save_standby; CMenuOptionChooser * epg_save_frequently; CMenuOptionChooser * epg_read; CMenuOptionChooser * epg_scan; + CMenuOptionChooser * tmdb_onoff; + CMenuOptionChooser * youtube_onoff; + CMenuOptionChooser * shoutcast_onoff; CMenuForwarder * epg_dir; int width; std::string epg_cache; @@ -54,12 +56,17 @@ class CMiscMenue : public CMenuTarget, CChangeObserver std::string epg_old_events; std::string epg_max_events; + std::string tmdb_api_key_short; + std::string youtube_dev_id_short; + std::string shoutcast_dev_id_short; + int showMiscSettingsMenu(); void showMiscSettingsMenuGeneral(CMenuWidget *ms_general); void showMiscSettingsMenuEpg(CMenuWidget *ms_epg); void showMiscSettingsMenuFBrowser(CMenuWidget *ms_fbrowser); int showMiscSettingsMenuEnergy(); int showMiscSettingsMenuChanlist(); + int showMiscSettingsMenuOnlineServices(); #ifdef CPU_FREQ void showMiscSettingsMenuCPUFreq(CMenuWidget *ms_cpu); #endif /*CPU_FREQ*/ diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 49604e0a3..50a5ed1f8 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -33,7 +33,6 @@ #include #include -#include #include #include #include @@ -138,7 +137,7 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &) TP.feparams.polarization = scansettings.sat_TP_pol; TP.feparams.delsys = (delivery_system_t) scansettings.sat_TP_delsys; TP.feparams.modulation = (fe_modulation_t) scansettings.sat_TP_mod; - + TP.TP_id = 0; g_Zapit->tune_TP(TP); paintHead(); diff --git a/src/gui/motorcontrol.h b/src/gui/motorcontrol.h index 9d2dcab91..96fc16fdf 100644 --- a/src/gui/motorcontrol.h +++ b/src/gui/motorcontrol.h @@ -58,7 +58,6 @@ class CMotorControl : public CMenuTarget int hheight,mheight; // head/menu font height int ypos; int ypos_status; - int ypos_menue; Font* m_font; int8_t stepSize; int32_t stepDelay; diff --git a/src/gui/moviebrowser/Makefile.am b/src/gui/moviebrowser/Makefile.am new file mode 100644 index 000000000..46379f2ca --- /dev/null +++ b/src/gui/moviebrowser/Makefile.am @@ -0,0 +1,20 @@ +AM_CPPFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS + +AM_CPPFLAGS += \ + -I$(top_builddir) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/zapit/include \ + -I$(top_srcdir)/lib \ + -I$(top_srcdir)/lib/libeventserver \ + -I$(top_srcdir)/lib/libconfigfile \ + -I$(top_srcdir)/lib/xmltree \ + @SIGC_CFLAGS@ \ + @FREETYPE_CFLAGS@ \ + @HWLIB_CFLAGS@ + +noinst_LIBRARIES = libneutrino_gui_moviebrowser.a + + +libneutrino_gui_moviebrowser_a_SOURCES = \ + mb.cpp diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser/mb.cpp similarity index 92% rename from src/gui/moviebrowser.cpp rename to src/gui/moviebrowser/mb.cpp index aa5c4bc27..d32c9045a 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1,25 +1,25 @@ -/*************************************************************************** - Neutrino-GUI - DBoxII-Project +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' 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 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. + 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . *********************************************************** - Module Name: moviebrowser.cpp . + Module Name: mb.cpp Description: Implementation of the CMovieBrowser class This class provides a filebrowser window to view, select and start a movies from HD. @@ -27,12 +27,15 @@ Date: Nov 2005 - Author: Günther@tuxbox.berlios.org + Author: Guenther@tuxbox.berlios.org based on code of Steffen Hehn 'McClean' (C) 2009-2015 Stefan Seyfried + (C) 2016 Sven Hoefer -****************************************************************************/ + outsourced: + (C) 2016, Thilo Graf 'dbt' +*/ #ifdef HAVE_CONFIG_H #include @@ -42,11 +45,14 @@ #include #include -#include -#include "moviebrowser.h" -#include "filebrowser.h" +//#include +#include "mb.h" +#include "mb_functions.h" +#include "mb_help.h" +#include +#include +#include #include -#include #include #include #include @@ -60,12 +66,11 @@ #include // for statfs #include #include -#include +//#include #include -#include #include #include -#include +//#include #include #include #include @@ -83,8 +88,9 @@ typedef struct dirent64 dirent_struct; #define TRACE printf #define NUMBER_OF_MOVIES_LAST 40 // This is the number of movies shown in last recored and last played list +#define MOVIE_SMSKEY_TIMEOUT 800 -#define MESSAGEBOX_BROWSER_ROW_ITEM_COUNT 20 +#define MESSAGEBOX_BROWSER_ROW_ITEM_COUNT 22 const CMenuOptionChooser::keyval MESSAGEBOX_BROWSER_ROW_ITEM[MESSAGEBOX_BROWSER_ROW_ITEM_COUNT] = { { MB_INFO_FILENAME, LOCALE_MOVIEBROWSER_INFO_FILENAME }, @@ -106,7 +112,9 @@ const CMenuOptionChooser::keyval MESSAGEBOX_BROWSER_ROW_ITEM[MESSAGEBOX_BROWSER_ { MB_INFO_GEOMETRIE, LOCALE_MOVIEBROWSER_INFO_VIDEOFORMAT }, { MB_INFO_AUDIO, LOCALE_MOVIEBROWSER_INFO_AUDIO }, { MB_INFO_LENGTH, LOCALE_MOVIEBROWSER_INFO_LENGTH }, - { MB_INFO_SIZE, LOCALE_MOVIEBROWSER_INFO_SIZE } + { MB_INFO_SIZE, LOCALE_MOVIEBROWSER_INFO_SIZE }, + { MB_INFO_RATING, LOCALE_MOVIEBROWSER_INFO_RATING }, + { MB_INFO_SPACER, LOCALE_MOVIEBROWSER_INFO_SPACER } }; #define MESSAGEBOX_YES_NO_OPTIONS_COUNT 2 @@ -139,9 +147,7 @@ const CMenuOptionChooser::keyval MESSAGEBOX_PARENTAL_LOCKAGE_OPTIONS[MESSAGEBOX_ #define TITLE_FONT_COLOR COL_MENUHEAD_TEXT #define TITLE_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE] -#define FOOT_FONT g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL] - -#define INTER_FRAME_SPACE 4 // space between e.g. upper and lower window +#define FOOT_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT] const neutrino_locale_t m_localizedItemName[MB_INFO_MAX_NUMBER+1] = { @@ -165,6 +171,8 @@ const neutrino_locale_t m_localizedItemName[MB_INFO_MAX_NUMBER+1] = LOCALE_MOVIEBROWSER_SHORT_AUDIO, LOCALE_MOVIEBROWSER_SHORT_LENGTH, LOCALE_MOVIEBROWSER_SHORT_SIZE, + LOCALE_MOVIEBROWSER_SHORT_RATING, + LOCALE_MOVIEBROWSER_SHORT_SPACER, NONEXISTANT_LOCALE }; @@ -179,7 +187,7 @@ const neutrino_locale_t m_localizedItemName[MB_INFO_MAX_NUMBER+1] = #define MB_ROW_WIDTH_INFO2 25 #define MB_ROW_WIDTH_PARENTAL_LOCKAGE 4 #define MB_ROW_WIDTH_CHANNEL 15 -#define MB_ROW_WIDTH_BOOKMARK 4 +#define MB_ROW_WIDTH_BOOKMARK 6 #define MB_ROW_WIDTH_QUALITY 10 #define MB_ROW_WIDTH_PREVPLAYDATE 12 #define MB_ROW_WIDTH_RECORDDATE 12 @@ -189,6 +197,8 @@ const neutrino_locale_t m_localizedItemName[MB_INFO_MAX_NUMBER+1] = #define MB_ROW_WIDTH_AUDIO 8 #define MB_ROW_WIDTH_LENGTH 10 #define MB_ROW_WIDTH_SIZE 12 +#define MB_ROW_WIDTH_RATING 5 +#define MB_ROW_WIDTH_SPACER 1 const int m_defaultRowWidth[MB_INFO_MAX_NUMBER+1] = { @@ -212,6 +222,8 @@ const int m_defaultRowWidth[MB_INFO_MAX_NUMBER+1] = MB_ROW_WIDTH_AUDIO, MB_ROW_WIDTH_LENGTH, MB_ROW_WIDTH_SIZE, + MB_ROW_WIDTH_RATING, + MB_ROW_WIDTH_SPACER, 0 //MB_ROW_WIDTH_MAX_NUMBER }; static MI_MOVIE_INFO* playing_info; @@ -220,114 +232,7 @@ static MI_MOVIE_INFO* playing_info; //------------------------------------------------------------------------ #define FILEBROWSER_NUMBER_OF_SORT_VARIANTS 5 -bool sortDirection = 0; -bool compare_to_lower(const char a, const char b) -{ - return tolower(a) < tolower(b); -} - -// sort operators -bool sortByTitle(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (std::lexicographical_compare(a->epgTitle.begin(), a->epgTitle.end(), b->epgTitle.begin(), b->epgTitle.end(), compare_to_lower)) - return true; - if (std::lexicographical_compare(b->epgTitle.begin(), b->epgTitle.end(), a->epgTitle.begin(), a->epgTitle.end(), compare_to_lower)) - return false; - return a->file.Time < b->file.Time; -} -bool sortByGenre(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (std::lexicographical_compare(a->epgInfo1.begin(), a->epgInfo1.end(), b->epgInfo1.begin(), b->epgInfo1.end(), compare_to_lower)) - return true; - if (std::lexicographical_compare(b->epgInfo1.begin(), b->epgInfo1.end(), a->epgInfo1.begin(), a->epgInfo1.end(), compare_to_lower)) - return false; - return sortByTitle(a,b); -} -bool sortByChannel(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (std::lexicographical_compare(a->epgChannel.begin(), a->epgChannel.end(), b->epgChannel.begin(), b->epgChannel.end(), compare_to_lower)) - return true; - if (std::lexicographical_compare(b->epgChannel.begin(), b->epgChannel.end(), a->epgChannel.begin(), a->epgChannel.end(), compare_to_lower)) - return false; - return sortByTitle(a,b); -} -bool sortByFileName(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (std::lexicographical_compare(a->file.getFileName().begin(), a->file.getFileName().end(), b->file.getFileName().begin(), b->file.getFileName().end(), compare_to_lower)) - return true; - if (std::lexicographical_compare(b->file.getFileName().begin(), b->file.getFileName().end(), a->file.getFileName().begin(), a->file.getFileName().end(), compare_to_lower)) - return false; - return a->file.Time < b->file.Time; -} -bool sortByRecordDate(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->file.Time > b->file.Time ; - else - return a->file.Time < b->file.Time ; -} -bool sortBySize(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->file.Size > b->file.Size; - else - return a->file.Size < b->file.Size; -} -bool sortByAge(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->parentalLockAge > b->parentalLockAge; - else - return a->parentalLockAge < b->parentalLockAge; -} -bool sortByQuality(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->quality > b->quality; - else - return a->quality < b->quality; -} -bool sortByDir(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->dirItNr > b->dirItNr; - else - return a->dirItNr < b->dirItNr; -} - -bool sortByLastPlay(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->dateOfLastPlay > b->dateOfLastPlay; - else - return a->dateOfLastPlay < b->dateOfLastPlay; -} - -bool (* const sortBy[MB_INFO_MAX_NUMBER+1])(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) = -{ - &sortByFileName, //MB_INFO_FILENAME = 0, - &sortByDir, //MB_INFO_FILEPATH = 1, - &sortByTitle, //MB_INFO_TITLE = 2, - NULL, //MB_INFO_SERIE = 3, - &sortByGenre, //MB_INFO_INFO1 = 4, - NULL, //MB_INFO_MAJOR_GENRE = 5, - NULL, //MB_INFO_MINOR_GENRE = 6, - NULL, //MB_INFO_INFO2 = 7, - &sortByAge, //MB_INFO_PARENTAL_LOCKAGE = 8, - &sortByChannel, //MB_INFO_CHANNEL = 9, - NULL, //MB_INFO_BOOKMARK = 10, - &sortByQuality, //MB_INFO_QUALITY = 11, - &sortByLastPlay, //MB_INFO_PREVPLAYDATE = 12, - &sortByRecordDate, //MB_INFO_RECORDDATE = 13, - NULL, //MB_INFO_PRODDATE = 14, - NULL, //MB_INFO_COUNTRY = 15, - NULL, //MB_INFO_GEOMETRIE = 16, - NULL, //MB_INFO_AUDIO = 17, - NULL, //MB_INFO_LENGTH = 18, - &sortBySize, //MB_INFO_SIZE = 19, - NULL //MB_INFO_MAX_NUMBER = 20 -}; CMovieBrowser::CMovieBrowser(): configfile ('\t') { @@ -337,7 +242,7 @@ CMovieBrowser::CMovieBrowser(): configfile ('\t') CMovieBrowser::~CMovieBrowser() { //TRACE("[mb] del\n"); - hide(); + m_dir.clear(); m_dirNames.clear(); @@ -608,18 +513,18 @@ void CMovieBrowser::initFrames(void) m_cBoxFrameLastPlayList.iX = m_cBoxFrameBrowserList.iX; m_cBoxFrameLastPlayList.iY = m_cBoxFrameBrowserList.iY ; - m_cBoxFrameLastPlayList.iWidth = (m_cBoxFrameBrowserList.iWidth>>1) - (INTER_FRAME_SPACE>>1); + m_cBoxFrameLastPlayList.iWidth = (m_cBoxFrameBrowserList.iWidth>>1) - (OFFSET_INTER>>1); m_cBoxFrameLastPlayList.iHeight = m_cBoxFrameBrowserList.iHeight; - m_cBoxFrameLastRecordList.iX = m_cBoxFrameLastPlayList.iX + m_cBoxFrameLastPlayList.iWidth + INTER_FRAME_SPACE; + m_cBoxFrameLastRecordList.iX = m_cBoxFrameLastPlayList.iX + m_cBoxFrameLastPlayList.iWidth + OFFSET_INTER; m_cBoxFrameLastRecordList.iY = m_cBoxFrameLastPlayList.iY; - m_cBoxFrameLastRecordList.iWidth = m_cBoxFrame.iWidth - m_cBoxFrameLastPlayList.iWidth - INTER_FRAME_SPACE; + m_cBoxFrameLastRecordList.iWidth = m_cBoxFrame.iWidth - m_cBoxFrameLastPlayList.iWidth - OFFSET_INTER; m_cBoxFrameLastRecordList.iHeight = m_cBoxFrameLastPlayList.iHeight; m_cBoxFrameInfo.iX = m_cBoxFrameBrowserList.iX; - m_cBoxFrameInfo.iY = m_cBoxFrameBrowserList.iY + m_cBoxFrameBrowserList.iHeight + INTER_FRAME_SPACE; + m_cBoxFrameInfo.iY = m_cBoxFrameBrowserList.iY + m_cBoxFrameBrowserList.iHeight + OFFSET_INTER; m_cBoxFrameInfo.iWidth = m_cBoxFrameBrowserList.iWidth; - m_cBoxFrameInfo.iHeight = m_cBoxFrame.iHeight - m_cBoxFrameBrowserList.iHeight - INTER_FRAME_SPACE - m_cBoxFrameFootRel.iHeight - m_cBoxFrameTitleRel.iHeight; + m_cBoxFrameInfo.iHeight = m_cBoxFrame.iHeight - m_cBoxFrameBrowserList.iHeight - OFFSET_INTER - m_cBoxFrameFootRel.iHeight - m_cBoxFrameTitleRel.iHeight; m_cBoxFrameFilter.iX = m_cBoxFrameInfo.iX; m_cBoxFrameFilter.iY = m_cBoxFrameInfo.iY; @@ -847,6 +752,10 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) movieInfoUpdateAll[MB_INFO_MAJOR_GENRE]) (*current_list)[i]->genreMajor = m_movieSelectionHandler->genreMajor; + if (!((*current_list)[i]->rating!=0 && movieInfoUpdateAllIfDestEmptyOnly == true) && + movieInfoUpdateAll[MB_INFO_RATING]) + (*current_list)[i]->rating = m_movieSelectionHandler->rating; + if (!((*current_list)[i]->quality!=0 && movieInfoUpdateAllIfDestEmptyOnly == true) && movieInfoUpdateAll[MB_INFO_QUALITY]) (*current_list)[i]->quality = m_movieSelectionHandler->quality; @@ -898,7 +807,7 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) delete hintBox; framebuffer->paintBackground(); // clear screen CMovieCut mc; - bool res = mc.copyMovie(m_movieSelectionHandler, &m_movieInfo, onefile); + bool res = mc.copyMovie(m_movieSelectionHandler, onefile); //g_RCInput->clearRCMsg(); if (res == 0) ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_COPY_FAILED, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); @@ -923,7 +832,7 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) delete hintBox; framebuffer->paintBackground(); // clear screen CMovieCut mc; - bool res = mc.cutMovie(m_movieSelectionHandler, &m_movieInfo); + bool res = mc.cutMovie(m_movieSelectionHandler); //g_RCInput->clearRCMsg(); if (!res) ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_CUT_FAILED, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); @@ -954,11 +863,7 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) if (!res) ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_TRUNCATE_FAILED, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); else - { - //printf("New movie info: size %lld len %d\n", res, m_movieSelectionHandler->bookmarks.end/60); - m_movieInfo.saveMovieInfo(*m_movieSelectionHandler); m_doLoadMovies = true; - } m_doRefresh = true; } } @@ -1025,6 +930,7 @@ int CMovieBrowser::exec(const char* path) uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(timeout); while (loop) { + framebuffer->blit(); g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd); result = onButtonPress(msg); @@ -1088,8 +994,8 @@ int CMovieBrowser::exec(const char* path) { loop = false; } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { - //FIXME do nothing ? + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if (msg == NeutrinoMessages::STANDBY_ON || msg == NeutrinoMessages::LEAVE_ALL || @@ -1112,6 +1018,7 @@ int CMovieBrowser::exec(const char* path) timeoutEnd = CRCInput::calcTimeoutEnd(timeout); // calcualate next timeout } hide(); + framebuffer->blit(); //TRACE(" return %d\n",res); m_prevBrowserSelection = m_currentBrowserSelection; @@ -1174,7 +1081,7 @@ int CMovieBrowser::paint(void) //CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD)); Font* font = NULL; - + m_movieSelectionHandler = NULL; m_pcBrowser = new CListFrame(&m_browserListLines, font, CListFrame::SCROLL | CListFrame::HEADER_LINE, &m_cBoxFrameBrowserList); m_pcLastPlay = new CListFrame(&m_playListLines, font, CListFrame::SCROLL | CListFrame::HEADER_LINE | CListFrame::TITLE, @@ -1234,7 +1141,11 @@ int CMovieBrowser::paint(void) refreshLCD(); if (m_settings.gui == MB_GUI_FILTER) m_settings.gui = MB_GUI_MOVIE_INFO; - onSetGUIWindow(m_settings.gui); + if (show_mode == MB_SHOW_YT) + onSetGUIWindow(MB_GUI_MOVIE_INFO); + else + onSetGUIWindow(m_settings.gui); + return (true); } @@ -1346,25 +1257,21 @@ void CMovieBrowser::refreshMovieInfo(void) int flogo_w = 0, flogo_h = 0; if (logo_ok) { flogo_w = (int)(((float)16 / (float)9) * (float)m_cBoxFrameInfo.iHeight); - flogo_h = m_cBoxFrameInfo.iHeight; -#ifdef BOXMODEL_APOLLO - /* align for hw blit */ - flogo_w = ((flogo_w + 3) / 4) * 4; -#endif + flogo_h = m_cBoxFrameInfo.iHeight*90/100; } - static int logo_w = 0; - static int logo_h = 0; +// static int logo_w = 0; +// static int logo_h = 0; int logo_w_max = m_cBoxFrameTitleRel.iWidth / 4; - //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgEpgId, m_movieSelectionHandler->epgId, m_cBoxFrameTitleRel.iY); - int lx = m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-logo_w-10; - int ly = m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-logo_h)/2; + //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgId, m_movieSelectionHandler->channelId, m_cBoxFrameTitleRel.iY); + int lx = 0;//never read m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-logo_w-10; + int ly = 0;//never read m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-logo_h)/2; short pb_hdd_offset = 104; if (show_mode == MB_SHOW_YT) pb_hdd_offset = 0; - if (CChannelLogo && (old_EpgId != m_movieSelectionHandler->epgEpgId >>16)) { + if (CChannelLogo && (old_EpgId != m_movieSelectionHandler->epgId >>16)) { if (newHeader) CChannelLogo->clearFbData(); // reset logo screen data else @@ -1372,10 +1279,10 @@ void CMovieBrowser::refreshMovieInfo(void) delete CChannelLogo; CChannelLogo = NULL; } - if (old_EpgId != m_movieSelectionHandler->epgEpgId >>16) { + if (old_EpgId != m_movieSelectionHandler->epgId >>16) { if (CChannelLogo == NULL) - CChannelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->epgChannel, m_movieSelectionHandler->epgEpgId >>16); //TODO: add logo into header as item - old_EpgId = m_movieSelectionHandler->epgEpgId >>16; + CChannelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->channelName, m_movieSelectionHandler->epgId >>16); //TODO: add logo into header as item + old_EpgId = m_movieSelectionHandler->epgId >>16; } if (CChannelLogo && CChannelLogo->hasLogo()) { @@ -1387,7 +1294,7 @@ void CMovieBrowser::refreshMovieInfo(void) int w_logo = ratio*CChannelLogo->getWidth()/100; CChannelLogo->setWidth(min(w_logo, logo_w_max)); } - + lx = m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-CChannelLogo->getWidth()-10; ly = m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-CChannelLogo->getHeight())/2; CChannelLogo->setXPos(lx - pb_hdd_offset); @@ -1397,26 +1304,39 @@ void CMovieBrowser::refreshMovieInfo(void) newHeader = false; } - if (m_settings.gui != MB_GUI_FILTER && logo_ok) { - lx = m_cBoxFrameInfo.iX+m_cBoxFrameInfo.iWidth - flogo_w -14; - ly = m_cBoxFrameInfo.iY - 1 + (m_cBoxFrameInfo.iHeight-flogo_h)/2; - if (pic == NULL){ //TODO: paint custom covers with different ratio, currently only works with default ratio 16/9 or 4/3 - pic = new CComponentsPicture(lx+2, ly+1, fname, NULL, CC_SHADOW_OFF, COL_MENUCONTENTSELECTED_PLUS_0); - pic->setHeight(flogo_h, true); /*flogo_w*/ - pic->enableFrame(true, 2); - pic->enableCache(); - pic->doPaintBg(false); - }else - pic->setPicture(fname); - flogo_w = pic->getWidth(); - pic->setXPos(m_cBoxFrameInfo.iX+m_cBoxFrameInfo.iWidth - flogo_w -12); - if (!m_movieSelectionHandler->epgInfo2.empty()) - m_pcInfo->OnAfterScrollPage.connect(sigc::mem_fun(pic, &CComponentsPicture::paint0)); - }else{ - delete pic; - pic = NULL; + if (pic){ + if (pic->getPictureName() != fname || !logo_ok){ + delete pic; pic = NULL; + } } - m_pcInfo->setText(&m_movieSelectionHandler->epgInfo2, logo_ok ? m_cBoxFrameInfo.iWidth-flogo_w-20 : 0); + + if (m_settings.gui != MB_GUI_FILTER && logo_ok) { + lx = m_cBoxFrameInfo.iX + m_cBoxFrameBrowserList.iWidth - flogo_w -14; + ly = m_cBoxFrameInfo.iY + (m_cBoxFrameInfo.iHeight-flogo_h)/2; + if (pic == NULL){ //TODO: paint custom covers with different ratio, currently only works with default ratio HD 16/9 + pic = new CComponentsPicture(lx, ly, fname, NULL, CC_SHADOW_ON, COL_MENUCONTENTDARK_PLUS_0); + if (pic->getHeight() < flogo_h/2){ + flogo_h = flogo_h/2; + pic->setYPos(m_cBoxFrameInfo.iY + (m_cBoxFrameInfo.iHeight-flogo_h)/2); + } + pic->setHeight(flogo_h, true); + pic->enableFrame(true, 2); + pic->doPaintBg(false); + flogo_w = pic->getWidth(); + pic->setXPos(m_cBoxFrameInfo.iX + m_cBoxFrameInfo.iWidth - flogo_w - 24); + } + + if (!m_movieSelectionHandler->epgInfo2.empty()){ + if (m_pcInfo->OnAfterScrollPage.empty()){ + pic->enableCache(); + m_pcInfo->OnAfterScrollPage.connect(sigc::mem_fun(pic, &CComponentsPicture::paint0)); + } + } + + } + if (pic) + flogo_w = pic->getWidth(); + m_pcInfo->setText(&m_movieSelectionHandler->epgInfo2, m_cBoxFrameInfo.iWidth - flogo_w - 24); if (pic) pic->paint(CC_SAVE_SCREEN_NO); } @@ -1739,16 +1659,16 @@ int CMovieBrowser::refreshFoot(bool show) //TRACE("[mb]->refreshButtonLine\n"); int offset = (m_settings.gui != MB_GUI_LAST_PLAY && m_settings.gui != MB_GUI_LAST_RECORD) ? 0 : 2; neutrino_locale_t ok_loc = (m_settings.gui == MB_GUI_FILTER && m_windowFocus == MB_FOCUS_FILTER) ? LOCALE_BOOKMARKMANAGER_SELECT : LOCALE_MOVIEBROWSER_FOOT_PLAY; - int ok_loc_len = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), true), - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_PLAY), true)); + int ok_loc_len = std::max(FOOT_FONT->getRenderWidth(g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), true), + FOOT_FONT->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_PLAY), true)); std::string filter_text = g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_FILTER); filter_text += m_settings.filter.optionString; std::string sort_text = g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT); sort_text += g_Locale->getText(m_localizedItemName[m_settings.sorting.item]); - int sort_text_len = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT), true); + int sort_text_len = FOOT_FONT->getRenderWidth(g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT), true); int len = 0; for (int i = 0; m_localizedItemName[i] != NONEXISTANT_LOCALE; i++) - len = std::max(len, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(m_localizedItemName[i]), true)); + len = std::max(len, FOOT_FONT->getRenderWidth(g_Locale->getText(m_localizedItemName[i]), true)); sort_text_len += len; button_label_ext footerButtons[] = { @@ -1794,8 +1714,68 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) { //TRACE("[mb]->onButtonPressMainFrame: %d\n",msg); bool result = true; + neutrino_msg_data_t data; - if (msg == CRCInput::RC_home) + if (msg == (neutrino_msg_t) g_settings.mbkey_copy_onefile + || msg == (neutrino_msg_t) g_settings.mbkey_copy_several + || msg == (neutrino_msg_t) g_settings.mbkey_cut + || msg == (neutrino_msg_t) g_settings.mbkey_truncate) + { + if (msg == (neutrino_msg_t) g_settings.mbkey_copy_onefile) + exec(NULL, "copy_onefile"); + else + if (msg == (neutrino_msg_t) g_settings.mbkey_copy_several) + exec(NULL, "copy_several"); + else + if (msg == (neutrino_msg_t) g_settings.mbkey_cut) + exec(NULL, "cut"); + else + if (msg == (neutrino_msg_t) g_settings.mbkey_truncate) + exec(NULL, "truncate"); + + if (m_doLoadMovies) + loadMovies(); + if (m_doRefresh) + refresh(); + } + else if (msg == (neutrino_msg_t) g_settings.mbkey_cover) + { + if (m_movieSelectionHandler != NULL) { + std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); + if (!fname.empty()) + { + //delete Cover + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) + { + unlink(fname.c_str()); + refresh(); + } + } + else if (g_settings.tmdb_enabled) + { + //add TMDB Cover + fname = m_movieSelectionHandler->file.Name.c_str(); + int ext_pos = 0; + ext_pos = fname.rfind('.'); + if( ext_pos > 0) { + std::string extension; + extension = fname.substr(ext_pos + 1, fname.length() - ext_pos); + extension = "." + extension; + str_replace(extension, ".jpg", fname); + printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),fname.c_str()); + cTmdb* tmdb = new cTmdb(m_movieSelectionHandler->epgTitle); + if ((tmdb->getResults() > 0) && (tmdb->hasCover())) { + if (!fname.empty()) + if (tmdb->getSmallCover(fname)) + refresh(); + } + if (tmdb) + delete tmdb; + } + } + } + } + else if (msg == CRCInput::RC_home) { if (m_settings.gui == MB_GUI_FILTER) onSetGUIWindow(MB_GUI_MOVIE_INFO); @@ -1804,11 +1784,13 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } else if (msg == CRCInput::RC_left) { - onSetGUIWindowPrev(); + if (show_mode != MB_SHOW_YT) + onSetGUIWindowPrev(); } else if (msg == CRCInput::RC_right) { - onSetGUIWindowNext(); + if (show_mode != MB_SHOW_YT) + onSetGUIWindowNext(); } else if (msg == CRCInput::RC_green) { @@ -1845,6 +1827,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) TRACE("[mb]->new sorting %d,%s\n",m_settings.sorting.item,g_Locale->getText(m_localizedItemName[m_settings.sorting.item])); refreshBrowserList(); + refreshMovieInfo(); refreshFoot(); } } @@ -1859,7 +1842,8 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) { if (m_movieSelectionHandler != NULL) { - m_movieInfo.showMovieInfo(*m_movieSelectionHandler); + framebuffer->paintBackground(); //clear whole screen + g_EpgData->show_mp(m_movieSelectionHandler); refresh(); } } @@ -1877,48 +1861,66 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } } - // just here to stay backward compatible with these horrible key assignments - else if (msg == CRCInput::RC_radio) + else if (g_settings.sms_movie && (msg >= CRCInput::RC_1) && (msg <= CRCInput::RC_9)) { - exec(NULL, "copy_onefile"); - if (m_doLoadMovies) - loadMovies(); - if (m_doRefresh) - refresh(); - } - else if (msg == CRCInput::RC_text) - { - exec(NULL, "copy_several"); - if (m_doLoadMovies) - loadMovies(); - if (m_doRefresh) - refresh(); - } - else if (msg == CRCInput::RC_audio) - { - exec(NULL, "cut"); - if (m_doLoadMovies) - loadMovies(); - if (m_doRefresh) - refresh(); - } - else if (msg == CRCInput::RC_games) - { - exec(NULL, "truncate"); - if (m_doLoadMovies) - loadMovies(); - if (m_doRefresh) - refresh(); - } - else if (msg == CRCInput::RC_favorites) - { - if (m_movieSelectionHandler != NULL) { - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { - std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); - if (!fname.empty()) - unlink(fname.c_str()); - refresh(); + unsigned char smsKey = 0; + SMSKeyInput smsInput; + smsInput.setTimeout(MOVIE_SMSKEY_TIMEOUT); + + std::vector *current_list = NULL; + CListFrame *current_frame = NULL; + + if (m_windowFocus == MB_FOCUS_BROWSER) + { + current_list = &m_vHandleBrowserList; + current_frame = m_pcBrowser; + } + else if (m_windowFocus == MB_FOCUS_LAST_PLAY) + { + current_list = &m_vHandlePlayList; + current_frame = m_pcLastPlay; + } + else if (m_windowFocus == MB_FOCUS_LAST_RECORD) + { + current_list = &m_vHandleRecordList; + current_frame = m_pcLastRecord; + } + + if (current_list == NULL || current_frame == NULL) + return result; + + do { + smsKey = smsInput.handleMsg(msg); + printf("SMS new key: %c\n", smsKey); + g_RCInput->getMsg_ms(&msg, &data, MOVIE_SMSKEY_TIMEOUT-100); + } while ((msg >= CRCInput::RC_1) && (msg <= CRCInput::RC_9)); + + int selected = current_frame->getSelectedLine(); + if (msg == CRCInput::RC_timeout || msg == CRCInput::RC_nokey) { + uint32_t i; + for (i = selected+1; i < (*current_list).size(); i++) { + + char firstCharOfTitle = (*current_list)[i]->epgTitle.c_str()[0]; + if (tolower(firstCharOfTitle) == smsKey) { + printf("SMS found selected=%d i=%d \"%s\"\n", selected, i, (*current_list)[i]->epgTitle.c_str()); + break; + } } + if (i >= (*current_list).size()) { + for (i = 0; i < (*current_list).size(); i++) { + char firstCharOfTitle = (*current_list)[i]->epgTitle.c_str()[0]; + if (tolower(firstCharOfTitle) == smsKey) { + printf("SMS found selected=%d i=%d \"%s\"\n", selected, i, (*current_list)[i]->epgTitle.c_str()); + break; + } + } + } + if (i < (*current_list).size()) { + current_frame->setSelectedLine(i); + updateMovieSelection(); + } + + smsInput.resetOldKey(); } } else @@ -2112,61 +2114,62 @@ bool CMovieBrowser::onButtonPressMovieInfoList(neutrino_msg_t msg) return (result); } -bool CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk) +std::string CMovieBrowser::formatDeleteMsg(MI_MOVIE_INFO *movieinfo, int msgFont, const int boxWidth) { - //TRACE("[onDeleteFile] "); - bool result = false; -#if 0 - int test= movieinfo->file.Name.find(".ts", movieinfo->file.Name.length()-3); - if (test == -1) { - // not a TS file, return!!!!! - TRACE("show_ts_info: not a TS file "); - return; - } -#endif - size_t msgMax = 50; + Font *msgFont_ = g_Font[msgFont]; + int msgWidth = boxWidth - 20; std::string msg = g_Locale->getText(LOCALE_FILEBROWSER_DODELETE1); - msg += "\n "; + msg += "\n"; + if (!movieinfo->epgTitle.empty()) { - if ((movieinfo->epgTitle.length() + movieinfo->epgInfo1.length()) <= msgMax) { - msg += movieinfo->epgTitle; + int titleW = msgFont_->getRenderWidth(movieinfo->epgTitle); + int infoW = 0; + int zW = 0; + if (!movieinfo->epgInfo1.empty()) { + infoW = msgFont_->getRenderWidth(movieinfo->epgInfo1); + zW = msgFont_->getRenderWidth(" ()"); + } + + if ((titleW+infoW+zW) <= msgWidth) { + /* one line */ + msg += trim(movieinfo->epgTitle); if (!movieinfo->epgInfo1.empty()) { msg += " ("; - msg += movieinfo->epgInfo1; + msg += trim(movieinfo->epgInfo1); msg += ")"; } } else { - if (movieinfo->epgTitle.length() > msgMax) { - msg += movieinfo->epgTitle.substr(0, msgMax); - msg += "..."; - } - else { - msg += movieinfo->epgTitle; - if (!movieinfo->epgInfo1.empty()) { - msg += "\n ("; - if (movieinfo->epgInfo1.length() > msgMax) { - msg = movieinfo->epgInfo1.substr(0, msgMax); - msg += "..."; - } - else - msg += movieinfo->epgInfo1; + /* two lines */ + msg += cutString(movieinfo->epgTitle, msgFont, msgWidth); + if (!movieinfo->epgInfo1.empty()) { + msg += "\n("; + msg += cutString(movieinfo->epgInfo1, msgFont, msgWidth); msg += ")"; - } } } } - else { - if (movieinfo->file.Name.length() > msgMax) { - msg += movieinfo->file.Name.substr(0, msgMax); - msg += "..."; - } - else - msg += movieinfo->file.Name; - } + else + msg += cutString(movieinfo->file.Name, msgFont, msgWidth); + msg += "\n"; msg += g_Locale->getText(LOCALE_FILEBROWSER_DODELETE2); - if ((skipAsk || !movieinfo->delAsk) || (ShowMsg(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes)) + + return msg; +} + +bool CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk) +{ + //TRACE("[onDeleteFile] "); + bool result = false; + + /* default font for ShowMsg */ + int msgFont = SNeutrinoSettings::FONT_TYPE_MENU; + /* default width for ShowMsg */ + int msgBoxWidth = 450; + + std::string msg = formatDeleteMsg(movieinfo, msgFont, msgBoxWidth); + if ((skipAsk || !movieinfo->delAsk) || (ShowMsg(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo, NULL, msgBoxWidth)==CMessageBox::mbrYes)) { CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MOVIEBROWSER_DELETE_INFO)); hintBox->paint(); @@ -2425,7 +2428,8 @@ bool CMovieBrowser::onSortMovieInfoHandleList(std::vector& handl { if (sort_item == MB_INFO_QUALITY || sort_item == MB_INFO_PARENTAL_LOCKAGE || sort_item == MB_INFO_PREVPLAYDATE || sort_item == MB_INFO_RECORDDATE || - sort_item == MB_INFO_PRODDATE || sort_item == MB_INFO_SIZE) + sort_item == MB_INFO_PRODDATE || sort_item == MB_INFO_SIZE || + sort_item == MB_INFO_RATING) sortDirection = 1; else sortDirection = 0; @@ -2491,6 +2495,26 @@ void CMovieBrowser::loadAllTsFileNamesFromStorage(void) TRACE("[mb] Dir%d, Files:%d\n", (int)m_dirNames.size(), (int)m_vMovieInfo.size()); } +bool CMovieBrowser::gotMovie(const char *rec_title) +{ + //TRACE("[mb]->gotMovie\n"); + + m_doRefresh = false; + loadAllTsFileNamesFromStorage(); + + bool found = false; + for (unsigned int i = 0; i < m_vMovieInfo.size(); i++) + { + //printf("[mb] search for %s in %s\n", rec_title, m_vMovieInfo[i].epgTitle.c_str()); + if (strcmp(rec_title, m_vMovieInfo[i].epgTitle.c_str()) == 0) + { + found = true; + break; + } + } + return found; +} + static const char * const ext_list[] = { "avi", "mkv", "mp4", "flv", "mov", "mpg", "mpeg", "m2ts", "iso" @@ -2527,7 +2551,7 @@ bool CMovieBrowser::addFile(CFile &file, int dirItNr) movieInfo.file = file; if(!m_movieInfo.loadMovieInfo(&movieInfo)) { - movieInfo.epgChannel = string(g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD)); + movieInfo.channelName = string(g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD)); movieInfo.epgTitle = file.getFileName(); } movieInfo.dirItNr = dirItNr; @@ -2843,6 +2867,8 @@ void CMovieBrowser::showHelp(void) help.exec(NULL,NULL); } + + #define MAX_STRING 30 int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) { @@ -2907,12 +2933,13 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_TITLE, &movieInfoUpdateAll[MB_INFO_TITLE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_1)); movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_INFO1, &movieInfoUpdateAll[MB_INFO_INFO1], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_2)); movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_SERIE, &movieInfoUpdateAll[MB_INFO_SERIE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_3)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_QUALITY, &movieInfoUpdateAll[MB_INFO_QUALITY], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_4)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE, &movieInfoUpdateAll[MB_INFO_PARENTAL_LOCKAGE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_5)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR, &movieInfoUpdateAll[MB_INFO_MAJOR_GENRE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_6)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, &movieInfoUpdateAll[MB_INFO_PRODDATE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_7)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, &movieInfoUpdateAll[MB_INFO_COUNTRY], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_8)); - movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_LENGTH, &movieInfoUpdateAll[MB_INFO_LENGTH], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_9)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_RATING, &movieInfoUpdateAll[MB_INFO_RATING], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_4)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_QUALITY, &movieInfoUpdateAll[MB_INFO_QUALITY], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true, NULL, CRCInput::RC_5)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE, &movieInfoUpdateAll[MB_INFO_PARENTAL_LOCKAGE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_6)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR, &movieInfoUpdateAll[MB_INFO_MAJOR_GENRE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_7)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, &movieInfoUpdateAll[MB_INFO_PRODDATE], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_8)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, &movieInfoUpdateAll[MB_INFO_COUNTRY], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_9)); + movieInfoMenuUpdate.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_LENGTH, &movieInfoUpdateAll[MB_INFO_LENGTH], MESSAGEBOX_YES_NO_OPTIONS, MESSAGEBOX_YES_NO_OPTIONS_COUNT, true,NULL, CRCInput::RC_0)); /********************************************************************/ /** movieInfo ******************************************************/ @@ -2924,7 +2951,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) snprintf(size,BUFFER_SIZE,"%5" PRIu64 "",movie_info->file.Size>>20); CKeyboardInput titelUserInput(LOCALE_MOVIEBROWSER_INFO_TITLE, &movie_info->epgTitle, (movie_info->epgTitle.empty() || (movie_info->epgTitle.size() < MAX_STRING)) ? MAX_STRING:movie_info->epgTitle.size()); - CKeyboardInput channelUserInput(LOCALE_MOVIEBROWSER_INFO_CHANNEL, &movie_info->epgChannel, MAX_STRING); + CKeyboardInput channelUserInput(LOCALE_MOVIEBROWSER_INFO_CHANNEL, &movie_info->channelName, MAX_STRING); CKeyboardInput epgUserInput(LOCALE_MOVIEBROWSER_INFO_INFO1, &movie_info->epgInfo1, 20); CKeyboardInput countryUserInput(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, &movie_info->productionCountry, 11); @@ -2933,6 +2960,9 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) CIntInput lengthUserIntInput(LOCALE_MOVIEBROWSER_INFO_LENGTH, (int *)&movie_info->length, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CIntInput yearUserIntInput(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, (int *)&movie_info->productionDate, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); + CMenuOptionNumberChooser *rate = new CMenuOptionNumberChooser(LOCALE_MOVIEBROWSER_INFO_RATING, &movie_info->rating, true, 0, 100, NULL); + rate->setNumberFormat(rateFormat); + CMenuWidget movieInfoMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); movieInfoMenu.addIntroItems(LOCALE_MOVIEBROWSER_INFO_HEAD); @@ -2945,12 +2975,13 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_INFO1, (movie_info->epgInfo1.size() <= MAX_STRING) /*true*/, movie_info->epgInfo1, &epgUserInput,NULL, CRCInput::RC_3)); movieInfoMenu.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR, &movie_info->genreMajor, GENRE_ALL, GENRE_ALL_COUNT, true,NULL, CRCInput::RC_4, "", true)); movieInfoMenu.addItem(GenericMenuSeparatorLine); + movieInfoMenu.addItem(rate); movieInfoMenu.addItem(new CMenuOptionNumberChooser(LOCALE_MOVIEBROWSER_INFO_QUALITY,&movie_info->quality,true,0,3, NULL)); movieInfoMenu.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE, &movie_info->parentalLockAge, MESSAGEBOX_PARENTAL_LOCKAGE_OPTIONS, MESSAGEBOX_PARENTAL_LOCKAGE_OPTION_COUNT, true,NULL, CRCInput::RC_6)); movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, true, yearUserIntInput.getValue(), &yearUserIntInput,NULL, CRCInput::RC_7)); movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, true, movie_info->productionCountry, &countryUserInput,NULL, CRCInput::RC_8)); movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_LENGTH, true, lengthUserIntInput.getValue(), &lengthUserIntInput,NULL, CRCInput::RC_9)); - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_CHANNEL, true, movie_info->epgChannel, &channelUserInput,NULL, CRCInput::RC_0));//LOCALE_TIMERLIST_CHANNEL + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_CHANNEL, true, movie_info->channelName, &channelUserInput,NULL, CRCInput::RC_0));//LOCALE_TIMERLIST_CHANNEL movieInfoMenu.addItem(GenericMenuSeparatorLine); movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PATH, false, dirItNr)); //LOCALE_TIMERLIST_RECORDING_DIR movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PREVPLAYDATE, false, dateUserDateInput.getValue()));//LOCALE_FLASHUPDATE_CURRENTVERSIONDATE @@ -3284,6 +3315,9 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite int i=0; int counter=0; + std::string b; + bool s, e, u; + switch(item) { case MB_INFO_FILENAME: // = 0, @@ -3322,16 +3356,44 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = str_tmp; break; case MB_INFO_CHANNEL: // = 9, - *item_string = movie_info.epgChannel; + *item_string = movie_info.channelName; break; case MB_INFO_BOOKMARK: // = 10, + b = ""; + + s = false; + if (movie_info.bookmarks.start != 0) + { + s = true; + b += "S"; + } + + e = false; + if (movie_info.bookmarks.end != 0) + { + e = true; + if (s) + b += ","; + b += "E"; + } + // we just return the number of bookmarks for (i = 0; i < MI_MOVIE_BOOK_USER_MAX; i++) { if (movie_info.bookmarks.user[i].pos != 0) counter++; } - *item_string = to_string(counter);; + u = (counter > 0); + if (u) + { + if (s || e) + b += ","; + b += "U["; + b += to_string(counter); + b += "]"; + } + + *item_string = b; break; case MB_INFO_QUALITY: // = 11, snprintf(str_tmp, sizeof(str_tmp),"%d",movie_info.quality); @@ -3375,7 +3437,15 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite snprintf(str_tmp, sizeof(str_tmp),"%4" PRIu64 "",movie_info.file.Size>>20); *item_string = str_tmp; break; - case MB_INFO_MAX_NUMBER: // = 20 + case MB_INFO_RATING: // = 20, + if (movie_info.rating) + { + snprintf(str_tmp, sizeof(str_tmp),"%d,%d",movie_info.rating/10, movie_info.rating%10); + *item_string = str_tmp; + } + break; + case MB_INFO_SPACER: // = 21, + case MB_INFO_MAX_NUMBER: // = 22 default: *item_string=""; result = false; @@ -3464,7 +3534,7 @@ void CMovieBrowser::loadYTitles(int mode, std::string search, std::string id) yt_video_list_t &ylist = ytparser.GetVideoList(); for (unsigned i = 0; i < ylist.size(); i++) { MI_MOVIE_INFO movieInfo; - movieInfo.epgChannel = ylist[i].author; + movieInfo.channelName = ylist[i].author; movieInfo.epgTitle = ylist[i].title; movieInfo.epgInfo1 = ylist[i].category; movieInfo.epgInfo2 = ylist[i].description; @@ -3799,7 +3869,7 @@ bool CMovieBrowser::showYTMenu(bool calledExternally) m_settings.ytmode = newmode; m_settings.ytsearch_history.push_front(search); std::list::iterator it = m_settings.ytsearch_history.begin(); - it++; + ++it; while (it != m_settings.ytsearch_history.end()) { if (*it == search) it = m_settings.ytsearch_history.erase(it); @@ -3903,24 +3973,7 @@ int CMenuSelector::paint(bool selected) return y+height; } -int CMovieHelp::exec(CMenuTarget* /*parent*/, const std::string & /*actionKey*/) -{ - Helpbox helpbox; - helpbox.addLine(NEUTRINO_ICON_BUTTON_RED, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_RED)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_GREEN, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_GREEN)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_YELLOW, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_YELLOW)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_BLUE, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_BLUE)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_MENU_SMALL,g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_MENU)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_PLAY, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_PLAY)); - helpbox.addLine(""); - helpbox.addLine(NEUTRINO_ICON_BUTTON_OKAY, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_OKAY)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_MUTE_SMALL,g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_MUTE)); - helpbox.addLine(""); - helpbox.addLine(NEUTRINO_ICON_BUTTON_LEFT, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_LEFT)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_RIGHT, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_RIGHT)); - helpbox.show(LOCALE_MESSAGEBOX_INFO); - return(0); -} + ///////////////////////////////////////////////// // MenuTargets //////////////////////////////////////////////// diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser/mb.h similarity index 61% rename from src/gui/moviebrowser.h rename to src/gui/moviebrowser/mb.h index 94054e7f5..41dfc1d7d 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser/mb.h @@ -1,67 +1,41 @@ -/*************************************************************************** - Neutrino-GUI - DBoxII-Project - - Homepage: http://dbox.cyberphoria.org/ - - $Id: moviebrowser.h,v 1.5 2006/09/11 21:11:35 guenther Exp $ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' 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 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. + 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . *********************************************************** - Module Name: moviebrowser.h . + Module Name: mb.h - Description: implementation of the CMovieBrowser class + Description: Implementation of the CMovieBrowser class + This class provides a filebrowser window to view, select and start a movies from HD. + This class does replace the Filebrowser Date: Nov 2005 - Author: Günther@tuxbox.berlios.org + Author: Guenther@tuxbox.berlios.org based on code of Steffen Hehn 'McClean' - $Log: moviebrowser.h,v $ - Revision 1.5 2006/09/11 21:11:35 guenther - General menu clean up - Dir menu updated - Add options menu - In movie info menu "update all" added - Serie option added (hide serie, auto serie) - Update movie info on delete movie - Delete Background when menu is entered - Timeout updated (MB does not exit after options menu is left) + (C) 2009-2014 Stefan Seyfried - Revision 1.4 2006/02/20 01:10:34 guenther - - temporary parental lock updated - remove 1s debug prints in movieplayer- Delete file without rescan of movies- Crash if try to scroll in list with 2 movies only- UTF8XML to UTF8 conversion in preview- Last file selection recovered- use of standard folders adjustable in config- reload and remount option in config + outsourced: + (C) 2016, Thilo Graf 'dbt' +*/ - Revision 1.3 2005/12/18 09:23:53 metallica - fix compil warnings - - Revision 1.2 2005/12/12 07:58:02 guenther - - fix bug on deleting CMovieBrowser - speed up parse time (20 ms per .ts file now)- update stale function- refresh directories on reload- print scan time in debug console - - -****************************************************************************/ #ifndef MOVIEBROWSER_H_ #define MOVIEBROWSER_H_ @@ -69,14 +43,16 @@ #include #endif +#include "mb_types.h" + #include -#include +//#include #include #include -#include -#include + #include +#include #include #include #include @@ -89,106 +65,11 @@ /* percent */ #define MIN_BROWSER_FRAME_HEIGHT 10 #define MAX_BROWSER_FRAME_HEIGHT 80 -void strReplace(std::string& orig, const char* fstr, const std::string &rstr); - -/* !!!! Do NOT change the order of the enum, just add items at the end !!!! */ -typedef enum -{ - MB_INFO_FILENAME = 0, - MB_INFO_FILEPATH = 1, - MB_INFO_TITLE = 2, - MB_INFO_SERIE = 3, - MB_INFO_INFO1 = 4, - MB_INFO_MAJOR_GENRE = 5, - MB_INFO_MINOR_GENRE = 6, - MB_INFO_INFO2 = 7, - MB_INFO_PARENTAL_LOCKAGE = 8, - MB_INFO_CHANNEL = 9, - MB_INFO_BOOKMARK = 10, - MB_INFO_QUALITY = 11, - MB_INFO_PREVPLAYDATE = 12, - MB_INFO_RECORDDATE = 13, - MB_INFO_PRODDATE = 14, - MB_INFO_COUNTRY = 15, - MB_INFO_GEOMETRIE = 16, - MB_INFO_AUDIO = 17, - MB_INFO_LENGTH = 18, - MB_INFO_SIZE = 19, - MB_INFO_MAX_NUMBER = 20 // MUST be allways the last item in the list -}MB_INFO_ITEM; +// void strReplace(std::string& orig, const char* fstr, const std::string &rstr); -typedef enum -{ - MB_DIRECTION_AUTO = 0, - MB_DIRECTION_UP = 1, - MB_DIRECTION_DOWN = 2, - MB_DIRECTION_MAX_NUMBER = 3 // MUST be allways the last item in the list -}MB_DIRECTION; -typedef struct -{ - MB_INFO_ITEM item; - MB_DIRECTION direction; -}MB_SORTING; - -typedef enum -{ - MB_STORAGE_TYPE_UNDEFINED = 0, - MB_STORAGE_TYPE_NFS = 1, - MB_STORAGE_TYPE_VLC = 2, - MB_STORAGE_MAX_NUMBER = 3 // MUST be allways the last item in the list -}MB_STORAGE_TYPE; - -typedef struct -{ - MB_INFO_ITEM item; - std::string optionString; - int optionVar; -}MB_FILTER; - -typedef enum -{ - MB_FOCUS_BROWSER = 0, - MB_FOCUS_LAST_PLAY = 1, - MB_FOCUS_LAST_RECORD = 2, - MB_FOCUS_MOVIE_INFO = 3, - MB_FOCUS_FILTER = 4, - MB_FOCUS_MAX_NUMBER = 5 // MUST be allways the last item in the list -}MB_FOCUS; - -typedef enum -{ - MB_GUI_BROWSER_ONLY = 0, - MB_GUI_MOVIE_INFO = 1, - MB_GUI_LAST_PLAY = 2, - MB_GUI_LAST_RECORD = 3, - MB_GUI_FILTER = 4, - MB_GUI_MAX_NUMBER = 5 // MUST be allways the last item in the list -}MB_GUI; - - -typedef enum -{ - MB_PARENTAL_LOCK_OFF = 0, - MB_PARENTAL_LOCK_ACTIVE = 1, - MB_PARENTAL_LOCK_OFF_TMP = 2, // use this to activate the lock temporarily until next dbox start up - MB_PARENTAL_LOCK_MAX_NUMBER = 3 // MUST be allways the last item in the list -}MB_PARENTAL_LOCK; - -typedef struct -{ - std::string name; - int* used; -}MB_DIR; - -typedef enum -{ - MB_SHOW_RECORDS, - MB_SHOW_FILES, - MB_SHOW_YT -} MB_SHOW_MODE; #define MB_MAX_ROWS LF_MAX_ROWS #define MB_MAX_DIRS NETWORK_NFS_NR_OF_ENTRIES @@ -384,8 +265,9 @@ class CMovieBrowser : public CMenuTarget void setMode(int mode) { if (show_mode != mode) m_file_info_stale = true; - show_mode = mode; + show_mode = mode; } + bool gotMovie(const char *rec_title); private: //Functions ///// MovieBrowser init /////////////// @@ -426,6 +308,7 @@ class CMovieBrowser : public CMenuTarget void onSetGUIWindowNext(void); void onSetGUIWindowPrev(void); bool onDelete(bool cursor_only = false); + std::string formatDeleteMsg(MI_MOVIE_INFO *movieinfo, int msgFont, const int boxWidth = 450); bool onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk = false); // P4 bool onSortMovieInfoHandleList(std::vector& pv_handle_list, MB_INFO_ITEM sort_type, MB_DIRECTION direction); @@ -471,16 +354,6 @@ class CMovieBrowser : public CMenuTarget bool addFile(CFile &file, int dirItNr); }; -// Class to show Moviebrowser Information, to be used by menu -class CMovieHelp : public CMenuTarget -{ - private: - - public: - CMovieHelp(){}; - ~CMovieHelp(){}; - int exec( CMenuTarget* parent, const std::string & actionKey ); -}; // I tried a lot to use the menu.cpp as ListBox selection, and I got three solution which are all garbage. //Might be replaced by somebody who is familiar with this stuff . @@ -537,14 +410,7 @@ class CFileChooser : public CMenuWidget int exec(CMenuTarget* parent, const std::string & actionKey); }; -typedef enum -{ - DIR_STATE_UNKNOWN = 0, - DIR_STATE_SERVER_DOWN = 1, - DIR_STATE_NOT_MOUNTED = 2, - DIR_STATE_MOUNTED = 3, - DIR_STATE_DISABLED = 4 -} DIR_STATE; + class CDirMenu : public CMenuWidget { @@ -565,90 +431,6 @@ class CDirMenu : public CMenuWidget }; -// EPG Genre, taken from epgview, TODO: might be splitted in major/minor to increase handling -#define GENRE_ALL_COUNT 76 -const CMenuOptionChooser::keyval GENRE_ALL[GENRE_ALL_COUNT] = -{ - { 0x00, LOCALE_GENRE_UNKNOWN }, - { 0x10, LOCALE_GENRE_MOVIE_0 }, - { 0x11, LOCALE_GENRE_MOVIE_1 }, - { 0x12, LOCALE_GENRE_MOVIE_2 }, - { 0x13, LOCALE_GENRE_MOVIE_3 }, - { 0x14, LOCALE_GENRE_MOVIE_4 }, - { 0x15, LOCALE_GENRE_MOVIE_5 }, - { 0x16, LOCALE_GENRE_MOVIE_6 }, - { 0x17, LOCALE_GENRE_MOVIE_7 }, - { 0x18, LOCALE_GENRE_MOVIE_8 }, - { 0x20, LOCALE_GENRE_NEWS_0 }, - { 0x21, LOCALE_GENRE_NEWS_1 }, - { 0x22, LOCALE_GENRE_NEWS_2 }, - { 0x23, LOCALE_GENRE_NEWS_3 }, - { 0x24, LOCALE_GENRE_NEWS_4 }, - { 0x30, LOCALE_GENRE_SHOW_0 }, - { 0x31, LOCALE_GENRE_SHOW_1 }, - { 0x32, LOCALE_GENRE_SHOW_2 }, - { 0x33, LOCALE_GENRE_SHOW_3 }, - { 0x40, LOCALE_GENRE_SPORTS_0 }, - { 0x41, LOCALE_GENRE_SPORTS_1 }, - { 0x42, LOCALE_GENRE_SPORTS_2 }, - { 0x43, LOCALE_GENRE_SPORTS_3 }, - { 0x44, LOCALE_GENRE_SPORTS_4 }, - { 0x45, LOCALE_GENRE_SPORTS_5 }, - { 0x46, LOCALE_GENRE_SPORTS_6 }, - { 0x47, LOCALE_GENRE_SPORTS_7 }, - { 0x48, LOCALE_GENRE_SPORTS_8 }, - { 0x49, LOCALE_GENRE_SPORTS_9 }, - { 0x4A, LOCALE_GENRE_SPORTS_10 }, - { 0x4B, LOCALE_GENRE_SPORTS_11 }, - { 0x50, LOCALE_GENRE_CHILDRENS_PROGRAMMES_0 }, - { 0x51, LOCALE_GENRE_CHILDRENS_PROGRAMMES_1 }, - { 0x52, LOCALE_GENRE_CHILDRENS_PROGRAMMES_2 }, - { 0x53, LOCALE_GENRE_CHILDRENS_PROGRAMMES_3 }, - { 0x54, LOCALE_GENRE_CHILDRENS_PROGRAMMES_4 }, - { 0x55, LOCALE_GENRE_CHILDRENS_PROGRAMMES_5 }, - { 0x60, LOCALE_GENRE_MUSIC_DANCE_0 }, - { 0x61, LOCALE_GENRE_MUSIC_DANCE_1 }, - { 0x62, LOCALE_GENRE_MUSIC_DANCE_2 }, - { 0x63, LOCALE_GENRE_MUSIC_DANCE_3 }, - { 0x64, LOCALE_GENRE_MUSIC_DANCE_4 }, - { 0x65, LOCALE_GENRE_MUSIC_DANCE_5 }, - { 0x66, LOCALE_GENRE_MUSIC_DANCE_6 }, - { 0x70, LOCALE_GENRE_ARTS_0 }, - { 0x71, LOCALE_GENRE_ARTS_1 }, - { 0x72, LOCALE_GENRE_ARTS_2 }, - { 0x73, LOCALE_GENRE_ARTS_3 }, - { 0x74, LOCALE_GENRE_ARTS_4 }, - { 0x75, LOCALE_GENRE_ARTS_5 }, - { 0x76, LOCALE_GENRE_ARTS_6 }, - { 0x77, LOCALE_GENRE_ARTS_7 }, - { 0x78, LOCALE_GENRE_ARTS_8 }, - { 0x79, LOCALE_GENRE_ARTS_9 }, - { 0x7A, LOCALE_GENRE_ARTS_10 }, - { 0x7B, LOCALE_GENRE_ARTS_11 }, - { 0x80, LOCALE_GENRE_SOCIAL_POLITICAL_0 }, - { 0x81, LOCALE_GENRE_SOCIAL_POLITICAL_1 }, - { 0x82, LOCALE_GENRE_SOCIAL_POLITICAL_2 }, - { 0x83, LOCALE_GENRE_SOCIAL_POLITICAL_3 }, - { 0x90, LOCALE_GENRE_DOCUS_MAGAZINES_0 }, - { 0x91, LOCALE_GENRE_DOCUS_MAGAZINES_1 }, - { 0x92, LOCALE_GENRE_DOCUS_MAGAZINES_2 }, - { 0x93, LOCALE_GENRE_DOCUS_MAGAZINES_3 }, - { 0x94, LOCALE_GENRE_DOCUS_MAGAZINES_4 }, - { 0x95, LOCALE_GENRE_DOCUS_MAGAZINES_5 }, - { 0x96, LOCALE_GENRE_DOCUS_MAGAZINES_6 }, - { 0x97, LOCALE_GENRE_DOCUS_MAGAZINES_7 }, - { 0xA0, LOCALE_GENRE_TRAVEL_HOBBIES_0 }, - { 0xA1, LOCALE_GENRE_TRAVEL_HOBBIES_1 }, - { 0xA2, LOCALE_GENRE_TRAVEL_HOBBIES_2 }, - { 0xA3, LOCALE_GENRE_TRAVEL_HOBBIES_3 }, - { 0xA4, LOCALE_GENRE_TRAVEL_HOBBIES_4 }, - { 0xA5, LOCALE_GENRE_TRAVEL_HOBBIES_5 }, - { 0xA6, LOCALE_GENRE_TRAVEL_HOBBIES_6 }, - { 0xA7, LOCALE_GENRE_TRAVEL_HOBBIES_7 } -}; + #endif /*MOVIEBROWSER_H_*/ - - - - diff --git a/src/gui/moviebrowser/mb_functions.h b/src/gui/moviebrowser/mb_functions.h new file mode 100644 index 000000000..a5fd547d3 --- /dev/null +++ b/src/gui/moviebrowser/mb_functions.h @@ -0,0 +1,170 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + 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 . + + *********************************************************** + + Module Name: mb_functions.h + + Description: Implementation of the CMovieBrowser class + This class provides a filebrowser window to view, select and start a movies from HD. + This class does replace the Filebrowser + + Date: Nov 2005 + + Author: Guenther@tuxbox.berlios.org + based on code of Steffen Hehn 'McClean' + + (C) 2009-2014 Stefan Seyfried + (C) 2016 Sven Hoefer + + outsourced: + (C) 2016, Thilo Graf 'dbt' +*/ + +#ifndef __MB_FUNCTIONS__ +#define __MB_FUNCTIONS__ + +#include "mb_types.h" +#include + +void strReplace(std::string& orig, const char* fstr, const std::string &rstr); + +static std::string rateFormat(int i) +{ + return to_string(i/10) + "," + to_string(i%10); +} + +bool sortDirection = 0; + +bool compare_to_lower(const char a, const char b) +{ + return tolower(a) < tolower(b); +} + +// sort operators +bool sortByTitle(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (std::lexicographical_compare(a->epgTitle.begin(), a->epgTitle.end(), b->epgTitle.begin(), b->epgTitle.end(), compare_to_lower)) + return true; + if (std::lexicographical_compare(b->epgTitle.begin(), b->epgTitle.end(), a->epgTitle.begin(), a->epgTitle.end(), compare_to_lower)) + return false; + return a->file.Time < b->file.Time; +} +bool sortByGenre(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (std::lexicographical_compare(a->epgInfo1.begin(), a->epgInfo1.end(), b->epgInfo1.begin(), b->epgInfo1.end(), compare_to_lower)) + return true; + if (std::lexicographical_compare(b->epgInfo1.begin(), b->epgInfo1.end(), a->epgInfo1.begin(), a->epgInfo1.end(), compare_to_lower)) + return false; + return sortByTitle(a,b); +} +bool sortByChannel(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (std::lexicographical_compare(a->channelName.begin(), a->channelName.end(), b->channelName.begin(), b->channelName.end(), compare_to_lower)) + return true; + if (std::lexicographical_compare(b->channelName.begin(), b->channelName.end(), a->channelName.begin(), a->channelName.end(), compare_to_lower)) + return false; + return sortByTitle(a,b); +} +bool sortByFileName(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (std::lexicographical_compare(a->file.getFileName().begin(), a->file.getFileName().end(), b->file.getFileName().begin(), b->file.getFileName().end(), compare_to_lower)) + return true; + if (std::lexicographical_compare(b->file.getFileName().begin(), b->file.getFileName().end(), a->file.getFileName().begin(), a->file.getFileName().end(), compare_to_lower)) + return false; + return a->file.Time < b->file.Time; +} +bool sortByRecordDate(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->file.Time > b->file.Time ; + else + return a->file.Time < b->file.Time ; +} +bool sortBySize(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->file.Size > b->file.Size; + else + return a->file.Size < b->file.Size; +} +bool sortByAge(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->parentalLockAge > b->parentalLockAge; + else + return a->parentalLockAge < b->parentalLockAge; +} +bool sortByRating(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->rating > b->rating; + else + return a->rating < b->rating; +} +bool sortByQuality(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->quality > b->quality; + else + return a->quality < b->quality; +} +bool sortByDir(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->dirItNr > b->dirItNr; + else + return a->dirItNr < b->dirItNr; +} +bool sortByLastPlay(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->dateOfLastPlay > b->dateOfLastPlay; + else + return a->dateOfLastPlay < b->dateOfLastPlay; +} + +bool (* const sortBy[MB_INFO_MAX_NUMBER+1])(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) = +{ + &sortByFileName, //MB_INFO_FILENAME = 0, + &sortByDir, //MB_INFO_FILEPATH = 1, + &sortByTitle, //MB_INFO_TITLE = 2, + NULL, //MB_INFO_SERIE = 3, + &sortByGenre, //MB_INFO_INFO1 = 4, + NULL, //MB_INFO_MAJOR_GENRE = 5, + NULL, //MB_INFO_MINOR_GENRE = 6, + NULL, //MB_INFO_INFO2 = 7, + &sortByAge, //MB_INFO_PARENTAL_LOCKAGE = 8, + &sortByChannel, //MB_INFO_CHANNEL = 9, + NULL, //MB_INFO_BOOKMARK = 10, + &sortByQuality, //MB_INFO_QUALITY = 11, + &sortByLastPlay, //MB_INFO_PREVPLAYDATE = 12, + &sortByRecordDate, //MB_INFO_RECORDDATE = 13, + NULL, //MB_INFO_PRODDATE = 14, + NULL, //MB_INFO_COUNTRY = 15, + NULL, //MB_INFO_GEOMETRIE = 16, + NULL, //MB_INFO_AUDIO = 17, + NULL, //MB_INFO_LENGTH = 18, + &sortBySize, //MB_INFO_SIZE = 19, + &sortByRating, //MB_INFO_RATING = 20, + NULL, //MB_INFO_SPACER = 21, + NULL //MB_INFO_MAX_NUMBER = 22 +}; + +#endif /*__MB_FUNCTIONS__*/ diff --git a/src/gui/moviebrowser/mb_help.h b/src/gui/moviebrowser/mb_help.h new file mode 100644 index 000000000..dc77e86d1 --- /dev/null +++ b/src/gui/moviebrowser/mb_help.h @@ -0,0 +1,72 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + 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 . + + *********************************************************** + + Module Name: mb_help.h + + Description: Implementation of the CMovieBrowser class + This class provides a filebrowser window to view, select and start a movies from HD. + This class does replace the Filebrowser + + Date: Nov 2005 + + Author: Guenther@tuxbox.berlios.org + based on code of Steffen Hehn 'McClean' + + outsourced: + (C) 2016, Thilo Graf 'dbt' +*/ + +#ifndef MOVIEBROWSER_HELP_H_ +#define MOVIEBROWSER_HELP_H_ + + +#include + +// Class to show Moviebrowser Information, to be used by menu +class CMovieHelp : public CMenuTarget +{ + private: + + public: + CMovieHelp(){}; + ~CMovieHelp(){}; + + int exec(CMenuTarget* /*parent*/, const std::string & /*actionKey*/) + { + Helpbox helpbox; + helpbox.addLine(NEUTRINO_ICON_BUTTON_RED, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_RED)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_GREEN, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_GREEN)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_YELLOW, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_YELLOW)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_BLUE, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_BLUE)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_MENU_SMALL,g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_MENU)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_PLAY, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_PLAY)); + helpbox.addLine(""); + helpbox.addLine(NEUTRINO_ICON_BUTTON_OKAY, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_OKAY)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_MUTE_SMALL,g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_MUTE)); + helpbox.addLine(""); + helpbox.addLine(NEUTRINO_ICON_BUTTON_LEFT, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_LEFT)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_RIGHT, g_Locale->getText(LOCALE_MOVIEBROWSER_HELP_BUTTON_RIGHT)); + helpbox.show(LOCALE_MESSAGEBOX_INFO); + return(0); + } +}; + +#endif /*MOVIEBROWSER_HELP_H_*/ diff --git a/src/gui/moviebrowser/mb_types.h b/src/gui/moviebrowser/mb_types.h new file mode 100644 index 000000000..b260d0ec7 --- /dev/null +++ b/src/gui/moviebrowser/mb_types.h @@ -0,0 +1,234 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + 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 . + + *********************************************************** + + Module Name: mb_types.h + + Description: Implementation of the CMovieBrowser class + This class provides a filebrowser window to view, select and start a movies from HD. + This class does replace the Filebrowser + + Date: Nov 2005 + + Author: Guenther@tuxbox.berlios.org + based on code of Steffen Hehn 'McClean' + + (C) 2009-2014 Stefan Seyfried + (C) 2016 Sven Hoefer + + outsourced: + (C) 2016, Thilo Graf 'dbt' +*/ + +#include + +#ifndef __MB_TYPES__ +#define __MB_TYPES__ + +/* !!!! Do NOT change the order of the enum, just add items at the end !!!! */ +typedef enum +{ + MB_INFO_FILENAME = 0, + MB_INFO_FILEPATH = 1, + MB_INFO_TITLE = 2, + MB_INFO_SERIE = 3, + MB_INFO_INFO1 = 4, + MB_INFO_MAJOR_GENRE = 5, + MB_INFO_MINOR_GENRE = 6, + MB_INFO_INFO2 = 7, + MB_INFO_PARENTAL_LOCKAGE = 8, + MB_INFO_CHANNEL = 9, + MB_INFO_BOOKMARK = 10, + MB_INFO_QUALITY = 11, + MB_INFO_PREVPLAYDATE = 12, + MB_INFO_RECORDDATE = 13, + MB_INFO_PRODDATE = 14, + MB_INFO_COUNTRY = 15, + MB_INFO_GEOMETRIE = 16, + MB_INFO_AUDIO = 17, + MB_INFO_LENGTH = 18, + MB_INFO_SIZE = 19, + MB_INFO_RATING = 20, + MB_INFO_SPACER = 21, + MB_INFO_MAX_NUMBER = 22 // MUST be allways the last item in the list +}MB_INFO_ITEM; + +typedef enum +{ + MB_DIRECTION_AUTO = 0, + MB_DIRECTION_UP = 1, + MB_DIRECTION_DOWN = 2, + MB_DIRECTION_MAX_NUMBER = 3 // MUST be allways the last item in the list +}MB_DIRECTION; + +typedef struct +{ + MB_INFO_ITEM item; + MB_DIRECTION direction; +}MB_SORTING; + +typedef enum +{ + MB_STORAGE_TYPE_UNDEFINED = 0, + MB_STORAGE_TYPE_NFS = 1, + MB_STORAGE_TYPE_VLC = 2, + MB_STORAGE_MAX_NUMBER = 3 // MUST be allways the last item in the list +}MB_STORAGE_TYPE; + +typedef struct +{ + MB_INFO_ITEM item; + std::string optionString; + int optionVar; +}MB_FILTER; + +typedef enum +{ + MB_FOCUS_BROWSER = 0, + MB_FOCUS_LAST_PLAY = 1, + MB_FOCUS_LAST_RECORD = 2, + MB_FOCUS_MOVIE_INFO = 3, + MB_FOCUS_FILTER = 4, + MB_FOCUS_MAX_NUMBER = 5 // MUST be allways the last item in the list +}MB_FOCUS; + +typedef enum +{ + MB_GUI_BROWSER_ONLY = 0, + MB_GUI_MOVIE_INFO = 1, + MB_GUI_LAST_PLAY = 2, + MB_GUI_LAST_RECORD = 3, + MB_GUI_FILTER = 4, + MB_GUI_MAX_NUMBER = 5 // MUST be allways the last item in the list +}MB_GUI; + +typedef enum +{ + MB_PARENTAL_LOCK_OFF = 0, + MB_PARENTAL_LOCK_ACTIVE = 1, + MB_PARENTAL_LOCK_OFF_TMP = 2, // use this to activate the lock temporarily until next dbox start up + MB_PARENTAL_LOCK_MAX_NUMBER = 3 // MUST be allways the last item in the list +}MB_PARENTAL_LOCK; + +typedef struct +{ + std::string name; + int* used; +}MB_DIR; + +typedef enum +{ + MB_SHOW_RECORDS, + MB_SHOW_FILES, + MB_SHOW_YT +} MB_SHOW_MODE; + +typedef enum +{ + DIR_STATE_UNKNOWN = 0, + DIR_STATE_SERVER_DOWN = 1, + DIR_STATE_NOT_MOUNTED = 2, + DIR_STATE_MOUNTED = 3, + DIR_STATE_DISABLED = 4 +} DIR_STATE; + +// EPG Genre, taken from epgview, TODO: might be splitted in major/minor to increase handling +#define GENRE_ALL_COUNT 76 +const CMenuOptionChooser::keyval GENRE_ALL[GENRE_ALL_COUNT] = +{ + { 0x00, LOCALE_GENRE_UNKNOWN }, + { 0x10, LOCALE_GENRE_MOVIE_0 }, + { 0x11, LOCALE_GENRE_MOVIE_1 }, + { 0x12, LOCALE_GENRE_MOVIE_2 }, + { 0x13, LOCALE_GENRE_MOVIE_3 }, + { 0x14, LOCALE_GENRE_MOVIE_4 }, + { 0x15, LOCALE_GENRE_MOVIE_5 }, + { 0x16, LOCALE_GENRE_MOVIE_6 }, + { 0x17, LOCALE_GENRE_MOVIE_7 }, + { 0x18, LOCALE_GENRE_MOVIE_8 }, + { 0x20, LOCALE_GENRE_NEWS_0 }, + { 0x21, LOCALE_GENRE_NEWS_1 }, + { 0x22, LOCALE_GENRE_NEWS_2 }, + { 0x23, LOCALE_GENRE_NEWS_3 }, + { 0x24, LOCALE_GENRE_NEWS_4 }, + { 0x30, LOCALE_GENRE_SHOW_0 }, + { 0x31, LOCALE_GENRE_SHOW_1 }, + { 0x32, LOCALE_GENRE_SHOW_2 }, + { 0x33, LOCALE_GENRE_SHOW_3 }, + { 0x40, LOCALE_GENRE_SPORTS_0 }, + { 0x41, LOCALE_GENRE_SPORTS_1 }, + { 0x42, LOCALE_GENRE_SPORTS_2 }, + { 0x43, LOCALE_GENRE_SPORTS_3 }, + { 0x44, LOCALE_GENRE_SPORTS_4 }, + { 0x45, LOCALE_GENRE_SPORTS_5 }, + { 0x46, LOCALE_GENRE_SPORTS_6 }, + { 0x47, LOCALE_GENRE_SPORTS_7 }, + { 0x48, LOCALE_GENRE_SPORTS_8 }, + { 0x49, LOCALE_GENRE_SPORTS_9 }, + { 0x4A, LOCALE_GENRE_SPORTS_10 }, + { 0x4B, LOCALE_GENRE_SPORTS_11 }, + { 0x50, LOCALE_GENRE_CHILDRENS_PROGRAMMES_0 }, + { 0x51, LOCALE_GENRE_CHILDRENS_PROGRAMMES_1 }, + { 0x52, LOCALE_GENRE_CHILDRENS_PROGRAMMES_2 }, + { 0x53, LOCALE_GENRE_CHILDRENS_PROGRAMMES_3 }, + { 0x54, LOCALE_GENRE_CHILDRENS_PROGRAMMES_4 }, + { 0x55, LOCALE_GENRE_CHILDRENS_PROGRAMMES_5 }, + { 0x60, LOCALE_GENRE_MUSIC_DANCE_0 }, + { 0x61, LOCALE_GENRE_MUSIC_DANCE_1 }, + { 0x62, LOCALE_GENRE_MUSIC_DANCE_2 }, + { 0x63, LOCALE_GENRE_MUSIC_DANCE_3 }, + { 0x64, LOCALE_GENRE_MUSIC_DANCE_4 }, + { 0x65, LOCALE_GENRE_MUSIC_DANCE_5 }, + { 0x66, LOCALE_GENRE_MUSIC_DANCE_6 }, + { 0x70, LOCALE_GENRE_ARTS_0 }, + { 0x71, LOCALE_GENRE_ARTS_1 }, + { 0x72, LOCALE_GENRE_ARTS_2 }, + { 0x73, LOCALE_GENRE_ARTS_3 }, + { 0x74, LOCALE_GENRE_ARTS_4 }, + { 0x75, LOCALE_GENRE_ARTS_5 }, + { 0x76, LOCALE_GENRE_ARTS_6 }, + { 0x77, LOCALE_GENRE_ARTS_7 }, + { 0x78, LOCALE_GENRE_ARTS_8 }, + { 0x79, LOCALE_GENRE_ARTS_9 }, + { 0x7A, LOCALE_GENRE_ARTS_10 }, + { 0x7B, LOCALE_GENRE_ARTS_11 }, + { 0x80, LOCALE_GENRE_SOCIAL_POLITICAL_0 }, + { 0x81, LOCALE_GENRE_SOCIAL_POLITICAL_1 }, + { 0x82, LOCALE_GENRE_SOCIAL_POLITICAL_2 }, + { 0x83, LOCALE_GENRE_SOCIAL_POLITICAL_3 }, + { 0x90, LOCALE_GENRE_DOCUS_MAGAZINES_0 }, + { 0x91, LOCALE_GENRE_DOCUS_MAGAZINES_1 }, + { 0x92, LOCALE_GENRE_DOCUS_MAGAZINES_2 }, + { 0x93, LOCALE_GENRE_DOCUS_MAGAZINES_3 }, + { 0x94, LOCALE_GENRE_DOCUS_MAGAZINES_4 }, + { 0x95, LOCALE_GENRE_DOCUS_MAGAZINES_5 }, + { 0x96, LOCALE_GENRE_DOCUS_MAGAZINES_6 }, + { 0x97, LOCALE_GENRE_DOCUS_MAGAZINES_7 }, + { 0xA0, LOCALE_GENRE_TRAVEL_HOBBIES_0 }, + { 0xA1, LOCALE_GENRE_TRAVEL_HOBBIES_1 }, + { 0xA2, LOCALE_GENRE_TRAVEL_HOBBIES_2 }, + { 0xA3, LOCALE_GENRE_TRAVEL_HOBBIES_3 }, + { 0xA4, LOCALE_GENRE_TRAVEL_HOBBIES_4 }, + { 0xA5, LOCALE_GENRE_TRAVEL_HOBBIES_5 }, + { 0xA6, LOCALE_GENRE_TRAVEL_HOBBIES_6 }, + { 0xA7, LOCALE_GENRE_TRAVEL_HOBBIES_7 } +}; + +#endif /*__MB_TYPES__*/ \ No newline at end of file diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 424aa2989..def5a2f02 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -1,14 +1,10 @@ -/*************************************************************************** - Neutrino-GUI - DBoxII-Project +/* + movieinfo - Neutrino-GUI - Homepage: http://dbox.cyberphoria.org/ + Copyright (C) 2005 Günther - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. + Copyright (C) 2009, 2012 Stefan Seyfried + Copyright (C) 2015 Sven Hoefer (svenhoefer) License: GPL @@ -26,20 +22,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - *********************************************************** +*/ - Module Name: movieinfo.cpp . - - Description: Implementation of the CMovieInfo class - This class loads, saves and shows the movie Information from the any .xml File on HD - - Date: Nov 2005 - - Author: Günther@tuxbox.berlios.org - - Copyright(C) 2009, 2012 Stefan Seyfried - -****************************************************************************/ #ifdef HAVE_CONFIG_H #include #endif @@ -56,30 +40,19 @@ #include -// #define XMLTREE_LIB -#ifdef XMLTREE_LIB -#include -#include -#endif #define TRACE printf -/************************************************************************ - -************************************************************************/ CMovieInfo::CMovieInfo() { - //TRACE("[mi] new\r\n"); + //TRACE("[mi] new\n"); } CMovieInfo::~CMovieInfo() { - //TRACE("[mi] del\r\n"); + //TRACE("[mi] del\n"); ; } -/************************************************************************ - -************************************************************************/ bool CMovieInfo::convertTs2XmlName(std::string& filename) { size_t lastdot = filename.find_last_of("."); @@ -91,9 +64,6 @@ bool CMovieInfo::convertTs2XmlName(std::string& filename) return false; } -/************************************************************************ - -************************************************************************/ static void XML_ADD_TAG_STRING(std::string &_xml_text_, const char *_tag_name_, std::string _tag_content_) { _xml_text_ += "\t\t<"; @@ -127,72 +97,50 @@ static void XML_ADD_TAG_LONG(std::string &_xml_text_, const char *_tag_name_, ui _xml_text_ += ">\n"; } -#if 0 -std::string decodeXmlSpecialChars(std::string s); - -static void XML_GET_DATA_STRING(XMLTreeNode *_node_, const char *_tag_, std::string &_string_dest_) -{ - if(!strcmp(_node_->GetType(), _tag_) && _node_->GetData()) - _string_dest_ = decodeXmlSpecialChars(_node_->GetData()); -} - -static void XML_GET_DATA_INT(XMLTreeNode *_node_, const char *_tag_, int _int_dest_) -{ - if(!strcmp(_node_->GetType(), _tag_) && _node_->GetData()) - _int_dest_ = atoi(_node_->GetData()); -} - -static void XML_GET_DATA_LONG(XMLTreeNode *_node_, const char *_tag_,long int _int_dest_) -{ - if(!strcmp(_node_->GetType(), _tag_) && _node_->GetData()); - sscanf(_node_->GetData(), "%llu", &_int_dest_); -} -#endif - bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * movie_info) { - //TRACE("[mi]->encodeMovieInfoXml\r\n"); + //TRACE("[mi]->encodeMovieInfoXml\n"); *extMessage = "\n\n" "<" MI_XML_TAG_NEUTRINO " commandversion=\"1\">\n" "\t<" MI_XML_TAG_RECORD " command=\"" "record" "\">\n"; - XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_CHANNELNAME, movie_info->epgChannel); + XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_CHANNELNAME, movie_info->channelName); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_EPGTITLE, movie_info->epgTitle); - XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->epgId); + XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->channelId); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO1, movie_info->epgInfo1); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO2, movie_info->epgInfo2); - XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->epgMode); //%d - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid); //%u - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); //%u + XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgId); // %llu + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->mode); // %d + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->VideoPid); // %u + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); // %u if ( !movie_info->audioPids.empty() ) { *extMessage += "\t\t<" MI_XML_TAG_AUDIOPIDS ">\n"; - for (unsigned int i = 0; i < movie_info->audioPids.size(); i++) // pids.APIDs.size() + for (unsigned int i = 0; i < movie_info->audioPids.size(); i++) // pids.APIDs.size() { *extMessage += "\t\t\t<" MI_XML_TAG_AUDIO " " MI_XML_TAG_PID "=\""; - *extMessage += to_string(movie_info->audioPids[i].epgAudioPid); + *extMessage += to_string(movie_info->audioPids[i].AudioPid); *extMessage += "\" " MI_XML_TAG_ATYPE "=\""; *extMessage += to_string(movie_info->audioPids[i].atype); *extMessage += "\" " MI_XML_TAG_SELECTED "=\""; *extMessage += to_string(movie_info->audioPids[i].selected); *extMessage += "\" " MI_XML_TAG_NAME "=\""; - *extMessage += ZapitTools::UTF8_to_UTF8XML(movie_info->audioPids[i].epgAudioPidName.c_str()); + *extMessage += ZapitTools::UTF8_to_UTF8XML(movie_info->audioPids[i].AudioPidName.c_str()); *extMessage += "\"/>\n"; } *extMessage += "\t\t\n"; } - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VTXTPID, movie_info->epgVTXPID); //%u - /***************************************************** - * new tags */ + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VTXTPID, movie_info->VtxtPid); // %u + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_GENRE_MAJOR, movie_info->genreMajor); XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_GENRE_MINOR, movie_info->genreMinor); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_SERIE_NAME, movie_info->serieName); XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_LENGTH, movie_info->length); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_PRODUCT_COUNTRY, movie_info->productionCountry); XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_PRODUCT_DATE, movie_info->productionDate); + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_RATING, movie_info->rating); XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_QUALITY, movie_info->quality); XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_PARENTAL_LOCKAGE, movie_info->parentalLockAge); XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_DATE_OF_LAST_PLAY, movie_info->dateOfLastPlay); @@ -222,12 +170,11 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo return true; } -/************************************************************************ -************************************************************************/ bool CMovieInfo::saveMovieInfo(MI_MOVIE_INFO & movie_info, CFile * file) { - //TRACE("[mi]->saveXml \r\n"); + //TRACE("[mi]->saveMovieInfo\n"); + bool result = true; std::string text; CFile file_xml; @@ -238,35 +185,35 @@ bool CMovieInfo::saveMovieInfo(MI_MOVIE_INFO & movie_info, CFile * file) } else { file_xml.Name = file->Name; } - TRACE("[mi] saveXml: %s\r\n", file_xml.Name.c_str()); + TRACE("[mi] saveMovieInfo: %s\n", file_xml.Name.c_str()); if (result == true) { result = encodeMovieInfoXml(&text, &movie_info); if (result == true) { result = saveFile(file_xml, text); // save if (result == false) { - TRACE("[mi] saveXml: save error\r\n"); + TRACE("[mi] saveMovieInfo: save error\n"); } } else { - TRACE("[mi] saveXml: encoding error\r\n"); + TRACE("[mi] saveMovieInfo: encoding error\n"); } } else { - TRACE("[mi] saveXml: error\r\n"); + TRACE("[mi] saveMovieInfo: error\n"); } return (result); } -/************************************************************************ -************************************************************************/ bool CMovieInfo::loadMovieInfo(MI_MOVIE_INFO * movie_info, CFile * file) { - //TRACE("[mi]->loadMovieInfo \r\n"); + //TRACE("[mi]->loadMovieInfo\n"); + bool result = true; CFile file_xml; if (file == NULL) { - // if there is no give file, we use the file name from movie info but we have to convert the ts name to xml name first + // if there is no give file, we use the file name from movie info + // but we have to convert the ts name to xml name first file_xml.Name = movie_info->file.Name; result = convertTs2XmlName(file_xml.Name); } else { @@ -277,284 +224,15 @@ bool CMovieInfo::loadMovieInfo(MI_MOVIE_INFO * movie_info, CFile * file) // load xml file in buffer std::string text; result = loadFile(file_xml, text); - if (result == true) { -#ifdef XMLTREE_LIB + if (result == true) result = parseXmlTree(text, movie_info); -#else /* XMLTREE_LIB */ - result = parseXmlQuickFix(text, movie_info); -#endif /* XMLTREE_LIB */ - } } - if (movie_info->productionDate > 50 && movie_info->productionDate < 200) // backwardcompaibility + if (movie_info->productionDate > 50 && movie_info->productionDate < 200) // backwardcompaibility movie_info->productionDate += 1900; return (result); } -/************************************************************************ - -************************************************************************/ -#if 0 -//never used -bool CMovieInfo::parseXmlTree(char */*text*/, MI_MOVIE_INFO * /*movie_info*/) -{ -#ifndef XMLTREE_LIB - return (false); // no XML lib available return false -#else /* XMLTREE_LIB */ - - //int helpIDtoLoad = 80; - - //XMLTreeParser *parser=new XMLTreeParser("ISO-8859-1"); - XMLTreeParser *parser = new XMLTreeParser(NULL); - - if (!parser->Parse(text, strlen(text), 1)) { - TRACE("parse error: %s at line %d \r\n", parser->ErrorString(parser->GetErrorCode()), parser->GetCurrentLineNumber()); - //fclose(in); - delete parser; - return (false); - } - - XMLTreeNode *root = parser->RootNode(); - if (!root) { - TRACE(" root error \r\n"); - delete parser; - return (false); - } - - if (strcmp(root->GetType(), MI_XML_TAG_NEUTRINO)) { - TRACE("not neutrino file. %s", root->GetType()); - delete parser; - return (false); - } - - XMLTreeNode *node = parser->RootNode(); - - for (node = node->GetChild(); node; node = node->GetNext()) { - if (!strcmp(node->GetType(), MI_XML_TAG_RECORD)) { - for (XMLTreeNode * xam1 = node->GetChild(); xam1; xam1 = xam1->GetNext()) { - XML_GET_DATA_STRING(xam1, MI_XML_TAG_CHANNELNAME, movie_info->epgChannel); - XML_GET_DATA_STRING(xam1, MI_XML_TAG_EPGTITLE, movie_info->epgTitle); - XML_GET_DATA_LONG(xam1, MI_XML_TAG_ID, movie_info->epgId); - XML_GET_DATA_STRING(xam1, MI_XML_TAG_INFO1, movie_info->epgInfo1); - XML_GET_DATA_STRING(xam1, MI_XML_TAG_INFO2, movie_info->epgInfo2); - XML_GET_DATA_LONG(xam1, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu - XML_GET_DATA_INT(xam1, MI_XML_TAG_MODE, movie_info->epgMode); //%d - XML_GET_DATA_INT(xam1, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid); //%u - XML_GET_DATA_INT(xam1, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); //%u - if (!strcmp(xam1->GetType(), MI_XML_TAG_AUDIOPIDS)) { - for (XMLTreeNode * xam2 = xam1->GetChild(); xam2; xam2 = xam2->GetNext()) { - if (!strcmp(xam2->GetType(), MI_XML_TAG_AUDIO)) { - EPG_AUDIO_PIDS pids; - pids.epgAudioPid = atoi(xam2->GetAttributeValue(MI_XML_TAG_PID)); - pids.atype = atoi(xam2->GetAttributeValue(MI_XML_TAG_ATYPE)); - pids.selected = atoi(xam2->GetAttributeValue(MI_XML_TAG_SELECTED)); - pids.epgAudioPidName = decodeXmlSpecialChars(xam2->GetAttributeValue(MI_XML_TAG_NAME)); -//printf("MOVIE INFO: apid %d type %d name %s selected %d\n", pids.epgAudioPid, pids.atype, pids.epgAudioPidName.c_str(), pids.selected); - movie_info->audioPids.push_back(pids); - } - } - } - XML_GET_DATA_INT(xam1, MI_XML_TAG_VTXTPID, movie_info->epgVTXPID); //%u - /***************************************************** - * new tags */ - XML_GET_DATA_INT(xam1, MI_XML_TAG_GENRE_MAJOR, movie_info->genreMajor); - XML_GET_DATA_INT(xam1, MI_XML_TAG_GENRE_MINOR, movie_info->genreMinor); - XML_GET_DATA_STRING(xam1, MI_XML_TAG_SERIE_NAME, movie_info->serieName); - XML_GET_DATA_INT(xam1, MI_XML_TAG_LENGTH, movie_info->length); - XML_GET_DATA_STRING(xam1, MI_XML_TAG_PRODUCT_COUNTRY, movie_info->productionCountry); - //if(!strcmp(xam1->GetType(), MI_XML_TAG_PRODUCT_COUNTRY)) if(xam1->GetData() != NULL)strncpy(movie_info->productionCountry, xam1->GetData(),4); - XML_GET_DATA_INT(xam1, MI_XML_TAG_PRODUCT_DATE, movie_info->productionDate); - XML_GET_DATA_INT(xam1, MI_XML_TAG_QUALITIY, movie_info->quality); - XML_GET_DATA_INT(xam1, MI_XML_TAG_QUALITY, movie_info->quality); - XML_GET_DATA_INT(xam1, MI_XML_TAG_PARENTAL_LOCKAGE, movie_info->parentalLockAge); - XML_GET_DATA_INT(xam1, MI_XML_TAG_DATE_OF_LAST_PLAY, movie_info->dateOfLastPlay); - - if (!strcmp(xam1->GetType(), MI_XML_TAG_BOOKMARK)) { - for (XMLTreeNode * xam2 = xam1->GetChild(); xam2; xam2 = xam2->GetNext()) { - XML_GET_DATA_INT(xam2, MI_XML_TAG_BOOKMARK_START, movie_info->bookmarks.start); - XML_GET_DATA_INT(xam2, MI_XML_TAG_BOOKMARK_END, movie_info->bookmarks.end); - XML_GET_DATA_INT(xam2, MI_XML_TAG_BOOKMARK_LAST, movie_info->bookmarks.lastPlayStop); - } - } - /*****************************************************/ - } - } - } - - delete parser; - if (movie_info->epgInfo2.empty()) { - movie_info->epgInfo2 = movie_info->epgInfo1; - //movie_info->epgInfo1 = ""; - } -#endif /* XMLTREE_LIB */ - return (true); -} -#endif -/************************************************************************ - -************************************************************************/ -void CMovieInfo::showMovieInfo(MI_MOVIE_INFO & movie_info) -{ - std::string print_buffer = movie_info.epgInfo1; - print_buffer += "\n"; - if (movie_info.epgInfo1 != movie_info.epgInfo2) { - print_buffer += movie_info.epgInfo2; - print_buffer += "\n"; - } - - if ( !movie_info.productionCountry.empty() || movie_info.productionDate != 0) { - print_buffer += movie_info.productionCountry; - print_buffer += to_string(movie_info.productionDate + 1900); - print_buffer += "\n"; - } - if (!movie_info.serieName.empty()) { - print_buffer += "\n"; - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_SERIE); - print_buffer += ": "; - print_buffer += movie_info.serieName; - print_buffer += "\n"; - } - if (!movie_info.epgChannel.empty()) { - print_buffer += "\n"; - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_CHANNEL); - print_buffer += ": "; - print_buffer += movie_info.epgChannel; - print_buffer += "\n"; - } - if (movie_info.quality != 0) { - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_QUALITY); - print_buffer += ": "; - print_buffer += to_string(movie_info.quality); - print_buffer += "\n"; - } - if (movie_info.parentalLockAge != 0) { - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE); - print_buffer += ": "; - print_buffer += to_string(movie_info.parentalLockAge); - print_buffer += " "; - print_buffer += g_Locale->getText(LOCALE_UNIT_LONG_YEARS); - print_buffer += "\n"; - } - if (movie_info.length != 0) { - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_LENGTH); - print_buffer += ": "; - print_buffer += to_string(movie_info.length); - print_buffer += "\n"; - } - if ( !movie_info.audioPids.empty() ) { - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_AUDIO); - print_buffer += ": "; - for (unsigned int i = 0; i < movie_info.audioPids.size(); i++) { - if (i) - print_buffer += ", "; - print_buffer += movie_info.audioPids[i].epgAudioPidName; - } - print_buffer += "\n"; - } - if (movie_info.genreMajor != 0) - { - neutrino_locale_t locale_genre; - unsigned char i = (movie_info.genreMajor & 0x0F0); - if (i >= 0x010 && i < 0x0B0) - { - i >>= 4; - i--; - locale_genre = genre_sub_classes_list[i][((movie_info.genreMajor & 0x0F) < genre_sub_classes[i]) ? (movie_info.genreMajor & 0x0F) : 0]; - } - else - locale_genre = LOCALE_GENRE_UNKNOWN; - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR); - print_buffer += ": "; - print_buffer += g_Locale->getText(locale_genre); - print_buffer += "\n"; - } - - tm *date_tm = localtime(&movie_info.dateOfLastPlay); - print_buffer += "\n"; - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_PREVPLAYDATE); - print_buffer += ": "; - print_buffer += strftime("%F", date_tm); - print_buffer += "\n"; - - date_tm = localtime(&movie_info.file.Time); - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_RECORDDATE); - print_buffer += ": "; - print_buffer += strftime("%F", date_tm); - print_buffer += "\n"; - - if (movie_info.file.Size != 0) { - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_SIZE); - print_buffer += ": "; - print_buffer += to_string(movie_info.file.Size >> 20); - print_buffer += "\n"; - } - - print_buffer += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_FILE); - print_buffer += ": "; - print_buffer += movie_info.file.Name; - print_buffer += "\n"; - - ShowMsg2UTF(movie_info.epgTitle.empty()? movie_info.file.getFileName().c_str() : movie_info.epgTitle.c_str(), print_buffer.c_str(), CMsgBox::mbrBack, CMsgBox::mbBack); // UTF-8*/ - -} - -/************************************************************************ - -************************************************************************/ -#if 0 -//never used -void CMovieInfo::printDebugMovieInfo(MI_MOVIE_INFO & movie_info) -{ - TRACE(" FileName: %s", movie_info.file.Name.c_str()); - //TRACE(" FilePath: %s", movie_info.file.GetFilePath ); - //TRACE(" FileLength: %d", movie_info.file.GetLength ); - //TRACE(" FileStatus: %d", movie_info.file.GetStatus ); - - TRACE(" ********** Movie Data ***********\r\n"); // (date, month, year) - TRACE(" dateOfLastPlay: \t%d\r\n", (int)movie_info.dateOfLastPlay); // (date, month, year) - TRACE(" dirItNr: \t\t%d\r\n", movie_info.dirItNr); // - TRACE(" genreMajor: \t\t%d\r\n", movie_info.genreMajor); //genreMajor; - TRACE(" genreMinor: \t\t%d\r\n", movie_info.genreMinor); //genreMinor; - TRACE(" length: \t\t%d\r\n", movie_info.length); // (minutes) - TRACE(" quality: \t\t%d\r\n", movie_info.quality); // (3 stars: classics, 2 stars: very good, 1 star: good, 0 stars: OK) - TRACE(" productionCount:\t>%s<\r\n", movie_info.productionCountry.c_str()); - TRACE(" productionDate: \t%d\r\n", movie_info.productionDate); // (Year) years since 1900 - TRACE(" parentalLockAge: \t\t\t%d\r\n", movie_info.parentalLockAge); // MI_PARENTAL_LOCKAGE (0,6,12,16,18) - TRACE(" format: \t\t%d\r\n", movie_info.format); // MI_VIDEO_FORMAT(16:9, 4:3) - TRACE(" audio: \t\t%d\r\n", movie_info.audio); // MI_AUDIO (AC3, Deutsch, Englisch) - TRACE(" epgId: \t\t%d\r\n", (int)movie_info.epgId); - TRACE(" epgEpgId: \t\t%llu\r\n", movie_info.epgEpgId); - TRACE(" epgMode: \t\t%d\r\n", movie_info.epgMode); - TRACE(" epgVideoPid: \t\t%d\r\n", movie_info.epgVideoPid); - TRACE(" epgVTXPID: \t\t%d\r\n", movie_info.epgVTXPID); - TRACE(" Size: \t\t%d\r\n", (int)movie_info.file.Size >> 20); - TRACE(" Date: \t\t%d\r\n", (int)movie_info.file.Time); - - for (unsigned int i = 0; i < movie_info.audioPids.size(); i++) { - TRACE(" audioPid (%d): \t\t%d\r\n", i, movie_info.audioPids[i].epgAudioPid); - TRACE(" audioName(%d): \t\t>%s<\r\n", i, movie_info.audioPids[i].epgAudioPidName.c_str()); - } - - TRACE(" epgTitle: \t\t>%s<\r\n", movie_info.epgTitle.c_str()); - TRACE(" epgInfo1:\t\t>%s<\r\n", movie_info.epgInfo1.c_str()); //epgInfo1 - TRACE(" epgInfo2:\t\t\t>%s<\r\n", movie_info.epgInfo2.c_str()); //epgInfo2 - TRACE(" epgChannel:\t\t>%s<\r\n", movie_info.epgChannel.c_str()); - TRACE(" serieName:\t\t>%s<\r\n", movie_info.serieName.c_str()); // (name e.g. 'StarWars) - - TRACE(" bookmarks start: \t%d\r\n", movie_info.bookmarks.start); - TRACE(" bookmarks end: \t%d\r\n", movie_info.bookmarks.end); - TRACE(" bookmarks lastPlayStop: %d\r\n", movie_info.bookmarks.lastPlayStop); - - for (int i = 0; i < MI_MOVIE_BOOK_USER_MAX; i++) { - if (movie_info.bookmarks.user[i].pos != 0 || i == 0) { - TRACE(" bookmarks user, pos:%d, type:%d, name: >%s<\r\n", movie_info.bookmarks.user[i].pos, movie_info.bookmarks.user[i].length, movie_info.bookmarks.user[i].name.c_str()); - } - } -} -#endif -/************************************************************************ - -************************************************************************/ static int find_next_char(char to_find, const char *text, int start_pos, int end_pos) { while (start_pos < end_pos) { @@ -574,7 +252,7 @@ static int find_next_char(char to_find, const char *text, int start_pos, int end while(_pos_ < bytes && _text_[_pos_] != '<' ) _pos_++;\ _dest_ = "";\ _dest_.append(&_text_[pos_prev],_pos_ - pos_prev );\ - _dest_ = decodeXmlSpecialChars(_dest_);\ + _dest_ = htmlEntityDecode(_dest_);\ _pos_ += sizeof(_tag_);\ continue;\ } @@ -594,65 +272,36 @@ static int find_next_char(char to_find, const char *text, int start_pos, int end _pos_ += sizeof(_tag_) ;\ int pos_prev = _pos_;\ while(_pos_ < bytes && _text_[_pos_] != '<' ) pos++;\ - _dest_ = strtoull(&_text_[pos_prev], NULL, 10); /*atoll(&_text_[pos_prev]);*/\ + _dest_ = strtoull(&_text_[pos_prev], NULL, 10);\ continue;\ } -//void CMovieInfo::strReplace(std::string& orig, const char* fstr, const std::string rstr) -void strReplace(std::string & orig, const char *fstr, const std::string &rstr) +bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) { -// replace all occurrence of fstr with rstr and, and returns a reference to itself - size_t index = 0; - size_t fstrlen = strlen(fstr); - size_t rstrlen = rstr.size(); - - while ((index = orig.find(fstr, index)) != std::string::npos) { - orig.replace(index, fstrlen, rstr); - index += rstrlen; - } -} - -std::string decodeXmlSpecialChars(std::string s) -{ - strReplace(s,"<","<"); - strReplace(s,">",">"); - strReplace(s,"&","&"); - strReplace(s,""","\""); - strReplace(s,"'","\'"); - strReplace(s," ","\n"); - strReplace(s," ","\n"); - return s; -} - - /************************************************************************ -************************************************************************/ -bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info) -{ -#ifndef XMLTREE_LIB int bookmark_nr = 0; - movie_info->dateOfLastPlay = 0; //100*366*24*60*60; // (date, month, year) + movie_info->dateOfLastPlay = 0; //100*366*24*60*60; // (date, month, year) //bool result = false; const char *text = _text.c_str(); int bytes = _text.length(); - /** search ****/ + int pos = 0; - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; while ((pos = find_next_char('<', text, pos, bytes)) != -1) { pos++; - GET_XML_DATA_STRING(text, pos, MI_XML_TAG_CHANNELNAME, movie_info->epgChannel) + GET_XML_DATA_STRING(text, pos, MI_XML_TAG_CHANNELNAME, movie_info->channelName) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_EPGTITLE, movie_info->epgTitle) - GET_XML_DATA_LONG(text, pos, MI_XML_TAG_ID, movie_info->epgId) + GET_XML_DATA_LONG(text, pos, MI_XML_TAG_ID, movie_info->channelId) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO1, movie_info->epgInfo1) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO2, movie_info->epgInfo2) - GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgEpgId) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->epgMode) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid) + GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgId) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->mode) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->VideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) - GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->epgChannel) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_VTXTPID, movie_info->epgVTXPID) + GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->channelName) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_VTXTPID, movie_info->VtxtPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_GENRE_MAJOR, movie_info->genreMajor) GET_XML_DATA_INT(text, pos, MI_XML_TAG_GENRE_MINOR, movie_info->genreMinor) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_SERIE_NAME, movie_info->serieName) @@ -660,6 +309,7 @@ bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info GET_XML_DATA_STRING(text, pos, MI_XML_TAG_PRODUCT_COUNTRY, movie_info->productionCountry) GET_XML_DATA_INT(text, pos, MI_XML_TAG_PRODUCT_DATE, movie_info->productionDate) GET_XML_DATA_INT(text, pos, MI_XML_TAG_PARENTAL_LOCKAGE, movie_info->parentalLockAge) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_RATING, movie_info->rating) GET_XML_DATA_INT(text, pos, MI_XML_TAG_QUALITIY, movie_info->quality) GET_XML_DATA_INT(text, pos, MI_XML_TAG_QUALITY, movie_info->quality) GET_XML_DATA_INT(text, pos, MI_XML_TAG_DATE_OF_LAST_PLAY, movie_info->dateOfLastPlay) @@ -684,9 +334,9 @@ bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info while (text[pos + pos2] != '\"' && text[pos + pos2] != 0 && text[pos + pos2] != '/') pos2++; if (text[pos + pos2] == '\"') - audio_pids.epgAudioPid = atoi(&text[pos + pos2 + 1]); + audio_pids.AudioPid = atoi(&text[pos + pos2 + 1]); } else - audio_pids.epgAudioPid = 0; + audio_pids.AudioPid = 0; audio_pids.atype = 0; pos2 = -1; @@ -716,7 +366,7 @@ bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info audio_pids.selected = atoi(&text[pos + pos2 + 1]); } - audio_pids.epgAudioPidName = ""; + audio_pids.AudioPidName = ""; //pos2 = strcspn(&text[pos],MI_XML_TAG_NAME); pos2 = -1; ptr = strstr(&text[pos], MI_XML_TAG_NAME); @@ -732,20 +382,20 @@ bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info pos3++; if (text[pos + pos3] == '\"') { - audio_pids.epgAudioPidName.append(&text[pos + pos2 + 1], pos3 - pos2 - 1); - audio_pids.epgAudioPidName = decodeXmlSpecialChars(audio_pids.epgAudioPidName); + audio_pids.AudioPidName.append(&text[pos + pos2 + 1], pos3 - pos2 - 1); + audio_pids.AudioPidName = htmlEntityDecode(audio_pids.AudioPidName); } } } - //printf("MOVIE INFO: apid %d type %d name %s selected %d\n", audio_pids.epgAudioPid, audio_pids.atype, audio_pids.epgAudioPidName.c_str(), audio_pids.selected); + //printf("MOVIE INFO: apid %d type %d name %s selected %d\n", audio_pids.AudioPid, audio_pids.atype, audio_pids.AudioPidName.c_str(), audio_pids.selected); movie_info->audioPids.push_back(audio_pids); } /* parse bookmarks */ GET_XML_DATA_INT(text, pos, MI_XML_TAG_BOOKMARK_START, movie_info->bookmarks.start) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_BOOKMARK_END, movie_info->bookmarks.end) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_BOOKMARK_LAST, movie_info->bookmarks.lastPlayStop) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_BOOKMARK_END, movie_info->bookmarks.end) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_BOOKMARK_LAST, movie_info->bookmarks.lastPlayStop) - if (bookmark_nr < MI_MOVIE_BOOK_USER_MAX) { + if (bookmark_nr < MI_MOVIE_BOOK_USER_MAX) { if (strncmp(&text[pos], MI_XML_TAG_BOOKMARK_USER, sizeof(MI_XML_TAG_BOOKMARK_USER) - 1) == 0) { pos += sizeof(MI_XML_TAG_BOOKMARK_USER); //int pos2 = strcspn(&text[pos],MI_XML_TAG_BOOKMARK_USER_POS); @@ -781,7 +431,7 @@ bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info if (text[pos + pos3] == '\"') { movie_info->bookmarks.user[bookmark_nr].name.append(&text[pos + pos2 + 1], pos3 - pos2 - 1); - movie_info->bookmarks.user[bookmark_nr].name = decodeXmlSpecialChars(movie_info->bookmarks.user[bookmark_nr].name); + movie_info->bookmarks.user[bookmark_nr].name = htmlEntityDecode(movie_info->bookmarks.user[bookmark_nr].name); } } } @@ -802,16 +452,13 @@ bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info } return (true); -#endif - return (false); } -/************************************************************************ -************************************************************************/ bool CMovieInfo::addNewBookmark(MI_MOVIE_INFO * movie_info, MI_BOOKMARK & new_bookmark) { - TRACE("[mi] addNewBookmark\r\n"); + TRACE("[mi] addNewBookmark\n"); + bool result = false; if (movie_info != NULL) { // search for free entry @@ -840,9 +487,6 @@ bool CMovieInfo::addNewBookmark(MI_MOVIE_INFO * movie_info, MI_BOOKMARK & new_bo return (result); } -/************************************************************************ - -************************************************************************/ void MI_MOVIE_INFO::clear(void) { @@ -856,34 +500,35 @@ void MI_MOVIE_INFO::clear(void) file.Name = ""; file.Url = ""; - file.Size = 0; // Megabytes + file.Size = 0; // Megabytes file.Time = mktime(&timePlay); - dateOfLastPlay = mktime(&timePlay); // (date, month, year) - dirItNr = 0; // - genreMajor = 0; //genreMajor; - genreMinor = 0; //genreMinor; - length = 0; // (minutes) - quality = 0; // (3 stars: classics, 2 stars: very good, 1 star: good, 0 stars: OK) - productionDate = 0; // (Year) years since 1900 - parentalLockAge = 0; // MI_PARENTAL_LOCKAGE (0,6,12,16,18) -// format = 0; // MI_VIDEO_FORMAT(16:9, 4:3) -// audio = 0; // MI_AUDIO (AC3, Deutsch, Englisch) + dateOfLastPlay = mktime(&timePlay); + dirItNr = 0; + genreMajor = 0; + genreMinor = 0; + length = 0; + rating = 0; + quality = 0; + productionDate = 0; + parentalLockAge = 0; + //format = 0; + //audio = 0; + channelId = 0; epgId = 0; - epgEpgId = 0; - epgMode = 0; - epgVideoPid = 0; + mode = 0; + VideoPid = 0; VideoType = 0; - epgVTXPID = 0; + VtxtPid = 0; audioPids.clear(); productionCountry = ""; epgTitle = ""; - epgInfo1 = ""; //epgInfo1 - epgInfo2 = ""; //epgInfo2 - epgChannel = ""; - serieName = ""; // (name e.g. 'StarWars) + epgInfo1 = ""; + epgInfo2 = ""; + channelName = ""; + serieName = ""; bookmarks.end = 0; bookmarks.start = 0; bookmarks.lastPlayStop = 0; @@ -893,24 +538,23 @@ void MI_MOVIE_INFO::clear(void) bookmarks.user[i].name = ""; } tfile = ""; + ytdate = ""; ytid = ""; ytitag = 0; + marked = false; delAsk = true; } -/************************************************************************ - -************************************************************************/ -bool CMovieInfo::loadFile(CFile & file, std::string &buffer) +bool CMovieInfo::loadFile(CFile &file, std::string &buffer) { bool result = true; int fd = open(file.Name.c_str(), O_RDONLY); - if (fd == -1) // cannot open file, return!!!!! + if (fd == -1) { - TRACE("[mi] loadXml: cannot open (%s)\r\n", file.Name.c_str()); + TRACE("[mi] loadFile: cannot open (%s)\n", file.Name.c_str()); return false; } struct stat st; @@ -920,7 +564,7 @@ bool CMovieInfo::loadFile(CFile & file, std::string &buffer) } char buf[st.st_size]; if (st.st_size != read(fd, buf, st.st_size)) { - TRACE("[mi] loadXml: cannot read (%s)\r\n", file.Name.c_str()); + TRACE("[mi] loadFile: cannot read (%s)\n", file.Name.c_str()); result = false; } else buffer = std::string(buf, st.st_size); @@ -930,22 +574,18 @@ bool CMovieInfo::loadFile(CFile & file, std::string &buffer) return result; } -/************************************************************************ - -************************************************************************/ bool CMovieInfo::saveFile(const CFile & file, std::string &text) { bool result = false; int fd; if ((fd = open(file.Name.c_str(), O_SYNC | O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) >= 0) { - /*int nr=*/ write(fd, text.c_str(), text.size()); //fdatasync(fd); close(fd); result = true; - //TRACE("[mi] saved (%d)\r\n",nr); + //TRACE("[mi] saved (%d)\n",nr); } else { - TRACE("[mi] ERROR: cannot open\r\n"); + TRACE("[mi] ERROR: cannot open\n"); } return (result); } diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index f6d271a69..8ce7e4426 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -1,15 +1,8 @@ -/*************************************************************************** - Neutrino-GUI - DBoxII-Project - - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. +/* + movieinfo - Neutrino-GUI + Copyright (C) 2005 Günther + Copyright (C) 2015 Sven Hoefer (svenhoefer) License: GPL @@ -27,21 +20,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - *********************************************************** - - Module Name: movieinfo.h . - - Description: implementation of the CMovieInfo class - - Date: Nov 2005 - - Author: Günther@tuxbox.berlios.org - - Revision History: - Date Author Change Description - Nov 2005 Günther initial start - -****************************************************************************/ +*/ #ifndef MOVIEINFO_H_ #define MOVIEINFO_H_ @@ -57,135 +36,132 @@ #include #include "driver/file.h" -/************************************************************************/ -/************************************************************************/ -/***************** CMovieInfo ********************************/ -/************************************************************************/ - - /* XML tags for xml file*/ -#define MI_XML_TAG_NEUTRINO "neutrino" -#define MI_XML_TAG_RECORD "record" - -#define MI_XML_TAG_CHANNELNAME "channelname" -#define MI_XML_TAG_EPGTITLE "epgtitle" -#define MI_XML_TAG_ID "id" -#define MI_XML_TAG_INFO1 "info1" -#define MI_XML_TAG_INFO2 "info2" -#define MI_XML_TAG_EPGID "epgid" -#define MI_XML_TAG_MODE "mode" -#define MI_XML_TAG_VIDEOPID "videopid" -#define MI_XML_TAG_VIDEOTYPE "videotype" -#define MI_XML_TAG_AUDIOPIDS "audiopids" -#define MI_XML_TAG_AUDIO "audio" -#define MI_XML_TAG_PID "pid" -#define MI_XML_TAG_NAME "name" -#define MI_XML_TAG_ATYPE "audiotype" -#define MI_XML_TAG_SELECTED "selected" -#define MI_XML_TAG_VTXTPID "vtxtpid" -#define MI_XML_TAG_GENRE_MAJOR "genremajor" -#define MI_XML_TAG_GENRE_MINOR "genreminor" -#define MI_XML_TAG_SERIE_NAME "seriename" -#define MI_XML_TAG_LENGTH "length" -#define MI_XML_TAG_PRODUCT_COUNTRY "productioncountry" -#define MI_XML_TAG_PRODUCT_DATE "productiondate" -#define MI_XML_TAG_QUALITY "quality" -#define MI_XML_TAG_QUALITIY "qualitiy" // just to keep compatibility to older xml-files +#define MI_XML_TAG_NEUTRINO "neutrino" +#define MI_XML_TAG_RECORD "record" +#define MI_XML_TAG_CHANNELNAME "channelname" +#define MI_XML_TAG_EPGTITLE "epgtitle" +#define MI_XML_TAG_ID "id" +#define MI_XML_TAG_INFO1 "info1" +#define MI_XML_TAG_INFO2 "info2" +#define MI_XML_TAG_EPGID "epgid" +#define MI_XML_TAG_MODE "mode" +#define MI_XML_TAG_VIDEOPID "videopid" +#define MI_XML_TAG_VIDEOTYPE "videotype" +#define MI_XML_TAG_AUDIOPIDS "audiopids" +#define MI_XML_TAG_AUDIO "audio" +#define MI_XML_TAG_PID "pid" +#define MI_XML_TAG_NAME "name" +#define MI_XML_TAG_ATYPE "audiotype" +#define MI_XML_TAG_SELECTED "selected" +#define MI_XML_TAG_VTXTPID "vtxtpid" +#define MI_XML_TAG_GENRE_MAJOR "genremajor" +#define MI_XML_TAG_GENRE_MINOR "genreminor" +#define MI_XML_TAG_SERIE_NAME "seriename" +#define MI_XML_TAG_LENGTH "length" +#define MI_XML_TAG_PRODUCT_COUNTRY "productioncountry" +#define MI_XML_TAG_PRODUCT_DATE "productiondate" +#define MI_XML_TAG_RATING "rating" +#define MI_XML_TAG_QUALITY "quality" +#define MI_XML_TAG_QUALITIY "qualitiy" // just to keep compatibility to older xml-files #define MI_XML_TAG_PARENTAL_LOCKAGE "parentallockage" -#define MI_XML_TAG_BOOKMARK "bookmark" +#define MI_XML_TAG_BOOKMARK "bookmark" #define MI_XML_TAG_BOOKMARK_START "bookmarkstart" -#define MI_XML_TAG_BOOKMARK_END "bookmarkend" +#define MI_XML_TAG_BOOKMARK_END "bookmarkend" #define MI_XML_TAG_BOOKMARK_LAST "bookmarklast" #define MI_XML_TAG_BOOKMARK_USER "bookmarkuser" #define MI_XML_TAG_BOOKMARK_USER_POS "bookmarkuserpos" #define MI_XML_TAG_BOOKMARK_USER_TYPE "bookmarkusertype" #define MI_XML_TAG_BOOKMARK_USER_NAME "bookmarkusername" -#define MI_XML_TAG_DATE_OF_LAST_PLAY "dateoflastplay" +#define MI_XML_TAG_DATE_OF_LAST_PLAY "dateoflastplay" - -#define MI_MAX_AUDIO_PIDS 4 // just to avoid the buffer is filled endless, might be increased later on , but 4 audio pids might be enough -#define MI_MOVIE_BOOK_USER_MAX 20 // just to avoid the buffer is filled endless, might be increased later on. Make sure to increase the bookmark menu as well +#define MI_MAX_AUDIO_PIDS 4 // just to avoid the buffer is filled endless, might be increased later on , but 4 audio pids might be enough +#define MI_MOVIE_BOOK_USER_MAX 20 // just to avoid the buffer is filled endless, might be increased later on. Make sure to increase the bookmark menu as well typedef enum { - MI_PARENTAL_OVER0 = 0, - MI_PARENTAL_OVER6 = 6, - MI_PARENTAL_OVER12 = 12, - MI_PARENTAL_OVER16 = 16, - MI_PARENTAL_OVER18 = 18, - MI_PARENTAL_ALWAYS = 99, - MI_PARENTAL_MAX_NUMBER = 100 -}MI_PARENTAL_LOCKAGE; + MI_PARENTAL_OVER0 = 0, + MI_PARENTAL_OVER6 = 6, + MI_PARENTAL_OVER12 = 12, + MI_PARENTAL_OVER16 = 16, + MI_PARENTAL_OVER18 = 18, + MI_PARENTAL_ALWAYS = 99, + MI_PARENTAL_MAX_NUMBER = 100 +} MI_PARENTAL_LOCKAGE; typedef struct { - int pos; // position in seconds from file start - int length; // bookmark type, 0: just a bookmark, < 0 jump back (seconds), > 0 jump forward (seconds) - std::string name; // bookmark name to be displayed -}MI_BOOKMARK; + int pos; // position in seconds from file start + int length; // bookmark type, 0: just a bookmark, < 0 jump back (seconds), > 0 jump forward (seconds) + std::string name; // bookmark name to be displayed +} MI_BOOKMARK; typedef struct { - int start; // movie start in seconds from file start - int end; // movie end in seconds from file start + int start; // movie start in seconds from file start + int end; // movie end in seconds from file start int lastPlayStop; // position of last play stop in seconds from file start MI_BOOKMARK user[MI_MOVIE_BOOK_USER_MAX]; // other user defined bookmarks -}MI_MOVIE_BOOKMARKS; +} MI_MOVIE_BOOKMARKS; typedef struct { int atype; int selected; - int epgAudioPid; // epg audio pid nr, usually filled by VCR - std::string epgAudioPidName; // epg audio pid name, usually filled by VCR -}EPG_AUDIO_PIDS; + int AudioPid; // audio pid nr, usually filled by VCR + std::string AudioPidName; // audio pid name, usually filled by VCR +} AUDIO_PIDS; -/************************************************************************/ -/************************************************************************/ - -class MI_MOVIE_INFO +class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); { - public: - //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); - CFile file; // not stored in xml - std::string productionCountry; // user defined Country (not from EPG yet, but might be possible) - std::string epgTitle; // plain movie name, usually filled by EPG - std::string epgInfo1; // used for Genre (Premiere) or second title, usually filled by EPG - std::string epgInfo2; // detailed movie content, usually filled by EPG - std::string epgChannel; // Channel name, usually filled by EPG - std::string serieName; // user defines series name + public: + CFile file; // not stored in xml + std::string productionCountry; // user defined Country (not from EPG yet, but might be possible) + std::string epgTitle; // plain movie name, usually filled by EPG + std::string epgInfo1; // used for Genre (Premiere) or second title, usually filled by EPG + std::string epgInfo2; // detailed movie content, usually filled by EPG + std::string channelName; // channel name, auto filled + std::string serieName; // user defines series name - time_t dateOfLastPlay; // last play date of movie in seconds since 1970 - int dirItNr; // handle for quick directory path access only, this is not saved in xml, might be used by the owner of the movie info struct - int genreMajor; // see showEPG class for more info, usually filled by EPG - char genreMinor; // genreMinor not used so far - int length; // movie length in minutes, usually filled by EPG - int quality; // user classification (3 stars: classics, 2 stars: very good, 1 star: good, 0 stars: OK) - int productionDate; // user defined Country (not from EPG yet, but might be possible) - int parentalLockAge; // used for age rating(0:never,6,12,16,18 years,99:always), usually filled by EPG (if available) - //char format; // currently not used - //char audio; // currently not used - MI_MOVIE_BOOKMARKS bookmarks; // bookmark collecton for this movie - std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] + time_t dateOfLastPlay; // last play date of movie in seconds since 1970 + int dirItNr; // handle for quick directory path access only, this is not saved in xml, might be used by the owner of the movie info struct + int genreMajor; // see showEPG class for more info, usually filled by EPG + char genreMinor; // genreMinor not used so far + int length; // movie length in minutes, usually filled by EPG + int rating; // user rating (like IMDb rating; 75 means 7.5/10) + int quality; // user classification (3 stars: classics, 2 stars: very good, 1 star: good, 0 stars: OK) + int productionDate; // user defined Country (not from EPG yet, but might be possible) + int parentalLockAge; // used for age rating(0:never,6,12,16,18 years,99:always), usually filled by EPG (if available) + //char format; // currently not used + //char audio; // currently not used + MI_MOVIE_BOOKMARKS bookmarks; // bookmark collecton for this movie + std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] - uint64_t epgId; // currently not used, we just do not want to loose this info if movie info is saved backed - uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed - int epgMode; // currently not used, we just do not want to loose this info if movie info is saved backed - int epgVideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed - int VideoType; - int epgVTXPID; // currently not used, we just do not want to loose this info if movie info is saved backed - bool marked; - bool delAsk; - std::string tfile; // thumbnail/cover file name - std::string ytdate; // yt published - std::string ytid; // yt published - int ytitag; // youtube quality profile + uint64_t channelId; // channel id, auto filled + uint64_t epgId; // EPG id, usually filled by EPG + int mode; // record mode (0: unknown; 1: tv record; 2: radio record) + int VideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed + int VideoType; + int VtxtPid; // currently not used, we just do not want to loose this info if movie info is saved backed - enum miSource { UNKNOWN = 0, YT, NK }; - miSource source; + bool marked; + bool delAsk; - void clear(void); - MI_MOVIE_INFO() { clear(); } + std::string tfile; // thumbnail/cover file name + + std::string ytdate; // youtube published + std::string ytid; // youtube published + int ytitag; // youtube quality profile + + enum miSource { + UNKNOWN = 0, + YT, + NK + }; + miSource source; + + void clear(void); + MI_MOVIE_INFO() { clear(); } }; typedef std::vector MI_MOVIE_LIST; @@ -196,21 +172,16 @@ class CMovieInfo public: // Functions CMovieInfo(); ~CMovieInfo(); - bool convertTs2XmlName(std::string& filename); // convert a ts file name in .xml file name - bool loadMovieInfo(MI_MOVIE_INFO* movie_info, CFile* file = NULL ); // load movie information for the given .xml filename. If there is no filename, the filename (ts) from movie_info is converted to xml and used instead - bool encodeMovieInfoXml(std::string* extMessage, MI_MOVIE_INFO * movie_info); // encode the movie_info structure to xml string - bool saveMovieInfo(MI_MOVIE_INFO& movie_info, CFile* file = NULL ); // encode the movie_info structure to xml and save it to the given .xml filename. If there is no filename, the filename (ts) from movie_info is converted to xml and used instead - void showMovieInfo(MI_MOVIE_INFO& movie_info); // open a Hintbox and show the movie info - void printDebugMovieInfo(MI_MOVIE_INFO& movie_info); // print movie info on debug channel (RS232) - bool addNewBookmark(MI_MOVIE_INFO* movie_info,MI_BOOKMARK &new_bookmark); // add a new bookmark to the given movie info. If there is no space false is returned - - private:// Functions - bool parseXmlTree (std::string &text, MI_MOVIE_INFO* movie_info); // this is the 'good' function, but it needs the xmllib which is not currently linked within neutrino. Might be to slow as well. If used, add bookmark parsing - bool parseXmlQuickFix(std::string &text, MI_MOVIE_INFO* movie_info); // OK, this is very quick an dirty. It does not waste execution time or flash (this is QUICK). But, do not play to much with the xml files (e.g. with MS Notepad) since small changes in the structure could cause the parser to fail (this it DIRTY). - bool loadFile(CFile& file, std::string &buffer); - bool saveFile(const CFile& file, std::string &buffer); - private:// variables + bool convertTs2XmlName(std::string &filename); // convert a ts file name in .xml file name + bool loadMovieInfo(MI_MOVIE_INFO *movie_info, CFile *file = NULL ); // load movie information for the given .xml filename. If there is no filename, the filename (ts) from movie_info is converted to xml and used instead + bool encodeMovieInfoXml(std::string *extMessage, MI_MOVIE_INFO *movie_info); // encode the movie_info structure to xml string + bool saveMovieInfo(MI_MOVIE_INFO &movie_info, CFile *file = NULL ); // encode the movie_info structure to xml and save it to the given .xml filename. If there is no filename, the filename (ts) from movie_info is converted to xml and used instead + bool addNewBookmark(MI_MOVIE_INFO *movie_info, MI_BOOKMARK &new_bookmark); // add a new bookmark to the given movie info. If there is no space false is returned + + private: // Functions + bool parseXmlTree(std::string &text, MI_MOVIE_INFO *movie_info); + bool loadFile(CFile &file, std::string &buffer); + bool saveFile(const CFile &file, std::string &buffer); }; #endif /*MOVIEINFO_H_*/ -// vim:ts=4 diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 82d8707ca..352bbc20b 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -52,6 +53,7 @@ #include #include #include +#include #include #include @@ -61,6 +63,7 @@ #include #include #include +#include #include #include @@ -70,7 +73,9 @@ #include #include #include +#include #include +#include #ifndef HAVE_COOL_HARDWARE #define LCD_MODE CVFD::MODE_MOVIE @@ -80,7 +85,8 @@ extern cVideo * videoDecoder; extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ -extern CInfoClock *InfoClock; + +extern CVolume* g_volume; #define TIMESHIFT_SECONDS 3 #define ISO_MOUNT_POINT "/media/iso" @@ -92,12 +98,13 @@ OpenThreads::Mutex CMoviePlayerGui::bgmutex; OpenThreads::Condition CMoviePlayerGui::cond; pthread_t CMoviePlayerGui::bgThread; cPlayback *CMoviePlayerGui::playback; +bool CMoviePlayerGui::webtv_started; CMovieBrowser* CMoviePlayerGui::moviebrowser; CBookmarkManager * CMoviePlayerGui::bookmarkmanager; CMoviePlayerGui& CMoviePlayerGui::getInstance(bool background) { - OpenThreads::ScopedLock m_lock(bgmutex); + OpenThreads::ScopedLock m_lock(mutex); if (!instance_mp ) { instance_mp = new CMoviePlayerGui(); @@ -205,6 +212,8 @@ void CMoviePlayerGui::Init(void) info_1 = ""; info_2 = ""; filelist_it = filelist.end(); + vzap_it = filelist_it; + fromInfoviewer = false; keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL; isLuaPlay = false; haveLuaInfoFunc = false; @@ -417,23 +426,23 @@ void CMoviePlayerGui::fillPids() if (p_movie_info == NULL) return; - vpid = p_movie_info->epgVideoPid; + vpid = p_movie_info->VideoPid; vtype = p_movie_info->VideoType; numpida = 0; currentapid = 0; /* FIXME: better way to detect TS recording */ if (!p_movie_info->audioPids.empty()) { - currentapid = p_movie_info->audioPids[0].epgAudioPid; + currentapid = p_movie_info->audioPids[0].AudioPid; currentac3 = p_movie_info->audioPids[0].atype; } else if (!vpid) { is_file_player = true; return; } for (int i = 0; i < (int)p_movie_info->audioPids.size(); i++) { - apids[i] = p_movie_info->audioPids[i].epgAudioPid; + apids[i] = p_movie_info->audioPids[i].AudioPid; ac3flags[i] = p_movie_info->audioPids[i].atype; numpida++; if (p_movie_info->audioPids[i].selected) { - currentapid = p_movie_info->audioPids[i].epgAudioPid; + currentapid = p_movie_info->audioPids[i].AudioPid; currentac3 = p_movie_info->audioPids[i].atype; } } @@ -483,7 +492,7 @@ void CMoviePlayerGui::ClearQueue() void CMoviePlayerGui::EnableClockAndMute(bool enable) { CAudioMute::getInstance()->enableMuteIcon(enable); - InfoClock->enableInfoClock(enable); + CInfoClock::getInstance()->enableInfoClock(enable); } void CMoviePlayerGui::makeFilename() @@ -523,9 +532,11 @@ bool CMoviePlayerGui::prepareFile(CFile *file) if (isMovieBrowser) { if (filelist_it != filelist.end()) { unsigned idx = filelist_it - filelist.begin(); - p_movie_info = milist[idx]; - startposition = p_movie_info->bookmarks.start > 0 ? p_movie_info->bookmarks.start*1000 : -1; - printf("CMoviePlayerGui::prepareFile: file %s start %d\n", file_name.c_str(), startposition); + if(milist.size() > idx){ + p_movie_info = milist[idx]; + startposition = p_movie_info->bookmarks.start > 0 ? p_movie_info->bookmarks.start*1000 : -1; + printf("CMoviePlayerGui::prepareFile: file %s start %d\n", file_name.c_str(), startposition); + } } if (isYT) { file_name = file->Url; @@ -553,6 +564,7 @@ bool CMoviePlayerGui::SelectFile() info_2 = ""; pretty_name.clear(); file_name.clear(); + cookie_header.clear(); //reinit Path_local for webif reloadsetup if (g_settings.network_nfs_moviedir.empty()) Path_local = "/"; @@ -592,7 +604,7 @@ bool CMoviePlayerGui::SelectFile() if (moviebrowser->getSelectedFiles(filelist, milist)) { filelist_it = filelist.begin(); p_movie_info = *(milist.begin()); - file = &(*filelist_it); +// file = &(*filelist_it); } else if ((file = moviebrowser->getSelectedFile()) != NULL) { p_movie_info = moviebrowser->getCurrentMovieInfo(); @@ -663,6 +675,9 @@ void *CMoviePlayerGui::ShowStartHint(void *arg) else if (msg != NeutrinoMessages::EVT_WEBTV_ZAP_COMPLETE && msg != CRCInput::RC_timeout && msg > CRCInput::RC_MaxRC) { CNeutrinoApp::getInstance()->handleMsg(msg, data); } + else if ((msg>= CRCInput::RC_WithData) && (msg< CRCInput::RC_WithData+ 0x10000000)) + delete[] (unsigned char*) data; + } if (hintbox != NULL) { hintbox->hide(); @@ -671,13 +686,55 @@ void *CMoviePlayerGui::ShowStartHint(void *arg) return NULL; } +bool CMoviePlayerGui::StartWebtv(void) +{ + printf("%s: starting...\n", __func__);fflush(stdout); + last_read = position = duration = 0; + + cutNeutrino(); + clearSubtitle(); + + playback->Open(is_file_player ? PLAYMODE_FILE : PLAYMODE_TS); + + bool res = playback->Start((char *) file_name.c_str(), cookie_header);//url with cookies + + playback->SetSpeed(1); + if (!res) { + playback->Close(); + } else { + getCurrentAudioName(is_file_player, currentaudioname); + if (is_file_player) + selectAutoLang(); + } + + return res; +} + void* CMoviePlayerGui::bgPlayThread(void *arg) { set_threadname(__func__); CMoviePlayerGui *mp = (CMoviePlayerGui *) arg; + printf("%s: starting... instance %p\n", __func__, mp);fflush(stdout); int eof = 0, pos = 0; - while(true) { + unsigned char *chid = new unsigned char[sizeof(t_channel_id)]; + *(t_channel_id*)chid = mp->movie_info.channelId; + + bool started = mp->StartWebtv(); + printf("%s: started: %d\n", __func__, started);fflush(stdout); + bool chidused = false; + + mutex.lock(); + if (!webtv_started) + started = false; + else if (!started){ + g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_FAILED, (neutrino_msg_data_t) chid); + chidused = true; + } + webtv_started = started; + mutex.unlock(); + + while(webtv_started) { if (mp->playback->GetPosition(mp->position, mp->duration)) { #if 0 printf("CMoviePlayerGui::bgPlayThread: position %d duration %d (%d)\n", mp->position, mp->duration, mp->duration-mp->position); @@ -688,9 +745,8 @@ void* CMoviePlayerGui::bgPlayThread(void *arg) eof = 0; if (eof > 5) { printf("CMoviePlayerGui::bgPlayThread: playback stopped, try to rezap...\n"); - unsigned char *chid = new unsigned char[sizeof(t_channel_id)]; - *(t_channel_id*)chid = mp->movie_info.epgId; g_RCInput->postMsg(NeutrinoMessages::EVT_WEBTV_ZAP_COMPLETE, (neutrino_msg_data_t) chid); + chidused = true; break; } pos = mp->position; @@ -702,14 +758,256 @@ void* CMoviePlayerGui::bgPlayThread(void *arg) break; mp->showSubtitle(0); } - printf("%s: play end...\n", __func__); + printf("%s: play end...\n", __func__);fflush(stdout); mp->PlayFileEnd(); + if(!chidused) + delete [] chid; + pthread_exit(NULL); } -bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::string &name, t_channel_id chan) +bool CMoviePlayerGui::sortStreamList(livestream_info_t info1, livestream_info_t info2) { - printf("%s: starting...\n", __func__); + return (info1.res1 < info2.res1); +} + +bool CMoviePlayerGui::luaGetUrl(const std::string &script, const std::string &file, std::vector &streamList) +{ + CHintBox* box = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_LIVESTREAM_READ_DATA)); + box->paint(); + + std::string result_code = ""; + std::string result_string = ""; + + std::vector args; + args.push_back(file); +#ifdef ENABLE_LUA + CLuaInstance *lua = new CLuaInstance(); + lua->runScript(script.c_str(), &args, &result_code, &result_string); + delete lua; +#endif + if ((result_code != "0") || result_string.empty()) { + if (box != NULL) { + box->hide(); + delete box; + } + return false; + } + + Json::Value root; + Json::Reader reader; + bool parsedSuccess = reader.parse(result_string, root, false); + if (!parsedSuccess) { + printf("Failed to parse JSON\n"); + printf("%s\n", reader.getFormattedErrorMessages().c_str()); + if (box != NULL) { + box->hide(); + delete box; + } + return false; + } + + livestream_info_t info; + std::string tmp; + bool haveurl = false; + if ( !root.isObject() ) { + for (Json::Value::iterator it = root.begin(); it != root.end(); ++it) { + info.url=""; info.name=""; info.header=""; info.bandwidth = 1; info.resolution=""; info.res1 = 1; + tmp = "0"; + Json::Value object_it = *it; + for (Json::Value::iterator iti = object_it.begin(); iti != object_it.end(); iti++) { + std::string name = iti.name(); + if (name=="url") { + info.url = (*iti).asString(); + haveurl = true; + } else if (name=="name") { + info.name = (*iti).asString(); + } + else if (name=="header") { + info.header = (*iti).asString(); + } + else if (name=="band") { + info.bandwidth = atoi((*iti).asString().c_str()); + } else if (name=="res1") { + tmp = (*iti).asString(); + info.res1 = atoi(tmp.c_str()); + } else if (name=="res2") { + info.resolution = tmp + "x" + (*iti).asString(); + } + } + if (haveurl) { + streamList.push_back(info); + } + haveurl = false; + } + } + if (root.isObject()) { + for (Json::Value::iterator it = root.begin(); it != root.end(); ++it) { + info.url=""; info.name=""; info.header=""; info.bandwidth = 1; info.resolution=""; info.res1 = 1; + tmp = "0"; + std::string name = it.name(); + if (name=="url") { + info.url = (*it).asString(); + haveurl = true; + } else if (name=="name") { + info.name = (*it).asString(); + } else if (name=="header") { + info.header = (*it).asString(); + } else if (name=="band") { + info.bandwidth = atoi((*it).asString().c_str()); + } else if (name=="res1") { + tmp = (*it).asString(); + info.res1 = atoi(tmp.c_str()); + } else if (name=="res2") { + info.resolution = tmp + "x" + (*it).asString(); + } + } + if (haveurl) { + streamList.push_back(info); + } + } + /* sort streamlist */ + std::sort(streamList.begin(), streamList.end(), sortStreamList); + + /* remove duplicate resolutions */ + livestream_info_t *_info; + int res_old = 0; + for (size_t i = 0; i < streamList.size(); ++i) { + _info = &(streamList[i]); + if (res_old == _info->res1) + streamList.erase(streamList.begin()+i); + res_old = _info->res1; + } + + if (box != NULL) { + box->hide(); + delete box; + } + + return true; +} + +bool CMoviePlayerGui::selectLivestream(std::vector &streamList, int res, livestream_info_t* info) +{ + livestream_info_t* _info; + int _res = res; + +#if 0 + printf("\n"); + for (size_t i = 0; i < streamList.size(); ++i) { + _info = &(streamList[i]); + printf("%d - _info->res1: %4d, _info->res: %9s, _info->bandwidth: %d\n", i, _info->res1, (_info->resolution).c_str(), _info->bandwidth); + } + printf("\n"); +#endif + + bool resIO = false; + while (1) { + size_t i; + for (i = 0; i < streamList.size(); ++i) { + _info = &(streamList[i]); + if (_info->res1 == _res) { + info->url = _info->url; + info->name = _info->name; + info->header = _info->header; + info->resolution = _info->resolution; + info->res1 = _info->res1; + info->bandwidth = _info->bandwidth; + return true; + } + } + /* Required resolution not found, decreasing resolution */ + for (i = streamList.size(); i > 0; --i) { + _info = &(streamList[i-1]); + if (_info->res1 < _res) { + _res = _info->res1; + resIO = true; + break; + } + } + /* Required resolution not found, increasing resolution */ + if (resIO == false) { + for (i = 0; i < streamList.size(); ++i) { + _info = &(streamList[i]); + if (_info->res1 > _res) { + _res = _info->res1; + break; + } + } + } + } + return false; +} + +bool CMoviePlayerGui::getLiveUrl(const t_channel_id chan, const std::string &url, const std::string &script, std::string &realUrl, std::string &_pretty_name, std::string &info1, std::string &info2, std::string &header) +{ + static t_channel_id oldChan = 0; + static std::vector liveStreamList; + livestream_info_t info; + + if (script.empty()) { + realUrl = url; + return true; + } + std::string _script = script; + + if (_script.find("/") == std::string::npos) + _script = g_settings.livestreamScriptPath + "/" + _script; + + size_t pos = _script.find(".lua"); + if (!file_exists(_script.c_str()) || (pos == std::string::npos) || (_script.length()-pos != 4)) { + liveStreamList.clear(); + printf(">>>>> [%s:%s:%d] script error\n", __file__, __func__, __LINE__); + return false; + } + if ((oldChan != chan) || liveStreamList.empty()) { + liveStreamList.clear(); + if (!luaGetUrl(_script, url, liveStreamList)) { + liveStreamList.clear(); + printf(">>>>> [%s:%s:%d] lua script error\n", __file__, __func__, __LINE__); + return false; + } + oldChan = chan; + } + + if (!selectLivestream(liveStreamList, g_settings.livestreamResolution, &info)) { + liveStreamList.clear(); + printf(">>>>> [%s:%s:%d] error selectLivestream\n", __file__, __func__, __LINE__); + return false; + } + + realUrl = info.url; + if (!info.name.empty()) { + info1 = info.name; + _pretty_name = info.name; + } + if (!info.header.empty()) { + header = info.header; + } + +#if 0 + if (!info.resolution.empty()) + info2 = info.resolution; + if (info.bandwidth > 0) { + char buf[32]; + memset(buf, '\0', sizeof(buf)); + snprintf(buf, sizeof(buf), "%.02f kbps", (float)((float)info.bandwidth/(float)1000)); + info2 += (std::string)", " + (std::string)buf; + } +#else + if (info.bandwidth > 0) { + char buf[32]; + memset(buf, '\0', sizeof(buf)); + snprintf(buf, sizeof(buf), "%.02f kbps", (float)((float)info.bandwidth/(float)1000)); + info2 = (std::string)buf; + } +#endif + return true; +} + +bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::string &name, t_channel_id chan, const std::string &script) +{ + printf("%s: starting...\n", __func__);fflush(stdout); static CZapProtection *zp = NULL; if (zp) return true; @@ -739,7 +1037,12 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st } } - OpenThreads::ScopedLock m_lock(mutex); + std::string realUrl; + std::string _pretty_name = name; + cookie_header.clear(); + if (!getLiveUrl(chan, file, script, realUrl, _pretty_name, livestreamInfo1, livestreamInfo2, cookie_header)) { + return false; + } instance_bg->Cleanup(); instance_bg->ClearFlags(); @@ -748,23 +1051,25 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st instance_bg->isWebTV = true; instance_bg->is_file_player = true; instance_bg->isHTTP = true; - - instance_bg->file_name = file; - instance_bg->pretty_name = name; + instance_bg->file_name = realUrl; + instance_bg->pretty_name = _pretty_name; + instance_bg->cookie_header = cookie_header; instance_bg->movie_info.epgTitle = name; - instance_bg->movie_info.epgChannel = file; - instance_bg->movie_info.epgId = chan; + instance_bg->movie_info.channelName = realUrl; + instance_bg->movie_info.channelId = chan; instance_bg->p_movie_info = &movie_info; - bool res = instance_bg->PlayFileStart(); - if (res) { - if (pthread_create (&bgThread, 0, CMoviePlayerGui::bgPlayThread, instance_bg)) - fprintf(stderr, "ERROR: pthread_create(%s)\n", __func__); - } else - instance_bg->PlayFileEnd(); - printf("%s: this %p started: res %d thread %lx\n", __func__, this, res, bgThread);fflush(stdout); - return res; + stopPlayBack(); + webtv_started = true; + if (pthread_create (&bgThread, 0, CMoviePlayerGui::bgPlayThread, instance_bg)) { + printf("ERROR: pthread_create(%s)\n", __func__); + webtv_started = false; + return false; + } + + printf("%s: this %p started, thread %lx\n", __func__, this, bgThread);fflush(stdout); + return true; } void CMoviePlayerGui::stopPlayBack(void) @@ -775,10 +1080,17 @@ void CMoviePlayerGui::stopPlayBack(void) repeat_mode = REPEAT_OFF; if (bgThread) { printf("%s: this %p join background thread %lx\n", __func__, this, bgThread);fflush(stdout); + mutex.lock(); + webtv_started = false; + if(playback) + playback->RequestAbort(); + mutex.unlock(); cond.broadcast(); pthread_join(bgThread, NULL); bgThread = 0; } + livestreamInfo1.clear(); + livestreamInfo2.clear(); printf("%s: stopped\n", __func__); } @@ -797,9 +1109,7 @@ void CMoviePlayerGui::Pause(bool b) void CMoviePlayerGui::PlayFile(void) { - mutex.lock(); PlayFileStart(); - mutex.unlock(); PlayFileLoop(); bool repeat = (repeat_mode == REPEAT_OFF); if (isLuaPlay) @@ -827,6 +1137,7 @@ bool CMoviePlayerGui::PlayFileStart(void) cutNeutrino(); if (isWebTV) videoDecoder->setBlank(true); + clearSubtitle(); printf("IS FILE PLAYER: %s\n", is_file_player ? "true": "false" ); @@ -840,7 +1151,7 @@ bool CMoviePlayerGui::PlayFileStart(void) } duration = p_movie_info->length * 60 * 1000; - int percent = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, currentapid, currentac3 == 1); + int percent = CZapit::getInstance()->GetPidVolume(p_movie_info->channelId, currentapid, currentac3 == 1); CZapit::getInstance()->SetVolumePercent(percent); } @@ -851,6 +1162,7 @@ bool CMoviePlayerGui::PlayFileStart(void) pthread_create(&thrStartHint, NULL, CMoviePlayerGui::ShowStartHint, this); } bool res = playback->Start((char *) file_name.c_str(), vpid, vtype, currentapid, currentac3, duration); + if (thrStartHint) { showStartingHint = false; pthread_join(thrStartHint, NULL); @@ -869,7 +1181,7 @@ bool CMoviePlayerGui::PlayFileStart(void) int i; int towait = (timeshift == TSHIFT_MODE_ON) ? TIMESHIFT_SECONDS+1 : TIMESHIFT_SECONDS; int cnt = 500; - if (IS_WEBTV(movie_info.epgId)) { + if (IS_WEBTV(movie_info.channelId)) { videoDecoder->setBlank(false); cnt = 200; towait = 20; @@ -929,6 +1241,55 @@ bool CMoviePlayerGui::SetPosition(int pos, bool absolute) return res; } +void CMoviePlayerGui::quickZap(neutrino_msg_t msg) +{ + if ((msg == CRCInput::RC_right) || msg == (neutrino_msg_t) g_settings.key_quickzap_up) + { + //printf("CMoviePlayerGui::%s: CRCInput::RC_right or g_settings.key_quickzap_up\n", __func__); + if (isLuaPlay) + { + playstate = CMoviePlayerGui::STOPPED; + keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NEXT; + ClearQueue(); + } + else if (!filelist.empty()) + { + if (filelist_it < (filelist.end() - 1)) + { + playstate = CMoviePlayerGui::STOPPED; + ++filelist_it; + } + else if (repeat_mode == REPEAT_ALL) + { + playstate = CMoviePlayerGui::STOPPED; + ++filelist_it; + if (filelist_it == filelist.end()) + { + filelist_it = filelist.begin(); + } + } + } + } + else if ((msg == CRCInput::RC_left) || msg == (neutrino_msg_t) g_settings.key_quickzap_down) + { + //printf("CMoviePlayerGui::%s: CRCInput::RC_left or g_settings.key_quickzap_down\n", __func__); + if (isLuaPlay) + { + playstate = CMoviePlayerGui::STOPPED; + keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_PREV; + ClearQueue(); + } + else if (filelist.size() > 1) + { + if (filelist_it != filelist.begin()) + { + playstate = CMoviePlayerGui::STOPPED; + --filelist_it; + } + } + } +} + void CMoviePlayerGui::PlayFileLoop(void) { bool first_start = true; @@ -986,6 +1347,9 @@ void CMoviePlayerGui::PlayFileLoop(void) eof = 0; } handleMovieBrowser(0, position); + if (playstate == CMoviePlayerGui::STOPPED) + at_eof = true; + FileTime.update(position, duration); } showSubtitle(0); @@ -1022,29 +1386,36 @@ void CMoviePlayerGui::PlayFileLoop(void) playstate = CMoviePlayerGui::STOPPED; keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_STOP; ClearQueue(); - } else if (isLuaPlay && (msg == (neutrino_msg_t) CRCInput::RC_right)) { - playstate = CMoviePlayerGui::STOPPED; - keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NEXT; - ClearQueue(); - } else if (isLuaPlay && (msg == (neutrino_msg_t) CRCInput::RC_left)) { - playstate = CMoviePlayerGui::STOPPED; - keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_PREV; - ClearQueue(); - } else if ((!filelist.empty() && msg == (neutrino_msg_t) CRCInput::RC_right)) { - if (filelist_it < (filelist.end() - 1)) { - ++filelist_it; - playstate = CMoviePlayerGui::STOPPED; - } else if (repeat_mode == REPEAT_ALL) { - ++filelist_it; - if (filelist_it == filelist.end()) - filelist_it = filelist.begin(); - playstate = CMoviePlayerGui::STOPPED; - } - } else if (filelist.size() > 1 && msg == (neutrino_msg_t) CRCInput::RC_left) { - if (filelist_it != filelist.begin()) { - playstate = CMoviePlayerGui::STOPPED; - --filelist_it; + } else if (msg == CRCInput::RC_left || msg == CRCInput::RC_right) { + bool reset_vzap_it = true; + switch (g_settings.mode_left_right_key_tv) + { + case SNeutrinoSettings::INFOBAR: + callInfoViewer(); + break; + case SNeutrinoSettings::VZAP: + if (fromInfoviewer) + { + set_vzap_it(msg == CRCInput::RC_right); + reset_vzap_it = false; + fromInfoviewer = false; + } + callInfoViewer(reset_vzap_it); + break; + case SNeutrinoSettings::VOLUME: + g_volume->setVolume(msg); + break; + default: /* SNeutrinoSettings::ZAP */ + quickZap(msg); + break; } + } else if (msg == (neutrino_msg_t) g_settings.key_quickzap_up || msg == (neutrino_msg_t) g_settings.key_quickzap_down) { + quickZap(msg); + } else if (fromInfoviewer && msg == CRCInput::RC_ok && !filelist.empty()) { + printf("CMoviePlayerGui::%s: start playlist movie #%d\n", __func__, (int)(vzap_it - filelist.begin())); + fromInfoviewer = false; + playstate = CMoviePlayerGui::STOPPED; + filelist_it = vzap_it; } else if (timeshift == TSHIFT_MODE_OFF && !isWebTV /* && !isYT */ && (msg == (neutrino_msg_t) g_settings.mpkey_next_repeat_mode)) { repeat_mode = (repeat_mode_enum)((int)repeat_mode + 1); if (repeat_mode > (int) REPEAT_ALL) @@ -1121,9 +1492,12 @@ void CMoviePlayerGui::PlayFileLoop(void) update_lcd = true; } else if (msg == (neutrino_msg_t) g_settings.mpkey_time) { FileTime.switchMode(position, duration); - } else if (/*!is_file_player &&*/ ((msg == (neutrino_msg_t) g_settings.mpkey_rewind) || - (msg == (neutrino_msg_t) g_settings.mpkey_forward))) { - + } else if (msg == (neutrino_msg_t) g_settings.mbkey_cover) { + makeScreenShot(false, true); + } else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { + makeScreenShot(); + } else if ((msg == (neutrino_msg_t) g_settings.mpkey_rewind) || + (msg == (neutrino_msg_t) g_settings.mpkey_forward)) { int newspeed; if (msg == (neutrino_msg_t) g_settings.mpkey_rewind) { newspeed = (speed >= 0) ? -1 : speed - 1; @@ -1185,7 +1559,13 @@ void CMoviePlayerGui::PlayFileLoop(void) SetPosition(1000 * (hh * 3600 + mm * 60 + ss), true); } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { - callInfoViewer(); + if (fromInfoviewer) + { + g_EpgData->show_mp(p_movie_info,GetPosition(),GetDuration()); + fromInfoviewer = false; + } + else + callInfoViewer(); update_lcd = true; clearSubtitle(); } else if (timeshift != TSHIFT_MODE_OFF && (msg == CRCInput::RC_text || msg == CRCInput::RC_epg || msg == NeutrinoMessages::SHOW_EPG)) { @@ -1216,8 +1596,6 @@ void CMoviePlayerGui::PlayFileLoop(void) #endif } else if (msg == NeutrinoMessages::SHOW_EPG) { handleMovieBrowser(NeutrinoMessages::SHOW_EPG, position); - } else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { - makeScreenShot(); } else if (msg == NeutrinoMessages::EVT_SUBT_MESSAGE) { showSubtitle(data); } else if (msg == NeutrinoMessages::ANNOUNCE_RECORD || @@ -1239,10 +1617,8 @@ void CMoviePlayerGui::PlayFileLoop(void) } else if (msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER) { if (playstate == CMoviePlayerGui::PLAY && (position >= 300000 || (duration < 300000 && (position > (duration /2))))) makeScreenShot(true); - } else if (msg == CRCInput::RC_favorites) { - makeScreenShot(false, true); - } else if (msg == CRCInput::RC_sat) { - //FIXME do nothing ? + } else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if (msg == (neutrino_msg_t) CRCInput::RC_setup) { CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::SHOW_MAINMENU, 0); } else if (msg == CRCInput::RC_red || msg == CRCInput::RC_green || msg == CRCInput::RC_yellow || msg == CRCInput::RC_blue ) { @@ -1311,16 +1687,53 @@ void CMoviePlayerGui::PlayFileEnd(bool restore) } } -void CMoviePlayerGui::callInfoViewer() +void CMoviePlayerGui::set_vzap_it(bool up) { + //printf("CMoviePlayerGui::%s: vzap_it: %d count %s\n", __func__, (int)(vzap_it - filelist.begin()), up ? "up" : "down"); + if (up) + { + if (vzap_it < (filelist.end() - 1)) + ++vzap_it; + } + else + { + if (vzap_it > filelist.begin()) + --vzap_it; + } + //printf("CMoviePlayerGui::%s: vzap_it: %d\n", __func__, (int)(vzap_it - filelist.begin())); +} + +void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) +{ + if (init_vzap_it) + { + //printf("CMoviePlayerGui::%s: init_vzap_it\n", __func__); + vzap_it = filelist_it; + } + if (timeshift != TSHIFT_MODE_OFF) { g_InfoViewer->showTitle(CNeutrinoApp::getInstance()->channelList->getActiveChannel()); return; } - if (isMovieBrowser && p_movie_info) { - g_InfoViewer->showMovieTitle(playstate, p_movie_info->epgEpgId >>16, p_movie_info->epgChannel, p_movie_info->epgTitle, p_movie_info->epgInfo1, - duration, position, repeat_mode); + if(duration == 0) + UpdatePosition(); + + if (isMovieBrowser && p_movie_info) + { + MI_MOVIE_INFO *mi; + mi = p_movie_info; + if (!filelist.empty() && g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) + { + if (vzap_it <= filelist.end()) { + unsigned idx = vzap_it - filelist.begin(); + //printf("CMoviePlayerGui::%s: idx: %d\n", __func__, idx); + if(milist.size() > idx) + mi = milist[idx]; + } + } + g_InfoViewer->showMovieTitle(playstate, mi->epgId >>16, mi->channelName, mi->epgTitle, mi->epgInfo1, + duration, position, repeat_mode, init_vzap_it ? 0 /*IV_MODE_DEFAULT*/ : 1 /*IV_MODE_VIRTUAL_ZAP*/); return; } @@ -1334,8 +1747,8 @@ bool CMoviePlayerGui::getAudioName(int apid, std::string &apidtitle) return false; for (int i = 0; i < (int)p_movie_info->audioPids.size(); i++) { - if (p_movie_info->audioPids[i].epgAudioPid == apid && !p_movie_info->audioPids[i].epgAudioPidName.empty()) { - apidtitle = p_movie_info->audioPids[i].epgAudioPidName; + if (p_movie_info->audioPids[i].AudioPid == apid && !p_movie_info->audioPids[i].AudioPidName.empty()) { + apidtitle = p_movie_info->audioPids[i].AudioPidName; return true; } } @@ -1458,15 +1871,15 @@ void CMoviePlayerGui::selectAudioPid() APIDSelector.addItem(item, defpid); } - int percent[numpida]; + int percent[numpida+1]; if (p_movie_info && numpida <= p_movie_info->audioPids.size()) { APIDSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST)); - CVolume::getInstance()->SetCurrentChannel(p_movie_info->epgId); + CVolume::getInstance()->SetCurrentChannel(p_movie_info->channelId); CVolume::getInstance()->SetCurrentPid(currentapid); for (uint i=0; i < numpida; i++) { - percent[i] = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, apids[i], ac3flags[i]); - APIDSelector.addItem(new CMenuOptionNumberChooser(p_movie_info->audioPids[i].epgAudioPidName, + percent[i] = CZapit::getInstance()->GetPidVolume(p_movie_info->channelId, apids[i], ac3flags[i]); + APIDSelector.addItem(new CMenuOptionNumberChooser(p_movie_info->audioPids[i].AudioPidName, &percent[i], currentapid == apids[i], 0, 999, CVolume::getInstance())); } @@ -1687,12 +2100,13 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) #endif const char *unit_short_minute = g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); char play_pos[32]; - snprintf(play_pos, sizeof(play_pos), "%3d %s", p_movie_info->bookmarks.lastPlayStop/60, unit_short_minute); + int lastplaystop = p_movie_info ? p_movie_info->bookmarks.lastPlayStop/60:0; + snprintf(play_pos, sizeof(play_pos), "%3d %s", lastplaystop, unit_short_minute); char start_pos[32] = {0}; - if (p_movie_info->bookmarks.start != 0) + if (p_movie_info && p_movie_info->bookmarks.start != 0) snprintf(start_pos, sizeof(start_pos), "%3d %s", p_movie_info->bookmarks.start/60, unit_short_minute); char end_pos[32] = {0}; - if (p_movie_info->bookmarks.end != 0) + if (p_movie_info && p_movie_info->bookmarks.end != 0) snprintf(end_pos, sizeof(end_pos), "%3d %s", p_movie_info->bookmarks.end/60, unit_short_minute); bookStartMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_BOOK_LASTMOVIESTOP, isMovieBrowser, play_pos, &cSelectedMenuBookStart[1])); @@ -1766,7 +2180,7 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) bool restore = FileTime.IsVisible(); if (restore) FileTime.kill(); - InfoClock->enableInfoClock(false); + CInfoClock::getInstance()->enableInfoClock(false); if (isLuaPlay && haveLuaInfoFunc) { int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; @@ -1776,12 +2190,14 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) yres = 1080; aspectRatio = videoDecoder->getAspectRatio(); } +#ifdef ENABLE_LUA CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); +#endif } else if (p_movie_info) - cMovieInfo.showMovieInfo(*p_movie_info); + g_EpgData->show_mp(p_movie_info, position, duration); - InfoClock->enableInfoClock(true); + CInfoClock::getInstance()->enableInfoClock(true); if (restore) { FileTime.setMode(m_mode); FileTime.update(position, duration); @@ -1891,7 +2307,7 @@ void CMoviePlayerGui::selectSubtitle() if (!numsubs) playback->FindAllSubs(spids, sub_supported, &numsubs, slanguage); - CMenuOptionStringChooser * sc = new CMenuOptionStringChooser(LOCALE_SUBTITLES_CHARSET, &g_settings.subs_charset, true, NULL, CRCInput::RC_red, NULL, true); + CMenuOptionStringChooser * sc = new CMenuOptionStringChooser(LOCALE_SUBTITLES_CHARSET, &g_settings.subs_charset, currentspid == -1, NULL, CRCInput::RC_red, NULL, true); sc->addOption("UTF-8"); sc->addOption("UCS-2"); sc->addOption("CP1250"); @@ -1919,7 +2335,7 @@ void CMoviePlayerGui::selectSubtitle() APIDSelector.addItem(item); } sprintf(cnt, "%d", count); - APIDSelector.addItem(new CMenuForwarder(LOCALE_SUBTITLES_STOP, true, NULL, selector, cnt, CRCInput::RC_stop), currentspid > 0); + APIDSelector.addItem(new CMenuForwarder(LOCALE_SUBTITLES_STOP, currentspid != -1, NULL, selector, cnt, CRCInput::RC_stop), currentspid > 0); APIDSelector.exec(NULL, ""); delete selector; @@ -1928,12 +2344,12 @@ void CMoviePlayerGui::selectSubtitle() currentspid = spids[select]; /* external subtitles pid is 0x1FFF */ ext_subs = (currentspid == 0x1FFF); - playback->SelectSubtitles(currentspid); + playback->SelectSubtitles(currentspid, g_settings.subs_charset); printf("[movieplayer] spid changed to %d\n", currentspid); } else if (select > 0) { ext_subs = false; currentspid = -1; - playback->SelectSubtitles(currentspid); + playback->SelectSubtitles(currentspid, g_settings.subs_charset); printf("[movieplayer] spid changed to %d\n", currentspid); } } @@ -2018,18 +2434,25 @@ void CMoviePlayerGui::showSubtitle(neutrino_msg_data_t data) int xres = 0, yres = 0, framerate; videoDecoder->getPictureInfo(xres, yres, framerate); - double xc = (double) CFrameBuffer::getInstance()->getScreenWidth(/*true*/)/(double) xres; - double yc = (double) CFrameBuffer::getInstance()->getScreenHeight(/*true*/)/(double) yres; + double xc, yc; + if (sub->num_rects && (sub->rects[0]->x + sub->rects[0]->w) <= 720 && + sub->rects[0]->y + sub->rects[0]->h <= 576) { + xc = (double) CFrameBuffer::getInstance()->getScreenWidth(/*true*/)/(double) 720; + yc = (double) CFrameBuffer::getInstance()->getScreenHeight(/*true*/)/(double) 576; + } else { + xc = (double) CFrameBuffer::getInstance()->getScreenWidth(/*true*/)/(double) xres; + yc = (double) CFrameBuffer::getInstance()->getScreenHeight(/*true*/)/(double) yres; + } clearSubtitle(); for (unsigned i = 0; i < sub->num_rects; i++) { uint32_t * colors = (uint32_t *) sub->rects[i]->pict.data[1]; - int nw = (double) sub->rects[i]->w * xc; - int nh = (double) sub->rects[i]->h * yc; int xoff = (double) sub->rects[i]->x * xc; int yoff = (double) sub->rects[i]->y * yc; + int nw = GetWidth4FB_HW_ACC(xoff, (double) sub->rects[i]->w * xc); + int nh = (double) sub->rects[i]->h * yc; printf("Draw: #%d at %d,%d size %dx%d colors %d (x=%d y=%d w=%d h=%d) \n", i+1, sub->rects[i]->x, sub->rects[i]->y, sub->rects[i]->w, sub->rects[i]->h, @@ -2155,12 +2578,14 @@ void CMoviePlayerGui::showSubtitle(neutrino_msg_data_t data) void CMoviePlayerGui::selectAutoLang() { - if (ext_subs) { + if (!numsubs) playback->FindAllSubs(spids, sub_supported, &numsubs, slanguage); + + if (ext_subs) { for (unsigned count = 0; count < numsubs; count++) { if (spids[count] == 0x1FFF) { currentspid = spids[count]; - playback->SelectSubtitles(currentspid); + playback->SelectSubtitles(currentspid, g_settings.subs_charset); } } } @@ -2195,6 +2620,34 @@ void CMoviePlayerGui::selectAutoLang() getCurrentAudioName(is_file_player, currentaudioname); } } + if (isWebTV && g_settings.auto_subs && numsubs > 0) { + for(int i = 0; i < 3; i++) { + if(g_settings.pref_subs[i].empty() || g_settings.pref_subs[i] == "none") + continue; + + std::string temp(g_settings.pref_subs[i]); + std::string slang; + for (int j = 0 ; j < numsubs; j++) { + if (!sub_supported[j]) + continue; + slang = slanguage[j].substr(0, 3); + std::map::const_iterator it; + for(it = iso639.begin(); it != iso639.end(); ++it) { + if(temp == it->second && slang == it->first) { + currentspid = spids[j]; + break; + } + } + if (currentspid > 0) + break; + } + if (currentspid > 0) { + playback->SelectSubtitles(currentspid, g_settings.subs_charset); + printf("[movieplayer] spid changed to %d %s (%s)\n", currentspid, temp.c_str(), slang.c_str()); + break; + } + } + } } void CMoviePlayerGui::parsePlaylist(CFile *file) @@ -2208,12 +2661,13 @@ void CMoviePlayerGui::parsePlaylist(CFile *file) while (infile.good()) { infile.getline(cLine, sizeof(cLine)); - if (cLine[strlen(cLine)-1]=='\r') - cLine[strlen(cLine)-1]=0; + size_t len = strlen(cLine); + if (len > 0 && cLine[len-1]=='\r') + cLine[len-1]=0; int dur; sscanf(cLine, "#EXTINF:%d,%[^\n]\n", &dur, name); - if (strlen(cLine) > 0 && cLine[0]!='#') + if (len > 0 && cLine[0]!='#') { char *url = NULL; if ((url = strstr(cLine, "http://")) || (url = strstr(cLine, "https://")) || (url = strstr(cLine, "rtmp://")) || (url = strstr(cLine, "rtsp://")) || (url = strstr(cLine, "mmsh://")) ) { diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index aa558cc24..cbe1ed10a 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include @@ -85,11 +85,25 @@ class CMoviePlayerGui : public CMenuTarget enum repeat_mode_enum { REPEAT_OFF = 0, REPEAT_TRACK = 1, REPEAT_ALL = 2 }; private: + typedef struct livestream_info_t + { + std::string url; + std::string name; + std::string resolution; + std::string header;//cookie + int res1; + int bandwidth; + } livestream_info_struct_t; + + std::string livestreamInfo1; + std::string livestreamInfo2; + CFrameBuffer * frameBuffer; int m_LastMode; std::string file_name; std::string pretty_name; + std::string cookie_header; std::string info_1, info_2; std::string currentaudioname; bool playing; @@ -153,9 +167,13 @@ class CMoviePlayerGui : public CMenuTarget CFileFilter tsfilefilter; CFileList filelist; CFileList::iterator filelist_it; + CFileList::iterator vzap_it; + void set_vzap_it(bool up); + bool fromInfoviewer; std::string Path_local; int menu_ret; bool autoshot_done; + //std::vector liveStreamList; /* playback from bookmark */ static CBookmarkManager * bookmarkmanager; @@ -165,6 +183,7 @@ class CMoviePlayerGui : public CMenuTarget static OpenThreads::Mutex bgmutex; static OpenThreads::Condition cond; static pthread_t bgThread; + static bool webtv_started; static cPlayback *playback; static CMoviePlayerGui* instance_mp; @@ -176,9 +195,11 @@ class CMoviePlayerGui : public CMenuTarget void PlayFileLoop(); void PlayFileEnd(bool restore = true); void cutNeutrino(); + bool StartWebtv(); + void quickZap(neutrino_msg_t msg); void showHelpTS(void); - void callInfoViewer(); + void callInfoViewer(bool init_vzap_it = true); void fillPids(); bool getAudioName(int pid, std::string &apidtitle); void getCurrentAudioName( bool file_player, std::string &audioname); @@ -203,6 +224,9 @@ class CMoviePlayerGui : public CMenuTarget void EnableClockAndMute(bool enable); static void *ShowStartHint(void *arg); static void* bgPlayThread(void *arg); + static bool sortStreamList(livestream_info_t info1, livestream_info_t info2); + bool selectLivestream(std::vector &streamList, int res, livestream_info_t* info); + bool luaGetUrl(const std::string &script, const std::string &file, std::vector &streamList); CMoviePlayerGui(const CMoviePlayerGui&) {}; CMoviePlayerGui(); @@ -223,7 +247,7 @@ class CMoviePlayerGui : public CMenuTarget int timeshift; int file_prozent; void SetFile(std::string &name, std::string &file, std::string info1="", std::string info2="") { pretty_name = name; file_name = file; info_1 = info1; info_2 = info2; } - bool PlayBackgroundStart(const std::string &file, const std::string &name, t_channel_id chan); + bool PlayBackgroundStart(const std::string &file, const std::string &name, t_channel_id chan, const std::string &script=""); void stopPlayBack(void); void setLastMode(int m) { m_LastMode = m; } void Pause(bool b = true); @@ -236,9 +260,12 @@ class CMoviePlayerGui : public CMenuTarget size_t GetReadCount(); std::string GetFile() { return pretty_name; } void restoreNeutrino(); + void setFromInfoviewer(bool f) { fromInfoviewer = f; }; void setBlockedFromPlugin(bool b) { blockedFromPlugin = b; }; bool getBlockedFromPlugin() { return blockedFromPlugin; }; void setLuaInfoFunc(lua_State* L, bool func) { luaState = L; haveLuaInfoFunc = func; }; + void getLivestreamInfo(std::string *i1, std::string *i2) { *i1=livestreamInfo1; *i2=livestreamInfo2; }; + bool getLiveUrl(const t_channel_id chan, const std::string &url, const std::string &script, std::string &realUrl, std::string &_pretty_name, std::string &info1, std::string &info2, std::string &header); }; #endif diff --git a/src/gui/network_setup.cpp b/src/gui/network_setup.cpp index 87097ae20..717ee4098 100644 --- a/src/gui/network_setup.cpp +++ b/src/gui/network_setup.cpp @@ -725,7 +725,7 @@ void CNetworkSetup::testNetworkSettings() //get www-domain testsite from /.version CConfigFile config('\t'); - config.loadConfig("/.version"); + config.loadConfig(TARGET_PREFIX "/.version"); testsite = config.getString("homepage",defaultsite); testsite.replace( 0, testsite.find("www",0), "" ); diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index f03b16bef..62c89eaa2 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -182,6 +182,16 @@ int COPKGManager::exec(CMenuTarget* parent, const string &actionKey) //show package info... bool is_installed = pkg_vec[selected]->installed; string infostr = getPkgInfo(pkg_vec[selected]->name, "", is_installed /*status or info*/); + + //if available, generate a readable string for installation time + if (is_installed){ + string tstr = getPkgInfo(pkg_vec[selected]->name, "Installed-Time", is_installed); + stringstream sstr(tstr); + time_t tval; sstr >> tval; + string newstr = asctime(localtime(&tval)); + infostr = str_replace(tstr, newstr, infostr); + } + DisplayInfoMessage(infostr.c_str()); return res; } @@ -402,7 +412,7 @@ void COPKGManager::updateMenu() bool upgradesAvailable = false; getPkgData(OM_LIST_INSTALLED); getPkgData(OM_LIST_UPGRADEABLE); - for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); it++) { + for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it) { /* this should no longer trigger at all */ if (badpackage(it->second.name)) continue; @@ -454,7 +464,7 @@ bool COPKGManager::checkUpdates(const std::string & package_name, bool show_prog if (show_progress) status.showStatus(75); - for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); it++){ + for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it){ dprintf(DEBUG_INFO, "[COPKGManager] [%s - %d] Update check for...%s\n", __func__, __LINE__, it->second.name.c_str()); if (show_progress){ /* showing the names only makes things *much* slower... @@ -532,14 +542,14 @@ int COPKGManager::showMenu() fw = new CMenuForwarder(LOCALE_OPKG_INSTALL_LOCAL_PACKAGE, true, NULL, this, "local_package", CRCInput::RC_green); fw->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_OPKG_INSTALL_LOCAL_PACKAGE); menu->addItem(fw); - +#if ENABLE_OPKG_GUI_FEED_SETUP //feed setup CMenuWidget feeds_menu(LOCALE_OPKG_TITLE, NEUTRINO_ICON_UPDATE, w_max (100, 10)); showMenuConfigFeed(&feeds_menu); fw = new CMenuForwarder(LOCALE_OPKG_FEED_ADDRESSES, true, NULL, &feeds_menu, NULL, CRCInput::RC_www); fw->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_OPKG_FEED_ADDRESSES_EDIT); menu->addItem(fw); - +#endif menu->addItem(GenericMenuSeparatorLine); menu_offset = menu->getItemsCount(); @@ -549,7 +559,7 @@ int COPKGManager::showMenu() menu->addKey(CRCInput::RC_yellow, this, "rc_yellow"); pkg_vec.clear(); - for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); it++) { + for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it) { /* this should no longer trigger at all */ if (badpackage(it->second.name)) continue; @@ -607,22 +617,93 @@ int COPKGManager::showMenu() bool COPKGManager::hasOpkgSupport() { - string deps[] = {"/var/lib/opkg", /*"/bin/opkg-check-config", "/bin/update-alternatives", "/share/opkg/intercept"*/}; - if (find_executable(OPKG_CL).empty()) { dprintf(DEBUG_NORMAL, "[COPKGManager] [%s - %d]" OPKG_CL " executable not found\n", __func__, __LINE__); return false; } + +#if 0 + /* If directory /var/lib/opkg resp. /opt/opkg + does not exist, it is created by opkg itself */ + string deps[] = {"/var/lib/opkg", /*"/bin/opkg-check-config", "/bin/update-alternatives", "/share/opkg/intercept"*/}; for(size_t i=0; i::iterator it = pkg_map.begin(); it != pkg_map.end(); it++) + for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it) it->second.installed = false; break; case OM_LIST_UPGRADEABLE: if (list_upgradeable_done) return; list_upgradeable_done = true; - for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); it++) + for (map::iterator it = pkg_map.begin(); it != pkg_map.end(); ++it) it->second.upgradable = false; break; } @@ -670,12 +751,16 @@ void COPKGManager::getPkgData(const int pkg_content_id) continue; switch (pkg_content_id) { - case OM_LIST: + case OM_LIST: { /* do not even put "bad" packages into the list to save memory */ if (badpackage(name)) continue; pkg_map[name] = pkg(name, line, line); + map::iterator it = pkg_map.find(name); + if (it != pkg_map.end()) + it->second.desc = getPkgDescription(name, line); break; + } case OM_LIST_INSTALLED: { map::iterator it = pkg_map.find(name); if (it != pkg_map.end()) @@ -720,8 +805,17 @@ string COPKGManager::getPkgInfo(const string& pkg_name, const string& pkg_key, b execCmd(pkg_types[current_status ? OM_STATUS : OM_INFO] + pkg_name, CShellWindow::QUIET); dprintf(DEBUG_INFO, "[COPKGManager] [%s - %d] [data: %s]\n", __func__, __LINE__, tmp_str.c_str()); - if (pkg_key.empty()) + if (pkg_key.empty()) { + /* When description is empty, read data from InfoDir */ + string tmp = getKeyInfo(tmp_str, "Description:", " "); + if (tmp.empty()) { + tmp = getPkgDescription(pkg_name); + if (!tmp.empty()) { + tmp_str += (string)"\nDescription: " + tmp + "\n"; + } + } return tmp_str; + } return getKeyInfo(tmp_str, pkg_key, ":"); } diff --git a/src/gui/opkg_manager.h b/src/gui/opkg_manager.h index 78cebaa49..a01894c75 100644 --- a/src/gui/opkg_manager.h +++ b/src/gui/opkg_manager.h @@ -46,7 +46,6 @@ class COPKGManager : public CMenuTarget private: int width; std::string tmp_str; - CFrameBuffer *frameBuffer; CConfigFile opkg_conf; void saveConfig(); void loadConfig(); @@ -151,6 +150,9 @@ class COPKGManager : public CMenuTarget int doUpdate(); void handleShellOutput(std::string* cur_line, int* res, bool* ok); + std::string getInfoDir(); + std::string getPkgDescription(std::string pkgName, std::string pkgDesc=""); + struct pkg { std::string name; std::string version; diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 8e1072fb7..616e3e7b8 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -47,6 +47,7 @@ #include "osd_progressbar_setup.h" #include +#include #include #include #include @@ -102,7 +103,7 @@ COsdSetup::~COsdSetup() } //font settings -const SNeutrinoSettings::FONT_TYPES channellist_font_sizes[5] = +const SNeutrinoSettings::FONT_TYPES channellist_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_CHANNELLIST, SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR, @@ -110,8 +111,9 @@ const SNeutrinoSettings::FONT_TYPES channellist_font_sizes[5] = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT, SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP }; +size_t channellist_font_items = sizeof(channellist_font_sizes)/sizeof(channellist_font_sizes[0]); -const SNeutrinoSettings::FONT_TYPES eventlist_font_sizes[5] = +const SNeutrinoSettings::FONT_TYPES eventlist_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE, SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE, @@ -119,52 +121,60 @@ const SNeutrinoSettings::FONT_TYPES eventlist_font_sizes[5] = SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME, SNeutrinoSettings::FONT_TYPE_EVENTLIST_EVENT }; +size_t eventlist_font_items = sizeof(eventlist_font_sizes)/sizeof(eventlist_font_sizes[0]); -const SNeutrinoSettings::FONT_TYPES infobar_font_sizes[4] = +const SNeutrinoSettings::FONT_TYPES infobar_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER, SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME, SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO, SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL }; +size_t infobar_font_items = sizeof(infobar_font_sizes)/sizeof(infobar_font_sizes[0]); -const SNeutrinoSettings::FONT_TYPES epg_font_sizes[4] = +const SNeutrinoSettings::FONT_TYPES epg_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_EPG_TITLE, SNeutrinoSettings::FONT_TYPE_EPG_INFO1, SNeutrinoSettings::FONT_TYPE_EPG_INFO2, SNeutrinoSettings::FONT_TYPE_EPG_DATE }; +size_t epg_font_items = sizeof(epg_font_sizes)/sizeof(epg_font_sizes[0]); -const SNeutrinoSettings::FONT_TYPES menu_font_sizes[4] = +const SNeutrinoSettings::FONT_TYPES menu_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_MENU_TITLE, SNeutrinoSettings::FONT_TYPE_MENU, SNeutrinoSettings::FONT_TYPE_MENU_INFO, + SNeutrinoSettings::FONT_TYPE_MENU_FOOT, SNeutrinoSettings::FONT_TYPE_MENU_HINT }; -const SNeutrinoSettings::FONT_TYPES other_font_sizes[2] = +size_t menu_font_items = sizeof(menu_font_sizes)/sizeof(menu_font_sizes[0]); + +const SNeutrinoSettings::FONT_TYPES other_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_SUBTITLES, SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM }; +size_t other_font_items = sizeof(other_font_sizes)/sizeof(other_font_sizes[0]); -#define FONT_GROUP_COUNT 6 -font_sizes_groups font_sizes_groups[FONT_GROUP_COUNT] = +font_sizes_groups font_sizes_groups[] = { - {LOCALE_FONTMENU_MENU , 4, menu_font_sizes , "fontsize.dmen", LOCALE_MENU_HINT_MENU_FONTS }, - {LOCALE_FONTMENU_CHANNELLIST, 5, channellist_font_sizes, "fontsize.dcha", LOCALE_MENU_HINT_CHANNELLIST_FONTS }, - {LOCALE_FONTMENU_EVENTLIST , 5, eventlist_font_sizes , "fontsize.deve", LOCALE_MENU_HINT_EVENTLIST_FONTS }, - {LOCALE_FONTMENU_EPG , 4, epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS }, - {LOCALE_FONTMENU_INFOBAR , 4, infobar_font_sizes , "fontsize.dinf", LOCALE_MENU_HINT_INFOBAR_FONTS }, - {LOCALE_FONTMENU_OTHER , 2, other_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_OTHER_FONTS } + {LOCALE_FONTMENU_MENU , menu_font_items , menu_font_sizes , "fontsize.dmen", LOCALE_MENU_HINT_MENU_FONTS }, + {LOCALE_FONTMENU_CHANNELLIST, channellist_font_items, channellist_font_sizes, "fontsize.dcha", LOCALE_MENU_HINT_CHANNELLIST_FONTS }, + {LOCALE_FONTMENU_EVENTLIST , eventlist_font_items , eventlist_font_sizes , "fontsize.deve", LOCALE_MENU_HINT_EVENTLIST_FONTS }, + {LOCALE_FONTMENU_EPG , epg_font_items , epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS }, + {LOCALE_FONTMENU_INFOBAR , infobar_font_items , infobar_font_sizes , "fontsize.dinf", LOCALE_MENU_HINT_INFOBAR_FONTS }, + {LOCALE_FONTMENU_OTHER , other_font_items , other_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_OTHER_FONTS } }; +#define FONT_GROUP_COUNT (sizeof(font_sizes_groups)/sizeof(font_sizes_groups[0])) font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] = { {LOCALE_FONTSIZE_MENU , 20, CNeutrinoFonts::FONT_STYLE_BOLD , 0}, {LOCALE_FONTSIZE_MENU_TITLE , 30, CNeutrinoFonts::FONT_STYLE_BOLD , 0}, {LOCALE_FONTSIZE_MENU_INFO , 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, + {LOCALE_FONTSIZE_MENU_FOOT , 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, {LOCALE_FONTSIZE_EPG_TITLE , 25, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, {LOCALE_FONTSIZE_EPG_INFO1 , 17, CNeutrinoFonts::FONT_STYLE_ITALIC , 2}, {LOCALE_FONTSIZE_EPG_INFO2 , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, @@ -276,7 +286,6 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); if ( msg == CRCInput::RC_ok ) { - loop = false; memset(window_size_value, 0, sizeof(window_size_value)); snprintf(window_size_value, sizeof(window_size_value), "%d / %d", g_settings.window_width, g_settings.window_height); mfWindowSize->setOption(window_size_value); @@ -338,7 +347,7 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) return res; } else if(strncmp(actionKey.c_str(), "fontsize.d", 10) == 0) { - for (int i = 0; i < FONT_GROUP_COUNT; i++) { + for (unsigned int i = 0; i < FONT_GROUP_COUNT; i++) { if (actionKey == font_sizes_groups[i].actionkey) { for (unsigned int j = 0; j < font_sizes_groups[i].count; j++) { SNeutrinoSettings::FONT_TYPES k = font_sizes_groups[i].content[j]; @@ -373,14 +382,14 @@ const CMenuOptionChooser::keyval INFOBAR_CASYSTEM_MODE_OPTIONS[INFOBAR_CASYSTEM_ { 2, LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_MINI }, { 3, LOCALE_OPTIONS_OFF }, }; - +#if 0 //not used #define SHOW_INFOMENU_MODE_OPTION_COUNT 2 const CMenuOptionChooser::keyval SHOW_INFOMENU_MODE_OPTIONS[SHOW_INFOMENU_MODE_OPTION_COUNT] = { { 0, LOCALE_MAINMENU_HEAD }, { 1, LOCALE_MAINMENU_SERVICE }, }; - +#endif #define MENU_CORNERSETTINGS_TYPE_OPTION_COUNT 2 const CMenuOptionChooser::keyval MENU_CORNERSETTINGS_TYPE_OPTIONS[MENU_CORNERSETTINGS_TYPE_OPTION_COUNT] = { @@ -450,7 +459,7 @@ const CMenuOptionChooser::keyval CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS[CHANNE { 0 , LOCALE_CHANNELLIST_EPGTEXT_ALIGN_LEFT }, { 1 , LOCALE_CHANNELLIST_EPGTEXT_ALIGN_RIGHT } }; - +#if 0 //not used #define CHANNELLIST_EXTENDED_OPTIONS_COUNT 3 const CMenuOptionChooser::keyval CHANNELLIST_EXTENDED_OPTIONS[CHANNELLIST_EXTENDED_OPTIONS_COUNT]= { @@ -458,7 +467,7 @@ const CMenuOptionChooser::keyval CHANNELLIST_EXTENDED_OPTIONS[CHANNELLIST_EXTEND { 1, LOCALE_CHANNELLIST_EXTENDED_SIMPLE }, //unicolor { 2, LOCALE_CHANNELLIST_EXTENDED_COLORED } //colored }; - +#endif #define OPTIONS_COLORED_EVENTS_OPTION_COUNT 3 const CMenuOptionChooser::keyval OPTIONS_COLORED_EVENTS_OPTIONS[OPTIONS_COLORED_EVENTS_OPTION_COUNT] = { @@ -701,6 +710,10 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors) &t.menu_Content_inactive_alpha, colorSetupNotifier); CColorChooser* chContentInactiveTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.menu_Content_inactive_Text_red, &t.menu_Content_inactive_Text_green, &t.menu_Content_inactive_Text_blue, NULL, colorSetupNotifier); + CColorChooser* chFootcolor = new CColorChooser(LOCALE_COLORMENU_BACKGROUND, &t.menu_Foot_red, &t.menu_Foot_green, &t.menu_Foot_blue, + &t.menu_Foot_alpha, colorSetupNotifier); + CColorChooser* chFootTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.menu_Foot_Text_red, &t.menu_Foot_Text_green, &t.menu_Foot_Text_blue, + NULL, colorSetupNotifier); menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_COLORMENUSETUP_MENUHEAD)); @@ -760,6 +773,17 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors) mf->setHint("", LOCALE_MENU_HINT_SELECTED_TEXT); menu_colors->addItem(mf); + // footer + menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_COLORMENUSETUP_MENUFOOT)); + mf = new CMenuDForwarder(LOCALE_COLORMENU_BACKGROUND, true, NULL, chFootcolor ); + mf->setHint("", LOCALE_MENU_HINT_FOOT_BACK); + menu_colors->addItem(mf); + + // footer text + mf = new CMenuDForwarder(LOCALE_COLORMENU_TEXTCOLOR, true, NULL, chFootTextcolor ); + mf->setHint("", LOCALE_MENU_HINT_FOOT_TEXTCOLOR); + menu_colors->addItem(mf); + // hintbox color gradient menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_COLORTHEMEMENU_MENU_HINTS)); oj = new CMenuOptionChooser(LOCALE_COLOR_GRADIENT, &t.menu_Hint_gradient, OPTIONS_COL_GRADIENT_OPTIONS, OPTIONS_COL_GRADIENT_OPTIONS_COUNT, true); @@ -904,7 +928,8 @@ public: void COsdSetup::AddFontSettingItem(CMenuWidget &font_Settings, const SNeutrinoSettings::FONT_TYPES number_of_fontsize_entry) { - font_Settings.addItem(new CMenuNumberInput(neutrino_font[number_of_fontsize_entry].name, neutrino_font[number_of_fontsize_entry].defaultsize, fontsizenotifier, CNeutrinoApp::getInstance()->getConfigFile())); + CMenuNumberInput *ni = new CMenuNumberInput(neutrino_font[number_of_fontsize_entry].name, neutrino_font[number_of_fontsize_entry].defaultsize, fontsizenotifier, CNeutrinoApp::getInstance()->getConfigFile()); + font_Settings.addItem(ni); } //font settings menu @@ -944,7 +969,7 @@ void COsdSetup::showOsdFontSizeSetup(CMenuWidget *menu_fonts) //fontSettings->addItem( new CMenuForwarder(LOCALE_EPGPLUS_SELECT_FONT_NAME, true, NULL, this, "select_font")); mn_widget_id_t w_index = MN_WIDGET_ID_OSDSETUP_FONTSIZE_MENU; - for (int i = 0; i < FONT_GROUP_COUNT; i++) + for (unsigned int i = 0; i < FONT_GROUP_COUNT; i++) { CMenuWidget *fontSettingsSubMenu = new CMenuWidget(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, w_index); @@ -1020,7 +1045,6 @@ void COsdSetup::showOsdMenusSetup(CMenuWidget *menu_menus) CMenuOptionChooser * mc; submenu_menus->addIntroItems(LOCALE_SETTINGS_MENUS); - // menu position mc = new CMenuOptionChooser(LOCALE_SETTINGS_MENU_POS, &g_settings.menu_pos, MENU_DISP_POS_OPTIONS, MENU_DISP_POS_OPTIONS_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_MENU_POS); @@ -1211,6 +1235,11 @@ void COsdSetup::showOsdEventlistSetup(CMenuWidget *menu_eventlist) mc = new CMenuOptionChooser(LOCALE_EVENTLIST_ADDITIONAL, &g_settings.eventlist_additional, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_EVENTLIST_ADDITIONAL); menu_eventlist->addItem(mc); + + // epgplus in eventlist + mc = new CMenuOptionChooser(LOCALE_EVENTLIST_EPGPLUS, &g_settings.eventlist_epgplus, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_EVENTLIST_EPGPLUS); + menu_eventlist->addItem(mc); } // volume diff --git a/src/gui/personalize.h b/src/gui/personalize.h index 0ffcb24f9..2a92f6f2b 100644 --- a/src/gui/personalize.h +++ b/src/gui/personalize.h @@ -58,7 +58,6 @@ #include #include #include -#include #include class CPlugins; diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index ae6607a40..4648890f9 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -77,7 +77,7 @@ #include #include extern cVideo * videoDecoder; -extern CInfoClock *InfoClock; + //------------------------------------------------------------------------ bool comparePictureByDate (const CPicture& a, const CPicture& b) @@ -163,13 +163,12 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) width = frameBuffer->getScreenWidthRel(); height = frameBuffer->getScreenHeightRel(); - sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); //get footerHeight from paintButtons - buttons1Height = ::paintButtons(0, 0, 0, PictureViewerButtons1Count, PictureViewerButtons1, 0, 0, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 0, false); - buttons2Height = ::paintButtons(0, 0, 0, PictureViewerButtons2Count, PictureViewerButtons2, 0, 0, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 0, false); + buttons1Height = ::paintButtons(0, 0, 0, PictureViewerButtons1Count, PictureViewerButtons1, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); + buttons2Height = ::paintButtons(0, 0, 0, PictureViewerButtons2Count, PictureViewerButtons2, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); footerHeight = buttons1Height + buttons2Height; listmaxshow = (height-theight-footerHeight)/(fheight); @@ -233,6 +232,8 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) // Restore last mode CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , m_LastMode ); + if (m_LastMode == NeutrinoMessages::mode_ts) + videoDecoder->setBlank(false); // always exit all return menu_return::RETURN_REPAINT; @@ -259,7 +260,7 @@ int CPictureViewerGui::show() m_currentTitle = m_audioPlayer->getAudioPlayerM_current(); CAudioMute::getInstance()->enableMuteIcon(false); - InfoClock->enableInfoClock(false); + CInfoClock::getInstance()->enableInfoClock(false); while (loop) { @@ -632,7 +633,8 @@ int CPictureViewerGui::show() loop = false; g_RCInput->postMsg(msg, data); } - else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else { @@ -645,7 +647,7 @@ int CPictureViewerGui::show() hide(); CAudioMute::getInstance()->enableMuteIcon(true); - InfoClock->enableInfoClock(true); + CInfoClock::getInstance()->enableInfoClock(true); return(res); } @@ -667,36 +669,33 @@ void CPictureViewerGui::paintItem(int pos) // printf("paintItem{\n"); int ypos = y+ theight + 0 + pos*fheight; + unsigned int currpos = liststart + pos; + + bool i_selected = currpos == selected; + bool i_marked = false; + bool i_switch = false; //(currpos < playlist.size()) && (pos & 1); + int i_radius = RADIUS_NONE; + fb_pixel_t color; fb_pixel_t bgcolor; - if ((liststart+pos < playlist.size()) && (pos & 1) ) - { - color = COL_MENUCONTENTDARK_TEXT; - bgcolor = COL_MENUCONTENTDARK_PLUS_0; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } + getItemColors(color, bgcolor, i_selected, i_marked, i_switch); - if (liststart+pos == selected) - { - frameBuffer->paintBoxRel(x,ypos, width-15, fheight, bgcolor); - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } + if (i_selected || i_marked) + i_radius = RADIUS_LARGE; - frameBuffer->paintBoxRel(x, ypos, width-15, fheight, bgcolor, liststart+pos == selected ? RADIUS_LARGE : 0); - if (liststart+pospaintBoxRel(x, ypos, width - 15, fheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width - 15, fheight, bgcolor, i_radius); + + if (currpos < playlist.size()) { - std::string tmp = playlist[liststart+pos].Name; + std::string tmp = playlist[currpos].Name; tmp += " ("; - tmp += playlist[liststart+pos].Type; + tmp += playlist[currpos].Type; tmp += ')'; char timestring[18]; - strftime(timestring, 18, "%d-%m-%Y %H:%M", gmtime(&playlist[liststart+pos].Date)); + strftime(timestring, 18, "%d-%m-%Y %H:%M", gmtime(&playlist[currpos].Date)); int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(timestring); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+fheight, width-30 - w, tmp, color, fheight); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+width-20-w,ypos+fheight, w, timestring, color, fheight); @@ -727,7 +726,7 @@ void CPictureViewerGui::paintFoot() else PictureViewerButtons2[0].locale = LOCALE_PICTUREVIEWER_SORTORDER_DATE; - frameBuffer->paintBoxRel(x, y + (height - footerHeight), width, footerHeight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x, y + (height - footerHeight), width, footerHeight, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); if (!playlist.empty()) { @@ -758,14 +757,17 @@ void CPictureViewerGui::paint() int ypos = y+ theight; int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); - int sbc= ((playlist.size()- 1)/ listmaxshow)+ 1; - int sbs= (selected/listmaxshow); + unsigned int tmp_max = listmaxshow; + if(!tmp_max) + tmp_max = 1; + int sbc= ((playlist.size()- 1)/ tmp_max)+ 1; + int sbs= (selected/tmp_max); if (sbc < 1) sbc = 1; - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); + frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); paintFoot(); paintInfo(); diff --git a/src/gui/pictureviewer.h b/src/gui/pictureviewer.h index 500635b0c..2d5410148 100644 --- a/src/gui/pictureviewer.h +++ b/src/gui/pictureviewer.h @@ -76,7 +76,6 @@ class CPictureViewerGui : public CMenuTarget unsigned int listmaxshow; int fheight; // Fonthoehe Playlist-Inhalt int theight; // Fonthoehe Playlist-Titel - int sheight; // Fonthoehe MP Info int footerHeight; int buttons1Height; int buttons2Height; diff --git a/src/gui/pictureviewer_setup.cpp b/src/gui/pictureviewer_setup.cpp index 052299c39..a00de31e5 100644 --- a/src/gui/pictureviewer_setup.cpp +++ b/src/gui/pictureviewer_setup.cpp @@ -72,7 +72,6 @@ int CPictureViewerSetup::exec(CMenuTarget* parent, const std::string &actionKey) if(actionKey == "picturedir") { - parent->hide(); CFileBrowser b; b.Dir_Mode=true; if (b.exec(g_settings.network_nfs_picturedir.c_str())) diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index 37d5a8e84..61c7b1652 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -343,11 +343,11 @@ PluginParam * CPlugins::makeParam(const char * const id, const int value, Plugin } #endif -void CPlugins::startPlugin_by_name(const std::string & filename) +void CPlugins::startPlugin_by_name(const std::string & name) { for (int i = 0; i < (int) plugin_list.size(); i++) { - if (!filename.compare(g_PluginList->getFileName(i))) + if (name.compare(g_PluginList->getName(i)) == 0) { startPlugin(i); return; @@ -355,13 +355,13 @@ void CPlugins::startPlugin_by_name(const std::string & filename) } } -void CPlugins::startPlugin(const char * const name) +void CPlugins::startPlugin(const char * const filename) { - int pluginnr = find_plugin(name); + int pluginnr = find_plugin(filename); if (pluginnr > -1) startPlugin(pluginnr); else - printf("[CPlugins] could not find %s\n", name); + printf("[CPlugins] could not find %s\n", filename); } @@ -420,9 +420,11 @@ void CPlugins::startLuaPlugin(int number) script, plugin_list[number].cfgfile.c_str()); return; } +#ifdef ENABLE_LUA CLuaInstance *lua = new CLuaInstance(); lua->runScript(script); delete lua; +#endif #if 0 frameBuffer->ClearFB(); #endif diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 3e9a1b095..89a5c714d 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -147,7 +147,7 @@ int CRecordSetup::exec(CMenuTarget* parent, const std::string &actionKey) return res; } - +#if 0 //not used #define RECORDINGMENU_RECORDING_TYPE_OPTION_COUNT 4 const CMenuOptionChooser::keyval RECORDINGMENU_RECORDING_TYPE_OPTIONS[RECORDINGMENU_RECORDING_TYPE_OPTION_COUNT] = { @@ -157,7 +157,6 @@ const CMenuOptionChooser::keyval RECORDINGMENU_RECORDING_TYPE_OPTIONS[RECORDINGM { CNeutrinoApp::RECORDING_FILE , LOCALE_RECORDINGMENU_FILE } }; -#if 0 //not used #define CHOOSE_DIRECT_REC_DIR_COUNT 3 const CMenuOptionChooser::keyval CHOOSE_DIRECT_REC_DIR[RECORDINGMENU_RECORDING_TYPE_OPTION_COUNT] = { @@ -235,6 +234,11 @@ int CRecordSetup::showRecordSetup() end_of_recording->setHint("", LOCALE_MENU_HINT_RECORD_END); recordingSettings->addItem(end_of_recording); + // already_found + CMenuOptionChooser* already_found = new CMenuOptionChooser(LOCALE_RECORDINGMENU_ALREADY_FOUND_CHECK, &g_settings.recording_already_found_check, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + already_found->setHint("", LOCALE_MENU_HINT_RECORD_ALREADY_FOUND_CHECK); + recordingSettings->addItem(already_found); + if (!g_settings.easymenu) { CMenuOptionChooser* slow_warn = new CMenuOptionChooser(LOCALE_RECORDINGMENU_SLOW_WARN, &g_settings.recording_slow_warning, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); slow_warn->setHint("", LOCALE_MENU_HINT_RECORD_SLOW_WARN); diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 03cb5afa3..daf43cb2d 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -50,8 +50,6 @@ #include #include -#include - #include #include #include @@ -215,7 +213,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) //printf("[neutrino] scan_mode %d TP_freq %s TP_rate %s TP_fec %d TP_pol %d\n", scansettings.scan_mode, scansettings.TP_freq, scansettings.TP_rate, scansettings.TP_fec, scansettings.TP_pol); if(manual) { - CZapit::getInstance()->scanPids(true); + CZapit::getInstance()->scanPids(scan_pids); if(scansettings.scan_nit_manual) scan_flags |= CServiceScan::SCAN_NIT; TP.scan_mode = scan_flags; diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 4e6592de0..516d873b9 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -2020,6 +2020,7 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &actionkey) std::string text = "No transponders found for "; text += name; ShowHint(LOCALE_MESSAGEBOX_ERROR, text.c_str(), 450, 2); + delete selector; return menu_return::RETURN_REPAINT; } diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 05c7396e5..5082fec27 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -40,6 +40,7 @@ #include "audiomute.h" #include "screensaver.h" #include +#include #include #include @@ -269,7 +270,7 @@ void CScreenSaver::paint() } else{ if (!scr_clock){ - scr_clock = new CComponentsFrmClock(1, 1, NULL, "%H.%M:%S", "%H.%M %S", true); + scr_clock = new CComponentsFrmClock(1, 1, NULL, "%H:%M:%S", "%H:%M %S", true); scr_clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]); scr_clock->disableSaveBg(); scr_clock->doPaintBg(false); diff --git a/src/gui/screensetup.cpp b/src/gui/screensetup.cpp index 447f1102e..9b446f0cd 100644 --- a/src/gui/screensetup.cpp +++ b/src/gui/screensetup.cpp @@ -209,12 +209,12 @@ int CScreenSetup::exec(CMenuTarget* parent, const std::string &) } break; } - case CRCInput::RC_favorites: - case CRCInput::RC_sat: - break; - default: - if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) + if (CNeutrinoApp::getInstance()->listModeKey(msg)) + { + break; + } + else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { loop = false; res = menu_return::RETURN_EXIT_ALL; diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 90e4c420d..9829f396c 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -37,13 +37,14 @@ #include #include +#include #include #include #include #include #include +#include #include -#include #include #include #include @@ -59,7 +60,7 @@ extern cAudio * audioDecoder; extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ -CStreamInfo2::CStreamInfo2 () +CStreamInfo2::CStreamInfo2() : fader(g_settings.theme.menu_Content_alpha) { frameBuffer = CFrameBuffer::getInstance (); pip = NULL; @@ -125,9 +126,11 @@ int CStreamInfo2::exec (CMenuTarget * parent, const std::string &) frontend = CFEManager::getInstance()->getLiveFE(); + fader.StartFadeIn(); paint (paint_mode); int res = doSignalStrengthLoop (); hide (); + fader.StopFade(); return res; } @@ -137,7 +140,9 @@ int CStreamInfo2::doSignalStrengthLoop () #define BAR_HEIGHT 12 int res = menu_return::RETURN_REPAINT; + bool fadeout = false; neutrino_msg_t msg; + neutrino_msg_t postmsg = 0; uint64_t maxb, minb, lastb, tmp_rate; unsigned int current_pmt_version = (unsigned int)-1; int cnt = 0; @@ -222,6 +227,27 @@ int CStreamInfo2::doSignalStrengthLoop () /* rate limiting is done in update_rate */ g_RCInput->getMsg_us(&msg, &data, 0); + if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) + { + if (fader.FadeDone()) + { + break; + } + continue; + } + if (fadeout && msg == CRCInput::RC_timeout) + { + if (fader.StartFadeOut()) + { + msg = 0; + continue; + } + else + { + break; + } + } + // switch paint mode if (msg == CRCInput::RC_red || msg == CRCInput::RC_blue || msg == CRCInput::RC_green || msg == CRCInput::RC_yellow) { hide (); @@ -231,12 +257,12 @@ int CStreamInfo2::doSignalStrengthLoop () } else if(msg == CRCInput::RC_setup) { res = menu_return::RETURN_EXIT_ALL; - break; + fadeout = true; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { - g_RCInput->postMsg (msg, 0); + else if(CNeutrinoApp::getInstance()->listModeKey(msg)) { + postmsg = msg; res = menu_return::RETURN_EXIT_ALL; - break; + fadeout = true; } else if (msg == (neutrino_msg_t) g_settings.key_screenshot) { CNeutrinoApp::getInstance ()->handleMsg (msg, data); @@ -245,7 +271,7 @@ int CStreamInfo2::doSignalStrengthLoop () // -- any key --> abort if (msg <= CRCInput::RC_MaxRC) - break; + fadeout = true; // -- push other events if (msg > CRCInput::RC_MaxRC && msg != CRCInput::RC_timeout) @@ -254,6 +280,12 @@ int CStreamInfo2::doSignalStrengthLoop () delete signalbox; signalbox = NULL; ts_close (); + + if (postmsg) + { + g_RCInput->postMsg(postmsg, 0); + } + return res; } diff --git a/src/gui/streaminfo2.h b/src/gui/streaminfo2.h index f0808e9d1..ca7019659 100644 --- a/src/gui/streaminfo2.h +++ b/src/gui/streaminfo2.h @@ -31,6 +31,7 @@ #include +class COSDFader; class CStreamInfo2 : public CMenuTarget { private: @@ -39,6 +40,7 @@ class CStreamInfo2 : public CMenuTarget CFrontend *frontend; CComponentsPIP * pip; CMoviePlayerGui *mp; + COSDFader fader; int x; int y; int width; diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 75ea0777e..225fcdf2a 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -39,7 +39,7 @@ #include #include #include - +#include #include #include @@ -110,7 +110,7 @@ CTestMenu::~CTestMenu() delete scrollbar; } -static int test_pos[4] = { 130, 192, 282, 360 }; +//static int test_pos[4] = { 130, 192, 282, 360 }; int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) { @@ -138,13 +138,12 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) CVFD::getInstance()->ShowIcon((fp_icon) 0x09000002, true); CVFD::getInstance()->ShowIcon((fp_icon) 0x0B000002, true); char text[255]; - char buf[XML_UTF8_ENCODE_MAX]; int ch = 0x2588; - int len = XmlUtf8Encode(ch, buf); - + std::string tmp = Unicode_Character_to_UTF8(ch); + size_t len = tmp.size(); for (int i = 0; i < 12; i++) { - memmove(&text[i*len], buf, len); + memmove(&text[i*len], tmp.c_str(), len); } text[12*len] = 0; @@ -556,7 +555,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) if (footer == NULL){ footer = new CComponentsFooter (100, 30, 1000, hh, CComponentsFooter::CC_BTN_HELP | CComponentsFooter::CC_BTN_EXIT | CComponentsFooter::CC_BTN_MENU |CComponentsFooter::CC_BTN_MUTE_ZAP_ACTIVE, NULL, true); //int start = 5, btnw =90, btnh = 37; - footer->setButtonFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]); + footer->setButtonFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]); footer->setIcon(NEUTRINO_ICON_INFO); //add button labels with conventional button label struct @@ -685,7 +684,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) if (clock_r == NULL){ clock_r = new CComponentsFrmClock(100, 50, NULL, "%H.%M:%S", NULL, true); clock_r->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]); - clock_r->setClockIntervall(1); + clock_r->setClockInterval(1); // clock_r->doPaintBg(false); } diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index 78a2cc972..0582f0ad4 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -150,6 +150,8 @@ int CThemes::Show() std::string file_name = ""; CMenuWidget themes (LOCALE_COLORMENU_MENUCOLORS, NEUTRINO_ICON_SETTINGS, width); + sigc::slot0 slot_repaint = sigc::mem_fun(themes, &CMenuWidget::hide); //we want to clean screen before repaint after changed Option + themes.OnBeforePaint.connect(slot_repaint); themes.addIntroItems(LOCALE_COLORTHEMEMENU_HEAD2); @@ -274,6 +276,14 @@ void CThemes::setTheme(CConfigFile &configfile) configfile.setInt32( "menu_Content_inactive_Text_red", t.menu_Content_inactive_Text_red ); configfile.setInt32( "menu_Content_inactive_Text_green", t.menu_Content_inactive_Text_green ); configfile.setInt32( "menu_Content_inactive_Text_blue", t.menu_Content_inactive_Text_blue ); + configfile.setInt32( "menu_Foot_alpha", t.menu_Foot_alpha ); + configfile.setInt32( "menu_Foot_red", t.menu_Foot_red ); + configfile.setInt32( "menu_Foot_green", t.menu_Foot_green ); + configfile.setInt32( "menu_Foot_blue", t.menu_Foot_blue ); + configfile.setInt32( "menu_Foot_Text_alpha", t.menu_Foot_Text_alpha ); + configfile.setInt32( "menu_Foot_Text_red", t.menu_Foot_Text_red ); + configfile.setInt32( "menu_Foot_Text_green", t.menu_Foot_Text_green ); + configfile.setInt32( "menu_Foot_Text_blue", t.menu_Foot_Text_blue ); configfile.setInt32( "menu_Hint_gradient" , t.menu_Hint_gradient); configfile.setInt32( "menu_Hint_gradient_direction" , t.menu_Hint_gradient_direction); @@ -363,6 +373,12 @@ void CThemes::getTheme(CConfigFile &configfile) t.infobar_green = configfile.getInt32( "infobar_green", 0x0e ); t.infobar_blue = configfile.getInt32( "infobar_blue", 0x23 ); + //t.menu_Foot default historically depends on t.infobar + t.menu_Foot_alpha = configfile.getInt32( "menu_Foot_alpha", t.infobar_alpha ); + t.menu_Foot_red = configfile.getInt32( "menu_Foot_red", int(t.infobar_red*0.4)+14 ); + t.menu_Foot_green = configfile.getInt32( "menu_Foot_green", int(t.infobar_green*0.4)+14 ); + t.menu_Foot_blue = configfile.getInt32( "menu_Foot_blue", int(t.infobar_blue*0.4)+14 ); + t.infobar_gradient_top = configfile.getInt32( "infobar_gradient_top", CC_COLGRAD_OFF ); t.infobar_gradient_top_direction = configfile.getInt32( "infobar_gradient_top_direction", CFrameBuffer::gradientVertical ); t.infobar_gradient_body = configfile.getInt32( "infobar_gradient_body", CC_COLGRAD_OFF); @@ -379,6 +395,12 @@ void CThemes::getTheme(CConfigFile &configfile) t.infobar_Text_green = configfile.getInt32( "infobar_Text_green", 0x64 ); t.infobar_Text_blue = configfile.getInt32( "infobar_Text_blue", 0x64 ); + //t.menu_Foot_Text default historically depends on t.infobar_Text + t.menu_Foot_Text_alpha = configfile.getInt32( "menu_Foot_Text_alpha", 0x00 ); + t.menu_Foot_Text_red = configfile.getInt32( "menu_Foot_Text_red", int(t.infobar_Text_red*0.6) ); + t.menu_Foot_Text_green = configfile.getInt32( "menu_Foot_Text_green", int(t.infobar_Text_green*0.6) ); + t.menu_Foot_Text_blue = configfile.getInt32( "menu_Foot_Text_blue", int(t.infobar_Text_blue*0.6) ); + t.colored_events_alpha = configfile.getInt32( "colored_events_alpha", 0x00 ); t.colored_events_red = configfile.getInt32( "colored_events_red", 95 ); t.colored_events_green = configfile.getInt32( "colored_events_green", 70 ); diff --git a/src/gui/timeosd.cpp b/src/gui/timeosd.cpp index dd62f3659..8d631319e 100644 --- a/src/gui/timeosd.cpp +++ b/src/gui/timeosd.cpp @@ -36,7 +36,7 @@ #include "screensaver.h" -CTimeOSD::CTimeOSD():CComponentsFrmClock( 1, 1, NULL, "%H:%M:%S", NULL, false, 1, NULL, CC_SHADOW_ON, COL_LIGHT_GRAY, COL_MENUCONTENT_PLUS_0,COL_MENUCONTENTDARK_PLUS_0) +CTimeOSD::CTimeOSD():CComponentsFrmClock( 1, 1, NULL, "%H:%M:%S", NULL, false, 1, NULL, CC_SHADOW_ON) { Init(); } @@ -48,7 +48,7 @@ void CTimeOSD::Init() m_mode = MODE_HIDE; //use current theme colors - setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENT_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); + setColorAll(COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); //set text color if (paint_bg){ @@ -100,7 +100,7 @@ void CTimeOSD::show(time_t time_show, bool force) return; m_time_show = time_show; - setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENT_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); //use current theme colors + setColorAll(COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); //use current theme colors paint_bg = true; if (g_settings.infoClockBackground) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index a0a5faac4..346363342 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -3,6 +3,8 @@ Timerliste by Zwen (C) 2009, 2011-2014 Stefan Seyfried + Remote Timers by + (C) 2016 TangoCash Homepage: http://dbox.cyberphoria.org/ @@ -67,6 +69,9 @@ #include #include #include +#include + +#include #include #include @@ -249,6 +254,15 @@ public: } }; +std::string string_printf_helper(const char *fmt, ...) { + va_list arglist; + const int bufferlen = 4*1024; + char buffer[bufferlen] = {0}; + va_start(arglist, fmt); + vsnprintf(buffer, bufferlen, fmt, arglist); + va_end(arglist); + return std::string(buffer); +} CTimerList::CTimerList() { @@ -279,6 +293,42 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) { const char * key = actionKey.c_str(); + if(actionKey == "add_ip") { + std::string remoteip; + CIPInput remotebox_NetworkIP(LOCALE_REMOTEBOX_IP , &remoteip); + if (remotebox_NetworkIP.exec(NULL,"") == true) { + remboxmenu->addItem(new CMenuForwarder(remoteip, true, NULL, this, "cha_ip")); + remotebox_NetworkIP.hide(); + changed = true; + } + return menu_return::RETURN_REPAINT; + } + + if(actionKey == "del_ip") { + bselected = remboxmenu->getSelected(); + if (bselected >= item_offset) { + remboxmenu->removeItem(bselected); + remboxmenu->hide(); + bselected = remboxmenu->getSelected(); + changed = true; + } + return menu_return::RETURN_REPAINT; + } + + if(actionKey == "cha_ip") { + bselected = remboxmenu->getSelected(); + CMenuItem* item = remboxmenu->getItem(bselected); + CMenuForwarder *f = static_cast(item); + std::string remoteip = f->getName(); + CIPInput remotebox_NetworkIP(LOCALE_REMOTEBOX_IP , &remoteip); + if (remotebox_NetworkIP.exec(NULL,"") == true) { + f->setName(remoteip); + remotebox_NetworkIP.hide(); + changed = true; + } + return menu_return::RETURN_REPAINT; + } + if (strcmp(key, "modifytimer") == 0) { timerlist[selected].announceTime = timerlist[selected].alarmTime -60; @@ -297,6 +347,23 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) timerlist[selected].alarmTime, timerlist[selected].stopTime, timerlist[selected].eventRepeat, timerlist[selected].repeatCount,timerlist[selected].recordingDir); + } else if (timerlist[selected].eventType == CTimerd::TIMER_REMOTEBOX) + { + CHTTPTool httpTool; + std::string r_url; + r_url = "http://"; + r_url += timerlist[selected].remotebox_ip; + r_url += "/control/timer?action=new&update=1"; + r_url += "&alarm=" + to_string((int)timerlist[selected].alarmTime); + r_url += "&stop=" + to_string((int)timerlist[selected].stopTime); + r_url += "&announce=" + to_string((int)timerlist[selected].announceTime); + r_url += "&channel_id=" + string_printf_helper(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timerlist[selected].channel_id); + r_url += "&aj=on"; + r_url += "&rs=on"; + r_url += "&id=" + to_string((int)timerlist[selected].eventID); + //printf("[remotetimer] url:%s\n",r_url.c_str()); + r_url = httpTool.downloadString(r_url); + //printf("[remotetimer] status:%s\n",r_url.c_str()); } else { Timer->modifyTimerEvent(timerlist[selected].eventID, timerlist[selected].announceTime, @@ -306,6 +373,73 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) } return menu_return::RETURN_EXIT; } + else if ((strcmp(key, "send_remotetimer") == 0) && remoteChanExists(timerlist[selected].channel_id)) + { + CHTTPTool httpTool; + std::string r_url; + r_url = "http://"; + r_url += timerlist[selected].remotebox_ip; + r_url += "/control/timer?action=new"; + r_url += "&alarm=" + to_string((int)timerlist[selected].alarmTime + timerlist[selected].rem_pre); + r_url += "&stop=" + to_string((int)timerlist[selected].stopTime - timerlist[selected].rem_post); + r_url += "&announce=" + to_string((int)timerlist[selected].announceTime); + r_url += "&channel_id=" + string_printf_helper(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timerlist[selected].channel_id); + r_url += "&aj=on"; + r_url += "&rs=on"; + //printf("[remotetimer] url:%s\n",r_url.c_str()); + r_url = httpTool.downloadString(r_url); + //printf("[remotetimer] status:%s\n",r_url.c_str()); + if (r_url=="ok") + Timer->removeTimerEvent(timerlist[selected].eventID); + } + else if ((strcmp(key, "fetch_remotetimer") == 0) && localChanExists(timerlist[selected].channel_id)) + { + CHTTPTool httpTool; + std::string r_url; + r_url = "http://"; + r_url += timerlist[selected].remotebox_ip; + r_url += "/control/timer?action=remove"; + r_url += "&id=" + to_string((int)timerlist[selected].eventID); + //printf("[remotetimer] url:%s\n",r_url.c_str()); + r_url = httpTool.downloadString(r_url); + //printf("[remotetimer] status:%s\n",r_url.c_str()); + if (r_url=="ok") { + int pre,post; + Timer->getRecordingSafety(pre,post); + Timer->addRecordTimerEvent(timerlist[selected].channel_id, timerlist[selected].alarmTime + pre, + timerlist[selected].stopTime - post, 0, 0, timerlist[selected].announceTime, + TIMERD_APIDS_CONF, true, timerlist[selected].announceTime > time(NULL)); + } + } + else if (strcmp(key, "del_remotetimer") == 0) + { + CHTTPTool httpTool; + std::string r_url; + r_url = "http://"; + r_url += timerlist[selected].remotebox_ip; + r_url += "/control/timer?action=remove"; + r_url += "&id=" + to_string((int)timerlist[selected].eventID); + //printf("[remotetimer] url:%s\n",r_url.c_str()); + r_url = httpTool.downloadString(r_url); + //printf("[remotetimer] status:%s\n",r_url.c_str()); + } + else if (strcmp(key, "update_remotetimer") == 0) + { + CHTTPTool httpTool; + std::string r_url; + r_url = "http://"; + r_url += timerlist[selected].remotebox_ip; + r_url += "/control/timer?action=new&update=1"; + r_url += "&alarm=" + to_string((int)timerlist[selected].alarmTime); + r_url += "&stop=" + to_string((int)timerlist[selected].stopTime); + r_url += "&announce=" + to_string((int)timerlist[selected].announceTime); + r_url += "&channel_id=" + string_printf_helper(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timerlist[selected].channel_id); + r_url += "&aj=on"; + r_url += "&rs=on"; + //printf("[remotetimer] url:%s\n",r_url.c_str()); + r_url = httpTool.downloadString(r_url); + //printf("[remotetimer] status:%s\n",r_url.c_str()); + } else if (strcmp(key, "newtimer") == 0) { timerNew.announceTime=timerNew.alarmTime-60; @@ -316,6 +450,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) eventinfo.channel_id=timerNew.channel_id; eventinfo.apids = TIMERD_APIDS_CONF; eventinfo.recordingSafety = false; + eventinfo.autoAdjustToEPG = false; timerNew.standby_on = (timerNew_standby_on == 1); void *data=NULL; if (timerNew.eventType == CTimerd::TIMER_STANDBY) @@ -333,6 +468,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) recinfo.channel_id=timerNew.channel_id; recinfo.apids=TIMERD_APIDS_CONF; recinfo.recordingSafety = false; + recinfo.autoAdjustToEPG = false; // FIXME -- add GUI option? timerNew.announceTime-= 120; // 2 more mins for rec timer strncpy(recinfo.recordingDir,timerNew.recordingDir,sizeof(recinfo.recordingDir)-1); @@ -382,7 +518,8 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) return menu_return::RETURN_EXIT; } else if(actionKey == "rec_dir1") { - parent->hide(); + if (parent) + parent->hide(); const char *action_str = "RecDir1"; if(chooserDir(timerlist[selected].recordingDir, true, action_str, sizeof(timerlist[selected].recordingDir)-1)) { printf("[timerlist] new %s dir %s\n", action_str, timerlist[selected].recordingDir); @@ -391,7 +528,8 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) return menu_return::RETURN_REPAINT; } else if(actionKey == "rec_dir2") { - parent->hide(); + if (parent) + parent->hide(); const char *action_str = "RecDir2"; if(chooserDir(timerNew.recordingDir, true, action_str, sizeof(timerNew.recordingDir)-1)) { printf("[timerlist] new %s dir %s\n", action_str, timerNew.recordingDir); @@ -425,20 +563,30 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) }*/ } -#define TimerListButtonsCount 5 -struct button_label TimerListButtons[TimerListButtonsCount] = +struct button_label TimerListButtons[] = { { NEUTRINO_ICON_BUTTON_RED , LOCALE_TIMERLIST_DELETE }, { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_TIMERLIST_NEW }, { NEUTRINO_ICON_BUTTON_YELLOW , LOCALE_TIMERLIST_RELOAD }, { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_TIMERLIST_MODIFY }, - { NEUTRINO_ICON_BUTTON_INFO_SMALL, NONEXISTANT_LOCALE } + { NEUTRINO_ICON_BUTTON_INFO_SMALL, NONEXISTANT_LOCALE }, + { NEUTRINO_ICON_BUTTON_MENU_SMALL, NONEXISTANT_LOCALE }, + { NEUTRINO_ICON_BUTTON_PLAY , NONEXISTANT_LOCALE } +}; +size_t TimerListButtonsCount = sizeof(TimerListButtons)/sizeof(TimerListButtons[0]); + +#define RemoteBoxFooterButtonCount 3 +static const struct button_label RemoteBoxFooterButtons[RemoteBoxFooterButtonCount] = { + { NEUTRINO_ICON_BUTTON_RED, LOCALE_REMOTEBOX_DEL }, + { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_REMOTEBOX_ADD }, + { NEUTRINO_ICON_BUTTON_OKAY, LOCALE_REMOTEBOX_MOD } }; void CTimerList::updateEvents(void) { timerlist.clear(); Timer->getTimerList (timerlist); + remoteTimerList (timerlist); sort(timerlist.begin(), timerlist.end()); theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); @@ -446,7 +594,8 @@ void CTimerList::updateEvents(void) //get footerHeight from paintButtons footerHeight = ::paintButtons(TimerListButtons, TimerListButtonsCount, 0, 0, 0, 0, 0, false); - width = w_max(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth()*56, 20); + //width = w_max(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth()*56, 20); + width = frameBuffer->getScreenWidth()*0.9; height = frameBuffer->getScreenHeight() - (2*theight); // max height listmaxshow = (height-theight)/(fheight*2); @@ -468,6 +617,129 @@ void CTimerList::updateEvents(void) y = getScreenStartY(height); } +void CTimerList::select_remotebox_ip() +{ + if (g_settings.timer_remotebox_ip.size() == 1) { + std::list::iterator it = g_settings.timer_remotebox_ip.begin(); + strncpy(timerlist[selected].remotebox_ip,it->c_str(),sizeof(timerlist[selected].remotebox_ip)); + timerlist[selected].remotebox_ip[sizeof(timerlist[selected].remotebox_ip) - 1] = 0; + } + + int select = 0; + CMenuWidget *m = new CMenuWidget(LOCALE_REMOTEBOX_HEAD, NEUTRINO_ICON_TIMER); + CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); + + for (std::list::iterator it = g_settings.timer_remotebox_ip.begin(); it != g_settings.timer_remotebox_ip.end(); ++it) + m->addItem(new CMenuForwarder(*it, true, NULL, selector, to_string(std::distance(g_settings.timer_remotebox_ip.begin(),it)).c_str())); + + m->exec(NULL, ""); + + delete selector; + + std::list::iterator it = g_settings.timer_remotebox_ip.begin(); + std::advance(it,select); + strncpy(timerlist[selected].remotebox_ip,it->c_str(),sizeof(timerlist[selected].remotebox_ip)); + timerlist[selected].remotebox_ip[sizeof(timerlist[selected].remotebox_ip) - 1] = 0; +} + +bool CTimerList::remoteChanExists(t_channel_id channel_id) +{ + CHTTPTool httpTool; + std::string r_url; + r_url = "http://"; + r_url += timerlist[selected].remotebox_ip; + r_url += "/control/getchannel?format=json&id="; + r_url += string_printf_helper(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id); + r_url = httpTool.downloadString(r_url); + + Json::Value root; + Json::Reader reader; + bool parsedSuccess = reader.parse(r_url, root, false); + if (!parsedSuccess) { + printf("Failed to parse JSON\n"); + printf("%s\n", reader.getFormattedErrorMessages().c_str()); + } + + r_url = root.get("success","false").asString(); + + if (r_url == "false") + ShowMsg(LOCALE_REMOTEBOX_CHANNEL_NA, convertChannelId2String(channel_id), + CMessageBox::mbrOk, CMessageBox::mbOk, NULL, 450, 30, false); + + return (r_url == "true"); +} + +bool CTimerList::localChanExists(t_channel_id channel_id) +{ + CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); + if (channel) + return true; + else + return false; +} + +void CTimerList::remoteTimerList(CTimerd::TimerList &rtimerlist) +{ + if (g_settings.timer_remotebox_ip.size() == 0) + return; + + CHTTPTool httpTool; + std::string r_url; + for (std::list::iterator it = g_settings.timer_remotebox_ip.begin(); + it != g_settings.timer_remotebox_ip.end(); ++it) { + r_url = "http://"; + r_url += *it; + r_url += "/control/timer?format=json"; + r_url = httpTool.downloadString(r_url); + //printf("[remotetimer] timers:%s\n",r_url.c_str()); + + Json::Value root; + Json::Reader reader; + bool parsedSuccess = reader.parse(r_url, root, false); + if (!parsedSuccess) { + printf("Failed to parse JSON\n"); + printf("%s\n", reader.getFormattedErrorMessages().c_str()); + } + Json::Value delays = root["data"]["timer"][0]; + + rem_pre = atoi(delays["config"].get("pre_delay","0").asString()); + rem_post = atoi(delays["config"].get("post_delay","0").asString()); + + //printf("[remotetimer] pre:%d - post:%d\n", rem_pre, rem_post); + + Json::Value remotetimers = root["data"]["timer"][0]["timer_list"]; + + for (unsigned int i= 0; ic_str(),sizeof(rtimer.remotebox_ip)); + rtimer.remotebox_ip[sizeof(rtimer.remotebox_ip) - 1] = 0; + rtimer.rem_pre = rem_pre; + rtimer.rem_post = rem_post; + rtimer.eventID = atoi(remotetimers[i].get("id","").asString()); + rtimer.eventType = CTimerd::TIMER_REMOTEBOX; + rtimer.eventState = (CTimerd::CTimerEventStates) atoi(remotetimers[i].get("state","").asString()); + if ( remotetimers[i]["repeat"].get("count","").asString() == "-") + rtimer.repeatCount = 0; + else + rtimer.repeatCount = atoi(remotetimers[i]["repeat"].get("count","").asString()); + rtimer.eventRepeat = (CTimerd::CTimerEventRepeat)(atoi(remotetimers[i]["repeat"].get("number","").asString()) & 0x1FF); + std::string wd = remotetimers[i]["repeat"].get("weekdays","").asString(); + CTimerdClient().getWeekdaysFromStr(&rtimer.eventRepeat, wd); + rtimer.alarmTime = (time_t) atoll(remotetimers[i]["alarm"][0].get("digits","").asString().c_str()); + rtimer.announceTime = (time_t) atoll(remotetimers[i]["announce"][0].get("digits","").asString().c_str()); + rtimer.stopTime = (time_t) atoll(remotetimers[i]["stop"][0].get("digits","").asString().c_str()); + rtimer.epgID = (event_id_t) atoi(remotetimers[i].get("epg_id","").asString()); + sscanf(remotetimers[i].get("channel_id","").asString().c_str(), SCANF_CHANNEL_ID_TYPE, &rtimer.channel_id); + strncpy(rtimer.epgTitle,remotetimers[i].get("title","").asString().c_str(),51); + if (remotetimers[i]["audio"].get("apids_conf","").asString() == "true") + rtimer.apids = TIMERD_APIDS_CONF; + //printf("[remotetimer] r-timer:%s - %s\n", remotetimers[i].get("channel_id","").asString().c_str(), remotetimers[i].get("title","").asString().c_str()); + rtimerlist.push_back(rtimer); + } + } + } +} int CTimerList::show() { @@ -547,8 +819,36 @@ int CTimerList::show() else update=true; } + else if ((msg == CRCInput::RC_play) && !(timerlist.empty()) && (g_settings.timer_remotebox_ip.size() > 0)) + { + if (timerlist[selected].eventType == CTimerd::TIMER_RECORD ) { + select_remotebox_ip(); + if (exec(this,"send_remotetimer")) + { + res=menu_return::RETURN_EXIT_ALL; + loop=false; + } + else + update=true; + } else if (timerlist[selected].eventType == CTimerd::TIMER_REMOTEBOX ) { + if (exec(this,"fetch_remotetimer")) + { + res=menu_return::RETURN_EXIT_ALL; + loop=false; + } + else + update=true; + } + } else if ((msg == CRCInput::RC_red) && !(timerlist.empty())) { + if ((timerlist[selected].eventType == CTimerd::TIMER_REMOTEBOX) && (timerlist[selected].eventState < CTimerd::TIMERSTATE_ISRUNNING)) { + if (exec(this,"del_remotetimer")) + { + res=menu_return::RETURN_EXIT_ALL; + loop=false; + } + } else { bool killTimer = true; if (CRecordManager::getInstance()->RecordingStatus(timerlist[selected].channel_id)) { CTimerd::RecordingStopInfo recinfo; @@ -571,10 +871,11 @@ int CTimerList::show() } } if (killTimer) { - Timer->removeTimerEvent(timerlist[selected].eventID); + Timer->removeTimerEvent(timerlist[selected].eventID); update = true; } } + } else if (msg==CRCInput::RC_green) { if (newTimer()==menu_return::RETURN_EXIT_ALL) @@ -585,6 +886,11 @@ int CTimerList::show() else update=true; } + else if (msg==CRCInput::RC_setup) + { + enterRemoteBox(); + update=true; + } else if (msg==CRCInput::RC_yellow) { update=true; @@ -598,17 +904,12 @@ int CTimerList::show() loop=false; } #endif - else if (msg==CRCInput::RC_setup) - { - res=menu_return::RETURN_EXIT_ALL; - loop=false; - } else if ( msg == CRCInput::RC_help || msg == CRCInput::RC_info) { CTimerd::responseGetTimer* timer=&timerlist[selected]; if (timer!=NULL) { - if (timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_ZAPTO) + if (timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_REMOTEBOX || timer->eventType == CTimerd::TIMER_ZAPTO) { hide(); if (timer->epgID != 0) @@ -621,9 +922,8 @@ int CTimerList::show() paint(); } } - // help key } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); loop = false; res = menu_return::RETURN_EXIT_ALL; @@ -647,45 +947,74 @@ void CTimerList::hide() { if (visible) { - frameBuffer->paintBackgroundBoxRel(x, y, width + SHADOW_OFFSET, height + SHADOW_OFFSET); + frameBuffer->paintBackgroundBoxRel(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW); visible = false; } } +void CTimerList::enterRemoteBox() +{ + remboxmenu = new CMenuWidget(LOCALE_REMOTEBOX_HEAD, NEUTRINO_ICON_TIMER); + remboxmenu->addKey(CRCInput::RC_red, this, "del_ip"); + remboxmenu->addKey(CRCInput::RC_green, this, "add_ip"); + + remboxmenu->addIntroItems(); + + item_offset = remboxmenu->getItemsCount(); + for (std::list::iterator it = g_settings.timer_remotebox_ip.begin(); + it != g_settings.timer_remotebox_ip.end(); ++it) + remboxmenu->addItem(new CMenuForwarder(*it, true, NULL, this, "cha_ip")); + + remboxmenu->setFooter(RemoteBoxFooterButtons, RemoteBoxFooterButtonCount); + + remboxmenu->exec(NULL, ""); + remboxmenu->hide(); + if (changed) { + g_settings.timer_remotebox_ip.clear(); + for (int i = item_offset; i < remboxmenu->getItemsCount(); i++) { + CMenuItem *item = remboxmenu->getItem(i); + CMenuForwarder *f = static_cast(item); + g_settings.timer_remotebox_ip.push_back(f->getName()); + } + changed = false; + } + delete remboxmenu; +} + void CTimerList::paintItem(int pos) { int ypos = y+ theight+ pos*fheight*2; - fb_pixel_t color; - fb_pixel_t bgcolor; - int real_width=width; if (timerlist.size() > listmaxshow) { real_width-=15; //scrollbar } - color = COL_MENUCONTENT_TEXT; - if (pos & 1) - bgcolor = COL_MENUCONTENT_PLUS_1; - else - bgcolor = COL_MENUCONTENT_PLUS_0; + unsigned int currpos = liststart + pos; + + bool i_selected = currpos == (unsigned) selected; + bool i_marked = false; + bool i_switch = false; //pos & 1; + int i_radius = RADIUS_NONE; + + fb_pixel_t color; + fb_pixel_t bgcolor; + + getItemColors(color, bgcolor, i_selected, i_marked, i_switch); + + if (i_selected || i_marked) + i_radius = RADIUS_LARGE; + + if (i_radius) + frameBuffer->paintBoxRel(x, ypos, real_width, 2*fheight, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, real_width, 2*fheight, bgcolor, i_radius); //shadow - frameBuffer->paintBoxRel(x + width, ypos, SHADOW_OFFSET, 2*fheight, COL_MENUCONTENTDARK_PLUS_0); - //item - frameBuffer->paintBoxRel(x, ypos, real_width, 2*fheight, bgcolor); + frameBuffer->paintBoxRel(x + width, ypos, OFFSET_SHADOW, 2*fheight, COL_SHADOW_PLUS_0); - if (liststart + pos == selected) + if (currpos < timerlist.size()) { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - //selected item - frameBuffer->paintBoxRel(x,ypos, real_width, 2*fheight, bgcolor, RADIUS_MID); - - if (liststart + pos < (int)timerlist.size()) - { - CTimerd::responseGetTimer & timer = timerlist[liststart+pos]; + CTimerd::responseGetTimer & timer = timerlist[currpos]; char zAlarmTime[25] = {0}; struct tm *alarmTime = localtime(&(timer.alarmTime)); strftime(zAlarmTime,20,"%d.%m. %H:%M",alarmTime); @@ -711,7 +1040,8 @@ void CTimerList::paintItem(int pos) sprintf(srepeatcount,"%ux",timer.repeatCount); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*23)/2,ypos+fheight, (real_width-fw*13)/2-5, srepeatcount, color, fheight); } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*13)/2,ypos+fheight, (real_width-fw*13)/2-5, convertTimerType2String(timer.eventType), color, fheight); + std::string t_type = (timer.eventType == CTimerd::TIMER_REMOTEBOX) ? std::string(convertTimerType2String(timer.eventType)) + " (" + std::string(timer.remotebox_ip) + ")" : convertTimerType2String(timer.eventType); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*13)/2,ypos+fheight, (real_width-fw*13)/2-5, t_type, color, fheight); // paint rec icon when recording in progress if ((timer.eventType == CTimerd::TIMER_RECORD) && (CRecordManager::getInstance()->RecordingStatus(timer.channel_id))) { @@ -727,6 +1057,14 @@ void CTimerList::paintItem(int pos) } } + if ((timer.eventType == CTimerd::TIMER_REMOTEBOX) && timer.eventState == CTimerd::TIMERSTATE_ISRUNNING) { + int icol_w, icol_h; + frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icol_w, &icol_h); + if ((icol_w > 0) && (icol_h > 0)) { + frameBuffer->paintIcon(NEUTRINO_ICON_REC, (x + real_width) - (icol_w + 8), ypos, 2*fheight); + } + } + std::string zAddData(""); switch (timer.eventType) { @@ -779,6 +1117,57 @@ void CTimerList::paintItem(int pos) } } break; + case CTimerd::TIMER_REMOTEBOX : + { + CHTTPTool httpTool; + std::string r_url; + r_url = "http://"; + r_url += std::string(timer.remotebox_ip); + r_url += "/control/getchannel?format=json&id="; + r_url += string_printf_helper(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timer.channel_id); + r_url = httpTool.downloadString(r_url); + + Json::Value root; + Json::Reader reader; + bool parsedSuccess = reader.parse(r_url, root, false); + if (!parsedSuccess) { + printf("Failed to parse JSON\n"); + printf("%s\n", reader.getFormattedErrorMessages().c_str()); + } + + Json::Value remotechannel = root["data"]["channel"][0]; + + zAddData = remotechannel.get("name","").asString(); + if (timer.apids != TIMERD_APIDS_CONF) + { + std::string sep = ""; + zAddData += " ("; + if (timer.apids & TIMERD_APIDS_STD) + { + zAddData += "STD"; + sep = "/"; + } + if (timer.apids & TIMERD_APIDS_ALT) + { + zAddData += sep; + zAddData += "ALT"; + sep = "/"; + } + if (timer.apids & TIMERD_APIDS_AC3) + { + zAddData += sep; + zAddData += "AC3"; +// sep = "/"; + } + zAddData += ')'; + } + if (strlen(timer.epgTitle)!=0) + { + zAddData += " : "; + zAddData += timer.epgTitle; + } + } + break; case CTimerd::TIMER_STANDBY: { zAddData = g_Locale->getText(timer.standby_on ? LOCALE_TIMERLIST_STANDBY_ON : LOCALE_TIMERLIST_STANDBY_OFF); @@ -799,7 +1188,7 @@ void CTimerList::paintItem(int pos) } g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13,ypos+2*fheight, real_width-(fw*13+5), zAddData, color, fheight); // LCD Display - if (liststart+pos==selected) + if (currpos == (unsigned) selected) { std::string line1 = convertTimerType2String(timer.eventType); // UTF-8 //std::string line2 = zAlarmTime; @@ -845,14 +1234,14 @@ void CTimerList::paintFoot() if (timer != NULL) { //replace info button with dummy if timer is not type REC or ZAP - if (timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_ZAPTO) + if (timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_REMOTEBOX || timer->eventType == CTimerd::TIMER_ZAPTO) TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_INFO_SMALL; else TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_DUMMY_SMALL; } //shadow - frameBuffer->paintBoxRel(x + SHADOW_OFFSET, y + height - footerHeight, width, footerHeight + SHADOW_OFFSET, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x + OFFSET_SHADOW, y + height - footerHeight, width, footerHeight + OFFSET_SHADOW, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); if (timerlist.empty()) ::paintButtons(x, y + height - footerHeight, width, 2, &(TimerListButtons[1]), width); @@ -878,11 +1267,13 @@ void CTimerList::paint() { int ypos = y+ theight; int sb = 2*fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + unsigned int tmp_max = listmaxshow; + if(!tmp_max) + tmp_max = 1; + int sbc= ((timerlist.size()- 1)/ tmp_max)+ 1; - int sbc= ((timerlist.size()- 1)/ listmaxshow)+ 1; - - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ page_nr * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3, RADIUS_SMALL); + frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ page_nr * (sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_SMALL); } paintFoot(); @@ -909,6 +1300,8 @@ const char * CTimerList::convertTimerType2String(const CTimerd::CTimerEventTypes return g_Locale->getText(LOCALE_TIMERLIST_TYPE_SLEEPTIMER ); case CTimerd::TIMER_EXEC_PLUGIN : return g_Locale->getText(LOCALE_TIMERLIST_TYPE_EXECPLUGIN ); + case CTimerd::TIMER_REMOTEBOX : + return g_Locale->getText(LOCALE_TIMERLIST_TYPE_REMOTEBOX ); default : return g_Locale->getText(LOCALE_TIMERLIST_TYPE_UNKNOWN ); } @@ -1054,19 +1447,18 @@ int CTimerList::modifyTimer() //printf("TIMER: rec dir %s len %s\n", timer->recordingDir, strlen(timer->recordingDir)); - if (!strlen(timer->recordingDir)) - strncpy(timer->recordingDir,g_settings.network_nfs_recordingdir.c_str(),sizeof(timer->recordingDir)-1); - timer_recordingDir = timer->recordingDir; - - bool recDirEnabled = (g_settings.recording_type == RECORDING_FILE); // obsolete? - CMenuForwarder* m6 = new CMenuForwarder(LOCALE_TIMERLIST_RECORDING_DIR, recDirEnabled, timer_recordingDir, this, "rec_dir1", CRCInput::RC_green); - timerSettings.addItem(GenericMenuSeparatorLine); timerSettings.addItem(m3); timerSettings.addItem(m4); timerSettings.addItem(m5); if (timer->eventType == CTimerd::TIMER_RECORD) { + if (!strlen(timer->recordingDir)) + strncpy(timer->recordingDir,g_settings.network_nfs_recordingdir.c_str(),sizeof(timer->recordingDir)-1); + timer_recordingDir = timer->recordingDir; + + bool recDirEnabled = (g_settings.recording_type == RECORDING_FILE); // obsolete? + CMenuForwarder* m6 = new CMenuForwarder(LOCALE_TIMERLIST_RECORDING_DIR, recDirEnabled, timer_recordingDir, this, "rec_dir1", CRCInput::RC_green); timerSettings.addItem(GenericMenuSeparatorLine); timerSettings.addItem(m6); } @@ -1258,13 +1650,23 @@ int CTimerList::newTimer() return ret; } -bool askUserOnTimerConflict(time_t announceTime, time_t stopTime) +bool askUserOnTimerConflict(time_t announceTime, time_t stopTime, t_channel_id channel_id) { if (CFEManager::getInstance()->getEnabledCount() == 1) { CTimerdClient Timer; CTimerd::TimerList overlappingTimers = Timer.getOverlappingTimers(announceTime,stopTime); //printf("[CTimerdClient] attention\n%d\t%d\t%d conflicts with:\n",timerNew.announceTime,timerNew.alarmTime,timerNew.stopTime); + // Don't ask if there are overlapping timers on the same transponder. + if (channel_id) { + CTimerd::TimerList::iterator i; + for (i = overlappingTimers.begin(); i != overlappingTimers.end(); i++) + if ((i->eventType != CTimerd::TIMER_RECORD || !SAME_TRANSPONDER(channel_id, i->channel_id))) + break; + if (i == overlappingTimers.end()) + return true; // yes, add timer + } + std::string timerbuf = g_Locale->getText(LOCALE_TIMERLIST_OVERLAPPING_TIMER); timerbuf += "\n"; for (CTimerd::TimerList::iterator it = overlappingTimers.begin(); @@ -1287,20 +1689,13 @@ bool askUserOnTimerConflict(time_t announceTime, time_t stopTime) timerbuf += it->epgTitle; } } - timerbuf += ")"; + timerbuf += "):\n"; - timerbuf += ":\n"; - char at[25] = {0}; struct tm *annTime = localtime(&(it->announceTime)); - strftime(at,20,"%d.%m. %H:%M",annTime); - timerbuf += at; - timerbuf += " - "; + timerbuf += strftime("%d.%m. %H:%M\n",annTime); - char st[25] = {0}; struct tm *sTime = localtime(&(it->stopTime)); - strftime(st,20,"%d.%m. %H:%M",sTime); - timerbuf += st; - timerbuf += "\n"; + timerbuf += strftime("%d.%m. %H:%M\n",sTime); //printf("%d\t%d\t%d\n",it->announceTime,it->alarmTime,it->stopTime); } //printf("message:\n%s\n",timerbuf.c_str()); diff --git a/src/gui/timerlist.h b/src/gui/timerlist.h index 48c299bb8..3ed0af33c 100644 --- a/src/gui/timerlist.h +++ b/src/gui/timerlist.h @@ -85,6 +85,16 @@ class CTimerList : public CMenuTarget, public CListHelpers int newTimer(); /* todo: properly import the enum CVFD::MODES */ int saved_dispmode; + void remoteTimerList(CTimerd::TimerList &timerlist); + void enterRemoteBox(); + void select_remotebox_ip(); + bool remoteChanExists(t_channel_id channel_id); + bool localChanExists(t_channel_id channel_id); + int rem_pre,rem_post; + int item_offset; + bool changed; + int bselected; + CMenuWidget *remboxmenu; public: CTimerList(); @@ -97,7 +107,6 @@ class CTimerList : public CMenuTarget, public CListHelpers static std::string convertChannelId2String(const t_channel_id id); // UTF-8 }; -bool askUserOnTimerConflict(time_t announceTime, time_t stopTime); - +bool askUserOnTimerConflict(time_t announceTime, time_t stopTime, t_channel_id channel_id = 0); #endif diff --git a/src/gui/tmdb.cpp b/src/gui/tmdb.cpp new file mode 100644 index 000000000..0b8556440 --- /dev/null +++ b/src/gui/tmdb.cpp @@ -0,0 +1,296 @@ +/* + Copyright (C) 2015 TangoCash + + License: GPLv2 + + 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; + + 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "system/settings.h" +#include "system/helpers.h" +#include "system/set_threadname.h" +#include "gui/widget/hintbox.h" + +#include + +#include +#include + +#include "tmdb.h" + +#if LIBCURL_VERSION_NUM < 0x071507 +#include +#endif + +#define URL_TIMEOUT 60 +#define TMDB_COVER "/tmp/tmdb.jpg" + +cTmdb::cTmdb(std::string epgtitle) +{ + minfo.epgtitle = epgtitle; + curl_handle = curl_easy_init(); + +#ifdef TMDB_API_KEY + key = TMDB_API_KEY; +#else + key = g_settings.tmdb_api_key; +#endif + + CHintBox* box = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_TMDB_READ_DATA)); + box->paint(); + + std::string lang = Lang2ISO639_1(g_settings.language); + GetMovieDetails(lang); + if ((minfo.result < 1 || minfo.overview.empty()) && lang != "en") + GetMovieDetails("en"); + + if (box != NULL) { + box->hide(); + delete box; + } +} + +cTmdb::~cTmdb() +{ + curl_easy_cleanup(curl_handle); +} + +size_t cTmdb::CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data) +{ + if (size * nmemb > 0) { + std::string* pStr = (std::string*) data; + pStr->append((char*) ptr, nmemb); + } + return size*nmemb; +} + +std::string cTmdb::decodeUrl(std::string url) +{ + char * str = curl_easy_unescape(curl_handle, url.c_str(), 0, NULL); + if (str) + url = str; + curl_free(str); + return url; +} + +std::string cTmdb::encodeUrl(std::string txt) +{ + char * str = curl_easy_escape(curl_handle, txt.c_str(), txt.length()); + if (str) + txt = str; + curl_free(str); + return txt; +} + +bool cTmdb::getUrl(std::string &url, std::string &answer, CURL *_curl_handle) +{ + printf("[TMDB]: %s\n",__func__); + if (!_curl_handle) + _curl_handle = curl_handle; + + curl_easy_setopt(_curl_handle, CURLOPT_URL, url.c_str()); + curl_easy_setopt(_curl_handle, CURLOPT_WRITEFUNCTION, &cTmdb::CurlWriteToString); + curl_easy_setopt(_curl_handle, CURLOPT_FILE, (void *)&answer); + curl_easy_setopt(_curl_handle, CURLOPT_FAILONERROR, 1); + curl_easy_setopt(_curl_handle, CURLOPT_TIMEOUT, URL_TIMEOUT); + curl_easy_setopt(_curl_handle, CURLOPT_NOSIGNAL, (long)1); + curl_easy_setopt(_curl_handle, CURLOPT_SSL_VERIFYPEER, false); + + if (!g_settings.softupdate_proxyserver.empty()) { + curl_easy_setopt(_curl_handle, CURLOPT_PROXY, g_settings.softupdate_proxyserver.c_str()); + if (!g_settings.softupdate_proxyusername.empty()) { + std::string tmp = g_settings.softupdate_proxyusername + ":" + g_settings.softupdate_proxypassword; + curl_easy_setopt(_curl_handle, CURLOPT_PROXYUSERPWD, tmp.c_str()); + } + } + + char cerror[CURL_ERROR_SIZE]; + curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror); + + printf("try to get [%s] ...\n", url.c_str()); + CURLcode httpres = curl_easy_perform(_curl_handle); + + printf("http: res %d size %d\n", httpres, (int)answer.size()); + + if (httpres != 0 || answer.empty()) { + printf("error: %s\n", cerror); + return false; + } + return true; +} + +bool cTmdb::DownloadUrl(std::string url, std::string file, CURL *_curl_handle) +{ + if (!_curl_handle) + _curl_handle = curl_handle; + + FILE * fp = fopen(file.c_str(), "wb"); + if (fp == NULL) { + perror(file.c_str()); + return false; + } + curl_easy_setopt(_curl_handle, CURLOPT_URL, url.c_str()); + curl_easy_setopt(_curl_handle, CURLOPT_WRITEFUNCTION, NULL); + curl_easy_setopt(_curl_handle, CURLOPT_FILE, fp); + curl_easy_setopt(_curl_handle, CURLOPT_FAILONERROR, 1); + curl_easy_setopt(_curl_handle, CURLOPT_TIMEOUT, URL_TIMEOUT); + curl_easy_setopt(_curl_handle, CURLOPT_NOSIGNAL, (long)1); + curl_easy_setopt(_curl_handle, CURLOPT_SSL_VERIFYPEER, false); + + if (!g_settings.softupdate_proxyserver.empty()) { + curl_easy_setopt(_curl_handle, CURLOPT_PROXY, g_settings.softupdate_proxyserver.c_str()); + if (!g_settings.softupdate_proxyusername.empty()) { + std::string tmp = g_settings.softupdate_proxyusername + ":" + g_settings.softupdate_proxypassword; + curl_easy_setopt(_curl_handle, CURLOPT_PROXYUSERPWD, tmp.c_str()); + } + } + + char cerror[CURL_ERROR_SIZE]; + curl_easy_setopt(_curl_handle, CURLOPT_ERRORBUFFER, cerror); + + printf("try to get [%s] ...\n", url.c_str()); + CURLcode httpres = curl_easy_perform(_curl_handle); + + double dsize; + curl_easy_getinfo(_curl_handle, CURLINFO_SIZE_DOWNLOAD, &dsize); + fclose(fp); + + printf("http: res %d size %g.\n", httpres, dsize); + + if (httpres != 0) { + printf("curl error: %s\n", cerror); + unlink(file.c_str()); + return false; + } + return true; +} + +bool cTmdb::GetMovieDetails(std::string lang) +{ + printf("[TMDB]: %s\n",__func__); + std::string url = "http://api.themoviedb.org/3/search/multi?api_key="+key+"&language="+lang+"&query=" + encodeUrl(minfo.epgtitle); + std::string answer; + if (!getUrl(url, answer)) + return false; + + Json::Value root; + Json::Reader reader; + bool parsedSuccess = reader.parse(answer, root, false); + if (!parsedSuccess) { + printf("Failed to parse JSON\n"); + printf("%s\n", reader.getFormattedErrorMessages().c_str()); + return false; + } + + minfo.result = root.get("total_results",0).asInt(); + + printf("[TMDB]: results: %d\n",minfo.result); + + if (minfo.result > 0) { + Json::Value elements = root["results"]; + minfo.id = elements[0].get("id",-1).asInt(); + minfo.media_type = elements[0].get("media_type","").asString(); + if (minfo.id > -1) { + url = "http://api.themoviedb.org/3/"+minfo.media_type+"/"+to_string(minfo.id)+"?api_key="+key+"&language="+lang+"&append_to_response=credits"; + answer.clear(); + if (!getUrl(url, answer)) + return false; + parsedSuccess = reader.parse(answer, root, false); + if (!parsedSuccess) { + printf("Failed to parse JSON\n"); + printf("%s\n", reader.getFormattedErrorMessages().c_str()); + return false; + } + + minfo.overview = root.get("overview","").asString(); + minfo.poster_path = root.get("poster_path","").asString(); + minfo.original_title = root.get("original_title","").asString();; + minfo.release_date = root.get("release_date","").asString();; + minfo.vote_average = root.get("vote_average","").asString();; + minfo.vote_count = root.get("vote_count",0).asInt();; + minfo.runtime = root.get("runtime",0).asInt();; + if (minfo.media_type == "tv") { + minfo.original_title = root.get("original_name","").asString();; + minfo.episodes = root.get("number_of_episodes",0).asInt();; + minfo.seasons = root.get("number_of_seasons",0).asInt();; + minfo.release_date = root.get("first_air_date","").asString();; + elements = root["episode_run_time"]; + minfo.runtimes = elements[0].asString(); + for (unsigned int i= 1; igetText(LOCALE_EPGVIEWER_LENGTH)+": "+minfo.runtimes+"\n"; + else + epgtext += (std::string)g_Locale->getText(LOCALE_EPGVIEWER_LENGTH)+": "+to_string(minfo.runtime)+"\n"; + epgtext += (std::string)g_Locale->getText(LOCALE_EPGVIEWER_GENRE)+": "+minfo.genres+"\n"; + epgtext += (std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ORIGINAL_TITLE) +" : "+ minfo.original_title+"\n"; + epgtext += (std::string)g_Locale->getText(LOCALE_EPGEXTENDED_YEAR_OF_PRODUCTION)+" : "+ minfo.release_date.substr(0,4) +"\n"; + if (minfo.media_type == "tv") + epgtext += "Seasons/Episodes: "+to_string(minfo.seasons)+"/"+to_string(minfo.episodes)+"\n"; + if (!minfo.cast.empty()) + epgtext += (std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ACTORS)+":\n"+ minfo.cast+"\n"; + return epgtext; +} diff --git a/src/gui/tmdb.h b/src/gui/tmdb.h new file mode 100644 index 000000000..6675955f4 --- /dev/null +++ b/src/gui/tmdb.h @@ -0,0 +1,79 @@ +/* + Copyright (C) 2015 TangoCash + + License: GPLv2 + + 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; + + 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef __TMDB__ +#define __TMDB__ + +#include +#include + +#include + +typedef struct { + std::string epgtitle; + std::string poster_path; + std::string overview; + std::string original_title; + std::string release_date; + std::string vote_average; + int vote_count; + int id; + std::string media_type; + int result; + int runtime; + std::string runtimes; + std::string genres; + int episodes; + int seasons; + std::string cast; +}tmdbinfo; + +class cTmdb +{ + private: + CURL *curl_handle; + tmdbinfo minfo; + + static size_t CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data); + std::string encodeUrl(std::string txt); + std::string decodeUrl(std::string url); + std::string key; // tmdb api key + bool getUrl(std::string &url, std::string &answer, CURL *_curl_handle = NULL); + bool DownloadUrl(std::string url, std::string file, CURL *_curl_handle = NULL); + bool GetMovieDetails(std::string lang); + + public: + cTmdb(std::string epgtitle); + ~cTmdb(); + std::string CreateEPGText(); + + std::string getTitle() { return minfo.epgtitle;} + std::string getOrgTitle() { return minfo.original_title;} + std::string getReleaseDate() { return minfo.release_date;} + std::string getDescription() { return minfo.overview;} + std::string getVote() { return minfo.vote_average;} + std::string getCast() { return minfo.cast;} + bool hasCover() { return !minfo.poster_path.empty();} + bool getBigCover(std::string cover) { return DownloadUrl("http://image.tmdb.org/t/p/w342" + minfo.poster_path, cover);} + bool getSmallCover(std::string cover) { return DownloadUrl("http://image.tmdb.org/t/p/w185" + minfo.poster_path, cover);} + int getResults() { return minfo.result;} + int getStars() { return (int) (atof(minfo.vote_average.c_str())+0.5);} +}; + +#endif diff --git a/src/gui/update.cpp b/src/gui/update.cpp index b215e71b7..71acd91bc 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -144,7 +144,7 @@ bool CFlashUpdate::checkOnlineVersion() std::vector update_t_list; CConfigFile _configfile('\t'); - const char * versionString = (_configfile.loadConfig("/.version")) ? (_configfile.getString( "version", "????????????????").c_str()) : "????????????????"; + const char * versionString = (_configfile.loadConfig(TARGET_PREFIX "/.version")) ? (_configfile.getString( "version", "????????????????").c_str()) : "????????????????"; #ifdef DEBUG printf("[update] file %s\n", g_settings.softupdate_url_file.c_str()); #endif @@ -200,7 +200,7 @@ bool CFlashUpdate::selectHttpImage(void) int curVer, newVer, newfound = 0; CConfigFile _configfile('\t'); - const char * versionString = (_configfile.loadConfig("/.version")) ? (_configfile.getString( "version", "????????????????").c_str()) : "????????????????"; + const char * versionString = (_configfile.loadConfig(TARGET_PREFIX "/.version")) ? (_configfile.getString( "version", "????????????????").c_str()) : "????????????????"; CFlashVersionInfo curInfo(versionString); printf("current flash-version: %s (%d) date %s (%ld)\n", versionString, curInfo.getVersion(), curInfo.getDate(), curInfo.getDateTime()); @@ -474,7 +474,7 @@ printf("[update] mode is %d\n", softupdate_mode); } strcpy(msg, g_Locale->getText(LOCALE_FLASHUPDATE_NOVERSION)); - msg_body = LOCALE_FLASHUPDATE_MSGBOX_MANUAL; +//never read msg_body = LOCALE_FLASHUPDATE_MSGBOX_MANUAL; } return (ShowMsg(LOCALE_MESSAGEBOX_INFO, msg, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) == CMessageBox::mbrYes); // UTF-8 } diff --git a/src/gui/update_settings.h b/src/gui/update_settings.h index 44a7a16df..c4cfc520d 100644 --- a/src/gui/update_settings.h +++ b/src/gui/update_settings.h @@ -61,7 +61,6 @@ class CUpdateSettings : public CMenuTarget int width; int initMenu(); - CFlashExpert *fe; #ifdef USE_SMS_INPUT CStringInputSMS *input_url_file; #endif diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index dd18cee43..faf85ed8b 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -3,6 +3,8 @@ UPnP Browser (c) 2007 by Jochen Friedrich (c) 2009-2011,2016 Stefan Seyfried + (c) 2016 Thilo Graf + (c) 2016 Sven Hoefer License: GPL @@ -17,8 +19,7 @@ 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #ifdef HAVE_CONFIG_H @@ -43,15 +44,13 @@ #include #include #include - #include -#include -#include #include #include -#include - +#include #include +#include +#include #include #include @@ -59,12 +58,13 @@ extern cVideo * videoDecoder; extern CPictureViewer * g_PicViewer; const struct button_label RescanButton = {NEUTRINO_ICON_BUTTON_BLUE , LOCALE_UPNPBROWSER_RESCAN}; -const struct button_label BrowseButtons[4] = +const struct button_label BrowseButtons[] = { - { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_STOP }, { NEUTRINO_ICON_BUTTON_RED , LOCALE_FILEBROWSER_NEXTPAGE }, { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_FILEBROWSER_PREVPAGE }, - { NEUTRINO_ICON_BUTTON_OKAY , LOCALE_AUDIOPLAYER_PLAY } + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_AUDIOPLAYER_STOP }, + { NEUTRINO_ICON_BUTTON_OKAY , LOCALE_AUDIOPLAYER_PLAY }, + { NEUTRINO_ICON_BUTTON_HOME , LOCALE_MENU_BACK, } }; CUpnpBrowserGui::CUpnpBrowserGui() @@ -72,13 +72,98 @@ CUpnpBrowserGui::CUpnpBrowserGui() m_socket = new CUPnPSocket(); m_frameBuffer = CFrameBuffer::getInstance(); m_playing_entry_is_shown = false; + + Init(); + dline = NULL; + image = NULL; + + sigc::slot0 reinit = sigc::mem_fun(this, &CUpnpBrowserGui::Init); + CNeutrinoApp::getInstance()->OnAfterSetupFonts.connect(reinit); + CFrameBuffer::getInstance()->OnAfterSetPallette.connect(reinit); +} + +void CUpnpBrowserGui::Init() +{ + font_item = SNeutrinoSettings::FONT_TYPE_MENU; + + topbox.enableFrame(true, 2); + topbox.setCorner(RADIUS_LARGE); + topbox.setColorAll(COL_FRAME_PLUS_0, COL_MENUHEAD_PLUS_0, COL_SHADOW_PLUS_0, COL_MENUHEAD_TEXT); + topbox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]); + topbox.enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Head_gradient_direction); + topbox.enableShadow(CC_SHADOW_ON, -1, true); + + infobox.enableFrame(true, 2); + infobox.setCorner(RADIUS_LARGE); + infobox.setColorAll(topbox.getColorFrame(), COL_MENUCONTENTDARK_PLUS_0); + infobox.setTextColor(COL_MENUCONTENTDARK_TEXT); + infobox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]); + infobox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction); + infobox.enableShadow(CC_SHADOW_ON, -1, true); + + timebox.enableFrame(true, 2); + timebox.setCorner(RADIUS_LARGE); + timebox.setColorAll(infobox.getColorFrame(), infobox.getColorBody()); + timebox.setTextColor(infobox.getTextColor()); + timebox.setTextFont(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]); + timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction); + timebox.enableShadow(CC_SHADOW_ON, -1, true); + + m_width = m_frameBuffer->getScreenWidthRel(); + m_height = m_frameBuffer->getScreenHeightRel(); + + int _top_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getHeight(); + int _title_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + int _info_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); + + m_item_height = g_Font[font_item]->getHeight(); + + m_header_height = _title_height; + m_footer_height = _title_height; + m_topbox_height = _top_height*3 + OFFSET_INNER_MID; // topbox: 3 lines + inner offset + m_infobox_height = _info_height*2 + OFFSET_INNER_LARGE; // infobox/timebox: 2 lines + inner offset + + /* From top to bottom we have: + * + * topbox (with shadow) + * OFFSET_INTER + * mainwindow (with shadow) + * - header + * - body (items*listshowmax) + * - footer + * OFFSET_INTER + * infobox/timebox (with shadow) + */ + + m_listmaxshow = (m_height - m_topbox_height - OFFSET_SHADOW - OFFSET_INTER - m_header_height - m_footer_height - OFFSET_SHADOW - OFFSET_INTER - m_infobox_height - OFFSET_SHADOW) / (m_item_height); + + // recalc height + m_height = m_topbox_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height + (m_listmaxshow * m_item_height) + m_footer_height + OFFSET_SHADOW + OFFSET_INTER + m_infobox_height + OFFSET_SHADOW; + + footer.setHeight(m_footer_height); + footer.enableShadow(CC_SHADOW_ON, -1, true); + + m_x=getScreenStartX(m_width); + if (m_x < ConnectLineBox_Width) // shouldn't happen + m_x = ConnectLineBox_Width; + m_y=getScreenStartY(m_height); + + // calc positions + m_header_y = m_y + m_topbox_height + OFFSET_SHADOW + OFFSET_INTER; + m_item_y = m_header_y + m_header_height; + m_footer_y = m_item_y + (m_listmaxshow * m_item_height); + m_infobox_y = m_footer_y + m_footer_height + OFFSET_SHADOW + OFFSET_INTER; } CUpnpBrowserGui::~CUpnpBrowserGui() { delete m_socket; - delete dline; + if (dline){ + delete dline; dline = NULL; + } + if (image) + delete image, image = NULL; } int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/) @@ -92,30 +177,12 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ CNeutrinoApp::getInstance()->stopPlayBack(true); m_frameBuffer->showFrame("mp3.jpg"); - // tell neutrino we're in audio mode - CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_audio); + // tell neutrino we're in upnp mode + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_upnp); // remember last mode m_LastMode=(CNeutrinoApp::getInstance()->getLastMode()); - m_width = m_frameBuffer->getScreenWidthRel(); - m_height = m_frameBuffer->getScreenHeightRel(); - - m_sheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - m_buttonHeight = std::min(25, m_sheight); - m_theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - m_mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getHeight(); - m_title_height = m_mheight*2 + 20 + m_sheight + 4; - m_info_height = m_mheight*2; - m_listmaxshow = (m_height - m_info_height - m_title_height - m_theight - 2*m_buttonHeight) / (m_fheight); - m_height = m_theight + m_info_height + m_title_height + 2*m_buttonHeight + m_listmaxshow * m_fheight; // recalc height - - m_x=getScreenStartX(m_width); - if (m_x < ConnectLineBox_Width) - m_x = ConnectLineBox_Width; - m_y=getScreenStartY(m_height); - // Stop sectionsd g_Sectionsd->setPauseScanning(true); @@ -125,8 +192,7 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ selectDevice(); - if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP) - CAudioPlayer::getInstance()->stop(); + stopAudio(); // Start Sectionsd g_Sectionsd->setPauseScanning(false); @@ -638,7 +704,7 @@ bool CUpnpBrowserGui::updateItemSelection(std::string id, std::vector selected = newpos; liststart = (selected/m_listmaxshow)*m_listmaxshow; - printf("updateItemSelection: list start old %d new %d selected old %d new %d\n", oldliststart, liststart, prev_selected, selected); + printf("updateItemSelection: list start old %u new %d selected old %d new %d\n", oldliststart, liststart, prev_selected, selected); if (oldliststart != liststart) { unsigned int total; if (!getItems(id, liststart, entries, total)) @@ -791,9 +857,8 @@ bool CUpnpBrowserGui::selectItem(std::string id) m_playid++; } else if (msg == CRCInput::RC_yellow) { - if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP) - CAudioPlayer::getInstance()->stop(); m_folderplay = false; + stopAudio(); } else if (m_folderplay && msg == (neutrino_msg_t) CRCInput::RC_stop) { timeout = 0; @@ -809,8 +874,7 @@ bool CUpnpBrowserGui::selectItem(std::string id) } else if (m_folderplay && msg == (neutrino_msg_t) CRCInput::RC_next) { timeout = 0; - if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP) - CAudioPlayer::getInstance()->stop(); + stopAudio(); } else if (msg == NeutrinoMessages::RECORD_START || msg == NeutrinoMessages::ZAPTO || @@ -842,6 +906,17 @@ bool CUpnpBrowserGui::selectItem(std::string id) } } +#if 0 + /* + maybe it's better to stop audio here, + because infobox and timebox will never been painted and updated + */ + if (endall) + { + stopAudio(); + } +#endif + delete entries; timeout = 0; m_frameBuffer->Clear(); @@ -851,146 +926,132 @@ bool CUpnpBrowserGui::selectItem(std::string id) void CUpnpBrowserGui::paintDeviceInfo() { - std::string tmp; - int w, xstart; - CVFD::getInstance()->showMenuText(0, m_devices[m_selecteddevice].friendlyname.c_str(), -1, true); // Info - m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height - 10, COL_MENUCONTENT_PLUS_6, RADIUS_MID); - m_frameBuffer->paintBoxRel(m_x + 2, m_y + 2, m_width - 4, m_title_height - 14, COL_MENUCONTENTSELECTED_PLUS_0, RADIUS_MID); + std::string tmp; // first line tmp = m_devices[m_selecteddevice].manufacturer + " " + - m_devices[m_selecteddevice].manufacturerurl; - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); - w = std::min(w, m_width - 20); - xstart = (m_width - w) / 2; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT); + m_devices[m_selecteddevice].manufacturerurl + "\n"; // second line - tmp = m_devices[m_selecteddevice].modelname + " " + + tmp += m_devices[m_selecteddevice].modelname + " " + m_devices[m_selecteddevice].modelnumber + " " + - m_devices[m_selecteddevice].modeldescription; - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); - w = std::min(w, m_width - 20); - xstart = (m_width - w) / 2; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 2*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT); + m_devices[m_selecteddevice].modeldescription + "\n"; + // third line - tmp = m_devices[m_selecteddevice].modelurl; - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); - w = std::min(w, m_width - 20); - xstart = (m_width - w) / 2; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 3*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT); + tmp += m_devices[m_selecteddevice].modelurl; + + topbox.setDimensionsAll(m_x, m_y, m_width, m_topbox_height); + topbox.setText(tmp, CTextBox::AUTO_WIDTH); + topbox.paint0(); } void CUpnpBrowserGui::paintDevice(unsigned int _pos) { - int ypos = m_y + m_title_height + m_theight + _pos*m_fheight; + int ypos = m_item_y + _pos*m_item_height; + unsigned int pos = m_deviceliststart + _pos; + + bool i_selected = pos == m_selecteddevice; + int i_radius = RADIUS_NONE; + fb_pixel_t color; fb_pixel_t bgcolor; - unsigned int pos = m_deviceliststart + _pos; - if (pos == m_selecteddevice) + getItemColors(color, bgcolor, i_selected); + + if (i_selected) { - color = COL_MENUCONTENT_TEXT_PLUS_2; - bgcolor = COL_MENUCONTENT_PLUS_2; paintDeviceInfo(); + i_radius = RADIUS_LARGE; } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor); + + if (i_radius) + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, COL_MENUCONTENT_PLUS_0); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor, i_radius); if (pos >= m_devices.size()) return; - char sNr[20]; - sprintf(sNr, "%2d", pos + 1); - std::string num = sNr; - + std::string num = to_string(pos + 1); std::string name = m_devices[pos].friendlyname; - int w = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getRenderWidth(name) + 5; - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + 10, ypos + m_fheight, m_width - 30 - w, - num, color, m_fheight); - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + m_width - 15 - w, ypos + m_fheight, - w, name, color, m_fheight); + int w = g_Font[font_item]->getRenderWidth(name); + g_Font[font_item]->RenderString(m_x + OFFSET_INNER_MID, ypos + m_item_height, m_width - 15 - OFFSET_INNER_MID - w, num, color, m_item_height); + g_Font[font_item]->RenderString(m_x + m_width - 15 - OFFSET_INNER_MID - w, ypos + m_item_height, w, name, color, m_item_height); } void CUpnpBrowserGui::paintDevices() { - std::string tmp; - int ypos, top; - // LCD CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, "Select UPnP Device"); // Head - CComponentsHeaderLocalized header(m_x, m_y + m_title_height, m_width, m_theight, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); - if (CNeutrinoApp::getInstance()->isMuted()) + CComponentsHeaderLocalized header(m_x, m_header_y, m_width, m_header_height, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); + header.enableShadow(CC_SHADOW_RIGHT, -1, true); + if (CNeutrinoApp::getInstance()->isMuted()) //TODO: consider mute mode on runtime header.addContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL); + else + header.removeContextButtons(); + //header.enableShadow(); header.paint(CC_SAVE_SCREEN_NO); // Items for (unsigned int count=0; countpaintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_MENUCONTENT_PLUS_1); + int sb = m_item_height * m_listmaxshow; + m_frameBuffer->paintBoxRel(m_x + m_width - 15, m_item_y, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + unsigned int tmp_max = m_listmaxshow; + if(!tmp_max) + tmp_max = 1; + int sbc = ((m_devices.size() - 1) / tmp_max) + 1; + int sbs = ((m_selecteddevice) / tmp_max); - int sbc = ((m_devices.size() - 1) / m_listmaxshow) + 1; - int sbs = ((m_selecteddevice) / m_listmaxshow); + m_frameBuffer->paintBoxRel(m_x + m_width - 13, m_item_y + 2 + sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); - m_frameBuffer->paintBoxRel(m_x + m_width - 13, ypos + 2 + sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); + //shadow + m_frameBuffer->paintBoxRel(m_x + m_width, m_item_y + OFFSET_SHADOW, OFFSET_SHADOW, sb, COL_SHADOW_PLUS_0); // Foot - top = m_y + (m_height - m_info_height - 2 * m_buttonHeight); + footer.paintButtons(m_x, m_footer_y, m_width, m_footer_height, 1, &RescanButton, m_width/2); - m_frameBuffer->paintBoxRel(m_x, top, m_width, m_buttonHeight+2, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); -// m_frameBuffer->paintHLine(m_x, m_x + m_width, top, COL_INFOBAR_SHADOW_PLUS_0); - ::paintButtons(m_x, top, 0, 1, &RescanButton, m_width, m_buttonHeight); - - paintItem2DetailsLine (-1); // clear it + paintItem2DetailsLine(-1); // clear it } void CUpnpBrowserGui::paintItem(std::vector *entries, unsigned int pos, unsigned int selected) { - int ypos = m_y + m_title_height + m_theight + pos*m_fheight; + int ypos = m_item_y + pos*m_item_height; + + bool i_selected = pos == selected; + int i_radius = RADIUS_NONE; + fb_pixel_t color; fb_pixel_t bgcolor; - if (pos == selected) - { - color = COL_MENUCONTENT_TEXT_PLUS_2; - bgcolor = COL_MENUCONTENT_PLUS_2; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor); + getItemColors(color, bgcolor, i_selected); + + if (i_selected) + i_radius = RADIUS_LARGE; + + if (i_radius) + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, COL_MENUCONTENT_PLUS_0); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor, i_radius); if (pos >= (*entries).size()) return; UPnPEntry *entry = &(*entries)[pos]; - if (pos == selected) + if (i_selected) { paintItemInfo(entry); paintDetails(entry); if (entry->isdir) - paintItem2DetailsLine (-1); // clear it + paintItem2DetailsLine(-1); // clear it else - paintItem2DetailsLine (pos); + paintItem2DetailsLine(pos); } int preferred=entry->preferred; @@ -1016,30 +1077,32 @@ void CUpnpBrowserGui::paintItem(std::vector *entries, unsigned int po } std::string name = entry->title; - char tmp_time[] = "00:00:00.0"; - int w = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getRenderWidth(tmp_time); + char tmp_time[] = "0:00:00.00"; + int w = g_Font[font_item]->getRenderWidth(tmp_time); - m_frameBuffer->paintIcon(fileicon, m_x + 5 , ypos + (m_fheight - 16) / 2); - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + m_width - 15 - w, ypos + m_fheight, - w, info, color, m_fheight); - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(m_x + 30, ypos + m_fheight, m_width - 50 - w, - name, color, m_fheight); + int icon_w = 0; + int icon_h = 0; + int icon_o = 0; + m_frameBuffer->getIconSize(fileicon.c_str(), &icon_w, &icon_h); + if (icon_w && icon_h) + { + icon_o = icon_w + OFFSET_INNER_MID; + m_frameBuffer->paintIcon(fileicon, m_x + OFFSET_INNER_MID, ypos + (m_item_height - icon_h)/2); + } + g_Font[font_item]->RenderString(m_x + OFFSET_INNER_MID + icon_o, ypos + m_item_height, m_width - 15 - OFFSET_INNER_MID - w, name, color, m_item_height); + g_Font[font_item]->RenderString(m_x + m_width - 15 - OFFSET_INNER_MID - w, ypos + m_item_height, w, info, color, m_item_height); } void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) { std::string tmp; std::stringstream ts; - int w, xstart; + int preferred=entry->preferred; // LCD CVFD::getInstance()->showMenuText(0, entry->title.c_str(), -1, true); - // Info - m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height - 10, COL_MENUCONTENT_PLUS_6, RADIUS_MID); - m_frameBuffer->paintBoxRel(m_x + 2, m_y + 2, m_width - 4, m_title_height - 14, COL_MENUCONTENTSELECTED_PLUS_0, RADIUS_MID); - // first line ts << "Resources: " << entry->resources.size() << " Selected: " << preferred+1 << " "; tmp = ts.str(); @@ -1048,58 +1111,56 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) tmp = tmp + "Duration: " + entry->resources[preferred].duration; else tmp = tmp + "No resource for Item"; - - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); - w = std::min(w, m_width - 20); - xstart = (m_width - w) / 2; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT); + tmp += "\n"; // second line if (entry->isdir) - tmp = "Directory"; + tmp += "Directory"; else { - tmp = ""; + tmp += ""; if (preferred != -1) - tmp = "Protocol: " + entry->proto + ", MIME-Type: " + entry->mime; + tmp += "Protocol: " + entry->proto + ", MIME-Type: " + entry->mime; } - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); - w = std::min(w, m_width - 20); - xstart = (m_width - w) / 2; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 2*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT); + tmp += "\n"; //third line - tmp = ""; if (!entry->isdir && preferred != -1) - tmp = "URL: " + entry->resources[preferred].url; + tmp += "URL: " + entry->resources[preferred].url; - w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); - w = std::min(w, m_width - 20); - xstart = (m_width - w) / 2; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 3*m_mheight, m_width - 20, - tmp, COL_MENUCONTENTSELECTED_TEXT); static std::string lastname = "", tmpname = ""; if(!entry->albumArtURI.empty()){ - static int flogo_w = 0, flogo_h = 0; if(lastname != entry->albumArtURI){ tmpname = lastname = entry->albumArtURI.c_str(); - tmpname = g_PicViewer->DownloadImage(tmpname ); - flogo_w = 0, flogo_h = 0; - g_PicViewer->getSize(tmpname.c_str(), &flogo_w, &flogo_h); - if((flogo_h > m_title_height-14) || (m_title_height*2 > flogo_h)){ - g_PicViewer->rescaleImageDimensions(&flogo_w, &flogo_h, m_title_height*2, m_title_height-14); + tmpname = g_PicViewer->DownloadImage(tmpname); + int h_image = infobox.getHeight() - OFFSET_INTER - infobox.getCornerRadius(); + int y_image = infobox.getYPos() + infobox.getHeight()/2 - h_image/2; + if (!image){ + image = new CComponentsPicture(0, y_image, tmpname, NULL, CC_SHADOW_OFF, COL_MENUCONTENTDARK_PLUS_0); + image->doPaintBg(false); + image->SetTransparent(CFrameBuffer::TM_BLACK); } + image->setPicture(tmpname); + image->setHeight(h_image, true); + int x_image = infobox.getXPos() + infobox.getWidth() - image->getWidth() - OFFSET_INTER - infobox.getCornerRadius(); + image->setXPos(x_image); + } + }else{ + if (image){ + delete image; image = NULL; } - g_PicViewer->DisplayImage(tmpname.c_str(), m_x+m_width-flogo_w-2-RADIUS_MID, m_y + 2, flogo_w, flogo_h); } + + topbox.setText(tmp, CTextBox::AUTO_WIDTH); + topbox.paint0(); } void CUpnpBrowserGui::paintItems(std::vector *entry, unsigned int selected, unsigned int max, unsigned int offset) { -printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, max, offset); - int ypos, top; + printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, max, offset); + + //block infoclock + CInfoClock::getInstance()->block(); // LCD CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, "Select UPnP Entry"); @@ -1108,7 +1169,7 @@ printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, std::string name = g_Locale->getText(LOCALE_UPNPBROWSER_HEAD); name += " : "; name += m_devices[m_selecteddevice].friendlyname; - CComponentsHeader header(m_x, m_y + m_title_height, m_width, m_theight, name, NEUTRINO_ICON_UPNP); + CComponentsHeader header(m_x, m_header_y, m_width, m_header_height, name, NEUTRINO_ICON_UPNP); if (CNeutrinoApp::getInstance()->isMuted()) header.setContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL); header.paint(CC_SAVE_SCREEN_NO); @@ -1117,125 +1178,122 @@ printf("CUpnpBrowserGui::paintItem:s selected %d max %d offset %d\n", selected, for (unsigned int count=0; countpaintBoxRel(m_x + m_width - 15, ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - - int sbc = ((max + offset - 1) / m_listmaxshow) + 1; - int sbs = ((selected + offset) / m_listmaxshow); + int sb = m_item_height * m_listmaxshow; + m_frameBuffer->paintBoxRel(m_x + m_width - 15, m_item_y, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); + unsigned int tmp = m_listmaxshow ? m_listmaxshow : 1;//avoid division by zero + int sbc = ((max + offset - 1) / tmp) + 1; + int sbs = ((selected + offset) / tmp); int sbh = 0; if ((sbc > 0) && (sbc > sb-4)) sbh = 2; - m_frameBuffer->paintBoxRel(m_x + m_width - 13, ypos + 2 + sbs*((sb-4)/sbc+sbh), 11, (sb-4)/sbc + sbh, COL_MENUCONTENT_PLUS_3); + m_frameBuffer->paintBoxRel(m_x + m_width - 13, m_item_y + 2 + sbs*((sb-4)/sbc+sbh), 11, (sb-4)/sbc + sbh, COL_SCROLLBAR_ACTIVE_PLUS_0); // Foot buttons - top = m_y + (m_height - m_info_height - 2 * m_buttonHeight); - m_frameBuffer->paintBoxRel(m_x, top, m_width, m_buttonHeight+2, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); - ::paintButtons(m_x, top, 0, 4, BrowseButtons, m_width, m_buttonHeight); + size_t numbuttons = sizeof(BrowseButtons)/sizeof(BrowseButtons[0]); + footer.paintButtons(m_x, m_footer_y, m_width, m_footer_height, numbuttons, BrowseButtons, m_width/numbuttons); } void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) { // Foot info - int top = m_y + (m_height - m_info_height - 1 * m_buttonHeight) + 2; - int text_start = m_x + 10; -printf("paintDetails: use_playing %d shown %d\n", use_playing, m_playing_entry_is_shown); - if ((!use_playing) && entry->isdir) - { - m_frameBuffer->paintBackgroundBoxRel(m_x+2, top + 2, m_width-4, 2 * m_buttonHeight+8); + char tmp_time[] = "000:00"; + int timebox_width = timebox.getFont()->getRenderWidth(tmp_time) + OFFSET_INNER_MID*2; + infobox.setDimensionsAll(m_x, m_infobox_y, m_width - OFFSET_SHADOW - OFFSET_INTER - timebox_width, m_infobox_height); + timebox.setDimensionsAll(m_x + m_width - timebox_width, infobox.getYPos(), timebox_width, m_infobox_height); + + printf("paintDetails: use_playing %d shown %d\n", use_playing, m_playing_entry_is_shown); + if ((!use_playing) && entry->isdir){ + infobox.kill(); + timebox.kill(); m_playing_entry_is_shown = false; - } - else - { - int ih = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->getHeight(); - //m_frameBuffer->paintBoxRel(m_x, top + 2, m_width-2, 2 * ih, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); - if (use_playing) - { - if (!m_playing_entry_is_shown) - { + }else{ + string text = ""; + if (use_playing){ + if (!m_playing_entry_is_shown){ m_playing_entry_is_shown = true; - m_frameBuffer->paintBoxRel(m_x, top + 2, m_width-2, 2 * ih, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start, - top + 1 * m_buttonHeight + 4, m_x + m_width - 8, m_playing_entry.title + " - " + - m_playing_entry.artist, COL_MENUCONTENTDARK_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start, - top + 2 * m_buttonHeight + 4, m_x + m_width - 8, m_playing_entry.album, COL_MENUCONTENTDARK_TEXT); + text = m_playing_entry.title; + text += !m_playing_entry.artist.empty() ? " - " + m_playing_entry.artist : ""; + text += "\n" + m_playing_entry.album; + infobox.setText(text, CTextBox::AUTO_WIDTH); + infobox.paint0(); } - } - else - { - if (entry == NULL) return; + }else{ + if (!entry) + return; m_playing_entry_is_shown = false; - m_frameBuffer->paintBoxRel(m_x, top + 2, m_width-2, 2 * ih, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start, - top + 1 * m_buttonHeight + 4, m_x + m_width - 8, entry->title + " - " + - entry->artist, COL_MENUCONTENTDARK_TEXT); - g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start, - top + 2 * m_buttonHeight + 4, m_x + m_width - 8, entry->album, COL_MENUCONTENTDARK_TEXT); + text = entry->title; + text += !entry->artist.empty() ? " - " + entry->artist : ""; + text += "\n" + entry->album; + infobox.setText(text, CTextBox::AUTO_WIDTH); + infobox.paint0(); } + if (image) + image->paint0(); + timebox.paint0(); } } -void CUpnpBrowserGui::paintItem2DetailsLine (int pos) +void CUpnpBrowserGui::paintItem2DetailsLine(int pos) { - if (dline) { - dline->kill(); - delete dline; - dline = NULL; - } - if (pos < 0) return; int xpos = m_x - ConnectLineBox_Width; - int ypos1 = m_y + m_title_height+0 + m_theight + pos*m_fheight; - int ypos2 = m_y + (m_height - m_info_height - 1 * m_buttonHeight) + 2; + int ypos1 = m_item_y + pos*m_item_height; + int ypos2 = infobox.getYPos() + infobox.getHeight() - infobox.getHeight()/2; - int ypos1a = ypos1 + (m_fheight/2); - int ypos2a = ypos2 + (m_info_height/2)-4; + int ypos1a = ypos1 + (m_item_height/2); - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, m_fheight/2+1, m_info_height-RADIUS_LARGE*2); - dline->paint(CC_SAVE_SCREEN_NO); + if (!dline) + dline = new CComponentsDetailLine(); + dline->setDimensionsAll(xpos, ypos1a, ypos2, m_item_height/2, infobox.getHeight() - RADIUS_LARGE*2); + dline->paint(); } void CUpnpBrowserGui::updateTimes(const bool force) { - int top; - if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP) - { + if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP){ bool updatePlayed = force; - if ((m_time_played != CAudioPlayer::getInstance()->getTimePlayed())) - { + if ((m_time_played != CAudioPlayer::getInstance()->getTimePlayed())){ m_time_played = CAudioPlayer::getInstance()->getTimePlayed(); updatePlayed = true; } -printf("updateTimes: force %d updatePlayed %d\n", force, updatePlayed); + printf("updateTimes: force %d updatePlayed %d\n", force, updatePlayed); char play_time[8]; snprintf(play_time, 7, "%ld:%02ld", m_time_played / 60, m_time_played % 60); - char tmp_time[] = "000:00"; - int w = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(tmp_time); - if (updatePlayed) - { - paintDetails(NULL, true); - top = m_y + (m_height - m_info_height - 1 * m_buttonHeight) + m_buttonHeight + 4; - m_frameBuffer->paintBoxRel(m_x + m_width - w - 15, top + 1, w + 4, m_buttonHeight, COL_MENUCONTENTDARK_PLUS_0); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(m_x + m_width - w - 11, top + 1 + m_buttonHeight, w, play_time, COL_MENUCONTENTDARK_TEXT); + if (updatePlayed){ + timebox.setText(play_time, CTextBox::CENTER); + timebox.paint0(); } } } void CUpnpBrowserGui::playAudio(std::string name, int type) { + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_audio); + CAudiofile mp3(name, (CFile::FileType) type); CAudioPlayer::getInstance()->play(&mp3, g_settings.audioplayer_highprio == 1); + + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap); +} + +void CUpnpBrowserGui::stopAudio() +{ + if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP) + { + CAudioPlayer::getInstance()->stop(); + } } void CUpnpBrowserGui::showPicture(std::string name) { + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_pic); + g_PicViewer->SetScaling((CPictureViewer::ScalingMode)g_settings.picviewer_scaling); g_PicViewer->SetVisible(g_settings.screen_StartX, g_settings.screen_EndX, g_settings.screen_StartY, g_settings.screen_EndY); @@ -1246,14 +1304,19 @@ void CUpnpBrowserGui::showPicture(std::string name) g_PicViewer->ShowImage(name, false); g_PicViewer->Cleanup(); + + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap); } void CUpnpBrowserGui::playVideo(std::string name, std::string url) { - if (CAudioPlayer::getInstance()->getState() != CBaseDec::STOP) - CAudioPlayer::getInstance()->stop(); + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_ts); + + stopAudio(); m_frameBuffer->stopFrame(); CMoviePlayerGui::getInstance().SetFile(name, url); CMoviePlayerGui::getInstance().exec(NULL, "upnp"); + + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap); } diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index 940122d6a..2ab2df4e5 100644 --- a/src/gui/upnpbrowser.h +++ b/src/gui/upnpbrowser.h @@ -4,14 +4,6 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Homepage: http://dbox.cyberphoria.org/ - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - - License: GPL This program is free software; you can redistribute it and/or modify @@ -25,8 +17,7 @@ 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #ifndef __upnpplayergui__ @@ -88,13 +79,19 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers unsigned int m_listmaxshow; unsigned int m_deviceliststart; unsigned int m_selecteddevice; - int m_fheight; // Fonthoehe Inhalt - int m_theight; // Fonthoehe Titel - int m_mheight; // Fonthoehe Info - int m_sheight; // Fonthoehe Status - int m_buttonHeight; - int m_title_height; - int m_info_height; + + int font_item; + + int m_topbox_height; + int m_header_height; + int m_header_y; + int m_item_height; + int m_item_y; + int m_footer_height; + int m_footer_y; + int m_infobox_height; + int m_infobox_y; + bool m_folderplay; std::string m_playfolder; int m_playid; @@ -102,12 +99,15 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers bool m_playing_entry_is_shown; time_t timeout; CComponentsDetailLine * dline; + CComponentsFooter footer; + CComponentsInfoBox topbox, infobox, timebox; + CComponentsPicture *image; bool discoverDevices(); void splitProtocol(std::string &protocol, std::string &prot, std::string &network, std::string &mime, std::string &additional); - bool getResults(std::string id, unsigned int start, unsigned int count, std::list &results); + bool getResults(std::string id, unsigned int start, unsigned int count, std::list &results); std::vector *decodeResult(std::string); - + void Init(); void updateDeviceSelection(int newpos); void selectDevice(); void paintDevices(); @@ -119,13 +119,14 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers bool updateItemSelection(std::string id, std::vector * &entries, int newpos, unsigned int &selected, unsigned int &liststart); bool selectItem(std::string); void paintItems(std::vector *entry, unsigned int selected, unsigned int max, unsigned int offset); - void paintItem (std::vector *entry, unsigned int pos, unsigned int selected); + void paintItem(std::vector *entry, unsigned int pos, unsigned int selected); void paintItemInfo(UPnPEntry *entry); void paintDetails(UPnPEntry *entry, bool use_playing = false); - void paintItem2DetailsLine (int pos); + void paintItem2DetailsLine(int pos); void updateTimes(const bool force = false); void playAudio(std::string name, int type); + void stopAudio(); void showPicture(std::string name); void playVideo(std::string name, std::string url); }; diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index e178031eb..a0e3c24ca 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -69,19 +69,24 @@ #include #include +#include #include #include #include +#include #include #include #include #include +#include +#include #include extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ extern CPlugins * g_PluginList; /* neutrino.cpp */ +extern cVideo * videoDecoder; #if !HAVE_SPARK_HARDWARE extern CCAMMenuHandler * g_CamHandler; #endif @@ -179,7 +184,11 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) else menu->addItem(GenericMenuSeparator); - bool _mode_ts = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_ts; + bool _mode_ts = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_ts; + bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv) && + (!CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()); + + bool adzap_active = CAdZapMenu::getInstance()->isActive(); std::string itemstr_last("1"); @@ -265,6 +274,8 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) { if (g_RemoteControl->subChannels.empty()) break; + if (_mode_webtv) + break; // NVOD/SubService- Kanal! CMenuWidget *tmpNVODSelector = new CMenuWidget(g_RemoteControl->are_subchannels ? LOCALE_NVODSELECTOR_SUBSERVICE : LOCALE_NVODSELECTOR_STARTTIME, NEUTRINO_ICON_VIDEO); if (!subchanselect.getNVODMenu(tmpNVODSelector)) { @@ -365,12 +376,12 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) menu_item = new CMenuForwarder(!g_settings.mode_clock ? LOCALE_CLOCK_SWITCH_ON:LOCALE_CLOCK_SWITCH_OFF, true, NULL, neutrino, "clock_switch", key, icon); menu_item->setHint("", LOCALE_MENU_HINT_CLOCK_MODE); break; -#if 0 case SNeutrinoSettings::ITEM_ADZAP: keyhelper.get(&key,&icon,CRCInput::RC_blue); - menu_item = new CMenuForwarder(LOCALE_USERMENU_ITEM_ADZAP, true, NULL, neutrino, "adzap", key, icon); - menu_item->setHint("", LOCALE_MENU_HINT_ADZAP); + menu_item = new CMenuForwarder(LOCALE_USERMENU_ITEM_ADZAP, true, adzap_active ? g_Locale->getText(LOCALE_OPTIONS_OFF) : NULL, CAdZapMenu::getInstance(), "adzap", key, icon); + menu_item->setHint(NEUTRINO_ICON_HINT_ADZAP, adzap_active ? LOCALE_MENU_HINT_ADZAP_ACTIVE : LOCALE_MENU_HINT_ADZAP); break; +#if 0 case SNeutrinoSettings::ITEM_TUNER_RESTART: keyhelper.get(&key,&icon); menu_item = new CMenuForwarder(LOCALE_SERVICEMENU_RESTART_TUNER, true, NULL, neutrino, "restarttuner", key, icon); @@ -431,6 +442,13 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) menu_item = new CMenuDForwarder(LOCALE_SERVICEMENU_UPDATE, true, NULL, new CSoftwareUpdate(), NULL, key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, LOCALE_MENU_HINT_SW_UPDATE); break; + case SNeutrinoSettings::ITEM_LIVESTREAM_RESOLUTION: + if (!_mode_webtv) + break; + keyhelper.get(&key,&icon); + menu_item = new CMenuDForwarder(LOCALE_LIVESTREAM_RESOLUTION, true, NULL, new CWebTVResolution(), NULL, key, icon); + //menu_item->setHint(xx, yy); + break; case -1: // plugin { int number_of_plugins = g_PluginList->getNumberOfPlugins(); @@ -460,8 +478,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) } } - extern CInfoClock *InfoClock; - InfoClock->enableInfoClock(false); + CInfoClock::getInstance()->enableInfoClock(false); // show menu if there are more than 2 items only // otherwise, we start the item directly (must be the last one) if (menu_items > 1 ) @@ -469,7 +486,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) else if (last_menu_item) last_menu_item->exec( NULL ); - InfoClock->enableInfoClock(true); + CInfoClock::getInstance()->enableInfoClock(true); CNeutrinoApp::getInstance()->StartSubtitles(); if (button < COL_BUTTONMAX) @@ -488,6 +505,7 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu neutrino_locale_t loc = NONEXISTANT_LOCALE; const char *text = NULL; + int mode = CNeutrinoApp::getInstance()->getMode(); std::vector items = ::split(g_settings.usermenu[button]->items, ','); for (std::vector::iterator it = items.begin(); it != items.end(); ++it) { @@ -512,6 +530,31 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu continue; case SNeutrinoSettings::ITEM_NONE: case SNeutrinoSettings::ITEM_BAR: + case SNeutrinoSettings::ITEM_LIVESTREAM_RESOLUTION: + if (mode == NeutrinoMessages::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) { + if(loc == NONEXISTANT_LOCALE && !text) { + CWebTVResolution webtvres; + std::string tmp = webtvres.getResolutionValue(); + if (!(videoDecoder->getBlank())) + { + int xres = 0, yres = 0, framerate; + videoDecoder->getPictureInfo(xres, yres, framerate); + if (xres && yres) + { + std::string res = to_string(xres) + "x" + to_string(yres); + if (res.compare(tmp)) + { + tmp = " (" + res + ")"; + text = tmp.c_str(); + } + } + }else{ + text = tmp.c_str(); + } + } else + return_title = true; + active = true; + } continue; case SNeutrinoSettings::ITEM_EPG_MISC: return_title = true; @@ -538,7 +581,9 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu continue; case SNeutrinoSettings::ITEM_AUDIO_SELECT: if(loc == NONEXISTANT_LOCALE && !text) { - if (!g_RemoteControl->current_PIDs.APIDs.empty()) + if (mode == NeutrinoMessages::mode_webtv) + text = CMoviePlayerGui::getInstance(true).CurrentAudioName().c_str(); // use instance_bg + else if (!g_RemoteControl->current_PIDs.APIDs.empty()) text = g_RemoteControl->current_PIDs.APIDs[ g_RemoteControl->current_PIDs.PIDs.selected_apid].desc; } else diff --git a/src/gui/user_menue_setup.cpp b/src/gui/user_menue_setup.cpp index c5a2df4b5..16296be01 100644 --- a/src/gui/user_menue_setup.cpp +++ b/src/gui/user_menue_setup.cpp @@ -101,7 +101,6 @@ static keyvals usermenu_items[] = { SNeutrinoSettings::ITEM_SCRIPTS, LOCALE_MAINMENU_SCRIPTS, usermenu_show }, { SNeutrinoSettings::ITEM_LUA, LOCALE_MAINMENU_LUA, usermenu_show }, #if 0 - { SNeutrinoSettings::ITEM_ADZAP, LOCALE_USERMENU_ITEM_ADZAP, usermenu_show }, { SNeutrinoSettings::ITEM_TUNER_RESTART, LOCALE_SERVICEMENU_RESTART_TUNER, usermenu_show }, { SNeutrinoSettings::ITEM_THREE_D_MODE, LOCALE_THREE_D_SETTINGS, usermenu_show_three_d_mode }, { SNeutrinoSettings::ITEM_RASS, LOCALE_RASS_HEAD, usermenu_show }, @@ -112,6 +111,8 @@ static keyvals usermenu_items[] = { SNeutrinoSettings::ITEM_HDDMENU, LOCALE_HDD_SETTINGS, usermenu_show }, { SNeutrinoSettings::ITEM_NETSETTINGS, LOCALE_MAINSETTINGS_NETWORK, usermenu_show }, { SNeutrinoSettings::ITEM_SWUPDATE, LOCALE_SERVICEMENU_UPDATE, usermenu_show }, + { SNeutrinoSettings::ITEM_LIVESTREAM_RESOLUTION,LOCALE_LIVESTREAM_RESOLUTION, usermenu_show }, + { SNeutrinoSettings::ITEM_ADZAP, LOCALE_USERMENU_ITEM_ADZAP, usermenu_show }, { SNeutrinoSettings::ITEM_MAX, NONEXISTANT_LOCALE, usermenu_show } }; @@ -190,6 +191,10 @@ int CUserMenuSetup::exec(CMenuTarget* parent, const std::string &actionKey) static neutrino_locale_t locals[SNeutrinoSettings::ITEM_MAX]; neutrino_locale_t CUserMenuSetup::getLocale(unsigned int key) { + if(key >= SNeutrinoSettings::ITEM_MAX){ + key = SNeutrinoSettings::ITEM_NONE; + } + static bool initialized = false; if (!initialized) { initialized = true; diff --git a/src/gui/vfd_setup.cpp b/src/gui/vfd_setup.cpp index 870bd4cb6..d1ef2d2f0 100644 --- a/src/gui/vfd_setup.cpp +++ b/src/gui/vfd_setup.cpp @@ -156,6 +156,10 @@ int CVfdSetup::showSetup() oj = new CMenuOptionChooser(LOCALE_LCDMENU_SCROLL, &g_settings.lcd_scroll, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, vfd_enabled); oj->setHint("", LOCALE_MENU_HINT_VFD_SCROLL); vfds->addItem(oj); + + oj = new CMenuOptionChooser(LOCALE_LCDMENU_NOTIFY_RCLOCK, &g_settings.lcd_notify_rclock, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, vfd_enabled); + oj->setHint("", LOCALE_MENU_HINT_VFD_NOTIFY_RCLOCK); + vfds->addItem(oj); } int res = vfds->exec(NULL, ""); diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 8dac847e0..53b956bb9 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -142,8 +142,8 @@ const CMenuOptionChooser::keyval VIDEOMENU_VIDEOSIGNAL_HD1_OPTIONS[VIDEOMENU_VID { ANALOG_MODE(CINCH,HD,YPRPB), LOCALE_VIDEOMENU_ANALOG_HD_YPRPB_CINCH } }; -#define VIDEOMENU_VIDEOSIGNAL_TANK_OPTION_COUNT 6 -const CMenuOptionChooser::keyval VIDEOMENU_VIDEOSIGNAL_TANK_OPTIONS[VIDEOMENU_VIDEOSIGNAL_TANK_OPTION_COUNT] = +#define VIDEOMENU_VIDEOSIGNAL_HD2_OPTION_COUNT 6 +const CMenuOptionChooser::keyval VIDEOMENU_VIDEOSIGNAL_HD2_OPTIONS[VIDEOMENU_VIDEOSIGNAL_HD2_OPTION_COUNT] = { { ANALOG_MODE(BOTH ,xD,AUTO ),LOCALE_VIDEOMENU_ANALOG_AUTO }, /* Encoder automatically adjusts based on content */ { ANALOG_MODE(BOTH ,xD,CVBS ),LOCALE_VIDEOMENU_ANALOG_CVBS }, /* CVBS on SCART (disables fastblank, un-used dacs) */ @@ -341,20 +341,17 @@ int CVideoSettings::showVideoSetup() } else if (system_rev > 0x06) { -#ifdef ANALOG_MODE - if (system_rev == 9 || system_rev == 11 || system_rev == 12) { // Tank, Trinity, Zee2 - vs_analg_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_ANALOG_MODE, &g_settings.analog_mode1, VIDEOMENU_VIDEOSIGNAL_TANK_OPTIONS, VIDEOMENU_VIDEOSIGNAL_TANK_OPTION_COUNT, true, this); - vs_analg_ch->setHint("", LOCALE_MENU_HINT_VIDEO_ANALOG_MODE); - } else -#endif - { - if(system_rev != 10) { - vs_scart_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_SCART, &g_settings.analog_mode1, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_SCART_OPTIONS, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_SCART_OPTION_COUNT, true, this); - vs_scart_ch->setHint("", LOCALE_MENU_HINT_VIDEO_SCART_MODE); - } - vs_chinch_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_CINCH, &g_settings.analog_mode2, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_CINCH_OPTIONS, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_CINCH_OPTION_COUNT, true, this); - vs_chinch_ch->setHint("", LOCALE_MENU_HINT_VIDEO_CINCH_MODE); +#if defined(BOXMODEL_APOLLO) && defined(ANALOG_MODE) + vs_analg_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_ANALOG_MODE, &g_settings.analog_mode1, VIDEOMENU_VIDEOSIGNAL_HD2_OPTIONS, VIDEOMENU_VIDEOSIGNAL_HD2_OPTION_COUNT, true, this); + vs_analg_ch->setHint("", LOCALE_MENU_HINT_VIDEO_ANALOG_MODE); +#else + if(system_rev != 10) { + vs_scart_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_SCART, &g_settings.analog_mode1, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_SCART_OPTIONS, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_SCART_OPTION_COUNT, true, this); + vs_scart_ch->setHint("", LOCALE_MENU_HINT_VIDEO_SCART_MODE); } + vs_chinch_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_CINCH, &g_settings.analog_mode2, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_CINCH_OPTIONS, VIDEOMENU_VIDEOSIGNAL_HD1PLUS_CINCH_OPTION_COUNT, true, this); + vs_chinch_ch->setHint("", LOCALE_MENU_HINT_VIDEO_CINCH_MODE); +#endif } #ifndef BOXMODEL_APOLLO else if (g_info.hw_caps->has_SCART) /* TRIPLEDRAGON hack... :-) TODO: SPARK? */ diff --git a/src/gui/videosettings.h b/src/gui/videosettings.h index 824b4ed3a..2b07076a6 100644 --- a/src/gui/videosettings.h +++ b/src/gui/videosettings.h @@ -42,7 +42,6 @@ class CVideoSettings : public CMenuWidget, CChangeObserver CMenuForwarder *SyncControlerForwarder; CMenuOptionChooser *VcrVideoOutSignalOptionChooser; - int vcr_video_out_signal; int prev_video_mode; int is_wizard; diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index dad43bedc..52f4af4ed 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -127,14 +127,14 @@ void CVolumeBar::initVolumeBarPosition() if (CNeutrinoApp::getInstance()->getChannellistIsVisible() == true) y += std::max(39, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()) + v_spacer; else if (g_settings.mode_clock) - y = clock_y + clock_height + v_spacer + SHADOW_OFFSET; + y = clock_y + clock_height + v_spacer + OFFSET_SHADOW; } x = sw - width - x_corr; break; } case VOLUMEBAR_POS_TOP_LEFT: if (CMoviePlayerGui::getInstance().osdTimeVisible()) - y = clock_y + clock_height + v_spacer + SHADOW_OFFSET; + y = clock_y + clock_height + v_spacer + OFFSET_SHADOW; break; case VOLUMEBAR_POS_BOTTOM_LEFT: y = (sh + frameBuffer->getScreenY()) - height - v_spacer; diff --git a/src/gui/volumebar.h b/src/gui/volumebar.h index 02d8a378e..1f09a056b 100644 --- a/src/gui/volumebar.h +++ b/src/gui/volumebar.h @@ -39,8 +39,8 @@ class CVolumeBar : public CComponentsForm CComponentsLabel *vb_digit; int vb_digit_mode; int VolumeFont; - int sy, sw, sh; - int mute_ax, mute_ay, mute_dx, mute_dy, mute_ay_old; + int sw, sh; + int mute_ax, mute_ay, mute_dx, mute_dy; int h_spacer, v_spacer; int vb_item_offset; diff --git a/src/gui/webtv_setup.cpp b/src/gui/webtv_setup.cpp index e5cfe48f0..9e0edf26f 100644 --- a/src/gui/webtv_setup.cpp +++ b/src/gui/webtv_setup.cpp @@ -29,7 +29,9 @@ #include #include #include +#include #include +#include #include #include "webtv_setup.h" @@ -41,6 +43,17 @@ CWebTVSetup::CWebTVSetup() changed = false; } +const CMenuOptionChooser::keyval_ext LIVESTREAM_RESOLUTION_OPTIONS[] = +{ + { 1920, NONEXISTANT_LOCALE, "1920x1080" }, + { 1280, NONEXISTANT_LOCALE, "1280x720" }, + { 854, NONEXISTANT_LOCALE, "854x480" }, + { 640, NONEXISTANT_LOCALE, "640x360" }, + { 426, NONEXISTANT_LOCALE, "426x240" }, + { 128, NONEXISTANT_LOCALE, "128x72" } +}; +#define LIVESTREAM_RESOLUTION_OPTION_COUNT (sizeof(LIVESTREAM_RESOLUTION_OPTIONS)/sizeof(CMenuOptionChooser::keyval_ext)) + #define CWebTVSetupFooterButtonCount 2 static const struct button_label CWebTVSetupFooterButtons[CWebTVSetupFooterButtonCount] = { { NEUTRINO_ICON_BUTTON_RED, LOCALE_WEBTV_XML_DEL }, @@ -91,6 +104,11 @@ int CWebTVSetup::exec(CMenuTarget* parent, const std::string & actionKey) } return res; } + if (actionKey == "script_path") { + const char *action_str = "ScriptPath"; + chooserDir(g_settings.livestreamScriptPath, false, action_str); + return res; + } if(parent) parent->hide(); @@ -108,10 +126,26 @@ int CWebTVSetup::Show() m->addKey(CRCInput::RC_red, this, "d"); m->addKey(CRCInput::RC_green, this, "a"); - m->addIntroItems(LOCALE_WEBTV_HEAD, LOCALE_WEBTV_XML); + m->addIntroItems(LOCALE_WEBTV_HEAD, LOCALE_LIVESTREAM_HEAD); + + bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv) && + (!CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()); + + CMenuForwarder *mf; + int shortcut = 1; + mf = new CMenuForwarder(LOCALE_LIVESTREAM_SCRIPTPATH, !_mode_webtv, g_settings.livestreamScriptPath, this, "script_path", CRCInput::convertDigitToKey(shortcut++)); + m->addItem(mf); +#if 0 + mf = new CMenuForwarder(LOCALE_LIVESTREAM_RESOLUTION, _mode_webtv, NULL, new CWebTVResolution(), NULL, CRCInput::convertDigitToKey(shortcut++)); + m->addItem(mf); +#endif + + m->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_WEBTV_XML)); + item_offset = m->getItemsCount(); for (std::list::iterator it = g_settings.webtv_xml.begin(); it != g_settings.webtv_xml.end(); ++it) m->addItem(new CMenuForwarder(*it, true, NULL, this, "c")); + m->setFooter(CWebTVSetupFooterButtons, CWebTVSetupFooterButtonCount); //Why we need here an extra buttonbar? int res = m->exec(NULL, ""); @@ -131,4 +165,57 @@ int CWebTVSetup::Show() return res; } -// vim:ts=4 + +/* ## CWebTVResolution ############################################# */ + +CWebTVResolution::CWebTVResolution() +{ + width = 40; +} + +int CWebTVResolution::exec(CMenuTarget* parent, const std::string& /*actionKey*/) +{ + if (parent) + parent->hide(); + + return Show(); +} + +int CWebTVResolution::Show() +{ + m = new CMenuWidget(LOCALE_WEBTV_HEAD, NEUTRINO_ICON_MOVIEPLAYER, width, MN_WIDGET_ID_LIVESTREAM_RESOLUTION); + m->addIntroItems(LOCALE_LIVESTREAM_HEAD); + + CMenuOptionChooser *mc; + mc = new CMenuOptionChooser(LOCALE_LIVESTREAM_RESOLUTION, &g_settings.livestreamResolution, + LIVESTREAM_RESOLUTION_OPTIONS, LIVESTREAM_RESOLUTION_OPTION_COUNT, + true, NULL, CRCInput::RC_nokey, NULL, true); + m->addItem(mc); + + int oldRes = g_settings.livestreamResolution; + int res = m->exec(NULL, ""); + m->hide(); + delete m; + + bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv) && + (!CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()); + if (oldRes != g_settings.livestreamResolution && _mode_webtv) { + CZapitChannel * cc = CZapit::getInstance()->GetCurrentChannel(); + if (cc && IS_WEBTV(cc->getChannelID())) { + CMoviePlayerGui::getInstance().stopPlayBack(); + CMoviePlayerGui::getInstance().PlayBackgroundStart(cc->getUrl(), cc->getName(), cc->getChannelID(), cc->getScriptName()); + } + } + + return res; +} + +const char *CWebTVResolution::getResolutionValue() +{ + for (unsigned int i = 0; i < LIVESTREAM_RESOLUTION_OPTION_COUNT; ++i) + { + if (g_settings.livestreamResolution == LIVESTREAM_RESOLUTION_OPTIONS[i].key) + return LIVESTREAM_RESOLUTION_OPTIONS[i].valname; + } + return ""; +} diff --git a/src/gui/webtv_setup.h b/src/gui/webtv_setup.h index ed6d4ab96..698719ee8 100644 --- a/src/gui/webtv_setup.h +++ b/src/gui/webtv_setup.h @@ -40,4 +40,17 @@ class CWebTVSetup : public CMenuTarget int exec(CMenuTarget* parent, const std::string & actionKey); int Show(); }; + +class CWebTVResolution : public CMenuTarget +{ + private: + int width; + CMenuWidget *m; + public: + CWebTVResolution(); + const char *getResolutionValue(); + int exec(CMenuTarget* parent, const std::string & actionKey); + int Show(); +}; + #endif diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index 07b1dad7c..f94cfc237 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -28,7 +28,6 @@ #include #include -#include #include #include @@ -97,7 +96,7 @@ int paintButtons( const button_label_ext * const content, int *wantedheight) { CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); - Font * font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; + Font * font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]; int cnt = count; int x_footer = x; int y_footer = y; @@ -195,7 +194,7 @@ int paintButtons( const button_label_ext * const content, //paint footer if (w_footer > 0) - frameBuffer->paintBoxRel(x_footer, y_footer, w_footer, h_footer, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); //round + frameBuffer->paintBoxRel(x_footer, y_footer, w_footer, h_footer, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); //round //baseline @@ -221,12 +220,15 @@ int paintButtons( const button_label_ext * const content, } if (spacing >= 0) - { /* add half of the inter-object space to the */ - spacing /= count_labels; /* left and right (this might break vertical */ - x_button += spacing / 2; /* alignment, but nobody is using this (yet) */ - } /* and I'm don't know how it should work. */ + { + int tmp = count_labels ? count_labels : 1;//avoid division by zero + /* add half of the inter-object space to the */ + spacing /= tmp; /* left and right (this might break vertical */ + x_button += spacing / 2; /* alignment, but nobody is using this (yet) */ + } /* and I'm don't know how it should work. */ else { + w_text = w_text ? w_text : 1; /* shorten captions relative to their length */ for (int i = 0; i < cnt; i++) fwidth[i] = (fwidth[i] * (w_text + spacing)) / w_text; /* spacing is negative...*/ @@ -247,7 +249,7 @@ int paintButtons( const button_label_ext * const content, // paint icon and text frameBuffer->paintIcon(icon, x_button , y_base - iconh[j]/2); x_caption = x_button + iconw[j] + h_space; - font->RenderString(x_caption, y_caption, fwidth[j], caption, COL_INFOBAR_SHADOW_TEXT); + font->RenderString(x_caption, y_caption, fwidth[j], caption, COL_MENUFOOT_TEXT); /* set next startposition x, if text is length=0 then offset is =renderwidth of icon, * for generating buttons without captions, @@ -281,7 +283,7 @@ int paintButtons( const button_label_ext * const content, * stuff below here was obviously not tested recently * vertical_paint optional, default value is false (horizontal) sets direction of painted buttons - * fcolor optional, default value is COL_INFOBAR_SHADOW_TEXT, use it to render font with other color + * fcolor optional, default value is COL_MENUFOOT_TEXT, use it to render font with other color * alt_buttontext optional, default NULL, overwrites button caption at definied buttonlabel id (see parameter alt_buttontext_id) with this text * alt_buttontext_id optional, default 0, means id from buttonlable struct which text you will change * show optional, default value is true (show button), if false, then no show and return the height of the button. @@ -303,7 +305,7 @@ int paintButtons( const int &x, const std::vector& /*all_buttontext_id*/) { CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); - Font * font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]; + Font * font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]; uint cnt = count; int x_footer = x; int y_footer = y; @@ -389,7 +391,7 @@ int paintButtons( const int &x, //paint footer if (w_footer > 0) - frameBuffer->paintBoxRel(x_footer, y_footer, w_footer, h_footer, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); //round + frameBuffer->paintBoxRel(x_footer, y_footer, w_footer, h_footer, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); //round //baseline @@ -410,8 +412,9 @@ int paintButtons( const int &x, else { /* shorten captions relative to their length */ + int tmp = w_text ? w_text : 1;//avoid division by zero for (i = 0; i < cnt; i++) - fwidth[i] = (fwidth[i] * (w_text + spacing)) / w_text; /* spacing is negative...*/ + fwidth[i] = (fwidth[i] * (w_text + spacing)) / tmp; /* spacing is negative...*/ spacing = 0; } diff --git a/src/gui/widget/buttons.h b/src/gui/widget/buttons.h index ad52669b2..2f1e75395 100644 --- a/src/gui/widget/buttons.h +++ b/src/gui/widget/buttons.h @@ -83,7 +83,7 @@ int paintButtons( const int &x, const int &footerheight = 0, std::string tmp = "", /* just to make sure compilation breaks */ bool vertical_paint = false, - const uint32_t fcolor = COL_INFOBAR_SHADOW_TEXT, + const uint32_t fcolor = COL_MENUFOOT_TEXT, const char * alt_buttontext = NULL, const uint &buttontext_id = 0, bool show = true, diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index e2924c173..a1eef250c 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -229,17 +229,16 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) *value[VALUE_ALPHA] = a_alt; loop = false; break; - - case CRCInput::RC_sat: - case CRCInput::RC_favorites: - break; case CRCInput::RC_timeout: case CRCInput::RC_ok: loop = false; break; - default: - if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) + if (CNeutrinoApp::getInstance()->listModeKey(msg)) + { + break; + } + else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { loop = false; res = menu_return::RETURN_EXIT_ALL; diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index eb9900a58..febb0f5fa 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -174,10 +174,10 @@ void CHintBox::refresh(void) return; } - //window->paintBoxRel(borderwidth, height, width, borderwidth, COL_INFOBAR_SHADOW_PLUS_0); - //window->paintBoxRel(width, borderwidth, borderwidth, height - borderwidth, COL_INFOBAR_SHADOW_PLUS_0); - window->paintBoxRel(width - 20, borderwidth, borderwidth + 20, height - borderwidth - 20, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_TOP); // right - window->paintBoxRel(borderwidth, height-20, width, borderwidth+20, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); // bottom + //window->paintBoxRel(borderwidth, height, width, borderwidth, COL_SHADOW_PLUS_0); + //window->paintBoxRel(width, borderwidth, borderwidth, height - borderwidth, COL_SHADOW_PLUS_0); + window->paintBoxRel(width - 20, borderwidth, borderwidth + 20, height - borderwidth - 20, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_TOP); // right + window->paintBoxRel(borderwidth, height-20, width, borderwidth+20, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); // bottom CComponentsHeader header(window->x, window->y, width, theight, caption, iconfile); header.paint(CC_SAVE_SCREEN_NO); @@ -210,9 +210,9 @@ void CHintBox::refresh(void) if (entries_per_page < line.size()) { ypos = theight + (fheight >> 1); - window->paintBoxRel(width - 15, ypos , 15, entries_per_page * fheight, COL_MENUCONTENT_PLUS_1); + window->paintBoxRel(width - 15, ypos, 15, entries_per_page * fheight, COL_SCROLLBAR_PASSIVE_PLUS_0); unsigned int marker_size = (entries_per_page * fheight) / ((line.size() + entries_per_page - 1) / entries_per_page); - window->paintBoxRel(width - 13, ypos + current_page * marker_size, 11, marker_size , COL_MENUCONTENT_PLUS_3); + window->paintBoxRel(width - 13, ypos + current_page * marker_size, 11, marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0); } } @@ -290,7 +290,8 @@ int ShowHint(const char * const Caption, const char * const Text, const int Widt else hintBox->scroll_down(); } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if(msg == CRCInput::RC_mode) { res = messages_return::handled; diff --git a/src/gui/widget/hintboxext.cpp b/src/gui/widget/hintboxext.cpp index 11ac55675..ea89a0f1b 100644 --- a/src/gui/widget/hintboxext.cpp +++ b/src/gui/widget/hintboxext.cpp @@ -47,9 +47,7 @@ CHintBoxExt::CHintBoxExt(const neutrino_locale_t Caption, const char * const Tex { m_message = strdup(Text); - char *begin = m_message; - - begin = strtok(m_message, "\n"); + char *begin = strtok(m_message, "\n"); while (begin != NULL) { std::vector oneLine; @@ -67,9 +65,7 @@ CHintBoxExt::CHintBoxExt(const std::string &CaptionString, const char * const Te { m_message = strdup(Text); - char *begin = m_message; - - begin = strtok(m_message, "\n"); + char *begin = strtok(m_message, "\n"); while (begin != NULL) { std::vector oneLine; @@ -203,7 +199,7 @@ void CHintBoxExt::init(const neutrino_locale_t Caption, const std::string &Capti // printf("pages: %d, startEntryVec: %d\n",page+1,m_startEntryOfPage.size()-1); // printf("maxEntries: %d\n", m_maxEntriesPerPage); - m_width = w_max(maxWidth,SHADOW_OFFSET); + m_width = w_max(maxWidth,OFFSET_SHADOW); m_currentPage = 0; m_pages = page + 1; unsigned int additional_width; @@ -231,7 +227,7 @@ void CHintBoxExt::init(const neutrino_locale_t Caption, const std::string &Capti /* if the output does not fit, make sure we at least * stay inside the screen... */ - m_width = w_max(m_width ,SHADOW_OFFSET); + m_width = w_max(m_width ,OFFSET_SHADOW); if (maxLineWidth + scrollWidth > m_width) maxLineWidth = m_width - scrollWidth; @@ -254,10 +250,10 @@ void CHintBoxExt::paint(bool toround) } bgPainted = false; - m_window = new CFBWindow(getScreenStartX(m_width + SHADOW_OFFSET), - getScreenStartY(m_height + SHADOW_OFFSET), - m_width + SHADOW_OFFSET, - m_height + SHADOW_OFFSET); + m_window = new CFBWindow(getScreenStartX(m_width + OFFSET_SHADOW), + getScreenStartY(m_height + OFFSET_SHADOW), + m_width + OFFSET_SHADOW, + m_height + OFFSET_SHADOW); refresh(toround); } @@ -271,7 +267,7 @@ void CHintBoxExt::refresh(bool toround) if (!bgPainted) { // bottom, right shadow - m_window->paintBoxRel(SHADOW_OFFSET, SHADOW_OFFSET, m_width, m_height, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, toround ? CORNER_ALL : CORNER_BOTTOM | CORNER_TOP_RIGHT); + m_window->paintBoxRel(OFFSET_SHADOW, OFFSET_SHADOW, m_width, m_height, COL_SHADOW_PLUS_0, RADIUS_LARGE, toround ? CORNER_ALL : CORNER_BOTTOM | CORNER_TOP_RIGHT); bgPainted = true; } @@ -343,9 +339,9 @@ void CHintBoxExt::refresh(bool toround) { // yPos = m_theight + (m_fheight >> 1); yPos = m_theight; - m_window->paintBoxRel(m_width - 15, yPos, 15, m_maxEntriesPerPage * m_fheight, COL_MENUCONTENT_PLUS_1); + m_window->paintBoxRel(m_width - 15, yPos, 15, m_maxEntriesPerPage * m_fheight, COL_SCROLLBAR_PASSIVE_PLUS_0); unsigned int marker_size = (m_maxEntriesPerPage * m_fheight) / m_pages; - m_window->paintBoxRel(m_width - 13, yPos + m_currentPage * marker_size, 11, marker_size, COL_MENUCONTENT_PLUS_3); + m_window->paintBoxRel(m_width - 13, yPos + m_currentPage * marker_size, 11, marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0); } } diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index 2b5264475..0d20fa35d 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -179,6 +179,9 @@ #define NEUTRINO_ICON_RECORDING_EVENT_MARKER "rec_event_marker" #define NEUTRINO_ICON_ZAP "zap" #define NEUTRINO_ICON_PIP "pip" +#define NEUTRINO_ICON_STAR_ON "star-on" +#define NEUTRINO_ICON_STAR_OFF "star-off" +#define NEUTRINO_ICON_TMDB "tmdb" #define DUMMY_ICON "dummy" @@ -204,6 +207,7 @@ #define NEUTRINO_ICON_HINT_SHUTDOWN "hint_shutdown" #define NEUTRINO_ICON_HINT_INFO "hint_info" #define NEUTRINO_ICON_HINT_CI "hint_ci" +#define NEUTRINO_ICON_HINT_ADZAP "hint_adzap" /* media */ #define NEUTRINO_ICON_HINT_APLAY "hint_aplay" #define NEUTRINO_ICON_HINT_INET_RADIO "hint_inetradio" diff --git a/src/gui/widget/keyboard_input.cpp b/src/gui/widget/keyboard_input.cpp index cc4eaf6f3..72cd73dfc 100644 --- a/src/gui/widget/keyboard_input.cpp +++ b/src/gui/widget/keyboard_input.cpp @@ -530,9 +530,9 @@ int CKeyboardInput::exec(CMenuTarget* parent, const std::string &) fb_pixel_t * pixbuf = NULL; if (!parent) { - pixbuf = new fb_pixel_t[(width + SHADOW_OFFSET) * (height + SHADOW_OFFSET)]; + pixbuf = new fb_pixel_t[(width + OFFSET_SHADOW) * (height + OFFSET_SHADOW)]; if (pixbuf) - frameBuffer->SaveScreen(x, y, width + SHADOW_OFFSET, height + SHADOW_OFFSET, pixbuf); + frameBuffer->SaveScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixbuf); } paint(); @@ -610,8 +610,9 @@ int CKeyboardInput::exec(CMenuTarget* parent, const std::string &) loop = false; res = menu_return::RETURN_EXIT_REPAINT; } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else { @@ -625,7 +626,7 @@ int CKeyboardInput::exec(CMenuTarget* parent, const std::string &) if (pixbuf) { - frameBuffer->RestoreScreen(x, y, width + SHADOW_OFFSET, height + SHADOW_OFFSET, pixbuf); + frameBuffer->RestoreScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixbuf); delete[] pixbuf; } else hide(); @@ -643,7 +644,7 @@ int CKeyboardInput::exec(CMenuTarget* parent, const std::string &) void CKeyboardInput::hide() { - frameBuffer->paintBackgroundBoxRel(x, y, width + SHADOW_OFFSET, height + SHADOW_OFFSET); + frameBuffer->paintBackgroundBoxRel(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW); } int CKeyboardInput::paintFooter(bool show) @@ -667,7 +668,7 @@ int CKeyboardInput::paintFooter(bool show) void CKeyboardInput::paint() { - frameBuffer->paintBoxRel(x + SHADOW_OFFSET, y + SHADOW_OFFSET, width, height, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE, CORNER_ALL); //round + frameBuffer->paintBoxRel(x + OFFSET_SHADOW, y + OFFSET_SHADOW, width, height, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_ALL); //round frameBuffer->paintBoxRel(x, y + hheight, width, bheight, COL_MENUCONTENT_PLUS_0); CComponentsHeader header(x, y, width, hheight, head, iconfile); @@ -714,19 +715,10 @@ void CKeyboardInput::paintChar(int pos, std::string &c) fb_pixel_t color; fb_pixel_t bgcolor; - if (pos == selected) - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } + getItemColors(color, bgcolor, pos == selected); - frameBuffer->paintBoxRel(xpos, ypos, input_w, input_h, COL_MENUCONTENT_PLUS_2); - frameBuffer->paintBoxRel(xpos+ 1, ypos+ 1, input_w- 2, input_h- 2, bgcolor); + frameBuffer->paintBoxRel(xpos, ypos, input_w, input_h, bgcolor); + frameBuffer->paintBoxFrame(xpos, ypos, input_w, input_h, 1, COL_MENUCONTENT_PLUS_2); int ch_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(c); int ch_x = xpos + std::max(input_w/2 - ch_w/2, 0); @@ -748,19 +740,16 @@ void CKeyboardInput::paintKey(int row, int column) //key_y = y+ hheight+ offset+ input_h+ offset; int ypos = key_y + (key_h + KEY_BORDER)*row; + int i_selected = (focus == FOCUS_KEY && row == srow && column == scol); + fb_pixel_t color; fb_pixel_t bgcolor; - if (focus == FOCUS_KEY && row == srow && column == scol) { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } else { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } - int radius = CORNER_RADIUS_SMALL; + getItemColors(color, bgcolor, i_selected); + + int radius = RADIUS_SMALL; frameBuffer->paintBoxRel(xpos, ypos, key_w, key_h, bgcolor, radius); - frameBuffer->paintBoxFrame(xpos, ypos, key_w, key_h, KEY_FRAME_WIDTH, COL_MENUCONTENT_PLUS_6, radius); + frameBuffer->paintBoxFrame(xpos, ypos, key_w, key_h, KEY_FRAME_WIDTH, COL_FRAME_PLUS_0, radius); if (keyboard[row][column].empty()) return; diff --git a/src/gui/widget/listbox.cpp b/src/gui/widget/listbox.cpp index 683fbac03..4698459bb 100644 --- a/src/gui/widget/listbox.cpp +++ b/src/gui/widget/listbox.cpp @@ -68,14 +68,14 @@ void CListBox::paint() int ypos = y+ theight; int sb = fheight* listmaxshow; - frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); + frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_SCROLLBAR_PASSIVE_PLUS_0); int sbc= ((getItemCount()- 1)/ listmaxshow)+ 1; int sbs= (selected/listmaxshow); if (sbc < 1) sbc = 1; - frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); + frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_SCROLLBAR_ACTIVE_PLUS_0); } void CListBox::paintHead() @@ -125,16 +125,7 @@ void CListBox::paintItem(unsigned int /*itemNr*/, int paintNr, bool pselected) fb_pixel_t color; fb_pixel_t bgcolor; - if (pselected) - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } + getItemColors(color, bgcolor, pselected); frameBuffer->paintBoxRel(x,ypos, width- 15, getItemHeight(), bgcolor); g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 10, ypos+ fheight, width-20, "demo", color); @@ -221,13 +212,13 @@ int CListBox::exec(CMenuTarget* parent, const std::string & /*actionKey*/) { onBlueKeyPressed(); } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else { CNeutrinoApp::getInstance()->handleMsg( msg, data ); - // kein canceling... } } diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index 2db6ed003..3e34451d9 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -66,17 +66,11 @@ #define MIN_WINDOW_WIDTH (frameBuffer->getScreenWidth() >> 1) #define MIN_WINDOW_HEIGHT 40 -#define TITLE_BACKGROUND_COLOR ((CFBWindow::color_t)COL_MENUHEAD_PLUS_0) -#define HEADER_LIST_BACKGROUND_COLOR ((CFBWindow::color_t)COL_MENUCONTENT_PLUS_0) -#define LIST_BACKGROUND_COLOR ((CFBWindow::color_t)COL_MENUCONTENT_PLUS_0) -//#define LIST_BACKGROUND_COLOR_SELECTED ((CFBWindow::color_t)COL_MENUCONTENT_PLUS_1) -#define LIST_BACKGROUND_COLOR_SELECTED ((CFBWindow::color_t)COL_MENUCONTENTSELECTED_PLUS_0) - +#define TITLE_BACKGROUND_COLOR COL_MENUHEAD_PLUS_0 #define TITLE_FONT_COLOR COL_MENUHEAD_TEXT + +#define HEADER_LIST_BACKGROUND_COLOR COL_MENUCONTENT_PLUS_0 #define HEADER_LIST_FONT_COLOR COL_MENUCONTENT_TEXT -#define LIST_FONT_COLOR COL_MENUCONTENT_TEXT -//#define LIST_FONT_COLOR_SELECTED COL_MENUCONTENT_TEXT -#define LIST_FONT_COLOR_SELECTED COL_MENUCONTENTSELECTED_TEXT #define FONT_LIST g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2] #define FONT_HEADER_LIST g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1] @@ -377,12 +371,12 @@ void CListFrame::refreshScroll(void) if (m_nNrOfPages > 1) { frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, - m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_MENUCONTENT_PLUS_1); + m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_SCROLLBAR_PASSIVE_PLUS_0); unsigned int marker_size = m_cFrameScrollRel.iHeight / m_nNrOfPages; frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX, m_cFrameScrollRel.iY + m_nCurrentPage * marker_size +m_cFrame.iY, m_cFrameScrollRel.iWidth - (2*SCROLL_MARKER_BORDER), - marker_size, COL_MENUCONTENT_PLUS_3); + marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0); } else { @@ -410,7 +404,7 @@ void CListFrame::refreshList(void) //TRACE("[CListFrame]->refreshList: %d\r\n",m_nCurrentLine); if( frameBuffer == NULL) return; frameBuffer->paintBoxRel(m_cFrameListRel.iX+m_cFrame.iX, m_cFrameListRel.iY+m_cFrame.iY, - m_cFrameListRel.iWidth, m_cFrameListRel.iHeight, LIST_BACKGROUND_COLOR); + m_cFrameListRel.iWidth, m_cFrameListRel.iHeight, COL_MENUCONTENT_PLUS_0); if( m_nNrOfLines <= 0) return; @@ -432,27 +426,19 @@ void CListFrame::refreshLine(int line) if((line < m_nCurrentLine) && (line > m_nCurrentLine + m_nLinesPerPage)) return; - uint32_t color, bgcolor; + fb_pixel_t color, bgcolor; int rel_line = line - m_nCurrentLine; int y = m_cFrameListRel.iY + TEXT_BORDER_WIDTH + (rel_line*m_nFontListHeight); int radius = 0; + bool selected = (line == m_nSelectedLine && m_showSelection == true); bool marked = (!m_pLines->marked.empty() && m_pLines->marked[line]); - if(line == m_nSelectedLine && m_showSelection == true) - { - color = marked ? COL_MENUCONTENTINACTIVE_TEXT : LIST_FONT_COLOR_SELECTED; - bgcolor = marked ? COL_MENUCONTENTSELECTED_PLUS_2 : LIST_BACKGROUND_COLOR_SELECTED; + + getItemColors(color, bgcolor, selected, marked); + + if (selected || marked) radius = RADIUS_LARGE; - } - else if (marked) { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_2; - } - else - { - color = LIST_FONT_COLOR; - bgcolor = LIST_BACKGROUND_COLOR; - } + frameBuffer->paintBoxRel(m_cFrameListRel.iX+m_cFrame.iX, y+m_cFrame.iY, m_cFrameListRel.iWidth, m_nFontListHeight, bgcolor, radius); diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index c524fb3bc..865741f92 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -253,7 +253,7 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text fb_pixel_t right_frame_col, right_bg_col; if (active) { right_bg_col = right_bgcol; - right_frame_col = COL_MENUCONTENT_PLUS_6; + right_frame_col = COL_FRAME_PLUS_0; } else { right_bg_col = COL_MENUCONTENTINACTIVE_TEXT; @@ -261,7 +261,7 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text } CComponentsShapeSquare col(stringstartposOption, y + 2, dx - stringstartposOption + x - 2, item_height - 4, NULL, false, right_frame_col, right_bg_col); col.setFrameThickness(3); - col.setCorner(RADIUS_LARGE); + col.setCorner(RADIUS_SMALL); col.paint(false); } if (*right_text) { @@ -379,7 +379,7 @@ void CMenuItem::paintItemButton(const bool select_mode, int item_height, const c if (icon_w>0 && icon_h>0) { - icon_painted = frameBuffer->paintIcon(iconName_Info_right, dx + icon_start_x - (icon_w + 20), y+ ((item_height/2- icon_h/2)) ); + frameBuffer->paintIcon(iconName_Info_right, dx + icon_start_x - (icon_w + 20), y+ ((item_height/2- icon_h/2)) ); } } } @@ -677,8 +677,10 @@ void CMenuWidget::resetWidget(bool delete_items) { for(unsigned int count=0;countisStatic) + if (delete_items && !item->isStatic){ delete item; + item = NULL; + } } items.clear(); @@ -811,6 +813,10 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) if (titem->isSelectable()) { items[selected]->paint( false ); selected= i; + if (selected > page_start[current_page + 1] || selected < page_start[current_page]) { + /* different page */ + paintItems(); + } paintHint(selected); pos = selected; if (titem->directKeyOK) @@ -959,12 +965,8 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) break; case (CRCInput::RC_timeout): break; - - case (CRCInput::RC_sat): - case (CRCInput::RC_favorites): - g_RCInput->postMsg (msg, 0); - //close any menue on dbox-key case (CRCInput::RC_setup): + //close any menu on menu-key { msg = CRCInput::RC_timeout; retval = menu_return::RETURN_EXIT_ALL; @@ -981,7 +983,12 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) break; default: - if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { + if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + g_RCInput->postMsg (msg, 0); + retval = menu_return::RETURN_EXIT_ALL; + msg = CRCInput::RC_timeout; + } + else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { retval = menu_return::RETURN_EXIT_ALL; msg = CRCInput::RC_timeout; } @@ -1184,8 +1191,8 @@ void CMenuWidget::calcSize() if(total_pages > 1) sb_width=15; - full_width = /*ConnectLineBox_Width+*/width+sb_width+SHADOW_OFFSET; - full_height = height+RADIUS_LARGE+SHADOW_OFFSET*2 /*+hint_height+INFO_BOX_Y_OFFSET*/; + full_width = /*ConnectLineBox_Width+*/width+sb_width+OFFSET_SHADOW; + full_height = height+RADIUS_LARGE+OFFSET_SHADOW*2 /*+hint_height+OFFSET_INTER*/; /* + ConnectLineBox_Width for the hintbox connection line * + center_offset for symmetry * + 20 for setMenuPos calculates 10 pixels border left and right */ @@ -1193,7 +1200,7 @@ void CMenuWidget::calcSize() int max_possible = (int)frameBuffer->getScreenWidth() - ConnectLineBox_Width - center_offset - 20; if (full_width > max_possible) { - width = max_possible - sb_width - SHADOW_OFFSET; + width = max_possible - sb_width - OFFSET_SHADOW; full_width = max_possible + center_offset; /* symmetry in MENU_POS_CENTER case */ } @@ -1235,14 +1242,14 @@ void CMenuWidget::paint() header->enableShadow(CC_SHADOW_RIGHT); header->setOffset(10); } - header->setColorBody(COL_MENUHEAD_PLUS_0); - header->setColorShadow(COL_MENUCONTENTDARK_PLUS_0); + header->setColorAll(COL_FRAME_PLUS_0, COL_MENUHEAD_PLUS_0, COL_SHADOW_PLUS_0); header->setCaptionColor(COL_MENUHEAD_TEXT); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0); + header->enableGradientBgCleanUp(savescreen); header->paint(CC_SAVE_SCREEN_NO); // paint body shadow - frameBuffer->paintBoxRel(x+SHADOW_OFFSET, y + hheight + SHADOW_OFFSET, width + sb_width, height - hheight + RADIUS_LARGE + (fbutton_count ? fbutton_height : 0), COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x+OFFSET_SHADOW, y + hheight + OFFSET_SHADOW, width + sb_width, height - hheight + RADIUS_LARGE + (fbutton_count ? fbutton_height : 0), COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); // paint body background frameBuffer->paintBoxRel(x, y+hheight, width + sb_width, height-hheight + RADIUS_LARGE, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, (fbutton_count ? CORNER_NONE : CORNER_BOTTOM)); @@ -1302,9 +1309,9 @@ void CMenuWidget::paintItems() //Item not currently on screen if (selected >= 0) { - while (selected < page_start[current_page]) + while (current_page > 0 && selected < page_start[current_page]) current_page--; - while (selected >= page_start[current_page + 1]) + while (current_page+1 < page_start.size() && selected >= page_start[current_page + 1]) current_page++; } @@ -1312,8 +1319,8 @@ void CMenuWidget::paintItems() if(total_pages>1) { int item_height=height-(item_start_y-y); - frameBuffer->paintBoxRel(x+ width,item_start_y, 15, item_height, COL_MENUCONTENT_PLUS_1, RADIUS_MIN); - frameBuffer->paintBoxRel(x+ width +2, item_start_y+ 2+ current_page*(item_height-4)/total_pages, 11, (item_height-4)/total_pages, COL_MENUCONTENT_PLUS_3, RADIUS_MIN); + frameBuffer->paintBoxRel(x+ width,item_start_y, 15, item_height, COL_SCROLLBAR_PASSIVE_PLUS_0, RADIUS_MIN); + frameBuffer->paintBoxRel(x+ width +2, item_start_y+ 2+ current_page*(item_height-4)/total_pages, 11, (item_height-4)/total_pages, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_MIN); /* background of menu items, paint every time because different items can have * different height and this might leave artifacts otherwise after changing pages */ frameBuffer->paintBoxRel(x,item_start_y, width,item_height, COL_MENUCONTENT_PLUS_0); @@ -1420,7 +1427,8 @@ void CMenuWidget::paintHint(int pos) /* clear info box */ if ((info_box) && (pos < 0)) savescreen ? info_box->hide() : info_box->kill(); - hint_painted = false; + if (info_box) + hint_painted = info_box->isPainted(); } if (pos < 0) return; @@ -1430,7 +1438,7 @@ void CMenuWidget::paintHint(int pos) if (!item->hintIcon && item->hint == NONEXISTANT_LOCALE && item->hintText.empty()) { if (info_box) { savescreen ? info_box->hide() : info_box->kill(); - hint_painted = false; + hint_painted = info_box->isPainted(); } return; } @@ -1441,15 +1449,15 @@ void CMenuWidget::paintHint(int pos) int iheight = item->getHeight(); int rad = RADIUS_LARGE; int xpos = x - ConnectLineBox_Width; - int ypos2 = y + height + fbutton_height + rad + SHADOW_OFFSET + INFO_BOX_Y_OFFSET; + int ypos2 = y + height + fbutton_height + rad + OFFSET_SHADOW + OFFSET_INTER; int iwidth = width+sb_width; //init details line and infobox dimensions int ypos1 = item->getYPosition(); - int ypos1a = ypos1 + (iheight/2)-2; - int ypos2a = ypos2 + (hint_height/2)-2; + int ypos1a = ypos1 + (iheight/2); + int ypos2a = ypos2 + (hint_height/2); int markh = hint_height > rad*2 ? hint_height - rad*2 : hint_height; - int imarkh = iheight/2+1; + int imarkh = iheight/2; //init details line if (details_line == NULL) @@ -1472,10 +1480,11 @@ void CMenuWidget::paintHint(int pos) info_box->removeLineBreaks(str); info_box->setText(str, CTextBox::AUTO_WIDTH, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT], COL_MENUCONTENT_TEXT); info_box->setCorner(RADIUS_LARGE); - info_box->setColorAll(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENTDARK_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); + info_box->setColorAll(COL_FRAME_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); + info_box->setTextColor(COL_MENUCONTENTDARK_TEXT); info_box->enableShadow(); info_box->setPicture(item->hintIcon ? item->hintIcon : ""); - info_box->enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction);// COL_INFOBAR_SHADOW_PLUS_1 is default footer color + info_box->enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_MENUFOOT_PLUS_0, g_settings.theme.menu_Hint_gradient_direction);// COL_MENUFOOT_PLUS_0 is default footer color //paint result if (details_line) @@ -1989,12 +1998,11 @@ int CMenuOptionChooser::paint( bool selected) int CMenuOptionChooser::getWidth(void) { - int ow = 0; int tw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(getName()); int width = tw; for(unsigned int count = 0; count < options.size(); count++) { - ow = 0; + int ow = 0; if (options[count].valname) ow = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(options[count].valname); else @@ -2251,7 +2259,7 @@ CMenuSeparator::CMenuSeparator(const int Type, const neutrino_locale_t Text, boo nameString = ""; } -CMenuSeparator::CMenuSeparator(const int Type, const std::string Text, bool IsStatic) : CMenuItem(false, CRCInput::RC_nokey, NULL, NULL, IsStatic) +CMenuSeparator::CMenuSeparator(const int Type, const std::string &Text, bool IsStatic) : CMenuItem(false, CRCInput::RC_nokey, NULL, NULL, IsStatic) { type = Type; name = NONEXISTANT_LOCALE; diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 97bf7bd26..104078179 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -190,7 +190,7 @@ class CMenuItem : public CComponentsSignals virtual int isMenueOptionChooser(void) const{return 0;} void setHint(const char * const icon, const neutrino_locale_t text) { hintIcon = (icon && *icon) ? icon : NULL; hint = text; } - void setHint(const char * const icon, const std::string text) { hintIcon = (icon && *icon) ? icon : NULL; hintText = text; } + void setHint(const char * const icon, const std::string &text) { hintIcon = (icon && *icon) ? icon : NULL; hintText = text; } void setLua(lua_State *_luaState, std::string &_luaAction, std::string &_luaId) { luaState = _luaState; luaAction = _luaAction; luaId = _luaId; }; virtual const char *getName(); @@ -226,7 +226,7 @@ class CMenuSeparator : public CMenuItem CMenuSeparator(const int Type = 0, const neutrino_locale_t Text = NONEXISTANT_LOCALE, bool IsStatic = false); - CMenuSeparator(const int Type, const std::string Text, bool IsStatic = false); + CMenuSeparator(const int Type, const std::string &Text, bool IsStatic = false); virtual ~CMenuSeparator(){} int paint(bool selected=false); diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index 0a5ef4356..bf6d22730 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -73,9 +73,9 @@ void CMessageBox::Init(const CMessageBox::result_ &Default, const uint32_t ShowB ih = std::max(h, ih); i_maxw = std::max(w, i_maxw); } - fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); - b_height = std::max(fh, ih) + 8 + (RADIUS_LARGE / 2); - m_bbheight = b_height + fh/2 + ButtonSpacing; + fh = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight(); + b_height = std::max(fh, ih) + 8 + (RADIUS_MID / 2); + m_bbheight = b_height + fh/2 + ButtonSpacing + OFFSET_SHADOW; result = Default; b_width = getButtonWidth(); if (ShowButtons & CMessageBox::mbBtnAlignCenter1) @@ -131,7 +131,7 @@ int CMessageBox::getButtonWidth() neutrino_locale_t localeMsg[localeMsgCount] = {LOCALE_MESSAGEBOX_YES, LOCALE_MESSAGEBOX_NO, LOCALE_MESSAGEBOX_CANCEL, LOCALE_MESSAGEBOX_OK, LOCALE_MESSAGEBOX_BACK}; int MaxButtonTextWidth = 0; for (int i = 0; i < localeMsgCount; i++) - MaxButtonTextWidth = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText(localeMsg[i])), MaxButtonTextWidth); + MaxButtonTextWidth = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getRenderWidth(g_Locale->getText(localeMsg[i])), MaxButtonTextWidth); return MaxButtonTextWidth + i_maxw + 36 + (RADIUS_LARGE / 2); } @@ -172,13 +172,15 @@ void CMessageBox::paintButtons() color = COL_MENUCONTENTSELECTED_TEXT; bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; } else { - color = COL_INFOBAR_SHADOW_TEXT; - bgcolor = COL_INFOBAR_SHADOW_PLUS_0; + color = COL_MENUCONTENTINACTIVE_TEXT; + bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } CFrameBuffer::getInstance()->getIconSize(Buttons[i].icon, &iw, &ih); - m_window->paintBoxRel(xpos, ypos, b_width, b_height, (CFBWindow::color_t)bgcolor, RADIUS_LARGE); + m_window->paintBoxRel(xpos + OFFSET_SHADOW, ypos + OFFSET_SHADOW, b_width, b_height, COL_SHADOW_PLUS_0, RADIUS_MID); + m_window->paintBoxRel(xpos, ypos, b_width, b_height, (CFBWindow::color_t)bgcolor, RADIUS_MID); + m_window->paintBoxFrame(xpos, ypos, b_width, b_height, 1, COL_SHADOW_PLUS_0, RADIUS_MID); m_window->paintIcon(Buttons[i].icon, xpos + ((b_height - ih) / 2), ypos + ((b_height - ih) / 2), ih); - m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], xpos + iw + 17, ypos + fh + ((b_height - fh) / 2), + m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT], xpos + iw + 17, ypos + fh + ((b_height - fh) / 2), b_width - (iw + 21), Buttons[i].text, (CFBWindow::color_t)color); xpos += b_width + ButtonDistance; } @@ -231,7 +233,7 @@ int CMessageBox::exec(int timeout) result = mbrYes; loop = false; } - else if(msg==CRCInput::RC_right) + else if(msg==CRCInput::RC_right && ButtonCount > 1) { bool ok = false; while (!ok) @@ -255,7 +257,7 @@ int CMessageBox::exec(int timeout) paintButtons(); } } - else if(msg==CRCInput::RC_left) + else if(msg==CRCInput::RC_left && ButtonCount > 1) { bool ok = false; while (!ok) @@ -271,8 +273,9 @@ int CMessageBox::exec(int timeout) { loop = false; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg) || (msg == CRCInput::RC_spkr)) { + // do nothing } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { @@ -289,7 +292,10 @@ int CMessageBox::exec(int timeout) int ShowMsg(const neutrino_locale_t Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) { - CMessageBox* messageBox = new CMessageBox(Caption, Text, Width, Icon, Default, ShowButtons); + std::string tmpText = "msg error"; + if(Text) + tmpText = Text; + CMessageBox* messageBox = new CMessageBox(Caption, tmpText.c_str(), Width, Icon, Default, ShowButtons); messageBox->returnDefaultValueOnTimeout(returnDefaultOnTimeout); messageBox->exec(timeout); int res = messageBox->result; @@ -300,7 +306,10 @@ int ShowMsg(const neutrino_locale_t Caption, const char * const Text, const CMes int ShowMsg(const std::string &Caption, const char * const Text, const CMessageBox::result_ &Default, const uint32_t ShowButtons, const char * const Icon, const int Width, const int timeout, bool returnDefaultOnTimeout) { - CMessageBox* messageBox = new CMessageBox(Caption, Text, Width, Icon, Default, ShowButtons); + std::string tmpText = "msg error"; + if(Text) + tmpText = Text; + CMessageBox* messageBox = new CMessageBox(Caption, tmpText.c_str(), Width, Icon, Default, ShowButtons); messageBox->returnDefaultValueOnTimeout(returnDefaultOnTimeout); messageBox->exec(timeout); int res = messageBox->result; diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 124b922f2..978b8401b 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -67,7 +67,7 @@ #define MIN_WINDOW_HEIGHT 40 #define DEFAULT_TITLE_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE] -#define DEFAULT_FOOT_FONT g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL] +#define DEFAULT_FOOT_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT] ////////////////////////////////////////////////////////////////////// // Construction/Destruction @@ -356,10 +356,12 @@ void CMsgBox::refreshFoot(void) } else { - color = COL_INFOBAR_SHADOW_TEXT; - bgcolor = COL_INFOBAR_SHADOW_PLUS_0; + color = COL_MENUCONTENTINACTIVE_TEXT; + bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } + m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + OFFSET_SHADOW, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + OFFSET_SHADOW, ButtonWidth, m_nFontFootHeight + 4, COL_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); + m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_RED, xpos + 14+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); /*m_pcWindow->RenderString(*/ m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 4 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth - 53, g_Locale->getText(LOCALE_MESSAGEBOX_YES), (CFBWindow::color_t)color); @@ -377,11 +379,12 @@ void CMsgBox::refreshFoot(void) } else { - color = COL_INFOBAR_SHADOW_TEXT; - bgcolor = COL_INFOBAR_SHADOW_PLUS_0; + color = COL_MENUCONTENTINACTIVE_TEXT; + bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } - + m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + OFFSET_SHADOW, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + OFFSET_SHADOW, ButtonWidth, m_nFontFootHeight + 4, COL_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); + m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, xpos + 14+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); /*m_pcWindow->RenderString(*/ m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 4 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth- 53, g_Locale->getText(LOCALE_MESSAGEBOX_NO), (CFBWindow::color_t)color); @@ -399,11 +402,12 @@ void CMsgBox::refreshFoot(void) } else { - color = COL_INFOBAR_SHADOW_TEXT; - bgcolor = COL_INFOBAR_SHADOW_PLUS_0; + color = COL_MENUCONTENTINACTIVE_TEXT; + bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; } - + m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX + OFFSET_SHADOW, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + OFFSET_SHADOW, ButtonWidth, m_nFontFootHeight + 4, COL_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID); + m_pcWindow->paintBoxFrame(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, 1, COL_SHADOW_PLUS_0, RADIUS_MID); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_HOME, xpos+10+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY); /*m_pcWindow->RenderString(*/ m_pcFontFoot->RenderString(xpos + 43+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + m_nFontFootHeight + 2 + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth- 53, g_Locale->getText((m_nFootButtons & mbCancel) ? LOCALE_MESSAGEBOX_CANCEL : LOCALE_MESSAGEBOX_BACK), (CFBWindow::color_t)color); @@ -480,7 +484,7 @@ void CMsgBox::refreshBorder(void) m_cBoxFrame.iHeight - m_nWindowFrameBorderWidth+m_cBoxFrame.iY - RADIUS_LARGE, m_cBoxFrame.iWidth - m_nWindowFrameBorderWidth - RADIUS_LARGE, m_nWindowFrameBorderWidth + RADIUS_LARGE, - COL_INFOBAR_SHADOW_PLUS_0, + COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM_LEFT); //draw right shadow @@ -488,7 +492,7 @@ void CMsgBox::refreshBorder(void) m_nWindowFrameBorderWidth+m_cBoxFrame.iY, m_nWindowFrameBorderWidth + RADIUS_LARGE, m_cBoxFrame.iHeight - m_nWindowFrameBorderWidth, - COL_INFOBAR_SHADOW_PLUS_0, + COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_RIGHT); } @@ -619,6 +623,13 @@ void CMsgBox::refresh(void) refreshTitle(); refreshFoot(); + //draw body + m_pcWindow->paintBoxRel( m_cBoxFrameText.iX, + m_cBoxFrameText.iY, + m_cBoxFrameText.iWidth, + m_cBoxFrameText.iHeight, + COL_MENUCONTENT_PLUS_0); + // rep-draw textbox if there is one if(m_pcTextBox != NULL) { @@ -719,8 +730,9 @@ int CMsgBox::exec( int timeout, int returnDefaultOnTimeout) { loop = false; } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { @@ -750,7 +762,6 @@ bool CMsgBox::setText(const std::string* newText) // update text in textbox if there is one if(m_pcTextBox != NULL && newText != NULL) { - lresult = m_pcTextBox->setText(newText); if(m_nMode & AUTO_WIDTH || m_nMode & AUTO_HIGH) { /* window might changed in size ...*/ @@ -768,6 +779,8 @@ bool CMsgBox::setText(const std::string* newText) m_cBoxFrame.iY = g_settings.screen_StartY + ((g_settings.screen_EndY - g_settings.screen_StartY - m_cBoxFrame.iHeight) >>1); } } + + lresult = m_pcTextBox->setText(newText); } return(lresult); diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 905778d67..852b3b5f2 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -69,9 +69,9 @@ void CProgressWindow::Init() local_bar->allowPaint(false); local_bar->setDimensionsAll(x_item, y_item, w_item, h_pbar); local_bar->setColorBody(col_body); - local_bar->setActiveColor(COL_MENUCONTENT_PLUS_7); + local_bar->setActiveColor(COL_PROGRESSBAR_ACTIVE_PLUS_0); local_bar->setFrameThickness(w_bar_frame); - local_bar->setColorFrame(COL_MENUCONTENT_PLUS_7); + local_bar->setColorFrame(COL_PROGRESSBAR_ACTIVE_PLUS_0); addWindowItem(local_bar); y_item += 2*h_pbar; @@ -80,9 +80,9 @@ void CProgressWindow::Init() global_bar->allowPaint(false); global_bar->setDimensionsAll(x_item, y_item, w_item, h_pbar); global_bar->setColorBody(col_body); - global_bar->setActiveColor(COL_MENUCONTENT_PLUS_7); + global_bar->setActiveColor(COL_PROGRESSBAR_ACTIVE_PLUS_0); global_bar->setFrameThickness(w_bar_frame); - global_bar->setColorFrame(COL_MENUCONTENT_PLUS_7); + global_bar->setColorFrame(COL_PROGRESSBAR_ACTIVE_PLUS_0); addWindowItem(global_bar); y_item += 2*h_pbar; diff --git a/src/gui/widget/shellwindow.cpp b/src/gui/widget/shellwindow.cpp index 60eab7cb3..a0602a68d 100644 --- a/src/gui/widget/shellwindow.cpp +++ b/src/gui/widget/shellwindow.cpp @@ -51,10 +51,14 @@ CShellWindow::CShellWindow(const std::string &Command, const int Mode, int *Res, textBox = NULL; frameBuffer = CFrameBuffer::getInstance(); - command = Command; - mode = Mode; - res = Res; + setCommand(Command, Mode, Res, auto_exec); +} +void CShellWindow::setCommand(const std::string &Command, const int Mode, int* Res, bool auto_exec) +{ + command = Command; + mode = Mode; + res = Res; if (auto_exec) exec(); } @@ -233,7 +237,7 @@ void CShellWindow::showResult() show_button = true; } else if (mode & ACKNOWLEDGE_EVENT){ - if (*res != 0){ + if (res && *res != 0){ OnResultError(res); if (OnResultError.empty()) DisplayErrorMessage("Error while execution of task. Please see window for details!"); diff --git a/src/gui/widget/shellwindow.h b/src/gui/widget/shellwindow.h index 75cbd88f5..c875a22e4 100644 --- a/src/gui/widget/shellwindow.h +++ b/src/gui/widget/shellwindow.h @@ -56,6 +56,10 @@ class CShellWindow : public sigc::trackable }; CShellWindow(const std::string &Command, const int Mode = 0, int* Res = NULL, bool auto_exec = true); ~CShellWindow(); + void setCommand(const std::string &Command, const int Mode = 0, int* Res = NULL, bool auto_exec = true); + std::string getCommand(){return command;} + int getMode(){return mode;} + void exec(); /*! diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index 4020f6fea..b47a99c4e 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -108,7 +108,7 @@ void CStringInput::init() #endif hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); iheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getHeight(); - fheight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight() + 6; // init min buttonbar height + fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight() + 6; // init min buttonbar height input_h = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight() + 2; // font height + border input_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("M") + 2; // hack font width + border offset = 20; @@ -394,9 +394,9 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & ) fb_pixel_t * pixbuf = NULL; if (!parent) { - pixbuf = new fb_pixel_t[(width + SHADOW_OFFSET) * (height + SHADOW_OFFSET)]; + pixbuf = new fb_pixel_t[(width + OFFSET_SHADOW) * (height + OFFSET_SHADOW)]; if (pixbuf) - frameBuffer->SaveScreen(x, y, width + SHADOW_OFFSET, height + SHADOW_OFFSET, pixbuf); + frameBuffer->SaveScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixbuf); } paint(); @@ -494,8 +494,9 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & ) loop=false; res = menu_return::RETURN_EXIT_REPAINT; } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else { @@ -518,7 +519,7 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & ) if (pixbuf) { - frameBuffer->RestoreScreen(x, y, width + SHADOW_OFFSET, height + SHADOW_OFFSET, pixbuf); + frameBuffer->RestoreScreen(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW, pixbuf); delete[] pixbuf;//Mismatching allocation and deallocation: pixbuf frameBuffer->blit(); } else @@ -540,13 +541,13 @@ int CStringInput::handleOthers(const neutrino_msg_t /*msg*/, const neutrino_msg_ void CStringInput::hide() { - frameBuffer->paintBackgroundBoxRel(x, y, width + SHADOW_OFFSET, height + SHADOW_OFFSET); + frameBuffer->paintBackgroundBoxRel(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW); frameBuffer->blit(); } void CStringInput::paint(bool sms) { - frameBuffer->paintBoxRel(x + SHADOW_OFFSET, y + SHADOW_OFFSET, width, height, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE, CORNER_ALL); //round + frameBuffer->paintBoxRel(x + OFFSET_SHADOW, y + OFFSET_SHADOW, width, height, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_ALL); //round frameBuffer->paintBoxRel(x, y + hheight, width, bheight, COL_MENUCONTENT_PLUS_0, sms ? 0 : RADIUS_LARGE, CORNER_BOTTOM); CComponentsHeader header(x, y, width, hheight, head, iconfile); @@ -600,19 +601,10 @@ void CStringInput::paintChar(int pos, const char c) fb_pixel_t color; fb_pixel_t bgcolor; - if (pos == selected) - { - color = COL_MENUCONTENTSELECTED_TEXT; - bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; - } - else - { - color = COL_MENUCONTENT_TEXT; - bgcolor = COL_MENUCONTENT_PLUS_0; - } + getItemColors(color, bgcolor, pos == selected); - frameBuffer->paintBoxRel(xpos, ypos, input_w, input_h, COL_MENUCONTENT_PLUS_2); - frameBuffer->paintBoxRel(xpos+ 1, ypos+ 1, input_w- 2, input_h- 2, bgcolor); + frameBuffer->paintBoxRel(xpos, ypos, input_w, input_h, bgcolor); + frameBuffer->paintBoxFrame(xpos, ypos, input_w, input_h, 1, COL_MENUCONTENT_PLUS_2); int ch_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(ch); int ch_x = xpos + std::max(input_w/2 - ch_w/2, 0); @@ -900,7 +892,7 @@ const char * CPLPINInput::getHint1(void) } } -#define borderwidth SHADOW_OFFSET // FIXME: do we need border around ?? +#define borderwidth OFFSET_SHADOW // FIXME: do we need border around ?? int CPLPINInput::exec( CMenuTarget* parent, const std::string & ) { diff --git a/src/gui/widget/stringinput.h b/src/gui/widget/stringinput.h index d460b2bae..2a8d9bcd4 100644 --- a/src/gui/widget/stringinput.h +++ b/src/gui/widget/stringinput.h @@ -95,7 +95,6 @@ class CStringInput : public CMenuTarget class CStringInputSMS : public CStringInput { - bool capsMode; int arraySizes[10]; char Chars[10][10]; // maximal 10 character in one CharList entry! diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index 803cc4843..4b4923e00 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -251,14 +251,14 @@ int CExtendedInput::exec( CMenuTarget* parent, const std::string & ) timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); } } else { - //keine nderungen - beenden ok loop=false; if(cancel != NULL) *cancel = true; } } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { @@ -310,7 +310,6 @@ void CExtendedInput::paint() tmp_y += iheight; g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_2), COL_MENUCONTENT_TEXT); } - tmp_y += offset; } for(unsigned int i=0; ipaintBoxRel(xpos, ypos, input_w, input_h, COL_MENUCONTENT_PLUS_2); - frameBuffer->paintBoxRel(xpos+ 1, ypos+ 1, input_w- 2, input_h- 2, bgcolor); + frameBuffer->paintBoxRel(xpos, ypos, input_w, input_h, bgcolor); + frameBuffer->paintBoxFrame(xpos, ypos, input_w, input_h, 1, COL_MENUCONTENT_PLUS_2); int ch_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(ch); int ch_x = xpos + std::max(input_w/2 - ch_w/2, 0); diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 5f33a725e..93358b8e4 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -51,6 +51,8 @@ ****************************************************************************/ +//#define VISUAL_DEBUG + #ifdef HAVE_CONFIG_H #include #endif @@ -59,6 +61,9 @@ #include #include "textbox.h" #include +#ifdef VISUAL_DEBUG +#include +#endif #define SCROLL_FRAME_WIDTH 10 #define SCROLL_MARKER_BORDER 2 @@ -69,7 +74,6 @@ #define MIN_WINDOW_WIDTH ((g_settings.screen_EndX - g_settings.screen_StartX)>>1) #define MIN_WINDOW_HEIGHT 40 - CTextBox::CTextBox(const char * text, Font* font_text, const int pmode, const CBox* position, CFBWindow::color_t textBackgroundColor) { @@ -97,7 +101,7 @@ CTextBox::CTextBox(const char * text, Font* font_text, const int pmode, //TRACE(" CTextBox::m_cText: %d, m_nMode %d\t\r\n",m_cText.size(),m_nMode); - m_textBackgroundColor = textBackgroundColor; + m_textBackgroundColor = m_old_textBackgroundColor = textBackgroundColor; m_nFontTextHeight = getFontTextHeight(); //TRACE("[CTextBox] %s Line %d\r\n", __FUNCTION__, __LINE__); @@ -160,8 +164,8 @@ void CTextBox::initVar(void) m_nLinesPerPage = 0; m_nCurrentLine = 0; m_nCurrentPage = 0; - text_Hborder_width = 8; //border left and right - text_Vborder_width = 8; //border top and buttom + text_Hborder_width = OFFSET_INNER_MID; //border left and right + text_Vborder_width = OFFSET_INNER_MID; //border top and buttom m_cFrame.iX = m_old_x = g_settings.screen_StartX + ((g_settings.screen_EndX - g_settings.screen_StartX - MIN_WINDOW_WIDTH) >>1); m_cFrame.iWidth = m_old_dx = MIN_WINDOW_WIDTH; @@ -249,7 +253,7 @@ void CTextBox::reSizeMainFrameWidth(int textWidth) { //TRACE("[CTextBox]->%s: \ntext width: %d\n m_cFrame.iWidth: %d\n m_cFrameTextRel.iWidth: %d\n m_nMaxWidth: %d\n m_nMinWidth: %d\n",__FUNCTION__, textWidth, m_cFrame.iWidth, m_cFrameTextRel.iWidth, m_nMaxWidth, m_nMinWidth); - int iNewWindowWidth = textWidth + m_cFrameScrollRel.iWidth + 2*text_Hborder_width; + int iNewWindowWidth = textWidth + m_cFrameScrollRel.iWidth + 2*text_Hborder_width; if( iNewWindowWidth > m_nMaxWidth) iNewWindowWidth = m_nMaxWidth; @@ -494,12 +498,12 @@ void CTextBox::refreshScroll(void) { frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, - COL_MENUCONTENT_PLUS_1); + COL_SCROLLBAR_PASSIVE_PLUS_0); unsigned int marker_size = m_cFrameScrollRel.iHeight / m_nNrOfPages; frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX, m_cFrameScrollRel.iY + m_nCurrentPage * marker_size+m_cFrame.iY, m_cFrameScrollRel.iWidth - 2*SCROLL_MARKER_BORDER, - marker_size, COL_MENUCONTENT_PLUS_3); + marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0); m_has_scrolled = true; } else @@ -563,7 +567,7 @@ void CTextBox::refreshText(void) //bg variables int ax = m_cFrameTextRel.iX+m_cFrame.iX; int ay = m_cFrameTextRel.iY+m_cFrame.iY; - int dx = m_cFrameTextRel.iWidth; + int dx = m_old_cText != m_cText || m_nNrOfPages>1 ? m_cFrameTextRel.iWidth : m_nMaxTextWidth; int dy = m_cFrameTextRel.iHeight; //find changes @@ -602,7 +606,8 @@ void CTextBox::refreshText(void) clearScreenBuffer(); if (allow_paint_bg){ //TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__); - frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType); + //paint full background only on new text, otherwise paint required background + frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType); } } else{ @@ -642,23 +647,33 @@ void CTextBox::refreshText(void) // fit into mid of frame space y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * lines) >> 1); +#ifdef VISUAL_DEBUG + frameBuffer->paintBoxRel(m_cFrame.iX, m_cFrame.iY, m_cFrame.iWidth, m_cFrame.iHeight, COL_GREEN); +#endif + for(i = m_nCurrentLine; i < m_nNrOfLines && i < m_nCurrentLine + m_nLinesPerPage; i++) { - //calculate centered xpos - if( m_nMode & CENTER ){ - x_center = ((m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i], m_utf8_encoded))>>1) - text_Hborder_width; - } - else if ( m_nMode & RIGHT ){ - x_center = ((m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i], m_utf8_encoded)) - text_Hborder_width*2); - if ( m_nMode & SCROLL ) + //calculate xpos + if ((m_nMode & CENTER) || (m_nMode & RIGHT)) + { + x_center = m_cFrameTextRel.iWidth - m_cFrameTextRel.iX - 2*text_Hborder_width - m_pcFontText->getRenderWidth(m_cLineArray[i], m_utf8_encoded); + if (m_nMode & CENTER) + x_center /= 2; + if (m_nMode & SCROLL) x_center -= SCROLL_FRAME_WIDTH; } x_center = std::max(x_center, 0); + int tx = m_cFrame.iX + m_cFrameTextRel.iX + text_Hborder_width + x_center; + int ty = m_cFrame.iY + y; + int tw = m_cFrameTextRel.iWidth - m_cFrameTextRel.iX - 2*text_Hborder_width - x_center; + +#ifdef VISUAL_DEBUG + int th = m_nFontTextHeight; + frameBuffer->paintBoxRel(tx, ty-th, tw, th, COL_RED); +#endif //TRACE("[CTextBox] %s Line %d m_cFrame.iX %d m_cFrameTextRel.iX %d\r\n", __FUNCTION__, __LINE__, m_cFrame.iX, m_cFrameTextRel.iX); - m_pcFontText->RenderString(m_cFrame.iX + m_cFrameTextRel.iX + text_Hborder_width + x_center, - y+m_cFrame.iY, m_cFrameTextRel.iWidth, m_cLineArray[i].c_str(), - m_textColor, 0, m_renderMode | (m_utf8_encoded) ? Font::IS_UTF8 : 0); + m_pcFontText->RenderString(tx, ty, tw, m_cLineArray[i].c_str(), m_textColor, 0, m_renderMode | (m_utf8_encoded) ? Font::IS_UTF8 : 0); m_old_cText = m_cText; y += m_nFontTextHeight; } diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index e895ece0e..cb5f26a24 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -61,7 +61,6 @@ #include #include -#include #include #define TRACE printf #define TRACE_1 printf diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 782e897f2..452135e4f 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -46,6 +46,8 @@ #include "global.h" #include "neutrino.h" +#include "neutrino_menue.h" +#include "version_pseudo.h" #include @@ -63,6 +65,7 @@ #include #include +#include "gui/adzap.h" #include "gui/audiomute.h" #include "gui/audioplayer.h" #include "gui/bouquetlist.h" @@ -136,9 +139,9 @@ #include #include #include - +#ifdef ENABLE_LUA #include - +#endif int old_b_id = -1; CInfoClock *InfoClock; @@ -185,11 +188,13 @@ CBouquetList * TVbouquetList; CBouquetList * TVsatList; CBouquetList * TVfavList; CBouquetList * TVallList; +CBouquetList * TVwebList; CBouquetList * RADIObouquetList; CBouquetList * RADIOsatList; CBouquetList * RADIOfavList; CBouquetList * RADIOallList; +CBouquetList * RADIOwebList; CBouquetList * AllFavBouquetList; @@ -231,6 +236,7 @@ CNeutrinoApp::CNeutrinoApp() SetupFrameBuffer(); mode = mode_unknown; + lastMode = mode_unknown; channelList = NULL; TVchannelList = NULL; RADIOchannelList = NULL; @@ -294,7 +300,7 @@ const lcd_setting_struct_t lcd_setting[SNeutrinoSettings::LCD_SETTING_COUNT] = static SNeutrinoSettings::usermenu_t usermenu_default[] = { { CRCInput::RC_red, "2,3,4,13", "", "red" }, { CRCInput::RC_green, "6", "", "green" }, - { CRCInput::RC_yellow, "7", "", "yellow" }, + { CRCInput::RC_yellow, "7,31", "", "yellow" }, { CRCInput::RC_blue, "12,11,20,21,19,14,29,30,15", "", "blue" }, { CRCInput::RC_play, "9", "", "5" }, { CRCInput::RC_audio, "27", "", "6" }, @@ -459,6 +465,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.backlight_standby = configfile.getInt32( "backlight_standby", 0); g_settings.backlight_deepstandby = configfile.getInt32( "backlight_deepstandby", 0); g_settings.lcd_scroll = configfile.getInt32( "lcd_scroll", 1); + g_settings.lcd_notify_rclock = configfile.getInt32("lcd_notify_rclock", 1); g_settings.hdd_fs = configfile.getInt32( "hdd_fs", 0); g_settings.hdd_sleep = configfile.getInt32( "hdd_sleep", 120); @@ -474,6 +481,18 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.shutdown_min = configfile.getInt32("shutdown_min", 180); g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0); + g_settings.timer_remotebox_ip.clear(); + int timer_remotebox_ip_count = configfile.getInt32("timer_remotebox_ip_count", 0); + if (timer_remotebox_ip_count) { + for (int i = 0; i < timer_remotebox_ip_count; i++) { + std::string k = "timer_remotebox_ip_" + to_string(i); + std::string timer_remotebox_ip = configfile.getString(k, ""); + if (timer_remotebox_ip.empty()) + continue; + g_settings.timer_remotebox_ip.push_back(timer_remotebox_ip); + } + } + g_settings.infobar_sat_display = configfile.getBool("infobar_sat_display" , true ); g_settings.infobar_show_channeldesc = configfile.getBool("infobar_show_channeldesc" , false ); g_settings.infobar_subchan_disp_pos = configfile.getInt32("infobar_subchan_disp_pos", 4); // subchan display in infobar @@ -500,7 +519,6 @@ 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); @@ -656,9 +674,10 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.recording_save_in_channeldir = configfile.getBool("recording_save_in_channeldir" , false); g_settings.recording_slow_warning = configfile.getBool("recording_slow_warning" , true); g_settings.recording_startstop_msg = configfile.getBool("recording_startstop_msg" , true); + g_settings.recording_already_found_check = configfile.getBool("recording_already_found_check", false); // default plugin for movieplayer - g_settings.movieplayer_plugin = configfile.getString( "movieplayer_plugin", "noplugin" ); + g_settings.movieplayer_plugin = configfile.getString( "movieplayer_plugin", "---" ); g_settings.plugin_hdd_dir = configfile.getString( "plugin_hdd_dir", "/media/sda1/plugins" ); g_settings.plugins_disabled = configfile.getString( "plugins_disabled", "" ); @@ -705,6 +724,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.spectrum = configfile.getBool("spectrum" , false); g_settings.channellist_additional = configfile.getInt32("channellist_additional", 1); //default no minitv g_settings.eventlist_additional = configfile.getInt32("eventlist_additional", 0); + g_settings.eventlist_epgplus = configfile.getInt32("eventlist_epgplus", 1); g_settings.channellist_epgtext_align_right = configfile.getBool("channellist_epgtext_align_right" , false); g_settings.channellist_progressbar_design = configfile.getInt32("channellist_progressbar_design", g_settings.progressbar_design); g_settings.channellist_foot = configfile.getInt32("channellist_foot", 0); //default transponder data @@ -825,10 +845,17 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.audioplayer_show_playlist = configfile.getInt32("audioplayer_show_playlist",1); g_settings.audioplayer_enable_sc_metadata = configfile.getInt32("audioplayer_enable_sc_metadata",1); g_settings.shoutcast_dev_id = configfile.getString("shoutcast_dev_id","XXXXXXXXXXXXXXXX"); + g_settings.shoutcast_enabled = configfile.getInt32("shoutcast_enabled", 1); + g_settings.shoutcast_enabled = check_shoutcast_dev_id(); //Movie-Player g_settings.movieplayer_repeat_on = configfile.getInt32("movieplayer_repeat_on", CMoviePlayerGui::REPEAT_OFF); g_settings.youtube_dev_id = configfile.getString("youtube_dev_id","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); + g_settings.youtube_enabled = configfile.getInt32("youtube_enabled", 1); + g_settings.youtube_enabled = check_youtube_dev_id(); + g_settings.tmdb_api_key = configfile.getString("tmdb_api_key","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); + g_settings.tmdb_enabled = configfile.getInt32("tmdb_enabled", 1); + g_settings.tmdb_enabled = check_tmdb_api_key(); //Filebrowser g_settings.filebrowser_showrights = configfile.getInt32("filebrowser_showrights", 1); @@ -855,6 +882,8 @@ int CNeutrinoApp::loadSetup(const char * fname) } g_settings.epg_search_history_size = g_settings.epg_search_history.size(); + g_settings.adzap_zapBackPeriod = configfile.getInt32("adzap_zapBackPeriod", 180); + g_settings.adzap_writeData = configfile.getInt32("adzap_writeData", 0); // USERMENU -> in system/settings.h //------------------------------------------- @@ -934,11 +963,37 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.infoClockBackground = configfile.getInt32("infoClockBackground", 0); g_settings.infoClockSeconds = configfile.getInt32("infoClockSeconds", 1); + g_settings.livestreamResolution = configfile.getInt32("livestreamResolution", 1920); + g_settings.livestreamScriptPath = configfile.getString("livestreamScriptPath", PLUGINDIR_VAR "/webtv"); + + g_settings.version_pseudo = configfile.getString("version_pseudo", "19700101000000"); + + if (g_settings.version_pseudo < NEUTRINO_VERSION_PSEUDO) + upgradeSetup(fname); + if(erg) configfile.setModifiedFlag(true); return erg; } +void CNeutrinoApp::upgradeSetup(const char * fname) +{ + if (g_settings.version_pseudo < "20160226110000") + { + if (g_settings.usermenu[SNeutrinoSettings::BUTTON_YELLOW]->items == "7") + { + g_settings.usermenu[SNeutrinoSettings::BUTTON_YELLOW]->items = "7,31"; + configfile.setString("usermenu_tv_yellow", g_settings.usermenu[SNeutrinoSettings::BUTTON_YELLOW]->items); + } + } + + g_settings.version_pseudo = NEUTRINO_VERSION_PSEUDO; + configfile.setString("version_pseudo", g_settings.version_pseudo); + + if (configfile.getModifiedFlag()) + configfile.saveConfig(fname); +} + /************************************************************************************** * CNeutrinoApp - saveSetup, save the application-settings * **************************************************************************************/ @@ -1016,6 +1071,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "backlight_standby", g_settings.backlight_standby); configfile.setInt32( "backlight_deepstandby", g_settings.backlight_deepstandby); configfile.setInt32( "lcd_scroll", g_settings.lcd_scroll); + configfile.setInt32( "lcd_notify_rclock", g_settings.lcd_notify_rclock); //misc configfile.setInt32( "power_standby", g_settings.power_standby); @@ -1029,6 +1085,15 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("shutdown_count" , g_settings.shutdown_count); configfile.setInt32("shutdown_min" , g_settings.shutdown_min ); configfile.setInt32("sleeptimer_min", g_settings.sleeptimer_min); + + int timer_remotebox_ip_count = 0; + for (std::list::iterator it = g_settings.timer_remotebox_ip.begin(); it != g_settings.timer_remotebox_ip.end(); ++it) { + std::string k = "timer_remotebox_ip_" + to_string(timer_remotebox_ip_count); + configfile.setString(k, *it); + timer_remotebox_ip_count++; + } + configfile.setInt32 ( "timer_remotebox_ip_count", g_settings.timer_remotebox_ip.size()); + configfile.setBool("infobar_sat_display" , g_settings.infobar_sat_display ); configfile.setBool("infobar_show_channeldesc" , g_settings.infobar_show_channeldesc ); configfile.setInt32("infobar_subchan_disp_pos" , g_settings.infobar_subchan_disp_pos ); @@ -1055,7 +1120,6 @@ 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 @@ -1168,6 +1232,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setBool ("recording_save_in_channeldir" , g_settings.recording_save_in_channeldir ); configfile.setBool ("recording_slow_warning" , g_settings.recording_slow_warning ); configfile.setBool ("recording_startstop_msg" , g_settings.recording_startstop_msg ); + configfile.setBool ("recording_already_found_check" , g_settings.recording_already_found_check ); // default plugin for movieplayer configfile.setString ( "movieplayer_plugin", g_settings.movieplayer_plugin ); @@ -1213,6 +1278,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "zapto_pre_time", g_settings.zapto_pre_time ); configfile.setBool("spectrum", g_settings.spectrum); configfile.setInt32("eventlist_additional", g_settings.eventlist_additional); + configfile.setInt32("eventlist_epgplus", g_settings.eventlist_epgplus); configfile.setInt32("channellist_additional", g_settings.channellist_additional); configfile.setBool("channellist_epgtext_align_right", g_settings.channellist_epgtext_align_right); configfile.setInt32("channellist_progressbar_design", g_settings.channellist_progressbar_design); @@ -1298,10 +1364,14 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "audioplayer_show_playlist", g_settings.audioplayer_show_playlist ); configfile.setInt32( "audioplayer_enable_sc_metadata", g_settings.audioplayer_enable_sc_metadata ); configfile.setString( "shoutcast_dev_id", g_settings.shoutcast_dev_id ); + configfile.setInt32( "shoutcast_enabled", g_settings.shoutcast_enabled ); //Movie-Player configfile.setInt32( "movieplayer_repeat_on", g_settings.movieplayer_repeat_on ); configfile.setString( "youtube_dev_id", g_settings.youtube_dev_id ); + configfile.setInt32( "youtube_enabled", g_settings.youtube_enabled ); + configfile.setString( "tmdb_api_key", g_settings.tmdb_api_key ); + configfile.setInt32( "tmdb_enabled", g_settings.tmdb_enabled ); //Filebrowser configfile.setInt32("filebrowser_showrights", g_settings.filebrowser_showrights); @@ -1314,6 +1384,8 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt64("startchanneltv_id", g_settings.startchanneltv_id); configfile.setInt64("startchannelradio_id", g_settings.startchannelradio_id); configfile.setInt32("uselastchannel", g_settings.uselastchannel); + configfile.setInt32("adzap_zapBackPeriod", g_settings.adzap_zapBackPeriod); + configfile.setInt32("adzap_writeData", g_settings.adzap_writeData); //epg search g_settings.epg_search_history_size = g_settings.epg_search_history.size(); if (g_settings.epg_search_history_size > g_settings.epg_search_history_max) @@ -1369,6 +1441,11 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("infoClockSeconds", g_settings.infoClockSeconds); configfile.setInt32("easymenu", g_settings.easymenu); + configfile.setInt32("livestreamResolution", g_settings.livestreamResolution); + configfile.setString("livestreamScriptPath", g_settings.livestreamScriptPath); + + configfile.setString("version_pseudo", g_settings.version_pseudo); + if(strcmp(fname, NEUTRINO_SETTINGS_FILE) || configfile.getModifiedFlag()) configfile.saveConfig(fname); } @@ -1401,11 +1478,16 @@ void CNeutrinoApp::channelsInit(bool bOnly) if(TVchannelList) delete TVchannelList; if(RADIOchannelList) delete RADIOchannelList; + if(TVwebList) delete TVwebList; + if(RADIOwebList) delete RADIOwebList; + TVchannelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD), false, true); RADIOchannelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD), false, true); TVbouquetList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_PROVS)); TVfavList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_FAVS)); + TVwebList = new CBouquetList(g_Locale->getText(LOCALE_BOUQUETNAME_WEBTV)); + RADIOwebList = new CBouquetList(g_Locale->getText(LOCALE_BOUQUETNAME_WEBTV)); RADIObouquetList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_PROVS)); RADIOfavList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_FAVS)); @@ -1546,6 +1628,8 @@ void CNeutrinoApp::channelsInit(bool bOnly) if (b->getTvChannels(zapitList) || (g_settings.show_empty_favorites && b->bUser)) { if(b->bUser) tmp = TVfavList->addBouquet(b); + else if(b->bWebtv) + tmp = TVwebList->addBouquet(b); else tmp = TVbouquetList->addBouquet(b); @@ -1555,6 +1639,8 @@ void CNeutrinoApp::channelsInit(bool bOnly) if (b->getRadioChannels(zapitList) || (g_settings.show_empty_favorites && b->bUser)) { if(b->bUser) tmp = RADIOfavList->addBouquet(b); + else if(b->bWebtv) + tmp = RADIOwebList->addBouquet(b); else tmp = RADIObouquetList->addBouquet(b); @@ -1611,6 +1697,12 @@ void CNeutrinoApp::SetChannelMode(int newmode) else bouquetList = TVsatList; break; + case LIST_MODE_WEBTV: + if(mode == mode_radio) + bouquetList = RADIOwebList; + else + bouquetList = TVwebList; + break; case LIST_MODE_ALL: if(mode == mode_radio) bouquetList = RADIOallList; @@ -1737,6 +1829,7 @@ void CNeutrinoApp::SetupFonts(int fmode) /* recalculate infobar position */ if (g_InfoViewer) g_InfoViewer->start(); + OnAfterSetupFonts(); } /************************************************************************************** @@ -1778,6 +1871,7 @@ void CNeutrinoApp::InitZapper() int tvmode = CZapit::getInstance()->getMode() & CZapitClient::MODE_TV; lastChannelMode = tvmode ? g_settings.channel_mode : g_settings.channel_mode_radio; mode = tvmode ? mode_tv : mode_radio; + lastMode = mode; SDTreloadChannels = false; channelsInit(); @@ -2170,7 +2264,7 @@ TIMER_STOP("################################## after all ####################### } delete hintBox; } - RealRun(personalize.getWidget(0)/**main**/); + RealRun(); ExitRun(true, can_deepstandby); @@ -2196,7 +2290,6 @@ void CNeutrinoApp::quickZap(int msg) void CNeutrinoApp::numericZap(int msg) { StopSubtitles(); - g_InfoViewer->setSwitchMode(CInfoViewer::IV_MODE_NUMBER_ZAP); int res = channelList->numericZap( msg ); StartSubtitles(res < 0); if (res >= 0 && CRCInput::isNumeric(msg)) { @@ -2259,9 +2352,9 @@ void CNeutrinoApp::screensaver(bool on) } } -void CNeutrinoApp::RealRun(CMenuWidget &_mainMenu) +void CNeutrinoApp::RealRun() { - mainMenu = &_mainMenu; + mainMenu = &personalize.getWidget(MENU_MAIN); neutrino_msg_t msg; neutrino_msg_data_t data; @@ -2275,9 +2368,9 @@ void CNeutrinoApp::RealRun(CMenuWidget &_mainMenu) standbyMode(true, true); //cCA::GetInstance()->Ready(true); - +#ifdef ENABLE_LUA CLuaServer *luaServer = CLuaServer::getInstance(); - +#endif g_PluginList->startPlugin("startup"); if (!g_PluginList->getScriptOutput().empty()) { ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); @@ -2288,10 +2381,14 @@ void CNeutrinoApp::RealRun(CMenuWidget &_mainMenu) m_screensaver = false; while( true ) { +#ifdef ENABLE_LUA luaServer->UnBlock(); +#endif g_RCInput->getMsg(&msg, &data, 100, ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) && (g_RemoteControl->subChannels.size() < 1)) ? true : false); // 10 secs.. +#ifdef ENABLE_LUA if (luaServer->Block(msg, data)) continue; +#endif if (mode == mode_radio) { bool ignored_msg = ( @@ -2619,6 +2716,11 @@ int CNeutrinoApp::showChannelList(const neutrino_msg_t _msg, bool from_menu) if (bouquetList->Bouquets.empty()) SetChannelMode(LIST_MODE_PROV); nNewChannel = bouquetList->exec(true); + } else if(msg == CRCInput::RC_www) { + SetChannelMode(LIST_MODE_WEBTV); + if (bouquetList->Bouquets.empty()) + SetChannelMode(LIST_MODE_PROV); + nNewChannel = bouquetList->exec(true); } _repeat: printf("CNeutrinoApp::showChannelList: nNewChannel %d\n", nNewChannel);fflush(stdout); @@ -2667,7 +2769,9 @@ _repeat: bouquets_changed = false; channels_init = false; - t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + t_channel_id live_channel_id = channelList->getActiveChannel_ChannelID(); + if(!live_channel_id) + live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); adjustToChannelID(live_channel_id);//FIXME what if deleted ? delete hintBox; } @@ -2749,6 +2853,17 @@ void CNeutrinoApp::lockPlayBack(bool blank) videoDecoder->setBlank(true); } +bool CNeutrinoApp::listModeKey(const neutrino_msg_t msg) +{ + if ( + msg == CRCInput::RC_sat + || msg == CRCInput::RC_favorites + || msg == CRCInput::RC_www + ) + return true; + return false; +} + int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) { int res = 0; @@ -2763,7 +2878,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) CZapitChannel * cc = CZapit::getInstance()->GetCurrentChannel(); if (cc && (chid == cc->getChannelID())) { CMoviePlayerGui::getInstance().stopPlayBack(); - if (CMoviePlayerGui::getInstance().PlayBackgroundStart(cc->getUrl(), cc->getName(), cc->getChannelID())) + if (CMoviePlayerGui::getInstance().PlayBackgroundStart(cc->getUrl(), cc->getName(), cc->getChannelID(), cc->getScriptName())) delete [] (unsigned char*) data; else g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_FAILED, data); @@ -2773,7 +2888,8 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) return messages_return::handled; } if (mode == mode_webtv && msg == NeutrinoMessages::EVT_SUBT_MESSAGE) { - CMoviePlayerGui::getInstance().showSubtitle(data); + CMoviePlayerGui::getInstance(true).showSubtitle(data); + return messages_return::handled; } if(msg == NeutrinoMessages::EVT_ZAP_COMPLETE) { CZapit::getInstance()->GetAudioMode(g_settings.audio_AnalogMode); @@ -2784,7 +2900,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) if (mode != mode_webtv) { scrambled_timer = g_RCInput->addTimer(10*1000*1000, true); SelectSubtitles(); - StartSubtitles(!g_InfoViewer->is_visible); + //StartSubtitles(!g_InfoViewer->is_visible); /* update scan settings for manual scan to current channel */ CScanSetup::getInstance()->updateManualSettings(); @@ -2839,7 +2955,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } /* ================================== KEYS ================================================ */ - if( msg == CRCInput::RC_ok || (!g_InfoViewer->getSwitchMode() && (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites))) { + if( msg == CRCInput::RC_ok || (!g_InfoViewer->getSwitchMode() && CNeutrinoApp::getInstance()->listModeKey(msg))) { if( (mode == mode_tv) || (mode == mode_radio) || (mode == mode_ts) || (mode == mode_webtv)) { showChannelList(msg); return messages_return::handled; @@ -3069,16 +3185,24 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } #endif //zap to rec channel in standby-mode + CTimerd::RecordingInfo * eventinfo = (CTimerd::RecordingInfo *) data; + t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); + /* special case for nhttpd: start direct record, if no eventID */ + if (eventinfo->eventID == 0) { + int rec_mode = CRecordManager::getInstance()->GetRecordMode(live_channel_id); + /* start only if not recorded yet */ + if (rec_mode == CRecordManager::RECMODE_OFF || rec_mode == CRecordManager::RECMODE_TSHIFT) + CRecordManager::getInstance()->Record(live_channel_id); + delete[] (unsigned char*) data; + return messages_return::handled | messages_return::cancel_all; + } if(mode == mode_standby){ - CTimerd::RecordingInfo * eventinfo = (CTimerd::RecordingInfo *) data; - t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - if((eventinfo->channel_id != live_channel_id) && !(SAME_TRANSPONDER(live_channel_id, eventinfo->channel_id))) zapTo(eventinfo->channel_id); } if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) { - CRecordManager::getInstance()->Record((CTimerd::RecordingInfo *) data); + CRecordManager::getInstance()->Record(eventinfo); autoshift = CRecordManager::getInstance()->TimeshiftOnly(); } @@ -3322,6 +3446,10 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) if(mode != mode_standby) standbyMode( true ); } + if((data & mode_mask)== mode_upnp) { + lastMode=mode; + mode=mode_upnp; + } if((data & mode_mask)== mode_audio) { lastMode=mode; mode=mode_audio; @@ -3330,7 +3458,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) lastMode=mode; mode=mode_pic; } - if((data & mode_mask)== mode_ts && CMoviePlayerGui::getInstance().Playing()) { + if((data & mode_mask)== mode_ts) { if(mode == mode_radio) frameBuffer->stopFrame(); lastMode=mode; @@ -3343,7 +3471,8 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) CZapitChannel * cc = CZapit::getInstance()->GetCurrentChannel(); if (cc && IS_WEBTV(cc->getChannelID())) { CMoviePlayerGui::getInstance().stopPlayBack(); - CMoviePlayerGui::getInstance().PlayBackgroundStart(cc->getUrl(), cc->getName(), cc->getChannelID()); + if (!CMoviePlayerGui::getInstance().PlayBackgroundStart(cc->getUrl(), cc->getName(), cc->getChannelID(), cc->getScriptName())) + g_RCInput->postMsg(NeutrinoMessages::EVT_ZAP_FAILED, data); } } } @@ -4324,6 +4453,11 @@ void CNeutrinoApp::loadKeys(const char * fname) g_settings.key_bouquet_up = tconfig.getInt32( "key_bouquet_up", CRCInput::RC_right); g_settings.key_bouquet_down = tconfig.getInt32( "key_bouquet_down", CRCInput::RC_left); + g_settings.mbkey_copy_onefile = tconfig.getInt32( "mbkey.copy_onefile", CRCInput::RC_radio ); + g_settings.mbkey_copy_several = tconfig.getInt32( "mbkey.copy_several", CRCInput::RC_text ); + g_settings.mbkey_cut = tconfig.getInt32( "mbkey.cut", CRCInput::RC_audio ); + g_settings.mbkey_truncate = tconfig.getInt32( "mbkey.truncate", CRCInput::RC_games ); + g_settings.mbkey_cover = tconfig.getInt32( "mbkey.cover", CRCInput::RC_favorites ); g_settings.mpkey_rewind = tconfig.getInt32( "mpkey.rewind", CRCInput::RC_rewind ); g_settings.mpkey_forward = tconfig.getInt32( "mpkey.forward", CRCInput::RC_forward ); @@ -4352,6 +4486,7 @@ void CNeutrinoApp::loadKeys(const char * fname) g_settings.bouquetlist_mode = tconfig.getInt32( "bouquetlist_mode", 0 ); g_settings.sms_channel = tconfig.getInt32( "sms_channel", 0 ); + g_settings.sms_movie = tconfig.getInt32( "sms_movie", 0 ); g_settings.mode_left_right_key_tv = tconfig.getInt32( "mode_left_right_key_tv", SNeutrinoSettings::ZAP); g_settings.key_help = tconfig.getInt32( "key_help", CRCInput::RC_help ); @@ -4402,6 +4537,12 @@ void CNeutrinoApp::saveKeys(const char * fname) tconfig.setInt32( "key_bouquet_up", g_settings.key_bouquet_up ); tconfig.setInt32( "key_bouquet_down", g_settings.key_bouquet_down ); + tconfig.setInt32( "mbkey.copy_onefile", g_settings.mbkey_copy_onefile ); + tconfig.setInt32( "mbkey.copy_several", g_settings.mbkey_copy_several ); + tconfig.setInt32( "mbkey.cut", g_settings.mbkey_cut ); + tconfig.setInt32( "mbkey.truncate", g_settings.mbkey_truncate ); + tconfig.setInt32( "mbkey.cover", g_settings.mbkey_cover ); + tconfig.setInt32( "mpkey.rewind", g_settings.mpkey_rewind ); tconfig.setInt32( "mpkey.forward", g_settings.mpkey_forward ); tconfig.setInt32( "mpkey.pause", g_settings.mpkey_pause ); @@ -4428,6 +4569,7 @@ void CNeutrinoApp::saveKeys(const char * fname) tconfig.setInt32( "bouquetlist_mode", g_settings.bouquetlist_mode ); tconfig.setInt32( "sms_channel", g_settings.sms_channel ); + tconfig.setInt32( "sms_movie", g_settings.sms_movie ); tconfig.setInt32( "mode_left_right_key_tv", g_settings.mode_left_right_key_tv ); tconfig.setInt32( "key_help", g_settings.key_help ); @@ -4714,6 +4856,12 @@ bool CNeutrinoApp::adjustToChannelID(const t_channel_id channel_id) if (has_channel && first_mode_found < 0) first_mode_found = LIST_MODE_PROV; if(!has_channel && old_mode == LIST_MODE_PROV) + new_mode = LIST_MODE_WEBTV; + + has_channel = TVwebList->adjustToChannelID(channel_id); + if (has_channel && first_mode_found < 0) + first_mode_found = LIST_MODE_WEBTV; + if(!has_channel && old_mode == LIST_MODE_WEBTV) new_mode = LIST_MODE_SAT; has_channel = TVsatList->adjustToChannelID(channel_id); @@ -4735,6 +4883,12 @@ bool CNeutrinoApp::adjustToChannelID(const t_channel_id channel_id) if (has_channel && first_mode_found < 0) first_mode_found = LIST_MODE_PROV; if(!has_channel && old_mode == LIST_MODE_PROV) + new_mode = LIST_MODE_WEBTV; + + has_channel = RADIOwebList->adjustToChannelID(channel_id); + if (has_channel && first_mode_found < 0) + first_mode_found = LIST_MODE_WEBTV; + if(!has_channel && old_mode == LIST_MODE_WEBTV) new_mode = LIST_MODE_SAT; has_channel = RADIOsatList->adjustToChannelID(channel_id); @@ -4779,12 +4933,11 @@ void CNeutrinoApp::migrateConfig(const char *fname) migconf.loadConfig(fname); /* here we do a simple rename of config file keys */ int magic = -424242; /* obviously a value that does not appear in real cases */ - int tmp = magic; int i; for (i = 0; key_rename[i].from != NULL; i++) { const char *from = key_rename[i].from; const char *to = key_rename[i].to; - tmp = migconf.getInt32(from, magic); + int tmp = migconf.getInt32(from, magic); if (tmp == magic) /* old key does not exist */ continue; /* only set new key to old value if the new key does not yet exist */ diff --git a/src/neutrino.h b/src/neutrino.h index 9017a1b99..1b15140ea 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -120,7 +120,7 @@ private: void getAnnounceEpgName(CTimerd::RecordingInfo * eventinfo, std::string &name); void ExitRun(const bool write_si = true, int retcode = 0); - void RealRun(CMenuWidget &mainSettings); + void RealRun(); void InitZapper(); void InitTimerdClient(); void InitZapitClient(); @@ -153,6 +153,7 @@ public: mode_ts = 7, mode_off = 8, mode_webtv = 9, + mode_upnp = 10, mode_mask = 0xFF, norezap = 0x100 }; @@ -161,6 +162,7 @@ public: void saveSetup(const char * fname); int loadSetup(const char * fname); + void upgradeSetup(const char * fname); void loadKeys(const char * fname = NULL); void saveKeys(const char * fname = NULL); void SetupTiming(); @@ -187,6 +189,7 @@ public: // //onchange bool changeNotify(const neutrino_locale_t OptionName, void *); + bool listModeKey(const neutrino_msg_t msg); int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data); int getMode() { @@ -237,7 +240,10 @@ public: void screensaver(bool); //signal/event handler before restart of neutrino gui sigc::signal OnBeforeRestart; + sigc::signal OnAfterSetupFonts; void channelRezap(); + + void g_settings_video_Mode(int value) { g_settings.video_Mode = value; } }; #endif diff --git a/src/neutrinoMessages.h b/src/neutrinoMessages.h index 65519c02f..4049ead7e 100644 --- a/src/neutrinoMessages.h +++ b/src/neutrinoMessages.h @@ -177,6 +177,7 @@ struct NeutrinoMessages { mode_pic = 6, mode_ts = 7, mode_webtv = 9, + mode_upnp = 10, mode_mask = 0xFF, norezap = 0x100 }; diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 93863a81e..0e2082591 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -83,16 +83,6 @@ extern CCAMMenuHandler * g_CamHandler; // extern char current_timezone[50]; // extern bool autoshift; -enum -{ - MENU_MAIN, - MENU_SETTINGS, - MENU_SERVICE, - MENU_SHUTDOWN, - - MENU_MAX //3 -}; - #define MENU_WIDTH 35 const mn_widget_struct_t menu_widgets[MENU_MAX] = @@ -142,7 +132,7 @@ void CNeutrinoApp::InitMenuMain() // Dynamic renumbering personalize.setShortcut(); - CMenuWidget &menu = personalize.getWidget(MENU_MAIN)/**main**/; + CMenuWidget &menu = personalize.getWidget(MENU_MAIN); menu.addKey(CRCInput::RC_stop, this, "easyswitch"); //top @@ -234,7 +224,7 @@ void CNeutrinoApp::InitMenuMain() //2nd section*************************************************************************************************** // settings, also as pin protected option in personalize menu, as a result of parameter value CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION - mf = new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, &personalize.getWidget(MENU_SETTINGS)/**settings**/); + mf = new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, &personalize.getWidget(MENU_SETTINGS)); mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_SETTINGS); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SETTINGS], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ACCESS_OPTION); @@ -324,7 +314,7 @@ void CNeutrinoApp::InitMenuSettings() { dprintf(DEBUG_DEBUG, "init settings menue...\n"); - //CMenuWidget &menu = personalize.getWidget(MENU_SETTINGS)/**settings**/; + //CMenuWidget &menu = personalize.getWidget(MENU_SETTINGS); // Dynamic renumbering personalize.setShortcut(); @@ -468,7 +458,7 @@ void CNeutrinoApp::InitMenuService() { dprintf(DEBUG_DEBUG, "init service menu...\n"); - //CMenuWidget &menu = personalize.getWidget(MENU_SERVICE)/**service**/; + //CMenuWidget &menu = personalize.getWidget(MENU_SERVICE); // Dynamic renumbering personalize.setShortcut(); diff --git a/src/neutrino_menue.h b/src/neutrino_menue.h index b21d2a2be..4ad4453bf 100644 --- a/src/neutrino_menue.h +++ b/src/neutrino_menue.h @@ -37,7 +37,6 @@ #ifndef __neutrino_menue__ #define __neutrino_menue__ - //enums for menu widget indicies, enum MN_WIDGET_ID { @@ -99,6 +98,7 @@ enum MN_WIDGET_ID MN_WIDGET_ID_KEYSETUP_KEYBINDING_CHANNELLIST, MN_WIDGET_ID_KEYSETUP_KEYBINDING_QUICKZAP, MN_WIDGET_ID_KEYSETUP_KEYBINDING_MOVIEPLAYER, + MN_WIDGET_ID_KEYSETUP_KEYBINDING_MOVIEBROWSER, MN_WIDGET_ID_KEYSETUP_KEYBINDING_SPECIAL, //picture viewer setup @@ -109,7 +109,8 @@ enum MN_WIDGET_ID //web tv setup MN_WIDGET_ID_WEBTVSETUP, - + MN_WIDGET_ID_LIVESTREAM_RESOLUTION, + //misc settings MN_WIDGET_ID_MISCSETUP, MN_WIDGET_ID_MISCSETUP_GENERAL, @@ -117,6 +118,7 @@ enum MN_WIDGET_ID MN_WIDGET_ID_MISCSETUP_EPG, MN_WIDGET_ID_MISCSETUP_FILEBROWSER, MN_WIDGET_ID_MISCSETUP_CHANNELLIST, + MN_WIDGET_ID_MISCSETUP_ONLINESERVICES, //media menu MN_WIDGET_ID_MEDIA, @@ -188,5 +190,14 @@ enum MN_WIDGET_ID MN_WIDGET_ID_MAX }; +enum +{ + MENU_MAIN, + MENU_SETTINGS, + MENU_SERVICE, + MENU_SHUTDOWN, + + MENU_MAX +}; #endif diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index 4a215504f..c4d946ce0 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -24,8 +24,8 @@ http://box_ip/control/epgsearch - EPG-Suche mit XML Ausgabe - http://box_ip/control/epgsearchxml + EPG-Suche mit XML Ausgabe + http://box_ip/control/epgsearchxml Die Box herunterfahren @@ -48,7 +48,7 @@ http://box_ip/control/setmode - Radio/TV Mode Abfrage + Neutrino Mode Abfrage http://box_ip/control/getmode @@ -251,6 +251,11 @@ http://box_ip/control/config + + Dateisystemstatistiken + + http://box_ip/control/statfs + Streaming URL anfordern @@ -260,7 +265,12 @@ Senderlogos auflisten http://box_ip/control/logolist - + + + Neutrino-Ordner auflisten + + http://box_ip/control/getdir +     @@ -415,7 +425,7 @@ Beispiel:

Parameter: xml=true&channelid=<channel_id>|channelname=<channel_name> -[&details=true][&max=<max items>][&stoptime=<long:stop time>]
+[&details=true][&max=<max items>][&stoptime=<long:stop time>][&search=<keywords>]
Rückgabe:
Liefert zum angegebenen Sender (angegeben durch channel_id oder channel_name) das EPG als XML-Liste zurück.
@@ -509,13 +519,19 @@ USA 2005, mit Jerry Stiller, Kevin James, Leah Remini. 20 Min.
fsk:0
Soap/Melodram/Folklore
-Parameter: Suchbegriff;epginfo=false
+
+Parameter: Suchbegriffe
+oder
+Parameter: search=Suchbegriffe[&epginfo=true|false|search][&format=plain|xml|json]
Rückgabe:

Es werden alle Sendungen im EPG zurückgegeben, die den Suchbegriff
im Titel oder Beschreibungstext beinhalten.
Die Treffer lassen sich unter Angabe von epginfo=false auf Treffer im Titel beschränken.
Hier werden die Sendungsinhalte (info1 und info2) nicht mitgeliefert.
+Mit der Angabe von epginfo=search werden die Sendungsinhalte (info1 und info2) zwar in die Suche
+einbezogen, aber nicht mitgeliefert.
+Die Ausgabe erfolgt im angegebenen Format. Ist kein Format angegeben, wird reiner Text ausgegeben

Rückgabe-Format: Datum Startzeit Monat Wochentag Dauer in Minuten Sender Titel der Sendung

@@ -538,47 +554,9 @@ Nachrichten
-
EPG-Suche mit XML Ausgabe
-
Handler: http://box_ip/control/epgsearchxml
+
EPG-Suche mit XML Ausgabe Deprecated!
+
Handler: http://box_ip/control/epgsearchxml

-Parameter: keine
-Rückgabe:
-
-Es werden alle verfügbaren EPG-Daten aller Programme in einer XML zurückgegeben.
-
-Beispiel:
-
->>>http://box_ip/control/epgsearchxml
-<neutrino commandversion="1">
-<epgsearch>
-<channelname>Sparhandy TV</channelname>
-<epgtitle>Homeshopping mit SparhandyTV</epgtitle>
-<info1>SparhandyTV ist der neue Homeshopping-Kanal von Sparhandy und bietet Ihnen -attraktive und günstige Angebote rund um das Thema Mobilfunk.</info1>
-...
-
-Parameter: Suchbegriff;epginfo=false
-Rückgabe:
-
-Es werden alle Sendungen im EPG zurückgegeben, die den Suchbegriff
-im Titel oder Beschreibungstext beinhalten.
-Die Treffer lassen sich unter Angabe von epginfo=false auf Treffer im Titel beschränken.
-Hier werden die Sendungsinhalte (info1 und info2) nicht mitgeliefert.
-
-Rückgabe-Format: Datum Startzeit Monat Wochentag Dauer in Minuten Sender Titel der Sendung
-
-
-Beispiel:
-
->>>http://box_ip/control/epgsearchxml?Nachtmagazin&epginfo=false
-<neutrino commandversion="1">
-<epgsearch>
-<channelname>Das Erste HD</channelname>
-<epgtitle>Nachtmagazin</epgtitle>
-<fsk>0</fsk>
-<genre>Nachrichten</genre>
-
-
Die Box herunterfahren
@@ -979,13 +957,14 @@ ok
-
Radio/TV Mode Abfrage
+
Neutrino Mode Abfrage
Handler: http://box_ip/control/getmode

-Parameter:
-Rückgabe: "tv", "radio", "unkown"
+Parameter: keine
+Rückgabe: "tv", "radio", "scart", "standby", "audio",
+"pic", "ts", "webtv", "upnp", "unknown"

-Es wird der aktuelle mode zurückgegeben tv / radio / unknown (shouldn't happen)
+Es wird der aktuelle Modus der Box zurückgegeben
Beispiel:

@@ -993,6 +972,17 @@ Beispiel:
tv

+Parameter: channelsmode
+Rückgabe: "tv", "radio", "unknown"
+
+Es wird der eingestellte Kanalmodus der Box zurückgegeben
+
+Beispiel:
+
+>>>http://box_ip/control/getmode?channelmode
+radio
+
+
Datum von der Box abfragen
@@ -2162,6 +2152,14 @@ Beispiel:
...
  + +
Dateisystemstatistiken
+
Handler: http://box_ip/control/statfs
+
+Parameter: keine oder path=<path>; format=<plain|xml|json>

+
+ +
Streaming URL anfordern
Handler: http://box_ip/control/build_live_url
@@ -2220,6 +2218,34 @@ Beispiel:
519d0007008532da;Folx TV;7008532da
  + +
Neutrino-Ordner auflisten
+
Handler: http://box_ip/control/getdir
+
+Parameter: dir, subdirs, format +

+Dir kann folgende Werte erhalten:
+
  • moviedir - gibt alle Pfade der moviebrowser.conf zurück
  • +
  • recordingdir - gibt den Aufnahmeordner der neutrino.conf zurück
  • +
  • allmoviedirs - moviedir + recordingdir
  • +
    +subdirs gibt an ob die Unterordner mit ausgegeben werden sollen (true/false)
    +format gibt das Ausgabeformat an (xml,json) +

    +Rückgabe: dir [absoluter Pfad zum Ordner] +

    +
    +
    +Beispiel:
    +
    +>>>http://box_ip/control/getdir?dir=allmoviedirs&subdirs=true&format=json

    +{"success": "true", "data":{"dirs": [{"dir": "/mnt/series/", +} +,{"dir": "/mnt/movies/", +}] +}} + 
    +   

    diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index f693277d7..838edc98e 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -15,6 +15,7 @@ // system #include #include +#include // for statfs #include #include #include @@ -156,75 +157,81 @@ void CControlAPI::compatibility_Timer(CyhookHandler *hh) const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= { // channel & bouquet & epg & zapping handling - {"getservicesxml", &CControlAPI::GetServicesxmlCGI,""}, - {"getbouquetsxml", &CControlAPI::GetBouquetsxmlCGI,""}, - {"getubouquetsxml", &CControlAPI::GetUBouquetsxmlCGI,""}, - {"channellist", &CControlAPI::ChannellistCGI, "text/plain"}, - {"logolist", &CControlAPI::LogolistCGI, "text/plain"}, - {"getbouquet", &CControlAPI::GetBouquetCGI, "+xml"}, - {"getbouquets", &CControlAPI::GetBouquetsCGI, "+xml"}, - {"getmode", &CControlAPI::GetModeCGI, "text/plain"}, - {"setmode", &CControlAPI::SetModeCGI, "text/plain"}, - {"epgsearchxml", &CControlAPI::EpgSearchXMLCGI, ""}, - {"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"}, + {"getservicesxml", &CControlAPI::GetServicesxmlCGI, ""}, + {"getbouquetsxml", &CControlAPI::GetBouquetsxmlCGI, ""}, + {"getubouquetsxml", &CControlAPI::GetUBouquetsxmlCGI, ""}, + {"channellist", &CControlAPI::ChannellistCGI, "text/plain"}, + {"logolist", &CControlAPI::LogolistCGI, "text/plain"}, + {"getbouquet", &CControlAPI::GetBouquetCGI, "+xml"}, + {"getchannel", &CControlAPI::GetChannelCGI, ""}, + {"getbouquets", &CControlAPI::GetBouquetsCGI, "+xml"}, + {"getmode", &CControlAPI::GetModeCGI, "text/plain"}, + {"setmode", &CControlAPI::SetModeCGI, "text/plain"}, + {"epgsearchxml", &CControlAPI::EpgSearchXMLCGI, ""}, + {"epgsearch", &CControlAPI::EpgSearchCGI, ""}, + {"epg", &CControlAPI::EpgCGI, ""}, + {"zapto", &CControlAPI::ZaptoCGI, "text/plain"}, + {"signal", &CControlAPI::SignalInfoCGI, "text/plain"}, + {"getonidsid", &CControlAPI::GetChannelIDCGI, "text/plain"}, + {"getchannelid", &CControlAPI::GetChannelIDCGI, ""}, + {"currenttpchannels", &CControlAPI::GetTPChannel_IDCGI, "text/plain"}, // boxcontrol - system - {"standby", &CControlAPI::StandbyCGI, "text/plain"}, - {"shutdown", &CControlAPI::ShutdownCGI, "text/plain"}, - {"reboot", &CControlAPI::RebootCGI, "text/plain"}, - {"getdate", &CControlAPI::GetDateCGI, "text/plain"}, - {"gettime", &CControlAPI::GetTimeCGI, "text/plain"}, - {"info", &CControlAPI::InfoCGI, "text/plain"}, - {"version", &CControlAPI::VersionCGI, ""}, - {"reloadsetup", &CControlAPI::ReloadNeutrinoSetupCGI, ""}, - {"reloadplugins", &CControlAPI::ReloadPluginsCGI, ""}, - {"reloadchannels", &CControlAPI::ReloadChannelsCGI, ""}, + {"standby", &CControlAPI::StandbyCGI, "text/plain"}, + {"shutdown", &CControlAPI::ShutdownCGI, "text/plain"}, + {"reboot", &CControlAPI::RebootCGI, "text/plain"}, + {"getdate", &CControlAPI::GetDateCGI, "text/plain"}, + {"gettime", &CControlAPI::GetTimeCGI, "text/plain"}, + {"info", &CControlAPI::InfoCGI, "text/plain"}, + {"version", &CControlAPI::VersionCGI, ""}, + {"reloadsetup", &CControlAPI::ReloadNeutrinoSetupCGI, ""}, + {"reloadplugins", &CControlAPI::ReloadPluginsCGI, ""}, + {"reloadchannels", &CControlAPI::ReloadChannelsCGI, ""}, #ifdef SCREENSHOT - {"screenshot", &CControlAPI::ScreenshotCGI, ""}, + {"screenshot", &CControlAPI::ScreenshotCGI, ""}, #endif // boxcontrol - devices - {"volume", &CControlAPI::VolumeCGI, "text/plain"}, - {"lcd", &CControlAPI::LCDAction, "text/plain"}, - {"system", &CControlAPI::SystemCGI, "text/plain"}, - {"message", &CControlAPI::MessageCGI, "text/plain"}, - {"rc", &CControlAPI::RCCGI, "text/plain"}, - {"rcem", &CControlAPI::RCEmCGI, "text/plain"}, + {"volume", &CControlAPI::VolumeCGI, "text/plain"}, + {"lcd", &CControlAPI::LCDAction, "text/plain"}, + {"system", &CControlAPI::SystemCGI, "text/plain"}, + {"message", &CControlAPI::MessageCGI, "text/plain"}, + {"rc", &CControlAPI::RCCGI, "text/plain"}, + {"rcem", &CControlAPI::RCEmCGI, "text/plain"}, // Start skripts, plugins - {"startplugin", &CControlAPI::StartPluginCGI, "text/plain"}, - {"exec", &CControlAPI::ExecCGI, "+xml"}, - {"yweb", &CControlAPI::YWebCGI, "text/plain"}, + {"startplugin", &CControlAPI::StartPluginCGI, "text/plain"}, + {"exec", &CControlAPI::ExecCGI, "text/plain"}, + {"yweb", &CControlAPI::YWebCGI, "text/plain"}, // video & Audio handling - {"aspectratio", &CControlAPI::AspectRatioCGI, "text/plain"}, - {"videoformat", &CControlAPI::VideoFormatCGI, "text/plain"}, - {"videooutput", &CControlAPI::VideoOutputCGI, "text/plain"}, - {"vcroutput", &CControlAPI::VCROutputCGI, "text/plain"}, - {"scartmode", &CControlAPI::ScartModeCGI, "text/plain"}, - {"audio", &CControlAPI::AudioCGI, "text/plain"}, - {"crypt", &CControlAPI::CryptCGI, "text/plain"}, + {"aspectratio", &CControlAPI::AspectRatioCGI, "text/plain"}, + {"videoformat", &CControlAPI::VideoFormatCGI, "text/plain"}, + {"videooutput", &CControlAPI::VideoOutputCGI, "text/plain"}, + {"vcroutput", &CControlAPI::VCROutputCGI, "text/plain"}, + {"scartmode", &CControlAPI::ScartModeCGI, "text/plain"}, + {"audio", &CControlAPI::AudioCGI, "text/plain"}, + {"crypt", &CControlAPI::CryptCGI, "text/plain"}, // timer - {"timer", &CControlAPI::TimerCGI, "text/plain"}, + {"timer", &CControlAPI::TimerCGI, "text/plain"}, // bouquet editing - {"setbouquet", &CControlAPI::setBouquetCGI, "text/plain"}, - {"savebouquet", &CControlAPI::saveBouquetCGI, "text/plain"}, - {"movebouquet", &CControlAPI::moveBouquetCGI, "text/plain"}, - {"deletebouquet", &CControlAPI::deleteBouquetCGI, "text/plain"}, - {"addbouquet", &CControlAPI::addBouquetCGI, "text/plain"}, - {"renamebouquet", &CControlAPI::renameBouquetCGI, "text/plain"}, - {"changebouquet", &CControlAPI::changeBouquetCGI, "text/plain"}, - {"updatebouquet", &CControlAPI::updateBouquetCGI, "text/plain"}, + {"setbouquet", &CControlAPI::setBouquetCGI, "text/plain"}, + {"savebouquet", &CControlAPI::saveBouquetCGI, "text/plain"}, + {"movebouquet", &CControlAPI::moveBouquetCGI, "text/plain"}, + {"deletebouquet", &CControlAPI::deleteBouquetCGI, "text/plain"}, + {"addbouquet", &CControlAPI::addBouquetCGI, "text/plain"}, + {"renamebouquet", &CControlAPI::renameBouquetCGI, "text/plain"}, + {"changebouquet", &CControlAPI::changeBouquetCGI, "text/plain"}, + {"updatebouquet", &CControlAPI::updateBouquetCGI, "text/plain"}, + // xmltv + {"xmltv.data", &CControlAPI::xmltvepgCGI, "+xml"}, + {"xmltv.m3u", &CControlAPI::xmltvm3uCGI, ""}, // utils - {"build_live_url", &CControlAPI::build_live_url, ""}, - {"get_logo", &CControlAPI::logoCGI, "text/plain"}, + {"build_live_url", &CControlAPI::build_live_url, ""}, + {"get_logo", &CControlAPI::logoCGI, "text/plain"}, // settings - {"config", &CControlAPI::ConfigCGI, "text/plain"}, + {"config", &CControlAPI::ConfigCGI, "text/plain"}, // filehandling - {"file", &CControlAPI::FileCGI, "+xml"} - - + {"file", &CControlAPI::FileCGI, "+xml"}, + {"statfs", &CControlAPI::StatfsCGI, "+xml"}, + {"getdir", &CControlAPI::getDirCGI, "+xml"}, + {"getmovies", &CControlAPI::getMoviesCGI, "+xml"} }; //----------------------------------------------------------------------------- // Main Dispatcher @@ -239,38 +246,40 @@ void CControlAPI::Execute(CyhookHandler *hh) for(unsigned int i = 0; i < filename.length(); i++) filename[i] = tolower(filename[i]); + func_req = filename; + // debugging informations if(CLogging::getInstance()->getDebug()) { - dprintf("Execute CGI : %s\n",filename.c_str()); - for(CStringList::iterator it = hh->ParamList.begin() ; - it != hh->ParamList.end() ; ++it) - dprintf(" Parameter %s : %s\n",it->first.c_str(), it->second.c_str()); + dprintf("Execute CGI : %s\n", func_req.c_str()); + for(CStringList::iterator it = hh->ParamList.begin(); it != hh->ParamList.end(); ++it) + dprintf(" Parameter %s : %s\n", it->first.c_str(), it->second.c_str()); } // get function index for(unsigned int i = 0; i < (sizeof(yCgiCallList)/sizeof(yCgiCallList[0])); i++) - if (filename == yCgiCallList[i].func_name) + if (func_req == yCgiCallList[i].func_name) { index = i; break; } + if(index == -1) // function not found { hh->SetError(HTTP_NOT_IMPLEMENTED, HANDLED_NOT_IMPLEMENTED); return; } - // send header else if(std::string(yCgiCallList[index].mime_type).empty()) // decide in function ; else if(std::string(yCgiCallList[index].mime_type) == "+xml") // Parameter xml? - if ((!hh->ParamList["xml"].empty()) ||(hh->ParamList["format"] == "xml")) + if (hh->getOutType() == xml) hh->SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); else hh->SetHeader(HTTP_OK, "text/html; charset=UTF-8"); else hh->SetHeader(HTTP_OK, yCgiCallList[index].mime_type); + // response hh->status = HANDLED_READY; if (hh->Method == M_HEAD) // HEAD or function call @@ -288,6 +297,8 @@ void CControlAPI::Execute(CyhookHandler *hh) //============================================================================= void CControlAPI::TimerCGI(CyhookHandler *hh) { + hh->outStart(); + if (NeutrinoAPI->Timerd->isTimerdAvailable()) { if (!hh->ParamList.empty() && hh->ParamList["format"].empty()) @@ -315,8 +326,8 @@ void CControlAPI::TimerCGI(CyhookHandler *hh) } } else { - if (hh->ParamList["format"] == "xml") - SendTimersXML(hh); + if (hh->getOutType() == plain) + SendTimersPlain(hh); else SendTimers(hh); } @@ -342,8 +353,8 @@ void CControlAPI::SetModeCGI(CyhookHandler *hh) if (hh->ParamList["1"] == "radio") // switch to radio mode { if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_standby){ - int mode = NeutrinoMessages::mode_radio; - NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::CHANGEMODE, CEventServer::INITID_HTTPD, (void *)&mode,sizeof(int)); + neutrino_msg_data_t mode = NeutrinoMessages::mode_radio; + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::CHANGEMODE, CEventServer::INITID_HTTPD, (void *)&mode,sizeof(neutrino_msg_data_t)); sleep(1); NeutrinoAPI->UpdateBouquets(); }else{ @@ -354,8 +365,8 @@ void CControlAPI::SetModeCGI(CyhookHandler *hh) else if (hh->ParamList["1"] == "tv") // switch to tv mode { if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_standby){ - int mode = NeutrinoMessages::mode_tv; - NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::CHANGEMODE, CEventServer::INITID_HTTPD, (void *)&mode,sizeof(int)); + neutrino_msg_data_t mode = NeutrinoMessages::mode_tv; + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::CHANGEMODE, CEventServer::INITID_HTTPD, (void *)&mode,sizeof(neutrino_msg_data_t)); sleep(1); NeutrinoAPI->UpdateBouquets(); }else{ @@ -365,17 +376,27 @@ void CControlAPI::SetModeCGI(CyhookHandler *hh) } else if (hh->ParamList["record"] == "start") // start record mode { +#if 0 if(hh->ParamList["stopplayback"] == "true") NeutrinoAPI->Zapit->stopPlayBack(); NeutrinoAPI->Sectionsd->setPauseScanning(true); NeutrinoAPI->Zapit->setRecordMode(true); +#endif + CTimerd::RecordingInfo recinfo; + recinfo.eventID = 0; + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::RECORD_START, CEventServer::INITID_HTTPD, (void *)&recinfo, sizeof(CTimerd::RecordingInfo)); } else if (hh->ParamList["record"] == "stop") // stop record mode { +#if 0 NeutrinoAPI->Zapit->setRecordMode(false); NeutrinoAPI->Sectionsd->setPauseScanning(false); if (!NeutrinoAPI->Zapit->isPlayBackActive()) NeutrinoAPI->Zapit->startPlayBack(); +#endif + CTimerd::RecordingInfo recinfo; + recinfo.eventID = 0; // FIXME must present + NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::RECORD_STOP, CEventServer::INITID_HTTPD, (void *)&recinfo, sizeof(CTimerd::RecordingInfo)); } hh->SendOk(); } @@ -386,28 +407,64 @@ void CControlAPI::SetModeCGI(CyhookHandler *hh) //----------------------------------------------------------------------------- void CControlAPI::GetModeCGI(CyhookHandler *hh) { - int mode = NeutrinoAPI->Zapit->getMode(); - if ( mode == CZapitClient::MODE_TV) - hh->WriteLn("tv"); - else if ( mode == CZapitClient::MODE_RADIO) - return hh->WriteLn("radio"); + hh->outStart(); + std::string result = ""; + std::string key = "mode"; + + if (hh->ParamList_exist("channelsmode") && hh->ParamList["channelsmode"] != "false") + { + key = "channelsmode"; + int mode = NeutrinoAPI->Zapit->getMode(); + if (mode == CZapitClient::MODE_TV) + result = "tv"; + else if (mode == CZapitClient::MODE_RADIO) + result = "radio"; + else + result = "unknown"; + } else - return hh->WriteLn("unknown"); + { + int mode = CNeutrinoApp::getInstance()->getMode(); + if (mode == NeutrinoMessages::mode_tv) + result = "tv"; + else if (mode == NeutrinoMessages::mode_radio) + result = "radio"; + else if (mode == NeutrinoMessages::mode_scart) + result = "scart"; + else if (mode == NeutrinoMessages::mode_standby) + result = "standby"; + else if (mode == NeutrinoMessages::mode_audio) + result = "audio"; + else if (mode == NeutrinoMessages::mode_pic) + result = "pic"; + else if (mode == NeutrinoMessages::mode_ts) + result = "ts"; + else if (mode == NeutrinoMessages::mode_webtv) + result = "webtv"; + else if (mode == NeutrinoMessages::mode_upnp) + result = "upnp"; + else + result = "unknown"; + } + + if (!result.empty()) + { + if (hh->getOutType() != plain) + { + result = hh->outPair(key, result, false); + result = hh->outObject("getmode", result); + } + hh->SendResult(result); + } + else + hh->SendError(); } //----------------------------------------------------------------------------- void CControlAPI::ExecCGI(CyhookHandler *hh) { - bool res = false; std::string script, result; - // override standard header - if (hh->ParamList.size() > 1 && hh->ParamList["xml"].empty()) - hh->SetHeader(HTTP_OK, "text/html; charset=UTF-8"); - else if (hh->ParamList.size() > 1 && !hh->ParamList["xml"].empty()) - hh->SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); - else - hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); - if ( !hh->ParamList.empty() ) + if (!hh->ParamList.empty() ) { script = hh->ParamList["1"]; unsigned int len = hh->ParamList.size(); @@ -417,16 +474,18 @@ void CControlAPI::ExecCGI(CyhookHandler *hh) script += " "; script += hh->ParamList[itoa(y)]; } - result = YexecuteScript(hh, script); + result = yExecuteScript(script); } else - printf("[CControlAPI] no script given\n"); + { + log_level_printf(0, "[%s] no script given\n", __func__); + result = "error"; + } - res = (result != "error"); - if (res) - hh->Write(result); - else + if (result == "error") hh->SetError(HTTP_NOT_FOUND); + else + hh->WriteLn(result); } //----------------------------------------------------------------------------- @@ -591,15 +650,57 @@ void CControlAPI::GetUBouquetsxmlCGI(CyhookHandler *hh) hh->SendFile(CONFIGDIR "/zapit/ubouquets.xml"); } +//------------------------------------------------------------------------- +/** Display channel id's + * @param hh CyhookHandler + * + * @par nhttpd-usage + * @code + * /control/getonidsid + * /control/getchannelid[?format=plain|json|xml] + * @endcode + * + * @par output + * @code + * /control/getonidsid + * @endcode + * + * @code + * 3f300012b66 + * @endcode + * + * @par output (xml) + * @code + * /control/getchannelid?format=xml + * @endcode + * + * @code + * + * 361d03f300012b66 + * 3f300012b66 + * + * @endcode + */ //----------------------------------------------------------------------------- // get actual channel_id -void CControlAPI::GetChannel_IDCGI(CyhookHandler *hh) +void CControlAPI::GetChannelIDCGI(CyhookHandler *hh) { - CZapitClient::CCurrentServiceInfo current_pids = NeutrinoAPI->Zapit->getCurrentServiceInfo(); - hh->printf("%x%04x%04x\n",current_pids.tsid, current_pids.onid, current_pids.sid); + t_channel_id channel_id = CZapit::getInstance()->GetCurrentChannelID(); + if (func_req == "getonidsid") //what a terrible name! + { + hh->WriteLn(string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL)); + return; + } + + hh->outStart(); + std::string result = ""; + result = hh->outPair("id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true); + result += hh->outPair("short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL), false); + result = hh->outObject("id", result); + hh->SendResult(result); } -// get actual channel_id +//----------------------------------------------------------------------------- void CControlAPI::GetTPChannel_IDCGI(CyhookHandler *hh) { SendChannelList(hh, true); @@ -653,7 +754,7 @@ void CControlAPI::InfoCGI(CyhookHandler *hh) if (hh->ParamList["1"] == "streaminfo") // print streaminfo SendStreamInfo(hh); else if (hh->ParamList["1"] == "version") // send version file - hh->SendFile("/.version"); + hh->SendFile(TARGET_PREFIX "/.version"); else if (hh->ParamList["1"] == "httpdversion") // print httpd version typ (only ffor comptibility) hh->Write("3"); else if (hh->ParamList["1"] == "nhttpd_version")// print nhttpd version @@ -712,7 +813,8 @@ int CControlAPI::rc_send(int ev, unsigned int code, unsigned int value) //----------------------------------------------------------------------------- // The code here is based on rcsim. Thx Carjay! -void CControlAPI::RCEmCGI(CyhookHandler *hh) { +void CControlAPI::RCEmCGI(CyhookHandler *hh) +{ if (hh->ParamList.empty()) { hh->SendError(); return; @@ -864,117 +966,189 @@ void CControlAPI::ChannellistCGI(CyhookHandler *hh) void CControlAPI::LogolistCGI(CyhookHandler *hh) { + hh->outStart(); + std::string result = ""; + bool isFirstLine = true; + + bool files = false; + unsigned int s = hh->ParamList.size(); + for (unsigned int i = 1; i <= s; i++) + { + files = (hh->ParamList[itoa(i)] == "files" && hh->ParamList["files"] != "false"); + if (files) + break; + } + int mode = NeutrinoAPI->Zapit->getMode(); CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); for (; !(cit.EndOfChannels()); cit++) { + std::string item = ""; + std::string id = ""; + std::string logo = ""; + std::vector v; CZapitChannel * channel = *cit; size_t pos = std::find(v.begin(), v.end(), channel->getChannelID()) - v.begin(); if (pos < v.size()) continue; v.push_back(channel->getChannelID()); - result += string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS";%s;" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS"", channel->getChannelID(), channel->getName().c_str(), (channel->getChannelID() & 0xFFFFFFFFFFFFULL)); - if (hh->ParamList["1"].compare("files") == 0) + std::string logo_used = ""; + std::string logo_real = ""; + if (files) { - std::string logoFile = ""; - std::string logoLink = ""; - char link[PATH_MAX + 1] = {0}; - if (g_PicViewer->GetLogoName(channel->getChannelID(), NeutrinoAPI->GetServiceName(channel->getChannelID()), logoFile, NULL, NULL)) + char _real[PATH_MAX + 1] = {0}; + if (g_PicViewer->GetLogoName(channel->getChannelID(), NeutrinoAPI->GetServiceName(channel->getChannelID()), logo_used, NULL, NULL)) { - result += string_printf(";%s", logoFile.c_str()); - realpath(logoFile.c_str(), link); - logoLink = string(link); - if (strcmp(logoFile.c_str(), logoLink.c_str()) != 0) - result += string_printf(";%s", logoLink.c_str()); + realpath(logo_used.c_str(), _real); + logo_real = string(_real); + if (strcmp(logo_used.c_str(), logo_real.c_str()) == 0) + logo_real.clear(); } } - result += "\n"; + if (hh->outType == plain) + { + std::string outLine = string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS";%s;" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS"", channel->getChannelID(), channel->getName().c_str(), (channel->getChannelID() & 0xFFFFFFFFFFFFULL)); + if (files) + { + if (!logo_used.empty()) + outLine += string_printf(";%s", logo_used.c_str()); + if (!logo_real.empty()) + outLine += string_printf(";%s", logo_real.c_str()); + } + item = hh->outSingle(outLine); + } + else + { + item = hh->outPair("name", hh->outValue(channel->getName()), true); + + id = hh->outPair("id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()), true); + id += hh->outPair("short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID() & 0xFFFFFFFFFFFFULL), false); + item += hh->outObject("id", id, files); + + if (files) + { + logo = hh->outPair("used", logo_used, true); + logo += hh->outPair("real", logo_real, false); + item += hh->outObject("logo", logo); + } + } + if (isFirstLine) + isFirstLine = false; + else + result += hh->outNext(); + result += hh->outArrayItem("channel", item, false); } - hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); - hh->WriteLn(result); + result = hh->outArray("logolist", result); + + hh->SendResult(result); } //----------------------------------------------------------------------------- // get actual and next event data for given channel //----------------------------------------------------------------------------- -std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChannel * channel) { +std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChannel * channel) +{ std::string result, firstEPG, secondEPG = ""; t_channel_id current_channel = CZapit::getInstance()->GetCurrentChannelID(); std::string timestr; + CShortEPGData epg; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - CChannelEvent *event; - event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; + CChannelEvent event; + NeutrinoAPI->GetChannelEvent(channel->getChannelID(), event); - if (event) { + bool return_epginfo = (hh->ParamList["epginfo"] != "false"); + + result += hh->outPair("isActiveChannel", (channel->getChannelID() == current_channel) ? "true" : "false", false); + + if (event.eventID) { int percentage = 100; - if (event->duration > 0) - percentage = 100 * (time(NULL) - event->startTime) / event->duration; + if (event.duration > 0) + percentage = 100 * (time(NULL) - event.startTime) / event.duration; CEitManager::getInstance()->getCurrentNextServiceKey(channel->getChannelID(), currentNextInfo); - timestr = timeString(event->startTime); + timestr = timeString(event.startTime); - firstEPG += hh->outPair("startTime", timestr, true); - firstEPG += hh->outPair("description", hh->outValue(event->description), true); - firstEPG += hh->outPair("timeElapsed", string_printf("%d", (time(NULL) - event->startTime) / 60), true); - firstEPG += hh->outPair("timeTotal", string_printf("%d", event->duration / 60), true); - firstEPG += hh->outPair("percentage", string_printf("%d", percentage), false); firstEPG += hh->outPair("eventid", string_printf("%llu", currentNextInfo.current_uniqueKey), true); + firstEPG += hh->outPair("description", hh->outValue(event.description), true); + if (return_epginfo && CEitManager::getInstance()->getEPGidShort(currentNextInfo.current_uniqueKey, &epg)) + { + firstEPG += hh->outPair("info1", hh->outValue(epg.info1), true); + firstEPG += hh->outPair("info2", hh->outValue(epg.info2), true); + } + firstEPG += hh->outPair("startTime", timestr, true); + firstEPG += hh->outPair("timeTotal", string_printf("%d", event.duration / 60), true); + firstEPG += hh->outPair("timeElapsed", string_printf("%d", (time(NULL) - event.startTime) / 60), true); + firstEPG += hh->outPair("percentage", string_printf("%d", percentage), false); if (currentNextInfo.flags & CSectionsdClient::epgflags::has_next) { timestr = timeString(currentNextInfo.next_zeit.startzeit); - secondEPG += hh->outPair("startTime", timestr, true); - secondEPG += hh->outPair("description", hh->outValue(currentNextInfo.next_name), false); - secondEPG += hh->outPair("timeTotal", string_printf("%d", currentNextInfo.next_zeit.dauer / 60), true); secondEPG += hh->outPair("eventid", string_printf("%llu", currentNextInfo.next_uniqueKey), true); + secondEPG += hh->outPair("description", hh->outValue(currentNextInfo.next_name), true); + if (return_epginfo && CEitManager::getInstance()->getEPGidShort(currentNextInfo.next_uniqueKey, &epg)) + { + secondEPG += hh->outPair("info1", hh->outValue(epg.info1), true); + secondEPG += hh->outPair("info2", hh->outValue(epg.info2), true); + } + secondEPG += hh->outPair("startTime", timestr, true); + secondEPG += hh->outPair("timeTotal", string_printf("%d", currentNextInfo.next_zeit.dauer / 60), false); } } - result += hh->outPair("isActiveChannel", (channel->getChannelID() == current_channel) ? "true" : "false", (!firstEPG.empty())); if(!firstEPG.empty()) { - result += hh->outCollection("firstEPG", firstEPG); + result += hh->outNext(); + result += hh->outObject("firstEPG", firstEPG); } if(!secondEPG.empty()) { result += hh->outNext(); - result += hh->outCollection("secondEPG", secondEPG); + result += hh->outObject("secondEPG", secondEPG); } return result; } //----------------------------------------------------------------------------- // produce data (collection) for given channel -std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * channel, int bouquetNr, int nr) { +std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * channel, int bouquetNr, int channelNr) +{ std::string result = ""; bool isEPGdetails = !(hh->ParamList["epg"].empty()); if (hh->outType == json || hh->outType == xml) { - result += hh->outPair("number", string_printf("%u", nr), true); + if (channelNr > -1) + result += hh->outPair("number", string_printf("%u", channelNr), true); result += hh->outPair("id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()), true); result += hh->outPair("short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID()&0xFFFFFFFFFFFFULL), true); result += hh->outPair("name", hh->outValue(channel->getName()), true); - result += hh->outPair("logo", hh->outValue(NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->getChannelID())), true); - result += hh->outPair("bouquetnr", string_printf("%d", bouquetNr), isEPGdetails); - if(isEPGdetails) + result += hh->outPair("logo", hh->outValue(NeutrinoAPI->getLogoFile(channel->getChannelID())), false); + if (bouquetNr > -1) + { + result += hh->outNext(); + result += hh->outPair("bouquetnr", string_printf("%d", bouquetNr), false); + } + if (isEPGdetails) + { + result += hh->outNext(); result += _GetBouquetActualEPGItem(hh, channel); + } result = hh->outArrayItem("channel", result, false); } else { - CChannelEvent *event; - event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; + CChannelEvent event; + NeutrinoAPI->GetChannelEvent(channel->getChannelID(), event); - if (event && isEPGdetails) { + if (event.eventID && isEPGdetails) { result += string_printf("%u " PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s (%s)\n", - nr, + channelNr, channel->getChannelID(), - channel->getName().c_str(), event->description.c_str()); + channel->getName().c_str(), event.description.c_str()); } else { result += string_printf("%u " PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s\n", - nr, + channelNr, channel->getChannelID(), channel->getName().c_str()); } @@ -989,7 +1163,7 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * * Get bouquet list (all) oder filtered to a given bouquet number * Option epg=true for actual and next epg data for each channel * @code - * /control/getbouquet?[bouquet=][&mode=TV|RADIO][&epg=true] + * /control/getbouquet?[bouquet=][&mode=TV|RADIO][&epg=true[&epginfo=false]] * @endcode * Get the actual used bouquet number * @code @@ -1047,8 +1221,9 @@ std::string CControlAPI::_GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * * @endcode */ //------------------------------------------------------------------------- -void CControlAPI::GetBouquetCGI(CyhookHandler *hh) { - TOutType outType = hh->outStart(); +void CControlAPI::GetBouquetCGI(CyhookHandler *hh) +{ + TOutType outType = hh->outStart(true /*old mode*/); std::string result = ""; if (!(hh->ParamList.empty())) { @@ -1115,22 +1290,73 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh) { } } result = hh->outArray("channels", result); - // write footer - if (outType == json) { - hh->WriteLn(json_out_success(result)); - } - else { - hh->WriteLn(result); - } + + hh->SendResult(result); } } - else { - if (hh->ParamList["format"] == "json") { - hh->WriteLn(json_out_error("no parameter")); + else + hh->SendError("no parameter"); +} + +//------------------------------------------------------------------------- +/** Show some infos about current or given (by full ID!) channel + * @param hh CyhookHandler + * + * @par nhttpd-usage + * @code + * /control/getchannel[?format=plain|xml|json][&id=][&epg=true[&epginfo=false]] + * @endcode + * + * @par output (json) + * @code + * /control/getchannel?format=json + * @endcode + * + * @code + * { + * "success": "true", + * "data": { + * "channel": [ + * { + * "id": "361d03f300012b66", + * "short_id": "3f300012b66", + * "name": "ZDFHD", + * "logo": "/share/tuxbox/neutrino/icons/logo/3f300012b66.png" + * } + * ] + * } + * } + * @endcode + */ +//------------------------------------------------------------------------- +// get actual channel info +void CControlAPI::GetChannelCGI(CyhookHandler *hh) +{ + hh->outStart(); + + std::string result = ""; + + t_channel_id channel_id = 0; + if (hh->ParamList["id"].empty()) + channel_id = CZapit::getInstance()->GetCurrentChannelID(); + else + sscanf(hh->ParamList["id"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id); + + if (channel_id != 0) + { + NeutrinoAPI->GetChannelEvents(); + CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id); + if (channel) + { + result = _GetBouquetWriteItem(hh, channel, -1, -1); + result = hh->outArray("channel", result); + hh->SendResult(result); } else - hh->WriteLn("error"); + hh->SendError(hh->ParamList["id"] + " seems wrong"); } + else + hh->SendError(); } //------------------------------------------------------------------------- @@ -1196,7 +1422,8 @@ void CControlAPI::GetBouquetCGI(CyhookHandler *hh) { * @endcode */ //------------------------------------------------------------------------- -void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) { +void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) +{ bool show_hidden = true; bool encode = false; std::string result = ""; @@ -1239,40 +1466,53 @@ void CControlAPI::GetBouquetsCGI(CyhookHandler *hh) { bouquet = std::string(g_bouquetManager->Bouquets[i]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : g_bouquetManager->Bouquets[i]->Name.c_str()); if (encode) bouquet = encodeString(bouquet); // encode (URLencode) the bouquetname - item = hh->outPair("number", string_printf("%u", i + 1), true); - if(outType == plain) item+= " "; - item += hh->outPair("name", bouquet, false); + if (outType == plain) + item = string_printf("%u", i + 1) + " " + bouquet + "\n"; + else + { + item = hh->outPair("number", string_printf("%u", i + 1), true); + item += hh->outPair("name", bouquet, false); + } result += hh->outArrayItem("bouquet", item, (i < size-1)); } } result = hh->outArray("bouquets", result); - // write footer - if (outType == json) { - hh->WriteLn(json_out_success(result)); - } - else { - hh->WriteLn(result); - } + + hh->SendResult(result); } //----------------------------------------------------------------------------- // details EPG Information for channelid //----------------------------------------------------------------------------- -std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_channel_id channel_id, int max, long stoptime) { +std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_channel_id channel_id, int max, long stoptime) +{ std::string result = ""; std::string channelData = ""; - CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList); + channelData += hh->outPair("channel_name", hh->outValue(NeutrinoAPI->GetServiceName(channel_id)), true); channelData += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true); - channelData += hh->outPair("channel_short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL), true); - channelData += hh->outPair("channel_name", hh->outValue(NeutrinoAPI->GetServiceName(channel_id)), false); - if(hh->outType == json) - channelData = hh->outCollection("channelData", channelData); + channelData += hh->outPair("channel_short_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id & 0xFFFFFFFFFFFFULL), (bouquetnr > -1)); + if (bouquetnr > -1) + channelData += hh->outPair("bouquetnr", string_printf("%d", bouquetnr), false); + if (hh->outType == json) + channelData = hh->outObject("channelData", channelData); int i = 0; CChannelEventList::iterator eventIterator; bool isFirstLine = true; - for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); ++eventIterator, i++) { + + t_channel_id epg_id = channel_id; + CZapitChannel * ch = CServiceManager::getInstance()->FindChannel(channel_id); + if (ch) + epg_id = ch->getEpgID(); + + CChannelEventList eList; + CEitManager::getInstance()->getEventsServiceKey(epg_id, eList); + + for (eventIterator = eList.begin(); eventIterator != eList.end(); ++eventIterator, i++) { if ((max != -1 && i >= max) || (stoptime != -1 && eventIterator->startTime >= stoptime)) break; std::string prog = ""; + if (hh->outType == plain) + prog += hh->outSingle(""); + prog += hh->outPair("bouquetnr", string_printf("%d", bouquetnr), true); prog += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id), true); prog += hh->outPair("eventid", string_printf("%llu", eventIterator->eventID), true); @@ -1300,6 +1540,7 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ } } prog += hh->outPair("description", hh->outValue(eventIterator->description), false); + if(isFirstLine) isFirstLine = false; else @@ -1315,7 +1556,8 @@ std::string CControlAPI::channelEPGformated(CyhookHandler *hh, int bouquetnr, t_ //----------------------------------------------------------------------------- // Detailed EPG list in XML or JSON //----------------------------------------------------------------------------- -void CControlAPI::epgDetailList(CyhookHandler *hh) { +void CControlAPI::epgDetailList(CyhookHandler *hh) +{ // ------ get parameters ------- // max = maximal output items int max = -1; @@ -1335,6 +1577,7 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) { else if (!(hh->ParamList["channelname"].empty())) { channel_id = NeutrinoAPI->ChannelNameToChannelId(hh->ParamList["channelname"].c_str()); } + // or determine bouquetnr -> iterate the bouquet int bouquetnr = -1; bool all_bouquets = false; @@ -1346,11 +1589,17 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) { bouquetnr--; } + // fallback + if ((channel_id == (t_channel_id) -1) && (bouquetnr == -1)) + { + channel_id = CZapit::getInstance()->GetCurrentChannelID(); + //all_bouquets = true; //better, but broken + } + // ------ generate output ------ - TOutType outType = hh->outStart(); + hh->outStart(true /*old mode*/); std::string result = ""; - NeutrinoAPI->eList.clear(); if (bouquetnr >= 0 || all_bouquets) { int bouquet_size = (int) g_bouquetManager->Bouquets.size(); int start_bouquet = 0; @@ -1387,14 +1636,9 @@ void CControlAPI::epgDetailList(CyhookHandler *hh) { // list one channel, no bouquetnr given result = channelEPGformated(hh, 0, channel_id, max, stoptime); - result = hh->outCollection("epglist", result); - // write footer - if (outType == json) { - hh->WriteLn(json_out_success(result)); - } - else { - hh->WriteLn(result); - } + result = hh->outObject("epglist", result); + + hh->SendResult(result); } //------------------------------------------------------------------------------------------------- inline static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b) @@ -1405,156 +1649,185 @@ extern const char * GetGenre(const unsigned char contentClassification); // UTF- void CControlAPI::EpgSearchXMLCGI(CyhookHandler *hh) { - EpgSearchCGI(hh, true); //xml_format = true + SendFoundEvents(hh, true); } -void CControlAPI::EpgSearchTXTCGI(CyhookHandler *hh) +//------------------------------------------------------------------------- +/** Return EPG search data + * @param hh CyhookHandler + * + * @par nhttpd-usage + * @code + * /control/epgsearch? + * or + * /control/epgsearch?search=[&epginfo=true|false|search][&format=plain|xml|json] + * @endcode + */ + +//------------------------------------------------------------------------- +void CControlAPI::EpgSearchCGI(CyhookHandler *hh) { - EpgSearchCGI(hh, false); //xml_format = false + SendFoundEvents(hh); } -void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_format ) +void CControlAPI::SendFoundEvents(CyhookHandler *hh, bool xml_format) { + if (hh->ParamList.empty()) + { + hh->SendError(); + return; + } + + std::string result =""; + std::string item = ""; t_channel_id channel_id; CChannelEventList evtlist; - if (!hh->ParamList.empty()) { - bool search_epginfo = true; - if (hh->ParamList["epginfo"] == "false") - search_epginfo = false; + bool search_epginfo = (hh->ParamList["epginfo"] != "false"); + bool return_epginfo = (hh->ParamList["epginfo"] == "true" || hh->ParamList["epginfo"].empty()); - const int m_search_epg_item = search_epginfo ? 5 /*SEARCH_EPG_ALL*/ : 1 /*SEARCH_EPG_TITLE*/; - std::string m_search_keyword = hh->ParamList["1"]; + std::string search_keyword = (hh->ParamList["search"].empty()) ? hh->ParamList["1"] : hh->ParamList["search"]; + const int search_epg_item = search_epginfo ? 5 /*SEARCH_EPG_ALL*/ : 1 /*SEARCH_EPG_TITLE*/; - if(xml_format){ - hh->SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); - hh->WriteLn(""); - hh->WriteLn(""); - } - else{ - hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); // default - } - - std::vector v; - int channel_nr = CNeutrinoApp::getInstance ()->channelList->getSize();//unique channelList TV or Radio - for(int channel = 0; channel < channel_nr; channel++){ - channel_id = CNeutrinoApp::getInstance ()->channelList->getChannelFromIndex(channel)->getChannelID(); - v.push_back(channel_id); - } - std::map ch_id_map; - std::vector::iterator it; - for (it = v.begin(); it != v.end(); ++it){ - ch_id_map[*it & 0xFFFFFFFFFFFFULL] = *it; - } - CEitManager::getInstance()->getEventsServiceKey(0,evtlist, m_search_epg_item,m_search_keyword, true);//all_chann + if (xml_format) // to stay backward compatible :/ + hh->ParamList["format"] = "xml"; + hh->outStart(true /*old mode*/); - if(!evtlist.empty()){ - std::map::iterator map_it; - CChannelEventList::iterator e; - for ( e=evtlist.begin(); e!=evtlist.end();++e){ - map_it = ch_id_map.find(e->channelID); - if (map_it != ch_id_map.end()){ - e->channelID = map_it->second;//map channelID48 to channelID - } - else{ - evtlist.erase(e--);// remove event for not found channels in channelList - } + /* TODO: maybe add following options as in tuxbox neutrino + hh->ParamList["epgitem"] + hh->ParamList["mode"] + hh->ParamList["channelid"] + hh->ParamList["channelname"] + hh->ParamList["bouquet"] + */ + + std::vector v; + int channel_nr = CNeutrinoApp::getInstance()->channelList->getSize(); //unique channelList TV or Radio + for (int channel = 0; channel < channel_nr; channel++) + { + channel_id = CNeutrinoApp::getInstance()->channelList->getChannelFromIndex(channel)->getChannelID(); + v.push_back(channel_id); + } + std::map ch_id_map; + std::vector::iterator it; + for (it = v.begin(); it != v.end(); ++it) + { + ch_id_map[*it & 0xFFFFFFFFFFFFULL] = *it; + } + + CEitManager::getInstance()->getEventsServiceKey(0, evtlist, search_epg_item, search_keyword, true); + + if (!evtlist.empty()) + { + std::map::iterator map_it; + CChannelEventList::iterator e; + for (e = evtlist.begin(); e != evtlist.end(); ++e) + { + map_it = ch_id_map.find(e->channelID); + if (map_it != ch_id_map.end()) + { + e->channelID = map_it->second;//map channelID48 to channelID + } + else + { + evtlist.erase(e--);// remove event for not found channels in channelList } } - if(!evtlist.empty()){ - sort(evtlist.begin(),evtlist.end(),sortByDateTime); - } + } + if (!evtlist.empty()) + { + sort(evtlist.begin(), evtlist.end(), sortByDateTime); + } - time_t azeit=time(NULL); - CShortEPGData epg; - CEPGData longepg; - char tmpstr[256] ={0}; - std::string genere; - CChannelEventList::iterator eventIterator; - unsigned int u_azeit = ( azeit > -1)? azeit:0; - for (eventIterator = evtlist.begin(); eventIterator != evtlist.end(); ++eventIterator){ - if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) { - if( (eventIterator->startTime+eventIterator->duration) < u_azeit) - continue; - struct tm *tmStartZeit = localtime(&eventIterator->startTime); - if(xml_format){ - hh->printf("\t"); - 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()); - if (search_epginfo) { - 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()); - } - if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) { - hh->printf("\t\t%u\n", longepg.fsk); -#ifdef FULL_CONTENT_CLASSIFICATION - if (!longepg.contentClassification.empty()){ - genere = GetGenre(longepg.contentClassification[0]); - genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str()); - hh->printf("\t\t%s\n", genere.c_str()); - } -#else - if (longepg.contentClassification) { - genere = GetGenre(longepg.contentClassification); - genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str()); - hh->printf("\t\t%s\n", genere.c_str()); - } -#endif - } - strftime(tmpstr, sizeof(tmpstr), "%Y-%m-%d", tmStartZeit ); - hh->printf("\t\t%s\n", tmpstr); - strftime(tmpstr, sizeof(tmpstr), "%H:%M", tmStartZeit ); - hh->printf("\t\t\n", tmpstr); - hh->printf("\t\t%d\n", eventIterator->duration); - hh->printf("\t\t\t" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "\n",eventIterator->channelID); - hh->printf("\t\t\t%ld\n",eventIterator->eventID); - hh->printf("\t"); - }else{ - std::string datetimer_str ; - strftime(tmpstr, sizeof(tmpstr), "%Y-%m-%d %H:%M", tmStartZeit ); - datetimer_str = tmpstr; - datetimer_str += " "; - datetimer_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); - datetimer_str += " "; - datetimer_str += g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); - snprintf(tmpstr, sizeof(tmpstr)," [%d min]",eventIterator->duration / 60); - datetimer_str += tmpstr; - - hh->WriteLn(datetimer_str); - hh->WriteLn(NeutrinoAPI->GetServiceName(eventIterator->channelID)); - hh->WriteLn(epg.title); - if (search_epginfo) { - if(!epg.info1.empty()) - hh->WriteLn(epg.info1); - if(!epg.info2.empty()) - hh->WriteLn(epg.info2); - } - if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) { - hh->printf("fsk:%u\n", longepg.fsk); -#ifdef FULL_CONTENT_CLASSIFICATION - if (!longepg.contentClassification.empty()){ - genere = GetGenre(longepg.contentClassification[0]); - genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str()); - hh->WriteLn(genere); - } -#else - if (longepg.contentClassification) { - genere = GetGenre(longepg.contentClassification); - genere = ZapitTools::UTF8_to_UTF8XML(genere.c_str()); - hh->WriteLn(genere); - } -#endif - } - hh->WriteLn("----------------------------------------------------------"); + time_t azeit=time(NULL); + CShortEPGData epg; + CEPGData longepg; + char tmpstr[256] ={0}; + std::string genre; + CChannelEventList::iterator eventIterator; + unsigned int u_azeit = ( azeit > -1)? azeit:0; + for (eventIterator = evtlist.begin(); eventIterator != evtlist.end(); ++eventIterator) + { + bool got_next = (eventIterator != (evtlist.end() - 1)); + if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) + { + if( (eventIterator->startTime+eventIterator->duration) < u_azeit) + continue; + struct tm *tmStartZeit = localtime(&eventIterator->startTime); + item.clear(); + if (hh->outType == json || hh->outType == xml) + { + item += hh->outPair("channelname", NeutrinoAPI->GetServiceName(eventIterator->channelID), true); + item += hh->outPair("epgtitle", hh->outValue(epg.title), true); + if (return_epginfo) { + item += hh->outPair("info1", hh->outValue(epg.info1), true); + item += hh->outPair("info2", hh->outValue(epg.info2), true); } + if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) + { + item += hh->outPair("fsk", string_printf("%u", longepg.fsk), true); + genre = ""; +#ifdef FULL_CONTENT_CLASSIFICATION + if (!longepg.contentClassification.empty()) + genre = GetGenre(longepg.contentClassification[0]); +#else + if (longepg.contentClassification) + genre = GetGenre(longepg.contentClassification); +#endif + item += hh->outPair("genre", ZapitTools::UTF8_to_UTF8XML(genre.c_str()), true); + } + strftime(tmpstr, sizeof(tmpstr), "%Y-%m-%d", tmStartZeit ); + item += hh->outPair("date", tmpstr, true); + strftime(tmpstr, sizeof(tmpstr), "%H:%M", tmStartZeit ); + item += hh->outPair("time", tmpstr, true); + item += hh->outPair("duration", string_printf("%d", eventIterator->duration / 60), true); + item += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, eventIterator->channelID), true); + item += hh->outPair("eventid", string_printf("%llu", eventIterator->eventID), false); + + result += hh->outArrayItem("item", item, got_next); + } + else // outType == plain + { + std::string datetimer_str ; + strftime(tmpstr, sizeof(tmpstr), "%Y-%m-%d %H:%M", tmStartZeit ); + datetimer_str = tmpstr; + datetimer_str += " "; + datetimer_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); + datetimer_str += " "; + datetimer_str += g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); + snprintf(tmpstr, sizeof(tmpstr)," [%d min]",eventIterator->duration / 60); + datetimer_str += tmpstr; + + result += hh->outSingle(datetimer_str); + result += hh->outSingle(NeutrinoAPI->GetServiceName(eventIterator->channelID)); + result += hh->outSingle(epg.title); + if (return_epginfo) { + if(!epg.info1.empty()) + result += hh->outSingle(epg.info1); + if(!epg.info2.empty()) + result += hh->outSingle(epg.info2); + } + if (CEitManager::getInstance()->getEPGid(eventIterator->eventID, eventIterator->startTime, &longepg)) { + result += hh->outSingle(string_printf("fsk:%u", longepg.fsk)); + genre = ""; +#ifdef FULL_CONTENT_CLASSIFICATION + if (!longepg.contentClassification.empty()) + genre = GetGenre(longepg.contentClassification[0]); +#else + if (longepg.contentClassification) + genre = GetGenre(longepg.contentClassification); +#endif + if(!genre.empty()) + result += hh->outSingle(ZapitTools::UTF8_to_UTF8XML(genre.c_str())); + } + result += hh->outSingle("----------------------------------------------------------"); } } - if(xml_format) - hh->printf(""); - }else - hh->SendError(); + } + result = hh->outArray("epgsearch", result); + hh->SendResult(result); } //------------------------------------------------------------------------- @@ -1566,6 +1839,7 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_format ) * /control/epg * /control/epg? 64Bit, hex * /control/epg?id= + * /control/epg?search= * /control/epg?eventid= * /control/epg?ext * /control/epg?xml=true&channelid=|channelname=[&details=true][&max=][&stoptime=] @@ -1575,38 +1849,42 @@ void CControlAPI::EpgSearchCGI(CyhookHandler *hh, bool xml_format ) */ //------------------------------------------------------------------------- -void CControlAPI::EpgCGI(CyhookHandler *hh) { - NeutrinoAPI->eList.clear(); +void CControlAPI::EpgCGI(CyhookHandler *hh) +{ bool param_empty = hh->ParamList.empty(); hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); // default // Detailed EPG list in XML or JSON - if (!hh->ParamList["xml"].empty() || !hh->ParamList["json"].empty() || !hh->ParamList["detaillist"].empty()) { + if (hh->getOutType() == xml || hh->getOutType() == json || !hh->ParamList["detaillist"].empty()) { epgDetailList(hh); } // Standard list normal or extended else if (param_empty || hh->ParamList["1"] == "ext") { hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); bool isExt = (hh->ParamList["1"] == "ext"); - CChannelEvent *event = NULL; + CChannelEvent event; NeutrinoAPI->GetChannelEvents(); int mode = NeutrinoAPI->Zapit->getMode(); CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); for (; !(cit.EndOfChannels()); cit++) { CZapitChannel * channel = *cit; - event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; - if (event) { + NeutrinoAPI->GetChannelEvent(channel->getChannelID(), event); + if (event.eventID) { if (!isExt) { hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS - " %llu %s\n", channel->getChannelID(), event->eventID, event->description.c_str()); + " %llu %s\n", channel->getChannelID(), event.eventID, event.description.c_str()); } else { // ext output hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS - " %ld %u %llu %s\n", channel->getChannelID(), event->startTime, event->duration, event->eventID, event->description.c_str()); + " %ld %u %llu %s\n", channel->getChannelID(), event.startTime, event.duration, event.eventID, event.description.c_str()); } } } } + else if (!hh->ParamList["search"].empty()) + { + SendFoundEvents(hh, (hh->getOutType() == xml)); + } // query details for given eventid else if (!hh->ParamList["eventid"].empty()) { //special epg query @@ -1637,9 +1915,10 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { else if (!(hh->ParamList["id"].empty())) { t_channel_id channel_id = 0; sscanf(hh->ParamList["id"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id); - CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList); + CChannelEventList eList; + CEitManager::getInstance()->getEventsServiceKey(channel_id, eList); CChannelEventList::iterator eventIterator; - for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); ++eventIterator) { + for (eventIterator = eList.begin(); eventIterator != eList.end(); ++eventIterator) { CShortEPGData epg; if (CEitManager::getInstance()->getEPGidShort(eventIterator->eventID, &epg)) { hh->printf("%llu %ld %d\n", eventIterator->eventID, eventIterator->startTime, eventIterator->duration); @@ -1661,7 +1940,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { //----------------------------------------------------------------------------- void CControlAPI::VersionCGI(CyhookHandler *hh) { - hh->SendFile("/.version"); + hh->SendFile(TARGET_PREFIX "/.version"); } //----------------------------------------------------------------------------- void CControlAPI::ReloadNeutrinoSetupCGI(CyhookHandler *hh) @@ -1855,10 +2134,11 @@ void CControlAPI::LCDAction(CyhookHandler *hh) void CControlAPI::SendEventList(CyhookHandler *hh, t_channel_id channel_id) { int pos = 0; - CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList); + CChannelEventList eList; + CEitManager::getInstance()->getEventsServiceKey(channel_id, eList); CChannelEventList::iterator eventIterator; - for (eventIterator = NeutrinoAPI->eList.begin(); eventIterator != NeutrinoAPI->eList.end(); ++eventIterator, pos++) + for (eventIterator = eList.begin(); eventIterator != eList.end(); ++eventIterator, pos++) hh->printf("%llu %ld %d %s\n", eventIterator->eventID, eventIterator->startTime, eventIterator->duration, eventIterator->description.c_str()); } @@ -1986,7 +2266,8 @@ void CControlAPI::SendAllCurrentVAPid(CyhookHandler *hh) { if(!(init_iso)) { - strncpy( pids.APIDs[j].desc, _getISO639Description( pids.APIDs[j].desc ),DESC_MAX_LEN ); + std::string tmp_desc = _getISO639Description( pids.APIDs[j].desc); + strncpy(pids.APIDs[j].desc, tmp_desc.c_str(), DESC_MAX_LEN -1); } hh->printf("%05u %s %s\n",pids.APIDs[j].pid,pids.APIDs[j].desc,pids.APIDs[j].is_ac3 ? " (AC3)": pids.APIDs[j].desc,pids.APIDs[j].is_aac ? "(AAC)" : pids.APIDs[j].desc,pids.APIDs[j].is_eac3 ? "(EAC3)" : " "); } @@ -2020,7 +2301,7 @@ void CControlAPI::SendAllCurrentVAPid(CyhookHandler *hh) hh->printf("%05u pcr\n",pids.PIDs.pcrpid); } //----------------------------------------------------------------------------- -void CControlAPI::SendTimers(CyhookHandler *hh) +void CControlAPI::SendTimersPlain(CyhookHandler *hh) { CTimerd::TimerList timerlist; // List of bouquets bool send_id = false; @@ -2089,25 +2370,29 @@ void CControlAPI::SendTimers(CyhookHandler *hh) } //----------------------------------------------------------------------------- -void CControlAPI::_SendTime(CyhookHandler *hh, struct tm *Time, int digits) { +std::string CControlAPI::_SendTime(CyhookHandler *hh, struct tm *Time, int digits) { char zTime[25] = {0}; char zDate[25] = {0}; strftime(zTime,20,"%H:%M",Time); strftime(zDate,20,"%d.%m.%Y",Time); - hh->printf("\t\t\t\t\t%s %s\n",zDate,zTime); - hh->printf("\t\t\t\t\t%s\n",zDate); - hh->printf("\t\t\t\t\t\n",zTime); - hh->printf("\t\t\t\t\t%d\n",digits); - hh->printf("\t\t\t\t\t%d\n",Time->tm_mday); - hh->printf("\t\t\t\t\t%d\n",Time->tm_mon+1); - hh->printf("\t\t\t\t\t%d\n",Time->tm_year+1900); - hh->printf("\t\t\t\t\t%d\n",Time->tm_hour); - hh->printf("\t\t\t\t\t%d\n",Time->tm_min); + std::string result = ""; + + result += hh->outPair("text", string_printf("%s %s", zDate, zTime), true); + result += hh->outPair("date", string_printf("%s", zDate), true); + result += hh->outPair("time", string_printf("%s", zTime), true); + result += hh->outPair("digits", string_printf("%d", digits), true); + result += hh->outPair("day", string_printf("%d", Time->tm_mday), true); + result += hh->outPair("month", string_printf("%d", Time->tm_mon+1), true); + result += hh->outPair("year", string_printf("%d", Time->tm_year+1900), true); + result += hh->outPair("hour", string_printf("%d", Time->tm_hour), true); + result += hh->outPair("min", string_printf("%d", Time->tm_min), false); + + return result; } //----------------------------------------------------------------------------- -// build xml for all timer data (needed for yWeb 3) +// build json/xml for all timer data (needed for yWeb 3) //----------------------------------------------------------------------------- -void CControlAPI::SendTimersXML(CyhookHandler *hh) +void CControlAPI::SendTimers(CyhookHandler *hh) { // Init local timer iterator CTimerd::TimerList timerlist; // List of timers @@ -2115,97 +2400,86 @@ void CControlAPI::SendTimersXML(CyhookHandler *hh) NeutrinoAPI->Timerd->getTimerList(timerlist); sort(timerlist.begin(), timerlist.end()); // sort timer CTimerd::TimerList::iterator timer = timerlist.begin(); - -// std::string xml_response = ""; - hh->SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); - hh->WriteLn(""); - hh->WriteLn("\n"); - - // general timer configuration - hh->WriteLn("\t\n"); + std::string result = ""; + std::string config = ""; + std::string timer_list = ""; // Look for Recording Safety Timers too int pre=0, post=0; NeutrinoAPI->Timerd->getRecordingSafety(pre,post); -// hh->printf("\t\t\t%d\n",(int)timer->recordingSafety); - hh->printf("\t\t\t%d\n",pre); - hh->printf("\t\t\t%d\n",post); - hh->WriteLn("\t\n"); + config += hh->outPair("pre_delay", string_printf("%d", pre), true); + config += hh->outPair("post_delay", string_printf("%d", post), false); - // start timer list - hh->WriteLn("\t\n"); + result += hh->outObject("config", config, true); - for(; timer != timerlist.end(); ++timer) + for(int i = 0; timer != timerlist.end(); ++timer) { - hh->WriteLn("\t\t\n"); - hh->printf("\t\t\t%s\n",(NeutrinoAPI->timerEventType2Str(timer->eventType)).c_str()); - hh->printf("\t\t\t%d\n",timer->eventID); - hh->printf("\t\t\t%d\n",(int)timer->eventState); - hh->printf("\t\t\t%d\n",(int)timer->eventType); + if (i > 0) + timer_list += hh->outNext(); + + std::string timer_item = ""; + + timer_item += hh->outPair("type", NeutrinoAPI->timerEventType2Str(timer->eventType), true); + timer_item += hh->outPair("id", string_printf("%d", timer->eventID), true); + timer_item += hh->outPair("state", string_printf("%d", (int)timer->eventState), true); + timer_item += hh->outPair("type_number", string_printf("%d", (int)timer->eventType), true); // alarmtime - hh->WriteLn("\t\t\t\n"); + std::string alarm = ""; struct tm *alarmTime = localtime(&(timer->alarmTime)); - hh->WriteLn("\t\t\t\t\n"); - _SendTime(hh, alarmTime, (int)timer->alarmTime); - hh->WriteLn("\t\t\t\t\n"); + alarm += hh->outArrayItem("normal", _SendTime(hh, alarmTime, (int)timer->alarmTime), true); time_t real_alarmTimeT = timer->alarmTime - pre; struct tm *safetyAlarmTime = localtime(&real_alarmTimeT); - hh->WriteLn("\t\t\t\t\n"); - _SendTime(hh, safetyAlarmTime, (int)real_alarmTimeT); - hh->WriteLn("\t\t\t\t\n"); + alarm += hh->outArrayItem("safety", _SendTime(hh, safetyAlarmTime, (int)real_alarmTimeT), false); - hh->WriteLn("\t\t\t\n"); + timer_item += hh->outArray("alarm", alarm, true); // announcetime - hh->WriteLn("\t\t\t\n"); + std::string announce = ""; + struct tm *announceTime = localtime(&(timer->announceTime)); - hh->WriteLn("\t\t\t\t\n"); - _SendTime(hh, announceTime, (int)timer->announceTime); - hh->WriteLn("\t\t\t\t\n"); + announce += hh->outArrayItem("normal", _SendTime(hh, announceTime, (int)timer->announceTime), true); time_t real_announceTimeT = timer->announceTime - pre; struct tm *safetyAnnounceTime = localtime(&real_announceTimeT); - hh->WriteLn("\t\t\t\t\n"); - _SendTime(hh, safetyAnnounceTime, (int)real_announceTimeT); - hh->WriteLn("\t\t\t\t\n"); + announce += hh->outArrayItem("safety", _SendTime(hh, safetyAnnounceTime, (int)real_announceTimeT), false); - hh->WriteLn("\t\t\t\n"); + timer_item += hh->outArray("announce", announce, true); // stoptime if(timer->stopTime > 0) { - hh->WriteLn("\t\t\t\n"); + std::string stop = ""; + struct tm *stopTime = localtime(&(timer->stopTime)); - hh->WriteLn("\t\t\t\t\n"); - _SendTime(hh, stopTime, (int)timer->stopTime); - hh->WriteLn("\t\t\t\t\n"); + stop += hh->outArrayItem("normal", _SendTime(hh, stopTime, (int)timer->stopTime), true); time_t real_stopTimeT = timer->stopTime - post; struct tm *safetyStopTime = localtime(&real_stopTimeT); - hh->WriteLn("\t\t\t\t\n"); - _SendTime(hh, safetyStopTime, (int)real_stopTimeT); - hh->WriteLn("\t\t\t\t\n"); + stop += hh->outArrayItem("safety", _SendTime(hh, safetyStopTime, (int)real_stopTimeT), false); - hh->WriteLn("\t\t\t\n"); + timer_item += hh->outArray("stop", stop, true); } // repeat + std::string repeat = ""; + std::string zRep = NeutrinoAPI->timerEventRepeat2Str(timer->eventRepeat); std::string zRepCount; if (timer->eventRepeat == CTimerd::TIMERREPEAT_ONCE) zRepCount = "-"; else zRepCount = (timer->repeatCount == 0) ? "∞" : string_printf("%dx",timer->repeatCount); - hh->WriteLn("\t\t\t\n"); - hh->printf("\t\t\t\t%s\n",zRepCount.c_str()); - hh->printf("\t\t\t\t%d\n",(int)timer->eventRepeat); - hh->printf("\t\t\t\t%s\n",zRep.c_str()); std::string weekdays; NeutrinoAPI->Timerd->setWeekdaysToStr(timer->eventRepeat, weekdays); - hh->printf("\t\t\t\t%s\n", weekdays.c_str()); - hh->WriteLn("\t\t\t\n"); + + repeat += hh->outPair("count", zRepCount, true); + repeat += hh->outPair("number", string_printf("%d", (int)timer->eventRepeat), true); + repeat += hh->outPair("text", zRep, true); + repeat += hh->outPair("weekdays", weekdays, false); + + timer_item += hh->outObject("repeat", repeat, false); // channel infos std::string channel_name = NeutrinoAPI->GetServiceName(timer->channel_id); @@ -2225,72 +2499,74 @@ void CControlAPI::SendTimersXML(CyhookHandler *hh) { #if 0 case CTimerd::TIMER_NEXTPROGRAM : { - hh->printf("\t\t\t" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "\n",timer->channel_id); - hh->printf("\t\t\t%s\n",channel_name.c_str()); - hh->printf("\t\t\t%s\n",title.c_str()); + timer_item += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timer->channel_id), true); + timer_item += hh->outPair("channel_name", channel_name, true); + timer_item += hh->outPair("title", title, false); } break; #endif case CTimerd::TIMER_ZAPTO : { - hh->printf("\t\t\t" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "\n",timer->channel_id); - hh->printf("\t\t\t%s\n",channel_name.c_str()); - hh->printf("\t\t\t%s\n",title.c_str()); + timer_item += hh->outNext(); + timer_item += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timer->channel_id), true); + timer_item += hh->outPair("channel_name", channel_name, true); + timer_item += hh->outPair("title", title, false); } break; case CTimerd::TIMER_RECORD : { - hh->printf("\t\t\t" PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS "\n",timer->channel_id); - hh->printf("\t\t\t%s\n",channel_name.c_str()); - hh->printf("\t\t\t%s\n",title.c_str()); + timer_item += hh->outNext(); + timer_item += hh->outPair("channel_id", string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, timer->channel_id), true); + timer_item += hh->outPair("channel_name", channel_name, true); + timer_item += hh->outPair("title", title, true); // audio - if(timer->apids != TIMERD_APIDS_CONF) { - hh->WriteLn("\t\t\t\n"); - } - else { - hh->WriteLn("\t\t\t\n"); + std::string audio = ""; + std::string apids_conf = "true"; + std::string apids_std = "false"; + std::string apids_alt = "false"; + std::string apids_ac3 = "false"; + + if (timer->apids != TIMERD_APIDS_CONF) + { + apids_conf = "false"; + if (timer->apids & TIMERD_APIDS_STD) + apids_std = "true"; + if (timer->apids & TIMERD_APIDS_ALT) + apids_alt = "true"; + if (timer->apids & TIMERD_APIDS_AC3) + apids_ac3 = "true"; } - hh->printf("\t\t\t%s\n",timer->recordingDir); - hh->printf("\t\t\t%d\n",(int)timer->epgID); + audio += hh->outPair("apids_conf", apids_conf, true); + audio += hh->outPair("apids_std", apids_std, true); + audio += hh->outPair("apids_alt", apids_alt, true); + audio += hh->outPair("apids_ac3", apids_ac3, false); + timer_item += hh->outObject("audio", audio, true); + + timer_item += hh->outPair("recording_dir", timer->recordingDir, true); + timer_item += hh->outPair("epg_id", string_printf("%d", (int)timer->epgID), false); } break; case CTimerd::TIMER_STANDBY : { - hh->printf("\t\t\t%s\n",(timer->standby_on)? "on" : "off"); + timer_item += hh->outNext(); + timer_item += hh->outPair("status", (timer->standby_on) ? "on" : "off", false); } break; case CTimerd::TIMER_REMIND : { std::string _message; _message = std::string(timer->message).substr(0,20); - hh->printf("\t\t\t%s\n",_message.c_str()); + timer_item += hh->outNext(); + timer_item += hh->outPair("message", _message, false); } break; case CTimerd::TIMER_EXEC_PLUGIN : { - hh->printf("\t\t\t%s\n",timer->pluginName); + timer_item += hh->outNext(); + timer_item += hh->outPair("plugin", timer->pluginName, false); } break; @@ -2305,10 +2581,15 @@ void CControlAPI::SendTimersXML(CyhookHandler *hh) default: {} } - hh->WriteLn("\t\t\n"); + timer_list += hh->outArrayItem("timer", timer_item, false); + i++; } - hh->WriteLn("\t\n"); - hh->WriteLn("\n"); + result += hh->outArray("timer_list", timer_list); + if (hh->getOutType() == json) + result = hh->outArrayItem("timer", result, false); + result = hh->outArray("timer", result); + + hh->SendResult(result); } //----------------------------------------------------------------------------- @@ -2377,59 +2658,6 @@ void CControlAPI::YWeb_SendRadioStreamingPid(CyhookHandler *hh) } //----------------------------------------------------------------------------- -std::string CControlAPI::YexecuteScript(CyhookHandler *, std::string cmd) -{ - std::string script, para, result; - bool found = false; - - // split script and parameters - int pos; - if ((pos = cmd.find_first_of(" ")) > 0) - { - script = cmd.substr(0, pos); - para = cmd.substr(pos+1,cmd.length() - (pos+1)); // snip - } - else - script=cmd; - // get file - std::string fullfilename; - script += ".sh"; //add script extention - char cwd[255]={0}; - getcwd(cwd, 254); - - for (unsigned int i=0; iParamList["update"]="1"; @@ -2584,7 +2812,8 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) eventinfo.epgID = 0; eventinfo.epg_starttime = 0; eventinfo.apids = TIMERD_APIDS_CONF; - eventinfo.recordingSafety = (hh->ParamList["rs"] == "1"); + eventinfo.recordingSafety = (hh->ParamList["rs"] == "1") || (hh->ParamList["rs"] == "on"); + eventinfo.autoAdjustToEPG = (hh->ParamList["aj"] == "1") || (hh->ParamList["aj"] == "on"); // channel by Id or name if(!hh->ParamList["channel_id"].empty()) @@ -2811,6 +3040,125 @@ void CControlAPI::updateBouquetCGI(CyhookHandler *hh) NeutrinoAPI->UpdateBouquets(); hh->SendOk(); } +//----------------------------------------------------------------------------- +// details EPG Information in xmltv format from all user bouquets +//----------------------------------------------------------------------------- +void CControlAPI::xmltvepgCGI(CyhookHandler *hh) +{ + int mode = NeutrinoAPI->Zapit->getMode(); + hh->ParamList["format"] = "xml"; + hh->outStart(); + + t_channel_id channel_id; + std::string result = ""; + std::string channelTag = "", channelData = ""; + std::string programmeTag = "", programmeData = ""; + + ZapitChannelList chanlist; + CChannelEventList eList; + CChannelEventList::iterator eventIterator; + + for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) + { + if (mode == CZapitClient::MODE_RADIO) + g_bouquetManager->Bouquets[i]->getRadioChannels(chanlist); + else + g_bouquetManager->Bouquets[i]->getTvChannels(chanlist); + if(!chanlist.empty() && !g_bouquetManager->Bouquets[i]->bHidden && g_bouquetManager->Bouquets[i]->bUser) + { + for(int j = 0; j < (int) chanlist.size(); j++) + { + CZapitChannel * channel = chanlist[j]; + channel_id = channel->getChannelID() & 0xFFFFFFFFFFFFULL; + channelTag = "channel id=\""+string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id)+"\""; + channelData = hh->outPair("display-name", hh->outValue(channel->getName()), true); + result += hh->outObject(channelTag, channelData); + + eList.clear(); + + CEitManager::getInstance()->getEventsServiceKey(channel_id, eList); + + if (eList.size() == 0) + continue; + + if (eList.size() > 50) + eList.erase(eList.begin()+50,eList.end()); + + for (eventIterator = eList.begin(); eventIterator != eList.end(); ++eventIterator) + { + if (eventIterator->get_channel_id() == channel_id) + { + programmeTag = "programme "; + programmeTag += "channel=\""+string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel_id)+"\" "; + char zbuffer[25] = { 0 }; + struct tm *mtime = localtime(&eventIterator->startTime); + strftime(zbuffer, 21, "%Y%m%d%H%M%S +0200", mtime); + programmeTag += "start=\""+std::string(zbuffer)+"\" "; + long _stoptime = eventIterator->startTime + eventIterator->duration; + mtime = localtime(&_stoptime); + strftime(zbuffer, 21, "%Y%m%d%H%M%S +0200", mtime); + programmeTag += "stop=\""+std::string(zbuffer)+"\" "; + + programmeData = hh->outPair("title lang=\"de\"", hh->outValue(eventIterator->description), false); + programmeData += hh->outPair("desc lang=\"de\"", hh->outValue(eventIterator->text), true); + + result += hh->outArrayItem(programmeTag, programmeData, false); + } + } + } + } + } + + + result = hh->outObject("tv generator-info-name=\"Neutrino XMLTV Generator v1.0\"", result); + + result = "\n\n" + result; + + hh->SendResult(result); +} + +void CControlAPI::xmltvm3uCGI(CyhookHandler *hh) +{ + hh->outStart(); + std::string result = ""; + + int mode = NeutrinoAPI->Zapit->getMode(); + // build url + std::string url = ""; + if(!hh->ParamList["host"].empty()) + url = "http://"+hh->ParamList["host"]; + else + url = "http://"+hh->HeaderList["Host"]; + /* strip off optional custom port */ + if (url.rfind(":") != 4) + url = url.substr(0, url.rfind(":")); + + url += ":31339/id="; + + result += "#EXTM3U\n"; + + for (int i = 0; i < (int) g_bouquetManager->Bouquets.size(); i++) + { + ZapitChannelList chanlist; + if (mode == CZapitClient::MODE_RADIO) + g_bouquetManager->Bouquets[i]->getRadioChannels(chanlist); + else + g_bouquetManager->Bouquets[i]->getTvChannels(chanlist); + if(!chanlist.empty() && !g_bouquetManager->Bouquets[i]->bHidden && g_bouquetManager->Bouquets[i]->bUser) + { + for(int j = 0; j < (int) chanlist.size(); j++) + { + CZapitChannel * channel = chanlist[j]; + std::string bouq_name = g_bouquetManager->Bouquets[i]->Name; + std::string chan_id_short = string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID() & 0xFFFFFFFFFFFFULL); + result += "#EXTINF:-1 tvg-id=\""+chan_id_short+"\" tvg-logo=\""+NeutrinoAPI->getLogoFile(channel->getChannelID())+"\" group-title=\""+bouq_name+"\", [COLOR gold]"+channel->getName()+"[/COLOR]\n"; + result += url+string_printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS, channel->getChannelID())+"\n"; + } + } + } + + hh->SendResult(result); +} //------------------------------------------------------------------------- // audio_no : (optional) audio channel // host : (optional) ip of dbox @@ -2884,7 +3232,7 @@ void CControlAPI::logoCGI(CyhookHandler *hh) sscanf(hh->ParamList["1"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id); - hh->Write(NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel_id)); + hh->Write(NeutrinoAPI->getLogoFile(channel_id)); } //------------------------------------------------------------------------- /** Get Config File or save values to given config file @@ -2936,7 +3284,8 @@ void CControlAPI::logoCGI(CyhookHandler *hh) * @endcode */ //------------------------------------------------------------------------- -void CControlAPI::ConfigCGI(CyhookHandler *hh) { +void CControlAPI::ConfigCGI(CyhookHandler *hh) +{ bool load = true; CConfigFile *Config = new CConfigFile(','); ConfigDataMap conf; @@ -2945,7 +3294,7 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { std::string result = ""; std::string configFileName = hh->ParamList["config"]; - TOutType outType = hh->outStart(); + hh->outStart(); if (hh->ParamList["action"] == "submit") load = false; @@ -2953,6 +3302,8 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { // Para "config" describes the config type if (configFileName == "neutrino") config_filename = NEUTRINO_CONFIGFILE; + else if (configFileName == "moviebrowser") + config_filename = MOVIEBROWSER_CONFIGFILE; else if (configFileName == "nhttpd") config_filename = HTTPD_CONFIGFILE; else if (configFileName == "yweb") @@ -2969,13 +3320,9 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { replace(key, ".", "_dot_"); replace(key, "-", "_bind_"); if (!(hh->ParamList["config"] == "nhttpd" && it->first == "mod_auth.password")) { - if(outType == plain) - result += key + "=" + it->second + "\n"; - else { - if(it != start) - result += hh->outNext(); - result += hh->outPair(key, it->second, false); - } + if(it != start) + result += hh->outNext(); + result += hh->outPair(key, it->second, false); } } } @@ -2994,28 +3341,15 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { } else { if(!configFileName.empty()) - error = string_printf("no config defined for: %s", (hh->ParamList["config"]).c_str()); - else - error = "no config given"; + error = string_printf("no config defined for %s", (hh->ParamList["config"]).c_str()); } - // write footer - if (error.empty()) { - if (outType == json) { - hh->WriteLn(json_out_success(result)); - } - else { - hh->WriteLn(hh->outCollection("config", result)); - } - } - else { - if (outType == json) { - hh->WriteLn(json_out_error(error)); - } - else { - hh->SendError(); - } - } + hh->WriteLn(hh->outObject("config", result)); + + if (error.empty()) + hh->SendResult(result); + else + hh->SendError(error); delete Config; } @@ -3027,13 +3361,14 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { * * @par nhttpd-usage * @code - * /control/file?action=list&path={path}[&format=|xml|json] + * /control/file?action=list&path={path}[&format=|xml|json][&sort=false] * @endcode * * @par example: * @code * /control/file?action=list&path=/ * /control/file?action=list&path=/&format=json + * /control/file?action=list&path=/&format=json&sort=false * @endcode * * @par output @@ -3073,22 +3408,22 @@ void CControlAPI::ConfigCGI(CyhookHandler *hh) { * action =new_folder|delete|read_file|write_file|set_properties */ //----------------------------------------------------------------------------- -void CControlAPI::FileCGI(CyhookHandler *hh) { +void CControlAPI::FileCGI(CyhookHandler *hh) +{ std::string result = ""; if (hh->ParamList["action"] == "list") { // directory list: action=list&path= DIR *dirp; - TOutType outType = hh->outStart(); + hh->outStart(); std::string path = hh->ParamList["path"]; if ((dirp = opendir(path.c_str()))) { - bool isFirstLine = true; struct dirent *entry; + std::vector filelist; while ((entry = readdir(dirp))) { - std::string item = ""; - item += hh->outPair("name", - hh->outValue(hh->outValue(entry->d_name)), true); + if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")) + continue; std::string ftype; if (entry->d_type == DT_DIR) ftype = "dir"; @@ -3096,75 +3431,71 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { ftype = "lnk"; else if (entry->d_type == 8) ftype = "file"; - - item += hh->outPair("type_str", ftype, true); - item += hh->outPair("type", - string_printf("%d", (int) entry->d_type), true); if (path[path.length() - 1] != '/') path += "/"; std::string fullname = path + entry->d_name; - item += hh->outPair("fullname", hh->outValue(fullname), true); + + FileCGI_List listitem; + listitem.name = std::string(entry->d_name); + listitem.type_str = ftype; + listitem.type = entry->d_type; + listitem.fullname = fullname; + + filelist.push_back(listitem); + } + closedir(dirp); + + if (hh->ParamList["sort"] != "false") + sort(filelist.begin(), filelist.end(), fsort); + + for(std::vector::iterator f = filelist.begin(); f != filelist.end(); ++f) + { + bool got_next = (f != filelist.end()-1); + + std::string item = ""; + item += hh->outPair("name", hh->outValue(f->name.c_str()), true); + item += hh->outPair("type_str", hh->outValue(f->type_str.c_str()), true); + item += hh->outPair("type", string_printf("%d", (int) f->type), true); + item += hh->outPair("fullname", hh->outValue(f->fullname.c_str()), true); struct stat statbuf; - if (stat(fullname.c_str(), &statbuf) != -1) { - item - += hh->outPair( - "mode", - string_printf("%xld", - (long) statbuf.st_mode), true); + if (stat(f->fullname.c_str(), &statbuf) != -1) { + item += hh->outPair("mode", string_printf("%xld", (long) statbuf.st_mode), true); /* Print out type, permissions, and number of links. */ //TODO: hh->printf("\t\t%10.10s\n", sperm (statbuf.st_mode)); - item += hh->outPair("nlink", - string_printf("%d", statbuf.st_nlink), true); + item += hh->outPair("nlink", string_printf("%d", statbuf.st_nlink), true); /* Print out owner's name if it is found using getpwuid(). */ struct passwd *pwd; - if ((pwd = getpwuid(statbuf.st_uid)) != NULL) { + if ((pwd = getpwuid(statbuf.st_uid)) != NULL) item += hh->outPair("user", pwd->pw_name, true); - } - else { - item += hh->outPair("user", - string_printf("%d", statbuf.st_uid), true); - } + else + item += hh->outPair("user", string_printf("%d", statbuf.st_uid), true); + /* Print out group name if it is found using getgrgid(). */ struct group *grp; if ((grp = getgrgid(statbuf.st_gid)) != NULL) item += hh->outPair("group", grp->gr_name, true); - else { - item += hh->outPair("group", - string_printf("%d", statbuf.st_gid), true); - } + else + item += hh->outPair("group", string_printf("%d", statbuf.st_gid), true); + /* Print size of file. */ - item += hh->outPair("size", - string_printf("%jd", (intmax_t) statbuf.st_size), - true); + item += hh->outPair("size", string_printf("%jd", (intmax_t) statbuf.st_size), true); + struct tm *tm = localtime(&statbuf.st_mtime); char datestring[256] = {0}; /* Get localized date string. */ - strftime(datestring, sizeof(datestring), - nl_langinfo(D_T_FMT), tm); + strftime(datestring, sizeof(datestring), nl_langinfo(D_T_FMT), tm); item += hh->outPair("time", hh->outValue(datestring), true); - - item += hh->outPair("time_t", - string_printf("%ld", (long) statbuf.st_mtime), - false); + item += hh->outPair("time_t", string_printf("%ld", (long) statbuf.st_mtime), false); } - if(isFirstLine) - isFirstLine = false; - else - result += hh->outNext(); - result += hh->outArrayItem("item", item, false); + result += hh->outArrayItem("item", item, got_next); } - closedir(dirp); } result = hh->outArray("filelist", result); - // write footer - if (outType == json) { - hh->WriteLn(json_out_success(result)); - } - else - hh->WriteLn(result); + + hh->SendResult(result); } // create new folder else if (hh->ParamList["action"] == "new_folder") { @@ -3176,3 +3507,303 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { //TODO } } + +//----------------------------------------------------------------------------- +/** Get a list of statfs output for a given path + * + * @param hh CyhookHandler + * + * @par nhttpd-usage + * @code + * /control/statfs[?path={path}][&format=plain|xml|json] + * @endcode + * + * @par example: + * @code + * /control/statfs + * /control/statfs?path=/media/sda1/movies&format=json + * @endcode + * + * @par output + * @code + * {"success": "true", "data": + * { + * "statfs": { + * "path": "/media/sda1/movies", + * "f_type": "0x4d44", + * "f_bsize": "4096", + * "f_blocks": "488444", + * "f_bfree": "365874", + * "f_bavail": "365874", + * "f_files": "0", + * "f_ffree": "0", + * "f_fsid": "0x801, 0", + * "f_namelen": "1530", + * "f_frsize": "24" + * } + * }} + * @endcode + */ +//----------------------------------------------------------------------------- +void CControlAPI::StatfsCGI(CyhookHandler *hh) +{ + std::string result = ""; + + if (hh->ParamList["path"].empty()) + hh->ParamList["path"] = "/"; + + hh->outStart(); + + std::string path = hh->ParamList["path"]; + struct statfs s; + if (::statfs(path.c_str(), &s) == 0) + { + std::string item = ""; + item += hh->outPair("path", path.c_str(), true); + item += hh->outPair("f_type", string_printf("%#lx", (unsigned long) s.f_type), true); + item += hh->outPair("f_bsize", string_printf("%lu", (unsigned long) s.f_bsize), true); + item += hh->outPair("f_blocks", string_printf("%lu", (unsigned long) s.f_blocks), true); + item += hh->outPair("f_bfree", string_printf("%lu", (unsigned long) s.f_bfree), true); + item += hh->outPair("f_bavail", string_printf("%lu", (unsigned long) s.f_bavail), true); + item += hh->outPair("f_files", string_printf("%lu", (unsigned long) s.f_files), true); + item += hh->outPair("f_ffree", string_printf("%lu", (unsigned long) s.f_ffree), true); + item += hh->outPair("f_fsid", string_printf("%#x, %#x", (unsigned) s.f_fsid.__val[0], (unsigned) s.f_fsid.__val[1]), true); + item += hh->outPair("f_namelen", string_printf("%lu", (unsigned long) s.f_namelen), true); + item += hh->outPair("f_frsize", string_printf("%lu", (unsigned long) s.f_frsize), false); + + result = hh->outObject("statfs", item); + + hh->SendResult(result); + } + else + hh->SendError("statfs failed"); +} + +//----------------------------------------------------------------------------- +/** Get neutrino directories + * + * @param hh CyhookHandler + * + * @par nhttpd-usage + * @code + * /control/getdir?dir=allmoviedirs&[&subdirs=true][&format=|xml|json] + * @endcode + * +{"success": "true", "data":{"dirs": [{"dir": "/mnt/series/", +"used": "1" +} +,{"dir": "/mnt/movies/", +"used": "1" +} +,{"dir": "/mnt/movies/subdir" +} +{"dir": "/media/sda1/movie" +} +,] +}} + * @endcode + * + */ +//----------------------------------------------------------------------------- +void CControlAPI::getDirCGI(CyhookHandler *hh) +{ + std::string result = ""; + std::string item = ""; + bool isFirstLine = true; + + hh->outStart(true /*old mode*/); + + //Shows all 7 directories stored in the moviebrowser.conf + if (hh->ParamList["dir"] == "moviedir" || hh->ParamList["dir"] == "allmoviedirs" ) { + CConfigFile *Config = new CConfigFile(','); + Config->loadConfig(MOVIEBROWSER_CONFIGFILE); + char index[21]; + std::string mb_dir; + + for(int i=0;i<8;i++) { + snprintf(index, sizeof(index), "%d", i); + mb_dir = "mb_dir_"; + mb_dir = mb_dir + index; + mb_dir = Config->getString(mb_dir, ""); + + if(!mb_dir.empty()) { + item += hh->outPair("dir", hh->outValue(mb_dir), false); + if(isFirstLine) { + isFirstLine = false; + } + else { + result += hh->outNext(); + } + result += hh->outArrayItem("item", item, false); + item = ""; + if (hh->ParamList["subdirs"] == "true") { + result = getSubdirectories(hh, mb_dir, result); + } + } + } + } + + //Shows the neutrino recording dir + if (hh->ParamList["dir"] == "recordingdir" || hh->ParamList["dir"] == "allmoviedirs" ) { + item += hh->outPair("dir", hh->outValue(g_settings.network_nfs_recordingdir), false); + if(isFirstLine) { + isFirstLine = false; + } + else { + result += hh->outNext(); + } + result += hh->outArrayItem("item", item, false); + if (hh->ParamList["subdirs"] == "true") { + result = getSubdirectories(hh, g_settings.network_nfs_recordingdir, result); + } + } + + + result = hh->outArray("dirs", result); + + hh->SendResult(result); +} + +//Helpfunction to get subdirs of a dir +std::string CControlAPI::getSubdirectories(CyhookHandler *hh, std::string path, std::string result) +{ + std::string item = ""; + DIR *dirp; + struct dirent *entry; + + if ((dirp = opendir(path.c_str()))) { + while ((entry = readdir(dirp))) { + if (entry->d_type == DT_DIR && entry->d_name[0] != '.') { + if (path[path.length() - 1] != '/') { + path += "/"; + } + std::string fullname = path + entry->d_name; + item += hh->outPair("dir", hh->outValue(fullname), false); + result += hh->outNext(); + result += hh->outArrayItem("item", item, false); + item = ""; + result = getSubdirectories(hh, fullname, result); + } + } + closedir(dirp); + } + return result; +} + + +//----------------------------------------------------------------------------- +/** Get neutrino movies + * + * @param hh CyhookHandler + * + * @par nhttpd-usage + * @code + * /control/getmovies?ir=allmoviedirs&[&subdirs=true][&format=|xml|json] + * @endcode + * +{"success": "true", "data":{"movies": [{"title": "Sample.mkv", +"path": "/media/sda1/movies/Sample.mkv", +"size": "1136242099" +} +,{"title": "Aufnahme1.ts", +"path": "/media/sda1/recording/Aufnahme1.ts", +"size": "941" +} +,{"title": "Aufnahme2.ts", +"path": "/media/sda1/recording/Aufnahme2.ts", +"size": "941" +} +] +}} + * @endcode + * + */ +//----------------------------------------------------------------------------- +void CControlAPI::getMoviesCGI(CyhookHandler *hh) { + std::string result = ""; + bool subdirs = true; + + if(hh->ParamList["subdirs"] == "false") { + subdirs = false; + } + + hh->outStart(); + + //Shows all movies with path in moviebrowser.conf + if (hh->ParamList["dir"] == "moviedir" || hh->ParamList["dir"] == "allmoviedirs" ) { + CConfigFile *Config = new CConfigFile(','); + Config->loadConfig(MOVIEBROWSER_CONFIGFILE); + char index[21]; + std::string mb_dir; + + for(int i=0;i<8;i++) { + snprintf(index, sizeof(index), "%d", i); + mb_dir = "mb_dir_"; + mb_dir = mb_dir + index; + mb_dir = Config->getString(mb_dir, ""); + + if(!mb_dir.empty()) { + result = readMovies(hh, mb_dir, result, subdirs); + } + } + } + + //Shows all movies in the recordingdir + if (hh->ParamList["dir"] == "recordingdir" || hh->ParamList["dir"] == "allmoviedirs" ) { + result = readMovies(hh, g_settings.network_nfs_recordingdir, result, subdirs); + } + + //Shows movie from a given path + if (hh->ParamList["dir"][0] == '/') { + result = readMovies(hh, hh->ParamList["dir"], result, subdirs); + } + + result = hh->outArray("movies", result); + + hh->SendResult(result); +} + +//Helpfunction to get movies of a dir +std::string CControlAPI::readMovies(CyhookHandler *hh, std::string path, std::string result, bool subdirs) { + std::string item = ""; + std::string fullname; + DIR *dirp; + struct dirent *entry; + + if ((dirp = opendir(path.c_str()))) { + if (path[path.length() - 1] != '/') { + path += "/"; + } + while ((entry = readdir(dirp))) { + if(entry->d_type == 8) { + fullname = path + entry->d_name; + item += hh->outPair("title", hh->outValue(entry->d_name),true); + item += hh->outPair("path", hh->outValue(fullname), true); + struct stat statbuf; + if (stat(fullname.c_str(), &statbuf) != -1) { + /* Print size of file. */ + item += hh->outPair("size", string_printf("%jd", (intmax_t) statbuf.st_size), false); + } + if(!result.empty()) { + result += hh->outNext(); + } + result += hh->outArrayItem("item", item, false); + item = ""; + } + } + closedir(dirp); + if ((dirp = opendir(path.c_str()))) { + if(subdirs) + { + while ((entry = readdir(dirp))) { + if (entry->d_type == DT_DIR && entry->d_name[0] != '.') { + fullname = path + entry->d_name; + result = readMovies(hh, fullname, result, subdirs); + } + } + } + closedir(dirp); + } + } + return result; +} diff --git a/src/nhttpd/tuxboxapi/controlapi.h b/src/nhttpd/tuxboxapi/controlapi.h index 33287b6e0..e80702b28 100644 --- a/src/nhttpd/tuxboxapi/controlapi.h +++ b/src/nhttpd/tuxboxapi/controlapi.h @@ -19,6 +19,7 @@ class CControlAPI : public Cyhook private: // Dispatcher Array typedef void (CControlAPI::*TyFunc)(CyhookHandler *hh); + std::string func_req; typedef struct { const char *func_name; @@ -27,28 +28,41 @@ private: } TyCgiCall; const static TyCgiCall yCgiCallList[]; + struct FileCGI_List + { + std::string name; + std::string type_str; + unsigned char type; + std::string fullname; + + bool operator() (FileCGI_List a, FileCGI_List b) + { + return (a.name < b.name); + } + } fsort; + int rc_send(int ev, unsigned int code, unsigned int value); // send functions for ExecuteCGI (controld api) void SendEventList(CyhookHandler *hh,t_channel_id channel_id); + void SendFoundEvents(CyhookHandler *hh, bool xml_format = false); void SendcurrentVAPid(CyhookHandler *hh); void SendAllCurrentVAPid(CyhookHandler *hh); void SendStreamInfo(CyhookHandler *hh); void SendBouquets(CyhookHandler *hh); void SendBouquet(CyhookHandler *hh,int BouquetNr); void SendChannelList(CyhookHandler *hh, bool currentTP = false); + void SendTimersPlain(CyhookHandler *hh); void SendTimers(CyhookHandler *hh); - void SendTimersXML(CyhookHandler *hh); void epgDetailList(CyhookHandler *hh); void EpgSearchXMLCGI(CyhookHandler *hh); - void EpgSearchTXTCGI(CyhookHandler *hh); - void EpgSearchCGI(CyhookHandler *hh, bool xml_format = false); + void EpgSearchCGI(CyhookHandler *hh); // subs friend class CNeutrinoWebserver; // for timer /fb/ compatibility void doModifyTimer(CyhookHandler *hh); void doNewTimer(CyhookHandler *hh); - void _SendTime(CyhookHandler *hh, struct tm *Time, int digits); - std::string _GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * channel, int bouquetNr, int nr); + std::string _SendTime(CyhookHandler *hh, struct tm *Time, int digits); + std::string _GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * channel, int bouquetNr, int channelNr); std::string channelEPGformated(CyhookHandler *hh, int bouquetnr, t_channel_id channel_id, int max, long stoptime); std::string _GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChannel * channel); @@ -56,7 +70,6 @@ private: void YWeb_SendVideoStreamingPids(CyhookHandler *hh, int apid_no); void YWeb_SendRadioStreamingPid(CyhookHandler *hh); void compatibility_Timer(CyhookHandler *hh); - std::string YexecuteScript(CyhookHandler *hh, std::string cmd); // CGI functions for ExecuteCGI void TimerCGI(CyhookHandler *hh); @@ -71,7 +84,7 @@ private: void GetServicesxmlCGI(CyhookHandler *hh); void GetBouquetsxmlCGI(CyhookHandler *hh); void GetUBouquetsxmlCGI(CyhookHandler *hh); - void GetChannel_IDCGI(CyhookHandler *hh); + void GetChannelIDCGI(CyhookHandler *hh); void GetTPChannel_IDCGI(CyhookHandler *hh); void MessageCGI(CyhookHandler *hh); void InfoCGI(CyhookHandler *hh); @@ -81,6 +94,7 @@ private: void ChannellistCGI(CyhookHandler *hh); void LogolistCGI(CyhookHandler *hh); void GetBouquetCGI(CyhookHandler *hh); + void GetChannelCGI(CyhookHandler *hh); void GetBouquetsCGI(CyhookHandler *hh); void EpgCGI(CyhookHandler *hh); void VersionCGI(CyhookHandler *hh); @@ -109,22 +123,30 @@ private: void renameBouquetCGI(CyhookHandler *hh); void changeBouquetCGI(CyhookHandler *hh); void updateBouquetCGI(CyhookHandler *hh); + void xmltvepgCGI(CyhookHandler *hh); + void xmltvm3uCGI(CyhookHandler *hh); void build_live_url(CyhookHandler *hh); void logoCGI(CyhookHandler *hh); void ConfigCGI(CyhookHandler *hh); void FileCGI(CyhookHandler *hh); + void StatfsCGI(CyhookHandler *hh); void SignalInfoCGI(CyhookHandler *hh); + void getDirCGI(CyhookHandler *hh); + void getMoviesCGI(CyhookHandler *hh); + std::string readMovies(CyhookHandler *hh, std::string path, std::string result, bool subdirs); + std::string getSubdirectories(CyhookHandler *hh, std::string path, std::string result); protected: - static const unsigned int PLUGIN_DIR_COUNT = 9; - static std::string PLUGIN_DIRS[PLUGIN_DIR_COUNT]; CNeutrinoAPI *NeutrinoAPI; void init(CyhookHandler *hh); void Execute(CyhookHandler *hh); public: + static const unsigned int PLUGIN_DIR_COUNT = 9; + static std::string PLUGIN_DIRS[PLUGIN_DIR_COUNT]; + // constructor & deconstructor CControlAPI(CNeutrinoAPI *_NeutrinoAPI); diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/neutrinoapi.cpp index a1662dd93..4ec8ca05b 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -26,9 +26,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -41,7 +41,9 @@ #include #include #include +#include +extern CPictureViewer *g_PicViewer; extern CBouquetManager *g_bouquetManager; extern CFrontend * frontend; extern cVideo * videoDecoder; @@ -135,6 +137,10 @@ CNeutrinoAPI::CNeutrinoAPI() 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"); + EventServer->registerEvent2( NeutrinoMessages::RECORD_START, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); + EventServer->registerEvent2( NeutrinoMessages::RECORD_STOP, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock"); + + pmutex = new OpenThreads::Mutex(OpenThreads::Mutex::MUTEX_RECURSIVE); } //------------------------------------------------------------------------- @@ -152,6 +158,8 @@ CNeutrinoAPI::~CNeutrinoAPI(void) delete Timerd; if (EventServer) delete EventServer; + + delete pmutex; } //------------------------------------------------------------------------- @@ -171,6 +179,7 @@ void CNeutrinoAPI::UpdateBouquets(void) //------------------------------------------------------------------------- void CNeutrinoAPI::ZapTo(const char * const target) { + OpenThreads::ScopedPointerLock lock(pmutex); t_channel_id channel_id; sscanf(target, @@ -182,6 +191,7 @@ void CNeutrinoAPI::ZapTo(const char * const target) //------------------------------------------------------------------------- void CNeutrinoAPI::ZapToChannelId(t_channel_id channel_id) { + OpenThreads::ScopedPointerLock lock(pmutex); if (channel_id == Zapit->getCurrentServiceID()) { //printf("Kanal ist aktuell\n"); @@ -195,6 +205,7 @@ void CNeutrinoAPI::ZapToChannelId(t_channel_id channel_id) void CNeutrinoAPI::ZapToSubService(const char * const target) { + OpenThreads::ScopedPointerLock lock(pmutex); t_channel_id channel_id; sscanf(target, @@ -207,6 +218,7 @@ void CNeutrinoAPI::ZapToSubService(const char * const target) //------------------------------------------------------------------------- t_channel_id CNeutrinoAPI::ChannelNameToChannelId(std::string search_channel_name) { + OpenThreads::ScopedPointerLock lock(pmutex); //FIXME depending on mode missing //int mode = Zapit->getMode(); t_channel_id channel_id = (t_channel_id)-1; @@ -264,6 +276,7 @@ bool CNeutrinoAPI::GetStreamInfo(int bitInfo[10]) bool CNeutrinoAPI::GetChannelEvents(void) { + OpenThreads::ScopedPointerLock lock(pmutex); eList.clear(); CEitManager::getInstance()->getChannelEvents(eList); CChannelEventList::iterator eventIterator; @@ -279,15 +292,31 @@ bool CNeutrinoAPI::GetChannelEvents(void) return true; } -//------------------------------------------------------------------------- - -std::string CNeutrinoAPI::GetServiceName(t_channel_id channel_id) +void CNeutrinoAPI::GetChannelEvent(t_channel_id channel_id, CChannelEvent &event) { - return CServiceManager::getInstance()->GetServiceName(channel_id); + OpenThreads::ScopedPointerLock lock(pmutex); + event.eventID = 0; + + t_channel_id epg_id = channel_id; + CZapitChannel * ch = CServiceManager::getInstance()->FindChannel(channel_id); + if (ch) + epg_id = ch->getEpgID(); + + CChannelEvent * evt = ChannelListEvents[epg_id]; + if (evt) + event = *evt; } //------------------------------------------------------------------------- +std::string CNeutrinoAPI::GetServiceName(t_channel_id channel_id) +{ + OpenThreads::ScopedPointerLock lock(pmutex); + return CServiceManager::getInstance()->GetServiceName(channel_id); +} + +//------------------------------------------------------------------------- +#if 0 //never used CZapitClient::BouquetChannelList *CNeutrinoAPI::GetBouquet(unsigned int, int) { //FIXME @@ -315,7 +344,7 @@ void CNeutrinoAPI::UpdateChannelList(void) { //FIXME } - +#endif //------------------------------------------------------------------------- std::string CNeutrinoAPI::timerEventType2Str(CTimerd::CTimerEventTypes type) @@ -323,33 +352,33 @@ std::string CNeutrinoAPI::timerEventType2Str(CTimerd::CTimerEventTypes type) std::string result; switch (type) { case CTimerd::TIMER_SHUTDOWN: - result = "Shutdown"; + result = "{=L:timerlist.type.shutdown=}"; break; #if 0 case CTimerd::TIMER_NEXTPROGRAM: - result = "Next program"; + result = "{=L:timerlist.type.nextprogram=}"; break; #endif case CTimerd::TIMER_ZAPTO: - result = "Zap to"; + result = "{=L:timerlist.type.zapto=}"; break; case CTimerd::TIMER_STANDBY: - result = "Standby"; + result = "{=L:timerlist.type.standby=}"; break; case CTimerd::TIMER_RECORD: - result = "Record"; + result = "{=L:timerlist.type.record=}"; break; case CTimerd::TIMER_REMIND: - result = "Reminder"; + result = "{=L:timerlist.type.remind=}"; break; case CTimerd::TIMER_EXEC_PLUGIN: - result = "Execute plugin"; + result = "{=L:timerlist.type.execplugin=}"; break; case CTimerd::TIMER_SLEEPTIMER: - result = "Sleeptimer"; + result = "{=L:timerlist.type.sleeptimer=}"; break; default: - result = "Unknown"; + result = "{=L:timerlist.type.unknown=}"; break; } return result; @@ -362,63 +391,66 @@ std::string CNeutrinoAPI::timerEventRepeat2Str(CTimerd::CTimerEventRepeat rep) std::string result; switch (rep) { case CTimerd::TIMERREPEAT_ONCE: - result = "once"; + result = "{=L:timerlist.repeat.once=}"; break; case CTimerd::TIMERREPEAT_DAILY: - result = "daily"; + result = "{=L:timerlist.repeat.daily=}"; break; case CTimerd::TIMERREPEAT_WEEKLY: - result = "weekly"; + result = "{=L:timerlist.repeat.weekly=}"; break; case CTimerd::TIMERREPEAT_BIWEEKLY: - result = "2-weekly"; + result = "{=L:timerlist.repeat.biweekly=}"; break; case CTimerd::TIMERREPEAT_FOURWEEKLY: - result = "4-weekly"; + result = "{=L:timerlist.repeat.fourweekly=}"; break; case CTimerd::TIMERREPEAT_MONTHLY: - result = "monthly"; + result = "{=L:timerlist.repeat.monthly=}"; break; case CTimerd::TIMERREPEAT_BYEVENTDESCRIPTION: - result = "event"; + result = "{=L:timerlist.repeat.byeventdescription=}"; break; case CTimerd::TIMERREPEAT_WEEKDAYS: - result = "weekdays"; + result = "{=L:timerlist.repeat.weekdays=}"; break; default: if (rep > CTimerd::TIMERREPEAT_WEEKDAYS) { if (rep & 0x0200) - result += "Mo "; + result += "{=L:date.mo=} "; if (rep & 0x0400) - result += "Tu "; + result += "{=L:date.tu=} "; if (rep & 0x0800) - result += "We "; + result += "{=L:date.we=} "; if (rep & 0x1000) - result += "Th "; + result += "{=L:date.th=} "; if (rep & 0x2000) - result += "Fr "; + result += "{=L:date.fr=} "; if (rep & 0x4000) - result += "Sa "; + result += "{=L:date.sa=} "; if (rep & 0x8000) - result += "Su "; + result += "{=L:date.su=} "; } else - result = "Unknown"; + result = "{=L:timerlist.type.unknown=}"; } return result; } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getVideoAspectRatioAsString(void) { +std::string CNeutrinoAPI::getVideoAspectRatioAsString(void) +{ int aspectRatio = videoDecoder->getAspectRatio(); if (aspectRatio >= 0 && aspectRatio <= 4) return videoformat_names[aspectRatio]; else - return "unknown"; + return "{=L:unknown=}"; } //------------------------------------------------------------------------- -int CNeutrinoAPI::setVideoAspectRatioAsString(std::string newRatioString) { +int CNeutrinoAPI::setVideoAspectRatioAsString(std::string newRatioString) +{ + OpenThreads::ScopedPointerLock lock(pmutex); int newRatioInt = -1; for(int i=0;i<(int)sizeof(videoformat_names);i++) if( videoformat_names[i] == newRatioString){ @@ -430,7 +462,8 @@ int CNeutrinoAPI::setVideoAspectRatioAsString(std::string newRatioString) { return newRatioInt; } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getVideoResolutionAsString(void) { +std::string CNeutrinoAPI::getVideoResolutionAsString(void) +{ int xres, yres, framerate; videoDecoder->getPictureInfo(xres, yres, framerate); std::stringstream out; @@ -439,9 +472,10 @@ std::string CNeutrinoAPI::getVideoResolutionAsString(void) { } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getVideoFramerateAsString(void) { +std::string CNeutrinoAPI::getVideoFramerateAsString(void) +{ int xres, yres, framerate; - std::string sframerate="unknown"; + std::string sframerate = "{=L:unknown=}"; videoDecoder->getPictureInfo(xres, yres, framerate); switch(framerate){ case 2: @@ -453,7 +487,8 @@ std::string CNeutrinoAPI::getVideoFramerateAsString(void) { } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getAudioInfoAsString(void) { +std::string CNeutrinoAPI::getAudioInfoAsString(void) +{ int type, layer, freq, mode, lbitrate; audioDecoder->getAudioInfo(type, layer, freq, lbitrate, mode); std::stringstream out; @@ -465,11 +500,13 @@ std::string CNeutrinoAPI::getAudioInfoAsString(void) { } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getCryptInfoAsString(void) { +std::string CNeutrinoAPI::getCryptInfoAsString(void) +{ std::stringstream out; std::string casys[11]= {"Irdeto:","Betacrypt:","Seca:","Viaccess:","Nagra:","Conax: ","Cryptoworks:","Videoguard:","EBU:","XCrypt:","PowerVU:"}; int caids[] = { 0x600, 0x1700, 0x0100, 0x0500, 0x1800, 0xB00, 0xD00, 0x900, 0x2600, 0x4a00, 0x0E00 }; + OpenThreads::ScopedPointerLock lock(pmutex); CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel(); if(channel) { for (unsigned short i = 0; i < 11; i++) { @@ -485,24 +522,11 @@ std::string CNeutrinoAPI::getCryptInfoAsString(void) { } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getLogoFile(std::string _logoURL, t_channel_id channelId) { - std::string channelIdAsString = string_printf( PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS , channelId & 0xFFFFFFFFFFFFULL); +std::string CNeutrinoAPI::getLogoFile(t_channel_id channelId) +{ std::string channelName = GetServiceName(channelId); -// replace(channelName, " ", "_"); - _logoURL+="/"; - if (access((_logoURL + channelName + ".png").c_str(), 4) == 0) - return _logoURL + channelName + ".png"; - else if (access((_logoURL + channelName + ".jpg").c_str(), 4) == 0) - return _logoURL + channelName + ".jpg"; - else if (access((_logoURL + channelName + ".gif").c_str(), 4) == 0) - return _logoURL + channelName + ".gif"; - else if(access((_logoURL + channelIdAsString + ".png").c_str(), 4) == 0) - return _logoURL + channelIdAsString + ".png"; - else if (access((_logoURL + channelIdAsString + ".jpg").c_str(), 4) == 0) - return _logoURL + channelIdAsString + ".jpg"; - else if (access((_logoURL + channelIdAsString + ".gif").c_str(), 4) == 0) - return _logoURL + channelIdAsString + ".gif"; - else - return ""; + std::string logoString; + if (g_PicViewer->GetLogoName(channelId, channelName, logoString, NULL, NULL)) + return logoString; + return ""; } - diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.h b/src/nhttpd/tuxboxapi/neutrinoapi.h index 4d504eae0..82c9abbf3 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.h +++ b/src/nhttpd/tuxboxapi/neutrinoapi.h @@ -15,6 +15,7 @@ #include #include "neutrinoyparser.h" #include "controlapi.h" +#include //------------------------------------------------------------------------- // No Class Helpers @@ -24,22 +25,27 @@ bool _initialize_iso639_map(void); //------------------------------------------------------------------------- class CNeutrinoAPI { +private: + CChannelEventList eList; + OpenThreads::Mutex *pmutex; + std::map ChannelListEvents; + + // complete channellists + //CZapitClient::BouquetChannelList RadioChannelList,TVChannelList; + // events of actual channel + // List of available tv bouquets + //std::map TVBouquetsList; + // List of available radio bouquets + //std::map RadioBouquetsList; + // List of bouquets + CZapitClient::BouquetList BouquetList; +public: // Clientlibs CSectionsdClient *Sectionsd; CZapitClient *Zapit; CTimerdClient *Timerd; CEventServer *EventServer; - // complete channellists - CZapitClient::BouquetChannelList RadioChannelList,TVChannelList; - // events of actual channel - std::map ChannelListEvents; - // List of available tv bouquets - std::map TVBouquetsList; - // List of available radio bouquets - std::map RadioBouquetsList; - // List of bouquets - CZapitClient::BouquetList BouquetList; //bool standby_mode; @@ -55,10 +61,12 @@ class CNeutrinoAPI bool GetChannelEvents(void); #if 0 /* unused funktion*/ bool GetStreamInfo(int bitinfo[10]); -#endif - std::string GetServiceName(t_channel_id channel_id); CZapitClient::BouquetChannelList *GetBouquet(unsigned int BouquetNr, int Mode); CZapitClient::BouquetChannelList *GetChannelList(int Mode); + void UpdateBouquet(unsigned int BouquetNr); + void UpdateChannelList(void); +#endif + std::string GetServiceName(t_channel_id channel_id); // support functions void ZapTo (const char * const target); @@ -66,8 +74,6 @@ class CNeutrinoAPI void ZapToChannelId (t_channel_id channel_id); t_channel_id ChannelNameToChannelId(std::string search_channel_name); - void UpdateBouquet(unsigned int BouquetNr); - void UpdateChannelList(void); void UpdateBouquets(void); std::string timerEventType2Str(CTimerd::CTimerEventTypes type); @@ -78,17 +84,19 @@ class CNeutrinoAPI std::string getVideoFramerateAsString(void); std::string getAudioInfoAsString(void); std::string getCryptInfoAsString(void); - std::string getLogoFile(std::string _logoURL, t_channel_id channelId); + std::string getLogoFile(t_channel_id channelId); public: CNeutrinoAPI(); ~CNeutrinoAPI(void); - CChannelEventList eList; CNeutrinoYParser *NeutrinoYParser; CControlAPI *ControlAPI; + void Lock() { pmutex->lock(); } + void Unlock() { pmutex->unlock(); } + void GetChannelEvent(t_channel_id channel_id, CChannelEvent &event); - friend class CNeutrinoYParser; // Backreference - friend class CControlAPI; + //friend class CNeutrinoYParser; // Backreference + //friend class CControlAPI; }; #endif /*__nhttpd_neutrinoapi_h__*/ diff --git a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp index a40af0afc..f08d246a6 100644 --- a/src/nhttpd/tuxboxapi/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoyparser.cpp @@ -126,7 +126,6 @@ const CNeutrinoYParser::TyFuncCall CNeutrinoYParser::yFuncCallList[]= {"set_timer_form", &CNeutrinoYParser::func_set_timer_form}, {"bouquet_editor_main", &CNeutrinoYParser::func_bouquet_editor_main}, {"set_bouquet_edit_form", &CNeutrinoYParser::func_set_bouquet_edit_form}, - }; //------------------------------------------------------------------------- // y-func : dispatching and executing @@ -358,8 +357,8 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: for(int j = 0; j < (int) channels.size(); j++) { CZapitChannel * channel = channels[j]; - CChannelEvent *event; - event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()]; + CChannelEvent event; + NeutrinoAPI->GetChannelEvent(channel->getChannelID(), event); classname = (i++ & 1) ? 'a' : 'b'; if (channel->getChannelID() == current_channel) @@ -369,7 +368,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: yresult += ""; if (have_logos) { - std::string channel_logo = NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], channel->getChannelID()); + std::string channel_logo = func_get_logo_name(hh, string_printf(PRINTF_CHANNEL_ID_TYPE, channel->getChannelID())); std::string zaplink; if (channel_logo.empty()) zaplink = channel->getName().c_str(); @@ -397,10 +396,10 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: } /* timer slider */ - if(event && event->duration > 0) + if(event.eventID && event.duration > 0) { - prozent = 100 * (time(NULL) - event->startTime) / event->duration; - yresult += string_printf(" - + - + - + @@ -72,10 +72,9 @@ function do_check_input_LogosURL() - - {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ - =} - + @@ -117,13 +115,13 @@ function do_check_input_LogosURL() - + {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ - =} diff --git a/src/nhttpd/web/Y_Settings_personalize.yhtm b/src/nhttpd/web/Y_Settings_personalize.yhtm index 58fd92d01..5321cb6c0 100644 --- a/src/nhttpd/web/Y_Settings_personalize.yhtm +++ b/src/nhttpd/web/Y_Settings_personalize.yhtm @@ -15,44 +15,44 @@ function do_submit() } function do_init() { - obj_set_radio_value('p_tv', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_tvmode;1~open=}"); - obj_set_radio_value('p_radio', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_radiomode;1~cache=}"); - obj_set_radio_value('p_scart', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_scartmode;1~cache=}"); - obj_set_radio_value('p_games', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_games;1~cache=}"); - obj_set_radio_value('p_audioplayer', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_audioplayer;1~cache=}"); - obj_set_radio_value('p_inetradio', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_inetradio;1~cache=}"); - obj_set_radio_value('p_movieplayer', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_movieplayer;1~cache=}"); - obj_set_radio_value('p_picviewer', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_pictureviewer;1~cache=}"); - obj_set_radio_value('p_pinstatus', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_pinstatus;0~cache=}"); - obj_set_radio_value('p_upnp', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_upnpbrowser;1~cache=}"); - obj_set_radio_value('p_sleeptimer', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_sleeptimer;1~cache=}"); - obj_set_radio_value('p_reboot', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_reboot;1~cache=}"); - obj_set_radio_value('p_shutdown', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_shutdown;1~cache=}"); - obj_set_radio_value('p_settings', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_settings;0~cache=}"); - obj_set_radio_value('p_video', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_video;1~cache=}"); - obj_set_radio_value('p_audio', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_audio;1~cache=}"); - obj_set_radio_value('p_youth', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_youth;1~cache=}"); - obj_set_radio_value('p_network', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_network;1~cache=}"); - obj_set_radio_value('p_recording', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_recording;1~cache=}"); - obj_set_radio_value('p_language', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_language;1~cache=}"); - obj_set_radio_value('p_colors', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_colors;1~cache=}"); - obj_set_radio_value('p_lcd', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_lcd;1~cache=}"); - obj_set_radio_value('p_keybinding', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_keybinding;1~cache=}"); - obj_set_radio_value('p_mediaplayer', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_mediaplayer;1~cache=}"); - obj_set_radio_value('p_driver', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_driver;1~cache=}"); - obj_set_radio_value('p_misc', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_misc;1~cache=}"); - obj_set_radio_value('p_service', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_service;0~cache=}"); - obj_set_radio_value('p_bouqueteditor', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_bouqueteditor;1~cache=}"); - obj_set_radio_value('p_scants', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_scants;1~cache=}"); - obj_set_radio_value('p_reload', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_reload;1~cache=}"); - obj_set_radio_value('p_getplugins', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_getplugins;1~cache=}"); - obj_set_radio_value('p_restart', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_restart;1~cache=}"); - obj_set_radio_value('p_epgrestart', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_epgrestart;1~cache=}"); - obj_set_radio_value('p_chan_epg_stat', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_chan_epg_stat;1~cache=}"); - obj_set_radio_value('p_imageinfo', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_imageinfo;1~cache=}"); - obj_set_radio_value('p_update', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_update;1~cache=}"); - obj_set_radio_value('p_bluebutton', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_bluebutton;1~cache=}"); - obj_set_radio_value('p_redbutton', "{=ini-get:/var/tuxbox/config/neutrino.conf;personalize_redbutton;1~cache=}"); + obj_set_radio_value('p_tv', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_tvmode;1~open=}"); + obj_set_radio_value('p_radio', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_radiomode;1~cache=}"); + obj_set_radio_value('p_scart', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_scartmode;1~cache=}"); + obj_set_radio_value('p_games', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_games;1~cache=}"); + obj_set_radio_value('p_audioplayer', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_audioplayer;1~cache=}"); + obj_set_radio_value('p_inetradio', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_inetradio;1~cache=}"); + obj_set_radio_value('p_movieplayer', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_movieplayer;1~cache=}"); + obj_set_radio_value('p_picviewer', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_pictureviewer;1~cache=}"); + obj_set_radio_value('p_pinstatus', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_pinstatus;0~cache=}"); + obj_set_radio_value('p_upnp', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_upnpbrowser;1~cache=}"); + obj_set_radio_value('p_sleeptimer', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_sleeptimer;1~cache=}"); + obj_set_radio_value('p_reboot', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_reboot;1~cache=}"); + obj_set_radio_value('p_shutdown', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_shutdown;1~cache=}"); + obj_set_radio_value('p_settings', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_settings;0~cache=}"); + obj_set_radio_value('p_video', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_video;1~cache=}"); + obj_set_radio_value('p_audio', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_audio;1~cache=}"); + obj_set_radio_value('p_youth', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_youth;1~cache=}"); + obj_set_radio_value('p_network', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_network;1~cache=}"); + obj_set_radio_value('p_recording', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_recording;1~cache=}"); + obj_set_radio_value('p_language', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_language;1~cache=}"); + obj_set_radio_value('p_colors', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_colors;1~cache=}"); + obj_set_radio_value('p_lcd', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_lcd;1~cache=}"); + obj_set_radio_value('p_keybinding', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_keybinding;1~cache=}"); + obj_set_radio_value('p_mediaplayer', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_mediaplayer;1~cache=}"); + obj_set_radio_value('p_driver', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_driver;1~cache=}"); + obj_set_radio_value('p_misc', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_misc;1~cache=}"); + obj_set_radio_value('p_service', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_service;0~cache=}"); + obj_set_radio_value('p_bouqueteditor', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_bouqueteditor;1~cache=}"); + obj_set_radio_value('p_scants', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_scants;1~cache=}"); + obj_set_radio_value('p_reload', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_reload;1~cache=}"); + obj_set_radio_value('p_getplugins', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_getplugins;1~cache=}"); + obj_set_radio_value('p_restart', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_restart;1~cache=}"); + obj_set_radio_value('p_epgrestart', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_epgrestart;1~cache=}"); + obj_set_radio_value('p_chan_epg_stat', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_chan_epg_stat;1~cache=}"); + obj_set_radio_value('p_imageinfo', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_imageinfo;1~cache=}"); + obj_set_radio_value('p_update', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_update;1~cache=}"); + obj_set_radio_value('p_bluebutton', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_bluebutton;1~cache=}"); + obj_set_radio_value('p_redbutton', "{=ini-get:%(CONFIGDIR)/neutrino.conf;personalize_redbutton;1~cache=}"); } //]]> @@ -75,7 +75,7 @@ function do_init() - + diff --git a/src/nhttpd/web/Y_Settings_video_audio.yhtm b/src/nhttpd/web/Y_Settings_video_audio.yhtm index 0f7a6ee9a..5d6c14f9a 100644 --- a/src/nhttpd/web/Y_Settings_video_audio.yhtm +++ b/src/nhttpd/web/Y_Settings_video_audio.yhtm @@ -8,32 +8,32 @@ function do_init() { var val = ""; //video - val = "{=ini-get:/var/tuxbox/config/controld.conf;videooutput;1~open=}"; + val = "{=ini-get:%(CONFIGDIR)/controld.conf;videooutput;1~open=}"; document.f.videooutput.selectedIndex = val; - obj_set_radio_value('vcroutput', "{=ini-get:/var/tuxbox/config/controld.conf;vcroutput;0~cache=}"); + obj_set_radio_value('vcroutput', "{=ini-get:%(CONFIGDIR)/controld.conf;vcroutput;0~cache=}"); document.f.h_vcroutput.value = obj_get_radio_value("vcroutput"); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;video_Format;2~open=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;video_Format;2~open=}"; document.f.video_Format.selectedIndex = val; - val = "{=ini-get:/var/tuxbox/config/controld.conf;video_backgroundFormat;2~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/controld.conf;video_backgroundFormat;2~cache=}"; var sel = 0; if(val=="2") sel=1; if(val=="3") sel=2; document.f.video_backgroundFormat.selectedIndex = sel; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;video_csync;0~cache=}" + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;video_csync;0~cache=}" document.f.video_csync.value = val; - obj_set_radio_value('vcr_AutoSwitch', "{=ini-get:/var/tuxbox/config/neutrino.conf;vcr_AutoSwitch;true~cache=}"); + obj_set_radio_value('vcr_AutoSwitch', "{=ini-get:%(CONFIGDIR)/neutrino.conf;vcr_AutoSwitch;true~cache=}"); //audio - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_AnalogMode;0~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;audio_AnalogMode;0~cache=}"; document.f.audio_AnalogMode.selectedIndex = val; - obj_set_radio_value('audiochannel_up_down_enable', "{=ini-get:/var/tuxbox/config/neutrino.conf;audiochannel_up_down_enable;false~cache=}"); - obj_set_radio_value('audio_left_right_selectable', "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_left_right_selectable;false~cache=}"); - obj_set_radio_value('audio_DolbyDigital', "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_DolbyDigital;false~cache=}"); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_avs_Control;1~cache=}"; + obj_set_radio_value('audiochannel_up_down_enable', "{=ini-get:%(CONFIGDIR)/neutrino.conf;audiochannel_up_down_enable;false~cache=}"); + obj_set_radio_value('audio_left_right_selectable', "{=ini-get:%(CONFIGDIR)/neutrino.conf;audio_left_right_selectable;false~cache=}"); + obj_set_radio_value('audio_DolbyDigital', "{=ini-get:%(CONFIGDIR)/neutrino.conf;audio_DolbyDigital;false~cache=}"); + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;audio_avs_Control;1~cache=}"; document.f.audio_avs_Control.selectedIndex = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;audio_step;5~cache=}" + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;audio_step;5~cache=}" document.f.audio_step.value = val; } function set_hidden_values() diff --git a/src/nhttpd/web/Y_Settings_wol.yhtm b/src/nhttpd/web/Y_Settings_wol.yhtm index 40d7c429f..83ce4d40a 100644 --- a/src/nhttpd/web/Y_Settings_wol.yhtm +++ b/src/nhttpd/web/Y_Settings_wol.yhtm @@ -4,9 +4,9 @@ @@ -73,40 +75,40 @@ select { - + - + - + - + - + - + - + - + - - @@ -123,6 +125,8 @@ select { + + diff --git a/src/nhttpd/web/Y_Settings_zapit.yhtm b/src/nhttpd/web/Y_Settings_zapit.yhtm index 40a7aae32..88dad89f3 100644 --- a/src/nhttpd/web/Y_Settings_zapit.yhtm +++ b/src/nhttpd/web/Y_Settings_zapit.yhtm @@ -43,10 +43,10 @@ function do_submit()
    \n" + prozent = 100 * (time(NULL) - event.startTime) / event.duration; + yresult += string_printf(" - + - + - + diff --git a/src/nhttpd/web/Y_Settings_buttons.yhtm b/src/nhttpd/web/Y_Settings_buttons.yhtm index 52c5bb55e..a9e0f8962 100644 --- a/src/nhttpd/web/Y_Settings_buttons.yhtm +++ b/src/nhttpd/web/Y_Settings_buttons.yhtm @@ -23,43 +23,43 @@ input[type="text"],select { function do_init() { var val = ""; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;bouquetlist_mode;0~open=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;bouquetlist_mode;0~open=}"; document.f.bouquetlist_mode.selectedIndex = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_bouquet_down;105~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_bouquet_down;105~cache=}"; document.f.key_bouquet_down.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_bouquet_up;106~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_bouquet_up;106~cache=}"; document.f.key_bouquet_up.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_addrecord;398~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_addrecord;398~cache=}"; document.f.key_channelList_addrecord.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_addremind;400~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_addremind;400~cache=}"; document.f.key_channelList_addremind.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_cancel;102~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_cancel;102~cache=}"; document.f.key_channelList_cancel.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_pagedown;115~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_pagedown;115~cache=}"; document.f.key_channelList_pagedown.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_pageup;114~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_pageup;114~cache=}"; document.f.key_channelList_pageup.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_reload;141~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_reload;141~cache=}"; document.f.key_channelList_reload.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_search;399~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_search;399~cache=}"; document.f.key_channelList_search.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_channelList_sort;401~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_channelList_sort;401~cache=}"; document.f.key_channelList_sort.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_lastchannel;11~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_lastchannel;11~cache=}"; document.f.key_lastchannel.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_quickzap_down;108~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_quickzap_down;108~cache=}"; document.f.key_quickzap_down.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_quickzap_up;103~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_quickzap_up;103~cache=}"; document.f.key_quickzap_up.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_subchannel_down;105~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_subchannel_down;105~cache=}"; document.f.key_subchannel_down.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_subchannel_toggle;11~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_subchannel_toggle;11~cache=}"; document.f.key_subchannel_toggle.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_subchannel_up;106~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_subchannel_up;106~cache=}"; document.f.key_subchannel_up.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_tvradio_mode;-2~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_tvradio_mode;-2~cache=}"; document.f.key_tvradio_mode.value = itoKey(val); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;key_zaphistory;102~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;key_zaphistory;102~cache=}"; document.f.key_zaphistory.value = itoKey(val); } function rcsim(_key) diff --git a/src/nhttpd/web/Y_Settings_lcd.yhtm b/src/nhttpd/web/Y_Settings_lcd.yhtm index 8d2ea3e3d..6a57e7a74 100644 --- a/src/nhttpd/web/Y_Settings_lcd.yhtm +++ b/src/nhttpd/web/Y_Settings_lcd.yhtm @@ -13,21 +13,21 @@ function do_init() { var val = ""; - obj_set_radio_value('lcd_power', "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_power;1~open=}"); - obj_set_radio_value('lcd_inverse', "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_inverse;0~cache=}"); + obj_set_radio_value('lcd_power', "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_power;1~open=}"); + obj_set_radio_value('lcd_inverse', "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_inverse;0~cache=}"); - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_dim_time;0~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_dim_time;0~cache=}"; document.f.lcd_dim_time.value = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_dim_brightness;0~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_dim_brightness;0~cache=}"; document.f.lcd_dim_brightness.value = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_contrast;15~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_contrast;15~cache=}"; document.f.lcd_contrast.value = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_brightness;255~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_brightness;255~cache=}"; document.f.lcd_brightness.value = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_standbybrightness;170~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_standbybrightness;170~cache=}"; document.f.lcd_standbybrightness.value = val; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_epgmode;1~cache=}"; + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_epgmode;1~cache=}"; var sel = 0; if(val=="2") sel=1; if(val=="3") sel=2; @@ -36,7 +36,7 @@ function do_init() if(val=="15") sel=5; document.f.lcd_epgmode.selectedIndex = sel; - val = "{=ini-get:/var/tuxbox/config/neutrino.conf;lcd_show_volume;0~cache=}" + val = "{=ini-get:%(CONFIGDIR)/neutrino.conf;lcd_show_volume;0~cache=}" document.f.lcd_show_volume.value = val; } diff --git a/src/nhttpd/web/Y_Settings_mount.yhtm b/src/nhttpd/web/Y_Settings_mount.yhtm index 47046bfac..11b8917e6 100644 --- a/src/nhttpd/web/Y_Settings_mount.yhtm +++ b/src/nhttpd/web/Y_Settings_mount.yhtm @@ -4,10 +4,10 @@ // - + - + - + - + - + - + @@ -67,11 +67,11 @@ function do_submit() - + - +
    \n" "\t" "" "" @@ -414,7 +413,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: } else { - yresult += string_printf(" - + - + @@ -50,7 +50,7 @@ function do_submit() { - +
    \n\n"; if (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) { @@ -489,23 +521,41 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: } } - else if ((event = NeutrinoAPI->ChannelListEvents[channel->getChannelID()])) + else if (event.eventID) { bool has_current_next = true; - CEitManager::getInstance()->getCurrentNextServiceKey(channel->getChannelID(), currentNextInfo); - timestr = timeString(event->startTime); + CEitManager::getInstance()->getCurrentNextServiceKey(channel->getEpgID(), currentNextInfo); + timestr = timeString(event.startTime); + + CShortEPGData epg; + std::string EPGInfoC = ""; + if (CEitManager::getInstance()->getEPGidShort(currentNextInfo.current_uniqueKey, &epg)) + { + EPGInfoC += epg.info1; + EPGInfoC += epg.info2; + } yresult += string_printf("\n"); @@ -525,14 +575,33 @@ std::string CNeutrinoYParser::func_get_actual_channel_id(CyhookHandler *, std:: } //------------------------------------------------------------------------- -// func: Get Logo Name +// func: Get logo name for Webif //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_logo_name(CyhookHandler *hh, std::string channelId) { - if (hh->WebserverConfigList["Tuxbox.DisplayLogos"] == "true") { - t_channel_id cid; - if (1 == sscanf(channelId.c_str(), "%" PRIx64, &cid)) - return NeutrinoAPI->getLogoFile(hh->WebserverConfigList["Tuxbox.LogosURL"], cid); + std::string LogosURL = hh->WebserverConfigList["Tuxbox.LogosURL"]; + if (hh->WebserverConfigList["Tuxbox.DisplayLogos"] == "true" && !LogosURL.empty()) + { + std::string fileType[] = { ".png", ".jpg" , ".gif" }; + + std::string channelIdShort = channelId.substr(channelId.length() - 12); + channelIdShort = channelIdShort.erase(0, min(channelIdShort.find_first_not_of('0'), channelIdShort.size()-1)); + + std::string channelName = ""; + t_channel_id chId = 0; + if (sscanf(channelId.c_str(), "%" PRIx64, &chId) == 1) + channelName = NeutrinoAPI->GetServiceName(chId); + + for (size_t i = 0; i < (sizeof(fileType) / sizeof(fileType[0])); i++) + { + // first check Tuxbox.LogosURL from nhttpd.conf + if (access((LogosURL + "/" + channelName + fileType[i]).c_str(), R_OK) == 0) + return LogosURL + "/" + channelName + fileType[i]; + else if (access((LogosURL + "/" + channelIdShort + fileType[i]).c_str(), R_OK) == 0) + return LogosURL + "/" + channelIdShort + fileType[i]; + else // fallback to default logos + return NeutrinoAPI->getLogoFile(chId); + } } return ""; } @@ -676,7 +745,8 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *, { if(!(init_iso)) { - strcpy( pids.APIDs[j].desc, _getISO639Description( pids.APIDs[j].desc ) ); + std::string tmp_desc = _getISO639Description( pids.APIDs[j].desc); + strncpy(pids.APIDs[j].desc, tmp_desc.c_str(), DESC_MAX_LEN -1); } yresult += string_printf("\r\n",idx_as_id ? j : pids.APIDs[j].pid,(j==selected_apid) ? "selected=\"selected\"" : "",std::string(pids.APIDs[j].desc).c_str(),pids.APIDs[j].is_ac3 ? " (AC3)": pids.APIDs[j].is_aac ? "(AAC)" : pids.APIDs[j].is_eac3 ? "(EAC3)" : " "); } @@ -693,7 +763,8 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *, { if(!(init_iso)) { - strcpy( pids.APIDs[i].desc, _getISO639Description( pids.APIDs[i].desc ) ); + std::string tmp_desc = _getISO639Description( pids.APIDs[i].desc); + strncpy(pids.APIDs[i].desc, tmp_desc.c_str(), DESC_MAX_LEN -1); } yresult += string_printf("\r\n", idx_as_id ? i : it->pid, (i==selected_apid) ? "selected=\"selected\"" : "",pids.APIDs[i].desc, @@ -781,6 +852,7 @@ std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) if( boxname == "Armas ") boxname += "TripleDragon"; break; +#ifdef BOXMODEL_NEVIS case 6: boxname += "HD1"; break; @@ -792,19 +864,29 @@ std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) if (CFEManager::getInstance()->getFrontendCount() > 1) boxname += " Twin"; break; - case 9: - boxname += "Tank"; - break; case 10: boxname += "Zee"; break; +#endif +#ifdef BOXMODEL_APOLLO + case 9: + boxname += "Tank"; + break; case 11: boxname += "Trinity"; + if (cs_get_chip_type() != 33904 /*0x8470*/) + boxname += " V2"; break; case 12: boxname += "Zee2"; break; - + case 13: + boxname += "Link"; + break; + case 14: + boxname += "Trinity Duo"; + break; +#endif default: char buffer[10]; snprintf(buffer, sizeof(buffer), "%u\n", system_rev); @@ -834,21 +916,30 @@ std::string CNeutrinoYParser::func_get_boxmodel(CyhookHandler *, std::string) switch(system_rev) { +#ifdef BOXMODEL_NEVIS case 6: case 7: case 8: case 10: boxmodel = "Nevis"; break; +#endif +#ifdef BOXMODEL_APOLLO case 9: boxmodel = "Apollo"; break; case 11: - boxmodel = "Shiner"; + if (cs_get_chip_type() == 33904 /*0x8470*/) + boxmodel = "Shiner"; + else + boxmodel = "Kronos"; break; case 12: + case 13: + case 14: boxmodel = "Kronos"; break; +#endif default: break; } diff --git a/src/nhttpd/web/Makefile.am b/src/nhttpd/web/Makefile.am index 51994c542..dbf07aaf0 100644 --- a/src/nhttpd/web/Makefile.am +++ b/src/nhttpd/web/Makefile.am @@ -99,3 +99,13 @@ install_DATA += accordion.js \ Y_Filemgr.yhtm \ Y_Filemgr_Edit.yhtm \ Y_Filemgr_blocks.txt + +install-data-hook: + @# Badass hack, I know. If anyone knows a better way -- please send patch! + find $(DESTDIR)$(PRIVATE_HTTPDDIR)/ -type f -print0 | xargs --no-run-if-empty -0 \ + sed -i \ + -e 's|%(CONFIGDIR)|$(CONFIGDIR)|g' \ + -e 's|%(PLUGINDIR_VAR)|$(PLUGINDIR_VAR)|g' \ + -e 's|%(PRIVATE_HTTPDDIR)|$(PRIVATE_HTTPDDIR)|g' \ + -e 's|%(PUBLIC_HTTPDDIR)|$(PUBLIC_HTTPDDIR)|g' \ + ; diff --git a/src/nhttpd/web/Y_About.yhtm b/src/nhttpd/web/Y_About.yhtm index ad022b42c..d001e174d 100644 --- a/src/nhttpd/web/Y_About.yhtm +++ b/src/nhttpd/web/Y_About.yhtm @@ -1,7 +1,7 @@ {=var-set:cancache=yPConf=} {=include-block:Y_Blocks.txt;head=} -{=var-set:alt_httpd={=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.override_directory;/var/httpd=}=} +{=var-set:alt_httpd={=ini-get:%(CONFIGDIR)/nhttpd.conf;WebsiteMain.override_directory;%(PUBLIC_HTTPDDIR)=}=} {=var-set:vf={=if-file-exists:{=var-get:alt_httpd=}/Y_Version.txt~{=var-get:alt_httpd=}/Y_Version.txt~Y_Version.txt=}=}
    diff --git a/src/nhttpd/web/Y_Baselib.js b/src/nhttpd/web/Y_Baselib.js index fa4754711..7bd0552e6 100644 --- a/src/nhttpd/web/Y_Baselib.js +++ b/src/nhttpd/web/Y_Baselib.js @@ -476,3 +476,27 @@ function yhttpd_cache_clear(category) else loadSyncURL("/y/cache-clear?category="+category); } + +function saveTextAsFile(content, filename, filetype) +{ + var textFileAsBlob = new Blob([content], { type: filetype }); + var downloadLink = document.createElement("a"); + downloadLink.download = filename; + downloadLink.innerHTML = "Download File"; + if (window.webkitURL != null) + { + // Chrome allows the link to be clicked + // without actually adding it to the DOM. + downloadLink.href = window.webkitURL.createObjectURL(textFileAsBlob); + } + else + { + // Firefox requires the link to be added to the DOM + // before it can be clicked. + downloadLink.href = window.URL.createObjectURL(textFileAsBlob); + downloadLink.onclick = function() { this.parentNode.removeChild(this); }; + downloadLink.style.display = "none"; + document.body.appendChild(downloadLink); + } + downloadLink.click(); +} diff --git a/src/nhttpd/web/Y_Blocks.txt b/src/nhttpd/web/Y_Blocks.txt index 6ac61d28b..3c9f2dea5 100644 --- a/src/nhttpd/web/Y_Blocks.txt +++ b/src/nhttpd/web/Y_Blocks.txt @@ -20,166 +20,166 @@ end-block~build_live_url # ------- yWeb save Settings start-block~yWeb_save_settings -{=ini-set:/var/tuxbox/config/Y-Web.conf;management_ip;{=managementIP=}~open=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;management_ip2;{=managementIP2=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;wol_mac_1;{=wol_mac_1=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;wol_mac_2;{=wol_mac_2=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;wol_mac_3;{=wol_mac_3=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;wol_desc_1;{=wol_desc_1=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;wol_desc_2;{=wol_desc_2=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;wol_desc_3;{=wol_desc_3=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;fb;{=fb=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;start_page;{=start_page=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;style;{=style=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;yweb_box_name;{=yweb_box_name=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;yweb_box_color;{=yweb_box_color=}~save=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;management_ip;{=managementIP=}~open=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;management_ip2;{=managementIP2=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;wol_mac_1;{=wol_mac_1=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;wol_mac_2;{=wol_mac_2=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;wol_mac_3;{=wol_mac_3=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;wol_desc_1;{=wol_desc_1=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;wol_desc_2;{=wol_desc_2=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;wol_desc_3;{=wol_desc_3=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;fb;{=fb=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;start_page;{=start_page=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;style;{=style=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;yweb_box_name;{=yweb_box_name=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;yweb_box_color;{=yweb_box_color=}~save=} end-block~yWeb_save_settings # ------- Live save Settings start-block~Live_save_settings -{=ini-set:/var/tuxbox/config/Y-Web.conf;slavebox;{=slavebox=}~open=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;vlc_record_path;{=vlc_record_path=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;deinterlace;{=deinterlace=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;deinterlace_filter;{=v=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;udp;{=udp=}~cache=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;http_caching;{=http_caching=}~save=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;slavebox;{=slavebox=}~open=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;vlc_record_path;{=vlc_record_path=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;deinterlace;{=deinterlace=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;deinterlace_filter;{=v=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;udp;{=udp=}~cache=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;http_caching;{=http_caching=}~save=} end-block~Live_save_settings # ------- nhttpd save Settings start-block~nhttpd_save_settings -{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_auth.username;{=authuser=}~open=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_auth.password;{=authpassword=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_auth.no_auth_client;{=noauthclient=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_auth.authenticate;{=authenticate=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;WebsiteMain.port;{=port=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;webserver.threading;{=threading=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;server.no_keep-alive_ips;{=no_keep_alive_ips=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;WebsiteMain.hosted_directory;{=hosted_directory=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;WebsiteMain.override_directory;{=override_directory=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_sendfile.mime_types;{=mod_sendfile_mime_types=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;mod_sendfile.sendAll;{=mod_sendfile_sendAll=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;Language.selected;{=language=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;Tuxbox.DisplayLogos;{=Tuxbox_DisplayLogos=}~cache=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;Tuxbox.LogosURL;{=Tuxbox_LogosURL=}~save=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;mod_auth.username;{=authuser=}~open=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;mod_auth.password;{=authpassword=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;mod_auth.no_auth_client;{=noauthclient=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;mod_auth.authenticate;{=authenticate=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;WebsiteMain.port;{=port=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;webserver.threading;{=threading=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;server.no_keep-alive_ips;{=no_keep_alive_ips=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;WebsiteMain.hosted_directory;{=hosted_directory=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;WebsiteMain.override_directory;{=override_directory=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;mod_sendfile.mime_types;{=mod_sendfile_mime_types=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;mod_sendfile.sendAll;{=mod_sendfile_sendAll=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;Language.selected;{=language=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;Tuxbox.DisplayLogos;{=Tuxbox_DisplayLogos=}~cache=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;Tuxbox.LogosURL;{=Tuxbox_LogosURL=}~save=} {=func:do_reload_httpd_config=} end-block~nhttpd_save_settings # ------- Video / Audio save Settings start-block~video_audio_save_settings -{=ini-set:/var/tuxbox/config/neutrino.conf;video_Format;{=video_Format=}~open=} -{=ini-set:/var/tuxbox/config/neutrino.conf;video_backgroundFormat;{=video_backgroundFormat=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;video_csync;{=h_video_csync=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;vcr_AutoSwitch;{=vcr_AutoSwitch=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;audio_AnalogMode;{=audio_AnalogMode=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;audiochannel_up_down_enable;{=audiochannel_up_down_enable=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;audio_left_right_selectable;{=audio_left_right_selectable=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;audio_avs_Control;{=h_audio_avs_Control=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;audio_DolbyDigital;{=audio_DolbyDigital=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;audio_step;{=audio_step=}~save=} -{=ini-set:/var/tuxbox/config/controld.conf;vcroutput;{=h_vcroutput=}~open=} -{=ini-set:/var/tuxbox/config/controld.conf;videooutput;{=h_videooutput=}~save=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;video_Format;{=video_Format=}~open=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;video_backgroundFormat;{=video_backgroundFormat=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;video_csync;{=h_video_csync=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;vcr_AutoSwitch;{=vcr_AutoSwitch=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;audio_AnalogMode;{=audio_AnalogMode=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;audiochannel_up_down_enable;{=audiochannel_up_down_enable=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;audio_left_right_selectable;{=audio_left_right_selectable=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;audio_avs_Control;{=h_audio_avs_Control=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;audio_DolbyDigital;{=audio_DolbyDigital=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;audio_step;{=audio_step=}~save=} +{=ini-set:%(CONFIGDIR)/controld.conf;vcroutput;{=h_vcroutput=}~open=} +{=ini-set:%(CONFIGDIR)/controld.conf;videooutput;{=h_videooutput=}~save=} end-block~video_audio_save_settings # ------- LCD save Settings start-block~lcd_save_settings -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_power;{=lcd_power=}~open=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_inverse;{=lcd_inverse=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_dim_time;{=lcd_dim_time=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_dim_brightness;{=lcd_dim_brightness=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_epgmode;{=lcd_epgmode=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_show_volume;{=lcd_show_volume=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_contrast;{=lcd_contrast=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_brightness;{=lcd_brightness=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;lcd_standbybrightness;{=lcd_standbybrightness=}~save=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_power;{=lcd_power=}~open=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_inverse;{=lcd_inverse=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_dim_time;{=lcd_dim_time=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_dim_brightness;{=lcd_dim_brightness=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_epgmode;{=lcd_epgmode=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_show_volume;{=lcd_show_volume=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_contrast;{=lcd_contrast=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_brightness;{=lcd_brightness=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;lcd_standbybrightness;{=lcd_standbybrightness=}~save=} end-block~lcd_save_settings # ------- Buttons save Settings start-block~buttons_save_settings -{=ini-set:/var/tuxbox/config/neutrino.conf;bouquetlist_mode;{=bouquetlist_mode=}~open=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_bouquet_down;{=key_bouquet_down=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_bouquet_up;{=key_bouquet_up=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_addrecord;{=key_channelList_addrecord=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_addremind;{=key_channelList_addremind=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_cancel;{=key_channelList_cancel=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_pagedown;{=key_channelList_pagedown=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_pageup;{=key_channelList_pageup=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_reload;{=key_channelList_reload=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_search;{=key_channelList_search=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_channelList_sort;{=key_channelList_sort=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_lastchannel;{=key_lastchannel=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_quickzap_down;{=key_quickzap_down=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_quickzap_up;{=key_quickzap_up=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_subchannel_down;{=key_subchannel_down=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_subchannel_toggle;{=key_subchannel_toggle=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_subchannel_up;{=key_subchannel_up=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_tvradio_mode;{=key_tvradio_mode=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;key_zaphistory;{=key_zaphistory=}~save=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;bouquetlist_mode;{=bouquetlist_mode=}~open=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_bouquet_down;{=key_bouquet_down=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_bouquet_up;{=key_bouquet_up=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_addrecord;{=key_channelList_addrecord=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_addremind;{=key_channelList_addremind=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_cancel;{=key_channelList_cancel=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_pagedown;{=key_channelList_pagedown=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_pageup;{=key_channelList_pageup=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_reload;{=key_channelList_reload=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_search;{=key_channelList_search=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_channelList_sort;{=key_channelList_sort=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_lastchannel;{=key_lastchannel=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_quickzap_down;{=key_quickzap_down=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_quickzap_up;{=key_quickzap_up=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_subchannel_down;{=key_subchannel_down=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_subchannel_toggle;{=key_subchannel_toggle=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_subchannel_up;{=key_subchannel_up=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_tvradio_mode;{=key_tvradio_mode=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;key_zaphistory;{=key_zaphistory=}~save=} end-block~buttons_save_settings # ------- Personalize save Settings start-block~personalize_save_settings -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_tvmode;{=p_tv=}~open=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_radiomode;{=p_radio=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_scartmode;{=p_scart=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_games;{=p_games=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_audioplayer;{=p_audioplayer=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_inetradio;{=p_inetradio=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_movieplayer;{=p_movieplayer=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_pictureviewer;{=p_picviewer=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_pincode;{=p_pincode=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_upnpbrowser;{=p_upnp=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_sleeptimer;{=p_sleeptimer=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_reboot;{=p_reboot=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_shutdown;{=p_shutdown=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_settings;{=p_settings=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_video;{=p_video=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_audio;{=p_audio=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_youth;{=p_youth=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_network;{=p_network=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_recording;{=p_recording=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_language;{=p_language=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_colors;{=p_colors=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_lcd;{=p_lcd=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_keybinding;{=p_keybinding=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_mediaplayer;{=p_mediaplayer=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_driver;{=p_driver=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_misc;{=p_misc=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_service;{=p_service=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_bouqueteditor;{=p_bouqueteditor=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_scants;{=p_scants=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_reload;{=p_reload=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_getplugins;{=p_getplugins=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_restart;{=p_restart=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_epgrestart;{=p_epgrestart=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_chan_epg_stat;{=p_chan_epg_stat=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_imageinfo;{=p_imageinfo=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_update;{=p_update=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_bluebutton;{=p_bluebutton=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_redbutton;{=p_redbutton=}~save=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_tvmode;{=p_tv=}~open=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_radiomode;{=p_radio=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_scartmode;{=p_scart=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_games;{=p_games=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_audioplayer;{=p_audioplayer=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_inetradio;{=p_inetradio=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_movieplayer;{=p_movieplayer=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_pictureviewer;{=p_picviewer=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_pincode;{=p_pincode=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_upnpbrowser;{=p_upnp=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_sleeptimer;{=p_sleeptimer=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_reboot;{=p_reboot=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_shutdown;{=p_shutdown=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_settings;{=p_settings=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_video;{=p_video=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_audio;{=p_audio=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_youth;{=p_youth=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_network;{=p_network=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_recording;{=p_recording=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_language;{=p_language=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_colors;{=p_colors=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_lcd;{=p_lcd=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_keybinding;{=p_keybinding=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_mediaplayer;{=p_mediaplayer=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_driver;{=p_driver=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_misc;{=p_misc=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_service;{=p_service=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_bouqueteditor;{=p_bouqueteditor=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_scants;{=p_scants=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_reload;{=p_reload=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_getplugins;{=p_getplugins=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_restart;{=p_restart=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_epgrestart;{=p_epgrestart=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_chan_epg_stat;{=p_chan_epg_stat=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_imageinfo;{=p_imageinfo=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_update;{=p_update=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_bluebutton;{=p_bluebutton=}~cache=} +{=ini-set:%(CONFIGDIR)/neutrino.conf;personalize_redbutton;{=p_redbutton=}~save=} end-block~personalize_save_settings # ------- VNC save Settings start-block~vnc_save_settings -{=ini-set:/var/tuxbox/config/vnc.conf;server;{=server=}~open=} -{=ini-set:/var/tuxbox/config/vnc.conf;port;{=port=}~cache=} -{=ini-set:/var/tuxbox/config/vnc.conf;passwd;{=password=}~cache=} -{=ini-set:/var/tuxbox/config/vnc.conf;scale;{=scale=}~save=} +{=ini-set:%(CONFIGDIR)/vnc.conf;server;{=server=}~open=} +{=ini-set:%(CONFIGDIR)/vnc.conf;port;{=port=}~cache=} +{=ini-set:%(CONFIGDIR)/vnc.conf;passwd;{=password=}~cache=} +{=ini-set:%(CONFIGDIR)/vnc.conf;scale;{=scale=}~save=} end-block~vnc_save_settings # ------- Timer save Settings start-block~timer_save_settings -{=ini-set:/var/tuxbox/config/Y-Web.conf;tvinfo_username;{=tvinfo_username=}=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;tvinfo_password;{=tvinfo_password=}=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;klack_url;{=klack_url=}=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;klack_securitycode;{=klack_securitycode=}=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;live_resolution_w;{=ini-get:/var/tuxbox/config/Y-Web.conf;live_resolution_w;384=}=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;live_resolution_h;{=ini-get:/var/tuxbox/config/Y-Web.conf;live_resolution_h;288=}=} -{=file-action:/var/tuxbox/config/channels.txt;add;{=channels=}=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;tvinfo_username;{=tvinfo_username=}=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;tvinfo_password;{=tvinfo_password=}=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;klack_url;{=klack_url=}=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;klack_securitycode;{=klack_securitycode=}=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;live_resolution_w;{=ini-get:%(CONFIGDIR)/Y-Web.conf;live_resolution_w;384=}=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;live_resolution_h;{=ini-get:%(CONFIGDIR)/Y-Web.conf;live_resolution_h;288=}=} +{=file-action:%(CONFIGDIR)/channels.txt;add;{=channels=}=} end-block~timer_save_settings # ------- Ext save Settings start-block~ext_save_settings -{=file-action:/var/tuxbox/config/extentions.txt;add;{=extentions=}=} +{=file-action:%(CONFIGDIR)/extentions.txt;add;{=extentions=}=} end-block~ext_save_settings # ------- No Managemant Error @@ -198,7 +198,7 @@ end-block~no_management # ------- Managemant Check : insert at Top of Page start-block~management_check_top -{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} +{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~1~=}=} {=if-empty:{=var-get:management=} ~ {=include-block:Y_Blocks.txt;no_management=} @@ -330,9 +330,9 @@ end-block~frame_iso_head # ------- nhttpd save Settings start-block~start_wizard_save_settings -{=ini-set:/var/tuxbox/config/Y-Web.conf;start_page;{=start_page=}~open=} -{=ini-set:/var/tuxbox/config/Y-Web.conf;startup;true~save=} -{=ini-set:/var/tuxbox/config/nhttpd.conf;Language.selected;{=language=}=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;start_page;{=start_page=}~open=} +{=ini-set:%(CONFIGDIR)/Y-Web.conf;startup;true~save=} +{=ini-set:%(CONFIGDIR)/nhttpd.conf;Language.selected;{=language=}=} {=func:do_reload_httpd_config=} end-block~start_wizard_save_settings @@ -390,7 +390,7 @@ end-block~start_wizard_page # ------- Lay-Frame MAIN start-block~frame_main -{=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;startup=}~ +{=if-empty:{=ini-get:%(CONFIGDIR)/Y-Web.conf;startup=}~ {=include-block:Y_Blocks.txt;start_wizard_page=} ~ {=include-block:Y_Blocks.txt;frame_head=} @@ -438,7 +438,7 @@ end-block~frame_secondary # ------- Lay-Frame Boxcontrol-Menu start-block~frame_boxcontrol {=var-set:sec_menu=Y_Boxcontrol_Menue.yhtm=} -{=var-set:startpage={=ini-get:/var/tuxbox/config/Y-Web.conf;start_page;bouquets=}=} +{=var-set:startpage={=ini-get:%(CONFIGDIR)/Y-Web.conf;start_page;bouquets=}=} {=var-set:work= {=if-equal:{=var-get:startpage=}~bouquets~Y_Boxcontrol_Bouquets.yhtm ~ @@ -508,8 +508,8 @@ end-block~frame_live_epg # ------- Remote start-block~remote -{=var-set:nfbtype={=ini-get:/var/tuxbox/config/neutrino.conf;remote_control_hardware=}=} -{=var-set:yfbtype={=ini-get:/var/tuxbox/config/Y-Web.conf;fb;0=}=} +{=var-set:nfbtype={=ini-get:%(CONFIGDIR)/neutrino.conf;remote_control_hardware=}=} +{=var-set:yfbtype={=ini-get:%(CONFIGDIR)/Y-Web.conf;fb;0=}=} {=var-set:boxtype={=func:get_boxtype=}=} {=if-equal:{=var-get:yfbtype=}~0~ {=if-equal:{=var-get:nfbtype=}~2~ {=include-block:Y_Blocks.txt;rc_dbox_philips=}~ @@ -520,9 +520,11 @@ start-block~remote {=if-equal:{=var-get:boxtype=}~CST Tank~ {=include-block:Y_Blocks.txt;rc_cst_v5=}~ {=if-equal:{=var-get:boxtype=}~CST Trinity~ {=include-block:Y_Blocks.txt;rc_cst_v6=}~ {=if-equal:{=var-get:boxtype=}~CST Zee2~ {=include-block:Y_Blocks.txt;rc_cst_v6=}~ + {=if-equal:{=var-get:boxtype=}~CST Link~ {=include-block:Y_Blocks.txt;rc_cst_v4=}~ + {=if-equal:{=var-get:boxtype=}~CST Trinity Duo~ {=include-block:Y_Blocks.txt;rc_cst_v6=}~ {=comment:fallback~=} {=include-block:Y_Blocks.txt;rc_cst_v1=} - =}=}=}=}=}=} + =}=}=}=}=}=}=}=} =}=} ~ {=if-equal:{=var-get:yfbtype=}~-2~ {=include-block:Y_Blocks.txt;rc_dbox_philips=}~ @@ -533,9 +535,11 @@ start-block~remote {=if-equal:{=var-get:yfbtype=}~4~ {=include-block:Y_Blocks.txt;rc_cst_v4=}~ {=if-equal:{=var-get:yfbtype=}~5~ {=include-block:Y_Blocks.txt;rc_cst_v5=}~ {=if-equal:{=var-get:yfbtype=}~6~ {=include-block:Y_Blocks.txt;rc_cst_v6=}~ + {=if-equal:{=var-get:yfbtype=}~7~ {=include-block:Y_Blocks.txt;rc_cst_v4=}~ + {=if-equal:{=var-get:yfbtype=}~8~ {=include-block:Y_Blocks.txt;rc_cst_v6=}~ {=comment:fallback~=} {=include-block:Y_Blocks.txt;rc_cst_v1=} - =}=}=}=}=}=}=}=} + =}=}=}=}=}=}=}=}=}=} =} end-block~remote @@ -783,7 +787,7 @@ start-block~rc_cst_v5 page+ page- - + trsp @@ -820,7 +824,7 @@ start-block~rc_cst_v6 audio text - + trsp help diff --git a/src/nhttpd/web/Y_Boxcontrol_Channellist.yhtm b/src/nhttpd/web/Y_Boxcontrol_Channellist.yhtm index 70fc17378..072ebe026 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Channellist.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Channellist.yhtm @@ -10,6 +10,15 @@ function do_zap(channelid) { function do_epg(channelid,logoid) { window.location.href="Y_Dyn_Pages.yhtm?page=frame_live_epg&channel="+channelid+"&logoid="+logoid; } +function do_stream(channelid, channelname) +{ + var title = "livestream.m3u" + var type = "application/octet-stream" + var plist = "#EXTM3U\n"; + plist += "#EXTINF:-1," + channelname + "\n"; + plist += "http://" + window.location.hostname + ":31339/id=" + channelid + "\n"; + saveTextAsFile(plist, title, type); +} function do_streaminfo() { window.open("Y_StreamInfo.yhtm", "stream", "width=400"); } diff --git a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm index 62038a3a8..e4e603b87 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Menue.yhtm @@ -232,14 +232,14 @@ function get_data(){
    -{=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;slavebox=}~~ +{=if-empty:{=ini-get:%(CONFIGDIR)/Y-Web.conf;slavebox=}~~

    Switch to

    diff --git a/src/nhttpd/web/Y_Boxcontrol_Messages.yhtm b/src/nhttpd/web/Y_Boxcontrol_Messages.yhtm index 3b7b77225..3272c573c 100644 --- a/src/nhttpd/web/Y_Boxcontrol_Messages.yhtm +++ b/src/nhttpd/web/Y_Boxcontrol_Messages.yhtm @@ -1,26 +1,46 @@ {=var-set:cancache=yPyes=} {=include-block:Y_Blocks.txt;head=} + + + +
    {=var-set:help_url=Help-BoxControl-Message=}{=var-set:menu={=L:bc.menue.messages=}=}{=include-block:Y_Blocks.txt;work_menu=}
    -
    \n" + yresult += string_printf("\n\n"); + yresult += string_printf("" + "%d. %s%s" + "\n" + , channel->getChannelID() + , channel->number + , channel->getName().c_str() + , (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) ? " (NVOD)" : "" + ); + + yresult += "\n"; + + /* buttons */ + yresult += "
    \n" "\t" "" "" @@ -424,27 +423,60 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: ); } - /* channel name and buttons */ - yresult += string_printf("
    \n%s %d. %s%s %s\n", - ((channel->getChannelID() == current_channel) ? "" : " "), - channel->getChannelID(), - channel->number /* num + j */, - channel->getName().c_str(), - (channel->getServiceType() == ST_NVOD_REFERENCE_SERVICE) ? " (NVOD)" : "", - channel->getChannelID(), - channel->getChannelID() & 0xFFFFFFFFFFFFULL, - ((NeutrinoAPI->ChannelListEvents[channel->getChannelID()]) ? "\"Program" : "")); + /* channel name */ + yresult += "\n"; if (channel->getChannelID() == current_channel) - yresult += string_printf("\n  \"Streaminfo\""); + yresult += "\n"; - yresult += string_printf("
    \n
    \n"; + + if (channel->getChannelID() == current_channel) + { + yresult += ""; + yresult += "\"Streaminfo\""; + yresult += "\n"; + } + + if (!channel->getUrl().empty()) + { + yresult += "\"WebTV\"\n"; + } + + if (channel->scrambled) + { + yresult += "\"Scrambled\"\n"; + } + if (event.eventID) + { + yresult += string_printf("" + "\"Program" + "\n" + , channel->getChannelID() + , channel->getChannelID() & 0xFFFFFFFFFFFFULL + ); + } + + yresult += string_printf("" + "\"Stream\"" + "\n" + , channel->getChannelID() + , channel->getName().c_str() + ); + + yresult += "
    \n
    ",classname); - yresult += string_printf("%s %s " + yresult += string_printf("%s %s " "(%ld {=L:from=} %d {=L:unit.short.minute=}, %d%%)" , timestr.c_str() - , event->description.c_str() - , (time(NULL) - event->startTime)/60 - , event->duration / 60,prozent); + , EPGInfoC.c_str() + , event.description.c_str() + , (time(NULL) - event.startTime)/60 + , event.duration / 60,prozent); if ((has_current_next) && (currentNextInfo.flags & CSectionsdClient::epgflags::has_next)) { + std::string EPGInfoN = ""; + if (CEitManager::getInstance()->getEPGidShort(currentNextInfo.next_uniqueKey, &epg)) + { + EPGInfoN += epg.info1; + EPGInfoN += epg.info2; + } timestr = timeString(currentNextInfo.next_zeit.startzeit); - yresult += string_printf("
    %s %s", timestr.c_str(), currentNextInfo.next_name.c_str()); + yresult += string_printf("
    %s %s" + , timestr.c_str() + , EPGInfoN.c_str() + , currentNextInfo.next_name.c_str()); } yresult += string_printf("
    {=L:bc.msg.message_to_screen=}
    - - + +
    {=L:bc.msg.popup_to_screen=}
    - - + +

    - + + +
    +
    + {=var-set:help_url=Help-BoxControl-Message=}{=var-set:menu={=L:answer=}=}{=include-block:Y_Blocks.txt;work_menu=}
    +
    +
    diff --git a/src/nhttpd/web/Y_EPG.js b/src/nhttpd/web/Y_EPG.js index ba6db44ca..f3d3ebd96 100644 --- a/src/nhttpd/web/Y_EPG.js +++ b/src/nhttpd/web/Y_EPG.js @@ -9,8 +9,8 @@ var g_number_of_cols=0; /*nr of cols*/ var g_width_all_items=0; /*width without bouquet*/ var c_width_px_per_min=3; /* px per minute */ var c_min_per_col=15;/*minutes per col*/ -var c_width_px_bouquet=103; /* width of bouquet*/ -var c_slider_width=20; +var c_width_px_bouquet=100; /* width of bouquet*/ +var c_slider_width=25; var epg_data; /* all EPG Data in 2-dim Array*/ var epg_data_index=0; var g_timer_eventids = new Array(); @@ -21,10 +21,10 @@ var g_selected=0; function epg_plus_calc_dimensions(){ var show_dim=$('epg_plus').getDimensions(); var usable_width_px = show_dim.width-c_slider_width; /*get display width*/ - var max_minutes_to_display = Math.round((usable_width_px-c_width_px_bouquet)/c_width_px_per_min); /* calc display minutes*/ + var max_minutes_to_display = Math.round((usable_width_px-c_width_px_bouquet-c_width_px_per_min)/c_width_px_per_min); /* calc display minutes*/ g_number_of_cols = Math.round(max_minutes_to_display/c_min_per_col); - g_width_px = g_number_of_cols * c_width_px_per_min * c_min_per_col + c_width_px_bouquet; - g_width_all_items=g_width_px-c_width_px_bouquet; + g_width_px = g_number_of_cols * c_width_px_per_min * c_min_per_col + c_width_px_bouquet + c_width_px_per_min; + g_width_all_items=g_width_px-c_width_px_bouquet-c_width_px_per_min; $('epg_plus').style.cssText = "width:"+g_width_px; } function epg_zapto(){ @@ -45,7 +45,7 @@ function build_epg_clear(){ function build_epg_setbox(_item, _starttime, _stoptime, _start, _stop){ var d_start = Math.max(_start, _starttime); var d_stop = Math.min(_stop, _stoptime); - var d_left = c_width_px_bouquet+ Math.round((d_start-_starttime) * c_width_px_per_min / 60); + var d_left = c_width_px_bouquet+c_width_px_per_min+ Math.round((d_start-_starttime) * c_width_px_per_min / 60); var d_width = Math.max(0,Math.round((d_stop-d_start) * c_width_px_per_min / 60)-3); d_width= Math.min(d_width,g_width_px-d_left); if(d_start<_stoptime) @@ -166,7 +166,7 @@ function get_timer(){ /* main */ var g_i = 0; var g_bouquet_list; -var g_logosURL=""; +var g_display_logos=""; function build_epg_plus(_bouquet, _starttime) { build_epg_clear(); @@ -180,7 +180,11 @@ function build_epg_plus(_bouquet, _starttime) var __tdiv = obj_createAt(ep, "div", "ep_time_bar"); var __tname_div = obj_createAt(__tdiv, "div", "ep_time_bar_item"); __tname_div.innerHTML = "Uhrzeit"; + __tname_div.style.cssText = "width:"+c_width_px_bouquet+"px;"; build_epg_time_bar(__tdiv, _starttime, _stoptime); + __tdiv.style.cssText = "width:"+g_width_px; + var __ediv = obj_createAt(ep, "div", "epg_plus_container"); + __ediv.setAttribute("id", "epg_plus_container") g_i=0; window.setTimeout("build_epg_plus_loop("+_starttime+","+_stoptime+")",100); } @@ -193,10 +197,11 @@ function build_epg_plus_loop(_starttime, _stoptime) var __channel_id = getXMLNodeItemValue(_bouquet, "id"); var __short_channel_id = getXMLNodeItemValue(_bouquet, "short_id"); var __logo = getXMLNodeItemValue(_bouquet, "logo"); - var ep = $("epg_plus"); + var ep = $("epg_plus_container"); var __bdiv = obj_createAt(ep, "div", "ep_bouquet"); var __bname_div = obj_createAt(__bdiv, "div", "ep_bouquet_name"); - var ch_name_with_logo= (g_logosURL!="")?"\""+__channel_name+"\"":__channel_name; + var ch_name_with_logo= (g_display_logos=="true")?"\""+__channel_name+"\"":__channel_name; + $(__bname_div).style.cssText = "width:"+c_width_px_bouquet+"px;"; $(__bname_div).update(""+ch_name_with_logo+""); build_epg_bouquet(__bdiv, __channel_id, _starttime, _stoptime, __logo); window.setTimeout("build_epg_plus_loop("+_starttime+","+_stoptime+")",100); @@ -252,8 +257,8 @@ function build_time_list(_delta){ } } /*init call*/ -function epg_plus_init(_logosURL){ - g_logosURL = _logosURL; +function epg_plus_init(_display_logos){ + g_display_logos = _display_logos; window.onresize=epg_plus_calc_dimensions; build_time_list(0); } diff --git a/src/nhttpd/web/Y_EPG_Plus.yhtm b/src/nhttpd/web/Y_EPG_Plus.yhtm index b6cacff8a..4a4eb7c2e 100644 --- a/src/nhttpd/web/Y_EPG_Plus.yhtm +++ b/src/nhttpd/web/Y_EPG_Plus.yhtm @@ -11,7 +11,7 @@ function epg_imdb(){ -{=var-set:wait_text={=L:get_epg=}=}{=include-block:Y_Blocks.txt;snip_wait=} +{=var-set:wait_text={=L:epg.get_epg=}=}{=include-block:Y_Blocks.txt;snip_wait=}
    {=var-set:help_url=Help-Live_Timer-EPG_Plus=}{=var-set:menu={=L:epg.epg_plus=}=}{=include-block:Y_Blocks.txt;work_menu=}
    @@ -67,7 +67,7 @@ function epg_imdb(){
    diff --git a/src/nhttpd/web/Y_Ext_Menue.yhtm b/src/nhttpd/web/Y_Ext_Menue.yhtm index 678e4ea5c..3a3226323 100644 --- a/src/nhttpd/web/Y_Ext_Menue.yhtm +++ b/src/nhttpd/web/Y_Ext_Menue.yhtm @@ -1,5 +1,5 @@ -{=var-set:extension={=if-file-exists:/var/tuxbox/config/extentions.txt~/var/tuxbox/config/extentions.txt~{=if-file-exists:/var/httpd/extentions.txt~/var/httpd/extentions.txt~/share/tuxbox/neutrino/httpd/extentions.txt=}=}=} -{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} +{=var-set:extension={=if-file-exists:%(CONFIGDIR)/extentions.txt~%(CONFIGDIR)/extentions.txt~{=if-file-exists:%(PUBLIC_HTTPDDIR)/extentions.txt~%(PUBLIC_HTTPDDIR)/extentions.txt~%(PRIVATE_HTTPDDIR)/extentions.txt=}=}=} +{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~1~=}=} {=include-block:Y_Blocks.txt;head=} diff --git a/src/nhttpd/web/Y_Ext_Settings.yhtm b/src/nhttpd/web/Y_Ext_Settings.yhtm index ae3d6a290..b09770673 100644 --- a/src/nhttpd/web/Y_Ext_Settings.yhtm +++ b/src/nhttpd/web/Y_Ext_Settings.yhtm @@ -23,7 +23,7 @@ function do_submit(){ - +
     

    diff --git a/src/nhttpd/web/Y_Ext_Update.js b/src/nhttpd/web/Y_Ext_Update.js index 0a212f0e3..7f4c6edf4 100644 --- a/src/nhttpd/web/Y_Ext_Update.js +++ b/src/nhttpd/web/Y_Ext_Update.js @@ -236,7 +236,7 @@ function uninstall_build_list2(){ /*build_list*/ i=0; ext.installed_extensions.sortBy(function(e){return e.get('tag');}).each(function(e){ - res=loadSyncURL("/y/cgi?execute=if-file-exists:/var/tuxbox/config/ext/"+e.get('tag')+"_uninstall.inc~1~0"); + res=loadSyncURL("/y/cgi?execute=if-file-exists:%(CONFIGDIR)/ext/"+e.get('tag')+"_uninstall.inc~1~0"); uninstall_list_addRow(update_body,++i,e,res=="1"); }); $('statusline').hide(); diff --git a/src/nhttpd/web/Y_Info_Menue.yhtm b/src/nhttpd/web/Y_Info_Menue.yhtm index 3ea5dab60..7a104ca8c 100644 --- a/src/nhttpd/web/Y_Info_Menue.yhtm +++ b/src/nhttpd/web/Y_Info_Menue.yhtm @@ -9,7 +9,7 @@ function init(){ } -{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} +{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~1~=}=}

    {=L:main.info=}

    diff --git a/src/nhttpd/web/Y_Live.yhtm b/src/nhttpd/web/Y_Live.yhtm index c258faf7b..bd06b4e13 100644 --- a/src/nhttpd/web/Y_Live.yhtm +++ b/src/nhttpd/web/Y_Live.yhtm @@ -1,4 +1,4 @@ -{=var-set:must_management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} +{=var-set:must_management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~1~=}=} {=include-block:Y_Blocks.txt;head_no_charset=} @@ -151,13 +151,13 @@ function view_transcode_mode(){ -{=var-set:wait_text={=L:get_epg=}=}{=include-block:Y_Blocks.txt;snip_show_wait=} +{=var-set:wait_text={=L:epg.get_epg=}=}{=include-block:Y_Blocks.txt;snip_show_wait=} diff --git a/src/nhttpd/web/Y_Live_Menue.yhtm b/src/nhttpd/web/Y_Live_Menue.yhtm index 89457120f..6b4eb4157 100644 --- a/src/nhttpd/web/Y_Live_Menue.yhtm +++ b/src/nhttpd/web/Y_Live_Menue.yhtm @@ -29,7 +29,7 @@ function init(){ //]]> -{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} +{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~1~=}=}

    {=L:live.heading=}

    diff --git a/src/nhttpd/web/Y_Live_Record.yhtm b/src/nhttpd/web/Y_Live_Record.yhtm index bbc3d837d..ee437b68b 100644 --- a/src/nhttpd/web/Y_Live_Record.yhtm +++ b/src/nhttpd/web/Y_Live_Record.yhtm @@ -156,7 +156,7 @@ function doRecord()
    - + diff --git a/src/nhttpd/web/Y_Settings_Live.yhtm b/src/nhttpd/web/Y_Settings_Live.yhtm index 69e8256b6..f851e3846 100644 --- a/src/nhttpd/web/Y_Settings_Live.yhtm +++ b/src/nhttpd/web/Y_Settings_Live.yhtm @@ -24,7 +24,7 @@ function do_refresh_liveview() - + @@ -35,15 +35,15 @@ function do_refresh_liveview() - + - +
    {=L:live.rec.record_mode=}
    {=L:live.rec.filename=}:
    diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css index 6c975bd3f..085b8d1c2 100644 --- a/src/nhttpd/web/Y_Main.css +++ b/src/nhttpd/web/Y_Main.css @@ -24,6 +24,9 @@ button,input,select,form,td { height: 0; overflow: hidden; } +.pointer { + cursor: pointer; +} /* buttons */ a img:hover { position:relative; @@ -645,6 +648,11 @@ tr { /* width:auto;*/ overflow:auto; } +#epg_plus_container { + overflow-y: scroll; + overflow-x: hidden; + max-height: 75vh; +} .ep_bouquet { margin: 0px; padding: 0px; @@ -655,8 +663,6 @@ tr { .ep_bouquet_name { background: #A1CCF2; border-right : #BBBBBB solid 1px; - width : 100px; -/* height: 1.3em;*/ overflow:hidden; padding-left: 1px; padding-right: 1px; @@ -721,7 +727,6 @@ tr { background-color : #DDDDDD; } .ep_time_bar { - width:100%; margin-bottom: 0px; position:relative; border-bottom : #BBBBBB solid 1px; @@ -855,6 +860,10 @@ a:hover.clistsmall font-size:10pt; padding-left: 10px; } +.cslider_cell +{ + width: 35px; +} .cslider { height: 10px; @@ -879,6 +888,10 @@ a:hover.clistsmall { background-color: #FAFAFF; } +.title_table +{ + width: 100%; +} /*EPG*/ .epg { diff --git a/src/nhttpd/web/Y_Menue.yhtm b/src/nhttpd/web/Y_Menue.yhtm index fe461bf6b..7263711a8 100644 --- a/src/nhttpd/web/Y_Menue.yhtm +++ b/src/nhttpd/web/Y_Menue.yhtm @@ -80,7 +80,7 @@ function vlc() { } -{=var-set:alt_httpd={=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.override_directory;/var/httpd=}=} +{=var-set:alt_httpd={=ini-get:%(CONFIGDIR)/nhttpd.conf;WebsiteMain.override_directory;%(PUBLIC_HTTPDDIR)=}=} {=var-set:vf={=if-file-exists:{=var-get:alt_httpd=}/Y_Version.txt~{=var-get:alt_httpd=}/Y_Version.txt~Y_Version.txt=}=}
    @@ -119,8 +119,8 @@ function vlc() {
      - - {=ini-get:/var/tuxbox/config/Y-Web.conf;yweb_box_name=} + + {=ini-get:%(CONFIGDIR)/Y-Web.conf;yweb_box_name=} 00:00
    {=L:live.set.http_caching=}
    {=L:live.set.udp_defaul=}
    {=L:live.set.slavebox_ip=}
    {=L:live.set.vlc_rec_dir=}
    @@ -57,12 +57,12 @@ function do_refresh_liveview() // -{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} +{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~1~=}=}

    {=L:main.settings=}

    diff --git a/src/nhttpd/web/Y_Settings_Timer.yhtm b/src/nhttpd/web/Y_Settings_Timer.yhtm index 772812db3..28066927d 100644 --- a/src/nhttpd/web/Y_Settings_Timer.yhtm +++ b/src/nhttpd/web/Y_Settings_Timer.yhtm @@ -25,11 +25,11 @@ function do_submit() {
    {=L:set.timer.username=}
    {=L:set.timer.password=}
     

    diff --git a/src/nhttpd/web/Y_Settings_VNC.yhtm b/src/nhttpd/web/Y_Settings_VNC.yhtm index e99eaa92b..dc0d394d2 100644 --- a/src/nhttpd/web/Y_Settings_VNC.yhtm +++ b/src/nhttpd/web/Y_Settings_VNC.yhtm @@ -4,7 +4,7 @@ //
    Server
    Port
    Passwort
    Skalierung
    IP
    Verzeichnis
    Lokales Verzeichnis
    MAC
    Optionen 1
    Optionen 2
    Automount
    Benutzername
    Passwort

    diff --git a/src/nhttpd/web/Y_Settings_nhttpd.yhtm b/src/nhttpd/web/Y_Settings_nhttpd.yhtm index 872695929..ffb48b292 100644 --- a/src/nhttpd/web/Y_Settings_nhttpd.yhtm +++ b/src/nhttpd/web/Y_Settings_nhttpd.yhtm @@ -5,10 +5,10 @@ //
    {=L:set.nhttpd.authentication=}
    {=L:user=}
    {=L:password=}
    {=L:set.nhttpd.client_without_authentication=}
    {=L:set.nhttpd.authentication=}
    {=L:set.nhttpd.port=} {=L:set.nhttpd.active_after_boot=} +  {=L:set.nhttpd.active_after_boot=}
    {=L:set.nhttpd.threading=} @@ -83,22 +82,21 @@ function do_check_input_LogosURL() {=L:on=}
    {=L:set.nhttpd.alternate_web_folder=} -  {=L:set.nhttpd.active_after_boot=} +  {=L:set.nhttpd.active_after_boot=}
    {=L:set.nhttpd.hosted_folder=} -  {=L:set.nhttpd.active_after_boot=} +  {=L:set.nhttpd.active_after_boot=}
    {=L:set.nhttpd.allowed_file_extensions=}
    {=L:set.nhttpd.allow_all_file_extensions=}
    {=L:set.nhttpd.url_of_logos=}
    {=L:set.nhttpd.server=}
    {=L:set.nhttpd.ips_without_keep_alive=}
    {=L:set.nhttpd.ips_without_keep_alive_desc=}
    +
    PIN Code  
    Farbtasten
    Taste Blau (Features)
    {=L:set.yweb.management_IPs=}
    IP 1
    IP 2
    {=L:set.yweb.wake_on_lan=}
    MAC 1 {=L:set.yweb.description=}
    MAC 2 {=L:set.yweb.description=}
    MAC 3 {=L:set.yweb.description=}
    {=L:set.yweb.box_tag=}
    {=L:set.yweb.box_tag=}
    {=L:set.yweb.box_color=}
    {=L:others=}
    - bouquets.xml
    - services.xml
    - ubouquets.xml
    - myservices.xml
    + bouquets.xml
    + services.xml
    + ubouquets.xml
    + myservices.xml
    diff --git a/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm b/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm index 200ad4064..c1723b6d5 100644 --- a/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm +++ b/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm @@ -50,8 +50,8 @@ function standby(_standby){ -{=comment:disable non-working rec on/off buttons~ +{=comment:disable non-working rec off button~ =} diff --git a/src/nhttpd/web/Y_Tools_Check_Install.yhtm b/src/nhttpd/web/Y_Tools_Check_Install.yhtm index e5dc275e6..b99f2749a 100644 --- a/src/nhttpd/web/Y_Tools_Check_Install.yhtm +++ b/src/nhttpd/web/Y_Tools_Check_Install.yhtm @@ -57,22 +57,22 @@ function do_check(){ else sLog_addRow(sLog_body, "green", "WebServer: version is "+nhttpd_version, "ok"); - {=if-equal:{=ini-get:/var/tuxbox/config/nhttpd.conf;mod_auth.authenticate;false=}~false~~ + {=if-equal:{=ini-get:%(CONFIGDIR)/nhttpd.conf;mod_auth.authenticate;false=}~false~~ sLog_addRow(sLog_body, "yellow", "WebServer: Authentication is on. ", "notice"); =} - {=if-equal:{=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.port;80=}~80~~ + {=if-equal:{=ini-get:%(CONFIGDIR)/nhttpd.conf;WebsiteMain.port;80=}~80~~ sLog_addRow(sLog_body, "yellow", - "WebServer: not set to Standard-Port. Actual: {=ini-get:/var/tuxbox/config/nhttpd.conf;WebsiteMain.port;80=} "+wiki_url("Neutrino:yWeb#Webserver"), "notice"); + "WebServer: not set to Standard-Port. Actual: {=ini-get:%(CONFIGDIR)/nhttpd.conf;WebsiteMain.port;80=} "+wiki_url("Neutrino:yWeb#Webserver"), "notice"); =} /*settings*/ - {=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip=}~~ + {=if-empty:{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip=}~~ sLog_addRow(sLog_body, "yellow", - "Settings: Management IP(1) is set to {=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip=} ! Your IP is {=func:get_request_data client_addr=}. " + "Settings: Management IP(1) is set to {=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip=} ! Your IP is {=func:get_request_data client_addr=}. " +wiki_url("Help-Settings-yWeb"), "notice"); =} - {=if-empty:{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~~ + {=if-empty:{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~~ sLog_addRow(sLog_body, "yellow", - "Settings: Management IP(2) is set to {=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=} ! Your IP is {=func:get_request_data client_addr=}. " + "Settings: Management IP(2) is set to {=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=} ! Your IP is {=func:get_request_data client_addr=}. " +wiki_url("Neutrino:yWeb#yWeb"), "notice"); =} diff --git a/src/nhttpd/web/Y_Tools_Menue.yhtm b/src/nhttpd/web/Y_Tools_Menue.yhtm index 006aa241e..3fcdf0c3a 100644 --- a/src/nhttpd/web/Y_Tools_Menue.yhtm +++ b/src/nhttpd/web/Y_Tools_Menue.yhtm @@ -13,7 +13,7 @@ function init(){ } -{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=} +{=var-set:management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip;{=func:get_request_data client_addr=}=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:%(CONFIGDIR)/Y-Web.conf;management_ip2=}~1~=}=} {=var-set:automount={=find-exec:automount=}=} {=var-set:ether-wake={=find-exec:ether-wake=}=} diff --git a/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm b/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm index 5b75bedd3..bee1ec1b4 100644 --- a/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm +++ b/src/nhttpd/web/Y_Tools_Timer_Sync.yhtm @@ -14,8 +14,8 @@
    - TVInfo
    -   + TVInfo
    +  
    "; } } else if (ycmd_type == "script") - yresult = YexecuteScript(hh, ycmd_name); + yresult = yExecuteScript(ycmd_name); else if (ycmd_type == "if-empty") { std::string if_value, if_then, if_else; if (ySplitString(ycmd_name, "~", if_value, if_then)) { @@ -528,10 +528,14 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd) { } else yresult = "ycgi-type unknown"; } else if (!hh->ParamList[ycmd].empty()) { +#if 0 if ((hh->ParamList[ycmd]).find("script") == std::string::npos) yresult = hh->ParamList[ycmd]; else yresult = ""; +#else + yresult = hh->ParamList[ycmd]; +#endif } return yresult; @@ -632,54 +636,6 @@ std::string CyParser::YWeb_cgi_include_block(std::string filename, return yresult; } -//------------------------------------------------------------------------- - -std::string CyParser::YexecuteScript(CyhookHandler *, std::string cmd) { - std::string script, para, result; - bool found = false; - - // split script and parameters - int pos; - if ((pos = cmd.find_first_of(" ")) > 0) { - script = cmd.substr(0, pos); - para = cmd.substr(pos + 1, cmd.length() - (pos + 1)); // snip - } else - script = cmd; - // get file - std::string fullfilename; - script += ".sh"; //add script extention - - char cwd[255]; - getcwd(cwd, 254); - for (unsigned int i = 0; i < PLUGIN_DIR_COUNT && !found; i++) { - fullfilename = PLUGIN_DIRS[i] + "/" + script; - FILE *test = fopen(fullfilename.c_str(), "r"); // use fopen: popen does not work - if (test != NULL) { - fclose(test); - chdir(PLUGIN_DIRS[i].c_str()); - FILE *f = popen((fullfilename + " " + para).c_str(), "r"); //execute - if (f != NULL) { - found = true; - - char output[1024]; - while (fgets(output, 1024, f)) // get script output - result += output; - pclose(f); - } - } - } - chdir(cwd); - - if (!found) { - printf(" script %s not found in\n", script.c_str()); - for (unsigned int i = 0; i < PLUGIN_DIR_COUNT; i++) { - printf("%s\n", PLUGIN_DIRS[i].c_str()); - } - result = "error"; - } - return result; -} - //============================================================================= // y-func : Dispatching // TODO: new functions for diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.h b/src/nhttpd/yhttpd_mods/mod_yparser.h index ae5d49118..dc6209ec2 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.h +++ b/src/nhttpd/yhttpd_mods/mod_yparser.h @@ -95,7 +95,6 @@ private: std::string YWeb_cgi_get_ini(CyhookHandler *hh, std::string filename, std::string varname, std::string yaccess); void YWeb_cgi_set_ini(CyhookHandler *hh, std::string filename, std::string varname, std::string varvalue, std::string yaccess); std::string YWeb_cgi_include_block(std::string filename, std::string blockname, std::string ydefault); - std::string YexecuteScript(CyhookHandler *hh, std::string cmd); // CGIs void cgi(CyhookHandler *hh); diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 1ccc0b301..2b1a49389 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -46,6 +46,7 @@ #include #include #include "debug.h" +#include #include #include using namespace std; @@ -440,6 +441,28 @@ std::string trim(std::string &str, const std::string &trimChars /*= " \n\r\t"*/) return result.erase(0, result.find_first_not_of(trimChars)); } +std::string cutString(const std::string str, int msgFont, const int width) +{ + Font *msgFont_ = g_Font[msgFont]; + std::string ret = str; + ret = trim(ret); + int sw = msgFont_->getRenderWidth(ret); + if (sw <= width) + return ret; + else { + std::string z = "..."; + int zw = msgFont_->getRenderWidth(z); + if (width <= 2*zw) + return ret; + do { + ret = ret.substr(0, ret.length()-1); + sw = msgFont_->getRenderWidth(ret); + } while (sw+zw > width); + ret = trim(ret) + z; + } + return ret; +} + std::string strftime(const char *format, const struct tm *tm) { char buf[4096]; @@ -489,6 +512,8 @@ std::string& htmlEntityDecode(std::string& text) }; decode_table dt[] = { + {"\n", " "}, + {"\n", " "}, {" ", " "}, {"&", "&"}, {"<", "<"}, @@ -512,14 +537,28 @@ std::string& htmlEntityDecode(std::string& text) CFileHelpers::CFileHelpers() { - FileBufSize = 0xFFFF; - FileBuf = new char[FileBufSize]; + FileBufMaxSize = 0xFFFF; + ConsoleQuiet = false; + clearDebugInfo(); } CFileHelpers::~CFileHelpers() { - if (FileBuf != NULL) - delete [] FileBuf; +} + +char* CFileHelpers::initFileBuf(char* buf, uint32_t size) +{ + if (buf == NULL) + buf = new char[size]; + return buf; +} + +char* CFileHelpers::deleteFileBuf(char* buf) +{ + if (buf != NULL) + delete [] buf; + buf = NULL; + return buf; } CFileHelpers* CFileHelpers::getInstance() @@ -530,20 +569,198 @@ CFileHelpers* CFileHelpers::getInstance() return FileHelpers; } -bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t mode) +void CFileHelpers::clearDebugInfo() { - unlink(Dst); + DebugInfo.msg.clear(); + DebugInfo.file.clear(); + DebugInfo.func.clear(); + DebugInfo.line = 0; +} + +void CFileHelpers::setDebugInfo(const char* msg, const char* file, const char* func, int line) +{ + DebugInfo.msg = msg; + DebugInfo.file = file; + DebugInfo.func = func; + DebugInfo.line = line; +} + +void CFileHelpers::readDebugInfo(helpersDebugInfo* di) +{ + di->msg = DebugInfo.msg; + di->file = DebugInfo.file; + di->func = DebugInfo.func; + di->line = DebugInfo.line; +} + +void CFileHelpers::printDebugInfo() +{ + if (!ConsoleQuiet) + printf(">>>> [%s:%d] %s\n", DebugInfo.func.c_str(), DebugInfo.line, DebugInfo.msg.c_str()); +} + +bool CFileHelpers::cp(const char *Src, const char *Dst, const char *Flags/*=""*/) +{ + clearDebugInfo(); + if ((Src == NULL) || (Dst == NULL)) { + setDebugInfo("One or more parameters are NULL", __path_file__, __func__, __LINE__); + printDebugInfo(); + return false; + } + + std::string src = Src; + src = trim(src); + if (src.find_first_of("/") != 0) + src = "./" + src; + size_t pos = src.find_last_of("/"); + if (pos == src.length()-1) + src = src.substr(0, pos); + + std::string dst = Dst; + dst = trim(dst); + if (dst.find_first_of("/") != 0) + dst = "./" + dst; + pos = dst.find_last_of("/"); + if (pos == dst.length()-1) + dst = dst.substr(0, pos); + + bool wildcards = (src.find("*") != std::string::npos); + bool recursive = ((strchr(Flags, 'r') != NULL) || (strchr(Flags, 'a') != NULL)); + bool no_dereference = ((strchr(Flags, 'd') != NULL) || (strchr(Flags, 'a') != NULL)); + + static struct stat FileInfo; + char buf[PATH_MAX]; + if (wildcards == false) { + if (!file_exists(src.c_str())) { + setDebugInfo("Source file not exist", __path_file__, __func__, __LINE__); + printDebugInfo(); + return false; + } + if (lstat(src.c_str(), &FileInfo) == -1) { + setDebugInfo("lstat error", __path_file__, __func__, __LINE__); + printDebugInfo(); + return false; + } + + pos = src.find_last_of("/"); + std::string fname = src.substr(pos); + + static struct stat FileInfo2; + // is symlink + if (S_ISLNK(FileInfo.st_mode)) { + int len = readlink(src.c_str(), buf, sizeof(buf)-1); + if (len != -1) { + buf[len] = '\0'; + if (!no_dereference) { /* copy */ + std::string buf_ = (std::string)buf; + char buf2[PATH_MAX + 1]; + if (buf[0] != '/') + buf_ = getPathName(src) + "/" + buf_; + buf_ = (std::string)realpath(buf_.c_str(), buf2); + //printf("\n>>>> RealPath: %s\n \n", buf_.c_str()); + if (file_exists(dst.c_str()) && (lstat(dst.c_str(), &FileInfo2) != -1)){ + if (S_ISDIR(FileInfo2.st_mode)) + copyFile(buf_.c_str(), (dst + fname).c_str()); + else { + unlink(dst.c_str()); + copyFile(buf_.c_str(), dst.c_str()); + } + } + else + copyFile(buf_.c_str(), dst.c_str()); + } + else { /* link */ + if (file_exists(dst.c_str()) && (lstat(dst.c_str(), &FileInfo2) != -1)){ + if (S_ISDIR(FileInfo2.st_mode)) + symlink(buf, (dst + fname).c_str()); + else { + unlink(dst.c_str()); + symlink(buf, dst.c_str()); + } + } + else + symlink(buf, dst.c_str()); + } + } + } + // is directory + else if (S_ISDIR(FileInfo.st_mode)) { + if (recursive) + copyDir(src.c_str(), dst.c_str()); + else { + setDebugInfo("'recursive flag' must be set to copy dir.", __path_file__, __func__, __LINE__); + printDebugInfo(); + return false; + } + } + // is file + else if (S_ISREG(FileInfo.st_mode)) { + if (file_exists(dst.c_str()) && (lstat(dst.c_str(), &FileInfo2) != -1)){ + if (S_ISDIR(FileInfo2.st_mode)) + copyFile(src.c_str(), (dst + fname).c_str()); + else { + unlink(dst.c_str()); + copyFile(src.c_str(), dst.c_str()); + } + } + else + copyFile(src.c_str(), dst.c_str()); + } + else { + setDebugInfo("Currently unsupported st_mode.", __path_file__, __func__, __LINE__); + printDebugInfo(); + return false; + } + } + else { + setDebugInfo("Wildcard feature not yet realized.", __path_file__, __func__, __LINE__); + printDebugInfo(); + return false; + } + + return true; +} + +bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t forceMode/*=0*/) +{ + /* + set mode for Dst + ---------------- + when forceMode==0 (default) then + when Dst exists + mode = mode from Dst + else + mode = mode from Src + else + mode = forceMode + */ + mode_t mode = forceMode & 0x0FFF; + if (mode == 0) { + static struct stat FileInfo; + const char *f = Dst; + if (!file_exists(Dst)) + f = Src; + if (lstat(f, &FileInfo) == -1) + return false; + mode = FileInfo.st_mode & 0x0FFF; + } + if ((fd1 = open(Src, O_RDONLY)) < 0) return false; + if (file_exists(Dst)) + unlink(Dst); if ((fd2 = open(Dst, O_WRONLY | O_CREAT, mode)) < 0) { close(fd1); return false; } + char* FileBuf = NULL; uint32_t block; off64_t fsizeSrc64 = lseek64(fd1, 0, SEEK_END); lseek64(fd1, 0, SEEK_SET); off64_t fsize64 = fsizeSrc64; + uint32_t FileBufSize = (fsizeSrc64 < (off_t)FileBufMaxSize) ? (uint32_t)fsizeSrc64 : FileBufMaxSize; + FileBuf = initFileBuf(FileBuf, FileBufSize); block = FileBufSize; //printf("#####[%s] fsizeSrc64: %lld 0x%010llX - large file\n", __func__, fsizeSrc64, fsizeSrc64); while (fsize64 > 0) { @@ -558,11 +775,13 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t mode) if (fsizeSrc64 != fsizeDst64) { close(fd1); close(fd2); + FileBuf = deleteFileBuf(FileBuf); return false; } close(fd1); close(fd2); + FileBuf = deleteFileBuf(FileBuf); return true; } @@ -633,7 +852,7 @@ bool CFileHelpers::copyDir(const char *Src, const char *Dst, bool backupMode) if (backupMode && (CExtUpdate::getInstance()->isBlacklistEntry(srcPath))) save = ".save"; #endif - copyFile(srcPath, (dstPath + save).c_str(), FileInfo.st_mode & 0x0FFF); + copyFile(srcPath, (dstPath + save).c_str()); /* mode is set by copyFile */ } } } @@ -645,6 +864,8 @@ bool CFileHelpers::copyDir(const char *Src, const char *Dst, bool backupMode) // false - errno is set bool CFileHelpers::createDir(string& Dir, mode_t mode) { + CFileHelpers* fh = CFileHelpers::getInstance(); + fh->clearDebugInfo(); int res = 0; for(string::iterator iter = Dir.begin() ; iter != Dir.end();) { string::iterator newIter = find(iter, Dir.end(), '/' ); @@ -658,7 +879,12 @@ bool CFileHelpers::createDir(string& Dir, mode_t mode) // We can assume that if an error // occured, following will fail too, // so break here. - dprintf(DEBUG_NORMAL, "[CFileHelpers %s] creating directory %s: %s\n", __func__, newPath.c_str(), strerror(errno)); + if (!fh->getConsoleQuiet()) + dprintf(DEBUG_NORMAL, "[CFileHelpers %s] creating directory %s: %s\n", __func__, newPath.c_str(), strerror(errno)); + char buf[1024]; + memset(buf, '\0', sizeof(buf)); + snprintf(buf, sizeof(buf)-1, "creating directory %s: %s", newPath.c_str(), strerror(errno)); + fh->setDebugInfo(buf, __path_file__, __func__, __LINE__); break; } } @@ -673,13 +899,22 @@ bool CFileHelpers::createDir(string& Dir, mode_t mode) bool CFileHelpers::removeDir(const char *Dir) { + CFileHelpers* fh = CFileHelpers::getInstance(); + fh->clearDebugInfo(); DIR *dir; struct dirent *entry; char path[PATH_MAX]; dir = opendir(Dir); if (dir == NULL) { - printf("Error opendir()\n"); + if (errno == ENOENT) + return true; + if (!fh->getConsoleQuiet()) + dprintf(DEBUG_NORMAL, "[CFileHelpers %s] remove directory %s: %s\n", __func__, Dir, strerror(errno)); + char buf[1024]; + memset(buf, '\0', sizeof(buf)); + snprintf(buf, sizeof(buf)-1, "remove directory %s: %s", Dir, strerror(errno)); + fh->setDebugInfo(buf, __path_file__, __func__, __LINE__); return false; } while ((entry = readdir(dir)) != NULL) { @@ -820,6 +1055,26 @@ bool split_config_string(const std::string &str, std::mapgetScreenWidth(true); + if ((_x + ret) >= xRes) + ret = xRes-_x-1; + if (ret%4 == 0) + return ret; + + int add = (max) ? 3 : 0; + ret = ((ret + add) / 4) * 4; + if ((_x + ret) >= xRes) + ret -= 4; + + return ret; +} + std::vector split(const std::string &s, char delim) { std::vector vec; @@ -872,6 +1127,38 @@ std::string to_string(unsigned long long i) return s.str(); } +/** + * C++ version 0.4 std::string style "itoa": + * Contributions from Stuart Lowe, Ray-Yuan Sheu, + + * Rodrigo de Salvo Braz, Luc Gallant, John Maloney + * and Brian Hunt + */ +std::string itoa(int value, int base) +{ + std::string buf; + + // check that the base if valid + if (base < 2 || base > 16) return buf; + + enum { kMaxDigits = 35 }; + buf.reserve( kMaxDigits ); // Pre-allocate enough space. + + int quotient = value; + + // Translating number to string with base: + do { + buf += "0123456789abcdef"[ std::abs( quotient % base ) ]; + quotient /= base; + } while ( quotient ); + + // Append the negative sign + if ( value < 0) buf += '-'; + + std::reverse( buf.begin(), buf.end() ); + return buf; +} + std::string getJFFS2MountPoint(int mtdPos) { FILE* fd = fopen("/proc/mounts", "r"); @@ -890,3 +1177,36 @@ std::string getJFFS2MountPoint(int mtdPos) fclose(fd); return ""; } + +std::string Lang2ISO639_1(std::string& lang) +{ + std::string ret = ""; + if ((lang == "deutsch") || (lang == "bayrisch") || (lang == "ch-baslerdeutsch") || (lang == "ch-berndeutsch")) + ret = "de"; + else if (lang == "english") + ret = "en"; + else if (lang == "nederlands") + ret = "nl"; + else if (lang == "slovak") + ret = "sk"; + else if (lang == "bosanski") + ret = "bs"; + else if (lang == "czech") + ret = "cs"; + else if (lang == "francais") + ret = "fr"; + else if (lang == "italiano") + ret = "it"; + else if (lang == "polski") + ret = "pl"; + else if (lang == "portugues") + ret = "pt"; + else if (lang == "russkij") + ret = "ru"; + else if (lang == "suomi") + ret = "fi"; + else if (lang == "svenska") + ret = "sv"; + + return ret; +} diff --git a/src/system/helpers.h b/src/system/helpers.h index 85a6d701b..8c1961ffb 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -67,33 +67,55 @@ std::string getFileName(std::string &file); std::string getFileExt(std::string &file); std::string getNowTimeStr(const char* format); std::string trim(std::string &str, const std::string &trimChars = " \n\r\t"); +std::string cutString(const std::string str, int msgFont, const int width); std::string strftime(const char *format, const struct tm *tm); std::string strftime(const char *format, time_t when, bool gm = false); time_t toEpoch(std::string &date); std::string& str_replace(const std::string &search, const std::string &replace, std::string &text); std::string& htmlEntityDecode(std::string& text); +struct helpersDebugInfo { + std::string msg; + std::string file; + std::string func; + int line; +}; + class CFileHelpers { private: - unsigned long FileBufSize; - char *FileBuf; + uint32_t FileBufMaxSize; int fd1, fd2; + char* initFileBuf(char* buf, uint32_t size); + char* deleteFileBuf(char* buf); + bool ConsoleQuiet; + helpersDebugInfo DebugInfo; + void setDebugInfo(const char* msg, const char* file, const char* func, int line); + void printDebugInfo(); + public: CFileHelpers(); ~CFileHelpers(); static CFileHelpers* getInstance(); - bool copyFile(const char *Src, const char *Dst, mode_t mode); + void clearDebugInfo(); + void readDebugInfo(helpersDebugInfo* di); + void setConsoleQuiet(bool q) { ConsoleQuiet = q; }; + bool getConsoleQuiet() { return ConsoleQuiet; }; + + bool cp(const char *Src, const char *Dst, const char *Flags=""); + bool copyFile(const char *Src, const char *Dst, mode_t forceMode=0); bool copyDir(const char *Src, const char *Dst, bool backupMode=false); - static bool createDir(std::string& Dir, mode_t mode = 755); - static bool createDir(const char *Dir, mode_t mode = 755){std::string dir = std::string(Dir);return createDir(dir, mode);} + static bool createDir(std::string& Dir, mode_t mode = 0755); + static bool createDir(const char *Dir, mode_t mode = 0755){std::string dir = std::string(Dir);return createDir(dir, mode);} static bool removeDir(const char *Dir); static uint64_t getDirSize(const char *dir); static uint64_t getDirSize(const std::string& dir){return getDirSize(dir.c_str());}; }; +uint32_t GetWidth4FB_HW_ACC(const uint32_t _x, const uint32_t _w, const bool max=true); + std::string to_string(int); std::string to_string(unsigned int); std::string to_string(long); @@ -101,6 +123,8 @@ std::string to_string(unsigned long); std::string to_string(long long); std::string to_string(unsigned long long); +std::string itoa(int value, int base); + inline int atoi(std::string &s) { return atoi(s.c_str()); } inline int atoi(const std::string &s) { return atoi(s.c_str()); } inline int access(std::string &s, int mode) { return access(s.c_str(), mode); } @@ -114,5 +138,6 @@ std::vector split(const std::string &s, char delim); bool split_config_string(const std::string &str, std::map &smap); std::string getJFFS2MountPoint(int mtdPos); +std::string Lang2ISO639_1(std::string& lang); #endif diff --git a/src/system/httptool.cpp b/src/system/httptool.cpp index 8f89db96f..9f8aca4a4 100644 --- a/src/system/httptool.cpp +++ b/src/system/httptool.cpp @@ -41,6 +41,14 @@ void CHTTPTool::setStatusViewer( CProgressWindow* statusview ) statusViewer = statusview; } +size_t CHTTPTool::CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data) +{ + if (size * nmemb > 0) { + std::string* pStr = (std::string*) data; + pStr->append((char*) ptr, nmemb); + } + return size*nmemb; +} int CHTTPTool::show_progress( void *clientp, double dltotal, double dlnow, double /*ultotal*/, double /*ulnow*/ ) { @@ -127,3 +135,62 @@ printf("download code %d\n", res); return res==CURLE_OK; } + +std::string CHTTPTool::downloadString(const std::string & URL, int globalProgressEnd) +{ + CURL *curl; + CURLcode res; + std::string retString = ""; +#ifdef DEBUG +printf("url is %s\n", URL.c_str()); +#endif + res = (CURLcode) 1; + curl = curl_easy_init(); + if(curl) + { + iGlobalProgressEnd = globalProgressEnd; + if(statusViewer) + { + iGlobalProgressBegin = statusViewer->getGlobalStatus(); + } + curl_easy_setopt(curl, CURLOPT_URL, URL.c_str() ); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &CHTTPTool::CurlWriteToString); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)&retString); + curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, show_progress); + curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, this); + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0); + curl_easy_setopt(curl, CURLOPT_USERAGENT, userAgent.c_str()); + curl_easy_setopt(curl, CURLOPT_NOSIGNAL, (long)1); + curl_easy_setopt(curl, CURLOPT_TIMEOUT, 1800); + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 10); + curl_easy_setopt(curl, CURLOPT_FAILONERROR, true); + curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false); +#ifdef DEBUG + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); +#endif + + if (!g_settings.softupdate_proxyserver.empty()) {//use proxyserver +#ifdef DEBUG +printf("use proxyserver : %s\n", g_settings.softupdate_proxyserver.c_str()); +#endif + curl_easy_setopt(curl, CURLOPT_PROXY, g_settings.softupdate_proxyserver.c_str()); + + if (!g_settings.softupdate_proxyusername.empty()) {//use auth + //printf("use proxyauth\n"); + std::string tmp = g_settings.softupdate_proxyusername; + tmp += ":"; + tmp += g_settings.softupdate_proxypassword; + curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, tmp.c_str()); + } + } +#ifdef DEBUG +printf("going to download\n"); +#endif + res = curl_easy_perform(curl); + curl_easy_cleanup(curl); + } +#ifdef DEBUG +printf("download code %d\n", res); +#endif + return (res==CURLE_OK) ? retString : ""; +} diff --git a/src/system/httptool.h b/src/system/httptool.h index c0b3f487f..93a5f43c3 100644 --- a/src/system/httptool.h +++ b/src/system/httptool.h @@ -46,12 +46,14 @@ class CHTTPTool CProgressWindow* statusViewer; static int show_progress( void *clientp, double dltotal, double dlnow, double ultotal, double ulnow); + static size_t CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data); public: CHTTPTool(); void setStatusViewer( CProgressWindow* statusview ); bool downloadFile( const std::string & URL, const char * const downloadTarget, int globalProgressEnd=-1 ); + std::string downloadString(const std::string & URL, int globalProgressEnd=-1 ); }; diff --git a/src/system/localize.cpp b/src/system/localize.cpp index 607f7b95f..63f562437 100644 --- a/src/system/localize.cpp +++ b/src/system/localize.cpp @@ -223,17 +223,18 @@ CLocaleManager::loadLocale_ret_t CLocaleManager::loadLocale(const char * const l fclose(fd); if(buf) free(buf); - char *_mem = (char *) realloc(*mem, memp - *mem); - if (_mem) { - if (_mem != *mem) { - // most likely doesn't happen - for(unsigned int i = 1; i < sizeof(locale_real_names)/sizeof(const char *); i++) - if (loadData[i] != locale_real_names[i]) - loadData[i] -= *mem - _mem; - *mem = _mem; + if(memp - *mem > 0){ + char *_mem = (char *) realloc(*mem, memp - *mem); + if (_mem) { + if (_mem != *mem) { + // most likely doesn't happen + for(unsigned int i = 1; i < sizeof(locale_real_names)/sizeof(const char *); i++) + if (loadData[i] != locale_real_names[i]) + loadData[i] -= *mem - _mem; + *mem = _mem; + } } } - for (unsigned j = 1; j < (sizeof(locale_real_names)/sizeof(const char *)); j++) if (loadData[j] == locale_real_names[j]) { diff --git a/src/system/locals.h b/src/system/locals.h index 5fe1c56e8..f66030446 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -135,6 +135,15 @@ typedef enum LOCALE_GENRE_TRAVEL_HOBBIES_7, LOCALE_GENRE_UNKNOWN, LOCALE_ADZAP, + LOCALE_ADZAP_ANNOUNCE, + LOCALE_ADZAP_CANCEL, + LOCALE_ADZAP_DISABLE, + LOCALE_ADZAP_ENABLE, + LOCALE_ADZAP_MINUTE, + LOCALE_ADZAP_MINUTES, + LOCALE_ADZAP_MONITOR, + LOCALE_ADZAP_SWITCHBACK, + LOCALE_ADZAP_WRITEDATA, LOCALE_APIDSELECTOR_HEAD, LOCALE_AUDIO_SRS_ALGO, LOCALE_AUDIO_SRS_ALGO_HEAVY, @@ -273,6 +282,7 @@ typedef enum LOCALE_CHANNELLIST_FOOT_SORT_SAT, LOCALE_CHANNELLIST_HEAD, LOCALE_CHANNELLIST_HISTORY, + LOCALE_CHANNELLIST_HISTORY_CLEAR, LOCALE_CHANNELLIST_KEEP_NUMBERS, LOCALE_CHANNELLIST_MAKE_HDLIST, LOCALE_CHANNELLIST_MAKE_NEWLIST, @@ -350,6 +360,7 @@ typedef enum LOCALE_COLORMENUSETUP_MENUCONTENT, LOCALE_COLORMENUSETUP_MENUCONTENT_INACTIVE, LOCALE_COLORMENUSETUP_MENUCONTENT_SELECTED, + LOCALE_COLORMENUSETUP_MENUFOOT, LOCALE_COLORMENUSETUP_MENUHEAD, LOCALE_COLORSTATUSBAR_TEXT, LOCALE_COLORTHEMEMENU_HEAD, @@ -405,6 +416,7 @@ typedef enum LOCALE_EPGVIEWER_LENGTH, LOCALE_EPGVIEWER_NODETAILED, LOCALE_EPGVIEWER_NOTFOUND, + LOCALE_EPGVIEWER_SELECT_SCREENING, LOCALE_EVENTFINDER_FSK, LOCALE_EVENTFINDER_GENRE, LOCALE_EVENTFINDER_HEAD, @@ -418,6 +430,7 @@ typedef enum LOCALE_EVENTFINDER_SEARCHING, LOCALE_EVENTFINDER_START_SEARCH, LOCALE_EVENTLIST_ADDITIONAL, + LOCALE_EVENTLIST_EPGPLUS, LOCALE_EVENTLIST_NAME, LOCALE_EVENTLISTBAR_CHANNELSWITCH, LOCALE_EVENTLISTBAR_EVENTSORT, @@ -492,6 +505,7 @@ typedef enum LOCALE_EXTRA_SCRAMBLED_MESSAGE, LOCALE_EXTRA_SHOW_MUTE_ICON, LOCALE_EXTRA_SMS_CHANNEL, + LOCALE_EXTRA_SMS_MOVIE, LOCALE_EXTRA_SOUTH, LOCALE_EXTRA_START_TOSTANDBY, LOCALE_EXTRA_TEMP_TIMESHIFT, @@ -744,6 +758,7 @@ typedef enum LOCALE_FONTSIZE_INFOBAR_NUMBER, LOCALE_FONTSIZE_INFOBAR_SMALL, LOCALE_FONTSIZE_MENU, + LOCALE_FONTSIZE_MENU_FOOT, LOCALE_FONTSIZE_MENU_HINT, LOCALE_FONTSIZE_MENU_INFO, LOCALE_FONTSIZE_MENU_TITLE, @@ -792,6 +807,7 @@ typedef enum LOCALE_HDD_UMOUNT, LOCALE_HDD_UMOUNT_WARN, LOCALE_HDD_UMOUNTED, + LOCALE_IMAGEINFO_API, LOCALE_IMAGEINFO_CREATOR, LOCALE_IMAGEINFO_DATE, LOCALE_IMAGEINFO_DOKUMENTATION, @@ -886,6 +902,7 @@ typedef enum LOCALE_LCDMENU_DIM_TIME, LOCALE_LCDMENU_HEAD, LOCALE_LCDMENU_LCDCONTROLER, + LOCALE_LCDMENU_NOTIFY_RCLOCK, LOCALE_LCDMENU_SCROLL, LOCALE_LCDMENU_STATUSLINE, LOCALE_LCDMENU_STATUSLINE_BOTH, @@ -903,6 +920,10 @@ typedef enum LOCALE_LEDCONTROLER_ON_ALL, LOCALE_LEDCONTROLER_ON_LED1, LOCALE_LEDCONTROLER_ON_LED2, + LOCALE_LIVESTREAM_HEAD, + LOCALE_LIVESTREAM_READ_DATA, + LOCALE_LIVESTREAM_RESOLUTION, + LOCALE_LIVESTREAM_SCRIPTPATH, LOCALE_LUA_BOOLPARAM_DEPRECATED1, LOCALE_LUA_BOOLPARAM_DEPRECATED2, LOCALE_LUA_BOOLPARAM_DEPRECATED3, @@ -952,9 +973,18 @@ typedef enum LOCALE_MAINSETTINGS_SAVESETTINGSNOW_HINT, LOCALE_MAINSETTINGS_TIMEZONE, LOCALE_MAINSETTINGS_VIDEO, + LOCALE_MBKEY_COPY_ONEFILE, + LOCALE_MBKEY_COPY_SEVERAL, + LOCALE_MBKEY_COVER, + LOCALE_MBKEY_CUT, + LOCALE_MBKEY_TRUNCATE, LOCALE_MENU_BACK, LOCALE_MENU_CANCEL, LOCALE_MENU_HINT_A_PIC, + LOCALE_MENU_HINT_ADZAP, + LOCALE_MENU_HINT_ADZAP_ACTIVE, + LOCALE_MENU_HINT_ADZAP_SETUP, + LOCALE_MENU_HINT_ADZAP_WRITEDATA, LOCALE_MENU_HINT_APLAY, LOCALE_MENU_HINT_APLAY_SETUP, LOCALE_MENU_HINT_AUDIO, @@ -1037,6 +1067,7 @@ typedef enum LOCALE_MENU_HINT_EPG_SCAN, LOCALE_MENU_HINT_EPG_SCAN_MODE, LOCALE_MENU_HINT_EVENTLIST_ADDITIONAL, + LOCALE_MENU_HINT_EVENTLIST_EPGPLUS, LOCALE_MENU_HINT_EVENTLIST_FONTS, LOCALE_MENU_HINT_EVENTLIST_SETUP, LOCALE_MENU_HINT_EXTENDED, @@ -1051,6 +1082,8 @@ typedef enum LOCALE_MENU_HINT_FONT_SCALING, LOCALE_MENU_HINT_FONT_TTX, LOCALE_MENU_HINT_FONTS, + LOCALE_MENU_HINT_FOOT_BACK, + LOCALE_MENU_HINT_FOOT_TEXTCOLOR, LOCALE_MENU_HINT_GAMES, LOCALE_MENU_HINT_HDD, LOCALE_MENU_HINT_HDD_APPLY, @@ -1096,7 +1129,6 @@ typedef enum LOCALE_MENU_HINT_KEY_BOUQUETDOWN, LOCALE_MENU_HINT_KEY_BOUQUETUP, LOCALE_MENU_HINT_KEY_CANCEL, - LOCALE_MENU_HINT_KEY_CHANNEL_SMS, LOCALE_MENU_HINT_KEY_CHANNELDOWN, LOCALE_MENU_HINT_KEY_CHANNELLIST, LOCALE_MENU_HINT_KEY_CHANNELUP, @@ -1109,6 +1141,7 @@ typedef enum LOCALE_MENU_HINT_KEY_LIST_START, LOCALE_MENU_HINT_KEY_LOAD, LOCALE_MENU_HINT_KEY_MODECHANGE, + LOCALE_MENU_HINT_KEY_MOVIEBROWSER, LOCALE_MENU_HINT_KEY_MOVIEPLAYER, LOCALE_MENU_HINT_KEY_MPAUDIO, LOCALE_MENU_HINT_KEY_MPBOOKMARK, @@ -1166,6 +1199,7 @@ typedef enum LOCALE_MENU_HINT_MAKE_WEBTVLIST, LOCALE_MENU_HINT_MANAGE_SETTINGS, LOCALE_MENU_HINT_MB, + LOCALE_MENU_HINT_MBKEY_COVER, LOCALE_MENU_HINT_MEDIA, LOCALE_MENU_HINT_MENU_FONTS, LOCALE_MENU_HINT_MENU_HINTS, @@ -1177,6 +1211,7 @@ typedef enum LOCALE_MENU_HINT_MISC_EPG, LOCALE_MENU_HINT_MISC_FILEBROWSER, LOCALE_MENU_HINT_MISC_GENERAL, + LOCALE_MENU_HINT_MISC_ONLINESERVICES, LOCALE_MENU_HINT_MISC_ZAPIT, LOCALE_MENU_HINT_MOVIE, LOCALE_MENU_HINT_MOVIEBROWSER_SETUP, @@ -1258,6 +1293,7 @@ typedef enum LOCALE_MENU_HINT_PROTECTION, LOCALE_MENU_HINT_RADIOMODE, LOCALE_MENU_HINT_REBOOT, + LOCALE_MENU_HINT_RECORD_ALREADY_FOUND_CHECK, LOCALE_MENU_HINT_RECORD_APID_AC3, LOCALE_MENU_HINT_RECORD_APID_ALT, LOCALE_MENU_HINT_RECORD_APID_STD, @@ -1388,6 +1424,8 @@ typedef enum LOCALE_MENU_HINT_SERVICE, LOCALE_MENU_HINT_SERVICE_SCAN, LOCALE_MENU_HINT_SETTINGS, + LOCALE_MENU_HINT_SHOUTCAST_DEV_ID, + LOCALE_MENU_HINT_SHOUTCAST_ENABLED, LOCALE_MENU_HINT_SHOW_MUTE_ICON, LOCALE_MENU_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN_COUNT, @@ -1396,6 +1434,8 @@ typedef enum LOCALE_MENU_HINT_SHUTDOWN_REAL, LOCALE_MENU_HINT_SLEEPTIMER, LOCALE_MENU_HINT_SLEEPTIMER_MIN, + LOCALE_MENU_HINT_SMS_CHANNEL, + LOCALE_MENU_HINT_SMS_MOVIE, LOCALE_MENU_HINT_SOFT_RESTART, LOCALE_MENU_HINT_SOFTUPDATE_CHECK, LOCALE_MENU_HINT_SOFTUPDATE_CHECK_LOCAL, @@ -1413,6 +1453,8 @@ typedef enum LOCALE_MENU_HINT_TIMEOUTS, LOCALE_MENU_HINT_TIMERS, LOCALE_MENU_HINT_TIMEZONE, + LOCALE_MENU_HINT_TMDB_API_KEY, + LOCALE_MENU_HINT_TMDB_ENABLED, LOCALE_MENU_HINT_TOOLS, LOCALE_MENU_HINT_TVMODE, LOCALE_MENU_HINT_TVRADIO_SWITCH, @@ -1426,6 +1468,7 @@ typedef enum LOCALE_MENU_HINT_VFD_DEFAULTS, LOCALE_MENU_HINT_VFD_DIMTIME, LOCALE_MENU_HINT_VFD_INFOLINE, + LOCALE_MENU_HINT_VFD_NOTIFY_RCLOCK, LOCALE_MENU_HINT_VFD_SCROLL, LOCALE_MENU_HINT_VFD_STATUSLINE, LOCALE_MENU_HINT_VIDEO, @@ -1449,6 +1492,8 @@ typedef enum LOCALE_MENU_HINT_VOLUME_SIZE, LOCALE_MENU_HINT_WEBTV_SETUP, LOCALE_MENU_HINT_WINDOW_SIZE, + LOCALE_MENU_HINT_YOUTUBE_DEV_ID, + LOCALE_MENU_HINT_YOUTUBE_ENABLED, LOCALE_MENU_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY_SETUP, LOCALE_MENU_HINT_ZAP_CYCLE, @@ -1527,6 +1572,7 @@ typedef enum LOCALE_MISCSETTINGS_INFOBAR_SHOW_SYSFS_HDD, LOCALE_MISCSETTINGS_INFOBAR_SHOW_TUNER, LOCALE_MISCSETTINGS_INFOCLOCK, + LOCALE_MISCSETTINGS_ONLINESERVICES, LOCALE_MISCSETTINGS_PROGRESSBAR, LOCALE_MISCSETTINGS_PROGRESSBAR_COLOR, LOCALE_MISCSETTINGS_PROGRESSBAR_DESIGN, @@ -1691,9 +1737,11 @@ typedef enum LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, LOCALE_MOVIEBROWSER_INFO_PRODYEAR, LOCALE_MOVIEBROWSER_INFO_QUALITY, + LOCALE_MOVIEBROWSER_INFO_RATING, LOCALE_MOVIEBROWSER_INFO_RECORDDATE, LOCALE_MOVIEBROWSER_INFO_SERIE, LOCALE_MOVIEBROWSER_INFO_SIZE, + LOCALE_MOVIEBROWSER_INFO_SPACER, LOCALE_MOVIEBROWSER_INFO_TITLE, LOCALE_MOVIEBROWSER_INFO_VIDEOFORMAT, LOCALE_MOVIEBROWSER_LAST_PLAY_MAX_ITEMS, @@ -1740,9 +1788,11 @@ typedef enum LOCALE_MOVIEBROWSER_SHORT_PREVPLAYDATE, LOCALE_MOVIEBROWSER_SHORT_PRODYEAR, LOCALE_MOVIEBROWSER_SHORT_QUALITY, + LOCALE_MOVIEBROWSER_SHORT_RATING, LOCALE_MOVIEBROWSER_SHORT_RECORDDATE, LOCALE_MOVIEBROWSER_SHORT_SERIE, LOCALE_MOVIEBROWSER_SHORT_SIZE, + LOCALE_MOVIEBROWSER_SHORT_SPACER, LOCALE_MOVIEBROWSER_SHORT_TITLE, LOCALE_MOVIEBROWSER_START_HEAD, LOCALE_MOVIEBROWSER_START_RECORD_START, @@ -1788,9 +1838,9 @@ typedef enum LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT1, LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT2, LOCALE_MOVIEPLAYER_CHAPTERS, - LOCALE_MOVIEPLAYER_DEFPLUGIN, LOCALE_MOVIEPLAYER_FILEPLAYBACK, LOCALE_MOVIEPLAYER_HEAD, + LOCALE_MOVIEPLAYER_PLUGIN, LOCALE_MOVIEPLAYER_STARTING, LOCALE_MOVIEPLAYER_TITLES, LOCALE_MOVIEPLAYER_TOOMANYBOOKMARKS, @@ -2012,6 +2062,7 @@ typedef enum LOCALE_PINPROTECTION_HEAD, LOCALE_PINPROTECTION_WRONGCODE, LOCALE_PLUGINS_HDD_DIR, + LOCALE_PLUGINS_NO_PLUGIN, LOCALE_PLUGINS_RESULT, LOCALE_PLUGINTYPE_DISABLED, LOCALE_PLUGINTYPE_GAME, @@ -2022,6 +2073,8 @@ typedef enum LOCALE_RCLOCK_LOCKMSG, LOCALE_RCLOCK_TITLE, LOCALE_RCLOCK_UNLOCKMSG, + LOCALE_RECORDING_ALREADY_FOUND, + LOCALE_RECORDING_ALREADY_FOUND_CHECK, LOCALE_RECORDING_IS_RUNNING, LOCALE_RECORDING_START, LOCALE_RECORDING_STARTSTOP_MSG, @@ -2029,6 +2082,7 @@ typedef enum LOCALE_RECORDING_TIME_HOUR, LOCALE_RECORDING_TIME_HOURS, LOCALE_RECORDING_TIME_MIN, + LOCALE_RECORDINGMENU_ALREADY_FOUND_CHECK, LOCALE_RECORDINGMENU_APIDS, LOCALE_RECORDINGMENU_APIDS_AC3, LOCALE_RECORDINGMENU_APIDS_ALT, @@ -2064,6 +2118,12 @@ typedef enum LOCALE_RECORDINGMENU_VTXT_PID, LOCALE_RECORDINGMENU_ZAP_ON_ANNOUNCE, LOCALE_RECORDTIMER_ANNOUNCE, + LOCALE_REMOTEBOX_ADD, + LOCALE_REMOTEBOX_CHANNEL_NA, + LOCALE_REMOTEBOX_DEL, + LOCALE_REMOTEBOX_HEAD, + LOCALE_REMOTEBOX_IP, + LOCALE_REMOTEBOX_MOD, LOCALE_RESET_ALL, LOCALE_RESET_CHANNELS, LOCALE_RESET_CONFIRM, @@ -2233,6 +2293,8 @@ typedef enum LOCALE_SETTINGS_POS_TOP_RIGHT, LOCALE_SETTINGS_RESTORE, LOCALE_SETTINGS_RESTORE_WARN, + LOCALE_SHOUTCAST_DEV_ID, + LOCALE_SHOUTCAST_ENABLED, LOCALE_SHUTDOWN_RECORDING_QUERY, LOCALE_SHUTDOWNTIMER_ANNOUNCE, LOCALE_SLEEPTIMERBOX_ANNOUNCE, @@ -2326,6 +2388,7 @@ typedef enum LOCALE_TIMERLIST_TYPE_NEXTPROGRAM, LOCALE_TIMERLIST_TYPE_RECORD, LOCALE_TIMERLIST_TYPE_REMIND, + LOCALE_TIMERLIST_TYPE_REMOTEBOX, LOCALE_TIMERLIST_TYPE_SHUTDOWN, LOCALE_TIMERLIST_TYPE_SLEEPTIMER, LOCALE_TIMERLIST_TYPE_STANDBY, @@ -2352,6 +2415,9 @@ typedef enum LOCALE_TIMING_MENU, LOCALE_TIMING_NUMERICZAP, LOCALE_TIMING_VOLUMEBAR, + LOCALE_TMDB_API_KEY, + LOCALE_TMDB_ENABLED, + LOCALE_TMDB_READ_DATA, LOCALE_UNICABLE_LNB, LOCALE_UNICABLE_QRG, LOCALE_UNICABLE_SCR, @@ -2370,6 +2436,7 @@ typedef enum LOCALE_USERMENU_BUTTON_RED, LOCALE_USERMENU_BUTTON_YELLOW, LOCALE_USERMENU_HEAD, + LOCALE_USERMENU_ITEM_ADZAP, LOCALE_USERMENU_ITEM_BAR, LOCALE_USERMENU_ITEM_EPG_MISC, LOCALE_USERMENU_ITEM_NONE, @@ -2457,6 +2524,8 @@ typedef enum LOCALE_WIZARD_WELCOME_TEXT, LOCALE_WORD_FROM, LOCALE_WORD_IN, + LOCALE_YOUTUBE_DEV_ID, + LOCALE_YOUTUBE_ENABLED, LOCALE_ZAPIT_SCANTYPE, LOCALE_ZAPIT_SCANTYPE_ALL, LOCALE_ZAPIT_SCANTYPE_RADIO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 33ac965be..2439efe55 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -135,6 +135,15 @@ const char * locale_real_names[] = "GENRE.TRAVEL_HOBBIES.7", "GENRE.UNKNOWN", "adzap", + "adzap.announce", + "adzap.cancel", + "adzap.disable", + "adzap.enable", + "adzap.minute", + "adzap.minutes", + "adzap.monitor", + "adzap.switchback", + "adzap.writedata", "apidselector.head", "audio.srs_algo", "audio.srs_algo_heavy", @@ -273,6 +282,7 @@ const char * locale_real_names[] = "channellist.foot_sort_sat", "channellist.head", "channellist.history", + "channellist.history_clear", "channellist.keep_numbers", "channellist.make_hdlist", "channellist.make_newlist", @@ -350,6 +360,7 @@ const char * locale_real_names[] = "colormenusetup.menucontent", "colormenusetup.menucontent_inactive", "colormenusetup.menucontent_selected", + "colormenusetup.menufoot", "colormenusetup.menuhead", "colorstatusbar.text", "colorthememenu.head", @@ -405,6 +416,7 @@ const char * locale_real_names[] = "epgviewer.length", "epgviewer.nodetailed", "epgviewer.notfound", + "epgviewer.select_screening", "eventfinder.fsk", "eventfinder.genre", "eventfinder.head", @@ -418,6 +430,7 @@ const char * locale_real_names[] = "eventfinder.searching", "eventfinder.start_search", "eventlist.additional", + "eventlist.epgplus", "eventlist.name", "eventlistbar.channelswitch", "eventlistbar.eventsort", @@ -492,6 +505,7 @@ const char * locale_real_names[] = "extra.scrambled_message", "extra.show_mute_icon", "extra.sms_channel", + "extra.sms_movie", "extra.south", "extra.start_tostandby", "extra.temp_timeshift", @@ -744,6 +758,7 @@ const char * locale_real_names[] = "fontsize.infobar_number", "fontsize.infobar_small", "fontsize.menu", + "fontsize.menu_foot", "fontsize.menu_hint", "fontsize.menu_info", "fontsize.menu_title", @@ -792,6 +807,7 @@ const char * locale_real_names[] = "hdd_umount", "hdd_umount_warn", "hdd_umounted", + "imageinfo.api", "imageinfo.creator", "imageinfo.date", "imageinfo.dokumentation", @@ -886,6 +902,7 @@ const char * locale_real_names[] = "lcdmenu.dim_time", "lcdmenu.head", "lcdmenu.lcdcontroler", + "lcdmenu.notify_rclock", "lcdmenu.scroll", "lcdmenu.statusline", "lcdmenu.statusline.both", @@ -903,6 +920,10 @@ const char * locale_real_names[] = "ledcontroler.on.all", "ledcontroler.on.led1", "ledcontroler.on.led2", + "livestream.head", + "livestream.read_data", + "livestream.resolution", + "livestream.scriptpath", "lua.boolparam_deprecated1", "lua.boolparam_deprecated2", "lua.boolparam_deprecated3", @@ -952,9 +973,18 @@ const char * locale_real_names[] = "mainsettings.savesettingsnow_hint", "mainsettings.timezone", "mainsettings.video", + "mbkey.copy_onefile", + "mbkey.copy_several", + "mbkey.cover", + "mbkey.cut", + "mbkey.truncate", "menu.back", "menu.cancel", "menu.hint_a_pic", + "menu.hint_adzap", + "menu.hint_adzap_active", + "menu.hint_adzap_setup", + "menu.hint_adzap_writedata", "menu.hint_aplay", "menu.hint_aplay_setup", "menu.hint_audio", @@ -1037,6 +1067,7 @@ const char * locale_real_names[] = "menu.hint_epg_scan", "menu.hint_epg_scan_mode", "menu.hint_eventlist_additional", + "menu.hint_eventlist_epgplus", "menu.hint_eventlist_fonts", "menu.hint_eventlist_setup", "menu.hint_extended", @@ -1051,6 +1082,8 @@ const char * locale_real_names[] = "menu.hint_font_scaling", "menu.hint_font_ttx", "menu.hint_fonts", + "menu.hint_foot_back", + "menu.hint_foot_textcolor", "menu.hint_games", "menu.hint_hdd", "menu.hint_hdd_apply", @@ -1096,7 +1129,6 @@ const char * locale_real_names[] = "menu.hint_key_bouquetdown", "menu.hint_key_bouquetup", "menu.hint_key_cancel", - "menu.hint_key_channel_sms", "menu.hint_key_channeldown", "menu.hint_key_channellist", "menu.hint_key_channelup", @@ -1109,6 +1141,7 @@ const char * locale_real_names[] = "menu.hint_key_list_start", "menu.hint_key_load", "menu.hint_key_modechange", + "menu.hint_key_moviebrowser", "menu.hint_key_movieplayer", "menu.hint_key_mpaudio", "menu.hint_key_mpbookmark", @@ -1166,6 +1199,7 @@ const char * locale_real_names[] = "menu.hint_make_webtvlist", "menu.hint_manage_settings", "menu.hint_mb", + "menu.hint_mbkey_cover", "menu.hint_media", "menu.hint_menu_fonts", "menu.hint_menu_hints", @@ -1177,6 +1211,7 @@ const char * locale_real_names[] = "menu.hint_misc_epg", "menu.hint_misc_filebrowser", "menu.hint_misc_general", + "menu.hint_misc_onlineservices", "menu.hint_misc_zapit", "menu.hint_movie", "menu.hint_moviebrowser_setup", @@ -1258,6 +1293,7 @@ const char * locale_real_names[] = "menu.hint_protection", "menu.hint_radiomode", "menu.hint_reboot", + "menu.hint_record_already_found_check", "menu.hint_record_apid_ac3", "menu.hint_record_apid_alt", "menu.hint_record_apid_std", @@ -1388,6 +1424,8 @@ const char * locale_real_names[] = "menu.hint_service", "menu.hint_service_scan", "menu.hint_settings", + "menu.hint_shoutcast_dev_id", + "menu.hint_shoutcast_enabled", "menu.hint_show_mute_icon", "menu.hint_shutdown", "menu.hint_shutdown_count", @@ -1396,6 +1434,8 @@ const char * locale_real_names[] = "menu.hint_shutdown_real", "menu.hint_sleeptimer", "menu.hint_sleeptimer_min", + "menu.hint_sms_channel", + "menu.hint_sms_movie", "menu.hint_soft_restart", "menu.hint_softupdate_check", "menu.hint_softupdate_check_local", @@ -1413,6 +1453,8 @@ const char * locale_real_names[] = "menu.hint_timeouts", "menu.hint_timers", "menu.hint_timezone", + "menu.hint_tmdb_api_key", + "menu.hint_tmdb_enabled", "menu.hint_tools", "menu.hint_tvmode", "menu.hint_tvradio_switch", @@ -1426,6 +1468,7 @@ const char * locale_real_names[] = "menu.hint_vfd_defaults", "menu.hint_vfd_dimtime", "menu.hint_vfd_infoline", + "menu.hint_vfd_notify_rclock", "menu.hint_vfd_scroll", "menu.hint_vfd_statusline", "menu.hint_video", @@ -1449,6 +1492,8 @@ const char * locale_real_names[] = "menu.hint_volume_size", "menu.hint_webtv_setup", "menu.hint_window_size", + "menu.hint_youtube_dev_id", + "menu.hint_youtube_enabled", "menu.hint_ytplay", "menu.hint_ytplay_setup", "menu.hint_zap_cycle", @@ -1527,6 +1572,7 @@ const char * locale_real_names[] = "miscsettings.infobar_show_sysfs_hdd", "miscsettings.infobar_show_tuner", "miscsettings.infoclock", + "miscsettings.onlineservices", "miscsettings.progressbar", "miscsettings.progressbar_color", "miscsettings.progressbar_design", @@ -1691,9 +1737,11 @@ const char * locale_real_names[] = "moviebrowser.info_prodcountry", "moviebrowser.info_prodyear", "moviebrowser.info_quality", + "moviebrowser.info_rating", "moviebrowser.info_recorddate", "moviebrowser.info_serie", "moviebrowser.info_size", + "moviebrowser.info_spacer", "moviebrowser.info_title", "moviebrowser.info_videoformat", "moviebrowser.last_play_max_items", @@ -1740,9 +1788,11 @@ const char * locale_real_names[] = "moviebrowser.short_prevplaydate", "moviebrowser.short_prodyear", "moviebrowser.short_quality", + "moviebrowser.short_rating", "moviebrowser.short_recorddate", "moviebrowser.short_serie", "moviebrowser.short_size", + "moviebrowser.short_spacer", "moviebrowser.short_title", "moviebrowser.start_head", "moviebrowser.start_record_start", @@ -1788,9 +1838,9 @@ const char * locale_real_names[] = "movieplayer.bookmarkname_hint1", "movieplayer.bookmarkname_hint2", "movieplayer.chapters", - "movieplayer.defplugin", "movieplayer.fileplayback", "movieplayer.head", + "movieplayer.plugin", "movieplayer.starting", "movieplayer.titles", "movieplayer.toomanybookmarks", @@ -2012,6 +2062,7 @@ const char * locale_real_names[] = "pinprotection.head", "pinprotection.wrongcode", "plugins.hdd_dir", + "plugins.no_plugin", "plugins.result", "plugintype.disabled", "plugintype.game", @@ -2022,6 +2073,8 @@ const char * locale_real_names[] = "rclock.lockmsg", "rclock.title", "rclock.unlockmsg", + "recording.already_found", + "recording.already_found_check", "recording.is_running", "recording.start", "recording.startstop_msg", @@ -2029,6 +2082,7 @@ const char * locale_real_names[] = "recording.time_hour", "recording.time_hours", "recording.time_min", + "recordingmenu.already_found_check", "recordingmenu.apids", "recordingmenu.apids_ac3", "recordingmenu.apids_alt", @@ -2064,6 +2118,12 @@ const char * locale_real_names[] = "recordingmenu.vtxt_pid", "recordingmenu.zap_on_announce", "recordtimer.announce", + "remotebox_add", + "remotebox_channel_na", + "remotebox_del", + "remotebox_head", + "remotebox_ip", + "remotebox_mod", "reset_all", "reset_channels", "reset_confirm", @@ -2233,6 +2293,8 @@ const char * locale_real_names[] = "settings.pos_top_right", "settings.restore", "settings.restore_warn", + "shoutcast.dev_id", + "shoutcast.enabled", "shutdown.recording_query", "shutdowntimer.announce", "sleeptimerbox.announce", @@ -2326,6 +2388,7 @@ const char * locale_real_names[] = "timerlist.type.nextprogram", "timerlist.type.record", "timerlist.type.remind", + "timerlist.type.remotebox", "timerlist.type.shutdown", "timerlist.type.sleeptimer", "timerlist.type.standby", @@ -2352,6 +2415,9 @@ const char * locale_real_names[] = "timing.menu", "timing.numericzap", "timing.volumebar", + "tmdb.api_key", + "tmdb.enabled", + "tmdb.read_data", "unicable.lnb", "unicable.qrg", "unicable.scr", @@ -2370,6 +2436,7 @@ const char * locale_real_names[] = "usermenu.button_red", "usermenu.button_yellow", "usermenu.head", + "usermenu.item_adzap", "usermenu.item_bar", "usermenu.item_epg_misc", "usermenu.item_none", @@ -2457,6 +2524,8 @@ const char * locale_real_names[] = "wizard.welcome_text", "word.from", "word.in", + "youtube.dev_id", + "youtube.enabled", "zapit.scantype", "zapit.scantype.all", "zapit.scantype.radio", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index bc1f8b52f..1700250ac 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -168,12 +168,17 @@ void CColorSetupNotifier::setPalette() convertSetupColor2RGB(t.menu_Content_inactive_Text_red, t.menu_Content_inactive_Text_green, t.menu_Content_inactive_Text_blue), 8, convertSetupAlpha2Alpha(t.menu_Content_inactive_alpha) ); + frameBuffer->paletteGenFade(COL_MENUFOOT, + convertSetupColor2RGB(t.menu_Foot_red, t.menu_Foot_green, t.menu_Foot_blue), + convertSetupColor2RGB(t.menu_Foot_Text_red, t.menu_Foot_Text_green, t.menu_Foot_Text_blue), + 8, convertSetupAlpha2Alpha( t.menu_Foot_alpha ) ); + frameBuffer->paletteGenFade(COL_INFOBAR, convertSetupColor2RGB(t.infobar_red, t.infobar_green, t.infobar_blue), convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue), 8, convertSetupAlpha2Alpha(t.infobar_alpha) ); - frameBuffer->paletteGenFade(COL_INFOBAR_SHADOW, + frameBuffer->paletteGenFade(COL_SHADOW, convertSetupColor2RGB(int(t.infobar_red*0.4), int(t.infobar_green*0.4), int(t.infobar_blue*0.4)), convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue), 8, convertSetupAlpha2Alpha(t.infobar_alpha) ); @@ -204,10 +209,10 @@ void CColorSetupNotifier::setPalette() convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue), convertSetupAlpha2Alpha(t.infobar_alpha)); - // COL_INFOBAR_SHADOW_TEXT + // COL_MENUFOOT_TEXT frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 2, - convertSetupColor2RGB(int(t.infobar_Text_red*0.6), int(t.infobar_Text_green*0.6), int(t.infobar_Text_blue*0.6)), - convertSetupAlpha2Alpha(t.infobar_alpha)); + convertSetupColor2RGB(t.menu_Foot_Text_red, t.menu_Foot_Text_green, t.menu_Foot_Text_blue), + convertSetupAlpha2Alpha(t.menu_Foot_alpha)); // COL_MENUHEAD_TEXT frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 3, @@ -375,12 +380,20 @@ int CNVODChangeExec::exec(CMenuTarget* parent, const std::string & actionKey) int CMoviePluginChangeExec::exec(CMenuTarget* parent, const std::string & actionKey) { - int sel= atoi(actionKey.c_str()); - parent->hide(); - if (sel>=0) + if (parent) + parent->hide(); + + if (actionKey == "---") { - g_settings.movieplayer_plugin=g_PluginList->getName(sel); + g_settings.movieplayer_plugin = actionKey; } + else + { + int sel = atoi(actionKey.c_str()); + if (sel >= 0) + g_settings.movieplayer_plugin = g_PluginList->getName(sel); + } + return menu_return::RETURN_EXIT; } @@ -393,7 +406,7 @@ long CNetAdapter::mac_addr_sys ( u_char *addr) //only for function getMacAddr() int s, i; int ok = 0; s = socket(AF_INET, SOCK_DGRAM, 0); - if (s==-1) + if (s==-1) { return -1; } @@ -405,11 +418,11 @@ long CNetAdapter::mac_addr_sys ( u_char *addr) //only for function getMacAddr() for (i = ifc.ifc_len / sizeof(struct ifreq); --i >= 0; IFR++) { strcpy(ifr.ifr_name, IFR->ifr_name); - if (ioctl(s, SIOCGIFFLAGS, &ifr) == 0) + if (ioctl(s, SIOCGIFFLAGS, &ifr) == 0) { - if (! (ifr.ifr_flags & IFF_LOOPBACK)) + if (! (ifr.ifr_flags & IFF_LOOPBACK)) { - if (ioctl(s, SIOCGIFHWADDR, &ifr) == 0) + if (ioctl(s, SIOCGIFHWADDR, &ifr) == 0) { ok = 1; break; diff --git a/src/system/setting_helpers.h b/src/system/setting_helpers.h index b20649ac4..90134d5e5 100644 --- a/src/system/setting_helpers.h +++ b/src/system/setting_helpers.h @@ -33,6 +33,7 @@ */ +#include #include #include @@ -69,19 +70,16 @@ class COnOffNotifier : public CChangeObserver class CSectionsdConfigNotifier : public CChangeObserver { - public: - bool changeNotify(const neutrino_locale_t, void * ); + public: + bool changeNotify(const neutrino_locale_t, void * ); }; class CTouchFileNotifier : public CChangeObserver { const char * filename; - public: - inline CTouchFileNotifier(const char * file_to_modify) - { - filename = file_to_modify; - }; - bool changeNotify(const neutrino_locale_t, void * data); + public: + inline CTouchFileNotifier(const char * _filename) { filename = _filename; }; + bool changeNotify(const neutrino_locale_t, void * data); }; class CColorSetupNotifier : public CChangeObserver @@ -123,33 +121,38 @@ class CMoviePluginChangeExec : public CMenuTarget class CTZChangeNotifier : public CChangeObserver { -public: - bool changeNotify(const neutrino_locale_t, void * data); + public: + bool changeNotify(const neutrino_locale_t, void * data); }; class CDataResetNotifier : public CMenuTarget { -public: - int exec(CMenuTarget* parent, const std::string& actionKey); + public: + int exec(CMenuTarget* parent, const std::string& actionKey); }; class CFanControlNotifier : public CChangeObserver { -public: - bool changeNotify(const neutrino_locale_t, void * data); - static void setSpeed(unsigned int speed); + public: + bool changeNotify(const neutrino_locale_t, void * data); + static void setSpeed(unsigned int speed); }; class CCpuFreqNotifier : public CChangeObserver { -public: - bool changeNotify(const neutrino_locale_t, void * data); + public: + bool changeNotify(const neutrino_locale_t, void * data); }; class CAutoModeNotifier : public CChangeObserver { -public: - bool changeNotify(const neutrino_locale_t, void * data); + public: + bool changeNotify(const neutrino_locale_t, void * data); }; +//do we need a class? +inline int check_shoutcast_dev_id() { return ((g_settings.shoutcast_dev_id != "XXXXXXXXXXXXXXXX") && !g_settings.shoutcast_dev_id.empty()); } +inline int check_youtube_dev_id() { return ((g_settings.youtube_dev_id != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.youtube_dev_id.empty()); } +inline int check_tmdb_api_key() { return ((g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.tmdb_api_key.empty()); } + #endif diff --git a/src/system/settings.h b/src/system/settings.h index c6776d231..3d26b10d1 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -98,6 +98,16 @@ struct SNeutrinoTheme unsigned char menu_Content_inactive_Text_green; unsigned char menu_Content_inactive_Text_blue; + unsigned char menu_Foot_alpha; + unsigned char menu_Foot_red; + unsigned char menu_Foot_green; + unsigned char menu_Foot_blue; + + unsigned char menu_Foot_Text_alpha; + unsigned char menu_Foot_Text_red; + unsigned char menu_Foot_Text_green; + unsigned char menu_Foot_Text_blue; + int menu_Hint_gradient; int menu_Hint_gradient_direction; int menu_ButtonBar_gradient; @@ -141,6 +151,8 @@ struct SNeutrinoTheme struct SNeutrinoSettings { + std::string version_pseudo; + //video int video_Format; int video_Mode; @@ -198,7 +210,6 @@ 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; @@ -443,7 +454,9 @@ struct SNeutrinoSettings int recording_slow_warning; int recording_startstop_msg; int shutdown_timer_record_type; + std::list timer_remotebox_ip; std::string recording_filename_template; + int recording_already_found_check; int filesystem_is_utf8; // default plugin for ts-movieplayer (red button) @@ -495,6 +508,12 @@ struct SNeutrinoSettings int key_volumeup; int key_volumedown; + int mbkey_copy_onefile; + int mbkey_copy_several; + int mbkey_cut; + int mbkey_truncate; + int mbkey_cover; + int mpkey_rewind; int mpkey_forward; int mpkey_pause; @@ -557,6 +576,7 @@ struct SNeutrinoSettings int window_width; int window_height; int eventlist_additional; + int eventlist_epgplus; int channellist_additional; int channellist_epgtext_align_right; int channellist_progressbar_design; @@ -632,6 +652,7 @@ struct SNeutrinoSettings FONT_TYPE_MENU = 0, FONT_TYPE_MENU_TITLE, FONT_TYPE_MENU_INFO, + FONT_TYPE_MENU_FOOT, FONT_TYPE_EPG_TITLE, FONT_TYPE_EPG_INFO1, FONT_TYPE_EPG_INFO2, @@ -688,6 +709,8 @@ struct SNeutrinoSettings int backlight_standby; int backlight_deepstandby; int lcd_scroll; + int lcd_notify_rclock; + //#define FILESYSTEM_ENCODING_TO_UTF8(a) (g_settings.filesystem_is_utf8 ? (a) : ZapitTools::Latin1_to_UTF8(a).c_str()) #define FILESYSTEM_ENCODING_TO_UTF8(a) (isUTF8(a) ? (a) : ZapitTools::Latin1_to_UTF8(a).c_str()) #define UTF8_TO_FILESYSTEM_ENCODING(a) (g_settings.filesystem_is_utf8 ? (a) : ZapitTools::UTF8_to_Latin1(a).c_str()) @@ -707,6 +730,8 @@ struct SNeutrinoSettings int audioplayer_show_playlist; int audioplayer_enable_sc_metadata; std::string shoutcast_dev_id; + int shoutcast_enabled; + //Filebrowser int filebrowser_showrights; int filebrowser_sortmethod; @@ -715,6 +740,9 @@ struct SNeutrinoSettings //movieplayer int movieplayer_repeat_on; std::string youtube_dev_id; + int youtube_enabled; + std::string tmdb_api_key; + int tmdb_enabled; //zapit setup std::string StartChannelTV; @@ -723,6 +751,10 @@ struct SNeutrinoSettings t_channel_id startchannelradio_id; int uselastchannel; + //adzap + int adzap_zapBackPeriod; + int adzap_writeData; + int power_standby; int hdd_sleep; int hdd_noise; @@ -731,9 +763,13 @@ struct SNeutrinoSettings int hdd_statfs_mode; int zap_cycle; int sms_channel; + int sms_movie; std::string font_file; std::string ttx_font_file; + int livestreamResolution; + std::string livestreamScriptPath; + // USERMENU typedef enum { @@ -778,6 +814,9 @@ struct SNeutrinoSettings ITEM_NETSETTINGS = 29, ITEM_SWUPDATE = 30, + ITEM_LIVESTREAM_RESOLUTION = 31, + ITEM_ADZAP = 32, + ITEM_MAX // MUST be always the last in the list } USER_ITEM; typedef struct { @@ -805,8 +844,6 @@ struct SNeutrinoSettings }; }; -/* some default Values */ - extern const struct personalize_settings_t personalize_settings[SNeutrinoSettings::P_SETTINGS_MAX]; typedef struct time_settings_t @@ -840,20 +877,24 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define DEFAULT_LCD_AUTODIMM 0x00 #define DEFAULT_LCD_SHOW_VOLUME 0x01 -#define CORNER_RADIUS_LARGE 11 -#define CORNER_RADIUS_MID 7 -#define CORNER_RADIUS_SMALL 5 -#define CORNER_RADIUS_MIN 3 +#define CORNER_RADIUS_LARGE 11 +#define CORNER_RADIUS_MID 7 +#define CORNER_RADIUS_SMALL 5 +#define CORNER_RADIUS_MIN 3 +#define CORNER_RADIUS_NONE 0 -#define RADIUS_LARGE (g_settings.rounded_corners ? CORNER_RADIUS_LARGE : 0) -#define RADIUS_MID (g_settings.rounded_corners ? CORNER_RADIUS_MID : 0) -#define RADIUS_SMALL (g_settings.rounded_corners ? CORNER_RADIUS_SMALL : 0) -#define RADIUS_MIN (g_settings.rounded_corners ? CORNER_RADIUS_MIN : 0) +#define RADIUS_LARGE (g_settings.rounded_corners ? CORNER_RADIUS_LARGE : 0) +#define RADIUS_MID (g_settings.rounded_corners ? CORNER_RADIUS_MID : 0) +#define RADIUS_SMALL (g_settings.rounded_corners ? CORNER_RADIUS_SMALL : 0) +#define RADIUS_MIN (g_settings.rounded_corners ? CORNER_RADIUS_MIN : 0) +#define RADIUS_NONE 0 -// shadow -#define SHADOW_OFFSET 6 - -/* end default values */ +// offsets +#define OFFSET_SHADOW 6 +#define OFFSET_INTER 6 +#define OFFSET_INNER_LARGE 20 +#define OFFSET_INNER_MID 10 +#define OFFSET_INNER_SMALL 5 struct SglobalInfo @@ -873,7 +914,6 @@ const int PARENTALLOCK_PROMPT_ONSTART = 1; const int PARENTALLOCK_PROMPT_CHANGETOLOCKED = 2; const int PARENTALLOCK_PROMPT_ONSIGNAL = 3; - class CScanSettings { public: diff --git a/src/system/ytcache.cpp b/src/system/ytcache.cpp index 7e15acf35..64dcb6672 100644 --- a/src/system/ytcache.cpp +++ b/src/system/ytcache.cpp @@ -290,12 +290,13 @@ void cYTCache::cancelAll(MI_MOVIE_INFO::miSource source) if (pending.empty()) return; if (pending.size() > 1) - for (std::vector::iterator it = pending.begin() + 1; it != pending.end();) + for (std::vector::iterator it = pending.begin() + 1; it != pending.end();){ if ((*it).source == source) { failed.push_back(*it); it = pending.erase(it); } else ++it; + } if (pending.front().source != source) return; } diff --git a/src/timerd/timerd.cpp b/src/timerd/timerd.cpp index a9ae4bc52..f113f3dba 100644 --- a/src/timerd/timerd.cpp +++ b/src/timerd/timerd.cpp @@ -303,7 +303,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) CTimerd::TransferRecordingInfo recInfo; CBasicServer::receive_data(connfd, &recInfo, sizeof(CTimerd::TransferRecordingInfo)); - if(recInfo.recordingSafety) + if(recInfo.recordingSafety) { int pre,post; CTimerManager::getInstance()->getRecordingSafety(pre,post); @@ -321,7 +321,9 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) recInfo.apids, msgAddTimer.eventRepeat, msgAddTimer.repeatCount, - recInfo.recordingDir); + recInfo.recordingDir, + recInfo.recordingSafety, + recInfo.autoAdjustToEPG); rspAddTimer.eventID = CTimerManager::getInstance()->addEvent(event); break; diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index ff6757cd0..d9a54e36a 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -814,7 +814,7 @@ CTimerEvent::CTimerEvent( CTimerd::CTimerEventTypes evtype, time_t announcetime, stopTime = stoptime; repeatCount = repeatcount; previousState = CTimerd::TIMERSTATE_SCHEDULED; - +#if 0 //never used time_t diff = 0; time_t mtime = time(NULL); struct tm *tmtime = localtime(&mtime); @@ -832,6 +832,7 @@ CTimerEvent::CTimerEvent( CTimerd::CTimerEventTypes evtype, time_t announcetime, { diff+=3600; } +#endif #if 0 //FIXME EPG vs manual timer ? printf("############## CTimerEvent dst %d -> %d diff %d\n", isdst1, isdst2, diff); alarmTime += diff; @@ -1131,7 +1132,8 @@ CTimerEvent_Record::CTimerEvent_Record(time_t announce_Time, time_t alarm_Time, event_id_t epgID, time_t epg_starttime, unsigned char apids, CTimerd::CTimerEventRepeat evrepeat, - uint32_t repeatcount, const std::string &recDir) : + uint32_t repeatcount, const std::string &recDir, + bool _recordingSafety, bool _autoAdjustToEPG) : CTimerEvent(getEventType(), announce_Time, alarm_Time, stop_Time, evrepeat, repeatcount) { eventInfo.epgID = epgID; @@ -1140,6 +1142,8 @@ CTimerEvent_Record::CTimerEvent_Record(time_t announce_Time, time_t alarm_Time, eventInfo.apids = apids; recordingDir = recDir; epgTitle=""; + autoAdjustToEPG = _autoAdjustToEPG; + recordingSafety = _recordingSafety; CShortEPGData epgdata; if (CEitManager::getInstance()->getEPGidShort(epgID, &epgdata)) epgTitle=epgdata.title; @@ -1169,11 +1173,19 @@ CTimerEvent_Record::CTimerEvent_Record(CConfigFile *config, int iId): epgTitle = config->getString("EPG_TITLE_"+id); dprintf("read EPG_TITLE_%s %s (%p)\n",id.c_str(),epgTitle.c_str(),&epgTitle); + + recordingSafety = config->getInt32("RECORDING_SAFETY_"+id, true); + dprintf("read RECORDING_SAFETY_%s %d\n",id.c_str(), recordingSafety); + + autoAdjustToEPG = config->getInt32("EPG_AUTO_ADJUST_"+id, true); + dprintf("read EPG_AUTO_ADJUST_TO_EPG_%s %d\n",id.c_str(), autoAdjustToEPG); } //------------------------------------------------------------ void CTimerEvent_Record::fireEvent() { - Refresh(); + if (adjustToCurrentEPG()) + return; + getEpgId(); CTimerd::RecordingInfo ri=eventInfo; ri.eventID=eventID; strcpy(ri.recordingDir, recordingDir.substr(0,sizeof(ri.recordingDir)-1).c_str()); @@ -1187,6 +1199,8 @@ void CTimerEvent_Record::fireEvent() //------------------------------------------------------------ void CTimerEvent_Record::announceEvent() { + if (adjustToCurrentEPG()) + return; Refresh(); CTimerd::RecordingInfo ri=eventInfo; ri.eventID=eventID; @@ -1235,11 +1249,17 @@ void CTimerEvent_Record::saveToConfig(CConfigFile *config) config->setString("EPG_TITLE_"+id,epgTitle); dprintf("set EPG_TITLE_%s to %s (%p)\n",id.c_str(),epgTitle.c_str(), &epgTitle); + + config->setInt32("RECORDING_SAFETY_"+id, recordingSafety); + dprintf("set RECORDING_SAFETY_%s to %d\n",id.c_str(), recordingSafety); + + config->setInt32("EPG_AUTO_ADJUST_"+id, autoAdjustToEPG); + dprintf("set EPG_AUTO_ADJUST_TO_EPG_%s to %d\n",id.c_str(), autoAdjustToEPG); } //------------------------------------------------------------ void CTimerEvent_Record::Reschedule() { - // clear epgId on reschedule + // clear epgID on reschedule eventInfo.epgID = 0; eventInfo.epg_starttime = 0; epgTitle=""; @@ -1276,6 +1296,47 @@ void CTimerEvent_Record::Refresh() if (eventInfo.epgID == 0) getEpgId(); } +//------------------------------------------------------------ +bool CTimerEvent_Record::adjustToCurrentEPG() +{ + if (!autoAdjustToEPG) + return false; + + CChannelEventList evtlist; + CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id, evtlist); + + time_t now = time(NULL); + CChannelEventList::iterator first = evtlist.end(); + for (CChannelEventList::iterator e = evtlist.begin(); e != evtlist.end(); ++e) + { + if (e->startTime < now) + continue; + if (first == evtlist.end() || first->startTime > e->startTime) + first = e; + if (alarmTime <= e->startTime && e->startTime + (int)e->duration <= stopTime) + return false; + } + if (first == evtlist.end()) + return false; + + time_t _announceTime = first->startTime - (alarmTime - announceTime); + time_t _alarmTime = first->startTime; + time_t _stopTime = first->startTime + first->duration; + if (recordingSafety) { + int pre, post; + CTimerManager::getInstance()->getRecordingSafety(pre, post); + _alarmTime -= pre; + _stopTime += post; + } + + CTimerEvent_Record *event= new CTimerEvent_Record(_announceTime, _alarmTime, _stopTime, + eventInfo.channel_id, eventInfo.epgID, first->startTime, eventInfo.apids, + CTimerd::TIMERREPEAT_ONCE, 1, recordingDir, recordingSafety, autoAdjustToEPG); + CTimerManager::getInstance()->addEvent(event,false); + setState(CTimerd::TIMERSTATE_HASFINISHED); + + return true; +} //============================================================= // Zapto Event //============================================================= @@ -1294,9 +1355,6 @@ 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/timerd/timermanager.h b/src/timerd/timermanager.h index 7d9a18b22..188751e45 100644 --- a/src/timerd/timermanager.h +++ b/src/timerd/timermanager.h @@ -117,13 +117,16 @@ class CTimerEvent_Record : public CTimerEvent CTimerd::EventInfo eventInfo; std::string recordingDir; std::string epgTitle; + bool recordingSafety; + bool autoAdjustToEPG; CTimerEvent_Record(time_t announceTime, time_t alarmTime, time_t stopTime, t_channel_id channel_id, event_id_t epgID = 0, time_t epg_starttime = 0, unsigned char apids = TIMERD_APIDS_STD, CTimerd::CTimerEventRepeat evrepeat = CTimerd::TIMERREPEAT_ONCE, - uint32_t repeatcount = 1, const std::string &recDir = ""); + uint32_t repeatcount = 1, const std::string &recDir = "", + bool _recordingSafety = true, bool _autoAdjustToEPG = true); CTimerEvent_Record(CConfigFile *config, int iId); virtual ~CTimerEvent_Record(){}; virtual CTimerd::CTimerEventTypes getEventType(void) const { return CTimerd::TIMER_RECORD; }; @@ -134,6 +137,7 @@ class CTimerEvent_Record : public CTimerEvent virtual void Reschedule(); virtual void getEpgId(); virtual void Refresh(); + virtual bool adjustToCurrentEPG(); }; class CTimerEvent_Zapto : public CTimerEvent_Record diff --git a/src/zapit/include/zapit/bouquets.h b/src/zapit/include/zapit/bouquets.h index 007133a45..6c885a562 100644 --- a/src/zapit/include/zapit/bouquets.h +++ b/src/zapit/include/zapit/bouquets.h @@ -98,7 +98,10 @@ class CBouquetManager void writeBouquetChannels (FILE * bouq_fd, uint32_t i, bool bUser = false); void writeChannels(FILE * bouq_fd, ZapitChannelList &list, bool bUser); void writeBouquet(FILE * bouq_fd, uint32_t i, bool bUser); - + //remap epg_id + std::map EpgIDMapping; + void readEPGMapping(); + t_channel_id reMapEpgID(t_channel_id channelid); public: CBouquetManager() { remainChannels = NULL; }; ~CBouquetManager(); diff --git a/src/zapit/include/zapit/channel.h b/src/zapit/include/zapit/channel.h index 25702d659..30f1b5a83 100644 --- a/src/zapit/include/zapit/channel.h +++ b/src/zapit/include/zapit/channel.h @@ -120,6 +120,8 @@ class CZapitChannel private: /* channel name */ std::string name; + /* scripts for webtv livestreams */ + std::string script; /* TODO : Enable different unames in different bouquets ( generated bouquetID ? ) */ std::string uname; t_channel_id epg_id; @@ -174,7 +176,6 @@ class CZapitChannel void Init(); friend class CChannelList; - t_channel_id channel_id; public: typedef enum channel_flags { @@ -196,6 +197,7 @@ class CZapitChannel int number; CChannelEvent currentEvent,nextEvent; int type; + t_channel_id channel_id; unsigned char scrambled; char * pname; bool has_bouquet; @@ -205,15 +207,16 @@ class CZapitChannel freq_id_t freq; /* constructor, desctructor */ - CZapitChannel(const std::string & p_name, t_service_id p_sid, t_transport_stream_id p_tsid, t_original_network_id p_onid, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t freq); - CZapitChannel(const std::string & p_name, t_channel_id p_channel_id, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t p_freq); - CZapitChannel(const char *p_name, t_channel_id p_channel_id, const char *p_url, const char *p_desc, t_channel_id epgid = 0); + CZapitChannel(const std::string & p_name, t_service_id p_sid, t_transport_stream_id p_tsid, t_original_network_id p_onid, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t freq, const std::string script_name=""); + CZapitChannel(const std::string & p_name, t_channel_id p_channel_id, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t p_freq, const std::string script_name=""); + CZapitChannel(const char *p_name, t_channel_id p_channel_id, const char *p_url, const char *p_desc, t_channel_id epgid = 0, const char* script_name=NULL); ~CZapitChannel(void); /* get methods - read only variables */ t_service_id getServiceId(void) const { return service_id; } t_transport_stream_id getTransportStreamId(void) const { return transport_stream_id; } t_original_network_id getOriginalNetworkId(void) const { return original_network_id; } + std::string getScriptName(void) const { return script; } unsigned char getServiceType(bool real=false); bool isHD(); t_channel_id getChannelID(void) const { return channel_id; } @@ -287,6 +290,7 @@ class CZapitChannel }; bool Locked() { return (bLocked || !!bLockCount); } t_channel_id getEpgID(void) const { return epg_id; } + void setEPGid(t_channel_id pEPGid) { epg_id = pEPGid; } //remap epg_id }; struct CmpChannelBySat: public std::binary_function diff --git a/src/zapit/include/zapit/getservices.h b/src/zapit/include/zapit/getservices.h index 2aa4616c2..780b525c0 100644 --- a/src/zapit/include/zapit/getservices.h +++ b/src/zapit/include/zapit/getservices.h @@ -107,7 +107,7 @@ class CServiceManager ~CServiceManager(); static CServiceManager * getInstance(); - static void CopyFile(char * from, char * to); + static void CopyFile(const char * from, const char * to); bool InitSatPosition(t_satellite_position position, const char * name = NULL, bool force = false, delivery_system_t delsys = DVB_S, uint16_t nid = 0); bool LoadServices(bool only_current); diff --git a/src/zapit/src/Makefile.am b/src/zapit/src/Makefile.am index 9ece8df27..a1dac17bc 100644 --- a/src/zapit/src/Makefile.am +++ b/src/zapit/src/Makefile.am @@ -10,6 +10,7 @@ AM_CPPFLAGS += \ -I$(top_srcdir)/lib/connection \ -I$(top_srcdir)/lib/libeventserver \ -I$(top_srcdir)/lib/xmltree \ + @FREETYPE_CFLAGS@ \ @HWLIB_CFLAGS@ noinst_LIBRARIES = libzapit.a diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index 8f69e0702..c5cc7e0ec 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -387,6 +387,10 @@ void CBouquetManager::parseBouquetsXml(const char *fname, bool bUser) xmlNodePtr channel_node; if (search) { + if(!bUser){ + readEPGMapping(); + } + t_original_network_id original_network_id; t_service_id service_id; t_transport_stream_id transport_stream_id; @@ -448,6 +452,10 @@ void CBouquetManager::parseBouquetsXml(const char *fname, bool bUser) chan->pname = (char *) newBouquet->Name.c_str(); chan->bLocked = clock; chan->bUseCI = newBouquet->bUseCI; + //remapinng epg_id + t_channel_id new_epgid = reMapEpgID(chan->getChannelID()); + if(new_epgid) + chan->setEPGid(new_epgid); newBouquet->addService(chan); } else if (bUser) { @@ -483,6 +491,9 @@ void CBouquetManager::parseBouquetsXml(const char *fname, bool bUser) search = xmlNextNode(search); } INFO("total: %d bouquets", (int)Bouquets.size()); + if(!bUser && !EpgIDMapping.empty()){ + EpgIDMapping.clear(); + } } xmlFreeDoc(parser); } @@ -826,6 +837,7 @@ void CBouquetManager::loadWebtv() const char *desc = xmlGetAttribute(l1, "description"); const char *genre = xmlGetAttribute(l1, "genre"); const char *epgid = xmlGetAttribute(l1, "epgid"); + const char *script = xmlGetAttribute(l1, "script"); t_channel_id epg_id = 0; if (epgid) epg_id = strtoull(epgid, NULL, 16); @@ -838,7 +850,7 @@ void CBouquetManager::loadWebtv() } if (title && url) { t_channel_id chid = create_channel_id64(0, 0, 0, 0, 0, url); - CZapitChannel * channel = new CZapitChannel(title, chid, url, desc, epg_id); + CZapitChannel * channel = new CZapitChannel(title, chid, url, desc, epg_id, script); CServiceManager::getInstance()->AddChannel(channel); channel->flags = CZapitChannel::UPDATED; if (gbouquet) @@ -928,3 +940,47 @@ int CBouquetManager::ChannelIterator::getNrofFirstChannelofBouquet(const unsigne return i; } + +t_channel_id CBouquetManager::reMapEpgID(t_channel_id channelid) +{ + if(!EpgIDMapping.empty()){ + std::map::iterator it = EpgIDMapping.find(channelid); + if ( it != EpgIDMapping.end() ) + return it->second; + } + return 0; +} + +void CBouquetManager::readEPGMapping() +{ + if(!EpgIDMapping.empty()) + EpgIDMapping.clear(); + + const std::string epg_map_dir = CONFIGDIR "/zapit/epgmap.xml"; + xmlDocPtr epgmap_parser = parseXmlFile(epg_map_dir.c_str()); + + if (epgmap_parser != NULL) + { + + xmlNodePtr epgmap = xmlDocGetRootElement(epgmap_parser); + if(epgmap) + epgmap = xmlChildrenNode(epgmap); + + while (epgmap) { + const char *cannelid = xmlGetAttribute(epgmap, "channel_id"); + const char *epgid = xmlGetAttribute(epgmap, "new_epg_id"); + t_channel_id epg_id = 0; + t_channel_id chid = 0; + if (epgid) + epg_id = strtoull(epgid, NULL, 16); + if (cannelid) + chid = strtoull(cannelid, NULL, 16); + if(chid && epg_id){ + EpgIDMapping[chid]=epg_id; + } + + epgmap = xmlNextNode(epgmap); + } + } + xmlFreeDoc(epgmap_parser); +} diff --git a/src/zapit/src/channel.cpp b/src/zapit/src/channel.cpp index 45c98b476..2c5f28157 100644 --- a/src/zapit/src/channel.cpp +++ b/src/zapit/src/channel.cpp @@ -27,7 +27,7 @@ extern Zapit_config zapitCfg; -CZapitChannel::CZapitChannel(const std::string & p_name, t_service_id p_sid, t_transport_stream_id p_tsid, t_original_network_id p_onid, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t p_freq) +CZapitChannel::CZapitChannel(const std::string & p_name, t_service_id p_sid, t_transport_stream_id p_tsid, t_original_network_id p_onid, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t p_freq, const std::string script_name) { name = p_name; service_id = p_sid; @@ -38,11 +38,12 @@ CZapitChannel::CZapitChannel(const std::string & p_name, t_service_id p_sid, t_t freq = p_freq; channel_id = CREATE_CHANNEL_ID64; epg_id = channel_id; + script = script_name; Init(); //printf("NEW CHANNEL %s %x\n", name.c_str(), (int) this); } -CZapitChannel::CZapitChannel(const std::string & p_name, t_channel_id p_channel_id, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t p_freq) +CZapitChannel::CZapitChannel(const std::string & p_name, t_channel_id p_channel_id, unsigned char p_service_type, t_satellite_position p_satellite_position, freq_id_t p_freq, const std::string script_name) { name = p_name; channel_id = p_channel_id; @@ -53,11 +54,12 @@ CZapitChannel::CZapitChannel(const std::string & p_name, t_channel_id p_channel_ satellitePosition = p_satellite_position; freq = p_freq; epg_id = channel_id; + script = script_name; Init(); } // For WebTV ... -CZapitChannel::CZapitChannel(const char *p_name, t_channel_id p_channel_id, const char *p_url, const char *p_desc, t_channel_id epgid) +CZapitChannel::CZapitChannel(const char *p_name, t_channel_id p_channel_id, const char *p_url, const char *p_desc, t_channel_id epgid, const char* script_name) { if (!p_name || !p_url) return; @@ -73,6 +75,10 @@ CZapitChannel::CZapitChannel(const char *p_name, t_channel_id p_channel_id, cons satellitePosition = 0; freq = 0; epg_id = epgid; + if (script_name) + script = std::string(script_name); + else + script = ""; Init(); } diff --git a/src/zapit/src/fastscan.cpp b/src/zapit/src/fastscan.cpp index 9199e1cb1..e91034db0 100644 --- a/src/zapit/src/fastscan.cpp +++ b/src/zapit/src/fastscan.cpp @@ -336,7 +336,7 @@ bool CServiceScan::ReadFst(unsigned short pid, unsigned short operator_id, bool cDemux * dmx = new cDemux(); dmx->Open(DMX_PSI_CHANNEL); - if (dmx->sectionFilter(pid, filter, mask, 3, 3000) < 0) { + if (!dmx->sectionFilter(pid, filter, mask, 3, 3000)) { delete dmx; return false; } @@ -586,7 +586,7 @@ bool CServiceScan::ParseFnt(unsigned short pid, unsigned short operator_id) mask[0] = mask[1] = mask[2] = 0xFF; printf("[FNT] scaning pid %d operator %d\n", pid, operator_id); - if (dmx->sectionFilter(pid, filter, mask, 3, 3000) < 0) { + if (!dmx->sectionFilter(pid, filter, mask, 3, 3000)) { delete dmx; return false; } diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index c7ae0f909..a9544bb73 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -33,6 +33,7 @@ #include #include #include +#include //#define SAVE_DEBUG @@ -516,7 +517,6 @@ void CServiceManager::ParseChannels(xmlNodePtr node, const t_transport_stream_id channel->flags = flags; channel->scrambled = scrambled; channel->polarization = polarization; - service_type = channel->getServiceType(); if(pmtpid != 0 && (((channel->getServiceType() == ST_DIGITAL_RADIO_SOUND_SERVICE) && (apid > 0)) || ( (channel->getServiceType() == ST_DIGITAL_TELEVISION_SERVICE) && (vpid > 0) && (apid > 0))) ) { DBG("[getserv] preset chan %s vpid %X sid %X tpid %X onid %X\n", name.c_str(), vpid, service_id, transport_stream_id, transport_stream_id); @@ -974,13 +974,17 @@ do_current: return true; } -void CServiceManager::CopyFile(char * from, char * to) +void CServiceManager::CopyFile(const char * from, const char * to) { - char cmd[256] = "cp -f "; - strcat(cmd, from); - strcat(cmd, " "); - strcat(cmd, to); - system(cmd); + std::ifstream in(from, std::ios::in | std::ios::binary); + if(in.good()){ + std::ofstream out(to, std::ios::out | std::ios::binary); + if(out.good()){ + out << in.rdbuf(); + out.close(); + } + in.close(); + } // sync(); } diff --git a/src/zapit/src/pat.cpp b/src/zapit/src/pat.cpp index 82588a9c3..9f3fd6d3f 100644 --- a/src/zapit/src/pat.cpp +++ b/src/zapit/src/pat.cpp @@ -70,7 +70,7 @@ bool CPat::Parse() do { /* set filter for program association section */ /* read section */ - if ((dmx->sectionFilter(0, filter, mask, 5) < 0) || (i = dmx->Read(buffer, PAT_SECTION_SIZE) < 0)) + if ((!dmx->sectionFilter(0, filter, mask, 5)) || (i = dmx->Read(buffer, PAT_SECTION_SIZE) < 0)) { delete dmx; printf("[pat.cpp] dmx read failed\n"); diff --git a/src/zapit/src/scanbat.cpp b/src/zapit/src/scanbat.cpp index 7be4e1529..49e731568 100644 --- a/src/zapit/src/scanbat.cpp +++ b/src/zapit/src/scanbat.cpp @@ -99,7 +99,7 @@ bool CBat::Read() filter[0] = 0x4A; mask[0] = 0xFF; - if (dmx->sectionFilter(0x11, filter, mask, flen) < 0) { + if (!dmx->sectionFilter(0x11, filter, mask, flen)) { delete dmx; return false; } diff --git a/src/zapit/src/scannit.cpp b/src/zapit/src/scannit.cpp index f0b3cd903..cb7a81b0b 100644 --- a/src/zapit/src/scannit.cpp +++ b/src/zapit/src/scannit.cpp @@ -108,7 +108,7 @@ bool CNit::Read() flen = 3; } - if (dmx->sectionFilter(0x10, filter, mask, flen) < 0) { + if (!dmx->sectionFilter(0x10, filter, mask, flen)) { delete dmx; #ifdef DEBUG_NIT printf("[NIT] filter failed\n"); diff --git a/src/zapit/src/scanpmt.cpp b/src/zapit/src/scanpmt.cpp index 0f95917ea..b9a818630 100644 --- a/src/zapit/src/scanpmt.cpp +++ b/src/zapit/src/scanpmt.cpp @@ -73,7 +73,7 @@ bool CPmt::Read(unsigned short pid, unsigned short sid) mask[2] = 0xFF; mask[3] = 0x01; mask[4] = 0xFF; - if ((dmx->sectionFilter(pid, filter, mask, 5) < 0) || (dmx->Read(buffer, PMT_SECTION_SIZE) < 0)) { + if ((!dmx->sectionFilter(pid, filter, mask, 5)) || (dmx->Read(buffer, PMT_SECTION_SIZE) < 0)) { printf("CPmt::Read: pid %x failed\n", pid); ret = false; } diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index e16b0559a..f2af9fdea 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -77,6 +77,8 @@ #include #include +#include + #ifdef PEDANTIC_VALGRIND_SETUP #define VALGRIND_PARANOIA(x) memset(&x, 0, sizeof(x)) #else @@ -513,8 +515,14 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay } INFO("[zapit] zap to %s (%" PRIx64 " tp %" PRIx64 ")", newchannel->getName().c_str(), newchannel->getChannelID(), newchannel->getTransponderId()); + if (!firstzap && current_channel) + SaveChannelPids(current_channel); + + /* firstzap right now does nothing but control saving the audio channel */ + firstzap = false; if (IS_WEBTV(newchannel->getChannelID()) && !newchannel->getUrl().empty()) { + dvbsub_stop(); if (!IS_WEBTV(live_channel_id)) CCamManager::getInstance()->Stop(live_channel_id, CCamManager::PLAY); @@ -548,12 +556,6 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay return false; } sig_delay = 2; - if (!firstzap && current_channel) - SaveChannelPids(current_channel); - - /* firstzap right now does nothing but control saving the audio channel */ - firstzap = false; - pmt_stop_update_filter(&pmt_update_fd); /* stop playback on the old frontend... */ @@ -1713,14 +1715,13 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) } break; } -#if 0 case CZapitMessages::CMD_SET_VIDEO_SYSTEM: { CZapitMessages::commandInt msg; CBasicServer::receive_data(connfd, &msg, sizeof(msg)); videoDecoder->SetVideoSystem(msg.val); + CNeutrinoApp::getInstance()->g_settings_video_Mode(msg.val); break; } -#endif #if 0 case CZapitMessages::CMD_SET_NTSC: { videoDecoder->SetVideoSystem(8); @@ -2790,7 +2791,7 @@ bool CZapitSdtMonitor::Stop() void CZapitSdtMonitor::run() { - time_t /*tstart,*/ tcur, wtime = 0; + time_t /*tstart,*/ tcur = 0, wtime = 0; t_transport_stream_id transport_stream_id = 0; t_original_network_id original_network_id = 0; t_satellite_position satellitePosition = 0; @@ -2798,7 +2799,6 @@ void CZapitSdtMonitor::run() transponder_id_t tpid = 0; set_threadname("zap:sdtmonitor"); - tcur = time(0); //tstart = time(0); sdt_tp.clear(); printf("[zapit] sdt monitor started\n"); diff --git a/version_pseudo.h b/version_pseudo.h new file mode 100644 index 000000000..56e5e0b75 --- /dev/null +++ b/version_pseudo.h @@ -0,0 +1 @@ +#define NEUTRINO_VERSION_PSEUDO "20160226110000"