Merge branch 'master' into pu/moviebrowser

This commit is contained in:
svenhoefer
2016-11-05 21:09:27 +01:00
4 changed files with 29 additions and 6 deletions

View File

@@ -616,6 +616,11 @@ void CPictureViewer::rescaleImageDimensions(int *width, int *height, const int m
bool CPictureViewer::DisplayImage(const std::string & name, int posx, int posy, int width, int height, int transp) bool CPictureViewer::DisplayImage(const std::string & name, int posx, int posy, int width, int height, int transp)
{ {
if(width < 1 || height < 1){
dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] Error: width %i height %i \n", __func__, __LINE__, width, height);
return false;
}
CFrameBuffer* frameBuffer = CFrameBuffer::getInstance(); CFrameBuffer* frameBuffer = CFrameBuffer::getInstance();
if (transp > CFrameBuffer::TM_EMPTY) if (transp > CFrameBuffer::TM_EMPTY)
frameBuffer->SetTransparent(transp); frameBuffer->SetTransparent(transp);
@@ -672,6 +677,12 @@ fb_pixel_t * CPictureViewer::int_getImage(const std::string & name, int *width,
if (load_ret == FH_ERROR_OK) if (load_ret == FH_ERROR_OK)
{ {
dprintf(DEBUG_INFO, "[CPictureViewer] [%s - %d] mode %s, decoded %s, (Pos: %d %d) ,bpp = %d \n", __func__, __LINE__, mode_str.c_str(), name.c_str(), x, y, bpp); dprintf(DEBUG_INFO, "[CPictureViewer] [%s - %d] mode %s, decoded %s, (Pos: %d %d) ,bpp = %d \n", __func__, __LINE__, mode_str.c_str(), name.c_str(), x, y, bpp);
// image size error
if((GetImage) && (*width < 1 || *height < 1)){
dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] mode: %s, file: %s (Pos: %d %d, Dim: %d x %d)\n", __func__, __LINE__, mode_str.c_str(), name.c_str(), x, y, *width, *height);
free(buffer);
return NULL;
}
// resize only getImage // resize only getImage
if ((GetImage) && (x != *width || y != *height)) if ((GetImage) && (x != *width || y != *height))
{ {
@@ -691,6 +702,7 @@ fb_pixel_t * CPictureViewer::int_getImage(const std::string & name, int *width,
*height = y; *height = y;
}else{ }else{
dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] mode %s: Error decoding file %s\n", __func__, __LINE__, mode_str.c_str(), name.c_str()); dprintf(DEBUG_NORMAL, "[CPictureViewer] [%s - %d] mode %s: Error decoding file %s\n", __func__, __LINE__, mode_str.c_str(), name.c_str());
free(buffer);
return NULL; return NULL;
} }
free(buffer); free(buffer);

View File

@@ -105,8 +105,12 @@ void CComponentsInfoBox::paintPicture()
if (pic_name.empty()) if (pic_name.empty())
return; return;
//NOTE: real values are reqiured, if we paint this item within a form as embedded cc-item
int x_pic = (cc_parent ? cc_xr : x) + fr_thickness;
int y_pic = (cc_parent ? cc_yr : y) + fr_thickness;
//init pic object and set icon paint position //init pic object and set icon paint position
pic = new CComponentsPicture(x+fr_thickness+x_offset, y+fr_thickness, 0, min(48, height-2*fr_thickness), pic_name); //NOTE: icons do not scale! pic = new CComponentsPicture(x_pic+x_offset, y_pic, 0, min(48, height-2*fr_thickness), pic_name); //NOTE: icons do not scale!
pic->setColorBody(col_body); pic->setColorBody(col_body);
@@ -115,7 +119,7 @@ void CComponentsInfoBox::paintPicture()
pic->doPaintBg(false); pic->doPaintBg(false);
//fit icon into frame //fit icon into frame
pic->setYPos(y+(height/2-pic->getHeight()/2)); pic->setYPos(y_pic+(height/2-pic->getHeight()/2));
//paint, but set visibility mode //paint, but set visibility mode
pic->allowPaint(cc_allow_paint); pic->allowPaint(cc_allow_paint);

View File

@@ -569,7 +569,7 @@ int CMiscMenue::showMiscSettingsMenuOnlineServices()
ms_oservices->addItem(youtube_onoff); ms_oservices->addItem(youtube_onoff);
changeNotify(LOCALE_YOUTUBE_DEV_ID, NULL); changeNotify(LOCALE_YOUTUBE_DEV_ID, NULL);
CKeyboardInput youtube_dev_id_input(LOCALE_YOUTUBE_DEV_ID, &g_settings.youtube_dev_id, 38, this); CKeyboardInput youtube_dev_id_input(LOCALE_YOUTUBE_DEV_ID, &g_settings.youtube_dev_id, 39, this);
mf = new CMenuForwarder(LOCALE_YOUTUBE_DEV_ID, true, youtube_dev_id_short, &youtube_dev_id_input); mf = new CMenuForwarder(LOCALE_YOUTUBE_DEV_ID, true, youtube_dev_id_short, &youtube_dev_id_input);
mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_YOUTUBE_DEV_ID); mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_YOUTUBE_DEV_ID);
ms_oservices->addItem(mf); ms_oservices->addItem(mf);

View File

@@ -1306,10 +1306,19 @@ bool CTimerEvent_Record::adjustToCurrentEPG()
CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id, evtlist); CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id, evtlist);
time_t now = time(NULL); time_t now = time(NULL);
time_t compare;
int pre, post;
CTimerManager::getInstance()->getRecordingSafety(pre, post);
CChannelEventList::iterator first = evtlist.end(); CChannelEventList::iterator first = evtlist.end();
for (CChannelEventList::iterator e = evtlist.begin(); e != evtlist.end(); ++e) for (CChannelEventList::iterator e = evtlist.begin(); e != evtlist.end(); ++e)
{ {
if (e->startTime < now) compare = e->startTime;
if (!pre)
compare += e->duration;
if (compare <= now)
continue; continue;
if (first == evtlist.end() || first->startTime > e->startTime) if (first == evtlist.end() || first->startTime > e->startTime)
first = e; first = e;
@@ -1323,8 +1332,6 @@ bool CTimerEvent_Record::adjustToCurrentEPG()
time_t _alarmTime = first->startTime; time_t _alarmTime = first->startTime;
time_t _stopTime = first->startTime + first->duration; time_t _stopTime = first->startTime + first->duration;
if (recordingSafety) { if (recordingSafety) {
int pre, post;
CTimerManager::getInstance()->getRecordingSafety(pre, post);
_alarmTime -= pre; _alarmTime -= pre;
_stopTime += post; _stopTime += post;
} }