Merge branch 'dvbsi++' of 109.75.98.228:cst-private-neutrino into dvbsi++

This commit is contained in:
[CST] Focus
2012-03-20 11:53:48 +04:00
25 changed files with 820 additions and 356 deletions

View File

@@ -81,6 +81,7 @@ libneutrino_gui_a_SOURCES = \
settings_manager.cpp \
sleeptimer.cpp \
software_update.cpp \
start_wizard.cpp \
streaminfo2.cpp \
subchannel_select.cpp \
test_menu.cpp \

View File

@@ -10,16 +10,17 @@
#include <sys/timeb.h>
#include <time.h>
#include <sys/param.h>
#include "infoclock.h"
#include <driver/volume.h>
#include <gui/infoclock.h>
#define YOFF 0
CInfoClock::CInfoClock()
CInfoClock::CInfoClock(bool noVolume)
{
frameBuffer = CFrameBuffer::getInstance();
x = y = clock_x = 0;
time_height = time_width = thrTimer = 0;
Init();
Init(noVolume);
}
CInfoClock::~CInfoClock()
@@ -29,23 +30,34 @@ CInfoClock::~CInfoClock()
thrTimer = 0;
}
void CInfoClock::Init()
void CInfoClock::Init(bool noVolume)
{
//TOTO Give me a framebuffer->getScreenEndX ();
x = frameBuffer->getScreenWidth() + frameBuffer->getScreenX();
y = frameBuffer->getScreenY();
static int mute_dx = 0;
static int spacer = 0;
if (!noVolume) {
x = CVolume::getInstance()->getEndPosRight();
y = CVolume::getInstance()->getStartPosTop();
mute_dx = CVolume::getInstance()->mute_dx;
spacer = CVolume::getInstance()->spacer;
}
time_height = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getHeight();
int t1 = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(widest_number);
int t2 = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(":");
time_width = t1*6 + t2*2;
digit_offset = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getDigitOffset();
digit_h = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getDigitHeight();
int t1 = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(widest_number);
int t2 = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(":");
time_height = digit_h + (int)((float)digit_offset * 1.5);
time_width = t1*6 + t2*2;
clock_x = x - time_width;
if (CNeutrinoApp::getInstance()->isMuted())
clock_x -= (mute_dx + spacer);
}
int dvx, dummy;
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE,&dvx,&dummy);
dvx += (dvx/4);
x -= dvx;
clock_x = x - time_width - 10;
CInfoClock* CInfoClock::getInstance(bool noVolume)
{
static CInfoClock* InfoClock = NULL;
if(!InfoClock)
InfoClock = new CInfoClock(noVolume);
return InfoClock;
}
void CInfoClock::paintTime( bool show_dot)
@@ -57,7 +69,7 @@ void CInfoClock::paintTime( bool show_dot)
int x_diff = (time_width - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth(timestr)) / 2;
frameBuffer->paintBoxRel(clock_x, y, time_width, time_height, COL_MENUCONTENT_PLUS_0, RADIUS_SMALL);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(clock_x + x_diff, y + time_height, time_width, timestr, COL_MENUCONTENT);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(clock_x + x_diff, y + digit_h + digit_offset + ((time_height - digit_h) / 2), time_width, timestr, COL_MENUCONTENT);
}
void* CInfoClock::TimerProc(void *arg)
@@ -77,9 +89,15 @@ void* CInfoClock::TimerProc(void *arg)
return 0;
}
void CInfoClock::ClearDisplay()
{
frameBuffer->paintBackgroundBoxRel(clock_x, y, time_width, time_height);
}
void CInfoClock::StartClock()
{
Init();
CVolume::getInstance()->Init();
if(!thrTimer) {
pthread_create (&thrTimer, NULL, TimerProc, (void*) this) ;
@@ -89,6 +107,7 @@ void CInfoClock::StartClock()
void CInfoClock::StopClock()
{
CVolume::getInstance()->Init();
if(thrTimer) {
pthread_cancel(thrTimer);
thrTimer = 0;

View File

@@ -16,23 +16,24 @@ class CInfoClock
private:
CFrameBuffer * frameBuffer;
pthread_t thrTimer;
void Init();
int time_width;
int time_height;
int clock_x;
void paintTime( bool show_dot);
int y,x;
static void CleanUpProc(void* arg);
static void* TimerProc(void *arg);
pthread_t thrTimer;
void paintTime( bool show_dot);
int time_offset, digit_offset, digit_h;
int x, y, clock_x;
static void CleanUpProc(void* arg);
static void* TimerProc(void *arg);
public:
CInfoClock();
CInfoClock(bool noVolume=false);
~CInfoClock();
static CInfoClock* getInstance(bool noVolume=false);
void StartClock();
void StopClock();
void Init(bool noVolume=false);
void StartClock();
void StopClock();
void ClearDisplay();
int time_width, time_height;
};
#endif

View File

@@ -1253,7 +1253,7 @@ void CMovieBrowser::refreshMovieInfo(void)
g_PicViewer->rescaleImageDimensions(&flogo_w, &flogo_h, picw-2, pich-2);
lx = m_cBoxFrameInfo.iX+m_cBoxFrameInfo.iWidth - flogo_w -14;
ly = m_cBoxFrameInfo.iY - 1 + (m_cBoxFrameInfo.iHeight-flogo_h)/2;
g_PicViewer->DisplayImage(fname, lx+2, ly+1, flogo_w, flogo_h);
g_PicViewer->DisplayImage(fname, lx+2, ly+1, flogo_w, flogo_h, CFrameBuffer::TM_NONE);
m_pcWindow->paintVLineRel(lx, ly, flogo_h+1, COL_WHITE);
m_pcWindow->paintVLineRel(lx+flogo_w+2, ly, flogo_h+2, COL_WHITE);
m_pcWindow->paintHLineRel(lx, flogo_w+2, ly, COL_WHITE);

View File

@@ -42,6 +42,7 @@
#include <gui/widget/stringinput.h>
#include <gui/widget/stringinput_ext.h>
#include <gui/widget/hintbox.h>
#include <gui/widget/messagebox.h>
#include <global.h>
#include <neutrino.h>
@@ -72,6 +73,17 @@ CNetworkSetup::~CNetworkSetup()
//delete networkConfig;
}
CNetworkSetup* CNetworkSetup::getInstance()
{
static CNetworkSetup* me = NULL;
if(!me) {
me = new CNetworkSetup();
dprintf(DEBUG_DEBUG, "CNetworkSetup Instance created\n");
}
return me;
}
int CNetworkSetup::exec(CMenuTarget* parent, const std::string &actionKey)
{
int res = menu_return::RETURN_REPAINT;

View File

@@ -32,7 +32,6 @@
#define __network_setup__
#include <gui/widget/menue.h>
#include <gui/widget/messagebox.h>
#include <system/setting_helpers.h>
#include <system/configure_network.h>
@@ -123,6 +122,8 @@ class CNetworkSetup : public CMenuTarget, CChangeObserver
CNetworkSetup(bool wizard_mode = N_SETUP_MODE_WIZARD_NO);
~CNetworkSetup();
static CNetworkSetup* getInstance();
bool getWizardMode() {return is_wizard;};
void setWizardMode(bool mode);

View File

@@ -53,6 +53,7 @@
#include <driver/screen_max.h>
#include <driver/screenshot.h>
#include <driver/volume.h>
#include <system/debug.h>
@@ -431,10 +432,10 @@ int COsdSetup::showOsdSetup()
osd_menu->addItem(GenericMenuSeparatorLine);
//options
osd_menu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_ROUNDED_CORNERS, &g_settings.rounded_corners, MENU_CORNERSETTINGS_TYPE_OPTIONS, MENU_CORNERSETTINGS_TYPE_OPTION_COUNT, true));
osd_menu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_ROUNDED_CORNERS, &g_settings.rounded_corners, MENU_CORNERSETTINGS_TYPE_OPTIONS, MENU_CORNERSETTINGS_TYPE_OPTION_COUNT, true, this));
osd_menu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_SCRAMBLED_MESSAGE, &g_settings.scrambled_message, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
osd_menu->addItem(new CMenuOptionChooser(LOCALE_INFOVIEWER_SUBCHAN_DISP_POS, &g_settings.infobar_subchan_disp_pos, INFOBAR_SUBCHAN_DISP_POS_OPTIONS, INFOBAR_SUBCHAN_DISP_POS_OPTIONS_COUNT, true));
osd_menu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_VOLUME_POS, &g_settings.volume_pos, VOLUMEBAR_DISP_POS_OPTIONS, VOLUMEBAR_DISP_POS_OPTIONS_COUNT, true));
osd_menu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_VOLUME_POS, &g_settings.volume_pos, VOLUMEBAR_DISP_POS_OPTIONS, VOLUMEBAR_DISP_POS_OPTIONS_COUNT, true, this));
osd_menu->addItem(new CMenuOptionChooser(LOCALE_EXTRA_SHOW_MUTE_ICON, &g_settings.show_mute_icon, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
osd_menu->addItem(new CMenuOptionChooser(LOCALE_SETTINGS_MENU_POS, &g_settings.menu_pos, MENU_DISP_POS_OPTIONS, MENU_DISP_POS_OPTIONS_COUNT, true, this));
osd_menu->addItem(new CMenuOptionChooser(LOCALE_COLORMENU_FADE, &g_settings.widget_fade, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true ));
@@ -664,6 +665,11 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data)
g_InfoViewer->changePB();
return true;
}
else if ((ARE_LOCALES_EQUAL(OptionName, LOCALE_EXTRA_VOLUME_POS)) ||
(ARE_LOCALES_EQUAL(OptionName, LOCALE_EXTRA_ROUNDED_CORNERS))) {
CVolume::getInstance()->Init();
return true;
}
return false;
}

View File

@@ -43,6 +43,7 @@
#include <driver/rcinput.h>
#include <driver/screen_max.h>
#include <driver/record.h>
#include <driver/volume.h>
#include <gui/color.h>
@@ -434,7 +435,7 @@ int CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data)
case CRCInput::RC_minus:
case CRCInput::RC_left:
case CRCInput::RC_right:
CNeutrinoApp::getInstance()->setVolume(msg, true, true);
CVolume::getInstance()->setVolume(msg, true, true);
break;
default:
if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000))

124
src/gui/start_wizard.cpp Normal file
View File

@@ -0,0 +1,124 @@
/*
Neutrino-GUI - Tuxbox-Project
Copyright (C) 2001 Steffen Hehn 'McClean'
http://www.tuxbox.org
Startup wizard
based upon an implementation created by
Copyright (C) 2009 CoolStream International Ltd.
Reworked by dbt (Thilo Graf)
Copyright (C) 2012 dbt
http://www.dbox2-tuning.net
License: GPL
This software is free software; you can redistribute it and/or
modify it under the terms of the GNU Library 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,
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.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301, USA.
NOTE for ignorant distributors:
It's not allowed to distribute any compiled parts of this code, if you don't accept the terms of GPL.
Please read it and understand it right!
This means for you: Hold it, if not, leave it! You could face legal action!
Otherwise ask the copyright owners, anything else would be theft!
*/
#include "start_wizard.h"
#include <global.h>
#include <neutrino.h>
#include <neutrino_menue.h>
#include "network_setup.h"
#include "osd_setup.h"
#include "osdlang_setup.h"
#include "scan_setup.h"
#include <gui/widget/messagebox.h>
#include <video.h>
extern cVideo * videoDecoder;
using namespace std;
CStartUpWizard::CStartUpWizard()
{
}
CStartUpWizard::~CStartUpWizard()
{
}
int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
{
int res = menu_return::RETURN_REPAINT;
showBackgroundLogo();
if (parent)
parent->hide();
COsdLangSetup languageSettings(COsdLangSetup::OSDLANG_SETUP_MODE_WIZARD);
languageSettings.exec(NULL, "");
if(ShowMsgUTF (LOCALE_WIZARD_WELCOME_HEAD, g_Locale->getText(LOCALE_WIZARD_WELCOME_TEXT), CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbrCancel) == CMessageBox::mbrYes)
{
//open video settings in wizardmode
g_videoSettings->setWizardMode(CVideoSettings::V_SETUP_MODE_WIZARD);
COsdSetup osdSettings(COsdSetup::OSD_SETUP_MODE_WIZARD);
res = g_videoSettings->exec(NULL, "");
g_videoSettings->setWizardMode(CVideoSettings::V_SETUP_MODE_WIZARD_NO);
if(res != menu_return::RETURN_EXIT_ALL)
{
res = osdSettings.exec(NULL, "");
}
if(res != menu_return::RETURN_EXIT_ALL)
{
CNetworkSetup::getInstance()->setWizardMode(CNetworkSetup::N_SETUP_MODE_WIZARD);
res = CNetworkSetup::getInstance()->exec(NULL, "");
CNetworkSetup::getInstance()->setWizardMode(CNetworkSetup::N_SETUP_MODE_WIZARD_NO);
}
if(res != menu_return::RETURN_EXIT_ALL)
{
CScanSetup::getInstance()->setWizardMode(CScanSetup::SCAN_SETUP_MODE_WIZARD);
res = CScanSetup::getInstance()->exec(NULL, "");
CScanSetup::getInstance()->setWizardMode(CScanSetup::SCAN_SETUP_MODE_WIZARD_NO);
}
}
killBackgroundLogo();
return res;
}
inline void CStartUpWizard::showBackgroundLogo()
{
videoDecoder->ShowPicture(DATADIR "/neutrino/icons/start.jpg");
}
inline void CStartUpWizard::killBackgroundLogo()
{
videoDecoder->StopPicture();
}

59
src/gui/start_wizard.h Normal file
View File

@@ -0,0 +1,59 @@
/*
Neutrino-GUI - Tuxbox-Project
Copyright (C) 2001 Steffen Hehn 'McClean'
http://www.tuxbox.org
Startup wizard
based upon an implementation created by
Copyright (C) 2009 CoolStream International Ltd.
Reworked by dbt (Thilo Graf)
Copyright (C) 2012 dbt
http://www.dbox2-tuning.net
License: GPL
This software is free software; you can redistribute it and/or
modify it under the terms of the GNU Library 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,
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.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301, USA.
NOTE for ignorant distributors:
It's not allowed to distribute any compiled parts of this code, if you don't accept the terms of GPL.
Please read it and understand it right!
This means for you: Hold it, if not, leave it! You could face legal action!
Otherwise ask the copyright owners, anything else would be theft!
*/
#ifndef __start_wizard__
#define __start_wizard__
#include <global.h>
#include <neutrino.h>
#include <neutrino_menue.h>
class CStartUpWizard : public CMenuTarget
{
private:
void showBackgroundLogo();
void killBackgroundLogo();
public:
CStartUpWizard();
~CStartUpWizard();
int exec(CMenuTarget* parent, const std::string & actionKey);
};
#endif

View File

@@ -49,6 +49,7 @@
#include "gui/scan.h"
#include "gui/scan_setup.h"
#include <zapit/femanager.h>
#include <gui/widget/messagebox.h>
extern int cs_test_card(int unit, char * str);

View File

@@ -43,6 +43,7 @@
#include <gui/widget/icons.h>
#include <gui/widget/stringinput.h>
#include <gui/widget/keychooser.h>
#include <gui/widget/messagebox.h>
#include <driver/screen_max.h>