diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index e8870129e..64f5dce5b 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -128,6 +128,10 @@ audiomenu.pref_subs_head Untertitelwahl audiomenu.spdif_dd Dolby Digital über S/PDIF audiomenu.stereo stereo audiomenu.volume_adjust Lautstärke ändern, in % +audiomenu.volume_adjustment Lautstärkeanpassung pro Kanal +audiomenu.volume_adjustment_ac3 AC3-Tonspuren +audiomenu.volume_adjustment_clear Gespeicherte Werte löschen +audiomenu.volume_adjustment_pcm PCM-Tonspuren audiomenu.volume_start Einschaltlautstärke audiomenu.volume_step Lautstärke Schrittweite audioplayer.add Hinzufügen @@ -188,6 +192,7 @@ bouqueteditor.discardingchanges Änderungen werden verworfen. Bitte warten ... bouqueteditor.hide Verstecken bouqueteditor.lock Sperren bouqueteditor.move Bewegen +bouqueteditor.move_to Bewegen zu bouqueteditor.name Bouquet-Verwaltung bouqueteditor.newbouquetname Neuer Name des Bouquets bouqueteditor.rename Umbenennen @@ -241,7 +246,7 @@ channellist.new_zap_mode_active aktiv channellist.new_zap_mode_allow erlauben channellist.new_zap_mode_off aus channellist.nonefound Es wurden keine Kanäle gefunden!\nFühren Sie bitte eine Kanalsuche durch\n(MENU-Taste -> Service) -channellist.numeric_adjust Numeric zap adjust +channellist.numeric_adjust Bei numerischem Zap Kanalliste nachführen channellist.provs Anbieter channellist.recording_not_possible Aufnahme nicht möglich! channellist.remember Zuletzt verwendete @@ -250,6 +255,7 @@ channellist.reset_flags Entferne Kanal-Markierung "Neu" channellist.sats Satelliten channellist.show_channellogo Senderlogos zeigen channellist.show_channelnumber Kanalnummern zeigen +channellist.show_empty_favs Zeige leere Favoriten-Bouquets channellist.since seit channellist.start Start ci.clock CI Takt (Mhz) @@ -526,6 +532,7 @@ favorites.copy Kopiere Bouquet zu Favoriten favorites.finalhint \nVersehentlich hinzugefügte Kanäle können mit\nder Bouquetverwaltung korrigiert werden.\n favorites.menueadd Kanal Favoriten hinzufügen favorites.nobouquets Favoriten sind nur mit aktivierten Bouquets möglich. +filebrowser.add Hinzufügen filebrowser.delete Löschen filebrowser.denydirectoryleave Startverzeichnis absolut filebrowser.dodelete1 Soll @@ -535,6 +542,7 @@ filebrowser.filter.inactive Filter aus filebrowser.head Dateibrowser filebrowser.mark Markieren filebrowser.nextpage Seite vor +filebrowser.pm Playlist Manager filebrowser.prevpage Seite zurück filebrowser.scan Durchsuche Verzeichnisse filebrowser.select Auswählen @@ -554,6 +562,7 @@ flashupdate.cantopenfile kann Datei nicht öffnen flashupdate.cantopenmtd kann MTD nicht öffnen flashupdate.checkupdate_internet Online nach Updates suchen flashupdate.checkupdate_local Lokales Update +flashupdate.copy_image Kopiere Image in den Arbeitsspeicher flashupdate.createimage Image speichern flashupdate.createimage_add_env 'env' hinzufügen flashupdate.createimage_add_kernel 'kernel' hinzufügen @@ -644,12 +653,12 @@ fontmenu.head Schrift fontmenu.infobar Infobar fontmenu.menu Menü fontmenu.other Andere -fontmenu.scaling Schriftgrössenfaktor +fontmenu.scaling Schriftgrößenfaktor fontmenu.scaling_x Horizontal (in %) fontmenu.scaling_x_hint2 Horizontal (in %) min 50 / max 200 fontmenu.scaling_y Vertikal (in %) fontmenu.scaling_y_hint2 Vertikal (in %) min 50 / max 200 -fontmenu.sizes Schriftgrössen +fontmenu.sizes Schriftgrößen fontsize.channel_num_zap Direktauswahl fontsize.channellist Kanalliste fontsize.channellist_descr Beschreibung @@ -807,7 +816,7 @@ lcdcontroler.brightnessdeepstandby Deep-Standby lcdcontroler.brightnessstandby Standby lcdmenu.dim_brightness nach Dimm-Timeout lcdmenu.dim_time Dimm-Timeout -lcdmenu.head VFD Einstellungen +lcdmenu.head VFD/LED Einstellungen lcdmenu.lcdcontroler Helligkeit lcdmenu.scroll Laufschrift lcdmenu.statusline Statuszeile @@ -861,7 +870,7 @@ mainsettings.audio Audio mainsettings.head Einstellungen mainsettings.keybinding Tasten mainsettings.language Sprache -mainsettings.lcd VFD-Display +mainsettings.lcd Front-Panel mainsettings.manage Einstellungen verwalten mainsettings.misc Erweiterte Einstellungen mainsettings.multimedia Multimedia @@ -876,7 +885,11 @@ menu.back Zurück menu.cancel Abbrechen menu.hint_a_pic Konfigurieren Sie den Audioplayer und den Bildbetrachter 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 +menu.hint_audio_adjust_vol_ac3 Lautstärkeanpassung für AC3-Tonspuren +menu.hint_audio_adjust_vol_clear Alle gespeicherten Werte für AC3- und PCM-Tonspuren löschen +menu.hint_audio_adjust_vol_pcm Lautstärkeanpassung für PCM-Tonspuren menu.hint_audio_analog_mode Wählen Sie den Modus des Ausgangssignals für den CINCH-Anschluss menu.hint_audio_avsync Diese Funktion synchronisiert Bild und Ton menu.hint_audio_dd Ist diese Option aktiviert, wird automatisch auf Dolby Digital Ton geschalten, sobald dieser verfügbar ist @@ -920,6 +933,7 @@ menu.hint_channellist_mode_radio Wählen Sie die Start-Kanalliste im Radio-Modus menu.hint_channellist_setup Wählen Sie die Anzeigeoptionen für die Kanalliste menu.hint_channellist_show_channellogo Zeigt Senderlogos in der Kanalliste. menu.hint_channellist_show_channelnumber Zeigt Kanalnummer in der Kanalliste. +menu.hint_channellist_show_empty_favs Zeigt oder versteckt leere Bouquets in den Favoriten menu.hint_channels Kanalliste öffnen menu.hint_ci Conditional-Access-Menü zum Einrichten Ihres CI-Moduls oder der eingebetteten Conax-Karte menu.hint_clock_background Lassen Sie die Uhr mit Hintergrund anzeigen @@ -941,8 +955,10 @@ menu.hint_epg_extendedcache Maximum in Stunden, die die EPG-Daten bzw. die Event menu.hint_epg_fonts Ändern Sie die Schriftgrößen der EPG-Details menu.hint_epg_max_events Maxiale Anzahl der Events im Zwischenspeicher menu.hint_epg_old_events Veraltete EPG-Daten werden nach dieser Zeit (in Stunden) verworfen -menu.hint_epg_save Speichert die EPG-Daten auf einem externen Datenträger und läd es von dort nach einen Neustart -menu.hint_epg_save_standby Speichert die EPG-Daten auch im Standby-Modus +menu.hint_epg_read Liest nach einem Neustart die EPG-Daten von einem externen Datenträger wieder ein +menu.hint_epg_save Speichert die EPG-Daten beim Herunterfahren auf einem externen Datenträger +menu.hint_epg_save_frequently Speichert die EPG-Daten in regelmäßigen Abständen auf einem externen Datenträger +menu.hint_epg_save_standby Speichert die EPG-Daten auch, wenn in den Standby-Modus geschalten wird 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_event_textcolor Ändern Sie die Farbe für farbige Events in der Kanalliste und der Infobar @@ -1086,6 +1102,7 @@ menu.hint_misc_filebrowser Dateisystem, Dateirechte anzeigen im Dateibrowser, St menu.hint_misc_general Standby-, Teletext- und Rotor-Einstellungen, Pluginverzeichnis auf externem Datenträger 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 menu.hint_movieplayer_plugin Wählen Sie ein Plugin, das mit einer Schnellstart-Taste im Movieplayer-Modus gestartet wird menu.hint_net_broadcast Ändern Sie die Broadcast-Adresse.\nWenn Sie unsicher sind, verwenden Sie zuletzt .255 menu.hint_net_dhcp Verwenden Sie einen DHCP-Server für die automatische Vergabe einer IP-Adresse im Netzwerk @@ -1122,7 +1139,7 @@ menu.hint_net_ushare Freigabe verbundener Datenträger über UPnP menu.hint_net_xupnpd Freigabe von Live Channels über UPNP menu.hint_network IP-Adresse, Gateway, DNS, Zeit-Sync, Netzwerk-Freigaben, Dienste und mehr menu.hint_new_zap_mode Aktiviert Quickzap in der Kanalliste. Nach Betätigen der Mute-Taste wird mit den Hoch/Runter-Tasten direkt umgeschalten -menu.hint_numeric_adjust Adjust channel list mode on numeric zap +menu.hint_numeric_adjust Bei numerischer Programmwahl die Kanalliste am neu gewählten Programm ausrichten menu.hint_opkg Hier können Sie neue Software-Pakete installieren oder vorhandene aktualisieren menu.hint_opkg_upgrade Aktualisiert alle installierten Pakete auf die neueste verfügbare Version menu.hint_osd Farben, Schriftarten, Anzeigegröße, Ansichtsoptionen der Menüs und mehr @@ -1137,6 +1154,7 @@ menu.hint_parentallock_prompt Legen Sie fest, wann die Eingabe einer PIN erfolge menu.hint_personalize Personalisieren Sie ihre Menüs und konfigurieren Sie ihre Benutzermenüs menu.hint_pictureviewer_defdir Wählen Sie das Startverzeichnis für den Bildbetrachter menu.hint_pictureviewer_scaling Stellen Sie die Bildauflösung ein +menu.hint_pictureviewer_setup Konfigurieren Sie die Bildbetrachter-Optionen menu.hint_pictureviewer_slide_time Ändern Sie den Diashow-Intervall.\nStandardmäßig sind 10 Sekunden eingstellt menu.hint_picview Bilder anzeigen menu.hint_plugin_type_games Legt fest, ob Spiele im Benutzermenü unter der Rubrik 'Plugin-Typen' gezeigt werden sollen @@ -1200,6 +1218,7 @@ menu.hint_scan_auto Automatischer Suchlauf ausgewählter Anbieter menu.hint_scan_autoall Automatischer Suchlauf aller ausgewählten Anbieter menu.hint_scan_autoall_select Suchlauf nur in ausgewählten Satelliten menu.hint_scan_bouquet erneuern: hinzufügen zu den Bouquets, löschen: entfernt alte Bouquets, nicht ändern: neue werden in 'Andere' angefügt +menu.hint_scan_bouquet_writenames Originale Programmnamen in Bouquets speichern \nNie > nur Favoriten > nur Anbieter > Beide menu.hint_scan_bw Wählen Sie die Bandbreite menu.hint_scan_cable Wählen Sie ihr Kabelnetz für den Suchlauf menu.hint_scan_cable_simple Kabel-Suchlauf mit optionaler Anbieter- und Kanal-Nummerierung @@ -1342,6 +1361,7 @@ 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_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 (Menü zum Beenden) messagebox.back Zurück @@ -1373,7 +1393,9 @@ miscsettings.epg_max_events_hint2 Standard 6000, 0 (ohne Limit) miscsettings.epg_old_events EPG verwerfen nach (Std.) miscsettings.epg_old_events_hint1 Wie lange abgelaufene EPG-Daten aufheben? miscsettings.epg_old_events_hint2 Angabe in Stunden +miscsettings.epg_read Gespeicherte EPG-Daten einlesen miscsettings.epg_save EPG zwischenspeichern +miscsettings.epg_save_frequently EPG regelmäßig speichern miscsettings.epg_save_standby EPG speichern in Standby-Modus miscsettings.epg_scan Hintergrundscan EPG miscsettings.epg_scan_always Immer @@ -1485,6 +1507,7 @@ moviebrowser.book_movieend Filmende: moviebrowser.book_moviestart Filmstart: moviebrowser.book_name Name: moviebrowser.book_new Neue Markierung +moviebrowser.book_no_end Keine Endmarkierung gefunden moviebrowser.book_position Position: moviebrowser.book_type Sprung (<0 zurück, >0 vor): moviebrowser.book_type_backward Wiederholung @@ -1495,7 +1518,15 @@ moviebrowser.browser_row_item Spalteninfo moviebrowser.browser_row_nr Anzahl Spalten moviebrowser.browser_row_width Spaltenbreite [% der Gesamtbreite] moviebrowser.cache_dir Cache-Verzeichnis +moviebrowser.copies Kopiere Sprungmarken vom Film in neue Dateien? +moviebrowser.copy Kopiere Sprungmarken vom Film in neue Datei? +moviebrowser.copy_failed Fehler beim Kopieren. Sind Sprungmarken und genug freier Speicher vorhanden? +moviebrowser.copying Kopiere Sprungmarken, bitte warten ... +moviebrowser.cut Schneide Sprungmarken aus dem Film? +moviebrowser.cut_failed Fehler beim Schneiden. Sind Sprungmarken und genug freier Speicher vorhanden? +moviebrowser.cutting Schneide Film, bitte warten ... moviebrowser.delete_info Lösche Dateien, bitte warten... +moviebrowser.delete_screenshot Lösche Screenshot? moviebrowser.dir Pfad moviebrowser.dir_head Zusätzliche Verzeichnisse moviebrowser.edit_book Bookmark Ändern @@ -1526,12 +1557,13 @@ moviebrowser.hint_newbook_forward Neuer Werbesprung\n 'blue' für Endposition moviebrowser.info_audio Audio moviebrowser.info_channel Kanal moviebrowser.info_file Datei -moviebrowser.info_filename Name +moviebrowser.info_filename Dateiname moviebrowser.info_genre_major Genre -moviebrowser.info_genre_minor Genre +moviebrowser.info_genre_minor Genre (untergeordnet) moviebrowser.info_head Film Informationen moviebrowser.info_head_update Inhalte in allen sichtbaren Filminfos speichern moviebrowser.info_info1 Info 1 +moviebrowser.info_info2 Info 2 moviebrowser.info_length Spieldauer (Min) moviebrowser.info_parental_lockage FSK moviebrowser.info_parental_lockage_0year immer @@ -1547,9 +1579,9 @@ moviebrowser.info_prodyear Jahr moviebrowser.info_quality Qualität moviebrowser.info_recorddate Aufnahmedatum moviebrowser.info_serie Serie -moviebrowser.info_size Dateigrösse (MB) +moviebrowser.info_size Dateigröße (MB) moviebrowser.info_title Titel -moviebrowser.info_videoformat Bild +moviebrowser.info_videoformat Bildformat moviebrowser.last_play_max_items Zeilen 'zuletzt aufgenommen' moviebrowser.last_record_max_items Zeilen 'zuletzt gesehen' moviebrowser.load_default Lade Voreinstellung @@ -1591,10 +1623,14 @@ moviebrowser.short_prodyear Jahr moviebrowser.short_quality Qualität moviebrowser.short_recorddate Datum moviebrowser.short_serie Serie -moviebrowser.short_size Grösse +moviebrowser.short_size Größe moviebrowser.short_title Titel moviebrowser.start_head Film starten von Position: moviebrowser.start_record_start Aufnahmestart +moviebrowser.truncate Film kürzen? +moviebrowser.truncate_failed Fehler beim Kürzen des Films +moviebrowser.truncate_failed_playing Kürzen des Films während der Wiedergabe nicht möglich. +moviebrowser.truncating Kürze Film, bitte warten ... moviebrowser.ts_only Nur Aufnahmen zeigen moviebrowser.update_if_dest_empty_only Übernehmen nur wenn Ziel leer moviebrowser.use_dir Verzeichnis verwenden @@ -1768,6 +1804,7 @@ parentallock.never Nie parentallock.onsignal Bei gesendeter Vorsperre parentallock.parentallock Jugendschutz parentallock.prompt PIN-Eingabe +parentallock.zaptime Zap-Zeit für vorgesperrte Bouquets (Minuten) personalize.access Zugangsoptionen personalize.apply_settings Änderungen übernehmen? personalize.button_auto Auto @@ -1992,6 +2029,11 @@ scants.bouquet_erase löschen scants.bouquet_leave nicht ändern scants.bouquet_satellite Satelliten-Bouquet scants.bouquet_update erneuern +scants.bouquet_writenames Originalnamen in Bouquets schreiben +scants.bouquet_writenames_bouquets nur Anbieter +scants.bouquet_writenames_ever Beide +scants.bouquet_writenames_never Nie +scants.bouquet_writenames_ubouquets nur Favoriten scants.channel Kanal: scants.failed Kanalsuche fehlgeschlagen! scants.finished Kanalsuche erfolgreich beendet! @@ -2076,8 +2118,11 @@ streaming.dir_not_writable Das Aufnahmeverzeichnis ist nicht beschreibbar.\nAufn streaming.overflow Aufnahme-Puffer Überlauf! Bitte ggf. einige Aufnahmen beenden. streaming.slow System oder Datenträger zu langsam! Bitte ggf. einige Aufnahmen beenden. streaming.write_error Die Aufnahme wurde leider abgebrochen,\nda ein Fehler beim Schreiben der Daten auftrat. -stringinput.caps Groß-/Kleinbuchstaben +stringinput.backspace Rücklöschen +stringinput.caps Groß / Klein stringinput.clear Alles löschen +stringinput.insert Einfügen +stringinput.save Speichern subtitles.charset Zeichensatz subtitles.head Untertitel subtitles.stop Untertitel aus diff --git a/data/locale/english.locale b/data/locale/english.locale index 31428f7b7..9f3feb163 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -128,6 +128,10 @@ audiomenu.pref_subs_head Subtitle language preferences audiomenu.spdif_dd Encoded DD on SPDIF audiomenu.stereo stereo audiomenu.volume_adjust Volume adjustment, in % +audiomenu.volume_adjustment Channel specific volume adjustment +audiomenu.volume_adjustment_ac3 AC3 streams +audiomenu.volume_adjustment_clear Clear saved values +audiomenu.volume_adjustment_pcm PCM streams audiomenu.volume_start Start volume audiomenu.volume_step Volume step audioplayer.add Add @@ -188,6 +192,7 @@ bouqueteditor.discardingchanges Discarding changes. Please be patient. bouqueteditor.hide Hide bouqueteditor.lock Lock bouqueteditor.move Move +bouqueteditor.move_to Move to bouqueteditor.name Bouquet editor bouqueteditor.newbouquetname New name of bouquets bouqueteditor.rename Rename @@ -250,6 +255,7 @@ channellist.reset_flags Reset 'new' channel flag channellist.sats Satellites channellist.show_channellogo Show channel logos channellist.show_channelnumber Show channel numbers +channellist.show_empty_favs Show empty favorites bouquets channellist.since since channellist.start starts ci.clock CI clock (Mhz) @@ -487,6 +493,9 @@ extra.tp_mod_4_nr QAM/4-NR 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 Auto (HW) +extra.tp_pilot_auto_sw Auto (SW) extra.tp_pol Polarization extra.tp_pol_h H extra.tp_pol_l L @@ -526,6 +535,7 @@ favorites.copy Copy bouquet to Favorites favorites.finalhint \nUse the bouqueteditor to modify your favorites.\n favorites.menueadd add channel to favorites favorites.nobouquets Favorites are available with activated Bouquets only. +filebrowser.add Add filebrowser.delete Delete filebrowser.denydirectoryleave Absolute start directory filebrowser.dodelete1 Delete @@ -535,6 +545,7 @@ filebrowser.filter.inactive Filter off filebrowser.head Filebrowser filebrowser.mark Mark filebrowser.nextpage Next Page +filebrowser.pm Playlist Manager filebrowser.prevpage Prev. Page filebrowser.scan Scaning folder filebrowser.select Select @@ -554,6 +565,7 @@ flashupdate.cantopenfile can't open file flashupdate.cantopenmtd can't open MTD flashupdate.checkupdate_internet Check for online updates flashupdate.checkupdate_local Local update +flashupdate.copy_image Copy Image to main memory flashupdate.createimage Save image flashupdate.createimage_add_env Add 'env' to image flashupdate.createimage_add_kernel Add 'kernel' to image @@ -807,7 +819,7 @@ lcdcontroler.brightnessdeepstandby DeepStandby Brightness lcdcontroler.brightnessstandby Standby Brightness lcdmenu.dim_brightness Brightness after dim timeout lcdmenu.dim_time Dim timeout -lcdmenu.head VFD Settings +lcdmenu.head VFD/LED Settings lcdmenu.lcdcontroler Brightness lcdmenu.scroll Enable text scroll lcdmenu.statusline status line @@ -861,7 +873,7 @@ mainsettings.audio Audio mainsettings.head Settings mainsettings.keybinding Key Setup mainsettings.language Language / Timezone -mainsettings.lcd VFD-Display +mainsettings.lcd Front-Panel mainsettings.manage Manage settings mainsettings.misc Extended settings mainsettings.multimedia Multimedia @@ -876,7 +888,11 @@ menu.back Back menu.cancel Cancel menu.hint_a_pic Configure audio player and picture viewer 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 +menu.hint_audio_adjust_vol_ac3 Channel specific volume adjustment for AC3 streams +menu.hint_audio_adjust_vol_clear Clear all saved values for PCM and AC3 streams +menu.hint_audio_adjust_vol_pcm Channel specific volume adjustment for PCM streams menu.hint_audio_analog_mode Select audio channel to use\nstereo, mono-left, mono-right menu.hint_audio_avsync A/V sync menu.hint_audio_dd Auto-switch to DolbyDigital audio pid,\nif available @@ -920,6 +936,7 @@ menu.hint_channellist_mode_radio Use the selected channel list mode on startup i menu.hint_channellist_setup Configure channel list GUI options menu.hint_channellist_show_channellogo Show channel logos in channel list menu.hint_channellist_show_channelnumber Show channel number in channel list +menu.hint_channellist_show_empty_favs Show / hide empty bouquets in favorites menu.hint_channels Open channel list menu.hint_ci Conditional access menu\nto setup your CI CAM or embeded Conax card menu.hint_clock_background Show clock with theme's background color @@ -941,7 +958,9 @@ menu.hint_epg_extendedcache Maximum hours to cache extended\nevents descriptions menu.hint_epg_fonts Change EPG details window font sizes menu.hint_epg_max_events Maximum events to cache. After reaching limit\nEPG cache will remove future events menu.hint_epg_old_events Hours after event end time to consider\nevent old and remove it from cache -menu.hint_epg_save Save cached EPG to harddisk or usb flash\nand load it after boot +menu.hint_epg_read Read saved EPG data after boot from an external device +menu.hint_epg_save Save cached EPG data to an external device +menu.hint_epg_save_frequently Save cached EPG data in frequently intervals to an external device 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 @@ -1086,6 +1105,7 @@ menu.hint_misc_filebrowser Filesystem encoding, file rights\ndeny directory leav menu.hint_misc_general Start to standby, cache teletext, swp rotor\nplugin hdd dir menu.hint_misc_zapit Initial TV/Radio channels menu.hint_movie Play movies +menu.hint_moviebrowser_setup Set selection and display options. menu.hint_movieplayer_plugin Choose a plugin that's executed with the one touch key in movieplayer mode menu.hint_net_broadcast Enter broadcast address\nif unsure, use IP address with last .255 menu.hint_net_dhcp Use DHCP server to auto-configure @@ -1137,6 +1157,7 @@ menu.hint_parentallock_prompt Configure when Neutrino-HD will ask you\nfor PIN c menu.hint_personalize Enable, disable or Protect menu items\nConfigure color-buttons user menus menu.hint_pictureviewer_defdir Default picture viewer directory menu.hint_pictureviewer_scaling Picture scaling algorithm +menu.hint_pictureviewer_setup Configure pictureviewer behavior menu.hint_pictureviewer_slide_time Slideshow interval, in seconds menu.hint_picview View pictures menu.hint_plugin_type_games Show games in usermenu at selection 'Plugin types' @@ -1200,6 +1221,7 @@ menu.hint_scan_auto Auto-scan selected provider menu.hint_scan_autoall Scan several selected providers at once menu.hint_scan_autoall_select Add selected satellites to scan menu.hint_scan_bouquet Update: add to current bouquets, erase:\nremove old bouquets, leave: dont add or change +menu.hint_scan_bouquet_writenames Write services names to bouquets \n never > fovourites only > providers only > both menu.hint_scan_bw Select the channel bandwidth menu.hint_scan_cable Select cable network to scan menu.hint_scan_cable_simple Cable scan with optional\nprovider channel numbering @@ -1242,6 +1264,7 @@ menu.hint_scan_motorpos Select stored position number for this satellite,\nignor menu.hint_scan_nid Enter decimal network ID menu.hint_scan_nit Add transpoders from network information menu.hint_scan_pids Scan and save audio/video/PMT PIDs +menu.hint_scan_pilot Select pilot parameter menu.hint_scan_pol Select transponder polarization menu.hint_scan_rate Enter transponder symbol rate menu.hint_scan_reset_numbers Reset exising channel numbers\nand re-number channels after scan @@ -1310,7 +1333,7 @@ menu.hint_tools Run tools menu.hint_tvmode Switch box to TV mode menu.hint_tvradio_switch Switches between TV and Radio mode menu.hint_upnp Universal Plug and Play Browser -menu.hint_vfd Frontpanel LEDS, VFD options +menu.hint_vfd Frontpanel LEDs, VFD options menu.hint_vfd_brightness Working brightness menu.hint_vfd_brightness_setup Configure frontpanel display brightness\nfor different modes menu.hint_vfd_brightnessdeepstandby Brightness in deep-standby mode @@ -1331,6 +1354,7 @@ menu.hint_video_dbdr MPEG2 enhancement filters menu.hint_video_format TV aspect ratio menu.hint_video_mode HDMI output video mode menu.hint_video_modes VF key will cycle between enabled modes +menu.hint_video_modes_auto Enable modes to auto-select based on content menu.hint_video_pip Picture in picture size and position menu.hint_video_saturation Change picture saturation menu.hint_video_scart_mode Select analog output mode for SCART connectors @@ -1342,6 +1366,7 @@ 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_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 (press Menu to quit) messagebox.back Back @@ -1373,8 +1398,10 @@ miscsettings.epg_max_events_hint2 normaly 6000, 0 to disable limit miscsettings.epg_old_events EPG remove after (std.) miscsettings.epg_old_events_hint1 How long will EPG-Data be stored after they timed out? miscsettings.epg_old_events_hint2 Set in hours -miscsettings.epg_save Save/Restore epg on reboot -miscsettings.epg_save_standby Save epg on soft standby +miscsettings.epg_read Restore EPG on boot +miscsettings.epg_save Save EPG on shutdown +miscsettings.epg_save_frequently Save EPG frequently +miscsettings.epg_save_standby Save EPG on soft standby miscsettings.epg_scan EPG scan mode miscsettings.epg_scan_always Always miscsettings.epg_scan_bouquets EPG scan bouquets @@ -1485,17 +1512,26 @@ moviebrowser.book_movieend Movie end: moviebrowser.book_moviestart User Movie start: moviebrowser.book_name Name: moviebrowser.book_new New Bookmark +moviebrowser.book_no_end No end bookmark defined moviebrowser.book_position Position: moviebrowser.book_type Jump (<0 back , >0 for): moviebrowser.book_type_backward Repeat moviebrowser.book_type_forward jump over -moviebrowser.browser_frame_high Browser hight [%] +moviebrowser.browser_frame_high Browser height [%] moviebrowser.browser_row_head Row settings moviebrowser.browser_row_item Row item moviebrowser.browser_row_nr Number of rows moviebrowser.browser_row_width Row width (% of screenwidth) moviebrowser.cache_dir Cache directory +moviebrowser.copies Copy jumps from movie to new files? +moviebrowser.copy Copy jumps from movie to new file? +moviebrowser.copy_failed Copy failed, are there jump bookmarks and enough free space? +moviebrowser.copying Coping, please wait ... +moviebrowser.cut Cut jumps from movie? +moviebrowser.cut_failed Cut failed, are there jump bookmarks and enough free space? +moviebrowser.cutting Cutting movie, please wait ... moviebrowser.delete_info Delete files, please wait... +moviebrowser.delete_screenshot Delete screenshot? moviebrowser.dir Path moviebrowser.dir_head Additional paths moviebrowser.edit_book Bookmark change @@ -1526,12 +1562,13 @@ moviebrowser.hint_newbook_forward New jump forward\n 'blue' for endposition moviebrowser.info_audio Audio moviebrowser.info_channel Channel moviebrowser.info_file File -moviebrowser.info_filename Name +moviebrowser.info_filename Filename moviebrowser.info_genre_major Genre -moviebrowser.info_genre_minor Genre +moviebrowser.info_genre_minor Genre (minor) moviebrowser.info_head Film Information moviebrowser.info_head_update Save changes in all movie info files moviebrowser.info_info1 Info 1 +moviebrowser.info_info2 Info 2 moviebrowser.info_length Length (Min) moviebrowser.info_parental_lockage Parental Lock age moviebrowser.info_parental_lockage_0year always @@ -1595,6 +1632,10 @@ moviebrowser.short_size MB moviebrowser.short_title Title moviebrowser.start_head Start movie from: moviebrowser.start_record_start Movie start +moviebrowser.truncate Truncate movie? +moviebrowser.truncate_failed Truncate failed. +moviebrowser.truncate_failed_playing Impossible to truncate playing movie. +moviebrowser.truncating Truncating movie, please wait ... moviebrowser.ts_only Show recordings only moviebrowser.update_if_dest_empty_only Copy if destination is empty only moviebrowser.use_dir Use directory @@ -1768,6 +1809,7 @@ parentallock.never never parentallock.onsignal on broadcasted lock parentallock.parentallock Parental lock parentallock.prompt prompt for PIN +parentallock.zaptime Zap time for locked bouquets (minutes) personalize.access Access options personalize.apply_settings Apply changes? personalize.button_auto auto @@ -1992,6 +2034,11 @@ scants.bouquet_erase erase old scants.bouquet_leave leave current scants.bouquet_satellite Satellite-Bouquet scants.bouquet_update update +scants.bouquet_writenames Write service names to bouquets +scants.bouquet_writenames_bouquets providers +scants.bouquet_writenames_ever both +scants.bouquet_writenames_never never +scants.bouquet_writenames_ubouquets favourites scants.channel Channel: scants.failed Transponderscan failed! scants.finished Transponderscan finished successfully! @@ -2076,8 +2123,11 @@ streaming.dir_not_writable The recording directory is not writable.\nRecording w streaming.overflow Record buffer overflow, consider to stop some records streaming.slow System/hdd too slow, consider to stop some records streaming.write_error The recording was aborted,\nsince an error occured during the writing process. +stringinput.backspace Backspace stringinput.caps caps / no caps stringinput.clear clear all +stringinput.insert Insert +stringinput.save Save subtitles.charset Charset subtitles.head Subtitles subtitles.stop Stop subtitles @@ -2223,6 +2273,7 @@ videomenu.dbdr_both de-block+de-ring videomenu.dbdr_deblock de-block videomenu.dbdr_none none videomenu.enabled_modes VF key enabled modes +videomenu.enabled_modes_auto Auto-select enabled modes videomenu.fullscreen Full screen videomenu.hdmi_cec CSTLink (HDMI-CEC) videomenu.hdmi_cec_mode Receiver to use diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index 3f229a66e..9d05d7e13 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -807,7 +807,7 @@ lcdcontroler.brightnessdeepstandby Deep Standby helderheid lcdcontroler.brightnessstandby Standby Helderheid lcdmenu.dim_brightness Helderheid na dim timeout lcdmenu.dim_time Dim timeout -lcdmenu.head VFD Instellingen +lcdmenu.head VFD/LED Instellingen lcdmenu.lcdcontroler Helderheid lcdmenu.scroll Enable tekst scroll lcdmenu.statusline statuslijn @@ -861,7 +861,7 @@ mainsettings.audio Audio mainsettings.head Instellingen mainsettings.keybinding Sneltoetsen aanpassen mainsettings.language Taal / Tijdzone -mainsettings.lcd Display instellingen +mainsettings.lcd Voorpaneel instellingen mainsettings.manage Beheer instellingen mainsettings.misc Diverse instellingen mainsettings.multimedia Multimedia @@ -1310,7 +1310,7 @@ menu.hint_tools Start tools menu.hint_tvmode Schakel ontvanger in TV modus menu.hint_tvradio_switch Schakelen tussen TV en Radio modus menu.hint_upnp Universal Plug and Play Browser -menu.hint_vfd Voorpaneel LEDS, VFD opties +menu.hint_vfd Voorpaneel LEDs, VFD opties menu.hint_vfd_brightness Helderheid in gebruik menu.hint_vfd_brightness_setup Configureer helderheid van het display menu.hint_vfd_brightnessdeepstandby Helderheid in deep-standby modus diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index 729dc7ede..63b7cc53f 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -719,7 +719,7 @@ lcdcontroler.brightnessdeepstandby Jas v hlbokom spánku lcdcontroler.brightnessstandby Jas v spánku lcdmenu.dim_brightness Jas po zhasnutí lcdmenu.dim_time Čas zhasnutia -lcdmenu.head Nastavenie VFD +lcdmenu.head Nastavenie VFD/LED lcdmenu.lcdcontroler Jas lcdmenu.scroll Povoliť pohyb textu lcdmenu.statusline Stavový riadok @@ -767,7 +767,7 @@ mainsettings.audio Zvuk mainsettings.head Nastavenia mainsettings.keybinding Nastavenia kláves mainsettings.language Jazyk / Časové pásmo -mainsettings.lcd Zobrazovač VFD +mainsettings.lcd Zobrazovač VFD / LED mainsettings.manage Spravovanie nastavení mainsettings.misc Iné nastavenia mainsettings.network Sieť diff --git a/lib/sectionsdclient/sectionsdMsg.h b/lib/sectionsdclient/sectionsdMsg.h index 9358e8340..9b6b666a4 100644 --- a/lib/sectionsdclient/sectionsdMsg.h +++ b/lib/sectionsdclient/sectionsdMsg.h @@ -101,6 +101,7 @@ struct sectionsd int epg_extendedcache; // std::string network_ntpserver; // std::string epg_dir; + int epg_save_frequently; }; }; diff --git a/lib/sectionsdclient/sectionsdclient.cpp b/lib/sectionsdclient/sectionsdclient.cpp index 3a4188b4c..4b259babe 100644 --- a/lib/sectionsdclient/sectionsdclient.cpp +++ b/lib/sectionsdclient/sectionsdclient.cpp @@ -215,6 +215,7 @@ void CSectionsdClient::setConfig(const epg_config config) msg->network_ntprefresh = config.network_ntprefresh; msg->network_ntpenable = config.network_ntpenable; msg->epg_extendedcache = config.epg_extendedcache; + msg->epg_save_frequently= config.epg_save_frequently; // config.network_ntpserver: strcpy(&pData[sizeof(sectionsd::commandSetConfig)], config.network_ntpserver.c_str()); // config.epg_dir: diff --git a/lib/sectionsdclient/sectionsdclient.h b/lib/sectionsdclient/sectionsdclient.h index 95b8d5eff..8a5d2d5f6 100644 --- a/lib/sectionsdclient/sectionsdclient.h +++ b/lib/sectionsdclient/sectionsdclient.h @@ -171,6 +171,7 @@ class CSectionsdClient : private CBasicClient int network_ntpenable; int epg_extendedcache; std::string network_ntpserver; + int epg_save_frequently; std::string epg_dir; } epg_config; diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index 5c3f2fd67..a7d33db36 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -729,11 +729,9 @@ void CRemoteControl::stopvideo() if ( is_video_started ) { is_video_started= false; -#if HAVE_TRIPLEDRAGON /* we need stopPlayback to blank video, lockPlayback prevents it from being inadvertently starting */ g_Zapit->stopPlayBack(false); -#endif g_Zapit->lockPlayBack(false); } } diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 4331ce20c..b890a43f4 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -730,6 +730,9 @@ fb_pixel_t* CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, co #define MASK 0xFFFFFFFF fb_pixel_t* boxBuf = paintBoxRel2Buf(dx, dy, MASK, NULL, radius, type); + if (!boxBuf) + return NULL; + fb_pixel_t *bp = boxBuf; fb_pixel_t *gra = gradientData->gradientBuf; gradientData->boxBuf = boxBuf; diff --git a/src/driver/netfile.cpp b/src/driver/netfile.cpp index 4cb2bf7a2..96517812e 100644 --- a/src/driver/netfile.cpp +++ b/src/driver/netfile.cpp @@ -572,7 +572,7 @@ void readln(int fd, char *buf) int parse_response(URL *url, void * /*opt*/, CSTATE *state) { - char header[2049], /*str[255]*/ str[2048]; // combined with 2nd local str from id3 part + char header[2048], /*str[255]*/ str[2048]; // combined with 2nd local str from id3 part char *ptr, chr=0, lastchr=0; int hlen = 0, response; int meta_interval = 0, rval; diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 4e3d4ee9b..bacf9c025 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -809,6 +809,9 @@ CRecordManager::~CRecordManager() } nextmap.clear(); durations.clear(); + sm.lock(); + manager = NULL; + sm.unlock(); } CRecordManager * CRecordManager::getInstance() diff --git a/src/eitd/dmx.cpp b/src/eitd/dmx.cpp index 51106c5b7..76f4e47a7 100644 --- a/src/eitd/dmx.cpp +++ b/src/eitd/dmx.cpp @@ -287,6 +287,7 @@ int DMX::getSection(uint8_t *buf, const unsigned timeoutInMSeconds, int &timeout lock(); if (!isOpen()) { unlock(); + timeouts = -3; return -1; } diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 9138d3e67..b5a683096 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -71,6 +71,7 @@ static bool notify_complete = false; /* period to clean cached sections and force restart sections read */ #define META_HOUSEKEEPING_COUNT (24 * 60 * 60) / HOUSEKEEPING_SLEEP // meta housekeeping after XX housekeepings - every 24h - #define STANDBY_HOUSEKEEPING_COUNT (60 * 60) / HOUSEKEEPING_SLEEP +#define EPG_SAVE_FREQUENTLY_COUNT (60 * 60) / HOUSEKEEPING_SLEEP // Timeout bei tcp/ip connections in ms #define READ_TIMEOUT_IN_SECONDS 2 @@ -82,6 +83,7 @@ static bool notify_complete = false; // number of timeouts after which we stop waiting for an EIT version number #define TIMEOUTS_EIT_VERSION_WAIT (2 * CHECK_RESTART_DMX_AFTER_TIMEOUTS) +static unsigned int epg_save_frequently; static long secondsToCache; static long secondsExtendedTextCache; static long oldEventsAre; @@ -970,13 +972,10 @@ static void commandserviceChanged(int connfd, char *data, const unsigned dataLen static void commandserviceStopped(int connfd, char * /* data */, const unsigned /* dataLength */) { xprintf("[sectionsd] commandserviceStopped\n"); + current_channel_id = 0; sendEmptyResponse(connfd, NULL, 0); - threadCN.lock(); - threadEIT.lock(); - threadCN.closefd(); - threadEIT.closefd(); - threadCN.unlock(); - threadEIT.unlock(); + threadEIT.stop(); + threadCN.stop(); threadCN.stopUpdate(); xprintf("[sectionsd] commandserviceStopped done\n"); } @@ -1108,6 +1107,7 @@ static void commandSetConfig(int connfd, char *data, const unsigned /*dataLength oldEventsAre = (long)(pmsg->epg_old_events)*60L*60L; secondsExtendedTextCache = (long)(pmsg->epg_extendedcache)*60L*60L; max_events = pmsg->epg_max_events; + epg_save_frequently = pmsg->epg_save_frequently; unlockEvents(); bool time_wakeup = false; @@ -1593,8 +1593,12 @@ void CSectionThread::run() xprintf("%s: skipping to next filter %d from %d (timeouts %d)\n", name.c_str(), filter_index+1, (int)filters.size(), timeoutsDMX); #endif + if (timeoutsDMX == -3) + sendToSleepNow = true; + else + need_change = true; + timeoutsDMX = 0; - need_change = true; } if (zeit > lastChanged + skipTime) { #ifdef DEBUG_SECTION_THREADS @@ -2048,7 +2052,7 @@ static void print_meminfo(void) //--------------------------------------------------------------------- static void *houseKeepingThread(void *) { - int count = 0, scount = 0; + int count = 0, scount = 0, ecount = 0; dprintf("housekeeping-thread started.\n"); pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, 0); @@ -2081,6 +2085,23 @@ static void *houseKeepingThread(void *) removeOldEvents(oldEventsAre); // alte Events + ecount++; + if (ecount == EPG_SAVE_FREQUENTLY_COUNT) + { + if (epg_save_frequently > 0) + { + std::string d = epg_dir; + if (d.length() > 1) + { + std::string::iterator it = d.end() - 1; + if (*it == '/') + d.erase(it); + } + writeEventsToFile((char *)d.c_str()); + } + ecount = 0; + } + readLockEvents(); dprintf("Number of sptr events (event-ID): %u\n", (unsigned)mySIeventsOrderUniqueKey.size()); dprintf("Number of sptr events (service-id, start time, event-id): %u\n", (unsigned)mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.size()); @@ -2134,6 +2155,7 @@ bool CEitManager::Start() secondsExtendedTextCache = config.epg_extendedcache*60L*60L; //hours oldEventsAre = config.epg_old_events*60L*60L; //hours max_events = config.epg_max_events; + epg_save_frequently = config.epg_save_frequently; if (find_executable("ntpdate").empty()) ntp_system_cmd_prefix = "ntpd -n -q -p "; diff --git a/src/gui/audio_select.cpp b/src/gui/audio_select.cpp index 1a428540d..c95ff6b82 100644 --- a/src/gui/audio_select.cpp +++ b/src/gui/audio_select.cpp @@ -200,7 +200,7 @@ int CAudioSelectMenuHandler::doMenu () CVolume::getInstance()->SetCurrentPid(0); int percent[p_count]; for (uint i=0; i < p_count; i++) { - percent[i] = CZapit::getInstance()->GetPidVolume(0, g_RemoteControl->current_PIDs.APIDs[i].pid); + 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, &percent[i], i == g_RemoteControl->current_PIDs.PIDs.selected_apid, 0, 999, CVolume::getInstance())); diff --git a/src/gui/audio_setup.cpp b/src/gui/audio_setup.cpp index a58cc3565..2cc879df6 100644 --- a/src/gui/audio_setup.cpp +++ b/src/gui/audio_setup.cpp @@ -45,6 +45,7 @@ #include #include +#include #include @@ -64,8 +65,14 @@ CAudioSetup::~CAudioSetup() } -int CAudioSetup::exec(CMenuTarget* parent, const std::string &/*actionKey*/) +int CAudioSetup::exec(CMenuTarget* parent, const std::string &actionKey) { + if (actionKey == "clear_vol_map") { + CZapit::getInstance()->ClearVolumeMap(); + CZapit::getInstance()->SetVolumePercent(g_settings.audio_volume_percent_ac3, g_settings.audio_volume_percent_pcm); + return menu_return::RETURN_NONE; + } + dprintf(DEBUG_DEBUG, "init audio setup\n"); int res = menu_return::RETURN_REPAINT; @@ -196,6 +203,23 @@ int CAudioSetup::showAudioSetup() as_oj_srsonoff->setHint("", LOCALE_MENU_HINT_AUDIO_SRS); #endif + // ac3,pcm and clear volume adjustment + CMenuOptionNumberChooser *adj_ac3 = NULL, *adj_pcm = NULL; + CMenuForwarder *adj_clear = NULL; + if (!g_settings.easymenu) { + adj_ac3 = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_VOLUME_ADJUSTMENT_AC3, + (int *)&g_settings.audio_volume_percent_ac3, true, 0, 100, audioSetupNotifier); + adj_ac3->setNumberFormat("%d%%"); + adj_ac3->setHint("", LOCALE_MENU_HINT_AUDIO_ADJUST_VOL_AC3); + + adj_pcm = new CMenuOptionNumberChooser(LOCALE_AUDIOMENU_VOLUME_ADJUSTMENT_PCM, + (int *)&g_settings.audio_volume_percent_pcm, true, 0, 100, audioSetupNotifier); + adj_pcm->setNumberFormat("%d%%"); + adj_pcm->setHint("", LOCALE_MENU_HINT_AUDIO_ADJUST_VOL_PCM); + + adj_clear = new CMenuForwarder(LOCALE_AUDIOMENU_VOLUME_ADJUSTMENT_CLEAR, true, NULL, this, "clear_vol_map"); + adj_clear->setHint("", LOCALE_MENU_HINT_AUDIO_ADJUST_VOL_CLEAR); + } //paint items audioSettings->addIntroItems(LOCALE_MAINSETTINGS_AUDIO); //--------------------------------------------------------- @@ -228,6 +252,12 @@ int CAudioSetup::showAudioSetup() #if 0 audioSettings->addItem(mf); #endif + if (!g_settings.easymenu) { + audioSettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUSTMENT)); + audioSettings->addItem(adj_ac3); + audioSettings->addItem(adj_pcm); + audioSettings->addItem(adj_clear); + } int res = audioSettings->exec(NULL, ""); selected = audioSettings->getSelected(); @@ -235,6 +265,9 @@ int CAudioSetup::showAudioSetup() #ifdef BOXMODEL_APOLLO delete as_oj_noise; #endif + if (!g_settings.easymenu) + CZapit::getInstance()->SetVolumePercent(g_settings.audio_volume_percent_ac3, g_settings.audio_volume_percent_pcm); + return res; } diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 8c5e60310..3f26f6722 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -65,6 +65,7 @@ #include #include #include +#include #include "gui/pictureviewer.h" extern CPictureViewer * g_PicViewer; @@ -2607,7 +2608,7 @@ void CAudioPlayerGui::savePlaylist() absPlaylistDir += file->getFileName(); const int filenamesize = 30; - std::string filename; + std::string filename = "playlist"; if (file->getType() == CFile::FILE_PLAYLIST) { @@ -2624,12 +2625,7 @@ void CAudioPlayerGui::savePlaylist() { // query for filename this->hide(); - CStringInputSMS filenameInput(LOCALE_AUDIOPLAYER_PLAYLIST_NAME, - &filename, - filenamesize - 1, - LOCALE_AUDIOPLAYER_PLAYLIST_NAME_HINT1, - LOCALE_AUDIOPLAYER_PLAYLIST_NAME_HINT2, - "abcdefghijklmnopqrstuvwxyz0123456789-.,:!?/ "); + CKeyboardInput filenameInput(LOCALE_AUDIOPLAYER_PLAYLIST_NAME, &filename, filenamesize - 1, NULL, NULL, LOCALE_AUDIOPLAYER_PLAYLIST_NAME_HINT1, LOCALE_AUDIOPLAYER_PLAYLIST_NAME_HINT2); filenameInput.exec(NULL, ""); // refresh view this->paint(); diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 728f1b688..9501c9cb7 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include extern CBouquetManager *g_bouquetManager; @@ -526,7 +527,7 @@ std::string CBEBouquetWidget::inputName(const char * const defaultName, const ne { std::string Name = defaultName; - CStringInputSMS * nameInput = new CStringInputSMS(caption, &Name, 29, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.,:|!?/ "); + CKeyboardInput * nameInput = new CKeyboardInput(caption, &Name); nameInput->exec(this, ""); delete nameInput; diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 62665625f..6881c540a 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -124,7 +124,6 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl CChannelList::~CChannelList() { - chanlist->clear(); if(dline){ delete dline; dline = NULL; @@ -162,13 +161,12 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to) if ((*chanlist).empty()) return; - if (from > (*chanlist).size() || from >= to) - return; - - if (to == 0 || to > (*chanlist).size()) to = (*chanlist).size(); + if (from > (*chanlist).size() || from >= to) + return; + size_t chanlist_size = to - from; CChannelEventList events; @@ -311,7 +309,7 @@ int CChannelList::doChannelMenu(void) CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); bool empty = (*chanlist).empty(); - bool allow_edit = (bouquet && bouquet->zapitBouquet /*&& bouquet->zapitBouquet->bUser*/); + bool allow_edit = (bouquet && bouquet->zapitBouquet && !bouquet->zapitBouquet->bOther); int i = 0; snprintf(cnt, sizeof(cnt), "%d", i); @@ -337,7 +335,7 @@ int CChannelList::doChannelMenu(void) delete selector; if(select >= 0) { - signed int bouquet_id = 0; + //signed int bouquet_id = 0; old_selected = select; t_channel_id channel_id = empty ? 0 : (*chanlist)[selected]->channel_id; bool tvmode = CZapit::getInstance()->getMode() & CZapitClient::MODE_TV; @@ -369,31 +367,8 @@ int CChannelList::doChannelMenu(void) ret = -1; break; case 1: // add to - bouquet_id = AllFavBouquetList->exec(false); - hide(); - if(bouquet_id < 0) + if (!addChannelToBouquet()) return -1; - - if (AllFavBouquetList->Bouquets[bouquet_id]->zapitBouquet) { - CZapitBouquet *zapitBouquet = AllFavBouquetList->Bouquets[bouquet_id]->zapitBouquet; - CZapitChannel *ch = zapitBouquet->getChannelByChannelID(channel_id); - if (ch == NULL) { - fav_found = false; - zapitBouquet->addService((*chanlist)[selected]); - for (unsigned n = 0; n < blist->Bouquets.size(); n++) { - if (blist->Bouquets[n]->zapitBouquet == zapitBouquet) { - zapitBouquet->getChannels(blist->Bouquets[n]->channelList->channels, tvmode); - saveChanges(); - fav_found = true; - break; - } - } - } - } - if (!fav_found) { - CNeutrinoApp::getInstance()->MarkFavoritesChanged(); - CNeutrinoApp::getInstance()->MarkChannelsInit(); - } ret = 1; break; case 2: // add to my favorites @@ -906,6 +881,10 @@ int CChannelList::show() } } } + else if (!empty && edit_state && move_state != beMoving && msg == CRCInput::RC_forward ) + { + moveChannelToBouquet(); + } #ifdef ENABLE_PIP else if (!empty && ((msg == CRCInput::RC_play) || (msg == (neutrino_msg_t) g_settings.key_pip_close))) { if(SameTP()) { @@ -914,10 +893,7 @@ int CChannelList::show() calcSize(); paint(); } else { - if(CNeutrinoApp::getInstance()->StartPip((*chanlist)[selected]->getChannelID())) { - calcSize(); - paint(); - } + handleMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x100, true); } } } @@ -1001,7 +977,7 @@ bool CChannelList::showInfo(int number, int epgpos) return true; } -int CChannelList::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) +int CChannelList::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data, bool pip) { bool startvideo = true; @@ -1038,13 +1014,19 @@ int CChannelList::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED && data < 0x100) goto out; - /* if a pre-locked channel is inside the zap time, open it. Hardcoded to one hour for now. */ - if (data >= 0x100 && (*chanlist)[selected]->last_unlocked_time + 3600 > time_monotonic()) + /* if a pre-locked channel is inside the zap time, open it. */ + if (data >= 0x100 && (*chanlist)[selected]->last_unlocked_time + g_settings.parentallock_zaptime * 60 > time_monotonic()) + goto out; + + if (pip && (*chanlist)[selected]->Locked() == g_settings.parentallock_defaultlocked) goto out; /* OK, let's ask for a PIN */ - g_RemoteControl->stopvideo(); - //printf("stopped video\n"); + if (!pip) { + g_RemoteControl->is_video_started = true; + g_RemoteControl->stopvideo(); + //printf("stopped video\n"); + } zapProtection = new CZapProtection(g_settings.parentallock_pincode, data); if (zapProtection->check()) @@ -1079,8 +1061,17 @@ int CChannelList::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data) zapProtection = NULL; out: - if (startvideo) - g_RemoteControl->startvideo(); + if (startvideo) { + if(pip) { +#ifdef ENABLE_PIP + if (CNeutrinoApp::getInstance()->StartPip((*chanlist)[selected]->getChannelID())) { + calcSize(); + paint(); + } +#endif + } else + g_RemoteControl->startvideo(); + } return messages_return::handled; } @@ -1701,13 +1692,14 @@ struct button_label SChannelListButtons_SMode[NUM_LIST_BUTTONS_SORT] = { NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE, NONEXISTANT_LOCALE} }; -#define NUM_LIST_BUTTONS_EDIT 4 +#define NUM_LIST_BUTTONS_EDIT 5 const struct button_label SChannelListButtons_Edit[NUM_LIST_BUTTONS_EDIT] = { { NEUTRINO_ICON_BUTTON_RED , LOCALE_BOUQUETEDITOR_DELETE }, { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_BOUQUETEDITOR_ADD }, { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_BOUQUETEDITOR_MOVE }, - { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_BOUQUETEDITOR_LOCK } + { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_BOUQUETEDITOR_LOCK }, + { NEUTRINO_ICON_BUTTON_FORWARD , LOCALE_BOUQUETEDITOR_MOVE_TO } }; void CChannelList::paintButtonBar(bool is_current) @@ -2387,7 +2379,7 @@ void CChannelList::editMode(bool enable) channelsChanged = false; bouquet->zapitBouquet->getChannels(channels, tvmode); saveChanges(bouquet->zapitBouquet->bUser); - if ((*chanlist).empty()) + if (!g_settings.show_empty_favorites && (*chanlist).empty()) CNeutrinoApp::getInstance()->MarkChannelsInit(); } if (selected >= chanlist->size()) @@ -2434,14 +2426,14 @@ void CChannelList::internalMoveChannel( unsigned int fromPosition, unsigned int paint(); } -void CChannelList::deleteChannel() +void CChannelList::deleteChannel(bool ask) { if (selected >= chanlist->size()) return; if (!bouquet || !bouquet->zapitBouquet) return; - if (ShowMsg(LOCALE_FILEBROWSER_DELETE, (*chanlist)[selected]->getName(), CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)!=CMessageBox::mbrYes) + if (ask && ShowMsg(LOCALE_FILEBROWSER_DELETE, (*chanlist)[selected]->getName(), CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)!=CMessageBox::mbrYes) return; bouquet->zapitBouquet->removeService((*chanlist)[selected]->channel_id); @@ -2489,3 +2481,50 @@ void CChannelList::lockChannel() else paintItem(selected - liststart); } + +bool CChannelList::addChannelToBouquet() +{ + bool fav_found = true; + signed int bouquet_id = AllFavBouquetList->exec(false); + hide(); + if(bouquet_id < 0) + return false; + + t_channel_id channel_id = (*chanlist)[selected]->channel_id; + bool tvmode = CZapit::getInstance()->getMode() & CZapitClient::MODE_TV; + CBouquetList *blist = tvmode ? TVfavList : RADIOfavList; + if (AllFavBouquetList->Bouquets[bouquet_id]->zapitBouquet) { + CZapitBouquet *zapitBouquet = AllFavBouquetList->Bouquets[bouquet_id]->zapitBouquet; + CZapitChannel *ch = zapitBouquet->getChannelByChannelID(channel_id); + if (ch == NULL) { + fav_found = false; + zapitBouquet->addService((*chanlist)[selected]); + for (unsigned n = 0; n < blist->Bouquets.size(); n++) { + if (blist->Bouquets[n]->zapitBouquet == zapitBouquet) { + zapitBouquet->getChannels(blist->Bouquets[n]->channelList->channels, tvmode); + saveChanges(); + fav_found = true; + break; + } + } + } else { + ShowMsg(LOCALE_EXTRA_ADD_TO_BOUQUET, LOCALE_EXTRA_CHALREADYINBQ, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); + return false; + } + } + if (!fav_found) { + CNeutrinoApp::getInstance()->MarkFavoritesChanged(); + CNeutrinoApp::getInstance()->MarkChannelsInit(); + } + return true; +} + +void CChannelList::moveChannelToBouquet() +{ + if (addChannelToBouquet()) + deleteChannel(false); + else + paint(); + + paintHead(); +} diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 05abbefbd..6f9102ec5 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -159,10 +159,12 @@ private: void finishMoveChannel(); void cancelMoveChannel(); void internalMoveChannel(unsigned int fromPosition, unsigned int toPosition); - void deleteChannel(); + void deleteChannel(bool ask = true); void addChannel(); void lockChannel(); void saveChanges(bool fav = true); + bool addChannelToBouquet(); + void moveChannelToBouquet(); friend class CBouquet; public: @@ -208,7 +210,7 @@ public: int hasChannelID(t_channel_id channel_id); void setSelected( int nChannelNr); // for adjusting bouquet's channel list after numzap or quickzap - int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data); + int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data, bool pip = false); int getSize() const; bool isEmpty() const; @@ -234,6 +236,7 @@ public: SORT_MAX }; unsigned Size() { return (*chanlist).size(); } + ZapitChannelList &getChannels() { return channels; }; }; #endif diff --git a/src/gui/dboxinfo.cpp b/src/gui/dboxinfo.cpp index 3a728289a..e590a4c24 100644 --- a/src/gui/dboxinfo.cpp +++ b/src/gui/dboxinfo.cpp @@ -382,7 +382,7 @@ void CDBoxInfoWidget::paint() now -= info.uptime; std::string str_boot(strftime(g_Locale->getText(LOCALE_EXTRA_DBOXINFO_TIMEFORMAT), now)); - char ubuf[80] = { 0 }; + char ubuf[256] = { 0 }; char sbuf[256] = { 0 }; int updays, uphours, upminutes; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 1be50389e..9cf21ae3a 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -45,6 +45,7 @@ #include "widget/buttons.h" #include "bouquetlist.h" #include +#include #include #include @@ -1357,7 +1358,7 @@ int CEventFinderMenu::showMenu(void) int shortcut = 1; - CStringInputSMS stringInput(LOCALE_EVENTFINDER_KEYWORD,m_search_keyword, 20, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789 -_/()<>=+.,:!?\\'"); + CKeyboardInput stringInput(LOCALE_EVENTFINDER_KEYWORD,m_search_keyword); CMenuForwarder* mf0 = new CMenuForwarder(LOCALE_EVENTFINDER_KEYWORD, true, *m_search_keyword, &stringInput, NULL, CRCInput::RC_red); CMenuOptionChooser* mo0 = new CMenuOptionChooser(LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST, m_search_list, SEARCH_LIST_OPTIONS, SEARCH_LIST_OPTION_COUNT, true, this, CRCInput::convertDigitToKey(shortcut++)); @@ -1369,17 +1370,17 @@ int CEventFinderMenu::showMenu(void) CMenuForwarder* mf2 = new CMenuForwarder(LOCALE_EVENTFINDER_HISTORY, true, NULL, this, "#history", CRCInput::RC_yellow); CMenuOptionNumberChooser* moc1 = new CMenuOptionNumberChooser(LOCALE_EVENTFINDER_MAX_HISTORY, &g_settings.epg_search_history_max, true, 0, 50, NULL); - searchMenu.addItem(GenericMenuSeparatorLine); searchMenu.addItem(GenericMenuSeparator); + searchMenu.addItem(GenericMenuBack); + searchMenu.addItem(GenericMenuSeparatorLine); searchMenu.addItem(mf0); + searchMenu.addItem(mf1); searchMenu.addItem(GenericMenuSeparatorLine); searchMenu.addItem(mo0); searchMenu.addItem(m_search_channelname_mf); searchMenu.addItem(mo1); searchMenu.addItem(GenericMenuSeparatorLine); - searchMenu.addItem(mf1); - searchMenu.addItem(GenericMenuSeparatorLine); searchMenu.addItem(mf2); searchMenu.addItem(moc1); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 8bd7beb71..c71e34f3b 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -598,6 +598,7 @@ bool CFileBrowser::exec(const char * const dirname) bool res = false; menu_ret = menu_return::RETURN_REPAINT; + playlistmode = false; #ifdef ENABLE_INTERNETRADIO if (m_Mode == ModeSC) { m_baseurl = base; @@ -906,6 +907,187 @@ bool CFileBrowser::exec(const char * const dirname) return res; } +bool CFileBrowser::playlist_manager(CFileList &playlist, unsigned int playing) +{ + neutrino_msg_t msg; + neutrino_msg_data_t data; + + bool res = false; + menu_ret = menu_return::RETURN_REPAINT; + + filelist = playlist; + playlistmode = true; + + fontInit(); + paintHead(); + selected = playing; + + unsigned int oldselected = selected; + + paint(); + paintFoot(); + + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_FILEBROWSER]); + + bool loop=true; + while (loop) + { + frameBuffer->blit(); + g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); + neutrino_msg_t msg_repeatok = msg & ~CRCInput::RC_Repeat; + + if (msg <= CRCInput::RC_MaxRC) + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_FILEBROWSER]); + + if(!CRCInput::isNumeric(msg)) + { + m_SMSKeyInput.resetOldKey(); + paintSMSKey(); + } + if (msg == CRCInput::RC_home) + { + loop = false; + } + else if (msg == NeutrinoMessages::STANDBY_ON || + msg == NeutrinoMessages::SHUTDOWN || + msg == NeutrinoMessages::SLEEPTIMER) + { + menu_ret = menu_return::RETURN_EXIT_ALL; + loop = false; + g_RCInput->postMsg(msg, data); + } + else if (msg == CRCInput::RC_timeout) + { + selected = oldselected; + loop = false; + } + else if (msg > CRCInput::RC_MaxRC) + { + if (CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all) { + menu_ret = menu_return::RETURN_EXIT_ALL; + loop = false; + } + } + if ((filelist.empty())) + continue; + + if (msg_repeatok == CRCInput::RC_up) + { + unsigned int prevselected=selected; + unsigned int prevliststart = liststart; + if (selected) + selected --; + else + selected = filelist.size() - 1; + liststart = (selected/listmaxshow)*listmaxshow; + if(prevliststart != liststart) + { + paint(); + } + else + { + paintItem(prevselected - prevliststart); + paintItem(selected - liststart); + } + } + else if (msg_repeatok == CRCInput::RC_down) + { + unsigned int prevselected=selected; + unsigned int prevliststart = liststart; + selected = (selected + 1) % filelist.size(); + liststart = (selected/listmaxshow)*listmaxshow; + if(prevliststart != liststart) + { + paint(); + } + else + { + paintItem(prevselected - prevliststart); + paintItem(selected - liststart); + } + } + else if (msg == (neutrino_msg_t) g_settings.key_pagedown) + { + unsigned int last = filelist.size() - 1; + if (selected != last && selected + listmaxshow >= filelist.size()) { + selected = last; + } else { + selected = (selected == last) ? 0 : selected + listmaxshow; + liststart = (selected / listmaxshow) * listmaxshow; + } + paint(); + } + else if (msg == (neutrino_msg_t) g_settings.key_pageup) + { + if (selected && selected < listmaxshow) { + selected = 0; + } else { + selected = selected ? selected - listmaxshow : filelist.size() - 1; + liststart = (selected/listmaxshow)*listmaxshow; + } + paint(); + } + else if (msg == CRCInput::RC_red) + { + if (filelist.size() > 1) + { + filelist.erase(filelist.begin()+selected); + if (selected) selected --; + } + paint(); + } + else if (msg == CRCInput::RC_green) + { + CFileBrowser *addfiles = new CFileBrowser; + addfiles->Hide_records = true; + addfiles->Multi_Select = true; + addfiles->Dirs_Selectable = true; + addfiles->exec(g_settings.network_nfs_moviedir.c_str()); + CFileList tmplist = addfiles->getSelectedFiles(); + filelist.insert( filelist.end(), tmplist.begin(), tmplist.end() ); + tmplist.clear(); + delete addfiles; + paintHead(); + paint(); + paintFoot(); + } + else if (msg == CRCInput::RC_yellow ) + { + if (++g_settings.filebrowser_sortmethod >= FILEBROWSER_NUMBER_OF_SORT_VARIANTS) + g_settings.filebrowser_sortmethod = 0; + + sort(filelist.begin(), filelist.end(), sortBy[g_settings.filebrowser_sortmethod]); + + paint(); + paintFoot(); + } + else if (msg == CRCInput::RC_blue ) + { + std::random_shuffle ( filelist.begin(), filelist.end() ); + selected = 0; + paint(); + paintFoot(); + } + else if (msg == CRCInput::RC_ok) + { + filelist[selected].Marked = true; + loop = false; + res = true; + } + else if (CRCInput::isNumeric(msg_repeatok)) + { + SMSInput(msg_repeatok); + } + } + + hide(); + frameBuffer->blit(); + + playlist = filelist; + + return res; +} + void CFileBrowser::addRecursiveDir(CFileList * re_filelist, std::string rpath, bool bRootCall, CProgressWindow * progress) { neutrino_msg_t msg; @@ -1116,7 +1298,7 @@ void CFileBrowser::paintHead() l = asprintf(&l_name, "%s %s", g_Locale->getText(LOCALE_AUDIOPLAYER_ADD_SC), FILESYSTEM_ENCODING_TO_UTF8_STRING(name).c_str()); else #endif - l = asprintf(&l_name, "%s %s", g_Locale->getText(LOCALE_FILEBROWSER_HEAD), FILESYSTEM_ENCODING_TO_UTF8_STRING(name).c_str()); + l = asprintf(&l_name, "%s %s", g_Locale->getText(playlistmode ? LOCALE_FILEBROWSER_PM : LOCALE_FILEBROWSER_HEAD), FILESYSTEM_ENCODING_TO_UTF8_STRING(name).c_str()); if (l < 1) /* at least 1 for the " " space */ { @@ -1177,6 +1359,8 @@ const struct button_label FileBrowserFilterButton[2] = int CFileBrowser::paintFoot(bool show) { + int cnt,res; + std::string sort_text = g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_SORT); sort_text += g_Locale->getText(sortByNames[g_settings.filebrowser_sortmethod]); @@ -1191,6 +1375,15 @@ int CFileBrowser::paintFoot(bool show) if (Filter != NULL && use_filter) f_loc = LOCALE_FILEBROWSER_FILTER_ACTIVE; + button_label_ext footerButtons_pm[] = { + { NEUTRINO_ICON_BUTTON_RED, LOCALE_FILEBROWSER_DELETE, NULL, 0, false }, + { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_FILEBROWSER_ADD, NULL, 0, false }, + { NEUTRINO_ICON_BUTTON_YELLOW, NONEXISTANT_LOCALE, sort_text.c_str(), sort_text_len, false }, + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_AUDIOPLAYER_SHUFFLE, NULL, 0, false }, + { NEUTRINO_ICON_BUTTON_OKAY, LOCALE_FILEBROWSER_SELECT, NULL, 0, false }, + { NEUTRINO_ICON_BUTTON_PLAY, LOCALE_FILEBROWSER_MARK, NULL, 0, false }, + }; + button_label_ext footerButtons[] = { { NEUTRINO_ICON_BUTTON_RED, NONEXISTANT_LOCALE, sort_text.c_str(), sort_text_len, false }, { NEUTRINO_ICON_BUTTON_OKAY, LOCALE_FILEBROWSER_SELECT, NULL, 0, false }, @@ -1198,17 +1391,28 @@ int CFileBrowser::paintFoot(bool show) { NEUTRINO_ICON_BUTTON_PLAY, LOCALE_FILEBROWSER_MARK, NULL, 0, false }, { NEUTRINO_ICON_BUTTON_BLUE, f_loc, NULL, 0, false }, }; - int cnt = sizeof(footerButtons) / sizeof(button_label_ext); + + if (playlistmode) { + cnt = sizeof(footerButtons_pm) / sizeof(button_label_ext); + if (!show) + return paintButtons(footerButtons_pm, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); + } else { + cnt = sizeof(footerButtons) / sizeof(button_label_ext); + if (!show) + return paintButtons(footerButtons, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); + } + int fowidth = width - skwidth; - if (!show) - return paintButtons(footerButtons, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); if (filelist.empty()) { frameBuffer->paintBoxRel(x, y + height - foheight, width, foheight, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_MID, CORNER_BOTTOM); return foheight; } - int res = paintButtons(footerButtons, Filter ? cnt : cnt - 1, x, y + height - foheight, width, foheight, fowidth); + if (playlistmode) + res = paintButtons(footerButtons_pm, Filter ? cnt : cnt - 1, x, y + height - foheight, width, foheight, fowidth); + else + res = paintButtons(footerButtons, Filter ? cnt : cnt - 1, x, y + height - foheight, width, foheight, fowidth); paintSMSKey(); return res; } diff --git a/src/gui/filebrowser.h b/src/gui/filebrowser.h index aa30e5015..b0f640821 100644 --- a/src/gui/filebrowser.h +++ b/src/gui/filebrowser.h @@ -187,6 +187,7 @@ class CFileBrowser int paintFoot(bool show = true); void paintSMSKey(); void recursiveDelete(const char* file); + bool playlistmode; protected: void commonInit(); @@ -220,6 +221,7 @@ class CFileBrowser ~CFileBrowser(); bool exec(const char * const dirname); + bool playlist_manager(CFileList &playlist,unsigned int playing); CFile *getSelectedFile(); inline const CFileList & getSelectedFiles(void) const diff --git a/src/gui/info_menue.cpp b/src/gui/info_menue.cpp index 75c7032f8..c3df84d17 100644 --- a/src/gui/info_menue.cpp +++ b/src/gui/info_menue.cpp @@ -105,8 +105,7 @@ int CInfoMenu::showMenu() } //add I_TYPE_INFORMATION plugins - CPluginsExec pluginsExec; - info->integratePlugins(&pluginsExec, CPlugins::I_TYPE_INFORMATION, 1); + info->integratePlugins(CPlugins::I_TYPE_INFORMATION, 1); int res = info->exec(NULL, ""); delete info; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 6ddc1a5d7..98422be5e 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -112,8 +112,6 @@ CInfoViewer::CInfoViewer () ChanNameY = 0; ChanWidth = 0; ChanHeight = 0; - time_left_width = 0; - time_dot_width = 0; time_width = 0; time_height = 0; lastsnr = 0; @@ -140,6 +138,7 @@ CInfoViewer::~CInfoViewer() void CInfoViewer::Init() { + initClock(); BoxStartX = BoxStartY = BoxEndX = BoxEndY = 0; recordModeActive = false; is_visible = false; @@ -226,15 +225,9 @@ void CInfoViewer::start () ChanNameY = BoxStartY + (ChanHeight / 2) + SHADOW_OFFSET; //oberkante schatten? ChanInfoX = BoxStartX + (ChanWidth / 3); - time_height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getHeight(); - time_left_width = 2 * g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getWidth(); /* still a kludge */ - time_dot_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(":"); - time_width = time_left_width* 2+ time_dot_width; - - if (clock) { - delete clock; - clock = NULL; - } + initClock(); + time_height = clock->getHeight(); + time_width = clock->getWidth(); } void CInfoViewer::changePB() @@ -253,6 +246,23 @@ void CInfoViewer::changePB() timescale->setType(CProgressBar::PB_TIMESCALE); } +void CInfoViewer::initClock() +{ + if (clock == NULL){ + clock = new CComponentsFrmClock(); + clock->doPaintBg(false); + } + + clock->setColorBody(COL_INFOBAR_PLUS_0); + clock->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); + clock->setClockFont(SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME); + clock->setClockAlignment(CC_ALIGN_RIGHT | CC_ALIGN_HOR_CENTER); + clock->refresh(); + + clock->setPos(BoxEndX - 10 - clock->getWidth(), ChanNameY); + clock->setTextColor(COL_INFOBAR_TEXT); +} + void CInfoViewer::paintTime (bool show_dot) { if (!gotTime) @@ -261,23 +271,7 @@ void CInfoViewer::paintTime (bool show_dot) if (!gotTime) return; - int clock_x = BoxEndX - time_width - LEFT_OFFSET; - int clock_y = ChanNameY; - int clock_w = time_width + LEFT_OFFSET; - int clock_h = time_height; - - if (clock == NULL){ - clock = new CComponentsFrmClock(); - clock->doPaintBg(false); - } - - clock->setColorBody(COL_INFOBAR_PLUS_0); - clock->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); - clock->setDimensionsAll(clock_x, clock_y, clock_w, clock_h); - clock->setClockFont(SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME); clock->setClockFormat(show_dot ? "%H:%M" : "%H %M"); - clock->setTextColor(COL_INFOBAR_TEXT); - clock->paint(CC_SAVE_SCREEN_NO); } @@ -535,7 +529,7 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe if (g_settings.infobar_show_channellogo > 1) ChannelLogoMode = showChannelLogo(channel_id, 0); if (ChannelLogoMode == 0 || ChannelLogoMode == 3 || ChannelLogoMode == 4) - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(ChanNameX + 10 , ChanNameY + time_height,BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 ,ChannelName, COL_INFOBAR_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(ChanNameX + 10 , ChanNameY + time_height,BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 10 ,ChannelName, COL_INFOBAR_TEXT); // show_Data if (CMoviePlayerGui::getInstance().file_prozent > 100) @@ -780,7 +774,7 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con fb_pixel_t color = COL_INFOBAR_TEXT; g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString( ChanNameX + 10 + ChanNumWidth, ChanNameY + time_height, - BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 - ChanNumWidth, + BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 10 - ChanNumWidth, ChannelName, color /*COL_INFOBAR_TEXT*/); //provider name if(g_settings.infobar_show_channeldesc && pname){ @@ -797,7 +791,7 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getDigitOffset()); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString( ChanNameX + 10 + ChanNumWidth + chname_width, tmpY, - BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 - ChanNumWidth - chname_width, + BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 10 - ChanNumWidth - chname_width, prov_name, color /*COL_INFOBAR_TEXT*/); } @@ -1989,7 +1983,7 @@ int CInfoViewer::showChannelLogo(const t_channel_id logo_channel_id, const int c int logo_x = 0, logo_y = 0; int res = 0; int start_x = ChanNameX; - int chan_w = BoxEndX- (start_x+ 20)- time_width- 15; + int chan_w = BoxEndX- (start_x+ 20)- time_width- LEFT_OFFSET - 10; bool logo_available = g_PicViewer->GetLogoName(logo_channel_id, ChannelName, strAbsIconPath, &logo_w, &logo_h); diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index 435a6ed8e..9d321f2f2 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -89,8 +89,6 @@ class CInfoViewer //uint32_t fadeTimer; COSDFader fader; - int time_left_width; - int time_dot_width; int time_width; int time_height; int info_time_width; @@ -117,8 +115,8 @@ class CInfoViewer const char *runningStart = NULL, const char *runningRest = NULL, const char *nextStart = NULL, const char *nextDuration = NULL, bool update_current = true, bool update_next = true); + void initClock(); void paintTime( bool show_dot ); - void showRecordIcon(const bool show); void showIcon_Tuner() const; diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 10a0f88b8..b3326bc7a 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -213,7 +213,7 @@ void CInfoViewerBB::getBBButtonInfo() bbButtonMaxH = 0; bbButtonMaxX = g_InfoViewer->ChanInfoX; int bbButtonMaxW = 0; - int mode; + int mode = NeutrinoMessages::mode_unknown; for (int i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) { int w = 0, h = 0; bool active; @@ -233,13 +233,13 @@ void CInfoViewerBB::getBBButtonInfo() icon = NEUTRINO_ICON_BUTTON_GREEN; frameBuffer->getIconSize(icon.c_str(), &w, &h); text = CUserMenu::getUserMenuButtonName(1, active); - if (!text.empty()) + mode = CNeutrinoApp::getInstance()->getMode(); + if (!text.empty() && mode < NeutrinoMessages::mode_audio) break; text = g_settings.usermenu[SNeutrinoSettings::BUTTON_GREEN]->title; if (text == g_Locale->getText(LOCALE_AUDIOSELECTMENUE_HEAD)) text = ""; - mode = CNeutrinoApp::getInstance()->getMode(); - if ((mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv) && !CMoviePlayerGui::getInstance().timeshift) { + if ((mode == NeutrinoMessages::mode_ts || mode == NeutrinoMessages::mode_webtv || mode == NeutrinoMessages::mode_audio) && !CMoviePlayerGui::getInstance().timeshift) { text = CMoviePlayerGui::getInstance().CurrentAudioName(); } else if (!g_RemoteControl->current_PIDs.APIDs.empty()) { int selected = g_RemoteControl->current_PIDs.PIDs.selected_apid; diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index 583326edc..e60cae59a 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include @@ -107,7 +108,7 @@ int CKeybindSetup::exec(CMenuTarget* parent, const std::string &actionKey) fileBrowser.Dir_Mode = true; if (fileBrowser.exec("/var/tuxbox") == true) { std::string fname = "keys.conf"; - CStringInputSMS * sms = new CStringInputSMS(LOCALE_EXTRA_SAVEKEYS, &fname, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789. "); + CKeyboardInput * sms = new CKeyboardInput(LOCALE_EXTRA_SAVEKEYS, &fname); sms->exec(NULL, ""); std::string sname = fileBrowser.getSelectedFile()->Name + "/" + fname; printf("[neutrino keybind_setup] save keys: %s\n", sname.c_str()); diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 06ab8ebb5..9d57c7aa4 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -469,6 +470,7 @@ void CLuaInstance::runScript(const char *fileName, const char *arg0, ...) if (i >= 64) { fprintf(stderr, "CLuaInstance::runScript: too many arguments!\n"); args.clear(); + va_end(list); return; } args.push_back(temp); @@ -1046,7 +1048,6 @@ bool CLuaMenuChangeObserver::changeNotify(lua_State *L, const std::string &luaAc lua_pushstring(L, optionValue); lua_pcall(L, 2 /* two args */, 1 /* one result */, 0); double res = lua_isnumber(L, -1) ? lua_tonumber(L, -1) : 0; - lua_pop(L, 2); return (((int)res == menu_return::RETURN_REPAINT) || ((int)res == menu_return::RETURN_EXIT_REPAINT)); } @@ -1189,6 +1190,35 @@ int CLuaMenuStringinput::exec(CMenuTarget* /*parent*/, const std::string & /*act return menu_return::RETURN_REPAINT; } +CLuaMenuKeyboardinput::CLuaMenuKeyboardinput(lua_State *_L, std::string _luaAction, std::string _luaId, const char *_name, std::string *_value, int _size, CChangeObserver *_observ, const char *_icon, std::string _help, std::string _help2) : CLuaMenuForwarder(_L, _luaAction, _luaId) +{ + name = _name; + value = _value; + size = _size; + icon = _icon; + observ = _observ; + help = _help; + help2 = _help2; +} + +int CLuaMenuKeyboardinput::exec(CMenuTarget* /*parent*/, const std::string & /*actionKey*/) +{ + CKeyboardInput *i; + i = new CKeyboardInput((char *)name, value, size, observ, icon, help, help2); + i->exec(NULL, ""); + delete i; + if (!luaAction.empty()){ + lua_pushglobaltable(L); + lua_getfield(L, -1, luaAction.c_str()); + lua_remove(L, -2); + lua_pushstring(L, luaId.c_str()); + lua_pushstring(L, value->c_str()); + lua_pcall(L, 2 /* two args */, 1 /* one result */, 0); + lua_pop(L, 2); + } + return menu_return::RETURN_REPAINT; +} + int CLuaInstance::MenuNew(lua_State *L) { CMenuWidget *m; @@ -1241,9 +1271,9 @@ int CLuaInstance::MenuAddKey(lua_State *L) std::string action; tableLookup(L, "action", action); std::string id; tableLookup(L, "id", id); - lua_Integer directkey = CRCInput::RC_nokey; + lua_Unsigned directkey = CRCInput::RC_nokey; tableLookup(L, "directkey", directkey); - if (action != "" && directkey != (int) CRCInput::RC_nokey) { + if (action != "" && directkey != CRCInput::RC_nokey) { CLuaMenuForwarder *forwarder = new CLuaMenuForwarder(L, action, id); m->m->addKey(directkey, forwarder, action); m->targets.push_back(forwarder); @@ -1303,7 +1333,8 @@ int CLuaInstance::MenuAddItem(lua_State *L) m->tofree.push_back(icon); } - lua_Integer directkey = CRCInput::RC_nokey, pulldown = false; + lua_Unsigned directkey = CRCInput::RC_nokey; + lua_Integer pulldown = false; tableLookup(L, "directkey", directkey); tableLookup(L, "pulldown", pulldown); @@ -1382,6 +1413,14 @@ int CLuaInstance::MenuAddItem(lua_State *L) CLuaMenuStringinput *stringinput = new CLuaMenuStringinput(L, action, id, b->name.c_str(), &b->str_val, size, valid_chars, m->observ, icon, sms); mi = new CMenuForwarder(b->name, enabled, b->str_val, stringinput, NULL/*ActionKey*/, directkey, icon, right_icon); m->targets.push_back(stringinput); + } else if (type == "keyboardinput") { + b->str_val = value; + lua_Integer size = 0; tableLookup(L, "size", size); + std::string help = ""; tableLookup(L, "help", help); + std::string help2 = ""; tableLookup(L, "help2", help2); + CLuaMenuKeyboardinput *keyboardinput = new CLuaMenuKeyboardinput(L, action, id, b->name.c_str(), &b->str_val, size, m->observ, icon, help, help2); + mi = new CMenuForwarder(b->name, enabled, b->str_val, keyboardinput, NULL/*ActionKey*/, directkey, icon, right_icon); + m->targets.push_back(keyboardinput); } else if (type == "filebrowser") { b->str_val = value; lua_Integer dirMode = 0; diff --git a/src/gui/luainstance.h b/src/gui/luainstance.h index 318de95de..0ff9e0e83 100644 --- a/src/gui/luainstance.h +++ b/src/gui/luainstance.h @@ -103,6 +103,20 @@ class CLuaMenuStringinput : public CLuaMenuForwarder int exec(CMenuTarget* parent, const std::string & actionKey); }; +class CLuaMenuKeyboardinput : public CLuaMenuForwarder +{ + private: + std::string *value; + const char *name; + const char *icon; + int size; + CChangeObserver *observ; + std::string help, help2; + public: + CLuaMenuKeyboardinput(lua_State *_L, std::string _luaAction, std::string _luaId, const char *_name, std::string *_value, int _size, CChangeObserver *_observ, const char *_icon, std::string _help, std::string _help2); + int exec(CMenuTarget* parent, const std::string & actionKey); +}; + class CLuaHintbox { public: diff --git a/src/gui/mediaplayer.cpp b/src/gui/mediaplayer.cpp index ad13d4975..f6c89c7ad 100644 --- a/src/gui/mediaplayer.cpp +++ b/src/gui/mediaplayer.cpp @@ -260,9 +260,8 @@ int CMediaPlayerMenu::initMenuMedia(CMenuWidget *m, CPersonalizeGui *p) personalize->addPersonalizedItems(); //add I_TYPE_MULTIMEDIA plugins - CPluginsExec pluginsExec; unsigned int nextShortcut = (unsigned int)media->getNextShortcut(); - media->integratePlugins(&pluginsExec, CPlugins::I_TYPE_MULTIMEDIA, nextShortcut); + media->integratePlugins(CPlugins::I_TYPE_MULTIMEDIA, nextShortcut); res = media->exec(NULL, ""); delete media; diff --git a/src/gui/mediaplayer_setup.cpp b/src/gui/mediaplayer_setup.cpp index 319b22e3b..8f6bd02bf 100644 --- a/src/gui/mediaplayer_setup.cpp +++ b/src/gui/mediaplayer_setup.cpp @@ -34,7 +34,6 @@ #include #endif - #include "mediaplayer_setup.h" #include @@ -43,18 +42,15 @@ #include #include - #include #include #include - +#include #include #include - - CMediaPlayerSetup::CMediaPlayerSetup() { width = w_max (40, 10); @@ -63,7 +59,6 @@ CMediaPlayerSetup::CMediaPlayerSetup() CMediaPlayerSetup::~CMediaPlayerSetup() { - } int CMediaPlayerSetup::exec(CMenuTarget* parent, const std::string & /*actionKey*/) @@ -83,7 +78,48 @@ int CMediaPlayerSetup::exec(CMenuTarget* parent, const std::string & /*actionKey /*shows media setup menue entries*/ int CMediaPlayerSetup::showMediaPlayerSetup() { + CMenuWidget* mediaSetup = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width); + mediaSetup->setSelected(selected); + // intros + mediaSetup->addIntroItems(LOCALE_MAINMENU_MEDIA); + + CMenuForwarder *mf; + + CAudioPlayerSetup asetup; + mf = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, true, NULL, &asetup, "", CRCInput::RC_red); + mf->setHint(NEUTRINO_ICON_HINT_APLAY, LOCALE_MENU_HINT_APLAY_SETUP); + mediaSetup->addItem(mf); + + CPictureViewerSetup psetup; + mf = new CMenuForwarder(LOCALE_PICTUREVIEWER_HEAD, true, NULL, &psetup, "", CRCInput::RC_green); + mf->setHint(NEUTRINO_ICON_HINT_PICVIEW, LOCALE_MENU_HINT_PICTUREVIEWER_SETUP); + mediaSetup->addItem(mf); + + CWebTVSetup wsetup; + mf = new CMenuForwarder(LOCALE_WEBTV_HEAD, true, NULL, &wsetup, "show_menu", CRCInput::RC_yellow); + mf->setHint(NEUTRINO_ICON_HINT_TVMODE /* FIXME */, LOCALE_MENU_HINT_WEBTV_SETUP); + mediaSetup->addItem(mf); + + mediaSetup->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_MAINMENU_MOVIEPLAYER)); + + CMovieBrowser msetup; + int shortcut = 1; + mf = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, true, NULL, &msetup, "show_menu", CRCInput::convertDigitToKey(shortcut++)); + mf->setHint(NEUTRINO_ICON_HINT_MB, LOCALE_MENU_HINT_MOVIEBROWSER_SETUP); + mediaSetup->addItem(mf); + + mf = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, true, NULL, &msetup, "show_ytmenu", CRCInput::convertDigitToKey(shortcut++)); + mf->setHint(NEUTRINO_ICON_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY_SETUP); + mediaSetup->addItem(mf); + + + int res = mediaSetup->exec (NULL, ""); + selected = mediaSetup->getSelected(); + delete mediaSetup; + return res; + +#if 0 CMenuWidget* mediaSetup = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width); mediaSetup->setSelected(selected); @@ -105,4 +141,5 @@ int CMediaPlayerSetup::showMediaPlayerSetup() selected = mediaSetup->getSelected(); delete mediaSetup; return res; +#endif } diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 4af8e69e8..665731340 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -62,11 +62,36 @@ extern cVideo *videoDecoder; CMiscMenue::CMiscMenue() { width = w_max (40, 10); + + epg_save = NULL; + epg_save_standby = NULL; + epg_save_frequently = NULL; + epg_read = NULL; + epg_dir = NULL; } CMiscMenue::~CMiscMenue() { - + if (epg_save) { + delete epg_save; + epg_save = NULL; + } + if (epg_save_standby) { + delete epg_save_standby; + epg_save_standby = NULL; + } + if (epg_save_frequently) { + delete epg_save_frequently; + epg_save_frequently = NULL; + } + if (epg_read) { + delete epg_read; + epg_read = NULL; + } + if (epg_dir) { + delete epg_dir; + epg_dir = NULL; + } } int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) @@ -283,7 +308,6 @@ int CMiscMenue::showMiscSettingsMenu() delete fanNotifier; delete sectionsdConfigNotifier; - delete miscEpgNotifier; delete miscEpgScanNotifier; return res; } @@ -397,8 +421,20 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) ms_epg->addIntroItems(LOCALE_MISCSETTINGS_EPG_HEAD); ms_epg->addKey(CRCInput::RC_info, this, "info"); - CMenuOptionChooser * mc1 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE_STANDBY, &g_settings.epg_save_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_save); - mc1->setHint("", LOCALE_MENU_HINT_EPG_SAVE_STANDBY); + epg_save = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE, &g_settings.epg_save, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); + epg_save->setHint("", LOCALE_MENU_HINT_EPG_SAVE); + + epg_save_standby = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE_STANDBY, &g_settings.epg_save_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_save); + epg_save_standby->setHint("", LOCALE_MENU_HINT_EPG_SAVE_STANDBY); + + epg_save_frequently = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE_FREQUENTLY, &g_settings.epg_save_frequently, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_save, sectionsdConfigNotifier); + epg_save_frequently->setHint("", LOCALE_MENU_HINT_EPG_SAVE_FREQUENTLY); + + epg_read = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_READ, &g_settings.epg_read, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); + epg_read->setHint("", LOCALE_MENU_HINT_EPG_READ); + + epg_dir = new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_DIR, (g_settings.epg_save || g_settings.epg_read), g_settings.epg_dir, this, "epgdir"); + epg_dir->setHint("", LOCALE_MENU_HINT_EPG_DIR); epg_cache = to_string(g_settings.epg_cache); if (epg_cache.length() < 2) @@ -428,16 +464,6 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) CMenuForwarder * mf3 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, true, epg_max_events, miscSettings_epg_max_events); mf3->setHint("", LOCALE_MENU_HINT_EPG_MAX_EVENTS); - CMenuForwarder * mf4 = new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_DIR, g_settings.epg_save, g_settings.epg_dir, this, "epgdir"); - mf4->setHint("", LOCALE_MENU_HINT_EPG_DIR); - - miscEpgNotifier = new COnOffNotifier(); - miscEpgNotifier->addItem(mc1); - miscEpgNotifier->addItem(mf4); - - CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE, &g_settings.epg_save, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true,miscEpgNotifier); - mc->setHint("", LOCALE_MENU_HINT_EPG_SAVE); - CMenuOptionChooser * mc2 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN_BOUQUETS, &g_settings.epg_scan, EPG_SCAN_OPTIONS, EPG_SCAN_OPTION_COUNT, g_settings.epg_scan_mode != CEpgScan::MODE_OFF); mc2->setHint("", LOCALE_MENU_HINT_EPG_SCAN); @@ -449,9 +475,11 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) CFEManager::getInstance()->getEnabledCount() > 1 ? EPG_SCAN_MODE_OPTION_COUNT : 2, true, miscEpgScanNotifier); mc3->setHint("", LOCALE_MENU_HINT_EPG_SCAN_MODE); - ms_epg->addItem(mc); - ms_epg->addItem(mc1); - ms_epg->addItem(mf4); + ms_epg->addItem(epg_save); + ms_epg->addItem(epg_save_standby); + ms_epg->addItem(epg_save_frequently); + ms_epg->addItem(epg_read); + ms_epg->addItem(epg_dir); ms_epg->addItem(GenericMenuSeparatorLine); ms_epg->addItem(mf); ms_epg->addItem(mf1); @@ -486,8 +514,9 @@ int CMiscMenue::showMiscSettingsMenuChanlist() CMenuWidget * ms_chanlist = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_MISCSETUP_CHANNELLIST); ms_chanlist->addIntroItems(LOCALE_MISCSETTINGS_CHANNELLIST); - bool tmp1 = g_settings.make_hd_list; - bool tmp2 = g_settings.make_webtv_list; + bool make_hd_list = g_settings.make_hd_list; + bool make_webtv_list = g_settings.make_webtv_list; + bool show_empty_favorites = g_settings.show_empty_favorites; CMenuOptionChooser * mc; mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_MAKE_HDLIST , &g_settings.make_hd_list , OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); @@ -521,10 +550,15 @@ int CMiscMenue::showMiscSettingsMenuChanlist() mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_NUMERIC_ADJUST, &g_settings.channellist_numeric_adjust, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); mc->setHint("", LOCALE_MENU_HINT_NUMERIC_ADJUST); ms_chanlist->addItem(mc); + + mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_SHOW_EMPTY_FAVS, &g_settings.show_empty_favorites, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_SHOW_EMPTY_FAVS); + ms_chanlist->addItem(mc); + int res = ms_chanlist->exec(NULL, ""); delete ms_chanlist; - if (tmp1 != g_settings.make_hd_list|| tmp2 != g_settings.make_webtv_list) - g_Zapit->reinitChannels(); + if (make_hd_list != g_settings.make_hd_list || make_webtv_list != g_settings.make_webtv_list || show_empty_favorites != g_settings.show_empty_favorites) + g_RCInput->postMsg(NeutrinoMessages::EVT_SERVICESCHANGED, 0); return res; } @@ -542,6 +576,8 @@ void CMiscMenue::showMiscSettingsMenuCPUFreq(CMenuWidget *ms_cpu) bool CMiscMenue::changeNotify(const neutrino_locale_t OptionName, void * /*data*/) { + int ret = menu_return::RETURN_NONE; + if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC)) { printf("[neutrino CEC Settings] %s set CEC settings...\n", __FUNCTION__); @@ -556,6 +592,22 @@ bool CMiscMenue::changeNotify(const neutrino_locale_t OptionName, void * /*data* videoDecoder->SetCECAutoView(g_settings.hdmi_cec_view_on == 1); videoDecoder->SetCECMode((VIDEO_HDMI_CEC_MODE)g_settings.hdmi_cec_mode); } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_SAVE)) + { + if (g_settings.epg_save) + g_settings.epg_read = true; + epg_save_standby->setActive(g_settings.epg_save); + epg_save_frequently->setActive(g_settings.epg_save); + epg_dir->setActive(g_settings.epg_save || g_settings.epg_read); - return false; + CNeutrinoApp::getInstance()->SendSectionsdConfig(); + + ret = menu_return::RETURN_REPAINT; + } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_READ)) + { + epg_dir->setActive(g_settings.epg_save || g_settings.epg_read); + } + + return ret; } diff --git a/src/gui/miscsettings_menu.h b/src/gui/miscsettings_menu.h index 8958c0aae..7cc778774 100644 --- a/src/gui/miscsettings_menu.h +++ b/src/gui/miscsettings_menu.h @@ -41,8 +41,12 @@ class CMiscMenue : public CMenuTarget, CChangeObserver CFanControlNotifier *fanNotifier; CSectionsdConfigNotifier* sectionsdConfigNotifier; //COnOffNotifier* miscNotifier; - COnOffNotifier* miscEpgNotifier; COnOffNotifier* miscEpgScanNotifier; + CMenuOptionChooser * epg_save; + CMenuOptionChooser * epg_save_standby; + CMenuOptionChooser * epg_save_frequently; + CMenuOptionChooser * epg_read; + CMenuForwarder * epg_dir; int width; std::string epg_cache; std::string epg_extendedcache; diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 8510ab187..d1db4aa4b 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -98,8 +99,10 @@ const CMenuOptionChooser::keyval MESSAGEBOX_BROWSER_ROW_ITEM[MESSAGEBOX_BROWSER_ { MB_INFO_INFO1, LOCALE_MOVIEBROWSER_INFO_INFO1 }, { MB_INFO_MAJOR_GENRE, LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR }, { MB_INFO_MINOR_GENRE, LOCALE_MOVIEBROWSER_INFO_GENRE_MINOR }, + { MB_INFO_INFO2, LOCALE_MOVIEBROWSER_INFO_INFO2 }, { MB_INFO_PARENTAL_LOCKAGE, LOCALE_MOVIEBROWSER_INFO_PARENTAL_LOCKAGE }, { MB_INFO_CHANNEL, LOCALE_MOVIEBROWSER_INFO_CHANNEL }, + { MB_INFO_BOOKMARK, LOCALE_MOVIEBROWSER_MENU_MAIN_BOOKMARKS }, { MB_INFO_QUALITY, LOCALE_MOVIEBROWSER_INFO_QUALITY }, { MB_INFO_PREVPLAYDATE, LOCALE_MOVIEBROWSER_INFO_PREVPLAYDATE }, { MB_INFO_RECORDDATE, LOCALE_MOVIEBROWSER_INFO_RECORDDATE }, @@ -108,9 +111,7 @@ 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_BOOKMARK, LOCALE_MOVIEBROWSER_MENU_MAIN_BOOKMARKS }, - { MB_INFO_FILENAME, LOCALE_MOVIEBROWSER_INFO_FILENAME } + { MB_INFO_SIZE, LOCALE_MOVIEBROWSER_INFO_SIZE } }; #define MESSAGEBOX_YES_NO_OPTIONS_COUNT 2 @@ -362,15 +363,19 @@ CMovieBrowser::~CMovieBrowser() void CMovieBrowser::clearListLines() { - for (int i = 0; i < LF_MAX_ROWS; i++) + for (int i = 0; i < MB_MAX_ROWS; i++) { m_browserListLines.lineArray[i].clear(); - m_recordListLines.lineArray[i].clear(); - m_playListLines.lineArray[i].clear(); m_FilterLines.lineArray[i].clear(); } m_browserListLines.Icon.clear(); m_browserListLines.marked.clear(); + + for (int i = 0; i < 2; i++) + { + m_recordListLines.lineArray[i].clear(); + m_playListLines.lineArray[i].clear(); + } m_recordListLines.marked.clear(); m_playListLines.marked.clear(); } @@ -543,6 +548,9 @@ void CMovieBrowser::initGlobalSettings(void) m_settings.browserRowItem[3] = MB_INFO_SIZE; m_settings.browserRowItem[4] = MB_INFO_LENGTH; m_settings.browserRowItem[5] = MB_INFO_INFO1; + m_settings.browserRowItem[6] = MB_INFO_MAX_NUMBER; + m_settings.browserRowItem[7] = MB_INFO_MAX_NUMBER; + m_settings.browserRowItem[8] = MB_INFO_MAX_NUMBER; m_settings.browserRowWidth[0] = m_defaultRowWidth[m_settings.browserRowItem[0]]; //300; m_settings.browserRowWidth[1] = m_defaultRowWidth[m_settings.browserRowItem[1]]; //100; @@ -550,6 +558,9 @@ void CMovieBrowser::initGlobalSettings(void) m_settings.browserRowWidth[3] = m_defaultRowWidth[m_settings.browserRowItem[3]]; //50; m_settings.browserRowWidth[4] = m_defaultRowWidth[m_settings.browserRowItem[4]]; //30; m_settings.browserRowWidth[5] = m_defaultRowWidth[m_settings.browserRowItem[5]]; //30; + m_settings.browserRowWidth[6] = m_defaultRowWidth[m_settings.browserRowItem[6]]; + m_settings.browserRowWidth[7] = m_defaultRowWidth[m_settings.browserRowItem[7]]; + m_settings.browserRowWidth[8] = m_defaultRowWidth[m_settings.browserRowItem[8]]; m_settings.ts_only = 1; m_settings.ytmode = cYTFeedParser::MOST_POPULAR; @@ -620,33 +631,17 @@ void CMovieBrowser::initRows(void) m_settings.lastPlayRowNr = 2; m_settings.lastPlayRow[0] = MB_INFO_TITLE; m_settings.lastPlayRow[1] = MB_INFO_PREVPLAYDATE; - m_settings.lastPlayRow[2] = MB_INFO_MAX_NUMBER; - m_settings.lastPlayRow[3] = MB_INFO_MAX_NUMBER; - m_settings.lastPlayRow[4] = MB_INFO_MAX_NUMBER; - m_settings.lastPlayRow[5] = MB_INFO_MAX_NUMBER; /* the "last played" / "last recorded" windows have only half the width, so - multiply the relative width with 2 and add some fixed value for slack */ + multiply the relative width with 2 */ m_settings.lastPlayRowWidth[1] = m_defaultRowWidth[m_settings.lastPlayRow[1]] * 2 + 1; m_settings.lastPlayRowWidth[0] = 100 - m_settings.lastPlayRowWidth[1]; - m_settings.lastPlayRowWidth[2] = m_defaultRowWidth[m_settings.lastPlayRow[2]]; - m_settings.lastPlayRowWidth[3] = m_defaultRowWidth[m_settings.lastPlayRow[3]]; - m_settings.lastPlayRowWidth[4] = m_defaultRowWidth[m_settings.lastPlayRow[4]]; - m_settings.lastPlayRowWidth[5] = m_defaultRowWidth[m_settings.lastPlayRow[5]]; /***** Last Record List **************/ m_settings.lastRecordRowNr = 2; m_settings.lastRecordRow[0] = MB_INFO_TITLE; m_settings.lastRecordRow[1] = MB_INFO_RECORDDATE; - m_settings.lastRecordRow[2] = MB_INFO_MAX_NUMBER; - m_settings.lastRecordRow[3] = MB_INFO_MAX_NUMBER; - m_settings.lastRecordRow[4] = MB_INFO_MAX_NUMBER; - m_settings.lastRecordRow[5] = MB_INFO_MAX_NUMBER; m_settings.lastRecordRowWidth[1] = m_defaultRowWidth[m_settings.lastRecordRow[1]] * 2 + 1; m_settings.lastRecordRowWidth[0] = 100 - m_settings.lastRecordRowWidth[1]; - m_settings.lastRecordRowWidth[2] = m_defaultRowWidth[m_settings.lastRecordRow[2]]; - m_settings.lastRecordRowWidth[3] = m_defaultRowWidth[m_settings.lastRecordRow[3]]; - m_settings.lastRecordRowWidth[4] = m_defaultRowWidth[m_settings.lastRecordRow[4]]; - m_settings.lastRecordRowWidth[5] = m_defaultRowWidth[m_settings.lastRecordRow[5]]; } void CMovieBrowser::defaultSettings(MB_SETTINGS* /*settings*/) @@ -869,6 +864,16 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) m_movieSelectionHandler->bookmarks.user[i].pos =0; } } + else if(actionKey == "show_menu") + { + showMenu(true); + } + else if(actionKey == "show_ytmenu") + { + showYTMenu(true); + saveSettings(&m_settings); + } + return returnval; } @@ -1752,13 +1757,13 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) if (show_mode == MB_SHOW_YT) showYTMenu(); else - showMenu(m_movieSelectionHandler); + showMenu(); } else if (msg == CRCInput::RC_text || msg == CRCInput::RC_radio) { if ((show_mode == MB_SHOW_RECORDS) && - (ShowMsg(LOCALE_MESSAGEBOX_INFO, msg == CRCInput::RC_radio ? "Copy jumps from movie to new file ?" : "Copy jumps from movie to new files ?", CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes)) { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, "Coping, please wait"); + (ShowMsg(LOCALE_MESSAGEBOX_INFO, msg == CRCInput::RC_radio ? LOCALE_MOVIEBROWSER_COPY : LOCALE_MOVIEBROWSER_COPIES, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes)) { + CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_COPYING); hintBox->paint(); sleep(1); hintBox->hide(); @@ -1767,7 +1772,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) off64_t res = copy_movie(m_movieSelectionHandler, &m_movieInfo, msg == CRCInput::RC_radio); //g_RCInput->clearRCMsg(); if (res == 0) - ShowMsg(LOCALE_MESSAGEBOX_ERROR, "Copy failed, is there jump bookmarks ? Or check free space.", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_COPY_FAILED, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); else loadMovies(); refresh(); @@ -1780,8 +1785,8 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) else #endif if ((show_mode == MB_SHOW_RECORDS) && - (ShowMsg(LOCALE_MESSAGEBOX_INFO, "Cut jumps from movie ?", CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes)) { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, "Cutting, please wait"); + (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_CUT, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes)) { + CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_CUTTING); hintBox->paint(); sleep(1); hintBox->hide(); @@ -1790,7 +1795,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) off64_t res = cut_movie(m_movieSelectionHandler, &m_movieInfo); //g_RCInput->clearRCMsg(); if (res == 0) - ShowMsg(LOCALE_MESSAGEBOX_ERROR, "Cut failed, is there jump bookmarks ? Or check free space.", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_CUT_FAILED, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); else { loadMovies(); } @@ -1800,19 +1805,19 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) else if (msg == CRCInput::RC_games) { if ((show_mode == MB_SHOW_RECORDS) && m_movieSelectionHandler != NULL) { if ((m_movieSelectionHandler == playing_info) && (NeutrinoMessages::mode_ts == CNeutrinoApp::getInstance()->getMode())) - ShowMsg(LOCALE_MESSAGEBOX_ERROR, "Impossible to truncate playing movie.", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_TRUNCATE_FAILED_PLAYING, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); else if (m_movieSelectionHandler->bookmarks.end == 0) - ShowMsg(LOCALE_MESSAGEBOX_ERROR, "No End bookmark defined!", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_BOOK_NO_END, CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); else { - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, "Truncate movie ?", CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, "Truncating, please wait"); + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_TRUNCATE, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { + CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_TRUNCATING); hintBox->paint(); off64_t res = truncate_movie(m_movieSelectionHandler); hintBox->hide(); delete hintBox; g_RCInput->clearRCMsg(); if (res == 0) - ShowMsg(LOCALE_MESSAGEBOX_ERROR, "Truncate failed.", CMessageBox::mbrCancel, CMessageBox::mbCancel, NEUTRINO_ICON_ERROR); + 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); @@ -1824,7 +1829,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } } else if (msg == CRCInput::RC_favorites) { if (m_movieSelectionHandler != NULL) { - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, "Remove screenshot ?", CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { + 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 != "") unlink(fname.c_str()); @@ -2032,53 +2037,52 @@ bool CMovieBrowser::onButtonPressMovieInfoList(neutrino_msg_t msg) void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler, bool skipAsk) { //TRACE("[onDeleteFile] "); +#if 0 int test= movieSelectionHandler.file.Name.find(".ts", movieSelectionHandler.file.Name.length()-3); - if (test == -1) - { + if (test == -1) { // not a TS file, return!!!!! TRACE("show_ts_info: not a TS file "); + return; + } +#endif + std::string msg = g_Locale->getText(LOCALE_FILEBROWSER_DODELETE1); + msg += "\n "; + if (movieSelectionHandler.file.Name.length() > 40) + { + msg += movieSelectionHandler.file.Name.substr(0,40); + msg += "..."; } else + msg += movieSelectionHandler.file.Name; + + msg += "\n "; + msg += g_Locale->getText(LOCALE_FILEBROWSER_DODELETE2); + if ((skipAsk) || (ShowMsg(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes)) { - std::string msg = g_Locale->getText(LOCALE_FILEBROWSER_DODELETE1); - msg += "\n "; - if (movieSelectionHandler.file.Name.length() > 40) - { - msg += movieSelectionHandler.file.Name.substr(0,40); - msg += "..."; - } - else - msg += movieSelectionHandler.file.Name; + CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MOVIEBROWSER_DELETE_INFO)); + hintBox->paint(); + delFile(movieSelectionHandler.file); - msg += "\n "; - msg += g_Locale->getText(LOCALE_FILEBROWSER_DODELETE2); - if ((skipAsk) || (ShowMsg(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes)) - { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MOVIEBROWSER_DELETE_INFO)); - hintBox->paint(); - delFile(movieSelectionHandler.file); + std::string fname = getScreenshotName(movieSelectionHandler.file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); + if (!fname.empty()) + unlink(fname.c_str()); - std::string fname = getScreenshotName(movieSelectionHandler.file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); - if (!fname.empty()) - unlink(fname.c_str()); + CFile file_xml = movieSelectionHandler.file; + if (m_movieInfo.convertTs2XmlName(file_xml.Name)) + unlink(file_xml.Name.c_str()); - CFile file_xml = movieSelectionHandler.file; - if (m_movieInfo.convertTs2XmlName(file_xml.Name)) - unlink(file_xml.Name.c_str()); + delete hintBox; + g_RCInput->clearRCMsg(); - delete hintBox; - g_RCInput->clearRCMsg(); + m_vMovieInfo.erase((std::vector::iterator)&movieSelectionHandler); + TRACE("List size: %d\n", (int)m_vMovieInfo.size()); - m_vMovieInfo.erase((std::vector::iterator)&movieSelectionHandler); - TRACE("List size: %d\n", (int)m_vMovieInfo.size()); - - updateSerienames(); - refreshBrowserList(); - refreshLastPlayList(); - refreshLastRecordList(); - refreshMovieInfo(); - refresh(); - } + updateSerienames(); + refreshBrowserList(); + refreshLastPlayList(); + refreshLastRecordList(); + refreshMovieInfo(); + refresh(); } } @@ -2677,7 +2681,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) for (int li =0 ; li < MI_MOVIE_BOOK_USER_MAX && li < MAX_NUMBER_OF_BOOKMARK_ITEMS; li++) { - CStringInputSMS *pBookNameInput = new CStringInputSMS(LOCALE_MOVIEBROWSER_EDIT_BOOK, &movie_info->bookmarks.user[li].name, 20, LOCALE_MOVIEBROWSER_EDIT_BOOK_NAME_INFO1, LOCALE_MOVIEBROWSER_EDIT_BOOK_NAME_INFO2, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); + CKeyboardInput * pBookNameInput = new CKeyboardInput(LOCALE_MOVIEBROWSER_EDIT_BOOK_NAME_INFO1, &movie_info->bookmarks.user[li].name, 20); CIntInput *pBookPosIntInput = new CIntInput(LOCALE_MOVIEBROWSER_EDIT_BOOK, (int *)&movie_info->bookmarks.user[li].pos, 20, LOCALE_MOVIEBROWSER_EDIT_BOOK_POS_INFO1, LOCALE_MOVIEBROWSER_EDIT_BOOK_POS_INFO2); CIntInput *pBookTypeIntInput = new CIntInput(LOCALE_MOVIEBROWSER_EDIT_BOOK, (int *)&movie_info->bookmarks.user[li].length, 20, LOCALE_MOVIEBROWSER_EDIT_BOOK_TYPE_INFO1, LOCALE_MOVIEBROWSER_EDIT_BOOK_TYPE_INFO2); @@ -2692,7 +2696,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) /********************************************************************/ /** serie******************************************************/ - CStringInputSMS serieUserInput(LOCALE_MOVIEBROWSER_EDIT_SERIE, &movie_info->serieName, 20, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); + CKeyboardInput serieUserInput(LOCALE_MOVIEBROWSER_EDIT_SERIE, &movie_info->serieName, 20); CMenuWidget serieMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); serieMenu.addIntroItems(LOCALE_MOVIEBROWSER_SERIE_HEAD); @@ -2732,13 +2736,14 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) strncpy(dirItNr, m_dirNames[movie_info->dirItNr].c_str(),BUFFER_SIZE-1); snprintf(size,BUFFER_SIZE,"%5" PRIu64 "",movie_info->file.Size>>20); - CStringInputSMS titelUserInput(LOCALE_MOVIEBROWSER_INFO_TITLE, &movie_info->epgTitle, (movie_info->epgTitle.empty() || (movie_info->epgTitle.size() < MAX_STRING)) ? MAX_STRING:movie_info->epgTitle.size(), NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); - CStringInputSMS channelUserInput(LOCALE_MOVIEBROWSER_INFO_CHANNEL, &movie_info->epgChannel, MAX_STRING, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); - CStringInputSMS epgUserInput(LOCALE_MOVIEBROWSER_INFO_INFO1, &movie_info->epgInfo1, 20, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); + CKeyboardInput titelUserInput(LOCALE_MOVIEBROWSER_INFO_TITLE, &movie_info->epgTitle, (movie_info->epgTitle.empty() || (movie_info->epgTitle.size() < MAX_STRING)) ? MAX_STRING:movie_info->epgTitle.size()); + CKeyboardInput channelUserInput(LOCALE_MOVIEBROWSER_INFO_CHANNEL, &movie_info->epgChannel, MAX_STRING); + CKeyboardInput epgUserInput(LOCALE_MOVIEBROWSER_INFO_INFO1, &movie_info->epgInfo1, 20); + CKeyboardInput countryUserInput(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, &movie_info->productionCountry, 11); + CDateInput dateUserDateInput(LOCALE_MOVIEBROWSER_INFO_LENGTH, &movie_info->dateOfLastPlay, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CDateInput recUserDateInput(LOCALE_MOVIEBROWSER_INFO_LENGTH, &movie_info->file.Time, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CIntInput lengthUserIntInput(LOCALE_MOVIEBROWSER_INFO_LENGTH, (int *)&movie_info->length, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); - CStringInputSMS countryUserInput(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, &movie_info->productionCountry, 11, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "ABCDEFGHIJKLMNOPQRSTUVWXYZ "); CIntInput yearUserIntInput(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, (int *)&movie_info->productionDate, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CMenuWidget movieInfoMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); @@ -2770,7 +2775,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) return res; } -bool CMovieBrowser::showMenu(MI_MOVIE_INFO* /* movie_info */, bool calledExternally) +bool CMovieBrowser::showMenu(bool calledExternally) { /* first clear screen */ framebuffer->paintBackground(); @@ -2835,7 +2840,7 @@ bool CMovieBrowser::showMenu(MI_MOVIE_INFO* /* movie_info */, bool calledExterna for (i = 0; i < MB_MAX_ROWS; i++) { CIntInput* browserRowWidthIntInput = new CIntInput(LOCALE_MOVIEBROWSER_BROWSER_ROW_WIDTH,(int *)&m_settings.browserRowWidth[i], 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); - optionsMenuBrowser.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_BROWSER_ROW_ITEM, (int*)(&m_settings.browserRowItem[i]), MESSAGEBOX_BROWSER_ROW_ITEM, MESSAGEBOX_BROWSER_ROW_ITEM_COUNT, true)); + optionsMenuBrowser.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_BROWSER_ROW_ITEM, (int*)(&m_settings.browserRowItem[i]), MESSAGEBOX_BROWSER_ROW_ITEM, MESSAGEBOX_BROWSER_ROW_ITEM_COUNT, true, NULL, CRCInput::convertDigitToKey(i+1), NULL, true, true)); optionsMenuBrowser.addItem(new CMenuDForwarder(LOCALE_MOVIEBROWSER_BROWSER_ROW_WIDTH, true, browserRowWidthIntInput->getValue(), browserRowWidthIntInput)); if (i < MB_MAX_ROWS-1) optionsMenuBrowser.addItem(GenericMenuSeparator); @@ -2870,19 +2875,22 @@ bool CMovieBrowser::showMenu(MI_MOVIE_INFO* /* movie_info */, bool calledExterna CMovieHelp* movieHelp = new CMovieHelp(); CNFSSmallMenu* nfs = new CNFSSmallMenu(); - CMenuWidget mainMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); - mainMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_MAIN_HEAD); - mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_info_menu", CRCInput::RC_red)); - mainMenu.addItem(GenericMenuSeparatorLine); - mainMenu.addItem(new CMenuForwarder(LOCALE_EPGPLUS_OPTIONS, true, NULL, &optionsMenu,NULL, CRCInput::RC_green)); - mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_DIRECTORIES_HEAD, true, NULL, &dirMenu, NULL, CRCInput::RC_yellow)); - mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, true, NULL, this, "reload_movie_info", CRCInput::RC_blue)); - //mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_NFS_HEAD, true, NULL, nfs, NULL, CRCInput::RC_setup)); - mainMenu.addItem(GenericMenuSeparatorLine); - mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_HELP_HEAD, true, NULL, movieHelp, NULL, CRCInput::RC_help)); - //mainMenu.addItem(GenericMenuSeparator); + if (!calledExternally) { + CMenuWidget mainMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); + mainMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_MAIN_HEAD); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_info_menu", CRCInput::RC_red)); + mainMenu.addItem(GenericMenuSeparatorLine); + mainMenu.addItem(new CMenuForwarder(LOCALE_EPGPLUS_OPTIONS, true, NULL, &optionsMenu,NULL, CRCInput::RC_green)); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_DIRECTORIES_HEAD, true, NULL, &dirMenu, NULL, CRCInput::RC_yellow)); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, true, NULL, this, "reload_movie_info", CRCInput::RC_blue)); + //mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_NFS_HEAD, true, NULL, nfs, NULL, CRCInput::RC_setup)); + mainMenu.addItem(GenericMenuSeparatorLine); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_HELP_HEAD, true, NULL, movieHelp, NULL, CRCInput::RC_help)); + //mainMenu.addItem(GenericMenuSeparator); - mainMenu.exec(NULL, " "); + mainMenu.exec(NULL, " "); + } else + optionsMenu.exec(NULL, ""); // post menu handling if (m_parentalLock != MB_PARENTAL_LOCK_OFF_TMP) @@ -3447,7 +3455,7 @@ int CYTHistory::exec(CMenuTarget* parent, const std::string &actionKey) return menu_return::RETURN_EXIT; } -bool CMovieBrowser::showYTMenu() +bool CMovieBrowser::showYTMenu(bool calledExternally) { framebuffer->paintBackground(); @@ -3458,30 +3466,36 @@ bool CMovieBrowser::showYTMenu() CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); char cnt[5]; - for (unsigned i = 0; i < YT_FEED_OPTION_COUNT; i++) { - sprintf(cnt, "%d", YT_FEED_OPTIONS[i].key); - mainMenu.addItem(new CMenuForwarder(YT_FEED_OPTIONS[i].value, true, NULL, selector, cnt, CRCInput::convertDigitToKey(i + 1)), m_settings.ytmode == (int) YT_FEED_OPTIONS[i].key); + if (!calledExternally) { + for (unsigned i = 0; i < YT_FEED_OPTION_COUNT; i++) { + sprintf(cnt, "%d", YT_FEED_OPTIONS[i].key); + mainMenu.addItem(new CMenuForwarder(YT_FEED_OPTIONS[i].value, true, NULL, selector, cnt, CRCInput::convertDigitToKey(i + 1)), m_settings.ytmode == (int) YT_FEED_OPTIONS[i].key); + } + mainMenu.addItem(GenericMenuSeparatorLine); + + bool enabled = (!m_vMovieInfo.empty()) && (m_movieSelectionHandler != NULL); + sprintf(cnt, "%d", cYTFeedParser::RELATED); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_RELATED, enabled, NULL, selector, cnt, CRCInput::RC_red)); + + mainMenu.addItem(GenericMenuSeparatorLine); } - mainMenu.addItem(GenericMenuSeparatorLine); - - bool enabled = (!m_vMovieInfo.empty()) && (m_movieSelectionHandler != NULL); - sprintf(cnt, "%d", cYTFeedParser::RELATED); - mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_RELATED, enabled, NULL, selector, cnt, CRCInput::RC_red)); - - mainMenu.addItem(GenericMenuSeparatorLine); std::string search = m_settings.ytsearch; - CStringInputSMS stringInput(LOCALE_MOVIEBROWSER_YT_SEARCH, &search, 20, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789 -_/()<>=+.,:!?\\'"); - mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_SEARCH, true, search, &stringInput, NULL, CRCInput::RC_green)); - mainMenu.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_YT_ORDERBY, &m_settings.ytorderby, YT_ORDERBY_OPTIONS, YT_ORDERBY_OPTION_COUNT, true, NULL, CRCInput::RC_nokey, "", true)); - sprintf(cnt, "%d", cYTFeedParser::SEARCH); - mainMenu.addItem(new CMenuForwarder(LOCALE_EVENTFINDER_START_SEARCH, true, NULL, selector, cnt, CRCInput::RC_yellow)); + CKeyboardInput stringInput(LOCALE_MOVIEBROWSER_YT_SEARCH, &search); + if (!calledExternally) { + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_SEARCH, true, search, &stringInput, NULL, CRCInput::RC_green)); + mainMenu.addItem(new CMenuOptionChooser(LOCALE_MOVIEBROWSER_YT_ORDERBY, &m_settings.ytorderby, YT_ORDERBY_OPTIONS, YT_ORDERBY_OPTION_COUNT, true, NULL, CRCInput::RC_nokey, "", true)); + sprintf(cnt, "%d", cYTFeedParser::SEARCH); + mainMenu.addItem(new CMenuForwarder(LOCALE_EVENTFINDER_START_SEARCH, true, NULL, selector, cnt, CRCInput::RC_yellow)); + } CYTHistory ytHistory(m_settings, search); - if (m_settings.ytsearch_history_size > 0) - mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_HISTORY, true, NULL, &ytHistory, "", CRCInput::RC_blue)); + if (!calledExternally) { + if (m_settings.ytsearch_history_size > 0) + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_HISTORY, true, NULL, &ytHistory, "", CRCInput::RC_blue)); - mainMenu.addItem(GenericMenuSeparatorLine); + mainMenu.addItem(GenericMenuSeparatorLine); + } mainMenu.addItem(new CMenuOptionNumberChooser(LOCALE_MOVIEBROWSER_YT_MAX_RESULTS, &m_settings.ytresults, true, 10, 50, NULL)); mainMenu.addItem(new CMenuOptionNumberChooser(LOCALE_MOVIEBROWSER_YT_MAX_HISTORY, &m_settings.ytsearch_history_max, true, 10, 50, NULL)); @@ -3530,8 +3544,18 @@ bool CMovieBrowser::showYTMenu() delete selector; bool reload = false; - printf("MovieBrowser::showYTMenu(): selected: %d\n", select); int newmode = -1; + if (rstr != m_settings.ytregion) { + m_settings.ytregion = rstr; + if (newmode < 0) + newmode = m_settings.ytmode; + reload = true; + printf("change region to %s\n", m_settings.ytregion.c_str()); + } + if (calledExternally) + return true; + + printf("MovieBrowser::showYTMenu(): selected: %d\n", select); if (select >= 0) { newmode = select; if (select == cYTFeedParser::RELATED) { @@ -3571,13 +3595,7 @@ bool CMovieBrowser::showYTMenu() reload = true; } } - if (rstr != m_settings.ytregion) { - m_settings.ytregion = rstr; - if (newmode < 0) - newmode = m_settings.ytmode; - reload = true; - printf("change region to %s\n", m_settings.ytregion.c_str()); - } + if (reload) { CHintBox loadBox(LOCALE_MOVIEPLAYER_YTPLAYBACK, g_Locale->getText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES)); loadBox.paint(); diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index bddfca3fc..0cf21f829 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -190,7 +190,7 @@ typedef enum MB_SHOW_YT } MB_SHOW_MODE; -#define MB_MAX_ROWS 6 +#define MB_MAX_ROWS LF_MAX_ROWS #define MB_MAX_DIRS 5 /* MB_SETTINGS to be stored in g_settings anytime ....*/ typedef struct @@ -222,13 +222,13 @@ typedef struct // to be added to config later int lastPlayMaxItems; int lastPlayRowNr; - MB_INFO_ITEM lastPlayRow[MB_MAX_ROWS]; - int lastPlayRowWidth[MB_MAX_ROWS]; + MB_INFO_ITEM lastPlayRow[2]; + int lastPlayRowWidth[2]; int lastRecordMaxItems; int lastRecordRowNr; - MB_INFO_ITEM lastRecordRow[MB_MAX_ROWS]; - int lastRecordRowWidth[MB_MAX_ROWS]; + MB_INFO_ITEM lastRecordRow[2]; + int lastRecordRowWidth[2]; int ytmode; int ytorderby; int ytresults; @@ -354,7 +354,7 @@ class CMovieBrowser : public CMenuTarget std::vector yt_completed; std::vector yt_failed; void loadYTitles(int mode, std::string search = "", std::string id = ""); - bool showYTMenu(void); + bool showYTMenu(bool calledExternally = false); void refreshYTMenu(); public: // Functions //////////////////////////////////////////////////////////7 @@ -430,7 +430,7 @@ class CMovieBrowser : public CMenuTarget void getStorageInfo(void); // P3 ///// Menu //////////////////////////////////// - bool showMenu(MI_MOVIE_INFO* movie_info, bool calledExternally = false); // P2 + bool showMenu(bool calledExternally = false); int showMovieInfoMenu(MI_MOVIE_INFO* movie_info); // P2 int showStartPosSelectionMenu(void); // P2 diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index b487d7b65..c376e92d2 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -51,6 +51,8 @@ #include #include +#include + #include #include #include @@ -206,8 +208,10 @@ void CMoviePlayerGui::cutNeutrino() g_Zapit->setStandby(true); #endif - m_LastMode = (CNeutrinoApp::getInstance()->getMode() | NeutrinoMessages::norezap); -printf("%s: save mode %d\n", __func__, m_LastMode & NeutrinoMessages::mode_mask);fflush(stdout); + m_LastMode = (CNeutrinoApp::getInstance()->getMode() /*| NeutrinoMessages::norezap*/); + if (isWebTV) + m_LastMode |= NeutrinoMessages::norezap; + printf("%s: save mode %x\n", __func__, m_LastMode);fflush(stdout); int new_mode = NeutrinoMessages::norezap | (isWebTV ? NeutrinoMessages::mode_webtv : NeutrinoMessages::mode_ts); CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, new_mode); } @@ -227,13 +231,15 @@ void CMoviePlayerGui::restoreNeutrino() if (isUPNP) return; - g_Zapit->unlockPlayBack(); + //g_Zapit->unlockPlayBack(); + CZapit::getInstance()->EnablePlayback(true); g_Sectionsd->setPauseScanning(false); -printf("%s: restore mode %d\n", __func__, m_LastMode & NeutrinoMessages::mode_mask);fflush(stdout); + printf("%s: restore mode %x\n", __func__, m_LastMode);fflush(stdout); +#if 0 if (m_LastMode == NeutrinoMessages::mode_tv) g_RCInput->postMsg(NeutrinoMessages::EVT_PROGRAMLOCKSTATUS, 0x200, false); - +#endif if (m_LastMode != NeutrinoMessages::mode_unknown) CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, m_LastMode); @@ -244,7 +250,7 @@ printf("%s: restore mode %d\n", __func__, m_LastMode & NeutrinoMessages::mode_ma CZapit::getInstance()->Rezap(); } #endif -printf("%s: restoring done.\n", __func__);fflush(stdout); + printf("%s: restoring done.\n", __func__);fflush(stdout); } int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) @@ -414,8 +420,6 @@ void CMoviePlayerGui::Cleanup() p_movie_info = NULL; autoshot_done = false; currentaudioname = "Unk"; - info_1 = ""; - info_2 = ""; } void CMoviePlayerGui::ClearFlags() @@ -500,6 +504,8 @@ bool CMoviePlayerGui::SelectFile() menu_ret = menu_return::RETURN_REPAINT; Cleanup(); + info_1 = ""; + info_2 = ""; pretty_name.clear(); file_name.clear(); @@ -912,6 +918,24 @@ void CMoviePlayerGui::PlayFileLoop(void) updateLcd(); if (timeshift == TSHIFT_MODE_OFF) callInfoViewer(); + } else if (filelist.size() > 0) { + EnableClockAndMute(false); + CFileBrowser playlist; + CFile *pfile = NULL; + pfile = &(*filelist_it); + if (playlist.playlist_manager(filelist, std::distance( filelist.begin(), filelist_it ))) + { + playstate = CMoviePlayerGui::STOPPED; + CFile *sfile = NULL; + for (filelist_it = filelist.begin(); filelist_it != filelist.end(); ++filelist_it) + { + pfile = &(*filelist_it); + sfile = playlist.getSelectedFile(); + if ( (sfile->getFileName() == pfile->getFileName()) && (sfile->getPath() == pfile->getPath())) + break; + } + } + EnableClockAndMute(true); } } else if (msg == (neutrino_msg_t) g_settings.mpkey_pause) { if (playstate == CMoviePlayerGui::PAUSE) { @@ -1262,12 +1286,12 @@ void CMoviePlayerGui::selectAudioPid() APIDSelector.addItem(item, defpid); } + int percent[numpida]; if (p_movie_info && numpida <= p_movie_info->audioPids.size()) { APIDSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST)); CVolume::getInstance()->SetCurrentChannel(p_movie_info->epgId); CVolume::getInstance()->SetCurrentPid(currentapid); - int percent[numpida]; for (uint i=0; i < numpida; i++) { percent[i] = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, apids[i], ac3flags[i]); APIDSelector.addItem(new CMenuOptionNumberChooser(p_movie_info->audioPids[i].epgAudioPidName, @@ -1275,7 +1299,13 @@ void CMoviePlayerGui::selectAudioPid() 0, 999, CVolume::getInstance())); } } - + if (!g_settings.easymenu) { + APIDSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE)); + extern CAudioSetupNotifier * audioSetupNotifier; + APIDSelector.addItem( new CMenuOptionChooser(LOCALE_AUDIOMENU_ANALOG_OUT, &g_settings.analog_out, + OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, + true, audioSetupNotifier, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN) ); + } APIDSelector.exec(NULL, ""); delete selector; printf("CMoviePlayerGui::selectAudioPid: selected %d (%x) current %x\n", select, (select >= 0) ? apids[select] : -1, currentapid); diff --git a/src/gui/network_setup.cpp b/src/gui/network_setup.cpp index f6c6718f3..17a5c5ac7 100644 --- a/src/gui/network_setup.cpp +++ b/src/gui/network_setup.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -243,7 +244,7 @@ int CNetworkSetup::showNetworkSetup() CIPInput networkSettings_NameServer(LOCALE_NETWORKMENU_NAMESERVER, &network_nameserver, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2); //hostname - CStringInputSMS networkSettings_Hostname(LOCALE_NETWORKMENU_HOSTNAME, &network_hostname, 30, LOCALE_NETWORKMENU_HOSTNAME_HINT1, LOCALE_NETWORKMENU_HOSTNAME_HINT2, "abcdefghijklmnopqrstuvwxyz0123456789-. "); + CKeyboardInput networkSettings_Hostname(LOCALE_NETWORKMENU_HOSTNAME, &network_hostname, 0, NULL, NULL, LOCALE_NETWORKMENU_HOSTNAME_HINT1, LOCALE_NETWORKMENU_HOSTNAME_HINT2); //auto start CMenuOptionChooser* o1 = new CMenuOptionChooser(LOCALE_NETWORKMENU_SETUPONSTARTUP, &network_automatic_start, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); @@ -266,11 +267,11 @@ int CNetworkSetup::showNetworkSetup() m5->setHint("", LOCALE_MENU_HINT_NET_NAMESERVER); m8->setHint("", LOCALE_MENU_HINT_NET_HOSTNAME); - dhcpDisable[0] = m1; - dhcpDisable[1] = m2; - dhcpDisable[2] = m3; - dhcpDisable[3] = m4; - dhcpDisable[4] = m5; + dhcpDisable.Add(m1); + dhcpDisable.Add(m2); + dhcpDisable.Add(m3); + dhcpDisable.Add(m4); + dhcpDisable.Add(m5); CMenuOptionChooser* o2 = new CMenuOptionChooser(LOCALE_NETWORKMENU_DHCP, &network_dhcp, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); o2->setHint("", LOCALE_MENU_HINT_NET_DHCP); @@ -300,9 +301,9 @@ int CNetworkSetup::showNetworkSetup() if(ifcount > 1) // if there is only one, its probably wired { //ssid - CStringInputSMS * networkSettings_ssid = new CStringInputSMS(LOCALE_NETWORKMENU_SSID, &network_ssid, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789 -_/()<>=+.,:!?\\'"); + CKeyboardInput * networkSettings_ssid = new CKeyboardInput(LOCALE_NETWORKMENU_SSID, &network_ssid); //key - CStringInputSMS * networkSettings_key = new CStringInputSMS(LOCALE_NETWORKMENU_PASSWORD, &network_key, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.! "); + CKeyboardInput * networkSettings_key = new CKeyboardInput(LOCALE_NETWORKMENU_PASSWORD, &network_key); CMenuForwarder *m9 = new CMenuDForwarder(LOCALE_NETWORKMENU_SSID , networkConfig->wireless, network_ssid , networkSettings_ssid ); CMenuForwarder *m10 = new CMenuDForwarder(LOCALE_NETWORKMENU_PASSWORD , networkConfig->wireless, network_key , networkSettings_key ); CMenuForwarder *m11 = new CMenuForwarder(LOCALE_NETWORKMENU_SSID_SCAN , networkConfig->wireless, NULL, this, "scanssid"); @@ -311,9 +312,9 @@ int CNetworkSetup::showNetworkSetup() m10->setHint("", LOCALE_MENU_HINT_NET_PASS); m11->setHint("", LOCALE_MENU_HINT_NET_SSID_SCAN); - wlanEnable[0] = m9; - wlanEnable[1] = m10; - wlanEnable[2] = m11; + wlanEnable.Add(m9); + wlanEnable.Add(m10); + wlanEnable.Add(m11); networkSettings->addItem( m11); //ssid scan networkSettings->addItem( m9); //ssid @@ -383,6 +384,8 @@ int CNetworkSetup::showNetworkSetup() break; } + dhcpDisable.Clear(); + wlanEnable.Clear(); delete networkSettings; delete sectionsdConfigNotifier; return ret; @@ -391,7 +394,7 @@ int CNetworkSetup::showNetworkSetup() void CNetworkSetup::showNetworkNTPSetup(CMenuWidget *menu_ntp) { //prepare ntp input - CStringInputSMS * networkSettings_NtpServer = new CStringInputSMS(LOCALE_NETWORKMENU_NTPSERVER, &g_settings.network_ntpserver, 30, LOCALE_NETWORKMENU_NTPSERVER_HINT1, LOCALE_NETWORKMENU_NTPSERVER_HINT2, "abcdefghijklmnopqrstuvwxyz0123456789-. ", sectionsdConfigNotifier); + CKeyboardInput * networkSettings_NtpServer = new CKeyboardInput(LOCALE_NETWORKMENU_NTPSERVER, &g_settings.network_ntpserver, 0, sectionsdConfigNotifier, NULL, LOCALE_NETWORKMENU_NTPSERVER_HINT1, LOCALE_NETWORKMENU_NTPSERVER_HINT2); CStringInput * networkSettings_NtpRefresh = new CStringInput(LOCALE_NETWORKMENU_NTPREFRESH, &g_settings.network_ntprefresh, 3,LOCALE_NETWORKMENU_NTPREFRESH_HINT1, LOCALE_NETWORKMENU_NTPREFRESH_HINT2 , "0123456789 ", sectionsdConfigNotifier); @@ -654,15 +657,10 @@ bool CNetworkSetup::changeNotify(const neutrino_locale_t locale, void * Data) changeNotify(LOCALE_NETWORKMENU_DHCP, &CNetworkConfig::getInstance()->inet_static); - int ecnt = sizeof(wlanEnable) / sizeof(CMenuForwarder*); - for(int i = 0; i < ecnt; i++) - wlanEnable[i]->setActive(CNetworkConfig::getInstance()->wireless); + wlanEnable.Activate(CNetworkConfig::getInstance()->wireless); } else if(locale == LOCALE_NETWORKMENU_DHCP) { CNetworkConfig::getInstance()->inet_static = (network_dhcp == NETWORK_DHCP_OFF); - int ecnt = sizeof(dhcpDisable) / sizeof(CMenuForwarder*); - - for(int i = 0; i < ecnt; i++) - dhcpDisable[i]->setActive(CNetworkConfig::getInstance()->inet_static); + dhcpDisable.Activate(CNetworkConfig::getInstance()->inet_static); } return false; } diff --git a/src/gui/network_setup.h b/src/gui/network_setup.h index 993c7c86e..9a662ec28 100644 --- a/src/gui/network_setup.h +++ b/src/gui/network_setup.h @@ -74,8 +74,8 @@ class CNetworkSetup : public CMenuTarget, CChangeObserver std::string old_mac_addr; - CMenuForwarder* dhcpDisable[5]; - CMenuForwarder* wlanEnable[3]; + CGenericMenuActivate dhcpDisable; + CGenericMenuActivate wlanEnable; CSectionsdConfigNotifier* sectionsdConfigNotifier; diff --git a/src/gui/nfs.cpp b/src/gui/nfs.cpp index 986d3fc41..ba1348e74 100644 --- a/src/gui/nfs.cpp +++ b/src/gui/nfs.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -249,23 +250,21 @@ int CNFSMountGui::menuEntry(int nr) CMenuWidget mountMenuEntryW(LOCALE_NFS_MOUNT, NEUTRINO_ICON_NETWORK, width); mountMenuEntryW.addIntroItems(); - const char * const validkeys = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.,:|!?/ "; - CIPInput ipInput(LOCALE_NFS_IP, &g_settings.network_nfs[nr].ip, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2); - CStringInputSMS dirInput(LOCALE_NFS_DIR, &g_settings.network_nfs[nr].dir, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, validkeys); + CKeyboardInput dirInput(LOCALE_NFS_DIR, &g_settings.network_nfs[nr].dir); CMenuOptionChooser *automountInput= new CMenuOptionChooser(LOCALE_NFS_AUTOMOUNT, &g_settings.network_nfs[nr].automount, MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true); - CStringInputSMS options1Input(LOCALE_NFS_MOUNT_OPTIONS, &g_settings.network_nfs[nr].mount_options1, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, validkeys); + CKeyboardInput options1Input(LOCALE_NFS_MOUNT_OPTIONS, &g_settings.network_nfs[nr].mount_options1); CMenuForwarder *options1_fwd = new CMenuForwarder(LOCALE_NFS_MOUNT_OPTIONS, true, NULL, &options1Input); - CStringInputSMS options2Input(LOCALE_NFS_MOUNT_OPTIONS, &g_settings.network_nfs[nr].mount_options2, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, validkeys); + CKeyboardInput options2Input(LOCALE_NFS_MOUNT_OPTIONS, &g_settings.network_nfs[nr].mount_options2); CMenuForwarder *options2_fwd = new CMenuForwarder(LOCALE_NFS_MOUNT_OPTIONS, true, NULL, &options2Input); - CStringInputSMS userInput(LOCALE_NFS_USERNAME, &g_settings.network_nfs[nr].username, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, validkeys); + CKeyboardInput userInput(LOCALE_NFS_USERNAME, &g_settings.network_nfs[nr].username); CMenuForwarder *username_fwd = new CMenuForwarder(LOCALE_NFS_USERNAME, (g_settings.network_nfs[nr].type != (int)CFSMounter::NFS), NULL, &userInput); - CStringInputSMS passInput(LOCALE_NFS_PASSWORD, &g_settings.network_nfs[nr].password, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, validkeys); + CKeyboardInput passInput(LOCALE_NFS_PASSWORD, &g_settings.network_nfs[nr].password); CMenuForwarder *password_fwd = new CMenuForwarder(LOCALE_NFS_PASSWORD, (g_settings.network_nfs[nr].type != (int)CFSMounter::NFS), NULL, &passInput); CMACInput macInput(LOCALE_RECORDINGMENU_SERVER_MAC, &g_settings.network_nfs[nr].mac, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 5302d504c..77763d5dd 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -650,8 +650,10 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors) CColorChooser* chHeadcolor = new CColorChooser(LOCALE_COLORMENU_BACKGROUND, &t.menu_Head_red, &t.menu_Head_green, &t.menu_Head_blue, &t.menu_Head_alpha, colorSetupNotifier); + chHeadcolor->setGradient(CColorChooser::gradient_head_body); CColorChooser* chHeadTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.menu_Head_Text_red, &t.menu_Head_Text_green, &t.menu_Head_Text_blue, NULL, colorSetupNotifier); + chHeadTextcolor->setGradient(CColorChooser::gradient_head_text); CColorChooser* chContentcolor = new CColorChooser(LOCALE_COLORMENU_BACKGROUND, &t.menu_Content_red, &t.menu_Content_green, &t.menu_Content_blue, &t.menu_Content_alpha, colorSetupNotifier); CColorChooser* chContentTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.menu_Content_Text_red, &t.menu_Content_Text_green, &t.menu_Content_Text_blue, diff --git a/src/gui/parentallock_setup.cpp b/src/gui/parentallock_setup.cpp index 0f5becfb2..ca4ab7359 100644 --- a/src/gui/parentallock_setup.cpp +++ b/src/gui/parentallock_setup.cpp @@ -136,6 +136,7 @@ int CParentalSetup::showParentalSetup() else mc = new CMenuOptionChooser(LOCALE_PARENTALLOCK_BOUQUETMODE, &g_settings.parentallock_defaultlocked, PARENTALLOCK_DEFAULTLOCKED_OPTIONS, PARENTALLOCK_DEFAULTLOCKED_OPTION_COUNT, !parentallocked); plock->addItem(mc); + plock->addItem(new CMenuOptionNumberChooser(LOCALE_PARENTALLOCK_ZAPTIME, (int *)&g_settings.parentallock_zaptime, !parentallocked, 0, 10000)); CPINChangeWidget pinChangeWidget(LOCALE_PARENTALLOCK_CHANGEPIN, &g_settings.parentallock_pincode, 4, LOCALE_PARENTALLOCK_CHANGEPIN_HINT1); mf = new CMenuForwarder(LOCALE_PARENTALLOCK_CHANGEPIN, true, g_settings.parentallock_pincode, &pinChangeWidget); diff --git a/src/gui/personalize.cpp b/src/gui/personalize.cpp index 63623b0de..4eea448d1 100644 --- a/src/gui/personalize.cpp +++ b/src/gui/personalize.cpp @@ -942,7 +942,7 @@ void CPersonalizeGui::addPersonalizedItems() bool add_shortcut = false; //get shortcut - if (d_key == CRCInput::RC_nokey && fw->active ) //if no icon is defined and item is active, allow to generate a shortcut, + if (fw->active && (d_key == CRCInput::RC_nokey || CRCInput::isNumeric(d_key))) //if RC_nokey or RC_key is digi and item is active, allow to generate a shortcut, { add_shortcut = true; d_key = getShortcut(short_cut); diff --git a/src/gui/pluginlist.cpp b/src/gui/pluginlist.cpp index 499ce2e51..1e5a09e34 100644 --- a/src/gui/pluginlist.cpp +++ b/src/gui/pluginlist.cpp @@ -87,6 +87,10 @@ int CPluginList::exec(CMenuTarget* parent, const std::string &actionKey) if (parent) parent->hide(); + CColorKeyHelper keyhelper; + neutrino_msg_t key = CRCInput::RC_nokey; + const char * dummy = NULL; + number = -1; if (actionKey != "") number = atoi(actionKey.c_str()); @@ -106,11 +110,11 @@ int CPluginList::exec(CMenuTarget* parent, const std::string &actionKey) int nop = g_PluginList->getNumberOfPlugins(); - int shortcut = 1; - for(int count = 0; count < nop; count++) { if ((g_PluginList->getType(count) & pluginlisttype) && !g_PluginList->isHidden(count) && (g_PluginList->getIntegration(count) == CPlugins::I_TYPE_DISABLED)) { - CMenuForwarder *f = new CMenuForwarder(std::string(g_PluginList->getName(count)), true, "", this, to_string(count).c_str(), CRCInput::convertDigitToKey(shortcut++)); + neutrino_msg_t d_key = g_PluginList->getKey(count); + keyhelper.get(&key, &dummy, d_key); + CMenuForwarder *f = new CMenuForwarder(std::string(g_PluginList->getName(count)), true, NULL, this, to_string(count).c_str(), key); f->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count)); m.addItem(f); } @@ -133,3 +137,40 @@ int CPluginChooser::run() *selectedFilePtr = g_PluginList->getFileName(number); return menu_return::RETURN_EXIT; } + +CPluginsExec* CPluginsExec::getInstance() +{ + static CPluginsExec* pluginsExec = NULL; + + if (!pluginsExec) + pluginsExec = new CPluginsExec(); + + return pluginsExec; +} + +int CPluginsExec::exec(CMenuTarget* parent, const std::string & actionKey) +{ + if (actionKey.empty()) + return menu_return::RETURN_NONE; + + //printf("CPluginsExec exec: %s\n", actionKey.c_str()); + int sel = atoi(actionKey.c_str()); + + if (parent != NULL) + parent->hide(); + + if (actionKey == "teletext") { + g_RCInput->postMsg(CRCInput::RC_timeout, 0); + g_RCInput->postMsg(CRCInput::RC_text, 0); + } + else if (sel >= 0) + g_PluginList->startPlugin(sel); + + if (!g_PluginList->getScriptOutput().empty()) + ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_SHELL); + + if (g_PluginList->getIntegration(sel) == CPlugins::I_TYPE_DISABLED) + return menu_return::RETURN_EXIT; + + return menu_return::RETURN_REPAINT; +} diff --git a/src/gui/pluginlist.h b/src/gui/pluginlist.h index 02a17f0c8..be528d278 100644 --- a/src/gui/pluginlist.h +++ b/src/gui/pluginlist.h @@ -67,4 +67,11 @@ class CPluginChooser : public CPluginList int run (); }; +class CPluginsExec : public CMenuTarget +{ + public: + static CPluginsExec* getInstance(); + int exec(CMenuTarget* parent, const std::string & actionKey); +}; + #endif diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index 43799ecac..998f6abf6 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -192,13 +192,15 @@ bool CPlugins::parseCfg(plugin *plugin_data) {}; plugin_data->index = sindex++; - plugin_data->key = 0; //CRCInput::RC_nokey + plugin_data->key = CRCInput::RC_nokey; +#if 0 plugin_data->fb = false; plugin_data->rc = false; plugin_data->lcd = false; plugin_data->vtxtpid = false; plugin_data->showpig = false; plugin_data->needoffset = false; +#endif plugin_data->shellwindow = false; plugin_data->hide = false; plugin_data->type = CPlugins::P_TYPE_DISABLED; @@ -222,9 +224,9 @@ bool CPlugins::parseCfg(plugin *plugin_data) { plugin_data->index = atoi(parm); } - else if (cmd == "pluginversion") + else if (cmd == "key") { - plugin_data->key = atoi(parm); + plugin_data->key = getPluginKey(parm); } else if (cmd == "name") { @@ -250,6 +252,7 @@ bool CPlugins::parseCfg(plugin *plugin_data) { plugin_data->integration = getPluginIntegration(atoi(parm)); } +#if 0 else if (cmd == "needfb") { plugin_data->fb = atoi(parm); @@ -274,6 +277,7 @@ bool CPlugins::parseCfg(plugin *plugin_data) { plugin_data->needoffset = atoi(parm); } +#endif else if (cmd == "shellwindow") { plugin_data->shellwindow = atoi(parm); @@ -559,3 +563,17 @@ CPlugins::i_type_t CPlugins::getPluginIntegration(int integration) return I_TYPE_DISABLED; } } + +neutrino_msg_t CPlugins::getPluginKey(std::string key) +{ + if (key == "red") + return CRCInput::RC_red; + else if (key == "green") + return CRCInput::RC_green; + else if (key == "yellow") + return CRCInput::RC_yellow; + else if (key == "blue") + return CRCInput::RC_blue; + else /* (key == "auto") */ + return CRCInput::RC_nokey; +} diff --git a/src/gui/plugins.h b/src/gui/plugins.h index e805114b4..1f4c1095e 100644 --- a/src/gui/plugins.h +++ b/src/gui/plugins.h @@ -76,7 +76,7 @@ class CPlugins { int index; std::string filename; - int key; + neutrino_msg_t key; std::string cfgfile; std::string pluginfile; std::string plugindir; @@ -87,7 +87,7 @@ class CPlugins std::string depend; CPlugins::p_type_t type; CPlugins::i_type_t integration; - +#if 0 bool fb; bool rc; bool lcd; @@ -95,6 +95,7 @@ class CPlugins int posx, posy, sizex, sizey; bool showpig; bool needoffset; +#endif bool shellwindow; bool hide; bool operator< (const plugin& a) const @@ -115,6 +116,7 @@ class CPlugins int find_plugin(const std::string & filename); CPlugins::p_type_t getPluginType(int type); CPlugins::i_type_t getPluginIntegration(int integration); + neutrino_msg_t getPluginKey(std::string key="auto"); public: CPlugins(); ~CPlugins(); @@ -139,7 +141,7 @@ class CPlugins inline int getIntegration (const int number) const { return plugin_list[number].integration ; } inline bool isHidden (const int number) const { return plugin_list[number].hide ; } inline int getIndex (const int number) const { return plugin_list[number].index ; } - inline neutrino_msg_t getKey (const int number) const { return (neutrino_msg_t)plugin_list[number].key; } + inline neutrino_msg_t getKey (const int number) const { return plugin_list[number].key ; } void setType (const int number, int t) { plugin_list[number].type = (CPlugins::p_type_t) t ; } bool overrideType(plugin *plugin_data, std::string &setting, p_type type); diff --git a/src/gui/proxyserver_setup.cpp b/src/gui/proxyserver_setup.cpp index c4755d86b..25db5d61d 100644 --- a/src/gui/proxyserver_setup.cpp +++ b/src/gui/proxyserver_setup.cpp @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -80,17 +81,17 @@ int CProxySetup::showProxySetup() neutrino_locale_t subtitle = (menue_title == LOCALE_FLASHUPDATE_PROXYSERVER_SEP ? NONEXISTANT_LOCALE : LOCALE_FLASHUPDATE_PROXYSERVER_SEP); mn->addIntroItems(subtitle); - CStringInputSMS softUpdate_proxy(LOCALE_FLASHUPDATE_PROXYSERVER, &g_settings.softupdate_proxyserver, 23, LOCALE_FLASHUPDATE_PROXYSERVER_HINT1, LOCALE_FLASHUPDATE_PROXYSERVER_HINT2, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); + CKeyboardInput softUpdate_proxy(LOCALE_FLASHUPDATE_PROXYSERVER, &g_settings.softupdate_proxyserver, 0, NULL, NULL, LOCALE_FLASHUPDATE_PROXYSERVER_HINT1, LOCALE_FLASHUPDATE_PROXYSERVER_HINT2); CMenuForwarder * mf = new CMenuForwarder(LOCALE_FLASHUPDATE_PROXYSERVER, true, g_settings.softupdate_proxyserver, &softUpdate_proxy, NULL, CRCInput::RC_red); mf->setHint("", LOCALE_MENU_HINT_NET_PROXYSERVER); mn->addItem(mf); - CStringInputSMS softUpdate_proxyuser(LOCALE_FLASHUPDATE_PROXYUSERNAME, &g_settings.softupdate_proxyusername, 23, LOCALE_FLASHUPDATE_PROXYUSERNAME_HINT1, LOCALE_FLASHUPDATE_PROXYUSERNAME_HINT2, "abcdefghijklmnopqrstuvwxyz0123456789!""§$%&/()=?-. "); + CKeyboardInput softUpdate_proxyuser(LOCALE_FLASHUPDATE_PROXYUSERNAME, &g_settings.softupdate_proxyusername, 0, NULL, NULL, LOCALE_FLASHUPDATE_PROXYUSERNAME_HINT1, LOCALE_FLASHUPDATE_PROXYUSERNAME_HINT2); mf = new CMenuForwarder(LOCALE_FLASHUPDATE_PROXYUSERNAME, true, g_settings.softupdate_proxyusername, &softUpdate_proxyuser, NULL, CRCInput::RC_green); mf->setHint("", LOCALE_MENU_HINT_NET_PROXYUSER); mn->addItem(mf); - CStringInputSMS softUpdate_proxypass(LOCALE_FLASHUPDATE_PROXYPASSWORD, &g_settings.softupdate_proxypassword, 20, LOCALE_FLASHUPDATE_PROXYPASSWORD_HINT1, LOCALE_FLASHUPDATE_PROXYPASSWORD_HINT2, "abcdefghijklmnopqrstuvwxyz0123456789!""§$%&/()=?-. "); + CKeyboardInput softUpdate_proxypass(LOCALE_FLASHUPDATE_PROXYPASSWORD, &g_settings.softupdate_proxypassword, 0, NULL, NULL, LOCALE_FLASHUPDATE_PROXYPASSWORD_HINT1, LOCALE_FLASHUPDATE_PROXYPASSWORD_HINT2); mf = new CMenuForwarder(LOCALE_FLASHUPDATE_PROXYPASSWORD, true, g_settings.softupdate_proxypassword, &softUpdate_proxypass, NULL, CRCInput::RC_yellow); mf->setHint("", LOCALE_MENU_HINT_NET_PROXYPASS); mn->addItem(mf); diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index bd9dfe196..b385c2d3f 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include @@ -243,7 +244,7 @@ int CRecordSetup::showRecordSetup() } //filename template - CStringInputSMS* filename_template = new CStringInputSMS(LOCALE_RECORDINGMENU_FILENAME_TEMPLATE, &g_settings.recording_filename_template, 21, LOCALE_RECORDINGMENU_FILENAME_TEMPLATE_HINT, LOCALE_RECORDINGMENU_FILENAME_TEMPLATE_HINT2, "%/-_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "); + CKeyboardInput* filename_template = new CKeyboardInput(LOCALE_RECORDINGMENU_FILENAME_TEMPLATE, &g_settings.recording_filename_template, 0, NULL, NULL, LOCALE_RECORDINGMENU_FILENAME_TEMPLATE_HINT, LOCALE_RECORDINGMENU_FILENAME_TEMPLATE_HINT2); CMenuForwarder* ft = new CMenuDForwarder(LOCALE_RECORDINGMENU_FILENAME_TEMPLATE, true, g_settings.recording_filename_template, filename_template, NULL, CRCInput::RC_1); ft->setHint("", LOCALE_MENU_HINT_RECORD_FILENAME_TEMPLATE); recordingSettings->addItem(ft); diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index dc20daca9..d43e660dd 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -226,6 +226,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) 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.feparams.pilot = (zapit_pilot_t) scansettings.sat_TP_pilot; } else if (CFrontend::isTerr(delsys)) { /* DVB-T. TODO: proper menu and parameter setup, not all "AUTO" */ TP.feparams.frequency = atoi(scansettings.terrestrial_TP_freq.c_str()); diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index edb66fec6..669973216 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -268,6 +268,15 @@ const CMenuOptionChooser::keyval SATSETUP_SCANTP_POL[SATSETUP_SCANTP_POL_COUNT] { 3, LOCALE_EXTRA_TP_POL_R } }; +#define SATSETUP_SCANTP_PILOT_COUNT 4 +const CMenuOptionChooser::keyval SATSETUP_SCANTP_PILOT[SATSETUP_SCANTP_PILOT_COUNT] = +{ + { ZPILOT_ON, LOCALE_OPTIONS_ON }, + { ZPILOT_OFF, LOCALE_OPTIONS_OFF }, + { ZPILOT_AUTO, LOCALE_EXTRA_TP_PILOT_AUTO }, + { ZPILOT_AUTO_SW, LOCALE_EXTRA_TP_PILOT_AUTO_SW } +}; + #define OPTIONS_SOUTH0_NORTH1_OPTION_COUNT 2 const CMenuOptionChooser::keyval OPTIONS_SOUTH0_NORTH1_OPTIONS[OPTIONS_SOUTH0_NORTH1_OPTION_COUNT] = { @@ -657,7 +666,27 @@ int CScanSetup::showScanMenu() mc->setHint("", LOCALE_MENU_HINT_SCAN_BOUQUET); settings->addItem(mc); + //bouquet write_names selection + const short SCANTS_BOUQUET_WRITENAMES_COUNT = 4; + const CMenuOptionChooser::keyval SCANTS_BOUQUET_WRITENAMES[SCANTS_BOUQUET_WRITENAMES_COUNT] = + { + { CBouquetManager::BWN_NEVER , LOCALE_SCANTS_BOUQUET_WRITENAMES_NEVER }, + { CBouquetManager::BWN_UBOUQUETS , LOCALE_SCANTS_BOUQUET_WRITENAMES_UBOUQUETS }, + { CBouquetManager::BWN_BOUQUETS , LOCALE_SCANTS_BOUQUET_WRITENAMES_BOUQUETS }, + { CBouquetManager::BWN_EVER , LOCALE_SCANTS_BOUQUET_WRITENAMES_EVER } + }; + + int tmp_writeChannelsNames = zapitCfg.writeChannelsNames; + mc = new CMenuOptionChooser(LOCALE_SCANTS_BOUQUET_WRITENAMES, (int *)&zapitCfg.writeChannelsNames, SCANTS_BOUQUET_WRITENAMES, SCANTS_BOUQUET_WRITENAMES_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++), "", true); + mc->setHint("", LOCALE_MENU_HINT_SCAN_BOUQUET_WRITENAMES); + settings->addItem(mc); + int res = settings->exec(NULL, ""); + //set write_names if changed + if(zapitCfg.writeChannelsNames != tmp_writeChannelsNames){ + CZapit::getInstance()->SetConfig(&zapitCfg); + g_Zapit->saveBouquets(); + } delete satOnOff; delete settings; @@ -1619,6 +1648,7 @@ int CScanSetup::addScanOptionsItems(CMenuWidget *options_menu, const int &shortc CMenuOptionChooser *tm = NULL; CMenuForwarder *Freq = NULL; CMenuForwarder *Rate = NULL; + CMenuOptionChooser *pilot = NULL; if (r_system == ALL_SAT) { delsys = new CMenuOptionChooser(LOCALE_EXTRA_TP_DELSYS, (int *)&scansettings.sat_TP_delsys, SATSETUP_SCANTP_DELSYS, SATSETUP_SCANTP_DELSYS_COUNT, true, NULL, CRCInput::convertDigitToKey(shortCut++), "", true); delsys->setHint("", LOCALE_MENU_HINT_SCAN_DELSYS); @@ -1634,6 +1664,8 @@ int CScanSetup::addScanOptionsItems(CMenuWidget *options_menu, const int &shortc fec->setHint("", LOCALE_MENU_HINT_SCAN_FEC); pol = new CMenuOptionChooser(LOCALE_EXTRA_TP_POL, (int *)&scansettings.sat_TP_pol, SATSETUP_SCANTP_POL, SATSETUP_SCANTP_POL_COUNT, true, NULL, CRCInput::convertDigitToKey(shortCut++)); pol->setHint("", LOCALE_MENU_HINT_SCAN_POL); + pilot = new CMenuOptionChooser(LOCALE_EXTRA_TP_PILOT, (int *)&scansettings.sat_TP_pilot, SATSETUP_SCANTP_PILOT, SATSETUP_SCANTP_PILOT_COUNT, true, NULL, CRCInput::convertDigitToKey(shortCut++)); + pilot->setHint("", LOCALE_MENU_HINT_SCAN_PILOT); } else if (r_system == ALL_CABLE) { delsys = new CMenuOptionChooser(LOCALE_EXTRA_TP_DELSYS, (int *)&scansettings.cable_TP_delsys, CABLESETUP_SCANTP_DELSYS, CABLESETUP_SCANTP_DELSYS_COUNT, true, NULL, CRCInput::convertDigitToKey(shortCut++), "", true); delsys->setHint("", LOCALE_MENU_HINT_SCAN_DELSYS); @@ -1692,6 +1724,8 @@ int CScanSetup::addScanOptionsItems(CMenuWidget *options_menu, const int &shortc options_menu->addItem(tm); if (pol) options_menu->addItem(pol); + if (pilot) + options_menu->addItem(pilot); return shortCut; } @@ -1982,6 +2016,7 @@ int CTPSelectHandler::exec(CMenuTarget* parent, const std::string &actionkey) scansettings.sat_TP_pol = tmpI->second.feparams.polarization; scansettings.sat_TP_delsys = tmpI->second.feparams.delsys; scansettings.sat_TP_mod = tmpI->second.feparams.modulation; + scansettings.sat_TP_pilot = tmpI->second.feparams.pilot; } else if (CFrontend::isCable(tmpI->second.feparams.delsys)) { scansettings.cable_TP_freq = to_string(tmpI->second.feparams.frequency); diff --git a/src/gui/settings_manager.cpp b/src/gui/settings_manager.cpp index dd985b279..49f906f24 100644 --- a/src/gui/settings_manager.cpp +++ b/src/gui/settings_manager.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -90,7 +91,7 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey) if (fileBrowser.exec("/var/tuxbox") == true) { std::string fname = "neutrino.conf"; - CStringInputSMS * sms = new CStringInputSMS(LOCALE_EXTRA_SAVECONFIG, &fname, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789. "); + CKeyboardInput * sms = new CKeyboardInput(LOCALE_EXTRA_SAVECONFIG, &fname); sms->exec(NULL, ""); std::string sname = fileBrowser.getSelectedFile()->Name + "/" + fname; diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 147e71d53..fa0e06fb7 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -455,7 +455,8 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) return; transponder t; - CServiceManager::getInstance()->GetTransponder(channel->getTransponderId(), t); + //CServiceManager::getInstance()->GetTransponder(channel->getTransponderId(), t); + t = *frontend->getParameters(); int array[6]={g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION)), g_Font[font_info]->getRenderWidth(g_Locale->getText (LOCALE_STREAMINFO_ARATIO)), diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index 2d6cb3351..2e9016372 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -50,6 +51,7 @@ #include "themes.h" #define THEMEDIR DATADIR "/neutrino/themes/" +#define THEMEDIR_VAR "/var/tuxbox/themes/" #define USERDIR "/var" THEMEDIR #define FILE_PREFIX ".theme" @@ -80,7 +82,7 @@ int CThemes::exec(CMenuTarget* parent, const std::string & actionKey) if ( strstr(themeFile.c_str(), "{U}") != 0 ) { themeFile.erase(0, 3); - readFile((char*)((std::string)USERDIR + themeFile + FILE_PREFIX).c_str()); + readFile((char*)((std::string)THEMEDIR_VAR + themeFile + FILE_PREFIX).c_str()); } else readFile((char*)((std::string)THEMEDIR + themeFile + FILE_PREFIX).c_str()); @@ -102,7 +104,7 @@ void CThemes::readThemes(CMenuWidget &themes) { struct dirent **themelist; int n; - const char *pfade[] = {THEMEDIR, USERDIR}; + const char *pfade[] = {THEMEDIR, THEMEDIR_VAR}; bool hasCVSThemes, hasUserThemes; hasCVSThemes = hasUserThemes = false; std::string userThemeFile = ""; @@ -145,6 +147,8 @@ void CThemes::readThemes(CMenuWidget &themes) int CThemes::Show() { + move_userDir(); + std::string file_name = ""; CMenuWidget themes (LOCALE_COLORMENU_MENUCOLORS, NEUTRINO_ICON_SETTINGS, width); @@ -156,24 +160,24 @@ int CThemes::Show() readThemes(themes); - CStringInputSMS nameInput(LOCALE_COLORTHEMEMENU_NAME, &file_name, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789- "); + CKeyboardInput nameInput(LOCALE_COLORTHEMEMENU_NAME, &file_name); CMenuForwarder *m1 = new CMenuForwarder(LOCALE_COLORTHEMEMENU_SAVE, true , NULL, &nameInput, NULL, CRCInput::RC_green); - if (mkdirhier(USERDIR) && errno != EEXIST) { - printf("[neutrino theme] error creating %s\n", USERDIR); + if (mkdirhier(THEMEDIR_VAR) && errno != EEXIST) { + printf("[neutrino theme] error creating %s\n", THEMEDIR_VAR); } - if (access(USERDIR, F_OK) == 0 ) { + if (access(THEMEDIR_VAR, F_OK) == 0 ) { themes.addItem(GenericMenuSeparatorLine); themes.addItem(m1); } else { delete m1; - printf("[neutrino theme] error accessing %s\n", USERDIR); + printf("[neutrino theme] error accessing %s\n", THEMEDIR_VAR); } int res = themes.exec(NULL, ""); if (file_name.length() > 0) { - saveFile((char*)((std::string)USERDIR + file_name + FILE_PREFIX).c_str()); + saveFile((char*)((std::string)THEMEDIR_VAR + file_name + FILE_PREFIX).c_str()); } if (hasThemeChanged) { @@ -334,3 +338,37 @@ void CThemes::getTheme(CConfigFile &configfile) t.clock_Digit_green = configfile.getInt32( "clock_Digit_green", t.menu_Content_Text_green ); t.clock_Digit_blue = configfile.getInt32( "clock_Digit_blue", t.menu_Content_Text_blue ); } + +void CThemes::move_userDir() +{ + if (access(USERDIR, F_OK) == 0) + { + if (mkdirhier(THEMEDIR_VAR) && errno != EEXIST) + { + printf("[neutrino theme] error creating %s\n", THEMEDIR_VAR); + return; + } + struct dirent **themelist; + int n = scandir(USERDIR, &themelist, 0, alphasort); + if (n < 0) + { + perror("loading themes: scandir"); + return; + } + else + { + for (int count = 0; count < n; count++) + { + const char *file = themelist[count]->d_name; + if (strcmp(file, ".") == 0 || strcmp(file, "..") == 0) + continue; + const char *dest = (char*)((std::string)USERDIR + file).c_str(); + const char *target = (char*)((std::string)THEMEDIR_VAR + file).c_str(); + printf("[neutrino theme] moving %s to %s\n", dest, target); + rename(dest, target); + } + } + printf("[neutrino theme] removing %s\n", USERDIR); + remove(USERDIR); + } +} diff --git a/src/gui/themes.h b/src/gui/themes.h index 981d6cc4a..2560c90e9 100644 --- a/src/gui/themes.h +++ b/src/gui/themes.h @@ -44,6 +44,7 @@ class CThemes : public CMenuTarget, CChangeObserver void saveFile(char* themename); void readThemes(CMenuWidget &); void rememberOldTheme(bool remember); + void move_userDir(); public: CThemes(); diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index e70125051..3fc81e024 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -62,6 +62,7 @@ #include #include #include +#include #include #include @@ -1223,7 +1224,7 @@ int CTimerList::newTimer() CMenuOptionChooser* m8 = new CMenuOptionChooser(LOCALE_TIMERLIST_STANDBY, &timerNew_standby_on, TIMERLIST_STANDBY_OPTIONS, TIMERLIST_STANDBY_OPTION_COUNT, false); timerNew_message = std::string(timerNew.message); - CStringInputSMS timerSettings_msg(LOCALE_TIMERLIST_MESSAGE, &timerNew_message, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.,:!?/ "); + CKeyboardInput timerSettings_msg(LOCALE_TIMERLIST_MESSAGE, &timerNew_message); CMenuForwarder *m9 = new CMenuForwarder(LOCALE_TIMERLIST_MESSAGE, false, timerNew_message, &timerSettings_msg ); timerNew_pluginName = "---"; diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index fc7093392..f8cabbbdc 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -152,7 +152,6 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) // define classes CSubChannelSelectMenu subchanselect; - CPluginsExec plugins; CNeutrinoApp * neutrino = CNeutrinoApp::getInstance(); std::string txt = g_settings.usermenu[button]->title; @@ -278,8 +277,9 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) menu_item->setHint(NEUTRINO_ICON_HINT_GAMES, LOCALE_MENU_HINT_GAMES); break; case SNeutrinoSettings::ITEM_TOOLS: - keyhelper.get(&key,&icon); + keyhelper.get(&key,&icon); menu_item = new CMenuDForwarder(LOCALE_MAINMENU_TOOLS, g_PluginList->hasPlugin(CPlugins::P_TYPE_TOOL), NULL, new CPluginList(LOCALE_MAINMENU_TOOLS,CPlugins::P_TYPE_TOOL), "-1", key, icon ); + // FIXME menu_item->setHint("", NONEXISTANT_LOCALE); break; case SNeutrinoSettings::ITEM_SCRIPTS: keyhelper.get(&key,&icon); @@ -289,14 +289,13 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_LUA: keyhelper.get(&key,&icon); menu_item = new CMenuDForwarder(LOCALE_MAINMENU_LUA, g_PluginList->hasPlugin(CPlugins::P_TYPE_LUA), NULL, new CPluginList(LOCALE_MAINMENU_LUA,CPlugins::P_TYPE_LUA), "-1", key, icon ); + // FIXME menu_item->setHint("", NONEXISTANT_LOCALE); break; case SNeutrinoSettings::ITEM_PLUGIN_TYPES: { unsigned int number_of_plugins = (unsigned int) g_PluginList->getNumberOfPlugins(); if (!number_of_plugins) continue; - char id[5]; - int cnt = 0; for (unsigned int count = 0; count < number_of_plugins; count++) { #if 0 @@ -315,16 +314,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) if (show && !g_PluginList->isHidden(count) && (g_PluginList->getIntegration(count) == CPlugins::I_TYPE_DISABLED)) { - sprintf(id, "%d", count); menu_items++; neutrino_msg_t d_key = g_PluginList->getKey(count); //printf("[neutrino usermenu] plugin %d, set key %d...\n", count, g_PluginList->getKey(count)); keyhelper.get(&key,&icon, d_key); - menu_item = new CMenuForwarder(g_PluginList->getName(count), true, NULL, &plugins, id, key, icon); + menu_item = new CMenuForwarder(g_PluginList->getName(count), true, NULL, CPluginsExec::getInstance(), to_string(count).c_str(), key, icon); menu_item->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count)); menu->addItem(menu_item, false); - cnt++; } } menu_item = NULL; @@ -332,7 +329,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) } case SNeutrinoSettings::ITEM_VTXT: keyhelper.get(&key,&icon, feat_key[g_settings.personalize[SNeutrinoSettings::P_FEAT_KEY_VTXT]].key); //CRCInput::RC_blue - menu_item = new CMenuForwarder(LOCALE_USERMENU_ITEM_VTXT, true, NULL, &plugins, "teletext", key, icon); + menu_item = new CMenuForwarder(LOCALE_USERMENU_ITEM_VTXT, true, NULL, CPluginsExec::getInstance(), "teletext", key, icon); // FIXME menu_item->setHint("", NONEXISTANT_LOCALE); break; case SNeutrinoSettings::ITEM_IMAGEINFO: @@ -431,22 +428,11 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) int count = 0; for(; count < number_of_plugins; count++) { const char *pname = g_PluginList->getFileName(count); - if (pname && (std::string(pname) == *it)) { - keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(g_PluginList->getName(count), true, NULL, this, pname, key, icon); - const std::string hint = g_PluginList->getDescription(count); - if (hint != "") { - const char *hint_icon = NULL; - switch(g_PluginList->getType(count)) { - case CPlugins::P_TYPE_GAME: - hint_icon = NEUTRINO_ICON_HINT_GAMES; - break; - case CPlugins::P_TYPE_SCRIPT: - hint_icon = NEUTRINO_ICON_HINT_SCRIPTS; - break; - } - menu_item->setHint(hint_icon, hint); - } + if (pname && (std::string(pname) == *it) && !g_PluginList->isHidden(count)) { + neutrino_msg_t d_key = g_PluginList->getKey(count); + keyhelper.get(&key,&icon, d_key); + menu_item = new CMenuForwarder(g_PluginList->getName(count), true, NULL, CPluginsExec::getInstance(), to_string(count).c_str(), key, icon); + menu_item->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count)); break; } } @@ -593,11 +579,3 @@ bool CUserMenu::changeNotify(const neutrino_locale_t OptionName, void * Data) return false; } - -int CUserMenu::exec(CMenuTarget* /*parent*/, const std::string & actionKey) -{ - if (actionKey == "") - return menu_return::RETURN_NONE; - g_PluginList->startPlugin(actionKey.c_str()); - return menu_return::RETURN_EXIT; -} diff --git a/src/gui/user_menue.h b/src/gui/user_menue.h index 878aa8a5f..5d15efa5b 100644 --- a/src/gui/user_menue.h +++ b/src/gui/user_menue.h @@ -66,12 +66,11 @@ static user_menu_data_t user_menu[COL_BUTTONMAX] = // const neutrino_msg_t col_key_helper_msg_def[COL_BUTTONMAX]={CRCInput::RC_red,CRCInput::RC_green,CRCInput::RC_yellow,CRCInput::RC_blue}; // const char * col_key_helper_icon_def[COL_BUTTONMAX]={NEUTRINO_ICON_BUTTON_RED,NEUTRINO_ICON_BUTTON_GREEN,NEUTRINO_ICON_BUTTON_YELLOW,NEUTRINO_ICON_BUTTON_BLUE}; -class CUserMenu : public CChangeObserver, CMenuTarget +class CUserMenu : public CChangeObserver { private: int width; bool changeNotify(const neutrino_locale_t OptionName, void *); - int exec(CMenuTarget* parent, const std::string & actionKey); public: CUserMenu(); @@ -81,7 +80,7 @@ class CUserMenu : public CChangeObserver, CMenuTarget }; -// This is just a quick helper for the usermenu only. +// This is just a quick helper for the usermenu and pluginlist. class CColorKeyHelper { private: diff --git a/src/gui/user_menue_setup.cpp b/src/gui/user_menue_setup.cpp index 015ecca44..85dbaa5e1 100644 --- a/src/gui/user_menue_setup.cpp +++ b/src/gui/user_menue_setup.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -208,7 +209,7 @@ int CUserMenuSetup::showSetup() ums->addIntroItems(); int old_key = g_settings.usermenu[button]->key; - CStringInputSMS name(LOCALE_USERMENU_NAME, &g_settings.usermenu[button]->title, 20, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzäöüß/- "/*, notify*/); + CKeyboardInput name(LOCALE_USERMENU_NAME, &g_settings.usermenu[button]->title); CMenuForwarder * mf = new CMenuForwarder(LOCALE_USERMENU_NAME, true, NULL, &name); ums->addItem(mf); diff --git a/src/gui/vfd_setup.cpp b/src/gui/vfd_setup.cpp index 232d1525f..e344a86b8 100644 --- a/src/gui/vfd_setup.cpp +++ b/src/gui/vfd_setup.cpp @@ -114,43 +114,49 @@ int CVfdSetup::showSetup() CMenuWidget *vfds = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_LCD, width, MN_WIDGET_ID_VFDSETUP); vfds->addIntroItems(LOCALE_LCDMENU_HEAD); - //vfd brightness menu - CMenuForwarder * mf = new CMenuForwarder(LOCALE_LCDMENU_LCDCONTROLER, vfd_enabled, NULL, this, "brightness", CRCInput::RC_red); - mf->setHint("", LOCALE_MENU_HINT_VFD_BRIGHTNESS_SETUP); - vfds->addItem(mf); + CMenuForwarder * mf; //led menu - if(cs_get_revision() > 7) + if (cs_get_revision() > 7) // not HD1 and BSE { CMenuWidget * ledMenu = new CMenuWidget(LOCALE_LCDMENU_HEAD, NEUTRINO_ICON_LCD, width, MN_WIDGET_ID_VFDSETUP_LED_SETUP); showLedSetup(ledMenu); - mf = new CMenuDForwarder(LOCALE_LEDCONTROLER_MENU, true, NULL, ledMenu, NULL, CRCInput::RC_green); + mf = new CMenuDForwarder(LOCALE_LEDCONTROLER_MENU, true, NULL, ledMenu, NULL, CRCInput::RC_red); mf->setHint("", LOCALE_MENU_HINT_POWER_LEDS); vfds->addItem(mf); } - if(cs_get_revision() == 9) - { - CMenuWidget * blMenu = new CMenuWidget(LOCALE_LCDMENU_HEAD, NEUTRINO_ICON_LCD, width, MN_WIDGET_ID_VFDSETUP_BACKLIGHT); - showBacklightSetup(blMenu); - mf = new CMenuDForwarder(LOCALE_LEDCONTROLER_BACKLIGHT, true, NULL, blMenu, NULL, CRCInput::RC_yellow); - mf->setHint("", LOCALE_MENU_HINT_BACKLIGHT); + + if (CVFD::getInstance()->has_lcd) { + //vfd brightness menu + mf = new CMenuForwarder(LOCALE_LCDMENU_LCDCONTROLER, vfd_enabled, NULL, this, "brightness", CRCInput::RC_green); + mf->setHint("", LOCALE_MENU_HINT_VFD_BRIGHTNESS_SETUP); vfds->addItem(mf); + + if (cs_get_revision() == 9) // Tank only + { + //backlight menu + CMenuWidget * blMenu = new CMenuWidget(LOCALE_LCDMENU_HEAD, NEUTRINO_ICON_LCD, width, MN_WIDGET_ID_VFDSETUP_BACKLIGHT); + showBacklightSetup(blMenu); + mf = new CMenuDForwarder(LOCALE_LEDCONTROLER_BACKLIGHT, true, NULL, blMenu, NULL, CRCInput::RC_yellow); + mf->setHint("", LOCALE_MENU_HINT_BACKLIGHT); + vfds->addItem(mf); + } + + vfds->addItem(GenericMenuSeparatorLine); + + //status and info line options + CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_LCDMENU_STATUSLINE, &g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME], LCDMENU_STATUSLINE_OPTIONS, LCDMENU_STATUSLINE_OPTION_COUNT, vfd_enabled); + oj->setHint("", LOCALE_MENU_HINT_VFD_STATUSLINE); + CMenuOptionChooser* lcd_clock_channelname_menu = new CMenuOptionChooser(LOCALE_LCD_INFO_LINE, &g_settings.lcd_info_line, LCD_INFO_OPTIONS, LCD_INFO_OPTION_COUNT, vfd_enabled); + lcd_clock_channelname_menu->setHint("", LOCALE_MENU_HINT_VFD_INFOLINE); + vfds->addItem(oj); + vfds->addItem(lcd_clock_channelname_menu); + + oj = new CMenuOptionChooser(LOCALE_LCDMENU_SCROLL, &g_settings.lcd_scroll, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, vfd_enabled); + oj->setHint("", LOCALE_MENU_HINT_VFD_SCROLL); + vfds->addItem(oj); } - vfds->addItem(GenericMenuSeparatorLine); - - //status and info line options - CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_LCDMENU_STATUSLINE, &g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME], LCDMENU_STATUSLINE_OPTIONS, LCDMENU_STATUSLINE_OPTION_COUNT, vfd_enabled); - oj->setHint("", LOCALE_MENU_HINT_VFD_STATUSLINE); - CMenuOptionChooser* lcd_clock_channelname_menu = new CMenuOptionChooser(LOCALE_LCD_INFO_LINE, &g_settings.lcd_info_line, LCD_INFO_OPTIONS, LCD_INFO_OPTION_COUNT, vfd_enabled); - lcd_clock_channelname_menu->setHint("", LOCALE_MENU_HINT_VFD_INFOLINE); - vfds->addItem(oj); - vfds->addItem(lcd_clock_channelname_menu); - - oj = new CMenuOptionChooser(LOCALE_LCDMENU_SCROLL, &g_settings.lcd_scroll, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, vfd_enabled); - oj->setHint("", LOCALE_MENU_HINT_VFD_SCROLL); - vfds->addItem(oj); - int res = vfds->exec(NULL, ""); delete vfds; diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 4bf85a316..771475fc9 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -106,15 +106,17 @@ int CVideoSettings::exec(CMenuTarget* parent, const std::string &/*actionKey*/) return res; } -#define VIDEOMENU_43MODE_OPTION_COUNT 4 -const CMenuOptionChooser::keyval VIDEOMENU_43MODE_OPTIONS[VIDEOMENU_43MODE_OPTION_COUNT] = +const CMenuOptionChooser::keyval VIDEOMENU_43MODE_OPTIONS[] = { { DISPLAY_AR_MODE_PANSCAN, LOCALE_VIDEOMENU_PANSCAN }, +#ifndef BOXMODEL_APOLLO { DISPLAY_AR_MODE_PANSCAN2, LOCALE_VIDEOMENU_PANSCAN2 }, +#endif { DISPLAY_AR_MODE_LETTERBOX, LOCALE_VIDEOMENU_LETTERBOX }, { DISPLAY_AR_MODE_NONE, LOCALE_VIDEOMENU_FULLSCREEN } //{ 2, LOCALE_VIDEOMENU_AUTO } // whatever is this auto mode, it seems its totally broken }; +#define VIDEOMENU_43MODE_OPTION_COUNT (sizeof(VIDEOMENU_43MODE_OPTIONS)/sizeof(CMenuOptionChooser::keyval)) #define VIDEOMENU_VIDEOSIGNAL_TD_OPTION_COUNT 2 const CMenuOptionChooser::keyval VIDEOMENU_VIDEOSIGNAL_TD_OPTIONS[VIDEOMENU_VIDEOSIGNAL_TD_OPTION_COUNT] = @@ -337,7 +339,7 @@ int CVideoSettings::showVideoSetup() else if (system_rev > 0x06) { #ifdef ANALOG_MODE - if (system_rev == 9 || system_rev == 11) { // Tank, Trinity. + 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 @@ -370,6 +372,10 @@ int CVideoSettings::showVideoSetup() CMenuOptionChooser *vs_dbdropt_ch = NULL; CMenuWidget videomodes(LOCALE_MAINSETTINGS_VIDEO, NEUTRINO_ICON_SETTINGS); +#ifdef BOXMODEL_APOLLO + CMenuForwarder * vs_automodes_fw = NULL; + CMenuWidget automodes(LOCALE_MAINSETTINGS_VIDEO, NEUTRINO_ICON_SETTINGS); +#endif CAutoModeNotifier anotify; CMenuForwarder *vs_videomodes_fw = NULL; if (!g_settings.easymenu) { @@ -388,10 +394,19 @@ int CVideoSettings::showVideoSetup() for (int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) if (VIDEOMENU_VIDEOMODE_OPTIONS[i].key != -1) videomodes.addItem(new CMenuOptionChooser(VIDEOMENU_VIDEOMODE_OPTIONS[i].valname, &g_settings.enabled_video_modes[i], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, &anotify)); - //anotify.changeNotify(NONEXISTANT_LOCALE, 0); vs_videomodes_fw = new CMenuForwarder(LOCALE_VIDEOMENU_ENABLED_MODES, true, NULL, &videomodes, NULL, CRCInput::RC_red); vs_videomodes_fw->setHint("", LOCALE_MENU_HINT_VIDEO_MODES); + +#ifdef BOXMODEL_APOLLO + automodes.addIntroItems(LOCALE_VIDEOMENU_ENABLED_MODES_AUTO); + + for (int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT - 1; i++) + automodes.addItem(new CMenuOptionChooser(VIDEOMENU_VIDEOMODE_OPTIONS[i].valname, &g_settings.enabled_auto_modes[i], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, &anotify)); + + vs_automodes_fw = new CMenuForwarder(LOCALE_VIDEOMENU_ENABLED_MODES_AUTO, true, NULL, &automodes, NULL, CRCInput::RC_green); + vs_automodes_fw->setHint("", LOCALE_MENU_HINT_VIDEO_MODES_AUTO); +#endif } } @@ -420,6 +435,9 @@ int CVideoSettings::showVideoSetup() videosetup->addItem(vs_dbdropt_ch); //dbdr options if (vs_videomodes_fw != NULL) videosetup->addItem(vs_videomodes_fw); //video modes submenue +#ifdef BOXMODEL_APOLLO + videosetup->addItem(vs_automodes_fw); //video auto modes submenue +#endif } #ifdef BOXMODEL_APOLLO @@ -605,14 +623,14 @@ void CVideoSettings::next43Mode(void) neutrino_locale_t text; int curmode = 0; - for (int i = 0; i < VIDEOMENU_43MODE_OPTION_COUNT; i++) { + for (int i = 0; i < (int) VIDEOMENU_43MODE_OPTION_COUNT; i++) { if (VIDEOMENU_43MODE_OPTIONS[i].key == g_settings.video_43mode) { curmode = i; break; } } curmode++; - if (curmode >= VIDEOMENU_43MODE_OPTION_COUNT) + if (curmode >= (int) VIDEOMENU_43MODE_OPTION_COUNT) curmode = 0; text = VIDEOMENU_43MODE_OPTIONS[curmode].value; diff --git a/src/gui/widget/Makefile.am b/src/gui/widget/Makefile.am index be8f4f7a9..ea77f8b29 100644 --- a/src/gui/widget/Makefile.am +++ b/src/gui/widget/Makefile.am @@ -22,6 +22,7 @@ libneutrino_gui_widget_a_SOURCES = \ hintbox.cpp \ hintboxext.cpp \ keychooser.cpp \ + keyboard_input.cpp \ listbox.cpp \ listframe.cpp \ menue.cpp \ diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index f08644c97..8f758dc45 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -95,11 +95,28 @@ CColorChooser::CColorChooser(const neutrino_locale_t Name, unsigned char *R, uns value[VALUE_G] = G; value[VALUE_B] = B; value[VALUE_ALPHA] = Alpha; + + chooser_gradient = gradient_none; } void CColorChooser::setColor() { - frameBuffer->paintBoxRel(x+offset+162,y+hheight+2+5, mheight*4-4 ,mheight*4-4-10, getColor()); + fb_pixel_t col = getColor(); + int x_col = x+offset+160; + int y_col = y+hheight+5; + int w_col = mheight*4; + int h_col = mheight*4-10; + + if ((g_settings.gradiant) && ((chooser_gradient == gradient_head_body) || (chooser_gradient == gradient_head_text))) { + CComponentsHeader header(x_col, y_col+((h_col-hheight)/2), w_col, hheight, "Head"); + if (chooser_gradient == gradient_head_body) + header.setColorBody(col); + else if (chooser_gradient == gradient_head_text) + header.setCaptionColor(col); + header.paint(CC_SAVE_SCREEN_NO); + } + else + frameBuffer->paintBoxRel(x_col+2, y_col+2, w_col-4 , h_col-4, col); } fb_pixel_t CColorChooser::getColor() @@ -245,18 +262,19 @@ void CColorChooser::hide() void CColorChooser::paint() { - //frameBuffer->paintBoxRel(x,y, width,hheight, COL_MENUHEAD_PLUS_0); - frameBuffer->paintBoxRel(x,y, width,hheight, COL_MENUHEAD_PLUS_0, RADIUS_MID, CORNER_TOP); //round - g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+hheight, width, g_Locale->getText(name), COL_MENUHEAD_TEXT); - //frameBuffer->paintBoxRel(x,y+hheight, width,height-hheight, COL_MENUCONTENT_PLUS_0); + CComponentsHeader header(x, y, width, hheight, g_Locale->getText(name)); + header.paint(CC_SAVE_SCREEN_NO); + frameBuffer->paintBoxRel(x,y+hheight, width,height-hheight, COL_MENUCONTENT_PLUS_0, RADIUS_MID, CORNER_BOTTOM);//round for (int i = 0; i < 4; i++) paintSlider(x + 10, y + hheight + mheight * i, value[i], colorchooser_names[i], iconnames[i], (i == 0)); - //color preview - frameBuffer->paintBoxRel(x+offset+160,y+hheight+5, mheight*4, mheight*4-10, COL_MENUHEAD_PLUS_0); - frameBuffer->paintBoxRel(x+offset+162,y+hheight+2+5, mheight*4-4 ,mheight*4-4-10, 254); + if ((!g_settings.gradiant) || ((chooser_gradient != gradient_head_body) && (chooser_gradient != gradient_head_text))) { + //color preview + frameBuffer->paintBoxRel(x+offset+160,y+hheight+5, mheight*4, mheight*4-10, COL_MENUHEAD_PLUS_0); + frameBuffer->paintBoxRel(x+offset+162,y+hheight+2+5, mheight*4-4 ,mheight*4-4-10, 254); + } } void CColorChooser::paintSlider(int px, int py, unsigned char *spos, const neutrino_locale_t text, const char * const iconname, const bool selected) diff --git a/src/gui/widget/colorchooser.h b/src/gui/widget/colorchooser.h index f2ff70c90..5ecc64ec6 100644 --- a/src/gui/widget/colorchooser.h +++ b/src/gui/widget/colorchooser.h @@ -50,6 +50,7 @@ class CColorChooser : public CMenuTarget int hheight,mheight; // head/menu font height int offset; int font_info; + int chooser_gradient; unsigned char * value[4]; // r, g, b, alpha @@ -68,7 +69,13 @@ class CColorChooser : public CMenuTarget void hide(); int exec(CMenuTarget* parent, const std::string & actionKey); fb_pixel_t getColor(void); - + enum + { + gradient_none, + gradient_head_body, + gradient_head_text + }; + void setGradient(int gradient = gradient_none) { chooser_gradient = gradient; }; }; diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 217722790..eb9900a58 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -42,11 +42,23 @@ CHintBox::CHintBox(const neutrino_locale_t Caption, const char * const Text, con init(caption_tmp, Text, Width, Icon); } +CHintBox::CHintBox(const neutrino_locale_t Caption, const neutrino_locale_t Text, const int Width, const char * const Icon) +{ + const char * caption_tmp = g_Locale->getText(Caption); + const char * text_tmp = g_Locale->getText(Text); + init(caption_tmp, text_tmp, Width, Icon); +} + CHintBox::CHintBox(const char * const Caption, const char * const Text, const int Width, const char * const Icon) { init(Caption, Text, Width, Icon); } +CHintBox::CHintBox(const char * const Caption, const neutrino_locale_t Text, const int Width, const char * const Icon) +{ + const char * text_tmp = g_Locale->getText(Text); + init(Caption, text_tmp, Width, Icon); +} void CHintBox::init(const char * const Caption, const char * const Text, const int Width, const char * const Icon) { char * begin; diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index d58761c7d..460d9f556 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -65,7 +65,9 @@ class CHintBox public: // Text is UTF-8 encoded CHintBox(const neutrino_locale_t Caption, const char * const Text, const int Width = 450, const char * const Icon = NEUTRINO_ICON_INFO); + CHintBox(const neutrino_locale_t Caption, const neutrino_locale_t Text, const int Width = 450, const char * const Icon = NEUTRINO_ICON_INFO); CHintBox(const char * const Caption, const char * const Text, const int Width = 450, const char * const Icon = NEUTRINO_ICON_INFO); + CHintBox(const char * const Caption, const neutrino_locale_t Text, const int Width = 450, const char * const Icon = NEUTRINO_ICON_INFO); ~CHintBox(void); bool has_scrollbar(void); diff --git a/src/gui/widget/keyboard_input.cpp b/src/gui/widget/keyboard_input.cpp new file mode 100644 index 000000000..cc4eaf6f3 --- /dev/null +++ b/src/gui/widget/keyboard_input.cpp @@ -0,0 +1,774 @@ +/* + Neutrino-GUI - DBoxII-Project + + Copyright (C) 2001 Steffen Hehn 'McClean' + Copyright (C) 2014 CoolStream International Ltd + + 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, version 2 of the License. + + 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 + +static std::string keys_english[2][KEY_ROWS][KEY_COLUMNS] = +{ + { + { "`", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "§" }, + { "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "{", "}" }, + { "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "\'", "\\", ":", "\"" }, + { "z", "x", "c", "v", "b", "n", "m", ",", ".", "/", "<", ">", "?", " " } + }, + { + { "~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "§", }, + { "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "{", "}", "{", "}" }, + { "A", "S", "D", "F", "G", "H", "J", "K", "L", ";", "\'", "\\", ":", "\"" }, + { "Z", "X", "C", "V", "B", "N", "M", ",", ".", "/", "<", ">", "?", " " } + } +}; + +static std::string keys_deutsch[2][KEY_ROWS][KEY_COLUMNS] = +{ + { + { "°", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "ß", "´", "@" }, + { "q", "w", "e", "r", "t", "z", "u", "i", "o", "p", "ü", "+", "~", "/" }, + { "a", "s", "d", "f", "g", "h", "j", "k", "l", "ö", "ä", "#", "[", "]" }, + { "y", "x", "c", "v", "b", "n", "m", ",", ".", "-", "|", "<", ">", " " } + }, + { + { "^", "!", "\"","§", "$", "%", "&", "/", "(", ")", "=", "?", "`", "€" }, + { "Q", "W", "E", "R", "T", "Z", "U", "I", "O", "P", "Ü", "*", "\\","/" }, + { "A", "S", "D", "F", "G", "H", "J", "K", "L", "Ö", "Ä", "\'","{", "}" }, + { "Y", "X", "C", "V", "B", "N", "M", ";", ":", "_", "²", "³", "µ", " " } + } +}; + +static std::string keys_russian[2][KEY_ROWS][KEY_COLUMNS] = +{ + { + { "ё", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "§" }, + { "й", "ц", "у", "к", "е", "н", "г", "ш", "щ", "з", "х", "ъ", "[", "]" }, + { "ф", "ы", "в", "а", "п", "р", "о", "л", "д", "ж", "э", "\\", ":", "\"" }, + { "я", "ч", "с", "м", "и", "т", "ь", "б", "ю", "/", ".", ",", "?", " " } + }, + { + { "Ё", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "§" }, + { "Й", "Ц", "У", "К", "Е", "Н", "Г", "Ш", "Щ", "З", "Х", "Х", "{", "}" }, + { "Ф", "Ы", "В", "А", "П", "Р", "О", "Л", "Д", "Ж", "Э", "|", ";", "~" }, + { "Я", "Ч", "С", "М", "И", "Т", "Ь", "Б", "Ю", "?", "<", ">", "?", " " } + } +}; + +struct keyboard_layout keyboards[] = +{ + { "English", "english", keys_english }, + { "Deutsch", "deutsch", keys_deutsch }, + { "Русский", "russkij", keys_russian }, +}; +#define LAYOUT_COUNT (sizeof(keyboards)/sizeof(struct keyboard_layout)) + +std::string UTF8ToString(const char * &text) +{ + std::string res; + + res = *text; + if ((((unsigned char)(*text)) & 0x80) != 0) + { + int remaining_unicode_length = 0; + if ((((unsigned char)(*text)) & 0xf8) == 0xf0) + remaining_unicode_length = 3; + else if ((((unsigned char)(*text)) & 0xf0) == 0xe0) + remaining_unicode_length = 2; + else if ((((unsigned char)(*text)) & 0xe0) == 0xc0) + remaining_unicode_length = 1; + + for (int i = 0; i < remaining_unicode_length; i++) + { + text++; + if (((*text) & 0xc0) != 0x80) + break; + res += *text; + } + } + return res; +} + +CInputString::CInputString(int Size) +{ + len = Size; + std::string tmp; + for (unsigned i = 0; i < len; i++) + inputString.push_back(tmp); +} + +void CInputString::clear() +{ + for (unsigned i = 0; i < len; i++) + inputString[i].clear(); +} + +size_t CInputString::length() +{ + return inputString.size(); +} + +CInputString & CInputString::operator=(const std::string &str) +{ + clear(); + const char * text = str.c_str(); + for (unsigned i = 0; i < inputString.size() && *text; i++, text++) + inputString[i] = UTF8ToString(text); + return *this; +} + +void CInputString::assign(size_t n, char c) +{ + clear(); + for (unsigned i = 0; i < n && i < inputString.size(); i++) + inputString[i] = c; +} + +std::string &CInputString::at(size_t pos) +{ + return inputString[pos]; +} + +std::string &CInputString::getValue() +{ + valueString.clear(); + for (unsigned i = 0; i < inputString.size(); i++) { + if (!inputString[i].empty()) + valueString += inputString[i]; + } + valueString = valueString.erase(valueString.find_last_not_of(" ") + 1); + return valueString; +} + +const char* CInputString::c_str() +{ + return getValue().c_str(); +} + +CKeyboardInput::CKeyboardInput(const neutrino_locale_t Name, std::string* Value, int Size, CChangeObserver* Observ, const char * const Icon, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2) +{ + name = Name; + head = g_Locale->getText(Name); + valueString = Value; + inputSize = Size; + + iconfile = Icon ? Icon : ""; + + observ = Observ; + hint_1 = Hint_1; + hint_2 = Hint_2; + hintText_1 = ""; + hintText_2 = ""; + inputString = NULL; + layout = NULL; + selected = 0; + caps = 0; + srow = scol = 0; + focus = FOCUS_STRING; +} + +CKeyboardInput::CKeyboardInput(const std::string &Name, std::string *Value, int Size, CChangeObserver* Observ, const char * const Icon, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2) +{ + name = NONEXISTANT_LOCALE; + head = Name; + valueString = Value; + inputSize = Size; + + iconfile = Icon ? Icon : ""; + + observ = Observ; + hint_1 = Hint_1; + hint_2 = Hint_2; + hintText_1 = ""; + hintText_2 = ""; + inputString = NULL; + layout = NULL; + selected = 0; + caps = 0; + srow = scol = 0; + focus = FOCUS_STRING; +} + +CKeyboardInput::CKeyboardInput(const std::string &Name, std::string *Value, int Size, CChangeObserver* Observ, const char * const Icon, std::string HintText_1, std::string HintText_2) +{ + name = NONEXISTANT_LOCALE; + head = Name; + valueString = Value; + inputSize = Size; + + iconfile = Icon ? Icon : ""; + + observ = Observ; + hint_1 = NONEXISTANT_LOCALE; + hint_2 = NONEXISTANT_LOCALE; + hintText_1 = HintText_1; + hintText_2 = HintText_2; + inputString = NULL; + layout = NULL; + selected = 0; + caps = 0; + srow = scol = 0; + focus = FOCUS_STRING; +} + +CKeyboardInput::~CKeyboardInput() +{ +} + +#define BORDER_OFFSET 20 +#define INPUT_BORDER 2 +#define KEY_FRAME_WIDTH 2 // keys frame width +#define KEY_BORDER 4 // spacing between keys + +void CKeyboardInput::init() +{ + frameBuffer = CFrameBuffer::getInstance(); + setLayout(); + + hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + iheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getHeight(); + input_h = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight() + 2; // font height + border + input_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("M") + INPUT_BORDER; // hack font width + border + offset = BORDER_OFFSET; + fheight = paintFooter(false); + iwidth = inputSize*input_w + 2*offset; + + key_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth("M") + 20; + key_h = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight() + 10; + kwidth = key_w*KEY_COLUMNS + (KEY_COLUMNS-1)*KEY_BORDER + 2*offset; + + width = std::max(iwidth, kwidth); + width = std::min(width, (int) frameBuffer->getScreenWidth()); + + if (!inputSize || (iwidth > width)) { /* auto calc inputSize */ + inputSize = (width - 2*offset) / input_w; + iwidth = inputSize*input_w + 2*offset; + } + inputString = new CInputString(inputSize); + + int tmp_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(head); + if (!(iconfile.empty())) + { + int icol_w, icol_h; + frameBuffer->getIconSize(iconfile.c_str(), &icol_w, &icol_h); + hheight = std::max(hheight, icol_h + (offset/4)); + tmp_w += icol_w + (offset/2); + } + width = std::max(width, tmp_w + offset); + + bheight = input_h + (key_h+KEY_BORDER)*KEY_ROWS + 3*offset; + + bool has_hint_1 = ((hint_1 != NONEXISTANT_LOCALE) || !hintText_1.empty()); + bool has_hint_2 = ((hint_2 != NONEXISTANT_LOCALE) || !hintText_2.empty()); + if ((has_hint_1) || (has_hint_2)) + { + if (has_hint_1) + { + const char *_hint_1 = (hint_1 != NONEXISTANT_LOCALE ? g_Locale->getText(hint_1) : hintText_1.c_str()); + tmp_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getRenderWidth(_hint_1); + width = std::max(width, tmp_w + 2*offset); + bheight += iheight; + } + if (has_hint_2) + { + const char *_hint_2 = (hint_2 != NONEXISTANT_LOCALE ? g_Locale->getText(hint_2) : hintText_2.c_str()); + tmp_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getRenderWidth(_hint_2); + width = std::max(width, tmp_w + 2*offset); + bheight += iheight; + } + bheight += offset; + } + + height = hheight+ bheight + fheight; + + x = getScreenStartX(width); + y = getScreenStartY(height); + *inputString = *valueString; + changed = false; +} + +void CKeyboardInput::setLayout() +{ + if (layout != NULL) + return; + + layout = &keyboards[0]; + keyboard = layout->keys[caps]; + for(unsigned i = 0; i < LAYOUT_COUNT; i++) { + if (keyboards[i].locale == g_settings.language) { + layout = &keyboards[i]; + keyboard = layout->keys[caps]; + return; + } + } +} + +void CKeyboardInput::switchLayout() +{ + unsigned i; + for (i = 0; i < LAYOUT_COUNT; i++) { + if (layout == &keyboards[i]) + break; + } + i++; + if (i >= LAYOUT_COUNT) + i = 0; + layout = &keyboards[i]; + keyboard = layout->keys[caps]; + paintFooter(); + paintKeyboard(); +} + +void CKeyboardInput::NormalKeyPressed() +{ + if (keyboard[srow][scol].empty()) + return; + + inputString->at(selected) = keyboard[srow][scol]; + if (selected < (inputSize - 1)) + { + selected++; + paintChar(selected - 1); + } + paintChar(selected); + changed = true; +} + +void CKeyboardInput::clearString() +{ + selected = 0; + inputString->assign(inputString->length(), ' '); + for (int i = 0 ; i < inputSize; i++) + paintChar(i); + changed = true; +} + +void CKeyboardInput::switchCaps() +{ + caps = caps ? 0 : 1; + keyboard = layout->keys[caps]; + paintKeyboard(); +} + +void CKeyboardInput::keyUpPressed() +{ + if (focus == FOCUS_KEY) { + int old_row = srow; + srow--; + paintKey(old_row, scol); + if (srow < 0) { + focus = FOCUS_STRING; + paintChar(selected); + } else { + paintKey(srow, scol); + } + } else { + srow = KEY_ROWS - 1; + focus = FOCUS_KEY; + paintChar(selected); + paintKey(srow, scol); + } +} + +void CKeyboardInput::keyDownPressed() +{ + if (focus == FOCUS_KEY) { + int old_row = srow; + srow++; + paintKey(old_row, scol); + if (srow >= KEY_ROWS) { + focus = FOCUS_STRING; + paintChar(selected); + } else { + paintKey(srow, scol); + } + } else { + srow = 0; + focus = FOCUS_KEY; + paintChar(selected); + paintKey(srow, scol); + } +} + +void CKeyboardInput::keyLeftPressed() +{ + if (focus == FOCUS_KEY) { + int old_col = scol;; + scol--; + if (scol < 0) + scol = KEY_COLUMNS -1; + paintKey(srow, old_col); + paintKey(srow, scol); + } else { + int old = selected; + if (selected > 0) + selected--; + else + selected = inputSize - 1; + + paintChar(old); + paintChar(selected); + } +} + +void CKeyboardInput::keyRightPressed() +{ + if (focus == FOCUS_KEY) { + int old_col = scol;; + scol++; + if (scol >= KEY_COLUMNS) + scol = 0; + paintKey(srow, old_col); + paintKey(srow, scol); + } else { + int old = selected; + if (selected < (inputSize - 1)) { + selected++; + } else + selected = 0; + + paintChar(old); + paintChar(selected); + } +} + +void CKeyboardInput::deleteChar() +{ + int item = selected; + while (item < (inputSize -1)) + { + inputString->at(item) = inputString->at(item+1); + paintChar(item); + item++; + } + inputString->at(item) = ' '; + paintChar(item); + changed = true; +} + +void CKeyboardInput::keyBackspacePressed(void) +{ + if (selected > 0) + { + selected--; + for (int i = selected; i < inputSize - 1; i++) + { + inputString->at(i) = inputString->at(i + 1); + paintChar(i); + } + inputString->at(inputSize - 1) = ' '; + paintChar(inputSize - 1); + changed = true; + } +} + +void CKeyboardInput::insertChar() +{ + int item = inputSize -1; + while (item > selected) + { + inputString->at(item) = inputString->at(item-1); + paintChar(item); + item--; + } + inputString->at(item) = ' '; + paintChar(item); + changed = true; +} + +std::string &CKeyboardInput::getValue(void) +{ + return *valueString; +} + +int CKeyboardInput::exec(CMenuTarget* parent, const std::string &) +{ + neutrino_msg_t msg; + neutrino_msg_data_t data; + int res = menu_return::RETURN_REPAINT; + + if (parent) + parent->hide(); + + init(); + + std::string oldval = *valueString; + + fb_pixel_t * pixbuf = NULL; + if (!parent) { + pixbuf = new fb_pixel_t[(width + SHADOW_OFFSET) * (height + SHADOW_OFFSET)]; + if (pixbuf) + frameBuffer->SaveScreen(x, y, width + SHADOW_OFFSET, height + SHADOW_OFFSET, pixbuf); + } + + paint(); + paintKeyboard(); + + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); + + bool loop=true; + while (loop) + { + if (changed) + { + changed = false; + CVFD::getInstance()->showMenuText(1, inputString->c_str() , selected+1); + } + g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd, true); + + if (msg <= CRCInput::RC_MaxRC) + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); + + if (msg==CRCInput::RC_left) + { + keyLeftPressed(); + } + else if (msg==CRCInput::RC_right) + { + keyRightPressed(); + } + else if (msg == CRCInput::RC_up) + { + keyUpPressed(); + } + else if (msg == CRCInput::RC_down) + { + keyDownPressed(); + } + else if (msg==CRCInput::RC_red) + { + loop = false; + } + else if (msg == CRCInput::RC_green) + { + insertChar(); + } + else if (msg==CRCInput::RC_yellow) + { + clearString(); + } + else if (msg == CRCInput::RC_blue) + { + switchCaps(); + } + else if (msg == CRCInput::RC_rewind) + { + keyBackspacePressed(); + } + else if (msg == CRCInput::RC_ok) + { + if (focus == FOCUS_KEY) + NormalKeyPressed(); + } + else if (msg == CRCInput::RC_setup) + { + switchLayout(); + } + else if ((msg == CRCInput::RC_home) || (msg == CRCInput::RC_timeout)) + { + if ((inputString->getValue() != oldval) && + (ShowMsg(name, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel)) { + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); + continue; + } + + *inputString = oldval; + loop = false; + res = menu_return::RETURN_EXIT_REPAINT; + } + else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) + { + } + else + { + if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) + { + loop = false; + res = menu_return::RETURN_EXIT_ALL; + } + } + } + + if (pixbuf) + { + frameBuffer->RestoreScreen(x, y, width + SHADOW_OFFSET, height + SHADOW_OFFSET, pixbuf); + delete[] pixbuf; + } else + hide(); + + *valueString = inputString->getValue(); + + delete inputString; + inputString = NULL; + + if ((observ) && (msg == CRCInput::RC_red)) + observ->changeNotify(name, (void *) valueString->c_str()); + + return res; +} + +void CKeyboardInput::hide() +{ + frameBuffer->paintBackgroundBoxRel(x, y, width + SHADOW_OFFSET, height + SHADOW_OFFSET); +} + +int CKeyboardInput::paintFooter(bool show) +{ + button_label_ext footerButtons[] = { + { NEUTRINO_ICON_BUTTON_RED , LOCALE_STRINGINPUT_SAVE , NULL, 0, false }, + { NEUTRINO_ICON_BUTTON_GREEN , LOCALE_STRINGINPUT_INSERT , NULL, 0, false }, + { NEUTRINO_ICON_BUTTON_YELLOW , LOCALE_STRINGINPUT_CLEAR , NULL, 0, false }, + { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_STRINGINPUT_CAPS , NULL, 0, false }, + { NEUTRINO_ICON_BUTTON_BACKWARD, LOCALE_STRINGINPUT_BACKSPACE, NULL, 0, false }, + { NEUTRINO_ICON_BUTTON_MENU , NONEXISTANT_LOCALE , NULL, 0, false }, + { layout->locale.c_str() , NONEXISTANT_LOCALE , layout->name.c_str() , 0, false } + }; + + int cnt = (sizeof(footerButtons)/sizeof(struct button_label_ext)); + if (show) + return ::paintButtons(footerButtons, cnt, x, y+ hheight+ bheight, width, fheight, width, true); + else + return ::paintButtons(footerButtons, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); +} + +void CKeyboardInput::paint() +{ + frameBuffer->paintBoxRel(x + SHADOW_OFFSET, y + SHADOW_OFFSET, width, height, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE, CORNER_ALL); //round + frameBuffer->paintBoxRel(x, y + hheight, width, bheight, COL_MENUCONTENT_PLUS_0); + + CComponentsHeader header(x, y, width, hheight, head, iconfile); + header.paint(CC_SAVE_SCREEN_NO); + + key_y = y+ hheight+ offset+ input_h+ offset; + + bool has_hint_1 = ((hint_1 != NONEXISTANT_LOCALE) || !hintText_1.empty()); + bool has_hint_2 = ((hint_2 != NONEXISTANT_LOCALE) || !hintText_2.empty()); + if ((has_hint_1) || (has_hint_2)) + { + if (has_hint_1) + { + key_y += iheight; + const char *_hint_1 = (hint_1 != NONEXISTANT_LOCALE ? g_Locale->getText(hint_1) : hintText_1.c_str()); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, key_y, width- 2*offset, _hint_1, COL_MENUCONTENT_TEXT); + } + if (has_hint_2) + { + key_y += iheight; + const char *_hint_2 = (hint_2 != NONEXISTANT_LOCALE ? g_Locale->getText(hint_2) : hintText_2.c_str()); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, key_y, width- 2*offset, _hint_2, COL_MENUCONTENT_TEXT); + } + key_y += offset; + } + + for (int count = 0; count < inputSize; count++) + paintChar(count); + + paintFooter(); +} + +void CKeyboardInput::paintChar(int pos) +{ + if (pos < (int) inputString->length()) + paintChar(pos, inputString->at(pos)); +} + +void CKeyboardInput::paintChar(int pos, std::string &c) +{ + int xpos = x + offset + (width-iwidth)/2 + pos* input_w; + int ypos = y+ hheight+ offset; + + fb_pixel_t color; + fb_pixel_t bgcolor; + + if (pos == selected) + { + color = COL_MENUCONTENTSELECTED_TEXT; + bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; + } + else + { + color = COL_MENUCONTENT_TEXT; + bgcolor = COL_MENUCONTENT_PLUS_0; + } + + frameBuffer->paintBoxRel(xpos, ypos, input_w, input_h, COL_MENUCONTENT_PLUS_2); + frameBuffer->paintBoxRel(xpos+ 1, ypos+ 1, input_w- 2, input_h- 2, bgcolor); + + int ch_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(c); + int ch_x = xpos + std::max(input_w/2 - ch_w/2, 0); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(ch_x, ypos+ input_h, ch_w, c, color); +} + +void CKeyboardInput::paintKeyboard() +{ + for (int i = 0; i < KEY_ROWS; i++) { + for (int j = 0; j < KEY_COLUMNS; j++) + paintKey(i, j); + } +} + +void CKeyboardInput::paintKey(int row, int column) +{ + int xpos = x + offset + (width-kwidth)/2 + (key_w + KEY_BORDER)*column; + //int ypos = y + offset*2 + hheight + input_h + (key_h + KEY_BORDER)*row; + //key_y = y+ hheight+ offset+ input_h+ offset; + int ypos = key_y + (key_h + KEY_BORDER)*row; + + fb_pixel_t color; + fb_pixel_t bgcolor; + if (focus == FOCUS_KEY && row == srow && column == scol) { + color = COL_MENUCONTENTSELECTED_TEXT; + bgcolor = COL_MENUCONTENTSELECTED_PLUS_0; + } else { + color = COL_MENUCONTENT_TEXT; + bgcolor = COL_MENUCONTENT_PLUS_0; + } + + int radius = CORNER_RADIUS_SMALL; + frameBuffer->paintBoxRel(xpos, ypos, key_w, key_h, bgcolor, radius); + frameBuffer->paintBoxFrame(xpos, ypos, key_w, key_h, KEY_FRAME_WIDTH, COL_MENUCONTENT_PLUS_6, radius); + + if (keyboard[row][column].empty()) + return; + + std::string &s = keyboard[row][column]; + int ch_w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(s); + int ch_h = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + int ch_x = xpos + key_w/2 - ch_w/2; + int ch_y = ypos + key_h/2 + ch_h/2; + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(ch_x, ch_y, ch_w, s, color); +} diff --git a/src/gui/widget/keyboard_input.h b/src/gui/widget/keyboard_input.h new file mode 100644 index 000000000..009934b4a --- /dev/null +++ b/src/gui/widget/keyboard_input.h @@ -0,0 +1,138 @@ +/* + Neutrino-GUI - DBoxII-Project + + Copyright (C) 2001 Steffen Hehn 'McClean' + Copyright (C) 2014 CoolStream International Ltd + + 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, version 2 of the License. + + 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 __keyboard_input__ +#define __keyboard_input__ + +#include "menue.h" + +#include +#include + +#include + +#define KEY_ROWS 4 +#define KEY_COLUMNS 14 + +struct keyboard_layout +{ + std::string name; + std::string locale; + std::string (*keys)[KEY_ROWS][KEY_COLUMNS]; +}; + +class CInputString +{ + private: + size_t len; + std::vector inputString; + std::string valueString; + + public: + CInputString(int Size); + size_t length(); + void clear(); + std::string &at(size_t pos); + void assign(size_t n, char c); + const char* c_str(); + CInputString & operator=(const std::string &str); + std::string &getValue(); +}; + +class CKeyboardInput : public CMenuTarget +{ + protected: + CFrameBuffer *frameBuffer; + int x; + int y; + int width; + int height; + int hheight; // head font height + int iheight; // input string height + int bheight; // body height + int fheight; // footer height + int input_h; // input field height + int input_w; // input field width + int iwidth; // input width + int offset; + int key_y; + + // keyboard + int key_w; // keyboard key width + int key_h; // keyboard key height + int kwidth; // keyboard width + int srow, scol; + enum { + FOCUS_KEY, + FOCUS_STRING + }; + int focus; + int caps; + struct keyboard_layout *layout; + std::string (*keyboard)[KEY_COLUMNS]; + CInputString * inputString; + + std::string head; + neutrino_locale_t name; + neutrino_locale_t hint_1, hint_2; + std::string hintText_1, hintText_2; + std::string iconfile; + int inputSize; + int selected; + bool changed; + CChangeObserver * observ; + + virtual void init(); + + virtual void paint(); + virtual int paintFooter(bool show = true); + virtual void paintChar(int pos, std::string &c); + virtual void paintChar(int pos); + virtual void paintKeyboard(); + virtual void paintKey(int row, int column); + + virtual void NormalKeyPressed(); + virtual void clearString(); + virtual void switchCaps(); + virtual void keyUpPressed(); + virtual void keyDownPressed(); + virtual void keyLeftPressed(); + virtual void keyRightPressed(); + virtual void insertChar(); + virtual void deleteChar(); + virtual void keyBackspacePressed(); + virtual void switchLayout(); + virtual void setLayout(); + + public: + CKeyboardInput(const neutrino_locale_t Name, std::string* Value, int Size = 0, CChangeObserver* Observ = NULL, const char * const Icon = NULL, const neutrino_locale_t Hint_1 = NONEXISTANT_LOCALE, const neutrino_locale_t Hint_2 = NONEXISTANT_LOCALE); + CKeyboardInput(const std::string &Name, std::string* Value, int Size = 0, CChangeObserver* Observ = NULL, const char * const Icon = NULL, const neutrino_locale_t Hint_1 = NONEXISTANT_LOCALE, const neutrino_locale_t Hint_2 = NONEXISTANT_LOCALE); + CKeyboardInput(const std::string &Name, std::string* Value, int Size = 0, CChangeObserver* Observ = NULL, const char * const Icon = NULL, std::string HintText_1 = "", std::string HintText_2 = ""); + ~CKeyboardInput(); + + void hide(); + int exec( CMenuTarget* parent, const std::string & actionKey ); + virtual std::string &getValue(void); +}; + +#endif diff --git a/src/gui/widget/listframe.h b/src/gui/widget/listframe.h index 7a1503737..95c3b53e3 100644 --- a/src/gui/widget/listframe.h +++ b/src/gui/widget/listframe.h @@ -56,7 +56,7 @@ #include #include -#define LF_MAX_ROWS 6 +#define LF_MAX_ROWS 9 typedef struct { int rows; diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 8af0a3581..3cc11dac3 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -35,6 +35,7 @@ #include #include +#include #include #include @@ -965,11 +966,9 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) return retval; } -void CMenuWidget::integratePlugins(void *pluginsExec, CPlugins::i_type_t integration, const unsigned int shortcut) +void CMenuWidget::integratePlugins(CPlugins::i_type_t integration, const unsigned int shortcut) { - CPluginsExec *_pluginsExec = static_cast(pluginsExec); bool separatorline = false; - char id_plugin[5]; unsigned int number_of_plugins = (unsigned int) g_PluginList->getNumberOfPlugins(); unsigned int sc = shortcut; for (unsigned int count = 0; count < number_of_plugins; count++) @@ -982,9 +981,8 @@ void CMenuWidget::integratePlugins(void *pluginsExec, CPlugins::i_type_t integra separatorline = true; } printf("[neutrino] integratePlugins: add %s\n", g_PluginList->getName(count)); - sprintf(id_plugin, "%d", count); neutrino_msg_t dk = (shortcut != CRCInput::RC_nokey) ? CRCInput::convertDigitToKey(sc++) : CRCInput::RC_nokey; - CMenuForwarder *fw_plugin = new CMenuForwarder(g_PluginList->getName(count), true, NULL, _pluginsExec, id_plugin, dk); + CMenuForwarder *fw_plugin = new CMenuForwarder(g_PluginList->getName(count), true, NULL, CPluginsExec::getInstance(), to_string(count).c_str(), dk); fw_plugin->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count)); addItem(fw_plugin); } @@ -1327,7 +1325,7 @@ void CMenuWidget::paintHint(int pos) } if (item->hint == NONEXISTANT_LOCALE && item->hintText.empty()) - return; + item->hintText = " "; int iheight = item->getHeight(); int rad = RADIUS_LARGE; @@ -2289,7 +2287,7 @@ void CMenuProgressbar::init(const neutrino_locale_t Loc, const std::string &Text name = Loc; nameString = Text; scale.setDimensionsAll(0, 0, 100, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight()/2); - scale.setValue(100); + scale.setValues(100, 100); } int CMenuProgressbar::paint(bool selected) diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 2dabedd5e..74fd2051e 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -568,7 +568,7 @@ class CMenuWidget : public CMenuTarget virtual void hide(); virtual int exec(CMenuTarget* parent, const std::string & actionKey); virtual const char *getName(); - virtual void integratePlugins(void *pluginsExec, CPlugins::i_type_t integration, const unsigned int shortcut=CRCInput::RC_nokey); + virtual void integratePlugins(CPlugins::i_type_t integration, const unsigned int shortcut=CRCInput::RC_nokey); void setSelected(const int &Preselected){ preselected = Preselected; }; int getSelected()const { return selected; }; void move(int xoff, int yoff); diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 93f8efd60..b57c56ee3 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -61,7 +61,7 @@ void CProgressWindow::Init() status_txt->setDimensionsAll(x_item, y_item, w_item, h_txt); status_txt->setColorBody(col_body); addWindowItem(status_txt); - y_item += h_txt; + y_item += h_txt + 10; //create local_bar object local_bar = new CProgressBar(); @@ -83,7 +83,7 @@ void CProgressWindow::Init() addWindowItem(global_bar); y_item += 2*h_pbar; - height = y_item + ccw_head->getHeight() + 10; + height = y_item + ccw_head->getHeight(); setCenterPos(); } diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index 63c49153c..4020f6fea 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -485,8 +485,10 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & ) else if ( (msg==CRCInput::RC_home) || (msg==CRCInput::RC_timeout) ) { if ((*valueString != oldval) && - (ShowMsg(name, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel)) + (ShowMsg(name, LOCALE_MESSAGEBOX_DISCARD, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbCancel) == CMessageBox::mbrCancel)) { + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); continue; + } *valueString = oldval; loop=false; @@ -898,7 +900,7 @@ const char * CPLPINInput::getHint1(void) } } -#define borderwidth 4 +#define borderwidth SHADOW_OFFSET // FIXME: do we need border around ?? int CPLPINInput::exec( CMenuTarget* parent, const std::string & ) { diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index 296a265eb..803cc4843 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -248,6 +248,7 @@ int CExtendedInput::exec( CMenuTarget* parent, const std::string & ) *cancel = false; } else if(erg==CMessageBox::mbrCancel){ + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); } } else { //keine nderungen - beenden ok diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 8204abd49..7c9f47c6e 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -350,11 +350,8 @@ int CNeutrinoApp::loadSetup(const char * fname) configfile.clear(); } } - std::ifstream checkParentallocked(NEUTRINO_PARENTALLOCKED_FILE); - if(checkParentallocked) { - parentallocked = true; - checkParentallocked.close(); - } + parentallocked = !access(NEUTRINO_PARENTALLOCKED_FILE, R_OK); + g_settings.easymenu = configfile.getInt32("easymenu", 0); g_settings.softupdate_autocheck = configfile.getBool("softupdate_autocheck" , false); /* if file present and no config file found, force easy mode */ @@ -392,6 +389,9 @@ int CNeutrinoApp::loadSetup(const char * fname) if (g_settings.start_volume >= 0) g_settings.current_volume = g_settings.start_volume; + g_settings.audio_volume_percent_ac3 = configfile.getInt32("audio_volume_percent_ac3", 100); + g_settings.audio_volume_percent_pcm = configfile.getInt32("audio_volume_percent_pcm", 100); + g_settings.channel_mode = configfile.getInt32("channel_mode", LIST_MODE_PROV); g_settings.channel_mode_radio = configfile.getInt32("channel_mode_radio", LIST_MODE_PROV); g_settings.channel_mode_initial = configfile.getInt32("channel_mode_initial", -1); @@ -424,6 +424,11 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.enabled_video_modes[4] = 1; // 1080i 50Hz #endif + for(int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) { + sprintf(cfg_key, "enabled_auto_mode_%d", i); + g_settings.enabled_auto_modes[i] = configfile.getInt32(cfg_key, 1); + } + g_settings.cpufreq = configfile.getInt32("cpufreq", 0); g_settings.standby_cpufreq = configfile.getInt32("standby_cpufreq", 100); g_settings.rounded_corners = configfile.getInt32("rounded_corners", 1); @@ -441,6 +446,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.make_new_list = configfile.getInt32("make_new_list", 1); g_settings.make_removed_list = configfile.getInt32("make_removed_list", 1); g_settings.keep_channel_numbers = configfile.getInt32("keep_channel_numbers", 0); + g_settings.show_empty_favorites = configfile.getInt32("show_empty_favorites", 0); //misc g_settings.power_standby = configfile.getInt32( "power_standby", 0); @@ -534,6 +540,8 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.epg_save = configfile.getBool("epg_save", false); g_settings.epg_save_standby = configfile.getBool("epg_save_standby", true); + g_settings.epg_save_frequently = configfile.getInt32("epg_save_frequently", false); + g_settings.epg_read = configfile.getBool("epg_read", g_settings.epg_save); g_settings.epg_scan = configfile.getInt32("epg_scan", CEpgScan::SCAN_CURRENT); g_settings.epg_scan_mode = configfile.getInt32("epg_scan_mode", CEpgScan::MODE_OFF); // backward-compatible check @@ -666,7 +674,7 @@ int CNeutrinoApp::loadSetup(const char * fname) } } else { std::string webtv_xml = configfile.getString("webtv_xml", WEBTV_XML); - if (!file_size(webtv_xml.c_str())) + if (file_size(webtv_xml.c_str())) g_settings.webtv_xml.push_back(webtv_xml); } @@ -781,6 +789,7 @@ int CNeutrinoApp::loadSetup(const char * fname) } g_settings.parentallock_defaultlocked = configfile.getInt32("parentallock_defaultlocked", 0); g_settings.parentallock_pincode = configfile.getString( "parentallock_pincode", "0000" ); + g_settings.parentallock_zaptime = configfile.getInt32( "parentallock_zaptime", 60 ); for (int i = 0; i < SNeutrinoSettings::TIMING_SETTING_COUNT; i++) g_settings.timing[i] = configfile.getInt32(locale_real_names[timing_setting[i].name], timing_setting[i].default_timing); @@ -942,6 +951,8 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "current_volume", g_settings.current_volume ); configfile.setInt32( "current_volume_step", g_settings.current_volume_step ); configfile.setInt32( "start_volume", g_settings.start_volume ); + configfile.setInt32("audio_volume_percent_ac3", g_settings.audio_volume_percent_ac3); + configfile.setInt32("audio_volume_percent_pcm", g_settings.audio_volume_percent_pcm); configfile.setInt32( "channel_mode", g_settings.channel_mode ); configfile.setInt32( "channel_mode_radio", g_settings.channel_mode_radio ); configfile.setInt32( "channel_mode_initial", g_settings.channel_mode_initial ); @@ -963,6 +974,10 @@ void CNeutrinoApp::saveSetup(const char * fname) sprintf(cfg_key, "enabled_video_mode_%d", i); configfile.setInt32(cfg_key, g_settings.enabled_video_modes[i]); } + for(int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) { + sprintf(cfg_key, "enabled_auto_mode_%d", i); + configfile.setInt32(cfg_key, g_settings.enabled_auto_modes[i]); + } configfile.setInt32( "cpufreq", g_settings.cpufreq); configfile.setInt32( "standby_cpufreq", g_settings.standby_cpufreq); configfile.setInt32("rounded_corners", g_settings.rounded_corners); @@ -975,6 +990,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "make_new_list", g_settings.make_new_list); configfile.setInt32( "make_removed_list", g_settings.make_removed_list); configfile.setInt32( "keep_channel_numbers", g_settings.keep_channel_numbers); + configfile.setInt32( "show_empty_favorites", g_settings.show_empty_favorites); //led configfile.setInt32( "led_tv_mode", g_settings.led_tv_mode); configfile.setInt32( "led_standby_mode", g_settings.led_standby_mode); @@ -1046,6 +1062,8 @@ void CNeutrinoApp::saveSetup(const char * fname) // epg configfile.setBool("epg_save", g_settings.epg_save); configfile.setBool("epg_save_standby", g_settings.epg_save_standby); + configfile.setInt32("epg_save_frequently", g_settings.epg_save_frequently); + configfile.setBool("epg_read", g_settings.epg_read); configfile.setInt32("epg_scan", g_settings.epg_scan); configfile.setInt32("epg_scan_mode", g_settings.epg_scan_mode); configfile.setInt32("epg_cache_time" ,g_settings.epg_cache ); @@ -1225,6 +1243,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "parentallock_prompt", g_settings.parentallock_prompt ); configfile.setInt32( "parentallock_lockage", g_settings.parentallock_lockage ); configfile.setString( "parentallock_pincode", g_settings.parentallock_pincode ); + configfile.setInt32("parentallock_zaptime", g_settings.parentallock_zaptime); configfile.setInt32("parentallock_defaultlocked", g_settings.parentallock_defaultlocked); //timing @@ -1367,7 +1386,7 @@ void CNeutrinoApp::channelsInit(bool bOnly) int tvi = 0, ri = 0; - ZapitChannelList zapitList; + ZapitChannelList zapitList, webtvList; /* all TV channels */ CServiceManager::getInstance()->GetAllTvChannels(zapitList); @@ -1390,13 +1409,11 @@ void CNeutrinoApp::channelsInit(bool bOnly) TVallList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD)); tmp = TVallList->addBouquet(g_Locale->getText(LOCALE_CHANNELLIST_HEAD)); - delete tmp->channelList; - tmp->channelList = new CChannelList(*TVchannelList); + tmp->channelList->SetChannelList(&TVchannelList->getChannels()); RADIOallList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD)); tmp = RADIOallList->addBouquet(g_Locale->getText(LOCALE_CHANNELLIST_HEAD)); - delete tmp->channelList; - tmp->channelList = new CChannelList(*RADIOchannelList); + tmp->channelList->SetChannelList(&RADIOchannelList->getChannels()); if(TVsatList) delete TVsatList; TVsatList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_SATS)); @@ -1435,20 +1452,16 @@ void CNeutrinoApp::channelsInit(bool bOnly) } /* all WebTV channels */ if (g_settings.make_webtv_list) { - if (CServiceManager::getInstance()->GetAllWebTVChannels(zapitList)) { + if (CServiceManager::getInstance()->GetAllWebTVChannels(webtvList)) { /* all channels */ CBouquet* webtvBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_WEBTV), false, true); - webtvBouquet->channelList->SetChannelList(&zapitList); + webtvBouquet->channelList->SetChannelList(&webtvList); TVallList->Bouquets.push_back(webtvBouquet); - /* provider */ - webtvBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_WEBTV), false, true); - webtvBouquet->channelList->SetChannelList(&zapitList); - TVbouquetList->Bouquets.push_back(webtvBouquet); /* "satellite" */ webtvBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_WEBTV), false, true); - webtvBouquet->channelList->SetChannelList(&zapitList); + webtvBouquet->channelList->SetChannelList(&webtvList); TVsatList->Bouquets.push_back(webtvBouquet); - printf("[neutrino] got %d WebTV channels\n", (int)zapitList.size()); fflush(stdout); + printf("[neutrino] got %d WebTV channels\n", (int)webtvList.size()); fflush(stdout); } } /* all HD channels */ @@ -1500,7 +1513,7 @@ void CNeutrinoApp::channelsInit(bool bOnly) for (i = 0; i < g_bouquetManager->Bouquets.size(); i++) { CZapitBouquet *b = g_bouquetManager->Bouquets[i]; if (!b->bHidden) { - if (b->getTvChannels(zapitList) /*|| b->bFav */) { + if (b->getTvChannels(zapitList) || (g_settings.show_empty_favorites && b->bUser)) { if(b->bUser) tmp = TVfavList->addBouquet(b); else @@ -1509,7 +1522,7 @@ void CNeutrinoApp::channelsInit(bool bOnly) tmp->channelList->SetChannelList(&zapitList); tvi++; } - if (b->getRadioChannels(zapitList) /* || b->bFav */) { + if (b->getRadioChannels(zapitList) || (g_settings.show_empty_favorites && b->bUser)) { if(b->bUser) tmp = RADIOfavList->addBouquet(b); else @@ -1522,6 +1535,12 @@ void CNeutrinoApp::channelsInit(bool bOnly) AllFavBouquetList->addBouquet(b); } } + if (!webtvList.empty()) { + /* provider */ + CBouquet* webtvBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_WEBTV), false, true); + webtvBouquet->channelList->SetChannelList(&webtvList); + TVbouquetList->Bouquets.push_back(webtvBouquet); + } printf("[neutrino] got %d TV and %d RADIO bouquets\n", tvi, ri); fflush(stdout); TIMER_STOP("[neutrino] took"); @@ -1699,6 +1718,7 @@ void CNeutrinoApp::MakeSectionsdConfig(CSectionsdClient::epg_config& config) config.epg_old_events = g_settings.epg_old_events; config.epg_max_events = g_settings.epg_max_events; config.epg_extendedcache = g_settings.epg_extendedcache; + config.epg_save_frequently = g_settings.epg_save ? g_settings.epg_save_frequently : 0; config.epg_dir = g_settings.epg_dir; config.network_ntpserver = g_settings.network_ntpserver; config.network_ntprefresh = atoi(g_settings.network_ntprefresh.c_str()); @@ -1717,7 +1737,7 @@ void CNeutrinoApp::InitZapper() struct stat my_stat; g_InfoViewer->start(); - if (g_settings.epg_save){ + if (g_settings.epg_read) { if(stat(g_settings.epg_dir.c_str(), &my_stat) == 0) g_Sectionsd->readSIfromXML(g_settings.epg_dir.c_str()); } @@ -1948,7 +1968,8 @@ fprintf(stderr, "[neutrino start] %d -> %5ld ms\n", __LINE__, time_monotonic_ms /* create decoders, read channels */ bool zapit_init = CZapit::getInstance()->Start(&ZapStart_arg); -fprintf(stderr, "[neutrino start] %d -> %5ld ms\n", __LINE__, time_monotonic_ms() - starttime); + //get zapit config for writeChannelsNames + CZapit::getInstance()->GetConfig(zapitCfg); // init audio settings audioDecoder->SetSRS(g_settings.srs_enable, g_settings.srs_nmgr_enable, g_settings.srs_algo, g_settings.srs_ref_volume); @@ -2079,6 +2100,7 @@ fprintf(stderr, "[neutrino start] %d -> %5ld ms\n", __LINE__, time_monotonic_ms g_audioMute = CAudioMute::getInstance(); g_audioMute->AudioMute(current_muted, true); + CZapit::getInstance()->SetVolumePercent(g_settings.audio_volume_percent_ac3, g_settings.audio_volume_percent_pcm); CVFD::getInstance()->showVolume(g_settings.current_volume); CVFD::getInstance()->setMuted(current_muted); @@ -2554,6 +2576,12 @@ _repeat: adjustToChannelID(live_channel_id);//FIXME what if deleted ? delete hintBox; } + if (g_settings.easymenu) { + CBouquetList * blist = (mode == mode_radio) ? RADIOfavList : TVfavList; + t_channel_id live_channel_id = channelList->getActiveChannel_ChannelID(); + if (blist->hasChannelID(live_channel_id)) + SetChannelMode(LIST_MODE_FAV); + } channellist_visible = false; if (!from_menu) @@ -3068,6 +3096,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) if(tmp1 != g_settings.make_hd_list || tmp2 != g_settings.make_webtv_list) g_Zapit->reinitChannels(); + SendSectionsdConfig(); return messages_return::handled; } else if( msg == NeutrinoMessages::STANDBY_TOGGLE ) { @@ -3278,9 +3307,6 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) } - delete cHddStat::getInstance(); - delete CRecordManager::getInstance(); - dprintf(DEBUG_INFO, "exit\n"); StopSubtitles(); stopPlayBack(); @@ -3288,6 +3314,9 @@ void CNeutrinoApp::ExitRun(const bool /*write_si*/, int retcode) frameBuffer->paintBackground(); videoDecoder->ShowPicture(DATADIR "/neutrino/icons/shutdown.jpg"); + delete cHddStat::getInstance(); + delete CRecordManager::getInstance(); + CEpgScan::getInstance()->Stop(); if(g_settings.epg_save /* && timeset && g_Sectionsd->getIsTimeSet ()*/) { g_Sectionsd->setPauseScanning(true); @@ -3650,8 +3679,9 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) puts("[neutrino.cpp] executing " NEUTRINO_ENTER_STANDBY_SCRIPT "."); if (my_system(NEUTRINO_ENTER_STANDBY_SCRIPT) != 0) perror(NEUTRINO_ENTER_STANDBY_SCRIPT " failed"); - - if(!CRecordManager::getInstance()->RecordingStatus()) + bool alive = recordingstatus || CEpgScan::getInstance()->Running() || + CStreamManager::getInstance()->StreamStatus(); + if(!alive) cpuFreq->SetCpuFreq(g_settings.standby_cpufreq * 1000 * 1000); //fan speed @@ -3901,8 +3931,10 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) CMoviePlayerGui::getInstance().exec(NULL, actionKey); if(_mode == NeutrinoMessages::mode_radio ) videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg"); +#if 0 else if (_mode == mode_webtv) tvMode(true); +#endif return menu_return::RETURN_EXIT_ALL; } else if(actionKey=="audioplayer" || actionKey == "inetplayer") { @@ -4064,6 +4096,7 @@ void stop_daemons(bool stopall, bool for_flash) } if (for_flash) { + delete cHddStat::getInstance(); delete CRecordManager::getInstance(); delete videoDemux; int ret = my_system(4, "mount", "-no", "remount,ro", "/"); @@ -4085,6 +4118,7 @@ void sighandler (int signum) switch (signum) { case SIGTERM: case SIGINT: + delete cHddStat::getInstance(); delete CRecordManager::getInstance(); //CNeutrinoApp::getInstance()->saveSetup(NEUTRINO_SETTINGS_FILE); stop_daemons(); diff --git a/src/neutrino.h b/src/neutrino.h index 70c59772a..e34e22f6d 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -74,7 +74,6 @@ public: private: - CPluginsExec pluginsExec; CFrameBuffer * frameBuffer; CConfigFile configfile; diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index c0f7b41a9..c92df1a73 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -125,12 +125,12 @@ void CNeutrinoApp::InitMenu() unsigned int nextShortcut; CMenuWidget &menuSettings = personalize.getWidget(MENU_SETTINGS); nextShortcut = (unsigned int)menuSettings.getNextShortcut(); - menuSettings.integratePlugins(&pluginsExec, CPlugins::I_TYPE_SETTING, nextShortcut); + menuSettings.integratePlugins(CPlugins::I_TYPE_SETTING, nextShortcut); //add I_TYPE_SERVICE plugins CMenuWidget &menuService = personalize.getWidget(MENU_SERVICE); nextShortcut = (unsigned int)menuService.getNextShortcut(); - menuService.integratePlugins(&pluginsExec, CPlugins::I_TYPE_SERVICE, nextShortcut); + menuService.integratePlugins(CPlugins::I_TYPE_SERVICE, nextShortcut); } //init main menu @@ -425,11 +425,9 @@ void CNeutrinoApp::InitMenuSettings() } // lcd - if (CVFD::getInstance()->has_lcd) { - mf = new CMenuForwarder(LOCALE_MAINSETTINGS_LCD, true, NULL, new CVfdSetup()); - mf->setHint(NEUTRINO_ICON_HINT_VFD, LOCALE_MENU_HINT_VFD); - personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_VFD]); - } + mf = new CMenuForwarder(LOCALE_MAINSETTINGS_LCD, true, NULL, new CVfdSetup()); + mf->setHint(NEUTRINO_ICON_HINT_VFD, LOCALE_MENU_HINT_VFD); + personalize.addItem(MENU_SETTINGS, mf, &g_settings.personalize[SNeutrinoSettings::P_MSET_VFD]); // drive settings if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) { diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index 7eae99bb2..6b02df97d 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -735,6 +735,20 @@ Beispiel:
>>>http://dbox/control/zapto?name=Das%20Erste
ok
+
+Parameter: subchannel=<channel_id> (64 bit, hexidecimal value)
+Rueckgabe:
+
+Zappt auf den angegebenen Unterkanal.
+Als Rueckgabe ist im Erfolgsfall ok zu erwarten.
+
+Rueckgabe-Format: ok / error
+
+Beispiel:
+
+>>>http://dbox/control/zapto?subchannel=1008500d4
+ok
+
diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 1a85ba524..7ca7afa6e 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -174,7 +174,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"gettime", &CControlAPI::GetTimeCGI, "text/plain"}, {"info", &CControlAPI::InfoCGI, "text/plain"}, {"version", &CControlAPI::VersionCGI, ""}, - {"reloadsetup", &CControlAPI::ReloadNutrinoSetupfCGI, ""}, + {"reloadsetup", &CControlAPI::ReloadNeutrinoSetupCGI, ""}, {"reloadplugins", &CControlAPI::ReloadPluginsCGI, ""}, #ifdef SCREENSHOT {"screenshot", &CControlAPI::ScreenshotCGI, ""}, @@ -1563,7 +1563,7 @@ void CControlAPI::VersionCGI(CyhookHandler *hh) hh->SendFile("/.version"); } //----------------------------------------------------------------------------- -void CControlAPI::ReloadNutrinoSetupfCGI(CyhookHandler *hh) +void CControlAPI::ReloadNeutrinoSetupCGI(CyhookHandler *hh) { NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::RELOAD_SETUP, CEventServer::INITID_HTTPD); hh->SendOk(); @@ -1657,13 +1657,17 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh) CSectionsdClient::LinkageDescriptorList desc; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; CEitManager::getInstance()->getCurrentNextServiceKey(current_channel, currentNextInfo); - if (CEitManager::getInstance()->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey,desc)) + + if (currentNextInfo.flags & CSectionsdClient::epgflags::current_has_linkagedescriptors && + CEitManager::getInstance()->getLinkageDescriptorsUniqueKey(currentNextInfo.current_uniqueKey, desc)) { + CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(current_channel); + t_satellite_position satellitePosition = channel->getSatellitePosition(); for(unsigned int i=0; i< desc.size(); i++) { t_channel_id sub_channel_id = - CREATE_CHANNEL_ID( - desc[i].serviceId, desc[i].originalNetworkId, desc[i].transportStreamId); + ((uint64_t) ( satellitePosition >= 0 ? satellitePosition : (uint64_t)(0xF000+ abs(satellitePosition))) << 48) | + (uint64_t) CREATE_CHANNEL_ID(desc[i].serviceId, desc[i].originalNetworkId, desc[i].transportStreamId); hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s\n", sub_channel_id, @@ -1671,6 +1675,17 @@ void CControlAPI::ZaptoCGI(CyhookHandler *hh) } } } + else if (!hh->ParamList["subchannel"].empty()) + { + extern CRemoteControl * g_RemoteControl; + if (!g_RemoteControl->subChannels.empty()) + { + NeutrinoAPI->ZapToSubService(hh->ParamList["subchannel"].c_str()); + hh->SendOk(); + } + else + hh->SendError(); + } else if (hh->ParamList["name"] != "") { t_channel_id channel_id; diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.h b/src/nhttpd/tuxboxapi/coolstream/controlapi.h index ce7f7d9a3..4234ba39b 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.h +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.h @@ -65,7 +65,6 @@ private: void ExecCGI(CyhookHandler *hh); void SystemCGI(CyhookHandler *hh); void StandbyCGI(CyhookHandler *hh); - void EsoundCGI(CyhookHandler *hh); void RCCGI(CyhookHandler *hh); void GetDateCGI(CyhookHandler *hh); void GetTimeCGI(CyhookHandler *hh); @@ -83,7 +82,7 @@ private: void GetBouquetsCGI(CyhookHandler *hh); void EpgCGI(CyhookHandler *hh); void VersionCGI(CyhookHandler *hh); - void ReloadNutrinoSetupfCGI(CyhookHandler *hh); + void ReloadNeutrinoSetupCGI(CyhookHandler *hh); void ReloadPluginsCGI(CyhookHandler *hh); void ScreenshotCGI(CyhookHandler *hh); void ZaptoCGI(CyhookHandler *hh); diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp index 9ada60023..d2219e8e7 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp @@ -563,68 +563,109 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *, std::string yresult; static bool init_iso=true; bool idx_as_id=true; - + unsigned int selected_apid = 0; + t_channel_id current_channel_id = 0; + CZapitChannel * channel = NULL; if(para == "apid") idx_as_id=false; + else if(!para.empty() && ("channel="== para.substr(0,8))){ + if (sscanf(para.c_str(), "channel=%llx:audio=%i:", ¤t_channel_id,&selected_apid) == 2) { + if(current_channel_id != 0 && CZapit::getInstance()->GetCurrentChannelID() != current_channel_id){ + channel = CServiceManager::getInstance()->FindChannel(current_channel_id); + } + } + } if(init_iso) { if(_initialize_iso639_map()) init_iso=false; } - bool eit_not_ok=true; - CZapitClient::responseGetPIDs pids; + if (channel){//check audio pid if current_channel != vlc live channel + //wait for channel lock + for (int i = 0; i < 30 && channel->getAudioChannelCount()==0;i++){ + usleep(100000); + } + for (unsigned int i = 0; i < channel->getAudioChannelCount(); i++) { + CZapitAudioChannel::ZapitAudioChannelType atype = channel->getAudioChannel(i)->audioChannelType; + std::string a_desc; + if(!(init_iso)){ + a_desc = _getISO639Description( channel->getAudioChannel(i)->description.c_str() ); + }else{ + a_desc = channel->getAudioChannel(i)->description.c_str(); + } + if (channel->getAudioChannel(i)->audioChannelType == CZapitAudioChannel::EAC3) { + yresult += string_printf("\r\n",i + , (i==selected_apid) ? "selected=\"selected\"" : "" + , a_desc.c_str() + ,"(EAC3)"); + } else { + yresult += string_printf("\r\n",i + , (i==selected_apid) ? "selected=\"selected\"" : "" + ,a_desc.c_str() + ,atype?"(AC3)":" "); + } + } + } + if( yresult.empty()){ + bool eit_not_ok=true; + if(current_channel_id==0) + current_channel_id = CZapit::getInstance()->GetCurrentChannelID(); - CSectionsdClient::ComponentTagList tags; - pids.PIDs.vpid=0; - NeutrinoAPI->Zapit->getPIDS(pids); + CZapitClient::responseGetPIDs pids; + CSectionsdClient::ComponentTagList tags; + pids.PIDs.vpid=0; + NeutrinoAPI->Zapit->getPIDS(pids); - t_channel_id current_channel = CZapit::getInstance()->GetCurrentChannelID(); - CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; - CEitManager::getInstance()->getCurrentNextServiceKey(current_channel, currentNextInfo); - if (CEitManager::getInstance()->getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) - { - for (unsigned int i=0; i< tags.size(); i++) + CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; + CEitManager::getInstance()->getCurrentNextServiceKey(current_channel_id, currentNextInfo); + if (CEitManager::getInstance()->getComponentTagsUniqueKey(currentNextInfo.current_uniqueKey,tags)) { - for (unsigned short j=0; j< pids.APIDs.size(); j++) + unsigned int tag = 0; + for (unsigned int i=0; i< tags.size(); i++) { - if ( pids.APIDs[j].component_tag == tags[i].componentTag ) + for (unsigned short j=0; j< pids.APIDs.size(); j++) { - if(!tags[i].component.empty()) + if ( pids.APIDs[j].component_tag == tags[i].componentTag ) { - if(!(isalnum(tags[i].component[0]))) - tags[i].component=tags[i].component.substr(1,tags[i].component.length()-1); - yresult += string_printf("\r\n",idx_as_id ? j : pids.APIDs[j].pid,tags[i].component.c_str()); - } - else - { - if(!(init_iso)) + if(!tags[i].component.empty()) { - strcpy( pids.APIDs[j].desc, _getISO639Description( pids.APIDs[j].desc ) ); + if(!(isalnum(tags[i].component[0]))) + tags[i].component=tags[i].component.substr(1,tags[i].component.length()-1); + yresult += string_printf("\r\n",idx_as_id ? j : pids.APIDs[j].pid,(tag==selected_apid) ? "selected=\"selected\"" : "",tags[i].component.c_str()); + tag++; } - yresult += string_printf("\r\n",idx_as_id ? j : pids.APIDs[j].pid,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)" : " "); + else + { + if(!(init_iso)) + { + strcpy( pids.APIDs[j].desc, _getISO639Description( pids.APIDs[j].desc ) ); + } + 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)" : " "); + } + eit_not_ok=false; + break; } - eit_not_ok=false; - break; } } } - } - if(eit_not_ok) - { - unsigned short i = 0; - for (CZapitClient::APIDList::iterator it = pids.APIDs.begin(); it!=pids.APIDs.end(); ++it) + if(eit_not_ok) { - if(!(init_iso)) + unsigned short i = 0; + for (CZapitClient::APIDList::iterator it = pids.APIDs.begin(); it!=pids.APIDs.end(); ++it) { - strcpy( pids.APIDs[i].desc, _getISO639Description( pids.APIDs[i].desc ) ); + if(!(init_iso)) + { + strcpy( pids.APIDs[i].desc, _getISO639Description( pids.APIDs[i].desc ) ); + } + yresult += string_printf("\r\n", + idx_as_id ? i : it->pid, (i==selected_apid) ? "selected=\"selected\"" : "",pids.APIDs[i].desc, + pids.APIDs[i].is_ac3 ? " (AC3)": pids.APIDs[i].is_aac ? "(AAC)" : pids.APIDs[i].is_eac3 ? "(EAC3)" : " "); + i++; } - yresult += string_printf("\r\n",idx_as_id ? i : it->pid,pids.APIDs[i].desc,pids.APIDs[i].is_ac3 ? " (AC3)": pids.APIDs[i].is_aac ? "(AAC)" : pids.APIDs[i].is_eac3 ? "(EAC3)" : " "); - i++; } + if(pids.APIDs.empty()) + yresult = "00000"; // shouldnt happen, but print at least one apid } - - if(pids.APIDs.empty()) - yresult = "00000"; // shouldnt happen, but print at least one apid return yresult; } diff --git a/src/nhttpd/web/Y_Baselib.js b/src/nhttpd/web/Y_Baselib.js index 79402b8b9..a9c208648 100644 --- a/src/nhttpd/web/Y_Baselib.js +++ b/src/nhttpd/web/Y_Baselib.js @@ -373,6 +373,9 @@ function bt_set_value(_bt_name, _text) } /*dbox*/ /*expermental*/ +function reload_neutrino_conf() { + loadSyncURL("/control/reloadsetup"); +} function dbox_rcsim(_key){ loadSyncURL("/control/rcem?" + _key); } diff --git a/src/nhttpd/web/Y_Blocks.txt b/src/nhttpd/web/Y_Blocks.txt index 5f216f7ab..12c71185c 100644 --- a/src/nhttpd/web/Y_Blocks.txt +++ b/src/nhttpd/web/Y_Blocks.txt @@ -122,7 +122,6 @@ start-block~personalize_save_settings {=ini-set:/var/tuxbox/config/neutrino.conf;personalize_games;{=p_games=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;personalize_audioplayer;{=p_audioplayer=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;personalize_inetradio;{=p_inetradio=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;personalize_esound;{=p_esound=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;personalize_movieplayer;{=p_movieplayer=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;personalize_pictureviewer;{=p_picviewer=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;personalize_pincode;{=p_pincode=}~cache=} diff --git a/src/nhttpd/web/Y_Live.js b/src/nhttpd/web/Y_Live.js index 77ae189d3..7b9144088 100644 --- a/src/nhttpd/web/Y_Live.js +++ b/src/nhttpd/web/Y_Live.js @@ -329,7 +329,7 @@ function doChangeAudioPid(){ window.setTimeout("change_channel_play()",100); } function build_audio_pid_list(){ - var audio_pids_url = "/y/cgi?execute=func:get_audio_pids_as_dropdown"; + var audio_pids_url = "/y/cgi?execute=func:get_audio_pids_as_dropdown%20channel="+current_channel+":audio="+AudioChannel+":"; var audio_pid_list = loadSyncURL(audio_pids_url); audio_pid_list = "PIN - Esound Soundserver - - nicht sichtbar  - sichtbar  - PIN - - Movieplayer nicht sichtbar  diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index d4a791c43..1dd7f9347 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.8.0.62 -date=27.06.2014 +version=2.8.0.67 +date=05.12.2014 type=Release info=Port CST diff --git a/src/nhttpd/web/Y_neutrino_Blocks.txt b/src/nhttpd/web/Y_neutrino_Blocks.txt index 1ef19390f..685609fa2 100644 --- a/src/nhttpd/web/Y_neutrino_Blocks.txt +++ b/src/nhttpd/web/Y_neutrino_Blocks.txt @@ -30,6 +30,15 @@ start-block~neutrino_form_helpbox end-block~neutrino_form_helpbox +# ------- Neutrino form submit buttons +start-block~neutrino_form_submit + +   + +   + {=L:help=} +end-block~neutrino_form_submit + # ------- Neutrino form-data: record ------------------------------- start-block~neutrino_form-data_record
@@ -139,9 +148,7 @@ start-block~neutrino_form-data_record - -   -  {=L:help=} + {=include-block:Y_neutrino_Blocks.txt;neutrino_form_submit;nothing=}
@@ -225,9 +232,7 @@ start-block~neutrino_form-data_movieplayer - -   -  {=L:help=} + {=include-block:Y_neutrino_Blocks.txt;neutrino_form_submit;nothing=} @@ -252,7 +257,6 @@ end-block~neutrino_form-data_movieplayer # ------- yWeb save Settings start-block~neutrino_movieplayer_save_settings {=ini-set:/var/tuxbox/config/neutrino.conf;network_nfs_moviedir;{=network_nfs_moviedir=}=} - end-block~neutrino_movieplayer_save_settings @@ -293,9 +297,7 @@ start-block~neutrino_form-data_parental - -   -  {=L:help=} + {=include-block:Y_neutrino_Blocks.txt;neutrino_form_submit;nothing=} @@ -334,6 +336,140 @@ start-block~neutrino_parental_save_settings {=ini-set:/var/tuxbox/config/neutrino.conf;parentallock_pincode;{=parentallock_pincode=}~save=} end-block~neutrino_parental_save_settings +# ------- Neutrino form-data: EPG ------------------------------- +start-block~neutrino_form-data_epg +
+
+ {=var-set:help_url=Help-Settings-EPG=}{=var-set:menu={=L:set.menue.epg=}=}{=include-block:Y_Blocks.txt;work_menu=}
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{=L:miscsettings.epg_head=}
{=L:miscsettings.epg_save=} + {=L:off=}  + {=L:on=} +
{=L:miscsettings.epg_save_standby=} + {=L:off=}  + {=L:on=} +
{=L:miscsettings.epg_save_frequently=} + {=L:off=}  + {=L:on=} +
{=L:miscsettings.epg_read=} + {=L:off=}  + {=L:on=} +
{=L:miscsettings.epg_dir=} e.g. /media/sda1/epg/

{=L:miscsettings.epg_cache=}
{=L:miscsettings.epg_extendedcache=}
{=L:miscsettings.epg_old_events=}
{=L:miscsettings.epg_max_events=}

{=L:miscsettings.epg_scan=} + +
{=L:miscsettings.epg_scan_bouquets=} + +
+
+ + + + {=include-block:Y_neutrino_Blocks.txt;neutrino_form_submit;nothing=} +
+
+
+ +end-block~neutrino_form-data_epg + +# ------- yWeb save EPG +start-block~neutrino_epg_save_settings +{=ini-set:/var/tuxbox/config/neutrino.conf;epg_save;{=epg_save=}~open=} +{=ini-set:/var/tuxbox/config/neutrino.conf;epg_save_standby;{=epg_save_standby=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;epg_save_frequently;{=epg_save_frequently=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;epg_read;{=epg_read=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;epg_dir;{=epg_dir=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;epg_cache_time;{=epg_cache_time=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;epg_extendedcache_time;{=epg_extendedcache_time=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;epg_max_events;{=epg_max_events=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;epg_old_events;{=epg_old_events=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;epg_scan_mode;{=epg_scan_mode=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;epg_scan;{=epg_scan=}~save=} +end-block~neutrino_epg_save_settings + # ------- Neutrino form-data: diverse ------------------------------- start-block~neutrino_form-data_diverse
@@ -491,29 +627,6 @@ start-block~neutrino_form-data_diverse {=L:on=} - - EPG-Einstellungen - - - EPG-Cache (Tage) - - - - EPG-Langtext (Stunden) - - - - EPG verwerfen nach (Std.) - - - - Max. Events - - - - EPG Verzeichnis -  e.g. /mnt/mmc/epg/ - Zapit (Hinweis: pzapit -kill vorm Speichern ausführen) @@ -586,9 +699,7 @@ start-block~neutrino_form-data_diverse - -   -  {=L:help=} + {=include-block:Y_neutrino_Blocks.txt;neutrino_form_submit;nothing=}
@@ -652,11 +763,6 @@ end-block~neutrino_form-data_diverse start-block~neutrino_diverse_save_settings {=ini-set:/var/tuxbox/config/neutrino.conf;channellist_epgtext_align_right;{=epgtext_align_right=}~open=} {=ini-set:/var/tuxbox/config/neutrino.conf;channellist_extended;{=channellist_extended=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;epg_cache_time;{=epg_cache_time=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;epg_dir;{=epg_dir=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;epg_extendedcache_time;{=epg_extendedcache_time=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;epg_max_events;{=epg_max_events=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;epg_old_events;{=epg_old_events=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;filebrowser_showrights;{=filebrowser_showrights=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;filebrowser_denydirectoryleave;{=filebrowser_denydirectoryleave=}~cache=} {=ini-set:/var/tuxbox/config/neutrino.conf;filesystem_is_utf8;{=filesystem_is_utf8=}~cache=} @@ -683,167 +789,6 @@ start-block~neutrino_diverse_save_settings {=ini-set:/var/tuxbox/config/zapit/zapit.conf;makeRemainingChannelsBouquet;{=bouquet_others=}~save=} end-block~neutrino_diverse_save_settings - -# ------- Neutrino form-data: bootoptions ------------------------------- -start-block~neutrino_form-data_bootoptions -
-
- {=var-set:help_url=Help-Settings-Bootoptionen=}{=var-set:menu=Treiber- und Bootoptionen=}{=include-block:Y_Blocks.txt;work_menu=}
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SPTS-Mode Treiber laden - {=L:off=}  - {=L:on=} -
Infos beim Booten anzeigen - {=L:off=}  - {=L:on=} -
HW-Sections verwenden - {=L:off=}  - {=L:on=} -
AVIA-Watchdog aktivieren - {=L:off=}  - {=L:on=} -
eNX-Watchdog aktivieren - {=L:off=}  - {=L:on=} -
Philips/Sagem FB Workaround - {=L:off=}  - {=L:on=} -
SPTS-Fix AVIA500 - {=L:off=}  - {=L:on=} -
Realtime Clock (RTC) aktivieren - {=L:off=}  - {=L:on=} -
PMT Update verwenden - {=L:off=}  - {=L:on=} -
EXPERT! Boot-Konsole - -
FullDuplex Mode - {=L:off=}  - {=L:on=} -
Diverses
Bootmenü anzeigen - {=L:off=}  - {=L:on=} -
-
- - - - -   -  {=L:help=} -
-
-
- -end-block~neutrino_form-data_bootoptions - -# ------- yWeb save Settings -start-block~neutrino_bootoptions_save_settings -{=ini-set:/var/tuxbox/config/neutrino.conf;misc_spts;{=misc_spts=}=} -{=file-action:/var/etc/.neutrino;{=if-equal:{=bootmenu=}~0~add~delete=}=} -{=file-action:/var/etc/.boot_info;{=if-equal:{=bootinfo=}~1~add~delete=}=} -{=file-action:/var/etc/.hw_sections;{=if-equal:{=hwsections=}~0~add~delete=}=} -{=file-action:/var/etc/.no_watchdog;{=if-equal:{=no_watchdog=}~0~add~delete=}=} -{=file-action:/var/etc/.no_enxwatchdog;{=if-equal:{=no_enxwatchdog=}~0~add~delete=}=} -{=file-action:/var/etc/.philips_rc_patch;{=if-equal:{=philips_rc_patch=}~1~add~delete=}=} -{=file-action:/var/etc/.sptsfix;{=if-equal:{=sptsfix=}~1~add~delete=}=} -{=file-action:/var/etc/.rtc;{=if-equal:{=rtc=}~1~add~delete=}=} -{=file-action:/var/etc/.no_pmt_update;{=if-equal:{=no_pmt_update=}~0~add~delete=}=} -{=ini-set:/var/tuxbox/boot/boot.conf;console;{=console=}=} -{=ini-set:/var/tuxbox/boot/boot.conf;dbox_duplex;{=dbox_duplex=}=} - -#{=file-action:/var/etc/.test;add;moin\nduu=} -end-block~neutrino_bootoptions_save_settings - # ------- Neutrino form-data: pictureviewer ------------------------------- start-block~neutrino_form-data_pictureviewer
@@ -875,9 +820,7 @@ start-block~neutrino_form-data_pictureviewer - -   -  {=L:help=} + {=include-block:Y_neutrino_Blocks.txt;neutrino_form_submit;nothing=}
@@ -905,7 +848,7 @@ end-block~neutrino_form-data_pictureviewer start-block~neutrino_pictureviewer_save_settings {=ini-set:/var/tuxbox/config/neutrino.conf;picviewer_scaling;{=picviewer_scaling=}~open=} {=ini-set:/var/tuxbox/config/neutrino.conf;picviewer_slide_time;{=picviewer_slide_time=}~cache=} -{=ini-set:/var/tuxbox/config/neutrino.conf;network_nfs_picturedir;{=network_nfs_picturedir=}~cache=} +{=ini-set:/var/tuxbox/config/neutrino.conf;network_nfs_picturedir;{=network_nfs_picturedir=}~save=} end-block~neutrino_pictureviewer_save_settings # ------- Neutrino form-data: audioplayer ------------------------------- @@ -980,9 +923,7 @@ start-block~neutrino_form-data_audioplayer - -   -  {=L:help=} + {=include-block:Y_neutrino_Blocks.txt;neutrino_form_submit;nothing=} @@ -1151,9 +1092,7 @@ start-block~neutrino_form-data_direct_recording - -   -  {=L:help=} + {=include-block:Y_neutrino_Blocks.txt;neutrino_form_submit;nothing=} @@ -1207,52 +1146,6 @@ start-block~neutrino_direct_recording_save_settings {=ini-set:/var/tuxbox/config/neutrino.conf;recording_dir_permissions_0;{=recording_dir_permissions_0=}~save=} end-block~neutrino_direct_recording_save_settings -# ------- Neutrino form-data: esound ------------------------------- -start-block~neutrino_form-data_esound -
-
- {=var-set:help_url=Help-Settings-Esound_Soundserver=}{=var-set:menu=Esound Soundserver=}{=include-block:Y_Blocks.txt;work_menu=}
-
-
- - - - - -
Esound Port default: 16001
-
- - - - -   -  {=L:help=} -
-
-
- - -end-block~neutrino_form-data_esound - -# ------- yWeb save Settings -start-block~neutrino_esound_save_settings -{=ini-set:/var/tuxbox/config/neutrino.conf;esound_port;{=esound_port=}=} - -end-block~neutrino_esound_save_settings - # ------- list possible directorys for records start-block~neutrino_list_record_dirs