From 94b90fbbae876783b88ebd7211939a20b37ba4b6 Mon Sep 17 00:00:00 2001 From: "[CST] Lucian" Date: Tue, 17 Nov 2009 11:35:10 +0000 Subject: [PATCH 01/40] includes for $PREFIX..../include git-svn-id: http://www.coolstreamtech.de/coolstream_public_svn/CROSSENVIROMENT/coolstream@17 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4dc1d7147a549db02fa77589c257dd1f1bb2cb4c Author: [CST] Lucian Date: 2009-11-17 (Tue, 17 Nov 2009) --- 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 01e789a42578fba9922216746a8fca7f31e90828 Mon Sep 17 00:00:00 2001 From: "[CST] Lucian" Date: Thu, 6 May 2010 03:44:52 +0000 Subject: [PATCH 02/40] add new headers for compile git-svn-id: http://www.coolstreamtech.de/coolstream_public_svn/CROSSENVIROMENT/coolstream@563 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/547abfaef4d60fca3600baf08eb0251ccedfbaa4 Author: [CST] Lucian Date: 2010-05-06 (Thu, 06 May 2010) --- 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 e607fe9d34165896c6bd46a1b24cd5358471539a Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 1 Sep 2010 17:13:20 +0000 Subject: [PATCH 03/40] new header git-svn-id: http://www.coolstreamtech.de/coolstream_public_svn/CROSSENVIROMENT/coolstream@740 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/524ce5ca62edbbd2a9bfd3ac1ee2aa81b74ca4aa Author: [CST] Focus Date: 2010-09-01 (Wed, 01 Sep 2010) --- 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 bddfd23540b473d56f590b8515501f90ae44808f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 15 Jan 2012 15:41:54 +0000 Subject: [PATCH 04/40] 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 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/06d7c697089b5dce07049b91f28d47fc4c547546 Author: Jacek Jendrzej Date: 2012-01-15 (Sun, 15 Jan 2012) Origin message was: ------------------ -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 fd93e76b97b93a059e916f4ea85e2262d0072329 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Tue, 4 Dec 2012 18:55:29 +0400 Subject: [PATCH 05/40] gui/cam_menu.cpp: workaround for possible wrong CI menu item count from libcs Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/108913b65dd6b7d7818570541f158d8b4d850348 Author: [CST] Focus Date: 2012-12-04 (Tue, 04 Dec 2012) --- 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 190dc282b875861bfe3867e763eaf0eede7bf76c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 4 Dec 2012 19:57:02 +0100 Subject: [PATCH 06/40] src/gui/plugins.cpp: fix sort pluins without index Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/882a7b2e4708d29bbb9c2f69056c4fa986220b42 Author: Jacek Jendrzej Date: 2012-12-04 (Tue, 04 Dec 2012) --- 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 31e6947468598eb45f791ca9ea2a8a421ab67a6b Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 4 Dec 2012 19:57:30 +0100 Subject: [PATCH 07/40] update astra Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fbf2c058250975758fc1deec879287a8bde68141 Author: Jacek Jendrzej Date: 2012-12-04 (Tue, 04 Dec 2012) --- 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 f95cdc64af904c079e66c3f0af65663c9bd913e2 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 4 Dec 2012 11:00:27 +0100 Subject: [PATCH 08/40] CHintBoxExt: Fix view of multiple pages - Reduces flicker effect on screen Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/02b26854949f6efcb3f618fe9abf728cc9a7a5d8 Author: Michael Liebmann Date: 2012-12-04 (Tue, 04 Dec 2012) Origin message was: ------------------ * 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 9cab585c9326b4cebc09b25df448594b7f28d8e3 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 4 Dec 2012 21:05:19 +0100 Subject: [PATCH 09/40] Pictureviewer: Remove duplicate locale from help text Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c691c242ff3d576fdde0c844a200b1378d3ac3f2 Author: Michael Liebmann Date: 2012-12-04 (Tue, 04 Dec 2012) Origin message was: ------------------ * 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 1dd1a82845d7a97f2db90dd9256566e7a1972e28 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 4 Dec 2012 18:17:15 +0100 Subject: [PATCH 10/40] Update locale for menu hints (THX Tomworld) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b5e877639e5356fa52338c7bd3b92c566de950ef Author: Michael Liebmann Date: 2012-12-04 (Tue, 04 Dec 2012) Origin message was: ------------------ * 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 876d755e9c6b760c6a87f94df24346597614654f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 6 Dec 2012 23:11:56 +0100 Subject: [PATCH 11/40] src/nhttpd/yhttpd_mods/mod_yparser.cpp: workaround fix for segfault if server.log.loglevel=5 and read timer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2fbe881180aef27b24996c14508538a576642dd4 Author: Jacek Jendrzej Date: 2012-12-06 (Thu, 06 Dec 2012) --- 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 6da9a9daca6aeaa5821c89b974abfe5a9051aafa Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 7 Dec 2012 11:13:51 +0100 Subject: [PATCH 12/40] src/nhttpd: fix segfault if logging on Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fe16513b4ff1cc6fe6b083e51a48f5d568a99fa5 Author: Jacek Jendrzej Date: 2012-12-07 (Fri, 07 Dec 2012) --- 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 8819de8d85e7a354a905e8c799fd90fec66738f0 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 7 Dec 2012 12:01:45 +0100 Subject: [PATCH 13/40] never used Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1d5e7b23b371e6cf5dc95b84d73e302f7d7e37ed Author: Jacek Jendrzej Date: 2012-12-07 (Fri, 07 Dec 2012) --- 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 798febccb6667f580d295b6bbc8c51a3d741aaf1 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 8 Dec 2012 11:15:40 +0100 Subject: [PATCH 14/40] add provider name to infobar , no gui option Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7bebdf91e0ee941820dd1c68d09bed22f1e2efe2 Author: Jacek Jendrzej Date: 2012-12-08 (Sat, 08 Dec 2012) --- 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 0e7e197e3be0f758a28f2d48c7de767d2b572567 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 8 Dec 2012 16:28:53 +0100 Subject: [PATCH 15/40] supplement to 798febccb6667f580d295b6bbc8c51a3d741aaf1, simplification Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/59fa692bd0381c95b9569279ca876eb429d54945 Author: Jacek Jendrzej Date: 2012-12-08 (Sat, 08 Dec 2012) --- 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 dedad4412ec0c09992c28a9d4ed33463709fe7f6 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 8 Dec 2012 17:47:25 +0100 Subject: [PATCH 16/40] yWeb: Timer: dont stop recording after modifying timer - Timer: sets audio-pid correctly - Timer: seconds set to Null Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/dc33e93375cb80e6792f4ba82deee0f639f9caa4 Author: Jacek Jendrzej Date: 2012-12-08 (Sat, 08 Dec 2012) --- .../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 01a52aa8fbbd9e8d1b88ecac9bdb07d7ae89544f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 8 Dec 2012 17:53:01 +0100 Subject: [PATCH 17/40] supplement to dedad4412ec0c09992c28a9d4ed33463709fe7f6 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b3ddc46e14f1aeef127576f04e51cecd460bc9ad Author: Jacek Jendrzej Date: 2012-12-08 (Sat, 08 Dec 2012) --- 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 4ab0b27f3346da23ce56599d22fd180a52d941b3 Mon Sep 17 00:00:00 2001 From: swing99 Date: Mon, 10 Dec 2012 14:35:02 +0100 Subject: [PATCH 18/40] cables.xml: update Kabel Deutschland - Offensive 2012 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0ec6859ea9263621d3d0baaafff38d75fe56fb9f Author: swing99 Date: 2012-12-10 (Mon, 10 Dec 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 cefc77b6edd7e4c879dd609fdf924370767eaebc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 13 Dec 2012 10:49:06 +0100 Subject: [PATCH 19/40] svn_CROSSENVIRONMENT_coolstream: move files to new right place Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/998ae6d81dc77b106e20798576ec66d012480362 Author: vanhofen Date: 2012-12-13 (Thu, 13 Dec 2012) Origin message was: ------------------ - 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 2c760392f477cf48b2ee3cac37d569c50855c4c0 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 13 Dec 2012 14:03:04 +0100 Subject: [PATCH 20/40] src/zapit/src/zapit.cpp: fix segfault if channel==NULL (reloadchannels) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d67b1e9c9323e04868c8ff25a0c927951ff7be63 Author: Jacek Jendrzej Date: 2012-12-13 (Thu, 13 Dec 2012) --- 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 7332aea363dcd46f4003d19f1cbfbd2cb38bb820 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 13 Dec 2012 17:45:43 +0100 Subject: [PATCH 21/40] Fix include path for moved header files Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b1138e16b079c7ca69d20b2f8f1dc08769a92390 Author: Michael Liebmann Date: 2012-12-13 (Thu, 13 Dec 2012) Origin message was: ------------------ * 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 f969678b20d3788ee08608eba880238fd698903d Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 14 Dec 2012 14:34:18 +0100 Subject: [PATCH 22/40] src/nhttpd/yhttpd_core/helper.cpp: dont decode '+' to ' ', fix for channelname with '+' Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/42b69a8a5eb061ea90b25328be8c5ed5efd46782 Author: Jacek Jendrzej Date: 2012-12-14 (Fri, 14 Dec 2012) --- 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 c0ecf75100a45adcc54f2761df3ab147ab486a0d Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 17 Dec 2012 12:46:09 +0400 Subject: [PATCH 23/40] gui/videosettings.cpp: fix video mode switch ask, fix menu redraw after video mode switch Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/636be7fa8493189a135576a71c8c18d6e1701ebc Author: [CST] Focus Date: 2012-12-17 (Mon, 17 Dec 2012) --- 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 506b646c1947ce7cefe0d28a90b083a48f6780df Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 17 Dec 2012 12:58:24 +0100 Subject: [PATCH 24/40] nhttpd: skip doubles decode on channlename, revert f969678b20d3788ee08608eba880238fd698903d Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ed318d97bc7ab06299e9504c7e3249cd8dc0324c Author: Jacek Jendrzej Date: 2012-12-17 (Mon, 17 Dec 2012) --- 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 b64c42012498a1640a545eadd2c90f1fecaf5c42 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 17 Dec 2012 22:01:46 +0100 Subject: [PATCH 25/40] nhttpd: dont doubles decode, revert 506b646c1947ce7cefe0d28a90b083a48f6780df Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f66b2baedce1e9350ad18d402317dcc1847e35e3 Author: Jacek Jendrzej Date: 2012-12-17 (Mon, 17 Dec 2012) --- 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 3abf3109dcbcc8f8085472da9c2295c07f32e827 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 18 Dec 2012 21:58:00 +0100 Subject: [PATCH 26/40] moviebrowser.cpp: accept covers without appended date/time patch by FlatTV Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bce78c2cff3a078a75f78d6e33bc2b80d28f3509 Author: vanhofen Date: 2012-12-18 (Tue, 18 Dec 2012) Origin message was: ------------------ - 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 d7e8f68d567162694cd421f880741aaac6dcf00b Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 19 Dec 2012 16:45:40 +0400 Subject: [PATCH 27/40] gui/miscsettings_menu.cpp: always enable EPG options, which not depend on save epg on/off Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5749f8632326cecdf45b1f19734d59bff700b3d1 Author: [CST] Focus Date: 2012-12-19 (Wed, 19 Dec 2012) --- 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 9638bb154bbe4e83709ae857a5df427f1103b15c Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 20 Dec 2012 20:13:44 +0100 Subject: [PATCH 28/40] neutrino: fix segfault if not found frontend Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0806c47c73fb6660ba0eee2a49ef8a197763d9b9 Author: Jacek Jendrzej Date: 2012-12-20 (Thu, 20 Dec 2012) --- 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 ae67bb55be8010aa4b2f6af812980d69e5e3968a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 20 Dec 2012 21:05:44 +0100 Subject: [PATCH 29/40] nhttpd: fix encode bouquet and audio name Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2d1beb8402158da1421c184147d53b4a30aa0ac3 Author: Jacek Jendrzej Date: 2012-12-20 (Thu, 20 Dec 2012) --- 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 602bb28d7508dff7c69b9d90624a56126d583f71 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 22 Dec 2012 16:42:00 +0100 Subject: [PATCH 30/40] src/nhttpd/yhttpd_core/yrequest.cpp: fix automount string decode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/289e927e049da0219d0d0069d1fb73ab70d7384a Author: Jacek Jendrzej Date: 2012-12-22 (Sat, 22 Dec 2012) --- 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 9d03054e55cac2b5397bfc7637decaa9202acac0 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 22 Dec 2012 17:12:22 +0100 Subject: [PATCH 31/40] src/nhttpd/web/scripts/Y_Tools.sh: show alle prozesse Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8b35ae80607019ca067e2a1fc9efd2c2c5744d95 Author: Jacek Jendrzej Date: 2012-12-22 (Sat, 22 Dec 2012) --- 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 b4050ebf72871117e0618af33f004b90a358850f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 22 Dec 2012 17:19:43 +0100 Subject: [PATCH 32/40] src/nhttpd/yhttpd_core/yrequest.cpp: maybe needed, supplement to 602bb28d7508dff7c69b9d90624a56126d583f71 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b58cbd41359fa7b3d506b8f7f8ee1d7a7222cd62 Author: Jacek Jendrzej Date: 2012-12-22 (Sat, 22 Dec 2012) --- 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 610ce926f52b28be3d97292a2e7d72aac001cc11 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 23 Dec 2012 19:12:41 +0100 Subject: [PATCH 33/40] src/nhttpd/tuxboxapi/coolstream/controlapi.cpp: add current transponder pchannels list , use: /control/currenttpchannels Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4965619a79474fcac028effd4dc6e23064fab9fa Author: Jacek Jendrzej Date: 2012-12-23 (Sun, 23 Dec 2012) --- .../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 181781a12a75966de8f4ea9e29262fab24e575af Mon Sep 17 00:00:00 2001 From: Gaucho316 Date: Sat, 29 Dec 2012 17:53:05 +0100 Subject: [PATCH 34/40] nhttpd: don't decode URL parameters multiple times Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1b4ad51d0a49e96f1af79498afdb509a3c70b784 Author: Gaucho316 Date: 2012-12-29 (Sat, 29 Dec 2012) --- .../tuxboxapi/coolstream/controlapi.cpp | 2 +- src/nhttpd/yhttpd_core/helper.cpp | 2 +- src/nhttpd/yhttpd_core/yrequest.cpp | 19 ++++++++++++------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index fc902669d..f212fab5f 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -1569,7 +1569,7 @@ void CControlAPI::StartPluginCGI(CyhookHandler *hh) if (hh->ParamList["name"] != "") { pluginname = hh->ParamList["name"]; - pluginname=decodeString(pluginname); + //pluginname=decodeString(pluginname); NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_START_PLUGIN, CEventServer::INITID_HTTPD, (void *) pluginname.c_str(), diff --git a/src/nhttpd/yhttpd_core/helper.cpp b/src/nhttpd/yhttpd_core/helper.cpp index e2449fbbd..d8a6630aa 100644 --- a/src/nhttpd/yhttpd_core/helper.cpp +++ b/src/nhttpd/yhttpd_core/helper.cpp @@ -214,7 +214,7 @@ std::string decodeString(std::string encodedString) { return result; } //----------------------------------------------------------------------------- -// Encode URLEncoded std::string +// HTMLEncode std::string //----------------------------------------------------------------------------- std::string encodeString(std::string decodedString) { unsigned int len = sizeof(char) * decodedString.length() * 5 + 1; diff --git a/src/nhttpd/yhttpd_core/yrequest.cpp b/src/nhttpd/yhttpd_core/yrequest.cpp index f684f9ddd..679b5c1ce 100644 --- a/src/nhttpd/yhttpd_core/yrequest.cpp +++ b/src/nhttpd/yhttpd_core/yrequest.cpp @@ -160,6 +160,7 @@ bool CWebserverRequest::ParseParams(std::string param_string) { if (!ySplitStringExact(param_string, "&", param, param_string)) ende = true; if (ySplitStringExact(param, "=", name, value)) { + name = decodeString(name); value = trim(decodeString(value)); if (ParameterList[name].empty()) ParameterList[name] = value; @@ -168,11 +169,10 @@ bool CWebserverRequest::ParseParams(std::string param_string) { ParameterList[name] += value; } } + else + name = trim(decodeString(name)); 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; @@ -212,19 +212,24 @@ bool CWebserverRequest::ParseHeader(std::string header) { // query data is splitted and stored in ParameterList //----------------------------------------------------------------------------- void CWebserverRequest::analyzeURL(std::string url) { + std::string fullurl = ""; if(!ParameterList.empty()) ParameterList.clear(); + // URI decode - url = trim(url, "\r\n"); // non-HTTP-Standard: allow \r or \n in URL. Delete it. - UrlData["fullurl"] = url; + fullurl = decodeString(url); + fullurl = trim(fullurl, "\r\n"); // non-HTTP-Standard: allow \r or \n in URL. Delete it. + UrlData["fullurl"] = fullurl; + // split Params if (ySplitString(url, "?", UrlData["url"], UrlData["paramstring"])){ // split pure URL and all Params + UrlData["url"] = decodeString(UrlData["url"]); ParseParams( UrlData["paramstring"]); // split params to ParameterList }else{ // No Params - url = decodeString(url); - UrlData["url"] = url; + UrlData["url"] = fullurl; } + if (!ySplitStringLast(UrlData["url"], "/", UrlData["path"], UrlData["filename"])) { UrlData["path"] = "/"; // Set "/" if not contained From 0e86382a4e91468fe986ed615467bd6af6a1994f Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 1 Jan 2013 08:23:52 +0100 Subject: [PATCH 35/40] Software Update with apply the settings (Part12) - Make backup file from downloaded image - Restore original file, if an error occurs Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/48fff4f4dbbe92fec564a39dc95e2338fcd00399 Author: Michael Liebmann Date: 2013-01-01 (Tue, 01 Jan 2013) Origin message was: ------------------ * Software Update with apply the settings (Part12) - Make backup file from downloaded image - Restore original file, if an error occurs --- src/gui/ext_update.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gui/ext_update.cpp b/src/gui/ext_update.cpp index 7e4d430e4..c883a7060 100644 --- a/src/gui/ext_update.cpp +++ b/src/gui/ext_update.cpp @@ -130,6 +130,7 @@ bool CExtUpdate::ErrorReset(bool modus, const std::string & msg1, const std::str bool CExtUpdate::applySettings(const std::string & filename, int mode) { +#define ORGFILE_EXT ".org" if(!FileHelpers) FileHelpers = new CFileHelpers(); @@ -139,11 +140,19 @@ bool CExtUpdate::applySettings(const std::string & filename, int mode) imgFilename = FILESYSTEM_ENCODING_TO_UTF8_STRING(filename); DBG_TIMER_START() + + // make backup file + FileHelpers->copyFile(imgFilename.c_str(), (imgFilename + ORGFILE_EXT).c_str(), 0644); + bool ret = applySettings(); DBG_TIMER_STOP("Image editing") if (!ret) { if (mtdRamError != "") DisplayErrorMessage(mtdRamError.c_str()); + + // error, restore original file + unlink(imgFilename.c_str()); + rename((imgFilename + ORGFILE_EXT).c_str(), imgFilename.c_str()); } else { if (mode == MODE_EXPERT) { From 336cc75a5a8138b29a228817a08e2109615e1e7f Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Wed, 19 Dec 2012 01:19:16 +0100 Subject: [PATCH 36/40] Software Update with apply the settings (Part13) - Delete files from image, before apply settings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/158a8ba4ceaca6587f3425d10d0a26ba188c421e Author: Michael Liebmann Date: 2012-12-19 (Wed, 19 Dec 2012) Origin message was: ------------------ * Software Update with apply the settings (Part13) - Delete files from image, before apply settings --- data/settingsupdate.conf | 18 +++++++++------ src/gui/ext_update.cpp | 47 ++++++++++++++++++++-------------------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/data/settingsupdate.conf b/data/settingsupdate.conf index 45eafcac9..5234dc041 100644 --- a/data/settingsupdate.conf +++ b/data/settingsupdate.conf @@ -21,7 +21,17 @@ ## Die Verzeichnisse "/", "/dev", "/proc", "/sys", "/mnt", "/tmp" können nicht gesichert werden!! #------------------------------------------------------------------------------------------------ +#--------------------------------------------------------------------------- +## vor der Sicherung aus dem neuen Image zu löschende Dateien/Verzeichnisse, +## gekennzeichnet durch ein vorangestelltes ~ +# z.B. +# ~/share/tuxbox/neutrino/themes/Classic.theme +#--------------------------------------------------------------------------- + + +#------------- ## Sicherungen +#------------- /etc/hostname /etc/hosts /etc/network @@ -30,6 +40,7 @@ /var/etc /var/tuxbox/config + #---------------------------------------------------------------------------------------- ## von der Sicherung auszuschließende Dateien, gekennzeichnet durch ein vorangestelltes - #---------------------------------------------------------------------------------------- @@ -41,10 +52,3 @@ -/var/tuxbox/config/satellites.xml -/var/tuxbox/config/settingsupdate.conf -/var/tuxbox/config/tobackup.conf - -#---------------------------------------------------------------------------- -## nach der Sicherung aus dem neuen Image zu löschende Dateien/Verzeichnisse, -## gekennzeichnet durch ein vorangestelltes ~ -# z.B. -# ~/share/tuxbox/neutrino/themes/Classic.theme -#---------------------------------------------------------------------------- diff --git a/src/gui/ext_update.cpp b/src/gui/ext_update.cpp index c883a7060..c9094941d 100644 --- a/src/gui/ext_update.cpp +++ b/src/gui/ext_update.cpp @@ -506,6 +506,7 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) { char buf[PATH_MAX]; static struct stat FileInfo; + vector::iterator it; f1 = fopen(backupList.c_str(), "r"); if (f1 == NULL) { @@ -582,8 +583,30 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) } fclose(f1); + // read DeleteList + for(it = deleteList.begin(); it != deleteList.end(); ++it) { + line = *it; + if (lstat(line.c_str(), &FileInfo) != -1) { + if ((line.find("*") != std::string::npos) || (line.find("?") != std::string::npos)) { + // Wildcards + WRITE_UPDATE_LOG("delete file list: %s\n", line.c_str()); + deleteFileList(line.c_str()); + } + else if (S_ISREG(FileInfo.st_mode)) { + // File + WRITE_UPDATE_LOG("delete file: %s\n", line.c_str()); + unlink(line.c_str()); + } + else if (S_ISDIR(FileInfo.st_mode)){ + // Directory + WRITE_UPDATE_LOG("delete directory: %s\n", line.c_str()); + FileHelpers->removeDir(line.c_str()); + } + } + } + sync(); + // read copyList - vector::iterator it; for(it = copyList.begin(); it != copyList.end(); ++it) { line = *it; line = trim(line); @@ -628,28 +651,6 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) } } - - // read DeleteList - for(it = deleteList.begin(); it != deleteList.end(); ++it) { - line = *it; - if (lstat(line.c_str(), &FileInfo) != -1) { - if ((line.find("*") != std::string::npos) || (line.find("?") != std::string::npos)) { - // Wildcards - WRITE_UPDATE_LOG("delete file list: %s\n", line.c_str()); - deleteFileList(line.c_str()); - } - else if (S_ISREG(FileInfo.st_mode)) { - // File - WRITE_UPDATE_LOG("delete file: %s\n", line.c_str()); - unlink(line.c_str()); - } - else if (S_ISDIR(FileInfo.st_mode)){ - // Directory - WRITE_UPDATE_LOG("delete directory: %s\n", line.c_str()); - FileHelpers->removeDir(line.c_str()); - } - } - } sync(); return true; } From 8f3a597f7bad776da08539a57025927f6927df0f Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 1 Jan 2013 10:43:28 +0100 Subject: [PATCH 37/40] system/helpers.cpp: Adding value 'bsize' as a possible return value Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6e1a2dc9cdc625e2e8c3e8fea311cc1a2a81975e Author: Michael Liebmann Date: 2013-01-01 (Tue, 01 Jan 2013) Origin message was: ------------------ * system/helpers.cpp: Adding value 'bsize' as a possible return value --- src/system/helpers.cpp | 4 +++- src/system/helpers.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 23708b752..700f374b8 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -193,7 +193,7 @@ int check_dir(const char * dir) return ret; } -bool get_fs_usage(const char * dir, long &btotal, long &bused) +bool get_fs_usage(const char * dir, long &btotal, long &bused, long *bsize/*=NULL*/) { btotal = bused = 0; struct statfs s; @@ -201,6 +201,8 @@ bool get_fs_usage(const char * dir, long &btotal, long &bused) if (::statfs(dir, &s) == 0 && s.f_blocks) { btotal = s.f_blocks; bused = s.f_blocks - s.f_bfree; + if (bsize != NULL) + *bsize = s.f_bsize; //printf("fs (%s): total %ld used %ld\n", dir, btotal, bused); return true; } diff --git a/src/system/helpers.h b/src/system/helpers.h index 2d9731494..59d04a8bb 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -31,7 +31,7 @@ int safe_mkdir(char * path); bool file_exists(const char *filename); void wakeup_hdd(const char *hdd_dir); int check_dir(const char * dir); -bool get_fs_usage(const char * dir, long &total, long &used); +bool get_fs_usage(const char * dir, long &total, long &used, long *bsize=NULL); bool get_mem_usage(unsigned long &total, unsigned long &free); std::string trim(std::string &str, const std::string &trimChars = " \n\r\t"); From 6edc1f765546fb318beb2e8a780be6ed93d8639d Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 1 Jan 2013 14:36:08 +0100 Subject: [PATCH 38/40] Software Update with apply the settings (Part14) - Add warning/error if not enough space - THX Striper for translation into English of the locale Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/099d0181b64159363c7eef905628609af62d2419 Author: Michael Liebmann Date: 2013-01-01 (Tue, 01 Jan 2013) Origin message was: ------------------ * Software Update with apply the settings (Part14) - Add warning/error if not enough space - THX Striper for translation into English of the locale --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/ext_update.cpp | 42 +++++++++++++++++++++++++++++++++++--- src/gui/ext_update.h | 6 +++++- src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ 6 files changed, 52 insertions(+), 4 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 77aaddb59..1f2f4f965 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -487,9 +487,11 @@ flashupdate.squashfs.noversion Bei Updates werden Versionsüberprüfungen derzei flashupdate.titlereadflash Flash auslesen flashupdate.titlewriteflash Flash schreiben flashupdate.update_with_settings_del_skipped Ordner [%s] kann nicht gelöscht werden. Eintrag wird übersprungen. +flashupdate.update_with_settings_error Error Flashspeicher!\n \nIm neuen Image sind nur noch %ld KB (von %ld KB) frei,\ndas ist zu wenig, um einen sicheren Betrieb zu gewährleisten.\n \nDer Vorgang wird abgebrochen! flashupdate.update_with_settings_processed Image wird bearbeitet... flashupdate.update_with_settings_skipped Ordner [%s] kann nicht gesichert werden. Eintrag wird übersprungen. flashupdate.update_with_settings_successfully Settingsübernahme erfolgreich.\nDas Image kann jetzt geflasht werden. +flashupdate.update_with_settings_warning Warnung Flashspeicher!\n \nIm neuen Image sind nur noch %ld KB (von %ld KB) frei,\ndas ist möglicherweise zu wenig, um einen sicheren Betrieb zu gewährleisten.\n \nSoll der Vorgang trotzdem fortgesetzt werden? flashupdate.updatemode Updatemodus flashupdate.updatemode_internet Internet flashupdate.updatemode_manual von lokalem Update-Verzeichnis diff --git a/data/locale/english.locale b/data/locale/english.locale index 472b88de4..222ab4da6 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -487,9 +487,11 @@ flashupdate.squashfs.noversion SquashFS version checks are currently only suppor flashupdate.titlereadflash Reading Flash flashupdate.titlewriteflash Writing Flash flashupdate.update_with_settings_del_skipped Folder [%s] can not be deleted. Entry is skipped. +flashupdate.update_with_settings_error Flash Error!\n \nNew Image only has %ld KB (out of %ld KB) left. Not\nenough space to complete this operation.\n \nCanceling operation! flashupdate.update_with_settings_processed Image is being processed... flashupdate.update_with_settings_skipped Folder [%s] can not be saved. Entry is skipped. flashupdate.update_with_settings_successfully Setting takeover successfully.\nThe image can now be flashed. +flashupdate.update_with_settings_warning Flash Warning!\n \nNew Image only has %ld KB (out of %ld KB) left. Probably not\nenough space to complete this operation...\n \nDo you really want to proceed? flashupdate.updatemode Updatemode flashupdate.updatemode_internet internet flashupdate.updatemode_manual from local update directory diff --git a/src/gui/ext_update.cpp b/src/gui/ext_update.cpp index c9094941d..4c4ffe169 100644 --- a/src/gui/ext_update.cpp +++ b/src/gui/ext_update.cpp @@ -5,7 +5,7 @@ and some other guys Homepage: http://dbox.cyberphoria.org/ - Copyright (C) 2012 M. Liebmann (micha-bbg) + Copyright (C) 2012-2013 M. Liebmann (micha-bbg) License: GPL @@ -73,6 +73,10 @@ CExtUpdate::CExtUpdate() fLogfile = "/tmp/update.log"; mountPkt = "/tmp/image_mount"; FileHelpers = NULL; + flashErrorFlag = false; + total = bsize = used = 0; + free1 = free2 = free3 = 0; + copyList.clear(); blackList.clear(); deleteList.clear(); @@ -147,7 +151,7 @@ bool CExtUpdate::applySettings(const std::string & filename, int mode) bool ret = applySettings(); DBG_TIMER_STOP("Image editing") if (!ret) { - if (mtdRamError != "") + if ((mtdRamError != "") && (!flashErrorFlag)) DisplayErrorMessage(mtdRamError.c_str()); // error, restore original file @@ -309,8 +313,14 @@ bool CExtUpdate::applySettings() if (res) return ErrorReset(RESET_UNLOAD, "mount error"); - if (!readBackupList(mountPkt)) + if (get_fs_usage(mountPkt.c_str(), total, used, &bsize)) + free1 = (total * bsize) / 1024 - (used * bsize) / 1024; + + if (!readBackupList(mountPkt)) { + if (flashErrorFlag) + return false; return ErrorReset(0, "error readBackupList"); + } res = umount(mountPkt.c_str()); if (res) @@ -606,6 +616,9 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) } sync(); + if (get_fs_usage(mountPkt.c_str(), total, used, &bsize)) + free2 = (total * bsize) / 1024 - (used * bsize) / 1024; + // read copyList for(it = copyList.begin(); it != copyList.end(); ++it) { line = *it; @@ -652,6 +665,29 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) } } sync(); + + if (get_fs_usage(mountPkt.c_str(), total, used, &bsize)) { + long flashWarning = 1000; // 1MB + long flashError = 600; // 600KB + char buf1[1024]; + total = (total * bsize) / 1024; + free3 = total - (used * bsize) / 1024; + printf("##### [%s] %ld KB free org, %ld KB free after delete, %ld KB free now\n", __FUNCTION__, free1, free2, free3); + memset(buf1, '\0', sizeof(buf1)); + if (free3 <= flashError) { + snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_ERROR), free3, total); + ShowMsgUTF(LOCALE_MESSAGEBOX_ERROR, buf1, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_ERROR); + flashErrorFlag = true; + return false; + } + else if (free3 <= flashWarning) { + snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_WARNING), free3, total); + if (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buf1, CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_INFO) != CMessageBox::mbrYes) { + flashErrorFlag = true; + return false; + } + } + } return true; } diff --git a/src/gui/ext_update.h b/src/gui/ext_update.h index e0291641b..2999c9fa2 100644 --- a/src/gui/ext_update.h +++ b/src/gui/ext_update.h @@ -5,7 +5,7 @@ and some other guys Homepage: http://dbox.cyberphoria.org/ - Copyright (C) 2012 M. Liebmann (micha-bbg) + Copyright (C) 2012-2013 M. Liebmann (micha-bbg) License: GPL @@ -56,6 +56,10 @@ class CExtUpdate CFileHelpers* FileHelpers; std::vector copyList, blackList, deleteList; + bool flashErrorFlag; + long total, bsize, used; + long free1, free2, free3; + bool applySettings(void); bool readBackupList(const std::string & dstPath); bool copyFileList(const std::string & fileList, const std::string & dstPath); diff --git a/src/system/locals.h b/src/system/locals.h index 9d670a45b..19f72a907 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -514,9 +514,11 @@ typedef enum LOCALE_FLASHUPDATE_TITLEREADFLASH, LOCALE_FLASHUPDATE_TITLEWRITEFLASH, LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_DEL_SKIPPED, + LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_ERROR, LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_PROCESSED, LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SKIPPED, LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SUCCESSFULLY, + LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_WARNING, LOCALE_FLASHUPDATE_UPDATEMODE, LOCALE_FLASHUPDATE_UPDATEMODE_INTERNET, LOCALE_FLASHUPDATE_UPDATEMODE_MANUAL, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index e00f7b242..bebeabfbb 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -514,9 +514,11 @@ const char * locale_real_names[] = "flashupdate.titlereadflash", "flashupdate.titlewriteflash", "flashupdate.update_with_settings_del_skipped", + "flashupdate.update_with_settings_error", "flashupdate.update_with_settings_processed", "flashupdate.update_with_settings_skipped", "flashupdate.update_with_settings_successfully", + "flashupdate.update_with_settings_warning", "flashupdate.updatemode", "flashupdate.updatemode_internet", "flashupdate.updatemode_manual", From d7a2395633b4b26b3b85d8c8259061c932a9dd40 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 2 Jan 2013 15:55:19 +0100 Subject: [PATCH 39/40] src/driver/framebuffer.cpp: fix fb for Threads use Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3bbaddec396faf89c4d5e7a9dc149785593df966 Author: Jacek Jendrzej Date: 2013-01-02 (Wed, 02 Jan 2013) --- src/driver/framebuffer.cpp | 9 ++++++++- src/driver/framebuffer.h | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index b727ef51e..26694221a 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -632,7 +632,9 @@ void CFrameBuffer::paintBoxRel(const int x, const int y, const int dx, const int int corner_bl = (type & CORNER_BOTTOM_LEFT) ? 1 : 0; int corner_br = (type & CORNER_BOTTOM_RIGHT) ? 1 : 0; -#ifndef USE_NEVIS_GXA +#ifdef USE_NEVIS_GXA + OpenThreads::ScopedLock m_lock(mutex); +#else int swidth = stride / sizeof(fb_pixel_t); fb_pixel_t *fbp = getFrameBufferPointer() + (swidth * y); #endif @@ -763,6 +765,7 @@ void CFrameBuffer::paintVLine(int x, int ya, int yb, const fb_pixel_t col) return; #ifdef USE_NEVIS_GXA + OpenThreads::ScopedLock m_lock(mutex); /* draw a single vertical line from point x/ya to x/yb */ unsigned int cmd = GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(2) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(2) | GXA_CMD_NOT_ALPHA; @@ -788,6 +791,7 @@ void CFrameBuffer::paintVLineRel(int x, int y, int dy, const fb_pixel_t col) return; #ifdef USE_NEVIS_GXA + OpenThreads::ScopedLock m_lock(mutex); /* draw a single vertical line from point x/y with hight dx */ unsigned int cmd = GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(2) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(2) | GXA_CMD_NOT_ALPHA; @@ -811,6 +815,7 @@ void CFrameBuffer::paintHLine(int xa, int xb, int y, const fb_pixel_t col) return; #ifdef USE_NEVIS_GXA + OpenThreads::ScopedLock m_lock(mutex); /* draw a single horizontal line from point xa/y to xb/y */ unsigned int cmd = GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(2) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(2) | GXA_CMD_NOT_ALPHA; @@ -835,6 +840,7 @@ void CFrameBuffer::paintHLineRel(int x, int dx, int y, const fb_pixel_t col) return; #ifdef USE_NEVIS_GXA + OpenThreads::ScopedLock m_lock(mutex); /* draw a single horizontal line from point x/y with width dx */ unsigned int cmd = GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(2) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(2) | GXA_CMD_NOT_ALPHA; @@ -1698,6 +1704,7 @@ void CFrameBuffer::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32 //printf("CFrameBuffer::blit2FB: data %x Kva %x\n", (int) fbbuff, (int) uKva); if(uKva != NULL) { + OpenThreads::ScopedLock m_lock(mutex); cmd = GXA_CMD_BLT | GXA_CMD_NOT_TEXT | GXA_SRC_BMP_SEL(1) | GXA_DST_BMP_SEL(2) | GXA_PARAM_COUNT(3); _write_gxa(gxa_base, GXA_BMP1_TYPE_REG, (3 << 16) | width); diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index e971dabc1..9028b9d53 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -32,6 +32,8 @@ #include #include +#include +#include #define fb_pixel_t uint32_t @@ -57,6 +59,7 @@ class CFrameBuffer private: CFrameBuffer(); + OpenThreads::Mutex mutex; struct rgbData { From beba4d412d967847247527885017b10a33028d59 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 8 Jan 2013 20:35:53 +0100 Subject: [PATCH 40/40] neutrino: -add unicabel menu option Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7d550ed88efe264773a0fd29034de5bb158b6a04 Author: Jacek Jendrzej Date: 2013-01-08 (Tue, 08 Jan 2013) --- data/locale/deutsch.locale | 5 + data/locale/english.locale | 5 + src/gui/scan_setup.cpp | 152 +++++++++++++++----- src/gui/scan_setup.h | 2 + src/system/locals.h | 5 + src/system/locals_intern.h | 5 + src/zapit/include/zapit/client/zapittypes.h | 3 +- src/zapit/include/zapit/frontend_c.h | 1 - src/zapit/include/zapit/frontend_types.h | 1 + src/zapit/include/zapit/zapit.h | 3 +- src/zapit/src/femanager.cpp | 6 +- src/zapit/src/frontend.cpp | 44 +++--- src/zapit/src/zapit.cpp | 5 - 13 files changed, 175 insertions(+), 62 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 1f2f4f965..13c0cb219 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1568,6 +1568,8 @@ satsetup.satellite Satellit satsetup.select_sat Auswahl Satellit satsetup.smatvremote SMATV Remote Tuning satsetup.uncomm_input Uncommitted +satsetup.uni_settings Unicable Einstellungen +satsetup.unicable Unicable satsetup.usals_repeat USALS wiederholen satsetup.use_bat Benutze BAT satsetup.use_fta_flag nur FTA Kanäle @@ -1758,6 +1760,9 @@ timing.infobar_movieplayer Infobar (Filmwiedergabe) timing.infobar_radio Infobar (Radiobetrieb) timing.menu Menü timing.numericzap Umschalten mit Zifferntasten +unicable.lnb Unicable Eingang +unicable.qrg Unicable Frequenz +unicable.scr Unicable SCR upnpbrowser.head UPnP Browser upnpbrowser.noservers Kein UPnP-Server gefunden upnpbrowser.rescan Neue Suche diff --git a/data/locale/english.locale b/data/locale/english.locale index 222ab4da6..f49f35c98 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1568,6 +1568,8 @@ satsetup.satellite Satellite satsetup.select_sat Select satellites satsetup.smatvremote SMATV Remote Tuning satsetup.uncomm_input Uncommited input +satsetup.uni_settings Unicable Settings +satsetup.unicable Unicable satsetup.usals_repeat USALS command repeat satsetup.use_bat Use BAT satsetup.use_fta_flag just free Channels @@ -1758,6 +1760,9 @@ timing.infobar_movieplayer Infobar (movie mode) timing.infobar_radio Infobar (radio mode) timing.menu Menu timing.numericzap Numeric Zap +unicable.lnb Unicable Input +unicable.qrg Unicable Frequency +unicable.scr Unicable SCR upnpbrowser.head UPnP Browser upnpbrowser.noservers No UPnP servers found upnpbrowser.rescan Scan again diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index fbf007e41..b335afb79 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -96,7 +96,8 @@ const CMenuOptionChooser::keyval SATSETUP_DISEQC_OPTIONS[SATSETUP_DISEQC_OPTION_ { DISEQC_1_1, LOCALE_SATSETUP_DISEQC11 }, /*{ DISEQC_1_2, LOCALE_SATSETUP_DISEQC12 },*/ { DISEQC_ADVANCED, LOCALE_SATSETUP_DISEQC_ADVANCED }, - { SMATV_REMOTE_TUNING, LOCALE_SATSETUP_SMATVREMOTE } + { DISEQC_UNICABLE, LOCALE_SATSETUP_UNICABLE } +// { SMATV_REMOTE_TUNING, LOCALE_SATSETUP_SMATVREMOTE } }; #define SATSETUP_SCANTP_FEC_COUNT 21 @@ -268,6 +269,10 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey) { return showScanMenuLnbSetup(); } + else if(actionKey=="unisetup") + { + return showUnicableSetup(); + } else if(actionKey=="satfind") { return showScanMenuSatFind(); @@ -481,7 +486,6 @@ void CScanSetup::addScanMenuFrontendSetup(CMenuWidget * setupMenu) setupMenu->addIntroItems(); int count = CFEManager::getInstance()->getFrontendCount(); - CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_SATSETUP_FE_MODE, (int *)&femode, SATSETUP_FRONTEND_MODE, SATSETUP_FRONTEND_MODE_COUNT, allow_start && (count > 1), this, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED, true); mc->setHint("", LOCALE_MENU_HINT_SCAN_FEMODE); setupMenu->addItem(mc); @@ -491,13 +495,14 @@ void CScanSetup::addScanMenuFrontendSetup(CMenuWidget * setupMenu) for(int i = 0; i < count; i++) { CFrontend * fe = CFEManager::getInstance()->getFE(i); + frontend_config_t & fe_config = fe->getConfig(); char tmp[32]; snprintf(tmp, sizeof(tmp), "config_frontend%d", i); char name[255]; snprintf(name, sizeof(name), "%s %d: %s", g_Locale->getText(LOCALE_SATSETUP_FE_SETUP), i+1, fe->getInfo()->name); - mf = new CMenuForwarderNonLocalized(name, ((i == 0) || (femode == CFEManager::FE_MODE_ALONE)), NULL, this, tmp, + mf = new CMenuForwarderNonLocalized(name, ((i == 0) || (femode == CFEManager::FE_MODE_ALONE) || (fe_config.diseqcType == DISEQC_UNICABLE && femode == CFEManager::FE_MODE_TWIN)), NULL, this, tmp, (i == 0) ? CRCInput::RC_green : CRCInput::RC_yellow, (i == 0) ? NEUTRINO_ICON_BUTTON_GREEN : NEUTRINO_ICON_BUTTON_YELLOW); mf->setHint("", LOCALE_MENU_HINT_SCAN_SETUP_FE); setupMenu->addItem(mf); @@ -550,12 +555,14 @@ int CScanSetup::showFrontendSetup(int number) CMenuWidget * setupMenu = new CMenuWidget(name, NEUTRINO_ICON_SETTINGS, width); setupMenu->setSelected(feselected); setupMenu->addIntroItems(); - - CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_SATSETUP_DISEQC, (int *)&dmode, SATSETUP_DISEQC_OPTIONS, SATSETUP_DISEQC_OPTION_COUNT, allow_start, this, CRCInput::convertDigitToKey(shortcut++), "", true); + + bool option_onoff = (number > 0 && fe_config.diseqcType == DISEQC_UNICABLE && femode == CFEManager::FE_MODE_TWIN) ? false : true; + + CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_SATSETUP_DISEQC, (int *)&dmode, SATSETUP_DISEQC_OPTIONS, SATSETUP_DISEQC_OPTION_COUNT, allow_start && option_onoff, this, CRCInput::convertDigitToKey(shortcut++), "", true); mc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQCTYPE); setupMenu->addItem(mc); - ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&fe_config.diseqcRepeats, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED), 0, 2, NULL); + ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&fe_config.diseqcRepeats, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED) && (dmode != DISEQC_UNICABLE), 0, 2, NULL); ojDiseqcRepeats->setHint("", LOCALE_MENU_HINT_SCAN_DISEQCREPEAT); setupMenu->addItem(ojDiseqcRepeats); @@ -570,29 +577,32 @@ int CScanSetup::showFrontendSetup(int number) mc->setHint("", LOCALE_MENU_HINT_SCAN_SATENABLE); satToSelect.addItem(mc); } - CMenuForwarder * mf = new CMenuForwarder(LOCALE_SATSETUP_SELECT_SAT, true, NULL, &satToSelect, "", CRCInput::convertDigitToKey(shortcut++)); + CMenuForwarder * mf = new CMenuForwarder(LOCALE_SATSETUP_SELECT_SAT, option_onoff, NULL, &satToSelect, "", CRCInput::convertDigitToKey(shortcut++)); mf->setHint("", LOCALE_MENU_HINT_SCAN_SATADD); setupMenu->addItem(mf); //FIXME why fsatSetup not local variable ? - fsatSetup = new CMenuForwarder(LOCALE_SATSETUP_SAT_SETUP, true, NULL, this, "satsetup", CRCInput::convertDigitToKey(shortcut++)); + fsatSetup = new CMenuForwarder(LOCALE_SATSETUP_SAT_SETUP, option_onoff, NULL, this, "satsetup", CRCInput::convertDigitToKey(shortcut++)); fsatSetup->setHint("", LOCALE_MENU_HINT_SCAN_SATSETUP); setupMenu->addItem(fsatSetup); + uniSetup = new CMenuForwarder(LOCALE_SATSETUP_UNI_SETTINGS, (dmode == DISEQC_UNICABLE), NULL, this, "unisetup", CRCInput::convertDigitToKey(shortcut++)); + setupMenu->addItem(uniSetup); + setupMenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SATSETUP_EXTENDED_MOTOR)); - CMenuOptionNumberChooser * nc = new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&fe_config.motorRotationSpeed, true, 0, 64, NULL); + CMenuOptionNumberChooser * nc = new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&fe_config.motorRotationSpeed, option_onoff, 0, 64, NULL); nc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_SPEED); setupMenu->addItem(nc); - mc = new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_HVOLTAGE, (int *)&fe_config.highVoltage, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc = new CMenuOptionChooser(LOCALE_EXTRA_ZAPIT_HVOLTAGE, (int *)&fe_config.highVoltage, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, option_onoff); mc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_18V); setupMenu->addItem(mc); - mc = new CMenuOptionChooser(LOCALE_SATSETUP_USE_USALS, &all_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); + mc = new CMenuOptionChooser(LOCALE_SATSETUP_USE_USALS, &all_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, option_onoff, this); mc->setHint("", LOCALE_MENU_HINT_SCAN_USALSALL); setupMenu->addItem(mc); - mf = new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, true, NULL, this, "satfind", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); + mf = new CMenuForwarder(LOCALE_MOTORCONTROL_HEAD, option_onoff, NULL, this, "satfind", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); mf->setHint("", LOCALE_MENU_HINT_SCAN_SATFIND); setupMenu->addItem(mf); @@ -606,6 +616,35 @@ int CScanSetup::showFrontendSetup(int number) return res; } +int CScanSetup::showUnicableSetup() +{ + printf("[neutrino] CScanSetup call %s fe %d\n", __func__, fenumber); + + int res = menu_return::RETURN_REPAINT; + CFrontend *fe = CFEManager::getInstance()->getFE(fenumber); + frontend_config_t &fe_config = fe->getConfig(); + int unicable_scr = fe_config.uni_scr; + int unicable_qrg = fe_config.uni_qrg; + + CMenuOptionNumberChooser *uniscr = new CMenuOptionNumberChooser(LOCALE_UNICABLE_SCR, &unicable_scr, true, 0, 7); + CIntInput *uniqrg = new CIntInput(LOCALE_UNICABLE_QRG, unicable_qrg, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); + + CMenuWidget *uni_setup = new CMenuWidget(LOCALE_SATSETUP_UNI_SETTINGS, NEUTRINO_ICON_SETTINGS, width); + uni_setup->addIntroItems(); + + uni_setup->addItem(uniscr); + CMenuForwarder *mf = new CMenuForwarder(LOCALE_UNICABLE_QRG, true, uniqrg->getValue(), uniqrg); + uni_setup->addItem(mf); + res = uni_setup->exec(NULL, ""); + delete uni_setup; + if (res) { + fe_config.uni_scr = unicable_scr; + fe_config.uni_qrg = unicable_qrg; + printf("%s: scr: %d qrg: %d\n", __func__, unicable_scr, unicable_qrg); + } + return res; +} + int CScanSetup::showScanMenuLnbSetup() { printf("[neutrino] CScanSetup call %s fe %d\n", __FUNCTION__, fenumber); @@ -783,18 +822,31 @@ int CScanSetup::showScanMenuSatFind() void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satconfig) { temp_sat->addIntroItems(); + CMenuOptionNumberChooser *diseqc; + CMenuOptionNumberChooser *comm; + CMenuOptionNumberChooser *uncomm; + CMenuOptionNumberChooser *unilnb; + CMenuOptionNumberChooser *motor; + CMenuOptionChooser *usals; + CMenuForwarder *mf; + bool unicable = (dmode == DISEQC_UNICABLE); - CMenuOptionNumberChooser *diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); - diseqc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQC); - CMenuOptionNumberChooser *comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); - comm->setHint("", LOCALE_MENU_HINT_SCAN_COMMITED); - CMenuOptionNumberChooser *uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &satconfig.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); - uncomm->setHint("", LOCALE_MENU_HINT_SCAN_UNCOMMITED); - CMenuOptionNumberChooser *motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF); - motor->setHint("", LOCALE_MENU_HINT_SCAN_MOTORPOS); - CMenuOptionChooser *usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &satconfig.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true /*dmode == DISEQC_ADVANCED*/); - usals->setHint("", LOCALE_MENU_HINT_SCAN_USEUSALS); - + if (!unicable) { + diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); + diseqc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQC); + comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); + comm->setHint("", LOCALE_MENU_HINT_SCAN_COMMITED); + uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &satconfig.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); + uncomm->setHint("", LOCALE_MENU_HINT_SCAN_UNCOMMITED); + motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF); + motor->setHint("", LOCALE_MENU_HINT_SCAN_MOTORPOS); + usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &satconfig.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true /*dmode == DISEQC_ADVANCED*/); + usals->setHint("", LOCALE_MENU_HINT_SCAN_USEUSALS); + }else{ + if (satconfig.diseqc < 0) + satconfig.diseqc = 0; + unilnb = new CMenuOptionNumberChooser(LOCALE_UNICABLE_LNB, &satconfig.diseqc, true, 0, 1); + } if(!satconfig.use_usals) all_usals = 0; @@ -802,13 +854,17 @@ void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satcon CIntInput* lofH = new CIntInput(LOCALE_SATSETUP_LOFH, (int&) satconfig.lnbOffsetHigh, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CIntInput* lofS = new CIntInput(LOCALE_SATSETUP_LOFS, (int&) satconfig.lnbSwitch, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); - temp_sat->addItem(diseqc); - temp_sat->addItem(comm); - temp_sat->addItem(uncomm); - temp_sat->addItem(motor); - temp_sat->addItem(usals); + if (!unicable) { + temp_sat->addItem(diseqc); + temp_sat->addItem(comm); + temp_sat->addItem(uncomm); + temp_sat->addItem(motor); + temp_sat->addItem(usals); + } else { + temp_sat->addItem(unilnb); + } - CMenuForwarder * mf = new CMenuDForwarder(LOCALE_SATSETUP_LOFL, true, lofL->getValue(), lofL); + mf = new CMenuDForwarder(LOCALE_SATSETUP_LOFL, true, lofL->getValue(), lofL); mf->setHint("", LOCALE_MENU_HINT_SCAN_LOFL); temp_sat->addItem(mf); mf = new CMenuDForwarder(LOCALE_SATSETUP_LOFH, true, lofH->getValue(), lofH); @@ -1110,26 +1166,50 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data* } } else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_DISEQC)) { - printf("[neutrino] CScanSetup::%s: diseqc %d \n", __FUNCTION__, dmode); - //FIXME 2 frontends ?? + printf("[neutrino] CScanSetup::%s: diseqc %d fenumber %d\n", __FUNCTION__, dmode, fenumber); + CFrontend * fe = CFEManager::getInstance()->getFE(fenumber); + fe->setDiseqcType((diseqc_t) dmode); + + if(femode != CFEManager::FE_MODE_ALONE) + CFEManager::getInstance()->saveSettings(true); + fautoScanAll->setActive(dmode != NO_DISEQC); - if(dmode == NO_DISEQC) { + uniSetup->setActive(dmode == DISEQC_UNICABLE); + if (dmode == NO_DISEQC || dmode == DISEQC_UNICABLE) { ojDiseqcRepeats->setActive(false); + if(frontendSetup){ + if(femode == CFEManager::FE_MODE_TWIN && dmode == DISEQC_UNICABLE){ + frontendSetup->setActive(true); + } + else if( femode != CFEManager::FE_MODE_ALONE){ + frontendSetup->setActive(false); + } + } } else if(dmode < DISEQC_ADVANCED) { ojDiseqcRepeats->setActive(true); + if(frontendSetup && femode != CFEManager::FE_MODE_ALONE){ + frontendSetup->setActive(false); + } } else if(dmode == DISEQC_ADVANCED) { + if(frontendSetup && femode != CFEManager::FE_MODE_ALONE){ + frontendSetup->setActive(false); + } ojDiseqcRepeats->setActive(true); } - CFrontend * fe = CFEManager::getInstance()->getFE(fenumber); - fe->setDiseqcType((diseqc_t) dmode); + } else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SATSETUP_FE_MODE)) { printf("[neutrino] CScanSetup::%s: fe mode %d \n", __FUNCTION__, femode); /* cable dont have this menu */ - if(frontendSetup) - frontendSetup->setActive(femode == CFEManager::FE_MODE_ALONE); + bool twin_unicabel = false; + if(frontendSetup){ + CFrontend * fe = CFEManager::getInstance()->getLiveFE(); + frontend_config_t & fe_config = fe->getConfig(); + twin_unicabel = (femode == CFEManager::FE_MODE_TWIN && fe_config.diseqcType == DISEQC_UNICABLE); + frontendSetup->setActive(femode == CFEManager::FE_MODE_ALONE || twin_unicabel); + } CFEManager::getInstance()->setMode((CFEManager::fe_mode_t) femode); /* to copy settings from fe0 */ if(femode != CFEManager::FE_MODE_ALONE) diff --git a/src/gui/scan_setup.h b/src/gui/scan_setup.h index bdc7655e8..e201fc78c 100644 --- a/src/gui/scan_setup.h +++ b/src/gui/scan_setup.h @@ -57,6 +57,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver CMenuForwarder *fautoScanAll; CMenuForwarder *frontendSetup; CMenuForwarder *fsatSetup; + CMenuForwarder *uniSetup; CMenuOptionNumberChooser * ojDiseqcRepeats; CIntInput * nid; CMenuOptionChooser * lcnhd; @@ -84,6 +85,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver int showFrontendSetup(int number); int showScanMenuLnbSetup(); + int showUnicableSetup(); int showScanMenuSatFind(); void fillSatSelect(CMenuOptionStringChooser *select); void fillCableSelect(CMenuOptionStringChooser *select); diff --git a/src/system/locals.h b/src/system/locals.h index 19f72a907..0ecf8dd6f 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1595,6 +1595,8 @@ typedef enum LOCALE_SATSETUP_SELECT_SAT, LOCALE_SATSETUP_SMATVREMOTE, LOCALE_SATSETUP_UNCOMM_INPUT, + LOCALE_SATSETUP_UNI_SETTINGS, + LOCALE_SATSETUP_UNICABLE, LOCALE_SATSETUP_USALS_REPEAT, LOCALE_SATSETUP_USE_BAT, LOCALE_SATSETUP_USE_FTA_FLAG, @@ -1785,6 +1787,9 @@ typedef enum LOCALE_TIMING_INFOBAR_RADIO, LOCALE_TIMING_MENU, LOCALE_TIMING_NUMERICZAP, + LOCALE_UNICABLE_LNB, + LOCALE_UNICABLE_QRG, + LOCALE_UNICABLE_SCR, LOCALE_UPNPBROWSER_HEAD, LOCALE_UPNPBROWSER_NOSERVERS, LOCALE_UPNPBROWSER_RESCAN, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index bebeabfbb..81125c8cf 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1595,6 +1595,8 @@ const char * locale_real_names[] = "satsetup.select_sat", "satsetup.smatvremote", "satsetup.uncomm_input", + "satsetup.uni_settings", + "satsetup.unicable", "satsetup.usals_repeat", "satsetup.use_bat", "satsetup.use_fta_flag", @@ -1785,6 +1787,9 @@ const char * locale_real_names[] = "timing.infobar_radio", "timing.menu", "timing.numericzap", + "unicable.lnb", + "unicable.qrg", + "unicable.scr", "upnpbrowser.head", "upnpbrowser.noservers", "upnpbrowser.rescan", diff --git a/src/zapit/include/zapit/client/zapittypes.h b/src/zapit/include/zapit/client/zapittypes.h index 50d7a0859..3c472f14e 100644 --- a/src/zapit/include/zapit/client/zapittypes.h +++ b/src/zapit/include/zapit/client/zapittypes.h @@ -39,7 +39,8 @@ typedef enum { DISEQC_1_0, DISEQC_1_1, DISEQC_1_2, - DISEQC_ADVANCED + DISEQC_ADVANCED, + DISEQC_UNICABLE #if 0 , DISEQC_2_0, DISEQC_2_1, diff --git a/src/zapit/include/zapit/frontend_c.h b/src/zapit/include/zapit/frontend_c.h index 43cce1eb0..ecafd8b5b 100644 --- a/src/zapit/include/zapit/frontend_c.h +++ b/src/zapit/include/zapit/frontend_c.h @@ -184,7 +184,6 @@ class CFrontend }; void configRotor(int _motorRotationSpeed, bool _highVoltage) { config.motorRotationSpeed = _motorRotationSpeed; config.highVoltage = _highVoltage; }; - void configUnicable(int scr, int qrg) { config.uni_scr = scr; config.uni_qrg = qrg; }; frontend_config_t& getConfig() { return config; }; void setConfig(frontend_config_t cfg) { setDiseqcType((diseqc_t) cfg.diseqcType); config = cfg; }; diff --git a/src/zapit/include/zapit/frontend_types.h b/src/zapit/include/zapit/frontend_types.h index e703f9b52..1e8fa6a88 100644 --- a/src/zapit/include/zapit/frontend_types.h +++ b/src/zapit/include/zapit/frontend_types.h @@ -34,6 +34,7 @@ typedef struct frontend_config { int diseqcType; int uni_scr; int uni_qrg; + int uni_lnb; int motorRotationSpeed; int highVoltage; } frontend_config_t; diff --git a/src/zapit/include/zapit/zapit.h b/src/zapit/include/zapit/zapit.h index aa32ae0b9..7325d8c53 100644 --- a/src/zapit/include/zapit/zapit.h +++ b/src/zapit/include/zapit/zapit.h @@ -70,7 +70,8 @@ typedef struct Zapit_config { int highVoltage; int motorRotationSpeed; int uni_scr; - int uni_qrg; + int uni_qrg; /* the unicable frequency in MHz */ + int uni_lnb; /* the input (0/1) of a twin-position switch */ } t_zapit_config; diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index cabfe7127..f8fa390f2 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -236,8 +236,12 @@ void CFEManager::saveSettings(bool write) INFO("fe%d", fe->fenumber); if(fe->fenumber && mode != FE_MODE_ALONE) { CFrontend * fe0 = getFE(0); - fe->setConfig(fe0->getConfig()); fe->setSatellites(fe0->getSatellites()); + //fe->setConfig(fe0->getConfig()); + fe->config.diseqcType = fe0->config.diseqcType; + fe->config.diseqcRepeats = fe0->config.diseqcRepeats; + fe->config.motorRotationSpeed = fe0->config.motorRotationSpeed; + fe->config.highVoltage = fe0->config.highVoltage; } setConfigValue(fe, "diseqcType", fe_config.diseqcType); diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index c3b6a6a13..d7a948d45 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -159,8 +159,9 @@ CFrontend::CFrontend(int Number, int Adapter) config.diseqcType = NO_DISEQC; config.diseqcRepeats = 0; - config.uni_scr = -1; /* the unicable SCR address, -1 == no unicable */ - config.uni_qrg = 0; /* the unicable frequency in MHz, 0 == from spec */ + config.uni_scr = 0; /* the unicable SCR address 0-7 */ + config.uni_qrg = 0; /* the unicable frequency in MHz */ + config.uni_lnb = 0; /* for two-position switches */ config.highVoltage = false; config.motorRotationSpeed = 0; //in 0.1 degrees per second @@ -699,11 +700,11 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p } - if (config.uni_scr >= 0) + if (config.diseqcType == DISEQC_UNICABLE) cmdseq.props[FREQUENCY].u.data = sendEN50494TuningCommand(feparams->dvb_feparams.frequency, currentToneMode == SEC_TONE_ON, currentVoltage == SEC_VOLTAGE_18, - 0); /* bank 0/1, like mini-diseqc a/b, not impl.*/ + !!config.uni_lnb); cmdseq.num += nrOfProps; @@ -767,7 +768,7 @@ void CFrontend::secSetTone(const fe_sec_tone_mode_t toneMode, const uint32_t ms) if (currentToneMode == toneMode) return; - if (config.uni_scr >= 0) { + if (config.diseqcType == DISEQC_UNICABLE) { /* this is too ugly for words. the "currentToneMode" is the only place where the global "highband" state is saved. So we need to fake it for unicable and still set the tone on... */ @@ -796,7 +797,7 @@ void CFrontend::secSetVoltage(const fe_sec_voltage_t voltage, const uint32_t ms) return; printf("[fe%d] voltage %s\n", fenumber, voltage == SEC_VOLTAGE_OFF ? "OFF" : voltage == SEC_VOLTAGE_13 ? "13" : "18"); - if (config.uni_scr >= 0) { + if (config.diseqcType == DISEQC_UNICABLE) { /* see my comment in secSetTone... */ currentVoltage = voltage; /* need to know polarization for unicable */ fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13); /* voltage must not be 18V */ @@ -854,6 +855,9 @@ void CFrontend::setDiseqcType(const diseqc_t newDiseqcType, bool force) case DISEQC_ADVANCED: INFO("fe%d: DISEQC_ADVANCED", fenumber); break; + case DISEQC_UNICABLE: + INFO("fe%d: DISEQC_UNICABLE", fenumber); + break; #if 0 case DISEQC_2_0: INFO("DISEQC_2_0"); @@ -870,7 +874,11 @@ void CFrontend::setDiseqcType(const diseqc_t newDiseqcType, bool force) return; } - if ((force && (newDiseqcType != NO_DISEQC)) || ((config.diseqcType <= MINI_DISEQC) + if (newDiseqcType == DISEQC_UNICABLE) { + secSetTone(SEC_TONE_OFF, 0); + secSetVoltage(SEC_VOLTAGE_13, 0); + } + else if ((force && (newDiseqcType != NO_DISEQC)) || ((config.diseqcType <= MINI_DISEQC) && (newDiseqcType > MINI_DISEQC))) { secSetTone(SEC_TONE_OFF, 15); sendDiseqcPowerOn(); @@ -972,7 +980,14 @@ void CFrontend::setInput(t_satellite_position satellitePosition, uint32_t freque { sat_iterator_t sit = satellites.find(satellitePosition); + /* unicable uses diseqc parameter for input selection */ + config.uni_lnb = sit->second.diseqc; + setLnbOffsets(sit->second.lnbOffsetLow, sit->second.lnbOffsetHigh, sit->second.lnbSwitch); + if (config.diseqcType == DISEQC_UNICABLE) + return; + + if (config.diseqcType != DISEQC_ADVANCED) { setDiseqc(sit->second.diseqc, polarization, frequency); return; @@ -994,24 +1009,19 @@ void CFrontend::setInput(t_satellite_position satellitePosition, uint32_t freque uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int high_band, const int horizontal, const int bank) { - uint32_t uni_qrgs[] = { 1284, 1400, 1516, 1632, 1748, 1864, 1980, 2096 }; - uint32_t bpf; - if (config.uni_qrg == 0) - bpf = uni_qrgs[config.uni_scr]; - else - bpf = config.uni_qrg; - + uint32_t bpf = config.uni_qrg; struct dvb_diseqc_master_cmd cmd = { {0xe0, 0x10, 0x5a, 0x00, 0x00, 0x00}, 5 }; unsigned int t = (frequency / 1000 + bpf + 2) / 4 - 350; if (t < 1024 && config.uni_scr >= 0 && config.uni_scr < 8) { - INFO("VOLT18=%d TONE_ON=%d, freq=%d bpf=%d ret=%d", currentVoltage == SEC_VOLTAGE_18, currentToneMode == SEC_TONE_ON, frequency, bpf, (t + 350) * 4000 - frequency); + uint32_t ret = (t + 350) * 4000 - frequency; + INFO("[unicable] 18V=%d TONE=%d, freq=%d qrg=%d scr=%d bank=%d ret=%d", currentVoltage == SEC_VOLTAGE_18, currentToneMode == SEC_TONE_ON, frequency, bpf, config.uni_scr, bank, ret); if (!slave && info.type == FE_QPSK) { cmd.msg[3] = (t >> 8) | /* highest 3 bits of t */ (config.uni_scr << 5) | /* adress */ - (bank << 4) | /* not implemented yet */ + (bank << 4) | /* input 0/1 */ (horizontal << 3) | /* horizontal == 0x08 */ (high_band) << 2; /* high_band == 0x04 */ cmd.msg[4] = t & 0xFF; @@ -1020,7 +1030,7 @@ uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int sendDiseqcCommand(&cmd, 50); /* en50494 says: >2ms and < 60 ms */ fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13); } - return (t + 350) * 4000 - frequency; + return ret; } WARN("ooops. t > 1024? (%d) or uni_scr out of range? (%d)", t, config.uni_scr); return 0; diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index a50342ec4..896cb9f9d 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -192,8 +192,6 @@ void CZapit::SaveSettings(bool write) configfile.setInt32("diseqcRepeats", live_fe->getDiseqcRepeats()); configfile.setInt32("diseqcType", live_fe->getDiseqcType()); configfile.setInt32("motorRotationSpeed", config.motorRotationSpeed); - configfile.setInt32("uni_scr", config.uni_scr); - configfile.setInt32("uni_qrg", config.uni_qrg); #endif if (configfile.getModifiedFlag()) configfile.saveConfig(CONFIGFILE); @@ -309,8 +307,6 @@ void CZapit::LoadSettings() /* FIXME FE specific, to be removed */ diseqcType = (diseqc_t)configfile.getInt32("diseqcType", NO_DISEQC); config.motorRotationSpeed = configfile.getInt32("motorRotationSpeed", 18); // default: 1.8 degrees per second - config.uni_scr = configfile.getInt32("uni_scr", -1); - config.uni_qrg = configfile.getInt32("uni_qrg", 0); printf("[zapit.cpp] diseqc type = %d\n", diseqcType); @@ -336,7 +332,6 @@ void CZapit::ConfigFrontend() if(!CFEManager::getInstance()->configExist()) { INFO("New frontend config not exist"); fe->configRotor(config.motorRotationSpeed, config.highVoltage); - fe->configUnicable(config.uni_scr, config.uni_qrg); fe->setDiseqcType(diseqcType); fe->setDiseqcRepeats(configfile.getInt32("diseqcRepeats", 0)); fe->setRotorSatellitePosition(configfile.getInt32("lastSatellitePosition", 0));