mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
Rework handling muteicon
- Integrated for monitoring the mute icon into the frame buffer class.
If the icon is overwritten by an element, it is restored from the
framebuffer.
Signed-off-by: Thilo Graf <dbt@novatux.de>
Origin commit data
------------------
Commit: 1049b337bb
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2013-05-13 (Mon, 13 May 2013)
Origin message was:
------------------
* Rework handling muteicon
- Integrated for monitoring the mute icon into the frame buffer class.
If the icon is overwritten by an element, it is restored from the
framebuffer.
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -36,7 +36,9 @@
|
||||
|
||||
CAudioMute::CAudioMute():CComponentsPicture(0, 0, 0, 0, NEUTRINO_ICON_BUTTON_MUTE)
|
||||
{
|
||||
y_old = -1;
|
||||
y_old = -1;
|
||||
paint_bg = false;
|
||||
do_paint_mute_icon = true;
|
||||
CVolumeHelper::getInstance()->refresh();
|
||||
CVolumeHelper::getInstance()->getMuteIconDimensions(&x, &y, &width, &height);
|
||||
}
|
||||
@@ -60,20 +62,53 @@ void CAudioMute::AudioMute(int newValue, bool isEvent)
|
||||
|
||||
if( isEvent && ( neutrino->getMode() != CNeutrinoApp::mode_scart ) && ( neutrino->getMode() != CNeutrinoApp::mode_audio) && ( neutrino->getMode() != CNeutrinoApp::mode_pic))
|
||||
{
|
||||
CFrameBuffer *framebuffer = CFrameBuffer::getInstance();
|
||||
CVolumeHelper::getInstance()->getMuteIconDimensions(&x, &y, &width, &height);
|
||||
if ((y_old != y)) {
|
||||
this->hide();
|
||||
if (do_paint_mute_icon)
|
||||
{
|
||||
framebuffer->fbNoCheck(true);
|
||||
this->hide(true);
|
||||
framebuffer->fbNoCheck(false);
|
||||
}
|
||||
framebuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1);
|
||||
y_old = y;
|
||||
}
|
||||
if ((g_settings.mode_clock) && (doInit))
|
||||
CInfoClock::getInstance()->ClearDisplay();
|
||||
|
||||
if (newValue)
|
||||
this->paint();
|
||||
else
|
||||
this->hide();
|
||||
framebuffer->fbNoCheck(true);
|
||||
if (newValue) {
|
||||
if (do_paint_mute_icon)
|
||||
this->paint();
|
||||
framebuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1, this->getXPos(), this->getYPos(), this->getWidth(), this->getHeight());
|
||||
}
|
||||
else {
|
||||
if (do_paint_mute_icon)
|
||||
this->hide(true);
|
||||
framebuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1);
|
||||
}
|
||||
framebuffer->fbNoCheck(false);
|
||||
|
||||
if (doInit)
|
||||
CVolumeHelper::getInstance()->refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void CAudioMute::enableMuteIcon(bool enable)
|
||||
{
|
||||
CNeutrinoApp *neutrino = CNeutrinoApp::getInstance();
|
||||
CFrameBuffer *framebuffer = CFrameBuffer::getInstance();
|
||||
if (enable) {
|
||||
framebuffer->doPaintMuteIcon(true);
|
||||
do_paint_mute_icon = true;
|
||||
if (neutrino->isMuted())
|
||||
this->paint();
|
||||
}
|
||||
else {
|
||||
if (neutrino->isMuted())
|
||||
this->hide(true);
|
||||
framebuffer->doPaintMuteIcon(false);
|
||||
do_paint_mute_icon = false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user