mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
driver/record.cpp: fix get timeshift file name;
adapt menu for GetRecordMode() mask; comment unused code
This commit is contained in:
@@ -735,10 +735,15 @@ MI_MOVIE_INFO * CRecordManager::GetMovieInfo(t_channel_id channel_id, bool times
|
|||||||
return mi;
|
return mi;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string CRecordManager::GetFileName(t_channel_id channel_id)
|
const std::string CRecordManager::GetFileName(t_channel_id channel_id, bool timeshift)
|
||||||
{
|
{
|
||||||
std::string filename;
|
std::string filename;
|
||||||
CRecordInstance * inst = FindInstance(channel_id);
|
CRecordInstance * inst = NULL;
|
||||||
|
if (timeshift)
|
||||||
|
inst = FindTimeshift();
|
||||||
|
if (inst == NULL)
|
||||||
|
inst = FindInstance(channel_id);
|
||||||
|
|
||||||
if(inst)
|
if(inst)
|
||||||
filename = inst->GetFileName();
|
filename = inst->GetFileName();
|
||||||
return filename;
|
return filename;
|
||||||
@@ -1147,6 +1152,7 @@ int CRecordManager::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data
|
|||||||
return messages_return::unhandled;
|
return messages_return::unhandled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
bool CRecordManager::IsTimeshift(t_channel_id channel_id)
|
bool CRecordManager::IsTimeshift(t_channel_id channel_id)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
@@ -1185,6 +1191,7 @@ void CRecordManager::SetTimeshiftMode(CRecordInstance * inst, int mode)
|
|||||||
if (inst)
|
if (inst)
|
||||||
inst->tshift_mode = mode;
|
inst->tshift_mode = mode;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void CRecordManager::StartTimeshift()
|
void CRecordManager::StartTimeshift()
|
||||||
{
|
{
|
||||||
@@ -1326,11 +1333,13 @@ bool CRecordManager::ShowMenu(void)
|
|||||||
|
|
||||||
// Record / Timeshift
|
// Record / Timeshift
|
||||||
t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID();
|
t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID();
|
||||||
bool status_ts = IsTimeshift(live_channel_id);
|
|
||||||
bool status_rec = RecordingStatus(live_channel_id) && !status_ts;
|
int rec_mode = GetRecordMode(live_channel_id);
|
||||||
|
bool status_ts = rec_mode & RECMODE_TSHIFT;
|
||||||
|
//bool status_rec = rec_mode & RECMODE_REC;
|
||||||
|
|
||||||
//record item
|
//record item
|
||||||
iteml = new CMenuForwarder(LOCALE_RECORDINGMENU_MULTIMENU_REC_AKT, (!status_rec && !status_ts), NULL,
|
iteml = new CMenuForwarder(LOCALE_RECORDINGMENU_MULTIMENU_REC_AKT, true /*!status_rec*/, NULL,
|
||||||
this, "Record", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
|
this, "Record", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
|
||||||
//if no recordings are running, set the focus to the record menu item
|
//if no recordings are running, set the focus to the record menu item
|
||||||
menu.addItem(iteml, rec_count == 0 ? true: false);
|
menu.addItem(iteml, rec_count == 0 ? true: false);
|
||||||
@@ -1488,8 +1497,11 @@ bool CRecordManager::CutBackNeutrino(const t_channel_id channel_id, CFrontend *
|
|||||||
printf("%s channel_id %llx mode %d\n", __FUNCTION__, channel_id, mode);
|
printf("%s channel_id %llx mode %d\n", __FUNCTION__, channel_id, mode);
|
||||||
|
|
||||||
last_mode = CNeutrinoApp::getInstance()->getMode();
|
last_mode = CNeutrinoApp::getInstance()->getMode();
|
||||||
if(last_mode == NeutrinoMessages::mode_standby && recmap.empty())
|
if(last_mode == NeutrinoMessages::mode_standby && recmap.empty()) {
|
||||||
g_Zapit->setStandby(false); // this zap to live_channel_id
|
g_Zapit->setStandby(false); // this zap to live_channel_id
|
||||||
|
/* wait for zapit wakeup */
|
||||||
|
g_Zapit->getMode();
|
||||||
|
}
|
||||||
|
|
||||||
t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID();
|
t_channel_id live_channel_id = CZapit::getInstance()->GetCurrentChannelID();
|
||||||
|
|
||||||
|
@@ -163,7 +163,7 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/
|
|||||||
CRecordInstance * FindInstance(t_channel_id);
|
CRecordInstance * FindInstance(t_channel_id);
|
||||||
CRecordInstance * FindInstanceID(int recid);
|
CRecordInstance * FindInstanceID(int recid);
|
||||||
CRecordInstance * FindTimeshift();
|
CRecordInstance * FindTimeshift();
|
||||||
void SetTimeshiftMode(CRecordInstance * inst=NULL, int mode=TSHIFT_MODE_OFF);
|
//void SetTimeshiftMode(CRecordInstance * inst=NULL, int mode=TSHIFT_MODE_OFF);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum record_modes_t
|
enum record_modes_t
|
||||||
@@ -191,7 +191,7 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/
|
|||||||
bool StopAutoRecord(bool lock = true);
|
bool StopAutoRecord(bool lock = true);
|
||||||
|
|
||||||
MI_MOVIE_INFO * GetMovieInfo(const t_channel_id channel_id, bool timeshift = true);
|
MI_MOVIE_INFO * GetMovieInfo(const t_channel_id channel_id, bool timeshift = true);
|
||||||
const std::string GetFileName(const t_channel_id channel_id);
|
const std::string GetFileName(const t_channel_id channel_id, bool timeshift = true);
|
||||||
|
|
||||||
bool RunStartScript(void);
|
bool RunStartScript(void);
|
||||||
bool RunStopScript(void);
|
bool RunStopScript(void);
|
||||||
@@ -211,12 +211,12 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/
|
|||||||
int handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data);
|
int handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data);
|
||||||
// mimic old behavior for start/stop menu option chooser, still actual ?
|
// mimic old behavior for start/stop menu option chooser, still actual ?
|
||||||
int GetRecordCount() { return recmap.size(); };
|
int GetRecordCount() { return recmap.size(); };
|
||||||
bool IsTimeshift(t_channel_id channel_id=0);
|
|
||||||
void StartTimeshift();
|
void StartTimeshift();
|
||||||
int GetRecordMode(const t_channel_id channel_id=0);
|
int GetRecordMode(const t_channel_id channel_id=0);
|
||||||
bool IsFileRecord(std::string file);
|
bool IsFileRecord(std::string file);
|
||||||
// old code
|
// old code
|
||||||
#if 0
|
#if 0
|
||||||
|
bool IsTimeshift(t_channel_id channel_id=0);
|
||||||
bool MountDirectory(const char *recordingDir);
|
bool MountDirectory(const char *recordingDir);
|
||||||
bool ChooseRecDir(std::string &dir);
|
bool ChooseRecDir(std::string &dir);
|
||||||
int recordingstatus;
|
int recordingstatus;
|
||||||
|
Reference in New Issue
Block a user