From 4dc1d7147a549db02fa77589c257dd1f1bb2cb4c Mon Sep 17 00:00:00 2001 From: lucgas Date: Tue, 17 Nov 2009 11:35:10 +0000 Subject: [PATCH 01/48] includes for $PREFIX..../include git-svn-id: http://www.coolstreamtech.de/coolstream_public_svn/CROSSENVIROMENT/coolstream@17 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- control.h | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ cs_vfd.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ tsrouter.h | 32 ++++++++++++++++++++++++++ 3 files changed, 161 insertions(+) create mode 100644 control.h create mode 100755 cs_vfd.h create mode 100644 tsrouter.h diff --git a/control.h b/control.h new file mode 100644 index 000000000..ea76cc83a --- /dev/null +++ b/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, 8, unsigned int) +#define IOC_CONTROL_TVAV _IOW(CS_CONTROL_MAGIC, 9, unsigned int) +#define IOC_CONTROL_RGB _IOW(CS_CONTROL_MAGIC, 10, unsigned int) +#define IOC_CONTROL_SCART_STATUS _IOR(CS_CONTROL_MAGIC, 11, scart_status_t *) +#define IOC_CONTROL_PWM_SPEED _IOW(CS_CONTROL_MAGIC, 12, unsigned int) +#define IOC_CONTROL_HDDPOWER _IOW(CS_CONTROL_MAGIC, 13, unsigned int) + +/* ioctl for getting board serial and revision */ +#define IOC_CONTROL_BOARD_SERIAL_LOW _IOR(CS_CONTROL_MAGIC, 14, unsigned int *) +#define IOC_CONTROL_BOARD_SERIAL_HIGH _IOR(CS_CONTROL_MAGIC, 15, unsigned int *) +#define IOC_CONTROL_BOARD_REV _IOR(CS_CONTROL_MAGIC, 16, unsigned int *) + +/* ioctl for setting TS routing */ +#define IOC_CONTROL_TSROUTE_GET_HSDP_CONFIG _IOR(CS_CONTROL_MAGIC, 17, tsrouter_hsdp_config_t *) +#define IOC_CONTROL_TSROUTE_SET_HSDP_CONFIG _IOW(CS_CONTROL_MAGIC, 18, tsrouter_tsp_config_t *) +#define IOC_CONTROL_TSROUTE_GET_TSP_CONFIG _IOR(CS_CONTROL_MAGIC, 19, tsrouter_hsdp_config_t *) +#define IOC_CONTROL_TSROUTE_SET_TSP_CONFIG _IOW(CS_CONTROL_MAGIC, 20, tsrouter_tsp_config_t *) + +#endif /* __CONTROL_H */ diff --git a/cs_vfd.h b/cs_vfd.h new file mode 100755 index 000000000..d10e67e03 --- /dev/null +++ b/cs_vfd.h @@ -0,0 +1,62 @@ +/* + * 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; + +#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) */ + +#endif /* __CS_VFD__ */ diff --git a/tsrouter.h b/tsrouter.h new file mode 100644 index 000000000..672d6721d --- /dev/null +++ b/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 */ From 547abfaef4d60fca3600baf08eb0251ccedfbaa4 Mon Sep 17 00:00:00 2001 From: lucgas Date: Thu, 6 May 2010 03:44:52 +0000 Subject: [PATCH 02/48] add new headers for compile git-svn-id: http://www.coolstreamtech.de/coolstream_public_svn/CROSSENVIROMENT/coolstream@563 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- control.h | 26 +++++++++++++------------- cs_vfd.h | 31 +++++++++++++++++++++++++++---- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/control.h b/control.h index ea76cc83a..cc41c6c72 100644 --- a/control.h +++ b/control.h @@ -46,22 +46,22 @@ typedef struct cs_control_data { /* ioctls */ #define CS_CONTROL_MAGIC 0xDE -#define IOC_CONTROL_WIDESCREEN _IOW(CS_CONTROL_MAGIC, 8, unsigned int) -#define IOC_CONTROL_TVAV _IOW(CS_CONTROL_MAGIC, 9, unsigned int) -#define IOC_CONTROL_RGB _IOW(CS_CONTROL_MAGIC, 10, unsigned int) -#define IOC_CONTROL_SCART_STATUS _IOR(CS_CONTROL_MAGIC, 11, scart_status_t *) -#define IOC_CONTROL_PWM_SPEED _IOW(CS_CONTROL_MAGIC, 12, unsigned int) -#define IOC_CONTROL_HDDPOWER _IOW(CS_CONTROL_MAGIC, 13, unsigned int) +#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, 14, unsigned int *) -#define IOC_CONTROL_BOARD_SERIAL_HIGH _IOR(CS_CONTROL_MAGIC, 15, unsigned int *) -#define IOC_CONTROL_BOARD_REV _IOR(CS_CONTROL_MAGIC, 16, unsigned int *) +#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, 17, tsrouter_hsdp_config_t *) -#define IOC_CONTROL_TSROUTE_SET_HSDP_CONFIG _IOW(CS_CONTROL_MAGIC, 18, tsrouter_tsp_config_t *) -#define IOC_CONTROL_TSROUTE_GET_TSP_CONFIG _IOR(CS_CONTROL_MAGIC, 19, tsrouter_hsdp_config_t *) -#define IOC_CONTROL_TSROUTE_SET_TSP_CONFIG _IOW(CS_CONTROL_MAGIC, 20, tsrouter_tsp_config_t *) +#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/cs_vfd.h b/cs_vfd.h index d10e67e03..a56adf880 100755 --- a/cs_vfd.h +++ b/cs_vfd.h @@ -45,12 +45,33 @@ typedef enum 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_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; +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; + #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 */ @@ -58,5 +79,7 @@ typedef enum #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 */ +#define IOC_VFD_LED_CTRL _IOW(0xDE, 9, unsigned char)/* switch the vfd/psu in standby */ #endif /* __CS_VFD__ */ From 524ce5ca62edbbd2a9bfd3ac1ee2aa81b74ca4aa Mon Sep 17 00:00:00 2001 From: focus Date: Wed, 1 Sep 2010 17:13:20 +0000 Subject: [PATCH 03/48] new header git-svn-id: http://www.coolstreamtech.de/coolstream_public_svn/CROSSENVIROMENT/coolstream@740 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- cs_vfd.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/cs_vfd.h b/cs_vfd.h index a56adf880..13b4b933d 100755 --- a/cs_vfd.h +++ b/cs_vfd.h @@ -52,6 +52,7 @@ typedef enum 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 { @@ -72,6 +73,21 @@ typedef enum { 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 */ @@ -79,7 +95,8 @@ typedef enum { #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 */ -#define IOC_VFD_LED_CTRL _IOW(0xDE, 9, unsigned char)/* switch the vfd/psu in standby */ +#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__ */ From 06d7c697089b5dce07049b91f28d47fc4c547546 Mon Sep 17 00:00:00 2001 From: satbaby Date: Sun, 15 Jan 2012 15:41:54 +0000 Subject: [PATCH 04/48] -add nevis_ir.h file for alternative remote controls git-svn-id: http://www.coolstreamtech.de/coolstream_public_svn/CROSSENVIROMENT/coolstream@2059 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- nevis_ir.h | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 nevis_ir.h diff --git a/nevis_ir.h b/nevis_ir.h new file mode 100644 index 000000000..0774a150c --- /dev/null +++ b/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__ */ From 6ea053c2e934624e5696abde39d8bb43de276bb2 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 21 Nov 2012 20:37:54 +0400 Subject: [PATCH 05/48] gui/widget/menue.cpp: fix hintbox color if theme changed; fix hint paint for page-up button --- src/gui/widget/menue.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 3b6389265..66b252d8b 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -560,6 +560,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; @@ -577,6 +578,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; @@ -1132,6 +1134,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); @@ -1141,6 +1144,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); From fefa483469b0d21d147a513e3f7460720a5da8ae Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Mon, 26 Nov 2012 11:05:20 +0100 Subject: [PATCH 06/48] * Moviebrowser: Ask if the file of a running recording to be deleted. --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/driver/record.cpp | 6 ++--- src/driver/record.h | 2 +- src/gui/moviebrowser.cpp | 46 ++++++++++++++++++++++---------------- src/gui/moviebrowser.h | 4 +--- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 8 files changed, 36 insertions(+), 26 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 44c56365d..09e2a7d51 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -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 diff --git a/data/locale/english.locale b/data/locale/english.locale index 78e18ccb1..01e4502c5 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 diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 93403f3fa..86baeec8e 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 ac5ebc311..b8ee4be99 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -218,7 +218,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/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 92b0d4d0c..bb3cf9281 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -520,7 +520,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, @@ -1229,13 +1228,6 @@ 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 = (int)(((float)16 / (float)9) * (float)m_cBoxFrameInfo.iHeight); int pich = m_cBoxFrameInfo.iHeight; @@ -1638,13 +1630,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 } @@ -1740,8 +1728,28 @@ 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 { + g_Timerd->removeTimerEvent(inst->GetRecordingId()); + skipAsk = true; + } + } + if (onDelete) + onDeleteFile(*m_movieSelectionHandler, skipAsk); + } } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { @@ -2045,7 +2053,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"); @@ -2068,7 +2076,7 @@ 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)) { delFile(movieSelectionHandler.file); 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/system/locals.h b/src/system/locals.h index 237eb94cf..5ae34e13e 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, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 7d307bdb7..8c58cd2a5 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", From 86a95b039fb6c4eea88d06ae730063a52ac0f78a Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Mon, 26 Nov 2012 23:39:43 +0100 Subject: [PATCH 07/48] * Moviebrowser: Fix delete files when recording in progress. --- src/gui/moviebrowser.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index bb3cf9281..f69e7f801 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1743,7 +1743,11 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrNo) onDelete = false; else { - g_Timerd->removeTimerEvent(inst->GetRecordingId()); + CTimerd::RecordingStopInfo recinfo; + recinfo.channel_id = inst->GetChannelId(); + recinfo.eventID = inst->GetRecordingId(); + CRecordManager::getInstance()->Stop(&recinfo); + g_Timerd->removeTimerEvent(recinfo.eventID); skipAsk = true; } } From 964c6f9af01c300173edb9913a945d80d89f51c9 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Mon, 26 Nov 2012 22:35:55 +0100 Subject: [PATCH 08/48] * Moviebrowser: Show rec icon when recording in progress. --- src/gui/moviebrowser.cpp | 9 +++++++++ src/gui/widget/listframe.cpp | 32 ++++++++++++++++++++++++++++---- src/gui/widget/listframe.h | 2 ++ 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index f69e7f801..deaa9e536 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -380,6 +380,7 @@ CMovieBrowser::~CMovieBrowser() m_playListLines.lineArray[i].clear(); m_FilterLines.lineArray[i].clear(); } + m_browserListLines.Icon.clear(); } void CMovieBrowser::fileInfoStale(void) @@ -408,6 +409,7 @@ void CMovieBrowser::fileInfoStale(void) m_playListLines.lineArray[i].clear(); m_FilterLines.lineArray[i].clear(); } + m_browserListLines.Icon.clear(); }; void CMovieBrowser::init(void) @@ -937,6 +939,7 @@ int CMovieBrowser::exec(const char* path) m_recordListLines.lineArray[i].clear(); m_playListLines.lineArray[i].clear(); } + m_browserListLines.Icon.clear(); m_selectedDir = path; @@ -1508,6 +1511,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(); @@ -1545,8 +1549,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); diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index 8a9678ede..7484f1148 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[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; From ab2412343095f7db06031e6c351b82821f7c4ed3 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Tue, 27 Nov 2012 01:15:25 +0100 Subject: [PATCH 09/48] * Timerlist: Show rec icon when recording in progress. --- src/gui/timerlist.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 406e10ef5..c0c15595a 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -734,6 +734,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) { From 8c5a09712e5d41c12260bf6dcdf86afaa81702a7 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Tue, 27 Nov 2012 12:12:59 +0100 Subject: [PATCH 10/48] * Moviebrowser: Fix segfault if movie list is empty --- src/gui/widget/listframe.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index 7484f1148..437cdd0c9 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -392,7 +392,7 @@ void CListFrame::refreshScroll(void) int CListFrame::paintListIcon(int x, int y, int line) { int xDiff = 0; - if (m_pLines->Icon[line] != "") { + 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)) { From 3cad732b06b907c02bc2804024202ea6f20c9d12 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Tue, 27 Nov 2012 12:21:52 +0100 Subject: [PATCH 11/48] * Moviebrowser: Show message when deleting files --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/moviebrowser.cpp | 5 +++++ src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 9 insertions(+) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 09e2a7d51..3b3930340 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1189,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 diff --git a/data/locale/english.locale b/data/locale/english.locale index 01e4502c5..45aa2db2f 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1189,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 diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index deaa9e536..adc0e056a 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -2091,6 +2091,8 @@ void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler, bool skip msg += g_Locale->getText(LOCALE_FILEBROWSER_DODELETE2); 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 @@ -2117,6 +2119,9 @@ void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler, bool skip //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", m_vMovieInfo.size()); diff --git a/src/system/locals.h b/src/system/locals.h index 5ae34e13e..92fa4c9b3 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1216,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, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 8c58cd2a5..55c0a402b 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1216,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", From 5e4a541781ac0d4969cca7ab57b98dc79b7d2fc1 Mon Sep 17 00:00:00 2001 From: satbaby Date: Wed, 28 Nov 2012 19:03:03 +0100 Subject: [PATCH 12/48] src/nhttpd: clean code --- .../tuxboxapi/coolstream/controlapi.cpp | 54 +++++++++---------- src/nhttpd/tuxboxapi/coolstream/controlapi.h | 2 +- .../tuxboxapi/coolstream/neutrinoapi.cpp | 7 ++- src/nhttpd/tuxboxapi/coolstream/neutrinoapi.h | 2 +- .../tuxboxapi/coolstream/neutrinoyparser.cpp | 14 ++--- .../tuxboxapi/coolstream/neutrinoyparser.h | 6 +-- src/nhttpd/yhttpd.cpp | 10 ++-- src/nhttpd/yhttpd_core/helper.cpp | 4 +- src/nhttpd/yhttpd_core/yconnection.cpp | 3 +- src/nhttpd/yhttpd_core/yconnection.h | 2 +- src/nhttpd/yhttpd_core/yhook.h | 4 +- src/nhttpd/yhttpd_core/ylanguage.h | 2 +- src/nhttpd/yhttpd_core/yrequest.cpp | 2 +- src/nhttpd/yhttpd_core/yresponse.cpp | 4 +- src/nhttpd/yhttpd_core/yresponse.h | 6 +-- src/nhttpd/yhttpd_core/ysocket.cpp | 5 +- src/nhttpd/yhttpd_core/ywebserver.cpp | 7 ++- src/nhttpd/yhttpd_mods/mod_auth.cpp | 6 +-- src/nhttpd/yhttpd_mods/mod_auth.h | 3 +- src/nhttpd/yhttpd_mods/mod_cache.cpp | 12 ++--- src/nhttpd/yhttpd_mods/mod_cache.h | 6 +-- src/nhttpd/yhttpd_mods/mod_sendfile.cpp | 10 ++-- src/nhttpd/yhttpd_mods/mod_sendfile.h | 6 +-- src/nhttpd/yhttpd_mods/mod_testhook.h | 2 +- src/nhttpd/yhttpd_mods/mod_weblog.cpp | 8 +-- src/nhttpd/yhttpd_mods/mod_weblog.h | 4 +- src/nhttpd/yhttpd_mods/mod_yparser.cpp | 20 ++++--- src/nhttpd/yhttpd_mods/mod_yparser.h | 8 +-- 28 files changed, 106 insertions(+), 113 deletions(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 036cf3809..c2c078a67 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -34,16 +34,16 @@ #include #include #include -#include "gui/plugins.h"//for relodplugins +#include //for relodplugins #include #include -#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" @@ -220,7 +220,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()); @@ -892,7 +891,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; @@ -900,6 +898,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); @@ -1366,7 +1365,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(); @@ -1389,7 +1388,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(), "%llu", &epgid); CShortEPGData epg; if (CEitManager::getInstance()->getEPGidShort(epgid, &epg)) { @@ -1400,8 +1399,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(), "%llu", &epgid); sscanf(hh->ParamList["starttime"].c_str(), "%lu", &starttime); CEPGData longepg; @@ -1414,7 +1413,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; @@ -1431,7 +1430,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); } @@ -2006,10 +2005,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); } @@ -2072,7 +2070,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; iParamList["alarm"] != "") @@ -2145,7 +2142,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) // Alarm Time - Format exact! HH:MM if(hh->ParamList["alTime"] != "") strptime(hh->ParamList["alTime"].c_str(), "%H:%M", alarmTime); - alHour = alarmTime->tm_hour; + int alHour = alarmTime->tm_hour; correctTime(alarmTime); alarmTimeT = mktime(alarmTime); @@ -2389,10 +2386,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(); } @@ -2479,7 +2474,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) @@ -2735,18 +2730,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", @@ -2767,6 +2757,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( @@ -2780,6 +2771,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); } @@ -2788,6 +2780,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 { @@ -2798,7 +2791,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..db8670cd3 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; 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..3e988b22a 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); @@ -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(); @@ -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/yhttpd.cpp b/src/nhttpd/yhttpd.cpp index a7039798b..7e37a46a4 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/yrequest.cpp b/src/nhttpd/yhttpd_core/yrequest.cpp index 94fb344bd..999903915 100644 --- a/src/nhttpd/yhttpd_core/yrequest.cpp +++ b/src/nhttpd/yhttpd_core/yrequest.cpp @@ -116,7 +116,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)) { 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 601b966a3..eae380b95 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" @@ -241,7 +241,6 @@ bool CWebserver::run(void) { int CWebserver::AcceptNewConnectionSocket() { int slot = -1; CySocket *connectionSock = NULL; - int newfd; if (!(connectionSock = listenSocket.accept())) // Blocking wait { @@ -265,7 +264,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; } @@ -377,7 +376,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..8e747243c 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,11 @@ bool CmAuth::CheckAuth(CyhookHandler *hh) { // decode Base64 buffer to String //----------------------------------------------------------------------------- std::string CmAuth::decodeBase64(const char *b64buffer) { - char *newString, *org_newString; //shorter then b64buffer + 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; From 91abca7d30fa1516efbaa6f6caa6da40512e9f3b Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Fri, 30 Nov 2012 13:55:34 +0100 Subject: [PATCH 13/48] - icons: introduce new icons backward, forward, pause and play --- data/icons/Makefile.am | 4 ++++ data/icons/btn_backward.png | Bin 0 -> 572 bytes data/icons/btn_forward.png | Bin 0 -> 620 bytes data/icons/btn_pause.png | Bin 0 -> 566 bytes data/icons/btn_play.png | Bin 0 -> 580 bytes src/gui/widget/icons.h | 4 ++++ 6 files changed, 8 insertions(+) create mode 100644 data/icons/btn_backward.png create mode 100644 data/icons/btn_forward.png create mode 100644 data/icons/btn_pause.png create mode 100644 data/icons/btn_play.png 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 0000000000000000000000000000000000000000..962e71c844cad566117abca0ed551ecce160e956 GIT binary patch literal 572 zcmV-C0>k}@P)&xpfnI=6S2%}m=d=X=;#aqBwi}ftldU!={JgjH%J)fu+kxY}&0*DBz3V<$Pj9CDT z&2wuF##oFshzI}{Ad?J5L31cdy;0}*<1zEu97%=O(JQ*$F0=WJR8lg@{t!r-PvD$G zRoQ>D&%xUR0Iq&su@~)8Z!`cH$1!*FJ0!g~K_Nj=n$0GyR%>Zir_-VRuDyKU{<=j( zmJ)mb$pp<5#nEoJSKKZNi*U~2RFO27|$};pFoP{eFLq(rpst><-`eiQ{-lQYw}C{^Nqv;VA$H1Int2St>Z^@=ddb zt*wCZ<(T1@A={OwJbv_q$z;N4G@??eV2mM4?-8UTprFp-0P9(Ta=`OvFF=(b2(X^V zZgm%@8Rc?0?^zJsWRiv3JKO&}Ag@%S*xceGec&jWCjWcRpMC@MT=x#q|Kr^N0000< KMNUMnLSTY+Z34^y literal 0 HcmV?d00001 diff --git a/data/icons/btn_forward.png b/data/icons/btn_forward.png new file mode 100644 index 0000000000000000000000000000000000000000..cad43950b4e18dc11a5166a666f53ba142591738 GIT binary patch literal 620 zcmV-y0+aoTP)3loZ&8}ymQrXuO&^2BkBGZt}z8UCSQVnL9kNwpU>R!S=gt~{?$ zC=`g}pIB>eTQJrjR*UMj#@WuBFuCE8v z790-u7sKBE9xu1H61-pEPae8$!5G9zGRjGD6J=2*-w5Qbq=qpF)#dGxr*)zuHQ=P~H_X@C7fYG#J)d={-W ztyYV4I!!*8CzVPOgaP6lpFg$m0fxqafH+4OhAb^TB=7_7MG;ylO3NkuARvk&P=d7< zYeyf+2QIC#nc4fZ|6H6Xijv$6Ent(4^nvY8yYs*6{Q5T~#rw|VNFT%i0000B literal 0 HcmV?d00001 diff --git a/data/icons/btn_pause.png b/data/icons/btn_pause.png new file mode 100644 index 0000000000000000000000000000000000000000..c18fafa40af1986e5d09fc04263c41c14bcf9496 GIT binary patch literal 566 zcmV-60?GY}P))M_=Rvnk$tyz_quT((dU zLZH=Z0dV@^l*jLnr1O+UqX9s(+2q^91L-WqWg7}s76i$!`RAB)KF`gbo_>&~>Dqz? zaNZ$a5JK*AmSqs~q`$Ka9|F$1T?-;xSqX%lAt180U{@9b0Yq)%LBbYR2qO6uoO4K! zb(EVF;co&6y95jNK)>GypwsDKjRoL#a0|e7_nLyWC{%ulK68W+(8@3v47mAx!}G6a zN~IFTf@Sz+NUzspGMP{=M_6m|n>)yy0|5yEV+@r_g>tD(VXufW7Gn&DhgA+L2kgBm zVy#_ZmIPz(e6;^||DVTWtzGx41c0#xE|O95zvq1Q0+Jf==ZYee<^TWy07*qoM6N<$ Ef)jK36aWAK literal 0 HcmV?d00001 diff --git a/data/icons/btn_play.png b/data/icons/btn_play.png new file mode 100644 index 0000000000000000000000000000000000000000..e1baa70cab5893783650108ea7d482272dffbc9f GIT binary patch literal 580 zcmV-K0=xZ*P)}w<}2qLm>Bp0Nxuq9-r;w5+haFAaI#|1G@;mTDC za6#+B4XtTnL*d<-6xViwtOSvjMth{$Ju~Nw#+-gRZ30~&;%(;vI17R9?*48RSK~MR zz8~I4U99aP89I6U{F2WeI z2rxFm)*6hl7;A9O0bl{V^C$|cd_Fp&)oKxcig|u|PI96kimIX{w|D+Gftx2ChzPY> z4S@P_op!rTrBY$`G{bqHbSa98;^u#Ju#}+anpurTgUhd%d^|j4I-B8r^7e%U=N;-5 z75S^{$MrfF=jTiwADKIc^KM;&>g(gX8xEOHf38aq1o;O;=Ua!9<_RncEhU624@6P3 zPH@$^qIc6HpUZRb;egW44%uvGod7^p==b|Hn@u{M4%gqW$>nnF@9j}6M&$E(vY8Cl z+Lr`=?hp~I2^b6p^lo}gCKJl#GKE5ct^5|7=` Date: Fri, 30 Nov 2012 22:06:27 +0100 Subject: [PATCH 14/48] - add keys to control the audioplayer from pictureviewer decode and view pictures in a seperate thread. --- data/locale/deutsch.locale | 6 +++ data/locale/english.locale | 6 +++ src/gui/audioplayer.h | 11 ++-- src/gui/pictureviewer.cpp | 100 ++++++++++++++++++++++++++++++++++--- src/gui/pictureviewer.h | 8 +++ src/system/locals.h | 6 +++ src/system/locals_intern.h | 6 +++ 7 files changed, 131 insertions(+), 12 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 3b3930340..068d6e85f 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1452,6 +1452,12 @@ pictureviewer.help20 Sortierung andern pictureviewer.help21 Bild unskaliert einlesen pictureviewer.help22 Modus verlassen pictureviewer.help3 Sortierung andern +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 diff --git a/data/locale/english.locale b/data/locale/english.locale index 45aa2db2f..dea61a864 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1452,6 +1452,12 @@ 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 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/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 3165df49b..866f2813a 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) @@ -544,6 +556,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) @@ -798,8 +876,16 @@ void CPictureViewerGui::showHelp() 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 $"); + 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/system/locals.h b/src/system/locals.h index 92fa4c9b3..eb94a4ceb 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1479,6 +1479,12 @@ typedef enum 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 55c0a402b..b4431b571 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1479,6 +1479,12 @@ const char * locale_real_names[] = "pictureviewer.help21", "pictureviewer.help22", "pictureviewer.help3", + "pictureviewer.help30", + "pictureviewer.help31", + "pictureviewer.help32", + "pictureviewer.help33", + "pictureviewer.help34", + "pictureviewer.help35", "pictureviewer.help4", "pictureviewer.help5", "pictureviewer.help6", From b252de089662efcdb5932851c78cbbb98bb7fe48 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 4 Dec 2012 13:50:11 +0400 Subject: [PATCH 15/48] gui/movieplayer.cpp: dont auto-stop, if duration or position invalid --- src/gui/movieplayer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index d7e02a6ef..391c51897 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -500,7 +500,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) From c77138f2607e8584c1a4559d93fc7b40d9175240 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 4 Dec 2012 13:58:41 +0400 Subject: [PATCH 16/48] neutrino.cpp: revert mount at startup to system - fs can be not only ext3 but different --- src/neutrino.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 8323ec90a..8039d0142 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1858,12 +1858,10 @@ TIMER_START(); 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(); From d5cd463e17502cf41096560c33f1da929ee37dd4 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 4 Dec 2012 14:52:03 +0400 Subject: [PATCH 17/48] neutrino.cpp: fix subchannel up/down processing: if key_subchannel_up/down is set to different than left/right keys, and mode_left_right_key_tv == SNeutrinoSettings::VOLUME, CVolume::setVolume called, but not process other keys, and post msg again -> loop forever. - process mode_left_right_key_tv modes only if subchannel up/down == left/right --- src/neutrino.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 8039d0142..45e780792 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2050,13 +2050,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 ); From 5fc0d256f487ad0e1a4b7fae937ebb6efc1a77bd Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 4 Dec 2012 17:25:58 +0400 Subject: [PATCH 18/48] zapit/src/fastscan.cpp: fix duplicate channels in favorite bouquet, try to fix possible possible duplicates from different frequency --- src/zapit/src/fastscan.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) 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: From 108913b65dd6b7d7818570541f158d8b4d850348 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 4 Dec 2012 18:55:29 +0400 Subject: [PATCH 19/48] gui/cam_menu.cpp: workaround for possible wrong CI menu item count from libcs --- src/gui/cam_menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/cam_menu.cpp b/src/gui/cam_menu.cpp index 34071faec..7a8317d4d 100644 --- a/src/gui/cam_menu.cpp +++ b/src/gui/cam_menu.cpp @@ -332,7 +332,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)); From 882a7b2e4708d29bbb9c2f69056c4fa986220b42 Mon Sep 17 00:00:00 2001 From: satbaby Date: Tue, 4 Dec 2012 19:57:02 +0100 Subject: [PATCH 20/48] src/gui/plugins.cpp: fix sort pluins without index --- src/gui/plugins.cpp | 4 ++-- src/gui/plugins.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index 80836e7a1..2698ad2f7 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -156,7 +156,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); @@ -184,7 +184,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; From fbf2c058250975758fc1deec879287a8bde68141 Mon Sep 17 00:00:00 2001 From: satbaby Date: Tue, 4 Dec 2012 19:57:30 +0100 Subject: [PATCH 21/48] update astra --- data/satellites.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@ - + From 02b26854949f6efcb3f618fe9abf728cc9a7a5d8 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Tue, 4 Dec 2012 11:00:27 +0100 Subject: [PATCH 22/48] * CHintBoxExt: Fix view of multiple pages - Reduces flicker effect on screen --- src/gui/widget/hintboxext.cpp | 14 ++++++++++++-- src/gui/widget/hintboxext.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/hintboxext.cpp b/src/gui/widget/hintboxext.cpp index acec30040..8684e6899 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; @@ -147,6 +148,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++; } @@ -209,6 +215,7 @@ void CHintBoxExt::paint(bool toround) return; } + bgPainted = false; CFrameBuffer* frameBuffer = CFrameBuffer::getInstance(); m_window = new CFBWindow(frameBuffer->getScreenX() + ((frameBuffer->getScreenWidth() - m_width ) >> 1), frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - m_height) >> 2), @@ -225,8 +232,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 64dc907c9..9cec2bd8b 100644 --- a/src/gui/widget/hintboxext.h +++ b/src/gui/widget/hintboxext.h @@ -63,6 +63,7 @@ class CHintBoxExt char * m_message; ContentLines m_lines; std::string m_iconfile; + bool bgPainted; void refresh(bool toround = 1); From c691c242ff3d576fdde0c844a200b1378d3ac3f2 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Tue, 4 Dec 2012 21:05:19 +0100 Subject: [PATCH 23/48] * Pictureviewer: Remove duplicate locale from help text --- data/locale/deutsch.locale | 29 +++++++++++++---------------- data/locale/english.locale | 27 ++++++++++++--------------- src/gui/pictureviewer.cpp | 30 +++++++++++++++--------------- src/system/locals.h | 3 --- src/system/locals_intern.h | 3 --- 5 files changed, 40 insertions(+), 52 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 068d6e85f..3824943c4 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1437,21 +1437,18 @@ 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 @@ -1462,8 +1459,8 @@ 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 dea61a864..472b88de4 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1437,20 +1437,17 @@ 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 @@ -1462,8 +1459,8 @@ 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/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 866f2813a..4dbd38422 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -860,22 +860,22 @@ 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(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(); diff --git a/src/system/locals.h b/src/system/locals.h index eb94a4ceb..9d670a45b 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1475,9 +1475,6 @@ 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, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index b4431b571..e00f7b242 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1475,9 +1475,6 @@ const char * locale_real_names[] = "pictureviewer.help18", "pictureviewer.help19", "pictureviewer.help2", - "pictureviewer.help20", - "pictureviewer.help21", - "pictureviewer.help22", "pictureviewer.help3", "pictureviewer.help30", "pictureviewer.help31", From b5e877639e5356fa52338c7bd3b92c566de950ef Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Tue, 4 Dec 2012 18:17:15 +0100 Subject: [PATCH 24/48] * Update locale for menu hints (THX Tomworld) --- data/locale/deutsch.locale | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 3824943c4..77aaddb59 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 From 2fbe881180aef27b24996c14508538a576642dd4 Mon Sep 17 00:00:00 2001 From: satbaby Date: Thu, 6 Dec 2012 23:11:56 +0100 Subject: [PATCH 25/48] src/nhttpd/yhttpd_mods/mod_yparser.cpp: workaround fix for segfault if server.log.loglevel=5 and read timer --- src/nhttpd/yhttpd_mods/mod_yparser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index 3fd7a1c5e..3e2ba627e 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -330,7 +330,8 @@ std::string CyParser::cgi_cmd_parsing(CyhookHandler *hh, if (ydebug) hh->printf("[ycgi debug]: CMD:[%s]
\n", ycmd.c_str()); yresult = YWeb_cgi_cmd(hh, ycmd); // 4. execute cmd - log_level_printf(5, ": ycmd...:%s\n", ycmd.c_str()); +// log_level_printf(5, ": ycmd...:%s\n", ycmd.c_str());//FIXME %s %s ... segfault + log_level_printf(6, ": yresult:%s\n", yresult.c_str()); if (ydebug) hh->printf("[ycgi debug]: RESULT:[%s]
\n", From fe16513b4ff1cc6fe6b083e51a48f5d568a99fa5 Mon Sep 17 00:00:00 2001 From: satbaby Date: Fri, 7 Dec 2012 11:13:51 +0100 Subject: [PATCH 26/48] src/nhttpd: fix segfault if logging on --- src/nhttpd/yhttpd_core/ylogging.cpp | 5 ++++- src/nhttpd/yhttpd_mods/mod_auth.cpp | 2 ++ src/nhttpd/yhttpd_mods/mod_yparser.cpp | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) 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_mods/mod_auth.cpp b/src/nhttpd/yhttpd_mods/mod_auth.cpp index 8e747243c..89dc65f1b 100644 --- a/src/nhttpd/yhttpd_mods/mod_auth.cpp +++ b/src/nhttpd/yhttpd_mods/mod_auth.cpp @@ -65,6 +65,8 @@ bool CmAuth::CheckAuth(CyhookHandler *hh) { // decode Base64 buffer to String //----------------------------------------------------------------------------- std::string CmAuth::decodeBase64(const char *b64buffer) { + if(b64buffer==NULL) + return ""; char *newString; //shorter then b64buffer std::string result; if ((newString = (char *) malloc(sizeof(char) * strlen(b64buffer) + 1)) diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index 3e2ba627e..3fd7a1c5e 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -330,8 +330,7 @@ std::string CyParser::cgi_cmd_parsing(CyhookHandler *hh, if (ydebug) hh->printf("[ycgi debug]: CMD:[%s]
\n", ycmd.c_str()); yresult = YWeb_cgi_cmd(hh, ycmd); // 4. execute cmd -// log_level_printf(5, ": ycmd...:%s\n", ycmd.c_str());//FIXME %s %s ... segfault - + log_level_printf(5, ": ycmd...:%s\n", ycmd.c_str()); log_level_printf(6, ": yresult:%s\n", yresult.c_str()); if (ydebug) hh->printf("[ycgi debug]: RESULT:[%s]
\n", From 1d5e7b23b371e6cf5dc95b84d73e302f7d7e37ed Mon Sep 17 00:00:00 2001 From: satbaby Date: Fri, 7 Dec 2012 12:01:45 +0100 Subject: [PATCH 27/48] never used --- src/eitd/SIevents.hpp | 3 +++ src/eitd/SIsections.hpp | 5 +++-- src/eitd/SIservices.hpp | 12 +++++++++--- src/gui/epgplus.cpp | 4 ++-- src/gui/timerlist.cpp | 2 +- src/gui/widget/progresswindow.cpp | 2 +- src/timerd/timerd.cpp | 2 +- 7 files changed, 20 insertions(+), 10 deletions(-) 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/epgplus.cpp b/src/gui/epgplus.cpp index 84e4d42df..0aed608ff 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/timerlist.cpp b/src/gui/timerlist.cpp index c0c15595a..2491ddcc3 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -776,7 +776,7 @@ void CTimerList::paintItem(int pos) { zAddData += sep; zAddData += "AC3"; - sep = "/"; +// sep = "/"; } zAddData += ')'; } diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index fa8dff4e4..0e06617e7 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -166,7 +166,7 @@ void CProgressWindow::paint() ypos+= mheight; globalstatusY = ypos+ mheight-20; - ypos+= mheight >>1; + //ypos+= mheight >>1; showGlobalStatus(global_progress); } diff --git a/src/timerd/timerd.cpp b/src/timerd/timerd.cpp index db1e2c5da..5eb5c509e 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) From 7bebdf91e0ee941820dd1c68d09bed22f1e2efe2 Mon Sep 17 00:00:00 2001 From: satbaby Date: Sat, 8 Dec 2012 11:15:40 +0100 Subject: [PATCH 28/48] add provider name to infobar , no gui option --- src/gui/infoviewer.cpp | 32 +++++++++++++++++++++++++++++--- src/gui/infoviewer.h | 2 +- src/neutrino.cpp | 15 ++++++++++++++- src/system/settings.h | 1 + 4 files changed, 45 insertions(+), 5 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index e1292fd5d..c2aa9e35d 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -567,21 +567,38 @@ void CInfoViewer::check_channellogo_ca_SettingsChange() void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap, int epgpos) { if(channel) { + std::string pname = ""; + if(g_settings.infobar_show_channeldesc){ + if(channel->pname){ + pname = channel->pname; + pname=pname.substr(pname.find_first_of("]")+1); + } + } + showTitle(channel->number, channel->getName(), channel->getSatellitePosition(), - channel->getChannelID(), calledFromNumZap, epgpos); + channel->getChannelID(), calledFromNumZap, epgpos, pname); } } void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int epgpos) { + CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(chid); + std::string pname = ""; + if(channel) { + if(g_settings.infobar_show_channeldesc){ + if(channel->pname){ + pname = channel->pname; + pname=pname.substr(pname.find_first_of("]")+1); + } + } showTitle(channel->number, channel->getName(), channel->getSatellitePosition(), - channel->getChannelID(), calledFromNumZap, epgpos); + channel->getChannelID(), calledFromNumZap, epgpos, 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, std::string pname) { check_channellogo_ca_SettingsChange(); aspectRatio = 0; @@ -709,6 +726,15 @@ 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 + if(g_settings.infobar_show_channeldesc && !pname.empty()){ + 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, + pname, color /*COL_INFOBAR*/, 0, true); // UTF-8 + } + } } diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index e2d5a9b95..6a70a154c 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -155,7 +155,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, std::string pname=""); // 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/neutrino.cpp b/src/neutrino.cpp index 45e780792..baa905480 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -378,6 +378,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); @@ -833,6 +834,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); @@ -1953,7 +1955,18 @@ void CNeutrinoApp::numericZap(int msg) void CNeutrinoApp::showInfo() { StopSubtitles(); - g_InfoViewer->showTitle(channelList->getActiveChannelNumber(), channelList->getActiveChannelName(), channelList->getActiveSatellitePosition(), channelList->getActiveChannel_ChannelID()); + std::string name = channelList->getActiveChannelName(); + std::string pname = ""; + + if(g_settings.infobar_show_channeldesc){ + CZapitChannel* channel= channelList->getActiveChannel(); + if(channel->pname){ + pname = channel->pname; + pname=pname.substr(pname.find_first_of("]")+1); + } + } + + g_InfoViewer->showTitle(channelList->getActiveChannelNumber(), name, channelList->getActiveSatellitePosition(), channelList->getActiveChannel_ChannelID(), false, 0, pname); StartSubtitles(); } diff --git a/src/system/settings.h b/src/system/settings.h index 2ca0ddd42..29c9ee2fb 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -63,6 +63,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; From 59fa692bd0381c95b9569279ca876eb429d54945 Mon Sep 17 00:00:00 2001 From: satbaby Date: Sat, 8 Dec 2012 16:28:53 +0100 Subject: [PATCH 29/48] supplement to 7bebdf91e0ee941820dd1c68d09bed22f1e2efe2, simplification --- src/gui/infoviewer.cpp | 28 +++++++++------------------- src/gui/infoviewer.h | 2 +- src/neutrino.cpp | 8 +++----- 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index c2aa9e35d..b495afb1f 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -567,16 +567,9 @@ void CInfoViewer::check_channellogo_ca_SettingsChange() void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap, int epgpos) { if(channel) { - std::string pname = ""; - if(g_settings.infobar_show_channeldesc){ - if(channel->pname){ - pname = channel->pname; - pname=pname.substr(pname.find_first_of("]")+1); - } - } showTitle(channel->number, channel->getName(), channel->getSatellitePosition(), - channel->getChannelID(), calledFromNumZap, epgpos, pname); + channel->getChannelID(), calledFromNumZap, epgpos, channel->pname); } } @@ -584,21 +577,14 @@ void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int { CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(chid); - std::string pname = ""; if(channel) { - if(g_settings.infobar_show_channeldesc){ - if(channel->pname){ - pname = channel->pname; - pname=pname.substr(pname.find_first_of("]")+1); - } - } showTitle(channel->number, channel->getName(), channel->getSatellitePosition(), - channel->getChannelID(), calledFromNumZap, epgpos, pname); + 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, std::string 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, char *pname) { check_channellogo_ca_SettingsChange(); aspectRatio = 0; @@ -726,13 +712,17 @@ 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 - if(g_settings.infobar_show_channeldesc && !pname.empty()){ + //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, - pname, color /*COL_INFOBAR*/, 0, true); // UTF-8 + prov_name, color /*COL_INFOBAR*/, 0, true); // UTF-8 } } diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index 6a70a154c..c1860b4d6 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -155,7 +155,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, std::string pname=""); // 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/neutrino.cpp b/src/neutrino.cpp index baa905480..466566897 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1955,18 +1955,16 @@ void CNeutrinoApp::numericZap(int msg) void CNeutrinoApp::showInfo() { StopSubtitles(); - std::string name = channelList->getActiveChannelName(); - std::string pname = ""; + char *pname = NULL; if(g_settings.infobar_show_channeldesc){ - CZapitChannel* channel= channelList->getActiveChannel(); + CZapitChannel* channel = channelList->getActiveChannel(); if(channel->pname){ pname = channel->pname; - pname=pname.substr(pname.find_first_of("]")+1); } } - g_InfoViewer->showTitle(channelList->getActiveChannelNumber(), name, channelList->getActiveSatellitePosition(), channelList->getActiveChannel_ChannelID(), false, 0, pname); + g_InfoViewer->showTitle(channelList->getActiveChannelNumber(), channelList->getActiveChannelName(), channelList->getActiveSatellitePosition(), channelList->getActiveChannel_ChannelID(), false, 0, pname); StartSubtitles(); } From dc33e93375cb80e6792f4ba82deee0f639f9caa4 Mon Sep 17 00:00:00 2001 From: satbaby Date: Sat, 8 Dec 2012 17:47:25 +0100 Subject: [PATCH 30/48] yWeb: Timer: dont stop recording after modifying timer - Timer: sets audio-pid correctly - Timer: seconds set to Null --- .../tuxboxapi/coolstream/controlapi.cpp | 47 +++++++++++++------ 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index c2c078a67..a341485e4 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -2119,6 +2119,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) alarmTimeT = 0, tnull = 0; unsigned int repCount = 0; + int alHour=0; // if alarm given then in parameters im time_t format if(hh->ParamList["alarm"] != "") @@ -2137,13 +2138,16 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) tnull = time(NULL); struct tm *alarmTime=localtime(&tnull); alarmTime->tm_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); - int alHour = alarmTime->tm_hour; - + 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; @@ -2151,12 +2155,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) @@ -2218,9 +2225,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; @@ -2247,6 +2254,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) apids |= TIMERD_APIDS_AC3; } } + CTimerd::RecordingInfo recinfo; CTimerd::EventInfo eventinfo; eventinfo.epgID = 0; @@ -2257,8 +2265,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"]); @@ -2280,8 +2288,8 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) // get Default Recordingdir CConfigFile *Config = new CConfigFile(','); Config->loadConfig(NEUTRINO_CONFIGFILE); - _rec_dir = Config->getString("network_nfs_recordingdir", "/mnt/filme"); - delete Config;//Memory leak: Config + _rec_dir = Config->getString("recording_dir_0", "/mnt/filme"); + delete Config; } if(changeApids) eventinfo.apids = apids; @@ -2309,7 +2317,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 { @@ -2327,15 +2341,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(); } //------------------------------------------------------------------------- From b3ddc46e14f1aeef127576f04e51cecd460bc9ad Mon Sep 17 00:00:00 2001 From: satbaby Date: Sat, 8 Dec 2012 17:53:01 +0100 Subject: [PATCH 31/48] supplement to dc33e93375cb80e6792f4ba82deee0f639f9caa4 --- src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index a341485e4..bd352e888 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -2288,7 +2288,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) // get Default Recordingdir CConfigFile *Config = new CConfigFile(','); Config->loadConfig(NEUTRINO_CONFIGFILE); - _rec_dir = Config->getString("recording_dir_0", "/mnt/filme"); + _rec_dir = Config->getString("network_nfs_recordingdir", "/mnt/filme"); delete Config; } if(changeApids) From 0ec6859ea9263621d3d0baaafff38d75fe56fb9f Mon Sep 17 00:00:00 2001 From: swing99 Date: Mon, 10 Dec 2012 14:35:02 +0100 Subject: [PATCH 32/48] cables.xml: update Kabel Deutschland - Offensive 2012 --- data/cables.xml | 1 + 1 file changed, 1 insertion(+) 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 @@ + From 998ae6d81dc77b106e20798576ec66d012480362 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Thu, 13 Dec 2012 10:49:06 +0100 Subject: [PATCH 33/48] - svn_CROSSENVIRONMENT_coolstream: move files to new right place --- control.h => lib/libcoolstream/control.h | 0 cs_vfd.h => lib/libcoolstream/cs_vfd.h | 0 nevis_ir.h => lib/libcoolstream/nevis_ir.h | 0 tsrouter.h => lib/libcoolstream/tsrouter.h | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename control.h => lib/libcoolstream/control.h (100%) rename cs_vfd.h => lib/libcoolstream/cs_vfd.h (100%) rename nevis_ir.h => lib/libcoolstream/nevis_ir.h (100%) rename tsrouter.h => lib/libcoolstream/tsrouter.h (100%) diff --git a/control.h b/lib/libcoolstream/control.h similarity index 100% rename from control.h rename to lib/libcoolstream/control.h diff --git a/cs_vfd.h b/lib/libcoolstream/cs_vfd.h similarity index 100% rename from cs_vfd.h rename to lib/libcoolstream/cs_vfd.h diff --git a/nevis_ir.h b/lib/libcoolstream/nevis_ir.h similarity index 100% rename from nevis_ir.h rename to lib/libcoolstream/nevis_ir.h diff --git a/tsrouter.h b/lib/libcoolstream/tsrouter.h similarity index 100% rename from tsrouter.h rename to lib/libcoolstream/tsrouter.h From d67b1e9c9323e04868c8ff25a0c927951ff7be63 Mon Sep 17 00:00:00 2001 From: satbaby Date: Thu, 13 Dec 2012 14:03:04 +0100 Subject: [PATCH 34/48] src/zapit/src/zapit.cpp: fix segfault if channel==NULL (reloadchannels) --- src/zapit/src/zapit.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index bcb08d681..a50342ec4 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -416,6 +416,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()); @@ -443,6 +446,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()); From b1138e16b079c7ca69d20b2f8f1dc08769a92390 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Thu, 13 Dec 2012 17:45:43 +0100 Subject: [PATCH 35/48] * Fix include path for moved header files --- configure.ac | 4 +++- lib/libcoolstream/cs_api.h | 2 +- lib/libcoolstream/video_cs.h | 4 ++-- src/driver/rcinput.h | 2 +- src/driver/vfd.h | 2 +- src/drivertool.c | 4 ++-- src/neutrino.cpp | 2 +- src/system/setting_helpers.cpp | 4 ---- 8 files changed, 11 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index d1d0378da..f5e82089c 100644 --- a/configure.ac +++ b/configure.ac @@ -118,7 +118,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/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/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 ce2150e28..6cb043be5 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/vfd.h b/src/driver/vfd.h index 1519021d3..8f0680e6e 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/neutrino.cpp b/src/neutrino.cpp index 466566897..ec32d4e63 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1696,7 +1696,7 @@ void CNeutrinoApp::InitSectiondClient() } #if HAVE_COOL_HARDWARE -#include +#include #endif void wake_up( bool &wakeup) diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index d362132c5..81d1418f8 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 From 42b69a8a5eb061ea90b25328be8c5ed5efd46782 Mon Sep 17 00:00:00 2001 From: satbaby Date: Fri, 14 Dec 2012 14:34:18 +0100 Subject: [PATCH 36/48] src/nhttpd/yhttpd_core/helper.cpp: dont decode '+' to ' ', fix for channelname with '+' --- src/nhttpd/yhttpd_core/helper.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nhttpd/yhttpd_core/helper.cpp b/src/nhttpd/yhttpd_core/helper.cpp index e2449fbbd..d529127fc 100644 --- a/src/nhttpd/yhttpd_core/helper.cpp +++ b/src/nhttpd/yhttpd_core/helper.cpp @@ -203,9 +203,12 @@ std::string decodeString(std::string encodedString) { iStr = strtoul(hex, NULL, 16); /* convert to Hex char */ result += (char) iStr; count += 3; +#if 0 +//why decode '+' to ' ' ? } else if (string[count] == '+') { result += ' '; count++; +#endif } else { result += string[count]; count++; From 636be7fa8493189a135576a71c8c18d6e1701ebc Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 17 Dec 2012 12:46:09 +0400 Subject: [PATCH 37/48] gui/videosettings.cpp: fix video mode switch ask, fix menu redraw after video mode switch --- src/gui/videosettings.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index f59e02752..6aab8b977 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -300,9 +300,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; } } @@ -343,6 +343,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)) From ed318d97bc7ab06299e9504c7e3249cd8dc0324c Mon Sep 17 00:00:00 2001 From: satbaby Date: Mon, 17 Dec 2012 12:58:24 +0100 Subject: [PATCH 38/48] nhttpd: skip doubles decode on channlename, revert 42b69a8a5eb061ea90b25328be8c5ed5efd46782 --- src/nhttpd/yhttpd_core/helper.cpp | 3 --- src/nhttpd/yhttpd_core/yrequest.cpp | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/yhttpd_core/helper.cpp b/src/nhttpd/yhttpd_core/helper.cpp index d529127fc..e2449fbbd 100644 --- a/src/nhttpd/yhttpd_core/helper.cpp +++ b/src/nhttpd/yhttpd_core/helper.cpp @@ -203,12 +203,9 @@ std::string decodeString(std::string encodedString) { iStr = strtoul(hex, NULL, 16); /* convert to Hex char */ result += (char) iStr; count += 3; -#if 0 -//why decode '+' to ' ' ? } else if (string[count] == '+') { result += ' '; count++; -#endif } else { result += string[count]; count++; diff --git a/src/nhttpd/yhttpd_core/yrequest.cpp b/src/nhttpd/yhttpd_core/yrequest.cpp index 999903915..84ccc5274 100644 --- a/src/nhttpd/yhttpd_core/yrequest.cpp +++ b/src/nhttpd/yhttpd_core/yrequest.cpp @@ -161,7 +161,11 @@ bool CWebserverRequest::ParseParams(std::string param_string) { if (!ySplitStringExact(param_string, "&", param, param_string)) ende = true; if (ySplitStringExact(param, "=", name, value)) { - value = trim(decodeString(value)); + if("channelname" == name){//skip doubles decode on channlename + value = trim((value)); + }else{ + value = trim(decodeString(value)); + } if (ParameterList[name].empty()) ParameterList[name] = value; else { From f66b2baedce1e9350ad18d402317dcc1847e35e3 Mon Sep 17 00:00:00 2001 From: satbaby Date: Mon, 17 Dec 2012 22:01:46 +0100 Subject: [PATCH 39/48] nhttpd: dont doubles decode, revert ed318d97bc7ab06299e9504c7e3249cd8dc0324c --- src/nhttpd/tuxboxapi/coolstream/controlapi.cpp | 2 +- src/nhttpd/yhttpd_core/yrequest.cpp | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index bd352e888..08968fddd 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -561,7 +561,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(); } diff --git a/src/nhttpd/yhttpd_core/yrequest.cpp b/src/nhttpd/yhttpd_core/yrequest.cpp index 84ccc5274..ae3a543d7 100644 --- a/src/nhttpd/yhttpd_core/yrequest.cpp +++ b/src/nhttpd/yhttpd_core/yrequest.cpp @@ -161,11 +161,7 @@ bool CWebserverRequest::ParseParams(std::string param_string) { if (!ySplitStringExact(param_string, "&", param, param_string)) ende = true; if (ySplitStringExact(param, "=", name, value)) { - if("channelname" == name){//skip doubles decode on channlename - value = trim((value)); - }else{ - value = trim(decodeString(value)); - } + value = trim(decodeString(value)); if (ParameterList[name].empty()) ParameterList[name] = value; else { @@ -215,7 +211,7 @@ bool CWebserverRequest::ParseHeader(std::string header) { void CWebserverRequest::analyzeURL(std::string url) { ParameterList.clear(); // URI decode - url = decodeString(url); + //url = decodeString(url); url = trim(url, "\r\n"); // non-HTTP-Standard: allow \r or \n in URL. Delete it. UrlData["fullurl"] = url; // split Params From bce78c2cff3a078a75f78d6e33bc2b80d28f3509 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Tue, 18 Dec 2012 21:58:00 +0100 Subject: [PATCH 40/48] - moviebrowser.cpp: accept covers without appended date/time patch by FlatTV --- src/gui/moviebrowser.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index adc0e056a..8ed92f2a4 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1235,7 +1235,12 @@ void CMovieBrowser::refreshMovieInfo(void) int picw = (int)(((float)16 / (float)9) * (float)m_cBoxFrameInfo.iHeight); 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); From 5749f8632326cecdf45b1f19734d59bff700b3d1 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 19 Dec 2012 16:45:40 +0400 Subject: [PATCH 41/48] gui/miscsettings_menu.cpp: always enable EPG options, which not depend on save epg on/off --- src/gui/miscsettings_menu.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index c1bd9c746..9cb4d2692 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -309,19 +309,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"); @@ -329,10 +329,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); From 0806c47c73fb6660ba0eee2a49ef8a197763d9b9 Mon Sep 17 00:00:00 2001 From: satbaby Date: Thu, 20 Dec 2012 20:13:44 +0100 Subject: [PATCH 42/48] neutrino: fix segfault if not found frontend --- src/neutrino.cpp | 6 ++++++ src/zapit/src/getservices.cpp | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index ec32d4e63..fff0e4624 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1819,6 +1819,12 @@ TIMER_START(); cpuFreq = new cCpuFreqManager(); cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); + + g_info.delivery_system = DVB_S; + if(CFEManager::getInstance()->getLiveFE() != NULL){ + g_info.delivery_system = CFEManager::getInstance()->getLiveFE()->getInfo()->type == FE_QPSK ? DVB_S : DVB_C; + } + g_info.delivery_system = CFEManager::getInstance()->getLiveFE()->getInfo()->type == FE_QPSK ? DVB_S : DVB_C; #if HAVE_TRIPLEDRAGON /* only SAT-hd1 before rev 8 has fan, rev 1 is TD (compat hack) */ diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 4255a35bf..0aa479238 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -591,6 +591,9 @@ bool CServiceManager::InitSatPosition(t_satellite_position position, char * name bool CServiceManager::LoadServices(bool only_current) { + if(CFEManager::getInstance()->getLiveFE() == NULL) + return false; + xmlDocPtr parser; static bool satcleared = 0;//clear only once, because menu is static service_count = 0; From 2d1beb8402158da1421c184147d53b4a30aa0ac3 Mon Sep 17 00:00:00 2001 From: satbaby Date: Thu, 20 Dec 2012 21:05:44 +0100 Subject: [PATCH 43/48] nhttpd: fix encode bouquet and audio name --- src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp index 3e988b22a..972c5d173 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp @@ -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; @@ -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; From 289e927e049da0219d0d0069d1fb73ab70d7384a Mon Sep 17 00:00:00 2001 From: satbaby Date: Sat, 22 Dec 2012 16:42:00 +0100 Subject: [PATCH 44/48] src/nhttpd/yhttpd_core/yrequest.cpp: fix automount string decode --- src/nhttpd/yhttpd_core/yrequest.cpp | 35 +++++++++++++++-------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/nhttpd/yhttpd_core/yrequest.cpp b/src/nhttpd/yhttpd_core/yrequest.cpp index ae3a543d7..3e281b20d 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, 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,7 +212,8 @@ 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. @@ -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; From 8b35ae80607019ca067e2a1fc9efd2c2c5744d95 Mon Sep 17 00:00:00 2001 From: satbaby Date: Sat, 22 Dec 2012 17:12:22 +0100 Subject: [PATCH 45/48] src/nhttpd/web/scripts/Y_Tools.sh: show alle prozesse --- src/nhttpd/web/scripts/Y_Tools.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..." ;; From b58cbd41359fa7b3d506b8f7f8ee1d7a7222cd62 Mon Sep 17 00:00:00 2001 From: satbaby Date: Sat, 22 Dec 2012 17:19:43 +0100 Subject: [PATCH 46/48] src/nhttpd/yhttpd_core/yrequest.cpp: maybe needed, supplement to 289e927e049da0219d0d0069d1fb73ab70d7384a --- src/nhttpd/yhttpd_core/yrequest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nhttpd/yhttpd_core/yrequest.cpp b/src/nhttpd/yhttpd_core/yrequest.cpp index 3e281b20d..f684f9ddd 100644 --- a/src/nhttpd/yhttpd_core/yrequest.cpp +++ b/src/nhttpd/yhttpd_core/yrequest.cpp @@ -215,16 +215,16 @@ void CWebserverRequest::analyzeURL(std::string url) { 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 From 4965619a79474fcac028effd4dc6e23064fab9fa Mon Sep 17 00:00:00 2001 From: satbaby Date: Sun, 23 Dec 2012 19:12:41 +0100 Subject: [PATCH 47/48] src/nhttpd/tuxboxapi/coolstream/controlapi.cpp: add current transponder pchannels list , use: /control/currenttpchannels --- .../tuxboxapi/coolstream/controlapi.cpp | 22 ++++++++++++++----- src/nhttpd/tuxboxapi/coolstream/controlapi.h | 3 ++- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 08968fddd..fc902669d 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -163,6 +163,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"}, @@ -531,6 +532,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) { @@ -1597,17 +1604,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()); + } } } diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.h b/src/nhttpd/tuxboxapi/coolstream/controlapi.h index db8670cd3..151dbf160 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.h +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.h @@ -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); From 8dcd92d5573c23a83ec4e4c48b330245cbf828a0 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 30 Dec 2012 20:56:19 +0100 Subject: [PATCH 48/48] Revert "neutrino: fix segfault if not found frontend" This reverts commit 0806c47c73fb6660ba0eee2a49ef8a197763d9b9. (it does not fix the real problem) --- src/neutrino.cpp | 6 ------ src/zapit/src/getservices.cpp | 3 --- 2 files changed, 9 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index fff0e4624..ec32d4e63 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1819,12 +1819,6 @@ TIMER_START(); cpuFreq = new cCpuFreqManager(); cpuFreq->SetCpuFreq(g_settings.cpufreq * 1000 * 1000); - - g_info.delivery_system = DVB_S; - if(CFEManager::getInstance()->getLiveFE() != NULL){ - g_info.delivery_system = CFEManager::getInstance()->getLiveFE()->getInfo()->type == FE_QPSK ? DVB_S : DVB_C; - } - g_info.delivery_system = CFEManager::getInstance()->getLiveFE()->getInfo()->type == FE_QPSK ? DVB_S : DVB_C; #if HAVE_TRIPLEDRAGON /* only SAT-hd1 before rev 8 has fan, rev 1 is TD (compat hack) */ diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 0aa479238..4255a35bf 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -591,9 +591,6 @@ bool CServiceManager::InitSatPosition(t_satellite_position position, char * name bool CServiceManager::LoadServices(bool only_current) { - if(CFEManager::getInstance()->getLiveFE() == NULL) - return false; - xmlDocPtr parser; static bool satcleared = 0;//clear only once, because menu is static service_count = 0;