Merge remote-tracking branch 'check/next-cc'

needs some build-fixing and merge errors are likely :-(

Conflicts:
	configure.ac
	data/icons/start.jpg
	data/locale/deutsch.locale
	data/locale/unmaintained/dutch.locale
	lib/libdvbsub/Makefile.am
	lib/libdvbsub/dvbsubtitle.cpp
	lib/libtuxtxt/Makefile.am
	src/Makefile.am
	src/daemonc/Makefile.am
	src/driver/audiodec/Makefile.am
	src/driver/framebuffer.cpp
	src/driver/framebuffer.h
	src/driver/pictureviewer/Makefile.am
	src/driver/rcinput.cpp
	src/driver/streamts.cpp
	src/driver/volume.cpp
	src/eitd/Makefile.am
	src/gui/Makefile.am
	src/gui/audioplayer.cpp
	src/gui/bedit/Makefile.am
	src/gui/bedit/bouqueteditor_chanselect.cpp
	src/gui/bouquetlist.cpp
	src/gui/channellist.cpp
	src/gui/components/Makefile.am
	src/gui/epgview.cpp
	src/gui/eventlist.cpp
	src/gui/infoviewer.cpp
	src/gui/infoviewer_bb.cpp
	src/gui/keybind_setup.cpp
	src/gui/moviebrowser.cpp
	src/gui/movieplayer.cpp
	src/gui/scan.cpp
	src/gui/scan_setup.cpp
	src/gui/test_menu.cpp
	src/gui/test_menu.h
	src/gui/update.cpp
	src/gui/videosettings.cpp
	src/gui/widget/Makefile.am
	src/gui/widget/buttons.cpp
	src/gui/widget/stringinput.cpp
	src/neutrino.cpp
	src/nhttpd/tuxboxapi/coolstream/Makefile.am
	src/system/Makefile.am
	src/system/setting_helpers.cpp
	src/system/settings.h
	src/zapit/include/zapit/client/zapitclient.h
	src/zapit/include/zapit/femanager.h
	src/zapit/include/zapit/getservices.h
	src/zapit/lib/zapitclient.cpp
	src/zapit/src/Makefile.am
	src/zapit/src/capmt.cpp
	src/zapit/src/femanager.cpp
	src/zapit/src/frontend.cpp
	src/zapit/src/getservices.cpp
This commit is contained in:
Stefan Seyfried
2013-05-10 10:06:47 +02:00
213 changed files with 11183 additions and 4823 deletions

View File

@@ -1,27 +1,25 @@
/*
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) 2012 Stefan Seyfried
Copyright (C) 2011-2013 M. Liebmann (micha-bbg)
Copyright (C) 2012,2013 Stefan Seyfried
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.
*/
@@ -40,11 +38,9 @@
#include <system/helpers.h>
#include <daemonc/remotecontrol.h>
#include <driver/volume.h>
#include <gui/audiomute.h>
#include <zapit/zapit.h>
#if HAVE_COOL_HARDWARE
#include <gui/components/cc_item_progressbar.h>
#endif
#define VOLUME_SCRIPT CONFIGDIR "/volume.sh"
@@ -55,21 +51,13 @@ CVolume::CVolume()
{
frameBuffer = CFrameBuffer::getInstance();
volscale = NULL;
#if 0
g_Zapit = new CZapitClient;
g_RCInput = new CRCInput;
v_RemoteControl = new CRemoteControl;
#endif
VolumeFont = SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO;
paintShadow = false; // For future On/Off switch shadow
MuteIconFrame = false; // For future On/Off switch IconFrame
ShadowOffset = 4;
mute_ax = 0;
mute_ay = 0;
mute_dx = 0;
mute_dy = 0;
m_mode = CNeutrinoApp::getInstance()->getMode();
channel_id = 0;
apid = 0;
Init();
}
CVolume::~CVolume()
@@ -77,120 +65,6 @@ CVolume::~CVolume()
delete volscale;
}
void CVolume::Init()
{
paintDigits = g_settings.volume_digits;
mute_ay_old = mute_ay;
int faktor_h = 18; // scale * 10
int clock_height= 0;
int clock_width = 0;
pB = 2; // progress border
spacer = 8;
colBar = COL_MENUCONTENT_PLUS_0;
colFrame = COL_MENUCONTENT_PLUS_3;
colContent = COL_MENUCONTENT;
colShadow = COL_MENUCONTENTDARK_PLUS_0;
x = frameBuffer->getScreenX();
y = sy = frameBuffer->getScreenY() + spacer / 2;
sw = g_settings.screen_EndX - spacer;
sh = frameBuffer->getScreenHeight();
frameBuffer->getIconSize(NEUTRINO_ICON_VOLUME, &icon_w, &icon_h);
progress_h = icon_h - 2*pB;
progress_w = 200;
vbar_w = spacer + icon_w + spacer + progress_w + spacer;
digit_h = 0;
digit_offset = 0;
if (paintDigits) {
digit_w = g_Font[VolumeFont]->getRenderWidth("100");
digit_offset = g_Font[VolumeFont]->getDigitOffset();
digit_h = g_Font[VolumeFont]->getDigitHeight();
progress_h = std::max(icon_h, digit_h);
vbar_w += digit_w;
}
vbar_h = std::max((icon_h * faktor_h) / 10, digit_h+digit_offset);
if (volscale)
delete volscale;
volscale = new CProgressBar(progress_x, progress_y, progress_w, progress_h, colFrame, colBar, colShadow, COL_MENUCONTENT_PLUS_3, COL_MENUCONTENT_PLUS_1, true);
volscale->setInvert();
volscale->setFrameThickness(2);
// mute icon
mute_icon_dx = 0;
mute_icon_dy = 0;
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE, &mute_icon_dx, &mute_icon_dy);
mute_dx = mute_icon_dx;
mute_dy = mute_icon_dy;
mute_dx += mute_icon_dx / 4;
mute_dy += mute_icon_dx / 4;
mute_ax = sw - mute_dx;
mute_ay = y;
CNeutrinoApp* neutrino = CNeutrinoApp::getInstance();
if ((g_settings.mode_clock) && (g_settings.volume_pos == 0)) {
// Clock and MuteIcon in a line.
clock_height = CInfoClock::getInstance(true)->time_height;
clock_width = CInfoClock::getInstance(true)->time_width;
mute_ay += (clock_height - mute_dy) / 2;
}
else {
// Volume level and MuteIcon in a line.
if (mute_dy > vbar_h)
y += (mute_dy - vbar_h) / 2;
else
mute_ay += (vbar_h - mute_dy) / 2;
}
if ((g_settings.mode_clock) && (!neutrino->isMuted()))
frameBuffer->paintBackgroundBoxRel(sw - clock_width, y, clock_width, clock_height);
//printf("\n##### [volume.cpp Zeile %d] mute_ax %d, mute_dx %d\n \n", __LINE__, mute_ax, mute_dx);
switch (g_settings.volume_pos)
{
case 0:{// upper 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 + spacer;
if (g_settings.mode_clock)
y += clock_height + spacer / 2;
}
x = sw - vbar_w - x_corr;
break;
}
case 1:// upper left
break;
case 2:// bottom left
y = sh - vbar_h;
break;
case 3:// bottom right
x = sw - vbar_w;
y = sh - vbar_h;
break;
case 4:// center default
x = ((sw - vbar_w) / 2) + x;
break;
case 5:// center higher
x = ((sw - vbar_w) / 2) + x;
y = sh - sh/15;
break;
}
icon_x = x + spacer;
icon_y = y + ((vbar_h - icon_h) / 2);
progress_x = icon_x + icon_w + spacer;
progress_y = y + ((vbar_h - progress_h) / 2);
if (paintDigits) {
digit_x = progress_x + progress_w + spacer/2;
digit_y = y + digit_h + digit_offset + ((vbar_h - digit_h) / 2);
digit_b_x = digit_x - spacer/4;
digit_b_w = vbar_w - (digit_b_x - x);
}
}
CVolume* CVolume::getInstance()
{
static CVolume* Volume = NULL;
@@ -199,38 +73,12 @@ CVolume* CVolume::getInstance()
return Volume;
}
void CVolume::AudioMute(int newValue, bool isEvent)
{
if (!g_Zapit) /* don't die... */
return;
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_audio) && ( neutrino->getMode() != CNeutrinoApp::mode_pic))
{
if ((mute_ay_old != mute_ay) && (mute_ay_old > 0))
frameBuffer->paintBackgroundBoxRel(mute_ax, mute_ay_old, mute_dx, mute_dy);
if ((g_settings.mode_clock) && (doInit))
CInfoClock::getInstance(true)->ClearDisplay();
frameBuffer->paintMuteIcon(newValue, mute_ax, mute_ay, mute_dx, mute_dy, MuteIconFrame);
if (doInit) {
Init();
CInfoClock::getInstance(true)->Init(true);
}
}
}
void CVolume::setvol(int vol)
{
//audioDecoder->setVolume(vol, vol);
CZapit::getInstance()->SetVolume(vol);
}
void CVolume::setVolume(const neutrino_msg_t key, const bool bDoPaint, bool nowait)
void CVolume::setVolume(const neutrino_msg_t key, bool nowait)
{
if (!g_RCInput) /* don't die... */
return;
@@ -241,34 +89,25 @@ void CVolume::setVolume(const neutrino_msg_t key, const bool bDoPaint, bool nowa
if (msg <= CRCInput::RC_MaxRC) {
if(m_mode != mode) {
m_mode = mode;
Init();
setVolume(msg);
return;
}
}
int vol = g_settings.current_volume;
fb_pixel_t * pixbuf = NULL;
if (bDoPaint && do_vol) {
pixbuf = new fb_pixel_t[(vbar_w+ShadowOffset) * (vbar_h+ShadowOffset)];
if(pixbuf!= NULL)
frameBuffer->SaveScreen(x, y, vbar_w+ShadowOffset, vbar_h+ShadowOffset, pixbuf);
if (volscale){
volscale->hide();
delete volscale;
volscale = NULL;
}
// volumebar shadow
if (paintShadow)
frameBuffer->paintBoxRel(x+ShadowOffset , y+ShadowOffset , (paintDigits) ? vbar_w - vbar_h : vbar_w + 1, vbar_h, colShadow, ROUNDED, (paintDigits) ? CORNER_TOP_LEFT | CORNER_BOTTOM_LEFT : CORNER_ALL);
// volumebar
frameBuffer->paintBoxRel(x , y , (paintDigits) ? vbar_w - vbar_h : vbar_w + 1, vbar_h, colBar, ROUNDED, (paintDigits) ? CORNER_TOP_LEFT | CORNER_BOTTOM_LEFT : CORNER_ALL);
// volume icon
frameBuffer->paintIcon(NEUTRINO_ICON_VOLUME, icon_x, icon_y, 0, colBar);
volscale->reset();
refreshVolumebar(vol);
if (volscale == NULL){
volscale = new CVolumeBar();
volscale->paint();
}
neutrino_msg_data_t data;
uint64_t timeoutEnd;
int vol = g_settings.current_volume;
do {
if (msg <= CRCInput::RC_MaxRC)
@@ -290,18 +129,19 @@ void CVolume::setVolume(const neutrino_msg_t key, const bool bDoPaint, bool nowa
} else
do_vol = true;
if (CNeutrinoApp::getInstance()->isMuted() && (dir > 0 || g_settings.current_volume > 0)) {
if (pixbuf != NULL) {
frameBuffer->RestoreScreen(x, y, vbar_w+ShadowOffset, vbar_h+ShadowOffset, pixbuf);
delete [] pixbuf;
if (volscale){
if (volscale->isPainted())
volscale->hide();
delete volscale;
volscale = NULL;
}
if (do_vol) {
AudioMute(false, true);
Init();
CAudioMute::getInstance()->AudioMute(false, true);
setVolume(msg);
return;
}
}
if (do_vol && !CNeutrinoApp::getInstance()->isMuted()) {
/* current_volume is char, we need signed to catch v < 0 */
int v = g_settings.current_volume;
@@ -312,12 +152,13 @@ void CVolume::setVolume(const neutrino_msg_t key, const bool bDoPaint, bool nowa
v = 0;
g_settings.current_volume = 0;
if (g_settings.show_mute_icon) {
if (pixbuf != NULL) {
frameBuffer->RestoreScreen(x, y, vbar_w+ShadowOffset, vbar_h+ShadowOffset, pixbuf);
delete []pixbuf;
if (volscale) {
if (volscale->isPainted())
volscale->hide();
delete volscale;
volscale = NULL;
}
AudioMute(true, true);
Init();
CAudioMute::getInstance()->AudioMute(true, true);
setVolume(msg);
return;
}
@@ -344,10 +185,10 @@ void CVolume::setVolume(const neutrino_msg_t key, const bool bDoPaint, bool nowa
break;
}
if (pixbuf) {
if (volscale) {
if(vol != g_settings.current_volume) {
vol = g_settings.current_volume;
refreshVolumebar(g_settings.current_volume);
volscale->repaintVolScale();
}
}
@@ -357,31 +198,14 @@ void CVolume::setVolume(const neutrino_msg_t key, const bool bDoPaint, bool nowa
}
} while (msg != CRCInput::RC_timeout);
if (pixbuf != NULL) {
frameBuffer->RestoreScreen(x, y, vbar_w+ShadowOffset, vbar_h+ShadowOffset, pixbuf);
delete [] pixbuf;
if (volscale) {
if (volscale->isPainted())
volscale->hide();
delete volscale;
volscale = NULL;
}
}
void CVolume::refreshVolumebar(int current_volume)
{
if (paintDigits) {
// shadow for erase digits
if (paintShadow)
frameBuffer->paintBoxRel(digit_b_x+ShadowOffset, y+ShadowOffset, digit_b_w, vbar_h, colShadow, ROUNDED, CORNER_TOP_RIGHT | CORNER_BOTTOM_RIGHT);
// erase digits
frameBuffer->paintBoxRel(digit_b_x, y, digit_b_w, vbar_h, colBar, ROUNDED, CORNER_TOP_RIGHT | CORNER_BOTTOM_RIGHT);
// digits
char buff[4];
snprintf(buff, 4, "%3d", current_volume);
g_Font[VolumeFont]->RenderString(digit_x, digit_y, digit_w, buff, colContent);
}
// progressbar
volscale->setValues(current_volume, 100);
volscale->paint();
frameBuffer->blit();
}
bool CVolume::changeNotify(const neutrino_locale_t OptionName, void * data)
{
bool ret = false;