mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 00:11:08 +02:00
Merge branch 'cst-next' of git://coolstreamtech.de/cst-public-gui-neutrino into ni/cst-next
Origin commit data
------------------
Branch: ni/coolstream
Commit: 39e5880a70
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-09-28 (Wed, 28 Sep 2016)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -63,6 +63,7 @@
|
|||||||
#include <gui/movieplayer.h>
|
#include <gui/movieplayer.h>
|
||||||
#include <gui/infoclock.h>
|
#include <gui/infoclock.h>
|
||||||
#include <system/settings.h>
|
#include <system/settings.h>
|
||||||
|
#include <system/set_threadname.h>
|
||||||
#include <gui/customcolor.h>
|
#include <gui/customcolor.h>
|
||||||
|
|
||||||
#include <gui/bouquetlist.h>
|
#include <gui/bouquetlist.h>
|
||||||
@@ -130,6 +131,8 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl
|
|||||||
move_state = beDefault;
|
move_state = beDefault;
|
||||||
edit_state = false;
|
edit_state = false;
|
||||||
channelsChanged = false;
|
channelsChanged = false;
|
||||||
|
|
||||||
|
paint_events_index = -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
CChannelList::~CChannelList()
|
CChannelList::~CChannelList()
|
||||||
@@ -161,6 +164,8 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
size_t chanlist_size = to - from;
|
size_t chanlist_size = to - from;
|
||||||
|
if (chanlist_size <= 0) // WTF???
|
||||||
|
return;
|
||||||
|
|
||||||
CChannelEventList events;
|
CChannelEventList events;
|
||||||
if (displayNext) {
|
if (displayNext) {
|
||||||
@@ -188,16 +193,18 @@ void CChannelList::updateEvents(unsigned int from, unsigned int to)
|
|||||||
for (uint32_t count = 0; count < chanlist_size; count++)
|
for (uint32_t count = 0; count < chanlist_size; count++)
|
||||||
p_requested_channels[count] = (*chanlist)[count + from]->getEpgID();
|
p_requested_channels[count] = (*chanlist)[count + from]->getEpgID();
|
||||||
|
|
||||||
CEitManager::getInstance()->getChannelEvents(events, p_requested_channels, chanlist_size);
|
CChannelEventList levents;
|
||||||
|
CEitManager::getInstance()->getChannelEvents(levents, p_requested_channels, chanlist_size);
|
||||||
for (uint32_t count=0; count < chanlist_size; count++) {
|
for (uint32_t count=0; count < chanlist_size; count++) {
|
||||||
(*chanlist)[count + from]->currentEvent = CChannelEvent();
|
(*chanlist)[count + from]->currentEvent = CChannelEvent();
|
||||||
for (CChannelEventList::iterator e = events.begin(); e != events.end(); ++e) {
|
for (CChannelEventList::iterator e = levents.begin(); e != levents.end(); ++e) {
|
||||||
if (((*chanlist)[count + from]->getEpgID()&0xFFFFFFFFFFFFULL) == e->get_channel_id()) {
|
if (((*chanlist)[count + from]->getEpgID()&0xFFFFFFFFFFFFULL) == e->get_channel_id()) {
|
||||||
(*chanlist)[count + from]->currentEvent = *e;
|
(*chanlist)[count + from]->currentEvent = *e;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
levents.clear();
|
||||||
delete[] p_requested_channels;
|
delete[] p_requested_channels;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -930,6 +937,8 @@ int CChannelList::show()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
paint_events(-2); // cancel paint_events thread
|
||||||
|
|
||||||
if (move_state == beMoving)
|
if (move_state == beMoving)
|
||||||
cancelMoveChannel();
|
cancelMoveChannel();
|
||||||
if (edit_state)
|
if (edit_state)
|
||||||
@@ -2307,9 +2316,70 @@ void CChannelList::paintPig (int _x, int _y, int w, int h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CChannelList::paint_events(int index)
|
void CChannelList::paint_events(int index)
|
||||||
|
{
|
||||||
|
if (index == -2 && paint_events_index > -2) {
|
||||||
|
pthread_mutex_lock(&paint_events_mutex);
|
||||||
|
paint_events_index = index;
|
||||||
|
sem_post(&paint_events_sem);
|
||||||
|
pthread_join(paint_events_thr, NULL);
|
||||||
|
sem_destroy(&paint_events_sem);
|
||||||
|
pthread_mutex_unlock(&paint_events_mutex);
|
||||||
|
} else if (paint_events_index == -2) {
|
||||||
|
if (index == -2)
|
||||||
|
return;
|
||||||
|
// First paint_event. No need to lock.
|
||||||
|
pthread_mutexattr_t attr;
|
||||||
|
pthread_mutexattr_init(&attr);
|
||||||
|
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK_NP);
|
||||||
|
pthread_mutex_init(&paint_events_mutex, &attr);
|
||||||
|
|
||||||
|
sem_init(&paint_events_sem, 0, 0);
|
||||||
|
paint_events_index = index;
|
||||||
|
if (!pthread_create(&paint_events_thr, NULL, paint_events, (void *) this))
|
||||||
|
sem_post(&paint_events_sem);
|
||||||
|
else
|
||||||
|
paint_events_index = -2;
|
||||||
|
} else {
|
||||||
|
pthread_mutex_lock(&paint_events_mutex);
|
||||||
|
paint_events_index = index;
|
||||||
|
pthread_mutex_unlock(&paint_events_mutex);
|
||||||
|
sem_post(&paint_events_sem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void *CChannelList::paint_events(void *arg)
|
||||||
|
{
|
||||||
|
CChannelList *me = (CChannelList *) arg;
|
||||||
|
me->paint_events();
|
||||||
|
pthread_exit(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CChannelList::paint_events()
|
||||||
|
{
|
||||||
|
set_threadname(__func__);
|
||||||
|
|
||||||
|
while (paint_events_index != -2) {
|
||||||
|
sem_wait(&paint_events_sem);
|
||||||
|
if (paint_events_index < 0)
|
||||||
|
continue;
|
||||||
|
while(!sem_trywait(&paint_events_sem));
|
||||||
|
int current_index = paint_events_index;
|
||||||
|
|
||||||
|
CChannelEventList evtlist;
|
||||||
|
readEvents((*chanlist)[current_index]->getChannelID(), evtlist);
|
||||||
|
if (current_index == paint_events_index) {
|
||||||
|
pthread_mutex_lock(&paint_events_mutex);
|
||||||
|
if (current_index == paint_events_index)
|
||||||
|
paint_events_index = -1;
|
||||||
|
pthread_mutex_unlock(&paint_events_mutex);
|
||||||
|
paint_events(evtlist);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CChannelList::paint_events(CChannelEventList &evtlist)
|
||||||
{
|
{
|
||||||
ffheight = g_Font[eventFont]->getHeight();
|
ffheight = g_Font[eventFont]->getHeight();
|
||||||
readEvents((*chanlist)[index]->getEpgID());
|
|
||||||
frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0);
|
frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0);
|
||||||
|
|
||||||
char startTime[10];
|
char startTime[10];
|
||||||
@@ -2371,8 +2441,6 @@ void CChannelList::paint_events(int index)
|
|||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if ( !evtlist.empty() )
|
|
||||||
evtlist.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b)
|
static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b)
|
||||||
@@ -2380,7 +2448,7 @@ static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b)
|
|||||||
return a.startTime < b.startTime;
|
return a.startTime < b.startTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannelList::readEvents(const t_channel_id channel_id)
|
void CChannelList::readEvents(const t_channel_id channel_id, CChannelEventList &evtlist)
|
||||||
{
|
{
|
||||||
CEitManager::getInstance()->getEventsServiceKey(channel_id , evtlist);
|
CEitManager::getInstance()->getEventsServiceKey(channel_id , evtlist);
|
||||||
|
|
||||||
|
@@ -46,6 +46,8 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <pthread.h>
|
||||||
|
#include <semaphore.h>
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
LIST_MODE_FAV,
|
LIST_MODE_FAV,
|
||||||
@@ -117,6 +119,11 @@ private:
|
|||||||
int infozone_height;
|
int infozone_height;
|
||||||
int previous_channellist_additional;
|
int previous_channellist_additional;
|
||||||
|
|
||||||
|
int paint_events_index;
|
||||||
|
sem_t paint_events_sem;
|
||||||
|
pthread_t paint_events_thr;
|
||||||
|
pthread_mutex_t paint_events_mutex;
|
||||||
|
|
||||||
const char * unit_short_minute;
|
const char * unit_short_minute;
|
||||||
|
|
||||||
CEPGData epgData;
|
CEPGData epgData;
|
||||||
@@ -147,9 +154,11 @@ private:
|
|||||||
void calcSize();
|
void calcSize();
|
||||||
std::string MaxChanNr();
|
std::string MaxChanNr();
|
||||||
void paintPig(int x, int y, int w, int h);
|
void paintPig(int x, int y, int w, int h);
|
||||||
|
void paint_events();
|
||||||
void paint_events(int index);
|
void paint_events(int index);
|
||||||
CChannelEventList evtlist;
|
void paint_events(CChannelEventList &evtlist);
|
||||||
void readEvents(const t_channel_id channel_id);
|
static void *paint_events(void *arg);
|
||||||
|
void readEvents(const t_channel_id channel_id, CChannelEventList &evtlist);
|
||||||
void showdescription(int index);
|
void showdescription(int index);
|
||||||
typedef std::pair<std::string,int> epg_pair;
|
typedef std::pair<std::string,int> epg_pair;
|
||||||
std::vector<epg_pair> epgText;
|
std::vector<epg_pair> epgText;
|
||||||
|
@@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#include <global.h>
|
#include <global.h>
|
||||||
#include <neutrino.h>
|
#include <neutrino.h>
|
||||||
#include <zapit/femanager.h>
|
|
||||||
#include "cc_frm_signalbars.h"
|
#include "cc_frm_signalbars.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
@@ -193,7 +192,9 @@ void CSignalBar::initSBarName()
|
|||||||
void CSignalBar::Refresh()
|
void CSignalBar::Refresh()
|
||||||
{
|
{
|
||||||
//get current value from frontend
|
//get current value from frontend
|
||||||
sb_signal = sb_frontend->getSignalStrength();
|
sb_signal = 0;
|
||||||
|
if (sb_frontend)
|
||||||
|
sb_signal = sb_frontend->getSignalStrength();
|
||||||
|
|
||||||
//reinit items with current values
|
//reinit items with current values
|
||||||
initSBItems();
|
initSBItems();
|
||||||
@@ -243,7 +244,9 @@ void CSignalBar::paint(bool do_save_bg)
|
|||||||
void CSignalNoiseRatioBar::Refresh()
|
void CSignalNoiseRatioBar::Refresh()
|
||||||
{
|
{
|
||||||
//get current value from frontend
|
//get current value from frontend
|
||||||
sb_signal = sb_frontend->getSignalNoiseRatio();
|
sb_signal = 0;
|
||||||
|
if (sb_frontend)
|
||||||
|
sb_signal = sb_frontend->getSignalNoiseRatio();
|
||||||
|
|
||||||
//reinit items with current values
|
//reinit items with current values
|
||||||
initSBItems();
|
initSBItems();
|
||||||
@@ -256,7 +259,7 @@ CSignalBox::CSignalBox(const int& xpos, const int& ypos, const int& w, const int
|
|||||||
initVarSigBox();
|
initVarSigBox();
|
||||||
vertical = vert;
|
vertical = vert;
|
||||||
|
|
||||||
sbx_frontend = (frontend_ref == NULL) ? CFEManager::getInstance()->getLiveFE() : frontend_ref;
|
sbx_frontend = frontend_ref;
|
||||||
x = xpos;
|
x = xpos;
|
||||||
y = ypos;
|
y = ypos;
|
||||||
width = w;
|
width = w;
|
||||||
@@ -339,10 +342,8 @@ void CSignalBox::paintScale()
|
|||||||
void CSignalBox::paint(bool do_save_bg)
|
void CSignalBox::paint(bool do_save_bg)
|
||||||
{
|
{
|
||||||
//paint frame and body
|
//paint frame and body
|
||||||
if (!is_painted){
|
if (!is_painted)
|
||||||
initSignalItems();
|
|
||||||
paintForm(do_save_bg);
|
paintForm(do_save_bg);
|
||||||
}
|
|
||||||
|
|
||||||
//paint current signal value
|
//paint current signal value
|
||||||
paintScale();
|
paintScale();
|
||||||
|
@@ -116,7 +116,7 @@ class CSignalBar : public CComponentsForm, public CCTextScreen
|
|||||||
CSignalBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const std::string& sb_name = "SIG", CComponentsForm *parent = NULL);
|
CSignalBar(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const std::string& sb_name = "SIG", CComponentsForm *parent = NULL);
|
||||||
|
|
||||||
///assigns the current used frontend, simplified a tuner object, see frontend_c.h
|
///assigns the current used frontend, simplified a tuner object, see frontend_c.h
|
||||||
virtual void setFrontEnd(CFrontend *frontend_ref){sb_frontend = frontend_ref;};
|
virtual void setFrontEnd(CFrontend *frontend_ref){if (sb_frontend != frontend_ref) {sb_lastsig = 0; sb_frontend = frontend_ref;}}
|
||||||
///assigns font for caption
|
///assigns font for caption
|
||||||
virtual void setTextFont(Font* font_text){sb_font = font_text;};
|
virtual void setTextFont(Font* font_text){sb_font = font_text;};
|
||||||
///sets the caption color, see also property 'sb_caption_color'
|
///sets the caption color, see also property 'sb_caption_color'
|
||||||
@@ -291,13 +291,16 @@ class CSignalBox : public CComponentsForm, public CCTextScreen
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
///class constructor for signal noise ratio.
|
///class constructor for signal noise ratio.
|
||||||
CSignalBox(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref = NULL, const bool vertical = true, CComponentsForm *parent = NULL, const std::string& sig_name = "SIG", const std::string& snr_name = "SNR" );
|
CSignalBox(const int& xpos, const int& ypos, const int& w, const int& h, CFrontend *frontend_ref, const bool vertical = true, CComponentsForm *parent = NULL, const std::string& sig_name = "SIG", const std::string& snr_name = "SNR" );
|
||||||
|
|
||||||
///returns the signal object, type = CSignalBar*
|
///returns the signal object, type = CSignalBar*
|
||||||
CSignalBar* getScaleObject(){return sbar;};
|
CSignalBar* getScaleObject(){return sbar;};
|
||||||
///returns the signal noise ratio object, type = CSignalNoiseRatioBar*
|
///returns the signal noise ratio object, type = CSignalNoiseRatioBar*
|
||||||
CSignalNoiseRatioBar* getLabelObject(){return snrbar;};
|
CSignalNoiseRatioBar* getLabelObject(){return snrbar;};
|
||||||
|
|
||||||
|
///assigns the current used frontend, simplified a tuner object, see frontend_c.h
|
||||||
|
void setFrontEnd(CFrontend *frontend_ref){sbx_frontend = frontend_ref;}
|
||||||
|
|
||||||
///sets the caption color of signalbars, see also property 'sbx_caption_color'
|
///sets the caption color of signalbars, see also property 'sbx_caption_color'
|
||||||
void setTextColor(const fb_pixel_t& caption_color){ sbx_caption_color = caption_color;};
|
void setTextColor(const fb_pixel_t& caption_color){ sbx_caption_color = caption_color;};
|
||||||
///get caption color of signalbars, see also property 'sbx_caption_color'
|
///get caption color of signalbars, see also property 'sbx_caption_color'
|
||||||
|
@@ -1739,12 +1739,13 @@ void CInfoViewer::showSNR ()
|
|||||||
}
|
}
|
||||||
if (sigbox == NULL){
|
if (sigbox == NULL){
|
||||||
int sigbox_offset = ChanWidth *10/100;
|
int sigbox_offset = ChanWidth *10/100;
|
||||||
sigbox = new CSignalBox(BoxStartX + sigbox_offset, y_numbox+ChanHeight/2, ChanWidth - 2*sigbox_offset, ChanHeight/2, CFEManager::getInstance()->getLiveFE(), true, NULL, "S", "Q");
|
sigbox = new CSignalBox(BoxStartX + sigbox_offset, y_numbox+ChanHeight/2, ChanWidth - 2*sigbox_offset, ChanHeight/2, NULL, true, NULL, "S", "Q");
|
||||||
sigbox->setTextColor(COL_INFOBAR_TEXT);
|
sigbox->setTextColor(COL_INFOBAR_TEXT);
|
||||||
sigbox->setColorBody(numbox->getColorBody());
|
sigbox->setColorBody(numbox->getColorBody());
|
||||||
sigbox->doPaintBg(false);
|
sigbox->doPaintBg(false);
|
||||||
sigbox->enableTboxSaveScreen(numbox->getColBodyGradientMode());
|
sigbox->enableTboxSaveScreen(numbox->getColBodyGradientMode());
|
||||||
}
|
}
|
||||||
|
sigbox->setFrontEnd(CFEManager::getInstance()->getLiveFE());
|
||||||
sigbox->paint(CC_SAVE_SCREEN_NO);
|
sigbox->paint(CC_SAVE_SCREEN_NO);
|
||||||
}
|
}
|
||||||
if(showButtonBar)
|
if(showButtonBar)
|
||||||
|
Reference in New Issue
Block a user