mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
Merge branch 'check/next-cc'
again: it compiles, but is not really tested... Conflicts: acinclude.m4 src/driver/volume.cpp src/gui/infoviewer.cpp src/gui/osd_setup.cpp src/gui/start_wizard.cpp src/zapit/src/getservices.cpp
This commit is contained in:
@@ -665,7 +665,7 @@ record_error_msg_t CRecordInstance::MakeFileName(CZapitChannel * channel)
|
||||
return RECORD_OK;
|
||||
}
|
||||
|
||||
void CRecordInstance::GetRecordString(std::string &str)
|
||||
void CRecordInstance::GetRecordString(std::string &str, std::string &dur)
|
||||
{
|
||||
CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id);
|
||||
if(channel == NULL) {
|
||||
@@ -676,12 +676,14 @@ void CRecordInstance::GetRecordString(std::string &str)
|
||||
char stime[15];
|
||||
int err = GetStatus();
|
||||
strftime(stime, sizeof(stime), "%H:%M:%S ", localtime(&start_time));
|
||||
time_t duration = time(0) - start_time;
|
||||
time_t duration = (time(0) - start_time) / 60;
|
||||
char dtime[20];
|
||||
int h = duration/3600;
|
||||
int m = duration/60;
|
||||
snprintf(dtime, sizeof(dtime), " (%02d %s %02d min)", h, h == 1 ? "hour" : "hours", m);
|
||||
str = stime + channel->getName() + ": " + GetEpgTitle() + ((err & REC_STATUS_OVERFLOW) ? " [!]" : "") + dtime;
|
||||
int h = duration / 60;
|
||||
int m = duration - (h * 60);
|
||||
snprintf(dtime, sizeof(dtime), "(%d %s %02d %s)", h, h == 1 ? g_Locale->getText(LOCALE_RECORDING_TIME_HOUR) : g_Locale->getText(LOCALE_RECORDING_TIME_HOURS),
|
||||
m, g_Locale->getText(LOCALE_RECORDING_TIME_MIN));
|
||||
str = stime + channel->getName() + ": " + GetEpgTitle() + ((err & REC_STATUS_OVERFLOW) ? " [!] " : " ");
|
||||
dur = dtime;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@@ -697,6 +699,7 @@ CRecordManager::CRecordManager()
|
||||
//recordingstatus = 0;
|
||||
recmap.clear();
|
||||
nextmap.clear();
|
||||
durations.clear();
|
||||
autoshift = false;
|
||||
shift_timer = 0;
|
||||
check_timer = 0;
|
||||
@@ -717,6 +720,7 @@ CRecordManager::~CRecordManager()
|
||||
delete[] (unsigned char *) (*it);
|
||||
}
|
||||
nextmap.clear();
|
||||
durations.clear();
|
||||
}
|
||||
|
||||
CRecordManager * CRecordManager::getInstance()
|
||||
@@ -1372,8 +1376,9 @@ int CRecordManager::exec(CMenuTarget* parent, const std::string & actionKey )
|
||||
bool tostart = true;
|
||||
CRecordInstance * inst = FindInstance(live_channel_id);
|
||||
if (inst) {
|
||||
std::string title;
|
||||
inst->GetRecordString(title);
|
||||
std::string title, duration;
|
||||
inst->GetRecordString(title, duration);
|
||||
title += duration;
|
||||
tostart = (ShowMsgUTF(LOCALE_RECORDING_IS_RUNNING, title.c_str(),
|
||||
CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrYes);
|
||||
}
|
||||
@@ -1413,6 +1418,7 @@ bool CRecordManager::ShowMenu(void)
|
||||
CMenuForwarder * iteml;
|
||||
t_channel_id channel_ids[RECORD_MAX_COUNT] = { 0 }; /* initialization avoids false "might */
|
||||
int recording_ids[RECORD_MAX_COUNT] = { 0 }; /* be used uninitialized" warning */
|
||||
durations.clear();
|
||||
|
||||
CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select);
|
||||
|
||||
@@ -1449,8 +1455,9 @@ bool CRecordManager::ShowMenu(void)
|
||||
channel_ids[i] = inst->GetChannelId();
|
||||
recording_ids[i] = inst->GetRecordingId();
|
||||
|
||||
std::string title;
|
||||
inst->GetRecordString(title);
|
||||
std::string title, duration;
|
||||
inst->GetRecordString(title, duration);
|
||||
durations.push_back(duration);
|
||||
|
||||
const char* mode_icon = NULL;
|
||||
//if (inst->tshift_mode)
|
||||
@@ -1465,7 +1472,7 @@ bool CRecordManager::ShowMenu(void)
|
||||
rc_key = CRCInput::RC_stop;
|
||||
btn_icon = NEUTRINO_ICON_BUTTON_STOP;
|
||||
}
|
||||
item = new CMenuForwarderNonLocalized(title.c_str(), true, NULL, selector, cnt, rc_key, NULL, mode_icon);
|
||||
item = new CMenuForwarderNonLocalized(title.c_str(), true, durations[i].c_str(), selector, cnt, rc_key, NULL, mode_icon);
|
||||
item->setItemButton(btn_icon, true);
|
||||
|
||||
//if only one recording is running, set the focus to this menu item
|
||||
@@ -1508,7 +1515,7 @@ bool CRecordManager::ShowMenu(void)
|
||||
bool CRecordManager::AskToStop(const t_channel_id channel_id, const int recid)
|
||||
{
|
||||
//int recording_id = 0;
|
||||
std::string title;
|
||||
std::string title, duration;
|
||||
CRecordInstance * inst;
|
||||
|
||||
mutex.lock();
|
||||
@@ -1519,7 +1526,8 @@ bool CRecordManager::AskToStop(const t_channel_id channel_id, const int recid)
|
||||
|
||||
if(inst) {
|
||||
//recording_id = inst->GetRecordingId();
|
||||
inst->GetRecordString(title);
|
||||
inst->GetRecordString(title, duration);
|
||||
title += duration;
|
||||
}
|
||||
mutex.unlock();
|
||||
if(inst == NULL)
|
||||
|
Reference in New Issue
Block a user