示例#1
0
void CAudioMute::enableMuteIcon(bool enable)
{
	CNeutrinoApp *neutrino = CNeutrinoApp::getInstance();
	CVolumeHelper::getInstance()->getMuteIconDimensions(&x, &y, &width, &height);
	frameBuffer->fbNoCheck(true);
	if (enable) {
		frameBuffer->doPaintMuteIcon(true);
		do_paint_mute_icon = true;
		if (neutrino->isMuted())
			this->paint();
	}
	else {
		if (!neutrino->isMuted())
			this->kill();
		frameBuffer->doPaintMuteIcon(false);
		do_paint_mute_icon = false;
	}
	frameBuffer->fbNoCheck(false);
}
void CAudioMute::AudioMute(int newValue, bool isEvent)
{
	CNeutrinoApp* neutrino = CNeutrinoApp::getInstance();
	bool doInit = newValue != (int) neutrino->isMuted();

	CVFD::getInstance()->setMuted(newValue);
	neutrino->setCurrentMuted(newValue);
	g_Zapit->muteAudio(newValue);

	if( isEvent && ( neutrino->getMode() != CNeutrinoApp::mode_scart ) && ( neutrino->getMode() != CNeutrinoApp::mode_pic))
	{
		if (doInit)
			CVolumeHelper::getInstance()->refresh();

		CVolumeHelper::getInstance()->getMuteIconDimensions(&x, &y, &width, &height);
		if ((y_old != y)) {
			if (do_paint_mute_icon)
			{
				frameBuffer->fbNoCheck(true);
				this->hide();
				frameBuffer->fbNoCheck(false);
			}
			frameBuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1);
			y_old = y;
		}

		/* Infoclock should be blocked in all windows and clean the clock
		 * display with ClearDisplay() by itself before paint,
		 * so we don't do this here.
		*/
		if (!CInfoClock::getInstance()->isBlocked()){
			CInfoClock::getInstance()->ClearDisplay();
		}

		frameBuffer->fbNoCheck(true);
		if (newValue) {
			if (do_paint_mute_icon)
				this->paint();
			frameBuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1, x, y, width, height);
		}
		else {
			if (!CInfoClock::getInstance()->isBlocked()){
				CInfoClock::getInstance()->ClearDisplay();
				this->kill();
				clearSavedScreen();
			}else
				this->hide();
			frameBuffer->setFbArea(CFrameBuffer::FB_PAINTAREA_MUTEICON1);
		}
		frameBuffer->fbNoCheck(false);
		frameBuffer->blit();
	}
}
//init current position of form
void CVolumeBar::initVolumeBarPosition()
{
	CNeutrinoApp* neutrino = CNeutrinoApp::getInstance();

	switch (g_settings.volume_pos)
	{
		case VOLUMEBAR_POS_TOP_RIGHT:{
			int x_corr 	= 0;
			if (( neutrino->getMode() != CNeutrinoApp::mode_scart ) && ( neutrino->getMode() != CNeutrinoApp::mode_audio) && ( neutrino->getMode() != CNeutrinoApp::mode_pic)) {
				if ((neutrino->isMuted()) && (!g_settings.mode_clock))
					x_corr = mute_dx + h_spacer;
				if (CNeutrinoApp::getInstance()->getChannellistIsVisible() == true)
					y += std::max(39, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()) + v_spacer;
				else if (g_settings.mode_clock)
					y = clock_y + clock_height + v_spacer + OFFSET_SHADOW;
			}
			x = sw - width - x_corr;
			break;
		}
		case VOLUMEBAR_POS_TOP_LEFT:
			if (FileTimeOSD->IsVisible())
				y = clock_y + clock_height + v_spacer + OFFSET_SHADOW;
			break;
		case VOLUMEBAR_POS_BOTTOM_LEFT:
			y = (sh + frameBuffer->getScreenY()) - height - v_spacer;
			break;
		case VOLUMEBAR_POS_BOTTOM_RIGHT:
			x = sw - width;
			y = (sh + frameBuffer->getScreenY()) - height - v_spacer;
			break;
		case VOLUMEBAR_POS_TOP_CENTER:
			x = ((sw - width) / 2) + x - h_spacer/2;
			break;
		case VOLUMEBAR_POS_BOTTOM_CENTER:
			x = ((sw - width) / 2) + x - h_spacer/2;
			y = (sh + frameBuffer->getScreenY()) - height - v_spacer;
			break;
		case VOLUMEBAR_POS_HIGHER_CENTER:
			x = ((sw - width) / 2) + x - h_spacer/2;
			y = (sh + frameBuffer->getScreenY()) - sh/10;
			break;
	}
}
示例#4
0
//init current position of form
void CVolumeBar::initVolumeBarPosition()
{
	CNeutrinoApp* neutrino = CNeutrinoApp::getInstance();

	switch (g_settings.volume_pos)
	{
		case VOLUMEBAR_POS_TOP_RIGHT:{
			int x_corr 	= 0;
			if (( neutrino->getMode() != CNeutrinoApp::mode_scart ) && ( neutrino->getMode() != CNeutrinoApp::mode_audio) && ( neutrino->getMode() != CNeutrinoApp::mode_pic)) {
				if ((neutrino->isMuted()) && (!g_settings.mode_clock))
					x_corr = mute_dx + h_spacer;
				if (g_settings.mode_clock)
					y += max(clock_y + clock_height, mute_ay + mute_dy);
			}
			x = sw - width - x_corr;
			break;
		}
		case VOLUMEBAR_POS_TOP_LEFT:
			break;
		case VOLUMEBAR_POS_BOTTOM_LEFT:
			y = (sh + frameBuffer->getScreenY()) - height - v_spacer;
			break;
		case VOLUMEBAR_POS_BOTTOM_RIGHT:
			x = sw - width;
			y = (sh + frameBuffer->getScreenY()) - height - v_spacer;
			break;
		case VOLUMEBAR_POS_TOP_CENTER:
			x = ((sw - width) / 2) + x - h_spacer/2;
			break;
		case VOLUMEBAR_POS_BOTTOM_CENTER:
			x = ((sw - width) / 2) + x - h_spacer/2;
			y = (sh + frameBuffer->getScreenY()) - height - v_spacer;
			break;
		case VOLUMEBAR_POS_HIGHER_CENTER:
			x = ((sw - width) / 2) + x - h_spacer/2;
			y = (sh + frameBuffer->getScreenY()) - sh/10;
			break;
	}
}