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/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 efe194f66..489249e48 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 @@ -809,7 +824,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 @@ -877,6 +892,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: @@ -926,9 +945,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 @@ -1011,6 +1039,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 @@ -1025,6 +1054,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 @@ -1070,7 +1101,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 @@ -1083,6 +1113,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 @@ -1107,7 +1138,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 @@ -1140,6 +1171,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' @@ -1151,6 +1183,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 @@ -1232,6 +1265,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,7 +1395,9 @@ menu.hint_selected_back Ändern Sie die Hintergrundfarbe für ausgewählte Fenst menu.hint_selected_text Ändern Sie die Textfarbe für ausgewählte Fensterinhalte 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_settings Konfigurieren von Neutrino-HD,\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 @@ -1370,7 +1406,9 @@ 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_soft_restart Neustarten von Neutrino, ohne die Box neu zu starten +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-HD, 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 menu.hint_softupdate_createimage_menu Sicherung der aktuellen Software inklusive aller Einstellungen @@ -1387,6 +1425,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 @@ -1424,7 +1464,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 @@ -1502,6 +1544,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 @@ -1666,6 +1709,7 @@ 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) @@ -1700,7 +1744,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 @@ -1715,6 +1759,7 @@ 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 @@ -1737,7 +1782,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 @@ -1763,9 +1808,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. @@ -1782,7 +1827,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 @@ -1987,6 +2032,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 @@ -1998,6 +2044,8 @@ rclock.lockmsg Die Fernbedienung wird gesperrt.\nUm die Sperre aufzuheben, bitte rclock.menueadd FB sperren 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 @@ -2005,6 +2053,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. @@ -2209,6 +2258,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? @@ -2328,6 +2379,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 @@ -2346,6 +2400,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) @@ -2361,7 +2416,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 @@ -2433,6 +2488,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 c0a22d00b..b2ec90954 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 @@ -809,7 +824,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 @@ -877,6 +892,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. @@ -926,9 +945,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 @@ -1011,6 +1039,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 @@ -1025,6 +1054,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 @@ -1070,7 +1101,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 @@ -1083,6 +1113,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 @@ -1107,7 +1138,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 @@ -1140,6 +1171,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 @@ -1151,6 +1183,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. @@ -1232,6 +1265,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,7 +1395,9 @@ menu.hint_selected_back Change selected item background color 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_settings Configure Neutrino-HD\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 @@ -1370,7 +1406,9 @@ 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_soft_restart Restart Neutrino without reboot +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-HD 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 menu.hint_softupdate_createimage_menu Backup of current software, including all settings @@ -1387,6 +1425,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 @@ -1424,7 +1464,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 @@ -1502,6 +1544,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 @@ -1666,6 +1709,7 @@ 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) @@ -1715,6 +1759,7 @@ 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 @@ -1737,7 +1782,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 @@ -1763,9 +1808,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. @@ -1782,7 +1827,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 @@ -1987,6 +2032,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 @@ -1997,6 +2043,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 @@ -2004,6 +2052,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 @@ -2208,6 +2257,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 ? @@ -2327,6 +2378,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 @@ -2345,6 +2399,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) @@ -2360,7 +2415,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 @@ -2432,6 +2487,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..ec6dd12e7 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -2196,6 +2196,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..a4138edb1 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,42 @@ 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.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 +788,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 +796,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 +814,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 +835,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 +844,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 +898,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 +967,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 +1020,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 +1056,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 +1093,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 +1104,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 +1123,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 +1137,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 +1185,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 @@ -1199,76 +1229,76 @@ menu.hint_other_fonts Zmena veľkostí ďaľšieho písma 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_parentallock_prompt Konfigurácia keď sa Neutrino-HD opýta na PIN kód +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 +1307,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 +1317,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 +1325,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 +1339,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 +1355,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 +1366,47 @@ 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_settings Konfigurácia Neutrino, sieť, zvuk, obraz, OSD a iné +menu.hint_service_scan Automatické / manuálne vyhľadávanie staníc, FastScan, Test signálu +menu.hint_settings Konfigurácia Neutrino-HD, 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_soft_restart Reštartovanie Neutrino bez rebootu +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-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 +1414,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 +1440,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 +1539,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 +1552,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 +1616,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 +1645,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 +1676,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 +1715,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 +1738,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 +1769,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 +1785,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 +1803,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 +1930,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 +1966,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 +1980,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 +1988,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 +2003,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 +2088,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 +2116,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 +2141,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 +2156,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 +2170,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 +2258,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 +2317,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 +2353,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 +2370,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 +2413,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 +2449,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/libcoolstream/playback_cs.h b/lib/libcoolstream/playback_cs.h index 8be1ba391..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); 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 8480ed0aa..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); 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 a3c8966ee..5eccb6e52 100644 --- a/lib/libdvbsub/dvbsubtitle.cpp +++ b/lib/libdvbsub/dvbsubtitle.cpp @@ -134,8 +134,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; -#endif + int xf = int(xc * (double) 720); for (i = 0; i < Count(); i++) { uint32_t * colors = (uint32_t *) sub.rects[i]->pict.data[1]; @@ -144,15 +143,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; } @@ -383,7 +382,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..7a106dba0 100644 --- a/lib/timerdclient/timerdclient.cpp +++ b/lib/timerdclient/timerdclient.cpp @@ -35,6 +35,7 @@ #endif int CTimerdClient::adzap_eventID = 0; + unsigned char CTimerdClient::getVersion () const { return CTimerdMsg::ACTVERSION; @@ -306,11 +307,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 +326,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; @@ -380,18 +375,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..212f94cfa 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 @@ -153,18 +152,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..7e5146771 100644 --- a/lib/timerdclient/timerdtypes.h +++ b/lib/timerdclient/timerdtypes.h @@ -68,8 +68,7 @@ class CTimerd TIMER_REMIND, TIMER_SLEEPTIMER, TIMER_EXEC_PLUGIN, - TIMER_IMMEDIATE_RECORD, - TIMER_ADZAP + TIMER_IMMEDIATE_RECORD }; enum CTimerEventStates diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index 9847f008a..fb1217975 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,37 @@ 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... +/* merge conflict */ +#if 0 /* getISO639Description returns same pointer as input if nothing is found */ if (current_PIDs.APIDs[count].desc != iso) strcpy(current_PIDs.APIDs[count].desc, iso); +#else + tmp_desc = getISO639Description( current_PIDs.APIDs[count].desc ); +#endif } 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 +565,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 ddcb58c26..a4eb905c1 100644 --- a/src/driver/audiodec/ffmpegdec.cpp +++ b/src/driver/audiodec/ffmpegdec.cpp @@ -297,7 +297,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/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 d5a6a6ad3..e7c7ad682 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -733,6 +733,8 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co if (!getActive()) return NULL; + checkFbArea(x, y, dx, dy, true); + fb_pixel_t MASK = 0xFFFFFFFF; int _dx = dx; int w_align; @@ -757,8 +759,10 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co #endif fb_pixel_t* boxBuf = paintBoxRel2Buf(_dx, dy, w_align, offs_align, MASK, NULL, radius, type); - if (boxBuf == NULL) + 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; @@ -789,16 +793,21 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co } } - if ((gradientData->mode & pbrg_noPaint) == pbrg_noPaint) + if ((gradientData->mode & pbrg_noPaint) == pbrg_noPaint) { + checkFbArea(x, y, dx, dy, false); return boxBuf; + } 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; } @@ -1004,6 +1013,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; @@ -1011,6 +1032,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; @@ -1097,11 +1122,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); @@ -1120,9 +1141,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); @@ -2006,8 +2025,6 @@ void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t uint32_t xc = (width > xRes) ? (uint32_t)xRes : width; uint32_t yc = (height > yRes) ? (uint32_t)yRes : height; - checkFbArea(xoff, yoff, xc, yc, true); - #if defined(FB_HW_ACCELERATION) if (!(width%4)) { fb_image image; @@ -2020,7 +2037,6 @@ void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t 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); - checkFbArea(xoff, yoff, xc, yc, false); 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); @@ -2036,7 +2052,6 @@ void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t _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(); - checkFbArea(xoff, yoff, xc, yc, false); 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); @@ -2057,7 +2072,6 @@ void CFrameBuffer::blitBox2FB(const fb_pixel_t* boxBuf, uint32_t width, uint32_t fbp += swidth; line++; } - checkFbArea(xoff, yoff, xc, yc, 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) @@ -2153,6 +2167,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) { @@ -2162,10 +2178,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 d0d1adc79..e97401452 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -228,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..965b89f8f 100644 --- a/src/driver/neutrinofonts.h +++ b/src/driver/neutrinofonts.h @@ -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 d1eb5417c..d65043848 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -882,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 ); } @@ -1182,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..c7b928227 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -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; @@ -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,9 +1892,8 @@ 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++) { @@ -1929,7 +1939,7 @@ void CStreamRec::FillMovieInfo(CZapitChannel * channel, APIDList & apid_list) recMovieInfo->epgVideoPid = 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->epgVideoPid); } } } @@ -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..73bf1d064 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -56,7 +56,9 @@ #include #include #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,17 +163,27 @@ void CStreamInstance::RemoveClient(int clientfd) printf("CStreamInstance::RemoveClient: %d (count %d)\n", clientfd, (int)fds.size()); } -void CStreamInstance::run() +bool CStreamInstance::Open() { +#if 0 printf("CStreamInstance::run: %" PRIx64 "\n", channel_id); set_threadname("n:streaminstance"); +#endif + CZapitChannel * tmpchan = CServiceManager::getInstance()->FindChannel(channel_id); if (!tmpchan) - return; + return false; dmx = new cDemux(tmpchan->getRecordDemux());//FIXME - dmx->Open(DMX_TP_CHANNEL, NULL, DMX_BUFFER_SIZE); + if(!dmx) + return false; + return dmx->Open(DMX_TP_CHANNEL, NULL, DMX_BUFFER_SIZE); +} + +void CStreamInstance::run() +{ + printf("CStreamInstance::run: %llx\n", channel_id); /* pids here cannot be empty */ stream_pids_t::iterator it = pids.begin(); @@ -306,7 +318,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 +352,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 +428,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 +511,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 +604,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 +713,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/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 e1138ee56..f611f3d87 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/gui/Makefile.am b/src/gui/Makefile.am index 87c5c403a..55ff0c226 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -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 \ @@ -96,6 +99,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..bfc9772ff 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(); @@ -1653,8 +1651,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()) @@ -1794,7 +1792,10 @@ 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); - 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; 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..8326163df 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -366,7 +366,7 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* cancelMoveBouquet(); } } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else { diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 8a9ef7157..68a612493 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -447,7 +447,7 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* cancelMoveChannel(); } } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else { diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index a33e4ce0a..93f7abbc8 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 ); @@ -434,19 +434,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); } } @@ -469,8 +469,10 @@ 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; + unsigned int tmp_max = listmaxshow; + if(!tmp_max) + tmp_max = 1; + int sbc= ((bookmarks.size()- 1)/ tmp_max)+ 1; if (sbc < 1) sbc = 1; diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 567438610..b07caecee 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()) { @@ -698,7 +704,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); @@ -712,9 +718,9 @@ void CBouquetList::paint() int ypos = y+ theight; int sb = fheight* listmaxshow; frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - - int sbc= ((bsize - 1)/ listmaxshow)+ 1; /* bsize is > 0, so sbc is also > 0 */ - int sbs= (selected/listmaxshow); + 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); frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3); } 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..a568eb140 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((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; break; diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index 163d5b89b..b576f7279 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 9d2f1a47b..47274c7bd 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -108,7 +108,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(); @@ -311,6 +311,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 +329,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 +416,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 +469,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 @@ -701,7 +713,7 @@ int CChannelList::show() loop = false; } } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { if (!edit_state) { int newmode = msg == CRCInput::RC_sat ? LIST_MODE_SAT : LIST_MODE_FAV; CNeutrinoApp::getInstance()->SetChannelMode(newmode); @@ -717,10 +729,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); @@ -1286,6 +1301,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) { @@ -1310,7 +1326,7 @@ int CChannelList::numericZap(int key) doZap = true; break; } - else if (msg == CRCInput::RC_favorites || msg == CRCInput::RC_sat || msg == CRCInput::RC_right) { + else if (msg == CRCInput::RC_favorites || msg == CRCInput::RC_sat || msg == CRCInput::RC_www || msg == CRCInput::RC_right) { } else if (CRCInput::isNumeric(msg)) { if (pos == 4) { @@ -1369,6 +1385,7 @@ int CChannelList::numericZap(int key) if (chan && showEPG) g_EventList->exec(chan->getChannelID(), chan->getName()); } + g_InfoViewer->resetSwitchMode(); return res; } @@ -1377,7 +1394,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(); @@ -2167,9 +2184,9 @@ 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); + 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; diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 21d2babda..d1bd179e4 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -50,6 +50,7 @@ enum { LIST_MODE_FAV, LIST_MODE_PROV, + LIST_MODE_WEBTV, LIST_MODE_SAT, LIST_MODE_ALL, LIST_MODE_LAST @@ -81,7 +82,6 @@ private: unsigned int origPosition; unsigned int newPosition; bool channelsChanged; - bool favoritesChanged; unsigned int tuned; t_channel_id selected_chid; diff --git a/src/gui/color.h b/src/gui/color.h index 5634a1e8e..f87bdd8f6 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)]) diff --git a/src/gui/components/cc_detailsline.cpp b/src/gui/components/cc_detailsline.cpp index 561f698a2..588a5e878 100644 --- a/src/gui/components/cc_detailsline.cpp +++ b/src/gui/components/cc_detailsline.cpp @@ -140,5 +140,5 @@ void CComponentsDetailLine::paint(bool do_save_bg) void CComponentsDetailLine::syncSysColors() { col_body = COL_MENUCONTENT_PLUS_6; - col_shadow = COL_MENUCONTENTDARK_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..37d01e4f0 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_MENUCONTENT_PLUS_6, 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 c81b0c6eb..8893cc73c 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -38,7 +38,7 @@ 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_shadow = col_shadow_old = COL_SHADOW_PLUS_0; col_frame = col_frame_old = COL_MENUCONTENT_PLUS_6; col_frame_sel = col_frame_sel_old = COL_MENUCONTENTSELECTED_PLUS_0; @@ -224,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) @@ -431,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); @@ -596,17 +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 (cc_gradient_bg_cleanup) - frameBuffer->paintBoxRel(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy, 0, fbdata.r, fbdata.rtype); + // 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->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__); diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 50036fd8b..08db89f5e 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; @@ -238,7 +236,7 @@ class CCDraw : public COSDFader, public CComponentsSignals ///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); diff --git a/src/gui/components/cc_extra.h b/src/gui/components/cc_extra.h index f63b75a75..d8311e67f 100644 --- a/src/gui/components/cc_extra.h +++ b/src/gui/components/cc_extra.h @@ -63,7 +63,7 @@ * @li CFrameBuffer::advanced * @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6 * @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 @@ -88,7 +88,7 @@ bool paintBoxRel( const int& x, const int& w_frame = 0, const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, 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 @@ -110,7 +110,7 @@ bool paintBoxRel( const int& x, * @li CORNER_ALL * @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6 * @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 @@ -131,7 +131,7 @@ bool paintBoxRel0( const int& x, const int& w_frame = 0, const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, 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) @@ -175,7 +175,7 @@ bool paintBoxRel0( const int& x, * @li CFrameBuffer::advanced * @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6 * @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 @@ -206,7 +206,7 @@ bool paintTextBoxRel( const std::string& text, const int& gradient_intensity = CColorGradient::normal, const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, 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 @@ -250,7 +250,7 @@ bool paintTextBoxRel( const std::string& text, * @li CFrameBuffer::advanced * @param[in] color_frame color of frame around box, default = COL_MENUCONTENT_PLUS_6 * @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 @@ -272,5 +272,5 @@ bool paintImage( const std::string& image_name, const int& corner_type = CORNER_NONE, const fb_pixel_t& color_frame = COL_MENUCONTENT_PLUS_6, 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.h b/src/gui/components/cc_frm.h index 94c488350..3e678bfa7 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -68,7 +68,7 @@ class CComponentsForm : public CComponentsItem 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_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..a92617ebf 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -102,7 +102,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const shadow = shadow_mode; shadow_w = SHADOW_OFFSET; - 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 +110,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; - 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; @@ -142,29 +142,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 +192,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 +237,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..eb754eef1 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_DARK_GRAY, 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_DARK_GRAY, 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_DARK_GRAY, 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_DARK_GRAY, 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_LIGHT_GRAY, 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_LIGHT_GRAY, 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_LIGHT_GRAY, 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_LIGHT_GRAY, 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_LIGHT_GRAY, 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_LIGHT_GRAY, 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_LIGHT_GRAY, 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_LIGHT_GRAY, 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..6b6e7b5c2 100644 --- a/src/gui/components/cc_frm_chain.h +++ b/src/gui/components/cc_frm_chain.h @@ -69,7 +69,7 @@ class CComponentsFrmChain : public CComponentsForm 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_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..a6e0b773b 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -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..74e859df9 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -104,7 +104,7 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + 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.h b/src/gui/components/cc_frm_ext_text.h index 0bf45f508..6bf1a23db 100644 --- a/src/gui/components/cc_frm_ext_text.h +++ b/src/gui/components/cc_frm_ext_text.h @@ -84,7 +84,7 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen 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_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 @@ -145,7 +145,7 @@ class CComponentsExtTextFormLocalized : public CComponentsExtTextForm 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_MENUCONTENT_PLUS_6, 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..2b51821a7 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -25,7 +25,6 @@ #include #endif -#include #include #include "cc_frm_footer.h" #include @@ -69,7 +68,7 @@ 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]; + cch_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]; height = max(h, cch_font->getHeight()); shadow = shadow_mode; @@ -142,11 +141,11 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont 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, btn_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); diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 9b30a7be8..311afbc3e 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 @@ -64,8 +65,8 @@ class CComponentsFooter : public CComponentsHeader 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_body = COL_MENUFOOT_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); ///show button frame and background, default false bool btn_contour; @@ -85,8 +86,8 @@ class CComponentsFooter : public CComponentsHeader 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_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..37667848e 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -103,7 +103,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; diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 45354ca2e..fda8f4835 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -48,7 +48,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen 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_shadow = COL_SHADOW_PLUS_0); protected: ///object: icon object, see also setIcon() @@ -126,7 +126,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen 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_shadow = COL_SHADOW_PLUS_0); virtual ~CComponentsHeader(); @@ -264,7 +264,7 @@ class CComponentsHeaderLocalized : public CComponentsHeader 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_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..16f162345 100644 --- a/src/gui/components/cc_frm_icons.h +++ b/src/gui/components/cc_frm_icons.h @@ -39,7 +39,7 @@ class CComponentsIconForm : public CComponentsFrmChain 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_shadow = COL_SHADOW_PLUS_0); public: CComponentsIconForm(CComponentsForm *parent = NULL); @@ -48,7 +48,7 @@ class CComponentsIconForm : public CComponentsFrmChain 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_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..37a29c84d 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -80,9 +80,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; @@ -129,7 +128,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 +149,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; isetText(REF_PERCENT_TXT, sb_val_mode, sb_font); + sb_vlbl->setText("0%", sb_val_mode, sb_font); } sb_vlbl->doPaintBg(false); diff --git a/src/gui/components/cc_frm_signalbars.h b/src/gui/components/cc_frm_signalbars.h index 216b221af..be9ade31c 100644 --- a/src/gui/components/cc_frm_signalbars.h +++ b/src/gui/components/cc_frm_signalbars.h @@ -91,7 +91,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 diff --git a/src/gui/components/cc_frm_slider.h b/src/gui/components/cc_frm_slider.h index 97e5d7e98..a5e06dcd9 100644 --- a/src/gui/components/cc_frm_slider.h +++ b/src/gui/components/cc_frm_slider.h @@ -69,7 +69,7 @@ class CComponentsSlider : public CComponentsForm 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_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..869acd530 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! @@ -214,11 +215,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/2, CORNER_BOTTOM); + ccw_footer->setButtonFont(ccw_button_font); ccw_footer->setColorBody(ccw_col_footer); + ccw_footer->doPaintBg(true); } } @@ -238,7 +241,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 +261,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 +272,36 @@ 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); + if (!ccw_show_header) + ccw_body->setCornerType(CORNER_TOP); + } } @@ -338,15 +352,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..fe031b2d7 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(); @@ -110,7 +112,7 @@ class CComponentsWindow : public CComponentsForm 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_shadow = COL_SHADOW_PLUS_0); ///initialize width and height void initWindowSize(); ///initialize position @@ -135,7 +137,7 @@ class CComponentsWindow : public CComponentsForm 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_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, @@ -145,7 +147,7 @@ class CComponentsWindow : public CComponentsForm 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_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;}; @@ -229,7 +233,7 @@ class CComponentsWindowMax : public CComponentsWindow 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_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 = "", @@ -237,7 +241,7 @@ class CComponentsWindowMax : public CComponentsWindow 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_shadow = COL_SHADOW_PLUS_0); }; #endif diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 2f36f262c..e973996e1 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -111,8 +111,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++) { @@ -145,7 +145,7 @@ void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent, const void CComponentsItem::syncSysColors() { col_body = COL_MENUCONTENT_PLUS_0; - col_shadow = COL_MENUCONTENTDARK_PLUS_0; + col_shadow = COL_SHADOW_PLUS_0; col_frame = COL_MENUCONTENT_PLUS_6; } diff --git a/src/gui/components/cc_item_infobox.cpp b/src/gui/components/cc_item_infobox.cpp index 01a03fba3..00fafa24c 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; diff --git a/src/gui/components/cc_item_infobox.h b/src/gui/components/cc_item_infobox.h index 189dbb42c..19ea2dfa6 100644 --- a/src/gui/components/cc_item_infobox.h +++ b/src/gui/components/cc_item_infobox.h @@ -74,7 +74,7 @@ class CComponentsInfoBox : public CComponentsText 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_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 b6e0d1b82..ba35b446b 100644 --- a/src/gui/components/cc_item_picture.cpp +++ b/src/gui/components/cc_item_picture.cpp @@ -72,10 +72,10 @@ 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; @@ -91,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); } @@ -99,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; } @@ -108,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(); @@ -123,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(); @@ -131,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(); @@ -139,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); @@ -154,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; @@ -165,36 +182,41 @@ 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 @@ -202,10 +224,15 @@ void CComponentsPicture::initCCItem() 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) @@ -222,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; } @@ -254,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) @@ -268,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); } } @@ -345,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 = ""; @@ -363,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..72605f058 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, @@ -109,7 +114,7 @@ class CComponentsPicture : public CComponentsItem int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_NONE); /*! @@ -125,17 +130,19 @@ class CComponentsPicture : public CComponentsItem int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + 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;}; @@ -191,7 +198,7 @@ class CComponentsPictureScalable : public CComponentsPicture int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + 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){}; }; @@ -226,7 +233,7 @@ class CComponentsChannelLogo : public CComponentsPicture int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, int transparent = CFrameBuffer::TM_BLACK); /*! @@ -242,11 +249,12 @@ class CComponentsChannelLogo : public CComponentsPicture int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + 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); @@ -274,7 +282,7 @@ class CComponentsChannelLogoScalable : public CComponentsChannelLogo int shadow_mode = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_background = 0, - fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0, + 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..8c9c94129 100644 --- a/src/gui/components/cc_item_progressbar.h +++ b/src/gui/components/cc_item_progressbar.h @@ -100,7 +100,7 @@ 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, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0, const fb_pixel_t active_col = COL_INFOBAR_PLUS_7, const fb_pixel_t passive_col = COL_INFOBAR_PLUS_3, const int R = 40, diff --git a/src/gui/components/cc_item_shapes.h b/src/gui/components/cc_item_shapes.h index 47e3ecf14..9b4c26df4 100644 --- a/src/gui/components/cc_item_shapes.h +++ b/src/gui/components/cc_item_shapes.h @@ -47,7 +47,7 @@ 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_MENUCONTENT_PLUS_6, 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 +64,7 @@ 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_MENUCONTENT_PLUS_6, 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..344f99b2a 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -109,7 +109,7 @@ 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_MENUCONTENT_PLUS_6, 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 +118,7 @@ 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_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); virtual ~CComponentsText(); @@ -132,6 +132,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/customcolor.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 @@ -249,7 +256,7 @@ class CComponentsLabel : public CComponentsText fb_pixel_t color_text = COL_MENUCONTENTINACTIVE_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_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.h b/src/gui/components/cc_item_tvpic.h index 1ffc0ebe8..4f1e22e8b 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_BLACK, 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/dboxinfo.cpp b/src/gui/dboxinfo.cpp index c43e01f80..9e55e1724 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((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { 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(); } @@ -365,8 +372,10 @@ void CDBoxInfoWidget::paint() 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..d84232a78 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 (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; loop = false; @@ -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..6a7e6698b 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -26,6 +26,7 @@ #endif #include +#include #include #include @@ -45,8 +46,13 @@ #include #include #include +#include +#include +#include #include #include +#include +#include #include #include @@ -117,6 +123,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 +142,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 +176,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 +196,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 +231,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 +266,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,10 +318,11 @@ 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) @@ -447,7 +505,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->epgEpgId; +#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->epgChannel.empty()) + { + extMovieInfo += "\n"; + extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_CHANNEL); + extMovieInfo += ": "; + extMovieInfo += mp_movie_info->epgChannel; + 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].epgAudioPidName; + } + 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->epgEpgId >> 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 +676,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 +714,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 +737,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 +792,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 +817,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 +850,15 @@ 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; } +/* merge conflict */ +#if 0 /* neat for debugging duplicate event issues etc. */ char *epgid; if (asprintf(&epgid, "EPG ID:%04X.%02X", (int)((epgData.eventID)&0x0FFFF), epgData.table_id) >= 0) @@ -643,6 +867,11 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start processTextToArray(epgid); free(epgid); } +#else + // show extended movie info + if (mp_info && !extMovieInfo.empty()) + processTextToArray(extMovieInfo); +#endif COSDFader fader(g_settings.theme.menu_Content_alpha); fader.StartFadeIn(); @@ -650,62 +879,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 +945,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 +959,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 +997,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,7 +1101,32 @@ 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, @@ -894,28 +1157,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 +1240,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 +1257,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->epgEpgId >> 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()) { @@ -974,14 +1273,13 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start break; case CRCInput::RC_favorites: case CRCInput::RC_sat: + case CRCInput::RC_www: 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 ); @@ -1005,14 +1303,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 +1460,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 +1522,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..505450779 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(); @@ -463,36 +468,33 @@ 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); @@ -599,10 +601,13 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna } 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) { @@ -644,10 +649,10 @@ 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 (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; loop = false; @@ -857,16 +862,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 +893,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) @@ -1028,12 +1036,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 +1131,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 +1148,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,7 +1161,10 @@ 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); return(res); diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index a5d9b9737..25e9e656e 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); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 057a1e637..8742295ff 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) { @@ -1375,10 +1375,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 +1417,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 +1430,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] = {(char)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); } } 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..cb1933d6e --- /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, 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..a8b871128 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -151,7 +151,7 @@ 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)) { + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; break; @@ -189,7 +189,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); } diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 24cf27734..c97f7603f 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -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 @@ -165,6 +165,9 @@ void CInfoViewer::Init() rt_x = rt_y = rt_h = rt_w = 0; infobar_txt = NULL; + + _livestreamInfo1.clear(); + _livestreamInfo2.clear(); } /* @@ -227,18 +230,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() @@ -250,10 +252,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); @@ -266,106 +267,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*SHADOW_OFFSET; + int box_y = BoxStartY + SHADOW_OFFSET; + int box_w = 0; + int box_h = txt_h; + + int icon_space = SHADOW_OFFSET/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->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); } } } @@ -373,10 +387,11 @@ 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, @@ -388,10 +403,10 @@ void CInfoViewer::paintBackground(int col_NumBox) // 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); + COL_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); + COL_SHADOW_PLUS_0, c_rad_large, CORNER_BOTTOM_LEFT); #endif // background for channel name/logo and clock paintHead(); @@ -433,6 +448,7 @@ void CInfoViewer::paintHead() void CInfoViewer::paintBody() { int h_body = InfoHeightY - header_height - SHADOW_OFFSET; + infoViewerBB->initBBOffset(); if (!zap_mode) h_body += infoViewerBB->bottom_bar_offset; @@ -440,8 +456,9 @@ void CInfoViewer::paintBody() if (body == NULL){ body = new CComponentsShapeSquare(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); - }else{ - if(txt_cur_event && txt_next_event){ + } 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(); @@ -522,7 +539,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 (); } @@ -531,7 +552,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 || @@ -546,6 +567,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 (!gotTime) gotTime = timeset; @@ -575,7 +597,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) @@ -680,13 +703,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) + 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 || @@ -824,7 +848,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, @@ -910,6 +934,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; @@ -925,9 +1009,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) || @@ -939,21 +1028,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 (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { 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) @@ -967,10 +1086,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); @@ -1011,15 +1126,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)) { @@ -1181,7 +1302,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() @@ -1193,7 +1314,7 @@ 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; @@ -1221,7 +1342,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+SHADOW_OFFSET, rt_y+SHADOW_OFFSET, 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); } @@ -1250,7 +1371,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+SHADOW_OFFSET, rt_y+rt_dy+SHADOW_OFFSET, 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 @@ -1386,6 +1507,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)) @@ -1599,9 +1721,9 @@ void CInfoViewer::display_Info(const char *current, const char *next, int pb_w = 112; int pb_startx = BoxEndX - pb_w - SHADOW_OFFSET; int pb_starty = ChanNameY - (pb_h + 10); - int pb_shadow = COL_INFOBAR_SHADOW_PLUS_0; + int pb_shadow = COL_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; + int pb_color = (g_settings.progressbar_design == CProgressBar::PB_MONO) ? COL_INFOBAR_PLUS_0 : COL_SHADOW_PLUS_0; if(g_settings.infobar_progressbar){ pb_startx = xStart; pb_w = BoxEndX - 10 - xStart; @@ -1635,14 +1757,17 @@ void CInfoViewer::display_Info(const char *current, const char *next, 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); + }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; @@ -1650,12 +1775,6 @@ void CInfoViewer::display_Info(const char *current, const char *next, bool colored_event_C = (g_settings.theme.colored_events_infobar == 1); bool colored_event_N = (g_settings.theme.colored_events_infobar == 2); - bool restore = false; - if (txt_cur_event){ - if (txt_cur_event_rest && txt_cur_event_rest->isPainted() && txt_cur_event && txt_cur_event->isPainted()) - restore = true; - } - //current event if (current && update_current){ if (txt_cur_event == NULL) @@ -1664,17 +1783,17 @@ void CInfoViewer::display_Info(const char *current, const char *next, 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 (restore) + 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); - if (restore) + if (txt_cur_event->isPainted()) txt_cur_event->hide(); txt_cur_start->paint(CC_SAVE_SCREEN_YES); } @@ -1685,7 +1804,7 @@ 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 (restore) + if (txt_cur_event_rest->isPainted()) txt_cur_event_rest->hide(); txt_cur_event_rest->paint(CC_SAVE_SCREEN_YES); } @@ -1699,17 +1818,17 @@ 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); - if (restore) + 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); - if (restore) + if (txt_next_start->isPainted()) txt_next_start->hide(); txt_next_start->paint(CC_SAVE_SCREEN_YES); } @@ -1720,7 +1839,7 @@ 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); - if (restore) + if (txt_next_in->isPainted()) txt_next_in->hide(); txt_next_in->paint(CC_SAVE_SCREEN_YES); } @@ -1810,7 +1929,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; } @@ -1952,8 +2071,8 @@ void CInfoViewer::killInfobarText() if (infobar_txt->isPainted()) infobar_txt->kill(); delete infobar_txt; + infobar_txt = NULL; } - infobar_txt = NULL; } @@ -1982,12 +2101,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, SHADOW_OFFSET/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; } @@ -1996,20 +2125,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); - 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); - - //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() @@ -2031,9 +2154,12 @@ void CInfoViewer::killTitle() 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(); + 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(); @@ -2065,10 +2191,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 570d2e038..3c320cbd7 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -65,7 +65,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 +108,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 +144,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(); @@ -285,7 +286,7 @@ void CInfoViewerBB::getBBButtonInfo() 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; @@ -430,8 +431,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); } } } @@ -703,6 +704,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); @@ -713,6 +715,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); @@ -720,7 +723,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(); } } } @@ -855,6 +857,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 7ed19d46e..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); diff --git a/src/gui/keybind_setup.h b/src/gui/keybind_setup.h index 894b45bc1..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: diff --git a/src/gui/lua/lua_cc_header.cpp b/src/gui/lua/lua_cc_header.cpp index c2273cde5..fa68852ee 100644 --- a/src/gui/lua/lua_cc_header.cpp +++ b/src/gui/lua/lua_cc_header.cpp @@ -76,7 +76,7 @@ int CLuaInstCCHeader::CCHeaderNew(lua_State *L) std::string caption, icon; lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; 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..926bb520f 100644 --- a/src/gui/lua/lua_cc_picture.cpp +++ b/src/gui/lua/lua_cc_picture.cpp @@ -78,7 +78,7 @@ int CLuaInstCCPicture::CCPictureNew(lua_State *L) lua_Integer alignment = 0; lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; 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) diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index a3717e76e..f7ed3a540 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -85,7 +85,7 @@ int CLuaInstCCText::CCTextNew(lua_State *L) lua_Unsigned color_text = (lua_Unsigned)COL_MENUCONTENT_TEXT; lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; 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_window.cpp b/src/gui/lua/lua_cc_window.cpp index 7fe6617a2..9977bfa2b 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -74,7 +74,7 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L) std::string name, icon = std::string(NEUTRINO_ICON_INFO); lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; 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 = ""; @@ -248,10 +248,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; } 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_hintbox.cpp b/src/gui/lua/lua_hintbox.cpp index 900637777..4cee2bbbb 100644 --- a/src/gui/lua/lua_hintbox.cpp +++ b/src/gui/lua/lua_hintbox.cpp @@ -154,9 +154,8 @@ 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 ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } 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..100056ba5 100644 --- a/src/gui/lua/lua_menue.cpp +++ b/src/gui/lua/lua_menue.cpp @@ -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); @@ -179,8 +183,10 @@ 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:"); } lua_pop(L, 1); } @@ -222,8 +228,10 @@ 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:"); } lua_pop(L, 2); } @@ -260,8 +268,10 @@ 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:"); } lua_pop(L, 2); } diff --git a/src/gui/lua/lua_misc.cpp b/src/gui/lua/lua_misc.cpp index 890ce404a..5e1310e94 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 @@ -319,7 +320,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; 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..fd25aeda2 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; diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index f3bf6b45f..d5de296b6 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -159,13 +159,15 @@ 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) }, { "BACKGROUND", MAGIC_COLOR | (COL_BACKGROUND) }, { "DARK_RED", MAGIC_COLOR | (COL_DARK_RED0) }, { "DARK_GREEN", MAGIC_COLOR | (COL_DARK_GREEN0) }, @@ -182,7 +184,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 +197,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 +213,7 @@ 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) }, { NULL, 0 } }; @@ -435,8 +440,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 +473,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 */ @@ -625,8 +634,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 +693,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..cf6b9ba30 100644 --- a/src/gui/lua/luainstance_helpers.h +++ b/src/gui/lua/luainstance_helpers.h @@ -31,8 +31,8 @@ #define LUA_CURL_CLASSNAME "curl" #define LUA_HEADER_CLASSNAME "header" -//#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/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..d10cdfbb5 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -138,7 +138,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.cpp b/src/gui/moviebrowser.cpp index 0bbe1f692..935011439 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -45,6 +45,8 @@ #include #include "moviebrowser.h" #include "filebrowser.h" +#include +#include #include #include #include @@ -83,8 +85,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 21 const CMenuOptionChooser::keyval MESSAGEBOX_BROWSER_ROW_ITEM[MESSAGEBOX_BROWSER_ROW_ITEM_COUNT] = { { MB_INFO_FILENAME, LOCALE_MOVIEBROWSER_INFO_FILENAME }, @@ -106,7 +109,8 @@ 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 } }; #define MESSAGEBOX_YES_NO_OPTIONS_COUNT 2 @@ -139,7 +143,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 FOOT_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT] #define INTER_FRAME_SPACE 4 // space between e.g. upper and lower window @@ -165,6 +169,7 @@ 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, NONEXISTANT_LOCALE }; @@ -179,7 +184,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 +194,7 @@ 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 const int m_defaultRowWidth[MB_INFO_MAX_NUMBER+1] = { @@ -212,6 +218,7 @@ 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, 0 //MB_ROW_WIDTH_MAX_NUMBER }; static MI_MOVIE_INFO* playing_info; @@ -281,6 +288,13 @@ bool sortByAge(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) 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) @@ -326,7 +340,8 @@ bool (* const sortBy[MB_INFO_MAX_NUMBER+1])(const MI_MOVIE_INFO* a, const MI_MOV NULL, //MB_INFO_AUDIO = 17, NULL, //MB_INFO_LENGTH = 18, &sortBySize, //MB_INFO_SIZE = 19, - NULL //MB_INFO_MAX_NUMBER = 20 + &sortByRating, //MB_INFO_RATING = 20, + NULL //MB_INFO_MAX_NUMBER = 21 }; CMovieBrowser::CMovieBrowser(): configfile ('\t') @@ -337,7 +352,7 @@ CMovieBrowser::CMovieBrowser(): configfile ('\t') CMovieBrowser::~CMovieBrowser() { //TRACE("[mb] del\n"); - hide(); + m_dir.clear(); m_dirNames.clear(); @@ -847,6 +862,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 +917,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 +942,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 +973,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 +1040,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,7 +1104,7 @@ int CMovieBrowser::exec(const char* path) { loop = false; } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { //FIXME do nothing ? } else if (msg == NeutrinoMessages::STANDBY_ON || @@ -1112,6 +1128,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 +1191,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 +1251,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,17 +1367,17 @@ 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; + 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; - short pb_hdd_offset = 104; + 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 = g_settings.infobar_show_sysfs_hdd ? 104 : 0; if (show_mode == MB_SHOW_YT) pb_hdd_offset = 0; @@ -1393,33 +1414,46 @@ 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); } void CMovieBrowser::info_hdd_level(bool paint_hdd) { - if (show_mode == MB_SHOW_YT) + if (show_mode == MB_SHOW_YT || !g_settings.infobar_show_sysfs_hdd) return; struct statfs s; @@ -1735,16 +1769,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[] = { @@ -1790,8 +1824,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); @@ -1800,11 +1894,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) { @@ -1841,6 +1937,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(); } } @@ -1855,7 +1952,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(); } } @@ -1873,48 +1971,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 @@ -2108,61 +2224,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(); @@ -2421,7 +2538,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; @@ -2487,6 +2605,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" @@ -2839,6 +2977,11 @@ void CMovieBrowser::showHelp(void) help.exec(NULL,NULL); } +static std::string rateFormat(int i) +{ + return to_string(i/10) + "," + to_string(i%10); +} + #define MAX_STRING 30 int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) { @@ -2903,12 +3046,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 ******************************************************/ @@ -2929,6 +3073,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); @@ -2941,6 +3088,7 @@ 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)); @@ -3280,6 +3428,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, @@ -3321,13 +3472,41 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = movie_info.epgChannel; 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); @@ -3371,7 +3550,14 @@ 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_MAX_NUMBER: // = 21 default: *item_string=""; result = false; @@ -3795,7 +3981,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); diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index 94054e7f5..55e3e8516 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -114,7 +114,8 @@ typedef enum 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_RATING = 20, + MB_INFO_MAX_NUMBER = 21 // MUST be allways the last item in the list }MB_INFO_ITEM; @@ -386,6 +387,7 @@ class CMovieBrowser : public CMenuTarget m_file_info_stale = true; show_mode = mode; } + bool gotMovie(const char *rec_title); private: //Functions ///// MovieBrowser init /////////////// @@ -426,6 +428,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); diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 424aa2989..c4559df14 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,31 +97,9 @@ 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" @@ -163,14 +111,14 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->epgId); 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->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 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); @@ -184,15 +132,15 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo } *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->epgVTXPID); // %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,48 +272,19 @@ 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; @@ -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) @@ -733,7 +383,7 @@ bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info if (text[pos + pos3] == '\"') { audio_pids.epgAudioPidName.append(&text[pos + pos2 + 1], pos3 - pos2 - 1); - audio_pids.epgAudioPidName = decodeXmlSpecialChars(audio_pids.epgAudioPidName); + audio_pids.epgAudioPidName = htmlEntityDecode(audio_pids.epgAudioPidName); } } } @@ -742,10 +392,10 @@ bool CMovieInfo::parseXmlQuickFix(std::string &_text, MI_MOVIE_INFO * movie_info } /* 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,18 +500,19 @@ 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; epgId = 0; epgEpgId = 0; @@ -880,10 +525,10 @@ void MI_MOVIE_INFO::clear(void) productionCountry = ""; epgTitle = ""; - epgInfo1 = ""; //epgInfo1 - epgInfo2 = ""; //epgInfo2 + epgInfo1 = ""; + epgInfo2 = ""; epgChannel = ""; - serieName = ""; // (name e.g. 'StarWars) + 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..eaa943d66 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 epgAudioPid; // epg audio pid nr, usually filled by VCR + std::string epgAudioPidName; // epg audio pid name, usually filled by VCR +} EPG_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 epgChannel; // Channel name, usually filled by EPG + 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 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 - 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 44b1c4494..bf333316b 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; @@ -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.epgId; + + 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); + + CLuaInstance *lua = new CLuaInstance(); + lua->runScript(script.c_str(), &args, &result_code, &result_string); + delete lua; + + 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.epgChannel = realUrl; instance_bg->movie_info.epgId = 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" ); @@ -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); @@ -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__, 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,9 +1617,7 @@ 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) { + } else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { //FIXME do nothing ? } else if (msg == (neutrino_msg_t) CRCInput::RC_setup) { CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::SHOW_MAINMENU, 0); @@ -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__, 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__, 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->epgEpgId >>16, mi->epgChannel, mi->epgTitle, mi->epgInfo1, + duration, position, repeat_mode, init_vzap_it ? 0 /*IV_MODE_DEFAULT*/ : 1 /*IV_MODE_VIRTUAL_ZAP*/); return; } @@ -1458,7 +1871,7 @@ 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)); @@ -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; @@ -1779,9 +2193,9 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); } 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); @@ -2018,18 +2432,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,8 +2576,10 @@ 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]; @@ -2195,6 +2618,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 +2659,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..c2101cdf7 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -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/opkg_manager.cpp b/src/gui/opkg_manager.cpp index f03b16bef..ac423ea37 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; @@ -637,14 +647,14 @@ void COPKGManager::getPkgData(const int pkg_content_id) if (list_installed_done) return; list_installed_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.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; } diff --git a/src/gui/opkg_manager.h b/src/gui/opkg_manager.h index 78cebaa49..75865a047 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(); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 8e1072fb7..dbfd7578b 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -102,7 +102,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 +110,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 +120,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 +285,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 +346,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 +381,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 +458,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 +466,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 +709,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 +772,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 +927,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 +968,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 +1044,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 +1234,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..9603b8fdb 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,7 @@ int CPictureViewerGui::show() loop = false; g_RCInput->postMsg(msg, data); } - else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else { @@ -645,7 +646,7 @@ int CPictureViewerGui::show() hide(); CAudioMute::getInstance()->enableMuteIcon(true); - InfoClock->enableInfoClock(true); + CInfoClock::getInstance()->enableInfoClock(true); return(res); } @@ -727,7 +728,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()) { @@ -760,8 +761,11 @@ void CPictureViewerGui::paint() int sb = fheight* listmaxshow; frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - 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; 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/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..574a91100 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -215,7 +215,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..e84c52144 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -269,7 +269,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..1906518ee 100644 --- a/src/gui/screensetup.cpp +++ b/src/gui/screensetup.cpp @@ -211,6 +211,7 @@ int CScreenSetup::exec(CMenuTarget* parent, const std::string &) } case CRCInput::RC_favorites: case CRCInput::RC_sat: + case CRCInput::RC_www: break; default: diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 90e4c420d..8111c0997 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -233,7 +233,7 @@ int CStreamInfo2::doSignalStrengthLoop () res = menu_return::RETURN_EXIT_ALL; break; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; break; diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 75ea0777e..bda48c198 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -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 13cfc8f1b..f93cd3f3e 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -274,6 +274,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); @@ -364,6 +372,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); @@ -380,6 +394,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/timerlist.cpp b/src/gui/timerlist.cpp index a0a5faac4..ec9cb5085 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -382,7 +382,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 +392,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); @@ -623,7 +625,7 @@ int CTimerList::show() } // help key } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { + else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { g_RCInput->postMsg (msg, 0); loop = false; res = menu_return::RETURN_EXIT_ALL; @@ -879,8 +881,10 @@ void CTimerList::paint() int ypos = y+ theight; int sb = 2*fheight* listmaxshow; frameBuffer->paintBoxRel(x+ width- 15,ypos, 15, sb, COL_MENUCONTENT_PLUS_1); - - int sbc= ((timerlist.size()- 1)/ listmaxshow)+ 1; + unsigned int tmp_max = listmaxshow; + if(!tmp_max) + tmp_max = 1; + int sbc= ((timerlist.size()- 1)/ tmp_max)+ 1; frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ page_nr * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3, RADIUS_SMALL); } @@ -1054,19 +1058,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 +1261,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 +1300,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..6ca937ecb 100644 --- a/src/gui/timerlist.h +++ b/src/gui/timerlist.h @@ -97,7 +97,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..64f588f3c 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -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 32912b418..6ba43bc41 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -3,6 +3,7 @@ UPnP Browser (c) 2007 by Jochen Friedrich (c) 2009-2011,2016 Stefan Seyfried + (c) 2016 Thilo Graf License: GPL @@ -17,8 +18,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,14 +43,11 @@ #include #include #include - #include -#include -#include #include #include #include - +#include #include #include #include @@ -59,12 +56,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 +70,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); +} + +#define INNER_OFFSET SHADOW_OFFSET + +void CUpnpBrowserGui::Init() +{ + font_item = SNeutrinoSettings::FONT_TYPE_MENU; + + topbox.enableFrame(true, 2); + topbox.setCorner(RADIUS_LARGE); + topbox.setColorAll(COL_MENUCONTENT_PLUS_6, 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.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.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 + 10; // topbox: 3 lines + inner offset + shadow + m_infobox_height = _info_height*2 + 20; // infobox/timebox: 2 lines + inner offset + shadow + + /* From top to bottom we have: + * + * topbox (with shadow) + * INNER_OFFSET + * mainwindow (with shadow) + * - header + * - body (items*listshowmax) + * - footer + * INNER_OFFSET + * infobox/timebox (with shadow) + */ + + m_listmaxshow = (m_height - m_topbox_height - SHADOW_OFFSET - INNER_OFFSET - m_header_height - m_footer_height - SHADOW_OFFSET - INNER_OFFSET - m_infobox_height - SHADOW_OFFSET) / (m_item_height); + + // recalc height + m_height = m_topbox_height + SHADOW_OFFSET + INNER_OFFSET + m_header_height + (m_listmaxshow * m_item_height) + m_footer_height + SHADOW_OFFSET + INNER_OFFSET + m_infobox_height + SHADOW_OFFSET; + + 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 + SHADOW_OFFSET + INNER_OFFSET; + 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 + SHADOW_OFFSET + INNER_OFFSET; } 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*/) @@ -98,24 +181,6 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ // 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); @@ -638,7 +703,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)) @@ -851,45 +916,31 @@ 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; fb_pixel_t color; fb_pixel_t bgcolor; @@ -905,7 +956,7 @@ void CUpnpBrowserGui::paintDevice(unsigned int _pos) color = COL_MENUCONTENT_TEXT; bgcolor = COL_MENUCONTENT_PLUS_0; } - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor); if (pos >= m_devices.size()) return; @@ -916,53 +967,54 @@ void CUpnpBrowserGui::paintDevice(unsigned int _pos) 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) + 5; + g_Font[font_item]->RenderString(m_x + 10, ypos + m_item_height, m_width - 30 - w, + num, color, m_item_height); + g_Font[font_item]->RenderString(m_x + m_width - 15 - 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_MENUCONTENT_PLUS_1); + 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_MENUCONTENT_PLUS_3); - 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 + SHADOW_OFFSET, SHADOW_OFFSET, sb, COL_SHADOW_PLUS_0); // Foot - 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); -// 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); + footer.paintButtons(m_x, m_footer_y, m_width, m_footer_height, 1, &RescanButton, m_width/2); 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; fb_pixel_t color; fb_pixel_t bgcolor; @@ -976,7 +1028,7 @@ void CUpnpBrowserGui::paintItem(std::vector *entries, unsigned int po color = COL_MENUCONTENT_TEXT; bgcolor = COL_MENUCONTENT_PLUS_0; } - m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor); + m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_item_height, bgcolor); if (pos >= (*entries).size()) return; @@ -1017,29 +1069,31 @@ 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); + 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 + 10; + m_frameBuffer->paintIcon(fileicon, m_x + 10, ypos + (m_item_height - icon_h) / 2); + } + g_Font[font_item]->RenderString(m_x + m_width - 15 - 10 - w, ypos + m_item_height, w, info, color, m_item_height); + g_Font[font_item]->RenderString(m_x + 10 + icon_o, ypos + m_item_height, m_width - icon_o - 15 - 2*10 - w, name, 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 +1102,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() - INNER_OFFSET - infobox.getCornerRadius(); + int y_image = infobox.getYPos() + infobox.getHeight()/2 - h_image/2; + if (!image){ + image = new CComponentsPicture(100, 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() - INNER_OFFSET - 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,122 +1160,108 @@ 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.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 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_MENUCONTENT_PLUS_1); + 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_MENUCONTENT_PLUS_3); + + //shadow + //m_frameBuffer->paintBoxRel(m_x + m_width, m_item_y + SHADOW_OFFSET, SHADOW_OFFSET, sb, COL_SHADOW_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); + int timebox_width = m_infobox_height; // maybe not enough + infobox.setDimensionsAll(m_x, m_infobox_y, m_width - SHADOW_OFFSET - INNER_OFFSET - timebox_width, m_infobox_height); + timebox.setDimensionsAll(m_x + m_width - timebox_width, infobox.getYPos(), m_infobox_height, timebox_width); + + printf("paintDetails: use_playing %d shown %d\n", use_playing, m_playing_entry_is_shown); + if ((!use_playing) && entry->isdir){ + infobox.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) { - 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*3); + 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(); } } } diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index 940122d6a..5c768d018 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); std::vector *decodeResult(std::string); - + void Init(); void updateDeviceSelection(int newpos); void selectDevice(); void paintDevices(); diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index f7c5c79b9..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) @@ -513,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; 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/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.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..f85af5a52 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -97,7 +97,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 +195,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 +221,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 +250,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 +284,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 +306,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 +392,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 +413,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..92634eece 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -232,6 +232,7 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) case CRCInput::RC_sat: case CRCInput::RC_favorites: + case CRCInput::RC_www: break; case CRCInput::RC_timeout: case CRCInput::RC_ok: diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index eb9900a58..0f547dfe5 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); @@ -290,7 +290,7 @@ 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((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } 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..dfc89946d 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; @@ -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(SHADOW_OFFSET, SHADOW_OFFSET, m_width, m_height, COL_SHADOW_PLUS_0, RADIUS_LARGE, toround ? CORNER_ALL : CORNER_BOTTOM | CORNER_TOP_RIGHT); bgPainted = true; } 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..4d459fefe 100644 --- a/src/gui/widget/keyboard_input.cpp +++ b/src/gui/widget/keyboard_input.cpp @@ -610,7 +610,7 @@ 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 ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else diff --git a/src/gui/widget/listbox.cpp b/src/gui/widget/listbox.cpp index 683fbac03..3672f0cd1 100644 --- a/src/gui/widget/listbox.cpp +++ b/src/gui/widget/listbox.cpp @@ -221,7 +221,7 @@ int CListBox::exec(CMenuTarget* parent, const std::string & /*actionKey*/) { onBlueKeyPressed(); } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index b43c98c92..d20cfec10 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -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(); @@ -966,6 +968,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) case (CRCInput::RC_sat): case (CRCInput::RC_favorites): + case (CRCInput::RC_www): g_RCInput->postMsg (msg, 0); //close any menue on dbox-key case (CRCInput::RC_setup): @@ -1240,14 +1243,13 @@ void CMenuWidget::paint() header->setOffset(10); } header->setColorBody(COL_MENUHEAD_PLUS_0); - header->setColorShadow(COL_MENUCONTENTDARK_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+SHADOW_OFFSET, y + hheight + SHADOW_OFFSET, 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)); @@ -1307,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++; } @@ -1425,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; @@ -1435,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; } @@ -1477,10 +1480,10 @@ 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_MENUCONTENT_PLUS_6, COL_MENUCONTENTDARK_PLUS_0); 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) @@ -1994,12 +1997,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 @@ -2256,7 +2258,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..f7e497846 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 + SHADOW_OFFSET; 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 + SHADOW_OFFSET, ypos + SHADOW_OFFSET, 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; } @@ -271,7 +273,7 @@ int CMessageBox::exec(int timeout) { loop = false; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www) || (msg == CRCInput::RC_spkr)) { } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) @@ -289,7 +291,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 +305,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..96c273dbc 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 + SHADOW_OFFSET, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + SHADOW_OFFSET, 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 + SHADOW_OFFSET, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + SHADOW_OFFSET, 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 + SHADOW_OFFSET, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY + SHADOW_OFFSET, 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,7 +730,7 @@ int CMsgBox::exec( int timeout, int returnDefaultOnTimeout) { loop = false; } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) @@ -750,7 +761,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 +778,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/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..4651d33d1 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; @@ -494,7 +494,7 @@ 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 ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } else 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..d95d07681 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -257,7 +257,7 @@ int CExtendedInput::exec( CMenuTarget* parent, const std::string & ) *cancel = true; } } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { } 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; i1 ? m_cFrameTextRel.iWidth : m_nMaxTextWidth; int dy = m_cFrameTextRel.iHeight; //find changes @@ -602,7 +602,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{ diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 4e9efb3d6..f46c67220 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" @@ -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; @@ -295,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" }, @@ -502,7 +507,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); @@ -658,9 +662,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", "" ); @@ -707,6 +712,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.spectrum = configfile.getBool("spectrum" , false); g_settings.channellist_additional = configfile.getInt32("channellist_additional", 2); //default 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" , 1);//default next Event @@ -827,10 +833,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); @@ -857,6 +870,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 //------------------------------------------- @@ -936,11 +951,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 * **************************************************************************************/ @@ -1058,7 +1099,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 @@ -1171,6 +1211,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 ); @@ -1216,6 +1257,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); @@ -1301,10 +1343,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); @@ -1317,6 +1363,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) @@ -1372,6 +1420,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); } @@ -1404,11 +1457,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)); @@ -1549,6 +1607,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); @@ -1558,6 +1618,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); @@ -1614,6 +1676,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; @@ -1740,6 +1808,7 @@ void CNeutrinoApp::SetupFonts(int fmode) /* recalculate infobar position */ if (g_InfoViewer) g_InfoViewer->start(); + OnAfterSetupFonts(); } /************************************************************************************** @@ -2171,7 +2240,7 @@ TIMER_STOP("################################## after all ####################### } delete hintBox; } - RealRun(personalize.getWidget(0)/**main**/); + RealRun(); ExitRun(true, can_deepstandby); @@ -2197,7 +2266,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)) { @@ -2260,9 +2328,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; @@ -2620,6 +2688,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); @@ -2668,7 +2741,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; } @@ -2764,7 +2839,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); @@ -2774,7 +2849,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); @@ -2785,7 +2861,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(); @@ -2840,7 +2916,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() && (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www))) { if( (mode == mode_tv) || (mode == mode_radio) || (mode == mode_ts) || (mode == mode_webtv)) { showChannelList(msg); return messages_return::handled; @@ -3070,16 +3146,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(); } @@ -3348,7 +3432,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); } } } @@ -4333,6 +4418,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 ); @@ -4361,6 +4451,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 ); @@ -4411,6 +4502,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 ); @@ -4437,6 +4534,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 ); @@ -4723,6 +4821,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); @@ -4744,6 +4848,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); @@ -4788,12 +4898,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 d65f6760c..61f616bfd 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(); @@ -162,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(); @@ -238,6 +239,7 @@ public: void screensaver(bool); //signal/event handler before restart of neutrino gui sigc::signal OnBeforeRestart; + sigc::signal OnAfterSetupFonts; void channelRezap(); }; #endif 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..3cfbfd527 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,78 @@ 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"}, // 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 +243,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 +294,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 +323,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 +350,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 +362,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 +373,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 +404,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 +471,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 +647,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); @@ -712,7 +810,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 +963,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(hh->WebserverConfigList["Tuxbox.LogosURL"], 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 +1160,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 +1218,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 +1287,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 +1419,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 +1463,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 +1537,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 +1553,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 +1574,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 +1586,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 +1633,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 +1646,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 +1836,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 +1846,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 +1912,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); @@ -1855,10 +2131,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 +2263,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 +2298,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 +2367,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 +2397,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 +2496,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 +2578,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 +2655,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"; @@ -2936,7 +3161,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 +3171,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 +3179,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 +3197,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 +3218,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 +3238,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 +3285,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 +3308,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 +3384,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..05749b7f5 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); @@ -113,18 +127,24 @@ private: 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..f0b3f5fe4 100644 --- a/src/nhttpd/tuxboxapi/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/neutrinoapi.cpp @@ -41,6 +41,7 @@ #include #include #include +#include extern CBouquetManager *g_bouquetManager; extern CFrontend * frontend; @@ -135,6 +136,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 +157,8 @@ CNeutrinoAPI::~CNeutrinoAPI(void) delete Timerd; if (EventServer) delete EventServer; + + delete pmutex; } //------------------------------------------------------------------------- @@ -171,6 +178,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 +190,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 +204,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 +217,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 +275,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 +291,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 +343,7 @@ void CNeutrinoAPI::UpdateChannelList(void) { //FIXME } - +#endif //------------------------------------------------------------------------- std::string CNeutrinoAPI::timerEventType2Str(CTimerd::CTimerEventTypes type) @@ -323,33 +351,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 +390,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 +461,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 +471,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 +486,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 +499,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,7 +521,8 @@ std::string CNeutrinoAPI::getCryptInfoAsString(void) { } //------------------------------------------------------------------------- -std::string CNeutrinoAPI::getLogoFile(std::string _logoURL, t_channel_id channelId) { +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 channelName = GetServiceName(channelId); // replace(channelName, " ", "_"); @@ -505,4 +542,3 @@ std::string CNeutrinoAPI::getLogoFile(std::string _logoURL, t_channel_id channel else return ""; } - diff --git a/src/nhttpd/tuxboxapi/neutrinoapi.h b/src/nhttpd/tuxboxapi/neutrinoapi.h index 4d504eae0..1685d5874 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); @@ -83,12 +89,14 @@ 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 1cce6e377..3e81d1156 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) @@ -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("
    \n" + prozent = 100 * (time(NULL) - event.startTime) / event.duration; + yresult += string_printf("
    \n" "\t" "" "" @@ -414,7 +413,7 @@ std::string CNeutrinoYParser::func_get_bouquets_with_epg(CyhookHandler *hh, std: } else { - yresult += string_printf("
    \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"); @@ -676,7 +726,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 +744,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, @@ -780,6 +832,7 @@ std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) if( boxname == "Armas ") boxname += "TripleDragon"; break; +#ifdef BOXMODEL_NEVIS case 6: boxname += "HD1"; break; @@ -791,19 +844,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); @@ -824,21 +887,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/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..a6fbc1c78 100644 --- a/src/nhttpd/web/Y_Blocks.txt +++ b/src/nhttpd/web/Y_Blocks.txt @@ -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 audiotext - + trsphelp 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_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..7a7f15368 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) @@ -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; + $(__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); diff --git a/src/nhttpd/web/Y_EPG_Plus.yhtm b/src/nhttpd/web/Y_EPG_Plus.yhtm index b6cacff8a..b6888235c 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=}
    diff --git a/src/nhttpd/web/Y_Live_EPG.yhtm b/src/nhttpd/web/Y_Live_EPG.yhtm index 1c25ff5e2..8d0dc53f0 100644 --- a/src/nhttpd/web/Y_Live_EPG.yhtm +++ b/src/nhttpd/web/Y_Live_EPG.yhtm @@ -67,7 +67,17 @@ function _show_epg() epg_data = new Array(); epg_data_index=0; + var weekday = new Array(7); + weekday[0]= "{=L:date.su=}"; + weekday[1] = "{=L:date.mo=}"; + weekday[2] = "{=L:date.tu=}"; + weekday[3] = "{=L:date.we=}"; + weekday[4] = "{=L:date.th=}"; + weekday[5] = "{=L:date.fr=}"; + weekday[6] = "{=L:date.sa=}"; + var now = new Date(); + var __d = new Date(); var _starttime = Math.round(now/1000); var epg_xml = loadSyncURLxml("/control/epg?xml=true&channelid={=channel=}&details=true"); if(epg_xml){ @@ -85,6 +95,10 @@ function _show_epg() var _info1 = epg_de_qout(getXMLNodeItemValue(prog, "info1")); var _info2 = epg_de_qout(getXMLNodeItemValue(prog, "info2")); + __d.setTime(_start*1000); + var _dow = weekday[__d.getDay()]; + _date = _dow + ", " + _date; + var epg_obj= new Array(_desc, _info1, _info2, _start, _start_t, _stop.toString(), "{=channel=}"); epg_data.push(epg_obj); @@ -102,7 +116,7 @@ function _show_epg() -{=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_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_Settings_nhttpd.yhtm b/src/nhttpd/web/Y_Settings_nhttpd.yhtm index 872695929..f78f667b6 100644 --- a/src/nhttpd/web/Y_Settings_nhttpd.yhtm +++ b/src/nhttpd/web/Y_Settings_nhttpd.yhtm @@ -75,7 +75,6 @@ function do_check_input_LogosURL() - {=if-not-equal:{=global-var-get:boxtype=}~coolstream~ - =} 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){
     {=L:set.nhttpd.active_after_boot=}
    {=L:set.nhttpd.threading=} @@ -83,7 +82,6 @@ function do_check_input_LogosURL() {=L:on=}
    {=L:set.nhttpd.alternate_web_folder=} diff --git a/src/nhttpd/web/Y_Settings_yWeb.yhtm b/src/nhttpd/web/Y_Settings_yWeb.yhtm index e3d9a8d14..02638bdbd 100644 --- a/src/nhttpd/web/Y_Settings_yWeb.yhtm +++ b/src/nhttpd/web/Y_Settings_yWeb.yhtm @@ -38,6 +38,8 @@ function do_init(){ case "4": // cst neo twin case "5": // cst tank case "6": // cst trinity + case "7": // cst link + case "8": // cst trinity duo sel=(sel*1+val*1); break; default: @@ -123,6 +125,8 @@ select { + +
    -{=comment:disable non-working rec on/off buttons~ +{=comment:disable non-working rec off button~ =} diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index 691238b8c..c4da80e3a 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.26 -date=21.01.2016 +version=2.9.0.38 +date=15.08.2016 type=Release info=Port CST diff --git a/src/nhttpd/web/images/Makefile.am b/src/nhttpd/web/images/Makefile.am index 8d8e32a4a..f8a8e47be 100644 --- a/src/nhttpd/web/images/Makefile.am +++ b/src/nhttpd/web/images/Makefile.am @@ -34,6 +34,7 @@ install_DATA = accept.png \ hidden.png \ info.png \ inlink.gif \ + key.png \ live.png \ live_popup.png \ livelock.png \ @@ -64,6 +65,7 @@ install_DATA = accept.png \ smallwait.gif \ snapshot.png \ stop.png \ + stream.png \ streaminfo.png \ time_add.png \ time_down.png \ @@ -81,6 +83,7 @@ install_DATA = accept.png \ volumeunmute.png \ volumeup.png \ wait.gif \ + webtv.png \ wget.png \ x_red.png \ zap.png diff --git a/src/nhttpd/web/images/elist.png b/src/nhttpd/web/images/elist.png index 253521aa5..bd307726b 100644 Binary files a/src/nhttpd/web/images/elist.png and b/src/nhttpd/web/images/elist.png differ diff --git a/src/nhttpd/web/images/key.png b/src/nhttpd/web/images/key.png new file mode 100644 index 000000000..4ec1a9281 Binary files /dev/null and b/src/nhttpd/web/images/key.png differ diff --git a/src/nhttpd/web/images/stream.png b/src/nhttpd/web/images/stream.png new file mode 100644 index 000000000..0f24e86e4 Binary files /dev/null and b/src/nhttpd/web/images/stream.png differ diff --git a/src/nhttpd/web/images/streaminfo.png b/src/nhttpd/web/images/streaminfo.png index d1b964d26..12cd1aef9 100644 Binary files a/src/nhttpd/web/images/streaminfo.png and b/src/nhttpd/web/images/streaminfo.png differ diff --git a/src/nhttpd/web/images/webtv.png b/src/nhttpd/web/images/webtv.png new file mode 100644 index 000000000..699149f84 Binary files /dev/null and b/src/nhttpd/web/images/webtv.png differ diff --git a/src/nhttpd/web/languages/Deutsch b/src/nhttpd/web/languages/Deutsch index 716ff9a4d..e726ac538 100644 --- a/src/nhttpd/web/languages/Deutsch +++ b/src/nhttpd/web/languages/Deutsch @@ -58,6 +58,23 @@ restriced_by_management_ip=Zugriff verwehrt wg. ManagementIP automatic=automatisch show=zeigen hide=verstecken +unknown=Unbekannt + +# ========== Dates +date.su=So +date.sunday=Sonntag +date.mo=Mo +date.monday=Montag +date.tu=Di +date.tuesday=Dienstag +date.we=Mi +date.wednesday=Mittwoch +date.th=Do +date.thursday=Donnerstag +date.fr=Fr +date.friday=Freitag +date.sa=Sa +date.saturday=Samstag # ==========Main Menue main.boxcontrol=Boxsteuerung @@ -520,6 +537,7 @@ live.timer_edit.plugin=Plugin live.timer_edit.rec_dir=Aufnahmeverzeichnis live.timer_edit.description=Beschreibung live.timer_edit.type=Typ +live.timer_edit.message=Nachricht =========== LIVE Timer Sync live.timer-sync.get_timer=Timer holen. @@ -597,6 +615,7 @@ rc.key_stop=Stop rc.key_record=Record rc.key_pause=Pause rc.key_games= +rc.key_trsp=Trsp rc.key_time= rc.key_picsize=Pic Size rc.key_picmode=Pic Mode diff --git a/src/nhttpd/web/languages/English b/src/nhttpd/web/languages/English index f5fbe84f1..8ee0e178d 100644 --- a/src/nhttpd/web/languages/English +++ b/src/nhttpd/web/languages/English @@ -58,6 +58,23 @@ restriced_by_management_ip=restricted by ManagementIP automatic=automatically show=show hide=hide +unknown=Unknown + +# ========== Dates +date.su=Su +date.sunday=Sunday +date.mo=Mo +date.monday=Monday +date.tu=Tu +date.tuesday=Tuesday +date.we=We +date.wednesday=Wednesday +date.th=Th +date.thursday=Thursday +date.fr=Fr +date.friday=Friday +date.sa=Sa +date.saturday=Saturday #========= MAIN Menue main.live_tv_desc=LiveTV @@ -523,6 +540,7 @@ live.timer_edit.plugin=Plugin live.timer_edit.rec_dir=Recordind directory live.timer_edit.description=Description live.timer_edit.type=Type +live.timer_edit.message=Message =========== LIVE Timer Sync live.timer-sync.get_timer=Get timer. @@ -600,6 +618,7 @@ rc.key_stop=Stop rc.key_record=Record rc.key_pause=Pause rc.key_games= +rc.key_trsp=Trsp rc.key_time= rc.key_picsize=Pic Size rc.key_picmode=Pic Mode diff --git a/src/nhttpd/yconfig.h b/src/nhttpd/yconfig.h index 0006e345d..b06d6e385 100644 --- a/src/nhttpd/yconfig.h +++ b/src/nhttpd/yconfig.h @@ -62,7 +62,7 @@ //#define Y_CONFIG_FEATURE_CHROOT y // Add Feature: Use Change Root for Security //#define Y_CONFIG_FEATURE_HTTPD_USER y // Add Feature: Set User for yhttpd-Process #define Y_CONFIG_BUILD_AS_DAEMON y // Build as a Daemon -//#define Y_CONFIG_FEATURE_THREADING y // Build with possibility for multi threading +#define Y_CONFIG_FEATURE_THREADING y // Build with possibility for multi threading //----------------------------------------------------------------------------- // Define/Undefine Features forced by CONFIG_SYSTEM_xxx // Dependencies @@ -110,6 +110,7 @@ #define YWEB_CONFIGFILE HTTPD_CONFIGDIR"/Y-Web.conf" #define PUBLICDOCUMENTROOT PUBLIC_HTTPDDIR #define NEUTRINO_CONFIGFILE CONFIGDIR"/neutrino.conf" +#define MOVIEBROWSER_CONFIGFILE CONFIGDIR"/moviebrowser.conf" #define HOSTEDDOCUMENTROOT HOSTED_HTTPDDIR #define HOSTEDDOCUMENTURL "/hosted/" #define EXTRASDOCUMENTROOT HOSTED_HTTPDDIR"/extras" diff --git a/src/nhttpd/yhttpd_core/helper.cpp b/src/nhttpd/yhttpd_core/helper.cpp index 24498b635..6361bd0c7 100644 --- a/src/nhttpd/yhttpd_core/helper.cpp +++ b/src/nhttpd/yhttpd_core/helper.cpp @@ -11,8 +11,11 @@ #include #include +#include + // yhttpd #include +#include #include "ytypes_globals.h" #include "helper.h" #include "ylogging.h" @@ -76,10 +79,10 @@ std::string timeString(time_t time) { // Printf and return formatet String. Buffer-save! // max length up to bufferlen -> then snip //------------------------------------------------------------------------- -#define bufferlen 4*1024 std::string string_printf(const char *fmt, ...) { - char buffer[bufferlen]; va_list arglist; + const int bufferlen = 4*1024; + char buffer[bufferlen] = {0}; va_start(arglist, fmt); vsnprintf(buffer, bufferlen, fmt, arglist); va_end(arglist); @@ -292,19 +295,154 @@ std::string json_out_error(std::string _error) { //----------------------------------------------------------------------------- // JSON: convert string to JSON-String //----------------------------------------------------------------------------- -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" + +std::string json_convert_string(std::string value) +{ + std::string result; + for (size_t i = 0; i < value.length(); i++) + { + unsigned char c = unsigned(value[i]); + switch(c) + { + case '\"': + result += "\\\""; + break; + case '\\': + result += "\\\\"; + break; + case '\b': + result += "\\b"; + break; + case '\f': + result += "\\f"; + break; + case '\n': + result += "\\n"; + break; + case '\r': + result += "\\r"; + break; + case '\t': + result += "\\t"; + break; + default: + if ( isControlCharacter( c ) ) + { + std::ostringstream oss; + oss << "\\u" << std::hex << std::uppercase << std::setfill('0') << std::setw(4) << static_cast(c); + result += oss.str(); + } + else + { + result += c; + } + break; + } + } + return result; +} + +#if 0 std::string json_convert_string(std::string s) { std::stringstream ss; - for (size_t i = 0; i < s.length(); ++i) { - if (unsigned(s[i]) < '\x20' || s[i] == '\\' || s[i] == '"' || unsigned(s[i]) >= '\x80') { - ss << "\\u" << std::setfill('0') << std::setw(4) << std::hex - << unsigned(s[i]); + for (size_t i = 0; i < s.length(); ) { + unsigned char ch = unsigned(s[i]); + if(ch == 0x0d){ + ss << "\\u000d"; + i++; + continue; + } + if(ch == 0x0a){ + ss << "\\u000a"; + i++; + continue; + } + + if(ch < '\x20' || ch == '\\' || ch == '"' || ch >= '\x80') { + unsigned long unicode = 0; + size_t todo = 0; + if (ch <= 0xBF) { + } + else if (ch <= 0xDF) { + unicode = ch & 0x1F; + todo = 1; + } + else if (ch <= 0xEF) { + unicode = ch & 0x0F; + todo = 2; + } + else if (ch <= 0xF7) { + unicode = ch & 0x07; + todo = 3; + } + for (size_t j = 0; j < todo; ++j){ + ++i; + unicode <<= 6; + unicode += unsigned(s[i]) & 0x3F; + } + if (unicode <= 0xFFFF) + { + ss << "\\u" << std::setfill('0') << std::setw(4) << std::hex << unicode; + }else + { + unicode -= 0x10000; + ss << "\\u" << std::setfill('0') << std::setw(4) << std::hex << ((unicode >> 10) + 0xD800); + ss << "\\u" << std::setfill('0') << std::setw(4) << std::hex << ((unicode & 0x3FF) + 0xDC00); + } } else { ss << s[i]; } + ++i; } return ss.str(); } -#pragma GCC diagnostic pop +#endif // 0 + +std::string yExecuteScript(std::string cmd) { + std::string script, para, result; + bool found = false; + + //aprintf("%s: %s\n", __func__, cmd.c_str()); + + // 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 < CControlAPI::PLUGIN_DIR_COUNT && !found; i++) { + fullfilename = CControlAPI::PLUGIN_DIRS[i] + "/" + script; + FILE *test = fopen(fullfilename.c_str(), "r"); // use fopen: popen does not work + if (test != NULL) { + fclose(test); + chdir(CControlAPI::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("%s: script %s not found in:\n", __func__, script.c_str()); + for (unsigned int i = 0; i < CControlAPI::PLUGIN_DIR_COUNT; i++) { + printf("\t%s\n", CControlAPI::PLUGIN_DIRS[i].c_str()); + } + result = "error"; + } + return result; +} diff --git a/src/nhttpd/yhttpd_core/helper.h b/src/nhttpd/yhttpd_core/helper.h index 22a917e8b..d322c04ad 100644 --- a/src/nhttpd/yhttpd_core/helper.h +++ b/src/nhttpd/yhttpd_core/helper.h @@ -48,5 +48,12 @@ std::string json_out_pair(std::string _key, std::string _value); std::string json_out_success(std::string _result); std::string json_out_error(std::string _error); std::string json_convert_string(std::string s); +/// Returns true if ch is a control character (in range [0,32]). +static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F;} + +//----------------------------------------------------------------------------- +// Script Helpers +//----------------------------------------------------------------------------- +std::string yExecuteScript(std::string cmd); #endif /* __yhttpd_helper_h__ */ diff --git a/src/nhttpd/yhttpd_core/yconnection.cpp b/src/nhttpd/yhttpd_core/yconnection.cpp index d45809bce..074c78584 100644 --- a/src/nhttpd/yhttpd_core/yconnection.cpp +++ b/src/nhttpd/yhttpd_core/yconnection.cpp @@ -52,6 +52,7 @@ CWebserverConnection::CWebserverConnection() { enlapsed_request = 0; enlapsed_response = 0; ConnectionNumber = ++GConnectionNumber; + Webserver = NULL; } //------------------------------------------------------------------------- CWebserverConnection::~CWebserverConnection(void) { diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index b4aa79e0a..56537c057 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -13,6 +13,29 @@ #include "ylogging.h" #include "helper.h" +//============================================================================= +// Constructor & Ceconstructor +//============================================================================= +CyhookHandler::CyhookHandler() +{ + ContentLength = 0; + RangeStart = 0; + RangeEnd = -1; + cached = false; + keep_alive = 0; + _outIndent = 0; + status = HANDLED_NONE; + Method = M_UNKNOWN; + httpStatus = HTTP_NIL; + outType = plain; + nonPair = false; + LastModified=0; +} + +CyhookHandler::~CyhookHandler() +{ +} + //============================================================================= // Initialization of static variables //============================================================================= @@ -50,7 +73,7 @@ THandleStatus CyhookHandler::Hooks_SendResponse() { //----------------------------------------------------------------------------- THandleStatus CyhookHandler::Hooks_PrepareResponse() { log_level_printf(4, "PrepareResponse Hook-List Start\n"); - outType = checkOutput(); + outType = getOutType(); THandleStatus _status = HANDLED_NONE; THookList::iterator i = HookList.begin(); for (; i != HookList.end(); ++i) { @@ -343,6 +366,19 @@ std::string CyhookHandler::BuildHeader(bool cache) { return result; } +bool CyhookHandler::ParamList_exist(std::string keyword) +{ + bool exist = false; + unsigned int s = ParamList.size(); + for (unsigned int i = 1; i <= s; i++) + { + exist = (ParamList[itoa(i)] == keyword); + if (exist) + break; + } + return exist; +} + //============================================================================= // Output helpers //============================================================================= @@ -369,27 +405,24 @@ void CyhookHandler::printf(const char *fmt, ...) { Write(outbuf); } //----------------------------------------------------------------------------- -TOutType CyhookHandler::checkOutput() { - // get outType - outType = plain; // plain +TOutType CyhookHandler::getOutType() { + TOutType _outType = plain; if(!(ParamList.empty())) { if ((ParamList.find("format") != ParamList.end() && ParamList["format"] == "json") || (ParamList.find("json") != ParamList.end() && !(ParamList["json"].empty())) ) - outType = json; + _outType = json; else if ((ParamList.find("format") != ParamList.end() && ParamList["format"] == "xml") || (ParamList.find("xml") != ParamList.end() && !(ParamList["xml"].empty())) ) - outType = xml; + _outType = xml; } - return outType; + return _outType; } //----------------------------------------------------------------------------- -TOutType CyhookHandler::outStart() { +TOutType CyhookHandler::outStart(bool single) { + // for compatibility + nonPair = single; // get outType - outType = plain; // plain - if (ParamList["format"] == "json") - outType = json; - else if (ParamList["format"] == "xml" || !(ParamList["xml"].empty()) ) - outType = xml; + outType = getOutType(); // set response header if (outType == xml) SetHeader(HTTP_OK, "text/xml; charset=UTF-8"); @@ -403,16 +436,46 @@ TOutType CyhookHandler::outStart() { std::string CyhookHandler::outIndent() { return ""; } + +//----------------------------------------------------------------------------- +std::string CyhookHandler::outSingle(std::string _content) { + return _content + "\n"; +} + //----------------------------------------------------------------------------- std::string CyhookHandler::outPair(std::string _key, std::string _content, bool _next) { std::string result = ""; switch (outType) { case xml: result = outIndent() + "<" + _key + ">" + _content + ""; - result += "\n"; break; case json: result = outIndent() + "\"" + _key + "\": \"" + _content + "\""; + if(_next) + result += ","; + break; + default: + if (nonPair) + result = _content; + else + result = _key + "=" + _content; + break; + } + return result + "\n"; +} + +//----------------------------------------------------------------------------- +std::string CyhookHandler::outArray(std::string _key, std::string _content, bool _next) { + std::string result = ""; + switch (outType) { + case xml: + //TODO: xml check and DESC check + result = outIndent() + "<" + _key + ">\n" + _content + ""; + result += "\n"; + break; + case json: + //TODO: json check + result = outIndent() + "\"" + _key + "\": [" + _content + "]"; if(_next) result += ","; result += "\n"; @@ -424,25 +487,6 @@ std::string CyhookHandler::outPair(std::string _key, std::string _content, bool return result; } -//----------------------------------------------------------------------------- -std::string CyhookHandler::outArray(std::string _key, std::string _content) { - std::string result = ""; - switch (outType) { - case xml: - //TODO: xml check and DESC check - result = outIndent() + "<" + _key + ">\n" + _content + ""; - break; - case json: - //TODO: json check - result = outIndent() + "\"" + _key + "\": [" + _content + "]"; - break; - default: - result = _content; - break; - } - return result + "\n"; -} - //----------------------------------------------------------------------------- std::string CyhookHandler::outArrayItem(std::string _key, std::string _content, bool _next) { std::string result = ""; @@ -450,36 +494,42 @@ std::string CyhookHandler::outArrayItem(std::string _key, std::string _content, case xml: //TODO: xml check and DESC check result = outIndent() + "<" + _key + ">\n" + _content + ""; + result += "\n"; break; case json: //TODO: json check result = outIndent() + "{" + _content + "}"; if(_next) result += ","; + result += "\n"; break; default: result = _content; break; } - return result + "\n"; + return result; } //----------------------------------------------------------------------------- -std::string CyhookHandler::outCollection(std::string _key, std::string _content) { +std::string CyhookHandler::outObject(std::string _key, std::string _content, bool _next) { std::string result = ""; switch (outType) { case xml: //TODO: xml check and DESC check result = outIndent() + "<" + _key + ">\n" + _content + ""; + result += "\n"; break; case json: //TODO: json check result = outIndent() + "\"" + _key + "\": {" + _content + "}"; + if(_next) + result += ","; + result += "\n"; break; default: result = _content; break; } - return result + "\n"; + return result; } //----------------------------------------------------------------------------- @@ -491,7 +541,6 @@ std::string CyhookHandler::outValue(std::string _content) { break; case json: result = json_convert_string(_content); -// result = _content; break; default: @@ -508,3 +557,60 @@ std::string CyhookHandler::outNext() { return ""; } +//----------------------------------------------------------------------------- +void CyhookHandler::SendOk() { + std::string result = ""; + switch (outType) { + case xml: + result = "true"; + break; + case json: + result = "{\"success\": \"true\"}"; + break; + default: + result = "ok"; + break; + } + Write(result); +} +//----------------------------------------------------------------------------- +void CyhookHandler::SendError(std::string error) { + std::string result = ""; + switch (outType) { + case xml: + if (error.empty()) + result = "false"; + else + result = "false" + error + ""; + break; + case json: + if (error.empty()) + result = "{\"success\": \"false\"}"; + else + result = "{\"success\": \"false\", \"error\":{\"msg\": \"" + error + "\"}}"; + break; + default: + if (error.empty()) + result = "error"; + else + result = "error=" + error; + break; + } + Write(result); +} +//----------------------------------------------------------------------------- +void CyhookHandler::SendResult(std::string _content) { + std::string result = ""; + switch (outType) { + case xml: + result = _content; + break; + case json: + result = json_out_success(_content); + break; + default: + result = _content; + break; + } + WriteLn(result); +} diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index a9c23fe3c..0fefe46a8 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -123,6 +123,9 @@ class CyhookHandler protected: static THookList HookList; public: + CyhookHandler(); + ~CyhookHandler(); + // Output std::string yresult; // content for response output THandleStatus status; // status of Hook handling @@ -136,6 +139,7 @@ public: std::string Sendfile; // Path & Name (local os style) of file to send bool keep_alive; bool cached; // cached by mod_cache + bool nonPair; // Input CStringList ParamList; // local copy of ParamList (Request) @@ -144,9 +148,6 @@ public: CStringList WebserverConfigList; // Reference (writable) to ConfigList CStringList HookVarList; // Variables in Hook-Handling passing to other Hooks THttp_Method Method; // HTTP Method (requested) - // constructor & deconstructor - CyhookHandler(){ContentLength = 0; RangeStart = 0; RangeEnd = -1; cached = false; keep_alive = 0; _outIndent = 0;status = HANDLED_NONE;Method = M_UNKNOWN;httpStatus = HTTP_NIL;outType = plain;}; - virtual ~CyhookHandler(){}; // hook slot handler static void attach(Cyhook *yh) // attach a Hook-Class to HookHandler @@ -191,21 +192,25 @@ public: void WriteLn(char const *text) {WriteLn(std::string(text));} void SendHTMLHeader(const std::string& Titel); void SendHTMLFooter(void); - void SendOk(void) {(ParamList["response"]=="json") ? Write("{\"success\": \"true\"}") : Write("ok");} - void SendError(void) {(ParamList["response"]=="json") ? Write("{\"success\": \"false\"}") : Write("error");} + void SendOk(void); + void SendError(std::string error = ""); + void SendResult(std::string _content); void SendFile(const std::string& url) {NewURL = url; status = HANDLED_SENDFILE;} void SendRedirect(const std::string& url) {httpStatus=HTTP_MOVED_TEMPORARILY; NewURL = url; status = HANDLED_REDIRECTION;} void SendRewrite(const std::string& url) {NewURL = url; status = HANDLED_REWRITE;} + bool ParamList_exist(std::string keyword); + int _outIndent; TOutType outType; // Outputtpe = plain (default)|xml|json - TOutType outStart(); - TOutType checkOutput(); + TOutType outStart(bool single = false); + TOutType getOutType(); std::string outIndent(); + std::string outSingle(std::string _content); std::string outPair(std::string _key, std::string _content, bool _next); - std::string outArray(std::string _key, std::string _content); + std::string outArray(std::string _key, std::string _content, bool _next = false); std::string outArrayItem(std::string _key, std::string _content, bool _next); - std::string outCollection(std::string _key,std::string _content); + std::string outObject(std::string _key,std::string _content, bool _next = false); std::string outValue(std::string _content); std::string outNext(); friend class CyParser; diff --git a/src/nhttpd/yhttpd_core/yrequest.cpp b/src/nhttpd/yhttpd_core/yrequest.cpp index 16a1932c0..2b4ae42af 100644 --- a/src/nhttpd/yhttpd_core/yrequest.cpp +++ b/src/nhttpd/yhttpd_core/yrequest.cpp @@ -38,6 +38,7 @@ CWebserverRequest::CWebserverRequest(CWebserver *pWebserver) { Webserver = pWebserver; CWebserverRequest(); + Connection=NULL; } //============================================================================= @@ -123,9 +124,8 @@ bool CWebserverRequest::ParseStartLine(std::string start_line) { analyzeURL(url); UrlData["httprotocol"] = Connection->httprotocol; // determine http Method - if (method.compare("POST") == 0) Connection->Method = M_POST; + if (method.compare("POST") == 0) Connection->Method = M_POST; else if (method.compare("GET") == 0) Connection->Method = M_GET; - else if (method.compare("PUT") == 0) Connection->Method = M_PUT; else if (method.compare("HEAD") == 0) Connection->Method = M_HEAD; else if (method.compare("PUT") == 0) Connection->Method = M_PUT; else if (method.compare("DELETE") == 0) Connection->Method = M_DELETE; diff --git a/src/nhttpd/yhttpd_core/yresponse.cpp b/src/nhttpd/yhttpd_core/yresponse.cpp index aeb4701ba..948a7f08e 100644 --- a/src/nhttpd/yhttpd_core/yresponse.cpp +++ b/src/nhttpd/yhttpd_core/yresponse.cpp @@ -34,6 +34,7 @@ CWebserverResponse::CWebserverResponse(CWebserver *pWebserver) { Webserver = pWebserver; CWebserverResponse(); + Connection=NULL; } //----------------------------------------------------------------------------- CWebserverResponse::CWebserverResponse() { diff --git a/src/nhttpd/yhttpd_core/ysocket.cpp b/src/nhttpd/yhttpd_core/ysocket.cpp index 4b3f4c6cf..93b1af233 100644 --- a/src/nhttpd/yhttpd_core/ysocket.cpp +++ b/src/nhttpd/yhttpd_core/ysocket.cpp @@ -291,6 +291,7 @@ int CySocket::Send(char const *buffer, unsigned int length) { BytesSend += len; return len; } +#if 0 //never used //----------------------------------------------------------------------------- // Check if Socket was closed by client //----------------------------------------------------------------------------- @@ -303,7 +304,7 @@ bool CySocket::CheckSocketOpen() { return !(recv(sock, buffer, sizeof(buffer), MSG_PEEK | MSG_DONTWAIT) == 0); #endif } - +#endif //============================================================================= // Aggregated Send- and Receive- Operations //============================================================================= diff --git a/src/nhttpd/yhttpd_core/ysocket.h b/src/nhttpd/yhttpd_core/ysocket.h index 8cd1b172e..06396b4c0 100644 --- a/src/nhttpd/yhttpd_core/ysocket.h +++ b/src/nhttpd/yhttpd_core/ysocket.h @@ -68,8 +68,9 @@ public: // send & receive (basic) int Read(char *buffer, unsigned int length); // Read a buffer (normal or SSL) int Send(char const *buffer, unsigned int length); // Send a buffer (normal or SSL) +#if 0 //#endif bool CheckSocketOpen(); // check if socket was closed by client - +#endif // send & receive bool SendFile(int filed, off_t start = 0, off_t size = -1); // Send a File std::string ReceiveBlock(); // receive a Block. Look at length diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index b75231fc7..bcef54ea4 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -397,7 +397,7 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd) { yresult = ""; } } 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)) { @@ -636,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 95f0ba988..60197e06a 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -46,7 +46,7 @@ #include #include #include "debug.h" -#include +#include #include #include using namespace std; @@ -441,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]; @@ -490,6 +512,8 @@ std::string& htmlEntityDecode(std::string& text) }; decode_table dt[] = { + {"\n", " "}, + {"\n", " "}, {" ", " "}, {"&", "&"}, {"<", "<"}, @@ -911,3 +935,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 f8a51edfa..42c86dd7f 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -67,6 +67,7 @@ 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); @@ -116,5 +117,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/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 0bde8d6b9..54ceee3fb 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, @@ -904,6 +919,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, @@ -953,9 +972,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, @@ -1038,6 +1066,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, @@ -1052,6 +1081,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, @@ -1097,7 +1128,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, @@ -1110,6 +1140,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, @@ -1167,6 +1198,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, @@ -1178,6 +1210,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, @@ -1259,6 +1292,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, @@ -1389,6 +1423,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, @@ -1397,6 +1433,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, @@ -1414,6 +1452,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, @@ -1451,6 +1491,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, @@ -1529,6 +1571,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, @@ -1693,6 +1736,7 @@ 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, @@ -1742,6 +1786,7 @@ 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, @@ -1790,9 +1835,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, @@ -2014,6 +2059,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, @@ -2024,6 +2070,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, @@ -2031,6 +2079,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, @@ -2235,6 +2284,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, @@ -2354,6 +2405,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, @@ -2372,6 +2426,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, @@ -2459,6 +2514,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 bc5c07f62..7c5c6e304 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", @@ -904,6 +919,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", @@ -953,9 +972,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", @@ -1038,6 +1066,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", @@ -1052,6 +1081,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", @@ -1097,7 +1128,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", @@ -1110,6 +1140,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", @@ -1167,6 +1198,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", @@ -1178,6 +1210,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", @@ -1259,6 +1292,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", @@ -1389,6 +1423,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", @@ -1397,6 +1433,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", @@ -1414,6 +1452,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", @@ -1451,6 +1491,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", @@ -1529,6 +1571,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", @@ -1693,6 +1736,7 @@ 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", @@ -1742,6 +1786,7 @@ 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", @@ -1790,9 +1835,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", @@ -2014,6 +2059,7 @@ const char * locale_real_names[] = "pinprotection.head", "pinprotection.wrongcode", "plugins.hdd_dir", + "plugins.no_plugin", "plugins.result", "plugintype.disabled", "plugintype.game", @@ -2024,6 +2070,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", @@ -2031,6 +2079,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", @@ -2235,6 +2284,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", @@ -2354,6 +2405,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", @@ -2372,6 +2426,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", @@ -2459,6 +2514,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 e86d778ce..41c5c4bbd 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -172,12 +172,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) ); @@ -208,10 +213,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, @@ -379,12 +384,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; } @@ -397,7 +410,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; } @@ -409,11 +422,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 c47ae028e..364939a75 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; @@ -444,6 +455,7 @@ struct SNeutrinoSettings int recording_startstop_msg; int shutdown_timer_record_type; std::string recording_filename_template; + int recording_already_found_check; int filesystem_is_utf8; // default plugin for ts-movieplayer (red button) @@ -495,6 +507,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 +575,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 +651,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, @@ -709,6 +729,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; @@ -717,6 +739,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; @@ -725,6 +750,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; @@ -733,9 +762,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 { @@ -780,6 +813,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 { @@ -807,8 +843,6 @@ struct SNeutrinoSettings }; }; -/* some default Values */ - extern const struct personalize_settings_t personalize_settings[SNeutrinoSettings::P_SETTINGS_MAX]; typedef struct time_settings_t @@ -855,9 +889,6 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO // shadow #define SHADOW_OFFSET 6 -/* end default values */ - - struct SglobalInfo { unsigned char box_Type; @@ -875,7 +906,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/timermanager.cpp b/src/timerd/timermanager.cpp index ff6757cd0..6d9c12f3e 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; @@ -1294,9 +1295,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/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/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 6175b55b6..6bf61aa9e 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -517,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); 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..ad72aed29 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -513,8 +513,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 +554,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... */ @@ -2790,7 +2790,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 +2798,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"