mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
CComponentsPIP: paint alternate picture if no tv mode
Use setPicture() to change image on runtime.
Origin commit data
------------------
Branch: ni/coolstream
Commit: 8196cf7671
Author: Thilo Graf <dbt@novatux.de>
Date: 2013-03-22 (Fri, 22 Mar 2013)
Origin message was:
------------------
CComponentsPIP: paint alternate picture if no tv mode
Use setPicture() to change image on runtime.
------------------
This commit was generated by Migit
This commit is contained in:
@@ -277,6 +277,7 @@ class CComponentsPIP : public CComponentsItem
|
||||
{
|
||||
private:
|
||||
int screen_w, screen_h;
|
||||
std::string pic_name; //alternate picture if is no tv picture available
|
||||
public:
|
||||
CComponentsPIP( const int x_pos, const int y_pos, const int percent = 30, bool has_shadow = CC_SHADOW_OFF);
|
||||
~CComponentsPIP();
|
||||
@@ -285,6 +286,7 @@ class CComponentsPIP : public CComponentsItem
|
||||
void hide(bool no_restore = false);
|
||||
void setScreenWidth(int screen_width){screen_w = screen_width;};
|
||||
void setScreenHeight(int screen_heigth){screen_h = screen_heigth;};
|
||||
void setPicture(const std::string& image){pic_name = image;};
|
||||
};
|
||||
|
||||
|
||||
|
@@ -49,6 +49,8 @@ CComponentsPIP::CComponentsPIP( const int x_pos, const int y_pos, const int perc
|
||||
//CComponentsPIP
|
||||
screen_w = frameBuffer->getScreenWidth(true);
|
||||
screen_h = frameBuffer->getScreenHeight(true);
|
||||
pic_name = DATADIR;
|
||||
pic_name += "/neutrino/icons/start.jpg";
|
||||
|
||||
//CComponents
|
||||
x = x_pos;
|
||||
@@ -72,8 +74,21 @@ CComponentsPIP::~CComponentsPIP()
|
||||
|
||||
void CComponentsPIP::paint(bool do_save_bg)
|
||||
{
|
||||
int pig_x = x+fr_thickness;
|
||||
int pig_y = y+fr_thickness;
|
||||
int pig_w = width-2*fr_thickness;
|
||||
int pig_h = height-2*fr_thickness;
|
||||
|
||||
paintInit(do_save_bg);
|
||||
videoDecoder->Pig(x+fr_thickness, y+fr_thickness, width-2*fr_thickness, height-2*fr_thickness, screen_w, screen_h);
|
||||
|
||||
if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_tv){
|
||||
videoDecoder->Pig(pig_x, pig_y, pig_w, pig_h, screen_w, screen_h);
|
||||
}
|
||||
else{ //paint an alternate image if no tv mode available
|
||||
CComponentsPicture pic = CComponentsPicture (pig_x, pig_y, pig_w, pig_h, pic_name);
|
||||
pic.paint();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user