diff --git a/src/gui/audiomute.cpp b/src/gui/audiomute.cpp index 0f50340e1..0cb46bc5a 100644 --- a/src/gui/audiomute.cpp +++ b/src/gui/audiomute.cpp @@ -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 #include -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(); diff --git a/src/gui/audiomute.h b/src/gui/audiomute.h index a45fa70e2..18dfcc8f5 100644 --- a/src/gui/audiomute.h +++ b/src/gui/audiomute.h @@ -29,17 +29,15 @@ #include -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);