CVolumeBar: rework volumebar handling

Use CComponenets and separates the gui part from driver part

- add new class CVolumeBar as CComponentsForm
- Various changes for reworked volume bar handling in some classes
- Move AudioMute() from CVolume to new class CAudioMute
- Use CComponentsPicture to paint muteicon
This commit is contained in:
2013-05-04 22:18:46 +02:00
committed by Michael Liebmann
parent 050df14f8d
commit 8baec6d62a
15 changed files with 644 additions and 303 deletions

View File

@@ -1,26 +1,24 @@
/*
Based up Neutrino-GUI - Tuxbox-Project
Copyright (C) 2001 by Steffen Hehn 'McClean'
volume bar - Neutrino-GUI
Copyright (C) 2001 Steffen Hehn 'McClean'
and some other guys
Homepage: http://dbox.cyberphoria.org/
Copyright (C) 2011-2012 M. Liebmann (micha-bbg)
Copyright (C) 2011-2013 M. Liebmann (micha-bbg)
License: GPL
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
@@ -29,28 +27,16 @@
#define __CVOLUME__
#include <driver/framebuffer.h>
#define ROUNDED g_settings.rounded_corners ? vbar_h/2 : 0
#include <gui/volumebar.h>
class CVolume : public CChangeObserver
{
private:
CFrameBuffer * frameBuffer;
CProgressBar *volscale;
void refreshVolumebar(int current_volume);
CVolumeBar *volscale;
int x, y, sy, sw, sh;
int mute_ax, mute_ay, mute_dy, mute_ay_old;
int mute_icon_dx, mute_icon_dy;
int icon_w, icon_h, icon_x, icon_y;
int vbar_w, vbar_h;
int progress_w, progress_h, progress_x, progress_y, pB;
int digit_w, digit_h, digit_offset, digit_x, digit_y, digit_b_x, digit_b_w;
int VolumeFont, colShadow, colBar, colFrame, colContent;
int ShadowOffset;
int rounded;
int mute_ax, mute_ay, mute_dx, mute_dy;
int m_mode;
bool paintShadow, paintDigits, MuteIconFrame;
/* volume adjustment variables */
t_channel_id channel_id;
int apid;
@@ -59,14 +45,9 @@ class CVolume : public CChangeObserver
CVolume();
~CVolume();
static CVolume* getInstance();
int spacer, mute_dx;
void Init();
void AudioMute(int newValue, bool isEvent= false);
void setvol(int vol);
void setVolume(const neutrino_msg_t key, const bool bDoPaint = true, bool nowait = false);
int getStartPosTop(){ return sy; }
int getEndPosRight(){ return sw; }
void setVolume(const neutrino_msg_t key, bool nowait = false);
void SetCurrentPid(int pid) { apid = pid; }
void SetCurrentChannel(t_channel_id id) { channel_id = id; }