Fix paint VolumeBar on InfoViewer

This commit is contained in:
Michael Liebmann
2013-06-26 22:36:08 +02:00
parent 2a63a85584
commit 31e2dae622
5 changed files with 60 additions and 24 deletions

View File

@@ -87,16 +87,8 @@ void CVolume::setVolume(const neutrino_msg_t key)
}
}
if (volscale){
volscale->hide();
delete volscale;
volscale = NULL;
}
if (volscale == NULL){
volscale = new CVolumeBar();
volscale->paint();
}
hideVolscale();
showVolscale();
neutrino_msg_data_t data;
uint64_t timeoutEnd;
@@ -111,12 +103,7 @@ void CVolume::setVolume(const neutrino_msg_t key)
(sub_chan_keybind && (msg == CRCInput::RC_right || msg == CRCInput::RC_left))) {
int dir = (msg == CRCInput::RC_plus || msg == CRCInput::RC_right) ? 1 : -1;
if (CNeutrinoApp::getInstance()->isMuted() && (dir > 0 || g_settings.current_volume > 0)) {
if (volscale){
if (volscale->isPainted())
volscale->hide();
delete volscale;
volscale = NULL;
}
hideVolscale();
CAudioMute::getInstance()->AudioMute(false, true);
if (mode == CNeutrinoApp::mode_audio) {
CAudioPlayerGui *cap = CMediaPlayerMenu::getInstance()->getPlayerInstance();
@@ -137,12 +124,7 @@ void CVolume::setVolume(const neutrino_msg_t key)
v = 0;
g_settings.current_volume = 0;
if (g_settings.show_mute_icon) {
if (volscale) {
if (volscale->isPainted())
volscale->hide();
delete volscale;
volscale = NULL;
}
hideVolscale();
CAudioMute::getInstance()->AudioMute(true, true);
if (mode == CNeutrinoApp::mode_audio) {
CAudioPlayerGui *cap = CMediaPlayerMenu::getInstance()->getPlayerInstance();
@@ -187,12 +169,29 @@ void CVolume::setVolume(const neutrino_msg_t key)
}
} while (msg != CRCInput::RC_timeout);
hideVolscale();
}
bool CVolume::hideVolscale()
{
bool ret = false;
if (volscale) {
if (volscale->isPainted())
if (volscale->isPainted()) {
volscale->hide();
ret = true;
}
delete volscale;
volscale = NULL;
}
return ret;
}
void CVolume::showVolscale()
{
if (volscale == NULL){
volscale = new CVolumeBar();
volscale->paint();
}
}
bool CVolume::changeNotify(const neutrino_locale_t OptionName, void * data)

View File

@@ -51,6 +51,8 @@ class CVolume : public CChangeObserver
void SetCurrentPid(int pid) { apid = pid; }
void SetCurrentChannel(t_channel_id id) { channel_id = id; }
bool hideVolscale();
void showVolscale();
bool changeNotify(const neutrino_locale_t OptionName, void *);
};

View File

@@ -61,6 +61,7 @@
#include <daemonc/remotecontrol.h>
#include <driver/record.h>
#include <driver/volume.h>
#include <zapit/satconfig.h>
#include <zapit/femanager.h>
@@ -115,6 +116,7 @@ CInfoViewer::CInfoViewer ()
infoViewerBB->Init();
oldinfo.current_uniqueKey = 0;
oldinfo.next_uniqueKey = 0;
isVolscale = false;
}
CInfoViewer::~CInfoViewer()
@@ -475,6 +477,14 @@ void CInfoViewer::showMovieTitle(const int playState, const std::string &Channel
const std::string &g_file_epg, const std::string &g_file_epg1,
const int duration, const int curr_pos)
{
if (g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_LEFT ||
g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_RIGHT ||
g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_CENTER ||
g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_HIGHER_CENTER)
isVolscale = CVolume::getInstance()->hideVolscale();
else
isVolscale = false;
check_channellogo_ca_SettingsChange();
aspectRatio = 0;
last_curr_id = last_next_id = 0;
@@ -615,6 +625,14 @@ void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int
void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, const t_satellite_position satellitePosition, const t_channel_id new_channel_id, const bool calledFromNumZap, int epgpos, char *pname)
{
if (g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_LEFT ||
g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_RIGHT ||
g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_CENTER ||
g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_HIGHER_CENTER)
isVolscale = CVolume::getInstance()->hideVolscale();
else
isVolscale = false;
check_channellogo_ca_SettingsChange();
aspectRatio = 0;
last_curr_id = last_next_id = 0;
@@ -822,6 +840,9 @@ void CInfoViewer::loop(bool show_dot)
neutrino_msg_t msg;
neutrino_msg_data_t data;
if (isVolscale)
CVolume::getInstance()->showVolscale();
while (!(res & (messages_return::cancel_info | messages_return::cancel_all))) {
g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd);
@@ -933,8 +954,10 @@ void CInfoViewer::loop(bool show_dot)
}
}
if (hideIt)
if (hideIt) {
CVolume::getInstance()->hideVolscale();
killTitle ();
}
g_RCInput->killTimer (sec_timer_id);
fader.Stop();

View File

@@ -151,6 +151,7 @@ class CInfoViewer
int BoxEndY;
int ChanInfoX;
bool showButtonBar;
bool isVolscale;
CInfoViewer();
~CInfoViewer();

View File

@@ -52,6 +52,7 @@
#include <gui/movieplayer.h>
#include <system/helpers.h>
#include <daemonc/remotecontrol.h>
#include <driver/volume.h>
#include <zapit/femanager.h>
#include <zapit/zapit.h>
@@ -351,6 +352,14 @@ void CInfoViewerBB::showBBButtons(const int modus)
int i;
bool paint = false;
if (g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_LEFT ||
g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_RIGHT ||
g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_BOTTOM_CENTER ||
g_settings.volume_pos == CVolumeBar::VOLUMEBAR_POS_HIGHER_CENTER)
g_InfoViewer->isVolscale = CVolume::getInstance()->hideVolscale();
else
g_InfoViewer->isVolscale = false;
getBBButtonInfo();
for (i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) {
if (tmp_bbButtonInfoText[i] != bbButtonInfo[i].text) {
@@ -389,6 +398,8 @@ void CInfoViewerBB::showBBButtons(const int modus)
tmp_bbButtonInfoText[i] = bbButtonInfo[i].text;
}
}
if (g_InfoViewer->isVolscale)
CVolume::getInstance()->showVolscale();
}
void CInfoViewerBB::showBBIcons(const int modus, const std::string & icon)