mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
hourglass: use count of images as calculation base for paint interval
We are using possible 3rd party theme packages (installed via package manager) with other counts of images. This should ensure an automatic adaptation of interval in case of different count of images.
This commit is contained in:
@@ -55,7 +55,7 @@ CHourGlass::CHourGlass( const int x_pos,
|
|||||||
initImageFiles();
|
initImageFiles();
|
||||||
|
|
||||||
hg_file_num = 0;
|
hg_file_num = 0;
|
||||||
hg_interval = interval;
|
hg_interval = interval == HG_AUTO_PAINT_INTERVAL ? 1000/hg_img_files.size() : interval;
|
||||||
hg_timer = new CComponentsTimer(hg_interval);
|
hg_timer = new CComponentsTimer(hg_interval);
|
||||||
hg_timer->OnTimer.connect(sigc::bind(sigc::mem_fun(*this, &CHourGlass::paint), true));
|
hg_timer->OnTimer.connect(sigc::bind(sigc::mem_fun(*this, &CHourGlass::paint), true));
|
||||||
}
|
}
|
||||||
|
@@ -33,6 +33,8 @@
|
|||||||
CHourglass shows only a timer controlled image chain, CHourglassProc will run an additional process.
|
CHourglass shows only a timer controlled image chain, CHourglassProc will run an additional process.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define HG_AUTO_PAINT_INTERVAL -1
|
||||||
|
|
||||||
class CHourGlass : public CComponentsShapeSquare
|
class CHourGlass : public CComponentsShapeSquare
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@@ -61,7 +63,7 @@ class CHourGlass : public CComponentsShapeSquare
|
|||||||
* The max count of images are defined in MAX_IMAGES.
|
* The max count of images are defined in MAX_IMAGES.
|
||||||
* Images must be stored as usual inside the defined icon directories.
|
* Images must be stored as usual inside the defined icon directories.
|
||||||
* @param[in] interval
|
* @param[in] interval
|
||||||
* @li optional: expects type int64_t, defines paint interval, default = 84ms
|
* @li optional: expects type int64_t, defines paint interval in milliseconds, default = HG_AUTO_PAINT_INTERVAL (cycle 1000ms / count of images)
|
||||||
* @param[in] parent
|
* @param[in] parent
|
||||||
* @li optional: expects type CComponentsForm, as a parent container in which this object is embedded, default = NULL (stand alone)
|
* @li optional: expects type CComponentsForm, as a parent container in which this object is embedded, default = NULL (stand alone)
|
||||||
* @param[in] shadow_mode
|
* @param[in] shadow_mode
|
||||||
@@ -81,7 +83,7 @@ class CHourGlass : public CComponentsShapeSquare
|
|||||||
const int w = 48,
|
const int w = 48,
|
||||||
const int h = 48,
|
const int h = 48,
|
||||||
const std::string& image_basename = "hourglass",
|
const std::string& image_basename = "hourglass",
|
||||||
const int64_t& interval = 84,
|
const int64_t& interval = HG_AUTO_PAINT_INTERVAL,
|
||||||
CComponentsForm *parent = NULL,
|
CComponentsForm *parent = NULL,
|
||||||
int shadow_mode = CC_SHADOW_OFF,
|
int shadow_mode = CC_SHADOW_OFF,
|
||||||
fb_pixel_t color_frame = COL_FRAME_PLUS_0,
|
fb_pixel_t color_frame = COL_FRAME_PLUS_0,
|
||||||
@@ -122,7 +124,7 @@ class CHourGlassProc : public CHourGlass
|
|||||||
const int w = 48,
|
const int w = 48,
|
||||||
const int h = 48,
|
const int h = 48,
|
||||||
const std::string& image_basename = "hourglass",
|
const std::string& image_basename = "hourglass",
|
||||||
const int64_t& interval = 84,
|
const int64_t& interval = HG_AUTO_PAINT_INTERVAL,
|
||||||
CComponentsForm *parent = NULL,
|
CComponentsForm *parent = NULL,
|
||||||
int shadow_mode = CC_SHADOW_OFF,
|
int shadow_mode = CC_SHADOW_OFF,
|
||||||
fb_pixel_t color_frame = COL_FRAME_PLUS_0,
|
fb_pixel_t color_frame = COL_FRAME_PLUS_0,
|
||||||
|
Reference in New Issue
Block a user