Merge branch 'dvbsi++' of coolstreamtech.de:cst-private-neutrino into neutrino-apollo

This commit is contained in:
[CST] Bas
2012-09-29 19:36:44 +08:00
9 changed files with 90 additions and 5 deletions

View File

@@ -1648,6 +1648,8 @@ streaminfo.resolution Resolution
streaminfo.signal Receipt signal
streaming.busy One or several recording processes are active.\nIf you encounter this message and no recording is active, please restart Neutrino-HD.
streaming.dir_not_writable The recording directory is not writable.\nRecording will not work.
streaming.overflow Record buffer overflow, consider to stop some records
streaming.slow System/hdd too slow, consider to stop some records
streaming.write_error The recording was aborted,\nsince an error occured during the writing process.
stringinput.caps caps / no caps
stringinput.clear clear all
@@ -1797,6 +1799,8 @@ videomenu.videoformat_149 14:9
videomenu.videoformat_169 16:9
videomenu.videoformat_43 4:3
videomenu.videomode Digital video mode
wizard.initial_settings Initial settings found
wizard.install_settings Do you want to install channels for Astra 19.2°E ?
wizard.welcome_head Welcome to the Setup Wizard
wizard.welcome_text Next steps will guide you through initial installation of the device.\nImportant: Your CoolStream set-top box can be conveniently controlled\nwith the web interface for timer management or live TV on the Web browser.\nDo not make it accessible to untrusted networks!\nDo you want to continue?
word.from from

View File

@@ -129,6 +129,13 @@ void CRecordInstance::WaitRecMsg(time_t StartTime, time_t WaitTime)
usleep(100000);
}
int CRecordInstance::GetStatus()
{
if (record)
return record->GetStatus();
return 0;
}
record_error_msg_t CRecordInstance::Start(CZapitChannel * channel)
{
int fd;
@@ -642,8 +649,9 @@ void CRecordInstance::GetRecordString(std::string &str)
return;
}
char stime[15];
int err = GetStatus();
strftime(stime, sizeof(stime), "%H:%M:%S ", localtime(&start_time));
str = stime + channel->getName() + ": " + GetEpgTitle();
str = stime + channel->getName() + ": " + GetEpgTitle() + ((err & REC_STATUS_OVERFLOW) ? " [!]" : "");
}
//-------------------------------------------------------------------------
@@ -660,6 +668,9 @@ CRecordManager::CRecordManager()
nextmap.clear();
autoshift = false;
shift_timer = 0;
check_timer = 0;
error_display = true;
warn_display = true;
}
CRecordManager::~CRecordManager()
@@ -891,8 +902,15 @@ bool CRecordManager::Record(const CTimerd::RecordingInfo * const eventinfo, cons
mutex.unlock();
if (error_msg == RECORD_OK)
if (error_msg == RECORD_OK) {
if (check_timer == 0)
check_timer = g_RCInput->addTimer(5*1000*1000, false);
/* set flag to show record error if any */
error_display = true;
warn_display = true;
return true;
}
printf("[recordmanager] %s: error code: %d\n", __FUNCTION__, error_msg);
/* RestoreNeutrino must be called always if record start failed */
@@ -1115,6 +1133,8 @@ void CRecordManager::StopPostProcess()
RestoreNeutrino();
StartNextRecording();
RunStopScript();
if(!RecordingStatus())
g_RCInput->killTimer(check_timer);
}
bool CRecordManager::Update(const t_channel_id channel_id)
@@ -1147,6 +1167,27 @@ int CRecordManager::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data
StartAutoRecord();
return messages_return::handled;
}
else if(data == check_timer) {
if(CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_standby) {
mutex.lock();
int have_err = 0;
for(recmap_iterator_t it = recmap.begin(); it != recmap.end(); it++)
have_err |= it->second->GetStatus();
mutex.unlock();
//printf("%s: check status: show err %d warn %d have_err %d\n", __FUNCTION__, error_display, warn_display, have_err); //FIXME
if (have_err) {
if ((have_err & REC_STATUS_OVERFLOW) && error_display) {
error_display = false;
warn_display = false;
DisplayErrorMessage(g_Locale->getText(LOCALE_STREAMING_OVERFLOW));
} else if (warn_display) {
warn_display = false;
DisplayErrorMessage(g_Locale->getText(LOCALE_STREAMING_SLOW));
}
}
return messages_return::handled;
}
}
}
return messages_return::unhandled;
}
@@ -1418,7 +1459,7 @@ bool CRecordManager::ShowMenu(void)
bool CRecordManager::AskToStop(const t_channel_id channel_id, const int recid)
{
int recording_id = 0;
//int recording_id = 0;
std::string title;
CRecordInstance * inst;
@@ -1429,7 +1470,7 @@ bool CRecordManager::AskToStop(const t_channel_id channel_id, const int recid)
inst = FindInstance(channel_id);
if(inst) {
recording_id = inst->GetRecordingId();
//recording_id = inst->GetRecordingId();
inst->GetRecordString(title);
}
mutex.unlock();
@@ -1438,7 +1479,17 @@ bool CRecordManager::AskToStop(const t_channel_id channel_id, const int recid)
if(ShowMsgUTF(LOCALE_SHUTDOWN_RECODING_QUERY, title.c_str(),
CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes) {
#if 0
g_Timerd->stopTimerEvent(recording_id);
#endif
mutex.lock();
if (recid)
inst = FindInstanceID(recid);
else
inst = FindInstance(channel_id);
if (inst)
StopInstance(inst);
mutex.unlock();
return true;
}
return false;

View File

@@ -124,6 +124,7 @@ class CRecordInstance
bool Timeshift() { return autoshift; };
int tshift_mode;
void SetStopMessage(const char* text) {rec_stop_msg = text;} ;
int GetStatus();
CFrontend * frontend;
};
@@ -150,6 +151,9 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/
int last_mode;
bool autoshift;
uint32_t shift_timer;
uint32_t check_timer;
bool error_display;
bool warn_display;
OpenThreads::Mutex mutex;
static OpenThreads::Mutex sm;

View File

@@ -393,6 +393,7 @@ bool CMovieInfo::parseXmlTree(char */*text*/, MI_MOVIE_INFO * /*movie_info*/)
XML_GET_DATA_STRING(xam1, MI_XML_TAG_PRODUCT_COUNTRY, movie_info->productionCountry);
//if(!strcmp(xam1->GetType(), MI_XML_TAG_PRODUCT_COUNTRY)) if(xam1->GetData() != NULL)strncpy(movie_info->productionCountry, xam1->GetData(),4);
XML_GET_DATA_INT(xam1, MI_XML_TAG_PRODUCT_DATE, movie_info->productionDate);
XML_GET_DATA_INT(xam1, MI_XML_TAG_QUALITIY, movie_info->quality);
XML_GET_DATA_INT(xam1, MI_XML_TAG_QUALITY, movie_info->quality);
XML_GET_DATA_INT(xam1, MI_XML_TAG_PARENTAL_LOCKAGE, movie_info->parentalLockAge);
XML_GET_DATA_INT(xam1, MI_XML_TAG_DATE_OF_LAST_PLAY, movie_info->dateOfLastPlay);
@@ -673,6 +674,7 @@ bool CMovieInfo::parseXmlQuickFix(char *text, MI_MOVIE_INFO * movie_info)
GET_XML_DATA_STRING(text, pos, MI_XML_TAG_PRODUCT_COUNTRY, movie_info->productionCountry)
GET_XML_DATA_INT(text, pos, MI_XML_TAG_PRODUCT_DATE, movie_info->productionDate)
GET_XML_DATA_INT(text, pos, MI_XML_TAG_PARENTAL_LOCKAGE, movie_info->parentalLockAge)
GET_XML_DATA_INT(text, pos, MI_XML_TAG_QUALITIY, movie_info->quality)
GET_XML_DATA_INT(text, pos, MI_XML_TAG_QUALITY, movie_info->quality)
GET_XML_DATA_INT(text, pos, MI_XML_TAG_DATE_OF_LAST_PLAY, movie_info->dateOfLastPlay)
if (strncmp(&text[pos], MI_XML_TAG_AUDIOPIDS, sizeof(MI_XML_TAG_AUDIOPIDS) - 1) == 0)

View File

@@ -86,7 +86,8 @@
#define MI_XML_TAG_LENGTH "length"
#define MI_XML_TAG_PRODUCT_COUNTRY "productioncountry"
#define MI_XML_TAG_PRODUCT_DATE "productiondate"
#define MI_XML_TAG_QUALITY "qualitiy"
#define MI_XML_TAG_QUALITY "quality"
#define MI_XML_TAG_QUALITIY "qualitiy" // just to keep compatibility to older xml-files
#define MI_XML_TAG_PARENTAL_LOCKAGE "parentallockage"
#define MI_XML_TAG_BOOKMARK "bookmark"
#define MI_XML_TAG_BOOKMARK_START "bookmarkstart"

View File

@@ -46,6 +46,8 @@
#include "osd_setup.h"
#include "osdlang_setup.h"
#include "scan_setup.h"
#include <zapit/zapit.h>
#include <system/helpers.h>
#include <gui/widget/messagebox.h>
@@ -103,6 +105,17 @@ int CStartUpWizard::exec(CMenuTarget* parent, const string & /*actionKey*/)
res = CScanSetup::getInstance()->exec(NULL, "");
CScanSetup::getInstance()->setWizardMode(CScanSetup::SCAN_SETUP_MODE_WIZARD_NO);
}
bool init_settings = file_exists("/var/tuxbox/config/initial/");
if(init_settings && (res != menu_return::RETURN_EXIT_ALL))
{
if (ShowMsgUTF(LOCALE_WIZARD_INITIAL_SETTINGS, g_Locale->getText(LOCALE_WIZARD_INSTALL_SETTINGS),
CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes) {
system("/bin/cp /var/tuxbox/config/initial/* /var/tuxbox/config/zapit/");
CFEManager::getInstance()->loadSettings();
CFEManager::getInstance()->saveSettings();
CZapit::getInstance()->PrepareChannels();
}
}
}

View File

@@ -1675,6 +1675,8 @@ typedef enum
LOCALE_STREAMINFO_SIGNAL,
LOCALE_STREAMING_BUSY,
LOCALE_STREAMING_DIR_NOT_WRITABLE,
LOCALE_STREAMING_OVERFLOW,
LOCALE_STREAMING_SLOW,
LOCALE_STREAMING_WRITE_ERROR,
LOCALE_STRINGINPUT_CAPS,
LOCALE_STRINGINPUT_CLEAR,
@@ -1824,6 +1826,8 @@ typedef enum
LOCALE_VIDEOMENU_VIDEOFORMAT_169,
LOCALE_VIDEOMENU_VIDEOFORMAT_43,
LOCALE_VIDEOMENU_VIDEOMODE,
LOCALE_WIZARD_INITIAL_SETTINGS,
LOCALE_WIZARD_INSTALL_SETTINGS,
LOCALE_WIZARD_WELCOME_HEAD,
LOCALE_WIZARD_WELCOME_TEXT,
LOCALE_WORD_FROM,

View File

@@ -1675,6 +1675,8 @@ const char * locale_real_names[] =
"streaminfo.signal",
"streaming.busy",
"streaming.dir_not_writable",
"streaming.overflow",
"streaming.slow",
"streaming.write_error",
"stringinput.caps",
"stringinput.clear",
@@ -1824,6 +1826,8 @@ const char * locale_real_names[] =
"videomenu.videoformat_169",
"videomenu.videoformat_43",
"videomenu.videomode",
"wizard.initial_settings",
"wizard.install_settings",
"wizard.welcome_head",
"wizard.welcome_text",
"word.from",

View File

@@ -2048,6 +2048,8 @@ bool CZapit::Start(Z_start_arg *ZapStart_arg)
videoDecoder->SetAudioHandle(audioDecoder->GetHandle());
/* set initial volume with 100% */
SetVolumePercent(100);
#ifdef USE_VBI
videoDecoder->OpenVBI(1);
#endif