CAudioMute: implementation of CComponents

Origin commit data
------------------
Commit: 35444cb703
Author: Thilo Graf <dbt@novatux.de>
Date: 2013-05-10 (Fri, 10 May 2013)
This commit is contained in:
2013-05-10 18:07:48 +02:00
committed by Michael Liebmann
parent 4f521760ef
commit 12b8d96c0b
2 changed files with 14 additions and 25 deletions

View File

@@ -4,6 +4,8 @@
audioMute - Neutrino-GUI
Copyright (C) 2013 M. Liebmann (micha-bbg)
CComponents implementation
Copyright (C) 2013 Thilo Graf
License: GPL
@@ -32,21 +34,11 @@
#include <gui/volumebar.h>
#include <gui/audiomute.h>
CAudioMute::CAudioMute()
CAudioMute::CAudioMute():CComponentsPicture(0, 0, 0, 0, NEUTRINO_ICON_BUTTON_MUTE)
{
mute_ax = 0;
mute_ay = 0;
mute_dx = 0;
mute_dy = 0;
mute_ay_old = -1;
y_old = -1;
CVolumeHelper::getInstance()->refresh();
CVolumeHelper::getInstance()->getMuteIconDimensions(&mute_ax, &mute_ay, &mute_dx, &mute_dy);
mIcon = new CComponentsPicture(mute_ax, mute_ay, mute_dx, mute_dy, NEUTRINO_ICON_BUTTON_MUTE);
}
CAudioMute::~CAudioMute()
{
delete mIcon;
CVolumeHelper::getInstance()->getMuteIconDimensions(&x, &y, &width, &height);
}
CAudioMute* CAudioMute::getInstance()
@@ -68,19 +60,18 @@ void CAudioMute::AudioMute(int newValue, bool isEvent)
if( isEvent && ( neutrino->getMode() != CNeutrinoApp::mode_scart ) && ( neutrino->getMode() != CNeutrinoApp::mode_audio) && ( neutrino->getMode() != CNeutrinoApp::mode_pic))
{
CVolumeHelper::getInstance()->getMuteIconDimensions(&mute_ax, &mute_ay, &mute_dx, &mute_dy);
if ((mIcon) && (mute_ay_old != mute_ay)) {
mIcon->hide();
mIcon->setYPos(mute_ay);
mute_ay_old = mute_ay;
CVolumeHelper::getInstance()->getMuteIconDimensions(&x, &y, &width, &height);
if ((y_old != y)) {
this->hide();
y_old = y;
}
if ((g_settings.mode_clock) && (doInit))
CInfoClock::getInstance()->ClearDisplay();
if (newValue)
mIcon->paint();
this->paint();
else
mIcon->hide();
this->hide();
if (doInit)
CVolumeHelper::getInstance()->refresh();

View File

@@ -29,17 +29,15 @@
#include <gui/components/cc.h>
class CAudioMute
class CAudioMute : public CComponentsPicture
{
private:
int mute_ay_old;
int mute_ax, mute_ay, mute_dx, mute_dy;
CComponentsPicture *mIcon;
int y_old;
public:
CAudioMute();
~CAudioMute();
// ~CAudioMute();
static CAudioMute* getInstance();
void AudioMute(int newValue, bool isEvent= false);