diff --git a/configure.ac b/configure.ac index 355bdca99..d2352b20f 100644 --- a/configure.ac +++ b/configure.ac @@ -130,7 +130,9 @@ AC_ARG_ENABLE(cleanup, [ --enable-cleanup enable cleanup on exit], [AC_DEFINE(EXIT_CLEANUP,1,[enable cleanup on exit])]) -AC_CHECK_HEADERS(coolstream/nevis_ir.h) +if test -e ${srcdir}/lib/libcoolstream/nevis_ir.h; then + AC_DEFINE(HAVE_COOLSTREAM_NEVIS_IR_H,1,[Define to 1 if you have the header file.]) +fi # # Check for libtdservicedb - the new one - for testing only diff --git a/data/cables.xml b/data/cables.xml index 777088793..2a3ed0c75 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -1343,6 +1343,7 @@ + diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index 4b256a96e..b8b41539d 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -46,6 +46,10 @@ install_DATA += \ bookmarkmanager.png \ border_lr.png \ border_ul.png \ + btn_backward.png \ + btn_forward.png \ + btn_pause.png \ + btn_play.png \ btn_record_active.png \ btn_record_inactive.png \ btn_stop.png \ diff --git a/data/icons/btn_backward.png b/data/icons/btn_backward.png new file mode 100644 index 000000000..962e71c84 Binary files /dev/null and b/data/icons/btn_backward.png differ diff --git a/data/icons/btn_forward.png b/data/icons/btn_forward.png new file mode 100644 index 000000000..cad43950b Binary files /dev/null and b/data/icons/btn_forward.png differ diff --git a/data/icons/btn_pause.png b/data/icons/btn_pause.png new file mode 100644 index 000000000..c18fafa40 Binary files /dev/null and b/data/icons/btn_pause.png differ diff --git a/data/icons/btn_play.png b/data/icons/btn_play.png new file mode 100644 index 000000000..e1baa70ca Binary files /dev/null and b/data/icons/btn_play.png differ diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index d21fa9e8f..1bbc13073 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -911,7 +911,7 @@ menu.hint_osd_preset Hier können Sie zwischen Röhren-TV (CRT) oder Flachbildsc menu.hint_parentallock_changepin Hier wird der 4 stellige PIN Code eingegeben,\nder dann ggf. abgefragt wird menu.hint_parentallock_lockage Hier wird festgelegt, bei welcher Altersklasse\ndie PIN Abfrage kommt menu.hint_parentallock_prompt Hier wird definiert, wann eine PIN Eingabe erfolgen soll -menu.hint_personalize aktivieren, deaktivieren, schützen von Menüpunkten\nkonfigurieren der Farb-Tasten in den Benutzermenüs +menu.hint_personalize Personalisieren Sie ihre Menüs, konfigurieren Sie die Farb-Tasten in den Benutzermenüs menu.hint_pictureviewer_defdir Hier wählen Sie das Startverzeichnis für den Bildbetrachter menu.hint_pictureviewer_scaling Hier kann die Bildauflösung eingestellt werden menu.hint_pictureviewer_slide_time Hier kann der Slideshow-Intervall geändert werden,\nStandardmässig ist ein Intervall von 10 Sekunden eingstellt @@ -1171,6 +1171,7 @@ motorcontrol.store Speichere Motorposition (a) motorcontrol.timed_mode Zeitgesteuerter Schrittweitenmodus motorcontrol.user_menu Benutzermenü motorcontrol.west_limit Setze westliches (soft) Limit +moviebrowser.ask_rec_to_delete Das Löschen des Films beendet auch die laufende Aufnahme!\n[%s]\nTrotzdem fortsetzen? moviebrowser.book_add Lesezeichen setzen moviebrowser.book_clear_all Lösche alle moviebrowser.book_head Markierungen @@ -1188,6 +1189,7 @@ moviebrowser.browser_row_head Spalten Einstellungen moviebrowser.browser_row_item Spalteninfo moviebrowser.browser_row_nr Anzahl Spalten moviebrowser.browser_row_width Spaltenbreite [% der Gesamtbreite] +moviebrowser.delete_info Lösche Dateien, bitte warten... moviebrowser.dir Pfad moviebrowser.dir_head Zusätzliche Verzeichnisse moviebrowser.edit_book Bookmark Ändern @@ -1438,27 +1440,30 @@ personalize.visible sichtbar pictureviewer.defdir Start-Verz. pictureviewer.head Bildbetrachter pictureviewer.help1 Menü-Modus -pictureviewer.help10 Anzeige-Modus -pictureviewer.help11 Bild neu einlesen -pictureviewer.help12 vorheriges Bild -pictureviewer.help13 nächstes Bild -pictureviewer.help14 Zoom out -pictureviewer.help15 Zoom in -pictureviewer.help16 Scroll hoch -pictureviewer.help17 Scroll links -pictureviewer.help18 Scroll rechts -pictureviewer.help19 Scroll herunter +pictureviewer.help10 Bild neu einlesen +pictureviewer.help11 vorheriges Bild +pictureviewer.help12 nächstes Bild +pictureviewer.help13 Zoom out +pictureviewer.help14 Zoom in +pictureviewer.help15 Scroll hoch +pictureviewer.help16 Scroll links +pictureviewer.help17 Scroll rechts +pictureviewer.help18 Scroll herunter +pictureviewer.help19 Bild unskaliert einlesen pictureviewer.help2 Bild anzeigen -pictureviewer.help20 Sortierung andern -pictureviewer.help21 Bild unskaliert einlesen -pictureviewer.help22 Modus verlassen -pictureviewer.help3 Sortierung andern +pictureviewer.help3 Sortierung ändern +pictureviewer.help30 Audioplayer-Modus +pictureviewer.help31 Startet die Wiedergabe +pictureviewer.help32 Pausiert die Wiedergabe +pictureviewer.help33 Stoppt die Wiedergabe +pictureviewer.help34 nächster Titel +pictureviewer.help35 vorheriger Titel pictureviewer.help4 Bild unskaliert einlesen pictureviewer.help5 Diashow-Modus pictureviewer.help6 vorheriges Bild pictureviewer.help7 nächstes Bild -pictureviewer.help8 Sortierung ändern -pictureviewer.help9 Modus verlassen +pictureviewer.help8 Modus verlassen +pictureviewer.help9 Anzeige-Modus pictureviewer.resize.color_average aufwendig pictureviewer.resize.none keine pictureviewer.resize.simple einfach diff --git a/data/locale/english.locale b/data/locale/english.locale index b5ec1277e..6f86bf110 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1171,6 +1171,7 @@ motorcontrol.store Store Motor Position (a) motorcontrol.timed_mode Timed Step Mode motorcontrol.user_menu User menu motorcontrol.west_limit Set West (soft) Limit +moviebrowser.ask_rec_to_delete Deletion of movie stops current recording!\n[%s]\nContinue anyway? moviebrowser.book_add Add bookmark moviebrowser.book_clear_all Clear all moviebrowser.book_head Bookmarks @@ -1188,6 +1189,7 @@ moviebrowser.browser_row_head Row settings moviebrowser.browser_row_item Row item moviebrowser.browser_row_nr Number of rows moviebrowser.browser_row_width Row width (% of screenwidth) +moviebrowser.delete_info Delete files, please wait... moviebrowser.dir Path moviebrowser.dir_head Additional paths moviebrowser.edit_book Bookmark change @@ -1438,27 +1440,30 @@ personalize.visible Visible pictureviewer.defdir start dir. pictureviewer.head Picture viewer pictureviewer.help1 menu mode -pictureviewer.help10 show mode -pictureviewer.help11 reread image -pictureviewer.help12 previous image -pictureviewer.help13 next image -pictureviewer.help14 Zoom out -pictureviewer.help15 Zoom in -pictureviewer.help16 scroll up -pictureviewer.help17 scroll left -pictureviewer.help18 scroll right -pictureviewer.help19 scroll down +pictureviewer.help10 reread image +pictureviewer.help11 previous image +pictureviewer.help12 next image +pictureviewer.help13 Zoom out +pictureviewer.help14 Zoom in +pictureviewer.help15 scroll up +pictureviewer.help16 scroll left +pictureviewer.help17 scroll right +pictureviewer.help18 scroll down +pictureviewer.help19 reread image (no scaling) pictureviewer.help2 display image -pictureviewer.help20 change sort order -pictureviewer.help21 reread image (no scaling) -pictureviewer.help22 exit pictureviewer.help3 change sort order +pictureviewer.help30 audioplayer mode +pictureviewer.help31 starts the playback +pictureviewer.help32 pauses the playback +pictureviewer.help33 stops the playback +pictureviewer.help34 next title +pictureviewer.help35 previous title pictureviewer.help4 do not scale picture pictureviewer.help5 diashow mode pictureviewer.help6 previous image pictureviewer.help7 next image -pictureviewer.help8 change sort order -pictureviewer.help9 exit +pictureviewer.help8 exit +pictureviewer.help9 show mode pictureviewer.resize.color_average advanced pictureviewer.resize.none none pictureviewer.resize.simple simple diff --git a/data/satellites.xml b/data/satellites.xml index 739e4d754..3c9add451 100755 --- a/data/satellites.xml +++ b/data/satellites.xml @@ -1624,7 +1624,7 @@ - + diff --git a/lib/libcoolstream/control.h b/lib/libcoolstream/control.h new file mode 100644 index 000000000..cc41c6c72 --- /dev/null +++ b/lib/libcoolstream/control.h @@ -0,0 +1,67 @@ +/******************************************************************** +* Description: Control driver for PWM and Scart +* Author: CoolStream Dev. Team +* Created at: Fri Jun 26 08:11:43 CEST 2009 +* +* Copyright (c) 2009 CoolStream International Ltd. All rights reserved. +* +********************************************************************/ + +#ifndef __CONTROL_H +#define __CONTROL_H + +#ifndef __KERNEL__ +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; +#include + +#else +#include +#include +#endif + +#include "tsrouter.h" + +typedef struct _scart_status { + bool widescreen; + bool function; + bool fastblank; +} scart_status_t; + +typedef struct _pwm_status { + u16 pwm_pulse_first; + u16 pwm_pulse_second; + u32 pwm_clock; +} pwm_status_t; + +typedef struct cs_control_data { + scart_status_t scart_status; + pwm_status_t pwm_status; + bool hdd_power; + u32 readers; + u32 sys_serial_high, sys_serial_low; + u32 sys_revision; +} cs_control_data_t; + +/* ioctls */ +#define CS_CONTROL_MAGIC 0xDE +#define IOC_CONTROL_WIDESCREEN _IOW(CS_CONTROL_MAGIC, 20, unsigned int) +#define IOC_CONTROL_TVAV _IOW(CS_CONTROL_MAGIC, 21, unsigned int) +#define IOC_CONTROL_RGB _IOW(CS_CONTROL_MAGIC, 22, unsigned int) +#define IOC_CONTROL_SCART_STATUS _IOR(CS_CONTROL_MAGIC, 23, scart_status_t *) +#define IOC_CONTROL_PWM_SPEED _IOW(CS_CONTROL_MAGIC, 24, unsigned int) +#define IOC_CONTROL_HDDPOWER _IOW(CS_CONTROL_MAGIC, 25, unsigned int) + +/* ioctl for getting board serial and revision */ +#define IOC_CONTROL_BOARD_SERIAL_LOW _IOR(CS_CONTROL_MAGIC, 26, unsigned int *) +#define IOC_CONTROL_BOARD_SERIAL_HIGH _IOR(CS_CONTROL_MAGIC, 27, unsigned int *) +#define IOC_CONTROL_BOARD_REV _IOR(CS_CONTROL_MAGIC, 28, unsigned int *) + +/* ioctl for setting TS routing */ +#define IOC_CONTROL_TSROUTE_GET_HSDP_CONFIG _IOR(CS_CONTROL_MAGIC, 29, tsrouter_hsdp_config_t *) +#define IOC_CONTROL_TSROUTE_SET_HSDP_CONFIG _IOW(CS_CONTROL_MAGIC, 30, tsrouter_tsp_config_t *) +#define IOC_CONTROL_TSROUTE_GET_TSP_CONFIG _IOR(CS_CONTROL_MAGIC, 31, tsrouter_hsdp_config_t *) +#define IOC_CONTROL_TSROUTE_SET_TSP_CONFIG _IOW(CS_CONTROL_MAGIC, 32, tsrouter_tsp_config_t *) + +#endif /* __CONTROL_H */ diff --git a/lib/libcoolstream/cs_api.h b/lib/libcoolstream/cs_api.h index 294b08c26..98c7430c0 100644 --- a/lib/libcoolstream/cs_api.h +++ b/lib/libcoolstream/cs_api.h @@ -9,7 +9,7 @@ #ifndef __CS_API_H_ #define __CS_API_H_ -#include +#include #include typedef void (*cs_messenger) (unsigned int msg, unsigned int data); diff --git a/lib/libcoolstream/cs_vfd.h b/lib/libcoolstream/cs_vfd.h new file mode 100755 index 000000000..13b4b933d --- /dev/null +++ b/lib/libcoolstream/cs_vfd.h @@ -0,0 +1,102 @@ +/* + * Driver for the Samsung HCR-13SS22 VF-Display connected to the Conexant + * CX2450x (Nevis) SoC via Coolstream VFD-Controller - public definititons. + * + * Copyright (C) 2008 Coolstream International Limited + */ + +#ifndef __CS_VFD__ +#define __CS_VFD__ + +typedef enum +{ + VFD_ICON_BAR8 = 0x00000004, + VFD_ICON_BAR7 = 0x00000008, + VFD_ICON_BAR6 = 0x00000010, + VFD_ICON_BAR5 = 0x00000020, + VFD_ICON_BAR4 = 0x00000040, + VFD_ICON_BAR3 = 0x00000080, + VFD_ICON_BAR2 = 0x00000100, + VFD_ICON_BAR1 = 0x00000200, + VFD_ICON_FRAME = 0x00000400, + VFD_ICON_HDD = 0x00000800, + VFD_ICON_MUTE = 0x00001000, + VFD_ICON_DOLBY = 0x00002000, + VFD_ICON_POWER = 0x00004000, + VFD_ICON_TIMESHIFT = 0x00008000, + VFD_ICON_SIGNAL = 0x00010000, + VFD_ICON_TV = 0x00020000, + VFD_ICON_RADIO = 0x00040000, + VFD_ICON_HD = 0x01000001, + VFD_ICON_1080P = 0x02000001, + VFD_ICON_1080I = 0x03000001, + VFD_ICON_720P = 0x04000001, + VFD_ICON_480P = 0x05000001, + VFD_ICON_480I = 0x06000001, + VFD_ICON_USB = 0x07000001, + VFD_ICON_MP3 = 0x08000001, + VFD_ICON_PLAY = 0x09000001, + VFD_ICON_COL1 = 0x09000002, + VFD_ICON_PAUSE = 0x0A000001, + VFD_ICON_CAM1 = 0x0B000001, + VFD_ICON_COL2 = 0x0B000002, + VFD_ICON_CAM2 = 0x0C000001 +} vfd_icon; + +typedef enum +{ + VFD_FLAG_NONE = 0x00, + VFD_FLAG_SCROLL_ON = 0x01, /* switch scrolling on */ + VFD_FLAG_SCROLL_LTR = 0x02, /* scroll from left to rightinstead of default right to left direction (i.e. for arabic text) */ + VFD_FLAG_SCROLL_SIO = 0x04, /* start/stop scrolling with empty screen (scroll in/out) */ + VFD_FLAG_SCROLL_DELAY = 0x08, /* delayed scroll start */ + VFD_FLAG_ALIGN_LEFT = 0x10, /* align the text in display from the left (default) */ + VFD_FLAG_ALIGN_RIGHT = 0x20, /* align the text in display from the right (arabic) */ + VFD_FLAG_UPDATE_SCROLL_POS = 0x40, /* update the current position for scrolling */ +} vfd_flag; + +typedef struct { + unsigned char brightness; + unsigned char flags; + unsigned char current_hour; + unsigned char current_minute; + unsigned char timer_minutes_hi; + unsigned char timer_minutes_lo; +} standby_data_t; + +typedef enum { + VFD_LED_1_ON = 0x81, + VFD_LED_2_ON = 0x82, + VFD_LED_3_ON = 0x83, + VFD_LED_1_OFF = 0x01, + VFD_LED_2_OFF = 0x02, + VFD_LED_3_OFF = 0x03, +} vfd_led_ctrl_t; + +typedef struct { + unsigned char source; + unsigned char time_minutes_hi; + unsigned char time_minutes_lo; +} wakeup_data_t; + +typedef enum +{ + WAKEUP_SOURCE_TIMER = 0x01, + WAKEUP_SOURCE_BUTTON = 0x02, + WAKEUP_SOURCE_REMOTE = 0x04, + WAKEUP_SOURCE_PWLOST = 0x7F, + WAKEUP_SOURCE_POWER = 0xFF +} wakeup_source; + +#define IOC_VFD_SET_BRIGHT _IOW(0xDE, 1, unsigned char) /* set the display brighness in 16 steps between 0 to 15 */ +#define IOC_VFD_CLEAR_ALL _IOW(0xDE, 2, unsigned int) /* clear the entire display (both text and icons) */ +#define IOC_VFD_SET_TEXT _IOW(0xDE, 3, char*) /* set a text to be displayed on the display. If arg == NULL, the text is cleared */ +#define IOC_VFD_SET_ICON _IOW(0xDE, 4, vfd_icon) /* switch the given icon on */ +#define IOC_VFD_CLEAR_ICON _IOW(0xDE, 5, vfd_icon) /* switch the given icon off */ +#define IOC_VFD_SET_OUTPUT _IOW(0xDE, 6, unsigned char) /* switch the given output on (supported by the controller, but not used in the hardware) */ +#define IOC_VFD_CLEAR_OUTPUT _IOW(0xDE, 7, unsigned char) /* switch the given output off (supported by the controller, but not used in the hardware) */ +#define IOC_VFD_STANDBY _IOW(0xDE, 8, standby_data_t *)/* switch the vfd/psu in standby (NEO and above only) */ +#define IOC_VFD_LED_CTRL _IOW(0xDE, 9, unsigned char) /* control the Frontpanles LED's (NEO and above only) */ +#define IOC_VFD_GET_WAKEUP _IOW(0xDE, 10,wakeup_data_t *) /* get wakeup data (NEO and above only) */ + +#endif /* __CS_VFD__ */ diff --git a/lib/libcoolstream/nevis_ir.h b/lib/libcoolstream/nevis_ir.h new file mode 100644 index 000000000..0774a150c --- /dev/null +++ b/lib/libcoolstream/nevis_ir.h @@ -0,0 +1,84 @@ +/* + * public definitions for the CX2450x Infrared receiver driver + * + * Copyright (C) 2008-2011 Coolstream International Limited + * + */ + +#ifndef __NEVIS_IR_H__ +#define __NEVIS_IR_H__ + +typedef enum +{ + IR_PROTOCOL_UNKNOWN = 0x00000, + IR_PROTOCOL_RMAP = 0x00001, /* Ruwido rMAP */ + IR_PROTOCOL_RMAP_E = 0x00002, /* Ruwido rMAP with extension for MNC Ltd sp. z o.o. */ + IR_PROTOCOL_NRC17 = 0x00004, /* Nokia NRC17 */ + IR_PROTOCOL_JVC = 0x00008, /* JVC */ + IR_PROTOCOL_RCA = 0x00010, /* RCA */ + IR_PROTOCOL_PSD = 0x00020, /* Precision Squared (not yet supported) */ + IR_PROTOCOL_RC5 = 0x00040, /* Philips RC5 */ + IR_PROTOCOL_RCMM = 0x00080, /* Philips RCMM */ + IR_PROTOCOL_RECS80 = 0x00100, /* Philips RECS80 */ + IR_PROTOCOL_NEC = 0x00200, /* NEC */ + IR_PROTOCOL_NECE = 0x00400, /* NEC with 16 bit address capability */ + IR_PROTOCOL_SCA = 0x00800, /* Scientific Atlanta */ + IR_PROTOCOL_MATSUSHITA = 0x01000, /* Matsushita (Technics/Panasonics) */ + IR_PROTOCOL_SONY = 0x02000, /* Sony SIRC 12 bit */ + IR_PROTOCOL_SONY15 = 0x04000, /* Sony SIRC 15 bit */ + IR_PROTOCOL_SONY20 = 0x08000, /* Sony SIRC 20 bit */ + IR_PROTOCOL_SONY24 = 0x10000, /* Sony SIRC 24 bit */ + IR_PROTOCOL_ALL = 0x1FFFF +} ir_protocol_t; + +typedef enum +{ + FP_MODE_KEYS_DISABLED = 0, + FP_MODE_KEYS_ENABLED = 1 +} fp_mode_t; + +#define EVENT_KEY_UP 0 +#define EVENT_KEY_DOWN 1 +#define NEVIS_IR_DEVICE_NAME "IR_NEVIS" + +/*******************************************************************************/ +/* DEBUG options */ +/*******************************************************************************/ + +#define DBG_NONE 0x00000000 /* no debug at all */ + +#define DBG_IR_SYSTEM 0x00000001 /* IR: low level informations */ +#define DBG_IR_DECODE 0x00000002 /* IR: informations from the IR protocol decoder */ +#define DBG_OUTPUT_QUEUE 0x00000004 /* IR: show data from the outgoing queue (from driver to the client(s) ) */ +#define DBG_IR_FOPS 0x00000008 /* IR: informations about filoe operations (ioctl's) */ + +#define DBG_VFD_SYSTEM 0x00010000 /* VFD: low level informations */ +#define DBG_VFD_FOPS 0x00080000 /* VFD: informations about filoe operations (ioctl's) */ + +/*******************************************************************************/ +/* ioctl's */ +/*******************************************************************************/ + +/* set the IR-protocols to listen for. */ +#define IOC_IR_SET_PRI_PROTOCOL _IOW(0xDD, 1, ir_protocol_t) /* set the primary IR-protocol */ +#define IOC_IR_SET_SEC_PROTOCOL _IOW(0xDD, 2, ir_protocol_t) /* set the secondary IR-protocol */ + +/* some IR-protocols can handle different device addresses. */ +#define IOC_IR_SET_PRI_ADDRESS _IOW(0xDD, 3, unsigned int) /* set the primary IR-address */ +#define IOC_IR_SET_SEC_ADDRESS _IOW(0xDD, 4, unsigned int) /* set the secondary IR-address */ + +/* defines the delay time between two pulses in milliseconds */ +#define IOC_IR_SET_F_DELAY _IOW(0xDD, 5, unsigned int) /* set the delay time before the first repetition */ +#define IOC_IR_SET_X_DELAY _IOW(0xDD, 6, unsigned int) /* set the delay time between all other repetitions */ + +/* load key mappings to translate from raw IR to Linux Input */ +#define IOC_IR_SET_PRI_KEYMAP _IOW(0xDD, 7, unsigned short *) /* set the primary keymap [num entries],[entry 1],[entry 2],...,[entry n] (max 0xFFFF entries) */ +#define IOC_IR_SET_SEC_KEYMAP _IOW(0xDD, 8, unsigned short *) /* set the secondary keymap [num entries],[entry 1],[entry 2],...,[entry n] (max 0xFFFF entries) */ + +/* frontpanel button options */ +#define IOC_IR_SET_FP_MODE _IOW(0xDD, 9, fp_mode_t) /* enable/disable frontpanel buttons */ + +/* informative stuff */ +#define IOC_IR_GET_PROTOCOLS _IOR(0xDD, 10, ir_protocol_t) /* reports a bitmask of all supported ir_protocols */ + +#endif /* __NEVIS_IR_H__ */ diff --git a/lib/libcoolstream/tsrouter.h b/lib/libcoolstream/tsrouter.h new file mode 100644 index 000000000..672d6721d --- /dev/null +++ b/lib/libcoolstream/tsrouter.h @@ -0,0 +1,32 @@ +#ifndef __TSROUTER_H +#define __TSROUTER_H + +typedef struct _tsrouter_hsdp_config { + u8 port; + u32 port_ctrl; + u32 pkt_ctrl; + u32 clk_ctrl; + u32 mux; + u32 int_en; + /* more ? */ +} tsrouter_hsdp_config_t; + +typedef struct _tsrouter_tsp_config { + u8 port; + u32 port_ctrl; + u32 mux; +} tsrouter_tsp_config_t; + +extern int cs_tsrouter_init(void); +extern void cs_tsrouter_exit(void); + +extern void cs_tsx_hsdp_init_port(u32 port, u32 ctrl); +extern void cs_tsx_tsp_init_port(u32 port, u32 hsdp_port); + +extern void cs_tsx_hsdp_get_port_config(tsrouter_hsdp_config_t *conf); +extern void cs_tsx_tsp_get_port_config(tsrouter_tsp_config_t *conf); + +extern void cs_tsx_hsdp_set_port_config(const tsrouter_hsdp_config_t *conf); +extern void cs_tsx_tsp_set_port_config(const tsrouter_tsp_config_t *conf); + +#endif /* __TSROUTER_H */ diff --git a/lib/libcoolstream/video_cs.h b/lib/libcoolstream/video_cs.h index a80d59051..251ec4058 100644 --- a/lib/libcoolstream/video_cs.h +++ b/lib/libcoolstream/video_cs.h @@ -9,8 +9,8 @@ #ifndef __VIDEO_CS_H_ #define __VIDEO_CS_H_ -#include -#include +#include +#include #include "cs_types.h" diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index f4788c98f..451a8751e 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -39,7 +39,7 @@ #include #include #ifdef HAVE_COOLSTREAM_NEVIS_IR_H -#include +#include #endif #ifndef KEY_OK diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 1f2b428da..d988fdd8f 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1650,18 +1650,18 @@ void CRecordManager::RestoreNeutrino(void) g_Sectionsd->setPauseScanning(false); } -bool CRecordManager::IsFileRecord(std::string file) +CRecordInstance* CRecordManager::getRecordInstance(std::string file) { mutex.lock(); for(recmap_iterator_t it = recmap.begin(); it != recmap.end(); it++) { CRecordInstance * inst = it->second; if ((((std::string)inst->GetFileName()) + ".ts") == file) { mutex.unlock(); - return true; + return inst; } } mutex.unlock(); - return false; + return NULL; } #if 0 diff --git a/src/driver/record.h b/src/driver/record.h index f7c3d0c12..6c8f914da 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -223,7 +223,7 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/ int GetRecordCount() { return recmap.size(); }; void StartTimeshift(); int GetRecordMode(const t_channel_id channel_id=0); - bool IsFileRecord(std::string file); + CRecordInstance* getRecordInstance(std::string file); // old code #if 0 bool IsTimeshift(t_channel_id channel_id=0); diff --git a/src/driver/vfd.h b/src/driver/vfd.h index 59e74363b..b7265a7a0 100644 --- a/src/driver/vfd.h +++ b/src/driver/vfd.h @@ -42,7 +42,7 @@ #include #include -#include +#include class CVFD { diff --git a/src/drivertool.c b/src/drivertool.c index 62f9ad991..f9fdc7f50 100644 --- a/src/drivertool.c +++ b/src/drivertool.c @@ -29,10 +29,10 @@ #include #include -#include +#include #ifdef HAVE_COOLSTREAM_NEVIS_IR_H -#include +#include #endif #ifndef IOC_IR_SET_PRI_PROTOCOL diff --git a/src/eitd/SIevents.hpp b/src/eitd/SIevents.hpp index 398f384b5..c1af74493 100644 --- a/src/eitd/SIevents.hpp +++ b/src/eitd/SIevents.hpp @@ -89,10 +89,13 @@ struct descr_linkage_header { struct descr_pdc_header { unsigned descriptor_tag : 8; +#if 0 + // unused unsigned descriptor_length : 8; unsigned pil0 : 8; unsigned pil1 : 8; unsigned pil2 : 8; +#endif } __attribute__ ((packed)) ; class SIlinkage { diff --git a/src/eitd/SIsections.hpp b/src/eitd/SIsections.hpp index 21b4df4b2..5862e1717 100644 --- a/src/eitd/SIsections.hpp +++ b/src/eitd/SIsections.hpp @@ -65,7 +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 struct SI_section_header { unsigned table_id : 8; #if __BYTE_ORDER == __BIG_ENDIAN @@ -94,7 +95,7 @@ struct SI_section_header { unsigned section_number : 8; unsigned last_section_number : 8; } __attribute__ ((packed)) ; // 8 bytes - +#endif class SIsectionEIT #ifdef USE_DVBSI_EVENTS : public EventInformationSection diff --git a/src/eitd/SIservices.hpp b/src/eitd/SIservices.hpp index 80f1f3f1b..4d6796c0a 100644 --- a/src/eitd/SIservices.hpp +++ b/src/eitd/SIservices.hpp @@ -51,7 +51,8 @@ public: { return uniqueKey() < ref.uniqueKey(); } - +#if 0 +//unused void toStream(char * &p) const { *(t_service_id *)p = service_id; p += sizeof(t_service_id); @@ -63,7 +64,7 @@ public: { return service_id; } - +#endif t_channel_id uniqueKey(void) const { return CREATE_CHANNEL_ID(service_id, original_network_id, transport_stream_id); // cf. zapittypes.h } @@ -115,11 +116,16 @@ public: is_actual = 0; } +#if 0 +// unused int eitScheduleFlag(void) { return (int)flags.EIT_schedule_flag; } int eitPresentFollowingFlag(void) { return (int)flags.EIT_present_following_flag; } +#endif int runningStatus(void) { return (int)flags.running_status; } +#if 0 +// unused int freeCAmode(void) { return (int)flags.free_CA_mode; } - +#endif bool operator < (const SIservice& s) const { return uniqueKey() < s.uniqueKey(); } diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index 6a73378e3..daba3d8a9 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -159,9 +159,6 @@ class CAudioPlayerGui : public CMenuTarget CFileFilter audiofilefilter; void paintItemID3DetailsLine (int pos); void clearItemID3DetailsLine (); - void play(unsigned int pos); - void stop(); - void pause(); void ff(unsigned int seconds=0); void rev(unsigned int seconds=0); int getNext(); @@ -248,8 +245,6 @@ class CAudioPlayerGui : public CMenuTarget bool openSCbrowser(void); bool clearPlaylist(void); bool shufflePlaylist(void); - bool playNext(bool allow_rotate = false); - bool playPrev(bool allow_rotate = false); bool pictureviewer; @@ -260,6 +255,12 @@ class CAudioPlayerGui : public CMenuTarget int exec(CMenuTarget* parent, const std::string & actionKey); void wantNextPlay(); + void pause(); + void play(unsigned int pos); + void stop(); + bool playNext(bool allow_rotate = false); + bool playPrev(bool allow_rotate = false); + int getAdioPayerM_currend() {return m_current;} }; diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index 2ace53420..cc82a2470 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -333,7 +333,7 @@ int CCAMMenuHandler::handleCamMsg (const neutrino_msg_t msg, neutrino_msg_data_t menu->addItem(new CMenuForwarderNonLocalized(convertDVBUTF8(sptr, strlen(sptr), 0).c_str(), false)); } } - for(i = 0; i < pMenu->choice_nb; i++) { + for(i = 0; (i < pMenu->choice_nb) && (i < MAX_MMI_ITEMS); i++) { snprintf(cnt, sizeof(cnt), "%d", i); if(sublevel) menu->addItem(new CMenuForwarderNonLocalized(convertDVBUTF8(pMenu->choice_item[i], strlen(pMenu->choice_item[i]), 0).c_str(), true, NULL, selector, cnt)); diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 4103b6fe6..c3ab392b1 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -694,8 +694,8 @@ void EpgPlus::init() CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); CFrameBuffer::getInstance()->getIconSize(NEUTRINO_ICON_BUTTON_HELP, &icol_w, &h2); - if(icol_h < h2) - icol_h = h2; +// if(icol_h < h2) +// icol_h = h2; int buttonHeight = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight()+8; //TODO get height from buttons/*std::max (icol_h+8, fonts[EPGPlus_footer_fontbuttons]->getHeight());*/ int footerHeight = Footer::getUsedHeight() + buttonHeight; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 0ff9a2ea1..76c218db5 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -576,21 +576,24 @@ void CInfoViewer::check_channellogo_ca_SettingsChange() void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap, int epgpos) { if(channel) { + showTitle(channel->number, channel->getName(), channel->getSatellitePosition(), - channel->getChannelID(), calledFromNumZap, epgpos); + channel->getChannelID(), calledFromNumZap, epgpos, channel->pname); } } void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int epgpos) { + CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(chid); + if(channel) { showTitle(channel->number, channel->getName(), channel->getSatellitePosition(), - channel->getChannelID(), calledFromNumZap, epgpos); + channel->getChannelID(), calledFromNumZap, epgpos, channel->pname); } } -void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, const t_satellite_position satellitePosition, const t_channel_id new_channel_id, const bool calledFromNumZap, int epgpos) +void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, const t_satellite_position satellitePosition, const t_channel_id new_channel_id, const bool calledFromNumZap, int epgpos, char *pname) { check_channellogo_ca_SettingsChange(); aspectRatio = 0; @@ -718,6 +721,19 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con ChanNameX + 10 + ChanNumWidth, ChanNameY + time_height, BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 - ChanNumWidth, ChannelName, color /*COL_INFOBAR*/, 0, true); // UTF-8 + //provider name + if(g_settings.infobar_show_channeldesc && pname){ + std::string prov_name = pname; + prov_name=prov_name.substr(prov_name.find_first_of("]")+1); + + int chname_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth (ChannelName); + chname_width += (chname_width/(ChannelName.size()-1)/2); + 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 + } + } } diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index daf68709e..33dc0d3df 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -156,7 +156,7 @@ class CInfoViewer void start(); void showEpgInfo(); - void showTitle(const int ChanNum, const std::string & Channel, const t_satellite_position satellitePosition, const t_channel_id new_channel_id = 0, const bool calledFromNumZap = false, int epgpos = 0); // Channel must be UTF-8 encoded + void showTitle(const int ChanNum, const std::string & Channel, const t_satellite_position satellitePosition, const t_channel_id new_channel_id = 0, const bool calledFromNumZap = false, int epgpos = 0, char *pname=NULL); // Channel must be UTF-8 encoded void showTitle(CZapitChannel * channel, const bool calledFromNumZap = false, int epgpos = 0); void showTitle(t_channel_id channel_id, const bool calledFromNumZap = false, int epgpos = 0); void lookAheadEPG(const int ChanNum, const std::string & Channel, const t_channel_id new_channel_id = 0, const bool calledFromNumZap = false); //alpha: fix for nvod subchannel update diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index bd717fd4c..cde8bfbe1 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -316,19 +316,19 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) mc1->setHint("", LOCALE_MENU_HINT_EPG_SAVE_STANDBY); CStringInput * miscSettings_epg_cache = new CStringInput(LOCALE_MISCSETTINGS_EPG_CACHE, &g_settings.epg_cache, 2,LOCALE_MISCSETTINGS_EPG_CACHE_HINT1, LOCALE_MISCSETTINGS_EPG_CACHE_HINT2 , "0123456789 ", sectionsdConfigNotifier); - CMenuForwarder * mf = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_CACHE, g_settings.epg_save, g_settings.epg_cache, miscSettings_epg_cache); + CMenuForwarder * mf = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_CACHE, true, g_settings.epg_cache, miscSettings_epg_cache); mf->setHint("", LOCALE_MENU_HINT_EPG_CACHE); CStringInput * miscSettings_epg_cache_e = new CStringInput(LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE, &g_settings.epg_extendedcache, 3,LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE_HINT1, LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE_HINT2 , "0123456789 ", sectionsdConfigNotifier); - CMenuForwarder * mf1 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE, g_settings.epg_save, g_settings.epg_extendedcache, miscSettings_epg_cache_e); + CMenuForwarder * mf1 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE, true, g_settings.epg_extendedcache, miscSettings_epg_cache_e); mf1->setHint("", LOCALE_MENU_HINT_EPG_EXTENDEDCACHE); CStringInput * miscSettings_epg_old_events = new CStringInput(LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, &g_settings.epg_old_events, 3,LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT2 , "0123456789 ", sectionsdConfigNotifier); - CMenuForwarder * mf2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, g_settings.epg_save, g_settings.epg_old_events, miscSettings_epg_old_events); + CMenuForwarder * mf2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, true, g_settings.epg_old_events, miscSettings_epg_old_events); mf2->setHint("", LOCALE_MENU_HINT_EPG_OLD_EVENTS); CStringInput * miscSettings_epg_max_events = new CStringInput(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, &g_settings.epg_max_events, 6,LOCALE_MISCSETTINGS_EPG_MAX_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_MAX_EVENTS_HINT2 , "0123456789 ", sectionsdConfigNotifier); - CMenuForwarder * mf3 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, g_settings.epg_save, g_settings.epg_max_events, miscSettings_epg_max_events); + CMenuForwarder * mf3 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, true, g_settings.epg_max_events, miscSettings_epg_max_events); mf3->setHint("", LOCALE_MENU_HINT_EPG_MAX_EVENTS); CMenuForwarder * mf4 = new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_DIR, g_settings.epg_save, g_settings.epg_dir, this, "epgdir"); @@ -336,10 +336,10 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) miscEpgNotifier = new COnOffNotifier(); miscEpgNotifier->addItem(mc1); - miscEpgNotifier->addItem(mf); - miscEpgNotifier->addItem(mf1); - miscEpgNotifier->addItem(mf2); - miscEpgNotifier->addItem(mf3); + //miscEpgNotifier->addItem(mf); + //miscEpgNotifier->addItem(mf1); + //miscEpgNotifier->addItem(mf2); + //miscEpgNotifier->addItem(mf3); miscEpgNotifier->addItem(mf4); CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE, &g_settings.epg_save, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true,miscEpgNotifier); diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 2311d74cf..0aab3ced7 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -371,6 +371,7 @@ CMovieBrowser::~CMovieBrowser() m_playListLines.lineArray[i].clear(); m_FilterLines.lineArray[i].clear(); } + m_browserListLines.Icon.clear(); } void CMovieBrowser::fileInfoStale(void) @@ -399,6 +400,7 @@ void CMovieBrowser::fileInfoStale(void) m_playListLines.lineArray[i].clear(); m_FilterLines.lineArray[i].clear(); } + m_browserListLines.Icon.clear(); }; void CMovieBrowser::init(void) @@ -511,7 +513,6 @@ void CMovieBrowser::init(void) refreshBrowserList(); refreshFilterList(); g_PicViewer->getSupportedImageFormats(PicExts); - IsRecord = false; #if 0 TRACE_1("Frames\r\n\tScren:\t%3d,%3d,%3d,%3d\r\n\tMain:\t%3d,%3d,%3d,%3d\r\n\tTitle:\t%3d,%3d,%3d,%3d \r\n\tBrowsr:\t%3d,%3d,%3d,%3d \r\n\tPlay:\t%3d,%3d,%3d,%3d \r\n\tRecord:\t%3d,%3d,%3d,%3d\r\n\r\n", g_settings.screen_StartX, @@ -929,6 +930,7 @@ int CMovieBrowser::exec(const char* path) m_recordListLines.lineArray[i].clear(); m_playListLines.lineArray[i].clear(); } + m_browserListLines.Icon.clear(); m_selectedDir = path; @@ -1222,18 +1224,16 @@ void CMovieBrowser::refreshMovieInfo(void) m_pcInfo->setText(&emptytext); } else { - // Is record? - bool tmp = CRecordManager::getInstance()->IsFileRecord(m_movieSelectionHandler->file.Name); - if (tmp != IsRecord) { - IsRecord = tmp; - refreshFoot(); - } - bool logo_ok = false; int picw = m_cBoxFrameInfo.iHeight * 16 / 9; int pich = m_cBoxFrameInfo.iHeight; std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name); - logo_ok = (fname != ""); + if(fname.empty()) { + std::string cover = m_movieSelectionHandler->file.Name; + cover.replace((cover.length()-18),15,""); //covername without yyyymmdd_hhmmss + fname = getScreenshotName(cover); + } + logo_ok = (!fname.empty()); int flogo_w = 0, flogo_h = 0; if(logo_ok) { g_PicViewer->getSize(fname.c_str(), &flogo_w, &flogo_h); @@ -1510,6 +1510,7 @@ void CMovieBrowser::refreshBrowserList(void) //P1 m_browserListLines.lineArray[row].clear(); m_browserListLines.rowWidth[row] = m_settings.browserRowWidth[row]; m_browserListLines.lineHeader[row]= g_Locale->getText(m_localizedItemName[m_settings.browserRowItem[row]]); + m_browserListLines.Icon.clear(); } m_vHandleBrowserList.clear(); @@ -1547,8 +1548,13 @@ void CMovieBrowser::refreshBrowserList(void) //P1 if(m_settings.browserRowItem[row] == MB_INFO_TITLE) getMovieInfoItem(*m_vHandleBrowserList[handle], MB_INFO_FILENAME, &string_item); } + m_browserListLines.lineArray[row].push_back(string_item); } + if (CRecordManager::getInstance()->getRecordInstance(m_vHandleBrowserList[handle]->file.Name) != NULL) + m_browserListLines.Icon.push_back(NEUTRINO_ICON_REC); + else + m_browserListLines.Icon.push_back(""); } m_pcBrowser->setLines(&m_browserListLines); @@ -1632,13 +1638,9 @@ void CMovieBrowser::refreshFoot(void) m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_OKAY, &iw, &ih); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, m_cBoxFrame.iX+xpos1+width*2, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*2 + 10 + iw, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, ok_text.c_str(), (CFBWindow::color_t)color, 0, true); // UTF-8 - - if (IsRecord == false) { - //delete icon - m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_SMALL, &iw, &ih); - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, m_cBoxFrame.iX+xpos1+width*3, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); - m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*3 + 10 + iw , m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), (CFBWindow::color_t)color, 0, true); // UTF-8 - } + m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_SMALL, &iw, &ih); + m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, m_cBoxFrame.iX+xpos1+width*3, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); + m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*3 + 10 + iw , m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), (CFBWindow::color_t)color, 0, true); // UTF-8 } @@ -1734,8 +1736,32 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } else if (msg == CRCInput::RC_spkr) { - if ((!m_vMovieInfo.empty()) && (m_movieSelectionHandler != NULL) && (IsRecord == false)) - onDeleteFile(*m_movieSelectionHandler); + if ((!m_vMovieInfo.empty()) && (m_movieSelectionHandler != NULL)) { + bool onDelete = true; + bool skipAsk = false; + CRecordInstance* inst = CRecordManager::getInstance()->getRecordInstance(m_movieSelectionHandler->file.Name); + if (inst != NULL) { + std::string delName = m_movieSelectionHandler->epgTitle; + if (delName == "") + delName = m_movieSelectionHandler->file.getFileName(); + char buf1[1024]; + memset(buf1, '\0', sizeof(buf1)); + snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_MOVIEBROWSER_ASK_REC_TO_DELETE), delName.c_str()); + if(ShowMsgUTF(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, + CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrNo) + onDelete = false; + else { + CTimerd::RecordingStopInfo recinfo; + recinfo.channel_id = inst->GetChannelId(); + recinfo.eventID = inst->GetRecordingId(); + CRecordManager::getInstance()->Stop(&recinfo); + g_Timerd->removeTimerEvent(recinfo.eventID); + skipAsk = true; + } + } + if (onDelete) + onDeleteFile(*m_movieSelectionHandler, skipAsk); + } } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { @@ -2039,7 +2065,7 @@ bool CMovieBrowser::onButtonPressMovieInfoList(neutrino_msg_t msg) return (result); } -void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler) +void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler, bool skipAsk) { //TRACE( "[onDeleteFile] "); int test= movieSelectionHandler.file.Name.find(".ts"); @@ -2062,8 +2088,10 @@ void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler) msg += "\r\n "; msg += g_Locale->getText(LOCALE_FILEBROWSER_DODELETE2); - if (ShowMsgUTF(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes) + if ((skipAsk) || (ShowMsgUTF(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes)) { + CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MOVIEBROWSER_DELETE_INFO)); + hintBox->paint(); delFile(movieSelectionHandler.file); #if 1 @@ -2090,6 +2118,9 @@ void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler) //delFile(file_xml); unlink(file_xml.Name.c_str()); } + hintBox->hide(); + delete hintBox; + g_RCInput->clearRCMsg(); m_vMovieInfo.erase( (std::vector::iterator)&movieSelectionHandler); TRACE("List size: %d\n", (int)m_vMovieInfo.size()); diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index 1b3c89712..154b7364f 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -294,8 +294,6 @@ class CMovieBrowser : public CMenuTarget MB_SETTINGS m_settings; std::vector m_dir; - bool IsRecord; - int movieInfoUpdateAll[MB_INFO_MAX_NUMBER]; int movieInfoUpdateAllIfDestEmptyOnly; @@ -368,7 +366,7 @@ class CMovieBrowser : public CMenuTarget void onSetGUIWindow(MB_GUI gui); void onSetGUIWindowNext(void); void onSetGUIWindowPrev(void); - void onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler); // P4 + void onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler, bool skipAsk = false); // P4 bool onSortMovieInfoHandleList(std::vector& pv_handle_list, MB_INFO_ITEM sort_type, MB_DIRECTION direction); ///// parse Storage Directories ///////////// diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index d7448e47a..ebbd1dc17 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -524,7 +524,9 @@ void CMoviePlayerGui::PlayFile(void) #ifdef DEBUG printf("CMoviePlayerGui::PlayFile: speed %d position %d duration %d (%d, %d%%)\n", speed, position, duration, duration-position, file_prozent); #endif - if (duration - position < 1000 && !timeshift) + /* in case ffmpeg report incorrect values */ + int posdiff = duration - position; + if ((posdiff > 0) && (posdiff < 1000) && !timeshift) { /* 10 seconds after end-of-file, stop */ if (++eof > 10) diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index cbbdc961d..730705e69 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -101,6 +101,9 @@ CPictureViewerGui::CPictureViewerGui() picture_filter.addFilter("jpeg"); picture_filter.addFilter("gif"); picture_filter.addFilter("crw"); + + decodeT = 0; + decodeTflag = false; } //------------------------------------------------------------------------ @@ -109,6 +112,12 @@ CPictureViewerGui::~CPictureViewerGui() { playlist.clear(); delete m_viewer; + + if (decodeT) + { + pthread_cancel(decodeT); + decodeT = 0; + } } //------------------------------------------------------------------------ @@ -225,6 +234,9 @@ int CPictureViewerGui::show() bool loop=true; bool update=true; + if (audioplayer) + m_currentTitle = m_audioPlayer->getAdioPayerM_currend(); + while (loop) { if (update) @@ -545,6 +557,35 @@ int CPictureViewerGui::show() CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_PICTUREVIEWER_HEAD)); } } + else if (((msg==CRCInput::RC_plus) || (msg==CRCInput::RC_minus)) && decodeTflag) + { + // FIXME: do not accept volume-keys while decoding + } + // control keys for audioplayer + else if (audioplayer && msg==CRCInput::RC_pause) + { + m_currentTitle = m_audioPlayer->getAdioPayerM_currend(); + m_audioPlayer->pause(); + } + else if (audioplayer && msg==CRCInput::RC_stop) + { + m_currentTitle = m_audioPlayer->getAdioPayerM_currend(); + m_audioPlayer->stop(); + } + else if (audioplayer && msg==CRCInput::RC_play) + { + m_currentTitle = m_audioPlayer->getAdioPayerM_currend(); + if (m_currentTitle > -1) + m_audioPlayer->play((unsigned int)m_currentTitle); + } + else if (audioplayer && msg==CRCInput::RC_forward) + { + m_audioPlayer->playNext(); + } + else if (audioplayer && msg==CRCInput::RC_rewind) + { + m_audioPlayer->playPrev(); + } else if (msg == NeutrinoMessages::CHANGEMODE) { if ((data & NeutrinoMessages::mode_mask) !=NeutrinoMessages::mode_pic) @@ -726,6 +767,10 @@ void CPictureViewerGui::paint() void CPictureViewerGui::view(unsigned int index, bool unscaled) { + if (decodeTflag) + return; + + m_unscaled = unscaled; selected=index; CVFD::getInstance()->showMenuText(0, playlist[index].Name.c_str()); @@ -733,26 +778,59 @@ void CPictureViewerGui::view(unsigned int index, bool unscaled) strftime(timestring, 18, "%d-%m-%Y %H:%M", gmtime(&playlist[index].Date)); //CVFD::getInstance()->showMenuText(1, timestring); //FIXME - if (unscaled) - m_viewer->DecodeImage(playlist[index].Filename, true, unscaled); - m_viewer->ShowImage(playlist[index].Filename, unscaled); + if (m_state==MENU) + m_state=VIEW; + //decode and view in a seperate thread + if (!decodeTflag) { + decodeTflag=true; + pthread_create(&decodeT, NULL, decodeThread, (void*) this); + pthread_detach(decodeT); + } +} + +void* CPictureViewerGui::decodeThread(void *arg) +{ + CPictureViewerGui *PictureViewerGui = (CPictureViewerGui*) arg; + + pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL); + pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL); + + PictureViewerGui->thrView(); + + PictureViewerGui->decodeTflag=false; + pthread_exit(NULL); +} + +void CPictureViewerGui::thrView() +{ + if (m_unscaled) + m_viewer->DecodeImage(playlist[selected].Filename, true, m_unscaled); + + m_viewer->ShowImage(playlist[selected].Filename, m_unscaled); + +#if 0 //Decode next unsigned int next=selected+1; if (next > playlist.size()-1) next=0; - if (m_state==MENU) - m_state=VIEW; if (m_state==VIEW) m_viewer->DecodeImage(playlist[next].Filename,true); else m_viewer->DecodeImage(playlist[next].Filename,false); +#endif } void CPictureViewerGui::endView() { if (m_state != MENU) m_state=MENU; + + if (decodeTflag) + { + decodeTflag=false; + pthread_cancel(decodeT); + } } void CPictureViewerGui::deletePicFile(unsigned int index, bool mode) @@ -782,24 +860,32 @@ void CPictureViewerGui::showHelp() helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP5)); helpbox.addLine(NEUTRINO_ICON_BUTTON_LEFT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP6)); helpbox.addLine(NEUTRINO_ICON_BUTTON_RIGHT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP7)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP8)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_HOME, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP9)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP3)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_HOME, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP8)); helpbox.addPagebreak(); - helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP10)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_OKAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP11)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_LEFT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP12)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_RIGHT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP13)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_1, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP14)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_3, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP15)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_2, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP16)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_4, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP17)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_6, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP18)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_8, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP19)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP20)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_0, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP21)); - helpbox.addLine(NEUTRINO_ICON_BUTTON_HOME, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP22)); - - helpbox.addLine("Version: $Revision: 1.57 $"); + helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP9)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_OKAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP10)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_LEFT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP11)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_RIGHT, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP12)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_1, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP13)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_3, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP14)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_2, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP15)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_4, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP16)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_6, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP17)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_8, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP18)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP3)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_0, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP19)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_HOME, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP8)); + if(audioplayer) + { + helpbox.addPagebreak(); + helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP30)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_PLAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP31)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_PAUSE, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP32)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_STOP, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP33)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_FORWARD, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP34)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_BACKWARD, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP35)); + } hide(); helpbox.show(LOCALE_MESSAGEBOX_INFO); } diff --git a/src/gui/pictureviewer.h b/src/gui/pictureviewer.h index 0909d6ef4..4e98071ae 100644 --- a/src/gui/pictureviewer.h +++ b/src/gui/pictureviewer.h @@ -111,6 +111,14 @@ class CPictureViewerGui : public CMenuTarget void deletePicFile(unsigned int index, bool mode); bool audioplayer; + int m_currentTitle; + + pthread_t decodeT; + static void* decodeThread(void *arg); + bool decodeTflag; + + void thrView(); + bool m_unscaled; public: CPictureViewerGui(); diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index fe7a361e8..a26c28d96 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -155,7 +155,7 @@ void CPlugins::loadPlugins() frameBuffer = CFrameBuffer::getInstance(); number_of_plugins = 0; plugin_list.clear(); - + sindex = 100; scanDir(g_settings.plugin_hdd_dir.c_str()); scanDir(PLUGINDIR_USB); scanDir(PLUGINDIR_VAR); @@ -183,7 +183,7 @@ bool CPlugins::parseCfg(plugin *plugin_data) while (linecount < 20 && getline(inFile, line[linecount++])) {}; - plugin_data->index = 0; + plugin_data->index = sindex++; plugin_data->key = 0; //CRCInput::RC_nokey plugin_data->fb = false; plugin_data->rc = false; diff --git a/src/gui/plugins.h b/src/gui/plugins.h index f37cc0704..501e6172c 100644 --- a/src/gui/plugins.h +++ b/src/gui/plugins.h @@ -88,7 +88,7 @@ class CPlugins }; int number_of_plugins; - + int sindex; std::vector plugin_list; std::string plugin_dir; std::string scriptOutput; diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index cf580aeb9..e274d240a 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -737,6 +737,21 @@ void CTimerList::paintItem(int pos) g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*23)/2,ypos+fheight, (real_width-fw*13)/2-5, srepeatcount, color, fheight, true); // UTF-8 } g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*13)/2,ypos+fheight, (real_width-fw*13)/2-5, convertTimerType2String(timer.eventType), color, fheight, true); // UTF-8 + + // paint rec icon when recording in progress + if ((timer.eventType == CTimerd::TIMER_RECORD) && (CRecordManager::getInstance()->RecordingStatus(timer.channel_id))) { + CTimerd::RecordingStopInfo recinfo; + recinfo.channel_id = timer.channel_id; + recinfo.eventID = timer.eventID; + if (CRecordManager::getInstance()->IsRecording(&recinfo)) { + int icol_w, icol_h; + frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icol_w, &icol_h); + if ((icol_w > 0) && (icol_h > 0)) { + frameBuffer->paintIcon(NEUTRINO_ICON_REC, (x + real_width) - (icol_w + 8), ypos, 2*fheight); + } + } + } + std::string zAddData(""); switch (timer.eventType) { @@ -764,7 +779,7 @@ void CTimerList::paintItem(int pos) { zAddData += sep; zAddData += "AC3"; - sep = "/"; +// sep = "/"; } zAddData += ')'; } diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index c0563e985..2341dd164 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -403,9 +403,9 @@ void CVideoSettings::setupVideoSystem(bool do_ask) g_settings.video_Mode = prev_video_mode; videoDecoder->SetVideoSystem(g_settings.video_Mode); } + else + prev_video_mode = g_settings.video_Mode; } - else - prev_video_mode = g_settings.video_Mode; } } @@ -446,6 +446,7 @@ bool CVideoSettings::changeNotify(const neutrino_locale_t OptionName, void * /* else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_VIDEOMODE)) { setupVideoSystem(true/*ask*/); + return true; } #if 0 else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_CONTRAST)) diff --git a/src/gui/widget/hintboxext.cpp b/src/gui/widget/hintboxext.cpp index 813323e3b..7d2af4f4b 100644 --- a/src/gui/widget/hintboxext.cpp +++ b/src/gui/widget/hintboxext.cpp @@ -108,6 +108,7 @@ void CHintBoxExt::init(const neutrino_locale_t Caption, const int Width, const c int maxLineWidth = 0; int scrollWidth = 0; textStartX = 0; + bgPainted = false; m_caption = Caption; @@ -149,6 +150,11 @@ void CHintBoxExt::init(const neutrino_locale_t Caption, const int Width, const c m_maxEntriesPerPage = m_startEntryOfPage[page] - m_startEntryOfPage[page-1]; } } + else { + if (m_height > maxOverallHeight) + maxOverallHeight = m_height; + m_maxEntriesPerPage = maxOverallHeight / m_fheight; + } line++; } @@ -218,6 +224,7 @@ void CHintBoxExt::paint(bool toround) return; } + bgPainted = false; m_window = new CFBWindow(getScreenStartX(m_width + SHADOW_OFFSET), getScreenStartY(m_height + SHADOW_OFFSET), m_width + SHADOW_OFFSET, @@ -233,8 +240,11 @@ void CHintBoxExt::refresh(bool toround) return; } - // bottom, right shadow - m_window->paintBoxRel(SHADOW_OFFSET, SHADOW_OFFSET, m_width, m_height, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, toround ? CORNER_ALL : CORNER_BOTTOM | CORNER_TOP_RIGHT); + if (!bgPainted) { + // bottom, right shadow + m_window->paintBoxRel(SHADOW_OFFSET, SHADOW_OFFSET, m_width, m_height, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, toround ? CORNER_ALL : CORNER_BOTTOM | CORNER_TOP_RIGHT); + bgPainted = true; + } // title bar m_window->paintBoxRel(0, 0, m_width, m_theight, (CFBWindow::color_t)COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round diff --git a/src/gui/widget/hintboxext.h b/src/gui/widget/hintboxext.h index 2472d17f6..77d1dfc7e 100644 --- a/src/gui/widget/hintboxext.h +++ b/src/gui/widget/hintboxext.h @@ -64,6 +64,7 @@ class CHintBoxExt char * m_message; ContentLines m_lines; std::string m_iconfile; + bool bgPainted; void refresh(bool toround = 1); diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index fa5a77fdd..8a3685cc2 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -61,6 +61,10 @@ #define NEUTRINO_ICON_BUTTON_DOWN_SMALL "down_small" #define NEUTRINO_ICON_BUTTON_LEFT "left" +#define NEUTRINO_ICON_BUTTON_BACKWARD "btn_backward" +#define NEUTRINO_ICON_BUTTON_FORWARD "btn_forward" +#define NEUTRINO_ICON_BUTTON_PAUSE "btn_pause" +#define NEUTRINO_ICON_BUTTON_PLAY "btn_play" #define NEUTRINO_ICON_BUTTON_RECORD_ACTIVE "btn_record_active" #define NEUTRINO_ICON_BUTTON_RECORD_INACTIVE "btn_record_inactive" #define NEUTRINO_ICON_BUTTON_STOP "btn_stop" diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index 8a9678ede..437cdd0c9 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -389,6 +389,20 @@ void CListFrame::refreshScroll(void) } } +int CListFrame::paintListIcon(int x, int y, int line) +{ + int xDiff = 0; + if ((!m_pLines->Icon.empty()) && (m_pLines->Icon[line] != "")) { + int icol_w, icol_h; + frameBuffer->getIconSize(m_pLines->Icon[line].c_str(), &icol_w, &icol_h); + if ((icol_w > 0) && (icol_h > 0)) { + frameBuffer->paintIcon(m_pLines->Icon[line], x+m_cFrame.iX, y+m_cFrame.iY-m_nFontListHeight, m_nFontListHeight); + xDiff = icol_w + TEXT_BORDER_WIDTH; + } + } + return xDiff; +} + void CListFrame::refreshList(void) { //TRACE("[CListFrame]->refreshList: %d\r\n",m_nCurrentLine); @@ -417,6 +431,9 @@ void CListFrame::refreshList(void) int width; int x = m_cFrameListRel.iX + TEXT_BORDER_WIDTH; y += m_nFontListHeight; + + int xDiff = paintListIcon(x, y, line); + int net_width = m_cFrameListRel.iWidth - ROW_BORDER_WIDTH * (m_pLines->rows - 1); for(int row = 0; row < m_pLines->rows; row++) { @@ -426,8 +443,10 @@ void CListFrame::refreshList(void) width = m_cFrameListRel.iWidth - x + m_cFrameListRel.iX - TEXT_BORDER_WIDTH; //TRACE(" normalize width to %d , x:%d \r\n",width,x); } - m_pcFontList->RenderString(x+m_cFrame.iX, y+m_cFrame.iY, - width, m_pLines->lineArray[row][line].c_str(), + if (row > 0) + xDiff = 0; + m_pcFontList->RenderString(x+m_cFrame.iX+xDiff, y+m_cFrame.iY, + width-xDiff, m_pLines->lineArray[row][line].c_str(), color, 0, true); // UTF-8 x += width + ROW_BORDER_WIDTH; } @@ -462,13 +481,18 @@ void CListFrame::refreshLine(int line) int width; int x = m_cFrameListRel.iX + TEXT_BORDER_WIDTH; y += m_nFontListHeight; + + int xDiff = paintListIcon(x, y, line); + int net_width = m_cFrameListRel.iWidth - ROW_BORDER_WIDTH * (m_pLines->rows - 1); for(int row = 0; row < m_pLines->rows; row++) { width = std::min(m_pLines->rowWidth[row] * net_width / 100, m_cFrameListRel.iWidth - x + m_cFrameListRel.iX - TEXT_BORDER_WIDTH); - m_pcFontList->RenderString(x+m_cFrame.iX, y+m_cFrame.iY, - width, m_pLines->lineArray[row][line].c_str(), + if (row > 0) + xDiff = 0; + m_pcFontList->RenderString(x+m_cFrame.iX+xDiff, y+m_cFrame.iY, + width-xDiff, m_pLines->lineArray[row][line].c_str(), color, 0, true); // UTF-8 x += width + ROW_BORDER_WIDTH; } diff --git a/src/gui/widget/listframe.h b/src/gui/widget/listframe.h index ff457c8dd..f548bfd2b 100644 --- a/src/gui/widget/listframe.h +++ b/src/gui/widget/listframe.h @@ -63,6 +63,7 @@ typedef struct std::string lineHeader[LF_MAX_ROWS]; std::vector lineArray[LF_MAX_ROWS]; int rowWidth[LF_MAX_ROWS]; + std::vector Icon; }LF_LINES; class CListFrame @@ -78,6 +79,7 @@ class CListFrame void refreshHeaderList(void); void reSizeMainFrameWidth(int maxTextWidth); void reSizeMainFrameHeight(int maxTextHeight); + int paintListIcon(int x, int y, int line); /* Variables */ LF_LINES* m_pLines; diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index fc4ed6954..b7ce39f55 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -562,6 +562,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) if ((pos < (int)page_start[current_page + 1]) && (pos >= (int)page_start[current_page])) { items[selected]->paint( false ); item->paint( true ); + paintHint(pos); selected = pos; } else { selected=pos; @@ -579,6 +580,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) if ((pos < (int)page_start[current_page + 1]) && (pos >= (int)page_start[current_page])) { items[selected]->paint( false ); item->paint( true ); + paintHint(pos); selected = pos; } else { selected=pos; @@ -1151,6 +1153,7 @@ void CMenuWidget::paintHint(int pos) details_line->setYPos(ypos1a); details_line->setYPosDown(ypos2a); details_line->setHMarkDown(markh); + details_line->setColor(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENTDARK_PLUS_0); } details_line->paint(savescreen); @@ -1160,6 +1163,7 @@ void CMenuWidget::paintHint(int pos) info_box->setXPos(x); info_box->setYPos(ypos2); info_box->setWidth(iwidth); + info_box->setColor(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENTDARK_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); } /* force full paint - menu-over i.e. option chooser with pulldown can overwrite */ info_box->paint(savescreen, true); diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index eb274d559..fe347a7a6 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -169,7 +169,7 @@ void CProgressWindow::paint() ypos+= mheight; globalstatusY = ypos+ mheight-20; - ypos+= mheight >>1; + //ypos+= mheight >>1; showGlobalStatus(global_progress); } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 50262b155..2335451f7 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -410,6 +410,7 @@ int CNeutrinoApp::loadSetup(const char * fname) strcpy(g_settings.shutdown_min, configfile.getString("shutdown_min","180").c_str()); g_settings.infobar_sat_display = configfile.getBool("infobar_sat_display" , true ); + g_settings.infobar_show_channeldesc = configfile.getBool("infobar_show_channeldesc" , false ); g_settings.infobar_subchan_disp_pos = configfile.getInt32("infobar_subchan_disp_pos" , 0 ); g_settings.progressbar_color = configfile.getBool("progressbar_color", true ); g_settings.infobar_show = configfile.getInt32("infobar_show", 1); @@ -872,6 +873,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setString("shutdown_count" , g_settings.shutdown_count); configfile.setString("shutdown_min" , g_settings.shutdown_min ); configfile.setBool("infobar_sat_display" , g_settings.infobar_sat_display ); + configfile.setBool("infobar_show_channeldesc" , g_settings.infobar_show_channeldesc ); configfile.setInt32("infobar_subchan_disp_pos" , g_settings.infobar_subchan_disp_pos ); configfile.setBool("progressbar_color" , g_settings.progressbar_color ); configfile.setInt32("infobar_show", g_settings.infobar_show); @@ -1743,7 +1745,7 @@ void CNeutrinoApp::InitSectiondClient() } #if HAVE_COOL_HARDWARE -#include +#include #endif void wake_up(long &wakeup) @@ -1934,12 +1936,10 @@ fprintf(stderr, "[neutrino start] %d -> %5ld ms\n", __LINE__, time_monotonic_ms g_CamHandler->init(); #ifndef ASSUME_MDEV - const char hddsda1[] = "/media/sda1"; - const char hddsdb1[] = "/media/sdb1"; - mkdir(hddsda1, 0755); - mount("/dev/sda1", hddsda1, "ext3", 0, NULL); - mkdir(hddsdb1,0755); - mount("/dev/sdb1", hddsdb1, "ext3", 0, NULL); + mkdir("/media/sda1", 0755); + mkdir("/media/sdb1", 0755); + my_system("mount", "/dev/sda1", "/media/sda1"); + my_system("mount", "/dev/sdb1", "/media/sdb1"); #endif CFSMounter::automount(); @@ -2041,7 +2041,16 @@ void CNeutrinoApp::numericZap(int msg) void CNeutrinoApp::showInfo() { StopSubtitles(); - g_InfoViewer->showTitle(channelList->getActiveChannelNumber(), channelList->getActiveChannelName(), channelList->getActiveSatellitePosition(), channelList->getActiveChannel_ChannelID()); + + char *pname = NULL; + if(g_settings.infobar_show_channeldesc){ + CZapitChannel* channel = channelList->getActiveChannel(); + if(channel->pname){ + pname = channel->pname; + } + } + + g_InfoViewer->showTitle(channelList->getActiveChannelNumber(), channelList->getActiveChannelName(), channelList->getActiveSatellitePosition(), channelList->getActiveChannel_ChannelID(), false, 0, pname); StartSubtitles(); } @@ -2138,13 +2147,16 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) g_RemoteControl->subChannelDown(); g_InfoViewer->showSubchan(); } - else if (g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) { - g_volume->setVolume(msg, true); - } - else if((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) || (g_settings.mode_left_right_key_tv == SNeutrinoSettings::INFOBAR)) { - if(channelList->getSize()) { - showInfo(); - } + else if ( msg == CRCInput::RC_left || msg == CRCInput::RC_right) { + if (g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) { + g_volume->setVolume(msg, true); + } + else if((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) + || (g_settings.mode_left_right_key_tv == SNeutrinoSettings::INFOBAR)) { + if(channelList->getSize()) { + showInfo(); + } + } } else quickZap( msg ); diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index be0475da9..6e0f2ee99 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -34,18 +34,18 @@ #include #include #include -#include "gui/plugins.h"//for relodplugins +#include //for relodplugins #include #ifdef SCREENSHOT #include #endif -#include "gui/rc_lock.h" +#include // yhttpd -#include "yhttpd.h" -#include "ytypes_globals.h" -#include "ylogging.h" -#include "helper.h" +#include +#include +#include +#include // nhttpd #include "neutrinoapi.h" #include "controlapi.h" @@ -165,6 +165,7 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= {"epg", &CControlAPI::EpgCGI, ""}, {"zapto", &CControlAPI::ZaptoCGI, "text/plain"}, {"getonidsid", &CControlAPI::GetChannel_IDCGI, "text/plain"}, + {"currenttpchannels", &CControlAPI::GetTPChannel_IDCGI, "text/plain"}, // boxcontrol - system {"standby", &CControlAPI::StandbyCGI, "text/plain"}, {"shutdown", &CControlAPI::ShutdownCGI, "text/plain"}, @@ -224,7 +225,6 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= void CControlAPI::Execute(CyhookHandler *hh) { int index = -1; - std::string yresult; std::string filename = hh->UrlData["filename"]; log_level_printf(4,"ControlAPI.Execute filename:(%s)\n",filename.c_str()); @@ -536,6 +536,12 @@ void CControlAPI::GetChannel_IDCGI(CyhookHandler *hh) hh->printf("%x%04x%04x\n",current_pids.tsid, current_pids.onid, current_pids.sid); } +// get actual channel_id +void CControlAPI::GetTPChannel_IDCGI(CyhookHandler *hh) +{ + SendChannelList(hh, true); +} + //----------------------------------------------------------------------------- void CControlAPI::MessageCGI(CyhookHandler *hh) { @@ -566,7 +572,7 @@ void CControlAPI::MessageCGI(CyhookHandler *hh) if (event != 0) { - message=decodeString(message); + //message=decodeString(message); NeutrinoAPI->EventServer->sendEvent(event, CEventServer::INITID_HTTPD, (void *) message.c_str(), message.length() + 1); hh->SendOk(); } @@ -896,7 +902,6 @@ void CControlAPI::ChannellistCGI(CyhookHandler *hh) std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChannel * channel) { std::string result, firstEPG, secondEPG = ""; t_channel_id current_channel = CZapit::getInstance()->GetCurrentChannelID(); - int percentage = 100; std::string timestr; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; @@ -904,6 +909,7 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann event = NeutrinoAPI->ChannelListEvents[channel->channel_id]; if (event) { + int percentage = 100; if (event->duration > 0) percentage = 100 * (time(NULL) - event->startTime) / event->duration; CEitManager::getInstance()->getCurrentNextServiceKey(channel->channel_id, currentNextInfo); @@ -1370,7 +1376,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { else if (hh->ParamList.empty() || hh->ParamList["1"] == "ext") { hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); bool isExt = (hh->ParamList["1"] == "ext"); - CChannelEvent *event; + CChannelEvent *event = NULL; NeutrinoAPI->GetChannelEvents(); int mode = NeutrinoAPI->Zapit->getMode(); @@ -1393,7 +1399,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { // query details for given eventid else if (hh->ParamList["eventid"] != "") { //special epg query - uint64_t epgid; + uint64_t epgid = 0; sscanf(hh->ParamList["eventid"].c_str(), "%" SCNu64 "", &epgid); CShortEPGData epg; if (CEitManager::getInstance()->getEPGidShort(epgid, &epg)) { @@ -1404,8 +1410,8 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { } else if (hh->ParamList["eventid2fsk"] != "") { if (hh->ParamList["starttime"] != "") { - uint64_t epgid; - time_t starttime; + uint64_t epgid = 0; + time_t starttime = 0; sscanf(hh->ParamList["fskid"].c_str(), "%" SCNu64 "", &epgid); sscanf(hh->ParamList["starttime"].c_str(), "%lu", &starttime); CEPGData longepg; @@ -1418,7 +1424,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { } // list EPG for channel id else if (!(hh->ParamList["id"].empty())) { - t_channel_id channel_id; + t_channel_id channel_id = 0; sscanf(hh->ParamList["id"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id); CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList); CChannelEventList::iterator eventIterator; @@ -1435,7 +1441,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { // list EPG for channelID 64Bit else { //eventlist for a chan - t_channel_id channel_id; + t_channel_id channel_id = 0; sscanf(hh->ParamList["1"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id); SendEventList(hh, channel_id); } @@ -1604,17 +1610,22 @@ void CControlAPI::SendEventList(CyhookHandler *hh, t_channel_id channel_id) } //----------------------------------------------------------------------------- -void CControlAPI::SendChannelList(CyhookHandler *hh) +void CControlAPI::SendChannelList(CyhookHandler *hh, bool currentTP) { + t_channel_id current_channel = 0; + if(currentTP){ + current_channel = CZapit::getInstance()->GetCurrentChannelID(); + current_channel=(current_channel>>16); + } + int mode = NeutrinoAPI->Zapit->getMode(); hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); CBouquetManager::ChannelIterator cit = mode == CZapitClient::MODE_RADIO ? g_bouquetManager->radioChannelsBegin() : g_bouquetManager->tvChannelsBegin(); for (; !(cit.EndOfChannels()); cit++) { CZapitChannel * channel = *cit; - hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS - " %s\n", - channel->channel_id, - channel->getName().c_str()); + if(!currentTP || (channel->channel_id >>16) == current_channel){ + hh->printf(PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS " %s\n", channel->channel_id, channel->getName().c_str()); + } } } @@ -2012,10 +2023,9 @@ void CControlAPI::SendTimersXML(CyhookHandler *hh) void CControlAPI::YWebCGI(CyhookHandler *hh) { bool status=true; - int para; if (hh->ParamList["video_stream_pids"] != "") { - para=0; + int para=0; sscanf( hh->ParamList["video_stream_pids"].c_str(), "%d", ¶); YWeb_SendVideoStreamingPids(hh, para); } @@ -2078,7 +2088,7 @@ std::string CControlAPI::YexecuteScript(CyhookHandler *, std::string cmd) // get file std::string fullfilename; script += ".sh"; //add script extention - char cwd[255]; + char cwd[255]={0}; getcwd(cwd, 254); for (unsigned int i=0; itm_sec = 0; - strptime(hh->ParamList["alDate"].c_str(), "%d.%m.%Y", alarmTime); + if(sscanf(hh->ParamList["alDate"].c_str(),"%2d.%2d.%4d",&(alarmTime->tm_mday), &(alarmTime->tm_mon), &(alarmTime->tm_year)) == 3) + { + alarmTime->tm_mon -= 1; + alarmTime->tm_year -= 1900; + } // Alarm Time - Format exact! HH:MM if(hh->ParamList["alTime"] != "") - strptime(hh->ParamList["alTime"].c_str(), "%H:%M", alarmTime); + sscanf(hh->ParamList["alTime"].c_str(),"%2d.%2d",&(alarmTime->tm_hour), &(alarmTime->tm_min)); alHour = alarmTime->tm_hour; - correctTime(alarmTime); alarmTimeT = mktime(alarmTime); announceTimeT = alarmTimeT; @@ -2160,12 +2173,15 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) stopTime->tm_sec = 0; // Stop Time - Format exact! HH:MM if(hh->ParamList["stTime"] != "") - strptime(hh->ParamList["stTime"].c_str(), "%H:%M", stopTime); + sscanf(hh->ParamList["stTime"].c_str(),"%2d.%2d",&(stopTime->tm_hour), &(stopTime->tm_min)); // Stop Date - Format exact! DD.MM.YYYY if(hh->ParamList["stDate"] != "") - strptime(hh->ParamList["stDate"].c_str(), "%d.%m.%Y", stopTime); - stopTime->tm_sec = 0; + if(sscanf(hh->ParamList["stDate"].c_str(),"%2d.%2d.%4d",&(stopTime->tm_mday), &(stopTime->tm_mon), &(stopTime->tm_year)) == 3) + { + stopTime->tm_mon -= 1; + stopTime->tm_year -= 1900; + } correctTime(stopTime); stopTimeT = mktime(stopTime); if(hh->ParamList["stDate"] == "" && alHour > stopTime->tm_hour) @@ -2227,9 +2243,9 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) rep = (CTimerd::CTimerEventRepeat) atoi(hh->ParamList["rep"].c_str()); else // default: no repeat rep = (CTimerd::CTimerEventRepeat)0; - if(((int)rep) >= ((int)CTimerd::TIMERREPEAT_WEEKDAYS) && hh->ParamList["wd"] != "") NeutrinoAPI->Timerd->getWeekdaysFromStr(&rep, hh->ParamList["wd"].c_str()); + // apids bool changeApids=false; unsigned char apids=0; @@ -2256,6 +2272,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) apids |= TIMERD_APIDS_AC3; } } + CTimerd::RecordingInfo recinfo; CTimerd::EventInfo eventinfo; eventinfo.epgID = 0; @@ -2266,8 +2283,8 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) // channel by Id or name if(hh->ParamList["channel_id"] != "") sscanf(hh->ParamList["channel_id"].c_str(), - SCANF_CHANNEL_ID_TYPE, - &eventinfo.channel_id); + SCANF_CHANNEL_ID_TYPE, + &eventinfo.channel_id); else eventinfo.channel_id = NeutrinoAPI->ChannelNameToChannelId(hh->ParamList["channel_name"]); @@ -2290,7 +2307,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) CConfigFile *Config = new CConfigFile(','); Config->loadConfig(NEUTRINO_CONFIGFILE); _rec_dir = Config->getString("network_nfs_recordingdir", "/mnt/filme"); - delete Config;//Memory leak: Config + delete Config; } if(changeApids) eventinfo.apids = apids; @@ -2318,7 +2335,13 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) if(hh->ParamList["id"] != "") { unsigned modyId = atoi(hh->ParamList["id"].c_str()); - NeutrinoAPI->Timerd->removeTimerEvent(modyId); + if(type == CTimerd::TIMER_RECORD) + NeutrinoAPI->Timerd->modifyRecordTimerEvent(modyId, announceTimeT, alarmTimeT, stopTimeT, rep,repCount,_rec_dir.c_str()); + else + NeutrinoAPI->Timerd->modifyTimerEvent(modyId, announceTimeT, alarmTimeT, stopTimeT, rep,repCount); +// NeutrinoAPI->Timerd->removeTimerEvent(modyId); + if(changeApids) + NeutrinoAPI->Timerd->modifyTimerAPid(modyId,apids); } else { @@ -2336,15 +2359,18 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) real_alarmTimeT -= pre; } - for(; timer != timerlist.end(); ++timer) + for(; timer != timerlist.end();++timer) if(timer->alarmTime == real_alarmTimeT) { NeutrinoAPI->Timerd->removeTimerEvent(timer->eventID); break; } + NeutrinoAPI->Timerd->addTimerEvent(type,data,announceTimeT,alarmTimeT,stopTimeT,rep,repCount); } } - NeutrinoAPI->Timerd->addTimerEvent(type,data,announceTimeT,alarmTimeT,stopTimeT,rep,repCount); + else + NeutrinoAPI->Timerd->addTimerEvent(type,data,announceTimeT,alarmTimeT,stopTimeT,rep,repCount); + hh->SendOk(); } //------------------------------------------------------------------------- @@ -2395,10 +2421,8 @@ void CControlAPI::moveBouquetCGI(CyhookHandler *hh) //------------------------------------------------------------------------- void CControlAPI::deleteBouquetCGI(CyhookHandler *hh) { - int selected = -1; - if (hh->ParamList["selected"] != "") { - selected = atoi(hh->ParamList["selected"].c_str()); + int selected = atoi(hh->ParamList["selected"].c_str()); NeutrinoAPI->Zapit->deleteBouquet(selected - 1); hh->SendOk(); } @@ -2485,7 +2509,7 @@ void CControlAPI::updateBouquetCGI(CyhookHandler *hh) // host : (optional) ip of dbox void CControlAPI::build_live_url(CyhookHandler *hh) { - std::string xpids,port,yresult; + std::string xpids; int mode = NeutrinoAPI->Zapit->getMode(); if ( mode == CZapitClient::MODE_TV) @@ -2741,18 +2765,13 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { if (hh->ParamList["action"] == "list") { // directory list: action=list&path= DIR *dirp; - struct dirent*entry; - struct stat statbuf; - struct passwd *pwd; - struct group *grp; - struct tm *tm; - char datestring[256]; TOutType outType = hh->outStart(); std::string path = hh->ParamList["path"]; if ((dirp = opendir(path.c_str()))) { bool isFirstLine = true; + struct dirent *entry; while ((entry = readdir(dirp))) { std::string item = ""; item += hh->outPair("name", @@ -2773,6 +2792,7 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { std::string fullname = path + entry->d_name; item += hh->outPair("fullname", hh->outValue(fullname), true); + struct stat statbuf; if (stat(fullname.c_str(), &statbuf) != -1) { item += hh->outPair( @@ -2786,6 +2806,7 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { string_printf("%d", statbuf.st_nlink), true); /* Print out owner's name if it is found using getpwuid(). */ + struct passwd *pwd; if ((pwd = getpwuid(statbuf.st_uid)) != NULL) { item += hh->outPair("user", pwd->pw_name, true); } @@ -2794,6 +2815,7 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { string_printf("%d", statbuf.st_uid), true); } /* Print out group name if it is found using getgrgid(). */ + struct group *grp; if ((grp = getgrgid(statbuf.st_gid)) != NULL) item += hh->outPair("group", grp->gr_name, true); else { @@ -2804,7 +2826,8 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { item += hh->outPair("size", string_printf("%jd", (intmax_t) statbuf.st_size), true); - tm = localtime(&statbuf.st_mtime); + struct tm *tm = localtime(&statbuf.st_mtime); + char datestring[256] = {0}; /* Get localized date string. */ strftime(datestring, sizeof(datestring), nl_langinfo(D_T_FMT), tm); diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.h b/src/nhttpd/tuxboxapi/coolstream/controlapi.h index 052739005..151dbf160 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.h +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.h @@ -8,7 +8,7 @@ #include // yhttpd #include -#include "yhook.h" +#include // forward declaration class CNeutrinoAPI; @@ -36,7 +36,7 @@ private: void SendStreamInfo(CyhookHandler *hh); void SendBouquets(CyhookHandler *hh); void SendBouquet(CyhookHandler *hh,int BouquetNr); - void SendChannelList(CyhookHandler *hh); + void SendChannelList(CyhookHandler *hh, bool currentTP = false); void SendTimers(CyhookHandler *hh); void SendTimersXML(CyhookHandler *hh); void epgDetailList(CyhookHandler *hh); @@ -70,6 +70,7 @@ private: void GetServicesxmlCGI(CyhookHandler *hh); void GetBouquetsxmlCGI(CyhookHandler *hh); void GetChannel_IDCGI(CyhookHandler *hh); + void GetTPChannel_IDCGI(CyhookHandler *hh); void MessageCGI(CyhookHandler *hh); void InfoCGI(CyhookHandler *hh); void HWInfoCGI(CyhookHandler *hh); diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp index 2ca05cfd4..65b433331 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp @@ -50,7 +50,7 @@ extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern CZapitClient::SatelliteList satList; // yhttpd -#include "ylogging.h" +#include // nhttpd #include "neutrinoapi.h" @@ -266,7 +266,7 @@ bool CNeutrinoAPI::GetChannelEvents(void) if (eList.begin() == eList.end()) return false; - for (eventIterator = eList.begin(); eventIterator != eList.end(); eventIterator++) + for (eventIterator = eList.begin(); eventIterator != eList.end(); ++eventIterator) ChannelListEvents[(*eventIterator).get_channel_id()] = &(*eventIterator); return true; @@ -457,14 +457,13 @@ std::string CNeutrinoAPI::getAudioInfoAsString(void) { //------------------------------------------------------------------------- std::string CNeutrinoAPI::getCryptInfoAsString(void) { - unsigned short i; std::stringstream out; std::string casys[11]= {"Irdeto:","Betacrypt:","Seca:","Viaccess:","Nagra:","Conax: ","Cryptoworks:","Videoguard:","EBU:","XCrypt:","PowerVU:"}; int caids[] = { 0x600, 0x1700, 0x0100, 0x0500, 0x1800, 0xB00, 0xD00, 0x900, 0x2600, 0x4a00, 0x0E00 }; CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel(); if(channel) { - for (i = 0; i < 11; i++) { + for (unsigned short i = 0; i < 11; i++) { for(casys_map_iterator_t it = channel->camap.begin(); it != channel->camap.end(); ++it) { int caid = (*it) & 0xFF00; if(caid == caids[i]) diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.h b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.h index 892dde995..a98a7b5bf 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.h +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.h @@ -12,7 +12,7 @@ #include // nhttpd -#include "helper.h" +#include #include "neutrinoyparser.h" #include "controlapi.h" diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp index 4498f8064..972c5d173 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp @@ -13,9 +13,9 @@ #include //ntohs #include //ntohs // yhttpd -#include "yhttpd.h" -#include "ytypes_globals.h" -#include "mod_yparser.h" +#include +#include +#include // tuxbox #include //timer list // nhttpd @@ -209,7 +209,7 @@ std::string CNeutrinoYParser::func_mount_set_values(CyhookHandler *hh, std::str //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_bouquets_as_dropdown(CyhookHandler *, std::string para) { - std::string ynr, yresult, sel, nr_str, do_show_hidden; + std::string yresult, sel, nr_str, do_show_hidden; int nr=1; ySplitString(para," ",nr_str, do_show_hidden); @@ -222,7 +222,7 @@ std::string CNeutrinoYParser::func_get_bouquets_as_dropdown(CyhookHandler *, st sel=(nr==(i+1)) ? "selected=\"selected\"" : ""; if(!channels->empty() && (!g_bouquetManager->Bouquets[i]->bHidden || do_show_hidden == "true")) yresult += string_printf("\n", i + 1, sel.c_str(), - (encodeString(std::string(g_bouquetManager->Bouquets[i]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) :g_bouquetManager->Bouquets[i]->Name.c_str()))).c_str()); + std::string(g_bouquetManager->Bouquets[i]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) :g_bouquetManager->Bouquets[i]->Name.c_str()).c_str()); //yresult += string_printf("\n", i + 1, sel.c_str(), (encodeString(std::string(g_bouquetManager->Bouquets[i]->Name.c_str()))).c_str()); } return yresult; @@ -268,7 +268,7 @@ std::string CNeutrinoYParser::func_get_actual_bouquet_number(CyhookHandler *, s //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_channels_as_dropdown(CyhookHandler *, std::string para) { - std::string abouquet, achannel_id, yresult, sel, sid; + std::string abouquet, achannel_id, yresult, sel; int bnumber = 1; int mode = NeutrinoAPI->Zapit->getMode(); @@ -556,7 +556,7 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *, { if(!(isalnum(tags[i].component[0]))) tags[i].component=tags[i].component.substr(1,tags[i].component.length()-1); - yresult += string_printf("\r\n",idx_as_id ? j : pids.APIDs[j].pid,encodeString(tags[i].component).c_str()); + yresult += string_printf("\r\n",idx_as_id ? j : pids.APIDs[j].pid,tags[i].component.c_str()); } else { @@ -564,7 +564,7 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *, { strcpy( pids.APIDs[j].desc, _getISO639Description( pids.APIDs[j].desc ) ); } - yresult += string_printf("\r\n",idx_as_id ? j : pids.APIDs[j].pid,encodeString(std::string(pids.APIDs[j].desc)).c_str(),pids.APIDs[j].is_ac3 ? " (AC3)": " "); + yresult += string_printf("\r\n",idx_as_id ? j : pids.APIDs[j].pid,std::string(pids.APIDs[j].desc).c_str(),pids.APIDs[j].is_ac3 ? " (AC3)": " "); } eit_not_ok=false; break; @@ -596,7 +596,7 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *, //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_unmount_get_list(CyhookHandler *, std::string) { - std::string ysel, ymount, ylocal_dir, yfstype, ynr, yresult, mounts; + std::string ysel, ymount, ylocal_dir, yfstype, yresult, mounts; std::ifstream in; in.open("/proc/mounts", std::ifstream::in); @@ -832,7 +832,7 @@ std::string CNeutrinoYParser::func_get_timer_list(CyhookHandler *, std::string yresult += string_printf(para.c_str(), classname, zAlarmTime, zStopTime, zRep.c_str(), zRepCount.c_str(), zType.c_str(), sAddData.c_str(),timer->eventID,timer->eventID); } - classname = (i++&1)?'a':'b'; + //classname = (i++&1)?'a':'b'; return yresult; } diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.h b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.h index 2d8da7697..b32f99c32 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.h +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.h @@ -9,9 +9,9 @@ // c++ #include // yhttpd -#include "yhttpd.h" -#include "ytypes_globals.h" -#include "mod_yparser.h" +#include +#include +#include // forward declaration class CNeutrinoAPI; diff --git a/src/nhttpd/web/scripts/Y_Tools.sh b/src/nhttpd/web/scripts/Y_Tools.sh index bd81a8b0e..06925d3bc 100755 --- a/src/nhttpd/web/scripts/Y_Tools.sh +++ b/src/nhttpd/web/scripts/Y_Tools.sh @@ -530,7 +530,7 @@ case "$1" in bootlogo_lcd_upload) bootlogo_lcd_upload ;; zapit_upload) zapit_upload $2 ;; kernel-stack) msg=`dmesg`; y_format_message_html ;; - ps) msg=`ps`; y_format_message_html ;; + ps) msg=`ps aux`; y_format_message_html ;; free) f=`free`; p=`df -h`; msg="RAM Memory use\n-------------------\n$f\n\nPartitions\n-------------------\n$p" y_format_message_html ;; yreboot) reboot; echo "Reboot..." ;; diff --git a/src/nhttpd/yhttpd.cpp b/src/nhttpd/yhttpd.cpp index a1ab14bf9..5cc3f8115 100644 --- a/src/nhttpd/yhttpd.cpp +++ b/src/nhttpd/yhttpd.cpp @@ -34,28 +34,28 @@ CStringList Cyhttpd::ConfigList; //============================================================================= #ifdef Y_CONFIG_USE_AUTHHOOK -#include "mod_auth.h" +#include static CmAuth *auth = NULL; #endif #ifdef Y_CONFIG_USE_WEBLOG -#include "mod_weblog.h" +#include static CmWebLog *weblog = NULL; #endif #ifdef Y_CONFIG_USE_SENDFILE -#include "mod_sendfile.h" +#include static CmodSendfile *mod_sendfile = NULL; #endif #ifdef Y_CONFIG_USE_CACHE -#include "mod_cache.h" +#include static CmodCache mod_cache; // static instance #endif //----------------------------------------------------------------------------- #if defined(CONFIG_SYSTEM_TUXBOX) || defined(CONFIG_SYSTEM_TUXBOX_COOLSTREAM) -#include "neutrinoapi.h" +#include static CNeutrinoAPI *NeutrinoAPI; #endif diff --git a/src/nhttpd/yhttpd_core/helper.cpp b/src/nhttpd/yhttpd_core/helper.cpp index 38b188ba2..e2449fbbd 100644 --- a/src/nhttpd/yhttpd_core/helper.cpp +++ b/src/nhttpd/yhttpd_core/helper.cpp @@ -12,7 +12,7 @@ #include // yhttpd -#include "yconfig.h" +#include #include "ytypes_globals.h" #include "helper.h" #include "ylogging.h" @@ -220,10 +220,10 @@ std::string encodeString(std::string decodedString) { unsigned int len = sizeof(char) * decodedString.length() * 5 + 1; std::string result(len, '\0'); char *newString = (char *) result.c_str(); - char *dstring = (char *) decodedString.c_str(); char one_char; if (len == result.length()) // got memory needed { + char *dstring = (char *) decodedString.c_str(); while ((one_char = *dstring++)) /* use the null character as a loop terminator */ { if (isalnum(one_char)) diff --git a/src/nhttpd/yhttpd_core/yconnection.cpp b/src/nhttpd/yhttpd_core/yconnection.cpp index 7c035c12d..ea16280b5 100644 --- a/src/nhttpd/yhttpd_core/yconnection.cpp +++ b/src/nhttpd/yhttpd_core/yconnection.cpp @@ -8,7 +8,7 @@ #include #include // yhttpd -#include "yconfig.h" +#include #include "ytypes_globals.h" #include "ywebserver.h" #include "yconnection.h" @@ -44,6 +44,7 @@ CWebserverConnection::CWebserverConnection(CWebserver *pWebserver) { //------------------------------------------------------------------------- CWebserverConnection::CWebserverConnection() { // aprintf("test CWebserverConnection::CWebserverConnection()\n"); + Method = M_UNKNOWN; sock = 0; RequestCanceled = 0; keep_alive = 0; diff --git a/src/nhttpd/yhttpd_core/yconnection.h b/src/nhttpd/yhttpd_core/yconnection.h index 50dca5580..cc8ebc6ca 100644 --- a/src/nhttpd/yhttpd_core/yconnection.h +++ b/src/nhttpd/yhttpd_core/yconnection.h @@ -14,7 +14,7 @@ // c++ #include // yhttpd -#include "yconfig.h" +#include #include "ytypes_globals.h" #include "ywebserver.h" #include "yrequest.h" diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index 9556be9f5..b313dadda 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -51,7 +51,7 @@ #include #include // yhttpd -#include "yconfig.h" +#include #include "ytypes_globals.h" #include "ylogging.h" // tuxbox @@ -141,7 +141,7 @@ public: CStringList HookVarList; // Variables in Hook-Handling passing to other Hooks THttp_Method Method; // HTTP Method (requested) // constructor & deconstructor - CyhookHandler(){ContentLength = 0; keep_alive = 0; _outIndent = 0;}; + CyhookHandler(){ContentLength = 0; keep_alive = 0; _outIndent = 0;status = HANDLED_NONE;Method = M_UNKNOWN;httpStatus = HTTP_NIL;outType = plain;}; virtual ~CyhookHandler(){}; // hook slot handler diff --git a/src/nhttpd/yhttpd_core/ylanguage.h b/src/nhttpd/yhttpd_core/ylanguage.h index 3ba368f7c..e90658fc2 100644 --- a/src/nhttpd/yhttpd_core/ylanguage.h +++ b/src/nhttpd/yhttpd_core/ylanguage.h @@ -8,7 +8,7 @@ #include #include // yhttpd -#include "yconfig.h" +#include #include "ytypes_globals.h" #include "ywebserver.h" diff --git a/src/nhttpd/yhttpd_core/ylogging.cpp b/src/nhttpd/yhttpd_core/ylogging.cpp index 2d93bc9e3..a61a863ff 100644 --- a/src/nhttpd/yhttpd_core/ylogging.cpp +++ b/src/nhttpd/yhttpd_core/ylogging.cpp @@ -77,7 +77,10 @@ void CLogging::printf(const char *fmt, ...) { va_end(arglist); pthread_mutex_lock(&Log_mutex); - ::printf(buffer); + buffer[bufferlen-1]='\0'; + ::printf("%s",buffer); + fflush(stdout); + if (LogToFile) { ; //FIXME Logging to File } diff --git a/src/nhttpd/yhttpd_core/yrequest.cpp b/src/nhttpd/yhttpd_core/yrequest.cpp index 94fb344bd..f684f9ddd 100644 --- a/src/nhttpd/yhttpd_core/yrequest.cpp +++ b/src/nhttpd/yhttpd_core/yrequest.cpp @@ -75,9 +75,8 @@ bool CWebserverRequest::HandleRequest(void) { return false; if (Connection->Method == M_GET || Connection->Method == M_HEAD) { - std::string tmp_line; //read header (speed up: read rest of request in blockmode) - tmp_line = Connection->sock->ReceiveBlock(); + std::string tmp_line = Connection->sock->ReceiveBlock(); if (!Connection->sock->isValid) { Connection->Response.SendError(HTTP_INTERNAL_SERVER_ERROR); return false; @@ -116,7 +115,7 @@ bool CWebserverRequest::HandleRequest(void) { // Split URL into path, filename, fileext .. UrlData[] //----------------------------------------------------------------------------- bool CWebserverRequest::ParseStartLine(std::string start_line) { - std::string method, url, http, tmp; + std::string method = "", url = "", tmp = ""; log_level_printf(8, ": line: %s\n", start_line.c_str()); if (ySplitString(start_line, " ", method, tmp)) { @@ -155,7 +154,7 @@ bool CWebserverRequest::ParseStartLine(std::string start_line) { //----------------------------------------------------------------------------- bool CWebserverRequest::ParseParams(std::string param_string) { bool ende = false; - std::string param, name = "", value, number; + std::string param, name = "", value = "", number = ""; while (!ende) { if (!ySplitStringExact(param_string, "&", param, param_string)) @@ -171,6 +170,9 @@ bool CWebserverRequest::ParseParams(std::string param_string) { } number = string_printf("%d", ParameterList.size() + 1); log_level_printf(7, "ParseParams: name: %s value: %s\n", name.c_str(), value.c_str()); + if(value.empty()){ + name = trim(decodeString(name)); + } ParameterList[number] = name; } return true; @@ -188,8 +190,9 @@ bool CWebserverRequest::ParseParams(std::string param_string) { //----------------------------------------------------------------------------- bool CWebserverRequest::ParseHeader(std::string header) { bool ende = false; - std::string sheader, name, value; - HeaderList.clear(); + std::string sheader = "", name = "", value = ""; + if(!HeaderList.empty()) + HeaderList.clear(); while (!ende) { if (!ySplitStringExact(header, "\r\n", sheader, header)) @@ -209,18 +212,19 @@ bool CWebserverRequest::ParseHeader(std::string header) { // query data is splitted and stored in ParameterList //----------------------------------------------------------------------------- void CWebserverRequest::analyzeURL(std::string url) { - ParameterList.clear(); + if(!ParameterList.empty()) + ParameterList.clear(); // URI decode - url = decodeString(url); url = trim(url, "\r\n"); // non-HTTP-Standard: allow \r or \n in URL. Delete it. UrlData["fullurl"] = url; // split Params - if (ySplitString(url, "?", UrlData["url"], UrlData["paramstring"])) // split pure URL and all Params + if (ySplitString(url, "?", UrlData["url"], UrlData["paramstring"])){ // split pure URL and all Params ParseParams( UrlData["paramstring"]); // split params to ParameterList - else + }else{ // No Params + url = decodeString(url); UrlData["url"] = url; - + } if (!ySplitStringLast(UrlData["url"], "/", UrlData["path"], UrlData["filename"])) { UrlData["path"] = "/"; // Set "/" if not contained @@ -240,7 +244,7 @@ void CWebserverRequest::analyzeURL(std::string url) { //----------------------------------------------------------------------------- bool CWebserverRequest::HandlePost() { //read header: line by line - std::string raw_header, tmp_line; + std::string raw_header = "", tmp_line = ""; do { tmp_line = Connection->sock->ReceiveLine(); if (tmp_line == "") // Socket empty @@ -270,7 +274,6 @@ bool CWebserverRequest::HandlePost() { { #ifdef Y_CONFIG_FEATURE_UPLOAD std::string boundary = "--" + HeaderList["Content-Type"].substr(t.length(),HeaderList["Content-Type"].length() - t.length()); - std::string post_header; do { content_len = HandlePostBoundary(boundary, content_len); @@ -285,9 +288,9 @@ bool CWebserverRequest::HandlePost() { { // handle normal form POST log_level_printf(6, "Handle POST application/x-www-form-urlencoded\n"); - std::string post_header; + // get message-body - post_header = Connection->sock->ReceiveBlock(); + std::string post_header = Connection->sock->ReceiveBlock(); while (post_header.length() < content_len) { post_header += Connection->sock->ReceiveBlock(); /* aprintf("POST form less data then expected\n"); @@ -384,10 +387,9 @@ bool CWebserverRequest::HandlePost() { //----------------------------------------------------------------------------- unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, unsigned int content_len) { - std::string tmp_line; // read boundary - tmp_line = Connection->sock->ReceiveLine(); + std::string tmp_line = Connection->sock->ReceiveLine(); content_len -= tmp_line.length(); log_level_printf(2, " Start\n"); @@ -412,7 +414,7 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, log_level_printf(2," disposition !!this is a file!! found. line:(%s)\n", tmp_line.c_str()); // get para from 'content-disposition: form-data; name="pics"; filename="file1.txt"' // set to ParameterList[""]="" - std::string left, right, var_name, var_value; + std::string left = "", right = "", var_name = "", var_value = ""; if(!ySplitStringExact(tmp_line, "name=\"", left, right)) { log_level_printf(7," no var_name START found. line:(%s)\n", tmp_line.c_str()); @@ -461,8 +463,7 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, } log_level_printf(7," read file Start\n"); - std::string upload_filename; - upload_filename = UPLOAD_TMP_FILE; + std::string upload_filename = UPLOAD_TMP_FILE; // Hook for Filename naming Connection->HookHandler.Hooks_UploadSetFilename(upload_filename); // Set upload filename to ParameterList["_upload_filename"]="" @@ -543,7 +544,7 @@ unsigned int CWebserverRequest::HandlePostBoundary(std::string boundary, // this part is a POST variable/parameter { // get var_name from 'content-disposition: form-data; name="var_name"' - std::string left, right, var_name, var_value; + std::string left = "", right = "", var_name = "", var_value = ""; if (!ySplitStringExact(tmp_line, "name=\"", left, right)) { log_level_printf(7, " no var_name START found. line:(%s)\n", tmp_line.c_str()); return 0; diff --git a/src/nhttpd/yhttpd_core/yresponse.cpp b/src/nhttpd/yhttpd_core/yresponse.cpp index c010a0f74..96ed8f510 100644 --- a/src/nhttpd/yhttpd_core/yresponse.cpp +++ b/src/nhttpd/yhttpd_core/yresponse.cpp @@ -15,8 +15,8 @@ #include #include // yhttpd -#include "yconfig.h" -#include "yhttpd.h" +#include +#include #include "ytypes_globals.h" #include "ylogging.h" #include "ywebserver.h" diff --git a/src/nhttpd/yhttpd_core/yresponse.h b/src/nhttpd/yhttpd_core/yresponse.h index 6bdaeab1b..4eb2bf864 100644 --- a/src/nhttpd/yhttpd_core/yresponse.h +++ b/src/nhttpd/yhttpd_core/yresponse.h @@ -9,7 +9,7 @@ // c++ #include // yhttpd -#include "yconfig.h" +#include #include "ytypes_globals.h" #include "yhook.h" @@ -42,8 +42,8 @@ public: void printf(const char *fmt, ...); bool Write(char const *text); bool WriteLn(char const *text); - bool Write(const std::string text) { return Write(text.c_str()); } - bool WriteLn(const std::string text) { return WriteLn(text.c_str()); } + bool Write(const std::string &text) { return Write(text.c_str()); } + bool WriteLn(const std::string &text) { return WriteLn(text.c_str()); } // Headers void SendError(HttpResponseType responseType) {SendHeader(responseType, false, "text/html");} diff --git a/src/nhttpd/yhttpd_core/ysocket.cpp b/src/nhttpd/yhttpd_core/ysocket.cpp index d78912640..6c51d3324 100644 --- a/src/nhttpd/yhttpd_core/ysocket.cpp +++ b/src/nhttpd/yhttpd_core/ysocket.cpp @@ -17,7 +17,7 @@ #include // yhttpd -#include "yhttpd.h" +#include #include "ysocket.h" #include "ylogging.h" // system @@ -64,6 +64,7 @@ CySocket::~CySocket() { // initialize //----------------------------------------------------------------------------- void CySocket::init(void) { + BytesSend = 0; handling = false; isOpened = false; isValid = true; @@ -194,8 +195,8 @@ CySocket* CySocket::accept() { #else set_tcp_nodelay(); #endif + new_ySocket->isOpened = true; } - new_ySocket->isOpened = true; // handling = true; return new_ySocket; } diff --git a/src/nhttpd/yhttpd_core/ywebserver.cpp b/src/nhttpd/yhttpd_core/ywebserver.cpp index 2b9c1e503..4b656d28e 100644 --- a/src/nhttpd/yhttpd_core/ywebserver.cpp +++ b/src/nhttpd/yhttpd_core/ywebserver.cpp @@ -19,7 +19,7 @@ #include // yhttpd -#include "yhttpd.h" +#include #include "ytypes_globals.h" #include "ywebserver.h" #include "ylogging.h" @@ -243,7 +243,6 @@ bool CWebserver::run(void) { int CWebserver::AcceptNewConnectionSocket() { int slot = -1; CySocket *connectionSock = NULL; - int newfd; if (!(connectionSock = listenSocket.accept())) // Blocking wait { @@ -267,7 +266,7 @@ int CWebserver::AcceptNewConnectionSocket() { SocketList[slot] = connectionSock; // put it to list fcntl(connectionSock->get_socket(), F_SETFD, O_NONBLOCK); // set non-blocking open_connections++; // count open connectins - newfd = connectionSock->get_socket(); + int newfd = connectionSock->get_socket(); if (newfd > fdmax) // keep track of the maximum fd fdmax = newfd; } @@ -379,7 +378,7 @@ bool CWebserver::CheckKeepAliveAllowedByIP(std::string client_ip) { while (it != conf_no_keep_alive_ips.end()) { if (trim(*it) == client_ip) do_keep_alive = false; - it++; + ++it; } pthread_mutex_unlock(&mutex); return do_keep_alive; diff --git a/src/nhttpd/yhttpd_mods/mod_auth.cpp b/src/nhttpd/yhttpd_mods/mod_auth.cpp index 3934dc0e4..89dc65f1b 100644 --- a/src/nhttpd/yhttpd_mods/mod_auth.cpp +++ b/src/nhttpd/yhttpd_mods/mod_auth.cpp @@ -6,7 +6,7 @@ #include #include #include "mod_auth.h" -#include "helper.h" +#include //----------------------------------------------------------------------------- // HOOK: response_hook @@ -65,11 +65,13 @@ bool CmAuth::CheckAuth(CyhookHandler *hh) { // decode Base64 buffer to String //----------------------------------------------------------------------------- std::string CmAuth::decodeBase64(const char *b64buffer) { - char *newString, *org_newString; //shorter then b64buffer + if(b64buffer==NULL) + return ""; + char *newString; //shorter then b64buffer std::string result; if ((newString = (char *) malloc(sizeof(char) * strlen(b64buffer) + 1)) != NULL) { - org_newString = newString; + char *org_newString = newString; int i = 0; unsigned long c = 0; diff --git a/src/nhttpd/yhttpd_mods/mod_auth.h b/src/nhttpd/yhttpd_mods/mod_auth.h index 6215c3fb9..4efdcd8e9 100644 --- a/src/nhttpd/yhttpd_mods/mod_auth.h +++ b/src/nhttpd/yhttpd_mods/mod_auth.h @@ -5,11 +5,12 @@ #ifndef __yhttpd_mod_auth_h__ #define __yhttpd_mod_auth_h__ -#include "yhook.h" +#include class CmAuth: public Cyhook { public: bool authenticate; CmAuth() { + authenticate = false; } ; ~CmAuth() { diff --git a/src/nhttpd/yhttpd_mods/mod_cache.cpp b/src/nhttpd/yhttpd_mods/mod_cache.cpp index 2c59edf20..2172e17e0 100644 --- a/src/nhttpd/yhttpd_mods/mod_cache.cpp +++ b/src/nhttpd/yhttpd_mods/mod_cache.cpp @@ -8,9 +8,9 @@ #include #include // yhttpd -#include "yconfig.h" -#include "ytypes_globals.h" -#include "helper.h" +#include +#include +#include #include "mod_cache.h" //============================================================================= @@ -128,7 +128,7 @@ void CmodCache::AddToCache(CyhookHandler *, std::string url, CacheList[url].mime_type = mime_type; CacheList[url].category = category; CacheList[url].created = time(NULL); - std::string test = CacheList[url].filename; +// std::string test = CacheList[url].filename; } fflush(fd); // flush and close file fclose(fd); @@ -154,7 +154,7 @@ void CmodCache::RemoveCategoryFromCache(std::string category) { do { restart = false; TCacheList::iterator i = CacheList.begin(); - for (; i != CacheList.end(); i++) { + for (; i != CacheList.end(); ++i) { TCache *item = &((*i).second); if (item->category == category) { CacheList.erase(((*i).first)); @@ -198,7 +198,7 @@ void CmodCache::yshowCacheInfo(CyhookHandler *hh) { "URLMimeFilenameCategoryCreatedRemove\n"); pthread_mutex_lock(&mutex); TCacheList::iterator i = CacheList.begin(); - for (; i != CacheList.end(); i++) { + for (; i != CacheList.end(); ++i) { TCache *item = &((*i).second); char timeStr[80]; strftime(timeStr, sizeof(timeStr), RFC1123FMT, gmtime(&(item->created))); diff --git a/src/nhttpd/yhttpd_mods/mod_cache.h b/src/nhttpd/yhttpd_mods/mod_cache.h index 149c0f8a3..d4172e6aa 100644 --- a/src/nhttpd/yhttpd_mods/mod_cache.h +++ b/src/nhttpd/yhttpd_mods/mod_cache.h @@ -11,9 +11,9 @@ // c++ #include // yhttpd -#include "yconfig.h" -#include "ytypes_globals.h" -#include "yhook.h" +#include +#include +#include //----------------------------------------------------------------------------- typedef struct { diff --git a/src/nhttpd/yhttpd_mods/mod_sendfile.cpp b/src/nhttpd/yhttpd_mods/mod_sendfile.cpp index 1e0d42b02..ce3a2551f 100644 --- a/src/nhttpd/yhttpd_mods/mod_sendfile.cpp +++ b/src/nhttpd/yhttpd_mods/mod_sendfile.cpp @@ -47,9 +47,9 @@ #include #include // yhttpd -#include "yconfig.h" -#include "ytypes_globals.h" -#include "helper.h" +#include +#include +#include #include "mod_sendfile.h" //============================================================================= @@ -64,7 +64,6 @@ CStringList CmodSendfile::sendfileTypes; THandleStatus CmodSendfile::Hook_PrepareResponse(CyhookHandler *hh) { hh->status = HANDLED_NONE; - int filed; log_level_printf(4, "mod_sendfile prepare hook start url:%s\n", hh->UrlData["fullurl"].c_str()); std::string mime = sendfileTypes[hh->UrlData["fileext"]]; if (((mime != "") || (hh->WebserverConfigList["mod_sendfile.sendAll"] == "true")) @@ -73,7 +72,7 @@ THandleStatus CmodSendfile::Hook_PrepareResponse(CyhookHandler *hh) { // build filename std::string fullfilename = GetFileName(hh, hh->UrlData["path"], hh->UrlData["filename"]); - + int filed; if ((filed = OpenFile(hh, fullfilename)) != -1) //can access file? { struct stat statbuf; @@ -180,7 +179,6 @@ std::string CmodSendfile::GetFileName(CyhookHandler *hh, std::string path, std:: //----------------------------------------------------------------------------- int CmodSendfile::OpenFile(CyhookHandler *, std::string fullfilename) { int fd = -1; - std::string tmpstring; if (fullfilename.length() > 0) { fd = open(fullfilename.c_str(), O_RDONLY | O_LARGEFILE); if (fd <= 0) { diff --git a/src/nhttpd/yhttpd_mods/mod_sendfile.h b/src/nhttpd/yhttpd_mods/mod_sendfile.h index 0bdcf157e..e4294a25f 100644 --- a/src/nhttpd/yhttpd_mods/mod_sendfile.h +++ b/src/nhttpd/yhttpd_mods/mod_sendfile.h @@ -11,9 +11,9 @@ // c++ #include // yhttpd -#include "yconfig.h" -#include "ytypes_globals.h" -#include "yhook.h" +#include +#include +#include //----------------------------------------------------------------------------- class CmodSendfile : public Cyhook diff --git a/src/nhttpd/yhttpd_mods/mod_testhook.h b/src/nhttpd/yhttpd_mods/mod_testhook.h index a92f9ed98..1f6ed9f2e 100644 --- a/src/nhttpd/yhttpd_mods/mod_testhook.h +++ b/src/nhttpd/yhttpd_mods/mod_testhook.h @@ -6,7 +6,7 @@ #define TESTHOOK_H_ -#include "yhook.h" +#include class CTesthook : public Cyhook { public: diff --git a/src/nhttpd/yhttpd_mods/mod_weblog.cpp b/src/nhttpd/yhttpd_mods/mod_weblog.cpp index 4d25f6e3f..49e88dab4 100644 --- a/src/nhttpd/yhttpd_mods/mod_weblog.cpp +++ b/src/nhttpd/yhttpd_mods/mod_weblog.cpp @@ -11,7 +11,7 @@ #include #include "mod_weblog.h" -#include "helper.h" +#include //============================================================================= // Initialization of static variables @@ -97,8 +97,8 @@ bool CmWebLog::printf(const char *fmt, ...) { if (!OpenLogFile()) return false; bool success = false; - char buffer[bufferlen]; if (WebLogFile != NULL) { + char buffer[bufferlen]={0}; pthread_mutex_lock(&WebLog_mutex); // yeah, its mine va_list arglist; va_start(arglist, fmt); @@ -130,6 +130,8 @@ bool CmWebLog::printf(const char *fmt, ...) { //----------------------------------------------------------------------------- void CmWebLog::AddLogEntry_CLF(CyhookHandler *hh) { +#if 0 +//never used std::string cs_method; switch (hh->Method) { @@ -141,6 +143,7 @@ void CmWebLog::AddLogEntry_CLF(CyhookHandler *hh) cs_method = "unknown"; break; } +#endif std::string c_ip = hh->UrlData["clientaddr"].c_str(); std::string request_startline = hh->UrlData["startline"].c_str(); int s_status = hh->httpStatus; @@ -315,7 +318,6 @@ void CmWebLog::AddLogEntry_ELF(CyhookHandler *hh) std::string c_ip = hh->UrlData["clientaddr"].c_str(); std::string request_startline = hh->UrlData["startline"].c_str(); std::string cs_uri = hh->UrlData["fullurl"]; - std::string cs_uri_stem = hh->UrlData["url"]; int sc_status = hh->httpStatus; int bytes = hh->GetContentLength(); int cached = (hh->HookVarList["CacheCategory"].empty()) ? 0 : 1; diff --git a/src/nhttpd/yhttpd_mods/mod_weblog.h b/src/nhttpd/yhttpd_mods/mod_weblog.h index f65026b55..bcdf2d96e 100644 --- a/src/nhttpd/yhttpd_mods/mod_weblog.h +++ b/src/nhttpd/yhttpd_mods/mod_weblog.h @@ -5,8 +5,8 @@ #ifndef __yhttpd_mod_weblog_h__ #define __yhttpd_mod_weblog_h__ -#include "yconfig.h" -#include "yhook.h" +#include +#include //----------------------------------------------------------------------------- // Defaults #ifndef LOG_FILE diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index 9ad6eb7e6..3fd7a1c5e 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -18,12 +18,12 @@ // tuxbox #include // yhttpd -#include "yconfig.h" -#include "ytypes_globals.h" -#include "helper.h" -#include "ylogging.h" +#include +#include +#include +#include #include "mod_yparser.h" -#include "ylanguage.h" +#include //============================================================================= // Initialization of static variables @@ -111,7 +111,7 @@ void CyParser::Execute(CyhookHandler *hh) { if (CLogging::getInstance()->getDebug()) { dprintf("Execute CGI : %s\n", filename.c_str()); for (CStringList::iterator it = hh->ParamList.begin(); it - != hh->ParamList.end(); it++) + != hh->ParamList.end(); ++it) dprintf(" Parameter %s : %s\n", it->first.c_str(), it->second.c_str()); } @@ -156,7 +156,6 @@ void CyParser::Execute(CyhookHandler *hh) { // mini cgi Engine (Entry for ycgi) //----------------------------------------------------------------------------- void CyParser::cgi(CyhookHandler *hh) { - bool ydebug = false; std::string htmlfilename, yresult, ycmd; if ( !hh->ParamList.empty() ) { @@ -164,6 +163,7 @@ void CyParser::cgi(CyhookHandler *hh) { htmlfilename = hh->ParamList["tmpl"]; else htmlfilename = hh->ParamList["1"]; + bool ydebug = false; if (hh->ParamList["debug"] != "") // switch debug on ydebug = true; @@ -171,7 +171,6 @@ void CyParser::cgi(CyhookHandler *hh) { { ycmd = hh->ParamList["execute"]; ycmd = YPARSER_ESCAPE_START + ycmd + YPARSER_ESCAPE_END; - ycmd = ycmd; yresult = cgi_cmd_parsing(hh, ycmd, ydebug); // parsing engine } // parsing given file @@ -471,7 +470,7 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd) { pthread_mutex_unlock(&yParser_mutex); } } else if (ycmd_type == "file-action") { - std::string filename, actionname, content, tmp, ydefault; + std::string filename, actionname, content, tmp; if (ySplitString(ycmd_name, ";", filename, tmp)) { ySplitString(tmp, ";", actionname, content); replace(content, "\r\n", "\n"); @@ -522,7 +521,6 @@ std::string CyParser::YWeb_cgi_get_ini(CyhookHandler *, std::string filename, //------------------------------------------------------------------------- void CyParser::YWeb_cgi_set_ini(CyhookHandler *, std::string filename, std::string varname, std::string varvalue, std::string yaccess) { - std::string result; if ((yaccess == "open") || (yaccess == "")) { yConfig->clear(); yConfig->loadConfig(filename); @@ -738,11 +736,11 @@ std::string CyParser::func_get_languages_as_dropdown(CyhookHandler *, std::string para) { std::string yresult, sel; DIR *d; - struct dirent *dir; std::string act_language = CLanguage::getInstance()->language; d = opendir((CLanguage::getInstance()->language_dir).c_str()); if (d != NULL) { + struct dirent *dir; while ((dir = readdir(d))) { if (strcmp(dir->d_name, ".") == 0 || strcmp(dir->d_name, "..") == 0) continue; diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.h b/src/nhttpd/yhttpd_mods/mod_yparser.h index 628ed0a7e..ae5d49118 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.h +++ b/src/nhttpd/yhttpd_mods/mod_yparser.h @@ -16,10 +16,10 @@ #include // yhttpd -#include "helper.h" -#include "yconfig.h" -#include "ytypes_globals.h" -#include "yhook.h" +#include +#include +#include +#include // forward declaration class CWebserverConnection; diff --git a/src/system/locals.h b/src/system/locals.h index aeeca7443..cd29bb4ee 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1198,6 +1198,7 @@ typedef enum LOCALE_MOTORCONTROL_TIMED_MODE, LOCALE_MOTORCONTROL_USER_MENU, LOCALE_MOTORCONTROL_WEST_LIMIT, + LOCALE_MOVIEBROWSER_ASK_REC_TO_DELETE, LOCALE_MOVIEBROWSER_BOOK_ADD, LOCALE_MOVIEBROWSER_BOOK_CLEAR_ALL, LOCALE_MOVIEBROWSER_BOOK_HEAD, @@ -1215,6 +1216,7 @@ typedef enum LOCALE_MOVIEBROWSER_BROWSER_ROW_ITEM, LOCALE_MOVIEBROWSER_BROWSER_ROW_NR, LOCALE_MOVIEBROWSER_BROWSER_ROW_WIDTH, + LOCALE_MOVIEBROWSER_DELETE_INFO, LOCALE_MOVIEBROWSER_DIR, LOCALE_MOVIEBROWSER_DIR_HEAD, LOCALE_MOVIEBROWSER_EDIT_BOOK, @@ -1476,10 +1478,13 @@ typedef enum LOCALE_PICTUREVIEWER_HELP18, LOCALE_PICTUREVIEWER_HELP19, LOCALE_PICTUREVIEWER_HELP2, - LOCALE_PICTUREVIEWER_HELP20, - LOCALE_PICTUREVIEWER_HELP21, - LOCALE_PICTUREVIEWER_HELP22, LOCALE_PICTUREVIEWER_HELP3, + LOCALE_PICTUREVIEWER_HELP30, + LOCALE_PICTUREVIEWER_HELP31, + LOCALE_PICTUREVIEWER_HELP32, + LOCALE_PICTUREVIEWER_HELP33, + LOCALE_PICTUREVIEWER_HELP34, + LOCALE_PICTUREVIEWER_HELP35, LOCALE_PICTUREVIEWER_HELP4, LOCALE_PICTUREVIEWER_HELP5, LOCALE_PICTUREVIEWER_HELP6, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 4a72331b4..8e56efc49 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1198,6 +1198,7 @@ const char * locale_real_names[] = "motorcontrol.timed_mode", "motorcontrol.user_menu", "motorcontrol.west_limit", + "moviebrowser.ask_rec_to_delete", "moviebrowser.book_add", "moviebrowser.book_clear_all", "moviebrowser.book_head", @@ -1215,6 +1216,7 @@ const char * locale_real_names[] = "moviebrowser.browser_row_item", "moviebrowser.browser_row_nr", "moviebrowser.browser_row_width", + "moviebrowser.delete_info", "moviebrowser.dir", "moviebrowser.dir_head", "moviebrowser.edit_book", @@ -1476,10 +1478,13 @@ const char * locale_real_names[] = "pictureviewer.help18", "pictureviewer.help19", "pictureviewer.help2", - "pictureviewer.help20", - "pictureviewer.help21", - "pictureviewer.help22", "pictureviewer.help3", + "pictureviewer.help30", + "pictureviewer.help31", + "pictureviewer.help32", + "pictureviewer.help33", + "pictureviewer.help34", + "pictureviewer.help35", "pictureviewer.help4", "pictureviewer.help5", "pictureviewer.help6", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 4d8888a37..9a43b8d15 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -47,10 +47,6 @@ #include #include -#if HAVE_COOL_HARDWARE -#include -#endif - #include #include diff --git a/src/system/settings.h b/src/system/settings.h index a232ad80d..f89bccf1b 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -68,6 +68,7 @@ struct SNeutrinoSettings char record_safety_time_after[3]; int zapto_pre_time; int infobar_sat_display; + int infobar_show_channeldesc; int infobar_subchan_disp_pos; int fan_speed; int infobar_show; diff --git a/src/timerd/timerd.cpp b/src/timerd/timerd.cpp index 0d41b8450..1511eab9e 100644 --- a/src/timerd/timerd.cpp +++ b/src/timerd/timerd.cpp @@ -61,7 +61,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) rspGetSleeptimer.eventID = 0; if (CTimerManager::getInstance()->listEvents(events)) { - for (pos = events.begin(); pos != events.end(); pos++) + for (pos = events.begin(); pos != events.end(); ++pos) { printf("ID: %u type: %u\n",pos->second->eventID,pos->second->eventType); if(pos->second->eventType == CTimerd::TIMER_SLEEPTIMER) diff --git a/src/zapit/src/fastscan.cpp b/src/zapit/src/fastscan.cpp index 8fb2b8324..9c2cefde4 100644 --- a/src/zapit/src/fastscan.cpp +++ b/src/zapit/src/fastscan.cpp @@ -288,7 +288,7 @@ bool CServiceScan::ParseFst(unsigned short pid, fast_scan_operator_t * op) std::string providerName = convertDVBUTF8((const char*)&(dbuf[4]), service_provider_name_length, 1, 1); std::string serviceName = convertDVBUTF8((const char*)&(dbuf[4 + service_provider_name_length + 1]), service_name_length, 1, 1); - + #ifdef SCAN_DEBUG printf("[FST] #%04d at %04d: net %04x tp %04x sid %04x v %04x a %04x pcr %04x frq %05d type %d prov [%s] name [%s]\n", num, satellitePosition, original_network_id, transport_stream_id, service_id, video_pid, audio_pid, pcr_pid, freq, service_type, providerName.c_str(), serviceName.c_str()); #endif @@ -297,8 +297,20 @@ bool CServiceScan::ParseFst(unsigned short pid, fast_scan_operator_t * op) channel_id = CREATE_CHANNEL_ID64; CZapitChannel * newchannel; - +#if 0 newchannel = CServiceManager::getInstance()->FindChannel(channel_id); +#else + + int flist[5] = { freq, freq-1, freq+1, freq-2, freq+2 }; + for(int i = 0; i < 5; i++) { + freq_id_t freq_id = flist[i]; + t_channel_id newid = CZapitChannel::makeChannelId(satellitePosition, + freq_id, transport_stream_id, original_network_id, service_id); + newchannel = CServiceManager::getInstance()->FindChannel(newid); + if(newchannel) + break; + } +#endif if(newchannel == NULL) { newchannel = new CZapitChannel ( serviceName, @@ -338,10 +350,13 @@ bool CServiceScan::ParseFst(unsigned short pid, fast_scan_operator_t * op) bouquetId = g_bouquetManager->existsUBouquet(op->name); if (bouquetId == -1) { bouquet = g_bouquetManager->addBouquet(std::string(op->name), true); + bouquetId = g_bouquetManager->existsUBouquet(op->name); } else bouquet = g_bouquetManager->Bouquets[bouquetId]; - bouquet->addService(newchannel); + + if (!(g_bouquetManager->existsChannelInBouquet(bouquetId, newchannel->getChannelID()))) + bouquet->addService(newchannel); } break; default: diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index fa4b3eacc..06dcf6f35 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -420,6 +420,9 @@ audio_map_set_t * CZapit::GetSavedPids(const t_channel_id channel_id) bool CZapit::TuneChannel(CFrontend * frontend, CZapitChannel * channel, bool &transponder_change) { + if(channel == NULL || frontend == NULL) + return false; + transponder_change = frontend->setInput(channel, current_is_nvod); if(transponder_change && !current_is_nvod) { int waitForMotor = frontend->driveToSatellitePosition(channel->getSatellitePosition()); @@ -447,6 +450,9 @@ bool CZapit::TuneChannel(CFrontend * frontend, CZapitChannel * channel, bool &tr bool CZapit::ParsePatPmt(CZapitChannel * channel) { + if(channel == NULL) + return false; + CPat pat(channel->getRecordDemux()); CPmt pmt(channel->getRecordDemux()); DBG("looking up pids for channel_id " PRINTF_CHANNEL_ID_TYPE "\n", channel->getChannelID());