From f6aa31db0c519bc00907979072ae12592ab8049d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 21 Oct 2016 23:41:22 +0200 Subject: [PATCH 01/24] locale: fix moviebrowser spacer trailing whitespace was removed by mistake with 'git rebase --whitespace=fix' :/ Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1530bb8e8c2b06a5890251d765195e8f1073bf31 Author: vanhofen Date: 2016-10-21 (Fri, 21 Oct 2016) Origin message was: ------------------ - locale: fix moviebrowser spacer trailing whitespace was removed by mistake with 'git rebase --whitespace=fix' :/ --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 92dc38778..7f9468a2a 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1765,7 +1765,7 @@ moviebrowser.short_rating Vote moviebrowser.short_recorddate Datum moviebrowser.short_serie Serie moviebrowser.short_size Größe -moviebrowser.short_spacer +moviebrowser.short_spacer moviebrowser.short_title Titel moviebrowser.start_head Film starten von Position: moviebrowser.start_record_start Aufnahmestart diff --git a/data/locale/english.locale b/data/locale/english.locale index de9e55ee9..b9bd319b0 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1765,7 +1765,7 @@ moviebrowser.short_rating Vote moviebrowser.short_recorddate Date moviebrowser.short_serie Serie moviebrowser.short_size MB -moviebrowser.short_spacer +moviebrowser.short_spacer moviebrowser.short_title Title moviebrowser.start_head Start movie from: moviebrowser.start_record_start Movie start From b707176221c7309a289d184f82aecd067cbc053c Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sat, 22 Oct 2016 20:20:38 +0200 Subject: [PATCH 02/24] fix empty ip Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d0b9b3b4a51d3acd7544d6649e1e8f1bc7e38116 Author: TangoCash Date: 2016-10-22 (Sat, 22 Oct 2016) --- src/gui/timerlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index f09dcd9a5..d6b949d2e 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -296,7 +296,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) if(actionKey == "add_ip") { std::string remoteip; CIPInput remotebox_NetworkIP(LOCALE_REMOTEBOX_IP , &remoteip); - if (remotebox_NetworkIP.exec(NULL,"") == true) { + if ((remotebox_NetworkIP.exec(NULL,"") == true) && (!remoteip.empty())) { remboxmenu->addItem(new CMenuForwarder(remoteip, true, NULL, this, "cha_ip")); remotebox_NetworkIP.hide(); changed = true; From fa76d8511de798b705862a69a55db1563771d206 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sun, 23 Oct 2016 11:00:19 +0200 Subject: [PATCH 03/24] fix overlapping remote timers Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7bd568dc9ca21a6e426ea65410102f361280d048 Author: TangoCash Date: 2016-10-23 (Sun, 23 Oct 2016) --- src/gui/timerlist.cpp | 111 ++++++++++++++++++++++++++++++++++++------ src/gui/timerlist.h | 1 + 2 files changed, 97 insertions(+), 15 deletions(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index d6b949d2e..70d603a02 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -394,22 +394,37 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) } else if ((strcmp(key, "fetch_remotetimer") == 0) && localChanExists(timerlist[selected].channel_id)) { + int pre,post; + Timer->getRecordingSafety(pre,post); + std::string remotebox_ip = timerlist[selected].remotebox_ip; + std::string eventID = to_string((int)timerlist[selected].eventID); + + int res = Timer->addRecordTimerEvent(timerlist[selected].channel_id, timerlist[selected].alarmTime + pre, + timerlist[selected].stopTime - post, 0, 0, timerlist[selected].announceTime, + TIMERD_APIDS_CONF, true, timerlist[selected].announceTime > time(NULL),"",false); + + if (res == -1) + { + bool forceAdd = askUserOnTimerConflict(timerlist[selected].announceTime,timerlist[selected].stopTime); + + if (forceAdd) + { + res = Timer->addRecordTimerEvent(timerlist[selected].channel_id, timerlist[selected].alarmTime + pre, + timerlist[selected].stopTime - post, 0, 0, timerlist[selected].announceTime, + TIMERD_APIDS_CONF, true, timerlist[selected].announceTime > time(NULL),"",true); + } + } + CHTTPTool httpTool; std::string r_url; r_url = "http://"; - r_url += timerlist[selected].remotebox_ip; + r_url += remotebox_ip; r_url += "/control/timer?action=remove"; - r_url += "&id=" + to_string((int)timerlist[selected].eventID); + r_url += "&id=" + eventID; //printf("[remotetimer] url:%s\n",r_url.c_str()); + if (res > 0) r_url = httpTool.downloadString(r_url); //printf("[remotetimer] status:%s\n",r_url.c_str()); - if (r_url=="ok") { - int pre,post; - Timer->getRecordingSafety(pre,post); - Timer->addRecordTimerEvent(timerlist[selected].channel_id, timerlist[selected].alarmTime + pre, - timerlist[selected].stopTime - post, 0, 0, timerlist[selected].announceTime, - TIMERD_APIDS_CONF, true, timerlist[selected].announceTime > time(NULL)); - } } else if (strcmp(key, "del_remotetimer") == 0) { @@ -619,12 +634,6 @@ void CTimerList::updateEvents(void) void CTimerList::select_remotebox_ip() { - if (g_settings.timer_remotebox_ip.size() == 1) { - std::list::iterator it = g_settings.timer_remotebox_ip.begin(); - strncpy(timerlist[selected].remotebox_ip,it->c_str(),sizeof(timerlist[selected].remotebox_ip)); - timerlist[selected].remotebox_ip[sizeof(timerlist[selected].remotebox_ip) - 1] = 0; - } - int select = 0; CMenuWidget *m = new CMenuWidget(LOCALE_REMOTEBOX_HEAD, NEUTRINO_ICON_TIMER); CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); @@ -638,12 +647,18 @@ void CTimerList::select_remotebox_ip() std::list::iterator it = g_settings.timer_remotebox_ip.begin(); std::advance(it,select); + if (askUserOnRemoteTimerConflict(timerlist[selected].announceTime, timerlist[selected].stopTime, (char*) it->c_str())) + { strncpy(timerlist[selected].remotebox_ip,it->c_str(),sizeof(timerlist[selected].remotebox_ip)); timerlist[selected].remotebox_ip[sizeof(timerlist[selected].remotebox_ip) - 1] = 0; + } } bool CTimerList::remoteChanExists(t_channel_id channel_id) { + if (strcmp(timerlist[selected].remotebox_ip,"") == 0) + return false; + CHTTPTool httpTool; std::string r_url; r_url = "http://"; @@ -1654,6 +1669,72 @@ int CTimerList::newTimer() return ret; } +bool CTimerList::askUserOnRemoteTimerConflict(time_t announceTime, time_t stopTime, char * remotebox_ip) +{ + CTimerd::TimerList overlappingTimers; + int pre,post; + Timer->getRecordingSafety(pre,post); + + for (CTimerd::TimerList::iterator it = timerlist.begin(); + it != timerlist.end();++it) + { + + if (strcmp(it->remotebox_ip,remotebox_ip) == 0) { + + if(it->stopTime != 0 && stopTime != 0) + { + // Check if both timers have start and end. In this case do not show conflict, if endtime is the same than the starttime of the following timer + if ((stopTime+post > it->alarmTime) && (announceTime-pre < it->stopTime)) + { + overlappingTimers.push_back(*it); + } + } + else + { + if (!((stopTime < it->announceTime) || (announceTime > it->stopTime))) + { + overlappingTimers.push_back(*it); + } + } + } + } + + std::string timerbuf = g_Locale->getText(LOCALE_TIMERLIST_OVERLAPPING_TIMER); + timerbuf += "\n"; + for (CTimerd::TimerList::iterator it = overlappingTimers.begin(); + it != overlappingTimers.end(); ++it) + { + timerbuf += CTimerList::convertTimerType2String(it->eventType); + timerbuf += " ("; + timerbuf += CTimerList::convertChannelId2String(it->channel_id); // UTF-8 + if (it->epgID != 0) + { + CEPGData epgdata; + if (CEitManager::getInstance()->getEPGid(it->epgID, it->epg_starttime, &epgdata)) + { + timerbuf += ":"; + timerbuf += epgdata.title; + } + else if (strlen(it->epgTitle)!=0) + { + timerbuf += ":"; + timerbuf += it->epgTitle; + } + } + timerbuf += "):\n"; + + struct tm *annTime = localtime(&(it->announceTime)); + timerbuf += strftime("%d.%m. %H:%M\n",annTime); + + struct tm *sTime = localtime(&(it->stopTime)); + timerbuf += strftime("%d.%m. %H:%M\n",sTime); + } + if (overlappingTimers.size() > 0) + return (ShowMsg(LOCALE_MESSAGEBOX_INFO,timerbuf,CMessageBox::mbrNo,CMessageBox::mbNo|CMessageBox::mbYes) == CMessageBox::mbrYes); + else + return true; +} + bool askUserOnTimerConflict(time_t announceTime, time_t stopTime, t_channel_id channel_id) { if (CFEManager::getInstance()->getEnabledCount() == 1) { diff --git a/src/gui/timerlist.h b/src/gui/timerlist.h index 3ed0af33c..7a633cb7f 100644 --- a/src/gui/timerlist.h +++ b/src/gui/timerlist.h @@ -95,6 +95,7 @@ class CTimerList : public CMenuTarget, public CListHelpers bool changed; int bselected; CMenuWidget *remboxmenu; + bool askUserOnRemoteTimerConflict(time_t announceTime, time_t stopTime, char * remotebox_ip); public: CTimerList(); From 07a1df57f10236788bcec1e5c59dc6353daebb6a Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 23 Oct 2016 12:19:06 +0200 Subject: [PATCH 04/24] remove obsolete embedded libtriple the code is unmaintained and probably non-functional, everyone should use libstb-hal instead (forward ported neutrino-mp commit 2158fee4418) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/57078ed23dc170b7e0dc58d8532b84b697157469 Author: Stefan Seyfried Date: 2016-10-23 (Sun, 23 Oct 2016) --- configure.ac | 1 - lib/Makefile.am | 5 - lib/libtriple/Makefile.am | 22 --- lib/libtriple/cs_api.h | 66 --------- lib/libtriple/init_cs.h | 2 - lib/libtriple/init_td.cpp | 133 ------------------- lib/libtriple/init_td.h | 5 - lib/libtriple/playback.h | 1 - lib/libtriple/td-compat/td-audio-compat.h | 38 ------ lib/libtriple/td-compat/td-demux-compat.h | 45 ------- lib/libtriple/td-compat/td-frontend-compat.h | 120 ----------------- lib/libtriple/td-compat/td-value-compat.h | 93 ------------- lib/libtriple/td-compat/td-video-compat.h | 46 ------- src/Makefile.am | 7 - 14 files changed, 584 deletions(-) delete mode 100644 lib/libtriple/Makefile.am delete mode 100644 lib/libtriple/cs_api.h delete mode 100644 lib/libtriple/init_cs.h delete mode 100644 lib/libtriple/init_td.cpp delete mode 100644 lib/libtriple/init_td.h delete mode 100644 lib/libtriple/playback.h delete mode 100644 lib/libtriple/td-compat/td-audio-compat.h delete mode 100644 lib/libtriple/td-compat/td-demux-compat.h delete mode 100644 lib/libtriple/td-compat/td-frontend-compat.h delete mode 100644 lib/libtriple/td-compat/td-value-compat.h delete mode 100644 lib/libtriple/td-compat/td-video-compat.h diff --git a/configure.ac b/configure.ac index e7b520033..f7d91397e 100644 --- a/configure.ac +++ b/configure.ac @@ -271,7 +271,6 @@ lib/xmltree/Makefile lib/jsoncpp/Makefile lib/sectionsdclient/Makefile lib/timerdclient/Makefile -lib/libtriple/Makefile lib/libtuxtxt/Makefile lib/libdvbsub/Makefile lib/libupnpclient/Makefile diff --git a/lib/Makefile.am b/lib/Makefile.am index ff4f206cb..bc4b8f2e5 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -17,8 +17,3 @@ if ENABLE_UPNP SUBDIRS += \ libupnpclient endif - -if BOXTYPE_TRIPLE -SUBDIRS += \ - libtriple -endif diff --git a/lib/libtriple/Makefile.am b/lib/libtriple/Makefile.am deleted file mode 100644 index 4ac1550ca..000000000 --- a/lib/libtriple/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -AM_CPPFLAGS = \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/lib \ - -I$(top_srcdir)/src/zapit/include \ - -I$(top_srcdir)/lib/connection \ - -I$(top_srcdir)/lib/libeventserver \ - @DIRECTFB_CFLAGS@ - -noinst_LIBRARIES = libtriple.a - -AM_CPPFLAGS += -fno-rtti -fno-exceptions - -libtriple_a_SOURCES = \ - dmx_td.cpp \ - video_td.cpp \ - audio_td.cpp \ - init_td.cpp \ - playback_td.cpp \ - pwrmngr.cpp \ - record_td.cpp - -#libtriple_a_LIBADD = $(top_builddir)/src/driver/libneutrino_driver.a diff --git a/lib/libtriple/cs_api.h b/lib/libtriple/cs_api.h deleted file mode 100644 index 5512b928d..000000000 --- a/lib/libtriple/cs_api.h +++ /dev/null @@ -1,66 +0,0 @@ -/* compatibility header for tripledragon. I'm lazy, so I just left it - as "cs_api.h" so that I don't need too many ifdefs in the code */ - -#ifndef __CS_API_H_ -#define __CS_API_H_ - -#include "init_td.h" -typedef void (*cs_messenger) (unsigned int msg, unsigned int data); - -#if 0 -enum CS_LOG_MODULE { - CS_LOG_CI = 0, - CS_LOG_HDMI_CEC, - CS_LOG_HDMI, - CS_LOG_VIDEO, - CS_LOG_VIDEO_DRM, - CS_LOG_AUDIO, - CS_LOG_DEMUX, - CS_LOG_DENC, - CS_LOG_PVR_RECORD, - CS_LOG_PVR_PLAY, - CS_LOG_POWER_CTRL, - CS_LOG_POWER_CLK, - CS_LOG_MEM, - CS_LOG_API, -}; -#endif - -inline void cs_api_init() -{ - init_td_api(); -}; - -inline void cs_api_exit() -{ - shutdown_td_api(); -}; - -#define cs_malloc_uncached malloc -#define cs_free_uncached free - -// Callback function helpers -static inline void cs_register_messenger(cs_messenger) { return; }; -static inline void cs_deregister_messenger(void) { return; }; -//cs_messenger cs_get_messenger(void); - -#if 0 -// Logging functions -void cs_log_enable(void); -void cs_log_disable(void); -void cs_log_message(const char *prefix, const char *fmt, ...); -void cs_log_module_enable(enum CS_LOG_MODULE module); -void cs_log_module_disable(enum CS_LOG_MODULE module); -void cs_log_module_message(enum CS_LOG_MODULE module, const char *fmt, ...); - -// TS Routing -unsigned int cs_get_ts_output(void); -int cs_set_ts_output(unsigned int port); - -// Serial nr and revision accessors -unsigned long long cs_get_serial(void); -#endif -/* compat... HD1 seems to be version 6. everything newer ist > 6... */ -static unsigned int cs_get_revision(void) { return 1; }; -extern int cnxt_debug; -#endif //__CS_API_H_ diff --git a/lib/libtriple/init_cs.h b/lib/libtriple/init_cs.h deleted file mode 100644 index 5894a14d0..000000000 --- a/lib/libtriple/init_cs.h +++ /dev/null @@ -1,2 +0,0 @@ -#warning using init_cs.h from libtriple -#include "init_td.h" diff --git a/lib/libtriple/init_td.cpp b/lib/libtriple/init_td.cpp deleted file mode 100644 index d56714bf3..000000000 --- a/lib/libtriple/init_td.cpp +++ /dev/null @@ -1,133 +0,0 @@ -#include - -#include "init_td.h" -#include -#include -#include -#include -#include -#include - -#include - -extern "C" { -#include -#include -#include -} - -static const char * FILENAME = "init_td.cpp"; - -static bool initialized = false; - -/* the super interface */ -static IDirectFB *dfb; -/* the primary surface */ -static IDirectFBSurface *primary; -static IDirectFBSurface *dest; -static IDirectFBDisplayLayer *layer; - -#define DFBCHECK(x...) \ - err = x; \ - if (err != DFB_OK) { \ - fprintf(stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \ - DirectFBErrorFatal(#x, err ); \ - } - -static void dfb_init() -{ - int argc = 0; - DFBResult err; - DFBSurfaceDescription dsc; - DFBSurfacePixelFormat pixelformat; - int SW, SH; - - DFBCHECK(DirectFBInit(&argc, NULL)); - /* neutrino does its own VT handling */ - DirectFBSetOption("no-vt-switch", NULL); - DirectFBSetOption("no-vt", NULL); - /* signal handling seems to interfere with neutrino */ - DirectFBSetOption("no-sighandler", NULL); - /* if DirectFB grabs the remote, neutrino does not get events */ - DirectFBSetOption("disable-module", "tdremote"); - DirectFBSetOption("disable-module", "keyboard"); - DirectFBSetOption("disable-module", "linux_input"); - DFBCHECK(DirectFBCreate(&dfb)); - - err = dfb->SetCooperativeLevel(dfb, DFSCL_FULLSCREEN); - if (err) - DirectFBError("Failed to get exclusive access", err); - - dsc.flags = DSDESC_CAPS; - dsc.caps = DSCAPS_PRIMARY; - - DFBCHECK(dfb->CreateSurface( dfb, &dsc, &primary )); - /* set pixel alpha mode */ - dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer); - DFBCHECK(layer->SetCooperativeLevel(layer, DLSCL_EXCLUSIVE)); - DFBDisplayLayerConfig conf; - DFBCHECK(layer->GetConfiguration(layer, &conf)); - conf.flags = DLCONF_OPTIONS; - conf.options = (DFBDisplayLayerOptions)((conf.options & ~DLOP_OPACITY) | DLOP_ALPHACHANNEL); - DFBCHECK(layer->SetConfiguration(layer, &conf)); - - primary->GetPixelFormat(primary, &pixelformat); - primary->GetSize(primary, &SW, &SH); - primary->Clear(primary, 0, 0, 0, 0); - primary->GetSubSurface(primary, NULL, &dest); - dest->Clear(dest, 0, 0, 0, 0); -} - -static void dfb_deinit() -{ - dest->Release(dest); - primary->Release(primary); - layer->Release(layer); - dfb->Release(dfb); -} - -static void rc_init() -{ - /* set remote control address from bootloader config */ - int fd = open("/dev/stb/tdsystem", O_RDWR); - struct BIOS_CONFIG_AREA bca; - unsigned short rc_addr = 0xff; - if (ioctl(fd, IOC_AVS_GET_LOADERCONFIG, &bca) != 0) - fprintf(stderr, "%s: IOC_AVS_GET_LOADERCONFIG failed: %m\n", __FUNCTION__); - else - rc_addr = bca.ir_adrs; - close(fd); - fd = open("/dev/stb/tdremote", O_RDWR); - if (ioctl(fd, IOC_IR_SET_ADDRESS, rc_addr) < 0) - fprintf(stderr, "%s: IOC_IR_SET_ADDRESS %d failed: %m\n", __FUNCTION__, rc_addr); - /* short delay in the driver improves responsiveness and reduces spurious - "key up" events during zapping */ - //ioctl(fd, IOC_IR_SET_DELAY, 1); TODO: needs more work in rcinput - close(fd); - printf("%s: rc_addr=0x%02hx\n", __FUNCTION__, rc_addr); -} - -void init_td_api() -{ - fprintf(stderr, "%s:%s begin, initialized = %d\n", FILENAME, __FUNCTION__, (int)initialized); - if (!initialized) - { - /* DirectFB does setpgid(0,0), which disconnects us from controlling terminal - and thus disables e.g. ctrl-C. work around that. */ - pid_t pid = getpgid(0); - dfb_init(); - if (setpgid(0, pid)) - perror("setpgid"); - rc_init(); - } - initialized = true; - fprintf(stderr, "%s:%s end\n", FILENAME, __FUNCTION__); -} - -void shutdown_td_api() -{ - fprintf(stderr, "%s:%s, initialized = %d\n", FILENAME, __FUNCTION__, (int)initialized); - if (initialized) - dfb_deinit(); - initialized = false; -} diff --git a/lib/libtriple/init_td.h b/lib/libtriple/init_td.h deleted file mode 100644 index d9a6f0963..000000000 --- a/lib/libtriple/init_td.h +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef __INIT_TD_H -#define __INIT_TD_H -void init_td_api(); -void shutdown_td_api(); -#endif diff --git a/lib/libtriple/playback.h b/lib/libtriple/playback.h deleted file mode 100644 index 6e6b4c5ae..000000000 --- a/lib/libtriple/playback.h +++ /dev/null @@ -1 +0,0 @@ -#include "playback_td.h" diff --git a/lib/libtriple/td-compat/td-audio-compat.h b/lib/libtriple/td-compat/td-audio-compat.h deleted file mode 100644 index 3e0b4a7ff..000000000 --- a/lib/libtriple/td-compat/td-audio-compat.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * compatibility stuff for Tripledragon audio API - * - * (C) 2009 Stefan Seyfried - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#ifndef __td_audio_compat_h__ -#define __td_audio_compat_h__ - -#include -// types -typedef enum { - AUDIO_SOURCE_DEMUX = AUD_SOURCE_DEMUX, - AUDIO_SOURCE_MEMORY = AUD_SOURCE_MEMORY -} audio_stream_source_t; -#define audio_channel_select_t audChannel_t -// ioctls -#define AUDIO_CHANNEL_SELECT MPEG_AUD_SELECT_CHANNEL -#define AUDIO_SELECT_SOURCE MPEG_AUD_SELECT_SOURCE -#define AUDIO_PLAY MPEG_AUD_PLAY -#define AUDIO_STOP MPEG_AUD_STOP -#define AUDIO_SET_MUTE MPEG_AUD_SET_MUTE - -#endif /* __td_audio_compat_h__ */ diff --git a/lib/libtriple/td-compat/td-demux-compat.h b/lib/libtriple/td-compat/td-demux-compat.h deleted file mode 100644 index 8feacfed3..000000000 --- a/lib/libtriple/td-compat/td-demux-compat.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * compatibility stuff for Tripledragon demux API - * - * (C) 2009 Stefan Seyfried - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#ifndef __td_demux_compat_h__ -#define __td_demux_compat_h__ - -#include -#include -// types -#define dmx_output_t OutDevice -#define dmx_pes_type_t PesType -#define dmx_sct_filter_params demux_filter_para -#define dmx_pes_filter_params demux_pes_para -#define pes_type pesType -// defines -#define DMX_FILTER_SIZE FILTER_LENGTH -#define DMX_ONESHOT XPDF_ONESHOT -#define DMX_CHECK_CRC 0 // TD checks CRC by default -#define DMX_IMMEDIATE_START XPDF_IMMEDIATE_START -#define DMX_OUT_DECODER OUT_DECODER -// ioctls -#define DMX_SET_FILTER DEMUX_FILTER_SET -#define DMX_SET_PES_FILTER DEMUX_FILTER_PES_SET -#define DMX_START DEMUX_START -#define DMX_STOP DEMUX_STOP -#define DMX_SET_BUFFER_SIZE DEMUX_SET_BUFFER_SIZE - -#endif /* __td_demux_compat_h__ */ diff --git a/lib/libtriple/td-compat/td-frontend-compat.h b/lib/libtriple/td-compat/td-frontend-compat.h deleted file mode 100644 index 46781ce89..000000000 --- a/lib/libtriple/td-compat/td-frontend-compat.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - * compatibility stuff for Tripledragon frontend API - * - * (C) 2009 Stefan Seyfried - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - */ - -#ifndef __td_frontend_compat_h__ -#define __td_frontend_compat_h__ - -#ifdef __cplusplus -extern "C" { -#endif - #include -#ifdef __cplusplus -} -#endif - -/* I know that those are different. But functions that get a - dvb_frontend_parameters struct passed on dbox/dreambox will most likely - get a tunersetup struct on TD, so it keeps the differences in headers - and function prototypes small. Of course, the functions itself will have - #ifdef TRIPLEDRAGON or similar... */ -#define dvb_frontend_parameters tunersetup - -/* compat stuff for settings.cpp */ -enum { - INVERSION_OFF, - INVERSION_ON, - INVERSION_AUTO -}; -typedef enum fe_code_rate { - FEC_NONE = 0, - FEC_1_2, - FEC_2_3, - FEC_3_4, - FEC_4_5, - FEC_5_6, - FEC_6_7, - FEC_7_8, - FEC_8_9, - FEC_AUTO -} fe_code_rate_t; - -enum td_code_rate { - TD_FEC_AUTO = 0, - TD_FEC_1_2, - TD_FEC_2_3, - TD_FEC_3_4, - TD_FEC_5_6, - TD_FEC_7_8 -}; - -typedef enum fe_sec_tone_mode { - SEC_TONE_ON, - SEC_TONE_OFF -} fe_sec_tone_mode_t; - -typedef enum fe_sec_voltage { - SEC_VOLTAGE_13, - SEC_VOLTAGE_18, - SEC_VOLTAGE_OFF -} fe_sec_voltage_t; - -typedef enum fe_sec_mini_cmd { - SEC_MINI_A, - SEC_MINI_B -} fe_sec_mini_cmd_t; - -struct dvb_diseqc_master_cmd { - unsigned char msg [6]; /* { framing, address, command, data [3] } */ - unsigned char msg_len; /* valid values are 3...6 */ -}; - -typedef enum fe_type { - FE_QPSK, - FE_QAM, - FE_OFDM, - FE_ATSC -} fe_type_t; - -struct dvb_frontend_info { -// char name[128]; - fe_type_t type; -#if 0 - __u32 frequency_min; - __u32 frequency_max; - __u32 frequency_stepsize; - __u32 frequency_tolerance; - __u32 symbol_rate_min; - __u32 symbol_rate_max; - __u32 symbol_rate_tolerance; /* ppm */ - __u32 notifier_delay; /* DEPRECATED */ - fe_caps_t caps; -#endif -}; - -struct dvb_frontend_event { - fe_status_t status; - tunersetup parameters; -}; - -#ifdef _DVBFRONTEND_H_ -#error _DVBFRONTEND_H_ included -#endif - -#endif /* __td_frontend_compat_h__ */ diff --git a/lib/libtriple/td-compat/td-value-compat.h b/lib/libtriple/td-compat/td-value-compat.h deleted file mode 100644 index f7bb9523c..000000000 --- a/lib/libtriple/td-compat/td-value-compat.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * compatibility stuff for conversion of Tripledragon API values to DVB API - * and vice versa - * - * (C) 2009 Stefan Seyfried - * - * Released under the GPL V2. - */ - -#ifndef _td_value_compat_ -#define _td_value_compat_ - -#undef FE_GET_INFO -#undef FE_READ_BER -#undef FE_READ_SIGNAL_STRENGTH -#undef FE_READ_SNR -#undef FE_READ_UNCORRECTED_BLOCKS -#undef FE_GET_EVENT -#undef FE_READ_STATUS -#undef FE_SET_PROPERTY -#undef FE_GET_EVENT -#undef FE_GET_EVENT -#undef FE_SET_PROPERTY -#undef FE_SET_TONE -#undef FE_ENABLE_HIGH_LNB_VOLTAGE -#undef FE_SET_VOLTAGE -#undef FE_DISEQC_SEND_MASTER_CMD -#undef FE_DISEQC_SEND_BURST -/* hack, linux/dvb/frontend.h already defines fe_status */ -#define fe_status td_fe_status -#define fe_status_t td_fe_status_t -#define FE_HAS_SIGNAL TD_FE_HAS_SIGNAL -#define FE_HAS_CARRIER TD_FE_HAS_CARRIER -#define FE_HAS_VITERBI TD_FE_HAS_VITERBI -#define FE_HAS_SYNC TD_FE_HAS_SYNC -#define FE_HAS_LOCK TD_FE_HAS_LOCK -#define FE_TIMEDOUT TD_FE_TIMEDOUT -#define FE_REINIT TD_FE_REINIT -#include -#undef fe_status -#undef fe_status_t -#undef FE_HAS_SIGNAL -#undef FE_HAS_CARRIER -#undef FE_HAS_VITERBI -#undef FE_HAS_SYNC -#undef FE_HAS_LOCK -#undef FE_TIMEDOUT -#undef FE_REINIT -enum td_code_rate { - TD_FEC_AUTO = 0, - TD_FEC_1_2, - TD_FEC_2_3, - TD_FEC_3_4, - TD_FEC_5_6, - TD_FEC_7_8 -}; - -static inline unsigned int dvbfec2tdfec(fe_code_rate_t fec) -{ - switch (fec) { - case FEC_1_2: // FEC_1_2 ... FEC_3_4 are equal to TD_FEC_1_2 ... TD_FEC_3_4 - case FEC_2_3: - case FEC_3_4: - return (unsigned int)fec; - case FEC_5_6: - return TD_FEC_5_6; - case FEC_7_8: - return TD_FEC_7_8; - default: - break; - } - return TD_FEC_AUTO; -} - -static inline fe_code_rate_t tdfec2dvbfec(unsigned int tdfec) -{ - switch (tdfec) - { - case TD_FEC_1_2: - case TD_FEC_2_3: - case TD_FEC_3_4: - return (fe_code_rate_t)tdfec; - case TD_FEC_5_6: - return FEC_5_6; - case TD_FEC_7_8: - return FEC_7_8; - default: - break; - } - return FEC_AUTO; -} - -#endif /* _td_value_compat_ */ diff --git a/lib/libtriple/td-compat/td-video-compat.h b/lib/libtriple/td-compat/td-video-compat.h deleted file mode 100644 index 137a3467a..000000000 --- a/lib/libtriple/td-compat/td-video-compat.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * compatibility stuff for Tripledragon video API - * - * (C) 2009 Stefan Seyfried - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef __td_video_compat_h__ -#define __td_video_compat_h__ - -#include -// types -#define video_format_t vidDispSize_t -#define video_displayformat_t vidDispMode_t -typedef enum { - VIDEO_SOURCE_DEMUX = VID_SOURCE_DEMUX, - VIDEO_SOURCE_MEMORY = VID_SOURCE_MEMORY -} video_stream_source_t; -typedef enum { - VIDEO_STOPPED, /* Video is stopped */ - VIDEO_PLAYING, /* Video is currently playing */ - VIDEO_FREEZED /* Video is freezed */ -} video_play_state_t; -//#define video_play_state_t vidState_t -// ioctls -#define VIDEO_SET_SYSTEM MPEG_VID_SET_DISPFMT -#define VIDEO_SET_FORMAT MPEG_VID_SET_DISPSIZE -#define VIDEO_SET_DISPLAY_FORMAT MPEG_VID_SET_DISPMODE -#define VIDEO_SELECT_SOURCE MPEG_VID_SELECT_SOURCE -#define VIDEO_PLAY MPEG_VID_PLAY -#define VIDEO_STOP MPEG_VID_STOP -#define VIDEO_SET_BLANK MPEG_VID_SET_BLANK - -#endif /* __td_video_compat_h__ */ diff --git a/src/Makefile.am b/src/Makefile.am index de465fc64..784fe9b1c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -167,10 +167,3 @@ bin_PROGRAMS += mdev_helper mdev_helper_SOURCES = mdev_helper.cpp endif -if BOXTYPE_TRIPLE -neutrino_LDADD += \ - $(top_builddir)/lib/libtriple/libtriple.a \ - @DIRECTFB_LIBS@ \ - $(top_builddir)/src/lcddisplay/liblcddisplay.a -endif - From adee2844cebeab122e500851aed18fae6ffa4d02 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 23 Oct 2016 12:23:05 +0200 Subject: [PATCH 05/24] configure: remove unused LIBCS_* variables (forward ported neutrino-mp commit 45b4bb0488d) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f6d09bd0ef42536ba4f43cd12568ce760ca3e32d Author: Stefan Seyfried Date: 2016-10-23 (Sun, 23 Oct 2016) --- configure.ac | 18 +----------------- src/Makefile.am | 2 -- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/configure.ac b/configure.ac index f7d91397e..f4d28a7ba 100644 --- a/configure.ac +++ b/configure.ac @@ -233,24 +233,8 @@ else HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__file__="\"$(subst $(srcdir)/,,$(abspath $<))\""' HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__path_file__="\"$(subst $(top_srcdir)/,,$(abspath $<))\""' fi -# -# Check for libtdservicedb - the new one - for testing only -# -#CSL_VERSION=0.0.1 -#FCSL_VERSION=`$PKG_CONFIG --modversion libcoolstream` -#AC_MSG_CHECKING(for package libcoolstream >= $CSL_VERSION) -#if $PKG_CONFIG --atleast-version $CSL_VERSION libcoolstream ; then - #AC_MSG_RESULT(found (version $FCSL_VERSION)) - #LIBCS_CFLAGS=`$PKG_CONFIG --cflags libcoolstream` - #LIBCS_LIBS=`$PKG_CONFIG --libs libcoolstream` -#else - #AC_MSG_ERROR([ -#*** libcoolstream $CSL_VERSION or newer is required! *** - #]) -#fi + AC_SUBST(HWLIB_CFLAGS) -AC_SUBST(LIBCS_CFLAGS) -AC_SUBST(LIBCS_LIBS) AC_SUBST(FREETYPE_CFLAGS) AC_SUBST(FREETYPE_LIBS) AC_SUBST(VORBISIDEC_CFLAGS) diff --git a/src/Makefile.am b/src/Makefile.am index 784fe9b1c..7d67e67cb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,7 +22,6 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib/libupnpclient \ @SIGC_CFLAGS@ \ @FREETYPE_CFLAGS@ \ - @LIBCS_CFLAGS@ \ @AVFORMAT_CFLAGS@ \ @HWLIB_CFLAGS@ @@ -116,7 +115,6 @@ neutrino_LDADD = \ @FREETYPE_LIBS@ \ @PNG_LIBS@ \ @BLURAY_LIBS@ \ - @LIBCS_LIBS@ \ @AVFORMAT_LIBS@ \ @AVUTIL_LIBS@ \ @AVCODEC_LIBS@ \ From 740e2b9257b0fabed38a422867d28fef3cd73309 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 27 Apr 2013 22:02:02 +0200 Subject: [PATCH 06/24] acinclude: better fix for pkg-config 0.28 behaviour Old pkg-config always retured a non-empty string for --cflags. It always contained at least one bogus space. New pkg-config does not do that. Do not rely on --cflags being non-empty. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4d4dad453603e6d4e9f098fa9164de43c66ee0f8 Author: Stefan Seyfried Date: 2013-04-27 (Sat, 27 Apr 2013) --- acinclude.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 38323b1d9..664b0c8cd 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -317,6 +317,7 @@ if $PKG_CONFIG --exists "$2" ; then AC_MSG_RESULT(yes) $1_CFLAGS=$($PKG_CONFIG --cflags "$2") $1_LIBS=$($PKG_CONFIG --libs "$2") + $1_EXISTS=yes else AC_MSG_RESULT(no) fi @@ -327,7 +328,7 @@ AC_SUBST($1_LIBS) AC_DEFUN([TUXBOX_APPS_LIB_PKGCONFIG],[ _TUXBOX_APPS_LIB_PKGCONFIG($1,$2) -if test -z "$$1_CFLAGS" ; then +if test x"$$1_EXISTS" != xyes; then AC_MSG_ERROR([could not find package $2]); fi ]) From 185fa754bbc17decf909e0de4abad56a1c0fea66 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 11 May 2013 13:45:58 +0200 Subject: [PATCH 07/24] acinclude: fix variable expansion issues Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/edbe92bf0c630e600b3de5e558012dee2126b387 Author: Stefan Seyfried Date: 2013-05-11 (Sat, 11 May 2013) --- acinclude.m4 | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 664b0c8cd..e50254329 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -82,21 +82,33 @@ check_path () { ]) +dnl expand nested ${foo}/bar +AC_DEFUN([TUXBOX_EXPAND_VARIABLE],[__$1="$2" + for __CNT in false false false false true; do dnl max 5 levels of indirection + + $1=`eval echo "$__$1"` + echo ${$1} | grep -q '\$' || break # 'grep -q' is POSIX, exit if no $ in variable + __$1="${$1}" + done + $__CNT && AC_MSG_ERROR([can't expand variable $1=$2]) dnl bail out if we did not expand +]) + AC_DEFUN([TUXBOX_APPS_DIRECTORY_ONE],[ AC_ARG_WITH($1,[ $6$7 [[PREFIX$4$5]]],[ _$2=$withval if test "$TARGET" = "cdk"; then - $2=`eval echo "$TARGET_PREFIX$withval"` + $2=`eval echo "$TARGET_PREFIX$withval"` # no indirection possible IMNSHO else $2=$withval fi TARGET_$2=${$2} ],[ - $2="\${$3}$5" + # RFC 1925: "you can always add another level of indirection..." + TUXBOX_EXPAND_VARIABLE($2,"${$3}$5") if test "$TARGET" = "cdk"; then - _$2=`eval echo "${target$3}$5"` + TUXBOX_EXPAND_VARIABLE(_$2,"${target$3}$5") else - _$2=`eval echo "${$3}$5"` + _$2=${$2} fi TARGET_$2=$_$2 ]) From 8e95fe17f38cafcce330ac1b09ccd80e161ad766 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 22 Oct 2016 11:50:38 +0200 Subject: [PATCH 08/24] fix Makefiles to include SIGC_CFLAGS now that the framebuffer class includes libsigc++, the path to it must be known to all parts using framebuffer.h Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/944a4e4ecd51c9412c55870f8d4d344ebcb48a27 Author: Stefan Seyfried Date: 2016-10-22 (Sat, 22 Oct 2016) --- lib/libdvbsub/Makefile.am | 1 + lib/libtuxtxt/Makefile.am | 1 + src/zapit/src/Makefile.am | 1 + 3 files changed, 3 insertions(+) diff --git a/lib/libdvbsub/Makefile.am b/lib/libdvbsub/Makefile.am index 6ac627d08..aa9082181 100644 --- a/lib/libdvbsub/Makefile.am +++ b/lib/libdvbsub/Makefile.am @@ -4,6 +4,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/zapit/include \ @AVFORMAT_CFLAGS@ \ + @SIGC_CFLAGS@ \ @HWLIB_CFLAGS@ AM_CPPFLAGS += -fno-rtti -fno-exceptions diff --git a/lib/libtuxtxt/Makefile.am b/lib/libtuxtxt/Makefile.am index 7ea232ad1..5d24e483e 100644 --- a/lib/libtuxtxt/Makefile.am +++ b/lib/libtuxtxt/Makefile.am @@ -4,6 +4,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/zapit/include \ $(FREETYPE_CFLAGS) \ + @SIGC_CFLAGS@ \ @HWLIB_CFLAGS@ AM_CPPFLAGS += -fno-rtti -fno-exceptions diff --git a/src/zapit/src/Makefile.am b/src/zapit/src/Makefile.am index a1dac17bc..0130f3a8a 100644 --- a/src/zapit/src/Makefile.am +++ b/src/zapit/src/Makefile.am @@ -11,6 +11,7 @@ AM_CPPFLAGS += \ -I$(top_srcdir)/lib/libeventserver \ -I$(top_srcdir)/lib/xmltree \ @FREETYPE_CFLAGS@ \ + @SIGC_CFLAGS@ \ @HWLIB_CFLAGS@ noinst_LIBRARIES = libzapit.a From 2dc1461e12ea2edf968d18ae7436dbd5070ddac4 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 26 Jan 2015 13:52:56 +0100 Subject: [PATCH 09/24] make curl and freetype2 detection crosscompile-friendly Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a40b58fa20e03245fd5a69c968e6c74c6f55eacd Author: Stefan Seyfried Date: 2015-01-26 (Mon, 26 Jan 2015) --- configure.ac | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index f4d28a7ba..bac79fa15 100644 --- a/configure.ac +++ b/configure.ac @@ -89,8 +89,16 @@ fi AM_CONDITIONAL(USE_TREMOR, test "$TREMOR" = "yes") # TUXBOX_APPS_LIB_PKGCONFIG(OPENSSL,openssl) -TUXBOX_APPS_LIB_CONFIG(CURL,curl-config) -TUXBOX_APPS_LIB_CONFIG(FREETYPE,freetype-config) +TUXBOX_APPS_LIB_PKGCONFIG(CURL,libcurl) +TUXBOX_APPS_LIB_PKGCONFIG(FREETYPE,freetype2) +# fallback to curl-config (which is ugly for cross-compilation) +if test -z "$CURL_LIBS" -a -z "$CURL_CFLAGS"; then + TUXBOX_APPS_LIB_CONFIG(CURL,curl-config) +fi +# fallback to freetype-config (which is ugly for cross-compilation) +if test -z "$FREETYPE_LIBS" -a -z "$FREETYPE_CFLAGS"; then + TUXBOX_APPS_LIB_CONFIG(FREETYPE,freetype-config) +fi TUXBOX_APPS_LIB_PKGCONFIG(PNG,libpng) TUXBOX_APPS_LIB_PKGCONFIG(AVFORMAT,libavformat) From 7ed3ec4f205579c83e2a48e630cae1dbde9ebdee Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 23 Oct 2016 17:43:16 +0200 Subject: [PATCH 10/24] update_ext: fix build with glibc > 2.21 (open needs mode) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b46420506f7fa462b1a267e5bb5ed1bb7e6535a1 Author: Stefan Seyfried Date: 2016-10-23 (Sun, 23 Oct 2016) --- src/gui/update_ext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/update_ext.cpp b/src/gui/update_ext.cpp index c946c89b5..3e6246d36 100644 --- a/src/gui/update_ext.cpp +++ b/src/gui/update_ext.cpp @@ -324,7 +324,7 @@ bool CExtUpdate::applySettings() fd2 = -1; int tmpCount = 0; while (fd2 < 0) { - fd2 = open(mtdBlockFileName.c_str(), O_WRONLY); + fd2 = open(mtdBlockFileName.c_str(), O_WRONLY, 00644); tmpCount++; if (tmpCount > 3) break; @@ -375,7 +375,7 @@ bool CExtUpdate::applySettings() if (fd1 < 0) return ErrorReset(RESET_UNLOAD | DELETE_MTDBUF, "cannot read mtdBlock"); fsize = mtdRamSize; - fd2 = open(imgFilename.c_str(), O_WRONLY | O_CREAT); + fd2 = open(imgFilename.c_str(), O_WRONLY | O_CREAT, 00644); if (fd2 < 0) return ErrorReset(RESET_UNLOAD | CLOSE_FD1 | DELETE_MTDBUF, "cannot open image file: ", imgFilename); while(fsize > 0) { From c246af077c295279398fcde869aa6d83190b1d01 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 23 Oct 2016 17:45:58 +0200 Subject: [PATCH 11/24] channellist: fix linking without --enable-pip Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/830b5c2aa75e833afc994774f52b1f32b0493ecc Author: Stefan Seyfried Date: 2016-10-23 (Sun, 23 Oct 2016) --- src/gui/channellist.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 5bb4f06ef..c6c9bafa3 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1080,10 +1080,12 @@ bool CChannelList::checkLockStatus(neutrino_msg_data_t data, bool pip) out: if (startvideo) { if(pip) { +#ifdef ENABLE_PIP if (CNeutrinoApp::getInstance()->StartPip((*chanlist)[selected]->getChannelID())) { calcSize(); paintBody(); } +#endif } else g_RemoteControl->startvideo(); return true; From 4b1d21489fbd46b71bb135820ee9e0a125cec6a3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 23 Oct 2016 21:45:43 +0200 Subject: [PATCH 12/24] colors: change color for marked items under cursor; user's request Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/850205f898b5e35ac978a49fe7491899e7157434 Author: vanhofen Date: 2016-10-23 (Sun, 23 Oct 2016) Origin message was: ------------------ - colors: change color for marked items under cursor; user's request --- src/gui/color.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/color.cpp b/src/gui/color.cpp index 56382340d..cbc0873e0 100644 --- a/src/gui/color.cpp +++ b/src/gui/color.cpp @@ -233,8 +233,8 @@ void getItemColors(fb_pixel_t &t, fb_pixel_t &b, bool selected, bool marked, boo { if (selected && marked) { - t = COL_MENUCONTENTSELECTED_TEXT_PLUS_2; - b = COL_MENUCONTENTSELECTED_PLUS_2; + t = COL_MENUCONTENTSELECTED_TEXT; + b = COL_MENUCONTENTSELECTED_PLUS_0; return; } From 15ef2615419f46c67abccded8ebb6b4d34bfea83 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 23 Oct 2016 21:51:34 +0200 Subject: [PATCH 13/24] moviebrowser: show minutes in two-digits format Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4d93168cf64619c3433f69f2646513d3aa246a85 Author: vanhofen Date: 2016-10-23 (Sun, 23 Oct 2016) Origin message was: ------------------ - moviebrowser: show minutes in two-digits format --- src/gui/moviebrowser/mb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index fe136c50b..11f4c5156 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3430,7 +3430,7 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = str_tmp; break; case MB_INFO_LENGTH: // = 18, - snprintf(str_tmp, sizeof(str_tmp),"%dh %dm", movie_info.length/60, movie_info.length%60); + snprintf(str_tmp, sizeof(str_tmp),"%dh %02dm", movie_info.length/60, movie_info.length%60); *item_string = str_tmp; break; case MB_INFO_SIZE: // = 19, From 0f962fef46a0a8c33eab189ad852a10ce98dc732 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 22 Oct 2016 12:02:10 +0200 Subject: [PATCH 14/24] record, streamts: use modern AV_CODEC_ID enums this allows to build with current ffmpeg Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5bf115db805842b5ec55374b379d267d4b3fe15a Author: Stefan Seyfried Date: 2016-10-22 (Sat, 22 Oct 2016) --- src/driver/record.cpp | 2 +- src/driver/streamts.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 07887096c..158476132 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -2172,7 +2172,7 @@ void CStreamRec::run() continue; AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; - if (bsfc && codec->codec_id == CODEC_ID_H264) { + if (bsfc && codec->codec_id == AV_CODEC_ID_H264) { AVPacket newpkt = pkt; if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index a917d2352..f293f0e7e 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -896,7 +896,7 @@ void CStreamStream::run() continue; AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; - if (bsfc && codec->codec_id == CODEC_ID_H264 ) { + if (bsfc && codec->codec_id == AV_CODEC_ID_H264 ) { AVPacket newpkt = pkt; if (av_bitstream_filter_filter(bsfc, codec, NULL, &newpkt.data, &newpkt.size, pkt.data, pkt.size, pkt.flags & AV_PKT_FLAG_KEY) >= 0) { From 3ac22e81b2c12415659bcbcc1defb83683039c8b Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 22 Oct 2016 12:08:57 +0200 Subject: [PATCH 15/24] driver/record: make CStreamRec non-public CStreamRec is only used inside CRecordManager::Record, so it can be implemented completely inside record.cpp. The positive side effect is that avformat.h is not included everywhere (e.g. from moviebrowser/mb.h) and thus AVFORMAT_CFLAGS does not need to be added everywhere to fix build failures. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b5cb683048e474864473704a4ed69265a2977c53 Author: Stefan Seyfried Date: 2016-10-22 (Sat, 22 Oct 2016) --- src/driver/record.cpp | 31 +++++++++++++++++++++++++++++++ src/driver/record.h | 4 ++++ 2 files changed, 35 insertions(+) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 158476132..7dd3183ab 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -64,6 +64,37 @@ #include #include +extern "C" { +#include +} + +class CStreamRec : public CRecordInstance, OpenThreads::Thread +{ + private: + AVFormatContext *ifcx; + AVFormatContext *ofcx; + AVBitStreamFilterContext *bsfc; + bool stopped; + bool interrupt; + time_t time_started; + int stream_index; + + void GetPids(CZapitChannel * channel); + void FillMovieInfo(CZapitChannel * channel, APIDList & apid_list); + bool Start(); + + void Close(); + bool Open(CZapitChannel * channel); + void run(); + void WriteHeader(uint32_t duration); + public: + CStreamRec(const CTimerd::RecordingInfo * const eventinfo, std::string &dir, bool timeshift = false, bool stream_vtxt_pid = false, bool stream_pmt_pid = false, bool stream_subtitle_pids = false); + ~CStreamRec(); + record_error_msg_t Record(); + bool Stop(bool remove_event = true); + static int Interrupt(void * data); +}; + /* TODO: * nextRecording / pending recordings - needs testing * check/fix askUserOnTimerConflict gui/timerlist.cpp -> getOverlappingTimers lib/timerdclient/timerdclient.cpp diff --git a/src/driver/record.h b/src/driver/record.h index d5d5c4495..476f92de8 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -42,9 +42,11 @@ #include #include +#if 0 extern "C" { #include } +#endif #define REC_MAX_APIDS 10 #define FILENAMEBUFFERSIZE 1024 @@ -237,6 +239,7 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/ #endif }; +#if 0 class CStreamRec : public CRecordInstance, OpenThreads::Thread { private: @@ -263,5 +266,6 @@ class CStreamRec : public CRecordInstance, OpenThreads::Thread bool Stop(bool remove_event = true); static int Interrupt(void * data); }; +#endif #endif From 241bcea831b253e414d95c743c88004ca13116f9 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 22 Oct 2016 12:22:06 +0200 Subject: [PATCH 16/24] helpers.cpp: include fontrenderer.h if Font class is used, the header should be included, too :-) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/645da6483981dccbccb80e54ea09a3120a9f9060 Author: Stefan Seyfried Date: 2016-10-22 (Sat, 22 Oct 2016) --- src/system/helpers.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 009dd1249..59176bc70 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -45,6 +45,7 @@ #include #include "debug.h" #include +#include #include #include using namespace std; From b8b787b42b96f56f946b7868ac0366b906fe2a61 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 22 Oct 2016 12:23:09 +0200 Subject: [PATCH 17/24] system/helpers: allow to build with c++11 compilers Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ae345d11d30779acb9877643919507d1bcb07c9a Author: Stefan Seyfried Date: 2016-10-22 (Sat, 22 Oct 2016) --- src/system/helpers.cpp | 2 ++ src/system/helpers.h | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 59176bc70..3f894ed5b 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -1125,6 +1125,7 @@ std::vector split(const std::string &s, char delim) return vec; } +#if __cplusplus <= 201103L std::string to_string(int i) { std::stringstream s; @@ -1166,6 +1167,7 @@ std::string to_string(unsigned long long i) s << i; return s.str(); } +#endif /** * C++ version 0.4 std::string style "itoa": diff --git a/src/system/helpers.h b/src/system/helpers.h index e9b860d04..0011c72eb 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -117,12 +117,17 @@ class CFileHelpers uint32_t GetWidth4FB_HW_ACC(const uint32_t _x, const uint32_t _w, const bool max=true); +#if __cplusplus <= 201103L std::string to_string(int); std::string to_string(unsigned int); std::string to_string(long); std::string to_string(unsigned long); std::string to_string(long long); std::string to_string(unsigned long long); +#else +/* hack... */ +#define to_string(x) std::to_string(x) +#endif std::string itoa(int value, int base); From 0897cd1c24916506a823777325c9f74741c1a87d Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Thu, 20 Oct 2016 09:11:39 +0200 Subject: [PATCH 18/24] configure: fix short-filename logic if configure was not called from absolute path, detection would fail and huge filenames would be included in binary (noticed in yocto krogoth release) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b8cf8167f4cd540c7b4077a0359ddc534767abce Author: Stefan Seyfried Date: 2016-10-20 (Thu, 20 Oct 2016) --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index bac79fa15..1f553e6e0 100644 --- a/configure.ac +++ b/configure.ac @@ -234,7 +234,7 @@ fi fi # hack to define a short filename also for out-of-tree build -if test `dirname $0` = `pwd`; then +if test `dirname $0` = `pwd` || test "$0" = ./configure; then HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__file__=__FILE__' HWLIB_CFLAGS="$HWLIB_CFLAGS "'-D__path_file__=__FILE__' else From afb74c79d878e8960eff2542a6bf3d552821a697 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 24 Oct 2016 13:41:23 +0200 Subject: [PATCH 19/24] helpers: 201103L have to_string Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/80f7d0a299b2e8f3172b5161fc4b007daa03faf1 Author: Jacek Jendrzej Date: 2016-10-24 (Mon, 24 Oct 2016) --- src/system/helpers.cpp | 2 +- src/system/helpers.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 3f894ed5b..00a8bacbb 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -1125,7 +1125,7 @@ std::vector split(const std::string &s, char delim) return vec; } -#if __cplusplus <= 201103L +#if __cplusplus < 201103L std::string to_string(int i) { std::stringstream s; diff --git a/src/system/helpers.h b/src/system/helpers.h index 0011c72eb..7cd1fef20 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -117,7 +117,7 @@ class CFileHelpers uint32_t GetWidth4FB_HW_ACC(const uint32_t _x, const uint32_t _w, const bool max=true); -#if __cplusplus <= 201103L +#if __cplusplus < 201103L std::string to_string(int); std::string to_string(unsigned int); std::string to_string(long); From 6f122b3b3f005578f0fa1bd40b54c08be0442c53 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 25 Oct 2016 11:06:12 +0200 Subject: [PATCH 20/24] moviebrowser: fix max_width in info-box Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/301f31267382f07e9f48c13d9b92ba885f04508a Author: vanhofen Date: 2016-10-25 (Tue, 25 Oct 2016) Origin message was: ------------------ - moviebrowser: fix max_width in info-box --- src/gui/moviebrowser/mb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 11f4c5156..20a3ff6fd 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1336,7 +1336,7 @@ void CMovieBrowser::refreshMovieInfo(void) } if (pic) flogo_w = pic->getWidth(); - m_pcInfo->setText(&m_movieSelectionHandler->epgInfo2, m_cBoxFrameInfo.iWidth - flogo_w - 24); + m_pcInfo->setText(&m_movieSelectionHandler->epgInfo2, m_cBoxFrameInfo.iWidth - flogo_w - (flogo_w ? 24 : 0)); if (pic) pic->paint(CC_SAVE_SCREEN_NO); } From 39f362b0c06bffff612676b01958e8d0bb2dccb2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 25 Oct 2016 11:06:12 +0200 Subject: [PATCH 21/24] textbox: fix round corners/scrollbar handling Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/be9143a511758d94ebdb3505a5ccd4f870421653 Author: vanhofen Date: 2016-10-25 (Tue, 25 Oct 2016) Origin message was: ------------------ - textbox: fix round corners/scrollbar handling --- src/gui/widget/textbox.cpp | 66 ++++++++++++++++++++++++++++++-------- 1 file changed, 52 insertions(+), 14 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 93358b8e4..a4f719240 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -296,9 +296,9 @@ void CTextBox::initFramesRel(void) if(m_nMode & SCROLL) { m_cFrameScrollRel.iX = m_cFrame.iWidth - SCROLL_FRAME_WIDTH; - m_cFrameScrollRel.iY = m_cFrameTextRel.iY; + m_cFrameScrollRel.iY = m_cFrameTextRel.iY + m_nBgRadius; m_cFrameScrollRel.iWidth = SCROLL_FRAME_WIDTH; - m_cFrameScrollRel.iHeight = m_cFrameTextRel.iHeight; + m_cFrameScrollRel.iHeight = m_cFrameTextRel.iHeight - 2*m_nBgRadius; } else { @@ -494,25 +494,44 @@ void CTextBox::refreshScroll(void) if( frameBuffer == NULL) return; + /* + FIXME: Find right conditions. + So long let's paint scrollbar background in every case + to avoid transparent spaces in scrollbar corners. + */ + if (1) + { + /* + Why we paint scrollbar background seperately? + So we have to reduce roundings from the left side of background. + */ + int BgRadiusType = CORNER_NONE; + if (m_nBgRadiusType == CORNER_ALL) + BgRadiusType = CORNER_RIGHT; + else if (m_nBgRadiusType == CORNER_TOP) + BgRadiusType = CORNER_TOP_RIGHT; + else if (m_nBgRadiusType == CORNER_BOTTOM) + BgRadiusType = CORNER_BOTTOM_RIGHT; + + frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrame.iY, + m_cFrameScrollRel.iWidth, m_cFrame.iHeight, + m_textBackgroundColor, m_nBgRadius, BgRadiusType); + } + if (m_nNrOfPages > 1) { frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, - COL_SCROLLBAR_PASSIVE_PLUS_0); - unsigned int marker_size = m_cFrameScrollRel.iHeight / m_nNrOfPages; - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX, - m_cFrameScrollRel.iY + m_nCurrentPage * marker_size+m_cFrame.iY, + COL_SCROLLBAR_PASSIVE_PLUS_0, RADIUS_MIN); + unsigned int marker_size = (m_cFrameScrollRel.iHeight - 2*SCROLL_MARKER_BORDER) / m_nNrOfPages; + frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER + m_cFrame.iX, + m_cFrameScrollRel.iY + SCROLL_MARKER_BORDER + m_nCurrentPage * marker_size + m_cFrame.iY, m_cFrameScrollRel.iWidth - 2*SCROLL_MARKER_BORDER, - marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0); + marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_MIN); m_has_scrolled = true; } else - { - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, - m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, - m_textBackgroundColor); m_has_scrolled = false; - } } //evaluate comparsion between old and current properties WITHOUT text contents, return true if found changes @@ -570,6 +589,12 @@ void CTextBox::refreshText(void) int dx = m_old_cText != m_cText || m_nNrOfPages>1 ? m_cFrameTextRel.iWidth : m_nMaxTextWidth; int dy = m_cFrameTextRel.iHeight; + //avoid artefacts in transparent cornes + /* + This happens, when text width is smaller then the radius width. + */ + dx = std::max(dx, 2*m_nBgRadius); + //find changes bool has_changed = hasChanged(&ax, &ay, &dx, &dy); @@ -604,10 +629,23 @@ void CTextBox::refreshText(void) bool allow_paint_bg = (m_old_cText != m_cText || has_changed || m_has_scrolled); if (m_nPaintBackground && !m_SaveScreen){ clearScreenBuffer(); - if (allow_paint_bg){ + if (allow_paint_bg) + { + /* + Why we paint scrollbar background seperately? + So we have to reduce roundings from the right side of background. + */ + int BgRadiusType = CORNER_NONE; + if (m_nBgRadiusType == CORNER_ALL) + BgRadiusType = CORNER_LEFT; + else if (m_nBgRadiusType == CORNER_TOP) + BgRadiusType = CORNER_TOP_LEFT; + else if (m_nBgRadiusType == CORNER_BOTTOM) + BgRadiusType = CORNER_BOTTOM_LEFT; + //TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__); //paint full background only on new text, otherwise paint required background - frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, m_nBgRadiusType); + frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, BgRadiusType); } } else{ From 3984ee312ac4d82011f97d1f05c31d98377071bd Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 25 Oct 2016 11:06:12 +0200 Subject: [PATCH 22/24] moviebrowser: add spacer row to last play/rec windows Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/46297266b2c8f861a29b2ff73487f9aa73b8ff51 Author: vanhofen Date: 2016-10-25 (Tue, 25 Oct 2016) Origin message was: ------------------ - moviebrowser: add spacer row to last play/rec windows --- src/gui/moviebrowser/mb.cpp | 30 +++++++++++++++++++----------- src/gui/moviebrowser/mb.h | 16 +++++++--------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 20a3ff6fd..c9abdc12c 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -272,7 +272,7 @@ void CMovieBrowser::clearListLines() m_browserListLines.Icon.clear(); m_browserListLines.marked.clear(); - for (int i = 0; i < 2; i++) + for (int i = 0; i < 3; i++) { m_recordListLines.lineArray[i].clear(); m_playListLines.lineArray[i].clear(); @@ -536,21 +536,29 @@ void CMovieBrowser::initRows(void) { //TRACE("[mb]->%s\n", __func__); + /* + The "last played" / "last recorded" windows have only half the width, so + multiply the relative width with 2 and add 1 percent for safety to date row. + This addition is just usefull for l a r g e font settings. + */ + /***** Last Play List **************/ - m_settings.lastPlayRowNr = 2; + m_settings.lastPlayRowNr = 3; m_settings.lastPlayRow[0] = MB_INFO_TITLE; - m_settings.lastPlayRow[1] = MB_INFO_PREVPLAYDATE; - /* the "last played" / "last recorded" windows have only half the width, so - multiply the relative width with 2 */ - m_settings.lastPlayRowWidth[1] = m_defaultRowWidth[m_settings.lastPlayRow[1]] * 2 + 1; - m_settings.lastPlayRowWidth[0] = 100 - m_settings.lastPlayRowWidth[1]; + m_settings.lastPlayRow[1] = MB_INFO_SPACER; + m_settings.lastPlayRow[2] = MB_INFO_PREVPLAYDATE; + m_settings.lastPlayRowWidth[2] = m_defaultRowWidth[m_settings.lastPlayRow[2]] * 2 + 1; + m_settings.lastPlayRowWidth[1] = m_defaultRowWidth[m_settings.lastPlayRow[1]] * 2; + m_settings.lastPlayRowWidth[0] = 100 - m_settings.lastPlayRowWidth[1] - m_settings.lastPlayRowWidth[2]; /***** Last Record List **************/ - m_settings.lastRecordRowNr = 2; + m_settings.lastRecordRowNr = 3; m_settings.lastRecordRow[0] = MB_INFO_TITLE; - m_settings.lastRecordRow[1] = MB_INFO_RECORDDATE; - m_settings.lastRecordRowWidth[1] = m_defaultRowWidth[m_settings.lastRecordRow[1]] * 2 + 1; - m_settings.lastRecordRowWidth[0] = 100 - m_settings.lastRecordRowWidth[1]; + m_settings.lastRecordRow[1] = MB_INFO_SPACER; + m_settings.lastRecordRow[2] = MB_INFO_RECORDDATE; + m_settings.lastRecordRowWidth[2] = m_defaultRowWidth[m_settings.lastRecordRow[2]] * 2 + 1; + m_settings.lastRecordRowWidth[1] = m_defaultRowWidth[m_settings.lastRecordRow[1]] * 2; + m_settings.lastRecordRowWidth[0] = 100 - m_settings.lastRecordRowWidth[1] - m_settings.lastRecordRowWidth[2]; } void CMovieBrowser::defaultSettings(MB_SETTINGS* /*settings*/) diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 41dfc1d7d..aefffc146 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -67,10 +67,6 @@ #define MAX_BROWSER_FRAME_HEIGHT 80 // void strReplace(std::string& orig, const char* fstr, const std::string &rstr); - - - - #define MB_MAX_ROWS LF_MAX_ROWS #define MB_MAX_DIRS NETWORK_NFS_NR_OF_ENTRIES /* MB_SETTINGS to be stored in g_settings anytime ....*/ @@ -94,22 +90,24 @@ typedef struct int browser_serie_mode; int serie_auto_create; + /* these variables are used for the listframes */ int browserFrameHeight; int browserRowNr; - MB_INFO_ITEM browserRowItem[MB_MAX_ROWS];//MB_INFO_ITEM + MB_INFO_ITEM browserRowItem[MB_MAX_ROWS]; int browserRowWidth[MB_MAX_ROWS]; // to be added to config later int lastPlayMaxItems; int lastPlayRowNr; - MB_INFO_ITEM lastPlayRow[2]; - int lastPlayRowWidth[2]; + MB_INFO_ITEM lastPlayRow[3]; + int lastPlayRowWidth[3]; int lastRecordMaxItems; int lastRecordRowNr; - MB_INFO_ITEM lastRecordRow[2]; - int lastRecordRowWidth[2]; + MB_INFO_ITEM lastRecordRow[3]; + int lastRecordRowWidth[3]; + int ytmode; int ytorderby; int ytresults; From 5e95ad4bb7f3c1db45de8d7fc11c23dad8a14750 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 25 Oct 2016 11:06:12 +0200 Subject: [PATCH 23/24] listframe/moviebrowser: add round corners to scrollbar Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a8c4bdb7de0db298beb4c612b8a4f504f5732619 Author: vanhofen Date: 2016-10-25 (Tue, 25 Oct 2016) Origin message was: ------------------ - listframe/moviebrowser: add round corners to scrollbar --- src/gui/widget/listframe.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index 3e34451d9..01cbcd52c 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -368,21 +368,27 @@ void CListFrame::refreshScroll(void) if( frameBuffer == NULL) return; if(!(m_nMode & SCROLL)) return; - if (m_nNrOfPages > 1) - { - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, - m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_SCROLLBAR_PASSIVE_PLUS_0); - unsigned int marker_size = m_cFrameScrollRel.iHeight / m_nNrOfPages; - frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX, - m_cFrameScrollRel.iY + m_nCurrentPage * marker_size +m_cFrame.iY, - m_cFrameScrollRel.iWidth - (2*SCROLL_MARKER_BORDER), - marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0); - } - else + /* + FIXME: Find right conditions. + So long let's paint scrollbar background in every case + to avoid transparent spaces in scrollbar corners. + */ + if (1) { frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_MENUCONTENT_PLUS_0); } + + if (m_nNrOfPages > 1) + { + frameBuffer->paintBoxRel(m_cFrameScrollRel.iX+m_cFrame.iX, m_cFrameScrollRel.iY+m_cFrame.iY, + m_cFrameScrollRel.iWidth, m_cFrameScrollRel.iHeight, COL_SCROLLBAR_PASSIVE_PLUS_0, RADIUS_MIN); + unsigned int marker_size = (m_cFrameScrollRel.iHeight - 2*SCROLL_MARKER_BORDER) / m_nNrOfPages; + frameBuffer->paintBoxRel(m_cFrameScrollRel.iX + SCROLL_MARKER_BORDER+m_cFrame.iX, + m_cFrameScrollRel.iY + SCROLL_MARKER_BORDER + m_nCurrentPage * marker_size +m_cFrame.iY, + m_cFrameScrollRel.iWidth - (2*SCROLL_MARKER_BORDER), + marker_size, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_MIN); + } } int CListFrame::paintListIcon(int x, int y, int line) From b7f8c2c220d254eafd7a56931b39073792262b0a Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 25 Oct 2016 12:19:48 +0200 Subject: [PATCH 24/24] moviebrowser: port configuration of moviebrowser fonts from NI-Neutrino Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/82f7eff169b3a192f04eb1685700ff17e0c1e45f Author: vanhofen Date: 2016-10-25 (Tue, 25 Oct 2016) Origin message was: ------------------ - moviebrowser: port configuration of moviebrowser fonts from NI-Neutrino --- data/locale/deutsch.locale | 5 +++++ data/locale/english.locale | 5 +++++ src/gui/moviebrowser/mb.cpp | 14 ++++++++------ src/gui/osd_setup.cpp | 12 ++++++++++++ src/system/locals.h | 5 +++++ src/system/locals_intern.h | 5 +++++ src/system/settings.h | 3 +++ 7 files changed, 43 insertions(+), 6 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 7f9468a2a..dc2a2c1b6 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -703,6 +703,7 @@ fontmenu.eventlist Event-Liste fontmenu.head Schrift fontmenu.infobar Infobar fontmenu.menu Menü +fontmenu.moviebrowser Moviebrowser fontmenu.other Andere fontmenu.scaling Schriftgrößenfaktor fontmenu.scaling_x Horizontal (in %) @@ -735,6 +736,9 @@ fontsize.menu_foot Fußleiste (in allen GUI-Elementen) fontsize.menu_hint Menü-Hilfe fontsize.menu_info Menüinfo fontsize.menu_title Menütitel +fontsize.moviebrowser_head Überschriften +fontsize.moviebrowser_info Info-Fenster +fontsize.moviebrowser_list Listen-Einträge fontsize.subtitles Text Untertitel fsk.all aus fsk.from_12 ab 12 @@ -1187,6 +1191,7 @@ menu.hint_misc_general Standby-, Teletext- und Rotor-Einstellungen, Pluginverzei menu.hint_misc_onlineservices Konfigurieren und steuern von Online-Diensten wie YouTube, SHOUTCast und TMDb menu.hint_misc_zapit Verwaltung der Start-Kanäle für den TV/Radio-Modus menu.hint_movie Wiedergabe von Filmen +menu.hint_moviebrowser_fonts Ändern Sie die Schriftgrößen im Moviebrowser (Meine Aufnahmen) menu.hint_moviebrowser_setup Legen Sie Auswahl- und Anzeigeoptionen des MovieBrowsers fest menu.hint_movieplayer_plugin Wählen Sie ein Plugin, das mit einer Schnellstart-Taste im Movieplayer-Modus gestartet wird menu.hint_net_broadcast Ändern Sie die Broadcast-Adresse.\nWenn Sie unsicher sind, verwenden Sie zuletzt .255 diff --git a/data/locale/english.locale b/data/locale/english.locale index b9bd319b0..220663cbe 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -703,6 +703,7 @@ fontmenu.eventlist Eventlist fontmenu.head Font settings fontmenu.infobar Infobar fontmenu.menu Menu +fontmenu.moviebrowser Moviebrowser fontmenu.other Other fontmenu.scaling Global Font Zoom Factor fontmenu.scaling_x Horizontal (in %) @@ -735,6 +736,9 @@ fontsize.menu_foot Footer (in all GUI elements) fontsize.menu_hint Menu hints fontsize.menu_info Menu Info fontsize.menu_title Menu Title +fontsize.moviebrowser_head Headers +fontsize.moviebrowser_info Info window +fontsize.moviebrowser_list List items fontsize.subtitles Text subtitles fsk.all off fsk.from_12 from 12 @@ -1187,6 +1191,7 @@ menu.hint_misc_general Start to standby, cache teletext, swp rotor\nplugin hdd d menu.hint_misc_onlineservices Configure and control online services like YouTube, SHOUTCast and TMDb menu.hint_misc_zapit Initial TV/Radio channels menu.hint_movie Play movies +menu.hint_moviebrowser_fonts Change moviebrowser (My recordings) font sizes menu.hint_moviebrowser_setup Set selection and display options. menu.hint_movieplayer_plugin Choose a plugin that's executed with the one touch key in movieplayer mode menu.hint_net_broadcast Enter broadcast address\nif unsure, use IP address with last .255 diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index c9abdc12c..452463f25 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1088,20 +1088,22 @@ int CMovieBrowser::paint(void) //CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD)); - Font* font = NULL; + Font* font = g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_LIST]; m_movieSelectionHandler = NULL; + m_pcBrowser = new CListFrame(&m_browserListLines, font, CListFrame::SCROLL | CListFrame::HEADER_LINE, - &m_cBoxFrameBrowserList); + &m_cBoxFrameBrowserList, NULL, + g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); m_pcLastPlay = new CListFrame(&m_playListLines, font, CListFrame::SCROLL | CListFrame::HEADER_LINE | CListFrame::TITLE, &m_cBoxFrameLastPlayList, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD_PLAYLIST), - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]); + g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); m_pcLastRecord = new CListFrame(&m_recordListLines, font, CListFrame::SCROLL | CListFrame::HEADER_LINE | CListFrame::TITLE, &m_cBoxFrameLastRecordList, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD_RECORDLIST), - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]); + g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); m_pcFilter = new CListFrame(&m_FilterLines, font, CListFrame::SCROLL | CListFrame::TITLE, &m_cBoxFrameFilter, g_Locale->getText(LOCALE_MOVIEBROWSER_HEAD_FILTER), - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]); - m_pcInfo = new CTextBox(" ", NULL, CTextBox::TOP | CTextBox::SCROLL, &m_cBoxFrameInfo); + g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD]); + m_pcInfo = new CTextBox(" ", g_Font[SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_INFO], CTextBox::TOP | CTextBox::SCROLL, &m_cBoxFrameInfo); if (m_pcBrowser == NULL || m_pcLastPlay == NULL || diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 2e26a6818..414c6fe00 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -149,6 +149,14 @@ const SNeutrinoSettings::FONT_TYPES menu_font_sizes[] = }; size_t menu_font_items = sizeof(menu_font_sizes)/sizeof(menu_font_sizes[0]); +const SNeutrinoSettings::FONT_TYPES moviebrowser_font_sizes[] = +{ + SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_HEAD, + SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_LIST, + SNeutrinoSettings::FONT_TYPE_MOVIEBROWSER_INFO +}; +size_t moviebrowser_font_items = sizeof(moviebrowser_font_sizes)/sizeof(moviebrowser_font_sizes[0]); + const SNeutrinoSettings::FONT_TYPES other_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_SUBTITLES, @@ -163,6 +171,7 @@ font_sizes_groups font_sizes_groups[] = {LOCALE_FONTMENU_EVENTLIST , eventlist_font_items , eventlist_font_sizes , "fontsize.deve", LOCALE_MENU_HINT_EVENTLIST_FONTS }, {LOCALE_FONTMENU_EPG , epg_font_items , epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS }, {LOCALE_FONTMENU_INFOBAR , infobar_font_items , infobar_font_sizes , "fontsize.dinf", LOCALE_MENU_HINT_INFOBAR_FONTS }, + {LOCALE_FONTMENU_MOVIEBROWSER,moviebrowser_font_items,moviebrowser_font_sizes,"fontsize.dmbr", LOCALE_MENU_HINT_MOVIEBROWSER_FONTS }, {LOCALE_FONTMENU_OTHER , other_font_items , other_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_OTHER_FONTS } }; #define FONT_GROUP_COUNT (sizeof(font_sizes_groups)/sizeof(font_sizes_groups[0])) @@ -193,6 +202,9 @@ font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] = {LOCALE_FONTSIZE_INFOBAR_SMALL , 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}, {LOCALE_FONTSIZE_FILEBROWSER_ITEM , 16, CNeutrinoFonts::FONT_STYLE_BOLD , 1}, {LOCALE_FONTSIZE_MENU_HINT , 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, + {LOCALE_FONTSIZE_MOVIEBROWSER_HEAD , 15, CNeutrinoFonts::FONT_STYLE_REGULAR, 2}, + {LOCALE_FONTSIZE_MOVIEBROWSER_LIST , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, + {LOCALE_FONTSIZE_MOVIEBROWSER_INFO , 17, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, {LOCALE_FONTSIZE_SUBTITLES , 25, CNeutrinoFonts::FONT_STYLE_BOLD , 0} }; diff --git a/src/system/locals.h b/src/system/locals.h index f66030446..f94923248 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -730,6 +730,7 @@ typedef enum LOCALE_FONTMENU_HEAD, LOCALE_FONTMENU_INFOBAR, LOCALE_FONTMENU_MENU, + LOCALE_FONTMENU_MOVIEBROWSER, LOCALE_FONTMENU_OTHER, LOCALE_FONTMENU_SCALING, LOCALE_FONTMENU_SCALING_X, @@ -762,6 +763,9 @@ typedef enum LOCALE_FONTSIZE_MENU_HINT, LOCALE_FONTSIZE_MENU_INFO, LOCALE_FONTSIZE_MENU_TITLE, + LOCALE_FONTSIZE_MOVIEBROWSER_HEAD, + LOCALE_FONTSIZE_MOVIEBROWSER_INFO, + LOCALE_FONTSIZE_MOVIEBROWSER_LIST, LOCALE_FONTSIZE_SUBTITLES, LOCALE_FSK_ALL, LOCALE_FSK_FROM_12, @@ -1214,6 +1218,7 @@ typedef enum LOCALE_MENU_HINT_MISC_ONLINESERVICES, LOCALE_MENU_HINT_MISC_ZAPIT, LOCALE_MENU_HINT_MOVIE, + LOCALE_MENU_HINT_MOVIEBROWSER_FONTS, LOCALE_MENU_HINT_MOVIEBROWSER_SETUP, LOCALE_MENU_HINT_MOVIEPLAYER_PLUGIN, LOCALE_MENU_HINT_NET_BROADCAST, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 2439efe55..482e7d875 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -730,6 +730,7 @@ const char * locale_real_names[] = "fontmenu.head", "fontmenu.infobar", "fontmenu.menu", + "fontmenu.moviebrowser", "fontmenu.other", "fontmenu.scaling", "fontmenu.scaling_x", @@ -762,6 +763,9 @@ const char * locale_real_names[] = "fontsize.menu_hint", "fontsize.menu_info", "fontsize.menu_title", + "fontsize.moviebrowser_head", + "fontsize.moviebrowser_info", + "fontsize.moviebrowser_list", "fontsize.subtitles", "fsk.all", "fsk.from_12", @@ -1214,6 +1218,7 @@ const char * locale_real_names[] = "menu.hint_misc_onlineservices", "menu.hint_misc_zapit", "menu.hint_movie", + "menu.hint_moviebrowser_fonts", "menu.hint_moviebrowser_setup", "menu.hint_movieplayer_plugin", "menu.hint_net_broadcast", diff --git a/src/system/settings.h b/src/system/settings.h index 0411b60a6..6744aaaae 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -669,6 +669,9 @@ struct SNeutrinoSettings FONT_TYPE_INFOBAR_SMALL, FONT_TYPE_FILEBROWSER_ITEM, FONT_TYPE_MENU_HINT, + FONT_TYPE_MOVIEBROWSER_HEAD, + FONT_TYPE_MOVIEBROWSER_LIST, + FONT_TYPE_MOVIEBROWSER_INFO, FONT_TYPE_SUBTITLES, FONT_TYPE_COUNT };