コード例 #1
0
//calculates size referred for possible activated clock or/and mute icon
void CVolumeBar::initVolumeBarSize()
{
	CVolumeHelper *cvh = CVolumeHelper::getInstance();
	cvh->refresh();
	cvh->getSpacer(&h_spacer, &v_spacer);
	cvh->getDimensions(&x, &y, &sw, &sh, &vb_icon_w, &vb_digit_w);
	cvh->getVolBarDimensions(&y, &height);

	//vb_digit_w += corner_rad/2;

	//scale
	vb_pbw 		= CFrameBuffer::getInstance()->scale2Res(200);
	vb_pbh 		= height-2*vb_item_offset;

	//result for width
	width = (vb_icon_w + vb_pbw + vb_digit_w) + 4*vb_item_offset + corner_rad/2;

	//adapt x-pos
	vb_pbx 		= vb_item_offset + vb_icon_w + vb_item_offset;
	vb_icon_x 	= vb_pbx/2 - vb_icon_w/2 + vb_item_offset;
	vb_digit_x	= vb_pbx + vb_pbw + vb_item_offset;

	// mute icon
	cvh->getMuteIconDimensions(&mute_ax, &mute_ay, &mute_dx, &mute_dy);
	// info clock
	int dummy;
	cvh->getInfoClockDimensions(&dummy, &clock_y, &clock_width, &clock_height);
	int mute_corrY = 0;
	if (mute_dy < height)
		mute_corrY = (height - mute_dy) / 2;
	cvh->setMuteIconCorrY(mute_corrY);

	vb_pby 		= height/2-vb_pbh/2;
}
コード例 #2
0
//calculates size referred for possible activated clock or/and mute icon
void CVolumeBar::initVolumeBarSize()
{
	CVolumeHelper *cvh = CVolumeHelper::getInstance();
	cvh->getSpacer(&h_spacer, &v_spacer);
	cvh->getDimensions(&x, &y, &sw, &sh, &vb_icon_w, &vb_digit_w);
	cvh->getVolBarDimensions(&y, &height);

	vb_digit_w += cornerRad()/2;

	//scale
	vb_pbw 		= 200;
	vb_pbh 		= height-4*vb_item_offset;

	//adapt x-pos
	vb_icon_x 	= vb_item_offset;
	vb_pbx 		= vb_icon_x + vb_icon_w + vb_item_offset;
	vb_digit_x	= vb_pbx + vb_pbw + vb_item_offset;

	//result for width
	width = (vb_icon_w + vb_pbw + vb_digit_w) + 4*vb_item_offset;

	// mute icon
	cvh->getMuteIconDimensions(&mute_ax, &mute_ay, &mute_dx, &mute_dy);
	// info clock
	int dummy;
	cvh->getInfoClockDimensions(&dummy, &clock_y, &clock_width, &clock_height, &dummy, &dummy);
	int mute_corrY = 0;
	if (mute_dy < height)
		mute_corrY = (height - mute_dy) / 2;
	cvh->setMuteIconCorrY(mute_corrY);

	if ((g_settings.mode_clock) && (!CNeutrinoApp::getInstance()->isMuted()))
		CInfoClock::getInstance()->ClearDisplay();

	vb_pbh 		= height-8;
	vb_pby 		= height/2-vb_pbh/2;
}