mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 09:51:13 +02:00
volumebar: formatting code using astyle; some manual code nicenings
Origin commit data
------------------
Commit: e36272f4ac
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-12-04 (Sat, 04 Dec 2021)
Origin message was:
------------------
- volumebar: formatting code using astyle; some manual code nicenings
This commit is contained in:
@@ -42,7 +42,6 @@ extern CTimeOSD *FileTimeOSD;
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
CVolumeBar::CVolumeBar()
|
||||
{
|
||||
initVarVolumeBar();
|
||||
@@ -126,9 +125,11 @@ void CVolumeBar::initVolumeBarPosition()
|
||||
|
||||
switch (g_settings.volume_pos)
|
||||
{
|
||||
case VOLUMEBAR_POS_TOP_RIGHT:{
|
||||
case VOLUMEBAR_POS_TOP_RIGHT:
|
||||
{
|
||||
int x_corr = 0;
|
||||
if ((neutrino->getMode() != NeutrinoModes::mode_avinput) && (neutrino->getMode() != NeutrinoModes::mode_audio) && (neutrino->getMode() != NeutrinoModes::mode_pic)) {
|
||||
if ((neutrino->getMode() != NeutrinoModes::mode_avinput) && (neutrino->getMode() != NeutrinoModes::mode_audio) && (neutrino->getMode() != NeutrinoModes::mode_pic))
|
||||
{
|
||||
if ((neutrino->isMuted()) && (!g_settings.mode_clock))
|
||||
x_corr = mute_dx + h_spacer;
|
||||
if (CNeutrinoApp::getInstance()->getChannellistIsVisible() == true)
|
||||
@@ -180,7 +181,8 @@ void CVolumeBar::initVolumeBarItems()
|
||||
// init current icon object
|
||||
void CVolumeBar::initVolumeBarIcon()
|
||||
{
|
||||
if (!vb_icon){
|
||||
if (!vb_icon)
|
||||
{
|
||||
vb_icon = new CComponentsPicture(vb_icon_x, CC_CENTERED, vb_icon_w, height, NEUTRINO_ICON_VOLUME);
|
||||
// add icon to container
|
||||
addCCItem(vb_icon);
|
||||
@@ -194,7 +196,8 @@ void CVolumeBar::initVolumeBarIcon()
|
||||
// create new scale
|
||||
void CVolumeBar::initVolumeBarScale()
|
||||
{
|
||||
if (!vb_pb){
|
||||
if (!vb_pb)
|
||||
{
|
||||
vb_pb = new CProgressBar();
|
||||
// add progressbar to container
|
||||
addCCItem(vb_pb);
|
||||
@@ -232,13 +235,13 @@ void CVolumeBar::paintVolumeBarDigit()
|
||||
vb_digit->paint(CC_SAVE_SCREEN_NO);
|
||||
}
|
||||
|
||||
|
||||
// refresh progressbar and digit
|
||||
void CVolumeBar::repaintVolScale()
|
||||
{
|
||||
paintVolScale();
|
||||
|
||||
if (g_settings.volume_digits) {
|
||||
if (g_settings.volume_digits)
|
||||
{
|
||||
initVolumeBarDigitValue();
|
||||
paintVolumeBarDigit();
|
||||
}
|
||||
@@ -263,9 +266,7 @@ void CVolumeBar::paint(const bool &do_save_bg)
|
||||
repaintVolScale();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// CVolumeHelper ####################################################################################################
|
||||
// CVolumeHelper ##############################################################
|
||||
|
||||
CVolumeHelper::CVolumeHelper()
|
||||
{
|
||||
@@ -283,11 +284,13 @@ CVolumeHelper::CVolumeHelper()
|
||||
|
||||
void CVolumeHelper::resetFont()
|
||||
{
|
||||
if (vb_font){
|
||||
if (vb_font)
|
||||
{
|
||||
vb_font = NULL;
|
||||
dprintf(DEBUG_INFO, "\033[33m[CVolumeHelper][%s - %d] reset vb font \033[0m\n", __func__, __LINE__);
|
||||
}
|
||||
if (clock_font){
|
||||
if (clock_font)
|
||||
{
|
||||
clock_font = NULL;
|
||||
dprintf(DEBUG_INFO, "\033[33m[CVolumeHelper][%s - %d] reset clock font \033[0m\n", __func__, __LINE__);
|
||||
}
|
||||
@@ -308,7 +311,8 @@ void CVolumeHelper::Init(Font* font)
|
||||
|
||||
void CVolumeHelper::initInfoClock(Font *font)
|
||||
{
|
||||
if (font == NULL) {
|
||||
if (font == NULL)
|
||||
{
|
||||
int dx = 0;
|
||||
int dy = g_settings.infoClockFontSize;
|
||||
clock_font = *CNeutrinoFonts::getInstance()->getDynFont(dx, dy, g_settings.infoClockSeconds ? "%H:%M:%S" : "%H:%M");
|
||||
@@ -330,13 +334,15 @@ void CVolumeHelper::initInfoClock(Font* font)
|
||||
vol_ay = y;
|
||||
mute_corrY = 0;
|
||||
|
||||
if (g_settings.mode_clock) {
|
||||
if (g_settings.mode_clock)
|
||||
{
|
||||
if (mute_dy > clock_dy)
|
||||
clock_ay += (mute_dy - clock_dy) / 2;
|
||||
else
|
||||
mute_corrY = (clock_dy - mute_dy) / 2;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
if (mute_dy > vol_height)
|
||||
vol_ay += (mute_dy - vol_height) / 2;
|
||||
else
|
||||
@@ -366,7 +372,8 @@ void CVolumeHelper::initVolBarSize()
|
||||
g_settings.volume_size = max(g_settings.volume_size, icon_height);
|
||||
vol_height = CFrameBuffer::getInstance()->scale2Res(g_settings.volume_size);
|
||||
|
||||
if (g_settings.volume_digits) {
|
||||
if (g_settings.volume_digits)
|
||||
{
|
||||
CNeutrinoFonts *cnf = CNeutrinoFonts::getInstance();
|
||||
cnf->setFontUseDigitHeight(true);
|
||||
int tmp_h = vol_height;
|
||||
|
@@ -86,13 +86,12 @@ class CVolumeBar : public CComponentsForm
|
||||
};
|
||||
|
||||
CVolumeBar(/*int current_volume*/);
|
||||
// ~CVolumeBar(); inherited from CComponentsForm
|
||||
//~CVolumeBar(); // inherited from CComponentsForm
|
||||
|
||||
void repaintVolScale();
|
||||
void paint(const bool &do_save_bg = CC_SAVE_SCREEN_YES);
|
||||
};
|
||||
|
||||
|
||||
class CVolumeHelper
|
||||
{
|
||||
private:
|
||||
|
Reference in New Issue
Block a user