mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-15 01:13:36 +02:00
neutrino cec_setup: cec-setup moved in its own module,
now to find under misc settings, but it's probaly not the right place,
we should waiting for more user feedback or advising about it,
to find a good place for it
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1065 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: 8dd799601e
Author: Thilo Graf <dbt@novatux.de>
Date: 2011-01-26 (Wed, 26 Jan 2011)
Origin message was:
------------------
*neutrino cec_setup: cec-setup moved in its own module,
now to find under misc settings, but it's probaly not the right place,
we should waiting for more user feedback or advising about it,
to find a good place for it
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1065 e54a6e83-5905-42d5-8d5c-058d10e6a962
------------------
This commit was generated by Migit
This commit is contained in:
@@ -43,6 +43,7 @@ libneutrino_gui_a_SOURCES = \
|
||||
bookmarkmanager.cpp \
|
||||
bouquetlist.cpp \
|
||||
channellist.cpp \
|
||||
cec_setup.cpp \
|
||||
dboxinfo.cpp \
|
||||
epg_menu.cpp \
|
||||
epgplus.cpp \
|
||||
|
152
src/gui/cec_setup.cpp
Normal file
152
src/gui/cec_setup.cpp
Normal file
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
cec settings menu - Neutrino-GUI
|
||||
|
||||
Copyright (C) 2001 Steffen Hehn 'McClean'
|
||||
and some other guys
|
||||
Homepage: http://dbox.cyberphoria.org/
|
||||
|
||||
Copyright (C) 2011 T. Graf 'dbt'
|
||||
Homepage: http://www.dbox2-tuning.net/
|
||||
|
||||
License: GPL
|
||||
|
||||
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 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 General Public License for more details.
|
||||
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "gui/cec_setup.h"
|
||||
|
||||
#include <global.h>
|
||||
#include <neutrino.h>
|
||||
#include <mymenu.h>
|
||||
|
||||
#include <gui/widget/icons.h>
|
||||
|
||||
#include <driver/screen_max.h>
|
||||
|
||||
#include <system/debug.h>
|
||||
|
||||
#include <cs_api.h>
|
||||
#include <video.h>
|
||||
|
||||
extern cVideo *videoDecoder;
|
||||
|
||||
CCECSetup::CCECSetup()
|
||||
{
|
||||
frameBuffer = CFrameBuffer::getInstance();
|
||||
|
||||
width = w_max (40, 10); //%
|
||||
hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
|
||||
mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
|
||||
height = hheight+13*mheight+ 10;
|
||||
selected = -1;
|
||||
x = getScreenStartX (width);
|
||||
y = getScreenStartY (height);
|
||||
}
|
||||
|
||||
CCECSetup::~CCECSetup()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int CCECSetup::exec(CMenuTarget* parent, const std::string &/*actionKey*/)
|
||||
{
|
||||
printf("[neutrino] init cec setup...\n");
|
||||
int res = menu_return::RETURN_REPAINT;
|
||||
|
||||
if (parent)
|
||||
parent->hide();
|
||||
|
||||
showMenu();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
void CCECSetup::hide()
|
||||
{
|
||||
frameBuffer->paintBackgroundBoxRel(x,y, width, height);
|
||||
}
|
||||
|
||||
|
||||
#define VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT 3
|
||||
const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_MODE_OPTIONS[VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT] =
|
||||
{
|
||||
{ VIDEO_HDMI_CEC_MODE_OFF , LOCALE_VIDEOMENU_HDMI_CEC_MODE_OFF },
|
||||
{ VIDEO_HDMI_CEC_MODE_TUNER , LOCALE_VIDEOMENU_HDMI_CEC_MODE_TUNER },
|
||||
{ VIDEO_HDMI_CEC_MODE_RECORDER , LOCALE_VIDEOMENU_HDMI_CEC_MODE_RECORDER },
|
||||
};
|
||||
|
||||
void CCECSetup::showMenu()
|
||||
{
|
||||
//menue init
|
||||
CMenuWidget *cec = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width);
|
||||
cec->setSelected(selected);
|
||||
cec->addIntroItems(LOCALE_VIDEOMENU_HDMI_CEC);
|
||||
|
||||
//cec
|
||||
CMenuOptionChooser *cec_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_MODE, &g_settings.hdmi_cec_mode, VIDEOMENU_HDMI_CEC_MODE_OPTIONS, VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT, true, this);
|
||||
cec1 = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_VIEW_ON, &g_settings.hdmi_cec_view_on, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF, this);
|
||||
cec2 = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_STANDBY, &g_settings.hdmi_cec_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF, this);
|
||||
|
||||
cec->addItem(cec_ch);
|
||||
cec->addItem(GenericMenuSeparatorLine);
|
||||
//-------------------------------------------------------
|
||||
cec->addItem(cec1);
|
||||
cec->addItem(cec2);
|
||||
|
||||
cec->exec(NULL, "");
|
||||
cec->hide();
|
||||
selected = cec->getSelected();
|
||||
delete cec;
|
||||
}
|
||||
|
||||
void CCECSetup::setCECSettings()
|
||||
{
|
||||
printf("[neutrino CEC Settings] %s init CEC settings...\n", __FUNCTION__);
|
||||
videoDecoder->SetCECAutoStandby(g_settings.hdmi_cec_standby == 1);
|
||||
videoDecoder->SetCECAutoView(g_settings.hdmi_cec_view_on == 1);
|
||||
videoDecoder->SetCECMode((VIDEO_HDMI_CEC_MODE)g_settings.hdmi_cec_mode);
|
||||
}
|
||||
|
||||
bool CCECSetup::changeNotify(const neutrino_locale_t OptionName, void *data)
|
||||
{
|
||||
int val = 0;
|
||||
if(data)
|
||||
val = * (int *) data;
|
||||
|
||||
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC_MODE))
|
||||
{
|
||||
printf("[neutrino CEC Settings] %s set CEC settings...\n", __FUNCTION__);
|
||||
cec1->setActive(g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF);
|
||||
cec2->setActive(g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF);
|
||||
bool ret = videoDecoder->SetCECMode((VIDEO_HDMI_CEC_MODE)g_settings.hdmi_cec_mode);
|
||||
}
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC_STANDBY))
|
||||
{
|
||||
videoDecoder->SetCECAutoStandby(g_settings.hdmi_cec_standby == 1);
|
||||
}
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC_VIEW_ON))
|
||||
{
|
||||
videoDecoder->SetCECAutoView(g_settings.hdmi_cec_view_on == 1);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
59
src/gui/cec_setup.h
Normal file
59
src/gui/cec_setup.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
Mediaplayer selection menu - Neutrino-GUI
|
||||
|
||||
Copyright (C) 2001 Steffen Hehn 'McClean'
|
||||
and some other guys
|
||||
Homepage: http://dbox.cyberphoria.org/
|
||||
|
||||
Copyright (C) 2011 T. Graf 'dbt'
|
||||
Homepage: http://www.dbox2-tuning.net/
|
||||
|
||||
License: GPL
|
||||
|
||||
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 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 General Public License for more details.
|
||||
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __CEC_SETUP__
|
||||
#define __CEC_SETUP__
|
||||
|
||||
#include <gui/widget/menue.h>
|
||||
|
||||
#include <driver/framebuffer.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
class CCECSetup : public CMenuTarget, CChangeObserver
|
||||
{
|
||||
private:
|
||||
CFrameBuffer *frameBuffer;
|
||||
CMenuOptionChooser *cec1, *cec2;
|
||||
|
||||
int x, y, width, height, hheight, mheight, selected;
|
||||
|
||||
void hide();
|
||||
void showMenu();
|
||||
|
||||
|
||||
public:
|
||||
CCECSetup();
|
||||
~CCECSetup();
|
||||
void setCECSettings();
|
||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||
virtual bool changeNotify(const neutrino_locale_t OptionName, void *data);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@@ -188,14 +188,6 @@ const CMenuOptionChooser::keyval VIDEOMENU_DBDR_OPTIONS[VIDEOMENU_DBDR_OPTION_CO
|
||||
{ 2, LOCALE_VIDEOMENU_DBDR_BOTH }
|
||||
};
|
||||
|
||||
#define VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT 3
|
||||
const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_MODE_OPTIONS[VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT] =
|
||||
{
|
||||
{ VIDEO_HDMI_CEC_MODE_OFF , LOCALE_VIDEOMENU_HDMI_CEC_MODE_OFF },
|
||||
{ VIDEO_HDMI_CEC_MODE_TUNER , LOCALE_VIDEOMENU_HDMI_CEC_MODE_TUNER },
|
||||
{ VIDEO_HDMI_CEC_MODE_RECORDER , LOCALE_VIDEOMENU_HDMI_CEC_MODE_RECORDER },
|
||||
};
|
||||
|
||||
void CVideoSettings::showVideoSetup()
|
||||
{
|
||||
//init
|
||||
@@ -243,12 +235,6 @@ void CVideoSettings::showVideoSetup()
|
||||
|
||||
CMenuForwarder * vs_videomodes_fw = new CMenuForwarder(LOCALE_VIDEOMENU_ENABLED_MODES, true, NULL, videomodes, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED );
|
||||
|
||||
//cec
|
||||
CMenuSeparator *vs_cec_sep = new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_VIDEOMENU_HDMI_CEC);
|
||||
CMenuOptionChooser *vs_cec_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_MODE, &g_settings.hdmi_cec_mode, VIDEOMENU_HDMI_CEC_MODE_OPTIONS, VIDEOMENU_HDMI_CEC_MODE_OPTION_COUNT, true, this);
|
||||
cec1 = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_VIEW_ON, &g_settings.hdmi_cec_view_on, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF, this);
|
||||
cec2 = new CMenuOptionChooser(LOCALE_VIDEOMENU_HDMI_CEC_STANDBY, &g_settings.hdmi_cec_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF, this);
|
||||
|
||||
//---------------------------------------
|
||||
videosetup->addIntroItems(LOCALE_MAINSETTINGS_VIDEO, LOCALE_VIDEOMENU_TV_SCART);
|
||||
//---------------------------------------
|
||||
@@ -266,11 +252,6 @@ void CVideoSettings::showVideoSetup()
|
||||
videosetup->addItem(vs_videomodes_ch); //video system
|
||||
videosetup->addItem(vs_dbdropt_ch); //dbdr options
|
||||
videosetup->addItem(vs_videomodes_fw); //video modes submenue
|
||||
//---------------------------------------
|
||||
videosetup->addItem(vs_cec_sep); //cec
|
||||
videosetup->addItem(vs_cec_ch);
|
||||
videosetup->addItem(cec1);
|
||||
videosetup->addItem(cec2);
|
||||
|
||||
videosetup->exec(NULL, "");
|
||||
videosetup->hide();
|
||||
@@ -278,11 +259,6 @@ void CVideoSettings::showVideoSetup()
|
||||
delete videosetup;
|
||||
}
|
||||
|
||||
void CVideoSettings::setVideoCECSettings()
|
||||
{
|
||||
setVideoSettings();
|
||||
setCECSettings();
|
||||
}
|
||||
|
||||
void CVideoSettings::setVideoSettings()
|
||||
{
|
||||
@@ -311,14 +287,6 @@ void CVideoSettings::setVideoSettings()
|
||||
videoDecoder->SetDBDR(g_settings.video_dbdr);
|
||||
}
|
||||
|
||||
void CVideoSettings::setCECSettings()
|
||||
{
|
||||
printf("[neutrino VideoSettings] %s init CEC settings...\n", __FUNCTION__);
|
||||
videoDecoder->SetCECAutoStandby(g_settings.hdmi_cec_standby == 1);
|
||||
videoDecoder->SetCECAutoView(g_settings.hdmi_cec_view_on == 1);
|
||||
videoDecoder->SetCECMode((VIDEO_HDMI_CEC_MODE)g_settings.hdmi_cec_mode);
|
||||
}
|
||||
|
||||
void CVideoSettings::setupVideoSystem(bool do_ask)
|
||||
{
|
||||
printf("[neutrino VideoSettings] %s setup videosystem...\n", __FUNCTION__);
|
||||
@@ -358,20 +326,6 @@ bool CVideoSettings::changeNotify(const neutrino_locale_t OptionName, void *data
|
||||
{
|
||||
videoDecoder->SetVideoMode((analog_mode_t) g_settings.analog_mode2);
|
||||
}
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC_MODE))
|
||||
{
|
||||
cec1->setActive(g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF);
|
||||
cec2->setActive(g_settings.hdmi_cec_mode != VIDEO_HDMI_CEC_MODE_OFF);
|
||||
videoDecoder->SetCECMode((VIDEO_HDMI_CEC_MODE)g_settings.hdmi_cec_mode);
|
||||
}
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC_STANDBY))
|
||||
{
|
||||
videoDecoder->SetCECAutoStandby(g_settings.hdmi_cec_standby == 1);
|
||||
}
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC_VIEW_ON))
|
||||
{
|
||||
videoDecoder->SetCECAutoView(g_settings.hdmi_cec_view_on == 1);
|
||||
}
|
||||
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_DBDR))
|
||||
{
|
||||
videoDecoder->SetDBDR(g_settings.video_dbdr);
|
||||
|
@@ -40,7 +40,6 @@ class CVideoSettings : public CMenuWidget, CChangeObserver
|
||||
private:
|
||||
CFrameBuffer *frameBuffer;
|
||||
CMenuForwarder *SyncControlerForwarder;
|
||||
CMenuOptionChooser *cec1, *cec2;
|
||||
CMenuOptionChooser *VcrVideoOutSignalOptionChooser;
|
||||
|
||||
int vcr_video_out_signal;
|
||||
@@ -67,9 +66,7 @@ public:
|
||||
void next43Mode();
|
||||
void SwitchFormat();
|
||||
|
||||
void setVideoCECSettings();
|
||||
void setVideoSettings();
|
||||
void setCECSettings();
|
||||
void setupVideoSystem(bool do_ask);
|
||||
|
||||
bool getWizardMode() {return is_wizard;};
|
||||
|
@@ -75,6 +75,7 @@
|
||||
#include <gui/epgplus.h>
|
||||
#include <gui/streaminfo2.h>
|
||||
|
||||
#include "gui/cec_setup.h"
|
||||
#include "gui/widget/colorchooser.h"
|
||||
#include "gui/widget/menue.h"
|
||||
#include "gui/widget/messagebox.h"
|
||||
@@ -291,8 +292,8 @@ static void initGlobals(void)
|
||||
|
||||
g_Locale = new CLocaleManager;
|
||||
g_PluginList = NULL;
|
||||
InfoClock = NULL;
|
||||
g_CamHandler = NULL;
|
||||
InfoClock = NULL;
|
||||
g_CamHandler = NULL;
|
||||
}
|
||||
|
||||
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
@@ -2099,9 +2100,13 @@ int CNeutrinoApp::run(int argc, char **argv)
|
||||
audioDecoder->SetSpdifDD(g_settings.spdif_dd ? true : false);
|
||||
audioDecoder->EnableAnalogOut(g_settings.analog_out ? true : false);
|
||||
|
||||
//init video and CEC Settings
|
||||
//init video settings
|
||||
g_videoSettings = new CVideoSettings;
|
||||
g_videoSettings->setVideoCECSettings();
|
||||
g_videoSettings->setVideoSettings();
|
||||
|
||||
//init cec settings
|
||||
CCECSetup cecsetup;
|
||||
cecsetup.setCECSettings();
|
||||
|
||||
// trigger a change
|
||||
audioSetupNotifier->changeNotify(LOCALE_AUDIOMENU_AVSYNC, NULL);
|
||||
|
@@ -78,6 +78,7 @@
|
||||
#include "gui/bedit/bouqueteditor_bouquets.h"
|
||||
#include "gui/bouquetlist.h"
|
||||
#include "gui/channellist.h"
|
||||
#include "gui/cec_setup.h"
|
||||
#include "gui/color.h"
|
||||
#include "gui/customcolor.h"
|
||||
#include "gui/epg_menu.h"
|
||||
@@ -1144,6 +1145,7 @@ void CNeutrinoApp::InitMiscSettings(CMenuWidget &miscSettings)
|
||||
miscSettingsFilebrowser->addItem(new CMenuOptionChooser(LOCALE_FILEBROWSER_SHOWRIGHTS , &g_settings.filebrowser_showrights , MESSAGEBOX_NO_YES_OPTIONS , MESSAGEBOX_NO_YES_OPTION_COUNT , true ));
|
||||
miscSettingsFilebrowser->addItem(new CMenuOptionChooser(LOCALE_FILEBROWSER_DENYDIRECTORYLEAVE, &g_settings.filebrowser_denydirectoryleave, MESSAGEBOX_NO_YES_OPTIONS , MESSAGEBOX_NO_YES_OPTION_COUNT , true ));
|
||||
miscSettings.addItem( new CMenuForwarder(LOCALE_FILEBROWSER_HEAD, true, NULL, miscSettingsFilebrowser, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE) );
|
||||
miscSettings.addItem(new CMenuForwarder(LOCALE_VIDEOMENU_HDMI_CEC, true, NULL, new CCECSetup() , NULL, CRCInput::RC_0));
|
||||
|
||||
#if 0
|
||||
//infobar
|
||||
|
@@ -1264,8 +1264,8 @@ typedef enum {
|
||||
LOCALE_VIDEOMENU_HDMI_CEC,
|
||||
LOCALE_VIDEOMENU_HDMI_CEC_MODE,
|
||||
LOCALE_VIDEOMENU_HDMI_CEC_MODE_OFF,
|
||||
LOCALE_VIDEOMENU_HDMI_CEC_MODE_TUNER,
|
||||
LOCALE_VIDEOMENU_HDMI_CEC_MODE_RECORDER,
|
||||
LOCALE_VIDEOMENU_HDMI_CEC_MODE_TUNER,
|
||||
LOCALE_VIDEOMENU_HDMI_CEC_STANDBY,
|
||||
LOCALE_VIDEOMENU_HDMI_CEC_VIEW_ON,
|
||||
LOCALE_VIDEOMENU_DBDR,
|
||||
|
@@ -1264,8 +1264,8 @@ const char *locale_real_names[] = {
|
||||
"videomenu.hdmi_cec",
|
||||
"videomenu.hdmi_cec_mode",
|
||||
"videomenu.hdmi_cec_mode_off",
|
||||
"videomenu.hdmi_cec_mode_tuner",
|
||||
"videomenu.hdmi_cec_mode_recorder",
|
||||
"videomenu.hdmi_cec_mode_tuner",
|
||||
"videomenu.hdmi_cec_standby",
|
||||
"videomenu.hdmi_cec_view_on",
|
||||
"videomenu.dbdr",
|
||||
|
Reference in New Issue
Block a user