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

Origin commit data
------------------
Commit: 65437a60a8
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2014-01-28 (Tue, 28 Jan 2014)
This commit is contained in:
Stefan Seyfried
2014-01-28 13:22:00 +01:00
10 changed files with 79 additions and 38 deletions

View File

@@ -887,8 +887,12 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6
*msg = NeutrinoMessages::RELOAD_SETUP;
*data = 0;
break;
case NeutrinoMessages::EVT_HDMI_CEC_ON:
*msg = NeutrinoMessages::EVT_HDMI_CEC_ON;
case NeutrinoMessages::EVT_HDMI_CEC_VIEW_ON:
*msg = NeutrinoMessages::EVT_HDMI_CEC_VIEW_ON;
*data = 0;
break;
case NeutrinoMessages::EVT_HDMI_CEC_STANDBY:
*msg = NeutrinoMessages::EVT_HDMI_CEC_STANDBY;
*data = 0;
break;
default:

View File

@@ -435,6 +435,19 @@ int CCAMMenuHandler::handleCamMsg (const neutrino_msg_t msg, neutrino_msg_data_t
}
else if(MsgId == CA_MESSAGE_MSG_MMI_TEXT) {
printf("CCAMMenuHandler::handleCamMsg: text\n");
}
else if(MsgId == CA_MESSAGE_MSG_CHANNEL_CHANGE) {
if (!(Msg.Flags & CA_MESSAGE_HAS_PARAM1_LONG))
return -1;
t_channel_id chid = Msg.Msg.ParamLong[0];
printf("CCAMMenuHandler::handleCamMsg: CA_MESSAGE_MSG_CHANNEL_CHANGE: %" PRIx64 "\n", chid);
CZapitChannel * channel = CServiceManager::getInstance()->FindChannel48(chid);
if (!channel) {
printf("CCAMMenuHandler::handleCamMsg: channel %" PRIx64 "not found\n", chid);
return -1;
}
CNeutrinoApp::getInstance()->zapTo(channel->getChannelID());
} else
ret = -1;
//printf("CCAMMenuHandler::handleCamMsg: return %d\n", ret);

View File

@@ -763,7 +763,7 @@ int CLuaMenuForwarder::exec(CMenuTarget* /*parent*/, const std::string & /*actio
lua_pushstring(L, luaId.c_str());
int status = lua_pcall(L, 1 /* one arg */, 1 /* one result */, 0);
if (status) {
fprintf(stderr, "[CLuaInstance::%s] error in script: %s\n", __func__, lua_tostring(L, -1));
fprintf(stderr, "[CLuaMenuForwarder::%s] error in script: %s\n", __func__, lua_tostring(L, -1));
ShowMsg2UTF("Lua script error:", lua_tostring(L, -1), CMsgBox::mbrBack, CMsgBox::mbBack);
}
if (lua_isnumber(L, -1))
@@ -915,6 +915,10 @@ int CLuaInstance::MenuAddItem(lua_State *L)
std::string type; tableLookup(L, "type", type);
if (type == "back") {
m->m->addItem(GenericMenuBack);
} else if (type == "next") {
m->m->addItem(GenericMenuNext);
} else if (type == "cancel") {
m->m->addItem(GenericMenuCancel);
} else if (type == "separator") {
m->m->addItem(GenericMenuSeparator);
} else if (type == "separatorline") {

View File

@@ -124,7 +124,9 @@ void CVolumeBar::initVolumeBarPosition()
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 + h_spacer;
if (g_settings.mode_clock)
if (CNeutrinoApp::getInstance()->getChannellistIsVisible() == true)
y += std::max(39, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()) + v_spacer;
else if (g_settings.mode_clock)
y = clock_y + clock_height + v_spacer + SHADOW_OFFSET;
}
x = sw - width - x_corr;

View File

@@ -643,6 +643,7 @@ class CMenuSelectorTarget : public CMenuTarget
extern CMenuSeparator * const GenericMenuSeparator;
extern CMenuSeparator * const GenericMenuSeparatorLine;
extern CMenuForwarder * const GenericMenuBack;
extern CMenuForwarder * const GenericMenuNext;
extern CMenuForwarder * const GenericMenuCancel;
#endif

View File

@@ -231,6 +231,7 @@ CNeutrinoApp::CNeutrinoApp()
current_muted = 0;
recordingstatus = 0;
g_channel_list_changed = false;
channellist_visible = false;
}
/*-------------------------------------------------------------------------------------
@@ -2107,15 +2108,6 @@ void CNeutrinoApp::quickZap(int msg)
int res;
StopSubtitles();
printf("CNeutrinoApp::quickZap haveFreeFrontend %d\n", CFEManager::getInstance()->haveFreeFrontend());
#if 0
if(!CFEManager::getInstance()->haveFreeFrontend())
{
res = channelList->numericZap(g_settings.key_zaphistory);
StartSubtitles(res < 0);
return;
}
#endif
bool ret;
if(!bouquetList->Bouquets.empty())
ret = bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->quickZap(msg, g_settings.zap_cycle);
@@ -2474,6 +2466,7 @@ int CNeutrinoApp::showChannelList(const neutrino_msg_t _msg, bool from_menu)
{
neutrino_msg_t msg = _msg;
InfoClock->enableInfoClock(false);
channellist_visible = true;
StopSubtitles();
@@ -2557,12 +2550,24 @@ _repeat:
goto _show;
}
channellist_visible = false;
if (!from_menu)
InfoClock->enableInfoClock(true);
return ((nNewChannel >= 0) ? menu_return::RETURN_EXIT_ALL : menu_return::RETURN_REPAINT);
}
void CNeutrinoApp::zapTo(t_channel_id channel_id)
{
bool recordingStatus = CRecordManager::getInstance()->RecordingStatus(channel_id);
if (!recordingStatus || (recordingStatus && CRecordManager::getInstance()->TimeshiftOnly()) ||
(recordingStatus && channelList->SameTP(channel_id))) {
dvbsub_stop();
g_Zapit->zapTo_serviceID_NOWAIT(channel_id);
}
}
int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
{
int res = 0;
@@ -2861,14 +2866,10 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
//zap to rec channel in standby-mode
if(mode == mode_standby){
CTimerd::RecordingInfo * eventinfo = (CTimerd::RecordingInfo *) data;
bool recordingStatus = CRecordManager::getInstance()->RecordingStatus(eventinfo->channel_id);
t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID();
if( !recordingStatus && (eventinfo->channel_id != live_channel_id) && channelList->SameTP(eventinfo->channel_id) && !(SAME_TRANSPONDER(live_channel_id, eventinfo->channel_id)) ){
dvbsub_stop();
t_channel_id channel_id=eventinfo->channel_id;
g_Zapit->zapTo_serviceID_NOWAIT(channel_id);
}
if((eventinfo->channel_id != live_channel_id) && !(SAME_TRANSPONDER(live_channel_id, eventinfo->channel_id)))
zapTo(eventinfo->channel_id);
}
if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) {
@@ -2898,8 +2899,8 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
else if( msg == NeutrinoMessages::ZAPTO) {
CTimerd::EventInfo * eventinfo = (CTimerd::EventInfo *) data;
if (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID()){
if( (recordingstatus == 0) || (recordingstatus && CRecordManager::getInstance()->TimeshiftOnly()) || (recordingstatus && CFEManager::getInstance()->haveFreeFrontend()) ||
(recordingstatus && channelList->SameTP(eventinfo->channel_id)) ) {
if( (recordingstatus == 0) || (recordingstatus && CRecordManager::getInstance()->TimeshiftOnly()) ||
(recordingstatus && channelList->SameTP(eventinfo->channel_id)) ) {
bool isTVMode = CServiceManager::getInstance()->IsChannelTVChannel(eventinfo->channel_id);
dvbsub_stop();
@@ -2949,13 +2950,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
if( g_settings.recording_zap_on_announce && (mode != mode_standby) && (eventinfo->channel_id != CZapit::getInstance()->GetCurrentChannelID())) {
CRecordManager::getInstance()->StopAutoRecord();
bool recordingStatus = CRecordManager::getInstance()->RecordingStatus();
if ( !recordingStatus || (recordingStatus && CRecordManager::getInstance()->TimeshiftOnly()) || (recordingStatus && CFEManager::getInstance()->haveFreeFrontend()) ||
(recordingStatus && channelList->SameTP(eventinfo->channel_id)) ){
dvbsub_stop();
t_channel_id channel_id=eventinfo->channel_id;
g_Zapit->zapTo_serviceID_NOWAIT(channel_id);
}
zapTo(eventinfo->channel_id);
}
if(( mode != mode_scart ) && ( mode != mode_standby ) && g_settings.recording_startstop_msg) {
std::string name = g_Locale->getText(LOCALE_RECORDTIMER_ANNOUNCE);
@@ -3148,12 +3143,18 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data)
// ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EXTRA_ZAPIT_SDT_CHANGED),
// CMessageBox::mbrBack,CMessageBox::mbBack, NEUTRINO_ICON_INFO);
}
else if (msg == NeutrinoMessages::EVT_HDMI_CEC_ON) {
else if (msg == NeutrinoMessages::EVT_HDMI_CEC_VIEW_ON) {
if(g_settings.hdmi_cec_view_on)
videoDecoder->SetCECAutoView(g_settings.hdmi_cec_view_on);
return messages_return::handled;
}
else if (msg == NeutrinoMessages::EVT_HDMI_CEC_STANDBY) {
if(g_settings.hdmi_cec_standby)
videoDecoder->SetCECAutoStandby(g_settings.hdmi_cec_standby);
return messages_return::handled;
}
if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000))
delete [] (unsigned char*) data;

View File

@@ -103,6 +103,7 @@ private:
int radiosort[LIST_MODE_LAST];
CMoviePluginChangeExec *MoviePluginChanger;
bool channellist_visible;
void SDT_ReloadChannels();
void setupNetwork( bool force= false );
@@ -211,6 +212,8 @@ public:
void stopDaemonsForFlash();
int showChannelList(const neutrino_msg_t msg, bool from_menu = false);
CPersonalizeGui & getPersonalizeGui() { return personalize; }
bool getChannellistIsVisible() { return channellist_visible; }
void zapTo(t_channel_id channel_id);
};
#endif

View File

@@ -152,7 +152,8 @@ struct NeutrinoMessages {
EVT_EIT_COMPLETE = CRCInput::RC_WithData + 24, /* data: (t_channel_id *) */
EVT_BACK_ZAP_COMPLETE = CRCInput::RC_WithData + 25, /* data: (t_channel_id *) */
EVT_HDMI_CEC_ON = CRCInput::RC_WithData + 26
EVT_HDMI_CEC_VIEW_ON = CRCInput::RC_WithData + 26,
EVT_HDMI_CEC_STANDBY = CRCInput::RC_WithData + 27
};
enum
{

View File

@@ -432,30 +432,41 @@ void CControlAPI::StandbyCGI(CyhookHandler *hh)
CEC_HDMI_off = true;
}
}
//dont use CEC with standbyoff --- use: control/standby?off&cec=off
if(g_settings.hdmi_cec_view_on && CEC_HDMI_off){
videoDecoder->SetCECAutoView(0);
}
if (hh->ParamList["1"] == "on") // standby mode on
{
//dont use CEC with standbyoff (TV off) --- use: control/standby?off&cec=off
if(g_settings.hdmi_cec_standby && CEC_HDMI_off){
videoDecoder->SetCECAutoStandby(0);
}
if(CNeutrinoApp::getInstance()->getMode() != 4)
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_ON, CEventServer::INITID_HTTPD);
hh->SendOk();
if(g_settings.hdmi_cec_standby && CEC_HDMI_off){//dont use CEC with standbyoff (TV off)
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_HDMI_CEC_STANDBY, CEventServer::INITID_HTTPD);
}
}
else if (hh->ParamList["1"] == "off")// standby mode off
{
//dont use CEC with with view on (TV on) --- use: control/standby?off&cec=off
if(g_settings.hdmi_cec_view_on && CEC_HDMI_off){
videoDecoder->SetCECAutoView(0);
}
NeutrinoAPI->Zapit->setStandby(false);
if(CNeutrinoApp::getInstance()->getMode() == 4)
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::STANDBY_OFF, CEventServer::INITID_HTTPD);
hh->SendOk();
if(g_settings.hdmi_cec_view_on && CEC_HDMI_off){//dont use CEC with view on (TV on)
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_HDMI_CEC_VIEW_ON, CEventServer::INITID_HTTPD);
}
}
else
hh->SendError();
if(g_settings.hdmi_cec_view_on && CEC_HDMI_off){//dont use CEC with standbyoff
NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::EVT_HDMI_CEC_ON, CEventServer::INITID_HTTPD);
}
}
else
if(CNeutrinoApp::getInstance()->getMode() == 4)//mode_standby = 4

View File

@@ -130,7 +130,8 @@ CNeutrinoAPI::CNeutrinoAPI()
EventServer->registerEvent2( NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
EventServer->registerEvent2( NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
EventServer->registerEvent2( NeutrinoMessages::RELOAD_SETUP, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");//reload neutrino conf
EventServer->registerEvent2( NeutrinoMessages::EVT_HDMI_CEC_ON, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
EventServer->registerEvent2( NeutrinoMessages::EVT_HDMI_CEC_VIEW_ON, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
EventServer->registerEvent2( NeutrinoMessages::EVT_HDMI_CEC_STANDBY, CEventServer::INITID_HTTPD, "/tmp/neutrino.sock");
}
//-------------------------------------------------------------------------