diff --git a/.gitignore b/.gitignore
index a61a25776..72d815bd9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,5 +37,6 @@ src/nhttpd/web/*.js.gz
src/zapit/src/pzapit
src/zapit/src/udpstreampes
src/drivertool
+src/dt
src/gui/version.h
src/nhttpd/nhttpd.conf
diff --git a/autorun.sh b/autorun.sh
index 52b20488c..d0b799034 100755
--- a/autorun.sh
+++ b/autorun.sh
@@ -1,8 +1,19 @@
-export LD_LIBRARY_PATH=/opt/lib:/opt/usr/lib
-export PATH=${PATH}:/opt/bin:/opt/usr/bin
+export LD_LIBRARY_PATH=/var/lib
+export PATH=${PATH}:/var/bin:/var/plugins
echo "### Starting NEUTRINO ###"
-cd /opt/bin
-./neutrino &
+cd /tmp
+/bin/neutrino > /dev/null 2> /dev/null
+/bin/sync
+/bin/sync
+
+if [ -e /tmp/.reboot ] ; then
+ /bin/dt -t"Rebooting..."
+ /sbin/reboot -f
+else
+ /bin/dt -t"Panic..."
+ sleep 5
+ /sbin/reboot -f
+fi
diff --git a/data/cables.xml b/data/cables.xml
index ce0008bf5..e992a06bc 100644
--- a/data/cables.xml
+++ b/data/cables.xml
@@ -268,8 +268,8 @@
-
-
+
+
@@ -287,22 +287,18 @@
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
@@ -310,6 +306,9 @@
+
+
+
diff --git a/data/encoding.conf b/data/encoding.conf
index 495ae7277..4d524dca8 100644
--- a/data/encoding.conf
+++ b/data/encoding.conf
@@ -35,6 +35,7 @@ cn ISO3166-2
0xc95 0x3 #ASTRA 23.5 12109H skylink
0xc98 0x3 #ASTRA 23.5 12168V skylink*
0xc9a 0x3 #ASTRA 23.5 12207V skylink*
+0xc8b 0x3 ISO6397 # skylink 23.5E 11914 H
#TSID ONID
0x1 0x601 #UPC Cable Hungary
0x2 0x601 #UPC Cable Hungary
diff --git a/data/initial/frontend.conf b/data/initial/frontend.conf
index 1bfe6aaf5..013cef302 100644
--- a/data/initial/frontend.conf
+++ b/data/initial/frontend.conf
@@ -7,6 +7,7 @@ fe0_position_192=192,-1,-1,-1,0,0,9750,10600,11700,0,0,1
fe0_satellites=192
fe0_uni_qrg=0
fe0_uni_scr=-1
+fe0_mode=1
fe1_diseqcRepeats=0
fe1_diseqcType=0
fe1_highVoltage=0
@@ -16,4 +17,4 @@ fe1_position_192=192,-1,-1,-1,0,0,9750,10600,11700,0,0,1
fe1_satellites=192
fe1_uni_qrg=0
fe1_uni_scr=-1
-mode=1
+fe1_mode=0
diff --git a/data/license/slovak.license b/data/license/slovak.license
index 0d481d492..fb94fcc56 100644
--- a/data/license/slovak.license
+++ b/data/license/slovak.license
@@ -1,4 +1,4 @@
-Tento program je slobodný softvér: môžete ho šíriť a upravovať podľa ustanovení Všeobecnej verejnej licencie GNU (GNU General Public License), vydávanej nadáciou Free Software Foundation, a to podľa 2.verzie tejto Licencie.
+Tento program je slobodný softvér: môžete ho šíriť a upravovať podľa ustanovení Všeobecnej verejnej licencie GNU (GNU General Public License), vydávanej nadáciou Free Software Foundation, a to buď podľa 2.verzie tejto Licencie, alebo (podľa vášho uváženia) ktorejkoľvek neskoršej verzie.
Tento program je šírený v nádeji, že bude užitočný, avšak BEZ AKEJKOĽVEK ZÁRUKY. Neposkytujú sa ani odvodené záruky OBCHODOVATEĽNOSTI alebo VHODNOSTI PRE URČITÝ ÚČEL. Ďalšie podrobnosti hľadajte vo Všeobecnej verejnej licencii GNU.
diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale
index e6882d80b..d13fb0953 100644
--- a/data/locale/deutsch.locale
+++ b/data/locale/deutsch.locale
@@ -368,8 +368,11 @@ extra.fec_s2_qpsk_7_8 7/8 S2_QPSK
extra.fec_s2_qpsk_8_9 8/9 S2_QPSK
extra.fec_s2_qpsk_9_10 9/10 S2_QPSK
extra.key_current_transponder Aktuelle Transponder Taste
+extra.key_format_mode Videoformat
extra.key_list_end Listenende
extra.key_list_start Listenanfang
+extra.key_pic_mode Bildschirmformat
+extra.key_pic_size 4:3 Anzeigeverhalten
extra.key_pip_close Stop/Start PiP
extra.key_pip_setup PiP Konfiguration
extra.key_pip_swap Umschalten PiP/live
@@ -417,6 +420,7 @@ extra.update_dir Lokales Update-Verzeichnis
extra.use_gotoxx Benutze gotoXX
extra.volume_digits Lautstärkeanzeige Ziffern
extra.volume_pos Lautstärkeanzeige
+extra.volume_size Höhe der Anzeige
extra.west Westen
extra.zap_cycle Zap nur in Bouquet
extra.zapit_fe_timeout Tuning Timeout (1=10ms)
@@ -485,6 +489,13 @@ flashupdate.menu_apply_settings Settingsübernahme erlauben
flashupdate.msgbox Es wurde folgendes neues File gefunden:\nDatum: %s, %s\nBasisImage: %s\nTyp: %s\n\nWollen Sie diese Version jetzt herunterladen\nund installieren?
flashupdate.msgbox_manual Es wurde ein neues Image gefunden:\nDatum: %s, %s\nBasisImage: %s\nImageTyp: %s\n\nWollen Sie diese Version jetzt installieren?
flashupdate.mtdselector Partitions-Auswahl
+flashupdate.namemode1 Dateiname Settingsfile
+flashupdate.namemode1_default +settings.img
+flashupdate.namemode1_hostname_time ++settings.img
+flashupdate.namemode1_orgname_time ++settings.img
+flashupdate.namemode2 Dateiname Sicherung
+flashupdate.namemode2_default +.img
+flashupdate.namemode2_hostname_time ++.img
flashupdate.new_found Updates verfügbar!
flashupdate.new_notfound Keine Updates verfügbar!
flashupdate.programmingflash programmiere Flash
@@ -498,6 +509,9 @@ flashupdate.proxyserver_sep Proxyserver
flashupdate.proxyusername Benutzername
flashupdate.proxyusername_hint1 Geben Sie den Proxy-Benutzernamen ein
flashupdate.proxyusername_hint2 Ein leerer Eintrag bedeutet keine Authentifizierung
+flashupdate.read_directory_not_exist Das Backupverzeichnis %s \nexistiert nicht!
+flashupdate.read_no_available_space Der maximal verfügbare Platz in %s \nbeträgt %d KB, es werden aber %d KB benötigt.\n \nDer Vorgang wird abgebrochen, wählen sie bitte einen anderen Datenträger!
+flashupdate.read_volume_error Die Größe des Datenträgers %s \nkann nicht ermittelt werden!
flashupdate.readflash ganzes Flashimage auslesen
flashupdate.readflashmtd einzelne Partition auslesen
flashupdate.ready fertig
@@ -654,6 +668,7 @@ keybindingmenu.remotecontrol_hardware_tripledragon Triple Dragon
keybindingmenu.repeatblock Anfangsverzögerung
keybindingmenu.repeatblockgeneric Wiederholungsverzögerung
keybindingmenu.sort Sortierreihenfolge ändern
+keybindingmenu.special_active Sondertasten
keybindingmenu.subchanneldown Unterkanal zurück
keybindingmenu.subchannelup Unterkanal weiter
keybindingmenu.tvradiomode Fernseh-/Radio-Modus
@@ -681,6 +696,8 @@ lcdmenu.statusline Statuszeile
lcdmenu.statusline.both Lautstärke/Fortschritt
lcdmenu.statusline.playtime Sendungsfortschritt
lcdmenu.statusline.volume Lautstärke
+ledcontroler.backlight Hintergrundbeleuchtung Buttons
+ledcontroler.backlight.tv TV Modus
ledcontroler.blink Blinke im Deep-Standby, wenn Timer aktiv
ledcontroler.menu Power Button LEDs
ledcontroler.mode.deepstandby Deep-Standby
@@ -752,6 +769,7 @@ menu.hint_audioplayer_title Aktivieren Sie die Titelsuche (SMS-Stil) in der Play
menu.hint_auto_lang Wählen Sie, ob automatisch ihre bevorzugte Tonspur ausgewählt wird, wenn sie vorhanden ist
menu.hint_auto_subs Automatische Anzeige der Untertitel in Ihrer bevorzugten Sprache
menu.hint_back Zurück zum vorherigen Menü.\nDie Taste 'Menü' schließt alle Menüs
+menu.hint_backlight Konfigurieren Sie die Hintergrundbeleuchtung der Buttons
menu.hint_backup Sichern von Konfigurationen und Kanallisten
menu.hint_bedit Bearbeiten ihrer Favoriten und der Bouquets
menu.hint_bigwindows Kanalliste, EPG-Infos, Audioplayer und einige andere Fenster werden bildschirmfüllend angezeigt
@@ -844,6 +862,7 @@ menu.hint_key_channel_sms Wenn es aktiviert ist, können Sie die Nummern-Tasten
menu.hint_key_channeldown Weisen Sie eine Taste für das Herunterschalten in der Kanalliste zu
menu.hint_key_channellist Konfigurieren Sie die Tastenbelegung für die Kanalliste
menu.hint_key_channelup Weisen Sie eine Taste für das Hochschalten in der Kanalliste zu
+menu.hint_key_format_mode_active Die Taste für das Videoformat deaktivieren/aktivieren
menu.hint_key_hardware Definieren Sie, welche Fernbedienung Sie verwenden möchten. Die Bestätigung erfolgt mit der Ausgewählten
menu.hint_key_history Definieren Sie eine Taste für das Anzeigen der letzten Programme, die Sie schauten
menu.hint_key_lastchannel Definieren Sie eine Taste, die in den vorher eingestellten Kanal zurückschaltet
@@ -866,6 +885,8 @@ menu.hint_key_mptime Weisen Sie eine Taste für die Restzeitanzeige ihrer Aufnah
menu.hint_key_mptimeshift Weisen Sie eine Taste für das Starten von Timeshift zu
menu.hint_key_pagedown Weisen Sie eine Taste für das Herunterblättern zu
menu.hint_key_pageup Weisen Sie eine Taste für das Hochblättern zu
+menu.hint_key_pic_mode_active Die Taste für das Bildschirmformat deaktivieren/aktivieren
+menu.hint_key_pic_size_active Die Taste für das 4:3 Anzeigeverhalten deaktivieren/aktivieren
menu.hint_key_pip_close Tastenzuordnung für Stop PiP oder Start mit aktuellem Kanal
menu.hint_key_pip_setup Tastenzuordnung für PiP Konfiguration
menu.hint_key_pip_swap Tastenzuordnung zum Umschalten PiP und aktuellem Kanal
@@ -877,6 +898,7 @@ menu.hint_key_right Wählen Sie die Funktion für die Tasten 'links' und 'rechts
menu.hint_key_save Speichern Sie Ihre Tastenbelegungen in einer Datei ab
menu.hint_key_screenshot Weisen Sie eine Taste zu, um Menü- und/oder TV-Screenshots zu speichern
menu.hint_key_sort Weisen Sie eine Taste für das Sortieren in der Kanalliste zu
+menu.hint_key_special_active Deaktivieren oder aktivieren einiger Sondertasten
menu.hint_key_subchanneldown Weisen Sie eine Taste für das Zurückschalten in den Unterkanälen zu
menu.hint_key_subchannelup Weisen Sie eine Taste für das Weiterschalten in den Unterkanälen zu
menu.hint_key_transponder Weisen Sie eine Taste für das Anzeigen der Transponder in der Kanalliste zu
@@ -1032,7 +1054,7 @@ menu.hint_scan_manual Manueller Transponder-Suchlauf mit ausgewählten Parameter
menu.hint_scan_mod Wählen Sie eine Transponder-Modulation
menu.hint_scan_motor_18v Benutze 18V für Motorbewegungen
menu.hint_scan_motor_speed Rotor-Bewegungsgeschwindigkeit in 1/10 Grad pro Sekunde
-menu.hint_scan_motorpos Wählen Sie eine gespeicherten Positions-Nummer für diesen Satelliten
+menu.hint_scan_motorpos Wählen Sie eine gespeicherten Positions-Nummer für diesen Satelliten,\nwird ignoriert, wenn USALS aktiv
menu.hint_scan_nid Geben Sie ihre Kabelnetzwerk-ID in dezimal ein
menu.hint_scan_nit Lassen Sie Transponder über gesendete NIT-Daten (Network Information Table) hinzufügen
menu.hint_scan_pids Duchsucht und speichert auch die Audio-, Video- und PMT-PIDs
@@ -1055,8 +1077,8 @@ menu.hint_scan_test Testen Sie das Signal für diesen Transponder
menu.hint_scan_tpselect Wählen Sie einen einzelnen Transponder für den Suchlauf
menu.hint_scan_uncommited Wählen Sie nicht festgeschriebene Angaben für diesen Satelliten
menu.hint_scan_usals_repeat Geben Sie die USALS-Wiederholungen für den Rotor ein
-menu.hint_scan_usalsall Setzen oder entfernen Sie USALS-Merker für alle Satelliten
-menu.hint_scan_useusals Verwenden Sie USALS für diesen Satelitten
+menu.hint_scan_usalsall Verwenden Sie USALS für alle Satelliten an diesem Tuner
+menu.hint_scan_useusals Verwenden Sie USALS für diesen Satelliten,\nwenn aktiv, wird Rotorposition ignoriert
menu.hint_scrambled_message Bei aktivierter Option erscheint eine Meldung, wenn ein verschlüsselter Sender nicht entschlüsselt werden kann
menu.hint_screen_setup Konfigurieren Sie den Bildschirmbereich für die Menüanzeige
menu.hint_screenshot_count Wählen Sie, wie viele Screenshots erstellt werden sollen
@@ -1122,6 +1144,7 @@ menu.hint_video_scart_mode Wählen Sie den Modus des Ausgangssignals für den SC
menu.hint_volume Wählen Sie die Anzeigeoptionen für die Lautstärke
menu.hint_volume_digits Zifferndarstellung der Lautstärkeanzeige ein- oder ausschalten
menu.hint_volume_pos Wählen Sie die Position der Lautstärkeanzeige aus
+menu.hint_volume_size Wählen Sie die Höhe der Lautstärkeanzeige
menu.hint_ytplay Wiedergabe von ausgewählten Youtube Feeds
menu.hint_zap_cycle Wählen Sie, ob nur innerhalb des aktiven Bouquets umgeschaltet werden kann
menu.next Weiter (Menü zum Beenden)
@@ -1216,6 +1239,7 @@ motorcontrol.install_menu Motor Installation
motorcontrol.motor_pos (a) Motorposition:
motorcontrol.movement (b) Bewegung:
motorcontrol.msec Millisekunden
+motorcontrol.network Netzwerk Info
motorcontrol.no_mode keine Sorge (wasn das?)
motorcontrol.notdef nicht benutzt
motorcontrol.override übersteuern
diff --git a/data/locale/english.locale b/data/locale/english.locale
index 0f82ce63f..ab38ddfbd 100644
--- a/data/locale/english.locale
+++ b/data/locale/english.locale
@@ -368,8 +368,11 @@ extra.fec_s2_qpsk_7_8 7/8 s2 qpsk
extra.fec_s2_qpsk_8_9 8/9 s2 qpsk
extra.fec_s2_qpsk_9_10 9/10 s2 qpsk
extra.key_current_transponder Current Transponder Key
+extra.key_format_mode Video format
extra.key_list_end end
extra.key_list_start home
+extra.key_pic_mode Screen format
+extra.key_pic_size 4:3 Display behavior
extra.key_pip_close Stop/Start PiP
extra.key_pip_setup Configure PiP
extra.key_pip_swap Swap PiP/live
@@ -417,6 +420,7 @@ extra.update_dir Local update directory
extra.use_gotoxx Use gotoXX
extra.volume_digits Volumebar digits
extra.volume_pos Volumebar
+extra.volume_size Height of display
extra.west West
extra.zap_cycle Zap cycle
extra.zapit_fe_timeout Tune timeout (1 = 10 msec)
@@ -485,6 +489,13 @@ flashupdate.menu_apply_settings Allow apply settings
flashupdate.msgbox Found the following new file:\nDate: %s, %s\nBaseImage: %s\nType: %s\n\nDo you want to download and install this version now?
flashupdate.msgbox_manual Found the following new image:\nDate: %s, %s\nBaseImage: %s\nImageType: %s\n\nDo you want to install this version now?
flashupdate.mtdselector Partition-Selector
+flashupdate.namemode1 Filename settingsfile
+flashupdate.namemode1_default +settings.img
+flashupdate.namemode1_hostname_time ++settings.img
+flashupdate.namemode1_orgname_time ++settings.img
+flashupdate.namemode2 Filename backup
+flashupdate.namemode2_default +.img
+flashupdate.namemode2_hostname_time ++.img
flashupdate.new_found New image found !
flashupdate.new_notfound No new images found
flashupdate.programmingflash programming flash
@@ -498,6 +509,9 @@ flashupdate.proxyserver_sep Proxyserver
flashupdate.proxyusername Username
flashupdate.proxyusername_hint1 enter the proxyserver username
flashupdate.proxyusername_hint2 a empty entry means no proxy-auth
+flashupdate.read_directory_not_exist The backup directory %s \ndoes not exist!
+flashupdate.read_no_available_space The maximum available space in %s \nis %d KB, but there are %d KB required.\n \nThe operation is canceled, please choose another medium!
+flashupdate.read_volume_error The size of the volume %s \ncan not be determined!
flashupdate.readflash Read whole image
flashupdate.readflashmtd Read one partition
flashupdate.ready ready
@@ -654,6 +668,7 @@ keybindingmenu.remotecontrol_hardware_tripledragon Triple Dragon
keybindingmenu.repeatblock generic delay
keybindingmenu.repeatblockgeneric repeat delay
keybindingmenu.sort change sort order
+keybindingmenu.special_active Special Keys
keybindingmenu.subchanneldown subchannel down
keybindingmenu.subchannelup subchannel up
keybindingmenu.tvradiomode TV/Radio-mode
@@ -681,6 +696,8 @@ lcdmenu.statusline status line
lcdmenu.statusline.both volume / playtime
lcdmenu.statusline.playtime playtime
lcdmenu.statusline.volume volume
+ledcontroler.backlight Buttons backlight
+ledcontroler.backlight.tv TV mode
ledcontroler.blink Blink in deep standby, if timer set
ledcontroler.menu Power Button LEDs
ledcontroler.mode.deepstandby Deep Standby
@@ -752,6 +769,7 @@ menu.hint_audioplayer_title Enable SMS-style title search in playlist
menu.hint_auto_lang Auto-switch audio to preferred language
menu.hint_auto_subs Auto-start subtitles for preferred language
menu.hint_back Return to previous menu\nPress menu key to close all menus
+menu.hint_backlight Configure buttons backlight
menu.hint_backup Backup configs and channels to selected dir
menu.hint_bedit Edit favorites and bouquets
menu.hint_bigwindows Channellist, EPG-infos, audioplayer and some other windows are displayed full screen
@@ -844,6 +862,7 @@ menu.hint_key_channel_sms If enabled, numeric buttons in channel list\nused to s
menu.hint_key_channeldown Assign button for fast switch to previous\nchannel in channel list
menu.hint_key_channellist Configure keybingdings for channel list
menu.hint_key_channelup Assign button for fast switch to next\nchannel in channel list
+menu.hint_key_format_mode_active Disable/enable key for the video format conversion
menu.hint_key_hardware Change remote control type
menu.hint_key_history Assign button to show channel\nchannel switch history
menu.hint_key_lastchannel Assign button for fast zap to\nprevious channel in history
@@ -866,6 +885,8 @@ menu.hint_key_mptime Assign button to show play time\nleft time
menu.hint_key_mptimeshift Assign button to start timeshift
menu.hint_key_pagedown Assign button to show next items page
menu.hint_key_pageup Assign button to show previous items page
+menu.hint_key_pic_mode_active Disable/enable key for the screen format
+menu.hint_key_pic_size_active Disable/enable key for the 4:3 display behavior
menu.hint_key_pip_close Assign button to stop PiP\nor start it for current channel
menu.hint_key_pip_setup Assign button to configure PiP
menu.hint_key_pip_swap Assign button to swap PiP and live channel
@@ -877,6 +898,7 @@ menu.hint_key_right Select 'right' function in live TV/Radio mode
menu.hint_key_save Save keybindings to file
menu.hint_key_screenshot Assign button to save GUI and/or TV screenshot
menu.hint_key_sort Assign button to change channel list sort order
+menu.hint_key_special_active Disable or enable some special keys
menu.hint_key_subchanneldown Assign button for fast switch\n to previous subchannel
menu.hint_key_subchannelup Assign button for fast switch\n to next subchannel
menu.hint_key_transponder Assign button to show channel list\nfor current transponder
@@ -1032,7 +1054,7 @@ menu.hint_scan_manual Manual transponder scan using\nselected parameters
menu.hint_scan_mod Select transponder modulation
menu.hint_scan_motor_18v Use 18V when moving rotor
menu.hint_scan_motor_speed Rotor moving speed in 1/10 degree\nper second
-menu.hint_scan_motorpos Select stored position number for\nthis satellite
+menu.hint_scan_motorpos Select stored position number for this satellite,\nignored, if USALS enabled
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
@@ -1055,8 +1077,8 @@ menu.hint_scan_test Test signal for this transponder
menu.hint_scan_tpselect Select transponder to scan
menu.hint_scan_uncommited Select uncommited input for\nthis satellite
menu.hint_scan_usals_repeat Repeat usals move rotor commands\nif you expirience unstable rotor move
-menu.hint_scan_usalsall Set/unset usals flag for all satellites
-menu.hint_scan_useusals Use USALS for\nthis satellite
+menu.hint_scan_usalsall Use USALS for all satellites on this frontend
+menu.hint_scan_useusals Use USALS for this satellite,\nif ON, rotor position ignored
menu.hint_scrambled_message Show scrambled message, when channel cannot be decoded
menu.hint_screen_setup Configure screen margins
menu.hint_screenshot_count When no GUI on screen, you can save 1-5\nscreenshot serie
@@ -1122,6 +1144,7 @@ menu.hint_video_scart_mode Select analog output mode for SCART connectors
menu.hint_volume Configure Volume GUI options
menu.hint_volume_digits Numeric display of the volumebar on/off
menu.hint_volume_pos Select volume indicator position
+menu.hint_volume_size Select volume indicator height
menu.hint_ytplay Play selected youtube feeds
menu.hint_zap_cycle When swithing channels, stay in current bouquet
menu.next Next (press Menu to quit)
@@ -1216,6 +1239,7 @@ motorcontrol.install_menu Install menu
motorcontrol.motor_pos (a) Motor Position:
motorcontrol.movement (b) Movement:
motorcontrol.msec milliseconds
+motorcontrol.network Network info
motorcontrol.no_mode don't care
motorcontrol.notdef Not used
motorcontrol.override Override position used for
@@ -1398,7 +1422,7 @@ movieplayer.tshelp7 skip approx. 1 minute
movieplayer.tshelp8 approx. 5 minutes back
movieplayer.tshelp9 skip approx. 5 minutes
movieplayer.tsplayback Play TS
-movieplayer.ytplayback Youtube feeds playback
+movieplayer.ytplayback Youtube videoplayer
mpkey.audio Audio track
mpkey.bookmark save bookmark
mpkey.forward Forward
@@ -1479,7 +1503,7 @@ options.on.without_messages Without msg
options.serial serial
parentallock.bouquetmode Bouquets are default
parentallock.changepin change PIN code
-parentallock.changepin_hint1 Enter your new youth protection pin code here!
+parentallock.changepin_hint1 Enter your new parental lock pin code here!
parentallock.changetolocked on locked bouquets
parentallock.defaultlocked locked
parentallock.defaultunlocked unlocked
@@ -1492,7 +1516,7 @@ parentallock.lockedchannel Locked sender...
parentallock.lockedprogram Locked program (from %d years up)
parentallock.never never
parentallock.onsignal on broadcasted lock
-parentallock.parentallock Youth protection
+parentallock.parentallock Parental lock
parentallock.prompt prompt for PIN
personalize.access Access options
personalize.apply_settings Apply changes?
@@ -1511,7 +1535,7 @@ personalize.help_line3 can be set to visible, not visible, activate, deactivate
personalize.help_line4 or PIN-protected.
personalize.help_line5 The access to personalization can be protected
personalize.help_line6 with PIN. The PIN is identical for all protected menus
-personalize.help_line7 (not for youth protection).
+personalize.help_line7 (not for parental lock).
personalize.help_line8 Default PIN is: 0000
personalize.menuconfiguration Menu Configuration
personalize.menudisabledhint The requested menu is currently disabled!\nFor activation please open menu 'Personalize'\nto find in menu 'Settings'!
@@ -1604,7 +1628,7 @@ recordingmenu.record_is_running Record is running!
recordingmenu.save_in_channeldir Save in channel dir
recordingmenu.server server
recordingmenu.server_mac MAC address
-recordingmenu.setupnow activate changes
+recordingmenu.setupnow Activate changes
recordingmenu.slow_warn Enable slow record warning
recordingmenu.timeshift Timeshift
recordingmenu.tsdir Timeshift directory
diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale
index d0690fe41..6f90a4ca9 100644
--- a/data/locale/nederlands.locale
+++ b/data/locale/nederlands.locale
@@ -9,13 +9,13 @@ EPGPlus.bybouquet_mode Per favorietenlijst
EPGPlus.bypage_mode Per pagina
EPGPlus.head Programmagids overzicht (EPG Plus)
EPGPlus.next_bouquet Volgende favorietenlijst
-EPGPlus.options opties
+EPGPlus.options Opties
EPGPlus.page_down Pagina omlaag
EPGPlus.page_up Pagina omhoog
EPGPlus.prev_bouquet Vorige favorietenlijst
EPGPlus.record Opnemen
EPGPlus.refresh_epg Herlaad EPG
-EPGPlus.remind Plannen
+EPGPlus.remind Zap reservering
EPGPlus.scroll_mode Scroll modus
EPGPlus.select_font_name Lettertype naam
EPGPlus.stretch_mode Uitgestrekte modus
@@ -116,7 +116,7 @@ audiomenu.avs avs
audiomenu.avsync A/V synchronisatie
audiomenu.avsync_am Audio master
audiomenu.clockrec
-audiomenu.dolbydigital Dolby Digital
+audiomenu.dolbydigital Automatisch Dolby Digital gebruiken indien aanwezig
audiomenu.hdmi_dd Encoded Dolby Digital via HDMI
audiomenu.hdmi_dd_auto Automatisch
audiomenu.hdmi_dd_force Forceer
@@ -240,6 +240,7 @@ channellist.sats Satellieten
channellist.since sinds
channellist.start start tijd
ci.clock CI kloksnelheid (Mhz)
+ci.ignore_msg Negeer CA berichten
ci.empty Geen CAM geplaatst
ci.init_failed Initialisatie CAM mislukt
ci.init_ok Initialisatie CAM compleet
@@ -327,7 +328,7 @@ eventfinder.search_within_epg Zoeken in
eventfinder.search_within_list Zoeken in
eventfinder.searching Zoek naar trefwoord in EPG...
eventfinder.start_search Zoeken starten
-eventlistbar.channelswitch Omschakelen
+eventlistbar.channelswitch Zap reservering
eventlistbar.eventsort Sorteren
eventlistbar.recordevent Opnemen
extra.add_to_bouquet Toevoegen aan favorietenlijst
@@ -670,9 +671,10 @@ keychoosermenu.setnone Geen toets
languagesetup.head Taal / Tijdzone
languagesetup.osd OSD taal
languagesetup.select OSD taal
-lcd_info_line show in infoline
+lcd_info_line Weergave in display
lcd_info_line_channel kanaalnaam
lcd_info_line_clock klok
+reset_removed Gewiste kanalen definitief verwijderen
lcdcontroler.brightness Normale helderheid
lcdcontroler.brightnessdeepstandby Deep Standby helderheid
lcdcontroler.brightnessstandby Standby Helderheid
@@ -685,7 +687,7 @@ lcdmenu.statusline.both volume / afspeelduur
lcdmenu.statusline.playtime afspeelduur
lcdmenu.statusline.volume volume
ledcontroler.blink Knipper in deepstandby indien een timer actief is.
-ledcontroler.menu Aan/uit knop LEDs
+ledcontroler.menu LED eigenschappen
ledcontroler.mode.deepstandby Deep Standby
ledcontroler.mode.record Knipper tijdens het opnemen
ledcontroler.mode.standby Stand-by
@@ -699,20 +701,20 @@ mainmenu.clearsectionsd EPG geheugen opschonen
mainmenu.games Spelletjes
mainmenu.head Hoofdmenu
mainmenu.media Media
-mainmenu.movieplayer Movie-player
+mainmenu.movieplayer Videospeler
mainmenu.pausesectionsd Lees EPG
mainmenu.pictureviewer Afbeeldingen
-mainmenu.radiomode Radio-Mode
+mainmenu.radiomode Radio mode
mainmenu.reboot Herstart systeem
mainmenu.recording Opnemen
mainmenu.recording_start Start
-mainmenu.recording_stop Stop
+mainmenu.recording_stop Stopt
mainmenu.scripts Scripts
-mainmenu.service Onderhoud
-mainmenu.settings Instellingen
+mainmenu.service Installatie
+mainmenu.settings Systeem Instellingen
mainmenu.shutdown Uitschakelen
mainmenu.sleeptimer Slaaptimer
-mainmenu.tvmode TV-Mode
+mainmenu.tvmode TV mode
mainmenu.tvradio_switch TV-Radio Schakelaar
mainsettings.audio Audio
mainsettings.colors Kleur / thema / font
@@ -730,7 +732,8 @@ mainsettings.savesettingsnow_hint Instellingen opslaan,\nmoment geduld...
mainsettings.timezone Tijdzone
mainsettings.video Video
menu.back Terug
-menu.cancel Annuleer
+menu.cancel Annuleer
+menu.hint_ytplay Video's afspelen van de populaire video website Youtube
menu.hint_a_pic Configureer audiospeler en afbeeldingen
menu.hint_aplay Audiospeler
menu.hint_audio Audio output, DD\nSRS True volume opties
@@ -853,7 +856,7 @@ menu.hint_key_load Laad sneltoetsen backup
menu.hint_key_modechange Wijzig TV/Radio mode en standby toetsen
menu.hint_key_movieplayer Configureer sneltoetsen voor de Movie-Player
menu.hint_key_mpaudio Knop toewijzen voor de weergave van audio selectie\ntijdens het afspelen van een opname.
-menu.hint_key_mpbookmark Knop toewijzen om een bladwijzer te plaatsen in een opname tijdens het afspelen hiervan.
+menu.hint_key_mpbookmark Knop toewijzen om een markeerpunt te plaatsen in een opname tijdens het afspelen hiervan.
menu.hint_key_mppause Knop toewijzen om het afspelen van een opname te pauzeren
menu.hint_key_mpplay Knop toewijzen om het afspelen van een opname te hervatten
menu.hint_key_mpplugin Knop toewijzen om tijdens het afspelen van een opname \neen geselecteerde plugin te starten.
@@ -1207,14 +1210,14 @@ motorcontrol.timed_mode Timed Stap Modus
motorcontrol.user_menu Gebruikersmenu
motorcontrol.west_limit West limiet instellen
moviebrowser.ask_rec_to_delete Het verwijderen van deze film stopt de huidige opname!\n[%s]\nWilt u toch verder gaan?
-moviebrowser.book_add Bladwijzer toevoegen
-moviebrowser.book_clear_all Alle bladwijzers verwijderen
-moviebrowser.book_head Bladwijzers
-moviebrowser.book_lastmoviestop Last play stop:
+moviebrowser.book_add Markeerpunt toevoegen
+moviebrowser.book_clear_all Alle markeerpunten verwijderen
+moviebrowser.book_head Markeerpunten
+moviebrowser.book_lastmoviestop Hervatten vanaf laatste afspeelstop
moviebrowser.book_movieend Einde film:
moviebrowser.book_moviestart Start film:
-moviebrowser.book_name Naam bladwijzer:
-moviebrowser.book_new Nieuwe bladwijzer
+moviebrowser.book_name Naam markeerpunt:
+moviebrowser.book_new Nieuw markeerpunt
moviebrowser.book_position Positie:
moviebrowser.book_type Spring (<0 terug , >0 voor):
moviebrowser.book_type_backward Herhaal
@@ -1227,8 +1230,8 @@ moviebrowser.browser_row_width Kolom breedte [%]
moviebrowser.delete_info Bestanden verwijderen, een moment geduld...
moviebrowser.dir Pad
moviebrowser.dir_head extra paden
-moviebrowser.edit_book Bookmark Wijzig
-moviebrowser.edit_book_name_info1 Geef nieuwe bookmark naam
+moviebrowser.edit_book Markeerpunt wijzigen
+moviebrowser.edit_book_name_info1 Geef markeerpunt een nieuwe naam
moviebrowser.edit_book_name_info2
moviebrowser.edit_book_pos_info1 Geef nieuwe eindpositie (s)
moviebrowser.edit_book_pos_info2
@@ -1239,7 +1242,7 @@ moviebrowser.error_no_movies geen films gevonden
moviebrowser.foot_filter Filter:
moviebrowser.foot_play Start film
moviebrowser.foot_sort Sorteer:
-moviebrowser.head TS Film browser
+moviebrowser.head Opnames afspelen
moviebrowser.head_filter Filter flims per categorie:
moviebrowser.head_playlist Laatst afgespeeld:
moviebrowser.head_recordlist Laatst opgenomen:
@@ -1254,7 +1257,7 @@ moviebrowser.info_channel Kanaal
moviebrowser.info_filename Naam
moviebrowser.info_genre_major Genre
moviebrowser.info_genre_minor Genre
-moviebrowser.info_head Film informatie
+moviebrowser.info_head Movie Editor
moviebrowser.info_head_update Wijzigingen opslaan in alle video informatie bestanden
moviebrowser.info_info1 Info 1
moviebrowser.info_info2 Info 2
@@ -1266,11 +1269,11 @@ moviebrowser.info_parental_lockage_16year 16 jaar
moviebrowser.info_parental_lockage_18year 18 jaar
moviebrowser.info_parental_lockage_6year 6 jaar
moviebrowser.info_parental_lockage_always nooit
-moviebrowser.info_path Path
+moviebrowser.info_path Opslag directory
moviebrowser.info_prevplaydate Laatst afgespleeld op
-moviebrowser.info_prodcountry LAnd
+moviebrowser.info_prodcountry Land
moviebrowser.info_prodyear Jaar
-moviebrowser.info_quality Qualiteit
+moviebrowser.info_quality Kwaliteit
moviebrowser.info_recorddate Datum van opname
moviebrowser.info_serie Serie
moviebrowser.info_size Bestandsgrootte in (MB)
@@ -1281,7 +1284,7 @@ moviebrowser.last_record_max_items Aantal lijnen laatste opname
moviebrowser.load_default Laad standaard instellingen
moviebrowser.menu_directories_head Directory's
moviebrowser.menu_help_head Help
-moviebrowser.menu_main_bookmarks Bladwijzers
+moviebrowser.menu_main_bookmarks Markeerpunten
moviebrowser.menu_main_head Instellingen
moviebrowser.menu_main_movieinfo Film info
moviebrowser.menu_main_saveandback Opslaan en terug
@@ -1322,34 +1325,54 @@ moviebrowser.short_serie Serie
moviebrowser.short_size MB
moviebrowser.short_title Titel
moviebrowser.start_head Start film vanaf:
-moviebrowser.start_record_start Film start
+moviebrowser.start_record_start Afspelen vanaf het begin
moviebrowser.update_if_dest_empty_only Kopieer indien doelbestemming leeg is
moviebrowser.use_dir Gebruik directory
moviebrowser.use_movie_dir Gebruik film directory
moviebrowser.use_rec_dir Gebruik opname directory
-movieplayer.bookmark Bladwijzers
-movieplayer.bookmarkname Bladwijzer naam
-movieplayer.bookmarkname_hint1 Naam invoeren voor uw bladwijzer
+moviebrowser.foot_focus Schakel venster
+moviebrowser.foot_refresh Lijst herladen
+moviebrowser.yt_error Laden van youtube video mislukt
+moviebrowser.yt_max_results Maximaal aantal resultaten
+moviebrowser.yt_most_discussed Meest besproken
+moviebrowser.yt_most_popular Meest populair
+moviebrowser.yt_most_resent Meest recent
+moviebrowser.yt_most_responded Meeste reacties
+moviebrowser.yt_most_shared Meest gedeeld
+moviebrowser.yt_next_results Volgende zoekresultaten
+moviebrowser.yt_on_the_web Trending video's
+moviebrowser.yt_prev_results Vorige zoekresultaten
+moviebrowser.yt_recently_featured Recent aanbevolen
+moviebrowser.yt_region Regio
+moviebrowser.yt_related Gerelateerde video's
+moviebrowser.yt_search Trefwoord
+moviebrowser.yt_top_favorites Top favorieten
+moviebrowser.yt_top_rated Meest gewaardeerd
+moviebrowser.foot_options Opties
+movieplayer.bookmark Markeerpunten
+movieplayer.bookmarkname Naam markeerpunt
+movieplayer.bookmarkname_hint1 Naam invoeren voor uw markeerpunt
movieplayer.bookmarkname_hint2
movieplayer.defplugin Start-Plugin
-movieplayer.fileplayback Bestand afspelen
-movieplayer.head Movieplayer
-movieplayer.toomanybookmarks Er zijn te veel bladwijzers.\n Verwijder eerst een bladwijzer.
+movieplayer.fileplayback Video afspelen
+movieplayer.head Videospeler
+movieplayer.toomanybookmarks Er zijn te veel markeerpunten.\n Verwijder eerst een markeerpunt.
movieplayer.tshelp1 Stop
movieplayer.tshelp10 Ongeveer 10 minuten terug
movieplayer.tshelp11 Ongeveer 10 minuten overslaan
movieplayer.tshelp12 Help: http://www.giggo.de/dbox2/movieplayer.html\n
movieplayer.tshelp2 Selecteer audio track
movieplayer.tshelp3 Pause/Voortzetten
-movieplayer.tshelp4 Creëer bladwijzer
+movieplayer.tshelp4 Creëer markeerpunt
movieplayer.tshelp5 Voortgang weergeven
movieplayer.tshelp6 Ongeveer 1 minuut terug
movieplayer.tshelp7 Ongeveer 1 minuut overslaan
movieplayer.tshelp8 Ongeveer 5 minuten terug
movieplayer.tshelp9 Ongeveer 5 minuten overslaan
-movieplayer.tsplayback TS Afspelen
+movieplayer.tsplayback Opname afspelen
+movieplayer.ytplayback Youtube video's
mpkey.audio Audio track
-mpkey.bookmark Bladwijzer opslaan
+mpkey.bookmark Markeerpunt opslaan
mpkey.forward Vooruit
mpkey.pause Pause
mpkey.play Afspelen
@@ -1426,6 +1449,9 @@ options.on Aan
options.on.without_messages Zonder bericht
options.serial serial
parentallock.changepin verander PIN code
+parentallock.bouquetmode Favorieten lijsten zijn standaard:
+parentallock.defaultlocked Beveiligd met een PIN code
+parentallock.defaultunlocked Onbeveiligd
parentallock.changepin_hint1 Geef de nieuwe jeugd-bescherm pin code hier in!
parentallock.changetolocked bij vergrendelde zenderlijsten
parentallock.head Geef Lock PIN code in
@@ -1448,7 +1474,7 @@ personalize.button_red rood
personalize.button_yellow geel
personalize.disabled Uitgeschakeld
personalize.enabled Ingeschakeld
-personalize.head Persoonlijke voorkeuren
+personalize.head Menu configuratie
personalize.help Help
personalize.help_line1 In het persoonlijke voorkeuren menu is het mogelijk
personalize.help_line2 om de meest belangrijke menu's naar uw wens in te stellen.
@@ -1463,14 +1489,14 @@ personalize.menudisabledhint Het opgevraagde menu is momenteel uitgeschakeld!\nO
personalize.notprotected Nee
personalize.notvisible Onzichtbaar
personalize.pin PIN
-personalize.pin_in_use PIN access for personalize setup
-personalize.pincode Personalization PIN
-personalize.pinhint Enter the Personalization PIN Code
+personalize.pin_in_use Geselecteerde menu's beveiligen met een PIN code
+personalize.pincode Vereiste pincode voor beveiligde menu's
+personalize.pinhint Voer de gewenste pincode in voor menu configuratie
personalize.pinprotect Ja
personalize.pinstatus PIN vereist
personalize.plugins Plugins
-personalize.usermenu_preferred_buttons Assigning of preferred keys
-personalize.usermenu_show_cancel Show "Cancel"-Button
+personalize.usermenu_preferred_buttons Gewenste toetsen toewijzen.
+personalize.usermenu_show_cancel Annuleer toets weergeven
personalize.visible Zichtbaar
pictureviewer.defdir start dir.
pictureviewer.head Afbeeldingen
@@ -1579,16 +1605,28 @@ satsetup.fastscan_hd Enkel HD
satsetup.fastscan_head Fastscan
satsetup.fastscan_prov Provider
satsetup.fastscan_prov_cd CanalDigitaal
-satsetup.fastscan_prov_telesat TéléSAT
+satsetup.fastscan_prov_telesat TéléSAT
satsetup.fastscan_prov_tvv TV Vlaanderen
satsetup.fastscan_sd Enkel SD
satsetup.fastscan_type Scantype
satsetup.fe_mode Tuner modus
satsetup.fe_mode_alone Onafhankelijk
-satsetup.fe_mode_loop Doorlussen
+
+
+satsetup.fe_mode Tuner mode
+satsetup.fe_mode_independent Onafhankelijk
+satsetup.fe_mode_link_loop Doorgelust
+satsetup.fe_mode_link_twin Twin
+satsetup.fe_mode_master Master
+satsetup.fe_mode_unused Ongebruikt
+
+
+satsetup.fe_mode_loop Doorgelust
satsetup.fe_mode_single Single
satsetup.fe_mode_twin Twin
satsetup.fe_setup Tuner instellen
+
+
satsetup.lofh LNB High Offset
satsetup.lofl LNB Low Offset
satsetup.lofs LNB switch Offset
@@ -1623,12 +1661,12 @@ scants.abort_body Wilt u het scannen onderbreken?
scants.abort_header Scan wordt afgebroken
scants.actcable Kabel:
scants.actsatellite Satelliet:
-scants.bouquet Bouquet
+scants.bouquet Favorietenlijsten
scants.bouquet_create creëer nieuw
scants.bouquet_erase wis alles
-scants.bouquet_leave niet veranderen
+scants.bouquet_leave Ongewijzigd laten
scants.bouquet_satellite Satelliet zenderlijst
-scants.bouquet_update update
+scants.bouquet_update updaten
scants.channel kanaal:
scants.failed Transponderscan mislukt!
scants.finished Transponderscan succesvol beëindigd!
@@ -1661,7 +1699,7 @@ screenshot.tv TV resolutie
screenshot.video Video in de achtergrond
servicemenu.getplugins Herlaad plugins
servicemenu.getplugins_hint Plugins worden geladen,\nmoment geduld alstublieft.
-servicemenu.head Onderhoud
+servicemenu.head Installatie
servicemenu.imageinfo Firmware info
servicemenu.reload Herlaad kanalenlijst
servicemenu.reload_hint Kanalenlijst wordt geladen,\nmoment geduld alstublieft.
@@ -1718,7 +1756,7 @@ timer.eventtimed.msg Het programma is gereserveerd. Uw ontvanger \nzal automatis
timer.eventtimed.title Reserveer programma
timerbar.channelswitch Reservering
timerbar.recordevent Opname
-timerlist.alarmtime Alarm tijd
+timerlist.alarmtime Start tijd
timerlist.apids Audio PIDs
timerlist.apids_dflt Standaard audio streams opnemen
timerlist.ask_to_delete Uw huidige opname wordt stop gezet. Wilt u verder gaan?
@@ -1811,7 +1849,7 @@ usermenu.head Gebruikersmenu
usermenu.item_bar ---- Boarder ----
usermenu.item_epg_misc EPG functions
usermenu.item_none (empty)
-usermenu.item_vtxt Videotext
+usermenu.item_vtxt Teletekst
usermenu.msg_info_is_empty U heeft geen naam voor dit menu gedefinieerd.\nDe standaard naam wordt gebruikt:\n
usermenu.msg_warning_name U heeft meerdere items gemaakt voor dit menu,\ngeen van de items heeft een naam.\nhet wordt aanbevolen om een naam in te voeren.
usermenu.msg_warning_no_items Geen items gedefinieerd.\n De menu naam is gereset!
@@ -1835,7 +1873,7 @@ videomenu.dbdr MPEG2 de-block/de-ring
videomenu.dbdr_both de-block+de-ring
videomenu.dbdr_deblock de-block
videomenu.dbdr_none Geen
-videomenu.enabled_modes VF toets ingeschakelde modus
+videomenu.enabled_modes Ingeschakelde video modi
videomenu.fullscreen Volledig scherm
videomenu.hdmi_cec CSTLink (HDMI-CEC)
videomenu.hdmi_cec_mode Gebruik ontvanger
@@ -1850,7 +1888,7 @@ videomenu.panscan Pan&Scan
videomenu.panscan2 14:9 Pan&Scan
videomenu.saturation Verzadiging
videomenu.scart Scart
-videomenu.screensetup Scherm instellingen
+videomenu.screensetup Scherm instellicingen
videomenu.sharpness Scherpheid
videomenu.tv-scart Video
videomenu.vcrsignal VCR Output Signaal Type
@@ -1867,11 +1905,11 @@ wizard.install_settings Wilt u de kanalen van Astra 1 (19.2º oost) inscannen?
wizard.welcome_head Welkom in de installatie wizard
wizard.welcome_text In de volgende stappen zullen we u begeleiden bij de eerste installatie van uw ontvanger.\n
word.from Van
-zapit.scantype scan naar services
-zapit.scantype.all alle services
-zapit.scantype.radio alleen radio
-zapit.scantype.tv alleen tv
-zapit.scantype.tvradio tv & radio
+zapit.scantype Wat voor kanalen wilt u zoeken?
+zapit.scantype.all Alle services
+zapit.scantype.radio Alleen radio
+zapit.scantype.tv Alleen TV
+zapit.scantype.tvradio TV & Radio
zapitsetup.head Start kanaal instellingen
zapitsetup.info Start kanaal
zapitsetup.last_radio Radio kanaal
diff --git a/data/locale/unmaintained/slovak.locale b/data/locale/unmaintained/slovak.locale
index f82ed1d3c..a060cfc9e 100644
--- a/data/locale/unmaintained/slovak.locale
+++ b/data/locale/unmaintained/slovak.locale
@@ -97,7 +97,7 @@ GENRE.TRAVEL_HOBBIES.6 inzertovanie/nakupovanie
GENRE.TRAVEL_HOBBIES.7 záhradkárstvo
GENRE.UNKNOWN neznáme
apidselector.head Výber jazyka
-audio.srs_algo Mód
+audio.srs_algo Režim
audio.srs_algo_heavy Hrubý
audio.srs_algo_light Jemný
audio.srs_algo_normal Normálny
@@ -312,7 +312,7 @@ epgextended.presenter Produkcia
epgextended.year_of_production Rok výroby
epglist.noevents Programové informácie (EPG) sú nedostupné...
epgviewer.More_Screenings Podobné relácie na tomto kanály
-epgviewer.More_Screenings_short Viacej relácií
+epgviewer.More_Screenings_short Ďaľšie vysielania
epgviewer.age_rating Vekové obmedzenie
epgviewer.audio Zvuk
epgviewer.genre Žáner
@@ -321,15 +321,15 @@ epgviewer.nodetailed Detailné informácie sú nedostupné
epgviewer.notfound Nenájdené programové informácie (EPG)
eventfinder.head Hľadaj v EPG
eventfinder.keyword Slovo
-eventfinder.search Hľadaj
+eventfinder.search hľadaj
eventfinder.search_all_epg Všade
eventfinder.search_within_epg Hľadaj v EPG
eventfinder.search_within_list Hľadaj v zozname
eventfinder.searching Hľadám slovo v EPG...
eventfinder.start_search Spusti hľadanie
eventlist.additional Podrobnejšie informácie
-eventlist.name Zoznam udalostí
-eventlistbar.channelswitch prejdi
+eventlist.name Zoznam relácií
+eventlistbar.channelswitch prepni
eventlistbar.eventsort triedenie
eventlistbar.recordevent nahraj
extra.add_to_bouquet Pridanie do buketu
@@ -368,8 +368,11 @@ extra.fec_s2_qpsk_7_8 7/8 s2 qpsk
extra.fec_s2_qpsk_8_9 8/9 s2 qpsk
extra.fec_s2_qpsk_9_10 9/10 s2 qpsk
extra.key_current_transponder Aktuálny kľúč transpondéra
+extra.key_format_mode Mód obrazu
extra.key_list_end Na koniec
extra.key_list_start Na začiatok
+extra.key_pic_mode Formát obrazu
+extra.key_pic_size Zobrazenie formátu 4:3
extra.key_pip_close Spustiť/Zastaviť PiP
extra.key_pip_setup Nastavenie PiP
extra.key_pip_swap Prehodiť PiP/Hlavný obraz
@@ -417,6 +420,7 @@ extra.update_dir Adresár aktualizácie
extra.use_gotoxx Použi gotoXX
extra.volume_digits Hlasitoť číselne
extra.volume_pos Ukazovateľ hlasitosti
+extra.volume_size Výška zobrazenia
extra.west Západne
extra.zap_cycle Cyklické prepínanie
extra.zapit_fe_timeout Časový limit naladenia (1 = 10 msek)
@@ -435,7 +439,7 @@ favorites.copy Kopíruj buket do Obľúbených
favorites.finalhint \nPouži editor buketov pre dokonačenie\nzmien v obľúbených.\n
favorites.menueadd Pridaj kanál do obľúbených
favorites.nobouquets Obľúbené sú dostupné len pri použití Buketov.
-filebrowser.delete zmaž
+filebrowser.delete Zmazať
filebrowser.denydirectoryleave Hlavný adresár
filebrowser.dodelete1 zmaž
filebrowser.dodelete2 ?
@@ -480,6 +484,8 @@ flashupdate.globalprogress Celkový postup:
flashupdate.head SW aktualizácia
flashupdate.md5check Kontrola IMAGE
flashupdate.md5sumerror IMAGE má chyby
+flashupdate.menu_apply_kernel Nahranie jadra (kernelu)
+flashupdate.menu_apply_settings Povoliť aplikovanie nastavení
flashupdate.msgbox Zistený nový súbor:\nDátum: %s, %s\nBaseImage: %s\nTyp: %s\n\nNaozaj prevziať a nainštalovať\ntento súbor?
flashupdate.msgbox_manual Zistený nový súbor:\nDátum: %s, %s\nBaseImage: %s\nTyp IMAGE: %s\n\nNaozaj nainštalovať\ntento súbor?
flashupdate.mtdselector Výber partície
@@ -652,6 +658,7 @@ keybindingmenu.remotecontrol_hardware_tripledragon Triple Dragon
keybindingmenu.repeatblock Základné oneskorenie
keybindingmenu.repeatblockgeneric Oneskorenie opakovania
keybindingmenu.sort Zmena poradia triedenia
+keybindingmenu.special_active Špeciálne klávesy
keybindingmenu.subchanneldown Predchádzajúci podkanál
keybindingmenu.subchannelup Nasledujúci podkanál
keybindingmenu.tvradiomode TV/Rádio
@@ -679,6 +686,8 @@ lcdmenu.statusline Stavový riadok
lcdmenu.statusline.both hlasitosť/odohratý čas
lcdmenu.statusline.playtime odohratý čas
lcdmenu.statusline.volume hlasitosť
+ledcontroler.backlight Podsvietené tlačidlá
+ledcontroler.backlight.tv TV režim
ledcontroler.blink Blikať v hlbokom spánku ak je nastavený časovač
ledcontroler.menu Podsvietenie Power tlačítka
ledcontroler.mode.deepstandby Hlboký spánok
@@ -750,6 +759,7 @@ menu.hint_audioplayer_title Použije SMS štýl vyhľadávania titulov v zozname
menu.hint_auto_lang Automatické prepnutie zvuku na preferovaný jazyk
menu.hint_auto_subs Automatické spustenie titulkov pre preferovaný jazyk
menu.hint_back Návrat do predchádzajúcej položky.\nStlačenie MENU klávesy uzavrie všetky položky
+menu.hint_backlight Nastavenie podsvietených tlačidiel
menu.hint_backup Záloha konfigurácií a kanálov do vybraného adresára
menu.hint_bedit Úprava obľúbených a buketov
menu.hint_bigwindows Zoznam kanálov, programové informácie, prehrávač hudby a niektoré ďaľšie okná budú zobrazované na celej obrazovke
@@ -780,6 +790,7 @@ menu.hint_epg_max_events Maximum udalostí zachytávania. Po dosiahnutí hranice
menu.hint_epg_old_events Hodiny po skončení udalosti aby sa označila\nako stará a odstránila sa zo zachytávania
menu.hint_epg_save Uloženie zachyteného EPG na disk alebo usb\na načítanie po spustení
menu.hint_epg_save_standby Uloženie EPG v režime pripravenosti
+menu.hint_epg_scan Povolenie prehľadávania EPG na pozadí ak je voľný tuner
menu.hint_event_textcolor Zmena farby udalosti pre nastavenia farebnosti udalosti\nv zozname kanálov a stavovom riadku
menu.hint_eventlist_additional Zobrazí podrobnejšie informácie\nv hlavnom okne
menu.hint_eventlist_fonts Zmena veľkosti písma zoznamu udalostí
@@ -840,6 +851,7 @@ menu.hint_key_channel_sms Ak zapnuté, číselné klávesy v zozname kanálov\ns
menu.hint_key_channeldown Priradenie klávesy pre rýchlu zmenu na predchádzajúci\nkanál v zozname kanálov
menu.hint_key_channellist Konfigurácia klávesových skratiek pre zoznam kanálov
menu.hint_key_channelup Priradenie klávesy pre rýchlu zmenu na nasledujúci\nkanál v zozname kanálov
+menu.hint_key_format_mode_active Kláves pre vypnutie/zapnutie konverzie obrazového formátu
menu.hint_key_hardware Zmena typu diaľkového ovládača
menu.hint_key_history Priradenie klávesy pre zobrazenie\nhistórie prepínania kanála
menu.hint_key_lastchannel Priradenie klávesy pre rýchle prepnutie na\npredchádzajúci kanál v histórii
@@ -862,6 +874,8 @@ menu.hint_key_mptime Priradenie klávesy pre zobrazenie časov nahrávky
menu.hint_key_mptimeshift Priradenie klávesy pre spustenie časového posunu
menu.hint_key_pagedown Priradenie klávesy pre zobrazenie nasledujúcej strany položiek
menu.hint_key_pageup Priradenie klávesy pre zobrazenie predchádzajúcej strany položiek
+menu.hint_key_pic_mode_active Povolenie/zakázanie klávesy pre zmenu formátu obrazu
+menu.hint_key_pic_size_active Povolenie/zakázanie klávesy pre zmenu správneho zobrazenia 4:3
menu.hint_key_pip_close Priradenie klávesy pre ukončenie PiP\nalebo spustenia ho na aktuálnom kanály
menu.hint_key_pip_setup Priradenie klávesy pre konfiguráciu PiP
menu.hint_key_pip_swap Priradenie klávesy pre zmenu PiP a živého kanála
@@ -873,6 +887,7 @@ menu.hint_key_right Výber 'vpravo' funkcie v živom TV/Rádio režime
menu.hint_key_save Uloží klávesové skratky do súboru
menu.hint_key_screenshot Priradenie klávesy pre uloženie GUI/nalebo zachytenie obrazovky
menu.hint_key_sort Priradenie klávesy pre zmenu triedenia zoznamu kanálov
+menu.hint_key_special_active Povolenie/zakázanie niektorých špeciálnych kláves
menu.hint_key_subchanneldown Priradenie klávesy pre rýchlu zmenu\n do predchádzajúceho subkanálu
menu.hint_key_subchannelup Priradenie klávesy pre rýchlu zmenu\n do nasledujúceho subkanálu
menu.hint_key_transponder Priradenie tlačítka pre zobrazenie zoznamu kanálov\nz aktuálneho transpondéra
@@ -1121,6 +1136,7 @@ menu.hint_video_scart_mode Výber režimu analógového výstupu pre SCART konek
menu.hint_volume Konfigurácia volieb okna hlasitosti
menu.hint_volume_digits Číselné zobrazenie ukazovateľa hlasitosti ZAP/VYP
menu.hint_volume_pos Výber pozície indikátora hlasitosti
+menu.hint_volume_size Výber výšky indikátora hlasitosti
menu.hint_ytplay Prehranie vybraných youtube videí
menu.hint_zap_cycle Pri prepínaní kanálov zotrvať v aktuálnom bukete
menu.next ďaľej (MENU ukončí)
@@ -1155,6 +1171,7 @@ miscsettings.epg_old_events_hint1 Ako dlho zapisovať dáta EPG po skončení?
miscsettings.epg_old_events_hint2 Nastavenie v hodinách.
miscsettings.epg_save Ulož/Obnov EPG po reštarte
miscsettings.epg_save_standby Ulož EPG pri soft standby
+miscsettings.epg_scan Prehľadávanie EPG
miscsettings.general Hlavné nastavenia
miscsettings.head Rôzne nastavenia
miscsettings.infobar Inforiadok
@@ -1212,6 +1229,7 @@ motorcontrol.install_menu Inštalačné menu
motorcontrol.motor_pos (a) Pozícia motora:
motorcontrol.movement (b) Presun:
motorcontrol.msec ms
+motorcontrol.network Informácie sieti
motorcontrol.no_mode nestará sa
motorcontrol.notdef Nepoužité
motorcontrol.override Nahradiť pozíciu určenú pre
@@ -1264,7 +1282,7 @@ moviebrowser.edit_book_type_info1 Zadanie novej dĺžky skoku
moviebrowser.edit_book_type_info2 <0 vzad , >0 vpred, 0: nikde
moviebrowser.edit_serie Zadanie názvu série
moviebrowser.error_no_movies Nenájdené filmy
-moviebrowser.foot_filter Filtrovať:
+moviebrowser.foot_filter Filter:
moviebrowser.foot_focus Prepnúť okno
moviebrowser.foot_options Voľby
moviebrowser.foot_play Štart filmu
@@ -1355,6 +1373,7 @@ moviebrowser.update_if_dest_empty_only Kopírovať len ak je cieľové miesto pr
moviebrowser.use_dir Použi adresár
moviebrowser.use_movie_dir Použi adresár filmov
moviebrowser.use_rec_dir Použi adresár nahrávania
+moviebrowser.yt_concurrent_connections Súbežné spojenia
moviebrowser.yt_error Chyba načítania youtube videa
moviebrowser.yt_max_results Dosiahnuté maximum výsledkov
moviebrowser.yt_most_discussed Najdiskutovanejšie
@@ -1364,6 +1383,7 @@ moviebrowser.yt_most_responded Najodpovedajšie
moviebrowser.yt_most_shared Najzdielanejšie
moviebrowser.yt_next_results Ďaľšie výsledky
moviebrowser.yt_on_the_web Trendové videá
+moviebrowser.yt_pref_quality Preferovaná kvalita
moviebrowser.yt_prev_results Predchádzájúce výsledky
moviebrowser.yt_recently_featured Nedávno odporúčané
moviebrowser.yt_region Región
@@ -1572,6 +1592,9 @@ rclock.unlockmsg Ovládač opäť funkčný.
recording.is_running Tento kanál sa nahráva. Spustiť nové nahrávanie?
recording.start Spustenie nahrávania, prosím čakajte...!
recording.stop Zastavenie nahrávania, prosím čakajte...!
+recording.time_hour hodina
+recording.time_hours hodín
+recording.time_min min
recordingmenu.apids Predvolené zvukové stopy
recordingmenu.apids_ac3 Nahraj zvuk AC3
recordingmenu.apids_alt Nahraj ostatné zvukové stopy
@@ -1735,7 +1758,8 @@ settings.noconffile Nenájdené nastavenia Neutrino.\nPoužité budú prednastav
settings.pos_bottom_center spodný stred
settings.pos_bottom_left ľavý spodok
settings.pos_bottom_right pravý spodok
-settings.pos_default_center vrchný stred
+settings.pos_default_center stred
+settings.pos_higher_center spodný vyšší stred
settings.pos_top_center vrchný stred
settings.pos_top_left ľavý vrch
settings.pos_top_right pravý vrch
@@ -1771,7 +1795,7 @@ subtitles.head Titulky
subtitles.stop Vypnúť titulky
timer.eventrecord.msg Udalosť je naplánovaná na nahrávanie.\nPre úpravu plánu otvorte časovač nahrávania.
timer.eventrecord.title Plánovač nahrávania
-timer.eventtimed.msg Táto program je naplánovaný.\nBox bude zapnutý a \nprepnutý na tento kanál v stanovenom čase.
+timer.eventtimed.msg Táto relácia je naplánovaná.\nBox bude zapnutý a prepnutý \nna tento kanál v stanovenom čase.
timer.eventtimed.title Plánovač udalostí
timerbar.channelswitch prepni
timerbar.recordevent nahraj
@@ -1852,6 +1876,7 @@ timing.infobar_movieplayer Stavový riadok (filmový mód)
timing.infobar_radio Stavový riadok (rádio mód)
timing.menu Menu
timing.numericzap Prepínanie číslami
+timing.volumebar Ukazovateľ hlasitosti
unicable.lnb Vstup Unicable
unicable.qrg Kmitočet Unicable
unicable.scr SCR Unicable
@@ -1927,6 +1952,11 @@ videomenu.videoformat_43 4:3
videomenu.videomode Obrazový režim
wizard.initial_settings Najdené ininicializačné nastavenia
wizard.install_settings Chcete inštalovať kanály pre Astra 19.2°E?
+wizard.setup Úvodná inštalácia
+wizard.setup_advanced Rozšírená
+wizard.setup_easy Jednoduchá
+wizard.setup_type Typ inštalácie
+wizard.setup_type_hint Jednoduché nastavenie pre CanalDigitaal/TĂ©lĂ©SAT/TV Vlaanderen alebo jednoduché káblové vyhľadávanie
wizard.welcome_head Vitajte v Sprievodcovi nastavenia
wizard.welcome_text Ďaľšie kroky prevedú základnú inštaláciu tohto zariadenia.\nChceš pokračovať?\nBlahoželáme k zakúpeniu CST. Nasledujúce \nkroky ťa prevedú počiatočnou inštaláciou nastavenia prístroja.\nPrajeme ti veľa radosti s týmto príjmačom!\nĎaľší krok ?
word.from z
diff --git a/lib/libcoolstream2/cs_api.h b/lib/libcoolstream2/cs_api.h
index 9ae38a702..64b8180bc 100644
--- a/lib/libcoolstream2/cs_api.h
+++ b/lib/libcoolstream2/cs_api.h
@@ -10,7 +10,7 @@
#ifndef __CS_API_H_
#define __CS_API_H_
-#include
+#include
#include
#include
#include
diff --git a/lib/libcoolstream2/cs_frontpanel.h b/lib/libcoolstream2/cs_frontpanel.h
index 97c0f577a..f4963da36 100644
--- a/lib/libcoolstream2/cs_frontpanel.h
+++ b/lib/libcoolstream2/cs_frontpanel.h
@@ -76,10 +76,10 @@ typedef struct {
typedef enum {
FP_LED_1_ON = 0x81,
FP_LED_2_ON = 0x82,
- FP_LED_3_ON = 0x83,
+ FP_LED_3_ON = 0x88,
FP_LED_1_OFF = 0x01,
FP_LED_2_OFF = 0x02,
- FP_LED_3_OFF = 0x03,
+ FP_LED_3_OFF = 0x08,
} fp_led_ctrl_t;
typedef struct {
diff --git a/lib/libcoolstream2/video_cs.h b/lib/libcoolstream2/video_cs.h
index 1d53e6268..e7aba1ba8 100644
--- a/lib/libcoolstream2/video_cs.h
+++ b/lib/libcoolstream2/video_cs.h
@@ -5,13 +5,12 @@
/* */
/* (C) 2008 CoolStream International */
/* */
-/* $Id:: $ */
/*******************************************************************************/
#ifndef __VIDEO_CS_H_
#define __VIDEO_CS_H_
-#include
-#include
+#include
+#include
#include "cs_types.h"
diff --git a/src/Makefile.am b/src/Makefile.am
index 9cf7624a1..735d42280 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -118,12 +118,17 @@ neutrino_LDADD += \
neutrino_LDADD += -lcoolstream-mt -lca-sc
if ENABLE_TMSDK
else
+if BOXMODEL_APOLLO
+neutrino_LDADD += -llnxtmvssUsr -llnxUKAL -llnxplatUsr -llnxtmasUsr -llnxdvbciUsr -llnxpvrUsr -llnxcssUsr -llnxnotifyqUsr -ltmpvrDataManager -ltmpvrIndexStorage -llnxscsUsr
+else
neutrino_LDADD += -lnxp
endif
+endif
bin_PROGRAMS += drivertool
-
drivertool_SOURCES = drivertool.c
+bin_PROGRAMS += dt
+dt_SOURCES = dt.c
endif
if USE_STB_HAL
diff --git a/src/driver/Makefile.am b/src/driver/Makefile.am
index 93d547edd..5ad12a2bd 100644
--- a/src/driver/Makefile.am
+++ b/src/driver/Makefile.am
@@ -28,6 +28,7 @@ libneutrino_driver_a_SOURCES = \
fontrenderer.cpp \
framebuffer_ng.cpp \
genpsi.cpp \
+ neutrinofonts.cpp \
radiotext.cpp \
radiotools.cpp \
rcinput.cpp \
diff --git a/src/driver/audiodec/wavdec.cpp b/src/driver/audiodec/wavdec.cpp
index 0ab88aa10..e7c900bf1 100644
--- a/src/driver/audiodec/wavdec.cpp
+++ b/src/driver/audiodec/wavdec.cpp
@@ -52,18 +52,18 @@ extern cAudio * audioDecoder;
struct WavHeader
{
char ChunkID[4];
-// int ChunkSize;
+ int ChunkSize;
char Format[4];
-// char Subchunk1ID[4];
-// int Subchunk1Size;
+ char Subchunk1ID[4];
+ int Subchunk1Size;
short AudioFormat;
short NumChannels;
int SampleRate;
int ByteRate;
-// short BlockAlign;
+ short BlockAlign;
short BitsPerSample;
-// char Subchunk2ID[4];
-// int Subchunk2Size;
+ char Subchunk2ID[4];
+ int Subchunk2Size;
} __attribute__ ((packed));
int endianTest=1;
diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp
index e4de0cc70..af90ddcd8 100644
--- a/src/driver/fontrenderer.cpp
+++ b/src/driver/fontrenderer.cpp
@@ -37,10 +37,6 @@
#include
#include
-/* Drawing pixels is actually faster without the GXA accelerator (wich OTOH is
- faster for drawing lines, so disable it here. */
-#undef USE_NEVIS_GXA
-
FT_Error FBFontRenderClass::myFTC_Face_Requester(FTC_FaceID face_id,
FT_Library /*library*/,
FT_Pointer request_data,
@@ -367,8 +363,35 @@ int UTF8ToUnicode(const char * &text, const bool utf8_encoded) // returns -1 on
return unicode_value;
}
-void Font::RenderString(int x, int y, const int width, const char *text, const unsigned char color, const int boxheight, const bool utf8_encoded)
+#define F_MUL 0x7FFF
+
+void Font::paintFontPixel(fb_pixel_t *td, uint8_t fg_trans, uint8_t fg_red, uint8_t fg_green, uint8_t fg_blue, fb_pixel_t bg_col, int faktor, uint8_t index)
{
+ int korr_t = ((bg_col & 0xFF000000) >> 24) - fg_trans;
+ int korr_r = ((bg_col & 0x00FF0000) >> 16) - fg_red;
+ int korr_g = ((bg_col & 0x0000FF00) >> 8) - fg_green;
+ int korr_b = (bg_col & 0x000000FF) - fg_blue;
+
+ *td = ((g_settings.contrast_fonts && (index > 128)) ? 0xFF000000 : (((fg_trans + ((korr_t*faktor)/F_MUL)) << 24) & 0xFF000000)) |
+ (((fg_red + ((korr_r*faktor)/F_MUL)) << 16) & 0x00FF0000) |
+ (((fg_green + ((korr_g*faktor)/F_MUL)) << 8) & 0x0000FF00) |
+ ((fg_blue + ((korr_b*faktor)/F_MUL)) & 0x000000FF);
+}
+
+void Font::RenderString(int x, int y, const int width, const char *text, const fb_pixel_t color, const int boxheight, const bool utf8_encoded, const bool useFullBg)
+{
+/*
+ useFullBg (default = false)
+
+ useFullBg = false
+ fetch bgcolor from framebuffer, using lower left edge of the font
+
+ useFullBg = true
+ fetch bgcolor from framebuffer, using the respective real font position
+ - font rendering slower
+ - e.g. required for font rendering on images
+*/
+
if (!frameBuffer->getActive())
return;
@@ -430,57 +453,56 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u
int lastindex=0; // 0 == missing glyph (never has kerning values)
FT_Vector kerning;
int pen1=-1; // "pen" positions for kerning, pen2 is "x"
+ static fb_pixel_t old_bgcolor = 0, old_fgcolor = 0;
+ static uint8_t fg_trans = 0, fg_red = 0, fg_green = 0, fg_blue = 0;
+ static bool olduseFullBg = false;
+ static fb_pixel_t colors[256] = {0};
+ static int faktor[256] = {0};
+ static bool fontRecsInit = false;
+ fb_pixel_t bg_color = 1;
+ fb_pixel_t fg_color = color;
- static fb_pixel_t oldbgcolor = 0, oldfgcolor = 0;
- static fb_pixel_t colors[256]={0};
+ if (!useFullBg) {
+ /* the GXA seems to do it's job asynchonously, so we need to wait until
+ it's ready, otherwise the font will sometimes "be overwritten" with
+ background color or bgcolor will be wrong */
+ frameBuffer->waitForIdle("Font::RenderString 1");
+ /* fetch bgcolor from framebuffer, using lower left edge of the font... */
+ bg_color = *(frameBuffer->getFrameBufferPointer() + x +
+ y * frameBuffer->getStride() / sizeof(fb_pixel_t));
+ }
+ else
+ bg_color = 0;
- // fb_pixel_t bgcolor = frameBuffer->realcolor[color];
- uint8_t fgindex = color; /* index of font color in the palette */
- if (color > COL_BLACK0 && color < 254) /* bigger than 254 would result in > 255 */
- fgindex = ((((int)color) + 2) | 7) - 2; /* no idea what this does exactly... */
- fb_pixel_t fgcolor = frameBuffer->realcolor[fgindex];
-#ifndef USE_NEVIS_GXA
- /* the GXA seems to do it's job asynchonously, so we need to wait until
- it's ready, otherwise the font will sometimes "be overwritten" with
- background color or bgcolor will be wrong */
- frameBuffer->waitForIdle("Font::RenderString");
-#endif
- /* fetch bgcolor from framebuffer, using lower left edge of the font... */
- fb_pixel_t bgcolor = *(frameBuffer->getFrameBufferPointer() + x +
- y * frameBuffer->getStride() / sizeof(fb_pixel_t));
+ if ((old_fgcolor != fg_color) || (old_bgcolor != bg_color) || (olduseFullBg != useFullBg) || !fontRecsInit) {
+ old_bgcolor = bg_color;
+ old_fgcolor = fg_color;
+ olduseFullBg = useFullBg;
+ fontRecsInit = true;
- if((oldbgcolor != bgcolor) || (oldfgcolor != fgcolor)) {
+ fg_trans = (fg_color & 0xFF000000) >> 24;
+ fg_red = (fg_color & 0x00FF0000) >> 16;
+ fg_green = (fg_color & 0x0000FF00) >> 8;
+ fg_blue = fg_color & 0x000000FF;
- oldbgcolor = bgcolor;
- oldfgcolor = fgcolor;
- t_fb_var_screeninfo * screeninfo = frameBuffer->getScreenInfo();
- int rl = screeninfo->red.length;
- int ro = screeninfo->red.offset;
- int gl = screeninfo->green.length;
- int go = screeninfo->green.offset;
- int bl = screeninfo->blue.length;
- int bo = screeninfo->blue.offset;
- int tl = screeninfo->transp.length;
- int to = screeninfo->transp.offset;
- int fgr = (((int)fgcolor >> ro) & ((1 << rl) - 1));
- int fgg = (((int)fgcolor >> go) & ((1 << gl) - 1));
- int fgb = (((int)fgcolor >> bo) & ((1 << bl) - 1));
- int fgt = (((int)fgcolor >> to) & ((1 << tl) - 1));
- int deltar = (((int)bgcolor >> ro) & ((1 << rl) - 1)) - fgr;
- int deltag = (((int)bgcolor >> go) & ((1 << gl) - 1)) - fgg;
- int deltab = (((int)bgcolor >> bo) & ((1 << bl) - 1)) - fgb;
- int deltat = (((int)bgcolor >> to) & ((1 << tl) - 1)) - fgt;
+ int korr_t=0, korr_r=0, korr_g=0, korr_b=0;
+ if (!useFullBg) {
+ korr_t = ((bg_color & 0xFF000000) >> 24) - fg_trans;
+ korr_r = ((bg_color & 0x00FF0000) >> 16) - fg_red;
+ korr_g = ((bg_color & 0x0000FF00) >> 8) - fg_green;
+ korr_b = (bg_color & 0x000000FF) - fg_blue;
+ }
+ for (int i = 0; i <= 0xFF; i++) {
+ int _faktor = ((0xFF - i) * F_MUL) / 0xFF;
- for (int i = 0; i < 256; i++) {
- colors[255 - i] =
- ((((fgr + deltar * i / 255) & ((1 << rl) - 1)) << ro) |
- (((fgg + deltag * i / 255) & ((1 << gl) - 1)) << go) |
- (((fgb + deltab * i / 255) & ((1 << bl) - 1)) << bo) |
- (((fgt + deltat * i / 255) & ((1 << tl) - 1)) << to));
- /* FIXME must be better solution */
- if(g_settings.contrast_fonts && ((255-i) > 128))
- colors[255 - i] |= 0xFF << to;
+ if (useFullBg)
+ faktor[i] = _faktor;
+ else
+ colors[i] = ((g_settings.contrast_fonts && (i > 128)) ? 0xFF000000 : (((fg_trans + ((korr_t*_faktor)/F_MUL)) << 24) & 0xFF000000)) |
+ (((fg_red + ((korr_r*_faktor)/F_MUL)) << 16) & 0x00FF0000) |
+ (((fg_green + ((korr_g*_faktor)/F_MUL)) << 8) & 0x0000FF00) |
+ ((fg_blue + ((korr_b*_faktor)/F_MUL)) & 0x000000FF);
}
}
@@ -536,89 +558,74 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u
if (x + glyph->xadvance + spread_by > left + width)
break;
- #ifndef USE_NEVIS_GXA
int stride = frameBuffer->getStride();
int ap=(x + glyph->left) * sizeof(fb_pixel_t) + stride * (y - glyph->top);
uint8_t * d = ((uint8_t *)frameBuffer->getFrameBufferPointer()) + ap;
- #endif
uint8_t * s = glyph->buffer;
int w = glyph->width;
int h = glyph->height;
int pitch = glyph->pitch;
- #ifndef USE_NEVIS_GXA
- if(ap>-1){
- #endif
- for (int ay=0; ay-1) {
+ fb_pixel_t *bg_buf = NULL;
+ if (useFullBg) {
+ // save background of the char
+ bg_buf = new fb_pixel_t[h * (w+spread_by)];
+ uint8_t *pos = d;
+ fb_pixel_t *bkpos = bg_buf;
+ /* the GXA seems to do it's job asynchonously, so we need to wait until
+ it's ready, otherwise the font will sometimes "be overwritten" with
+ background color or bgcolor will be wrong */
+ frameBuffer->waitForIdle("Font::RenderString 2");
+ for (int j = 0; j < h; j++) {
+ fb_pixel_t *dest = (fb_pixel_t*)pos;
+ for (int i = 0; i < (w + spread_by); i++)
+ *(bkpos++) = *(dest++);
+ pos += stride;
+ }
+ }
+
+ for (int ay = 0; ay < h; ay++) {
fb_pixel_t * td = (fb_pixel_t *)d;
- #endif
-
int ax;
- for (ax=0; ax < w + spread_by; ax++)
- {
- if (stylemodifier != Font::Embolden)
- {
- #ifdef USE_NEVIS_GXA
- /* not nice (and also slower), but currently the easiest way to prevent visible errors */
- frameBuffer->paintPixel(x + glyph->left + ax, y - glyph->top + ay, colors[*s++]);
- #else
- /* do not paint the backgroundcolor, see below */
- //if (colors[*s] != bgcolor)
- // from code above bgcolor index should be always 0
- if(*s != 0)
- *td = colors[*s];
- td++; s++;
- #endif
+ for (ax = 0; ax < w + spread_by; ax++) {
+ if (stylemodifier != Font::Embolden) {
+ /* do not paint the backgroundcolor (*s = 0) */
+ if(*s != 0) {
+ if (useFullBg)
+ paintFontPixel(td, fg_trans, fg_red, fg_green, fg_blue, bg_buf[ax*ay], faktor[*s], *s);
+ else
+ *td = colors[*s];
+ }
}
- else
- {
- int start, end;
+ else {
int lcolor = -1;
-
- if (ax < w)
- start = 0;
- else
- start = ax - w + 1;
-
- if (ax < spread_by)
- end = ax + 1;
- else
- end = spread_by + 1;
-
+ int start = (ax < w) ? 0 : ax - w + 1;
+ int end = (ax < spread_by) ? ax + 1 : spread_by + 1;
for (int i = start; i < end; i++)
if (lcolor < *(s - i))
lcolor = *(s - i);
- #ifdef USE_NEVIS_GXA
- frameBuffer->paintPixel(x + glyph->left + ax, y - glyph->top + ay, colors[lcolor]);
- #else
- /* we make the font "transparent" by not painting the background color
- colored boxes are painted beneath the fonts anyway
- note that this is not totally correct, because of subpixel hinting etc,
- but that should be barely visible in reality ;) */
- //if (colors[lcolor] != bgcolor)
- // from code above bgcolor index should be always 0
- if (lcolor != 0)
- *td = colors[lcolor];
- td++;
- #endif
- s++;
+ /* do not paint the backgroundcolor (lcolor = 0) */
+ if(lcolor != 0) {
+ if (useFullBg)
+ paintFontPixel(td, fg_trans, fg_red, fg_green, fg_blue, bg_buf[ax*ay], faktor[lcolor], (uint8_t)lcolor);
+ else
+ *td = colors[lcolor];
+ }
}
+ td++; s++;
}
- s += pitch- ax;
- #ifndef USE_NEVIS_GXA
+ s += pitch - ax;
d += stride;
- #endif
}
- #ifndef USE_NEVIS_GXA
+ if (bg_buf != NULL)
+ delete[] bg_buf;
+ bg_buf = NULL;
}
- #endif
- x+=glyph->xadvance+1;
- //x+=glyph->xadvance;
- if(pen1>x)
- x=pen1;
- pen1=x;
- lastindex=index;
+ x += glyph->xadvance + 1;
+ if (pen1 > x)
+ x = pen1;
+ pen1 = x;
+ lastindex = index;
}
//printf("RenderStat: %d %d %d \n", renderer->cacheManager->num_nodes, renderer->cacheManager->num_bytes, renderer->cacheManager->max_bytes);
pthread_mutex_unlock( &renderer->render_mutex );
@@ -627,9 +634,9 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u
frameBuffer->mark(left, y + lower - height, x, y + lower);
}
-void Font::RenderString(int x, int y, const int width, const std::string & text, const unsigned char color, const int boxheight, const bool utf8_encoded)
+void Font::RenderString(int x, int y, const int width, const std::string & text, const fb_pixel_t color, const int boxheight, const bool utf8_encoded, const bool useFullBg)
{
- RenderString(x, y, width, text.c_str(), color, boxheight, utf8_encoded);
+ RenderString(x, y, width, text.c_str(), color, boxheight, utf8_encoded, useFullBg);
}
int Font::getRenderWidth(const char *text, const bool utf8_encoded)
diff --git a/src/driver/fontrenderer.h b/src/driver/fontrenderer.h
index e10baf6dc..124de9632 100644
--- a/src/driver/fontrenderer.h
+++ b/src/driver/fontrenderer.h
@@ -54,6 +54,8 @@ class Font
int height,DigitHeight,DigitOffset,ascender,descender,upper,lower;
int fontwidth;
+ inline void paintFontPixel(fb_pixel_t *td, uint8_t fg_trans, uint8_t fg_red, uint8_t fg_green, uint8_t fg_blue, fb_pixel_t bg_col, int faktor, uint8_t index);
+
public:
enum fontmodifier
{
@@ -62,8 +64,8 @@ class Font
};
fontmodifier stylemodifier;
- void RenderString(int x, int y, const int width, const char * text, const unsigned char color, const int boxheight = 0, const bool utf8_encoded = false);
- void RenderString(int x, int y, const int width, const std::string & text, const unsigned char color, const int boxheight = 0, const bool utf8_encoded = false);
+ void RenderString(int x, int y, const int width, const char * text, const fb_pixel_t color, const int boxheight = 0, const bool utf8_encoded = false, const bool useFullBg = false);
+ void RenderString(int x, int y, const int width, const std::string & text, const fb_pixel_t color, const int boxheight = 0, const bool utf8_encoded = false, const bool useFullBg = false);
int getRenderWidth(const char * text, const bool utf8_encoded = false);
int getRenderWidth(const std::string & text, const bool utf8_encoded = false);
diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp
index df56e51ea..55e581b9b 100644
--- a/src/driver/framebuffer.cpp
+++ b/src/driver/framebuffer.cpp
@@ -748,6 +748,7 @@ void CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, const int
fillrect.width = dx;
fillrect.height = dy;
ioctl(fd, FBIO_FILL_RECT, &fillrect);
+ checkFbArea(x, y, dx, dy, false);
return;
}
#endif
diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h
index 0dd097396..b7d934f53 100644
--- a/src/driver/framebuffer.h
+++ b/src/driver/framebuffer.h
@@ -292,15 +292,11 @@ class CFrameBuffer
FB_PAINTAREA_MAX
};
-#if defined(FB_HW_ACCELERATION)
- inline bool checkFbArea(int, int, int, int, bool) { return true; }
-#else
inline bool checkFbArea(int _x, int _y, int _dx, int _dy, bool prev) { return (fbAreaActiv && !fb_no_check) ? _checkFbArea(_x, _y, _dx, _dy, prev) : true; }
-#endif
-
void setFbArea(int element, int _x=0, int _y=0, int _dx=0, int _dy=0);
void fbNoCheck(bool noCheck) { fb_no_check = noCheck; }
void doPaintMuteIcon(bool mode) { do_paint_mute_icon = mode; }
+ void blit(void) {}
};
#endif
diff --git a/src/driver/genpsi.cpp b/src/driver/genpsi.cpp
index cd350cf22..4f11d2d03 100644
--- a/src/driver/genpsi.cpp
+++ b/src/driver/genpsi.cpp
@@ -126,6 +126,7 @@ CGenPsi::CGenPsi()
vpid = 0;
vtype = 0;
+ pcrpid=0;
vtxtpid = 0;
vtxtlang[0] = 'g';
vtxtlang[1] = 'e';
@@ -160,13 +161,16 @@ void CGenPsi::addPid(uint16_t pid, uint16_t pidtype, short isAC3, const char *da
switch(pidtype)
{
case EN_TYPE_VIDEO:
- vpid=pid;
+ pcrpid=vpid=pid;
vtype = ES_TYPE_MPEG12;
break;
case EN_TYPE_AVC:
- vpid=pid;
+ pcrpid=vpid=pid;
vtype = ES_TYPE_AVC;
break;
+ case EN_TYPE_PCR:
+ pcrpid=pid;
+ break;
case EN_TYPE_AUDIO:
apid[nba]=pid;
atypes[nba]=isAC3;
@@ -244,8 +248,8 @@ int CGenPsi::genpsi(int fd)
//-- write row with desc. for pcr stream (eq. video) --
pkt[ofs] = EN_TYPE_PCR;
pkt[ofs+1] = 0x02;
- pkt[ofs+2] = (vpid>>8);
- pkt[ofs+3] = (vpid & 0xFF);
+ pkt[ofs+2] = (pcrpid>>8);
+ pkt[ofs+3] = (pcrpid & 0xFF);
//-- calculate CRC --
calc_crc32psi(&pkt[data_len], &pkt[OFS_HDR_2], data_len-OFS_HDR_2 );
@@ -276,8 +280,8 @@ int CGenPsi::genpsi(int fd)
pkt[OFS_HDR_2+2] = (patch_len & 0xFF);
//-- patch pcr PID --
ofs = OFS_PMT_DATA;
- pkt[ofs] |= (vpid>>8);
- pkt[ofs+1] = (vpid & 0xFF);
+ pkt[ofs] |= (pcrpid>>8);
+ pkt[ofs+1] = (pcrpid & 0xFF);
//-- write row with desc. for ES video stream --
ofs = OFS_STREAM_TAB;
pkt[ofs] = vtype;
@@ -348,6 +352,7 @@ int CGenPsi::genpsi(int fd)
//-- finish --
vpid=0;
+ pcrpid=0;
nba=0;
nsub = 0;
vtxtpid = 0;
diff --git a/src/driver/genpsi.h b/src/driver/genpsi.h
index 1fce949d6..bc39991aa 100644
--- a/src/driver/genpsi.h
+++ b/src/driver/genpsi.h
@@ -27,7 +27,7 @@
#define EN_TYPE_AUDIO 0x01
#define EN_TYPE_TELTEX 0x02
#define EN_TYPE_PCR 0x03
-#define EN_TYPE_AVC 0x04
+#define EN_TYPE_AVC 0x04
#define EN_TYPE_DVBSUB 0x06
class CGenPsi
@@ -36,6 +36,7 @@ class CGenPsi
short nba, nsub;
uint16_t vpid;
uint8_t vtype;
+ uint16_t pcrpid;
uint16_t vtxtpid;
char vtxtlang[3];
uint16_t apid[10];
diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp
new file mode 100644
index 000000000..2a3808c4c
--- /dev/null
+++ b/src/driver/neutrinofonts.cpp
@@ -0,0 +1,397 @@
+/*
+ Neutrino-GUI - DBoxII-Project
+
+ Copyright (C) 2001 Steffen Hehn 'McClean'
+
+ CNeutrinoFonts class for gui.
+ Copyright (C) 2013, M. Liebmann (micha-bbg)
+
+ License: GPL
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include
+#endif
+
+#include
+#include
+#include
+
+#include
+
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+
+extern font_sizes_groups_struct font_sizes_groups[];
+extern font_sizes_struct neutrino_font[];
+extern const char * locale_real_names[]; /* #include */
+
+const font_sizes_struct signal_font = {LOCALE_FONTSIZE_INFOBAR_SMALL, 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1};
+
+CNeutrinoFonts::CNeutrinoFonts()
+{
+ useDigitOffset = false;
+
+ fontDescr.name = "";
+ fontDescr.filename = "";
+ fontDescr.size_offset = 0;
+ old_fontDescr.name = "";
+ old_fontDescr.filename = "";
+ old_fontDescr.size_offset = 0;
+
+ for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++)
+ g_Font[i] = NULL;
+
+ g_SignalFont = NULL;
+
+ InitDynFonts();
+}
+
+void CNeutrinoFonts::InitDynFonts()
+{
+ for (int i = 0; i < FONT_ID_MAX; i++) {
+ dyn_font_t dyn_font;
+ dyn_font.dx = 0;
+ dyn_font.dy = 0;
+ dyn_font.size = 0;
+ dyn_font.style = 0;
+ dyn_font.text = "";
+ dyn_font.font = NULL;
+ dyn_font.useDigitOffset = false;
+ v_dyn_fonts.push_back(dyn_font);
+ }
+}
+
+CNeutrinoFonts::~CNeutrinoFonts()
+{
+ if (!v_share_fonts.empty()) {
+ for (unsigned int i = 0; i < v_share_fonts.size(); i++)
+ delete v_share_fonts[i].font;
+ v_share_fonts.clear();
+ }
+
+ if (!v_dyn_fonts.empty()) {
+ for (unsigned int i = 0; i < v_dyn_fonts.size(); i++)
+ delete v_dyn_fonts[i].font;
+ v_dyn_fonts.clear();
+ }
+}
+
+CNeutrinoFonts* CNeutrinoFonts::getInstance()
+{
+ static CNeutrinoFonts* nf = NULL;
+ if (!nf)
+ nf = new CNeutrinoFonts();
+ return nf;
+}
+
+void CNeutrinoFonts::SetupDynamicFonts(bool initRenderClass/*=true*/)
+{
+ if (initRenderClass) {
+ if (g_dynFontRenderer != NULL)
+ delete g_dynFontRenderer;
+ g_dynFontRenderer = new FBFontRenderClass();
+
+ dynFontStyle[0] = g_dynFontRenderer->AddFont(fontDescr.filename.c_str());
+
+ fontDescr.name = g_dynFontRenderer->getFamily(fontDescr.filename.c_str());
+ printf("[neutrino] font family %s\n", fontDescr.name.c_str());
+ dynFontStyle[1] = "Bold Regular";
+
+ g_dynFontRenderer->AddFont(fontDescr.filename.c_str(), true); // make italics
+ dynFontStyle[2] = "Italic";
+ }
+}
+
+void CNeutrinoFonts::SetupNeutrinoFonts(bool initRenderClass/*=true*/)
+{
+ if (initRenderClass) {
+ if (g_fontRenderer != NULL)
+ delete g_fontRenderer;
+ g_fontRenderer = new FBFontRenderClass(72 * g_settings.screen_xres / 100, 72 * g_settings.screen_yres / 100);
+
+ old_fontDescr.size_offset = fontDescr.size_offset;
+ old_fontDescr.filename = fontDescr.filename;
+ fontDescr.filename = "";
+ printf("[neutrino] settings font file %s\n", g_settings.font_file);
+ if (access(g_settings.font_file, F_OK)) {
+ if (!access(FONTDIR"/neutrino.ttf", F_OK)) {
+ fontDescr.filename = FONTDIR"/neutrino.ttf";
+ strcpy(g_settings.font_file, fontDescr.filename.c_str());
+ }
+ else {
+ fprintf( stderr,"[neutrino] font file [%s] not found\n neutrino exit\n",FONTDIR"/neutrino.ttf");
+ _exit(0);
+ }
+ }
+ else
+ fontDescr.filename = g_settings.font_file;
+
+ fontStyle[0] = g_fontRenderer->AddFont(fontDescr.filename.c_str());
+
+ old_fontDescr.name = fontDescr.name;
+ fontDescr.name = "";
+ fontDescr.name = g_fontRenderer->getFamily(fontDescr.filename.c_str());
+ printf("[neutrino] font family %s\n", fontDescr.name.c_str());
+ fontStyle[1] = "Bold Regular";
+
+ g_fontRenderer->AddFont(fontDescr.filename.c_str(), true); // make italics
+ fontStyle[2] = "Italic";
+ }
+
+ for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++) {
+ if (g_Font[i]) delete g_Font[i];
+ g_Font[i] = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[neutrino_font[i].style].c_str(), CNeutrinoApp::getInstance()->getConfigFile()->getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize) + neutrino_font[i].size_offset * fontDescr.size_offset);
+ }
+ if (g_SignalFont) delete g_SignalFont;
+ g_SignalFont = g_fontRenderer->getFont(fontDescr.name.c_str(), fontStyle[signal_font.style].c_str(), signal_font.defaultsize + signal_font.size_offset * fontDescr.size_offset);
+}
+
+void CNeutrinoFonts::refreshDynFonts()
+{
+ if (!v_share_fonts.empty()) {
+ for (unsigned int i = 0; i < v_share_fonts.size(); i++) {
+ if (v_share_fonts[i].font != NULL)
+ refreshDynFont(v_share_fonts[i].dx, v_share_fonts[i].dy, v_share_fonts[i].text, v_share_fonts[i].style, i, true);
+ }
+ }
+
+ if (!v_dyn_fonts.empty()) {
+ for (unsigned int i = 0; i < v_dyn_fonts.size(); i++) {
+ if (v_dyn_fonts[i].font != NULL)
+ refreshDynFont(v_dyn_fonts[i].dx, v_dyn_fonts[i].dy, v_dyn_fonts[i].text, v_dyn_fonts[i].style, i, false);
+ }
+ }
+
+ old_fontDescr.filename = fontDescr.filename;
+ old_fontDescr.name = fontDescr.name;
+ old_fontDescr.size_offset = fontDescr.size_offset;
+}
+
+void CNeutrinoFonts::refreshDynFont(int dx, int dy, std::string text, int style, int index, bool isShare)
+{
+ if ((dx <= 0) && (dy <= 0))
+ return;
+
+ dyn_font_t *dyn_font = (isShare) ? &(v_share_fonts[index]) : &(v_dyn_fonts[index]);
+ int oldSize = dyn_font->size;
+ bool tmp = useDigitOffset;
+ useDigitOffset = dyn_font->useDigitOffset;
+ int dynSize = getDynFontSize(dx, dy, text, style);
+ useDigitOffset = tmp;
+// if ((dyn_font->size == dynSize) && (old_fontDescr.name == fontDescr.name) && (old_fontDescr.filename == fontDescr.filename))
+// return;
+
+ if (dyn_font->font != NULL)
+ delete dyn_font->font;
+ Font *dynFont = g_dynFontRenderer->getFont(fontDescr.name.c_str(), dynFontStyle[style].c_str(), dynSize);
+ dyn_font->font = dynFont;
+ dyn_font->size = dynSize;
+ if (dyn_font->size != dynSize)
+ printf("##### [%s] change %s_font size old %d to new %d, index: %u\n", __FUNCTION__, (isShare)?"share":"dyn", oldSize, dyn_font->size, index);
+ else
+ printf("##### [%s] refresh %s_font size %d, index: %u\n", __FUNCTION__, (isShare)?"share":"dyn", dyn_font->size, index);
+}
+
+int CNeutrinoFonts::getFontHeight(Font* fnt)
+{
+ if (useDigitOffset)
+ return fnt->getDigitHeight() + (fnt->getDigitOffset() * 18) / 10;
+ else
+ return fnt->getHeight();
+}
+
+int CNeutrinoFonts::getDynFontSize(int dx, int dy, std::string text, int style)
+{
+ Font *dynFont = NULL;
+ int dynSize = 8;
+ bool dynFlag = false;
+
+ if (dx == 0) dx = 1280;
+ while (1) {
+ if (dynFont != NULL)
+ delete dynFont;
+ dynFont = g_dynFontRenderer->getFont(fontDescr.name.c_str(), dynFontStyle[style].c_str(), dynSize);
+ int _width = 0;
+ int _height = 0;
+ // calculate height & width
+ _height = getFontHeight(dynFont);
+ std::string tmpText = text;
+ if (text == "") tmpText = "x";
+ _width = dynFont->getRenderWidth(tmpText.c_str());
+ if ((_height > dy) || (_width > dx)) {
+ if (dynFlag)
+ dynSize--;
+ else
+ printf("##### [%s] Specified size (dx=%d, dy=%d) too small, use minimal font size.\n", __FUNCTION__, dx, dy);
+ break;
+ }
+ else if ((_height < dy) || (_width < dx)) {
+ dynFlag = true;
+ dynSize++;
+ }
+ else
+ break;
+ }
+
+ if (dynFont != NULL)
+ delete dynFont;
+
+ return dynSize;
+}
+
+/* CNeutrinoFonts::getDynFont usage
+
+ * dx, dy max. width/height of text field / return: real width/height of text field
+ If dx = 0, then the width is calculated automatically
+
+ * text Text to display
+ If text = "", then only the height is calculated
+
+ * style Font style (FONT_STYLE_REGULAR or FONT_STYLE_BOLD or FONT_STYLE_ITALIC)
+
+ * share Select font modus
+ FONT_ID_SHARE Font for used by several objects simultaneously
+ FONT_ID_xxx Font for exclusive application
+ FONT_ID_yyy - "" -
+ FONT_ID_zzz - "" -
+
+ * return value: Pointer to dynamic font
+
+ example:
+ dx = 0; //dx = 0, width is calculated automatically
+ dy = 30; //max. height
+ text = "100"; //max. text to display
+ //CNeutrinoFonts::FONT_STYLE_REGULAR = normal font style
+ //CNeutrinoFonts::FONT_ID_VOLBAR = exclusive font for Volume bar (defined in src/driver/neutrinofonts.h)
+ Font** font = CNeutrinoFonts::getInstance()->getDynFont(dx, dy, text, CNeutrinoFonts::FONT_STYLE_REGULAR, CNeutrinoFonts::FONT_ID_VOLBAR);
+ (*font)->RenderString(...)
+
+*/
+Font **CNeutrinoFonts::getDynFont(int &dx, int &dy, std::string text/*=""*/, int style/*=FONT_STYLE_REGULAR*/, int share/*=FONT_ID_SHARE*/)
+{
+ if (share > FONT_ID_SHARE)
+ return getDynFontWithID(dx, dy, text, style, share);
+ else
+ return getDynFontShare(dx, dy, text, style);
+}
+
+Font **CNeutrinoFonts::getDynFontWithID(int &dx, int &dy, std::string text, int style, unsigned int f_id)
+{
+ if ((dx <= 0) && (dy <= 0))
+ return NULL;
+ if ((fontDescr.name == "") || (fontDescr.filename == ""))
+ SetupNeutrinoFonts();
+ if (g_dynFontRenderer == NULL)
+ SetupDynamicFonts();
+
+ int dynSize = getDynFontSize(dx, dy, text, style);
+ Font *dynFont = NULL;
+ Font **ret = NULL;
+
+ if (f_id < v_dyn_fonts.size()) {
+ if ((v_dyn_fonts[f_id].size == dynSize) && (v_dyn_fonts[f_id].font != NULL)) {
+ dy = v_dyn_fonts[f_id].font->getHeight();
+ if (text != "")
+ dx = v_dyn_fonts[f_id].font->getRenderWidth(text.c_str());
+ return &(v_dyn_fonts[f_id].font);
+ }
+
+ dynFont = g_dynFontRenderer->getFont(fontDescr.name.c_str(), dynFontStyle[style].c_str(), dynSize);
+ if (v_dyn_fonts[f_id].font != NULL)
+ delete v_dyn_fonts[f_id].font;
+ v_dyn_fonts[f_id].dx = dx;
+ v_dyn_fonts[f_id].dy = dy;
+ v_dyn_fonts[f_id].size = dynSize;
+ v_dyn_fonts[f_id].style = style;
+ v_dyn_fonts[f_id].text = text;
+ v_dyn_fonts[f_id].font = dynFont;
+ v_dyn_fonts[f_id].useDigitOffset = useDigitOffset;
+ ret = &(v_dyn_fonts[f_id].font);
+ }
+ else
+ return NULL;
+
+ dy = (*ret)->getHeight();
+ if (text != "")
+ dx = (*ret)->getRenderWidth(text.c_str());
+#ifdef DEBUG_NFONTS
+ printf("##### [%s] dx: %d, dy: %d, dynSize: %d, dynFont: %p, ret: %p, FontID: %d\n", __FUNCTION__, dx, dy, dynSize, *ret, ret, f_id);
+#endif
+ return ret;
+}
+
+Font **CNeutrinoFonts::getDynFontShare(int &dx, int &dy, std::string text, int style)
+{
+ if ((dx <= 0) && (dy <= 0))
+ return NULL;
+ if ((fontDescr.name == "") || (fontDescr.filename == "") || (g_dynFontRenderer == NULL))
+ SetupNeutrinoFonts();
+
+ int dynSize = getDynFontSize(dx, dy, text, style);
+ Font *dynFont = NULL;
+
+ bool fontAvailable = false;
+ unsigned int i;
+ Font **ret = NULL;
+ if (!v_share_fonts.empty()) {
+ for (i = 0; i < v_share_fonts.size(); i++) {
+ if ((v_share_fonts[i].size == dynSize) &&
+ (v_share_fonts[i].style == style) &&
+ (v_share_fonts[i].useDigitOffset == useDigitOffset)) {
+ fontAvailable = true;
+ break;
+ }
+ }
+ }
+ if (fontAvailable) {
+ if (text.length() > v_share_fonts[i].text.length()) {
+ v_share_fonts[i].dx = dx;
+ v_share_fonts[i].dy = dy;
+ v_share_fonts[i].text = text;
+ }
+ ret = &(v_share_fonts[i].font);
+ }
+ else {
+ dynFont = g_dynFontRenderer->getFont(fontDescr.name.c_str(), dynFontStyle[style].c_str(), dynSize);
+ dyn_font_t dyn_font;
+ dyn_font.dx = dx;
+ dyn_font.dy = dy;
+ dyn_font.size = dynSize;
+ dyn_font.style = style;
+ dyn_font.text = text;
+ dyn_font.font = dynFont;
+ dyn_font.useDigitOffset = useDigitOffset;
+ v_share_fonts.push_back(dyn_font);
+ ret = &(v_share_fonts[v_share_fonts.size()-1].font);
+ }
+
+ dy = (*ret)->getHeight();
+ if (text != "")
+ dx = (*ret)->getRenderWidth(text.c_str());
+#ifdef DEBUG_NFONTS
+ printf("##### [%s] dx: %d, dy: %d, dynSize: %d, dynFont: %p, ret: %p, fontAvailable: %d\n", __FUNCTION__, dx, dy, dynSize, *ret, ret, fontAvailable);
+#endif
+ return ret;
+}
diff --git a/src/driver/neutrinofonts.h b/src/driver/neutrinofonts.h
new file mode 100644
index 000000000..d03edf779
--- /dev/null
+++ b/src/driver/neutrinofonts.h
@@ -0,0 +1,119 @@
+/*
+ Neutrino-GUI - DBoxII-Project
+
+ Copyright (C) 2001 Steffen Hehn 'McClean'
+
+ CNeutrinoFonts class for gui.
+ Copyright (C) 2013, M. Liebmann (micha-bbg)
+
+ License: GPL
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __neutrinofonts__
+#define __neutrinofonts__
+
+typedef struct neutrino_font_descr {
+ std::string name;
+ std::string filename;
+ int size_offset;
+} neutrino_font_descr_struct;
+
+typedef struct font_sizes {
+ const neutrino_locale_t name;
+ const unsigned int defaultsize;
+ const unsigned int style;
+ const unsigned int size_offset;
+} font_sizes_struct;
+
+typedef struct font_sizes_groups {
+ const neutrino_locale_t groupname;
+ const unsigned int count;
+ const SNeutrinoSettings::FONT_TYPES *const content;
+ const char * const actionkey;
+ const neutrino_locale_t hint;
+} font_sizes_groups_struct;
+
+class CNeutrinoFonts
+{
+ private:
+ std::string fontStyle[3];
+ std::string dynFontStyle[3];
+
+ typedef struct dyn_font_t
+ {
+ int dx;
+ int dy;
+ int size;
+ int style;
+ std::string text;
+ Font* font;
+ bool useDigitOffset;
+ } dyn_font_struct_t;
+
+ typedef std::vector v_dyn_fonts_t;
+ v_dyn_fonts_t v_share_fonts;
+ v_dyn_fonts_t v_dyn_fonts;
+ bool useDigitOffset;
+
+ void InitDynFonts();
+ void refreshDynFont(int dx, int dy, std::string text, int style, int index, bool isShare);
+ int getFontHeight(Font* fnt);
+ int getDynFontSize(int dx, int dy, std::string text, int style);
+ Font **getDynFontShare(int &dx, int &dy, std::string text, int style);
+ Font **getDynFontWithID(int &dx, int &dy, std::string text, int style, unsigned int f_id);
+
+ public:
+ enum {
+ FONT_STYLE_REGULAR = 0,
+ FONT_STYLE_BOLD = 1,
+ FONT_STYLE_ITALIC = 2
+ };
+
+ enum {
+ FONT_ID_SHARE = -1
+ };
+ enum {
+ FONT_ID_VOLBAR,
+
+ FONT_ID_MAX
+ };
+ enum {
+ FONTSETUP_NEUTRINO_FONT = 1, /* refresh neutrino fonts */
+ FONTSETUP_NEUTRINO_FONT_INST = 2, /* delete & initialize font renderer class */
+ FONTSETUP_DYN_FONT = 4, /* refresh dynamic fonts */
+ FONTSETUP_DYN_FONT_INST = 8, /* delete & initialize font renderer class */
+
+ FONTSETUP_ALL = FONTSETUP_NEUTRINO_FONT | FONTSETUP_NEUTRINO_FONT_INST | FONTSETUP_DYN_FONT | FONTSETUP_DYN_FONT_INST
+ };
+
+ CNeutrinoFonts();
+ ~CNeutrinoFonts();
+ static CNeutrinoFonts* getInstance();
+
+ neutrino_font_descr_struct fontDescr;
+ neutrino_font_descr_struct old_fontDescr;
+
+ void SetupNeutrinoFonts(bool initRenderClass = true);
+ void SetupDynamicFonts(bool initRenderClass = true);
+ void refreshDynFonts();
+ Font **getDynFont(int &dx, int &dy, std::string text="", int style=FONT_STYLE_REGULAR, int share=FONT_ID_SHARE);
+ void setFontUseDigitHeight(bool set=true) {useDigitOffset = set;}
+};
+
+
+#endif //__neutrinofonts__
diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp
index 1c95f0241..79beccd25 100644
--- a/src/driver/rcinput.cpp
+++ b/src/driver/rcinput.cpp
@@ -53,6 +53,7 @@
#include
#include
#include
+#include
#include
//#define RCDEBUG
@@ -148,6 +149,7 @@ CRCInput::CRCInput()
repeat_block = repeat_block_generic = 0;
open();
rc_last_key = KEY_MAX;
+ firstKey = true;
//select and setup remote control hardware
set_rc_hw();
@@ -1081,6 +1083,10 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6
*msg = NeutrinoMessages::EVT_TUNE_COMPLETE;
*data = (neutrino_msg_data_t) p;
break;
+ case CZapitClient::EVT_BACK_ZAP_COMPLETE:
+ *msg = NeutrinoMessages::EVT_BACK_ZAP_COMPLETE;
+ *data = (neutrino_msg_data_t) p;
+ break;
default:
printf("[neutrino] event INITID_ZAPIT - unknown eventID 0x%x\n", emsg.eventID );
}
@@ -1230,6 +1236,10 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6
if (ev.type == EV_SYN)
continue; /* ignore... */
SHTDCNT::getInstance()->resetSleepTimer();
+ if (firstKey) {
+ firstKey = false;
+ CTimerManager::getInstance()->cancelShutdownOnWakeup();
+ }
uint32_t trkey = translate(ev.code, i);
#ifdef _DEBUG
printf("key: %04x value %d, translate: %04x -%s-\n", ev.code, ev.value, trkey, getKeyName(trkey).c_str());
diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h
index c88bc3495..f172b00d7 100644
--- a/src/driver/rcinput.h
+++ b/src/driver/rcinput.h
@@ -155,6 +155,7 @@ class CRCInput
int fd_max;
int clickfd;
+ bool firstKey;
__u16 rc_last_key;
void set_dsp();
diff --git a/src/driver/record.cpp b/src/driver/record.cpp
index 58951e430..1e5e17aee 100644
--- a/src/driver/record.cpp
+++ b/src/driver/record.cpp
@@ -161,10 +161,14 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel)
}
CGenPsi psi;
- if (allpids.PIDs.vpid != 0)
- psi.addPid(allpids.PIDs.vpid, recMovieInfo->VideoType ? EN_TYPE_AVC : EN_TYPE_VIDEO, 0);
-
numpids = 0;
+ if (allpids.PIDs.vpid != 0){
+ psi.addPid(allpids.PIDs.vpid, recMovieInfo->VideoType ? EN_TYPE_AVC : EN_TYPE_VIDEO, 0);
+ if (allpids.PIDs.pcrpid && (allpids.PIDs.pcrpid != allpids.PIDs.vpid)) {
+ psi.addPid(allpids.PIDs.pcrpid, EN_TYPE_PCR, 0);
+ apids[numpids++]=allpids.PIDs.pcrpid;
+ }
+ }
for (unsigned int i = 0; i < recMovieInfo->audioPids.size(); i++) {
apids[numpids++] = recMovieInfo->audioPids[i].epgAudioPid;
psi.addPid(recMovieInfo->audioPids[i].epgAudioPid, EN_TYPE_AUDIO, recMovieInfo->audioPids[i].atype);
@@ -341,8 +345,8 @@ void CRecordInstance::GetPids(CZapitChannel * channel)
allpids.PIDs.vtxtpid = channel->getTeletextPid();
allpids.PIDs.pmtpid = channel->getPmtPid();
allpids.PIDs.selected_apid = channel->getAudioChannelIndex();
-#if 0 // not needed
allpids.PIDs.pcrpid = channel->getPcrPid();
+#if 0 // not needed
allpids.PIDs.privatepid = channel->getPrivatePid();
#endif
allpids.APIDs.clear();
@@ -1617,6 +1621,8 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, CFrontend *
if(live_channel_id != channel_id) {
/* first try to get frontend for record with locked live */
bool unlock = true;
+ /* executed in neutrino thread - possible race with zap NOWAIT and epg scan zap */
+ CFEManager::getInstance()->Lock();
CFEManager::getInstance()->lockFrontend(live_fe);
frontend = CFEManager::getInstance()->allocateFE(channel, true);
if (frontend == NULL) {
@@ -1625,6 +1631,8 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, CFrontend *
CFEManager::getInstance()->unlockFrontend(live_fe);
frontend = CFEManager::getInstance()->allocateFE(channel, true);
}
+ CFEManager::getInstance()->Unlock();
+
if (frontend == NULL)
return false;
diff --git a/src/driver/scanepg.cpp b/src/driver/scanepg.cpp
index 4b893648f..b0e2075d5 100644
--- a/src/driver/scanepg.cpp
+++ b/src/driver/scanepg.cpp
@@ -42,6 +42,7 @@ extern CBouquetList * bouquetList;
CEpgScan::CEpgScan()
{
current_bnum = -1;
+ next_chid = 0;
}
CEpgScan::~CEpgScan()
@@ -60,6 +61,7 @@ void CEpgScan::Clear()
{
scanmap.clear();
current_bnum = -1;
+ next_chid = 0;
}
void CEpgScan::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data)
@@ -98,39 +100,66 @@ void CEpgScan::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data)
if (scanmap.empty())
return;
- t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID();
-
- CFrontend *live_fe = CZapit::getInstance()->GetLiveFrontend();
- CFEManager::getInstance()->lockFrontend(live_fe);
-#ifdef ENABLE_PIP
- CFrontend *pip_fe = CZapit::getInstance()->GetPipFrontend();
- if (pip_fe && pip_fe != live_fe)
- CFEManager::getInstance()->lockFrontend(pip_fe);
-#endif
- for (eit_scanmap_iterator_t it = scanmap.begin(); it != scanmap.end(); /* ++it*/) {
- newchan = CServiceManager::getInstance()->FindChannel(it->second);
- if ((newchan == NULL) || SAME_TRANSPONDER(live_channel_id, newchan->getChannelID())) {
- scanmap.erase(it++);
- continue;
- }
- if (CFEManager::getInstance()->canTune(newchan)) {
- INFO("try to scan [%s]", newchan->getName().c_str());
- bool ret = g_Zapit->zapTo_record(newchan->getChannelID()) > 0;
- if (ret) {
+ Next();
+ }
+ else if (msg == NeutrinoMessages::EVT_BACK_ZAP_COMPLETE) {
+ t_channel_id chid = *(t_channel_id *)data;
+ INFO("EVT_BACK_ZAP_COMPLETE [" PRINTF_CHANNEL_ID_TYPE "]", chid);
+ if (next_chid) {
+ newchan = CServiceManager::getInstance()->FindChannel(next_chid);
+ if (newchan) {
+ if(chid) {
+ INFO("try to scan [%s]", newchan->getName().c_str());
g_Sectionsd->setServiceChanged(newchan->getChannelID(), false, newchan->getRecordDemux());
- break;
} else {
- scanmap.erase(it++);
- continue;
+ INFO("tune failed [%s]", newchan->getName().c_str());
+ scanmap.erase(newchan->getTransponderId());
+ Next();
}
- } else
- INFO("skip [%s], cannot tune", newchan->getName().c_str());
- ++it;
+ }
}
- CFEManager::getInstance()->unlockFrontend(live_fe);
-#ifdef ENABLE_PIP
- if (pip_fe && pip_fe != live_fe)
- CFEManager::getInstance()->unlockFrontend(pip_fe);
-#endif
}
}
+
+void CEpgScan::Next()
+{
+ next_chid = 0;
+ if (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_standby)
+ return;
+
+ t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID();
+
+ /* executed in neutrino thread - possible race with locks in zapit zap NOWAIT :
+ send zapTo_NOWAIT -> EIT_COMPLETE from sectionsd -> zap and this at the same time
+ */
+ CFEManager::getInstance()->Lock();
+ CFrontend *live_fe = CZapit::getInstance()->GetLiveFrontend();
+ CFEManager::getInstance()->lockFrontend(live_fe);
+#ifdef ENABLE_PIP
+ CFrontend *pip_fe = CZapit::getInstance()->GetPipFrontend();
+ if (pip_fe && pip_fe != live_fe)
+ CFEManager::getInstance()->lockFrontend(pip_fe);
+#endif
+ for (eit_scanmap_iterator_t it = scanmap.begin(); it != scanmap.end(); /* ++it*/) {
+ CZapitChannel * newchan = CServiceManager::getInstance()->FindChannel(it->second);
+ if ((newchan == NULL) || SAME_TRANSPONDER(live_channel_id, newchan->getChannelID())) {
+ scanmap.erase(it++);
+ continue;
+ }
+ if (CFEManager::getInstance()->canTune(newchan)) {
+ INFO("try to tune [%s]", newchan->getName().c_str());
+ next_chid = newchan->getChannelID();
+ break;
+ } else
+ INFO("skip [%s], cannot tune", newchan->getName().c_str());
+ ++it;
+ }
+ CFEManager::getInstance()->unlockFrontend(live_fe);
+#ifdef ENABLE_PIP
+ if (pip_fe && pip_fe != live_fe)
+ CFEManager::getInstance()->unlockFrontend(pip_fe);
+#endif
+ CFEManager::getInstance()->Unlock();
+ if (next_chid)
+ g_Zapit->zapTo_epg(next_chid);
+}
diff --git a/src/driver/scanepg.h b/src/driver/scanepg.h
index d3c74bc60..bdd9f5c32 100644
--- a/src/driver/scanepg.h
+++ b/src/driver/scanepg.h
@@ -31,7 +31,9 @@ class CEpgScan
private:
int current_bnum;
eit_scanmap_t scanmap;
+ t_channel_id next_chid;
std::set scanned;
+ void Next();
CEpgScan();
public:
diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp
index 4cfb69f31..3f8f74ce5 100644
--- a/src/driver/streamts.cpp
+++ b/src/driver/streamts.cpp
@@ -396,6 +396,32 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid)
}
}
}
+ //add pcr pid
+ if(channel->getPcrPid() != channel->getVideoPid()){
+ pids.insert(channel->getPcrPid());
+ psi.addPid(channel->getPcrPid(), EN_TYPE_PCR, 0);
+ }
+ //add teletext pid
+ if (g_settings.recording_stream_vtxt_pid && channel->getTeletextPid() != 0){
+ pids.insert(channel->getTeletextPid());
+ psi.addPid(channel->getTeletextPid(), EN_TYPE_TELTEX, 0, channel->getTeletextLang());
+ }
+ //add dvb sub pid
+ if (g_settings.recording_stream_subtitle_pids){
+ for (int i = 0 ; i < (int)channel->getSubtitleCount() ; ++i) {
+ CZapitAbsSub* s = channel->getChannelSub(i);
+ if (s->thisSubType == CZapitAbsSub::DVB) {
+ if(i>9)//max sub pids
+ break;
+
+ CZapitDVBSub* sd = reinterpret_cast(s);
+ pids.insert(sd->pId);
+ psi.addPid( sd->pId, EN_TYPE_DVBSUB, 0, sd->ISO639_language_code.c_str() );
+ }
+ }
+
+ }
+
psi.genpsi(fd);
return !pids.empty();
diff --git a/src/driver/vfd.cpp b/src/driver/vfd.cpp
index 80e8f06f4..464639b4a 100644
--- a/src/driver/vfd.cpp
+++ b/src/driver/vfd.cpp
@@ -199,6 +199,16 @@ void CVFD::setled(int led1, int led2){
}
}
+void CVFD::setBacklight(bool on_off)
+{
+ if(cs_get_revision() != 9)
+ return;
+
+ int led = on_off ? FP_LED_3_ON : FP_LED_3_OFF;
+ if (ioctl(fd, IOC_FP_LED_CTRL, led) < 0)
+ perror("FP_LED_3");
+}
+
void CVFD::setled(bool on_off)
{
if(g_settings.led_rec_mode == 0)
diff --git a/src/driver/vfd.h b/src/driver/vfd.h
index b011881ed..4b3a5767e 100644
--- a/src/driver/vfd.h
+++ b/src/driver/vfd.h
@@ -106,6 +106,7 @@ class CVFD
void setlcdparameter(void);
void setled(void);
void setled(bool on_off);
+ void setBacklight(bool on_off);
static CVFD* getInstance();
void init(const char * fontfile, const char * fontname);
diff --git a/src/dt.c b/src/dt.c
new file mode 100644
index 000000000..301008c69
--- /dev/null
+++ b/src/dt.c
@@ -0,0 +1,189 @@
+/*
+ Copyright (C) 2013 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;
+
+ 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.
+*/
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "cs_frontpanel.h"
+
+int main(int argc, char **argv)
+{
+ int x, b, f;
+ int fd;
+ char s[1024];
+ time_t t;
+ struct tm *tmp;
+ unsigned int timer;
+
+ if (argc > 1)
+ {
+ fd = open("/dev/display", O_RDONLY);
+ if (fd < 0)
+ {
+ perror("/dev/display");
+ return -fd;
+ }
+
+ memset(s, 0, 1024);
+
+ for (x = 1; x < argc; x++)
+ {
+ if (argv[x][0] == '-')
+ {
+ if (sscanf(argv[x], "-b%d", &b) == 1)
+ {
+ if ((b < 16) && (b >= 0))
+ {
+ if (ioctl(fd, IOC_FP_SET_BRIGHT, (unsigned char) b))
+ perror("IOC_FP_SET_BRIGHT");
+ }
+ else
+ printf("Error: brightness is out of range (0 ... 16)\n\n");
+ }
+ else if (sscanf(argv[x], "-s%X:%X:%X", &b, &f, &timer) == 3)
+ {
+ if ((b < 16) && (b >= 0))
+ {
+ fp_standby_data_t standby;
+ char h[3], m[3];
+
+ t = time(NULL);
+ tmp = localtime(&t);
+ if (tmp == NULL) {
+ perror("localtime");
+ }
+ if (strftime(h, sizeof(h), "%_H", tmp) == 0) {
+ fprintf(stderr, "strftime returned 0\n");
+ }
+ if (strftime(m, sizeof(m), "%_M", tmp) == 0) {
+ fprintf(stderr, "strftime returned 0\n");
+ }
+
+ standby.brightness = b;
+ standby.flags = f & 0xFF;
+ standby.current_hour = atoi(h);
+ standby.current_minute = atoi(m);
+ standby.timer_minutes_hi = timer >> 8;
+ standby.timer_minutes_lo = timer & 0xFF;
+ printf("brightness %d\n", standby.brightness);
+ printf("flags %02X\n", standby.flags);
+ printf("current_hour %d\n", standby.current_hour);
+ printf("current_minute %d\n", standby.current_minute);
+ printf("timer_minutes_hi %d\n", standby.timer_minutes_hi);
+ printf("timer_minutes_lo %d\n", standby.timer_minutes_lo);
+
+ if (ioctl(fd, IOC_FP_STANDBY, (fp_standby_data_t *) &standby))
+ perror("IOC_FP_STANDBY");
+ }
+ else
+ printf("Error: brightness is out of range (0 ... 16)\n\n");
+ }
+ else if (sscanf(argv[x], "-is%X", &b) == 1)
+ {
+ if (ioctl(fd, IOC_FP_SET_ICON, (unsigned int) b))
+ perror("IOC_FP_SET_ICON");
+ }
+ else if (sscanf(argv[x], "-ic%X", &b) == 1)
+ {
+ if (ioctl(fd, IOC_FP_CLEAR_ICON, (unsigned int) b))
+ perror("IOC_FP_CLEAR_ICON");
+ }
+
+ else if (sscanf(argv[x], "-ps%X", &b) == 1)
+ {
+ if (ioctl(fd, IOC_FP_SET_OUTPUT, (unsigned char) b))
+ perror("IOC_FP_SET_OUTPUT");
+ }
+ else if (sscanf(argv[x], "-pc%X", &b) == 1)
+ {
+ if (ioctl(fd, IOC_FP_CLEAR_OUTPUT, (unsigned char) b))
+ perror("IOC_FP_CLEAR_OUTPUT");
+ }
+
+ else if (sscanf(argv[x], "-t%[^\n]", s) == 1)
+ {
+ if (ioctl(fd, IOC_FP_SET_TEXT, s))
+ perror("IOC_FP_SET_TEXT");
+ }
+ else if (sscanf(argv[x], "-ls%X", &b) == 1)
+ {
+ if ((b > 0) || (b <= 8)) {
+ if (ioctl(fd, IOC_FP_LED_CTRL, b | 0x80))
+ perror("IOC_FP_LED_CTRL");
+ }
+ }
+ else if (sscanf(argv[x], "-lc%X", &b) == 1)
+ {
+ if ((b > 0) || (b <= 8)) {
+ if (ioctl(fd, IOC_FP_LED_CTRL, b))
+ perror("IOC_FP_LED_CTRL");
+ }
+ }
+ else if (sscanf(argv[x], "-st%X", &b) == 1)
+ {
+ fp_standby_cmd_data_t pwr;
+ pwr.addr = 0;
+ pwr.cmd = b;
+ printf("standby command: %x\n", pwr.cmd);fflush(stdout);
+
+ if (ioctl(fd, IOC_FP_STANDBY_CMD, &pwr))
+ perror("IOC_FP_STANDBY_CMD");
+ }
+
+ else if (argv[x][1] == 'c')
+ {
+ if (strlen(argv[x]) == 2)
+ {
+ if (ioctl(fd, IOC_FP_CLEAR_ALL, NULL))
+ perror("IOC_FP_CLEAR_ALL");
+ }
+ else
+ {
+ if (ioctl(fd, IOC_FP_SET_TEXT, NULL))
+ perror("IOC_FP_SET_TEXT");
+ }
+ }
+ }
+ }
+ close(fd);
+ }
+ else
+ {
+ printf("%s\n", argv[0]);
+ printf("dt - displaytest usage:\n"
+ " -b set display brightness between 0 and 15\n"
+ " -t write a UTF-8 text to the display\n"
+ " -c clear entire display\n"
+ " -ct clear text on the display\n"
+ " -is set icon\n"
+ " -ic clear icon\n"
+ " -ps set port\n"
+ " -pc clear port\n"
+ " -ls led n on\n"
+ " -lc led n off\n"
+ " -s:: sets the box into standby (brightness, flags, timer)\n"
+ "\n");
+ }
+ return 0;
+}
diff --git a/src/eitd/SIsections.hpp b/src/eitd/SIsections.hpp
index 5862e1717..b537cadaf 100644
--- a/src/eitd/SIsections.hpp
+++ b/src/eitd/SIsections.hpp
@@ -65,8 +65,8 @@ struct SI_section_EIT_header {
unsigned segment_last_section_number : 8;
unsigned last_table_id : 8;
} __attribute__ ((packed)) ; // 14 bytes
-#if 0
-// unused
+
+#ifndef USE_DVBSI_EVENTS
struct SI_section_header {
unsigned table_id : 8;
#if __BYTE_ORDER == __BIG_ENDIAN
diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp
index c9e379b8c..17b7359c4 100644
--- a/src/eitd/sectionsd.cpp
+++ b/src/eitd/sectionsd.cpp
@@ -94,11 +94,7 @@ static bool messaging_zap_detected = false;
//NTP-Config
#define CONF_FILE CONFIGDIR "/neutrino.conf"
-#ifdef USE_BB_NTPD
-const std::string ntp_system_cmd_prefix = "/sbin/ntpd -q -p ";
-#else
-const std::string ntp_system_cmd_prefix = "ntpdate ";
-#endif
+std::string ntp_system_cmd_prefix = "ntpdate ";
std::string ntp_system_cmd;
std::string ntpserver;
@@ -2125,9 +2121,12 @@ bool CEitManager::Start()
oldEventsAre = config.epg_old_events*60L*60L; //hours
max_events = config.epg_max_events;
+ if (access("/sbin/ntpdate", F_OK))
+ ntp_system_cmd_prefix = "/sbin/ntpd -n -q -p ";
+
printf("[sectionsd] Caching: %d days, %d hours Extended Text, max %d events, Events are old %d hours after end time\n",
config.epg_cache, config.epg_extendedcache, config.epg_max_events, config.epg_old_events);
- printf("[sectionsd] NTP: %s, server %s\n", ntpenable ? "enabled" : "disabled", ntpserver.c_str());
+ printf("[sectionsd] NTP: %s, server %s, command %s\n", ntpenable ? "enabled" : "disabled", ntpserver.c_str(), ntp_system_cmd_prefix.c_str());
if (!sectionsd_server.prepare(SECTIONSD_UDS_NAME)) {
fprintf(stderr, "[sectionsd] failed to prepare basic server\n");
diff --git a/src/global.h b/src/global.h
index 5f7c0858b..af240b305 100644
--- a/src/global.h
+++ b/src/global.h
@@ -89,6 +89,7 @@ NEUTRINO_CPP CSectionsdClient *g_Sectionsd;
NEUTRINO_CPP CTimerdClient *g_Timerd;
NEUTRINO_CPP FBFontRenderClass *g_fontRenderer;
+NEUTRINO_CPP FBFontRenderClass *g_dynFontRenderer;
NEUTRINO_CPP Font * g_Font[SNeutrinoSettings::FONT_TYPE_COUNT];
NEUTRINO_CPP Font * g_SignalFont;
diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp
index a9b13d291..e91f4e1b5 100644
--- a/src/gui/audioplayer.cpp
+++ b/src/gui/audioplayer.cpp
@@ -831,7 +831,7 @@ int CAudioPlayerGui::show()
m_frameBuffer->paintBoxRel(x1 - 7, y1 - h - 5, w + 14, h + 10, COL_MENUCONTENT_PLUS_6, RADIUS_SMALL);
m_frameBuffer->paintBoxRel(x1 - 4, y1 - h - 3, w + 8, h + 6, COL_MENUCONTENTSELECTED_PLUS_0, RADIUS_SMALL);
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]
- ->RenderString(x1,y1,w+1,selectedKey,COL_MENUCONTENTSELECTED,0);
+ ->RenderString(x1,y1,w+1,selectedKey,COL_MENUCONTENTSELECTED_TEXT,0);
g_RCInput->getMsg_ms(&msg, &data, AUDIOPLAYERGUI_SMSKEY_TIMEOUT - 200);
@@ -1550,19 +1550,19 @@ void CAudioPlayerGui::paintItem(int pos)
int ypos = m_y + m_title_height + m_theight + pos*m_fheight;
int c_rad_small;
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
if ((pos + m_liststart) == m_selected)
{
if ((pos + m_liststart) == (unsigned)m_current)
{
- color = COL_MENUCONTENTSELECTED + 2;
+ color = COL_MENUCONTENTSELECTED_TEXT_PLUS_2;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_2;
}
else
{
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
}
paintItemID3DetailsLine(pos);
@@ -1574,12 +1574,12 @@ void CAudioPlayerGui::paintItem(int pos)
{
if ((pos + m_liststart) == (unsigned)m_current)
{
- color = COL_MENUCONTENTDARK + 2;
+ color = COL_MENUCONTENTDARK_TEXT_PLUS_2;
bgcolor = COL_MENUCONTENTDARK_PLUS_2;
}
else
{
- color = COL_MENUCONTENTDARK;
+ color = COL_MENUCONTENTDARK_TEXT;
bgcolor = COL_MENUCONTENTDARK_PLUS_0;
}
}
@@ -1587,12 +1587,12 @@ void CAudioPlayerGui::paintItem(int pos)
{
if ((pos + m_liststart) == (unsigned)m_current)
{
- color = COL_MENUCONTENT + 2;
+ color = COL_MENUCONTENT_TEXT_PLUS_2;
bgcolor = COL_MENUCONTENT_PLUS_2;
}
else
{
- color = COL_MENUCONTENT;
+ color = COL_MENUCONTENT_TEXT;
bgcolor = COL_MENUCONTENT_PLUS_0;
}
}
@@ -1820,7 +1820,7 @@ void CAudioPlayerGui::paintInfo()
if (xstart < 10)
xstart = 10;
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_fheight, m_width - 20,
- tmp, COL_MENUCONTENTSELECTED, 0, true); // UTF-8
+ tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8
// second line (Artist/Title...)
if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO &&
@@ -1849,7 +1849,7 @@ void CAudioPlayerGui::paintInfo()
xstart=(m_width-w)/2;
if (xstart < 10)
xstart=10;
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x+xstart, m_y +4+ 2*m_fheight, m_width- 20, tmp, COL_MENUCONTENTSELECTED, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x+xstart, m_y +4+ 2*m_fheight, m_width- 20, tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8
// reset so fields get painted always
m_metainfo.clear();
@@ -1935,7 +1935,7 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos)
ibox->paint(false);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + 10, ypos2 + 2 + 1*m_fheight, m_width- 80,
- m_playlist[m_selected].MetaData.title, COL_MENUCONTENTDARK, 0, true); // UTF-8
+ m_playlist[m_selected].MetaData.title, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8
std::string tmp;
if (m_playlist[m_selected].MetaData.genre.empty())
tmp = m_playlist[m_selected].MetaData.date;
@@ -1949,7 +1949,7 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos)
}
int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true) + 10; // UTF-8
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + m_width - w - 5, ypos2 + 2 + 1*m_fheight,
- w, tmp, COL_MENUCONTENTDARK, 0, true); // UTF-8
+ w, tmp, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8
tmp = m_playlist[m_selected].MetaData.artist;
if (!(m_playlist[m_selected].MetaData.album.empty()))
{
@@ -1958,7 +1958,7 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos)
tmp += ')';
}
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + 10, ypos2 + 2*m_fheight - 2, m_width - 20,
- tmp, COL_MENUCONTENTDARK, 0, true); // UTF-8
+ tmp, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8
}
else
{
@@ -2203,7 +2203,7 @@ void CAudioPlayerGui::updateMetaData(bool screen_saver)
int xstart = ((m_width - 20 - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(m_metainfo))/2)+10;
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]
->RenderString(m_x + xstart, m_y + 4 + 2*m_fheight + m_sheight,
- m_width- 2*xstart, m_metainfo, COL_MENUCONTENTSELECTED);
+ m_width- 2*xstart, m_metainfo, COL_MENUCONTENTSELECTED_TEXT);
m_frameBuffer->blit();
}
}
@@ -2250,7 +2250,7 @@ void CAudioPlayerGui::updateTimes(const bool force)
m_fheight, COL_MENUCONTENTSELECTED_PLUS_0);
if (m_time_total > 0)
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + m_width - w1 - 10, m_y + 4 + m_fheight,
- w1, tot_time, COL_MENUCONTENTSELECTED);
+ w1, tot_time, COL_MENUCONTENTSELECTED_TEXT);
}
if (updatePlayed || (m_state == CAudioPlayerGui::PAUSE))
{
@@ -2262,7 +2262,7 @@ void CAudioPlayerGui::updateTimes(const bool force)
if ((m_state != CAudioPlayerGui::PAUSE) || (tv.tv_sec & 1))
{
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + m_width - w1 - w2 - 11, m_y + 4 + m_fheight,
- w2+4, play_time, COL_MENUCONTENTSELECTED);
+ w2+4, play_time, COL_MENUCONTENTSELECTED_TEXT);
}
}
m_frameBuffer->blit();
@@ -2388,7 +2388,7 @@ bool CAudioPlayerGui::getNumericInput(neutrino_msg_t& msg, int& val) {
int h = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->getHeight();
m_frameBuffer->paintBoxRel(x1 - 7, y1 - h - 5, w + 14, h + 10, COL_MENUCONTENT_PLUS_6);
m_frameBuffer->paintBoxRel(x1 - 4, y1 - h - 3, w + 8, h + 6, COL_MENUCONTENTSELECTED_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->RenderString(x1, y1, w + 1, str, COL_MENUCONTENTSELECTED, 0);
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->RenderString(x1, y1, w + 1, str, COL_MENUCONTENTSELECTED_TEXT, 0);
m_frameBuffer->blit();
while (true)
{
diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp
index 537576955..f7a525016 100644
--- a/src/gui/bedit/bouqueteditor_bouquets.cpp
+++ b/src/gui/bedit/bouqueteditor_bouquets.cpp
@@ -74,13 +74,13 @@ CBEBouquetWidget::CBEBouquetWidget()
void CBEBouquetWidget::paintItem(int pos)
{
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
int ypos = y+ theight+0 + pos*iheight;
unsigned int current = liststart + pos;
if (current == selected) {
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0);
frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, RADIUS_LARGE);
@@ -88,7 +88,7 @@ void CBEBouquetWidget::paintItem(int pos)
bool has_channels = true;
if(current < Bouquets->size())
has_channels = (!(*Bouquets)[current]->tvChannels.empty() ) || (!(*Bouquets)[current]->radioChannels.empty());
- color = has_channels ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE;
+ color = has_channels ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT;
bgcolor = has_channels ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0;
frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor);
}
diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp
index 79c261784..c1681296f 100644
--- a/src/gui/bedit/bouqueteditor_channels.cpp
+++ b/src/gui/bedit/bouqueteditor_channels.cpp
@@ -97,13 +97,13 @@ CBEChannelWidget::~CBEChannelWidget()
void CBEChannelWidget::paintItem(int pos)
{
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
int ypos = y+ theight+0 + pos*iheight;
unsigned int current = liststart + pos;
if(current == selected) {
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
if(current < Channels->size()) {
@@ -114,7 +114,7 @@ void CBEChannelWidget::paintItem(int pos)
frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, COL_MENUCONTENT_PLUS_0);
frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor, RADIUS_LARGE);
} else {
- color = COL_MENUCONTENT;
+ color = COL_MENUCONTENT_TEXT;
bgcolor = COL_MENUCONTENT_PLUS_0;
frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor);
}
@@ -163,8 +163,9 @@ void CBEChannelWidget::paint()
int sbs= (selected/listmaxshow);
if (sbc < 1)
sbc = 1;
+ int sbh= (sb- 4)/ sbc;
- frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * (sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3);
+ frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs * sbh, 11, sbh, COL_MENUCONTENT_PLUS_3);
}
void CBEChannelWidget::paintHead()
diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp
index bda31cea5..4a20779ac 100644
--- a/src/gui/bedit/bouqueteditor_chanselect.cpp
+++ b/src/gui/bedit/bouqueteditor_chanselect.cpp
@@ -105,11 +105,11 @@ void CBEChannelSelectWidget::paintItem(uint32_t itemNr, int paintNr, bool pselec
{
int ypos = y+ theight + paintNr*iheight;
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
if (pselected)
{
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
if(itemNr < getItemCount()) {
@@ -122,7 +122,7 @@ void CBEChannelSelectWidget::paintItem(uint32_t itemNr, int paintNr, bool pselec
}
else
{
- color = COL_MENUCONTENT;
+ color = COL_MENUCONTENT_TEXT;
bgcolor = COL_MENUCONTENT_PLUS_0;
frameBuffer->paintBoxRel(x,ypos, width- 15, iheight, bgcolor);
}
@@ -201,10 +201,10 @@ void CBEChannelSelectWidget::paintFoot()
#if 0
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 3* ButtonWidth+ 8, y+height+1);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 3* ButtonWidth+ 38, y+height+24 - 2, width, g_Locale->getText(LOCALE_BOUQUETEDITOR_SWITCH), COL_INFOBAR, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 3* ButtonWidth+ 38, y+height+24 - 2, width, g_Locale->getText(LOCALE_BOUQUETEDITOR_SWITCH), COL_INFOBAR_TEXT, 0, true); // UTF-8
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HOME, x+width - ButtonWidth+ 8, y+height+1);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width - ButtonWidth+ 38, y+height+24 - 2, width, g_Locale->getText(LOCALE_BOUQUETEDITOR_RETURN), COL_INFOBAR, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width - ButtonWidth+ 38, y+height+24 - 2, width, g_Locale->getText(LOCALE_BOUQUETEDITOR_RETURN), COL_INFOBAR_TEXT, 0, true); // UTF-8
#endif
}
diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp
index 00c10abcd..42a2c237e 100644
--- a/src/gui/bookmarkmanager.cpp
+++ b/src/gui/bookmarkmanager.cpp
@@ -372,23 +372,23 @@ void CBookmarkManager::paintItem(int pos)
{
int ypos = y+ theight+0 + pos*fheight*2;
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
if (pos & 1)
{
- color = COL_MENUCONTENTDARK;
+ color = COL_MENUCONTENTDARK_TEXT;
bgcolor = COL_MENUCONTENTDARK_PLUS_0;
}
else
{
- color = COL_MENUCONTENT;
+ color = COL_MENUCONTENT_TEXT;
bgcolor = COL_MENUCONTENT_PLUS_0;
}
if (liststart + pos == selected)
{
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
}
@@ -449,14 +449,14 @@ void CBookmarkManager::paintFoot()
if (bookmarks.empty()) {
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 1* ButtonWidth + 10, y+height);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR_TEXT, 0, true); // UTF-8
}
else
{
::paintButtons(x + 10, y + height + 4, width, 2, BookmarkmanagerButtons, footerHeight, ButtonWidth);
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 1* ButtonWidth + 10, y+height);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width-1 * ButtonWidth + 38, y+height+footerHeight - 2, ButtonWidth- 28, g_Locale->getText(LOCALE_BOOKMARKMANAGER_SELECT), COL_INFOBAR_TEXT, 0, true); // UTF-8
}
}
diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp
index f9a955d27..c37d6655b 100644
--- a/src/gui/bouquetlist.cpp
+++ b/src/gui/bouquetlist.cpp
@@ -542,7 +542,7 @@ void CBouquetList::hide()
void CBouquetList::paintItem(int pos)
{
int ypos = y+ theight+0 + pos*fheight;
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
bool iscurrent = true;
int npos = liststart + pos;
@@ -552,7 +552,7 @@ void CBouquetList::paintItem(int pos)
lname = (Bouquets[npos]->zapitBouquet && Bouquets[npos]->zapitBouquet->bFav) ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : Bouquets[npos]->channelList->getName();
if (npos == (int) selected) {
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor, RADIUS_LARGE);
if(npos < (int) Bouquets.size())
@@ -560,7 +560,7 @@ void CBouquetList::paintItem(int pos)
} else {
if(npos < (int) Bouquets.size())
iscurrent = !Bouquets[npos]->channelList->isEmpty();
- color = iscurrent ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE;
+ color = iscurrent ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT;
bgcolor = iscurrent ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0;
frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor);
}
diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp
index ee75bbf98..a541d628e 100644
--- a/src/gui/cam_menu.cpp
+++ b/src/gui/cam_menu.cpp
@@ -107,12 +107,12 @@ int CCAMMenuHandler::doMainMenu()
//cammenu->addItem( GenericMenuSeparatorLine );
cammenu->addIntroItems();
- if(true /* CiSlots */) {
+ if(CiSlots) {
cammenu->addItem( new CMenuOptionChooser(LOCALE_CI_RESET_STANDBY, &g_settings.ci_standby_reset, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
cammenu->addItem( new CMenuOptionNumberChooser(LOCALE_CI_CLOCK, &g_settings.ci_clock, true, 6, 12, this));
- cammenu->addItem( new CMenuOptionChooser(LOCALE_CI_IGNORE_MSG, &g_settings.ci_ignore_messages, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
- cammenu->addItem( GenericMenuSeparatorLine );
}
+ cammenu->addItem( new CMenuOptionChooser(LOCALE_CI_IGNORE_MSG, &g_settings.ci_ignore_messages, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
+ cammenu->addItem( GenericMenuSeparatorLine );
CMenuWidget * tempMenu;
int i = 0;
diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp
index 58cdf23dd..9c5e992df 100644
--- a/src/gui/channellist.cpp
+++ b/src/gui/channellist.cpp
@@ -581,6 +581,30 @@ bool CChannelList::updateSelection(int newpos)
return actzap;
}
+int CChannelList::getPrevNextBouquet(bool next)
+{
+ bool found = true;
+ int dir = next ? 1 : -1;
+ int b_size = bouquetList->Bouquets.size(); /* bigger than 0 */
+ int nNext = (bouquetList->getActiveBouquetNumber() + b_size + dir) % b_size;
+ if(bouquetList->Bouquets[nNext]->channelList->isEmpty() ) {
+ found = false;
+ int n_old = nNext;
+ nNext = (nNext + b_size + dir) % b_size;
+ for (int i = nNext; i != n_old; i = (i + b_size + dir) % b_size) {
+ if( !bouquetList->Bouquets[i]->channelList->isEmpty() ) {
+ found = true;
+ nNext = i;
+ break;
+ }
+ }
+ }
+ if (found)
+ return nNext;
+
+ return -1;
+}
+
#define CHANNEL_SMSKEY_TIMEOUT 800
/* return: >= 0 to zap, -1 on cancel, -3 on list mode change, -4 list edited, -2 zap but no restore old list/chan ?? */
int CChannelList::show()
@@ -673,9 +697,10 @@ int CChannelList::show()
if (!CRecordManager::getInstance()->Record(chanlist[selected]->channel_id)) {
paintHead();
paint();
- } else
+ } else {
+ selected = oldselected;
loop=false;
-
+ }
}
}
else if( msg == CRCInput::RC_stop ) { //stopp recording
@@ -771,23 +796,8 @@ int CChannelList::show()
if (dline)
dline->kill(); //kill details line on change to next page
if (!bouquetList->Bouquets.empty()) {
- bool found = true;
- int dir = msg == (neutrino_msg_t)g_settings.key_bouquet_up ? 1 : -1;
- int b_size = bouquetList->Bouquets.size(); /* bigger than 0 */
- int nNext = (bouquetList->getActiveBouquetNumber() + b_size + dir) % b_size;
- if(bouquetList->Bouquets[nNext]->channelList->isEmpty() ) {
- found = false;
- int n_old = nNext;
- nNext = (nNext + b_size + dir) % b_size;
- for (int i = nNext; i != n_old; i = (i + b_size + dir) % b_size) {
- if( !bouquetList->Bouquets[i]->channelList->isEmpty() ) {
- found = true;
- nNext = i;
- break;
- }
- }
- }
- if(found) {
+ int nNext = getPrevNextBouquet(msg == (neutrino_msg_t)g_settings.key_bouquet_up);
+ if(nNext >= 0) {
bouquetList->activateBouquet(nNext, false);
res = bouquetList->showChannelList();
loop = false;
@@ -1374,7 +1384,7 @@ int CChannelList::numericZap(int key)
for (int i = maxchansize-1; i >= 0; i--) {
valstr[i+ 1] = 0;
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->RenderString(ox+fw/3+ i*fw, oy+sy-3, sx, &valstr[i], COL_INFOBAR);
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP]->RenderString(ox+fw/3+ i*fw, oy+sy-3, sx, &valstr[i], COL_INFOBAR_TEXT);
}
frameBuffer->blit();
@@ -1466,21 +1476,22 @@ CZapitChannel* CChannelList::getPrevNextChannel(int key, unsigned int &sl)
printf("CChannelList::getPrevNextChannel: selected %d total %d active bouquet %d total %d\n", (int)cactive, (int)chanlist.size(), bactive, bsize);
if ((key == g_settings.key_quickzap_down) || (key == CRCInput::RC_left)) {
if(cactive == 0) {
- if(bactive == 0)
- bactive = bsize - 1;
- else
- bactive--;
- bouquetList->activateBouquet(bactive, false);
- cactive = bouquetList->Bouquets[bactive]->channelList->getSize() - 1;
+ bactive = getPrevNextBouquet(false);
+ if (bactive >= 0) {
+ bouquetList->activateBouquet(bactive, false);
+ cactive = bouquetList->Bouquets[bactive]->channelList->getSize() - 1;
+ }
} else
--cactive;
}
else if ((key == g_settings.key_quickzap_up) || (key == CRCInput::RC_right)) {
cactive++;
if(cactive >= chanlist.size()) {
- bactive = (bactive + 1) % bsize;
- bouquetList->activateBouquet(bactive, false);
- cactive = 0;
+ bactive = getPrevNextBouquet(true);
+ if (bactive >= 0) {
+ bouquetList->activateBouquet(bactive, false);
+ cactive = 0;
+ }
}
}
sl = cactive;
@@ -1644,7 +1655,7 @@ void CChannelList::paintDetails(int index)
text3= text3+ " - ";
xstart += g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text3, true);
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, full_width - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, full_width - 30- noch_len, text3, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true);
}
if (!(text2.empty())) {
@@ -1661,12 +1672,12 @@ void CChannelList::paintDetails(int index)
}
}
#endif
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ fdescrheight+ fheight, full_width- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ fdescrheight+ fheight, full_width- xstart- 30- noch_len, text2, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true);
}
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, full_width - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true);
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- seit_len, y+ height+ 5+ fheight, seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- noch_len, y+ height+ 5+ fdescrheight+ fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, full_width - 30 - seit_len, text1, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- seit_len, y+ height+ 5+ fheight, seit_len, cSeit, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- noch_len, y+ height+ 5+ fdescrheight+ fheight, noch_len, cNoch, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8
}
if(g_settings.channellist_foot == 0) {
transponder t;
@@ -1678,7 +1689,7 @@ void CChannelList::paintDetails(int index)
else
desc = desc + " (" + CServiceManager::getInstance()->GetSatelliteName(chanlist[index]->getSatellitePosition()) + ")";
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2*fheight +fdescrheight, full_width - 30, desc.c_str(), COL_MENUCONTENTDARK, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2*fheight +fdescrheight, full_width - 30, desc.c_str(), COL_MENUCONTENTDARK_TEXT, 0, true);
}
else if( !displayNext && g_settings.channellist_foot == 1) { // next Event
char buf[128] = {0};
@@ -1691,8 +1702,8 @@ void CChannelList::paintDetails(int index)
snprintf(buf, sizeof(buf), "%s", CurrentNext.next_name.c_str());
int from_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(cFrom, true); // UTF-8
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2*fheight+ fdescrheight, full_width - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST :COL_MENUCONTENTDARK, 0, true);
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- from_len, y+ height+ 5+ 2*fheight+ fdescrheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_CHANNELLIST : COL_MENUCONTENTDARK, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2*fheight+ fdescrheight, full_width - 30 - from_len, buf, colored_event_N ? COL_COLORED_EVENTS_TEXT :COL_MENUCONTENTDARK_TEXT, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ full_width- 10- from_len, y+ height+ 5+ 2*fheight+ fdescrheight, from_len, cFrom, colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8
}
}
if ((g_settings.channellist_additional) && (p_event != NULL))
@@ -1857,7 +1868,7 @@ void CChannelList::paintButtonBar(bool is_current)
void CChannelList::paintItem(int pos, const bool firstpaint)
{
int ypos = y+ theight + pos*fheight;
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
bool iscurrent = true;
bool paintbuttons = false;
@@ -1874,14 +1885,14 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
iscurrent = SameTP(chanlist[curr]);
if (curr == selected) {
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
paintItem2DetailsLine (pos);
paintDetails(curr);
c_rad_small = RADIUS_LARGE;
paintbuttons = true;
} else {
- color = iscurrent ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE;
+ color = iscurrent ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT;
bgcolor = iscurrent ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0;
}
@@ -1895,7 +1906,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
CZapitChannel* chan = chanlist[curr];
int prg_offset=0;
int title_offset=0;
- uint8_t tcolor=(liststart + pos == selected) ? color : COL_MENUCONTENTINACTIVE;
+ fb_pixel_t tcolor=(liststart + pos == selected) ? color : COL_MENUCONTENTINACTIVE_TEXT;
int xtheight=fheight-2;
if(g_settings.channellist_extended)
@@ -2004,7 +2015,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
int max_desc_len = width - numwidth - prg_offset - ch_name_len - 15 - 20; // 15 = scrollbar, 20 = spaces
if (chan->scrambled || (g_settings.channellist_extended ||g_settings.channellist_epgtext_align_right))
- max_desc_len -= icon_space; /* do we need space for the lock/rec icon? */
+ max_desc_len -= icon_space+g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getWidth(); /* do we need space for the lock/rec icon? */
if (max_desc_len < 0)
max_desc_len = 0;
@@ -2017,7 +2028,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
struct tm *pStartZeit = localtime(&p_event->startTime);
snprintf((char*) tmp, sizeof(tmp), "%02d:%02d", pStartZeit->tm_hour, pStartZeit->tm_min);
-// g_Font[SNeutrinoSettings::FONT_TYPE_IMAGEINFO_SMALL]->RenderString(x+ 5+ numwidth+ 6, ypos+ xtheight, width- numwidth- 20- 15 -poffs, tmp, COL_MENUCONTENT, 0, true);
+// g_Font[SNeutrinoSettings::FONT_TYPE_IMAGEINFO_SMALL]->RenderString(x+ 5+ numwidth+ 6, ypos+ xtheight, width- numwidth- 20- 15 -poffs, tmp, COL_MENUCONTENT_TEXT, 0, true);
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x+ 5+ numwidth+ 6, ypos+ xtheight, width- numwidth- 20- 15 -prg_offset, tmp, tcolor, 0, true);
}
else
@@ -2048,11 +2059,11 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color, 0, true);
if (g_settings.channellist_epgtext_align_right) {
// align right
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 20 - ch_desc_len - icon_space - 4, ypos + fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED:(!displayNext ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE) , 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 20 - ch_desc_len - icon_space - 4, ypos + fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED_TEXT:(!displayNext ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT) , 0, true);
}
else {
// align left
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 5+ numwidth+ 10+ ch_name_len+ 5+prg_offset, ypos+ fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED:(!displayNext ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE) , 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 5+ numwidth+ 10+ ch_name_len+ 5+prg_offset, ypos+ fheight, ch_desc_len, p_event->description, (curr == selected)?COL_MENUCONTENTSELECTED_TEXT:(!displayNext ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT) , 0, true);
}
}
else {
@@ -2095,7 +2106,7 @@ void CChannelList::paintHead()
headerClock->setCornerType(CORNER_TOP_RIGHT);
headerClock->setYPos(y);
headerClock->setHeight(theight);
- headerClock->setTextColor(COL_MENUHEAD);
+ headerClock->setTextColor(COL_MENUHEAD_TEXT);
headerClock->setColorBody(COL_MENUHEAD_PLUS_0);
headerClock->refresh();
headerClockWidth = headerClock->getWidth();
@@ -2116,6 +2127,25 @@ void CChannelList::paint()
liststart = (selected/listmaxshow)*listmaxshow;
updateEvents(this->historyMode ? 0:liststart, this->historyMode ? 0:(liststart + listmaxshow));
+ if (g_settings.channellist_additional == 2) // with miniTV
+ {
+ // paint box for miniTV again - important!
+ frameBuffer->paintBoxFrame(x+width, y+theight , pig_width, pig_height, 10, COL_MENUCONTENT_PLUS_0, 0);
+ // 5px offset - same value as in list below
+#if 0
+ /* focus: its possible now to scale video with still image, but on nevis
+ artifacts possible on SD osd */
+ paint_pig(x+width+5, y+theight+5, pig_width-10, pig_height-10);
+#else
+ if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_tv) {
+ paint_pig(x+width+5, y+theight+5, pig_width-10, pig_height-10);
+ }
+ else if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_radio) {
+ g_PicViewer->DisplayImage(DATADIR "/neutrino/icons/radiomode.jpg", x+width+5, y+theight+5, pig_width-10, pig_height-10, frameBuffer->TM_NONE);
+ }
+#endif
+ }
+
// paint background for main box
frameBuffer->paintBoxRel(x, y+theight, width, height-footerHeight-theight, COL_MENUCONTENT_PLUS_0);
if (g_settings.channellist_additional)
@@ -2123,7 +2153,7 @@ void CChannelList::paint()
// disable displayNext
displayNext = false;
// paint background for right box
- frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,pig_height+infozone_height,COL_MENUCONTENT_PLUS_0);
+ frameBuffer->paintBoxRel(x+width,y+theight+pig_height,infozone_width,infozone_height,COL_MENUCONTENT_PLUS_0);
}
for(unsigned int count = 0; count < listmaxshow; count++) {
@@ -2141,24 +2171,6 @@ void CChannelList::paint()
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ sbs*(sb-4)/sbc, 11, (sb-4)/sbc, COL_MENUCONTENT_PLUS_3);
showChannelLogo();
- if (g_settings.channellist_additional == 2) // with miniTV
- {
- // paint box for miniTV again - important!
- frameBuffer->paintBoxRel(x+width, y+theight , pig_width, pig_height, COL_MENUCONTENT_PLUS_0);
- // 5px offset - same value as in list below
-#if 0
- /* focus: its possible now to scale video with still image, but on nevis
- artifacts possible on SD osd */
- paint_pig(x+width+5, y+theight+5, pig_width-10, pig_height-10);
-#else
- if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_tv) {
- paint_pig(x+width+5, y+theight+5, pig_width-10, pig_height-10);
- }
- else if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_radio) {
- g_PicViewer->DisplayImage(DATADIR "/neutrino/icons/radiomode.jpg", x+width+5, y+theight+5, pig_width-10, pig_height-10, frameBuffer->TM_NONE);
- }
-#endif
- }
}
bool CChannelList::isEmpty() const
@@ -2278,12 +2290,12 @@ void CChannelList::paint_events(int index)
if ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height))
{
bool first = false;
- fb_pixel_t color = COL_MENUCONTENTDARK;
+ fb_pixel_t color = COL_MENUCONTENTDARK_TEXT;
if (e->eventID)
{
first = (i == 1);
if ((first && g_settings.colored_events_channellist == 1 /* current */) || (!first && g_settings.colored_events_channellist == 2 /* next */))
- color = COL_COLORED_EVENTS_CHANNELLIST;
+ color = COL_COLORED_EVENTS_TEXT;
struct tm *tmStartZeit = localtime(&e->startTime);
strftime(startTime, sizeof(startTime), "%H:%M", tmStartZeit );
//printf("%s %s\n", startTime, e->description.c_str());
@@ -2342,7 +2354,7 @@ void CChannelList::showdescription(int index)
frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0);
for (int i = 1; (i < (int)epgText.size()+1) && ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height)); i++)
- g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, infozone_width - 20, epgText[i-1].first, COL_MENUCONTENTDARK , 0, true);
+ g_Font[eventFont]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, infozone_width - 20, epgText[i-1].first, COL_MENUCONTENTDARK_TEXT, 0, true);
}
void CChannelList::addTextToArray(const std::string & text, int screening) // UTF-8
diff --git a/src/gui/channellist.h b/src/gui/channellist.h
index 2f8d309f4..ce34914d1 100644
--- a/src/gui/channellist.h
+++ b/src/gui/channellist.h
@@ -114,15 +114,16 @@ private:
void calcSize();
std::string MaxChanNr();
void paint_pig(int x, int y, int w, int h);
- void paint_events(int index);
- CChannelEventList evtlist;
- void readEvents(const t_channel_id channel_id);
+ void paint_events(int index);
+ CChannelEventList evtlist;
+ void readEvents(const t_channel_id channel_id);
void showdescription(int index);
typedef std::pair epg_pair;
std::vector epgText;
int emptyLineCount;
void addTextToArray( const std::string & text, int screening );
void processTextToArray(std::string text, int screening = 0);
+ int getPrevNextBouquet(bool next);
public:
CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false);
diff --git a/src/gui/color.cpp b/src/gui/color.cpp
index 03de02f77..57c04ce2a 100644
--- a/src/gui/color.cpp
+++ b/src/gui/color.cpp
@@ -88,3 +88,131 @@ void fadeColor(unsigned char &r, unsigned char &g, unsigned char &b, int fade, b
recalcColor(b, fade);
protectColor(r,g,b, protect);
}
+
+unsigned char getBrightnessRGB(fb_pixel_t color)
+{
+ RgbColor rgb;
+ rgb.r = (color & 0x00FF0000) >> 16;
+ rgb.g = (color & 0x0000FF00) >> 8;
+ rgb.b = color & 0x000000FF;
+
+ return rgb.r > rgb.g ? (rgb.r > rgb.b ? rgb.r : rgb.b) : (rgb.g > rgb.b ? rgb.g : rgb.b);
+}
+
+fb_pixel_t changeBrightnessRGBRel(fb_pixel_t color, int br)
+{
+ int br_ = (int)getBrightnessRGB(color);
+ br_ += br;
+ if (br_ < 0) br_ = 0;
+ if (br_ > 255) br_ = 255;
+ return changeBrightnessRGB(color, (unsigned char)br_);
+}
+
+void changeBrightnessRGBRel2(RgbColor *rgb, int br)
+{
+ fb_pixel_t color = (((rgb->r << 16) & 0x00FF0000) |
+ ((rgb->g << 8) & 0x0000FF00) |
+ ((rgb->b ) & 0x000000FF));
+ int br_ = (int)getBrightnessRGB(color);
+ br_ += br;
+ if (br_ < 0) br_ = 0;
+ if (br_ > 255) br_ = 255;
+
+ HsvColor hsv;
+ Rgb2Hsv(rgb, &hsv);
+ hsv.v = br;
+ Hsv2Rgb(&hsv, rgb);
+}
+
+fb_pixel_t changeBrightnessRGB(fb_pixel_t color, unsigned char br)
+{
+ HsvColor hsv;
+ RgbColor rgb;
+
+ unsigned char tr;
+ tr = (color & 0xFF000000) >> 24;
+ rgb.r = (color & 0x00FF0000) >> 16;
+ rgb.g = (color & 0x0000FF00) >> 8;
+ rgb.b = color & 0x000000FF;
+
+ Rgb2Hsv(&rgb, &hsv);
+ hsv.v = br;
+ Hsv2Rgb(&hsv, &rgb);
+
+ return (((tr << 24) & 0xFF000000) |
+ ((rgb.r << 16) & 0x00FF0000) |
+ ((rgb.g << 8) & 0x0000FF00) |
+ ((rgb.b ) & 0x000000FF));
+}
+
+void Hsv2Rgb(HsvColor *hsv, RgbColor *rgb)
+{
+ unsigned char region, remainder, p, q, t;
+
+ if (hsv->s == 0) {
+ rgb->r = hsv->v;
+ rgb->g = hsv->v;
+ rgb->b = hsv->v;
+ return;
+ }
+
+ region = hsv->h / 43;
+ remainder = (hsv->h - (region * 43)) * 6;
+
+ p = (hsv->v * (255 - hsv->s)) >> 8;
+ q = (hsv->v * (255 - ((hsv->s * remainder) >> 8))) >> 8;
+ t = (hsv->v * (255 - ((hsv->s * (255 - remainder)) >> 8))) >> 8;
+
+ switch (region) {
+ case 0:
+ rgb->r = hsv->v; rgb->g = t; rgb->b = p;
+ break;
+ case 1:
+ rgb->r = q; rgb->g = hsv->v; rgb->b = p;
+ break;
+ case 2:
+ rgb->r = p; rgb->g = hsv->v; rgb->b = t;
+ break;
+ case 3:
+ rgb->r = p; rgb->g = q; rgb->b = hsv->v;
+ break;
+ case 4:
+ rgb->r = t; rgb->g = p; rgb->b = hsv->v;
+ break;
+ default:
+ rgb->r = hsv->v; rgb->g = p; rgb->b = q;
+ break;
+ }
+
+ return;
+}
+
+void Rgb2Hsv(RgbColor *rgb, HsvColor *hsv)
+{
+ unsigned char rgbMin, rgbMax;
+
+ rgbMin = rgb->r < rgb->g ? (rgb->r < rgb->b ? rgb->r : rgb->b) : (rgb->g < rgb->b ? rgb->g : rgb->b);
+ rgbMax = rgb->r > rgb->g ? (rgb->r > rgb->b ? rgb->r : rgb->b) : (rgb->g > rgb->b ? rgb->g : rgb->b);
+
+ hsv->v = rgbMax;
+ if (hsv->v == 0) {
+ hsv->h = 0;
+ hsv->s = 0;
+ return;
+ }
+
+ hsv->s = 255 * long(rgbMax - rgbMin) / hsv->v;
+ if (hsv->s == 0) {
+ hsv->h = 0;
+ return;
+ }
+
+ if (rgbMax == rgb->r)
+ hsv->h = 0 + 43 * (rgb->g - rgb->b) / (rgbMax - rgbMin);
+ else if (rgbMax == rgb->g)
+ hsv->h = 85 + 43 * (rgb->b - rgb->r) / (rgbMax - rgbMin);
+ else
+ hsv->h = 171 + 43 * (rgb->r - rgb->g) / (rgbMax - rgbMin);
+
+ return;
+}
diff --git a/src/gui/color.h b/src/gui/color.h
index 7e58324fa..8e6a2e75c 100644
--- a/src/gui/color.h
+++ b/src/gui/color.h
@@ -33,7 +33,10 @@
#ifndef __color__
#define __color__
-#define COL_MAXFREE 254-8*9 - 1
+#include
+
+#define COL_MAXFREE 254-8*12 - 1
+#define COL_NEUTRINO_TEXT 254-8*12 // 24 values
#define COL_COLORED_EVENTS_CHANNELLIST 254-8*9
#define COL_COLORED_EVENTS_INFOBAR 254-8*8
#define COL_INFOBAR_SHADOW 254-8*7
@@ -90,6 +93,23 @@
#define COL_MENUCONTENTSELECTED_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTSELECTED + 2)])
#define COL_MENUCONTENTINACTIVE_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_MENUCONTENTINACTIVE + 0)])
#define COL_BACKGROUND_PLUS_0 (CFrameBuffer::getInstance()->realcolor[(COL_BACKGROUND + 0)])
+
+// text colors
+#define COL_COLORED_EVENTS_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 0)])
+#define COL_INFOBAR_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 1)])
+#define COL_INFOBAR_SHADOW_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 2)])
+#define COL_MENUHEAD_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 3)])
+#define COL_MENUCONTENT_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 4)])
+#define COL_MENUCONTENT_TEXT_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 5)])
+#define COL_MENUCONTENT_TEXT_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 6)])
+#define COL_MENUCONTENT_TEXT_PLUS_3 (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 7)])
+#define COL_MENUCONTENTDARK_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 8)])
+#define COL_MENUCONTENTDARK_TEXT_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 9)])
+#define COL_MENUCONTENTDARK_TEXT_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 10)])
+#define COL_MENUCONTENTSELECTED_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 11)])
+#define COL_MENUCONTENTSELECTED_TEXT_PLUS_1 (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 12)])
+#define COL_MENUCONTENTSELECTED_TEXT_PLUS_2 (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 13)])
+#define COL_MENUCONTENTINACTIVE_TEXT (CFrameBuffer::getInstance()->realcolor[(COL_NEUTRINO_TEXT + 14)])
#endif
@@ -98,5 +118,25 @@ int convertSetupAlpha2Alpha(unsigned char alpha);
void fadeColor(unsigned char &r, unsigned char &g, unsigned char &b, int fade, bool protect=true);
+typedef struct {
+ unsigned char r;
+ unsigned char g;
+ unsigned char b;
+} RgbColor;
+
+typedef struct {
+ unsigned char h;
+ unsigned char s;
+ unsigned char v;
+} HsvColor;
+
+unsigned char getBrightnessRGB(fb_pixel_t color);
+
+fb_pixel_t changeBrightnessRGBRel(fb_pixel_t color, int br);
+fb_pixel_t changeBrightnessRGB(fb_pixel_t color, unsigned char br);
+void changeBrightnessRGBRel2(RgbColor *rgb, int br);
+
+void Hsv2Rgb(HsvColor *hsv, RgbColor *rgb);
+void Rgb2Hsv(RgbColor *rgb, HsvColor *hsv);
#endif
diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp
index f00078539..9cd5eed0b 100644
--- a/src/gui/components/cc_frm.cpp
+++ b/src/gui/components/cc_frm.cpp
@@ -1,5 +1,5 @@
/*
- Based up Neutrino-GUI - Tuxbox-Project
+ Based up Neutrino-GUI - Tuxbox-Project
Copyright (C) 2001 by Steffen Hehn 'McClean'
Classes for generic GUI-related components.
@@ -88,14 +88,14 @@ void CComponentsForm::clearCCItems()
return;
#ifdef DEBUG_CC
printf(" [CComponentsForm] %s... delete %d cc-item(s) \n", __FUNCTION__, v_cc_items.size());
-#endif
-
+#endif
+
for(size_t i=0; igetItemType());
#endif
- delete v_cc_items[i];
+ delete v_cc_items[i];
v_cc_items[i] = NULL;
}
}
@@ -107,8 +107,8 @@ void CComponentsForm::initVarForm()
{
//CComponentsItem
initVarItem();
-
-
+
+
//simple default dimensions
x = 0;
y = 0;
@@ -147,7 +147,7 @@ void CComponentsForm::addCCItem(CComponentsItem* cc_Item)
cc_Item->setIndex(new_index);
#ifdef DEBUG_CC
printf(" %s-%d parent index = %d, assigned index ======> %d\n", __FUNCTION__, __LINE__, cc_item_index, new_index);
-#endif
+#endif
}
#ifdef DEBUG_CC
else
@@ -160,7 +160,7 @@ int CComponentsForm::getCCItemId(CComponentsItem* cc_Item)
if (cc_Item){
for (size_t i= 0; i< v_cc_items.size(); i++)
if (v_cc_items[i] == cc_Item)
- return i;
+ return i;
}
return -1;
}
@@ -224,7 +224,7 @@ void CComponentsForm::insertCCItem(const uint& cc_item_id, CComponentsItem* cc_I
#endif
return;
}
-
+
if (v_cc_items.empty()){
addCCItem(cc_Item);
#ifdef DEBUG_CC
@@ -306,13 +306,13 @@ void CComponentsForm::paintCCItems()
//set required x-position to item
if (xpos == CC_APPEND){
auto_x += append_h_offset;
- cc_item->setRealXPos(auto_x + xpos + 1);
+ cc_item->setRealXPos(auto_x + xpos + 1);
auto_x += w_item;
}
- else{
+ else{
cc_item->setRealXPos(this_x + xpos);
auto_x = (cc_item->getRealXPos() + w_item);
- }
+ }
//set required y-position to item
if (ypos == CC_APPEND){
@@ -320,17 +320,17 @@ void CComponentsForm::paintCCItems()
cc_item->setRealYPos(auto_y + ypos + 1);
auto_y += h_item;
}
- else{
+ else{
cc_item->setRealYPos(this_y + ypos);
auto_y = (cc_item->getRealYPos() + h_item);
- }
+ }
- //These steps check whether the element can be painted into the container.
+ //These steps check whether the element can be painted into the container.
//Is it too wide or too high, it will be shortened and displayed in the log.
//This should be avoid!
- //checkwidth and adapt if required
- int right_frm = (cc_parent ? cc_xr : x) + width - 2*fr_thickness;
+ //checkwidth and adapt if required
+ int right_frm = (cc_parent ? cc_xr : x) + width - fr_thickness;
int right_item = cc_item->getRealXPos() + w_item;
int w_diff = right_item - right_frm;
int new_w = w_item - w_diff;
@@ -341,7 +341,7 @@ void CComponentsForm::paintCCItems()
}
//check height and adapt if required
- int bottom_frm = (cc_parent ? cc_yr : y) + height - 2*fr_thickness;
+ int bottom_frm = (cc_parent ? cc_yr : y) + height - fr_thickness;
int bottom_item = cc_item->getRealYPos() + h_item;
int h_diff = bottom_item - bottom_frm;
int new_h = h_item - h_diff;
@@ -367,7 +367,7 @@ void CComponentsForm::hide(bool no_restore)
break;
}
}
-
+
//hide body
hideCCItem(no_restore);
}
diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp
index b302caee5..d78471f63 100644
--- a/src/gui/components/cc_frm_button.cpp
+++ b/src/gui/components/cc_frm_button.cpp
@@ -45,7 +45,7 @@ CComponentsButton::CComponentsButton( const int x_pos, const int y_pos, const i
initVarButton();
cc_btn_icon = icon_name;
cc_btn_capt = caption;
- cc_btn_capt_col = COL_MENUCONTENT;
+ cc_btn_capt_col = COL_MENUCONTENT_TEXT;
cc_btn_text_w = cc_btn_font->getRenderWidth(cc_btn_capt, true);
cc_btn_text_h = cc_btn_font->getHeight();
@@ -132,7 +132,7 @@ void CComponentsButton::initCaption()
//set properties to label object
if (cc_btn_capt_obj){
cc_btn_capt_obj->setDimensionsAll(cap_x, cap_y, width-cap_x, height);
- cc_btn_capt_obj->setTextColor(this->cc_item_enabled ? COL_MENUCONTENT : COL_MENUCONTENTINACTIVE);
+ cc_btn_capt_obj->setTextColor(this->cc_item_enabled ? COL_MENUCONTENT_TEXT : COL_MENUCONTENTINACTIVE_TEXT);
cc_btn_capt_obj->setText(cc_btn_capt, CTextBox::NO_AUTO_LINEBREAK, cc_btn_font);
cc_btn_capt_obj->forceTextPaint(); //here required;
cc_btn_capt_obj->doPaintBg(false);
diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp
index 4d3f3e957..eda580c72 100644
--- a/src/gui/components/cc_frm_clock.cpp
+++ b/src/gui/components/cc_frm_clock.cpp
@@ -70,7 +70,7 @@ void CComponentsFrmClock::initVarClock()
corner_rad = RADIUS_SMALL;
cl_font = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO];
- cl_col_text = COL_MENUCONTENT;
+ cl_col_text = COL_MENUCONTENT_TEXT;
cl_format_str = "%H:%M";
cl_align = CC_ALIGN_VER_CENTER | CC_ALIGN_HOR_CENTER;
@@ -140,7 +140,7 @@ void CComponentsFrmClock::initCCLockItems()
lbl->setCornerType(corner_type);
//set text border to 0
- lbl->setTextBorderWidth(0);
+ lbl->setTextBorderWidth(0,0);
}
}
diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp
index 4e9067f3a..da53e5de2 100644
--- a/src/gui/components/cc_frm_header.cpp
+++ b/src/gui/components/cc_frm_header.cpp
@@ -107,7 +107,7 @@ void CComponentsHeader::initVarHeader()
cch_icon_name = NULL;
cch_btn_obj = NULL;
cch_text = "";
- cch_col_text = COL_MENUHEAD;
+ cch_col_text = COL_MENUHEAD_TEXT;
cch_items_y = 0;
cch_offset = 8;
cch_icon_x = cch_offset;
diff --git a/src/gui/components/cc_item_infobox.h b/src/gui/components/cc_item_infobox.h
index 3e23de78f..afcfffd5b 100644
--- a/src/gui/components/cc_item_infobox.h
+++ b/src/gui/components/cc_item_infobox.h
@@ -67,7 +67,7 @@ class CComponentsInfoBox : public CComponentsText
CComponentsInfoBox( const int x_pos, const int y_pos, const int w, const int h,
std::string info_text = "", const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL,
bool has_shadow = CC_SHADOW_OFF,
- fb_pixel_t color_text = COL_MENUCONTENT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
+ fb_pixel_t color_text = COL_MENUCONTENT_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
~CComponentsInfoBox();
diff --git a/src/gui/components/cc_item_progressbar.cpp b/src/gui/components/cc_item_progressbar.cpp
index d2b77720e..41bfa2d62 100644
--- a/src/gui/components/cc_item_progressbar.cpp
+++ b/src/gui/components/cc_item_progressbar.cpp
@@ -202,7 +202,7 @@ void CProgressBar::paintAdvanced()
if (pb_active_width > pb_last_width) {
int step, off;
int b = 0;
- uint8_t diff = 0;
+ uint32_t diff = 0;
for (i = 0; (i < rd) && (i < maxi); i++) {
diff = i * 255 / rd;
if (pb_invert)
@@ -252,7 +252,7 @@ void CProgressBar::paintAdvanced()
}
}
for(i = maxi; i < total; i++) {
- for (j = 0; j < hcnt; j++) {//TODO: use shape cc-item
+ for (j = 0; j < hcnt; j++) {
int sh_x = pb_x + i * itemw;
int sh_y = py + j * itemh;
paintShapes(sh_x, sh_y, pointx, pointy, pb_passive_col); //fill passive
@@ -288,5 +288,6 @@ void CProgressBar::paintProgress(bool do_save_bg)
void CProgressBar::paint(bool do_save_bg)
{
+
paintProgress(do_save_bg);
}
diff --git a/src/gui/components/cc_item_progressbar.h b/src/gui/components/cc_item_progressbar.h
index ad8e6d274..eb22f8bf7 100644
--- a/src/gui/components/cc_item_progressbar.h
+++ b/src/gui/components/cc_item_progressbar.h
@@ -1,7 +1,7 @@
/*
Based up Neutrino-GUI - Tuxbox-Project
Copyright (C) 2001 by Steffen Hehn 'McClean'
-
+
(C) 2008, 2013 by Thilo Graf
(C) 2009,2010,2013 Stefan Seyfried
@@ -23,7 +23,7 @@
Boston, MA 02110-1301, USA.
*/
-///
+///
/*!
description of parameters:
@@ -45,7 +45,7 @@
paintZero > optional, if set to true and value = 0, then paints a diagonal line instead of active bar as symbolic for a zero value
*/
-
+
#ifndef __CC_PROGRESSBAR_H__
#define __CC_PROGRESSBAR_H__
@@ -57,28 +57,28 @@ class CProgressBar : public CComponentsItem
{
protected:
void initVarProgressbar();
-
+
private:
///colors of active and passive bar area, active means the displayed value, passive the neutral area
fb_pixel_t pb_active_col, pb_passive_col;
-
+
int pb_last_width;
///width of progress
int pb_active_width, pb_passive_width;
-
+
///maximal width,heigth of progress
int pb_max_width, pb_height;
///start position of bars
int pb_start_x_passive;
-
+
///color values
int pb_red, pb_green, pb_yellow;
///start position of activ/passiv area
int pb_x, pb_y;
-
+
bool pb_blink, pb_invert, pb_bl_changed;
///causes a diagonal line as a sign for 0 value instead of an empty bar
@@ -92,13 +92,13 @@ class CProgressBar : public CComponentsItem
///paint version of progressbar with color and advanced display modifications
void paintAdvanced();
///painting of activ/passive bars via shape object
- void paintShapes(int &shx, int ­, int &shw, int &shh, fb_pixel_t &col);
-
+ static void paintShapes(int &shx, int ­, int &shw, int &shh, fb_pixel_t &col);
+
void initDimensions();
///paints graph
void paintProgress(bool do_save_bg = CC_SAVE_SCREEN_NO);
-
+
static inline unsigned int make16color(__u32 rgb){return 0xFF000000 | rgb;};
public:
@@ -128,7 +128,7 @@ class CProgressBar : public CComponentsItem
///causes painting a diagonal line if value = 0, Note: ineffective in colored mode
void setZeroLine(bool paint_zero_line = true){pb_paint_zero = paint_zero_line;};
-
+
///setters for status colors
void setActiveColor(fb_pixel_t active_color) {pb_active_col = active_color;};
void setPassiveColor(fb_pixel_t passive_color) {pb_passive_col = passive_color;};
@@ -149,7 +149,7 @@ class CProgressBar : public CComponentsItem
const int val, const int max_val){x=x_pos; y=y_pos; width=w; height=h; pb_value=val; pb_max_value=max_val;};
///force update on next paint
- void reset() { pb_last_width = -1; }
+ void reset() { pb_last_width = -1; }
void paint(bool do_save_bg = CC_SAVE_SCREEN_NO);
enum pb_color_t {
@@ -160,5 +160,5 @@ class CProgressBar : public CComponentsItem
};
};
-
+
#endif /* __CC_PROGRESSBAR_H__ */
diff --git a/src/gui/components/cc_item_shapes.h b/src/gui/components/cc_item_shapes.h
index ffde992f4..b6900c820 100644
--- a/src/gui/components/cc_item_shapes.h
+++ b/src/gui/components/cc_item_shapes.h
@@ -1,5 +1,5 @@
/*
- Based up Neutrino-GUI - Tuxbox-Project
+ Based up Neutrino-GUI - Tuxbox-Project
Copyright (C) 2001 by Steffen Hehn 'McClean'
Classes for generic GUI-related components.
@@ -49,7 +49,7 @@ class CComponentsShapeCircle : public CComponentsItem
///set property: diam
inline void setDiam(const int& diam){d=width=height=diam, corner_rad=d/2;};
///get property: diam
- inline int getDiam(){return d;};
+ inline int getDiam() const {return d;};
///paint item
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
@@ -60,7 +60,7 @@ class CComponentsShapeSquare : public CComponentsItem
public:
CComponentsShapeSquare( const int x_pos, const int y_pos, const int w, const int h, bool has_shadow = CC_SHADOW_ON,
fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
-
+
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
};
diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp
index d93836488..c0dbd024a 100644
--- a/src/gui/components/cc_item_text.cpp
+++ b/src/gui/components/cc_item_text.cpp
@@ -1,5 +1,5 @@
/*
- Based up Neutrino-GUI - Tuxbox-Project
+ Based up Neutrino-GUI - Tuxbox-Project
Copyright (C) 2001 by Steffen Hehn 'McClean'
Classes for generic GUI-related components.
@@ -42,6 +42,8 @@ CComponentsText::CComponentsText()
{
//CComponentsText
initVarText();
+
+ initCCText();
}
CComponentsText::CComponentsText( const int x_pos, const int y_pos, const int w, const int h,
@@ -57,17 +59,17 @@ CComponentsText::CComponentsText( const int x_pos, const int y_pos, const int w,
y = y_pos,
width = w;
height = h;
-
+
col_frame = color_frame;
col_body = color_body;
col_shadow = color_shadow;
shadow = has_shadow;
-
+
ct_font = font_text;
ct_text = text;
ct_text_mode = mode;
ct_col_text = color_text;
-
+
initCCText();
}
@@ -90,18 +92,24 @@ void CComponentsText::initVarText()
//CComponentsText
ct_font = NULL;
- ct_box = NULL;
ct_textbox = NULL;
ct_text = "";
ct_old_text = ct_text;
ct_text_mode = CTextBox::AUTO_WIDTH;
+ pX = &x;
+ pY = &y;
+ pHeight = &height;
+ pWidth = &width;
+
/* we need a minimal borderwith of 1px because the edge-smoothing
(or fontrenderer?) otherwise will paint single pixels outside the
defined area. e.g. 'j' is leaving such residues */
- ct_text_border = 1;
+ ct_text_Hborder = 1;
+ ct_text_Vborder = 0;
- ct_col_text = COL_MENUCONTENT;
+ ct_col_text = COL_MENUCONTENT_TEXT;
+ ct_old_col_text = ct_col_text;
ct_text_sent = false;
ct_paint_textbg = false;
ct_force_text_paint = false;
@@ -117,24 +125,17 @@ void CComponentsText::initCCText()
//define height from font size
height = max(height, ct_font->getHeight());
- //text box dimensions
- if (ct_box== NULL){
- //ensure that we have a new instance
- delete ct_box;
- ct_box = NULL;
- }
-
//using of real x/y values to paint images if this text object is bound in a parent form
int tx = x, ty = y;
if (cc_parent){
tx = cc_xr;
ty = cc_yr;
}
- ct_box = new CBox();
- ct_box->iX = tx+fr_thickness;
- ct_box->iY = ty+fr_thickness;
- ct_box->iWidth = width-2*fr_thickness;
- ct_box->iHeight = height-2*fr_thickness;
+ //init text box dimensions
+ this->iX/*x*/ = tx+fr_thickness;
+ this->iY/*y*/ = ty+fr_thickness;
+ this->iWidth/*width*/ = width-2*fr_thickness;
+ this->iHeight/*height*/ = height-2*fr_thickness;
//init textbox
if (ct_textbox == NULL)
@@ -143,30 +144,27 @@ void CComponentsText::initCCText()
//set text box properties
ct_textbox->setTextFont(ct_font);
ct_textbox->setTextMode(ct_text_mode);
- ct_textbox->setWindowPos(ct_box);
- ct_textbox->setTextBorderWidth(ct_text_border);
+ ct_textbox->setWindowPos(this);
+ ct_textbox->setTextBorderWidth(ct_text_Hborder, ct_text_Vborder);
ct_textbox->enableBackgroundPaint(ct_paint_textbg);
ct_textbox->setBackGroundColor(col_body);
ct_textbox->setBackGroundRadius(corner_rad-fr_thickness, corner_type);
ct_textbox->setTextColor(ct_col_text);
- ct_textbox->setWindowMaxDimensions(ct_box->iWidth, ct_box->iHeight);
- ct_textbox->setWindowMinDimensions(ct_box->iWidth, ct_box->iHeight);
+ ct_textbox->setWindowMaxDimensions(width, height);
+ ct_textbox->setWindowMinDimensions(width, height);
- //send text to CTextBox object, but paint text only if text has changed or force option is enabled
- if ((ct_old_text != ct_text) || ct_force_text_paint)
- ct_text_sent = ct_textbox->setText(&ct_text, ct_box->iWidth);
- ct_old_text = ct_text;
+ //send text to CTextBox object, but paint text only if text or text coloer has changed or force option is enabled
+ if ((ct_old_text != ct_text) || ct_old_col_text != ct_col_text || ct_force_text_paint)
+ ct_text_sent = ct_textbox->setText(&ct_text, this->iWidth);
+ ct_old_text = ct_text;
+ ct_old_col_text = ct_col_text;
#ifdef DEBUG_CC
- printf(" [CComponentsText] [%s - %d] init text: %s [x %d, y %d, w %d, h %d]\n", __FUNCTION__, __LINE__, ct_text.c_str(), ct_box->iX, ct_box->iY, ct_box->iWidth, ct_box->iHeight);
+ printf(" [CComponentsText] [%s - %d] init text: %s [x %d, y %d, w %d, h %d]\n", __FUNCTION__, __LINE__, ct_text.c_str(), this->iX, this->iY, this->iWidth, this->iHeight);
#endif
}
void CComponentsText::clearCCText()
{
- if (ct_box)
- delete ct_box;
- ct_box = NULL;
-
if (ct_textbox)
delete ct_textbox;
ct_textbox = NULL;
@@ -206,21 +204,21 @@ bool CComponentsText::setTextFromFile(const string& path_to_textfile, const int
{
string file = path_to_textfile;
string txt = "";
-
+
ifstream in (file.c_str(), ios::in);
if (!in){
printf("[CComponentsText] [%s - %d] error while open %s -> %s\n", __FUNCTION__, __LINE__, file.c_str(), strerror(errno));
return false;
}
string line;
-
+
while(getline(in, line)){
txt += line + '\n';
}
in.close();
setText(txt, mode, font_text);
-
+
return true;
}
diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h
index 0496f6d22..194bd2dfb 100644
--- a/src/gui/components/cc_item_text.h
+++ b/src/gui/components/cc_item_text.h
@@ -1,5 +1,5 @@
/*
- Based up Neutrino-GUI - Tuxbox-Project
+ Based up Neutrino-GUI - Tuxbox-Project
Copyright (C) 2001 by Steffen Hehn 'McClean'
Classes for generic GUI-related components.
@@ -38,22 +38,24 @@ Handling of text parts based up CTextBox attributes and methodes.
CComponentsText provides a interface to the embedded CTextBox object.
*/
-class CComponentsText : public CComponentsItem
+class CComponentsText : public CComponentsItem, public CBox
{
protected:
///object: CTextBox object
CTextBox * ct_textbox;
- ///object: CBox object
- CBox * ct_box;
///object: Fontrenderer object
Font * ct_font;
- ///property: CTextBox object
+ ///property: text color
fb_pixel_t ct_col_text;
+ ///property: cached text color
+ fb_pixel_t ct_old_col_text;
///property: text display modes, see textbox.h for possible modes
int ct_text_mode;
- ///property: text border width
- int ct_text_border;
+ ///property: horizontal text border width (left and right)
+ int ct_text_Hborder;
+ ///property: vertical text border width (top and buttom)
+ int ct_text_Vborder;
///property: current text string
std::string ct_text;
///status: cached text string, mainly required to compare with current text
@@ -63,7 +65,7 @@ class CComponentsText : public CComponentsItem
bool ct_text_sent;
///property: send to CTextBox object enableBackgroundPaint(true)
bool ct_paint_textbg;
-
+
///property: force sending text to the CTextBox object, false= text only sended, if text was changed, see also textChanged()
bool ct_force_text_paint;
@@ -75,7 +77,7 @@ class CComponentsText : public CComponentsItem
///destroy current CTextBox and CBox objects
void clearCCText();
-
+
///initialize all required attributes for text and send to the CTextBox object
void initCCText();
///paint CCItem backckrond (if paint_bg=true), apply initCCText() and send paint() to the CTextBox object
@@ -85,14 +87,14 @@ class CComponentsText : public CComponentsItem
CComponentsText( const int x_pos, const int y_pos, const int w, const int h,
std::string text = "", const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL,
bool has_shadow = CC_SHADOW_OFF,
- fb_pixel_t color_text = COL_MENUCONTENT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
+ fb_pixel_t color_text = COL_MENUCONTENT_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0);
virtual ~CComponentsText();
///default members to paint a text box and hide painted text
///hide textbox
- void hide(bool no_restore = false);
+ void hide(bool no_restore = false);
///paint text box, parameter do_save_bg: default = true, causes fill of backckrond pixel buffer
- void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
+ void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
///send options for text font (size and type), color and mode (allignment)
virtual inline void setTextFont(Font* font_text){ct_font = font_text;};
@@ -101,7 +103,7 @@ class CComponentsText : public CComponentsItem
///set text alignment, also see textbox.h for possible alignment modes
virtual inline void setTextMode(const int mode){ct_text_mode = mode;};
///set text border width
- virtual inline void setTextBorderWidth(const int border){ct_text_border = border;};
+ virtual inline void setTextBorderWidth(const int Hborder, const int Vborder = 0){ct_text_Hborder = Hborder; ct_text_Vborder = Vborder;};
///send option to CTextBox object to paint background box behind text or not
virtual inline void doPaintTextBoxBg(bool do_paintbox_bg){ ct_paint_textbg = do_paintbox_bg;};
@@ -119,7 +121,7 @@ class CComponentsText : public CComponentsItem
///helper to remove linebreak chars from a string if needed
virtual void removeLineBreaks(std::string& str);
-
+
///returns true, if text was changed
virtual bool textChanged(){return ct_old_text != ct_text;};
///force paint of text even if text was changed or not
@@ -144,7 +146,7 @@ class CComponentsLabel : public CComponentsText
CComponentsLabel( const int x_pos, const int y_pos, const int w, const int h,
std::string text = "", const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL,
bool has_shadow = CC_SHADOW_OFF,
- fb_pixel_t color_text = COL_MENUCONTENTINACTIVE, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0)
+ fb_pixel_t color_text = COL_MENUCONTENTINACTIVE_TEXT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0)
:CComponentsText(x_pos, y_pos, w, h, text, mode, font_text, has_shadow, color_text, color_frame, color_body, color_shadow)
{
cc_item_type = CC_ITEMTYPE_LABEL;
@@ -153,7 +155,7 @@ class CComponentsLabel : public CComponentsText
{
initVarText();
cc_item_type = CC_ITEMTYPE_LABEL;
- ct_col_text = COL_MENUCONTENTINACTIVE;
+ ct_col_text = COL_MENUCONTENTINACTIVE_TEXT;
};
};
diff --git a/src/gui/components/unmaintained/cc_item_box.cpp b/src/gui/components/unmaintained/cc_item_box.cpp
index 48809f34e..29140ebc2 100644
--- a/src/gui/components/unmaintained/cc_item_box.cpp
+++ b/src/gui/components/unmaintained/cc_item_box.cpp
@@ -55,7 +55,7 @@ void CComponentsItemBox::initVarItemBox()
initVarItem();
//CComponentsItemBox
- it_col_text = COL_MENUCONTENT;
+ it_col_text = COL_MENUCONTENT_TEXT;
hSpacer = 2;
hOffset = 4;
vOffset = 1;
@@ -295,7 +295,7 @@ void CComponentsItemBox::paintText(size_t index, bool newElement)
v_element_data[index].handler2 = (void*)textbox;
}
- textbox->setTextBorderWidth(0);
+ textbox->setTextBorderWidth(0,0);
textbox->enableBackgroundPaint(false);
textbox->setTextFont(font_text);
textbox->movePosition(box->iX, box->iY);
@@ -498,7 +498,7 @@ void CComponentsTitleBar::initVarTitleBar()
onlyOneTextElement = true;
font_text = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
- it_col_text = COL_MENUHEAD;
+ it_col_text = COL_MENUHEAD_TEXT;
//CComponents
x = 0;
diff --git a/src/gui/components/unmaintained/cc_misc.h b/src/gui/components/unmaintained/cc_misc.h
index 728019abc..cda11f389 100644
--- a/src/gui/components/unmaintained/cc_misc.h
+++ b/src/gui/components/unmaintained/cc_misc.h
@@ -100,11 +100,11 @@ class CComponentsTitleBar : public CComponentsItemBox
public:
CComponentsTitleBar();
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, const char* c_text = NULL, const std::string& s_icon ="",
- fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
+ fb_pixel_t color_text = COL_MENUHEAD_TEXT, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, const std::string& s_text ="", const std::string& s_icon ="",
- fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
+ fb_pixel_t color_text = COL_MENUHEAD_TEXT, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, neutrino_locale_t locale_text = NONEXISTANT_LOCALE, const std::string& s_icon ="",
- fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
+ fb_pixel_t color_text = COL_MENUHEAD_TEXT, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
diff --git a/src/gui/dboxinfo.cpp b/src/gui/dboxinfo.cpp
index f845b8c01..9adfc472c 100644
--- a/src/gui/dboxinfo.cpp
+++ b/src/gui/dboxinfo.cpp
@@ -267,7 +267,7 @@ void CDBoxInfoWidget::paint()
if (p)
hw=++p;
hw+=" Info";
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10, y + hheight+1, width - 10, hw.c_str(), COL_MENUHEAD, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10, y + hheight+1, width - 10, hw.c_str(), COL_MENUHEAD_TEXT, 0, true); // UTF-8
break;
}
i++;
@@ -279,7 +279,7 @@ void CDBoxInfoWidget::paint()
continue;
if (read > 0 && buffer[read-1] == '\n')
buffer[read-1] = '\0';
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width - 10, buffer, COL_MENUCONTENT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width - 10, buffer, COL_MENUCONTENT_TEXT);
ypos+= mheight;
}
fclose(fd);
@@ -325,7 +325,7 @@ void CDBoxInfoWidget::paint()
LOAD_INT(info.loads[1]), LOAD_FRAC(info.loads[1]),
LOAD_INT(info.loads[2]), LOAD_FRAC(info.loads[2]));
strcat(sbuf, ubuf);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width - 10, sbuf, COL_MENUCONTENT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width - 10, sbuf, COL_MENUCONTENT_TEXT);
ypos+= mheight/2;
ypos+= mheight;
int headOffset=0;
@@ -352,7 +352,7 @@ void CDBoxInfoWidget::paint()
headOffset = nameOffset + (sizeOffset+10)*3+15;
break;
}
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ headOffset, ypos+ mheight, width - 10, head[j], COL_MENUCONTENTINACTIVE);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ headOffset, ypos+ mheight, width - 10, head[j], COL_MENUCONTENTINACTIVE_TEXT);
}
ypos+= mheight;
@@ -446,7 +446,7 @@ void CDBoxInfoWidget::paint()
snprintf(ubuf, buf_size, "%4d%%", percent_used);
break;
}
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + mpOffset, ypos+ mheight, width - 10, ubuf, rec_mp ? COL_MENUCONTENTINACTIVE:COL_MENUCONTENT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + mpOffset, ypos+ mheight, width - 10, ubuf, rec_mp ? COL_MENUCONTENTINACTIVE_TEXT:COL_MENUCONTENT_TEXT);
rec_mp = false;
}
int pbw = width - offsetw - 10;
diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp
index 4eb02bd45..417d66637 100644
--- a/src/gui/epgplus.cpp
+++ b/src/gui/epgplus.cpp
@@ -50,8 +50,8 @@
#include
#include
-#define COL_MENUCONTENT_P1 254-8*4+1
-#define COL_MENUCONTENT_P2 254-8*4+2
+#define COL_MENUCONTENT_P1 COL_MENUCONTENT_TEXT_PLUS_1
+#define COL_MENUCONTENT_P2 COL_MENUCONTENT_TEXT_PLUS_2
extern CBouquetList *bouquetList;
Font * fonts[EpgPlus::NumberOfFontSettings];
@@ -126,8 +126,8 @@ void EpgPlus::Header::paint(const char * Name)
}
this->frameBuffer->paintBoxRel (this->x, this->y, this->width, this->font->getHeight()+4, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);
this->font->RenderString (this->x + 10, this->y + this->font->getHeight() + 2,
- this->width - 20, head, COL_MENUHEAD, 0, true);
- //this->width - 20, g_Locale->getText (LOCALE_EPGPLUS_HEAD) , COL_MENUHEAD, 0, true);
+ this->width - 20, head, COL_MENUHEAD_TEXT, 0, true);
+ //this->width - 20, g_Locale->getText (LOCALE_EPGPLUS_HEAD) , COL_MENUHEAD_TEXT, 0, true);
int icol_w, icol_h;
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &icol_w, &icol_h);
this->frameBuffer->paintIcon (NEUTRINO_ICON_BUTTON_HELP, this->x + this->width - icol_w - RADIUS_LARGE - 10, this->y+ ((this->font->getHeight()-icol_h)/2), icol_h);
@@ -179,7 +179,7 @@ void EpgPlus::TimeLine::paint (time_t startTime, int pduration)
, toggleColor ? COL_MENUCONTENT_PLUS_2 : COL_MENUCONTENT_PLUS_1);
this->fontDate->RenderString (this->x + 4, this->y + this->fontDate->getHeight()
- , this->width, EpgPlus::getTimeString (startTime, "%d-%b") , COL_MENUCONTENT, 0, true); // UTF-8
+ , this->width, EpgPlus::getTimeString (startTime, "%d-%b") , COL_MENUCONTENT_TEXT, 0, true); // UTF-8
// paint ticks
for (int i = 0; i < numberOfTicks; ++i, xPos += tickDist, tickTime += pduration / numberOfTicks) {
@@ -232,7 +232,7 @@ void EpgPlus::TimeLine::paintMark (time_t startTime, int pduration, int px, int
int textWidth = this->fontTime->getRenderWidth (timeStr, true);
this->fontTime->RenderString (px - textWidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight()
- , textWidth, timeStr, COL_MENUCONTENT, 0, true); // UTF-8
+ , textWidth, timeStr, COL_MENUCONTENT_TEXT, 0, true); // UTF-8
// display end time after mark
timeStr = EpgPlus::getTimeString (startTime + pduration, "%H:%M");
@@ -240,10 +240,10 @@ void EpgPlus::TimeLine::paintMark (time_t startTime, int pduration, int px, int
if (px + pwidth + textWidth < this->x + this->width) {
this->fontTime->RenderString (px + pwidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight()
- , textWidth, timeStr, COL_MENUCONTENT, 0, true); // UTF-8
+ , textWidth, timeStr, COL_MENUCONTENT_TEXT, 0, true); // UTF-8
} else if (textWidth < pwidth - 10) {
this->fontTime->RenderString (px + pwidth - textWidth, this->y + this->fontTime->getHeight() + this->fontTime->getHeight()
- , textWidth, timeStr, COL_MENUCONTENTSELECTED, 0, true); // UTF-8
+ , textWidth, timeStr, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8
}
}
@@ -297,7 +297,7 @@ void EpgPlus::ChannelEventEntry::paint (bool pisSelected, bool toggleColor)
, this->channelEvent.description.empty()? COL_MENUCONTENT_PLUS_0 : (pisSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : (toggleColor ? COL_MENUCONTENT_PLUS_1 : COL_MENUCONTENT_PLUS_2)));
this->font->RenderString (this->x + 2, this->y + this->font->getHeight()
- , this->width - 4 > 0 ? this->width - 4 : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED : (toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2)
+ , this->width - 4 > 0 ? this->width - 4 : 0, this->channelEvent.description, pisSelected ? COL_MENUCONTENTSELECTED_TEXT : (toggleColor ? COL_MENUCONTENT_P1 : COL_MENUCONTENT_P2)
, 0, true);
// paint the separation line
@@ -374,7 +374,7 @@ void EpgPlus::ChannelEntry::paint (bool isSelected, time_t selectedTime)
isSelected ? COL_MENUCONTENTSELECTED_PLUS_0 : COL_MENUCONTENT_PLUS_0);
this->font->RenderString (this->x + 2, this->y + this->font->getHeight(),
- this->width - 4, this->displayName, isSelected ? COL_MENUCONTENTSELECTED : COL_MENUCONTENT, 0, true);
+ this->width - 4, this->displayName, isSelected ? COL_MENUCONTENTSELECTED_TEXT : COL_MENUCONTENT_TEXT, 0, true);
if (isSelected) {
#if 0
@@ -475,7 +475,7 @@ void EpgPlus::Footer::paintEventDetails (const std::string & description, const
yPos += height;
// display new text
- this->fontBouquetChannelName->RenderString (this->x + 10, yPos, this->width - 20, this->currentBouquetName + " : " + this->currentChannelName, COL_MENUHEAD, 0, true);
+ this->fontBouquetChannelName->RenderString (this->x + 10, yPos, this->width - 20, this->currentBouquetName + " : " + this->currentChannelName, COL_MENUHEAD_TEXT, 0, true);
height = this->fontEventDescription->getHeight();
@@ -485,7 +485,7 @@ void EpgPlus::Footer::paintEventDetails (const std::string & description, const
yPos += height;
// display new text
- this->fontEventDescription->RenderString (this->x + 10, yPos, this->width - 20, description, COL_MENUHEAD, 0, true);
+ this->fontEventDescription->RenderString (this->x + 10, yPos, this->width - 20, description, COL_MENUHEAD_TEXT, 0, true);
height = this->fontEventShortDescription->getHeight();
@@ -495,7 +495,7 @@ void EpgPlus::Footer::paintEventDetails (const std::string & description, const
yPos += height;
// display new text
- this->fontEventShortDescription->RenderString (this->x + 10, yPos, this->width - 20, shortDescription, COL_MENUHEAD, 0, true);
+ this->fontEventShortDescription->RenderString (this->x + 10, yPos, this->width - 20, shortDescription, COL_MENUHEAD_TEXT, 0, true);
}
struct button_label buttonLabels[] = {
diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp
index d09346172..2ae2370bb 100644
--- a/src/gui/epgview.cpp
+++ b/src/gui/epgview.cpp
@@ -248,7 +248,7 @@ void CEpgData::showText( int startPos, int ypos )
offset += digi;
break;
}
- g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10+offset, y+medlineheight, ox- 15- 15, epgText[i].first.substr(pos1, pos2 - pos1), (epgText[i].second==2)? COL_MENUCONTENTINACTIVE: COL_MENUCONTENT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10+offset, y+medlineheight, ox- 15- 15, epgText[i].first.substr(pos1, pos2 - pos1), (epgText[i].second==2)? COL_MENUCONTENTINACTIVE_TEXT: COL_MENUCONTENT_TEXT, 0, true); // UTF-8
count++;
pos1 = epgText[i].first.find_first_not_of(tok, pos2);
pos2 = epgText[i].first.find_first_of(tok, pos1);
@@ -257,7 +257,7 @@ void CEpgData::showText( int startPos, int ypos )
count = 0;
}
else{
- g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10, y+medlineheight, ox- 15- 15, epgText[i].first, COL_MENUCONTENT, 0, true); // UTF-8
+ g_Font[( i< info1_lines ) ?SNeutrinoSettings::FONT_TYPE_EPG_INFO1:SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->RenderString(sx+10, y+medlineheight, ox- 15- 15, epgText[i].first, COL_MENUCONTENT_TEXT, 0, true); // UTF-8
}
}
@@ -631,9 +631,9 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
g_PicViewer->DisplayImage(lname, sx+10, sy + (toph-logo_h)/2, logo_w, logo_h);
//show the title
- g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->RenderString(sx+15 + pic_offx, sy + topheight+ 3, ox-15- pic_offx, text1, COL_MENUHEAD, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->RenderString(sx+15 + pic_offx, sy + topheight+ 3, ox-15- pic_offx, text1, COL_MENUHEAD_TEXT, 0, true);
if (!(text2.empty()))
- g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->RenderString(sx+15+ pic_offx, sy+ 2* topheight+ 3, ox-15 - pic_offx, text2, COL_MENUHEAD, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->RenderString(sx+15+ pic_offx, sy+ 2* topheight+ 3, ox-15 - pic_offx, text2, COL_MENUHEAD_TEXT, 0, true);
//show date-time....
frameBuffer->paintBoxRel(sx, sy+oy-botboxheight, ox, botboxheight, COL_MENUHEAD_PLUS_0);
@@ -644,9 +644,9 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
fromto += epg_end;
widthl = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(fromto);
- g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+40, sy+oy-3, widthl, fromto, COL_MENUHEAD);
+ g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+40, sy+oy-3, widthl, fromto, COL_MENUHEAD_TEXT);
widthr = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(epg_date);
- g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ox-40-widthr, sy+oy-3, widthr, epg_date, COL_MENUHEAD, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ox-40-widthr, sy+oy-3, widthr, epg_date, COL_MENUHEAD_TEXT, 0, true);
int showPos = 0;
textCount = epgText.size();
@@ -689,13 +689,13 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
if ((prev_id != 0) && !call_fromfollowlist)
{
frameBuffer->paintBoxRel(sx+ 5, sy+ oy- botboxheight+ 4, botboxheight- 8, botboxheight- 8, COL_MENUCONTENT_PLUS_3);
- g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ 10, sy+ oy- 3, widthr, "<", COL_MENUCONTENT + 3);
+ g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ 10, sy+ oy- 3, widthr, "<", COL_MENUCONTENT_TEXT_PLUS_3);
}
if ((next_id != 0) && !call_fromfollowlist)
{
frameBuffer->paintBoxRel(sx+ ox- botboxheight+ 8- 5, sy+ oy- botboxheight+ 4, botboxheight- 8, botboxheight- 8, COL_MENUCONTENT_PLUS_3);
- g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ ox- botboxheight+ 8, sy+ oy- 3, widthr, ">", COL_MENUCONTENT + 3);
+ g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ ox- botboxheight+ 8, sy+ oy- 3, widthr, ">", COL_MENUCONTENT_TEXT_PLUS_3);
}
frameBuffer->blit();
@@ -750,7 +750,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
if ((prev_id != 0) && !call_fromfollowlist)
{
frameBuffer->paintBoxRel(sx+ 5, sy+ oy- botboxheight+ 4, botboxheight- 8, botboxheight- 8, COL_MENUCONTENT_PLUS_1);
- g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ 10, sy+ oy- 3, widthr, "<", COL_MENUCONTENT + 1);
+ g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ 10, sy+ oy- 3, widthr, "<", COL_MENUCONTENT_TEXT_PLUS_1);
show(channel_id, prev_id, &prev_zeit, false);
showPos=0;
@@ -761,7 +761,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
if ((next_id != 0) && !call_fromfollowlist)
{
frameBuffer->paintBoxRel(sx+ ox- botboxheight+ 8- 5, sy+ oy- botboxheight+ 4, botboxheight- 8, botboxheight- 8, COL_MENUCONTENT_PLUS_1);
- g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ ox- botboxheight+ 8, sy+ oy- 3, widthr, ">", COL_MENUCONTENT + 1);
+ g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ ox- botboxheight+ 8, sy+ oy- 3, widthr, ">", COL_MENUCONTENT_TEXT_PLUS_1);
show(channel_id, next_id, &next_zeit, false);
showPos=0;
@@ -1181,12 +1181,12 @@ void CEpgData::showTimerEventBar (bool pshow)
{
pos = 0;
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RED, x+8+cellwidth*pos, y+h_offset );
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+29+cellwidth*pos, y+h-h_offset, w-30, g_Locale->getText(LOCALE_TIMERBAR_RECORDEVENT), COL_INFOBAR, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+29+cellwidth*pos, y+h-h_offset, w-30, g_Locale->getText(LOCALE_TIMERBAR_RECORDEVENT), COL_INFOBAR_TEXT, 0, true); // UTF-8
}
// Button: Timer Channelswitch
pos = 2;
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x+8+cellwidth*pos, y+h_offset );
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+29+cellwidth*pos, y+h-h_offset, w-30, g_Locale->getText(LOCALE_TIMERBAR_CHANNELSWITCH), COL_INFOBAR, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+29+cellwidth*pos, y+h-h_offset, w-30, g_Locale->getText(LOCALE_TIMERBAR_CHANNELSWITCH), COL_INFOBAR_TEXT, 0, true); // UTF-8
#endif
}
diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp
index 0da91b20a..dc6c2cfb5 100644
--- a/src/gui/eventlist.cpp
+++ b/src/gui/eventlist.cpp
@@ -251,7 +251,7 @@ int CNeutrinoEventList::exec(const t_channel_id channel_id, const std::string& c
// Calculate iheight (we assume the red button is the largest one?)
struct button_label tmp_button[1] = { { NEUTRINO_ICON_BUTTON_RED, LOCALE_EVENTLISTBAR_RECORDEVENT } };
- iheight = ::paintButtons(0, 0, 0, 1, tmp_button, 0, 0, "", false, COL_INFOBAR_SHADOW, NULL, 0, false);
+ iheight = ::paintButtons(0, 0, 0, 1, tmp_button, 0, 0, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 0, false);
// Calculate theight
theight = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getHeight();
@@ -706,7 +706,7 @@ CTimerd::CTimerEventTypes CNeutrinoEventList::isScheduled(t_channel_id channel_i
void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI)
{
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
int ypos = y+ theight+0 + pos*fheight;
unsigned int curpos = liststart + pos;
@@ -716,17 +716,17 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI)
if (curpos==selected)
{
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
}
else if (curpos == current_event )
{
- color = COL_MENUCONTENT + 1;
+ color = COL_MENUCONTENT_TEXT_PLUS_1;
bgcolor = COL_MENUCONTENT_PLUS_1;
}
else
{
- color = COL_MENUCONTENT;
+ color = COL_MENUCONTENT_TEXT;
bgcolor = COL_MENUCONTENT_PLUS_0;
}
@@ -870,9 +870,9 @@ void CNeutrinoEventList::paintHead(std::string _channelname, std::string _channe
middle_offset = 0;
}
- g_Font[font_h]->RenderString(x+10,y+theight-pn_y_off+1, prev_len, _channelname_prev.c_str(), COL_INFOBAR, 0, true); // UTF-8
- g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x+prev_len+middle_offset,y+theight+1, middle_len, _channelname.c_str(), COL_MENUHEAD, 0, true); // UTF-8
- g_Font[font_h]->RenderString(x+full_width-next_len-10,y+theight-pn_y_off+1, next_len, _channelname_next.c_str(), COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_h]->RenderString(x+10,y+theight-pn_y_off+1, prev_len, _channelname_prev.c_str(), COL_INFOBAR_TEXT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x+prev_len+middle_offset,y+theight+1, middle_len, _channelname.c_str(), COL_MENUHEAD_TEXT, 0, true); // UTF-8
+ g_Font[font_h]->RenderString(x+full_width-next_len-10,y+theight-pn_y_off+1, next_len, _channelname_next.c_str(), COL_INFOBAR_TEXT, 0, true); // UTF-8
}
@@ -891,7 +891,7 @@ void CNeutrinoEventList::paintHead(t_channel_id _channel_id, std::string _channe
logo_ok = g_PicViewer->DisplayImage(lname, x+10, y+(theight-logo_h)/2, logo_w, logo_h);
}
else
- g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x+15+(logo_ok? 5+logo_w:0),y+theight+1, full_width, _channelname.c_str(), COL_MENUHEAD, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x+15+(logo_ok? 5+logo_w:0),y+theight+1, full_width, _channelname.c_str(), COL_MENUHEAD_TEXT, 0, true); // UTF-8
}
void CNeutrinoEventList::paint(t_channel_id channel_id)
diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp
index 2127119de..0c7805b4f 100644
--- a/src/gui/filebrowser.cpp
+++ b/src/gui/filebrowser.cpp
@@ -846,8 +846,12 @@ bool CFileBrowser::exec(const char * const dirname)
std::replace(name.begin(), name.end(), '\\', '/');
paintHead();
- ChangeDir(name);
- paint();
+ int selection = -1;
+ if (name == Path)
+ selection = selected;
+
+ ChangeDir(name, selection);
+ //paint();
paintFoot();
frameBuffer->blit();
@@ -1073,7 +1077,10 @@ bool CFileBrowser::exec(const char * const dirname)
ChangeDir(filelist[selected].Url);
else
#endif
+ {
+ selections.push_back(selected);
ChangeDir(filelist[selected].Name);
+ }
}
else
{
@@ -1236,7 +1243,7 @@ void CFileBrowser::paintItem(unsigned int pos)
{
int colwidth1, colwidth2, colwidth3;
int c_rad_small;
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
int ypos = y+ theight+0 + pos*fheight;
CFile * actual_file = NULL;
@@ -1244,14 +1251,14 @@ void CFileBrowser::paintItem(unsigned int pos)
if (liststart + pos == selected)
{
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
c_rad_small = RADIUS_SMALL;
// paintFoot();
}
else
{
- color = COL_MENUCONTENT;//DARK;
+ color = COL_MENUCONTENT_TEXT;//DARK;
bgcolor = COL_MENUCONTENT_PLUS_0;//DARK;
c_rad_small = 0;
}
@@ -1264,8 +1271,14 @@ void CFileBrowser::paintItem(unsigned int pos)
actual_file = &filelist[liststart+pos];
if (actual_file->Marked)
{
- color = COL_MENUCONTENTINACTIVE; //+= 2; FIXME
- bgcolor = (liststart + pos == selected) ? COL_MENUCONTENTSELECTED_PLUS_2 : COL_MENUCONTENT_PLUS_2;
+ if (liststart + pos == selected) {
+ color = COL_MENUCONTENTINACTIVE_TEXT;
+ bgcolor = COL_MENUCONTENTSELECTED_PLUS_2;
+ }
+ else {
+ color = COL_MENUCONTENT_TEXT;
+ bgcolor = COL_MENUCONTENT_PLUS_2;
+ }
}
if (g_settings.filebrowser_showrights == 0 && S_ISREG(actual_file->Mode))
@@ -1290,7 +1303,7 @@ void CFileBrowser::paintItem(unsigned int pos)
case CFile::FILE_FLAC:
#endif
fileicon = NEUTRINO_ICON_MP3;
-// color = COL_MENUCONTENT;
+// color = COL_MENUCONTENT_TEXT;
break;
case CFile::FILE_DIR:
@@ -1502,7 +1515,7 @@ void CFileBrowser::paintFoot()
char cKey[2]={m_SMSKeyInput.getOldKey(),0};
cKey[0] = toupper(cKey[0]);
int len = fnt_small->getRenderWidth(cKey);
- fnt_small->RenderString(x + width - 10 - len, by2 + foheight, len, cKey, COL_MENUHEAD, 0, true);
+ fnt_small->RenderString(x + width - 10 - len, by2 + foheight, len, cKey, COL_MENUHEAD_TEXT, 0, true);
}
}
}
diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp
index d0754dee8..289a0c53d 100644
--- a/src/gui/imageinfo.cpp
+++ b/src/gui/imageinfo.cpp
@@ -186,16 +186,20 @@ void CImageInfo::InitInfos()
const char * builddate = config.getString("builddate", "n/a").c_str();
#endif
- const char * _version = config.getString("version", "n/a").c_str();
+ std::string version_string;
+#ifdef IMAGE_VERSION
+ version_string = IMAGE_VERSION;
+#else
+ const char * _version = config.getString("version", "U000000000000000").c_str();
static CFlashVersionInfo versionInfo(_version);
- std::string version_string;
version_string = versionInfo.getReleaseCycle();
version_string += " ";
version_string += versionInfo.getType();
version_string += " (";
version_string += versionInfo.getDate();
version_string += ")";
+#endif
struct utsname uts_info;
diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp
index 0967f52a3..ec537fc59 100644
--- a/src/gui/infoclock.cpp
+++ b/src/gui/infoclock.cpp
@@ -63,7 +63,7 @@ void CInfoClock::paintTime( bool show_dot)
int x_diff = (time_width - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(timestr)) / 2;
frameBuffer->paintBoxRel(clock_x, y, time_width, time_height, COL_MENUCONTENT_PLUS_0, RADIUS_SMALL);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(clock_x + x_diff, y + digit_h + digit_offset + ((time_height - digit_h) / 2), time_width, timestr, COL_MENUCONTENT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(clock_x + x_diff, y + digit_h + digit_offset + ((time_height - digit_h) / 2), time_width, timestr, COL_MENUCONTENT_TEXT);
frameBuffer->blit();
}
diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp
index c92f27dbb..66afa00fc 100644
--- a/src/gui/infoviewer.cpp
+++ b/src/gui/infoviewer.cpp
@@ -263,7 +263,7 @@ void CInfoViewer::paintTime (bool show_dot, bool firstPaint)
if (show_dot)
frameBuffer->paintBoxRel (BoxEndX - time_width + time_left_width - LEFT_OFFSET, ChanNameY, time_dot_width, time_height / 2 + 2, COL_INFOBAR_PLUS_0);
else
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString (BoxEndX - time_width + time_left_width - LEFT_OFFSET, ChanNameY + time_height, time_dot_width, ":", COL_INFOBAR);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString (BoxEndX - time_width + time_left_width - LEFT_OFFSET, ChanNameY + time_height, time_dot_width, ":", COL_INFOBAR_TEXT);
strcpy (old_timestr, timestr);
} else {
strcpy (old_timestr, timestr);
@@ -273,9 +273,9 @@ void CInfoViewer::paintTime (bool show_dot, bool firstPaint)
}
timestr[2] = 0;
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString (BoxEndX - time_width - LEFT_OFFSET, ChanNameY + time_height, time_left_width, timestr, COL_INFOBAR);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString (BoxEndX - time_left_width - LEFT_OFFSET, ChanNameY + time_height, time_left_width, ×tr[3], COL_INFOBAR);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString (BoxEndX - time_width + time_left_width - LEFT_OFFSET, ChanNameY + time_height, time_dot_width, ":", COL_INFOBAR);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString (BoxEndX - time_width - LEFT_OFFSET, ChanNameY + time_height, time_left_width, timestr, COL_INFOBAR_TEXT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString (BoxEndX - time_left_width - LEFT_OFFSET, ChanNameY + time_height, time_left_width, ×tr[3], COL_INFOBAR_TEXT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString (BoxEndX - time_width + time_left_width - LEFT_OFFSET, ChanNameY + time_height, time_dot_width, ":", COL_INFOBAR_TEXT);
if (show_dot)
frameBuffer->paintBoxRel (BoxEndX - time_left_width - time_dot_width - LEFT_OFFSET, ChanNameY, time_dot_width, time_height / 2 + 2, COL_INFOBAR_PLUS_0);
}
@@ -350,7 +350,7 @@ void CInfoViewer::showRecordIcon (const bool show)
frameBuffer->paintBoxRel(box_posX, BoxStartY + box_posY , box_len, chanH, COL_INFOBAR_PLUS_0, radius);
if (rec_mode != CRecordManager::RECMODE_TSHIFT)
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (rec_icon_posX + rec_icon_w + icon_space, BoxStartY + box_posY + chanH, box_len, records_msg, COL_INFOBAR, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (rec_icon_posX + rec_icon_w + icon_space, BoxStartY + box_posY + chanH, box_len, records_msg, COL_INFOBAR_TEXT, 0, true);
if (rec_mode == CRecordManager::RECMODE_REC)
{
@@ -529,7 +529,7 @@ void CInfoViewer::showMovieTitle(const int playState, const std::string &Channel
infoViewerBB->paintshowButtonBar();
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(ChanNameX + 10 , ChanNameY + time_height,BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 ,ChannelName, COL_INFOBAR, 0, true); // UTF-8
+ 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, 0, true); // UTF-8
// show_Data
if (CMoviePlayerGui::getInstance().file_prozent > 100)
@@ -578,7 +578,7 @@ void CInfoViewer::showMovieTitle(const int playState, const std::string &Channel
if (speed) {
int sh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight();
int sy = BoxStartY + ChanHeight/2 - sh/2 + sh;
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(icon_x, sy, ChanHeight, runningRest, COL_INFOBAR, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(icon_x, sy, ChanHeight, runningRest, COL_INFOBAR_TEXT, 0, true);
icon_x += speedw;
}
frameBuffer->paintIcon(playicon, icon_x, icon_y);
@@ -659,14 +659,14 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con
is_visible = true;
infoViewerBB->is_visible = true;
- int col_NumBoxText = COL_INFOBAR;
- int col_NumBox = COL_INFOBAR_PLUS_0;
+ fb_pixel_t col_NumBoxText = COL_INFOBAR_TEXT;
+ fb_pixel_t col_NumBox = COL_INFOBAR_PLUS_0;
ChannelName = Channel;
bool new_chan = false;
if (virtual_zap_mode) {
if (g_RemoteControl->current_channel_id != new_channel_id) {
- col_NumBoxText = COL_MENUHEAD;
+ col_NumBoxText = COL_MENUHEAD_TEXT;
}
if ((channel_id != new_channel_id) || (evtlist.empty())) {
CEitManager::getInstance()->getEventsServiceKey(new_channel_id, evtlist);
@@ -735,7 +735,7 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con
}
}
int chanH = g_SignalFont->getHeight ();
- g_SignalFont->RenderString (3 + BoxStartX + ((ChanWidth - satNameWidth) / 2) , BoxStartY + chanH, satNameWidth, satname_tmp, COL_INFOBAR);
+ g_SignalFont->RenderString (3 + BoxStartX + ((ChanWidth - satNameWidth) / 2) , BoxStartY + chanH, satNameWidth, satname_tmp, COL_INFOBAR_TEXT);
ChanNumYPos += 10;
}
@@ -760,12 +760,12 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con
if (g_settings.infobar_show_channellogo < 5 || !logo_ok) {
if (ChannelLogoMode != 2) {
//FIXME good color to display inactive for zap ?
- //uint8_t color = CNeutrinoApp::getInstance ()->channelList->SameTP(new_channel_id) ? COL_INFOBAR : COL_INFOBAR_SHADOW;
- uint8_t color = COL_INFOBAR;
+ //fb_pixel_t color = CNeutrinoApp::getInstance ()->channelList->SameTP(new_channel_id) ? COL_INFOBAR_TEXT : COL_INFOBAR_SHADOW_TEXT;
+ 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,
- ChannelName, color /*COL_INFOBAR*/, 0, true); // UTF-8
+ ChannelName, color /*COL_INFOBAR_TEXT*/, 0, true); // UTF-8
//provider name
if(g_settings.infobar_show_channeldesc && pname){
std::string prov_name = pname;
@@ -779,7 +779,7 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(
ChanNameX + 10 + ChanNumWidth + chname_width, ChanNameY + time_height -SHADOW_OFFSET/2,
BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 - ChanNumWidth - chname_width,
- prov_name, color /*COL_INFOBAR*/, 0, true); // UTF-8
+ prov_name, color /*COL_INFOBAR_TEXT*/, 0, true); // UTF-8
}
}
@@ -1050,15 +1050,15 @@ void CInfoViewer::showSubchan ()
lframeBuffer->paintBackgroundBoxRel (x + dx, y, borderwidth, dy);
lframeBuffer->paintBoxRel (x, y, dx, dy, COL_MENUCONTENT_PLUS_0);
- //g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + 30, dx - 20, text, COL_MENUCONTENT, 0, true);
+ //g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + 30, dx - 20, text, COL_MENUCONTENT_TEXT, 0, true);
if (g_RemoteControl->director_mode) {
lframeBuffer->paintIcon (NEUTRINO_ICON_BUTTON_YELLOW, x + 8, y + dy - 20);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (x + 30, y + dy - 2, dx - 40, g_Locale->getText (LOCALE_NVODSELECTOR_DIRECTORMODE), COL_MENUCONTENT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString (x + 30, y + dy - 2, dx - 40, g_Locale->getText (LOCALE_NVODSELECTOR_DIRECTORMODE), COL_MENUCONTENT_TEXT, 0, true); // UTF-8
int h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight();
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + dy - h - 2, dx - 20, text, COL_MENUCONTENT, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + dy - h - 2, dx - 20, text, COL_MENUCONTENT_TEXT, 0, true);
} else
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + dy - 2, dx - 20, text, COL_MENUCONTENT, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (x + 10, y + dy - 2, dx - 20, text, COL_MENUCONTENT_TEXT, 0, true);
uint64_t timeoutEnd_tmp = CRCInput::calcTimeoutEnd (2);
int res = messages_return::none;
@@ -1149,7 +1149,7 @@ void CInfoViewer::showRadiotext()
// shadow
frameBuffer->paintBoxRel(rt_x+SHADOW_OFFSET, rt_y+SHADOW_OFFSET, rt_dx, rt_dy, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_TOP);
frameBuffer->paintBoxRel(rt_x, rt_y, rt_dx, rt_dy, COL_INFOBAR_PLUS_0, RADIUS_LARGE, CORNER_TOP);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rt_x+10, rt_y+ 30, rt_dx-20, stext[0], COL_INFOBAR, 0, RTisIsUTF); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rt_x+10, rt_y+ 30, rt_dx-20, stext[0], COL_INFOBAR_TEXT, 0, RTisIsUTF); // UTF-8
frameBuffer->blit();
}
// yoff = 17;
@@ -1187,15 +1187,15 @@ void CInfoViewer::showRadiotext()
int rts_dx = rt_dx-20;
if (g_Radiotext->S_RtOsdLoop == 1) { // latest bottom
for (int i = ind+1; i < g_Radiotext->S_RtOsdRows; i++)
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR, 0, RTisIsUTF); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR_TEXT, 0, RTisIsUTF); // UTF-8
for (int i = 0; i <= ind; i++)
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR, 0, RTisIsUTF); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR_TEXT, 0, RTisIsUTF); // UTF-8
}
else { // latest top
for (int i = ind; i >= 0; i--)
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR, 0, RTisIsUTF); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR_TEXT, 0, RTisIsUTF); // UTF-8
for (int i = g_Radiotext->S_RtOsdRows-1; i > ind; i--)
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR, 0, RTisIsUTF); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(rts_x, rts_y + (ii++)*rt_dy, rts_dx, g_Radiotext->RT_Text[i], COL_INFOBAR_TEXT, 0, RTisIsUTF); // UTF-8
}
frameBuffer->blit();
}
@@ -1385,6 +1385,15 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data)
return messages_return::unhandled;
}
+void CInfoViewer::sendNoEpg(const t_channel_id for_channel_id)
+{
+ if (!virtual_zap_mode) {
+ char *p = new char[sizeof(t_channel_id)];
+ memcpy(p, &for_channel_id, sizeof(t_channel_id));
+ g_RCInput->postMsg (NeutrinoMessages::EVT_NOEPG_YET, (const neutrino_msg_data_t) p, false);
+ }
+}
+
void CInfoViewer::getEPG(const t_channel_id for_channel_id, CSectionsdClient::CurrentNextInfo &info)
{
/* to clear the oldinfo for channels without epg, call getEPG() with for_channel_id = 0 */
@@ -1398,9 +1407,7 @@ void CInfoViewer::getEPG(const t_channel_id for_channel_id, CSectionsdClient::Cu
/* of there is no EPG, send an event so that parental lock can work */
if (info.current_uniqueKey == 0 && info.next_uniqueKey == 0) {
memcpy(&oldinfo, &info, sizeof(CSectionsdClient::CurrentNextInfo));
- char *p = new char[sizeof(t_channel_id)];
- memcpy(p, &for_channel_id, sizeof(t_channel_id));
- g_RCInput->postMsg (NeutrinoMessages::EVT_NOEPG_YET, (const neutrino_msg_data_t) p, false);
+ sendNoEpg(for_channel_id);
return;
}
@@ -1447,7 +1454,7 @@ void CInfoViewer::showSNR ()
snprintf (freq, sizeof(freq), "%d.%d MHz %s", frequency / 1000, frequency % 1000, polarisation.c_str());
int satNameWidth = g_SignalFont->getRenderWidth (freq);
- g_SignalFont->RenderString (3 + BoxStartX + ((ChanWidth - satNameWidth) / 2), BoxStartY + 2 * chanH - 3, satNameWidth, freq, SDT_freq_update ? COL_COLORED_EVENTS_INFOBAR:COL_INFOBAR);
+ g_SignalFont->RenderString (3 + BoxStartX + ((ChanWidth - satNameWidth) / 2), BoxStartY + 2 * chanH - 3, satNameWidth, freq, SDT_freq_update ? COL_COLORED_EVENTS_TEXT:COL_INFOBAR_TEXT);
SDT_freq_update = false;
}
int sw, snr, sig, posx, posy;
@@ -1472,7 +1479,7 @@ void CInfoViewer::showSNR ()
posx = posx + bar_width + 2;
sw = BoxStartX + ChanWidth - posx;
frameBuffer->paintBoxRel (posx, posy, sw, height, COL_INFOBAR_PLUS_0);
- g_SignalFont->RenderString (posx, posy + height, sw, percent, COL_INFOBAR);
+ g_SignalFont->RenderString (posx, posy + height, sw, percent, COL_INFOBAR_TEXT);
}
if (lastsnr != snr) {
lastsnr = snr;
@@ -1486,7 +1493,7 @@ void CInfoViewer::showSNR ()
posx = posx + bar_width + 2;
sw = BoxStartX + ChanWidth - posx -4;
frameBuffer->paintBoxRel (posx, posy, sw, height-2, COL_INFOBAR_PLUS_0);
- g_SignalFont->RenderString (posx, posy + height, sw, percent, COL_INFOBAR);
+ g_SignalFont->RenderString (posx, posy + height, sw, percent, COL_INFOBAR_TEXT);
}
}
if(showButtonBar)
@@ -1603,8 +1610,8 @@ void CInfoViewer::display_Info(const char *current, const char *next,
{
frameBuffer->paintBox(InfoX, CurrInfoY - height, currTimeX, CurrInfoY, COL_INFOBAR_PLUS_0);
if (runningStart != NULL)
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(InfoX, CurrInfoY, info_time_width, runningStart, colored_event_C ? COL_COLORED_EVENTS_INFOBAR : COL_INFOBAR, 0, UTF8);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(xStart, CurrInfoY, currTimeX - xStart - 5, current, colored_event_C ? COL_COLORED_EVENTS_INFOBAR : COL_INFOBAR, 0, UTF8);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(InfoX, CurrInfoY, info_time_width, runningStart, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT, 0, UTF8);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(xStart, CurrInfoY, currTimeX - xStart - 5, current, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT, 0, UTF8);
oldCurrTimeX = currTimeX;
}
@@ -1613,19 +1620,19 @@ void CInfoViewer::display_Info(const char *current, const char *next,
frameBuffer->paintBox(oldCurrTimeX, CurrInfoY-height, BoxEndX, CurrInfoY, COL_INFOBAR_PLUS_0);
oldCurrTimeX = currTimeX;
if (currTimeW != 0)
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(currTimeX, CurrInfoY, currTimeW, runningRest, colored_event_C ? COL_COLORED_EVENTS_INFOBAR : COL_INFOBAR, 0, UTF8);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(currTimeX, CurrInfoY, currTimeW, runningRest, colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT, 0, UTF8);
if (next != NULL && update_next)
{
frameBuffer->paintBox(InfoX, NextInfoY-height, BoxEndX, NextInfoY, COL_INFOBAR_PLUS_0);
if (nextStart != NULL)
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(InfoX, NextInfoY, info_time_width, nextStart, colored_event_N ? COL_COLORED_EVENTS_INFOBAR : COL_INFOBAR, 0, UTF8);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(InfoX, NextInfoY, info_time_width, nextStart, colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT, 0, UTF8);
if (starttimes)
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(xStart, NextInfoY, nextTimeX - xStart - 5, next, colored_event_N ? COL_COLORED_EVENTS_INFOBAR : COL_INFOBAR, 0, UTF8);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(xStart, NextInfoY, nextTimeX - xStart - 5, next, colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT, 0, UTF8);
else
- g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(xStart, NextInfoY, nextTimeX - xStart - 5, next, colored_event_N ? COL_COLORED_EVENTS_INFOBAR : COL_INFOBAR, 0, UTF8);
+ g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(xStart, NextInfoY, nextTimeX - xStart - 5, next, colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT, 0, UTF8);
if (nextTimeW != 0)
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(nextTimeX, NextInfoY, nextTimeW, nextDuration, colored_event_N ? COL_COLORED_EVENTS_INFOBAR : COL_INFOBAR, 0, UTF8);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(nextTimeX, NextInfoY, nextTimeW, nextDuration, colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT, 0, UTF8);
}
}
@@ -1725,12 +1732,10 @@ void CInfoViewer::show_Data (bool calledFromEvent)
// no EPG available
display_Info(g_Locale->getText(gotTime ? LOCALE_INFOVIEWER_NOEPG : LOCALE_INFOVIEWER_WAITTIME), NULL);
/* send message. Parental pin check gets triggered on EPG events... */
- char *p = new char[sizeof(t_channel_id)];
- memmove(p, &channel_id, sizeof(t_channel_id));
/* clear old info in getEPG */
CSectionsdClient::CurrentNextInfo dummy;
getEPG(0, dummy);
- g_RCInput->postMsg(NeutrinoMessages::EVT_NOEPG_YET, (const neutrino_msg_data_t)p, false); // data is pointer to allocated memory
+ sendNoEpg(channel_id);
return;
}
@@ -1786,7 +1791,7 @@ void CInfoViewer::show_Data (bool calledFromEvent)
// no EPG available
ChanInfoY += height;
frameBuffer->paintBox (ChanInfoX + 10, ChanInfoY, BoxEndX, ChanInfoY + height, COL_INFOBAR_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (BoxStartX + ChanWidth + 20, ChanInfoY + height, BoxEndX - (BoxStartX + ChanWidth + 20), g_Locale->getText (gotTime ? LOCALE_INFOVIEWER_NOEPG : LOCALE_INFOVIEWER_WAITTIME), COL_INFOBAR, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (BoxStartX + ChanWidth + 20, ChanInfoY + height, BoxEndX - (BoxStartX + ChanWidth + 20), g_Locale->getText (gotTime ? LOCALE_INFOVIEWER_NOEPG : LOCALE_INFOVIEWER_WAITTIME), COL_INFOBAR_TEXT, 0, true); // UTF-8
} else {
// irgendein EPG gefunden
int duration1Width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth (runningRest);
@@ -1798,7 +1803,7 @@ void CInfoViewer::show_Data (bool calledFromEvent)
if ((info_CurrentNext.flags & CSectionsdClient::epgflags::has_next) && (!(info_CurrentNext.flags & CSectionsdClient::epgflags::has_current))) {
// there are later events available - yet no current
frameBuffer->paintBox (ChanInfoX + 10, ChanInfoY, BoxEndX, ChanInfoY + height, COL_INFOBAR_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, BoxEndX - xStart, g_Locale->getText (LOCALE_INFOVIEWER_NOCURRENT), COL_INFOBAR, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, BoxEndX - xStart, g_Locale->getText (LOCALE_INFOVIEWER_NOCURRENT), COL_INFOBAR_TEXT, 0, true); // UTF-8
ChanInfoY += height;
@@ -1807,21 +1812,21 @@ void CInfoViewer::show_Data (bool calledFromEvent)
if (last_next_id != info_CurrentNext.next_uniqueKey) {
frameBuffer->paintBox (ChanInfoX + 10, ChanInfoY, BoxEndX, ChanInfoY + height, COL_INFOBAR_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (ChanInfoX + 10, ChanInfoY + height, 100, nextStart, COL_INFOBAR);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, duration2TextPos - xStart - 5, info_CurrentNext.next_name, COL_INFOBAR, 0, true);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (duration2TextPos, ChanInfoY + height, duration2Width, nextDuration, COL_INFOBAR);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (ChanInfoX + 10, ChanInfoY + height, 100, nextStart, COL_INFOBAR_TEXT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, duration2TextPos - xStart - 5, info_CurrentNext.next_name, COL_INFOBAR_TEXT, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (duration2TextPos, ChanInfoY + height, duration2Width, nextDuration, COL_INFOBAR_TEXT);
last_next_id = info_CurrentNext.next_uniqueKey;
}
} else {
if (last_curr_id != info_CurrentNext.current_uniqueKey) {
frameBuffer->paintBox (ChanInfoX + 10, ChanInfoY, BoxEndX, ChanInfoY + height, COL_INFOBAR_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (ChanInfoX + 10, ChanInfoY + height, 100, runningStart, COL_INFOBAR);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, duration1TextPos - xStart - 5, info_CurrentNext.current_name, COL_INFOBAR, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (ChanInfoX + 10, ChanInfoY + height, 100, runningStart, COL_INFOBAR_TEXT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, duration1TextPos - xStart - 5, info_CurrentNext.current_name, COL_INFOBAR_TEXT, 0, true);
last_curr_id = info_CurrentNext.current_uniqueKey;
}
frameBuffer->paintBox (BoxEndX - 80, ChanInfoY, BoxEndX, ChanInfoY + height, COL_INFOBAR_PLUS_0);//FIXME duration1TextPos not really good
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (duration1TextPos, ChanInfoY + height, duration1Width, runningRest, COL_INFOBAR);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (duration1TextPos, ChanInfoY + height, duration1Width, runningRest, COL_INFOBAR_TEXT);
ChanInfoY += height;
@@ -1831,9 +1836,9 @@ void CInfoViewer::show_Data (bool calledFromEvent)
if ((!is_nvod) && (info_CurrentNext.flags & CSectionsdClient::epgflags::has_next)) {
if (last_next_id != info_CurrentNext.next_uniqueKey) {
frameBuffer->paintBox (ChanInfoX + 10, ChanInfoY, BoxEndX, ChanInfoY + height, COL_INFOBAR_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (ChanInfoX + 10, ChanInfoY + height, 100, nextStart, COL_INFOBAR);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, duration2TextPos - xStart - 5, info_CurrentNext.next_name, COL_INFOBAR, 0, true);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (duration2TextPos, ChanInfoY + height, duration2Width, nextDuration, COL_INFOBAR);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (ChanInfoX + 10, ChanInfoY + height, 100, nextStart, COL_INFOBAR_TEXT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (xStart, ChanInfoY + height, duration2TextPos - xStart - 5, info_CurrentNext.next_name, COL_INFOBAR_TEXT, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString (duration2TextPos, ChanInfoY + height, duration2Width, nextDuration, COL_INFOBAR_TEXT);
last_next_id = info_CurrentNext.next_uniqueKey;
}
} //else
@@ -1893,7 +1898,7 @@ void CInfoViewer::showInfoFile()
infobar_txt->setDimensionsAll(xStart, yStart, width, height);
infobar_txt->setCornerRadius(RADIUS_SMALL);
infobar_txt->setShadowOnOff(true);
- infobar_txt->setTextColor(COL_INFOBAR);
+ infobar_txt->setTextColor(COL_INFOBAR_TEXT);
infobar_txt->setColorBody(COL_INFOBAR_PLUS_0);
infobar_txt->doPaintTextBoxBg(false);
diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h
index 437627ece..10707d34f 100644
--- a/src/gui/infoviewer.h
+++ b/src/gui/infoviewer.h
@@ -140,6 +140,7 @@ class CInfoViewer
void show_current_next(bool new_chan, int epgpos);
void reset_allScala();
void check_channellogo_ca_SettingsChange();
+ void sendNoEpg(const t_channel_id channel_id);
public:
bool chanready;
bool is_visible;
diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp
index b9a2830b5..2c9b34e1d 100644
--- a/src/gui/infoviewer_bb.cpp
+++ b/src/gui/infoviewer_bb.cpp
@@ -63,7 +63,6 @@ extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */
extern cVideo * videoDecoder;
//#define SHOW_RADIOTEXT_ICON
-#define COL_INFOBAR_BUTTONS (COL_INFOBAR_SHADOW + 1)
#define COL_INFOBAR_BUTTONS_BACKGROUND (COL_INFOBAR_SHADOW_PLUS_1)
CInfoViewerBB::CInfoViewerBB()
@@ -391,7 +390,7 @@ void CInfoViewerBB::showBBButtons(const int modus)
frameBuffer->paintIcon(bbButtonInfo[i].icon, bbButtonInfo[i].x, BBarY, InfoHeightY_Info);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bbButtonInfo[i].x + bbButtonInfo[i].cx, BBarFontY,
- bbButtonInfo[i].w - bbButtonInfo[i].cx, bbButtonInfo[i].text, COL_INFOBAR_BUTTONS, 0, true); // UTF-8
+ bbButtonInfo[i].w - bbButtonInfo[i].cx, bbButtonInfo[i].text, COL_INFOBAR_TEXT, 0, true); // UTF-8
}
}
diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp
index f832932c5..950450617 100644
--- a/src/gui/keybind_setup.cpp
+++ b/src/gui/keybind_setup.cpp
@@ -190,7 +190,10 @@ const key_settings_struct_t key_settings[CKeybindSetup::KEYBINDS_COUNT] =
{LOCALE_EXTRA_KEY_SCREENSHOT, &g_settings.key_screenshot, LOCALE_MENU_HINT_KEY_SCREENSHOT },
{LOCALE_EXTRA_KEY_PIP_CLOSE, &g_settings.key_pip_close, LOCALE_MENU_HINT_KEY_PIP_CLOSE },
{LOCALE_EXTRA_KEY_PIP_SETUP, &g_settings.key_pip_setup, LOCALE_MENU_HINT_KEY_PIP_SETUP },
- {LOCALE_EXTRA_KEY_PIP_SWAP, &g_settings.key_pip_swap, LOCALE_MENU_HINT_KEY_PIP_CLOSE }
+ {LOCALE_EXTRA_KEY_PIP_SWAP, &g_settings.key_pip_swap, LOCALE_MENU_HINT_KEY_PIP_CLOSE },
+ {LOCALE_EXTRA_KEY_FORMAT_MODE, &g_settings.key_format_mode_active, LOCALE_MENU_HINT_KEY_FORMAT_MODE_ACTIVE },
+ {LOCALE_EXTRA_KEY_PIC_MODE, &g_settings.key_pic_mode_active, LOCALE_MENU_HINT_KEY_PIC_MODE_ACTIVE },
+ {LOCALE_EXTRA_KEY_PIC_SIZE, &g_settings.key_pic_size_active, LOCALE_MENU_HINT_KEY_PIC_SIZE_ACTIVE }
};
@@ -271,6 +274,8 @@ int CKeybindSetup::showKeySetup()
void CKeybindSetup::showKeyBindSetup(CMenuWidget *bindSettings)
{
+ int shortcut = 1;
+
CMenuForwarder * mf;
bindSettings->addIntroItems(LOCALE_KEYBINDINGMENU_HEAD);
@@ -309,6 +314,14 @@ void CKeybindSetup::showKeyBindSetup(CMenuWidget *bindSettings)
//misc
bindSettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_KEYBINDINGMENU_MISC));
//bindSettings->addItem(new CMenuDForwarder(keydescription[KEY_PLUGIN], true, NULL, keychooser[KEY_PLUGIN]));
+
+ //Special keys
+ CMenuWidget* bindSettings_special = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, MN_WIDGET_ID_KEYSETUP_KEYBINDING_SPECIAL);
+ showKeyBindSpecialSetup(bindSettings_special);
+ mf = new CMenuDForwarder(LOCALE_KEYBINDINGMENU_SPECIAL_ACTIVE, true, NULL, bindSettings_special, NULL, CRCInput::convertDigitToKey(shortcut++));
+ mf->setHint("", LOCALE_MENU_HINT_KEY_SPECIAL_ACTIVE);
+ bindSettings->addItem(mf);
+
// unlock
mf = new CMenuDForwarder(key_settings[KEY_UNLOCK].keydescription, true, keychooser[KEY_UNLOCK]->getKeyName(), keychooser[KEY_UNLOCK]);
mf->setHint("", key_settings[KEY_UNLOCK].hint);
@@ -404,6 +417,17 @@ void CKeybindSetup::showKeyBindMovieplayerSetup(CMenuWidget *bindSettings_mplaye
}
}
+void CKeybindSetup::showKeyBindSpecialSetup(CMenuWidget *bindSettings_special)
+{
+ bindSettings_special->addIntroItems(LOCALE_KEYBINDINGMENU_SPECIAL_ACTIVE);
+
+ for (int i = KEY_FORMAT_MODE; i <= KEY_PIC_SIZE; i++) {
+ CMenuOptionChooser * mf = new CMenuOptionChooser(key_settings[i].keydescription, key_settings[i].keyvalue_p, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
+ mf->setHint("", key_settings[i].hint);
+ bindSettings_special->addItem(mf);
+ }
+}
+
bool CKeybindSetup::changeNotify(const neutrino_locale_t OptionName, void * /* data */)
{
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC) ||
diff --git a/src/gui/keybind_setup.h b/src/gui/keybind_setup.h
index fcbb47a8c..7a6313793 100644
--- a/src/gui/keybind_setup.h
+++ b/src/gui/keybind_setup.h
@@ -80,6 +80,9 @@ class CKeybindSetup : public CMenuTarget, public CChangeObserver
KEY_PIP_CLOSE,
KEY_PIP_SETUP,
KEY_PIP_SWAP,
+ KEY_FORMAT_MODE,
+ KEY_PIC_MODE,
+ KEY_PIC_SIZE,
KEYBINDS_COUNT
};
@@ -95,6 +98,7 @@ class CKeybindSetup : public CMenuTarget, public CChangeObserver
void showKeyBindChannellistSetup(CMenuWidget *bindSettings_chlist);
void showKeyBindQuickzapSetup(CMenuWidget *bindSettings_qzap);
void showKeyBindMovieplayerSetup(CMenuWidget *bindSettings_mplayer);
+ void showKeyBindSpecialSetup(CMenuWidget *bindSettings_special);
public:
CKeybindSetup();
diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp
index 506e7b9d3..a584af1e4 100644
--- a/src/gui/motorcontrol.cpp
+++ b/src/gui/motorcontrol.cpp
@@ -46,15 +46,7 @@
#include
#include
-
-static int g_sig;
-static int g_snr;
-static int last_snr = 0;
-static int moving = 0;
-
-#define RED_BAR 40
-#define YELLOW_BAR 70
-#define GREEN_BAR 100
+#include
#define BAR_BORDER 2
#define BAR_WIDTH 100
@@ -86,9 +78,9 @@ void CMotorControl::Init(void)
satfindpid = -1;
- width = w_max(470, 0);
+ width = w_max(720, 0);
mheight = mheight - 2;
- height = hheight + (20 * mheight) - 5;
+ height = hheight + (22 * mheight) - 5;
height = h_max(height, 0);
x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2;
@@ -114,55 +106,35 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &)
int wasgrow = 0;
uint8_t origPosition;
- last_snr = 0;
- moving = 0;
+ last_snr = moving = g_sig = g_snr = 0;
+ network = "unknown";
- CZapitClient::ScanSatelliteList satList;
- CZapitClient::commandSetScanSatelliteList sat;
- sat_iterator_t sit;
-
- sigscale->reset();
- snrscale->reset();
- lastsnr = lastsig = -1;
-
- bool istheend = false;
int lim_cmd;
- if (!frameBuffer->getActive())
- return menu_return::RETURN_EXIT_ALL;
+ int retval = menu_return::RETURN_REPAINT;
if (parent)
parent->hide();
- x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2;
- y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - height) / 2;
+ x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2;
+ y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - height) / 2;
+
+ /* send satellite list to zapit */
+ CZapitClient::ScanSatelliteList satList;
+ CZapitClient::commandSetScanSatelliteList sat;
-#if 0
- /* send satellite list to zapit */
- for(sit = satellitePositions.begin(); sit != satellitePositions.end(); sit++) {
- if(!strcmp(sit->second.name.c_str(),scansettings.satName)) {
- sat.position = sit->first;
- strncpy(sat.satName, scansettings.satName, 49);
- satList.push_back(sat);
- if(sit->second.motor_position)
- motorPosition = sit->second.motor_position;
- break;
- }
- }
-#endif
- /* send satellite list to zapit */
sat.position = CServiceManager::getInstance()->GetSatellitePosition(scansettings.satName);
strncpy(sat.satName, scansettings.satName, 49);
satList.push_back(sat);
satellite_map_t & satmap = frontend->getSatellites();
- sit = satmap.find(sat.position);
+ sat_iterator_t sit = satmap.find(sat.position);
if(sit != satmap.end() && sit->second.motor_position)
motorPosition = sit->second.motor_position;
origPosition = motorPosition;
//FIXME change cZapit live fe
g_Zapit->stopPlayBack();
- g_Zapit->setScanSatelliteList( satList);
+ g_Zapit->setScanSatelliteList(satList);
CZapit::getInstance()->SetLiveFrontend(frontend);
TP.feparams.dvb_feparams.frequency = atoi(scansettings.sat_TP_freq);
@@ -177,290 +149,201 @@ int CMotorControl::exec(CMenuTarget* parent, const std::string &)
paintStatus();
frameBuffer->blit();
- while (!istheend)
+ msg = CRCInput::RC_nokey;
+ while (!(msg == CRCInput::RC_setup) && (!(msg == CRCInput::RC_home)))
{
-
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd_MS(100 /*250*/);
- msg = CRCInput::RC_nokey;
-
- while (!(msg == CRCInput::RC_timeout) && (!(msg == CRCInput::RC_home)))
- {
- g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd);
- showSNR();
-//printf("SIG: %d SNR %d last %d\n", g_sig, g_snr, last_snr);
- if(moving && (stepMode == STEP_MODE_AUTO)) {
- if(last_snr < g_snr) {
- wasgrow = 1;
- }
- //if((last_snr > g_snr) && last_snr > 37000)
- if(wasgrow && (last_snr > g_snr) /* && last_snr > 50*/) {
-//printf("Must stop rotor!!!\n");
- g_Zapit->sendMotorCommand(0xE0, 0x31, 0x60, 0, 0, 0);
- moving = 0;
- paintStatus();
- last_snr = 0;
- //g_Zapit->tune_TP(TP);
- } else
- last_snr = g_snr;
- } else
- wasgrow = 0;
-
- if (installerMenue)
- {
- switch(msg)
- {
- case CRCInput::RC_ok:
- case CRCInput::RC_0:
- printf("[motorcontrol] 0 key received... goto userMenue\n");
- installerMenue = false;
- paintMenu();
- paintStatus();
- break;
-
- case CRCInput::RC_1:
- case CRCInput::RC_right:
- printf("[motorcontrol] left/1 key received... drive/Step motor west, stepMode: %d\n", stepMode);
- motorStepWest();
- paintStatus();
- //g_Zapit->tune_TP(TP);
- break;
-
- case CRCInput::RC_red:
- case CRCInput::RC_2:
- printf("[motorcontrol] 2 key received... halt motor\n");
- g_Zapit->sendMotorCommand(0xE0, 0x31, 0x60, 0, 0, 0);
- moving = 0;
- paintStatus();
- //g_Zapit->tune_TP(TP);
- break;
-
- case CRCInput::RC_3:
- case CRCInput::RC_left:
- printf("[motorcontrol] right/3 key received... drive/Step motor east, stepMode: %d\n", stepMode);
- motorStepEast();
- paintStatus();
- //g_Zapit->tune_TP(TP);
- break;
-
- case CRCInput::RC_4:
- printf("[motorcontrol] 4 key received... set west (soft) limit\n");
- if(g_settings.rotor_swap) lim_cmd = 0x66;
- else lim_cmd = 0x67;
- g_Zapit->sendMotorCommand(0xE1, 0x31, lim_cmd, 0, 0, 0);
- //g_Zapit->tune_TP(TP);
- break;
-
- case CRCInput::RC_5:
- printf("[motorcontrol] 5 key received... disable (soft) limits\n");
- g_Zapit->sendMotorCommand(0xE0, 0x31, 0x63, 0, 0, 0);
- //g_Zapit->tune_TP(TP);
- break;
-
- case CRCInput::RC_6:
- printf("[motorcontrol] 6 key received... set east (soft) limit\n");
- if(g_settings.rotor_swap) lim_cmd = 0x67;
- else lim_cmd = 0x66;
- g_Zapit->sendMotorCommand(0xE1, 0x31, lim_cmd, 0, 0, 0);
- //g_Zapit->tune_TP(TP);
- break;
-
- case CRCInput::RC_7:
- printf("[motorcontrol] 7 key received... goto reference position\n");
- g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6B, 1, 0, 0);
- satellitePosition = 0;
- paintStatus();
- //g_Zapit->tune_TP(TP);
- break;
-
- case CRCInput::RC_8:
- printf("[motorcontrol] 8 key received... enable (soft) limits\n");
- g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6A, 1, 0, 0);
- //g_Zapit->tune_TP(TP);
- break;
-
- case CRCInput::RC_9:
- printf("[motorcontrol] 9 key received... (re)-calculate positions\n");
- g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6F, 1, 0, 0);
- //g_Zapit->tune_TP(TP);
- break;
-
- case CRCInput::RC_plus:
- case CRCInput::RC_up:
- printf("[motorcontrol] up key received... increase satellite position: %d\n", ++motorPosition);
- satellitePosition = 0;
- paintStatus();
- break;
-
- case CRCInput::RC_minus:
- case CRCInput::RC_down:
- if (motorPosition > 1) motorPosition--;
- printf("[motorcontrol] down key received... decrease satellite position: %d\n", motorPosition);
- satellitePosition = 0;
- paintStatus();
- break;
-
- case CRCInput::RC_blue:
- if (++stepMode > 3)
- stepMode = 0;
- if (stepMode == STEP_MODE_OFF)
- satellitePosition = 0;
- last_snr = 0;
- printf("[motorcontrol] red key received... toggle stepmode on/off: %d\n", stepMode);
- paintStatus();
- break;
-
- default:
- //printf("[motorcontrol] message received...\n");
- if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000))
- delete[] (unsigned char*) data;
- break;
- }
+ g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd);
+ showSNR();
+ //printf("SIG: %d SNR %d last %d\n", g_sig, g_snr, last_snr);
+ if(moving && (stepMode == STEP_MODE_AUTO)) {
+ if(last_snr < g_snr) {
+ wasgrow = 1;
}
+ //if((last_snr > g_snr) && last_snr > 37000)
+ if(wasgrow && (last_snr > g_snr) /* && last_snr > 50*/) {
+ //printf("Must stop rotor!!!\n");
+ g_Zapit->sendMotorCommand(0xE0, 0x31, 0x60, 0, 0, 0);
+ moving = 0;
+ paintStatus();
+ last_snr = 0;
+ //g_Zapit->tune_TP(TP);
+ } else
+ last_snr = g_snr;
+ } else
+ wasgrow = 0;
+
+ if (msg == CRCInput::RC_ok || msg == CRCInput::RC_0) {
+ printf("[motorcontrol] 0 key received... goto %s\n", installerMenue ? "userMenue" : "installerMenue");
+ if (installerMenue)
+ installerMenue = false;
else
- {
- switch(msg)
- {
- case CRCInput::RC_ok:
- case CRCInput::RC_0:
- printf("[motorcontrol] 0 key received... goto installerMenue\n");
- installerMenue = true;
- paintMenu();
- paintStatus();
- break;
-
- case CRCInput::RC_1:
- case CRCInput::RC_right:
- printf("[motorcontrol] left/1 key received... drive/Step motor west, stepMode: %d\n", stepMode);
- motorStepWest();
- paintStatus();
- //g_Zapit->tune_TP(TP);
- break;
-
- case CRCInput::RC_red:
- case CRCInput::RC_2:
- printf("[motorcontrol] 2 key received... halt motor\n");
- g_Zapit->sendMotorCommand(0xE0, 0x31, 0x60, 0, 0, 0);
- //g_Zapit->tune_TP(TP);
- break;
-
- case CRCInput::RC_3:
- case CRCInput::RC_left:
- printf("[motorcontrol] right/3 key received... drive/Step motor east, stepMode: %d\n", stepMode);
- motorStepEast();
- paintStatus();
- //g_Zapit->tune_TP(TP);
- break;
-
- case CRCInput::RC_green:
- case CRCInput::RC_5:
- {
- bool store = true;
- printf("[motorcontrol] 5 key received... store present satellite number: %d\n", motorPosition);
- if(motorPosition != origPosition) {
- printf("[motorcontrol] position changed %d -> %d\n", origPosition, motorPosition);
- for(sit = satmap.begin(); sit != satmap.end(); sit++) {
- if(sit->second.motor_position == motorPosition)
- break;
- }
- if(sit != satmap.end()) {
- std::string satname = CServiceManager::getInstance()->GetSatelliteName(sit->first);
- printf("[motorcontrol] new positions configured for %s\n", satname.c_str());
- std::string buf = g_Locale->getText(LOCALE_MOTORCONTROL_OVERRIDE);
- buf += " ";
- buf += satname;
- buf += " ?";
- store = (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes);
- }
- }
- if(store)
- g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6A, 1, motorPosition, 0);
- //g_Zapit->tune_TP(TP);
- }
- break;
-
- case CRCInput::RC_6:
- if (stepSize < 0x7F) stepSize++;
- printf("[motorcontrol] 6 key received... increase Step size: %d\n", stepSize);
- paintStatus();
- break;
-
- case CRCInput::RC_yellow:
- case CRCInput::RC_7:
- printf("[motorcontrol] 7 key received... goto satellite number: %d\n", motorPosition);
- g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6B, 1, motorPosition, 0);
- satellitePosition = 0;
- paintStatus();
- //g_Zapit->tune_TP(TP);
- break;
-
- case CRCInput::RC_9:
- if (stepSize > 1) stepSize--;
- printf("[motorcontrol] 9 key received... decrease Step size: %d\n", stepSize);
- paintStatus();
- break;
-
- case CRCInput::RC_plus:
- case CRCInput::RC_up:
- printf("[motorcontrol] up key received... increase satellite position: %d\n", ++motorPosition);
- satellitePosition = 0;
- paintStatus();
- //g_Zapit->tune_TP(TP);
- break;
-
- case CRCInput::RC_minus:
- case CRCInput::RC_down:
- if (motorPosition > 1) motorPosition--;
- printf("[motorcontrol] down key received... decrease satellite position: %d\n", motorPosition);
- satellitePosition = 0;
- paintStatus();
- //g_Zapit->tune_TP(TP);
- break;
-
- case CRCInput::RC_blue:
- if (++stepMode > 2)
- stepMode = 0;
- if (stepMode == STEP_MODE_OFF)
- satellitePosition = 0;
- printf("[motorcontrol] red key received... toggle stepmode on/off: %d\n", stepMode);
- paintStatus();
- break;
-
- default:
- //printf("[motorcontrol] message received...\n");
- if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000))
- delete[] (unsigned char*) data;
- break;
- }
+ installerMenue = true;
+ paintMenu();
+ paintStatus();
+ }
+ else if (msg == CRCInput::RC_1 || msg == CRCInput::RC_left) {
+ printf("[motorcontrol] left/1 key received... drive/Step motor west, stepMode: %d\n", stepMode);
+ motorStep(true);
+ paintStatus();
+ //g_Zapit->tune_TP(TP);
+ }
+ else if (msg == CRCInput::RC_red || msg == CRCInput::RC_2) {
+ printf("[motorcontrol] 2 key received... halt motor\n");
+ g_Zapit->sendMotorCommand(0xE0, 0x31, 0x60, 0, 0, 0);
+ moving = 0;
+ paintStatus();
+ //g_Zapit->tune_TP(TP);
+ }
+ else if (msg == CRCInput::RC_3 || msg == CRCInput::RC_right) {
+ printf("[motorcontrol] right/3 key received... drive/Step motor east, stepMode: %d\n", stepMode);
+ motorStep(false);
+ paintStatus();
+ //g_Zapit->tune_TP(TP);
+ }
+ else if (msg == CRCInput::RC_4) {
+ if (installerMenue) {
+ printf("[motorcontrol] 4 key received... set west (soft) limit\n");
+ if(g_settings.rotor_swap) lim_cmd = 0x66;
+ else lim_cmd = 0x67;
+ g_Zapit->sendMotorCommand(0xE1, 0x31, lim_cmd, 0, 0, 0);
+ //g_Zapit->tune_TP(TP);
}
}
+ else if (msg == CRCInput::RC_5 || msg == CRCInput::RC_green) {
+ if (installerMenue) {
+ printf("[motorcontrol] 5 key received... disable (soft) limits\n");
+ g_Zapit->sendMotorCommand(0xE0, 0x31, 0x63, 0, 0, 0);
+ } else {
+ bool store = true;
+ printf("[motorcontrol] 5 key received... store present satellite number: %d\n", motorPosition);
+ if(motorPosition != origPosition) {
+ printf("[motorcontrol] position changed %d -> %d\n", origPosition, motorPosition);
+ for(sit = satmap.begin(); sit != satmap.end(); sit++) {
+ if(sit->second.motor_position == motorPosition)
+ break;
+ }
+ if(sit != satmap.end()) {
+ std::string satname = CServiceManager::getInstance()->GetSatelliteName(sit->first);
+ printf("[motorcontrol] new positions configured for %s\n", satname.c_str());
+ std::string buf = g_Locale->getText(LOCALE_MOTORCONTROL_OVERRIDE);
+ buf += " ";
+ buf += satname;
+ buf += " ?";
+ store = (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes);
+ }
+ }
+ if(store)
+ g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6A, 1, motorPosition, 0);
+ }
+ }
+ else if (msg == CRCInput::RC_6) {
+ if (installerMenue) {
+ printf("[motorcontrol] 6 key received... set east (soft) limit\n");
+ if(g_settings.rotor_swap) lim_cmd = 0x67;
+ else lim_cmd = 0x66;
+ g_Zapit->sendMotorCommand(0xE1, 0x31, lim_cmd, 0, 0, 0);
+ //g_Zapit->tune_TP(TP);
+ } else {
+ if (stepSize < 0x7F) stepSize++;
+ printf("[motorcontrol] 6 key received... increase Step size: %d\n", stepSize);
+ paintStatus();
+ }
+ }
+ else if (msg == CRCInput::RC_7) {
+ if (installerMenue) {
+ printf("[motorcontrol] 7 key received... goto reference position\n");
+ g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6B, 1, 0, 0);
+ satellitePosition = 0;
+ paintStatus();
+ } else {
+ printf("[motorcontrol] 7 key received... goto satellite number: %d\n", motorPosition);
+ g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6B, 1, motorPosition, 0);
+ satellitePosition = 0;
+ paintStatus();
+ }
+ //g_Zapit->tune_TP(TP);
+ }
+ else if (msg == CRCInput::RC_8) {
+ if (installerMenue) {
+ printf("[motorcontrol] 8 key received... enable (soft) limits\n");
+ g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6A, 1, 0, 0);
+ }
+ }
+ else if (msg == CRCInput::RC_9) {
+ if (installerMenue) {
+ printf("[motorcontrol] 9 key received... (re)-calculate positions\n");
+ g_Zapit->sendMotorCommand(0xE0, 0x31, 0x6F, 1, 0, 0);
+ } else {
+ if (stepSize > 1) stepSize--;
+ printf("[motorcontrol] 9 key received... decrease Step size: %d\n", stepSize);
+ paintStatus();
+ }
+ }
+ else if (msg == CRCInput::RC_plus || msg == CRCInput::RC_up) {
+ printf("[motorcontrol] up key received... increase satellite position: %d\n", ++motorPosition);
+ satellitePosition = 0;
+ paintStatus();
+ }
+ else if (msg == CRCInput::RC_minus || msg == CRCInput::RC_down) {
+ if (motorPosition > 1) motorPosition--;
+ printf("[motorcontrol] down key received... decrease satellite position: %d\n", motorPosition);
+ satellitePosition = 0;
+ paintStatus();
+ }
+ else if (msg == CRCInput::RC_blue) {
+ if (++stepMode > 3)
+ stepMode = 0;
+ if (stepMode == STEP_MODE_OFF)
+ satellitePosition = 0;
+ last_snr = 0;
+ printf("[motorcontrol] blue key received... toggle stepmode on/off: %d\n", stepMode);
+ paintStatus();
+ }
+ else if (msg == CRCInput::RC_info) {
+ network = "waiting for NIT...";
+ paintStatus();
+ readNetwork();
+ paintStatus();
+ }
+ else if (msg == CRCInput::RC_setup) {
+ retval = menu_return::RETURN_EXIT_ALL;
+ }
+ else {
+ if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000))
+ delete[] (unsigned char*) data;
+ }
frameBuffer->blit();
-
- istheend = (msg == CRCInput::RC_home);
}
hide();
frontend->setTsidOnid(0);
- return menu_return::RETURN_REPAINT;
+ return retval;
}
-void CMotorControl::motorStepWest(void)
+void CMotorControl::motorStep(bool west)
{
int cmd;
- printf("[motorcontrol] motorStepWest\n");
- if(g_settings.rotor_swap) cmd = 0x68;
- else cmd = 0x69;
+ if (west) {
+ if(g_settings.rotor_swap) cmd = 0x68;
+ else cmd = 0x69;
+ } else {
+ if(g_settings.rotor_swap) cmd = 0x69;
+ else cmd = 0x68;
+ }
+ printf("[motorcontrol] motorStep: %s\n", west ? "West" : "East");
switch(stepMode)
{
case STEP_MODE_ON:
g_Zapit->sendMotorCommand(0xE0, 0x31, cmd, 1, (-1 * stepSize), 0);
- satellitePosition += stepSize;
+ satellitePosition += west ? stepSize : -stepSize;
break;
case STEP_MODE_TIMED:
g_Zapit->sendMotorCommand(0xE0, 0x31, cmd, 1, 40, 0);
usleep(stepSize * stepDelay * 1000);
g_Zapit->sendMotorCommand(0xE0, 0x31, 0x60, 0, 0, 0); //halt motor
- satellitePosition += stepSize;
+ satellitePosition += west ? stepSize : -stepSize;
break;
case STEP_MODE_AUTO:
moving = 1;
@@ -470,31 +353,6 @@ void CMotorControl::motorStepWest(void)
}
}
-void CMotorControl::motorStepEast(void)
-{
- int cmd;
- if(g_settings.rotor_swap) cmd = 0x69;
- else cmd = 0x68;
- printf("[motorcontrol] motorStepEast\n");
- switch(stepMode)
- {
- case STEP_MODE_ON:
- g_Zapit->sendMotorCommand(0xE0, 0x31, cmd, 1, (-1 * stepSize), 0);
- satellitePosition -= stepSize;
- break;
- case STEP_MODE_TIMED:
- g_Zapit->sendMotorCommand(0xE0, 0x31, cmd, 1, 40, 0);
- usleep(stepSize * stepDelay * 1000);
- g_Zapit->sendMotorCommand(0xE0, 0x31, 0x60, 0, 0, 0); //halt motor
- satellitePosition -= stepSize;
- break;
- case STEP_MODE_AUTO:
- moving = 1;
- default:
- g_Zapit->sendMotorCommand(0xE0, 0x31, cmd, 1, 40, 0);
- }
-}
-
void CMotorControl::hide()
{
frameBuffer->paintBackgroundBoxRel(x, y, width, height + 20);
@@ -504,21 +362,25 @@ void CMotorControl::hide()
void CMotorControl::paintLine(int px, int *py, int pwidth, const char *txt)
{
+ frameBuffer->paintBoxRel(px, *py, pwidth, mheight, COL_MENUCONTENT_PLUS_0);
*py += mheight;
- frameBuffer->paintBoxRel(px, *py - mheight, pwidth, mheight, COL_MENUCONTENT_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px, *py, pwidth, txt, COL_MENUCONTENT, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px, *py, pwidth, txt, COL_MENUCONTENT_TEXT, 0, true);
}
void CMotorControl::paintLine(int px, int py, int pwidth, const char *txt)
{
- //frameBuffer->paintBoxRel(px, py - mheight, pwidth, mheight, COL_MENUCONTENT_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px, py, pwidth, txt, COL_MENUCONTENT, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px, py, pwidth, txt, COL_MENUCONTENT_TEXT, 0, true);
+}
+
+void CMotorControl::paintLine(int ix, int tx, int *py, int pwidth, const char *icon, const char *txt)
+{
+ frameBuffer->paintIcon(icon, ix, *py, mheight);
+ *py += mheight;
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(tx, *py, pwidth, txt, COL_MENUCONTENT_TEXT, 0, true);
}
void CMotorControl::paintSeparator(int xpos, int *pypos, int pwidth, const char * /*txt*/)
{
- //int stringwidth = 0;
- //int stringstartposX = 0;
int th = 10;
//*ypos += mheight;
*pypos += th;
@@ -526,17 +388,17 @@ void CMotorControl::paintSeparator(int xpos, int *pypos, int pwidth, const char
frameBuffer->paintHLineRel(xpos, pwidth - 20, *pypos - (th >> 1) + 1, COL_MENUCONTENT_PLUS_1);
#if 0
- stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(txt);
- stringstartposX = 0;
+ int stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(txt);
+ int stringstartposX = 0;
stringstartposX = (xpos + (pwidth >> 1)) - (stringwidth >> 1);
frameBuffer->paintBoxRel(stringstartposX - 5, *pypos - mheight, stringwidth + 10, mheight, COL_MENUCONTENT_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposX, *pypos, stringwidth, txt, COL_MENUCONTENT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposX, *pypos, stringwidth, txt, COL_MENUCONTENT_TEXT);
#endif
}
void CMotorControl::paintStatus()
{
- char buf[256];
+ char buf1[256];
char buf2[256];
int xpos1 = x + 10;
@@ -548,54 +410,45 @@ void CMotorControl::paintStatus()
paintSeparator(xpos1, &ypos, width, g_Locale->getText(LOCALE_MOTORCONTROL_SETTINGS));
paintLine(xpos1, &ypos, width1, g_Locale->getText(LOCALE_MOTORCONTROL_MOTOR_POS));
- sprintf(buf, "%d", motorPosition);
- paintLine(xpos2, ypos, width2 , buf);
+ sprintf(buf1, "%d", motorPosition);
+ paintLine(xpos2, ypos, width2 , buf1);
paintLine(xpos1, &ypos, width1, g_Locale->getText(LOCALE_MOTORCONTROL_MOVEMENT));
switch(stepMode)
{
case STEP_MODE_ON:
- strcpy(buf, g_Locale->getText(LOCALE_MOTORCONTROL_STEP_MODE));
- break;
- case STEP_MODE_OFF:
- strcpy(buf, g_Locale->getText(LOCALE_MOTORCONTROL_DRIVE_MODE));
+ strcpy(buf1, g_Locale->getText(LOCALE_MOTORCONTROL_STEP_MODE));
+ sprintf(buf2, "%d", stepSize);
break;
case STEP_MODE_AUTO:
- strcpy(buf, g_Locale->getText(LOCALE_MOTORCONTROL_DRIVE_MODE_AUTO));
+ strcpy(buf1, g_Locale->getText(LOCALE_MOTORCONTROL_DRIVE_MODE_AUTO));
+ if(moving)
+ strcpy(buf2, g_Locale->getText(LOCALE_MOTORCONTROL_STOP_MOVING));
+ else
+ strcpy(buf2, g_Locale->getText(LOCALE_MOTORCONTROL_STOP_STOPPED));
+ break;
+ case STEP_MODE_OFF:
+ strcpy(buf1, g_Locale->getText(LOCALE_MOTORCONTROL_DRIVE_MODE));
+ strcpy(buf2, g_Locale->getText(LOCALE_MOTORCONTROL_NO_MODE));
break;
case STEP_MODE_TIMED:
- strcpy(buf, g_Locale->getText(LOCALE_MOTORCONTROL_TIMED_MODE));
+ strcpy(buf1, g_Locale->getText(LOCALE_MOTORCONTROL_TIMED_MODE));
+ sprintf(buf2, "%d %s", stepSize * stepDelay, g_Locale->getText(LOCALE_MOTORCONTROL_MSEC));
break;
}
- paintLine(xpos2, ypos, width2, buf);
+ paintLine(xpos2, ypos, width2, buf1);
paintLine(xpos1, &ypos, width1, g_Locale->getText(LOCALE_MOTORCONTROL_STEP_SIZE));
- switch(stepMode)
- {
- case STEP_MODE_ON:
- sprintf(buf, "%d", stepSize);
- break;
- case STEP_MODE_AUTO:
- if(moving)
- strcpy(buf, g_Locale->getText(LOCALE_MOTORCONTROL_STOP_MOVING));
- else
- strcpy(buf, g_Locale->getText(LOCALE_MOTORCONTROL_STOP_STOPPED));
- break;
- case STEP_MODE_OFF:
- strcpy(buf, g_Locale->getText(LOCALE_MOTORCONTROL_NO_MODE));
- break;
- case STEP_MODE_TIMED:
- sprintf(buf, "%d ", stepSize * stepDelay);
- strcat(buf, g_Locale->getText(LOCALE_MOTORCONTROL_MSEC));
- break;
- }
- paintLine(xpos2, ypos, width2, buf);
+ paintLine(xpos2, ypos, width2, buf2);
+
+ paintLine(xpos1, &ypos, width1, g_Locale->getText(LOCALE_MOTORCONTROL_NETWORK));
+ paintLine(xpos2, ypos, width2, network.c_str());
paintSeparator(xpos1, &ypos, width, g_Locale->getText(LOCALE_MOTORCONTROL_STATUS));
- strcpy(buf, g_Locale->getText(LOCALE_MOTORCONTROL_SAT_POS));
- sprintf(buf2, "%d", satellitePosition);
- strcat(buf, buf2);
- paintLine(xpos1, &ypos, width1, buf);
+
+ sprintf(buf1, "%s %d", g_Locale->getText(LOCALE_MOTORCONTROL_SAT_POS), satellitePosition);
+ paintLine(xpos1, &ypos, width1, buf1);
+
paintSeparator(xpos1, &ypos, width, g_Locale->getText(LOCALE_MOTORCONTROL_SETTINGS));
}
@@ -607,6 +460,10 @@ void CMotorControl::paintHead()
void CMotorControl::paintMenu()
{
+ sigscale->reset();
+ snrscale->reset();
+ lastsnr = lastsig = -1;
+
frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);
ypos = y + hheight + (mheight >> 1) - 10;
@@ -614,8 +471,9 @@ void CMotorControl::paintMenu()
int xpos1 = x + 10;
int xpos2 = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth("(7/yellow)");
int width2 = width - (xpos2 - xpos1) - 10;
- int width1 = width - 10;
+#if 1
+ int width1 = width - 10;
paintLine(xpos1, &ypos, width1, "(0/OK)");
if(installerMenue)
paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_USER_MENU));
@@ -633,22 +491,16 @@ void CMotorControl::paintMenu()
{
paintLine(xpos1, &ypos, width1, "(4)");
paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_WEST_LIMIT));
- paintLine(xpos1, &ypos, width1, "(5)");
+ paintLine(xpos1, &ypos, width1, "(5/green)");
paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_DISABLE_LIMIT));
paintLine(xpos1, &ypos, width1, "(6)");
paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_EAST_LIMIT));
- paintLine(xpos1, &ypos, width1, "(7)");
+ paintLine(xpos1, &ypos, width1, "(7/yellow)");
paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_REF_POSITION));
paintLine(xpos1, &ypos, width1, "(8)");
paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_ENABLE_LIMIT));
paintLine(xpos1, &ypos, width1, "(9)");
paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_CALC_POSITIONS));
- paintLine(xpos1, &ypos, width1, "(+/up)");
- paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_POS_INCREASE));
- paintLine(xpos1, &ypos, width1, "(-/down)");
- paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_POS_DECREASE));
- paintLine(xpos1, &ypos, width1, "(blue)");
- paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_STEP_DRIVE));
}
else
{
@@ -664,14 +516,41 @@ void CMotorControl::paintMenu()
paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_NOTDEF));
paintLine(xpos1, &ypos, width1, "(9)");
paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_STEP_DECREASE));
- paintLine(xpos1, &ypos, width1, "(+/up)");
- paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_POS_INCREASE));
- paintLine(xpos1, &ypos, width1, "(-/down)");
- paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_POS_DECREASE));
- paintLine(xpos1, &ypos, width1, "(blue)");
- paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_STEP_DRIVE));
}
+ paintLine(xpos1, &ypos, width1, "(+/up)");
+ paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_POS_INCREASE));
+ paintLine(xpos1, &ypos, width1, "(-/down)");
+ paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_POS_DECREASE));
+ paintLine(xpos1, &ypos, width1, "(blue)");
+ paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_STEP_DRIVE));
+ paintLine(xpos1, &ypos, width1, "(info)");
+ paintLine(xpos2, ypos, width2, g_Locale->getText(LOCALE_MOTORCONTROL_NETWORK));
+#else
+ paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_0,
+ installerMenue ? g_Locale->getText(LOCALE_MOTORCONTROL_USER_MENU) : g_Locale->getText(LOCALE_MOTORCONTROL_INSTALL_MENU));
+ paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_1, g_Locale->getText(LOCALE_MOTORCONTROL_STEP_WEST));
+ paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_2, g_Locale->getText(LOCALE_MOTORCONTROL_HALT));
+ paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_3, g_Locale->getText(LOCALE_MOTORCONTROL_STEP_EAST));
+
+ paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_4,
+ installerMenue ? g_Locale->getText(LOCALE_MOTORCONTROL_WEST_LIMIT) : g_Locale->getText(LOCALE_MOTORCONTROL_NOTDEF));
+ paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_5,
+ installerMenue ? g_Locale->getText(LOCALE_MOTORCONTROL_DISABLE_LIMIT) : g_Locale->getText(LOCALE_MOTORCONTROL_STORE));
+ paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_6,
+ installerMenue ? g_Locale->getText(LOCALE_MOTORCONTROL_EAST_LIMIT) : g_Locale->getText(LOCALE_MOTORCONTROL_STEP_INCREASE));
+ paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_7,
+ installerMenue ? g_Locale->getText(LOCALE_MOTORCONTROL_REF_POSITION) : g_Locale->getText(LOCALE_MOTORCONTROL_GOTO));
+ paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_8,
+ installerMenue ? g_Locale->getText(LOCALE_MOTORCONTROL_ENABLE_LIMIT) : g_Locale->getText(LOCALE_MOTORCONTROL_NOTDEF));
+ paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_9,
+ installerMenue ? g_Locale->getText(LOCALE_MOTORCONTROL_CALC_POSITIONS) : g_Locale->getText(LOCALE_MOTORCONTROL_STEP_DECREASE));
+
+ paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_TOP, g_Locale->getText(LOCALE_MOTORCONTROL_POS_INCREASE));
+ paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_DOWN, g_Locale->getText(LOCALE_MOTORCONTROL_POS_DECREASE));
+ paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_BLUE, g_Locale->getText(LOCALE_MOTORCONTROL_STEP_DRIVE));
+ paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_INFO_SMALL, g_Locale->getText(LOCALE_MOTORCONTROL_NETWORK));
+#endif
ypos_status = ypos;
}
@@ -699,24 +578,19 @@ void CMotorControl::startSatFind(void)
void CMotorControl::stopSatFind(void)
{
-
+#if 0
if (satfindpid != -1) {
printf("[motorcontrol] killing satfind...\n");
kill(satfindpid, SIGKILL);
waitpid(satfindpid, 0, 0);
satfindpid = -1;
}
+#endif
}
-#define BARWT 10
-#define BAR_BL 2
-#define BARW (BARWT - BAR_BL)
-#define BARWW (BARWT - BARW)
-
void CMotorControl::showSNR()
{
char percent[10];
- //char ber[20];
int barwidth = 100;
uint16_t ssig, ssnr;
int sig, snr;
@@ -747,7 +621,7 @@ void CMotorControl::showSNR()
posx_sig += barwidth + 3;
frameBuffer->paintBoxRel(posx_sig, posy - 2, sw+4, mheight, COL_MENUCONTENT_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx_sig+2, posy + mheight, sw, percent, COL_MENUCONTENT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx_sig+2, posy + mheight, sw, percent, COL_MENUCONTENT_TEXT);
}
if (lastsnr != snr) {
@@ -761,6 +635,21 @@ void CMotorControl::showSNR()
posx_snr += barwidth + 3;
frameBuffer->paintBoxRel(posx_snr, posy - 2, sw+4, mheight, COL_MENUCONTENT_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx_snr+2, posy + mheight, sw, percent, COL_MENUCONTENT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx_snr+2, posy + mheight, sw, percent, COL_MENUCONTENT_TEXT);
}
}
+
+void CMotorControl::readNetwork()
+{
+ CNit nit(0, 0, 0);
+ nit.Start();
+ nit.Stop();
+ network = nit.GetNetworkName();
+ t_satellite_position pos = nit.getOrbitalPosition();
+ if (network.empty())
+ network = "unknown";
+
+ char net[100];
+ snprintf(net, sizeof(net), "%03d.%d, %s", abs(pos)/10, abs(pos)%10, network.c_str());
+ network = net;
+}
diff --git a/src/gui/motorcontrol.h b/src/gui/motorcontrol.h
index 84ffae7ba..fb4b74dc4 100644
--- a/src/gui/motorcontrol.h
+++ b/src/gui/motorcontrol.h
@@ -67,18 +67,21 @@ class CMotorControl : public CMenuTarget
int32_t satellitePosition;
int satfindpid;
int lastsnr, lastsig;
+ int g_sig, g_snr, last_snr, moving;
+ std::string network;
CProgressBar *snrscale, *sigscale;
void paintHead(void);
void paintMenu(void);
void paintStatus(void);
void paintLine(int x, int *y, int width, const char *txt);
void paintLine(int x, int y, int width, const char *txt);
+ void paintLine(int ix, int tx, int *y, int pwidth, const char *icon, const char *txt);
void paintSeparator(int xpos, int * ypos, int width, const char *txt);
- void motorStepEast(void);
- void motorStepWest(void);
+ void motorStep(bool west);
void startSatFind(void);
void stopSatFind(void);
void showSNR(void);
+ void readNetwork(void);
public:
diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp
index 2b704e839..3e5bb55b7 100644
--- a/src/gui/moviebrowser.cpp
+++ b/src/gui/moviebrowser.cpp
@@ -139,7 +139,7 @@ const CMenuOptionChooser::keyval MESSAGEBOX_PARENTAL_LOCKAGE_OPTIONS[MESSAGEBOX_
};
#define TITLE_BACKGROUND_COLOR ((CFBWindow::color_t)COL_MENUHEAD_PLUS_0)
-#define TITLE_FONT_COLOR ((CFBWindow::color_t)COL_MENUHEAD)
+#define TITLE_FONT_COLOR COL_MENUHEAD_TEXT
#define TITLE_FONT g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]
#define FOOT_FONT g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]
@@ -344,7 +344,7 @@ CMovieBrowser::CMovieBrowser(const char* path): configfile ('\t')
CMovieBrowser::CMovieBrowser(): configfile ('\t')
{
- TRACE("$Id: moviebrowser.cpp,v 1.10 2006/09/11 21:11:35 guenther Exp $\r\n");
+ //TRACE("$Id: moviebrowser.cpp,v 1.10 2006/09/11 21:11:35 guenther Exp $\r\n");
init();
}
@@ -609,6 +609,8 @@ void CMovieBrowser::initGlobalSettings(void)
m_settings.ytmode = cYTFeedParser::MOST_POPULAR;
m_settings.ytresults = 10;
m_settings.ytregion = "default";
+ m_settings.ytquality = 37;
+ m_settings.ytconcconn = 4;
}
void CMovieBrowser::initFrames(void)
@@ -635,7 +637,6 @@ void CMovieBrowser::initFrames(void)
m_cBoxFrameBrowserList.iWidth = m_cBoxFrame.iWidth;
m_cBoxFrameBrowserList.iHeight = m_cBoxFrame.iHeight * m_settings.browserFrameHeight / 100;
-fprintf(stderr, "m_cBoxFrame.iHeight %d m_cBoxFrameBrowserList.iHeight %d m_settings.browserFrameHeight %d\n",m_cBoxFrame.iHeight, m_cBoxFrameBrowserList.iHeight, m_settings.browserFrameHeight);
m_cBoxFrameFootRel.iX = 0;
m_cBoxFrameFootRel.iY = m_cBoxFrame.iHeight - m_pcFontFoot->getHeight();
m_cBoxFrameFootRel.iWidth = m_cBoxFrameBrowserList.iWidth;
@@ -1642,7 +1643,7 @@ void CMovieBrowser::refreshTitle(void)
void CMovieBrowser::refreshFoot(void)
{
//TRACE("[mb]->refreshButtonLine \r\n");
- int color = (CFBWindow::color_t) COL_INFOBAR_SHADOW;
+ fb_pixel_t color = COL_INFOBAR_TEXT;
int iw = 0, ih = 0;
std::string filter_text = g_Locale->getText(LOCALE_MOVIEBROWSER_FOOT_FILTER);
@@ -2872,7 +2873,6 @@ void CMovieBrowser::loadMovies(bool doRefresh)
loadBox.paint();
//clock_act = clock()/10000;TRACE("[mb] *1: time %9ld clock %6ld dclock %6ld*\n",(long)time(NULL),clock_act,clock_act - clock_prev);clock_prev = clock_act;
- m_file_info_stale = false;
if (show_mode == MB_SHOW_YT) {
loadYTitles(m_settings.ytmode, m_settings.ytsearch, m_settings.ytvid);
} else {
@@ -2888,6 +2888,7 @@ void CMovieBrowser::loadMovies(bool doRefresh)
autoFindSerie();
}
}
+ m_file_info_stale = false;
loadBox.hide();
@@ -3803,16 +3804,16 @@ int CMenuSelector::paint(bool selected)
{
CFrameBuffer * frameBuffer = CFrameBuffer::getInstance();
- unsigned char color = COL_MENUCONTENT;
+ fb_pixel_t color = COL_MENUCONTENT_TEXT;
fb_pixel_t bgcolor = COL_MENUCONTENT_PLUS_0;
if (selected)
{
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
}
if (!active)
{
- color = COL_MENUCONTENTINACTIVE;
+ color = COL_MENUCONTENTINACTIVE_TEXT;
bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0;
}
diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp
index aaa621990..fdc1f9101 100644
--- a/src/gui/movieplayer.cpp
+++ b/src/gui/movieplayer.cpp
@@ -420,12 +420,14 @@ bool CMoviePlayerGui::SelectFile()
sscanf(cLine, "#EXTINF:%d,%[^\n]\n", &dur, name);
if (strlen(cLine) > 0 && cLine[0]!='#')
{
- char *url = strstr(cLine, "http://");
- if (url != NULL) {
- printf("name %s [%d] url: %s\n", name, dur, url);
- full_name = url;
- if(strlen(name))
- file_name = name;
+ char *url = NULL;
+ if ( (url = strstr(cLine, "http://")) || (url = strstr(cLine, "rtmp://")) ){
+ if (url != NULL) {
+ printf("name %s [%d] url: %s\n", name, dur, url);
+ full_name = url;
+ if(strlen(name))
+ file_name = name;
+ }
}
}
}
@@ -1480,7 +1482,7 @@ void CMoviePlayerGui::showSubtitle(neutrino_msg_data_t data)
frameBuffer->paintBoxRel(min_x, min_y, max_x - min_x, max_y-min_y, COL_MENUCONTENT_PLUS_0);
for (unsigned i = 0; i < subtext.size(); i++)
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x[i], y[i], sw, subtext[i].c_str(), COL_MENUCONTENT, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x[i], y[i], sw, subtext[i].c_str(), COL_MENUCONTENT_TEXT, 0, true);
end_time = sub->end_display_time + time_monotonic_ms();
}
diff --git a/src/gui/nfs.cpp b/src/gui/nfs.cpp
index 3117fba73..71d14b114 100644
--- a/src/gui/nfs.cpp
+++ b/src/gui/nfs.cpp
@@ -103,6 +103,30 @@ int CNFSMountGui::exec( CMenuTarget* parent, const std::string & actionKey )
}
returnval = menu();
}
+ else if(actionKey == "rc_spkr")
+ {
+ int i = mountMenuWPtr->getSelected() - menu_offset;
+ if (i > -1 && i < NETWORK_NFS_NR_OF_ENTRIES) {
+ g_settings.network_nfs_ip[i] = "";
+ g_settings.network_nfs_dir[i][0] = 0;
+ g_settings.network_nfs_local_dir[i][0] = 0;
+ g_settings.network_nfs_automount[i] = 0;
+ g_settings.network_nfs_type[i] = 0;
+ g_settings.network_nfs_username[i][0] = 0;
+ g_settings.network_nfs_password[i][0] = 0;
+ strcpy(g_settings.network_nfs_mount_options1[i], "ro,soft,udp");
+ strcpy(g_settings.network_nfs_mount_options2[i], "nolock,rsize=8192,wsize=8192");
+ strcpy(g_settings.network_nfs_mac[i], "11:22:33:44:55:66");
+ sprintf(m_entry[i],
+ nfs_entry_printf_string[(g_settings.network_nfs_type[i] == (int) CFSMounter::NFS) ? 0 : ((g_settings.network_nfs_type[i] == (int) CFSMounter::CIFS) ? 1 : 2)],
+ g_settings.network_nfs_ip[i].c_str(),
+ FILESYSTEM_ENCODING_TO_UTF8(g_settings.network_nfs_dir[i]),
+ FILESYSTEM_ENCODING_TO_UTF8(g_settings.network_nfs_local_dir[i]),
+ g_Locale->getText(g_settings.network_nfs_automount[i] ? LOCALE_MESSAGEBOX_YES : LOCALE_MESSAGEBOX_NO));
+ sprintf(ISO_8859_1_entry[i],ZapitTools::UTF8_to_Latin1(m_entry[i]).c_str());
+ mountMenuEntry[i]->setOption(ISO_8859_1_entry[i]);
+ }
+ }
else if(actionKey.substr(0,10)=="mountentry")
{
parent->hide();
@@ -148,7 +172,9 @@ int CNFSMountGui::exec( CMenuTarget* parent, const std::string & actionKey )
int CNFSMountGui::menu()
{
CMenuWidget mountMenuW(LOCALE_NFS_MOUNT, NEUTRINO_ICON_NETWORK, width);
+ mountMenuWPtr = &mountMenuW;
mountMenuW.addIntroItems();
+ mountMenuW.addKey(CRCInput::RC_spkr, this, "rc_spkr");
char s2[12];
for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++)
@@ -156,6 +182,8 @@ int CNFSMountGui::menu()
sprintf(s2,"mountentry%d",i);
sprintf(ISO_8859_1_entry[i],ZapitTools::UTF8_to_Latin1(m_entry[i]).c_str());
mountMenuEntry[i] = new CMenuForwarderNonLocalized("", true, ISO_8859_1_entry[i], this, s2);
+ if (!i)
+ menu_offset = mountMenuW.getItemsCount();
if (CFSMounter::isMounted(g_settings.network_nfs_local_dir[i]))
{
diff --git a/src/gui/nfs.h b/src/gui/nfs.h
index 46d4469ae..3caabdcdb 100644
--- a/src/gui/nfs.h
+++ b/src/gui/nfs.h
@@ -48,6 +48,9 @@ class CNFSMountGui : public CMenuTarget
char m_entry[NETWORK_NFS_NR_OF_ENTRIES][200];
char ISO_8859_1_entry[NETWORK_NFS_NR_OF_ENTRIES][200];
+ CMenuWidget *mountMenuWPtr;
+ int menu_offset;
+
CMenuForwarderNonLocalized* mountMenuEntry[NETWORK_NFS_NR_OF_ENTRIES];
CFSMounter::FS_Support m_nfs_sup;
diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp
index 1076e07a6..b4538a074 100644
--- a/src/gui/osd_setup.cpp
+++ b/src/gui/osd_setup.cpp
@@ -49,6 +49,7 @@
#include
#include
+#include
#include
#include
#include
@@ -147,37 +148,33 @@ font_sizes_groups font_sizes_groups[6] =
{LOCALE_FONTMENU_GAMELIST , 2, gamelist_font_sizes , "fontsize.dgam", LOCALE_MENU_HINT_GAMELIST_FONTS }
};
-#define FONT_STYLE_REGULAR 0
-#define FONT_STYLE_BOLD 1
-#define FONT_STYLE_ITALIC 2
-
font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] =
{
- {LOCALE_FONTSIZE_MENU , 20, FONT_STYLE_BOLD , 0},
- {LOCALE_FONTSIZE_MENU_TITLE , 30, FONT_STYLE_BOLD , 0},
- {LOCALE_FONTSIZE_MENU_INFO , 16, FONT_STYLE_REGULAR, 0},
- {LOCALE_FONTSIZE_EPG_TITLE , 25, FONT_STYLE_REGULAR, 1},
- {LOCALE_FONTSIZE_EPG_INFO1 , 17, FONT_STYLE_ITALIC , 2},
- {LOCALE_FONTSIZE_EPG_INFO2 , 17, FONT_STYLE_REGULAR, 2},
- {LOCALE_FONTSIZE_EPG_DATE , 15, FONT_STYLE_REGULAR, 2},
- {LOCALE_FONTSIZE_EVENTLIST_TITLE , 30, FONT_STYLE_REGULAR, 0},
- {LOCALE_FONTSIZE_EVENTLIST_ITEMLARGE, 20, FONT_STYLE_BOLD , 1},
- {LOCALE_FONTSIZE_EVENTLIST_ITEMSMALL, 14, FONT_STYLE_REGULAR, 1},
- {LOCALE_FONTSIZE_EVENTLIST_DATETIME , 16, FONT_STYLE_REGULAR, 1},
- {LOCALE_FONTSIZE_EVENTLIST_EVENT , 17, FONT_STYLE_REGULAR, 1},
- {LOCALE_FONTSIZE_GAMELIST_ITEMLARGE , 20, FONT_STYLE_BOLD , 1},
- {LOCALE_FONTSIZE_GAMELIST_ITEMSMALL , 16, FONT_STYLE_REGULAR, 1},
- {LOCALE_FONTSIZE_CHANNELLIST , 20, FONT_STYLE_BOLD , 1},
- {LOCALE_FONTSIZE_CHANNELLIST_DESCR , 20, FONT_STYLE_REGULAR, 1},
- {LOCALE_FONTSIZE_CHANNELLIST_NUMBER , 14, FONT_STYLE_BOLD , 2},
- {LOCALE_FONTSIZE_CHANNELLIST_EVENT , 17, FONT_STYLE_REGULAR, 2},
- {LOCALE_FONTSIZE_CHANNEL_NUM_ZAP , 40, FONT_STYLE_BOLD , 0},
- {LOCALE_FONTSIZE_INFOBAR_NUMBER , 50, FONT_STYLE_BOLD , 0},
- {LOCALE_FONTSIZE_INFOBAR_CHANNAME , 30, FONT_STYLE_BOLD , 0},
- {LOCALE_FONTSIZE_INFOBAR_INFO , 20, FONT_STYLE_REGULAR, 1},
- {LOCALE_FONTSIZE_INFOBAR_SMALL , 14, FONT_STYLE_REGULAR, 1},
- {LOCALE_FONTSIZE_FILEBROWSER_ITEM , 16, FONT_STYLE_BOLD , 1},
- {LOCALE_FONTSIZE_MENU_HINT , 16, FONT_STYLE_REGULAR, 0}
+ {LOCALE_FONTSIZE_MENU , 20, CNeutrinoFonts::FONT_STYLE_BOLD , 0},
+ {LOCALE_FONTSIZE_MENU_TITLE , 30, CNeutrinoFonts::FONT_STYLE_BOLD , 0},
+ {LOCALE_FONTSIZE_MENU_INFO , 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 0},
+ {LOCALE_FONTSIZE_EPG_TITLE , 25, CNeutrinoFonts::FONT_STYLE_REGULAR, 1},
+ {LOCALE_FONTSIZE_EPG_INFO1 , 17, CNeutrinoFonts::FONT_STYLE_ITALIC , 2},
+ {LOCALE_FONTSIZE_EPG_INFO2 , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 2},
+ {LOCALE_FONTSIZE_EPG_DATE , 15, CNeutrinoFonts::FONT_STYLE_REGULAR, 2},
+ {LOCALE_FONTSIZE_EVENTLIST_TITLE , 30, CNeutrinoFonts::FONT_STYLE_REGULAR, 0},
+ {LOCALE_FONTSIZE_EVENTLIST_ITEMLARGE, 20, CNeutrinoFonts::FONT_STYLE_BOLD , 1},
+ {LOCALE_FONTSIZE_EVENTLIST_ITEMSMALL, 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1},
+ {LOCALE_FONTSIZE_EVENTLIST_DATETIME , 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 1},
+ {LOCALE_FONTSIZE_EVENTLIST_EVENT , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 1},
+ {LOCALE_FONTSIZE_GAMELIST_ITEMLARGE , 20, CNeutrinoFonts::FONT_STYLE_BOLD , 1},
+ {LOCALE_FONTSIZE_GAMELIST_ITEMSMALL , 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 1},
+ {LOCALE_FONTSIZE_CHANNELLIST , 20, CNeutrinoFonts::FONT_STYLE_BOLD , 1},
+ {LOCALE_FONTSIZE_CHANNELLIST_DESCR , 20, CNeutrinoFonts::FONT_STYLE_REGULAR, 1},
+ {LOCALE_FONTSIZE_CHANNELLIST_NUMBER , 14, CNeutrinoFonts::FONT_STYLE_BOLD , 2},
+ {LOCALE_FONTSIZE_CHANNELLIST_EVENT , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 2},
+ {LOCALE_FONTSIZE_CHANNEL_NUM_ZAP , 40, CNeutrinoFonts::FONT_STYLE_BOLD , 0},
+ {LOCALE_FONTSIZE_INFOBAR_NUMBER , 50, CNeutrinoFonts::FONT_STYLE_BOLD , 0},
+ {LOCALE_FONTSIZE_INFOBAR_CHANNAME , 30, CNeutrinoFonts::FONT_STYLE_BOLD , 0},
+ {LOCALE_FONTSIZE_INFOBAR_INFO , 20, CNeutrinoFonts::FONT_STYLE_REGULAR, 1},
+ {LOCALE_FONTSIZE_INFOBAR_SMALL , 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1},
+ {LOCALE_FONTSIZE_FILEBROWSER_ITEM , 16, CNeutrinoFonts::FONT_STYLE_BOLD , 1},
+ {LOCALE_FONTSIZE_MENU_HINT , 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}
};
int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey)
@@ -198,7 +195,7 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey)
{
strcpy(g_settings.font_file, fileBrowser.getSelectedFile()->Name.c_str());
printf("[neutrino] new font file %s\n", fileBrowser.getSelectedFile()->Name.c_str());
- CNeutrinoApp::getInstance()->SetupFonts();
+ CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_ALL);
osdFontFile = "(" + getBaseName(fileBrowser.getSelectedFile()->Name) + ")";
mfFontFile->setOption(osdFontFile.c_str());
}
@@ -215,7 +212,7 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey)
strcpy(g_settings.ttx_font_file, fileBrowser.getSelectedFile()->Name.c_str());
ttx_font_file = fileBrowser.getSelectedFile()->Name;
printf("[neutrino] ttx font file %s\n", fileBrowser.getSelectedFile()->Name.c_str());
- CNeutrinoApp::getInstance()->SetupFonts();
+ CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT | CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT_INST);
osdTtxFontFile = "(" + getBaseName(fileBrowser.getSelectedFile()->Name) + ")";
mfTtxFontFile->setOption(osdTtxFontFile.c_str());
}
@@ -257,7 +254,7 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey)
printf("[neutrino] new font scale settings x: %d%% y: %d%%\n", xre, yre);
g_settings.screen_xres = xre;
g_settings.screen_yres = yre;
- CNeutrinoApp::getInstance()->SetupFonts();
+ CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT | CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT_INST);
}
//return menu_return::RETURN_REPAINT;
return res;
@@ -546,6 +543,8 @@ int COsdSetup::showOsdSetup()
mc->setHint("", LOCALE_MENU_HINT_SUBCHANNEL_POS);
osd_menu->addItem(mc);
+ int oldVolumeSize = g_settings.volume_size;
+
int res = osd_menu->exec(NULL, "");
if (pb_color == -1)
@@ -554,6 +553,9 @@ int COsdSetup::showOsdSetup()
g_settings.progressbar_color = 1;
g_settings.progressbar_design = pb_color;
}
+ if (oldVolumeSize != g_settings.volume_size)
+ CVolumeHelper::getInstance()->refresh();
+
delete osd_menu;
return res;
}
@@ -935,6 +937,13 @@ void COsdSetup::showOsdVolumeSetup(CMenuWidget *menu_volume)
mc->setHint("", LOCALE_MENU_HINT_VOLUME_POS);
menu_volume->addItem(mc);
+ // volume size
+ int vMin = CVolumeHelper::getInstance()->getVolIconHeight();
+ g_settings.volume_size = max(g_settings.volume_size, vMin);
+ CMenuOptionNumberChooser * nc = new CMenuOptionNumberChooser(LOCALE_EXTRA_VOLUME_SIZE, &g_settings.volume_size, true, vMin, 50);
+ nc->setHint("", LOCALE_MENU_HINT_VOLUME_SIZE);
+ menu_volume->addItem(nc);
+
// volume digits
mc = new CMenuOptionChooser(LOCALE_EXTRA_VOLUME_DIGITS, &g_settings.volume_digits, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this);
mc->setHint("", LOCALE_MENU_HINT_VOLUME_DIGITS);
diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp
index 15f200dd7..36522e865 100644
--- a/src/gui/pictureviewer.cpp
+++ b/src/gui/pictureviewer.cpp
@@ -163,8 +163,8 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey)
fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
//get footerHeight from paintButtons
- buttons1Height = ::paintButtons(0, 0, 0, PictureViewerButtons1Count, PictureViewerButtons1, 0, 0, "", false, COL_INFOBAR_SHADOW, NULL, 0, false);
- buttons2Height = ::paintButtons(0, 0, 0, PictureViewerButtons2Count, PictureViewerButtons2, 0, 0, "", false, COL_INFOBAR_SHADOW, NULL, 0, false);
+ buttons1Height = ::paintButtons(0, 0, 0, PictureViewerButtons1Count, PictureViewerButtons1, 0, 0, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 0, false);
+ buttons2Height = ::paintButtons(0, 0, 0, PictureViewerButtons2Count, PictureViewerButtons2, 0, 0, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 0, false);
footerHeight = buttons1Height + buttons2Height;
listmaxshow = (height-theight-footerHeight)/(fheight);
@@ -663,24 +663,24 @@ void CPictureViewerGui::paintItem(int pos)
// printf("paintItem{\n");
int ypos = y+ theight + 0 + pos*fheight;
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
if ((liststart+pos < playlist.size()) && (pos & 1) )
{
- color = COL_MENUCONTENTDARK;
+ color = COL_MENUCONTENTDARK_TEXT;
bgcolor = COL_MENUCONTENTDARK_PLUS_0;
}
else
{
- color = COL_MENUCONTENT;
+ color = COL_MENUCONTENT_TEXT;
bgcolor = COL_MENUCONTENT_PLUS_0;
}
if (liststart+pos == selected)
{
frameBuffer->paintBoxRel(x,ypos, width-15, fheight, bgcolor);
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
}
diff --git a/src/gui/pipsetup.cpp b/src/gui/pipsetup.cpp
index 505576479..98692ad7a 100644
--- a/src/gui/pipsetup.cpp
+++ b/src/gui/pipsetup.cpp
@@ -188,10 +188,10 @@ void CPipSetup::paint()
frameBuffer->paintBoxRel(x, y, mwidth, mheight*4, COL_MENUCONTENT_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+5, y+mheight, mwidth, xpos, COL_MENUCONTENT);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+5, y+mheight*2, mwidth, ypos, COL_MENUCONTENT);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+5, y+mheight*3, mwidth, wpos, COL_MENUCONTENT);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+5, y+mheight*4, mwidth, hpos, COL_MENUCONTENT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+5, y+mheight, mwidth, xpos, COL_MENUCONTENT_TEXT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+5, y+mheight*2, mwidth, ypos, COL_MENUCONTENT_TEXT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+5, y+mheight*3, mwidth, wpos, COL_MENUCONTENT_TEXT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+5, y+mheight*4, mwidth, hpos, COL_MENUCONTENT_TEXT);
}
#endif //#ifdef ENABLE_PIP
diff --git a/src/gui/pluginlist.cpp b/src/gui/pluginlist.cpp
index d5191e156..be51bfbb0 100644
--- a/src/gui/pluginlist.cpp
+++ b/src/gui/pluginlist.cpp
@@ -269,12 +269,12 @@ void CPluginList::paintItem(int pos)
int ypos = (y+theight) + pos*fheight;
int itemheight = fheight;
- uint8_t color = COL_MENUCONTENT;
+ fb_pixel_t color = COL_MENUCONTENT_TEXT;
fb_pixel_t bgcolor = COL_MENUCONTENT_PLUS_0;
if (liststart+pos==selected)
{
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
}
diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp
index 1bab633bc..57fc0d531 100644
--- a/src/gui/scan.cpp
+++ b/src/gui/scan.cpp
@@ -431,7 +431,7 @@ neutrino_msg_t CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data)
case NeutrinoMessages::EVT_SCAN_REPORT_FREQUENCY:
freqready = 1;
sprintf(buffer, "%lu", data);
- xpos_frequency = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(buffer, true);
+ xpos_frequency = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(buffer, true)+2;
paintLine(xpos2, ypos_frequency, xpos_frequency, buffer);
//paintRadar();
break;
@@ -526,7 +526,7 @@ void CScanTs::hide()
void CScanTs::paintLineLocale(int px, int * py, int pwidth, const neutrino_locale_t l)
{
frameBuffer->paintBoxRel(px, *py, pwidth, mheight, COL_MENUCONTENT_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px, *py + mheight, pwidth, g_Locale->getText(l), COL_MENUCONTENTINACTIVE, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px+2, *py + mheight, pwidth, g_Locale->getText(l), COL_MENUCONTENTINACTIVE_TEXT, 0, true); // UTF-8
*py += mheight;
}
@@ -534,7 +534,7 @@ void CScanTs::paintLine(int px, int py, int w, const char * const txt)
{
//printf("CScanTs::paintLine x %d y %d w %d width %d xpos2 %d: %s\n", px, py, w, width, xpos2, txt);
frameBuffer->paintBoxRel(px, py, w, mheight, COL_MENUCONTENT_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px, py + mheight, w, txt, COL_MENUCONTENT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px+2, py + mheight, w, txt, COL_MENUCONTENT_TEXT, 0, true); // UTF-8
}
void CScanTs::paint(bool fortest)
@@ -553,12 +553,12 @@ void CScanTs::paint(bool fortest)
if(deltype == FE_QPSK)
{ //sat
paintLineLocale(xpos1, &ypos, width - xpos1, LOCALE_SCANTS_ACTSATELLITE);
- xpos2 = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_SCANTS_ACTSATELLITE), true); // UTF-8
+ xpos2 = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_SCANTS_ACTSATELLITE), true)+2; // UTF-8
}
if(deltype == FE_QAM)
{ //cable
paintLineLocale(xpos1, &ypos, width - xpos1, LOCALE_SCANTS_ACTCABLE);
- xpos2 = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_SCANTS_ACTCABLE), true); // UTF-8
+ xpos2 = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_SCANTS_ACTCABLE), true)+2; // UTF-8
}
ypos_transponder = ypos;
@@ -589,7 +589,7 @@ void CScanTs::paint(bool fortest)
int CScanTs::greater_xpos(int xpos, const neutrino_locale_t txt)
{
- int txt_xpos = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(txt), true); // UTF-8
+ int txt_xpos = xpos1 + 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(txt), true)+2; // UTF-8
if (txt_xpos > xpos)
return txt_xpos;
else
@@ -623,10 +623,10 @@ void CScanTs::showSNR ()
posx = posx + barwidth + 3;
frameBuffer->paintBoxRel(posx, posy -1, sw, mheight-8, COL_MENUCONTENT_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx+2, posy + mheight-(mheight-BAR_HEIGHT)/4, sw, percent, COL_MENUCONTENTDARK);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx+2, posy + mheight-(mheight-BAR_HEIGHT)/4, sw, percent, COL_MENUCONTENTDARK_TEXT);
frameBuffer->paintBoxRel(posx+(4*fw), posy - 2, 4*fw, mheight, COL_MENUCONTENT_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx+2+(4*fw), posy + mheight-(mheight-BAR_HEIGHT)/4, 4*fw, "SIG", COL_MENUCONTENT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx+2+(4*fw), posy + mheight-(mheight-BAR_HEIGHT)/4, 4*fw, "SIG", COL_MENUCONTENT_TEXT);
}
if (lastsnr != snr) {
@@ -639,10 +639,10 @@ void CScanTs::showSNR ()
posx = posx + barwidth + 3;
frameBuffer->paintBoxRel(posx, posy - 1, sw, mheight-8, COL_MENUCONTENT_PLUS_0, 0, true);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx + 2, posy + mheight-(mheight-BAR_HEIGHT)/4, sw, percent, COL_MENUCONTENTDARK, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx + 2, posy + mheight-(mheight-BAR_HEIGHT)/4, sw, percent, COL_MENUCONTENTDARK_TEXT, 0, true);
frameBuffer->paintBoxRel(posx+(4*fw), posy - 2, 4*fw, mheight, COL_MENUCONTENT_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx+2+(4*fw), posy + mheight-(mheight-BAR_HEIGHT)/4, 4*fw, "SNR", COL_MENUCONTENT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString (posx+2+(4*fw), posy + mheight-(mheight-BAR_HEIGHT)/4, 4*fw, "SNR", COL_MENUCONTENT_TEXT);
}
}
diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp
index 7c2bbc8cf..ec0b38701 100644
--- a/src/gui/scan_setup.cpp
+++ b/src/gui/scan_setup.cpp
@@ -67,7 +67,7 @@ extern char zapit_long[20];
/* ugly */
extern CHintBox *reloadhintBox;
-static int all_usals = 1;
+//static int all_usals = 1;
//sat_iterator_t sit;
#define SCANTS_BOUQUET_OPTION_COUNT 3
@@ -802,6 +802,7 @@ int CScanSetup::showFrontendSetup(int number)
mc->setHint("", LOCALE_MENU_HINT_SCAN_FEMODE);
setupMenu->addItem(mc);
+ msettings.Clear();
if (fe->getInfo()->type == FE_QPSK) {
/* disable all but mode option for linked frontends */
bool allow_moptions = !CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED;
@@ -854,25 +855,30 @@ int CScanSetup::showFrontendSetup(int number)
setupMenu->addItem(uniSetup);
setupMenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SATSETUP_EXTENDED_MOTOR));
- CMenuOptionNumberChooser * nc = new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&fe_config.motorRotationSpeed, true, 0, 64, NULL);
+ CMenuOptionNumberChooser * nc = new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&fe_config.motorRotationSpeed, allow_moptions, 0, 64, NULL);
nc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_SPEED);
setupMenu->addItem(nc);
+ msettings.Add(nc);
- mc = new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_HVOLTAGE, (int *)&fe_config.highVoltage, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
+ mc = new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_HVOLTAGE, (int *)&fe_config.highVoltage, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, allow_moptions);
mc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_18V);
setupMenu->addItem(mc);
+ msettings.Add(mc);
- mc = new CMenuOptionChooser(LOCALE_SATSETUP_USE_USALS, &all_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this);
+ mc = new CMenuOptionChooser(LOCALE_SATSETUP_USE_USALS, &fe_config.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, allow_moptions, this);
mc->setHint("", LOCALE_MENU_HINT_SCAN_USALSALL);
setupMenu->addItem(mc);
+ msettings.Add(mc);
- CMenuForwarder * mf = new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, true, NULL, this, "satfind", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
+ CMenuForwarder * mf = new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, allow_moptions, NULL, this, "satfind", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
mf->setHint("", LOCALE_MENU_HINT_SCAN_SATFIND);
setupMenu->addItem(mf);
+ msettings.Add(mf);
}
int res = setupMenu->exec(NULL, "");
feselected = setupMenu->getSelected();
+ msettings.Clear();
/* add configured satellites to satSelect in case they changed */
if (fe->isSat())
@@ -944,20 +950,16 @@ int CScanSetup::showScanMenuLnbSetup()
std::string satname = CServiceManager::getInstance()->GetSatelliteName(sit->first);
//sub menu for sat settings to selectable sat item
- CMenuWidget *tempsat = new CMenuWidget(satname.c_str(), NEUTRINO_ICON_SETTINGS, width);
- addScanMenuTempSat(tempsat, sit->second);
-#if 0 // option not refreshed.
- if(sit->second.motor_position > 0) {
- char mpos[10];
- sprintf(mpos, "%d", sit->second.motor_position);
- sat_setup->addItem(new CMenuForwarderNonLocalized(satname.c_str(), true, mpos, tempsat));
- } else
-#endif
- {
- CMenuForwarder * mf = new CMenuForwarderNonLocalized(satname.c_str(), true, NULL, tempsat);
- mf->setHint("", LOCALE_MENU_HINT_SCAN_LNBCONFIG);
- sat_setup->addItem(mf);
- }
+ CMenuWidget *tempsat = new CMenuWidget(satname.c_str(), NEUTRINO_ICON_SETTINGS, width);
+ addScanMenuTempSat(tempsat, sit->second);
+
+ char opt[100];
+ sprintf(opt, "diseqc %2d / rotor %2d", sit->second.diseqc+1, sit->second.motor_position);
+ satoptions.push_back(opt);
+ CMenuForwarder * mf = new CMenuForwarderNonLocalized(satname.c_str(), true, satoptions[count].c_str(), tempsat);
+ mf->setHint("", LOCALE_MENU_HINT_SCAN_LNBCONFIG);
+ sat_setup->addItem(mf);
+ satmf.push_back(mf);
tmp[count] = tempsat;
count++;
}
@@ -967,6 +969,8 @@ int CScanSetup::showScanMenuLnbSetup()
delete tmp[i];
}
delete sat_setup;
+ satmf.clear();
+ satoptions.clear();
return res;
}
@@ -1062,13 +1066,14 @@ int CScanSetup::showScanMenuSatFind()
int count = 0;
CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
char name[255];
+ static int selected = 0;
r_system = DVB_S;
snprintf(name, sizeof(name), "%s %d: %s", g_Locale->getText(LOCALE_MOTORCONTROL_HEAD), fenumber+1, fe->getInfo()->name);
CMenuWidget* sat_findMenu = new CMenuWidget(name /*LOCALE_MOTORCONTROL_HEAD*/, NEUTRINO_ICON_SETTINGS, width);
-
+ sat_findMenu->setSelected(selected);
sat_findMenu->addIntroItems();
CMenuOptionStringChooser * feSatSelect = new CMenuOptionStringChooser(LOCALE_SATSETUP_SATELLITE, scansettings.satName, true, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true);
@@ -1108,6 +1113,7 @@ int CScanSetup::showScanMenuSatFind()
sat_findMenu->addItem(mf);
int res = sat_findMenu->exec(NULL, "");
+ selected = sat_findMenu->getSelected();
delete sat_findMenu;
return res;
}
@@ -1127,13 +1133,13 @@ void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satcon
CMenuForwarder *mf;
if (!unicable) {
- diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
+ diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED), -1, 15, this, 1, -1, LOCALE_OPTIONS_OFF);
diseqc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQC);
comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
comm->setHint("", LOCALE_MENU_HINT_SCAN_COMMITED);
uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &satconfig.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
uncomm->setHint("", LOCALE_MENU_HINT_SCAN_UNCOMMITED);
- motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF);
+ motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, this, 0, 0, LOCALE_OPTIONS_OFF);
motor->setHint("", LOCALE_MENU_HINT_SCAN_MOTORPOS);
usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &satconfig.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true /*dmode == DISEQC_ADVANCED*/);
usals->setHint("", LOCALE_MENU_HINT_SCAN_USEUSALS);
@@ -1142,9 +1148,10 @@ void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satcon
satconfig.diseqc = 0;
unilnb = new CMenuOptionNumberChooser(LOCALE_UNICABLE_LNB, &satconfig.diseqc, true, 0, 1);
}
-
+#if 0
if(!satconfig.use_usals)
all_usals = 0;
+#endif
CIntInput* lofL = new CIntInput(LOCALE_SATSETUP_LOFL, (int&) satconfig.lnbOffsetLow, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
CIntInput* lofH = new CIntInput(LOCALE_SATSETUP_LOFH, (int&) satconfig.lnbOffsetHigh, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
@@ -1329,7 +1336,7 @@ void CScanSetup::addScanMenuCable(CMenuWidget *menu)
menu->addItem(GenericMenuSeparatorLine);
- CStringInput *freq = new CStringInput(LOCALE_EXTRA_TP_FREQ, (char *) scansettings.cable_TP_freq, freq_length, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789");
+ CStringInput *freq = new CStringInput(LOCALE_EXTRA_TP_FREQ, (char *) scansettings.cable_TP_freq, 6, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789");
CMenuForwarder *Freq = new CMenuDForwarder(LOCALE_EXTRA_TP_FREQ, true, scansettings.cable_TP_freq, freq, "", CRCInput::convertDigitToKey(shortCut++));
Freq->setHint("", LOCALE_MENU_HINT_SCAN_FREQ);
@@ -1376,7 +1383,7 @@ int CScanSetup::addScanOptionsItems(CMenuWidget *options_menu, const int &shortc
CMenuForwarder *Freq = NULL;
CMenuForwarder *Rate = NULL;
if (r_system == DVB_S) {
- CStringInput *freq = new CStringInput(LOCALE_EXTRA_TP_FREQ, (char *) scansettings.sat_TP_freq, freq_length, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789");
+ CStringInput *freq = new CStringInput(LOCALE_EXTRA_TP_FREQ, (char *) scansettings.sat_TP_freq, 8, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789");
Freq = new CMenuDForwarder(LOCALE_EXTRA_TP_FREQ, true, scansettings.sat_TP_freq, freq, "", CRCInput::convertDigitToKey(shortCut++));
Freq->setHint("", LOCALE_MENU_HINT_SCAN_FREQ);
@@ -1388,7 +1395,7 @@ int CScanSetup::addScanOptionsItems(CMenuWidget *options_menu, const int &shortc
mod_pol = new CMenuOptionChooser(LOCALE_EXTRA_TP_POL, (int *)&scansettings.sat_TP_pol, SATSETUP_SCANTP_POL, SATSETUP_SCANTP_POL_COUNT, true, NULL, CRCInput::convertDigitToKey(shortCut++));
mod_pol->setHint("", LOCALE_MENU_HINT_SCAN_POL);
} else if (r_system == DVB_C) {
- CStringInput *freq = new CStringInput(LOCALE_EXTRA_TP_FREQ, (char *) scansettings.cable_TP_freq, freq_length, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789");
+ CStringInput *freq = new CStringInput(LOCALE_EXTRA_TP_FREQ, (char *) scansettings.cable_TP_freq, 6, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789");
Freq = new CMenuDForwarder(LOCALE_EXTRA_TP_FREQ, true, scansettings.cable_TP_freq, freq, "", CRCInput::convertDigitToKey(shortCut++));
Freq->setHint("", LOCALE_MENU_HINT_SCAN_FREQ);
@@ -1465,8 +1472,10 @@ void CScanSetup::saveScanSetup()
dprintf(DEBUG_NORMAL, "error while saving scan-settings!\n");
//CServiceManager::getInstance()->SaveMotorPositions();
- zapitCfg.gotoXXLatitude = strtod(zapit_lat, NULL);
- zapitCfg.gotoXXLongitude = strtod(zapit_long, NULL);
+ if(zapit_lat[0] != '#')//check if var ok
+ zapitCfg.gotoXXLatitude = strtod(zapit_lat, NULL);
+ if(zapit_long[0] != '#')//check if var ok
+ zapitCfg.gotoXXLongitude = strtod(zapit_long, NULL);
CZapit::getInstance()->SetConfig(&zapitCfg);
CFEManager::getInstance()->saveSettings(true);
@@ -1478,12 +1487,14 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*
bool ret = false;
if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_USE_USALS)) {
+#if 0
CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
printf("[neutrino] CScanSetup::%s: all usals %d \n", __FUNCTION__, all_usals);
satellite_map_t & satmap = fe->getSatellites();
for (sat_iterator_t sit = satmap.begin(); sit != satmap.end(); sit++) {
sit->second.use_usals = all_usals;
}
+#endif
}
else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_DISEQC)) {
printf("[neutrino] CScanSetup::%s: diseqc %d fenumber %d\n", __FUNCTION__, dmode, fenumber);
@@ -1549,6 +1560,8 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*
bool enable = (dmode < DISEQC_ADVANCED) && (dmode != NO_DISEQC);
ojDiseqcRepeats->setActive(!CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED && enable);
+ msettings.Activate(!CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED);
+
/* if mode changed, set current master too */
if (femaster >= 0)
fe->setMaster(femaster);
@@ -1576,6 +1589,21 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*
}
}
}
+ else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_MOTOR_POS) ||
+ ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_DISEQC_INPUT)) {
+ CFrontend * fe = CFEManager::getInstance()->getFE(fenumber);
+ satellite_map_t & satmap = fe->getSatellites();
+ int count = 0;
+ for (sat_iterator_t sit = satmap.begin(); sit != satmap.end(); ++sit) {
+ if(!sit->second.configured)
+ continue;
+ char opt[100];
+ sprintf(opt, "diseqc %d / rotor %d", sit->second.diseqc+1, sit->second.motor_position);
+ satoptions[count] = opt;
+ satmf[count]->setOption(satoptions[count]);
+ count++;
+ }
+ }
else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_LOGICAL_NUMBERS)) {
printf("[neutrino] CScanSetup::%s: logical numbers %d\n", __FUNCTION__, scansettings.scan_logical_numbers);
lcnhd->setActive(scansettings.scan_logical_numbers);
diff --git a/src/gui/scan_setup.h b/src/gui/scan_setup.h
index 8fa8a9543..00ab51983 100644
--- a/src/gui/scan_setup.h
+++ b/src/gui/scan_setup.h
@@ -66,6 +66,8 @@ class CScanSetup : public CMenuTarget, public CChangeObserver
CMenuOptionNumberChooser * ojDiseqcRepeats;
CIntInput * nid;
CMenuOptionChooser * lcnhd;
+ /* items active for master/independent fe mode */
+ CGenericMenuActivate msettings;
CMenuOptionChooser * linkfe;
std::string modestr[4];
@@ -80,6 +82,9 @@ class CScanSetup : public CMenuTarget, public CChangeObserver
/* frontend link to number */
int femaster;
+ std::vector satoptions;
+ std::vector satmf;
+
/* flag to allow any operations which can damage recordings */
bool allow_start;
/* flag to re-init frontends */
diff --git a/src/gui/screensetup.cpp b/src/gui/screensetup.cpp
index f506fff24..7f875712b 100644
--- a/src/gui/screensetup.cpp
+++ b/src/gui/screensetup.cpp
@@ -261,9 +261,9 @@ void CScreenSetup::paintIcons(int pselected)
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, x_box + 5, y_box+BoxHeight, BoxHeight);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_box + icol_w + 10, y_box + BoxHeight, BoxWidth,
- g_Locale->getText(LOCALE_SCREENSETUP_UPPERLEFT ), (pselected == 0) ? COL_MENUCONTENTSELECTED:COL_MENUCONTENT , 0, true); // UTF-8
+ g_Locale->getText(LOCALE_SCREENSETUP_UPPERLEFT ), (pselected == 0) ? COL_MENUCONTENTSELECTED_TEXT:COL_MENUCONTENT_TEXT , 0, true); // UTF-8
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x_box + icol_w + 10, y_box + BoxHeight * 2, BoxWidth,
- g_Locale->getText(LOCALE_SCREENSETUP_LOWERRIGHT), (pselected == 1) ? COL_MENUCONTENTSELECTED:COL_MENUCONTENT, 0, true); // UTF-8
+ g_Locale->getText(LOCALE_SCREENSETUP_LOWERRIGHT), (pselected == 1) ? COL_MENUCONTENTSELECTED_TEXT:COL_MENUCONTENT_TEXT, 0, true); // UTF-8
}
void CScreenSetup::paintBorderUL()
@@ -298,7 +298,7 @@ void CScreenSetup::paintCoords()
/* the code is smaller with this loop instead of open-coded 4x RenderString() :-) */
for (int i = 0; i < 4; i++)
{
- f->RenderString(x2, y2, w, str[i], COL_MENUCONTENT);
+ f->RenderString(x2, y2, w, str[i], COL_MENUCONTENT_TEXT);
y2 += fh;
}
}
diff --git a/src/gui/start_wizard.cpp b/src/gui/start_wizard.cpp
index f9e125f80..f5bdc2f43 100644
--- a/src/gui/start_wizard.cpp
+++ b/src/gui/start_wizard.cpp
@@ -96,14 +96,17 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
{
int advanced = 1;
#ifdef ENABLE_FASTSCAN
- advanced = 0;
- CMenuWidget wtype(LOCALE_WIZARD_SETUP);
- wtype.setWizardMode(true);
- wtype.addIntroItems();
- CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_WIZARD_SETUP_TYPE, &advanced, WIZARD_SETUP_TYPE, 2, true, NULL);
- mc->setHint("", LOCALE_WIZARD_SETUP_TYPE_HINT);
- wtype.addItem(mc);
- wtype.exec(NULL, "");
+ std::string lang = g_settings.language;
+ if (lang == "nederlands") {
+ advanced = 0;
+ CMenuWidget wtype(LOCALE_WIZARD_SETUP);
+ wtype.setWizardMode(true);
+ wtype.addIntroItems();
+ CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_WIZARD_SETUP_TYPE, &advanced, WIZARD_SETUP_TYPE, 2, true, NULL);
+ mc->setHint("", LOCALE_WIZARD_SETUP_TYPE_HINT);
+ wtype.addItem(mc);
+ wtype.exec(NULL, "");
+ }
#endif
//open video settings in wizardmode
if(advanced && res != menu_return::RETURN_EXIT_ALL) {
@@ -126,7 +129,7 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
if (CFEManager::getInstance()->haveSat())
init_settings = file_exists(CONFIGDIR "/initial/");
- if(init_settings && (res != menu_return::RETURN_EXIT_ALL))
+ if(advanced && init_settings && (res != menu_return::RETURN_EXIT_ALL))
{
if (ShowMsgUTF(LOCALE_WIZARD_INITIAL_SETTINGS, g_Locale->getText(LOCALE_WIZARD_INSTALL_SETTINGS),
CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes) {
@@ -143,6 +146,7 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
res = CScanSetup::getInstance()->exec(NULL, "");
} else {
CZapit::getInstance()->GetConfig(zapitCfg);
+#ifdef ENABLE_FASTSCAN
if (CFEManager::getInstance()->haveSat()) {
#ifdef ENABLE_FASTSCAN
CMenuWidget fastScanMenu(LOCALE_SATSETUP_FASTSCAN_HEAD, NEUTRINO_ICON_SETTINGS, 45, MN_WIDGET_ID_SCAN_FAST_SCAN);
@@ -151,6 +155,7 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
res = fastScanMenu.exec(NULL, "");
#endif
}
+#endif
if (CFEManager::getInstance()->haveCable()) {
CMenuWidget cableScan(LOCALE_SATSETUP_CABLE, NEUTRINO_ICON_SETTINGS, 45, MN_WIDGET_ID_SCAN_CABLE_SCAN);
cableScan.setWizardMode(true);
diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp
index 3b3de3c68..5ab2044d6 100644
--- a/src/gui/streaminfo2.cpp
+++ b/src/gui/streaminfo2.cpp
@@ -178,12 +178,12 @@ int CStreamInfo2::doSignalStrengthLoop ()
rate.min_short_average = minb = bit_s;
sprintf(tmp_str, "%s:",g_Locale->getText(LOCALE_STREAMINFO_BITRATE));
- g_Font[font_info]->RenderString(dx1 , average_bitrate_pos, offset+10, tmp_str, COL_INFOBAR, 0, true);
+ g_Font[font_info]->RenderString(dx1 , average_bitrate_pos, offset+10, tmp_str, COL_INFOBAR_TEXT, 0, true);
sprintf(currate, "%5llu.%02llu", rate.short_average / 1000ULL, rate.short_average % 1000ULL);
frameBuffer->paintBoxRel (dx1 + average_bitrate_offset , average_bitrate_pos -dheight, sw, dheight, COL_MENUHEAD_PLUS_0);
- g_Font[font_info]->RenderString (dx1 + average_bitrate_offset , average_bitrate_pos, sw - 10, currate, COL_INFOBAR);
+ g_Font[font_info]->RenderString (dx1 + average_bitrate_offset , average_bitrate_pos, sw - 10, currate, COL_INFOBAR_TEXT);
sprintf(tmp_str, "(%s)",g_Locale->getText(LOCALE_STREAMINFO_AVERAGE_BITRATE));
- g_Font[font_info]->RenderString (dx1 + average_bitrate_offset + sw , average_bitrate_pos, sw *2, tmp_str, COL_INFOBAR);
+ g_Font[font_info]->RenderString (dx1 + average_bitrate_offset + sw , average_bitrate_pos, sw *2, tmp_str, COL_INFOBAR_TEXT);
}
showSNR ();
@@ -271,7 +271,7 @@ void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h)
char tname[255];
snprintf(tname, sizeof(tname), "%s: %d: %s", g_Locale->getText(LOCALE_STREAMINFO_SIGNAL), tuner, frontend->getInfo()->name);
- g_Font[font_small]->RenderString(_x, _y+iheight+15, width-10, tname /*tuner_name.c_str()*/, COL_INFOBAR, 0, true);
+ g_Font[font_small]->RenderString(_x, _y+iheight+15, width-_x-10, tname /*tuner_name.c_str()*/, COL_INFOBAR_TEXT, 0, true);
sigBox_x = _x;
sigBox_y = _y+iheight+15;
@@ -284,16 +284,16 @@ void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h)
frameBuffer->paintBoxRel(_x+xd*0,y1- 12,16,2, COL_RED); //red
- g_Font[font_small]->RenderString(_x+20+xd*0, y1, fw*4, "BER", COL_INFOBAR, 0, true);
+ g_Font[font_small]->RenderString(_x+20+xd*0, y1, fw*4, "BER", COL_INFOBAR_TEXT, 0, true);
frameBuffer->paintBoxRel(_x+xd*1,y1- 12,16,2,COL_BLUE); //blue
- g_Font[font_small]->RenderString(_x+20+xd*1, y1, fw*4, "SNR", COL_INFOBAR, 0, true);
+ g_Font[font_small]->RenderString(_x+20+xd*1, y1, fw*4, "SNR", COL_INFOBAR_TEXT, 0, true);
frameBuffer->paintBoxRel(_x+8+xd*2,y1- 12,16,2, COL_GREEN); //green
- g_Font[font_small]->RenderString(_x+28+xd*2, y1, fw*4, "SIG", COL_INFOBAR, 0, true);
+ g_Font[font_small]->RenderString(_x+28+xd*2, y1, fw*4, "SIG", COL_INFOBAR_TEXT, 0, true);
frameBuffer->paintBoxRel(_x+xd*3,y1- 12,16,2,COL_YELLOW); // near yellow
- g_Font[font_small]->RenderString(_x+20+xd*3, y1, fw*5, "Bitrate", COL_INFOBAR, 0, true);
+ g_Font[font_small]->RenderString(_x+20+xd*3, y1, fw*5, "Bitrate", COL_INFOBAR_TEXT, 0, true);
sig_text_ber_x = _x + xd * 0;
sig_text_snr_x = _x + 5 + xd * 1;
@@ -308,9 +308,9 @@ void CStreamInfo2::paint_signal_fe_box(int _x, int _y, int w, int h)
else
maxmin_x = _x + 40 + xd * 3 + (fontW*4);
- g_Font[font_small]->RenderString(maxmin_x, y1 + sheight + 5, fw*3, "max", COL_INFOBAR, 0, true);
- g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 2) +5, fw*3, "now", COL_INFOBAR, 0, true);
- g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 3) +5, fw*3, "min", COL_INFOBAR, 0, true);
+ g_Font[font_small]->RenderString(maxmin_x, y1 + sheight + 5, fw*3, "max", COL_INFOBAR_TEXT, 0, true);
+ g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 2) +5, fw*3, "now", COL_INFOBAR_TEXT, 0, true);
+ g_Font[font_small]->RenderString(maxmin_x, y1 + (sheight * 3) +5, fw*3, "min", COL_INFOBAR_TEXT, 0, true);
s_old.ber = s_old.max_ber = s_old.min_ber = -1;
@@ -409,7 +409,7 @@ void CStreamInfo2::SignalRenderStr(unsigned int oldvalue, unsigned int value, in
int fw = g_Font[font_small]->getRenderWidth(str);
frameBuffer->paintBoxRel(_x, _y - sheight + 5, fw, sheight -1, COL_MENUHEAD_PLUS_0);
sprintf(str,"%6u",value);
- g_Font[font_small]->RenderString(_x, _y + 5, width - _x, str, COL_INFOBAR, 0, true);
+ g_Font[font_small]->RenderString(_x, _y + 5, fw, str, COL_INFOBAR_TEXT, 0, true);
}
void CStreamInfo2::paint (int /*mode*/)
@@ -430,7 +430,7 @@ void CStreamInfo2::paint (int /*mode*/)
// paint backround, title pig, etc.
frameBuffer->paintBoxRel (0, 0, max_width, max_height, COL_MENUHEAD_PLUS_0);
- g_Font[font_head]->RenderString (xpos, ypos + hheight + 1, width, head_string, COL_MENUHEAD, 0, true); // UTF-8
+ g_Font[font_head]->RenderString (xpos, ypos + hheight + 1, width, head_string, COL_MENUHEAD_TEXT, 0, true); // UTF-8
ypos += hheight;
if (pip == NULL)
@@ -490,14 +490,14 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
//Video RESOLUTION
ypos += iheight;
sprintf (buf, "%s:",g_Locale->getText (LOCALE_STREAMINFO_RESOLUTION));
- g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
sprintf (buf, "%dx%d", xres, yres);
- g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
//audio rate
ypos += iheight;
sprintf (buf, "%s:",g_Locale->getText (LOCALE_STREAMINFO_ARATIO));
- g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
switch (aspectRatio) {
case 0:
sprintf (buf, "N/A");
@@ -517,12 +517,12 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
default:
strncpy (buf, g_Locale->getText (LOCALE_STREAMINFO_ARATIO_UNKNOWN), sizeof (buf)-1);
}
- g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
//Video FRAMERATE
ypos += iheight;
sprintf (buf, "%s:", g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE));
- g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
switch (framerate) {
case 0:
snprintf (buf,sizeof(buf), "23.976fps");
@@ -552,7 +552,7 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
strncpy (buf, g_Locale->getText (LOCALE_STREAMINFO_FRAMERATE_UNKNOWN), sizeof (buf)-1);
break;
}
- g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
// place for average bitrate
average_bitrate_pos = ypos += iheight;
//AUDIOTYPE
@@ -564,14 +564,14 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
const char *ddmodes[8] = { "CH1/CH2", "C", "L/R", "L/C/R", "L/R/S", "L/C/R/S", "L/R/SL/SR", "L/C/R/SL/SR" };
sprintf (buf, "%s:", g_Locale->getText (LOCALE_STREAMINFO_AUDIOTYPE));
- g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_info]->RenderString (xpos, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
if(type == 0) {
sprintf (buf, "MPEG %s (%d)", mpegmodes[mode], freq);
} else {
sprintf (buf, "DD %s (%d)", ddmodes[mode], freq);
}
- g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
//satellite
ypos += iheight;
@@ -580,18 +580,18 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
else if(t.deltype == FE_QAM)
sprintf (buf, "%s:",g_Locale->getText (LOCALE_CHANNELLIST_PROVS));
- g_Font[font_info]->RenderString(xpos, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_info]->RenderString(xpos, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
sprintf (buf, "%s",
CServiceManager::getInstance()->GetSatelliteName(channel->getSatellitePosition()).c_str());
- g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
//channel
ypos += iheight;
sprintf (buf, "%s:",g_Locale->getText (LOCALE_TIMERLIST_CHANNEL));//swiped locale
- g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR_TEXT, 0, true); // UTF-8
sprintf(buf, "%s", channel->getName().c_str());
- g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_info]->RenderString (xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
//tsfrequenz
ypos += iheight;
@@ -601,8 +601,8 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
scaling = 15000;
sprintf (buf, "%s",g_Locale->getText (LOCALE_SCANTS_FREQDATA));
- g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR, 0, true); // UTF-8
- g_Font[font_info]->RenderString(xpos+spaceoffset, ypos, box_width, t.description().c_str(), COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_info]->RenderString(xpos, ypos, box_width, buf , COL_INFOBAR_TEXT, 0, true); // UTF-8
+ g_Font[font_info]->RenderString(xpos+spaceoffset, ypos, box_width, t.description().c_str(), COL_INFOBAR_TEXT, 0, true); // UTF-8
// paint labels
int fontW = g_Font[font_small]->getWidth();
@@ -610,27 +610,27 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
//onid
ypos+= sheight;
sprintf(buf, "0x%04X (%i)", channel->getOriginalNetworkId(), channel->getOriginalNetworkId());
- g_Font[font_small]->RenderString(xpos, ypos, box_width, "ONid:" , COL_INFOBAR, 0, true); // UTF-8
- g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_small]->RenderString(xpos, ypos, box_width, "ONid:" , COL_INFOBAR_TEXT, 0, true); // UTF-8
+ g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
//sid
ypos+= sheight;
sprintf(buf, "0x%04X (%i)", channel->getServiceId(), channel->getServiceId());
- g_Font[font_small]->RenderString(xpos, ypos, box_width, "Sid:" , COL_INFOBAR, 0, true); // UTF-8
- g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_small]->RenderString(xpos, ypos, box_width, "Sid:" , COL_INFOBAR_TEXT, 0, true); // UTF-8
+ g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
//tsid
ypos+= sheight;
sprintf(buf, "0x%04X (%i)", channel->getTransportStreamId(), channel->getTransportStreamId());
- g_Font[font_small]->RenderString(xpos, ypos, box_width, "TSid:" , COL_INFOBAR, 0, true); // UTF-8
- g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_small]->RenderString(xpos, ypos, box_width, "TSid:" , COL_INFOBAR_TEXT, 0, true); // UTF-8
+ g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
//pmtpid
ypos+= sheight;
pmt_version = channel->getPmtVersion();
sprintf(buf, "0x%04X (%i) [0x%02X]", channel->getPmtPid(), channel->getPmtPid(), pmt_version);
- g_Font[font_small]->RenderString(xpos, ypos, box_width, "PMTpid:", COL_INFOBAR, 0, true); // UTF-8
- g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_small]->RenderString(xpos, ypos, box_width, "PMTpid:", COL_INFOBAR_TEXT, 0, true); // UTF-8
+ g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
//vpid
ypos+= sheight;
@@ -639,12 +639,12 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
} else {
sprintf(buf, "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE));
}
- g_Font[font_small]->RenderString(xpos, ypos, box_width, "Vpid:" , COL_INFOBAR, 0, true); // UTF-8
- g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_small]->RenderString(xpos, ypos, box_width, "Vpid:" , COL_INFOBAR_TEXT, 0, true); // UTF-8
+ g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
//apid
ypos+= sheight;
- g_Font[font_small]->RenderString(xpos, ypos, box_width, "Apid(s):" , COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_small]->RenderString(xpos, ypos, box_width, "Apid(s):" , COL_INFOBAR_TEXT, 0, true); // UTF-8
if (g_RemoteControl->current_PIDs.APIDs.empty()){
sprintf(buf, "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE));
} else {
@@ -653,10 +653,10 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
{
sprintf(buf, "0x%04X (%i)", g_RemoteControl->current_PIDs.APIDs[li].pid, g_RemoteControl->current_PIDs.APIDs[li].pid );
if (li == g_RemoteControl->current_PIDs.PIDs.selected_apid){
- g_Font[font_small]->RenderString(xpos+sw, ypos, box_width, buf, COL_MENUHEAD, 0, true); // UTF-8
+ g_Font[font_small]->RenderString(xpos+sw, ypos, box_width, buf, COL_MENUHEAD_TEXT, 0, true); // UTF-8
}
else{
- g_Font[font_small]->RenderString(xpos+sw, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_small]->RenderString(xpos+sw, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
}
sw = g_Font[font_small]->getRenderWidth(buf)+sw+10;
if (((li+1)%3 == 0) &&(g_RemoteControl->current_PIDs.APIDs.size()-1 > li)){ // if we have lots of apids, put "intermediate" line with pids
@@ -672,8 +672,8 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos)
sprintf(buf, "%s", g_Locale->getText(LOCALE_STREAMINFO_NOT_AVAILABLE));
else
sprintf(buf, "0x%04X (%i)", g_RemoteControl->current_PIDs.PIDs.vtxtpid, g_RemoteControl->current_PIDs.PIDs.vtxtpid );
- g_Font[font_small]->RenderString(xpos, ypos, box_width, "VTXTpid:" , COL_INFOBAR, 0, true); // UTF-8
- g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR, 0, true); // UTF-8
+ g_Font[font_small]->RenderString(xpos, ypos, box_width, "VTXTpid:" , COL_INFOBAR_TEXT, 0, true); // UTF-8
+ g_Font[font_small]->RenderString(xpos+spaceoffset, ypos, box_width, buf, COL_INFOBAR_TEXT, 0, true); // UTF-8
if(box_h == 0)
box_h = ypos - ypos1;
yypos = ypos;
@@ -761,7 +761,7 @@ void CStreamInfo2::paintCASystem(int xpos, int ypos)
if(caids[ca_id] == true){
if(cryptsysteme){
ypos += iheight;
- g_Font[font_info]->RenderString(xpos , ypos, box_width, "Conditional access:" , COL_INFOBAR, 0, false);
+ g_Font[font_info]->RenderString(xpos , ypos, box_width, "Conditional access:" , COL_INFOBAR_TEXT, 0, false);
cryptsysteme = false;
}
ypos += sheight;
@@ -770,7 +770,7 @@ void CStreamInfo2::paintCASystem(int xpos, int ypos)
std::string::size_type last_pos = casys[ca_id].find_first_not_of(tok, 0);
std::string::size_type pos = casys[ca_id].find_first_of(tok, last_pos);
while (std::string::npos != pos || std::string::npos != last_pos){
- g_Font[font_small]->RenderString(xpos + width_txt, ypos, box_width, casys[ca_id].substr(last_pos, pos - last_pos).c_str() , COL_INFOBAR, 0, false);
+ g_Font[font_small]->RenderString(xpos + width_txt, ypos, box_width, casys[ca_id].substr(last_pos, pos - last_pos).c_str() , COL_INFOBAR_TEXT, 0, false);
if(index == 0)
width_txt = spaceoffset;
else
@@ -930,8 +930,8 @@ void CStreamInfo2::showSNR ()
posx = posx + barwidth + 3;
frameBuffer->paintBoxRel(posx, posy -1, sw, mheight-8, COL_MENUHEAD_PLUS_0);
- g_Font[font_info]->RenderString (posx + 2, posy + mheight-5, sw, percent, COL_INFOBAR);
- g_Font[font_info]->RenderString (posx + 2 + sw, posy + mheight-5, pw, "SIG", COL_INFOBAR);
+ g_Font[font_info]->RenderString (posx + 2, posy + mheight-5, sw, percent, COL_INFOBAR_TEXT);
+ g_Font[font_info]->RenderString (posx + 2 + sw, posy + mheight-5, pw, "SIG", COL_INFOBAR_TEXT);
}
if (lastsnr != snr) {
lastsnr = snr;
@@ -944,7 +944,7 @@ void CStreamInfo2::showSNR ()
posx = posx + barwidth + 3;
frameBuffer->paintBoxRel(posx, posy - 1, sw, mheight-8, COL_MENUHEAD_PLUS_0, 0, true);
- g_Font[font_info]->RenderString (posx + 2, posy + mheight-5, sw, percent, COL_INFOBAR, 0, true);
- g_Font[font_info]->RenderString (posx + 2 + sw, posy + mheight-5, pw, "SNR", COL_INFOBAR, 0, true);
+ g_Font[font_info]->RenderString (posx + 2, posy + mheight-5, sw, percent, COL_INFOBAR_TEXT, 0, true);
+ g_Font[font_info]->RenderString (posx + 2 + sw, posy + mheight-5, pw, "SNR", COL_INFOBAR_TEXT, 0, true);
}
}
diff --git a/src/gui/timeosd.cpp b/src/gui/timeosd.cpp
index 25e42ad64..8fc7a8306 100644
--- a/src/gui/timeosd.cpp
+++ b/src/gui/timeosd.cpp
@@ -98,10 +98,10 @@ void CTimeOSD::update(time_t time_show)
if(m_mode == MODE_ASC) {
color1 = COL_MENUCONTENT_PLUS_0;
- color2 = COL_MENUCONTENT;
+ color2 = COL_MENUCONTENT_TEXT;
} else {
color1 = COL_MENUCONTENTSELECTED_PLUS_0;
- color2 = COL_MENUCONTENTSELECTED;
+ color2 = COL_MENUCONTENTSELECTED_TEXT;
}
strftime(cDisplayTime, 9, "%T", gmtime(&time_show));
frameBuffer->paintBoxRel(m_xend - m_width - t1, m_y, m_width, m_height, color1,RADIUS_SMALL);
diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp
index e8472ead4..ec3249de3 100644
--- a/src/gui/timerlist.cpp
+++ b/src/gui/timerlist.cpp
@@ -439,7 +439,7 @@ void CTimerList::updateEvents(void)
theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
//get footerHeight from paintButtons
- footerHeight = ::paintButtons(0, 0, 0, TimerListButtonsCount, TimerListButtons, 0, 0, "", false, COL_INFOBAR_SHADOW, NULL, 0, false);
+ footerHeight = ::paintButtons(0, 0, 0, TimerListButtonsCount, TimerListButtons, 0, 0, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 0, false);
width = w_max(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth()*56, 20);
height = frameBuffer->getScreenHeight() - (2*theight); // max height
@@ -691,7 +691,7 @@ void CTimerList::paintItem(int pos)
{
int ypos = y+ theight+ pos*fheight*2;
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
int real_width=width;
@@ -700,7 +700,7 @@ void CTimerList::paintItem(int pos)
real_width-=15; //scrollbar
}
- color = COL_MENUCONTENT;
+ color = COL_MENUCONTENT_TEXT;
if (pos & 1)
bgcolor = COL_MENUCONTENT_PLUS_1;
else
@@ -712,7 +712,7 @@ void CTimerList::paintItem(int pos)
if (liststart + pos == selected)
{
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
}
//selected item
diff --git a/src/gui/update.cpp b/src/gui/update.cpp
index ec8803b45..fb8dab40b 100644
--- a/src/gui/update.cpp
+++ b/src/gui/update.cpp
@@ -55,6 +55,8 @@
#include
#include
+#include
+
#define SQUASHFS
#include
@@ -260,6 +262,15 @@ bool CFlashUpdate::selectHttpImage(void)
newVersion = versions[selected];
file_md5 = md5s[selected];
fileType = fileTypes[selected];
+#ifdef BOXMODEL_APOLLO
+ if(fileType < '3') {
+ int esize = CMTDInfo::getInstance()->getMTDEraseSize(sysfs);
+ printf("[update] erase size is %x\n", esize);
+ if (esize == 0x40000) {
+ filename += ".256k";
+ }
+ }
+#endif
#ifdef DEBUG
printf("[update] filename %s type %c newVersion %s md5 %s\n", filename.c_str(), fileType, newVersion.c_str(), file_md5.c_str());
#endif
@@ -464,6 +475,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
if(fileType < '3') {
//flash it...
#if ENABLE_EXTUPDATE
+#ifndef BOXMODEL_APOLLO
if (g_settings.apply_settings) {
if (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_APPLY_SETTINGS), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) == CMessageBox::mbrYes)
if (!CExtUpdate::getInstance()->applySettings(filename, CExtUpdate::MODE_SOFTUPDATE)) {
@@ -472,6 +484,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey)
}
}
#endif
+#endif
#ifdef DEBUG1
if(1) {
@@ -541,20 +554,61 @@ CFlashExpert* CFlashExpert::getInstance()
return FlashExpert;
}
+bool CFlashExpert::checkSize(int mtd, std::string &backupFile)
+{
+ char errMsg[1024] = {0};
+ std::string path = getPathName(backupFile);
+ if (!file_exists(path.c_str())) {
+ snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_DIRECTORY_NOT_EXIST), path.c_str());
+ ShowHintUTF(LOCALE_MESSAGEBOX_ERROR, errMsg);
+ return false;
+ }
+
+ int mtdSize = CMTDInfo::getInstance()->getMTDSize(mtd) / 1024;
+
+ long btotal = 0, bused = 0, bsize = 0;
+ if (!get_fs_usage(path.c_str(), btotal, bused, &bsize)) {
+ snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_VOLUME_ERROR), path.c_str());
+ ShowHintUTF(LOCALE_MESSAGEBOX_ERROR, errMsg);
+ return false;
+ }
+ int backupMaxSize = (int)((btotal - bused) * bsize);
+ int res = 10; // Reserved 10% of available space
+ backupMaxSize = (backupMaxSize - ((backupMaxSize * res) / 100)) / 1024;
+ if (backupMaxSize < mtdSize) {
+ snprintf(errMsg, sizeof(errMsg)-1, g_Locale->getText(LOCALE_FLASHUPDATE_READ_NO_AVAILABLE_SPACE), path.c_str(), backupMaxSize, mtdSize);
+ ShowHintUTF(LOCALE_MESSAGEBOX_ERROR, errMsg);
+ return false;
+ }
+
+ return true;
+}
+
void CFlashExpert::readmtd(int preadmtd)
{
- char tmpStr[256];
- struct timeval tv;
- gettimeofday(&tv, NULL);
- strftime(tmpStr, sizeof(tmpStr), "_%Y%m%d_%H%M.img", localtime(&tv.tv_sec));
- CMTDInfo* mtdInfo = CMTDInfo::getInstance();
- std::string filename = (std::string)g_settings.update_dir + "/" + mtdInfo->getMTDName(preadmtd);
- filename += tmpStr;
+ std::string filename;
+ CMTDInfo* mtdInfo = CMTDInfo::getInstance();
+ std::string hostName = netGetHostname();
+ std::string timeStr = getNowTimeStr("_%Y%m%d_%H%M");
+
+ if (g_settings.softupdate_name_mode_backup == CExtUpdate::SOFTUPDATE_NAME_HOSTNAME_TIME)
+ filename = (std::string)g_settings.update_dir + "/" + mtdInfo->getMTDName(preadmtd) + timeStr + "_" + hostName + ".img";
+ else
+ filename = (std::string)g_settings.update_dir + "/" + mtdInfo->getMTDName(preadmtd) + timeStr + ".img";
if (preadmtd == -1) {
filename = (std::string)g_settings.update_dir + "/flashimage.img"; // US-ASCII (subset of UTF-8 and ISO8859-1)
preadmtd = MTD_OF_WHOLE_IMAGE;
}
+
+ bool skipCheck = false;
+#ifndef BOXMODEL_APOLLO
+ if ((std::string)g_settings.update_dir == "/tmp")
+ skipCheck = true;
+#endif
+ if ((!skipCheck) && (!checkSize(preadmtd, filename)))
+ return;
+
setTitle(LOCALE_FLASHUPDATE_TITLEREADFLASH);
paint();
showGlobalStatus(0);
@@ -643,8 +697,10 @@ void CFlashExpert::showMTDSelector(const std::string & actionkey)
mtdselector->addItem(new CMenuForwarderNonLocalized(mtdInfo->getMTDName(lx).c_str(), enabled, NULL, this, sActionKey, CRCInput::convertDigitToKey(shortcut++)));
}
#if ENABLE_EXTUPDATE
+#ifndef BOXMODEL_APOLLO
if (actionkey == "writemtd")
mtdselector->addItem(new CMenuForwarderNonLocalized("systemFS with settings", true, NULL, this, "writemtd10", CRCInput::convertDigitToKey(shortcut++)));
+#endif
#endif
mtdselector->exec(NULL,"");
delete mtdselector;
@@ -713,7 +769,8 @@ int CFlashExpert::exec(CMenuTarget* parent, const std::string & actionKey)
} else {
#if ENABLE_EXTUPDATE
if(selectedMTD == 10) {
- CExtUpdate::getInstance()->applySettings(actionKey, CExtUpdate::MODE_EXPERT);
+ std::string aK = actionKey;
+ CExtUpdate::getInstance()->applySettings(aK, CExtUpdate::MODE_EXPERT);
}
else
#endif
diff --git a/src/gui/update.h b/src/gui/update.h
index 8d9a30266..ae9e436d5 100644
--- a/src/gui/update.h
+++ b/src/gui/update.h
@@ -75,6 +75,7 @@ class CFlashExpert : public CProgressWindow
void showMTDSelector(const std::string & actionkey);
void showFileSelector(const std::string & actionkey);
+ bool checkSize(int mtd, std::string &backupFile);
void readmtd(int readmtd);
public:
diff --git a/src/gui/update_ext.cpp b/src/gui/update_ext.cpp
index 0346eeb3d..5deeb5ea7 100644
--- a/src/gui/update_ext.cpp
+++ b/src/gui/update_ext.cpp
@@ -41,6 +41,7 @@
#include
#include
#include
+#include
#include
#include
@@ -71,6 +72,7 @@ CExtUpdate::CExtUpdate()
fLogfile = "/tmp/update.log";
mountPkt = "/tmp/image_mount";
FileHelpers = NULL;
+ MTDBuf = NULL;
flashErrorFlag = false;
total = bsize = used = 0;
free1 = free2 = free3 = 0;
@@ -84,6 +86,8 @@ CExtUpdate::~CExtUpdate()
{
if(FileHelpers)
delete[] FileHelpers;
+ if(MTDBuf)
+ delete[] MTDBuf;
copyList.clear();
blackList.clear();
deleteList.clear();
@@ -105,12 +109,17 @@ bool CExtUpdate::ErrorReset(bool modus, const std::string & msg1, const std::str
umount(mountPkt.c_str());
// my_system(2,"rmmod", mtdramDriver.c_str());
}
- if (modus & RESET_FD1)
+ if (modus & CLOSE_FD1)
close(fd1);
- if (modus & RESET_FD2)
+ if (modus & CLOSE_FD2)
close(fd2);
- if (modus & RESET_F1)
+ if (modus & CLOSE_F1)
fclose(f1);
+ if (modus & DELETE_MTDBUF) {
+ if (MTDBuf != NULL)
+ delete[] MTDBuf;
+ MTDBuf = NULL;
+ }
if (msg2 == "")
snprintf(buf, sizeof(buf), "%s\n", msg1.c_str());
@@ -128,9 +137,8 @@ bool CExtUpdate::ErrorReset(bool modus, const std::string & msg1, const std::str
return false;
}
-bool CExtUpdate::applySettings(const std::string & filename, int mode)
+bool CExtUpdate::applySettings(std::string & filename, int mode)
{
-#define ORGFILE_EXT ".org"
if(!FileHelpers)
FileHelpers = new CFileHelpers();
@@ -141,8 +149,27 @@ bool CExtUpdate::applySettings(const std::string & filename, int mode)
DBG_TIMER_START()
- // make backup file
- FileHelpers->copyFile(imgFilename.c_str(), (imgFilename + ORGFILE_EXT).c_str(), 0644);
+ std::string oldFilename = imgFilename;
+ std::string hostName = netGetHostname();
+ std::string orgPath = getPathName(imgFilename);
+ std::string orgName = getBaseName(imgFilename);
+ orgName = getFileName(orgName);
+ std::string orgExt = "." + getFileExt(imgFilename);
+ std::string timeStr = getNowTimeStr("_%Y%m%d_%H%M");
+ std::string settingsStr = "+settings";
+
+ if (orgPath != "/tmp") {
+ if (g_settings.softupdate_name_mode_apply == CExtUpdate::SOFTUPDATE_NAME_HOSTNAME_TIME)
+ imgFilename = orgPath + "/" + hostName + timeStr + settingsStr + orgExt;
+ else if (g_settings.softupdate_name_mode_apply == CExtUpdate::SOFTUPDATE_NAME_ORGNAME_TIME)
+ imgFilename = orgPath + "/" + orgName + timeStr + settingsStr + orgExt;
+ else
+ imgFilename = orgPath + "/" + orgName + settingsStr + orgExt;
+ FileHelpers->copyFile(oldFilename.c_str(), imgFilename.c_str(), 0644);
+ }
+ else
+ imgFilename = oldFilename;
+ filename = imgFilename;
bool ret = applySettings();
DBG_TIMER_STOP("Image editing")
@@ -150,9 +177,8 @@ bool CExtUpdate::applySettings(const std::string & filename, int mode)
if ((mtdRamError != "") && (!flashErrorFlag))
DisplayErrorMessage(mtdRamError.c_str());
- // error, restore original file
+ // error, delete image file
unlink(imgFilename.c_str());
- rename((imgFilename + ORGFILE_EXT).c_str(), imgFilename.c_str());
}
else {
if (mode == MODE_EXPERT) {
@@ -276,19 +302,19 @@ bool CExtUpdate::applySettings()
}
int MTDBufSize = 0xFFFF;
- char *MTDBuf = new char[MTDBufSize];
+ MTDBuf = new char[MTDBufSize];
// copy image to mtdblock
if (MTDBuf == NULL)
- return ErrorReset(RESET_UNLOAD, "malloc error");
+ return ErrorReset(RESET_UNLOAD, "memory allocation error");
fd1 = open(imgFilename.c_str(), O_RDONLY);
if (fd1 < 0)
- return ErrorReset(RESET_UNLOAD, "cannot read image file: " + imgFilename);
+ return ErrorReset(RESET_UNLOAD | DELETE_MTDBUF, "cannot read image file: " + imgFilename);
long filesize = lseek(fd1, 0, SEEK_END);
lseek(fd1, 0, SEEK_SET);
if(filesize == 0)
- return ErrorReset(RESET_UNLOAD | RESET_FD1, "image filesize is 0");
+ return ErrorReset(RESET_UNLOAD | CLOSE_FD1 | DELETE_MTDBUF, "image filesize is 0");
if(filesize > mtdSize)
- return ErrorReset(RESET_UNLOAD | RESET_FD1, "image filesize too large");
+ return ErrorReset(RESET_UNLOAD | CLOSE_FD1 | DELETE_MTDBUF, "image filesize too large");
fd2 = -1;
int tmpCount = 0;
while (fd2 < 0) {
@@ -299,7 +325,7 @@ bool CExtUpdate::applySettings()
sleep(1);
}
if (fd2 < 0)
- return ErrorReset(RESET_UNLOAD | RESET_FD1, "cannot open mtdBlock");
+ return ErrorReset(RESET_UNLOAD | CLOSE_FD1 | DELETE_MTDBUF, "cannot open mtdBlock");
long fsize = filesize;
long block;
while(fsize > 0) {
@@ -316,12 +342,15 @@ bool CExtUpdate::applySettings()
FileHelpers->createDir(mountPkt.c_str(), 0755);
int res = mount(mtdBlockFileName.c_str(), mountPkt.c_str(), "jffs2", 0, NULL);
if (res)
- return ErrorReset(RESET_UNLOAD, "mount error");
+ return ErrorReset(RESET_UNLOAD | DELETE_MTDBUF, "mount error");
if (get_fs_usage(mountPkt.c_str(), total, used, &bsize))
free1 = (total * bsize) / 1024 - (used * bsize) / 1024;
if (!readBackupList(mountPkt)) {
+ if (MTDBuf != NULL)
+ delete[] MTDBuf;
+ MTDBuf = NULL;
if (flashErrorFlag)
return false;
return ErrorReset(0, "error readBackupList");
@@ -329,20 +358,20 @@ bool CExtUpdate::applySettings()
res = umount(mountPkt.c_str());
if (res)
- return ErrorReset(RESET_UNLOAD, "unmount error");
+ return ErrorReset(RESET_UNLOAD | DELETE_MTDBUF, "unmount error");
unlink(imgFilename.c_str());
// copy mtdblock to image
if (MTDBuf == NULL)
- return ErrorReset(RESET_UNLOAD, "malloc error");
+ return ErrorReset(RESET_UNLOAD, "memory allocation error");
fd1 = open(mtdBlockFileName.c_str(), O_RDONLY);
if (fd1 < 0)
- return ErrorReset(RESET_UNLOAD, "cannot read mtdBlock");
+ return ErrorReset(RESET_UNLOAD | DELETE_MTDBUF, "cannot read mtdBlock");
fsize = mtdRamSize;
fd2 = open(imgFilename.c_str(), O_WRONLY | O_CREAT);
if (fd2 < 0)
- return ErrorReset(RESET_UNLOAD | RESET_FD1, "cannot open image file: ", imgFilename);
+ return ErrorReset(RESET_UNLOAD | CLOSE_FD1 | DELETE_MTDBUF, "cannot open image file: ", imgFilename);
while(fsize > 0) {
block = fsize;
if(block > (long)MTDBufSize)
@@ -358,7 +387,7 @@ bool CExtUpdate::applySettings()
// check image file size
if (mtdRamSize != fsizeDst) {
unlink(imgFilename.c_str());
- return ErrorReset(0, "error file size: ", imgFilename);
+ return ErrorReset(DELETE_MTDBUF, "error file size: ", imgFilename);
}
// unload mtdramDriver only
@@ -367,7 +396,8 @@ bool CExtUpdate::applySettings()
if(hintBox)
hintBox->hide();
- delete[] MTDBuf;
+ if (MTDBuf != NULL)
+ delete[] MTDBuf;
MTDBuf = NULL;
sync();
return true;
@@ -546,7 +576,7 @@ bool CExtUpdate::readBackupList(const std::string & dstPath)
fgetpos(f1, &fz);
fseek(f1, 0, SEEK_SET);
if (fz.__pos == 0)
- return ErrorReset(RESET_F1, "backuplist filesize is 0");
+ return ErrorReset(CLOSE_F1, "backuplist filesize is 0");
size_t pos;
std::string line;
diff --git a/src/gui/update_ext.h b/src/gui/update_ext.h
index e6cc4642b..9ad7356b1 100644
--- a/src/gui/update_ext.h
+++ b/src/gui/update_ext.h
@@ -40,15 +40,17 @@ class CExtUpdate
enum
{
RESET_UNLOAD = 1,
- RESET_FD1 = 2,
- RESET_FD2 = 4,
- RESET_F1 = 8
+ CLOSE_FD1 = 2,
+ CLOSE_FD2 = 4,
+ CLOSE_F1 = 8,
+ DELETE_MTDBUF = 16
};
std::string imgFilename;
std::string mtdRamError;
int mtdNumber;
int fd1, fd2;
FILE *f1;
+ char *MTDBuf;
std::string mtdramDriver;
std::string backupList, defaultBackup;
std::string mountPkt;
@@ -80,11 +82,16 @@ class CExtUpdate
MODE_EXPERT = 0,
MODE_SOFTUPDATE = 1
};
+ enum {
+ SOFTUPDATE_NAME_DEFAULT,
+ SOFTUPDATE_NAME_HOSTNAME_TIME,
+ SOFTUPDATE_NAME_ORGNAME_TIME
+ };
CExtUpdate();
~CExtUpdate();
static CExtUpdate* getInstance();
- bool applySettings(const std::string & filename, int mode);
+ bool applySettings(std::string & filename, int mode);
bool ErrorReset(bool modus, const std::string & msg1="", const std::string & msg2="");
bool isBlacklistEntry(const std::string & file);
diff --git a/src/gui/update_settings.cpp b/src/gui/update_settings.cpp
index 27e609283..c2ae697f1 100644
--- a/src/gui/update_settings.cpp
+++ b/src/gui/update_settings.cpp
@@ -37,8 +37,9 @@
#include
#include
#include
-#include "update_settings.h"
-#include "filebrowser.h"
+#include
+#include
+#include
#include
#include
#include
@@ -67,6 +68,21 @@ const CMenuOptionChooser::keyval FLASHUPDATE_UPDATEMODE_OPTIONS[FLASHUPDATE_UPDA
{ 1, LOCALE_FLASHUPDATE_UPDATEMODE_INTERNET }
};
+#define SOFTUPDATE_NAME_MODE1_OPTION_COUNT 3
+const CMenuOptionChooser::keyval SOFTUPDATE_NAME_MODE1_OPTIONS[SOFTUPDATE_NAME_MODE1_OPTION_COUNT] =
+{
+ { CExtUpdate::SOFTUPDATE_NAME_DEFAULT, LOCALE_FLASHUPDATE_NAMEMODE1_DEFAULT },
+ { CExtUpdate::SOFTUPDATE_NAME_HOSTNAME_TIME, LOCALE_FLASHUPDATE_NAMEMODE1_HOSTNAME_TIME },
+ { CExtUpdate::SOFTUPDATE_NAME_ORGNAME_TIME, LOCALE_FLASHUPDATE_NAMEMODE1_ORGNAME_TIME }
+};
+
+#define SOFTUPDATE_NAME_MODE2_OPTION_COUNT 2
+const CMenuOptionChooser::keyval SOFTUPDATE_NAME_MODE2_OPTIONS[SOFTUPDATE_NAME_MODE2_OPTION_COUNT] =
+{
+ { CExtUpdate::SOFTUPDATE_NAME_DEFAULT, LOCALE_FLASHUPDATE_NAMEMODE2_DEFAULT },
+ { CExtUpdate::SOFTUPDATE_NAME_HOSTNAME_TIME, LOCALE_FLASHUPDATE_NAMEMODE2_HOSTNAME_TIME }
+};
+
int CUpdateSettings::exec(CMenuTarget* parent, const std::string &actionKey)
{
dprintf(DEBUG_DEBUG, "init software-update settings\n");
@@ -113,9 +129,18 @@ int CUpdateSettings::initMenu()
// fw_url->setHint("", LOCALE_MENU_HINT_XXX);
CMenuForwarder * fw_update_dir = new CMenuForwarder(LOCALE_EXTRA_UPDATE_DIR, true, g_settings.update_dir , this, "update_dir", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
// fw_update_dir->setHint("", LOCALE_MENU_HINT_XXX);
+ CMenuOptionChooser *name_backup = new CMenuOptionChooser(LOCALE_FLASHUPDATE_NAMEMODE2, &g_settings.softupdate_name_mode_backup, SOFTUPDATE_NAME_MODE2_OPTIONS, SOFTUPDATE_NAME_MODE2_OPTION_COUNT, true);
+// name_backup->setHint("", LOCALE_MENU_HINT_XXX);
+#ifndef BOXMODEL_APOLLO
CMenuOptionChooser *apply_settings = new CMenuOptionChooser(LOCALE_FLASHUPDATE_MENU_APPLY_SETTINGS, &g_settings.apply_settings, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, OnOffNotifier);
// apply_settings->setHint("", LOCALE_MENU_HINT_XXX);
+
+ CMenuOptionChooser *name_apply = new CMenuOptionChooser(LOCALE_FLASHUPDATE_NAMEMODE1, &g_settings.softupdate_name_mode_apply, SOFTUPDATE_NAME_MODE1_OPTIONS, SOFTUPDATE_NAME_MODE1_OPTION_COUNT, g_settings.apply_settings);
+// name_apply->setHint("", LOCALE_MENU_HINT_XXX);
+ OnOffNotifier->addItem(name_apply);
+#endif
+
#if 0
CMenuOptionChooser *apply_kernel = new CMenuOptionChooser(LOCALE_FLASHUPDATE_MENU_APPLY_KERNEL, &g_settings.apply_kernel, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.apply_settings);
// apply_kernel->setHint("", LOCALE_MENU_HINT_XXX);
@@ -124,8 +149,13 @@ int CUpdateSettings::initMenu()
w_upsettings.addItem(fw_update_dir);
w_upsettings.addItem(fw_url);
+ w_upsettings.addItem(name_backup);
+#ifndef BOXMODEL_APOLLO
w_upsettings.addItem(GenericMenuSeparatorLine);
w_upsettings.addItem(apply_settings);
+ w_upsettings.addItem(name_apply);
+#endif
+
#if 0
w_upsettings.addItem(apply_kernel);
#endif
diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp
index f82b283ed..71c7fc7c1 100644
--- a/src/gui/upnpbrowser.cpp
+++ b/src/gui/upnpbrowser.cpp
@@ -871,17 +871,17 @@ bool CUpnpBrowserGui::selectItem(std::string id)
void CUpnpBrowserGui::paintDevicePos(unsigned int pos)
{
int ypos = m_y + m_title_height + m_theight + pos*m_fheight;
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
if (pos == m_selecteddevice)
{
- color = COL_MENUCONTENT + 2;
+ color = COL_MENUCONTENT_TEXT_PLUS_2;
bgcolor = COL_MENUCONTENT_PLUS_2;
}
else
{
- color = COL_MENUCONTENT;
+ color = COL_MENUCONTENT_TEXT;
bgcolor = COL_MENUCONTENT_PLUS_0;
}
m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor);
@@ -907,12 +907,12 @@ void CUpnpBrowserGui::paintDevicePos(unsigned int pos)
void CUpnpBrowserGui::paintItemPos(std::vector *entry, unsigned int pos, unsigned int selected)
{
int ypos = m_y + m_title_height + m_theight + pos*m_fheight;
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
if (pos == selected)
{
- color = COL_MENUCONTENT + 2;
+ color = COL_MENUCONTENT_TEXT_PLUS_2;
bgcolor = COL_MENUCONTENT_PLUS_2;
paintDetails(entry, pos);
if ((*entry)[pos].isdir)
@@ -922,7 +922,7 @@ void CUpnpBrowserGui::paintItemPos(std::vector *entry, unsigned int p
}
else
{
- color = COL_MENUCONTENT;
+ color = COL_MENUCONTENT_TEXT;
bgcolor = COL_MENUCONTENT_PLUS_0;
}
m_frameBuffer->paintBoxRel(m_x, ypos, m_width - 15, m_fheight, bgcolor);
@@ -988,7 +988,7 @@ void CUpnpBrowserGui::paintDevice()
if (xstart < 10)
xstart = 10;
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_mheight, m_width - 20,
- tmp, COL_MENUCONTENTSELECTED, 0, true); // UTF-8
+ tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8
// second line
tmp = m_devices[m_selecteddevice].modelname + " " +
@@ -999,7 +999,7 @@ void CUpnpBrowserGui::paintDevice()
if (xstart < 10)
xstart = 10;
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 2*m_mheight, m_width - 20,
- tmp, COL_MENUCONTENTSELECTED, 0, true); // UTF-8
+ tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8
// third line
tmp = m_devices[m_selecteddevice].modelurl;
w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true); // UTF-8
@@ -1007,7 +1007,7 @@ void CUpnpBrowserGui::paintDevice()
if (xstart < 10)
xstart = 10;
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 3*m_mheight, m_width - 20,
- tmp, COL_MENUCONTENTSELECTED, 0, true); // UTF-8
+ tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8
// Head
CComponentsHeader header(m_x, m_y + m_title_height, m_width, m_theight, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP, CComponentsHeader::CC_BTN_MENU);
@@ -1071,7 +1071,7 @@ void CUpnpBrowserGui::paintItem(std::vector *entry, unsigned int sele
if (xstart < 10)
xstart = 10;
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 1*m_mheight, m_width - 20,
- tmp, COL_MENUCONTENTSELECTED, 0, true); // UTF-8
+ tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8
// second line
if ((*entry)[selected].isdir)
@@ -1094,7 +1094,7 @@ void CUpnpBrowserGui::paintItem(std::vector *entry, unsigned int sele
if (xstart < 10)
xstart = 10;
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 2*m_mheight, m_width - 20,
- tmp, COL_MENUCONTENTSELECTED, 0, true); // UTF-8
+ tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8
//third line
tmp = "";
@@ -1113,7 +1113,7 @@ void CUpnpBrowserGui::paintItem(std::vector *entry, unsigned int sele
if (xstart < 10)
xstart = 10;
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + xstart, m_y + 4 + 3*m_mheight, m_width - 20,
- tmp, COL_MENUCONTENTSELECTED, 0, true); // UTF-8
+ tmp, COL_MENUCONTENTSELECTED_TEXT, 0, true); // UTF-8
// Head
@@ -1121,7 +1121,7 @@ void CUpnpBrowserGui::paintItem(std::vector *entry, unsigned int sele
m_frameBuffer->paintBoxRel(m_x, m_y + m_title_height, m_width, m_theight, COL_MENUHEAD_PLUS_0);
m_frameBuffer->paintIcon(NEUTRINO_ICON_UPNP, m_x + 7, m_y + m_title_height + 6);
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(m_x + 35, m_y + m_theight + m_title_height + 0,
- m_width - 45, tmp, COL_MENUHEAD, 0, true); // UTF-8
+ m_width - 45, tmp, COL_MENUHEAD_TEXT, 0, true); // UTF-8
ypos = m_y + m_title_height;
if (m_theight > 26)
ypos = (m_theight - 26) / 2 + m_y + m_title_height;
@@ -1185,9 +1185,9 @@ void CUpnpBrowserGui::paintDetails(std::vector *entry, unsigned int i
m_playing_entry_is_shown = true;
g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start,
top + 1 * m_buttonHeight + 4, m_x + m_width - 8, m_playing_entry.title + " - " +
- m_playing_entry.artist, COL_MENUCONTENTDARK, 0, true); // UTF-8
+ m_playing_entry.artist, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8
g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start,
- top + 2 * m_buttonHeight + 4, m_x + m_width - 8, m_playing_entry.album, COL_MENUCONTENTDARK, 0, true); // UTF-8
+ top + 2 * m_buttonHeight + 4, m_x + m_width - 8, m_playing_entry.album, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8
}
}
else
@@ -1196,9 +1196,9 @@ void CUpnpBrowserGui::paintDetails(std::vector *entry, unsigned int i
m_playing_entry_is_shown = false;
g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start,
top + 1 * m_buttonHeight + 4, m_x + m_width - 8, (*entry)[index].title + " - " +
- (*entry)[index].artist, COL_MENUCONTENTDARK, 0, true); // UTF-8
+ (*entry)[index].artist, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8
g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]->RenderString(text_start,
- top + 2 * m_buttonHeight + 4, m_x + m_width - 8, (*entry)[index].album, COL_MENUCONTENTDARK, 0, true); // UTF-8
+ top + 2 * m_buttonHeight + 4, m_x + m_width - 8, (*entry)[index].album, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8
}
//// printf("title = %s\n", (*entry)[selected].title.c_str());
// printf("artist = %s\n", (*entry)[selected].artist.c_str());
@@ -1237,7 +1237,7 @@ void CUpnpBrowserGui::paintDetails(std::vector *entry, unsigned int i
text3 += " . ";
xstart += g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(text3);
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, width - 30- noch_len, text3, COL_MENUCONTENTDARK);
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2* fheight, width - 30- noch_len, text3, COL_MENUCONTENTDARK_TEXT);
}
if (!(text2.empty()))
@@ -1245,12 +1245,12 @@ void CUpnpBrowserGui::paintDetails(std::vector *entry, unsigned int i
while ( text2.find_first_of("[ -.+*#?=!$%&/]+") == 0 )
text2 = text2.substr( 1 );
text2 = text2.substr( 0, text2.find('\n') );
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ 2* fheight, width- xstart- 20- noch_len, text2, COL_MENUCONTENTDARK);
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ xstart, y+ height+ 5+ 2* fheight, width- xstart- 20- noch_len, text2, COL_MENUCONTENTDARK_TEXT);
}
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, width - 30 - seit_len, text1, COL_MENUCONTENTDARK);
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString (x+ width- 10- seit_len, y+ height+ 5+ fheight , seit_len, cSeit, COL_MENUCONTENTDARK, 0, true); // UTF-8
- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x+ width- 10- noch_len, y+ height+ 5+ 2* fheight- 2, noch_len, cNoch, COL_MENUCONTENTDARK, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, width - 30 - seit_len, text1, COL_MENUCONTENTDARK_TEXT);
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString (x+ width- 10- seit_len, y+ height+ 5+ fheight , seit_len, cSeit, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x+ width- 10- noch_len, y+ height+ 5+ 2* fheight- 2, noch_len, cNoch, COL_MENUCONTENTDARK_TEXT, 0, true); // UTF-8
#endif
}
@@ -1340,7 +1340,7 @@ void CUpnpBrowserGui::updateTimes(const bool force)
paintDetails(NULL, 0, true);
top = m_y + (m_height - m_info_height - 1 * m_buttonHeight) + m_buttonHeight + 4;
m_frameBuffer->paintBoxRel(m_x + m_width - w - 15, top + 1, w + 4, m_buttonHeight, COL_MENUCONTENTDARK_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(m_x + m_width - w - 11, top + 1 + m_buttonHeight, w, play_time, COL_MENUCONTENTDARK);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(m_x + m_width - w - 11, top + 1 + m_buttonHeight, w, play_time, COL_MENUCONTENTDARK_TEXT);
}
}
}
diff --git a/src/gui/vfd_setup.cpp b/src/gui/vfd_setup.cpp
index 15f434796..38579b051 100644
--- a/src/gui/vfd_setup.cpp
+++ b/src/gui/vfd_setup.cpp
@@ -54,7 +54,7 @@ CVfdSetup::CVfdSetup()
{
width = w_max (40, 10);
dim_time = NULL;
- vfd_enabled = (cs_get_revision() != 10);
+ vfd_enabled = (cs_get_revision() != 10) && (cs_get_revision() != 11);
}
CVfdSetup::~CVfdSetup()
@@ -130,6 +130,14 @@ int CVfdSetup::showSetup()
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, NEUTRINO_ICON_BUTTON_YELLOW);
+ mf->setHint("", LOCALE_MENU_HINT_BACKLIGHT);
+ vfds->addItem(mf);
+ }
vfds->addItem(GenericMenuSeparatorLine);
@@ -215,6 +223,24 @@ void CVfdSetup::showLedSetup(CMenuWidget *mn_led_widget)
mn_led_widget->addItem(mc);
}
+void CVfdSetup::showBacklightSetup(CMenuWidget *mn_led_widget)
+{
+ CMenuOptionChooser * mc;
+ mn_led_widget->addIntroItems(LOCALE_LEDCONTROLER_BACKLIGHT);
+
+ mc = new CMenuOptionChooser(LOCALE_LEDCONTROLER_BACKLIGHT_TV, &g_settings.backlight_tv, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this);
+ mc->setHint("", LOCALE_MENU_HINT_LEDS_TV);
+ mn_led_widget->addItem(mc);
+
+ mc = new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_STANDBY, &g_settings.backlight_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
+ mc->setHint("", LOCALE_MENU_HINT_LEDS_STANDBY);
+ mn_led_widget->addItem(mc);
+
+ mc = new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_DEEPSTANDBY, &g_settings.backlight_deepstandby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
+ mc->setHint("", LOCALE_MENU_HINT_LEDS_DEEPSTANDBY);
+ mn_led_widget->addItem(mc);
+}
+
bool CVfdSetup::changeNotify(const neutrino_locale_t OptionName, void */* data */)
{
@@ -236,5 +262,9 @@ bool CVfdSetup::changeNotify(const neutrino_locale_t OptionName, void */* data *
{
CVFD::getInstance()->setled();
}
+ else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LEDCONTROLER_BACKLIGHT_TV))
+ {
+ CVFD::getInstance()->setBacklight(g_settings.backlight_tv);
+ }
return false;
}
diff --git a/src/gui/vfd_setup.h b/src/gui/vfd_setup.h
index ca8dc6a47..b5eb7dfdd 100644
--- a/src/gui/vfd_setup.h
+++ b/src/gui/vfd_setup.h
@@ -44,6 +44,7 @@
int showSetup();
void showBrightnessSetup(CMenuWidget *mn_widget);
void showLedSetup(CMenuWidget *mn_led_widget);
+ void showBacklightSetup(CMenuWidget *mn_led_widget);
virtual bool changeNotify(const neutrino_locale_t OptionName, void *data);
int brightness;
int brightnessstandby;
diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp
index 1b5cfc5da..4653f2b6d 100644
--- a/src/gui/videosettings.cpp
+++ b/src/gui/videosettings.cpp
@@ -437,7 +437,6 @@ int CVideoSettings::showVideoSetup()
void CVideoSettings::setVideoSettings()
{
printf("[neutrino VideoSettings] %s init video settings...\n", __FUNCTION__);
- unsigned int system_rev = cs_get_revision();
#if 0
//FIXME focus: ?? this is different for different boxes
videoDecoder->SetVideoMode((analog_mode_t) g_settings.analog_mode1);
@@ -446,6 +445,7 @@ void CVideoSettings::setVideoSettings()
#ifdef BOXMODEL_APOLLO
changeNotify(LOCALE_VIDEOMENU_ANALOG_MODE, NULL);
#else
+ unsigned int system_rev = cs_get_revision();
if (system_rev == 0x06) {
changeNotify(LOCALE_VIDEOMENU_ANALOG_MODE, NULL);
} else {
diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp
index 6330ef150..b28e1b3cb 100644
--- a/src/gui/volumebar.cpp
+++ b/src/gui/volumebar.cpp
@@ -32,6 +32,7 @@
#include
#include
+#include
using namespace std;
@@ -68,7 +69,6 @@ void CVolumeBar::initVarVolumeBar()
vb_digit = NULL;
vb_digit_mode = CTextBox::CENTER ;
VolumeFont = SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO;
- vb_font = g_Font[VolumeFont];
initVolumeBarSize();
initVolumeBarPosition();
@@ -200,7 +200,7 @@ void CVolumeBar::initVolumeBarScale()
//set digit text with current volume value
void CVolumeBar::initVolumeBarDigitValue()
{
- vb_digit->setText(*vb_vol ,vb_digit_mode, vb_font);
+ vb_digit->setText(*vb_vol ,vb_digit_mode, *(CVolumeHelper::getInstance()->vb_font));
}
//create digit
@@ -209,7 +209,7 @@ void CVolumeBar::initVolumeBarDigit()
vb_digit = new CComponentsLabel();
vb_digit->setDimensionsAll(vb_digit_x, 0, vb_digit_w, height);
- vb_digit->setTextColor(COL_MENUCONTENT);
+ vb_digit->setTextColor(COL_MENUCONTENT_TEXT);
vb_digit->setCornerRadius(cornerRad());
vb_digit->setCornerType(CORNER_RIGHT);
initVolumeBarDigitValue();
@@ -277,6 +277,7 @@ void CVolumeHelper::Init()
y = frameBuffer->getScreenY() + v_spacer;
sw = g_settings.screen_EndX - h_spacer;
sh = frameBuffer->getScreenHeight();
+ vb_font = NULL;
initVolBarSize();
initMuteIcon();
@@ -319,19 +320,24 @@ void CVolumeHelper::initMuteIcon()
void CVolumeHelper::initVolBarSize()
{
- vol_height = 18;
- icon_width = 0;
- digit_width = 0;
- int tmp_h = 0;
- frameBuffer->getIconSize(NEUTRINO_ICON_VOLUME, &icon_width, &tmp_h);
- tmp_h += 2;
- icon_width += 8;
- vol_height = max(vol_height, tmp_h);
+ icon_width = 0;
+ icon_height = 0;
+ digit_width = 0;
+ frameBuffer->getIconSize(NEUTRINO_ICON_VOLUME, &icon_width, &icon_height);
+ icon_height = max(icon_height, 16); // if no icon available
+ icon_height += 2;
+ icon_width += 8;
+ g_settings.volume_size = max(g_settings.volume_size, icon_height);
+ vol_height = g_settings.volume_size;
if (g_settings.volume_digits) {
- tmp_h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getDigitHeight() + (g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getDigitOffset() * 18) / 10;
- vol_height = max(vol_height, tmp_h);
- digit_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth("100");
+ CNeutrinoFonts *cnf = CNeutrinoFonts::getInstance();
+ cnf->setFontUseDigitHeight(true);
+ int tmp_h = vol_height;
+ digit_width = 0;
+ vb_font = cnf->getDynFont(digit_width, tmp_h, "100", CNeutrinoFonts::FONT_STYLE_REGULAR, CNeutrinoFonts::FONT_ID_VOLBAR);
+ digit_width += 6;
+ vol_height = max(vol_height, tmp_h);
}
}
diff --git a/src/gui/volumebar.h b/src/gui/volumebar.h
index af44efef0..3903d4ac8 100644
--- a/src/gui/volumebar.h
+++ b/src/gui/volumebar.h
@@ -40,7 +40,6 @@ class CVolumeBar : public CComponentsForm
CComponentsPicture *vb_icon;
CComponentsLabel *vb_digit;
int vb_digit_mode;
- Font* vb_font;
int VolumeFont;
int sy, sw, sh;
int mute_ax, mute_ay, mute_dx, mute_dy, mute_ay_old;
@@ -105,7 +104,7 @@ class CVolumeHelper
int x, y, sw, sh;
int mute_ax, mute_ay, mute_dx, mute_dy, mute_corrY;
int clock_ax, clock_ay, clock_dx, clock_dy, digit_h, digit_offset;
- int icon_width, digit_width;
+ int icon_width, icon_height, digit_width;
int h_spacer, v_spacer;
int vol_ay, vol_height;
CFrameBuffer *frameBuffer;
@@ -120,7 +119,10 @@ class CVolumeHelper
CVolumeHelper();
static CVolumeHelper* getInstance();
+ Font** vb_font;
+
void getSpacer(int *h, int *v) { *h = h_spacer; *v = v_spacer; }
+ int getVolIconHeight() {return icon_height;}
void getDimensions(int *_x, int *_y, int *_sw, int *_sh, int *_iw, int *_dw) { *_x = x; *_y = y; *_sw = sw; *_sh = sh; *_iw = icon_width; *_dw = digit_width; }
void getMuteIconDimensions(int *_x, int *_y, int *w, int *h) { *_x = mute_ax; *_y = mute_ay+mute_corrY; *w = mute_dx; *h = mute_dy; }
void getInfoClockDimensions(int *_x, int *_y, int *w, int *h, int *d_h, int *d_o) { *_x = clock_ax; *_y = clock_ay; *w = clock_dx; *h = clock_dy, *d_h = digit_h, *d_o = digit_offset; }
diff --git a/src/gui/widget/Makefile.am b/src/gui/widget/Makefile.am
index 08874c785..0f030168a 100644
--- a/src/gui/widget/Makefile.am
+++ b/src/gui/widget/Makefile.am
@@ -21,7 +21,7 @@ if USE_STB_HAL
INCLUDES += -I$(STB_HAL_INC)
endif
-noinst_LIBRARIES = libneutrino_gui_widget.a libneutrino_gui_widget2.a
+noinst_LIBRARIES = libneutrino_gui_widget.a libneutrino_gui_widget2.a
libneutrino_gui_widget_a_SOURCES = \
buttons.cpp \
@@ -37,6 +37,7 @@ libneutrino_gui_widget_a_SOURCES = \
messagebox.cpp \
mountchooser.cpp \
msgbox.cpp \
+ signalbars.cpp \
stringinput.cpp \
stringinput_ext.cpp \
textbox.cpp
diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp
index f4a48d13b..c7eab93e6 100644
--- a/src/gui/widget/buttons.cpp
+++ b/src/gui/widget/buttons.cpp
@@ -53,7 +53,7 @@
* stuff below here was obviously not tested recently
* vertical_paint optional, default value is false (horizontal) sets direction of painted buttons
- * fcolor optional, default value is COL_INFOBAR_SHADOW, use it to render font with other color
+ * fcolor optional, default value is COL_INFOBAR_SHADOW_TEXT, use it to render font with other color
* alt_buttontext optional, default NULL, overwrites button caption at definied buttonlabel id (see parameter alt_buttontext_id) with this text
* alt_buttontext_id optional, default 0, means id from buttonlable struct which text you will change
* show optional, default value is true (show button), if false, then no show and return the height of the button.
@@ -68,7 +68,7 @@ int paintButtons( const int &x,
const int &footerheight,
std::string /* just to make sure nobody uses anything below */,
bool vertical_paint,
- const unsigned char fcolor,
+ const uint32_t fcolor,
const char * alt_buttontext,
const uint &buttontext_id,
bool show,
diff --git a/src/gui/widget/buttons.h b/src/gui/widget/buttons.h
index d4a187ab6..f988dcfae 100644
--- a/src/gui/widget/buttons.h
+++ b/src/gui/widget/buttons.h
@@ -44,7 +44,7 @@ int paintButtons( const int &x,
const int &footerheight = 0,
std::string tmp = "", /* just to make sure compilation breaks */
bool vertical_paint = false,
- const unsigned char fcolor = COL_INFOBAR_SHADOW,
+ const uint32_t fcolor = COL_INFOBAR_SHADOW_TEXT,
const char * alt_buttontext = NULL,
const uint &buttontext_id = 0,
bool show = true,
diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp
index 9240d13d9..2fb1fe150 100644
--- a/src/gui/widget/colorchooser.cpp
+++ b/src/gui/widget/colorchooser.cpp
@@ -98,15 +98,16 @@ CColorChooser::CColorChooser(const neutrino_locale_t Name, unsigned char *R, uns
}
void CColorChooser::setColor()
+{
+ frameBuffer->paintBoxRel(x+offset+162,y+hheight+2+5, mheight*4-4 ,mheight*4-4-10, getColor());
+}
+
+fb_pixel_t CColorChooser::getColor()
{
int color = convertSetupColor2RGB(*(value[VALUE_R]), *(value[VALUE_G]), *(value[VALUE_B]));
- int tAlpha = (value[VALUE_ALPHA]) ? (convertSetupAlpha2Alpha(*(value[VALUE_ALPHA]))) : 0;
+ int tAlpha = (value[VALUE_ALPHA]) ? (convertSetupAlpha2Alpha(*(value[VALUE_ALPHA]))) : 0xFF;
- if(!value[VALUE_ALPHA]) tAlpha = 0xFF;
-
- fb_pixel_t col = ((tAlpha << 24) & 0xFF000000) | color;
- //((tAlpha << 24) & 0xFF000000) | ((color << 16) & 0x00FF0000) | (color & 0x0000FF00) | ((color >> 16) & 0xFF);
- frameBuffer->paintBoxRel(x+offset+162,y+hheight+2+5, mheight*4-4 ,mheight*4-4-10, col);
+ return (((tAlpha << 24) & 0xFF000000) | color);
}
int CColorChooser::exec(CMenuTarget* parent, const std::string &)
@@ -248,7 +249,7 @@ 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, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+hheight, width, g_Locale->getText(name), COL_MENUHEAD_TEXT, 0, true); // UTF-8
//frameBuffer->paintBoxRel(x,y+hheight, width,height-hheight, COL_MENUCONTENT_PLUS_0);
frameBuffer->paintBoxRel(x,y+hheight, width,height-hheight, COL_MENUCONTENT_PLUS_0, RADIUS_MID, CORNER_BOTTOM);//round
@@ -268,5 +269,5 @@ void CColorChooser::paintSlider(int px, int py, unsigned char *spos, const neutr
frameBuffer->paintIcon(NEUTRINO_ICON_VOLUMEBODY,px+offset+10,py+2+mheight/4);
frameBuffer->paintIcon(selected ? iconname : NEUTRINO_ICON_VOLUMESLIDER2,px+offset+13+(*spos),py+mheight/4);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px,py+mheight, width, g_Locale->getText(text), COL_MENUCONTENT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(px,py+mheight, width, g_Locale->getText(text), COL_MENUCONTENT_TEXT, 0, true); // UTF-8
}
diff --git a/src/gui/widget/colorchooser.h b/src/gui/widget/colorchooser.h
index 50bc61734..f2ff70c90 100644
--- a/src/gui/widget/colorchooser.h
+++ b/src/gui/widget/colorchooser.h
@@ -67,6 +67,7 @@ class CColorChooser : public CMenuTarget
void hide();
int exec(CMenuTarget* parent, const std::string & actionKey);
+ fb_pixel_t getColor(void);
};
diff --git a/src/gui/widget/drawable.cpp b/src/gui/widget/drawable.cpp
index bfb41c807..7435d9158 100644
--- a/src/gui/widget/drawable.cpp
+++ b/src/gui/widget/drawable.cpp
@@ -88,7 +88,7 @@ void DText::init()
void DText::draw(CFBWindow *window, int x, int y, int width)
{
window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU], x, y + m_height, width,
- m_text.c_str(), (CFBWindow::color_t)COL_MENUCONTENT, 0, true); // UTF-8
+ m_text.c_str(), COL_MENUCONTENT_TEXT, 0, true); // UTF-8
}
void DText::print(void)
@@ -136,7 +136,7 @@ void DPagebreak::draw(CFBWindow */*window*/, int /*x*/, int /*y*/, int /*width*/
{
// window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU],
// x, y + m_height, width, "",
-// (CFBWindow::color_t)COL_MENUCONTENT, 0, true); // UTF-8
+// COL_MENUCONTENT_TEXT, 0, true); // UTF-8
}
void DPagebreak::print(void)
diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp
index 73bb1ea5d..9315b132e 100644
--- a/src/gui/widget/hintbox.cpp
+++ b/src/gui/widget/hintbox.cpp
@@ -181,11 +181,11 @@ void CHintBox::refresh(void)
CFrameBuffer::getInstance()->getIconSize(iconfile.c_str(), &iw, &ih);
//window->paintIcon(iconfile.c_str(), 8, 5);
window->paintIcon(iconfile.c_str(), 10, 0, theight);
- //window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], iw+20, theight, width - 20-iw, g_Locale->getText(caption), (CFBWindow::color_t)COL_MENUHEAD, 0, true); // UTF-8
- window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], iw+20, theight, width - 20-iw, caption, (CFBWindow::color_t)COL_MENUHEAD, 0, true); // UTF-8
+ //window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], iw+20, theight, width - 20-iw, g_Locale->getText(caption), COL_MENUHEAD_TEXT, 0, true); // UTF-8
+ window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], iw+20, theight, width - 20-iw, caption, COL_MENUHEAD_TEXT, 0, true); // UTF-8
}
else
- window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], 10, theight, width - 10, caption, (CFBWindow::color_t)COL_MENUHEAD, 0, true); // UTF-8
+ window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], 10, theight, width - 10, caption, COL_MENUHEAD_TEXT, 0, true); // UTF-8
//window->paintBoxRel(0, theight, width, (entries_per_page + 1) * fheight, (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0);
window->paintBoxRel(0, theight, width, (entries_per_page + 1) * fheight, (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);//round
@@ -194,7 +194,7 @@ void CHintBox::refresh(void)
int ypos = theight + (fheight >> 1);
for (std::vector::const_iterator it = line.begin() + (entries_per_page * current_page); ((it != line.end()) && (count > 0)); ++it, count--)
- window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU], textStartX, (ypos += fheight), width, *it, (CFBWindow::color_t)COL_MENUCONTENT, 0, true); // UTF-8
+ window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU], textStartX, (ypos += fheight), width, *it, COL_MENUCONTENT_TEXT, 0, true); // UTF-8
if (entries_per_page < line.size())
{
diff --git a/src/gui/widget/hintboxext.cpp b/src/gui/widget/hintboxext.cpp
index 7d2af4f4b..e5e31b411 100644
--- a/src/gui/widget/hintboxext.cpp
+++ b/src/gui/widget/hintboxext.cpp
@@ -265,7 +265,7 @@ void CHintBoxExt::refresh(bool toround)
x_text = x_offset;
// title text
- m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], x_text, m_theight, m_width, title_text.c_str(), (CFBWindow::color_t)COL_MENUHEAD, 0, true); // UTF-8
+ m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], x_text, m_theight, m_width, title_text.c_str(), COL_MENUHEAD_TEXT, 0, true); // UTF-8
// background of text panel
m_window->paintBoxRel(0, m_theight, m_width, (m_maxEntriesPerPage + 1) * m_fheight, (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0, toround ? RADIUS_LARGE : 0, CORNER_BOTTOM);//round
diff --git a/src/gui/widget/keychooser.cpp b/src/gui/widget/keychooser.cpp
index 57785e298..6a4e42dc6 100644
--- a/src/gui/widget/keychooser.cpp
+++ b/src/gui/widget/keychooser.cpp
@@ -174,9 +174,9 @@ void CKeyChooserItem::paint()
frameBuffer->paintBoxRel(x, y , width, hheight , COL_MENUHEAD_PLUS_0 , RADIUS_LARGE, CORNER_TOP);//round
frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);//round
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+ 10, y+ hheight, width, g_Locale->getText(name), COL_MENUHEAD, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+ 10, y+ hheight, width, g_Locale->getText(name), COL_MENUHEAD_TEXT, 0, true); // UTF-8
//paint msg...
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, y+ hheight+ mheight, width, g_Locale->getText(LOCALE_KEYCHOOSER_TEXT1), COL_MENUCONTENT, 0, true); // UTF-8
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, y+ hheight+ mheight* 2, width, g_Locale->getText(LOCALE_KEYCHOOSER_TEXT2), COL_MENUCONTENT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, y+ hheight+ mheight, width, g_Locale->getText(LOCALE_KEYCHOOSER_TEXT1), COL_MENUCONTENT_TEXT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, y+ hheight+ mheight* 2, width, g_Locale->getText(LOCALE_KEYCHOOSER_TEXT2), COL_MENUCONTENT_TEXT, 0, true); // UTF-8
}
diff --git a/src/gui/widget/listbox.cpp b/src/gui/widget/listbox.cpp
index 7e64a639c..935ca7923 100644
--- a/src/gui/widget/listbox.cpp
+++ b/src/gui/widget/listbox.cpp
@@ -81,7 +81,7 @@ void CListBox::paintHead()
{
//frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0);
frameBuffer->paintBoxRel(x, y, width, theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width, caption.c_str() , COL_MENUHEAD, 0, true);
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width, caption.c_str() , COL_MENUHEAD_TEXT, 0, true);
}
void CListBox::paintFoot()
@@ -92,16 +92,16 @@ void CListBox::paintFoot()
frameBuffer->paintHLine(x, x+width, y, COL_INFOBAR_SHADOW_PLUS_0);
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, x+width- 4* ButtonWidth+ 8, y+height+1);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 4* ButtonWidth+ 38, y+height+24 - 2, width, "edit", COL_INFOBAR);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 4* ButtonWidth+ 38, y+height+24 - 2, width, "edit", COL_INFOBAR_TEXT);
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, x+width- 3* ButtonWidth+ 8, y+height+4);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 3* ButtonWidth+ 29, y+height+24 - 2, width- 26, "add", COL_INFOBAR);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 3* ButtonWidth+ 29, y+height+24 - 2, width- 26, "add", COL_INFOBAR_TEXT);
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RED, x+width- 2* ButtonWidth+ 8, y+height+4);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 2* ButtonWidth+ 29, y+height+24 - 2, width- 26, "remove", COL_INFOBAR);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width- 2* ButtonWidth+ 29, y+height+24 - 2, width- 26, "remove", COL_INFOBAR_TEXT);
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HOME, x+width - ButtonWidth+ 8, y+height+1);
- g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width - ButtonWidth+ 38, y+height+24 - 2, width, "ready", COL_INFOBAR);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+width - ButtonWidth+ 38, y+height+24 - 2, width, "ready", COL_INFOBAR_TEXT);
}
void CListBox::paintItem(int pos)
@@ -129,17 +129,17 @@ void CListBox::paintItem(unsigned int /*itemNr*/, int paintNr, bool pselected)
{
int ypos = y+ theight + paintNr*getItemHeight();
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
if (pselected)
{
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
}
else
{
- color = COL_MENUCONTENT;
+ color = COL_MENUCONTENT_TEXT;
bgcolor = COL_MENUCONTENT_PLUS_0;
}
diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp
index 437cdd0c9..fe8d979af 100644
--- a/src/gui/widget/listframe.cpp
+++ b/src/gui/widget/listframe.cpp
@@ -72,11 +72,11 @@
//#define LIST_BACKGROUND_COLOR_SELECTED ((CFBWindow::color_t)COL_MENUCONTENT_PLUS_1)
#define LIST_BACKGROUND_COLOR_SELECTED ((CFBWindow::color_t)COL_MENUCONTENTSELECTED_PLUS_0)
-#define TITLE_FONT_COLOR COL_MENUHEAD
-#define HEADER_LIST_FONT_COLOR COL_MENUCONTENT
-#define LIST_FONT_COLOR COL_MENUCONTENT
-//#define LIST_FONT_COLOR_SELECTED COL_MENUCONTENT
-#define LIST_FONT_COLOR_SELECTED COL_MENUCONTENTSELECTED
+#define TITLE_FONT_COLOR COL_MENUHEAD_TEXT
+#define HEADER_LIST_FONT_COLOR COL_MENUCONTENT_TEXT
+#define LIST_FONT_COLOR COL_MENUCONTENT_TEXT
+//#define LIST_FONT_COLOR_SELECTED COL_MENUCONTENT_TEXT
+#define LIST_FONT_COLOR_SELECTED COL_MENUCONTENTSELECTED_TEXT
#define FONT_LIST g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]
#define FONT_HEADER_LIST g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]
@@ -418,7 +418,7 @@ void CListFrame::refreshList(void)
line < m_nNrOfLines && line < m_nCurrentLine + m_nLinesPerPage;
line++)
{
- int color = LIST_FONT_COLOR;
+ uint32_t color = LIST_FONT_COLOR;
// draw line
if(line == m_nSelectedLine && m_showSelection == true)
{
@@ -461,7 +461,7 @@ void CListFrame::refreshLine(int line)
if((line < m_nCurrentLine) && (line > m_nCurrentLine + m_nLinesPerPage))
return;
- uint8_t color;
+ uint32_t color;
int rel_line = line - m_nCurrentLine;
int y = m_cFrameListRel.iY + TEXT_BORDER_WIDTH + (rel_line*m_nFontListHeight);
diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp
index c905c945d..d55e2d295 100644
--- a/src/gui/widget/menue.cpp
+++ b/src/gui/widget/menue.cpp
@@ -45,11 +45,11 @@
#include
/* the following generic menu items are integrated into multiple menus at the same time */
-CMenuSeparator CGenericMenuSeparator;
-CMenuSeparator CGenericMenuSeparatorLine(CMenuSeparator::LINE);
-CMenuForwarder CGenericMenuBack(LOCALE_MENU_BACK, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_LEFT);
-CMenuForwarder CGenericMenuCancel(LOCALE_MENU_CANCEL, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_HOME);
-CMenuForwarder CGenericMenuNext(LOCALE_MENU_NEXT, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_HOME);
+CMenuSeparator CGenericMenuSeparator(0, NONEXISTANT_LOCALE, true);
+CMenuSeparator CGenericMenuSeparatorLine(CMenuSeparator::LINE, NONEXISTANT_LOCALE, true);
+CMenuForwarder CGenericMenuBack(LOCALE_MENU_BACK, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_LEFT, NULL, true);
+CMenuForwarder CGenericMenuCancel(LOCALE_MENU_CANCEL, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_HOME, NULL, true);
+CMenuForwarder CGenericMenuNext(LOCALE_MENU_NEXT, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_HOME, NULL, true);
CMenuSeparator * const GenericMenuSeparator = &CGenericMenuSeparator;
CMenuSeparator * const GenericMenuSeparatorLine = &CGenericMenuSeparatorLine;
CMenuForwarder * const GenericMenuBack = &CGenericMenuBack;
@@ -65,6 +65,7 @@ CMenuItem::CMenuItem()
used = false;
icon_frame_w = 10;
hint = NONEXISTANT_LOCALE;
+ isStatic = false;
}
void CMenuItem::init(const int X, const int Y, const int DX, const int OFFX)
@@ -74,7 +75,7 @@ void CMenuItem::init(const int X, const int Y, const int DX, const int OFFX)
dx = DX;
offx = OFFX;
name_start_x = x + offx + icon_frame_w;
- item_color = COL_MENUCONTENT;
+ item_color = COL_MENUCONTENT_TEXT;
item_bgcolor = COL_MENUCONTENT_PLUS_0;
}
@@ -100,17 +101,17 @@ void CMenuItem::initItemColors(const bool select_mode)
{
if (select_mode)
{
- item_color = COL_MENUCONTENTSELECTED;
+ item_color = COL_MENUCONTENTSELECTED_TEXT;
item_bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
}
else if (!active)
{
- item_color = COL_MENUCONTENTINACTIVE;
+ item_color = COL_MENUCONTENTINACTIVE_TEXT;
item_bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0;
}
else
{
- item_color = COL_MENUCONTENT;
+ item_color = COL_MENUCONTENT_TEXT;
item_bgcolor = COL_MENUCONTENT_PLUS_0;
}
}
@@ -125,7 +126,7 @@ void CMenuItem::paintItemBackground (const bool select_mode, const int &item_hei
frameBuffer->paintBoxRel(x, y, dx, item_height, item_bgcolor, RADIUS_LARGE);
}
-void CMenuItem::paintItemCaption(const bool select_mode, const int &item_height, const char * left_text, const char * right_text)
+void CMenuItem::paintItemCaption(const bool select_mode, const int &item_height, const char * left_text, const char * right_text, const fb_pixel_t right_bgcol)
{
if (select_mode)
{
@@ -141,14 +142,31 @@ void CMenuItem::paintItemCaption(const bool select_mode, const int &item_height,
}
//left text
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(name_start_x, y+ item_height, dx- (name_start_x - x), left_text, item_color, 0, true); // UTF-8
+ int _dx = dx;
+ if (!iconName_Info_right.empty()) {
+ int icon_w = 0;
+ int icon_h = 0;
+ CFrameBuffer::getInstance()->getIconSize(iconName_Info_right.c_str(), &icon_w, &icon_h);
+ if (icon_w)
+ _dx -= icon_frame_w + icon_w;
+ }
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(name_start_x, y+ item_height, _dx- (name_start_x - x), left_text, item_color, 0, true); // UTF-8
//right text
- if (right_text != NULL)
+ if (right_text || right_bgcol)
{
- int stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(right_text, true);
+ int stringwidth = 0;
+ if (right_text)
+ stringwidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(right_text, true);
int stringstartposOption = std::max(name_start_x + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(left_text, true) + icon_frame_w, x + dx - stringwidth - icon_frame_w); //+ offx
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposOption, y+item_height,dx- (stringstartposOption- x), right_text, item_color, 0, true);
+ if (right_bgcol) {
+ if (!right_text)
+ stringstartposOption -= 60;
+ CFrameBuffer::getInstance()->paintBoxRel(stringstartposOption, y + 1, dx - stringstartposOption + x - 1, item_height - 2, right_bgcol, RADIUS_LARGE);
+ CFrameBuffer::getInstance()->paintBoxFrame(stringstartposOption, y + 1, dx - stringstartposOption + x - 1, item_height - 2, 1, COL_MENUCONTENT_PLUS_6, RADIUS_LARGE);
+ }
+ if (right_text)
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposOption, y+item_height,dx- (stringstartposOption- x), right_text, item_color, 0, true);
}
}
@@ -197,7 +215,11 @@ void CMenuItem::paintItemButton(const bool select_mode, const int &item_height,
int icon_h = 0;
//define icon name depends of numeric value
+#ifdef MARTII
+ if (g_settings.menu_numbers_as_icons && icon_name.empty() && CRCInput::isNumeric(directKey))
+#else
if (icon_name.empty() && CRCInput::isNumeric(directKey))
+#endif
{
char i_name[6]; /* X +'\0' */
snprintf(i_name, 6, "%d", CRCInput::getNumericValue(directKey));
@@ -247,7 +269,11 @@ void CMenuItem::paintItemButton(const bool select_mode, const int &item_height,
{
frameBuffer->getIconSize(iconName_Info_right.c_str(), &icon_w, &icon_h);
+#ifdef MARTII
+ if (icon_w>0 && icon_h>0)
+#else
if (active && icon_w>0 && icon_h>0)
+#endif
{
icon_painted = frameBuffer->paintIcon(iconName_Info_right, dx + icon_start_x - (icon_w + 20), y+ ((item_height/2- icon_h/2)) );
}
@@ -398,12 +424,8 @@ void CMenuWidget::resetWidget(bool delete_items)
{
for(unsigned int count=0;countisStatic && delete_items) {
+ delete item;
item = NULL;
}
}
@@ -521,6 +543,27 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
if ( msg <= CRCInput::RC_MaxRC ) {
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]);
+ std::map::iterator it = keyActionMap.find(msg);
+ if (it != keyActionMap.end()) {
+ fader.Stop();
+ int rv = it->second.menue->exec(parent, it->second.action);
+ switch ( rv ) {
+ case menu_return::RETURN_EXIT_ALL:
+ retval = menu_return::RETURN_EXIT_ALL;
+ case menu_return::RETURN_EXIT:
+ msg = CRCInput::RC_timeout;
+ break;
+ case menu_return::RETURN_REPAINT:
+ case menu_return::RETURN_EXIT_REPAINT:
+ if (fade && washidden)
+ fader.StartFadeIn();
+ checkHints();
+ paint();
+ break;
+ }
+ frameBuffer->blit();
+ continue;
+ }
for (unsigned int i= 0; i< items.size(); i++) {
CMenuItem* titem = items[i];
if ((titem->directKey != CRCInput::RC_nokey) && (titem->directKey == msg)) {
@@ -535,6 +578,12 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
break;
}
}
+#ifdef MARTII
+ if (msg == (uint32_t) g_settings.key_channelList_pageup)
+ msg = CRCInput::RC_page_up;
+ else if (msg == (uint32_t) g_settings.key_channelList_pagedown)
+ msg = CRCInput::RC_page_down;
+#endif
}
if (handled)
@@ -1160,6 +1209,12 @@ void CMenuWidget::paintHint(int pos)
}
+void CMenuWidget::addKey(neutrino_msg_t key, CMenuTarget *menue, const std::string & action)
+{
+ keyActionMap[key].menue = menue;
+ keyActionMap[key].action = action;
+}
+
//-------------------------------------------------------------------------------------------------------------------------------
CMenuOptionNumberChooser::CMenuOptionNumberChooser(const neutrino_locale_t name, int * const OptionValue, const bool Active, const int min_value, const int max_value, CChangeObserver * const Observ, const int print_offset, const int special_value, const neutrino_locale_t special_value_name, const char * non_localized_name, bool sliderOn)
{
@@ -1194,9 +1249,10 @@ int CMenuOptionNumberChooser::exec(CMenuTarget*)
else
(*optionValue)++;
}
- paint(true);
if(observ)
observ->changeNotify(optionName, optionValue);
+ // give the observer a chance to modify the value
+ paint(true);
return menu_return::RETURN_NONE;
}
@@ -1229,6 +1285,26 @@ int CMenuOptionNumberChooser::paint(bool selected)
return y+height;
}
+int CMenuOptionNumberChooser::getWidth(void)
+{
+ const char * l_optionName = (optionString != NULL) ? optionString : g_Locale->getText(optionName);
+ int width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(l_optionName, true);
+
+ char tmp[20], *t;
+
+ snprintf(tmp, sizeof(tmp), "%d", lower_bound);
+ for(t = tmp; *t; t++) if (isdigit((int)*t)) *t = *widest_number;
+ int w1 = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true);
+
+ snprintf(tmp, sizeof(tmp), "%d", upper_bound);
+ for(t = tmp; *t; t++) if (isdigit((int)*t)) *t = *widest_number;
+ int w2 = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true);
+
+ width += (w1 > w2) ? w1 : w2;
+
+ return width + 10; /* min 10 pixels between option name and value. enough? */
+}
+
CMenuOptionChooser::CMenuOptionChooser(const neutrino_locale_t OptionName, int * const OptionValue, const struct keyval * const Options, const unsigned Number_Of_Options, const bool Active, CChangeObserver * const Observ, const neutrino_msg_t DirectKey, const std::string & IconName, bool Pulldown)
{
height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
@@ -1616,7 +1692,7 @@ int CMenuOptionLanguageChooser::paint( bool selected )
}
//-------------------------------------------------------------------------------------------------------------------------------
-CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const char * const Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right)
+CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const char * const Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic)
{
option = Option;
option_string = NULL;
@@ -1627,9 +1703,10 @@ CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active,
directKey = DirectKey;
iconName = IconName ? IconName : "";
iconName_Info_right = IconName_Info_right ? IconName_Info_right : "";
+ isStatic = IsStatic;
}
-CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right)
+CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option, CMenuTarget* Target, const char * const ActionKey, neutrino_msg_t DirectKey, const char * const IconName, const char * const IconName_Info_right, bool IsStatic)
{
option = NULL;
option_string = &Option;
@@ -1640,6 +1717,23 @@ CMenuForwarder::CMenuForwarder(const neutrino_locale_t Text, const bool Active,
directKey = DirectKey;
iconName = IconName ? IconName : "";
iconName_Info_right = IconName_Info_right ? IconName_Info_right : "";
+ isStatic = IsStatic;
+}
+
+void CMenuForwarder::setOption(const char * const Option)
+{
+ option = Option;
+ option_string = NULL;
+ if (used && x != -1)
+ paint();
+}
+
+void CMenuForwarder::setOption(const std::string &Option)
+{
+ option = NULL;
+ option_string = &Option;
+ if (used && x != -1)
+ paint();
}
int CMenuForwarder::getHeight(void) const
@@ -1647,16 +1741,6 @@ int CMenuForwarder::getHeight(void) const
return g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
}
-// used gets set by the addItem() function. This is for set to paint Option string by just not calling the addItem() function.
-// Without this, the changeNotifiers would become machine-dependent.
-void CMenuForwarder::setOption(const char *Option)
-{
- option = Option;
-
- if (used && x != -1)
- paint();
-}
-
// used gets set by the addItem() function. This is for set to paint Text from locales by just not calling the addItem() function.
// Without this, the changeNotifiers would become machine-dependent.
void CMenuForwarder::setTextLocale(const neutrino_locale_t Text)
@@ -1677,9 +1761,14 @@ int CMenuForwarder::getWidth(void)
else if (option_string)
option_text = option_string->c_str();
+ fb_pixel_t bgcol = 0;
+ if (jumpTarget)
+ bgcol = jumpTarget->getColor();
- if (option_text != NULL)
- tw += 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(option_text, true);
+ if (option_text != NULL)
+ tw += 10 + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(option_text, true);
+ else if (bgcol)
+ tw += 10 + 60;
return tw;
}
@@ -1718,6 +1807,9 @@ int CMenuForwarder::paint(bool selected)
const char * l_text = getName();
const char * option_text = getOption();
+ fb_pixel_t bgcol = 0;
+ if (jumpTarget)
+ bgcol = jumpTarget->getColor();
//paint item
prepareItem(selected, height);
@@ -1726,7 +1818,7 @@ int CMenuForwarder::paint(bool selected)
paintItemButton(selected, height);
//caption
- paintItemCaption(selected, height, l_text, option_text);
+ paintItemCaption(selected, height, l_text, option_text, bgcol);
return y+ height;
}
@@ -1787,12 +1879,13 @@ int CMenuForwarderNonLocalized::getWidth(void)
return tw;
}
//-------------------------------------------------------------------------------------------------------------------------------
-CMenuSeparator::CMenuSeparator(const int Type, const neutrino_locale_t Text)
+CMenuSeparator::CMenuSeparator(const int Type, const neutrino_locale_t Text, bool IsStatic)
{
directKey = CRCInput::RC_nokey;
iconName = "";
type = Type;
text = Text;
+ isStatic = IsStatic;
}
@@ -1837,12 +1930,12 @@ int CMenuSeparator::paint(bool selected)
if ((type & SUB_HEAD))
{
- item_color = COL_MENUHEAD;
+ item_color = COL_MENUHEAD_TEXT;
item_bgcolor = COL_MENUHEAD_PLUS_0;
}
else
{
- item_color = COL_MENUCONTENTINACTIVE;
+ item_color = COL_MENUCONTENTINACTIVE_TEXT;
item_bgcolor = COL_MENUCONTENT_PLUS_0;
}
@@ -1862,7 +1955,7 @@ int CMenuSeparator::paint(bool selected)
/* if no alignment is specified, align centered */
if (type & ALIGN_LEFT)
- name_start_x = x + (!SUB_HEAD ? name_start_x : 20 + 24 /*std icon_width is 24px - this should be determinated from NEUTRINO_ICON_BUTTON_HOME or so*/);
+ name_start_x = x + (!(type & SUB_HEAD) ? name_start_x : 20 + 24 /*std icon_width is 24px - this should be determinated from NEUTRINO_ICON_BUTTON_HOME or so*/);
else if (type & ALIGN_RIGHT)
name_start_x = x + dx - stringwidth - 20;
else /* ALIGN_CENTER */
diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h
index 9d9eb92a1..d23c03655 100644
--- a/src/gui/widget/menue.h
+++ b/src/gui/widget/menue.h
@@ -80,6 +80,7 @@ class CMenuTarget
virtual ~CMenuTarget(){}
virtual void hide(){}
virtual int exec(CMenuTarget* parent, const std::string & actionKey) = 0;
+ virtual fb_pixel_t getColor(void) { return 0; }
};
class CMenuItem
@@ -93,6 +94,7 @@ class CMenuItem
public:
bool active;
+ bool isStatic;
neutrino_msg_t directKey;
neutrino_msg_t msg;
std::string iconName;
@@ -138,7 +140,7 @@ class CMenuItem
virtual void setItemButton(const std::string& icon_Name, const bool is_select_button = false);
- virtual void paintItemCaption(const bool select_mode, const int &item_height, const char * left_text=NULL, const char * right_text=NULL);
+ virtual void paintItemCaption(const bool select_mode, const int &item_height, const char * left_text=NULL, const char * right_text=NULL, const fb_pixel_t right_bgcol=0);
virtual void paintItemSlider( const bool select_mode, const int &item_height, const int &optionvalue, const int &factor, const char * left_text=NULL, const char * right_text=NULL);
@@ -166,7 +168,7 @@ class CMenuSeparator : public CMenuItem
};
- CMenuSeparator(const int Type = 0, const neutrino_locale_t Text = NONEXISTANT_LOCALE);
+ CMenuSeparator(const int Type = 0, const neutrino_locale_t Text = NONEXISTANT_LOCALE, bool IsStatic = false);
virtual ~CMenuSeparator(){}
int paint(bool selected=false);
@@ -208,16 +210,14 @@ class CMenuForwarder : public CMenuItem
public:
- CMenuForwarder(const neutrino_locale_t Text, const bool Active=true, const char * const Option=NULL, CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, const char * const IconName_Info_right = NULL);
- CMenuForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option, CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, const char * const IconName_Info_right = NULL);
-
+ CMenuForwarder(const neutrino_locale_t Text, const bool Active=true, const char * const Option=NULL, CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false);
+ CMenuForwarder(const neutrino_locale_t Text, const bool Active, const std::string &Option, CMenuTarget* Target=NULL, const char * const ActionKey = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const char * const IconName = NULL, const char * const IconName_Info_right = NULL, bool IsStatic = false);
virtual ~CMenuForwarder(){}
int paint(bool selected=false);
int getHeight(void) const;
int getWidth(void);
- void setOption(const char *Option);
void setTextLocale(const neutrino_locale_t Text);
neutrino_locale_t getTextLocale(){return text;};
CMenuTarget* getTarget(){return jumpTarget;};
@@ -228,6 +228,8 @@ class CMenuForwarder : public CMenuItem
{
return active;
}
+ void setOption(const char * const Option);
+ void setOption(const std::string &Option);
};
class CMenuDForwarder : public CMenuForwarder
@@ -298,6 +300,7 @@ private:
int exec(CMenuTarget* parent);
int isMenueOptionChooser(void) const{return 1;}
+ int getWidth(void);
};
class CMenuOptionChooser : public CAbstractMenuOptionChooser
@@ -434,6 +437,8 @@ class CMenuWidget : public CMenuTarget
CFrameBuffer *frameBuffer;
std::vector items;
std::vector page_start;
+ struct keyAction { std::string action; CMenuTarget *menue; };
+ std::map keyActionMap;
std::string iconfile;
int min_width;
@@ -513,6 +518,7 @@ class CMenuWidget : public CMenuTarget
MENU_POS_BOTTOM_LEFT ,
MENU_POS_BOTTOM_RIGHT
};
+ void addKey(neutrino_msg_t key, CMenuTarget *menue, const std::string &action);
};
class CPINProtection
diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp
index be2e7fda9..65d231eb1 100644
--- a/src/gui/widget/messagebox.cpp
+++ b/src/gui/widget/messagebox.cpp
@@ -159,10 +159,10 @@ void CMessageBox::paintButtons()
for (i = 0; i < ButtonCount; i++) {
if (Buttons[i].def) {
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
} else {
- color = COL_INFOBAR_SHADOW;
+ color = COL_INFOBAR_SHADOW_TEXT;
bgcolor = COL_INFOBAR_SHADOW_PLUS_0;
}
CFrameBuffer::getInstance()->getIconSize(Buttons[i].icon, &iw, &ih);
diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp
index 38aed2a5a..cf8da2ad2 100644
--- a/src/gui/widget/msgbox.cpp
+++ b/src/gui/widget/msgbox.cpp
@@ -328,7 +328,7 @@ void CMsgBox::initFramesRel(void)
//////////////////////////////////////////////////////////////////////
void CMsgBox::refreshFoot(void)
{
- int color,bgcolor;
+ uint32_t color, bgcolor;
if( !(m_nMode & FOOT)) return;
// draw the background first
@@ -351,12 +351,12 @@ void CMsgBox::refreshFoot(void)
{
if (m_nResult == mbrYes)
{
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
}
else
{
- color = COL_INFOBAR_SHADOW;
+ color = COL_INFOBAR_SHADOW_TEXT;
bgcolor = COL_INFOBAR_SHADOW_PLUS_0;
}
m_pcWindow->paintBoxRel(xpos+m_cBoxFrame.iX, m_cBoxFrameFootRel.iY + (ADD_FOOT_HEIGHT>>1)+m_cBoxFrame.iY, ButtonWidth, m_nFontFootHeight + 4, (CFBWindow::color_t)bgcolor, RADIUS_MID);
@@ -372,12 +372,12 @@ void CMsgBox::refreshFoot(void)
{
if (m_nResult == mbrNo)
{
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
}
else
{
- color = COL_INFOBAR_SHADOW;
+ color = COL_INFOBAR_SHADOW_TEXT;
bgcolor = COL_INFOBAR_SHADOW_PLUS_0;
}
@@ -394,12 +394,12 @@ void CMsgBox::refreshFoot(void)
{
if (m_nResult >= mbrCancel)
{
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
}
else
{
- color = COL_INFOBAR_SHADOW;
+ color = COL_INFOBAR_SHADOW_TEXT;
bgcolor = COL_INFOBAR_SHADOW_PLUS_0;
}
@@ -441,7 +441,7 @@ void CMsgBox::refreshTitle(void)
m_cBoxFrameTitleRel.iHeight+3+m_cBoxFrame.iY,
m_cBoxFrameTitleRel.iWidth - TITLE_ICON_WIDTH + TEXT_BORDER_WIDTH,
m_cTitle.c_str(),
- (CFBWindow::color_t)COL_MENUHEAD,
+ COL_MENUHEAD_TEXT,
0,
true); // UTF-8
}
@@ -454,7 +454,7 @@ void CMsgBox::refreshTitle(void)
m_cBoxFrameTitleRel.iHeight+3+m_cBoxFrame.iY,
m_cBoxFrameTitleRel.iWidth - TEXT_BORDER_WIDTH,
m_cTitle.c_str(),
- (CFBWindow::color_t)COL_MENUHEAD,
+ COL_MENUHEAD_TEXT,
0,
true); // UTF-8
}
diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp
index e3957c0f7..0f7ae6b05 100644
--- a/src/gui/widget/progresswindow.cpp
+++ b/src/gui/widget/progresswindow.cpp
@@ -132,7 +132,7 @@ void CProgressWindow::showStatusMessageUTF(const std::string & text)
{
statusText = text;
frameBuffer->paintBox(x, statusTextY-mheight, x+width, statusTextY, COL_MENUCONTENT_PLUS_0);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10, statusTextY, width-20, text, COL_MENUCONTENT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10, statusTextY, width-20, text, COL_MENUCONTENT_TEXT, 0, true); // UTF-8
frameBuffer->blit();
#ifdef VFD_UPDATE
@@ -158,7 +158,7 @@ void CProgressWindow::paint()
int ypos=y;
frameBuffer->paintBoxRel(x, ypos, width, hheight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);
if (caption != NONEXISTANT_LOCALE)
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10, ypos+ hheight, width - 10, g_Locale->getText(caption), COL_MENUHEAD, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10, ypos+ hheight, width - 10, g_Locale->getText(caption), COL_MENUHEAD_TEXT, 0, true); // UTF-8
frameBuffer->paintBoxRel(x, ypos+ hheight, width, height- hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);
ypos+= hheight + (mheight >>1);
@@ -170,7 +170,7 @@ void CProgressWindow::paint()
showLocalStatus(0);
ypos+= mheight+10;
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width- 10, g_Locale->getText(LOCALE_FLASHUPDATE_GLOBALPROGRESS), COL_MENUCONTENT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width- 10, g_Locale->getText(LOCALE_FLASHUPDATE_GLOBALPROGRESS), COL_MENUCONTENT_TEXT, 0, true); // UTF-8
ypos+= mheight;
globalstatusY = ypos+ mheight-20;
diff --git a/src/gui/widget/signalbars.cpp b/src/gui/widget/signalbars.cpp
new file mode 100644
index 000000000..a8268b11a
--- /dev/null
+++ b/src/gui/widget/signalbars.cpp
@@ -0,0 +1,361 @@
+/*
+ Based up Neutrino-GUI - Tuxbox-Project
+ Copyright (C) 2001 by Steffen Hehn 'McClean'
+
+ Class for signalbar based up CComponent classes.
+ Copyright (C) 2013, Thilo Graf 'dbt'
+
+ License: GPL
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifdef HAVE_CONFIG_H
+#include
+#endif
+
+#include
+#include
+#include "signalbars.h"
+#include
+
+#define SB_MIN_HEIGHT 12
+
+using namespace std;
+
+CSignalBar::CSignalBar()
+{
+ initVarSigBar();
+ initSBItems();
+}
+
+CSignalBar::CSignalBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref)
+{
+ initVarSigBar();
+ sb_frontend = frontend_ref;
+ x = xpos;
+ y = ypos;
+ width = w;
+ height = h;
+
+ initSBItems();
+}
+
+void CSignalBar::initDimensions()
+{
+ //set current required dimensions and font size
+ sb_item_height = max(height, SB_MIN_HEIGHT) - 2*fr_thickness;
+ sb_item_top = height/2 - sb_item_height/2;
+ if (sb_scale_height == -1)
+ sb_scale_height = sb_item_height;
+
+ int dx = 0;
+ int dy = sb_item_height;
+ sb_font = *dy_font->getDynFont(dx, dy);
+
+ sb_vlbl_width = sb_font->getRenderWidth ("00%", true);
+ sb_lbl_width = sb_font->getRenderWidth ("XXXX"/*sb_name*/, true);
+ sb_scale_width = width - sb_vlbl_width - sb_lbl_width - 2*fr_thickness;
+}
+
+void CSignalBar::initSBItems()
+{
+ if (cc_parent){
+ //use backround color of parent form if signalbar is embedded
+ col_body = cc_parent->getColorBody();
+
+ //and set required color for text to name label
+ CSignalBox *sbx = static_cast(cc_parent);
+ sb_caption_color = sbx->getTextColor();
+ }
+
+ //reinit dimensions
+ initDimensions();
+
+ //init items scale, value and name
+ initSBarScale();
+ initSBarValue();
+ initSBarName();
+}
+
+void CSignalBar::initVarSigBar()
+{
+ initVarForm();
+ corner_rad = 0;
+ corner_type = 0;
+ append_h_offset = 2;
+ append_v_offset = 0;
+ height = SB_MIN_HEIGHT;
+
+ sb_scale_height = -1;
+
+ dy_font = CNeutrinoFonts::getInstance();
+
+ sb_caption_color= COL_INFOBAR_TEXT;
+
+ sb_lastsig = 0;
+ sb_signal = 0;
+
+ sb_frontend = NULL;
+ sb_scale = NULL;
+ sb_vlbl = NULL;
+ sb_lbl = NULL;
+ sb_name = "SIG";
+}
+
+void CSignalBar::initSBarScale()
+{
+ //create scale object if required
+ if (sb_scale == NULL){
+ sb_scale = new CProgressBar();
+ //we want colored scale!
+ sb_scale->setBlink();
+ }
+
+ //move and set dimensions
+ int scale_y = (sb_item_height/2 - sb_scale_height/2);
+ sb_scale->setDimensionsAll(fr_thickness, scale_y, sb_scale_width, sb_scale_height/*sb_item_height*/);
+ sb_scale->setColorBody(col_body);
+
+ //add scale object to container
+ if(!isAdded(sb_scale))
+ addCCItem(sb_scale);
+
+}
+
+void CSignalBar::initSBarValue()
+{
+ //create value label object with basic properties
+ if (sb_vlbl == NULL){
+ sb_vlbl = new CComponentsLabel();
+ sb_vlbl->doPaintBg(false);
+ sb_vlbl->setText("0%", CTextBox::NO_AUTO_LINEBREAK, sb_font);
+ }
+
+ //move and set dimensions
+ int vlbl_x = sb_scale->getXPos() + sb_scale_width + append_h_offset;
+ sb_vlbl->setDimensionsAll(vlbl_x/*CC_APPEND*/, sb_item_top, sb_vlbl_width, sb_item_height);
+
+ //set current text and body color color
+ sb_vlbl->setTextColor(sb_caption_color);
+ sb_vlbl->setColorBody(col_body);
+
+ //add value label object to container
+ if (!isAdded(sb_vlbl))
+ addCCItem(sb_vlbl);
+}
+
+void CSignalBar::initSBarName()
+{
+ //create name label object with basic properties
+ if (sb_lbl == NULL){
+ sb_lbl = new CComponentsLabel();
+ //paint no backround
+ sb_lbl->doPaintBg(true);
+ sb_lbl->forceTextPaint();
+ }
+
+ //move and set dimensions
+ int lbl_x = width - sb_lbl_width - fr_thickness;
+ sb_lbl->setDimensionsAll(lbl_x, sb_item_top, sb_lbl_width, sb_item_height);
+ sb_lbl->setText(sb_name, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, sb_font);
+
+ //set current text and body color
+ sb_lbl->setTextColor(sb_caption_color);
+ sb_lbl->setColorBody(col_body);
+
+ //add name label object to container
+ if (!isAdded(sb_lbl))
+ addCCItem(sb_lbl);
+}
+
+
+void CSignalBar::Refresh()
+{
+ //get current value from frontend
+ sb_signal = sb_frontend->getSignalStrength();
+
+ //reinit items with current values
+ initSBItems();
+}
+
+void CSignalBar::paintScale()
+{
+ //format signal values
+ int sig;
+ sig = (sb_signal & 0xFFFF) * 100 / 65535;
+
+ //exit if value too small
+ if(sig < 5)
+ return;
+
+ //assign current value to scale object and paint new value
+ if (sb_lastsig != sig) {
+ sb_lastsig = sig;
+ sb_scale->setValues(sig, 100);
+ //string is required
+ ostringstream i_str;
+ i_str << sig;
+ string percent(i_str.str());
+ percent += "%";
+ sb_vlbl->setText(percent, CTextBox::NO_AUTO_LINEBREAK | CTextBox::CENTER, sb_font);
+
+ //we must force paint backround, because of changing values
+ sb_vlbl->doPaintBg(true);
+ sb_vlbl->forceTextPaint();
+ sb_vlbl->doPaintTextBoxBg(true);
+ sb_vlbl->setColorBody(col_body);
+
+ //repaint labels
+ for(size_t i=0; iv_cc_items.size(); i++)
+ v_cc_items[i]->paint(false);
+ }
+}
+
+void CSignalBar::paint(bool do_save_bg)
+{
+ //initialize before and paint frame and body
+ if (!is_painted){
+ initSBItems();
+ paintForm(do_save_bg);
+ }
+
+ //paint current sig value
+ paintScale();
+}
+
+
+//*******************************************************************************************************************************
+CSignalNoiseRatioBar::CSignalNoiseRatioBar()
+{
+ initVarSnrBar();
+ initSBItems();
+}
+
+CSignalNoiseRatioBar::CSignalNoiseRatioBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref)
+{
+ initVarSnrBar();
+ sb_frontend = frontend_ref;
+ x = xpos;
+ y = ypos;
+ width = w;
+ height = h;
+
+ initSBItems();
+}
+
+void CSignalNoiseRatioBar::initVarSnrBar()
+{
+ initVarSigBar();
+ sb_name = "SNR";
+}
+
+void CSignalNoiseRatioBar::Refresh()
+{
+ //get current value from frontend
+ sb_signal = sb_frontend->getSignalNoiseRatio();
+
+ //reinit items with current values
+ initSBItems();
+}
+
+
+//**********************************************************************************************************************
+CSignalBox::CSignalBox(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref)
+{
+ initVarSigBox();
+
+ sbx_frontend = frontend_ref;
+ x = xpos;
+ y = ypos;
+ width = w;
+ height = h;
+
+ sbx_bar_height = height/2;
+ sbx_bar_width = width-2*corner_rad;
+
+ sbar = new CSignalBar(sbx_bar_x, 0, sbx_bar_width, sbx_bar_height, sbx_frontend);
+ sbar->doPaintBg(false);
+ addCCItem(sbar);
+
+ snrbar = new CSignalNoiseRatioBar(sbx_bar_x, CC_APPEND, sbx_bar_width, sbx_bar_height, sbx_frontend);
+ snrbar->doPaintBg(false);
+ addCCItem(snrbar);
+
+ initSignalItems();
+}
+
+void CSignalBox::initVarSigBox()
+{
+ initVarForm();
+ corner_rad = 0;
+
+ sbx_frontend = NULL;
+ sbar = NULL;
+ snrbar = NULL;
+ height = 3* SB_MIN_HEIGHT;
+ sbx_bar_height = height/2;
+ sbx_bar_x = corner_rad;
+ sbx_caption_color = COL_INFOBAR_TEXT;
+}
+
+void CSignalBox::initSignalItems()
+{
+ //set current properties for items
+// int cor_rad = corner_rad/2-fr_thickness;
+
+// int corr_y = sbx_bar_height%2;
+// int sb_h = sbx_bar_height - corr_y;
+
+ int sbar_h = sbx_bar_height - fr_thickness - append_v_offset/2;
+ int sbar_w = sbx_bar_width - 2*fr_thickness;
+ int sbar_x = sbx_bar_x + fr_thickness;
+ int scale_h = sbar_h * 76 / 100;
+
+ sbar->setDimensionsAll(sbar_x, fr_thickness, sbar_w, sbar_h);
+ sbar->setFrontEnd(sbx_frontend);
+ sbar->setCornerRadius(0);
+ sbar->setScaleHeight(scale_h);
+
+ snrbar->setDimensionsAll(sbar_x, CC_APPEND, sbar_w, sbar_h);
+ snrbar->setFrontEnd(sbx_frontend);
+ snrbar->setCornerRadius(0);
+ snrbar->setScaleHeight(scale_h);
+}
+
+void CSignalBox::paintScale()
+{
+ initSignalItems();
+
+ //repaint items
+ sbar->Refresh();
+ sbar->paint/*Scale*/(false);
+
+ snrbar->Refresh();
+ snrbar->paint/*Scale*/(false);
+}
+
+void CSignalBox::paint(bool do_save_bg)
+{
+ //paint frame and body
+ if (!is_painted){
+ initSignalItems();
+ paintForm(do_save_bg);
+ }
+
+ //paint current signal value
+ paintScale();
+}
diff --git a/src/gui/widget/signalbars.h b/src/gui/widget/signalbars.h
new file mode 100644
index 000000000..b6ee7544c
--- /dev/null
+++ b/src/gui/widget/signalbars.h
@@ -0,0 +1,278 @@
+/*
+ Based up Neutrino-GUI - Tuxbox-Project
+ Copyright (C) 2001 by Steffen Hehn 'McClean'
+
+ Class for signalbar based up CComponent classes.
+ Copyright (C) 2013, Thilo Graf 'dbt'
+
+ License: GPL
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program; if not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef __SIGNALBARS_H__
+#define __SIGNALBARS_H__
+
+
+#ifdef HAVE_CONFIG_H
+#include
+#endif
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/// Basic class for signalbars
+/*!
+Basic attributes and member functions for items.
+These class provides basic attributes and members to show frontend values in signalbars.
+CSignalBar() and their sub classes based up CComponentsForm() and are usable like other CComponentsItems()
+
+CSignalBar() is intended to show signal rate.
+*/
+
+class CSignalBar : public CComponentsForm
+{
+ public:
+ ///refresh current item properties, use this before paintScale().
+ void Refresh();
+
+ protected:
+ ///object: current frontend
+ CFrontend *sb_frontend;
+ ///object: scale bar
+ CProgressBar *sb_scale;
+ ///object: value caption
+ CComponentsLabel *sb_vlbl;
+ ///object: caption for signal name
+ CComponentsLabel *sb_lbl;
+ ///object: current font
+ Font *sb_font;
+ ///object: dynamic font object handler
+ CNeutrinoFonts *dy_font;
+ ///property: text color, see also setTextColor()
+ fb_pixel_t sb_caption_color;
+
+ ///property: item top position
+ int sb_item_top;
+ ///property: height of items
+ int sb_item_height;
+ ///property: height of scale
+ int sb_scale_height;
+ ///property: width of progressbar
+ int sb_scale_width;
+ ///property: width of value caption
+ int sb_vlbl_width;
+ ///property: width of caption
+ int sb_lbl_width;
+
+ ///cache last assingned signal value
+ int sb_lastsig;
+ ///current signal value
+ uint16_t sb_signal;
+
+ ///initialize all needed basich attributes and objects
+ void initVarSigBar();
+ ///initianlize position and dimensions of signalbar container
+ void initDimensions();
+ ///initialize scale object
+ void initSBarScale();
+ ///initialize value caption object, this contains the value of current frontend data, signal or noise rate
+ void initSBarValue();
+ ///initialize caption object, this contains the unit (e.g %) or name of value (e.g. SIG)
+ void initSBarName();
+
+ ///initialize all required objects at once, see also Refresh()
+ void initSBItems();
+
+ ///reinitialize current signal values and paint new values, required after Refresh()
+ void paintScale();
+
+ ///property: contains the name of signal type in the caption object, see also setName()
+ std::string sb_name;
+
+ public:
+ CSignalBar();
+ ///basic component class constructor for signal.
+ CSignalBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref);
+
+ ///assigns the current used frontend, simplified a tuner object, see frontend_c.h
+ virtual void setFrontEnd(CFrontend *frontend_ref){sb_frontend = frontend_ref;};
+ ///assigns font for caption
+ virtual void setTextFont(Font* font_text){sb_font = font_text;};
+ ///sets the caption color, see also property 'sb_caption_color'
+ virtual void setTextColor(const fb_pixel_t& caption_color){ sb_caption_color = caption_color;};
+ ///assigns the height of scale
+ virtual void setScaleHeight(const int& scale_height){sb_scale_height = scale_height;};
+ ///assigns the name of signal value in the caption object, see also sb_name
+ virtual void setName(const std::string& name){sb_name = name;};
+
+ ///returns the scale object, type = CProgressBar*
+ virtual CProgressBar* getScaleObject(){return sb_scale;};
+ ///returns the caption object, type = CComponentsLabel*
+ virtual CComponentsLabel* getLabelObject(){return sb_lbl;};
+
+ ///paint this items
+ virtual void paint(bool do_save_bg);
+};
+
+/// Sub class of CSignalBar()
+/*!
+This class use basic attributes and members from CSignalBar() to show frontend values.
+
+CSignalNoiseRatioBar() is intended to show signal noise ratio value.
+*/
+
+class CSignalNoiseRatioBar : public CSignalBar
+{
+ public:
+ ///refresh current item properties, use this before paintScale().
+ void Refresh();
+
+ protected:
+ ///initialize all needed basic attributes and objects
+ void initVarSnrBar();
+
+ public:
+ CSignalNoiseRatioBar();
+ ///basic component class constructor for signal noise ratio.
+ CSignalNoiseRatioBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref);
+};
+
+/// Class CSignalBox() provides CSignalBar(), CSignalNoiseRatioBar() scales at once.
+/*!
+Provides basic attributes and member functions for CComponentItems in
+additional of CSignalBar()- and CSignalNoiseRatioBar()-objects.
+
+
+To add a signalbox object to your code add this to a header file:
+#include
+
+class CSampleClass
+{
+ private:
+ //other stuff;
+ CSignalBox * signalbox;
+
+ public:
+ CSampleClass();
+ ~CSampleClass();
+ void showSNR();
+
+ //other stuff;
+
+};
+
+
+//add this to your costructor into the code file:
+CSampleClass::CSampleClass()
+{
+ //other stuff;
+ signalbox = NULL;
+}
+
+CStreamInfo2::~CStreamInfo2 ()
+{
+ //other stuff to clean;
+ delete signalbox;
+ //other stuff to clean;
+}
+
+void CSampleClass::showSNR()
+{
+ if (signalbox == NULL){
+ signalbox = new CSignalBox(10, 100, 500, 38, frontend);
+// signalbox->setCornerRadius(0); //optional
+// signalbox->setColorBody(COL_BLACK); //optional
+ signalbox->setColorBody(COL_MENUHEAD_PLUS_0);
+ signalbox->doPaintBg(false);
+//if you want to add the object to a CC-Container (e.g. CComponentsWindow()), remove this line:
+ signalbox->paint(false);
+//and add this lines:
+// if (!isAdded(signalbox))
+// addCCItem(signalbox);
+//Note: signal box objects deallocate together with the CC-Container!
+ }
+ else{
+ signalbox->paintScale();
+ }
+ }
+
+void CSampleClass::hide ()
+{
+ //other code;
+
+//Note: not required if signalbox is added to a CC-Container!
+ signalbox->hide(true);
+ delete signalbox;
+ signalbox = NULL;
+
+ //other code;
+}
+
+*/
+
+class CSignalBox : public CComponentsForm
+{
+ private:
+ ///object: current frontend
+ CFrontend *sbx_frontend;
+ ///object: current signalbar
+ CSignalBar *sbar;
+ ///object: current signal noise ratio bar
+ CSignalNoiseRatioBar *snrbar;
+
+ ///property: height of signalbars
+ int sbx_bar_height;
+ ///property: width of signalbars
+ int sbx_bar_width;
+ ///property: x position of signalbars
+ int sbx_bar_x;
+ ///property: text color, see also setTextColor()
+ fb_pixel_t sbx_caption_color;
+
+ ///initialize all needed basic attributes and objects
+ void initVarSigBox();
+ ///initialize general properties of signal items
+ void initSignalItems();
+
+ ///paint items with new values, required after Refresh()
+ void paintScale();
+
+ public:
+ ///class constructor for signal noise ratio.
+ CSignalBox(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref);
+
+ ///returns the signal object, type = CSignalBar*
+ CSignalBar* getScaleObject(){return sbar;};
+ ///returns the signal noise ratio object, type = CSignalNoiseRatioBar*
+ CSignalNoiseRatioBar* getLabelObject(){return snrbar;};
+
+ ///sets the caption color of signalbars, see also property 'sbx_caption_color'
+ void setTextColor(const fb_pixel_t& caption_color){ sbx_caption_color = caption_color;};
+ ///get caption color of signalbars, see also property 'sbx_caption_color'
+ fb_pixel_t getTextColor(){return sbx_caption_color;};
+
+
+ ///paint items
+ void paint(bool do_save_bg);
+};
+
+#endif
diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp
index 72ea25b4b..29c44b836 100644
--- a/src/gui/widget/stringinput.cpp
+++ b/src/gui/widget/stringinput.cpp
@@ -613,7 +613,7 @@ void CStringInput::paint(bool sms)
icol_o = icol_w + (offset/2);
}
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+ (offset/2)+ icol_o, y+ hheight, width- offset- icol_o, head ? head : g_Locale->getText(name), COL_MENUHEAD, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+ (offset/2)+ icol_o, y+ hheight, width- offset- icol_o, head ? head : g_Locale->getText(name), COL_MENUHEAD_TEXT, 0, true); // UTF-8
int tmp_y = y+ hheight+ offset+ input_h+ offset;
if ((hint_1 != NONEXISTANT_LOCALE) || (hint_2 != NONEXISTANT_LOCALE))
@@ -621,12 +621,12 @@ void CStringInput::paint(bool sms)
if (hint_1 != NONEXISTANT_LOCALE)
{
tmp_y += iheight;
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_1), COL_MENUCONTENT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_1), COL_MENUCONTENT_TEXT, 0, true); // UTF-8
}
if (hint_2 != NONEXISTANT_LOCALE)
{
tmp_y += iheight;
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_2), COL_MENUCONTENT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_2), COL_MENUCONTENT_TEXT, 0, true); // UTF-8
}
tmp_y += offset;
}
@@ -635,7 +635,7 @@ void CStringInput::paint(bool sms)
if (sms)
{
frameBuffer->getIconSize(NEUTRINO_ICON_NUMERIC_PAD, &icol_w, &icol_h);
- frameBuffer->paintIcon(NEUTRINO_ICON_NUMERIC_PAD, x + (width/2) - (icol_w/2), tmp_y, 0, COL_MENUCONTENT);
+ frameBuffer->paintIcon(NEUTRINO_ICON_NUMERIC_PAD, x + (width/2) - (icol_w/2), tmp_y, 0, COL_MENUCONTENT_TEXT);
//buttonbar
::paintButtons(x, y+ hheight+ bheight, width, CStringInputSMSButtonsCount, CStringInputSMSButtons, width, fheight);
@@ -659,17 +659,17 @@ void CStringInput::paintChar(int pos, const char c)
char ch[2] = {c, 0};
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
if (pos == selected)
{
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
}
else
{
- color = COL_MENUCONTENT;
+ color = COL_MENUCONTENT_TEXT;
bgcolor = COL_MENUCONTENT_PLUS_0;
}
diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp
index e3a0438dd..39b062ecb 100644
--- a/src/gui/widget/stringinput_ext.cpp
+++ b/src/gui/widget/stringinput_ext.cpp
@@ -305,7 +305,7 @@ void CExtendedInput::paint()
frameBuffer->paintBoxRel(x, y, width, hheight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);
frameBuffer->paintBoxRel(x, y + hheight, width, bheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+ (offset/2), y+ hheight, width- offset, g_Locale->getText(name), COL_MENUHEAD, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+ (offset/2), y+ hheight, width- offset, g_Locale->getText(name), COL_MENUHEAD_TEXT, 0, true); // UTF-8
int tmp_y = y+ hheight+ offset+ input_h+ offset;
@@ -314,12 +314,12 @@ void CExtendedInput::paint()
if (hint_1 != NONEXISTANT_LOCALE)
{
tmp_y += iheight;
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_1), COL_MENUCONTENT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_1), COL_MENUCONTENT_TEXT, 0, true); // UTF-8
}
if (hint_2 != NONEXISTANT_LOCALE)
{
tmp_y += iheight;
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_2), COL_MENUCONTENT, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->RenderString(x+ offset, tmp_y, width- 2*offset, g_Locale->getText(hint_2), COL_MENUCONTENT_TEXT, 0, true); // UTF-8
}
tmp_y += offset;
}
@@ -359,17 +359,17 @@ void CExtendedInput_Item_Char::paint(int x, int y, bool focusGained )
char ch[2] = {*data, 0};
- uint8_t color;
+ fb_pixel_t color;
fb_pixel_t bgcolor;
if (focusGained)
{
- color = COL_MENUCONTENTSELECTED;
+ color = COL_MENUCONTENTSELECTED_TEXT;
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
}
else
{
- color = COL_MENUCONTENT;
+ color = COL_MENUCONTENT_TEXT;
bgcolor = COL_MENUCONTENT_PLUS_0;
}
diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp
index 20bd21643..41a8fad31 100644
--- a/src/gui/widget/textbox.cpp
+++ b/src/gui/widget/textbox.cpp
@@ -102,7 +102,7 @@ CTextBox::CTextBox(const char * text, Font* font_text, const int pmode,
//TRACE("[CTextBox] %s Line %d\r\n", __FUNCTION__, __LINE__);
//TRACE(" CTextBox::m_nFontTextHeight: %d\t\r\n",m_nFontTextHeight);
-
+
//Initialise the window frames first and than refresh text line array
initFramesAndTextArray();
}
@@ -114,7 +114,7 @@ CTextBox::CTextBox(const char * text)
if(text != NULL)
m_cText = *text;
-
+
//TRACE_1("[CTextBox] %s Line %d text: %s\r\n", __FUNCTION__, __LINE__, text);
//Initialise the window frames first and than refresh text line array
@@ -125,7 +125,7 @@ CTextBox::CTextBox()
{
//TRACE("[CTextBox] new\r\n");
initVar();
-
+
//Initialise the window frames first and than refresh text line array
initFramesAndTextArray();
}
@@ -142,7 +142,7 @@ void CTextBox::initVar(void)
{
//TRACE("[CTextBox]->InitVar\r\n");
frameBuffer = NULL;
-
+
m_showTextFrame = 0;
m_nNrOfNewLine = 0;
m_nMaxLineWidth = 0;
@@ -160,7 +160,8 @@ void CTextBox::initVar(void)
m_nLinesPerPage = 0;
m_nCurrentLine = 0;
m_nCurrentPage = 0;
- text_border_width = 8;
+ text_Hborder_width = 8; //border left and right
+ text_Vborder_width = 8; //border top and buttom
m_cFrame.iX = g_settings.screen_StartX + ((g_settings.screen_EndX - g_settings.screen_StartX - MIN_WINDOW_WIDTH) >>1);
m_cFrame.iWidth = MIN_WINDOW_WIDTH;
@@ -173,11 +174,11 @@ void CTextBox::initVar(void)
m_nMinWidth = MIN_WINDOW_WIDTH;
m_textBackgroundColor = COL_MENUCONTENT_PLUS_0;
- m_textColor = COL_MENUCONTENT;
+ m_textColor = COL_MENUCONTENT_TEXT;
m_nPaintBackground = true;
m_nBgRadius = 0;
m_nBgRadiusType = CORNER_ALL;
-
+
m_cLineArray.clear();
// max_width = 0;
@@ -218,9 +219,10 @@ void CTextBox::setTextFont(Font* font_text)
}
}
-void CTextBox::setTextBorderWidth(int border)
+void CTextBox::setTextBorderWidth(int Hborder, int Vborder)
{
- text_border_width = border;
+ text_Hborder_width = Hborder;
+ text_Vborder_width = Vborder;
//Initialise the window frames first and than refresh text line array
initFramesAndTextArray();
}
@@ -241,14 +243,13 @@ void CTextBox::reSizeMainFrameWidth(int textWidth)
{
//TRACE("[CTextBox]->%s: \ntext width: %d\n m_cFrame.iWidth: %d\n m_cFrameTextRel.iWidth: %d\n m_nMaxWidth: %d\n m_nMinWidth: %d\n",__FUNCTION__, textWidth, m_cFrame.iWidth, m_cFrameTextRel.iWidth, m_nMaxWidth, m_nMinWidth);
- int iNewWindowWidth = textWidth + m_cFrameScrollRel.iWidth + 2*text_border_width;
+ int iNewWindowWidth = textWidth + m_cFrameScrollRel.iWidth + 2*text_Hborder_width;
if( iNewWindowWidth > m_nMaxWidth)
- iNewWindowWidth = m_nMaxWidth;
-
+ iNewWindowWidth = m_nMaxWidth;
+
if( iNewWindowWidth < m_nMinWidth)
iNewWindowWidth = m_nMinWidth;
-
m_cFrame.iWidth = iNewWindowWidth;
@@ -260,11 +261,11 @@ void CTextBox::reSizeMainFrameHeight(int textHeight)
{
//TRACE("[CTextBox]->ReSizeMainFrameHeight: %d, current: %d\r\n",textHeight,m_cFrameTextRel.iHeight);
- int iNewWindowHeight = textHeight + 2*text_border_width;
+ int iNewWindowHeight = textHeight + 2*text_Vborder_width;
if( iNewWindowHeight > m_nMaxHeight)
iNewWindowHeight = m_nMaxHeight;
-
+
if( iNewWindowHeight < m_nMinHeight)
iNewWindowHeight = m_nMinHeight;
@@ -299,7 +300,7 @@ void CTextBox::initFramesRel(void)
m_cFrameTextRel.iWidth = m_cFrame.iWidth - m_cFrameScrollRel.iWidth;
- m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_border_width)) / m_nFontTextHeight);
+ m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight);
#if 0
TRACE_1("Frames\r\n\tScren:\t%3d,%3d,%3d,%3d\r\n\tMain:\t%3d,%3d,%3d,%3d\r\n\tText:\t%3d,%3d,%3d,%3d \r\n\tScroll:\t%3d,%3d,%3d,%3d \r\n",
@@ -344,14 +345,14 @@ void CTextBox::refreshTextLineArray(void)
if( m_nMode & AUTO_WIDTH){
/* In case of autowidth, we calculate the max allowed width of the textbox */
- lineBreakWidth = m_nMaxWidth - m_cFrameScrollRel.iWidth - 2*text_border_width;
+ lineBreakWidth = m_nMaxWidth - m_cFrameScrollRel.iWidth - 2*text_Hborder_width;
}else{
/* If not autowidth, we just take the actuall textframe width */
- lineBreakWidth = std::max(m_nMaxWidth, m_cFrameTextRel.iWidth - 2*text_border_width);
+ lineBreakWidth = std::max(m_nMaxWidth, m_cFrameTextRel.iWidth - 2*text_Hborder_width);
}
-
+
if(m_nMaxTextWidth)
- lineBreakWidth = m_nMaxTextWidth - 2*text_border_width;
+ lineBreakWidth = m_nMaxTextWidth - 2*text_Hborder_width;
//TRACE("[CTextBox] line %d: lineBreakWidth %d\n", __LINE__, lineBreakWidth);
@@ -414,11 +415,11 @@ void CTextBox::refreshTextLineArray(void)
aktLine += aktWord;
//set current line width
aktWidth += aktWordWidth;
-
+
//set max text width, if required
if (aktWidth > m_nMaxTextWidth)
m_nMaxTextWidth = aktWidth;
-
+
//TRACE_1(" aktLine : %s\r\n",aktLine.c_str());
//TRACE_1(" aktWidth: %d aktWordWidth:%d\r\n",aktWidth,aktWordWidth);
@@ -443,7 +444,7 @@ void CTextBox::refreshTextLineArray(void)
/* check if we have to recalculate the window frame size, due to auto width and auto height */
if( m_nMode & AUTO_WIDTH)
{
- reSizeMainFrameWidth(m_nMaxTextWidth);
+ reSizeMainFrameWidth(m_nMaxTextWidth);
}
if(m_nMode & AUTO_HIGH)
@@ -451,7 +452,7 @@ void CTextBox::refreshTextLineArray(void)
reSizeMainFrameHeight(m_nNrOfLines * m_nFontTextHeight);
}
- m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_border_width)) / m_nFontTextHeight);
+ m_nLinesPerPage = std::max(1, (m_cFrameTextRel.iHeight - (2*text_Vborder_width)) / m_nFontTextHeight);
m_nNrOfPages = ((m_nNrOfLines-1) / m_nLinesPerPage) + 1;
if(m_nCurrentPage >= m_nNrOfPages)
@@ -477,7 +478,7 @@ void CTextBox::refreshScroll(void)
{
if(!(m_nMode & SCROLL))
return;
-
+
if( frameBuffer == NULL)
return;
@@ -514,42 +515,40 @@ void CTextBox::refreshText(void)
if (m_nPaintBackground)
frameBuffer->paintBoxRel(m_cFrameTextRel.iX+m_cFrame.iX, /*m_cFrameTextRel.iY+*/m_cFrame.iY,
m_cFrameTextRel.iWidth, m_cFrameTextRel.iHeight, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType);
-
+
if( m_nNrOfLines <= 0)
return;
-
- int y = m_cFrameTextRel.iY + text_border_width;
+ int y = m_cFrameTextRel.iY;
int i;
int x_center = 0;
// set text y position
if (m_nMode & TOP)
// move to top of frame
- y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * m_nLinesPerPage) >> 1) - text_border_width;
+ y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * m_nLinesPerPage) >> 1);
else if (m_nMode & BOTTOM)
// move to bottom of frame
- y += m_cFrameTextRel.iHeight - text_border_width - (m_nNrOfLines > 1 ? (m_nNrOfLines-1)*m_nFontTextHeight : 0) ;
- //m_nFontTextHeight + text_border_width /*- ((m_cFrameTextRel.iHeight + m_nFontTextHeight*/ * m_nLinesPerPage/*) >> 1)*/;
+ y += m_cFrameTextRel.iHeight - (m_nNrOfLines > 1 ? (m_nNrOfLines-1)*m_nFontTextHeight : 0) - text_Vborder_width;
+ //m_nFontTextHeight + text_Vborder_width /*- ((m_cFrameTextRel.iHeight + m_nFontTextHeight*/ * m_nLinesPerPage/*) >> 1)*/;
else
// fit into mid of frame space
- y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * std::min(m_nLinesPerPage, m_nNrOfLines)) >> 1) - text_border_width;
+ y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * std::min(m_nLinesPerPage, m_nNrOfLines)) >> 1);
for(i = m_nCurrentLine; i < m_nNrOfLines && i < m_nCurrentLine + m_nLinesPerPage; i++)
{
-
//calculate centered xpos
if( m_nMode & CENTER ){
- x_center = (m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i], true))>>1;
+ x_center = ((m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i], true))>>1) - text_Hborder_width;
}
else if ( m_nMode & RIGHT ){
- x_center = (m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i], true));
+ x_center = ((m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i], true)) - text_Hborder_width*2);
if ( m_nMode & SCROLL )
x_center -= SCROLL_FRAME_WIDTH;
}
-
+
//TRACE("[CTextBox] %s Line %d m_cFrame.iX %d m_cFrameTextRel.iX %d\r\n", __FUNCTION__, __LINE__, m_cFrame.iX, m_cFrameTextRel.iX);
- m_pcFontText->RenderString(m_cFrame.iX + m_cFrameTextRel.iX + text_border_width + x_center,
+ m_pcFontText->RenderString(m_cFrame.iX + m_cFrameTextRel.iX + text_Hborder_width + x_center,
y+m_cFrame.iY, m_cFrameTextRel.iWidth, m_cLineArray[i].c_str(),
m_textColor, 0, true); // UTF-8
y += m_nFontTextHeight;
@@ -562,7 +561,7 @@ void CTextBox::scrollPageDown(const int pages)
//TRACE("[CTextBox] %s Line %d\r\n", __FUNCTION__, __LINE__);
if( !(m_nMode & SCROLL))
return;
-
+
if( m_nNrOfLines <= 0)
return;
@@ -585,7 +584,7 @@ void CTextBox::scrollPageUp(const int pages)
//TRACE("[CTextBox] %s Line %d\r\n", __FUNCTION__, __LINE__);
if( !(m_nMode & SCROLL))
return;
-
+
if( m_nNrOfLines <= 0)
return;
@@ -663,10 +662,10 @@ void CTextBox::hide (void)
//TRACE("[CTextBox] %s Line %d\r\n", __FUNCTION__, __LINE__);
if(frameBuffer == NULL)
return;
-
+
if (m_nPaintBackground)
frameBuffer->paintBackgroundBoxRel(m_cFrame.iX, m_cFrame.iY, m_cFrame.iWidth, m_cFrame.iHeight);
frameBuffer->blit();
-
+
frameBuffer = NULL;
}
diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h
index 0fd0e08c6..210db2717 100644
--- a/src/gui/widget/textbox.h
+++ b/src/gui/widget/textbox.h
@@ -68,7 +68,11 @@
class CBox
{
- private:
+ protected:
+ int *pX;
+ int *pY;
+ int *pWidth;
+ int *pHeight;
public:
/* Constructor */
@@ -150,7 +154,8 @@ class CTextBox
CFrameBuffer * frameBuffer;
/* int max_width;*/
- int text_border_width;
+ int text_Hborder_width;
+ int text_Vborder_width;
bool m_FontUseDigitHeight;
public:
@@ -173,7 +178,7 @@ class CTextBox
bool setText(const std::string* newText, int max_width = 0);
void setTextColor(fb_pixel_t color_text){ m_textColor = color_text;};
void setBackGroundRadius(const int radius, const int type = CORNER_ALL){m_nBgRadius = radius; m_nBgRadiusType = type;};
- void setTextBorderWidth(int border);
+ void setTextBorderWidth(int Hborder, int Vborder);
void setTextFont(Font* font_text);
void setTextMode(const int text_mode){m_nMode = text_mode;};
void setBackGroundColor(CFBWindow::color_t textBackgroundColor){m_textBackgroundColor = textBackgroundColor;};
diff --git a/src/neutrino.cpp b/src/neutrino.cpp
index b06d0a15c..7980f54bb 100644
--- a/src/neutrino.cpp
+++ b/src/neutrino.cpp
@@ -53,6 +53,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -84,6 +85,7 @@
#include "gui/scan_setup.h"
#include "gui/sleeptimer.h"
#include "gui/start_wizard.h"
+#include "gui/update_ext.h"
#include "gui/videosettings.h"
#include "gui/widget/hintbox.h"
@@ -129,8 +131,8 @@ bool has_hdd;
CInfoClock *InfoClock;
int allow_flash = 1;
Zapit_config zapitCfg;
-char zapit_lat[20];
-char zapit_long[20];
+char zapit_lat[20]="#";
+char zapit_long[20]="#";
bool autoshift = false;
uint32_t scrambled_timer;
t_channel_id standby_channel_id;
@@ -180,6 +182,7 @@ CPictureViewer * g_PicViewer;
CCAMMenuHandler * g_CamHandler;
CVolume * g_volume;
CAudioMute * g_audioMute;
+CNeutrinoFonts * neutrinoFonts = NULL;
// Globale Variablen - to use import global.h
@@ -213,7 +216,7 @@ CNeutrinoApp::CNeutrinoApp()
#endif
SetupFrameBuffer();
- mode = mode_unknown;
+ mode = mode_unknown;
channelList = NULL;
TVchannelList = NULL;
RADIOchannelList = NULL;
@@ -223,7 +226,6 @@ CNeutrinoApp::CNeutrinoApp()
current_muted = 0;
recordingstatus = 0;
g_channel_list_changed = false;
- memset(&font, 0, sizeof(neutrino_font_descr_struct));
}
/*-------------------------------------------------------------------------------------
@@ -233,6 +235,9 @@ CNeutrinoApp::~CNeutrinoApp()
{
if (channelList)
delete channelList;
+ if (neutrinoFonts)
+ delete neutrinoFonts;
+ neutrinoFonts = NULL;
}
CNeutrinoApp* CNeutrinoApp::getInstance()
@@ -246,16 +251,6 @@ CNeutrinoApp* CNeutrinoApp::getInstance()
return neutrinoApp;
}
-
-#define FONT_STYLE_REGULAR 0
-#define FONT_STYLE_BOLD 1
-#define FONT_STYLE_ITALIC 2
-
-extern font_sizes_groups_struct font_sizes_groups[];
-extern font_sizes_struct neutrino_font[];
-
-const font_sizes_struct signal_font = {LOCALE_FONTSIZE_INFOBAR_SMALL , 14, FONT_STYLE_REGULAR, 1};
-
typedef struct lcd_setting_t
{
const char * const name;
@@ -401,6 +396,9 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.led_deep_mode = configfile.getInt32( "led_deep_mode", 3);
g_settings.led_rec_mode = configfile.getInt32( "led_rec_mode", 1);
g_settings.led_blink = configfile.getInt32( "led_blink", 1);
+ g_settings.backlight_tv = configfile.getInt32( "backlight_tv", 1);
+ g_settings.backlight_standby = configfile.getInt32( "backlight_standby", 0);
+ g_settings.backlight_deepstandby = configfile.getInt32( "backlight_deepstandby", 0);
g_settings.hdd_fs = configfile.getInt32( "hdd_fs", 0);
g_settings.hdd_sleep = configfile.getInt32( "hdd_sleep", 120);
@@ -443,6 +441,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.scrambled_message = configfile.getBool("scrambled_message", true );
g_settings.volume_pos = configfile.getInt32("volume_pos", CVolumeBar::VOLUMEBAR_POS_TOP_RIGHT );
g_settings.volume_digits = configfile.getBool("volume_digits", true);
+ g_settings.volume_size = configfile.getInt32("volume_size", 26 );
g_settings.menu_pos = configfile.getInt32("menu_pos", CMenuWidget::MENU_POS_CENTER);
g_settings.show_menu_hints = configfile.getBool("show_menu_hints", false);
g_settings.infobar_show_sysfs_hdd = configfile.getBool("infobar_show_sysfs_hdd" , true );
@@ -707,7 +706,9 @@ int CNeutrinoApp::loadSetup(const char * fname)
//Software-update
g_settings.softupdate_mode = configfile.getInt32( "softupdate_mode", 1 );
g_settings.apply_kernel = configfile.getBool("apply_kernel" , false);
- g_settings.apply_settings = configfile.getBool("apply_settings" , true);
+ g_settings.apply_settings = configfile.getBool("apply_settings" , false);
+ g_settings.softupdate_name_mode_apply = configfile.getInt32( "softupdate_name_mode_apply", CExtUpdate::SOFTUPDATE_NAME_DEFAULT);
+ g_settings.softupdate_name_mode_backup = configfile.getInt32( "softupdate_name_mode_backup", CExtUpdate::SOFTUPDATE_NAME_DEFAULT);
strcpy(g_settings.softupdate_url_file, configfile.getString("softupdate_url_file", "/var/etc/update.urls").c_str());
strcpy(g_settings.softupdate_proxyserver, configfile.getString("softupdate_proxyserver", "" ).c_str());
@@ -902,6 +903,9 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setInt32( "led_deep_mode", g_settings.led_deep_mode);
configfile.setInt32( "led_rec_mode", g_settings.led_rec_mode);
configfile.setInt32( "led_blink", g_settings.led_blink);
+ configfile.setInt32( "backlight_tv", g_settings.backlight_tv);
+ configfile.setInt32( "backlight_standby", g_settings.backlight_standby);
+ configfile.setInt32( "backlight_deepstandby", g_settings.backlight_deepstandby);
//misc
configfile.setInt32( "power_standby", g_settings.power_standby);
@@ -926,6 +930,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setBool("scrambled_message" , g_settings.scrambled_message );
configfile.setInt32("volume_pos" , g_settings.volume_pos );
configfile.setBool("volume_digits", g_settings.volume_digits);
+ configfile.setInt32("volume_size" , g_settings.volume_size);
configfile.setInt32("menu_pos" , g_settings.menu_pos);
configfile.setBool("show_menu_hints" , g_settings.show_menu_hints);
configfile.setInt32("infobar_show_sysfs_hdd" , g_settings.infobar_show_sysfs_hdd );
@@ -1142,6 +1147,8 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setBool("apply_kernel", g_settings.apply_kernel);
configfile.setBool("apply_settings", g_settings.apply_settings);
configfile.setString("softupdate_url_file" , g_settings.softupdate_url_file );
+ configfile.setInt32 ("softupdate_name_mode_apply", g_settings.softupdate_name_mode_apply);
+ configfile.setInt32 ("softupdate_name_mode_backup", g_settings.softupdate_name_mode_backup);
configfile.setString("softupdate_proxyserver" , g_settings.softupdate_proxyserver );
configfile.setString("softupdate_proxyusername" , g_settings.softupdate_proxyusername );
@@ -1511,8 +1518,6 @@ void CNeutrinoApp::CmdParser(int argc, char **argv)
softupdate = false;
//fromflash = false;
- font.name = NULL;
-
for(int x=1; xSetupNeutrinoFonts(((fmode & CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT_INST) == CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT_INST));
+ if ((fmode & CNeutrinoFonts::FONTSETUP_DYN_FONT) == CNeutrinoFonts::FONTSETUP_DYN_FONT) {
+ neutrinoFonts->SetupDynamicFonts(((fmode & CNeutrinoFonts::FONTSETUP_DYN_FONT_INST) == CNeutrinoFonts::FONTSETUP_DYN_FONT_INST));
+ neutrinoFonts->refreshDynFonts();
}
- else{
- font.filename = strdup(g_settings.font_file);
- }
- style[0] = g_fontRenderer->AddFont(font.filename);
- if(font.name != NULL)
- free((void *)font.name);
-
- font.name = strdup(g_fontRenderer->getFamily(font.filename).c_str());
-
- printf("[neutrino] font family %s\n", font.name);
-
- style[1] = "Bold Regular";
-
- g_fontRenderer->AddFont(font.filename, true); // make italics
- style[2] = "Italic";
-
- for (int i = 0; i < SNeutrinoSettings::FONT_TYPE_COUNT; i++)
- {
- if(g_Font[i]) delete g_Font[i];
- g_Font[i] = g_fontRenderer->getFont(font.name, style[neutrino_font[i].style], configfile.getInt32(locale_real_names[neutrino_font[i].name], neutrino_font[i].defaultsize) + neutrino_font[i].size_offset * font.size_offset);
- }
- g_SignalFont = g_fontRenderer->getFont(font.name, style[signal_font.style], signal_font.defaultsize + signal_font.size_offset * font.size_offset);
/* recalculate infobar position */
if (g_InfoViewer)
g_InfoViewer->start();
@@ -1721,7 +1691,7 @@ void CNeutrinoApp::InitTimerdClient()
void CNeutrinoApp::InitZapitClient()
{
g_Zapit = new CZapitClient;
-#define ZAPIT_EVENT_COUNT 27
+#define ZAPIT_EVENT_COUNT 28
const CZapitClient::events zapit_event[ZAPIT_EVENT_COUNT] =
{
CZapitClient::EVT_ZAP_COMPLETE,
@@ -1751,6 +1721,7 @@ void CNeutrinoApp::InitZapitClient()
CZapitClient::EVT_SDT_CHANGED,
CZapitClient::EVT_PMT_CHANGED,
CZapitClient::EVT_TUNE_COMPLETE,
+ CZapitClient::EVT_BACK_ZAP_COMPLETE
};
for (int i = 0; i < ZAPIT_EVENT_COUNT; i++)
@@ -1846,6 +1817,7 @@ fprintf(stderr, "[neutrino start] %d -> %5ld ms\n", __LINE__, time_monotonic_ms
}
fprintf(stderr, "[neutrino start] %d -> %5ld ms\n", __LINE__, time_monotonic_ms() - starttime);
/* setup GUI */
+ neutrinoFonts = CNeutrinoFonts::getInstance();
SetupFonts();
fprintf(stderr, "[neutrino start] %d -> %5ld ms\n", __LINE__, time_monotonic_ms() - starttime);
SetupTiming();
@@ -1857,10 +1829,11 @@ fprintf(stderr, "[neutrino start] %d -> %5ld ms\n", __LINE__, time_monotonic_ms
hintBox->paint();
fprintf(stderr, "[neutrino start] %d -> %5ld ms\n", __LINE__, time_monotonic_ms() - starttime);
- CVFD::getInstance()->init(font.filename, font.name);
+ CVFD::getInstance()->init(neutrinoFonts->fontDescr.filename.c_str(), neutrinoFonts->fontDescr.name.c_str());
CVFD::getInstance()->Clear();
CVFD::getInstance()->ShowText(g_Locale->getText(LOCALE_NEUTRINO_STARTING));
fprintf(stderr, "[neutrino start] %d -> %5ld ms\n", __LINE__, time_monotonic_ms() - starttime);
+ CVFD::getInstance()->setBacklight(g_settings.backlight_tv);
/* set service manager options before starting zapit */
CServiceManager::getInstance()->KeepNumbers(g_settings.keep_channel_numbers);
@@ -2453,7 +2426,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
return messages_return::handled;
}
}
- if ((msg == NeutrinoMessages::EVT_EIT_COMPLETE)) {
+ if ((msg == NeutrinoMessages::EVT_EIT_COMPLETE || msg == NeutrinoMessages::EVT_BACK_ZAP_COMPLETE)) {
CEpgScan::getInstance()->handleMsg(msg, data);
return messages_return::handled;
}
@@ -2690,15 +2663,15 @@ _repeat:
audioDecoder->EnableAnalogOut(false);
return messages_return::handled;
}
- else if( msg == CRCInput::RC_mode ) {
+ else if(( msg == CRCInput::RC_mode ) && g_settings.key_format_mode_active ) {
g_videoSettings->nextMode();
return messages_return::handled;
}
- else if( msg == CRCInput::RC_next ) {
+ else if(( msg == CRCInput::RC_next ) && g_settings.key_pic_size_active ) {
g_videoSettings->next43Mode();
return messages_return::handled;
}
- else if( msg == CRCInput::RC_prev ) {
+ else if(( msg == CRCInput::RC_prev ) && g_settings.key_pic_mode_active ) {
g_videoSettings->SwitchFormat();
return messages_return::handled;
}
@@ -3379,7 +3352,6 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
if(mode == mode_radio && g_Radiotext)
g_Radiotext->radiotext_stop();
-
#ifdef ENABLE_PIP
g_Zapit->stopPip();
#endif
@@ -3409,6 +3381,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
CVFD::getInstance()->Clear();
CVFD::getInstance()->setMode(CVFD::MODE_STANDBY);
}
+ CVFD::getInstance()->setBacklight(g_settings.backlight_standby);
if(g_settings.mode_clock) {
InfoClock->StopClock();
@@ -3461,6 +3434,9 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby )
if (my_system(NEUTRINO_LEAVE_STANDBY_SCRIPT) != 0)
perror(NEUTRINO_LEAVE_STANDBY_SCRIPT " failed");
+ CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO);
+ CVFD::getInstance()->setBacklight(g_settings.backlight_tv);
+
g_Zapit->setStandby(false);
/* the old code did:
if(was_record) g_Zapit->startPlayBack()
@@ -3658,6 +3634,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
delete g_Sectionsd;
delete g_RemoteControl;
delete g_fontRenderer;
+ delete g_dynFontRenderer;
delete hintBox;
@@ -3779,8 +3756,10 @@ void stop_daemons(bool stopall, bool for_flash)
delete &CMoviePlayerGui::getInstance();
CZapit::getInstance()->Stop();
printf("zapit shutdown done\n");
- if (!for_flash)
+ if (!for_flash) {
CVFD::getInstance()->Clear();
+ CVFD::getInstance()->setBacklight(g_settings.backlight_deepstandby);
+ }
if(stopall && !for_flash) {
if (cpuFreq) {
cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000);
@@ -3912,6 +3891,10 @@ void CNeutrinoApp::loadKeys(const char * fname)
g_settings.mpkey_plugin = tconfig.getInt32( "mpkey.plugin", CRCInput::RC_red );
g_settings.mpkey_subtitle = tconfig.getInt32( "mpkey.subtitle", CRCInput::RC_sub );
+ g_settings.key_format_mode_active = tconfig.getInt32( "key_format_mode_active", 1 );
+ g_settings.key_pic_mode_active = tconfig.getInt32( "key_pic_mode_active", 1 );
+ g_settings.key_pic_size_active = tconfig.getInt32( "key_pic_size_active", 1 );
+
/* options */
g_settings.menu_left_exit = tconfig.getInt32( "menu_left_exit", 0 );
g_settings.audio_run_player = tconfig.getInt32( "audio_run_player", 1 );
@@ -3976,6 +3959,10 @@ void CNeutrinoApp::saveKeys(const char * fname)
tconfig.setInt32( "mpkey.plugin", g_settings.mpkey_plugin );
tconfig.setInt32( "mpkey.subtitle", g_settings.mpkey_subtitle );
+ tconfig.setInt32( "key_format_mode_active", g_settings.key_format_mode_active );
+ tconfig.setInt32( "key_pic_mode_active", g_settings.key_pic_mode_active );
+ tconfig.setInt32( "key_pic_size_active", g_settings.key_pic_size_active );
+
tconfig.setInt32( "menu_left_exit", g_settings.menu_left_exit );
tconfig.setInt32( "audio_run_player", g_settings.audio_run_player );
tconfig.setInt32( "key_click", g_settings.key_click );
@@ -4139,6 +4126,7 @@ void CNeutrinoApp::Cleanup()
printf("cleanup 11\n");fflush(stdout);
delete g_fontRenderer; g_fontRenderer = NULL;
+ delete g_dynFontRenderer; g_dynFontRenderer = NULL;
printf("cleanup 12\n");fflush(stdout);
delete g_PicViewer; g_PicViewer = NULL;
printf("cleanup 13\n");fflush(stdout);
diff --git a/src/neutrino.h b/src/neutrino.h
index b79678e08..d93fd5d3e 100644
--- a/src/neutrino.h
+++ b/src/neutrino.h
@@ -37,6 +37,7 @@
#include
#include "driver/framebuffer.h"
+#include "driver/neutrinofonts.h"
#include "system/setting_helpers.h"
#include "system/configure_network.h"
#include "daemonc/remotecontrol.h" /* st_rmsg */
@@ -58,30 +59,6 @@
* *
**************************************************************************************/
-typedef struct neutrino_font_descr
-{
- const char * name;
- const char * filename;
- int size_offset;
-} neutrino_font_descr_struct;
-
-typedef struct font_sizes
-{
- const neutrino_locale_t name;
- const unsigned int defaultsize;
- const unsigned int style;
- const unsigned int size_offset;
-} font_sizes_struct;
-
-typedef struct font_sizes_groups
-{
- const neutrino_locale_t groupname;
- const unsigned int count;
- const SNeutrinoSettings::FONT_TYPES * const content;
- const char * const actionkey;
- const neutrino_locale_t hint;
-} font_sizes_groups_struct;
-
extern const unsigned char genre_sub_classes[]; /* epgview.cpp */
extern const neutrino_locale_t * genre_sub_classes_list[]; /* epgview.cpp */
@@ -108,8 +85,6 @@ private:
int network_dhcp;
int network_automatic_start;
- neutrino_font_descr_struct font;
-
int mode;
int lastMode;
bool softupdate;
@@ -179,7 +154,7 @@ public:
void loadKeys(const char * fname = NULL);
void saveKeys(const char * fname = NULL);
void SetupTiming();
- void SetupFonts();
+ void SetupFonts(int fmode = CNeutrinoFonts::FONTSETUP_ALL);
void setupRecordingDevice(void);
~CNeutrinoApp();
diff --git a/src/neutrinoMessages.h b/src/neutrinoMessages.h
index 50d703020..ce90d5b46 100644
--- a/src/neutrinoMessages.h
+++ b/src/neutrinoMessages.h
@@ -150,6 +150,7 @@ struct NeutrinoMessages {
EVT_RECORDING_ENDED = CRCInput::RC_WithData + 23,
/* sectionsd */
EVT_EIT_COMPLETE = CRCInput::RC_WithData + 24, /* data: (t_channel_id *) */
+ EVT_BACK_ZAP_COMPLETE = CRCInput::RC_WithData + 25, /* data: (t_channel_id *) */
};
enum
{
diff --git a/src/neutrino_menue.h b/src/neutrino_menue.h
index 712472094..2607c631e 100644
--- a/src/neutrino_menue.h
+++ b/src/neutrino_menue.h
@@ -88,6 +88,7 @@ enum MN_WIDGET_ID
MN_WIDGET_ID_VFDSETUP,
MN_WIDGET_ID_VFDSETUP_LCD_SLIDERS,
MN_WIDGET_ID_VFDSETUP_LED_SETUP,
+ MN_WIDGET_ID_VFDSETUP_BACKLIGHT,
//keybind setup
MN_WIDGET_ID_KEYSETUP,
@@ -96,6 +97,7 @@ enum MN_WIDGET_ID
MN_WIDGET_ID_KEYSETUP_KEYBINDING_CHANNELLIST,
MN_WIDGET_ID_KEYSETUP_KEYBINDING_QUICKZAP,
MN_WIDGET_ID_KEYSETUP_KEYBINDING_MOVIEPLAYER,
+ MN_WIDGET_ID_KEYSETUP_KEYBINDING_SPECIAL,
//picture viewer setup
MN_WIDGET_ID_PVIEWERSETUP,
diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp
index ff62a833d..efe10c28e 100644
--- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp
+++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp
@@ -625,14 +625,19 @@ void CControlAPI::HWInfoCGI(CyhookHandler *hh)
boxname += "BSE";
break;
case 8:
- case 9:
boxname += "Neo";
if (CFEManager::getInstance()->getFrontendCount() > 1)
boxname += " Twin";
break;
+ case 9:
+ boxname += "Tank";
+ break;
case 10:
boxname += "Zee";
break;
+ case 11:
+ boxname += "Trinity";
+ break;
default:
char buffer[10];
@@ -1741,7 +1746,8 @@ void CControlAPI::SendAllCurrentVAPid(CyhookHandler *hh)
hh->printf("%05u vtxt\n",pids.PIDs.vtxtpid);
if (pids.PIDs.pmtpid)
hh->printf("%05u pmt\n",pids.PIDs.pmtpid);
-
+ if (pids.PIDs.pcrpid)
+ hh->printf("%05u pcr\n",pids.PIDs.pcrpid);
}
//-----------------------------------------------------------------------------
void CControlAPI::SendTimers(CyhookHandler *hh)
@@ -2071,9 +2077,17 @@ void CControlAPI::YWeb_SendVideoStreamingPids(CyhookHandler *hh, int apid_no)
if(!pids.APIDs.empty())
apid = pids.APIDs[apid_idx].pid;
if(hh->ParamList["no_commas"] != "")
+ {
hh->printf("0x%04x 0x%04x 0x%04x",pids.PIDs.pmtpid,pids.PIDs.vpid,apid);
+ if (pids.PIDs.pcrpid != pids.PIDs.vpid)
+ hh->printf(" 0x%04x", pids.PIDs.pcrpid);
+ }
else
+ {
hh->printf("0x%04x,0x%04x,0x%04x",pids.PIDs.pmtpid,pids.PIDs.vpid,apid);
+ if (pids.PIDs.pcrpid != pids.PIDs.vpid)
+ hh->printf(",0x%04x", pids.PIDs.pcrpid);
+ }
}
//-----------------------------------------------------------------------------
@@ -2547,6 +2561,8 @@ void CControlAPI::build_live_url(CyhookHandler *hh)
if(!pids.APIDs.empty())
apid = pids.APIDs[apid_idx].pid;
xpids = string_printf("0x%04x,0x%04x,0x%04x",pids.PIDs.pmtpid,pids.PIDs.vpid,apid);
+ if (pids.PIDs.pcrpid != pids.PIDs.vpid)
+ xpids += string_printf(",0x%04x", pids.PIDs.pcrpid);
}
else if ( mode == CZapitClient::MODE_RADIO)
{
diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp
index a3489f34a..8824c9342 100644
--- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp
+++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp
@@ -520,6 +520,7 @@ std::string CNeutrinoYParser::func_get_mode(CyhookHandler *, std::string)
//-------------------------------------------------------------------------
std::string CNeutrinoYParser::func_get_video_pids(CyhookHandler *, std::string para)
{
+ std::string yresult;
CZapitClient::responseGetPIDs pids;
int apid=0,apid_no=0,apid_idx=0;
pids.PIDs.vpid=0;
@@ -532,7 +533,10 @@ std::string CNeutrinoYParser::func_get_video_pids(CyhookHandler *, std::string
apid_idx=apid_no;
if(!pids.APIDs.empty())
apid = pids.APIDs[apid_idx].pid;
- return string_printf("0x%04x,0x%04x,0x%04x",pids.PIDs.pmtpid,pids.PIDs.vpid,apid);
+ yresult = string_printf("0x%04x,0x%04x,0x%04x", pids.PIDs.pmtpid, pids.PIDs.vpid, apid);
+ if (pids.PIDs.pcrpid != pids.PIDs.vpid)
+ yresult += string_printf(",0x%04x", pids.PIDs.pcrpid);
+ return yresult;
}
//-------------------------------------------------------------------------
// y-func : get_radio_pids (returns: 0x0000)
@@ -703,14 +707,19 @@ std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string)
boxname += "BSE";
break;
case 8:
- case 9:
boxname += "Neo";
if (CFEManager::getInstance()->getFrontendCount() > 1)
boxname += " Twin";
break;
+ case 9:
+ boxname += "Tank";
+ break;
case 10:
boxname += "Zee";
break;
+ case 11:
+ boxname += "Trinity";
+ break;
default:
char buffer[10];
@@ -738,6 +747,7 @@ std::string CNeutrinoYParser::func_get_current_stream_info(CyhookHandler *hh, s
hh->ParamList["apid"] = itoh(serviceinfo.apid);
hh->ParamList["vtxtpid"] = (serviceinfo.vtxtpid != 0)?itoh(serviceinfo.vtxtpid):"not available";
hh->ParamList["pmtpid"] = (serviceinfo.pmtpid != 0)?itoh(serviceinfo.pmtpid):"not available";
+ hh->ParamList["pcrpid"] = (serviceinfo.pcrpid != 0)?itoh(serviceinfo.pcrpid):"not available";
hh->ParamList["tsfrequency"] = string_printf("%d.%d MHz", serviceinfo.tsfrequency/1000, serviceinfo.tsfrequency%1000);
hh->ParamList["polarisation"] = serviceinfo.polarisation==1?"h":"v";
hh->ParamList["ServiceName"] = NeutrinoAPI->GetServiceName(CZapit::getInstance()->GetCurrentChannelID());
diff --git a/src/nhttpd/web/Y_Blocks.txt b/src/nhttpd/web/Y_Blocks.txt
index 18ad726df..8dab68a26 100644
--- a/src/nhttpd/web/Y_Blocks.txt
+++ b/src/nhttpd/web/Y_Blocks.txt
@@ -411,7 +411,7 @@ end-block~page_frame_rest
start-block~frame_secondary
{=include-block:Y_Blocks.txt;frame_iso_head=}
-
+
@@ -508,9 +508,11 @@ start-block~remote
{=if-equal:{=var-get:boxtype=}~CST Zee CABLE~ {=include-block:Y_Blocks.txt;rc_cst_v3=}~
{=if-equal:{=var-get:boxtype=}~CST Neo Twin SAT~ {=include-block:Y_Blocks.txt;rc_cst_v4=}~
{=if-equal:{=var-get:boxtype=}~CST Neo Twin CABLE~ {=include-block:Y_Blocks.txt;rc_cst_v4=}~
+ {=if-equal:{=var-get:boxtype=}~CST Tank SAT~ {=include-block:Y_Blocks.txt;rc_cst_v5=}~
+ {=if-equal:{=var-get:boxtype=}~CST Tank CABLE~ {=include-block:Y_Blocks.txt;rc_cst_v5=}~
{=comment:fallback~=} {=include-block:Y_Blocks.txt;rc_cst_v1=}
- =}=}=}=}=}=}
+ =}=}=}=}=}=}=}=}
=}=}
~
{=if-equal:{=var-get:yfbtype=}~-2~ {=include-block:Y_Blocks.txt;rc_dbox_philips=}~
@@ -519,9 +521,10 @@ start-block~remote
{=if-equal:{=var-get:yfbtype=}~2~ {=include-block:Y_Blocks.txt;rc_cst_v2=}~
{=if-equal:{=var-get:yfbtype=}~3~ {=include-block:Y_Blocks.txt;rc_cst_v3=}~
{=if-equal:{=var-get:yfbtype=}~4~ {=include-block:Y_Blocks.txt;rc_cst_v4=}~
+ {=if-equal:{=var-get:yfbtype=}~5~ {=include-block:Y_Blocks.txt;rc_cst_v5=}~
{=comment:fallback~=} {=include-block:Y_Blocks.txt;rc_cst_v1=}
- =}=}=}=}=}=}
+ =}=}=}=}=}=}=}
=}
end-block~remote
@@ -723,6 +726,69 @@ start-block~map_rc_cst_v3_v4
end-block~map_rc_cst_v3_v4
+# ------- Remote CST V5 (TANK)
+start-block~rc_cst_v5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+end-block~rc_cst_v5
+
# ------- Remote d-Box Nokia old
start-block~rc_dbox_nokia_old
diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css
index 1d3a39aa8..a2283ebe7 100644
--- a/src/nhttpd/web/Y_Main.css
+++ b/src/nhttpd/web/Y_Main.css
@@ -551,8 +551,8 @@ tr {
}
.y_text_boxcontrol_table {
width:114px;
- height: 22px;
- background: url('/images/audiobar.gif') no-repeat 1px 0px;
+ height: 23px;
+ background: url('/images/audiobar.gif') no-repeat 1px 1px;
padding: 1px;
margin-top: 10px;
border: #FF8e42 solid 1px;
diff --git a/src/nhttpd/web/Y_Settings_yWeb.yhtm b/src/nhttpd/web/Y_Settings_yWeb.yhtm
index 0be09d97a..17a0991e8 100644
--- a/src/nhttpd/web/Y_Settings_yWeb.yhtm
+++ b/src/nhttpd/web/Y_Settings_yWeb.yhtm
@@ -18,7 +18,8 @@ function do_init(){
case "1": // cst hd1/bse
case "2": // cst neo
case "3": // cst zee/neo2
- case "4": // cst neo twin (todo!)
+ case "4": // cst neo twin
+ case "5": // cst tank
sel=(sel*1+val*1);
break;
default:
@@ -95,6 +96,7 @@ function do_init(){
CST HD-1plus | Neo
CST HD-1plus | Zee/Neo2
CST HD-1plus | Neo Twin
+ CST HD-2 | Tank
diff --git a/src/nhttpd/web/Y_StreamInfo.yhtm b/src/nhttpd/web/Y_StreamInfo.yhtm
index d554b0417..944651899 100644
--- a/src/nhttpd/web/Y_StreamInfo.yhtm
+++ b/src/nhttpd/web/Y_StreamInfo.yhtm
@@ -79,6 +79,16 @@
{=vpid=}
+
+ {=L:epg.si.pcrpid=}:
+
+ {=pcrpid=}
+
+
+ {=L:epg.si.pmtpid=}:
+
+ {=pmtpid=}
+
{=L:epg.si.apid=}:
diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt
index 31639c62c..173750aaa 100644
--- a/src/nhttpd/web/Y_Version.txt
+++ b/src/nhttpd/web/Y_Version.txt
@@ -1,4 +1,4 @@
-version=2.8.0.39
-date=05.07.2013
+version=2.8.0.44
+date=09.08.2013
type=Release
info=Port CST
diff --git a/src/nhttpd/web/images/Makefile.am b/src/nhttpd/web/images/Makefile.am
index 99ad6eaab..0b4d21667 100644
--- a/src/nhttpd/web/images/Makefile.am
+++ b/src/nhttpd/web/images/Makefile.am
@@ -68,6 +68,7 @@ install_DATA = accept.png \
rc_cst_v2.jpg \
rc_cst_v3.jpg \
rc_cst_v4.jpg \
+ rc_cst_v5.jpg \
rc_dbox_nokia_old.jpg \
rc_dbox_philips.jpg \
record.gif \
diff --git a/src/nhttpd/web/images/rc_cst_v5.jpg b/src/nhttpd/web/images/rc_cst_v5.jpg
new file mode 100644
index 000000000..5c4997ec1
Binary files /dev/null and b/src/nhttpd/web/images/rc_cst_v5.jpg differ
diff --git a/src/nhttpd/web/languages/Deutsch b/src/nhttpd/web/languages/Deutsch
index f17d79614..dd6d71641 100644
--- a/src/nhttpd/web/languages/Deutsch
+++ b/src/nhttpd/web/languages/Deutsch
@@ -196,6 +196,8 @@ epg.si.onid=Original Network ID
epg.si.sid=Service ID
epg.si.tsid=Transponder Stream ID
epg.si.vpid=Video PID
+epg.si.pmtpid=Program Map Table PID
+epg.si.pcrpid=Program Clock Reference PID
epg.si.apid=Audio PID
epg.si.vtxtpid=Teletext PID
epg.si.crypt=Crypt Systeme
diff --git a/src/nhttpd/web/languages/English b/src/nhttpd/web/languages/English
index d9ae7c8d2..c5ff7241a 100644
--- a/src/nhttpd/web/languages/English
+++ b/src/nhttpd/web/languages/English
@@ -199,6 +199,8 @@ epg.si.onid=Original Network ID
epg.si.sid=Service ID
epg.si.tsid=Transponder Stream ID
epg.si.vpid=Video PID
+epg.si.pmtpid=Program Map Table PID
+epg.si.pcrpid=Program Clock Reference PID
epg.si.apid=Audio PID
epg.si.vtxtpid=Teletext PID
epg.si.crypt=Crypt systems
diff --git a/src/nhttpd/web/languages/Slovak b/src/nhttpd/web/languages/Slovak
index 501032626..0625c854e 100644
--- a/src/nhttpd/web/languages/Slovak
+++ b/src/nhttpd/web/languages/Slovak
@@ -1,6 +1,6 @@
# yWeb language file (Slovensky) by EnoSat
# language version: 1.1
-# $Date: 2013-04-30 22:22:22 +0100 (Ut, 30 Apríla 2013) $
+# $Date: 2013-08-03 20:20:20 +0100 (so, 3 Augusta 2013) $
# $Revision: 212 $
#========= Hlavné / Celkové nastavenie
global.no_iframes=Váš prehliadač nepodporuje I-rámce.
@@ -53,6 +53,9 @@ attention=Upozornenie!
directory=Adresár
filename=Názov súboru
restriced_by_management_ip=obmedzené Manažmentom-IP
+automatic=automaticky
+show=ukázať
+hide=skryť
#======== Hlavná ponuka
main.boxcontrol=Ovládanie zariadenia
@@ -301,6 +304,7 @@ set.nhttpd.active_after_boot=aktívne po nabootovaní
set.nhttpd.port=Vydávateľ
set.nhttpd.threading=Prepojené
set.nhttpd.alternate_web_folder=Alternatívny web-adresár
+set.nhttpd.hosted_folder=Pripojené adresáre
set.nhttpd.allowed_file_extensions=Povolené prípony súboru / MIME
set.nhttpd.allow_all_file_extensions=Povoliť všetky prípony súboru
set.nhttpd.url_of_logos_desc=Vloženie adresára s logami staníc
@@ -502,6 +506,7 @@ live.timer_edit.apids.default=Prednastavené
live.timer_edit.apids.standard=Štandartné
live.timer_edit.apids.alt=Alternativné
live.timer_edit.apids.ac3=AC3
+live.timer_edit.apids=A-pidy
live.timer_edit.standby=Režim spánku
live.timer_edit.plugin=Doplnok
live.timer_edit.rec_dir=Adresár nahrávania
@@ -520,7 +525,7 @@ live.timer-sync.timer_preview=Prehľadový zoznam časovača
live.timer-sync.start_time=Čas začiatku
live.timer-sync.end_time=Čas konca
live.timer-sync.channel=Kanál
-live.timer-sync.programm=Program
+live.timer-sync.programm=Relácia
live.timer-sync.source=Zdroj
live.timer-sync.set_timer=nastav časovač
live.timer-sync.clear_log=vyčisti log
@@ -534,3 +539,54 @@ info.About=O programe
info.check_for_updates=Kontrola aktualizácie
info.your_version=Vaša inštalovaná verzia
info.actual_version=Aktuálna verzia
+
+========= Dialkové ovládanie
+rc.key_power=Spánok
+rc.key_mute=Umlčanie
+rc.key_1=1
+rc.key_2=2
+rc.key_3=3
+rc.key_4=4
+rc.key_5=5
+rc.key_6=6
+rc.key_7=7
+rc.key_8=8
+rc.key_9=9
+rc.key_0=0
+rc.key_text=TXT
+rc.key_favorites=Obľúbené
+rc.key_volumeup=Hlas+
+rc.key_volumedown=Hlas-
+rc.key_pageup=Strana+
+rc.key_pagedown=Strana-
+rc.key_mode=TV/Radio
+rc.key_next=Preskočiť-
+rc.key_previous=Preskočiť+
+rc.key_sleep=Uspať
+rc.key_audio=Zvuk
+rc.key_help=Pomoc
+rc.key_red=Červený
+rc.key_green=Zelený
+rc.key_yellow=Žltý
+rc.key_blue=Modrý
+rc.key_epg=EPG
+rc.key_info=Info
+rc.key_ok=OK
+rc.key_up=Nahor
+rc.key_down=Nadol
+rc.key_left=Vľavo
+rc.key_right=Vpravo
+rc.key_setup=Ponuka
+rc.key_home=Ukončiť
+rc.key_sat=Družica
+rc.key_www=
+rc.key_rewind=Vpred
+rc.key_play=Prehrať
+rc.key_forward=Vzad
+rc.key_stop=Zastaviť
+rc.key_record=Nahrať
+rc.key_pause=Pozastaviť
+rc.key_games=
+rc.key_time=
+rc.key_picsize=Veľkosť obrazu
+rc.key_picmode=Režim obrazu
diff --git a/src/system/flashtool.cpp b/src/system/flashtool.cpp
index f79227351..631358231 100644
--- a/src/system/flashtool.cpp
+++ b/src/system/flashtool.cpp
@@ -179,7 +179,25 @@ bool CFlashTool::program( const std::string & filename, int globalProgressEndEra
strncpy(buf1, filename.c_str(), sizeof(buf1)-1);
char* dn = dirname(buf1);
std::string flashfile;
+
+ bool skipCopy = false;
+#ifdef BOXMODEL_APOLLO
if (strcmp(dn, "/tmp") != 0) {
+ long btotal = 0, bused = 0, bsize = 0;
+ if (get_fs_usage("/tmp", btotal, bused, &bsize)) {
+ int fileSize = file_size(filename.c_str()) / 1024;
+ int backupMaxSize = (int)((btotal - bused) * bsize);
+ int res = 10; // Reserved 10% of available space
+ backupMaxSize = (backupMaxSize - ((backupMaxSize * res) / 100)) / 1024;
+ if (backupMaxSize < fileSize)
+ skipCopy = true;
+ }
+ else
+ skipCopy = true;
+ }
+#endif
+
+ if ((strcmp(dn, "/tmp") != 0) && !skipCopy) {
memset(buf1, 0, sizeof(buf1));
strncpy(buf1, filename.c_str(), sizeof(buf1)-1);
flashfile = (std::string)"/tmp/" + basename(buf1);
@@ -196,8 +214,10 @@ bool CFlashTool::program( const std::string & filename, int globalProgressEndEra
flashfile = filename;
// Unmount all NFS & CIFS volumes
- nfs_mounted_once = false;
- CFSMounter::umount();
+ if (!skipCopy) {
+ nfs_mounted_once = false;
+ CFSMounter::umount();
+ }
if( (fd1 = open( flashfile.c_str(), O_RDONLY )) < 0 ) {
ErrorMessage = g_Locale->getText(LOCALE_FLASHUPDATE_CANTOPENFILE);
diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp
index 741d9bfb3..0c936efc5 100644
--- a/src/system/helpers.cpp
+++ b/src/system/helpers.cpp
@@ -284,17 +284,17 @@ bool get_mem_usage(unsigned long &kbtotal, unsigned long &kbfree)
return true;
}
-std::string getPathName(std::string &path)
+std::string _getPathName(std::string &path, std::string sep)
{
- size_t pos = path.find_last_of("/");
+ size_t pos = path.find_last_of(sep);
if (pos == std::string::npos)
return path;
return path.substr(0, pos);
}
-std::string getBaseName(std::string &path)
+std::string _getBaseName(std::string &path, std::string sep)
{
- size_t pos = path.find_last_of("/");
+ size_t pos = path.find_last_of(sep);
if (pos == std::string::npos)
return path;
if (path.length() == pos +1)
@@ -302,6 +302,36 @@ std::string getBaseName(std::string &path)
return path.substr(pos+1);
}
+std::string getPathName(std::string &path)
+{
+ return _getPathName(path, "/");
+}
+
+std::string getBaseName(std::string &path)
+{
+ return _getBaseName(path, "/");
+}
+
+std::string getFileName(std::string &file)
+{
+ return _getPathName(file, ".");
+}
+
+std::string getFileExt(std::string &file)
+{
+ return _getBaseName(file, ".");
+}
+
+
+std::string getNowTimeStr(const char* format)
+{
+ char tmpStr[256];
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ strftime(tmpStr, sizeof(tmpStr), format, localtime(&tv.tv_sec));
+ return (std::string)tmpStr;
+}
+
std::string trim(std::string &str, const std::string &trimChars /*= " \n\r\t"*/)
{
std::string result = str.erase(str.find_last_not_of(trimChars) + 1);
diff --git a/src/system/helpers.h b/src/system/helpers.h
index 70db9525b..bab8204eb 100644
--- a/src/system/helpers.h
+++ b/src/system/helpers.h
@@ -38,6 +38,9 @@ bool get_mem_usage(unsigned long &total, unsigned long &free);
std::string getPathName(std::string &path);
std::string getBaseName(std::string &path);
+std::string getFileName(std::string &file);
+std::string getFileExt(std::string &file);
+std::string getNowTimeStr(const char* format);
std::string trim(std::string &str, const std::string &trimChars = " \n\r\t");
class CFileHelpers
diff --git a/src/system/localize.h b/src/system/localize.h
index 6717490f5..ad8bedb81 100644
--- a/src/system/localize.h
+++ b/src/system/localize.h
@@ -34,7 +34,7 @@
#define __locale__
#include
-#include_next
+#include
#include
#include
#include
diff --git a/src/system/locals.h b/src/system/locals.h
index 6137d73fd..6f273bd2a 100644
--- a/src/system/locals.h
+++ b/src/system/locals.h
@@ -395,8 +395,11 @@ typedef enum
LOCALE_EXTRA_FEC_S2_QPSK_8_9,
LOCALE_EXTRA_FEC_S2_QPSK_9_10,
LOCALE_EXTRA_KEY_CURRENT_TRANSPONDER,
+ LOCALE_EXTRA_KEY_FORMAT_MODE,
LOCALE_EXTRA_KEY_LIST_END,
LOCALE_EXTRA_KEY_LIST_START,
+ LOCALE_EXTRA_KEY_PIC_MODE,
+ LOCALE_EXTRA_KEY_PIC_SIZE,
LOCALE_EXTRA_KEY_PIP_CLOSE,
LOCALE_EXTRA_KEY_PIP_SETUP,
LOCALE_EXTRA_KEY_PIP_SWAP,
@@ -444,6 +447,7 @@ typedef enum
LOCALE_EXTRA_USE_GOTOXX,
LOCALE_EXTRA_VOLUME_DIGITS,
LOCALE_EXTRA_VOLUME_POS,
+ LOCALE_EXTRA_VOLUME_SIZE,
LOCALE_EXTRA_WEST,
LOCALE_EXTRA_ZAP_CYCLE,
LOCALE_EXTRA_ZAPIT_FE_TIMEOUT,
@@ -512,6 +516,13 @@ typedef enum
LOCALE_FLASHUPDATE_MSGBOX,
LOCALE_FLASHUPDATE_MSGBOX_MANUAL,
LOCALE_FLASHUPDATE_MTDSELECTOR,
+ LOCALE_FLASHUPDATE_NAMEMODE1,
+ LOCALE_FLASHUPDATE_NAMEMODE1_DEFAULT,
+ LOCALE_FLASHUPDATE_NAMEMODE1_HOSTNAME_TIME,
+ LOCALE_FLASHUPDATE_NAMEMODE1_ORGNAME_TIME,
+ LOCALE_FLASHUPDATE_NAMEMODE2,
+ LOCALE_FLASHUPDATE_NAMEMODE2_DEFAULT,
+ LOCALE_FLASHUPDATE_NAMEMODE2_HOSTNAME_TIME,
LOCALE_FLASHUPDATE_NEW_FOUND,
LOCALE_FLASHUPDATE_NEW_NOTFOUND,
LOCALE_FLASHUPDATE_PROGRAMMINGFLASH,
@@ -525,6 +536,9 @@ typedef enum
LOCALE_FLASHUPDATE_PROXYUSERNAME,
LOCALE_FLASHUPDATE_PROXYUSERNAME_HINT1,
LOCALE_FLASHUPDATE_PROXYUSERNAME_HINT2,
+ LOCALE_FLASHUPDATE_READ_DIRECTORY_NOT_EXIST,
+ LOCALE_FLASHUPDATE_READ_NO_AVAILABLE_SPACE,
+ LOCALE_FLASHUPDATE_READ_VOLUME_ERROR,
LOCALE_FLASHUPDATE_READFLASH,
LOCALE_FLASHUPDATE_READFLASHMTD,
LOCALE_FLASHUPDATE_READY,
@@ -681,6 +695,7 @@ typedef enum
LOCALE_KEYBINDINGMENU_REPEATBLOCK,
LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC,
LOCALE_KEYBINDINGMENU_SORT,
+ LOCALE_KEYBINDINGMENU_SPECIAL_ACTIVE,
LOCALE_KEYBINDINGMENU_SUBCHANNELDOWN,
LOCALE_KEYBINDINGMENU_SUBCHANNELUP,
LOCALE_KEYBINDINGMENU_TVRADIOMODE,
@@ -708,6 +723,8 @@ typedef enum
LOCALE_LCDMENU_STATUSLINE_BOTH,
LOCALE_LCDMENU_STATUSLINE_PLAYTIME,
LOCALE_LCDMENU_STATUSLINE_VOLUME,
+ LOCALE_LEDCONTROLER_BACKLIGHT,
+ LOCALE_LEDCONTROLER_BACKLIGHT_TV,
LOCALE_LEDCONTROLER_BLINK,
LOCALE_LEDCONTROLER_MENU,
LOCALE_LEDCONTROLER_MODE_DEEPSTANDBY,
@@ -779,6 +796,7 @@ typedef enum
LOCALE_MENU_HINT_AUTO_LANG,
LOCALE_MENU_HINT_AUTO_SUBS,
LOCALE_MENU_HINT_BACK,
+ LOCALE_MENU_HINT_BACKLIGHT,
LOCALE_MENU_HINT_BACKUP,
LOCALE_MENU_HINT_BEDIT,
LOCALE_MENU_HINT_BIGWINDOWS,
@@ -871,6 +889,7 @@ typedef enum
LOCALE_MENU_HINT_KEY_CHANNELDOWN,
LOCALE_MENU_HINT_KEY_CHANNELLIST,
LOCALE_MENU_HINT_KEY_CHANNELUP,
+ LOCALE_MENU_HINT_KEY_FORMAT_MODE_ACTIVE,
LOCALE_MENU_HINT_KEY_HARDWARE,
LOCALE_MENU_HINT_KEY_HISTORY,
LOCALE_MENU_HINT_KEY_LASTCHANNEL,
@@ -893,6 +912,8 @@ typedef enum
LOCALE_MENU_HINT_KEY_MPTIMESHIFT,
LOCALE_MENU_HINT_KEY_PAGEDOWN,
LOCALE_MENU_HINT_KEY_PAGEUP,
+ LOCALE_MENU_HINT_KEY_PIC_MODE_ACTIVE,
+ LOCALE_MENU_HINT_KEY_PIC_SIZE_ACTIVE,
LOCALE_MENU_HINT_KEY_PIP_CLOSE,
LOCALE_MENU_HINT_KEY_PIP_SETUP,
LOCALE_MENU_HINT_KEY_PIP_SWAP,
@@ -904,6 +925,7 @@ typedef enum
LOCALE_MENU_HINT_KEY_SAVE,
LOCALE_MENU_HINT_KEY_SCREENSHOT,
LOCALE_MENU_HINT_KEY_SORT,
+ LOCALE_MENU_HINT_KEY_SPECIAL_ACTIVE,
LOCALE_MENU_HINT_KEY_SUBCHANNELDOWN,
LOCALE_MENU_HINT_KEY_SUBCHANNELUP,
LOCALE_MENU_HINT_KEY_TRANSPONDER,
@@ -1149,6 +1171,7 @@ typedef enum
LOCALE_MENU_HINT_VOLUME,
LOCALE_MENU_HINT_VOLUME_DIGITS,
LOCALE_MENU_HINT_VOLUME_POS,
+ LOCALE_MENU_HINT_VOLUME_SIZE,
LOCALE_MENU_HINT_YTPLAY,
LOCALE_MENU_HINT_ZAP_CYCLE,
LOCALE_MENU_NEXT,
@@ -1243,6 +1266,7 @@ typedef enum
LOCALE_MOTORCONTROL_MOTOR_POS,
LOCALE_MOTORCONTROL_MOVEMENT,
LOCALE_MOTORCONTROL_MSEC,
+ LOCALE_MOTORCONTROL_NETWORK,
LOCALE_MOTORCONTROL_NO_MODE,
LOCALE_MOTORCONTROL_NOTDEF,
LOCALE_MOTORCONTROL_OVERRIDE,
diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h
index 3cfb6d9d4..c8b4d5125 100644
--- a/src/system/locals_intern.h
+++ b/src/system/locals_intern.h
@@ -395,8 +395,11 @@ const char * locale_real_names[] =
"extra.fec_s2_qpsk_8_9",
"extra.fec_s2_qpsk_9_10",
"extra.key_current_transponder",
+ "extra.key_format_mode",
"extra.key_list_end",
"extra.key_list_start",
+ "extra.key_pic_mode",
+ "extra.key_pic_size",
"extra.key_pip_close",
"extra.key_pip_setup",
"extra.key_pip_swap",
@@ -444,6 +447,7 @@ const char * locale_real_names[] =
"extra.use_gotoxx",
"extra.volume_digits",
"extra.volume_pos",
+ "extra.volume_size",
"extra.west",
"extra.zap_cycle",
"extra.zapit_fe_timeout",
@@ -512,6 +516,13 @@ const char * locale_real_names[] =
"flashupdate.msgbox",
"flashupdate.msgbox_manual",
"flashupdate.mtdselector",
+ "flashupdate.namemode1",
+ "flashupdate.namemode1_default",
+ "flashupdate.namemode1_hostname_time",
+ "flashupdate.namemode1_orgname_time",
+ "flashupdate.namemode2",
+ "flashupdate.namemode2_default",
+ "flashupdate.namemode2_hostname_time",
"flashupdate.new_found",
"flashupdate.new_notfound",
"flashupdate.programmingflash",
@@ -525,6 +536,9 @@ const char * locale_real_names[] =
"flashupdate.proxyusername",
"flashupdate.proxyusername_hint1",
"flashupdate.proxyusername_hint2",
+ "flashupdate.read_directory_not_exist",
+ "flashupdate.read_no_available_space",
+ "flashupdate.read_volume_error",
"flashupdate.readflash",
"flashupdate.readflashmtd",
"flashupdate.ready",
@@ -681,6 +695,7 @@ const char * locale_real_names[] =
"keybindingmenu.repeatblock",
"keybindingmenu.repeatblockgeneric",
"keybindingmenu.sort",
+ "keybindingmenu.special_active",
"keybindingmenu.subchanneldown",
"keybindingmenu.subchannelup",
"keybindingmenu.tvradiomode",
@@ -708,6 +723,8 @@ const char * locale_real_names[] =
"lcdmenu.statusline.both",
"lcdmenu.statusline.playtime",
"lcdmenu.statusline.volume",
+ "ledcontroler.backlight",
+ "ledcontroler.backlight.tv",
"ledcontroler.blink",
"ledcontroler.menu",
"ledcontroler.mode.deepstandby",
@@ -779,6 +796,7 @@ const char * locale_real_names[] =
"menu.hint_auto_lang",
"menu.hint_auto_subs",
"menu.hint_back",
+ "menu.hint_backlight",
"menu.hint_backup",
"menu.hint_bedit",
"menu.hint_bigwindows",
@@ -871,6 +889,7 @@ const char * locale_real_names[] =
"menu.hint_key_channeldown",
"menu.hint_key_channellist",
"menu.hint_key_channelup",
+ "menu.hint_key_format_mode_active",
"menu.hint_key_hardware",
"menu.hint_key_history",
"menu.hint_key_lastchannel",
@@ -893,6 +912,8 @@ const char * locale_real_names[] =
"menu.hint_key_mptimeshift",
"menu.hint_key_pagedown",
"menu.hint_key_pageup",
+ "menu.hint_key_pic_mode_active",
+ "menu.hint_key_pic_size_active",
"menu.hint_key_pip_close",
"menu.hint_key_pip_setup",
"menu.hint_key_pip_swap",
@@ -904,6 +925,7 @@ const char * locale_real_names[] =
"menu.hint_key_save",
"menu.hint_key_screenshot",
"menu.hint_key_sort",
+ "menu.hint_key_special_active",
"menu.hint_key_subchanneldown",
"menu.hint_key_subchannelup",
"menu.hint_key_transponder",
@@ -1149,6 +1171,7 @@ const char * locale_real_names[] =
"menu.hint_volume",
"menu.hint_volume_digits",
"menu.hint_volume_pos",
+ "menu.hint_volume_size",
"menu.hint_ytplay",
"menu.hint_zap_cycle",
"menu.next",
@@ -1243,6 +1266,7 @@ const char * locale_real_names[] =
"motorcontrol.motor_pos",
"motorcontrol.movement",
"motorcontrol.msec",
+ "motorcontrol.network",
"motorcontrol.no_mode",
"motorcontrol.notdef",
"motorcontrol.override",
diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp
index 7afbc03b1..a13a2218f 100644
--- a/src/system/setting_helpers.cpp
+++ b/src/system/setting_helpers.cpp
@@ -179,6 +179,82 @@ void CColorSetupNotifier::setPalette()
convertSetupColor2RGB(g_settings.colored_events_red, g_settings.colored_events_green, g_settings.colored_events_blue),
8, convertSetupAlpha2Alpha(g_settings.infobar_alpha) );
+ // ##### TEXT COLORS #####
+ // COL_COLORED_EVENTS_TEXT
+ frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 0,
+ convertSetupColor2RGB(g_settings.colored_events_red, g_settings.colored_events_green, g_settings.colored_events_blue),
+ convertSetupAlpha2Alpha(g_settings.menu_Content_alpha));
+
+ // COL_INFOBAR_TEXT
+ frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 1,
+ convertSetupColor2RGB(g_settings.infobar_Text_red, g_settings.infobar_Text_green, g_settings.infobar_Text_blue),
+ convertSetupAlpha2Alpha(g_settings.infobar_alpha));
+
+ // COL_INFOBAR_SHADOW_TEXT
+ frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 2,
+ convertSetupColor2RGB(int(g_settings.infobar_Text_red*0.6), int(g_settings.infobar_Text_green*0.6), int(g_settings.infobar_Text_blue*0.6)),
+ convertSetupAlpha2Alpha(g_settings.infobar_alpha));
+
+ // COL_MENUHEAD_TEXT
+ frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 3,
+ convertSetupColor2RGB(g_settings.menu_Head_Text_red, g_settings.menu_Head_Text_green, g_settings.menu_Head_Text_blue),
+ convertSetupAlpha2Alpha(g_settings.menu_Head_alpha));
+
+ // COL_MENUCONTENT_TEXT
+ frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 4,
+ convertSetupColor2RGB(g_settings.menu_Content_Text_red, g_settings.menu_Content_Text_green, g_settings.menu_Content_Text_blue),
+ convertSetupAlpha2Alpha(g_settings.menu_Content_alpha));
+
+ // COL_MENUCONTENT_TEXT_PLUS_1
+ frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 5,
+ changeBrightnessRGBRel(convertSetupColor2RGB(g_settings.menu_Content_Text_red, g_settings.menu_Content_Text_green, g_settings.menu_Content_Text_blue), -16),
+ convertSetupAlpha2Alpha(g_settings.menu_Content_alpha));
+
+ // COL_MENUCONTENT_TEXT_PLUS_2
+ frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 6,
+ changeBrightnessRGBRel(convertSetupColor2RGB(g_settings.menu_Content_Text_red, g_settings.menu_Content_Text_green, g_settings.menu_Content_Text_blue), -32),
+ convertSetupAlpha2Alpha(g_settings.menu_Content_alpha));
+
+ // COL_MENUCONTENT_TEXT_PLUS_3
+ frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 7,
+ changeBrightnessRGBRel(convertSetupColor2RGB(g_settings.menu_Content_Text_red, g_settings.menu_Content_Text_green, g_settings.menu_Content_Text_blue), -48),
+ convertSetupAlpha2Alpha(g_settings.menu_Content_alpha));
+
+ // COL_MENUCONTENTDARK_TEXT
+ frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 8,
+ convertSetupColor2RGB(g_settings.menu_Content_Text_red, g_settings.menu_Content_Text_green, g_settings.menu_Content_Text_blue),
+ convertSetupAlpha2Alpha(g_settings.menu_Content_alpha));
+
+ // COL_MENUCONTENTDARK_TEXT_PLUS_1
+ frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 9,
+ changeBrightnessRGBRel(convertSetupColor2RGB(g_settings.menu_Content_Text_red, g_settings.menu_Content_Text_green, g_settings.menu_Content_Text_blue), -52),
+ convertSetupAlpha2Alpha(g_settings.menu_Content_alpha));
+
+ // COL_MENUCONTENTDARK_TEXT_PLUS_2
+ frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 10,
+ changeBrightnessRGBRel(convertSetupColor2RGB(g_settings.menu_Content_Text_red, g_settings.menu_Content_Text_green, g_settings.menu_Content_Text_blue), -60),
+ convertSetupAlpha2Alpha(g_settings.menu_Content_alpha));
+
+ // COL_MENUCONTENTSELECTED_TEXT
+ frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 11,
+ convertSetupColor2RGB(g_settings.menu_Content_Selected_Text_red, g_settings.menu_Content_Selected_Text_green, g_settings.menu_Content_Selected_Text_blue),
+ convertSetupAlpha2Alpha(g_settings.menu_Content_Selected_alpha));
+
+ // COL_MENUCONTENTSELECTED_TEXT_PLUS_1
+ frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 12,
+ changeBrightnessRGBRel(convertSetupColor2RGB(g_settings.menu_Content_Selected_Text_red, g_settings.menu_Content_Selected_Text_green, g_settings.menu_Content_Selected_Text_blue), -16),
+ convertSetupAlpha2Alpha(g_settings.menu_Content_Selected_alpha));
+
+ // COL_MENUCONTENTSELECTED_TEXT_PLUS_2
+ frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 13,
+ changeBrightnessRGBRel(convertSetupColor2RGB(g_settings.menu_Content_Selected_Text_red, g_settings.menu_Content_Selected_Text_green, g_settings.menu_Content_Selected_Text_blue), -32),
+ convertSetupAlpha2Alpha(g_settings.menu_Content_Selected_alpha));
+
+ // COL_MENUCONTENTINACTIVE_TEXT
+ frameBuffer->paletteSetColor(COL_NEUTRINO_TEXT + 14,
+ convertSetupColor2RGB(g_settings.menu_Content_inactive_Text_red, g_settings.menu_Content_inactive_Text_green, g_settings.menu_Content_inactive_Text_blue),
+ convertSetupAlpha2Alpha(g_settings.menu_Content_inactive_alpha));
+
frameBuffer->paletteSet();
}
@@ -241,7 +317,7 @@ bool CFontSizeNotifier::changeNotify(const neutrino_locale_t, void *)
CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FONTSIZE_HINT)); // UTF-8
hintBox.paint();
- CNeutrinoApp::getInstance()->SetupFonts();
+ CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT);
hintBox.hide();
/* recalculate infoclock/muteicon/volumebar */
diff --git a/src/system/settings.h b/src/system/settings.h
index 706dbdf13..3bd450a4a 100644
--- a/src/system/settings.h
+++ b/src/system/settings.h
@@ -89,6 +89,7 @@ struct SNeutrinoSettings
int scrambled_message;
int volume_pos;
int volume_digits;
+ int volume_size;
int show_mute_icon;
int menu_pos;
int show_menu_hints;
@@ -419,6 +420,9 @@ struct SNeutrinoSettings
int key_pip_close;
int key_pip_setup;
int key_pip_swap;
+ int key_format_mode_active;
+ int key_pic_mode_active;
+ int key_pic_size_active;
int cacheTXT;
int minimode;
@@ -478,6 +482,8 @@ struct SNeutrinoSettings
char softupdate_proxyserver[31];
char softupdate_proxyusername[31];
char softupdate_proxypassword[31];
+ int softupdate_name_mode_apply;
+ int softupdate_name_mode_backup;
int apply_settings;
int apply_kernel;
@@ -545,6 +551,9 @@ struct SNeutrinoSettings
int led_deep_mode;
int led_rec_mode;
int led_blink;
+ int backlight_tv;
+ int backlight_standby;
+ int backlight_deepstandby;
#define FILESYSTEM_ENCODING_TO_UTF8(a) (g_settings.filesystem_is_utf8 ? (a) : ZapitTools::Latin1_to_UTF8(a).c_str())
#define UTF8_TO_FILESYSTEM_ENCODING(a) (g_settings.filesystem_is_utf8 ? (a) : ZapitTools::UTF8_to_Latin1(a).c_str())
#define FILESYSTEM_ENCODING_TO_UTF8_STRING(a) (g_settings.filesystem_is_utf8 ? (a) : ZapitTools::Latin1_to_UTF8(a))
diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp
index a9bfa47e2..4ae79b00c 100644
--- a/src/timerd/timermanager.cpp
+++ b/src/timerd/timermanager.cpp
@@ -727,11 +727,12 @@ bool CTimerManager::shutdown()
void CTimerManager::shutdownOnWakeup(int currEventID)
{
time_t nextAnnounceTime=0;
- if(wakeup == 0)
- return;
- wakeup = 0;
pthread_mutex_lock(&tm_eventsMutex);
+ if(wakeup == 0) {
+ pthread_mutex_unlock(&tm_eventsMutex);
+ return;
+ }
CTimerEventMap::iterator pos = events.begin();
for(;pos != events.end();++pos)
@@ -756,10 +757,23 @@ void CTimerManager::shutdownOnWakeup(int currEventID)
{ // in den naechsten 10 min steht nix an
dprintf("Programming shutdown event\n");
CTimerEvent_Shutdown* event = new CTimerEvent_Shutdown(now+120, now+180);
- addEvent(event);
+ shutdown_eventID = addEvent(event);
+ wakeup = 0;
}
pthread_mutex_unlock(&tm_eventsMutex);
}
+
+void CTimerManager::cancelShutdownOnWakeup()
+{
+ pthread_mutex_lock(&tm_eventsMutex);
+ if (shutdown_eventID > -1) {
+ removeEvent(shutdown_eventID);
+ shutdown_eventID = -1;
+ }
+ wakeup = 0;
+ pthread_mutex_unlock(&tm_eventsMutex);
+}
+
void CTimerManager::setRecordingSafety(int pre, int post)
{
m_extraTimeStart=pre;
diff --git a/src/timerd/timermanager.h b/src/timerd/timermanager.h
index 76b4b2749..042b46655 100644
--- a/src/timerd/timermanager.h
+++ b/src/timerd/timermanager.h
@@ -212,6 +212,7 @@ class CTimerManager
private:
void Init(void);
int eventID;
+ int shutdown_eventID;
CEventServer *eventServer;
CTimerEventMap events;
pthread_t thrTimer;
@@ -247,6 +248,7 @@ public:
void getRecordingSafety(int &pre, int &post){pre=m_extraTimeStart;post=m_extraTimeEnd;}
void setRecordingSafety(int pre, int post);
void loadRecordingSafety();
+ void cancelShutdownOnWakeup();
};
#endif
diff --git a/src/zapit/data/frontend.conf b/src/zapit/data/frontend.conf
index e69de29bb..013cef302 100644
--- a/src/zapit/data/frontend.conf
+++ b/src/zapit/data/frontend.conf
@@ -0,0 +1,20 @@
+fe0_diseqcRepeats=0
+fe0_diseqcType=0
+fe0_highVoltage=0
+fe0_lastSatellitePosition=360
+fe0_motorRotationSpeed=18
+fe0_position_192=192,-1,-1,-1,0,0,9750,10600,11700,0,0,1
+fe0_satellites=192
+fe0_uni_qrg=0
+fe0_uni_scr=-1
+fe0_mode=1
+fe1_diseqcRepeats=0
+fe1_diseqcType=0
+fe1_highVoltage=0
+fe1_lastSatellitePosition=360
+fe1_motorRotationSpeed=18
+fe1_position_192=192,-1,-1,-1,0,0,9750,10600,11700,0,0,1
+fe1_satellites=192
+fe1_uni_qrg=0
+fe1_uni_scr=-1
+fe1_mode=0
diff --git a/src/zapit/include/zapit/channel.h b/src/zapit/include/zapit/channel.h
index d8f1225bf..4aa756340 100644
--- a/src/zapit/include/zapit/channel.h
+++ b/src/zapit/include/zapit/channel.h
@@ -208,7 +208,7 @@ class CZapitChannel
/* get methods - read and write variables */
const std::string& getName(void) const { return name; }
t_satellite_position getSatellitePosition(void) const { return satellitePosition; }
- unsigned char getAudioChannelCount(void) { return audioChannels.size(); }
+ unsigned char getAudioChannelCount(void) { return (unsigned char) audioChannels.size(); }
unsigned short getPcrPid(void) { return pcrPid; }
unsigned short getPmtPid(void) { return pmtPid; }
unsigned short getTeletextPid(void) { return teletextPid; }
@@ -256,8 +256,8 @@ class CZapitChannel
void dumpServiceXml(FILE * fd, const char * action = NULL);
void dumpBouquetXml(FILE * fd);
- void setRecordDemux(int num) { record_demux = num; };
- void setPipDemux(int num) { pip_demux = num; };
+ void setRecordDemux(uint8_t num) { record_demux = num; };
+ void setPipDemux(uint8_t num) { pip_demux = num; };
int getRecordDemux() { return record_demux; };
int getPipDemux() { return pip_demux; };
static t_channel_id makeChannelId(t_satellite_position sat, freq_id_t freq,
diff --git a/src/zapit/include/zapit/client/msgtypes.h b/src/zapit/include/zapit/client/msgtypes.h
index 1da5b0eb9..4321d8a53 100644
--- a/src/zapit/include/zapit/client/msgtypes.h
+++ b/src/zapit/include/zapit/client/msgtypes.h
@@ -190,6 +190,8 @@ class CZapitMessages
t_channel_id channel_id;
bool record;
bool pip;
+ bool epg;
+ commandZaptoServiceID():channel_id(0),record(false),pip(false),epg(false){}
};
struct commandSetAudioChannel
diff --git a/src/zapit/include/zapit/client/zapitclient.h b/src/zapit/include/zapit/client/zapitclient.h
index 479a1cc69..4aa0cbc20 100644
--- a/src/zapit/include/zapit/client/zapitclient.h
+++ b/src/zapit/include/zapit/client/zapitclient.h
@@ -72,6 +72,7 @@ class CZapitClient:public CBasicClient
EVT_SERVICES_CHANGED,
EVT_PMT_CHANGED,
EVT_TUNE_COMPLETE,
+ EVT_BACK_ZAP_COMPLETE,
LAST_EVENT_MARKER // <- no actual event, needed by pzapit
};
@@ -274,6 +275,7 @@ class CZapitClient:public CBasicClient
unsigned int zapTo_serviceID(const t_channel_id channel_id);
unsigned int zapTo_record(const t_channel_id channel_id);
unsigned int zapTo_pip(const t_channel_id channel_id);
+ unsigned int zapTo_epg(const t_channel_id channel_id);
/* zaps to subservice, returns the "zap-status" */
unsigned int zapTo_subServiceID(const t_channel_id channel_id);
diff --git a/src/zapit/include/zapit/femanager.h b/src/zapit/include/zapit/femanager.h
index 03bdcc143..d57aedeca 100644
--- a/src/zapit/include/zapit/femanager.h
+++ b/src/zapit/include/zapit/femanager.h
@@ -29,7 +29,7 @@
#include
#include
-#include
+#include
#define MAX_FE 4
#define MAX_ADAPTERS 1
@@ -88,7 +88,7 @@ class CFEManager
bool have_cable;
bool have_terr;
bool have_locked;
- OpenThreads::Mutex mutex;
+ OpenThreads::ReentrantMutex mutex;
std::vector dmap;
@@ -147,5 +147,8 @@ class CFEManager
bool satOnly() { return (have_sat && !have_cable && !have_terr); }
bool cableOnly() { return (have_cable && !have_sat && ! have_terr); }
bool terrOnly() { return (have_terr && !have_sat && ! have_cable); }
+ void Lock() { mutex.lock(); }
+ void Unlock() { mutex.unlock(); }
+
};
#endif /* __femanager_h__ */
diff --git a/src/zapit/include/zapit/frontend_c.h b/src/zapit/include/zapit/frontend_c.h
index 2a4402480..ddf1287dc 100644
--- a/src/zapit/include/zapit/frontend_c.h
+++ b/src/zapit/include/zapit/frontend_c.h
@@ -174,7 +174,7 @@ class CFrontend
static fe_code_rate_t getCodeRate(const uint8_t fec_inner, int system = 0);
uint8_t getDiseqcPosition(void) const { return currentTransponder.diseqc; }
- uint8_t getDiseqcRepeats(void) const { return config.diseqcRepeats; }
+ uint8_t getDiseqcRepeats(void) const { return (uint8_t) config.diseqcRepeats; }
diseqc_t getDiseqcType(void) const { return (diseqc_t) config.diseqcType; }
uint32_t getFrequency(void) const { return currentTransponder.feparams.dvb_feparams.frequency; }
bool getHighBand() { return (int) getFrequency() >= lnbSwitch; }
diff --git a/src/zapit/include/zapit/frontend_types.h b/src/zapit/include/zapit/frontend_types.h
index edb7e4ede..51ee653b9 100644
--- a/src/zapit/include/zapit/frontend_types.h
+++ b/src/zapit/include/zapit/frontend_types.h
@@ -39,6 +39,7 @@ typedef struct frontend_config {
int motorRotationSpeed;
int highVoltage;
int diseqc_order;
+ int use_usals;
} frontend_config_t;
#endif // __FRONTEND_TYPES_H__
diff --git a/src/zapit/include/zapit/scannit.h b/src/zapit/include/zapit/scannit.h
index 39e70ee37..ad0c6f182 100644
--- a/src/zapit/include/zapit/scannit.h
+++ b/src/zapit/include/zapit/scannit.h
@@ -42,6 +42,7 @@ class CNit : public OpenThreads::Thread
bool cable;
t_satellite_position satellitePosition;
+ t_satellite_position orbitalPosition;
freq_id_t freq_id;
unsigned short nid;
channel_number_map_t logical_map;
@@ -66,6 +67,7 @@ class CNit : public OpenThreads::Thread
channel_number_map_t & getLogicalMap() { return logical_map; };
channel_number_map_t & getHDLogicalMap() { return hd_logical_map; };
std::string GetNetworkName() { return networkName; }
+ t_satellite_position getOrbitalPosition() { return orbitalPosition; }
};
#endif
diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h
index ab38f7ba3..bd7782af6 100644
--- a/src/zapit/include/zapit/zapit.h
+++ b/src/zapit/include/zapit/zapit.h
@@ -6,6 +6,7 @@
#define __zapit_h__
#include
+#include
#include
#include
#include
@@ -99,7 +100,7 @@ class CZapit : public OpenThreads::Thread
RECORD_MODE = 0x04
};
- OpenThreads::Mutex mutex;
+ OpenThreads::ReentrantMutex mutex;
bool started;
bool event_mode;
bool firstzap;
@@ -208,6 +209,7 @@ class CZapit : public OpenThreads::Thread
bool ParseCommand(CBasicMessage::Header &rmsg, int connfd);
bool ZapIt(const t_channel_id channel_id, bool for_update = false, bool startplayback = true);
bool ZapForRecord(const t_channel_id channel_id);
+ bool ZapForEpg(const t_channel_id channel_id);
bool ChangeAudioPid(uint8_t index);
void SetRadioMode();
void SetTVMode();
@@ -254,5 +256,7 @@ class CZapit : public OpenThreads::Thread
int SetVolumePercent(int percent);
bool StartPip(const t_channel_id channel_id);
bool StopPip();
+ void Lock() { mutex.lock(); }
+ void Unlock() { mutex.unlock(); }
};
#endif /* __zapit_h__ */
diff --git a/src/zapit/lib/zapitclient.cpp b/src/zapit/lib/zapitclient.cpp
index da0902d36..4f506c592 100644
--- a/src/zapit/lib/zapitclient.cpp
+++ b/src/zapit/lib/zapitclient.cpp
@@ -163,6 +163,7 @@ unsigned int CZapitClient::zapTo_serviceID(const t_channel_id channel_id)
msg.channel_id = channel_id;
msg.record = false;
msg.pip = false;
+ msg.epg = false;
send(CZapitMessages::CMD_ZAPTO_SERVICEID, (const char *) & msg, sizeof(msg));
@@ -182,6 +183,7 @@ unsigned int CZapitClient::zapTo_record(const t_channel_id channel_id)
msg.channel_id = channel_id;
msg.record = true;
msg.pip = false;
+ msg.epg = false;
send(CZapitMessages::CMD_ZAPTO_SERVICEID, (const char *) & msg, sizeof(msg));
@@ -200,6 +202,26 @@ unsigned int CZapitClient::zapTo_pip(const t_channel_id channel_id)
msg.channel_id = channel_id;
msg.record = false;
msg.pip = true;
+ msg.epg = false;
+
+ send(CZapitMessages::CMD_ZAPTO_SERVICEID, (const char *) & msg, sizeof(msg));
+
+ CZapitMessages::responseZapComplete response;
+ CBasicClient::receive_data((char* )&response, sizeof(response));
+
+ close_connection();
+
+ return response.zapStatus;
+}
+
+unsigned int CZapitClient::zapTo_epg(const t_channel_id channel_id)
+{
+ CZapitMessages::commandZaptoServiceID msg;
+
+ msg.channel_id = channel_id;
+ msg.record = false;
+ msg.pip = false;
+ msg.epg = true;
send(CZapitMessages::CMD_ZAPTO_SERVICEID, (const char *) & msg, sizeof(msg));
@@ -217,6 +239,9 @@ unsigned int CZapitClient::zapTo_subServiceID(const t_channel_id channel_id)
VALGRIND_PARANOIA;
msg.channel_id = channel_id;
+ msg.record = false;
+ msg.pip = false;
+ msg.epg = false;
send(CZapitMessages::CMD_ZAPTO_SUBSERVICEID, (const char *) & msg, sizeof(msg));
@@ -235,6 +260,9 @@ void CZapitClient::zapTo_serviceID_NOWAIT(const t_channel_id channel_id)
VALGRIND_PARANOIA;
msg.channel_id = channel_id;
+ msg.record = false;
+ msg.pip = false;
+ msg.epg = false;
send(CZapitMessages::CMD_ZAPTO_SERVICEID_NOWAIT, (const char *) & msg, sizeof(msg));
@@ -248,6 +276,9 @@ void CZapitClient::zapTo_subServiceID_NOWAIT(const t_channel_id channel_id)
VALGRIND_PARANOIA;
msg.channel_id = channel_id;
+ msg.record = false;
+ msg.pip = false;
+ msg.epg = false;
send(CZapitMessages::CMD_ZAPTO_SUBSERVICEID_NOWAIT, (const char *) & msg, sizeof(msg));
diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp
index 0c6b36a67..54d170543 100644
--- a/src/zapit/src/femanager.cpp
+++ b/src/zapit/src/femanager.cpp
@@ -249,6 +249,7 @@ bool CFEManager::loadSettings()
fe_config.uni_qrg = getConfigValue(fe, "uni_qrg", 0);
fe_config.uni_pin = getConfigValue(fe, "uni_pin", -1);
fe_config.diseqc_order = getConfigValue(fe, "diseqc_order", UNCOMMITED_FIRST);
+ fe_config.use_usals = getConfigValue(fe, "use_usals", 0);
fe->setRotorSatellitePosition(getConfigValue(fe, "lastSatellitePosition", 0));
@@ -337,6 +338,7 @@ void CFEManager::saveSettings(bool write)
setConfigValue(fe, "uni_qrg", fe_config.uni_qrg);
setConfigValue(fe, "uni_pin", fe_config.uni_pin);
setConfigValue(fe, "diseqc_order", fe_config.diseqc_order);
+ setConfigValue(fe, "use_usals", fe_config.use_usals);
setConfigValue(fe, "lastSatellitePosition", fe->getRotorSatellitePosition());
setConfigValue(fe, "mode", fe->getMode());
setConfigValue(fe, "master", fe->getMaster());
@@ -551,8 +553,7 @@ bool CFEManager::loopCanTune(CFrontend * fe, CZapitChannel * channel)
CFrontend * CFEManager::getFrontend(CZapitChannel * channel)
{
- CFrontend * free_frontend = NULL;
- //CFrontend * same_tid_fe = NULL;
+ CFrontend * retfe = NULL;
if (livefe && livefe->tuned && livefe->sameTsidOnid(channel->getTransponderId()))
return livefe;
@@ -582,6 +583,7 @@ CFrontend * CFEManager::getFrontend(CZapitChannel * channel)
break;
}
}
+ CFrontend * free_frontend = NULL;
CFrontend * free_twin = NULL;
bool loop_busy = false;
for (unsigned int i = 0; i < mfe->linkmap.size(); i++) {
@@ -616,6 +618,8 @@ CFrontend * CFEManager::getFrontend(CZapitChannel * channel)
}
if (!free_frontend)
free_frontend = free_twin;
+ if (free_frontend && !retfe)
+ retfe = free_frontend;
}
if (mfe->getMode() == CFrontend::FE_MODE_INDEPENDENT) {
FEDEBUG("Check fe%d: mode %d locked %d freq %d TP %" PRIx64 " - channel freq %d TP %" PRIx64, mfe->fenumber, mfe->getMode(),
@@ -625,12 +629,12 @@ CFrontend * CFEManager::getFrontend(CZapitChannel * channel)
FEDEBUG("fe %d on the same TP", mfe->fenumber);
return mfe;
}
- } else if(!free_frontend)
- free_frontend = mfe;
+ } else if(!retfe)
+ retfe = mfe;
}
}
- FEDEBUG("Selected fe: %d", free_frontend ? free_frontend->fenumber : -1);
- return free_frontend;
+ FEDEBUG("Selected fe: %d", retfe ? retfe->fenumber : -1);
+ return retfe;
}
#ifdef DYNAMIC_DEMUX
diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp
index 750d05683..54cf06b4f 100644
--- a/src/zapit/src/frontend.cpp
+++ b/src/zapit/src/frontend.cpp
@@ -1007,7 +1007,6 @@ void CFrontend::sendMotorCommand(uint8_t cmdtype, uint8_t address, uint8_t comma
struct dvb_diseqc_master_cmd cmd;
int i;
fe_sec_tone_mode_t oldTone = currentToneMode;
- fe_sec_voltage_t oldVoltage = currentVoltage;
printf("[fe%d] sendMotorCommand: cmdtype = %x, address = %x, cmd = %x\n", fenumber, cmdtype, address, command);
printf("[fe%d] sendMotorCommand: num_parms = %d, parm1 = %x, parm2 = %x\n", fenumber, num_parameters, parameter1, parameter2);
@@ -1019,14 +1018,17 @@ void CFrontend::sendMotorCommand(uint8_t cmdtype, uint8_t address, uint8_t comma
cmd.msg[4] = parameter2;
cmd.msg_len = 3 + num_parameters;
- //secSetVoltage(config.highVoltage ? SEC_VOLTAGE_18 : SEC_VOLTAGE_13, 15);
secSetTone(SEC_TONE_OFF, 15);
- secSetVoltage(SEC_VOLTAGE_13, 100);
+#if 0
+ fe_sec_voltage_t oldVoltage = currentVoltage;
+ //secSetVoltage(config.highVoltage ? SEC_VOLTAGE_18 : SEC_VOLTAGE_13, 15);
+ //secSetVoltage(SEC_VOLTAGE_13, 100);
+#endif
for(i = 0; i <= repeat; i++)
sendDiseqcCommand(&cmd, 50);
- secSetVoltage(oldVoltage, 15);
+ //secSetVoltage(oldVoltage, 15);
secSetTone(oldTone, 15);
printf("[fe%d] motor command sent.\n", fenumber);
@@ -1432,6 +1434,10 @@ int CFrontend::driveToSatellitePosition(t_satellite_position satellitePosition,
int new_position = 0, old_position = 0;
bool use_usals = 0;
+ if (CFrontend::linked(femode) || femode == CFrontend::FE_MODE_UNUSED) {
+ rotorSatellitePosition = satellitePosition;
+ return 0;
+ }
//if(config.diseqcType == DISEQC_ADVANCED) //FIXME testing
{
bool moved = false;
@@ -1453,7 +1459,7 @@ int CFrontend::driveToSatellitePosition(t_satellite_position satellitePosition,
if (rotorSatellitePosition == satellitePosition)
return 0;
- if (use_usals) {
+ if (use_usals || config.use_usals) {
gotoXX(satellitePosition);
moved = true;
} else {
@@ -1724,7 +1730,9 @@ void CFrontend::gotoXX(t_satellite_position pos)
}
printf("RotorCmd = %04x\n", RotorCmd);
+ if (config.highVoltage)
+ secSetVoltage(SEC_VOLTAGE_18, 100);
sendMotorCommand(0xE0, 0x31, 0x6E, 2, ((RotorCmd & 0xFF00) / 0x100), RotorCmd & 0xFF, repeatUsals);
- secSetVoltage(config.highVoltage ? SEC_VOLTAGE_18 : SEC_VOLTAGE_13, 15); //FIXME ?
+ //secSetVoltage(config.highVoltage ? SEC_VOLTAGE_18 : SEC_VOLTAGE_13, 15); //FIXME ?
}
diff --git a/src/zapit/src/scan.cpp b/src/zapit/src/scan.cpp
index 785a28a8d..4b7a00b75 100644
--- a/src/zapit/src/scan.cpp
+++ b/src/zapit/src/scan.cpp
@@ -483,6 +483,7 @@ void CServiceScan::Cleanup(const bool success)
scanBouquetManager = NULL;
}
CleanAllMaps();
+ abort_scan = false;
}
bool CServiceScan::SetFrontend(t_satellite_position satellitePosition)
diff --git a/src/zapit/src/scannit.cpp b/src/zapit/src/scannit.cpp
index c5c0d12d6..1f15e5e8b 100644
--- a/src/zapit/src/scannit.cpp
+++ b/src/zapit/src/scannit.cpp
@@ -41,6 +41,7 @@ CNit::CNit(t_satellite_position spos, freq_id_t frq, unsigned short pnid, int dn
nid = pnid;
dmxnum = dnum;
cable = (CServiceScan::getInstance()->GetFrontend()->getInfo()->type == FE_QAM);
+ orbitalPosition = 0;
}
CNit::~CNit()
@@ -108,12 +109,18 @@ bool CNit::Read()
if (dmx->sectionFilter(0x10, filter, mask, flen) < 0) {
delete dmx;
+#ifdef DEBUG_NIT
+ printf("[NIT] filter failed\n");
+#endif
return false;
}
do {
if (dmx->Read(buffer, NIT_SECTION_SIZE) < 0) {
delete dmx;
+#ifdef DEBUG_NIT
+ printf("[NIT] read failed\n");
+#endif
return false;
}
@@ -301,6 +308,9 @@ bool CNit::ParseSatelliteDescriptor(SatelliteDeliverySystemDescriptor * sd, Tran
if (abs(newSat - satellitePosition) < 5)
newSat = satellitePosition;
+ if (!orbitalPosition)
+ orbitalPosition = newSat;
+
if(satellitePosition != newSat) {
printf("NIT: different satellite position: our %d nit %d (%X)\n",
satellitePosition, newSat, sd->getOrbitalPosition());
diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp
index 5a63d5f83..5c6e8aa77 100644
--- a/src/zapit/src/zapit.cpp
+++ b/src/zapit/src/zapit.cpp
@@ -72,6 +72,7 @@
#include
#include
#include
+#include
#ifdef PEDANTIC_VALGRIND_SETUP
#define VALGRIND_PARANOIA(x) memset(&x, 0, sizeof(x))
@@ -491,6 +492,8 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay
INFO("[zapit] zap to %s (%" PRIx64 " tp %" PRIx64 ")", newchannel->getName().c_str(), newchannel->getChannelID(), newchannel->getTransponderId());
#ifdef ENABLE_PIP
+ /* executed async if zap NOWAIT, race possible with record lock/allocate */
+ CFEManager::getInstance()->Lock();
if (pip_fe)
CFEManager::getInstance()->lockFrontend(pip_fe);
CFrontend * fe = CFEManager::getInstance()->allocateFE(newchannel);
@@ -500,6 +503,7 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay
StopPip();
fe = CFEManager::getInstance()->allocateFE(newchannel);
}
+ CFEManager::getInstance()->Unlock();
#else
CFrontend * fe = CFEManager::getInstance()->allocateFE(newchannel);
#endif
@@ -628,7 +632,7 @@ bool CZapit::StartPip(const t_channel_id channel_id)
if((newchannel = CServiceManager::getInstance()->FindChannel(channel_id)) == NULL) {
- printf("zapit_to_record: channel_id " PRINTF_CHANNEL_ID_TYPE " not found", channel_id);
+ INFO("channel_id " PRINTF_CHANNEL_ID_TYPE " not found", channel_id);
return false;
}
INFO("[pip] zap to %s (%llx tp %llx)", newchannel->getName().c_str(), newchannel->getChannelID(), newchannel->getTransponderId());
@@ -687,7 +691,7 @@ bool CZapit::ZapForRecord(const t_channel_id channel_id)
int retry = (live_fe->getDiseqcType() == DISEQC_UNICABLE) * 2;
if((newchannel = CServiceManager::getInstance()->FindChannel(channel_id)) == NULL) {
- printf("zapit_to_record: channel_id " PRINTF_CHANNEL_ID_TYPE " not found", channel_id);
+ INFO("channel_id " PRINTF_CHANNEL_ID_TYPE " not found", channel_id);
return false;
}
INFO("%s: %s (%" PRIx64 ")", __FUNCTION__, newchannel->getName().c_str(), channel_id);
@@ -725,6 +729,48 @@ bool CZapit::ZapForRecord(const t_channel_id channel_id)
return true;
}
+bool CZapit::ZapForEpg(const t_channel_id channel_id)
+{
+ CZapitChannel* newchannel;
+ bool transponder_change;
+
+ if((newchannel = CServiceManager::getInstance()->FindChannel(channel_id)) == NULL) {
+ INFO("channel_id " PRINTF_CHANNEL_ID_TYPE " not found", channel_id);
+ return false;
+ }
+ INFO("%s: %s (%" PRIx64 ")", __FUNCTION__, newchannel->getName().c_str(), channel_id);
+
+ /* executed async in zapit thread, race possible with record lock/allocate */
+ CFEManager::getInstance()->Lock();
+
+ CFEManager::getInstance()->lockFrontend(live_fe);
+#ifdef ENABLE_PIP
+ if (pip_fe && pip_fe != live_fe)
+ CFEManager::getInstance()->lockFrontend(pip_fe);
+#endif
+ CFrontend * frontend = CFEManager::getInstance()->allocateFE(newchannel);
+
+ CFEManager::getInstance()->unlockFrontend(live_fe);
+#ifdef ENABLE_PIP
+ if (pip_fe && pip_fe != live_fe)
+ CFEManager::getInstance()->unlockFrontend(pip_fe);
+#endif
+ CFEManager::getInstance()->Unlock();
+
+ if(frontend == NULL) {
+ ERROR("Cannot get frontend\n");
+ return false;
+ }
+ if(!TuneChannel(frontend, newchannel, transponder_change))
+ return false;
+#if 0
+ if(!ParsePatPmt(newchannel))
+ return false;
+#endif
+ ParsePatPmt(newchannel);
+ return true;
+}
+
/* set channel/pid volume percent, using current channel_id and pid, if those params is 0 */
void CZapit::SetPidVolume(t_channel_id channel_id, int pid, int percent)
{
@@ -1023,6 +1069,15 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd)
else if(msgZaptoServiceID.pip)
msgResponseZapComplete.zapStatus = StartPip(msgZaptoServiceID.channel_id);
#endif
+ else if(msgZaptoServiceID.epg) {
+ msgResponseZapComplete.zapStatus = 0;
+ CBasicServer::send_data(connfd, &msgResponseZapComplete, sizeof(msgResponseZapComplete));
+ bool ret = ZapForEpg(msgZaptoServiceID.channel_id);
+ if (!ret)
+ msgZaptoServiceID.channel_id = 0;
+ SendEvent(CZapitClient::EVT_BACK_ZAP_COMPLETE, &msgZaptoServiceID.channel_id, sizeof(t_channel_id));
+ break;
+ }
else
msgResponseZapComplete.zapStatus = ZapTo(msgZaptoServiceID.channel_id, (rmsg.cmd == CZapitMessages::CMD_ZAPTO_SUBSERVICEID));