mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 00:11:08 +02:00
yWeb: Timer: dont stop recording after modifying timer - Timer: sets audio-pid correctly - Timer: seconds set to Null
Origin commit data
------------------
Branch: ni/coolstream
Commit: dc33e93375
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2012-12-08 (Sat, 08 Dec 2012)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -2119,6 +2119,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
|
|||||||
alarmTimeT = 0,
|
alarmTimeT = 0,
|
||||||
tnull = 0;
|
tnull = 0;
|
||||||
unsigned int repCount = 0;
|
unsigned int repCount = 0;
|
||||||
|
int alHour=0;
|
||||||
|
|
||||||
// if alarm given then in parameters im time_t format
|
// if alarm given then in parameters im time_t format
|
||||||
if(hh->ParamList["alarm"] != "")
|
if(hh->ParamList["alarm"] != "")
|
||||||
@@ -2137,13 +2138,16 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
|
|||||||
tnull = time(NULL);
|
tnull = time(NULL);
|
||||||
struct tm *alarmTime=localtime(&tnull);
|
struct tm *alarmTime=localtime(&tnull);
|
||||||
alarmTime->tm_sec = 0;
|
alarmTime->tm_sec = 0;
|
||||||
strptime(hh->ParamList["alDate"].c_str(), "%d.%m.%Y", alarmTime);
|
if(sscanf(hh->ParamList["alDate"].c_str(),"%2d.%2d.%4d",&(alarmTime->tm_mday), &(alarmTime->tm_mon), &(alarmTime->tm_year)) == 3)
|
||||||
|
{
|
||||||
|
alarmTime->tm_mon -= 1;
|
||||||
|
alarmTime->tm_year -= 1900;
|
||||||
|
}
|
||||||
|
|
||||||
// Alarm Time - Format exact! HH:MM
|
// Alarm Time - Format exact! HH:MM
|
||||||
if(hh->ParamList["alTime"] != "")
|
if(hh->ParamList["alTime"] != "")
|
||||||
strptime(hh->ParamList["alTime"].c_str(), "%H:%M", alarmTime);
|
sscanf(hh->ParamList["alTime"].c_str(),"%2d.%2d",&(alarmTime->tm_hour), &(alarmTime->tm_min));
|
||||||
int alHour = alarmTime->tm_hour;
|
alHour = alarmTime->tm_hour;
|
||||||
|
|
||||||
correctTime(alarmTime);
|
correctTime(alarmTime);
|
||||||
alarmTimeT = mktime(alarmTime);
|
alarmTimeT = mktime(alarmTime);
|
||||||
announceTimeT = alarmTimeT;
|
announceTimeT = alarmTimeT;
|
||||||
@@ -2151,12 +2155,15 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
|
|||||||
stopTime->tm_sec = 0;
|
stopTime->tm_sec = 0;
|
||||||
// Stop Time - Format exact! HH:MM
|
// Stop Time - Format exact! HH:MM
|
||||||
if(hh->ParamList["stTime"] != "")
|
if(hh->ParamList["stTime"] != "")
|
||||||
strptime(hh->ParamList["stTime"].c_str(), "%H:%M", stopTime);
|
sscanf(hh->ParamList["stTime"].c_str(),"%2d.%2d",&(stopTime->tm_hour), &(stopTime->tm_min));
|
||||||
|
|
||||||
// Stop Date - Format exact! DD.MM.YYYY
|
// Stop Date - Format exact! DD.MM.YYYY
|
||||||
if(hh->ParamList["stDate"] != "")
|
if(hh->ParamList["stDate"] != "")
|
||||||
strptime(hh->ParamList["stDate"].c_str(), "%d.%m.%Y", stopTime);
|
if(sscanf(hh->ParamList["stDate"].c_str(),"%2d.%2d.%4d",&(stopTime->tm_mday), &(stopTime->tm_mon), &(stopTime->tm_year)) == 3)
|
||||||
stopTime->tm_sec = 0;
|
{
|
||||||
|
stopTime->tm_mon -= 1;
|
||||||
|
stopTime->tm_year -= 1900;
|
||||||
|
}
|
||||||
correctTime(stopTime);
|
correctTime(stopTime);
|
||||||
stopTimeT = mktime(stopTime);
|
stopTimeT = mktime(stopTime);
|
||||||
if(hh->ParamList["stDate"] == "" && alHour > stopTime->tm_hour)
|
if(hh->ParamList["stDate"] == "" && alHour > stopTime->tm_hour)
|
||||||
@@ -2218,9 +2225,9 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
|
|||||||
rep = (CTimerd::CTimerEventRepeat) atoi(hh->ParamList["rep"].c_str());
|
rep = (CTimerd::CTimerEventRepeat) atoi(hh->ParamList["rep"].c_str());
|
||||||
else // default: no repeat
|
else // default: no repeat
|
||||||
rep = (CTimerd::CTimerEventRepeat)0;
|
rep = (CTimerd::CTimerEventRepeat)0;
|
||||||
|
|
||||||
if(((int)rep) >= ((int)CTimerd::TIMERREPEAT_WEEKDAYS) && hh->ParamList["wd"] != "")
|
if(((int)rep) >= ((int)CTimerd::TIMERREPEAT_WEEKDAYS) && hh->ParamList["wd"] != "")
|
||||||
NeutrinoAPI->Timerd->getWeekdaysFromStr(&rep, hh->ParamList["wd"].c_str());
|
NeutrinoAPI->Timerd->getWeekdaysFromStr(&rep, hh->ParamList["wd"].c_str());
|
||||||
|
|
||||||
// apids
|
// apids
|
||||||
bool changeApids=false;
|
bool changeApids=false;
|
||||||
unsigned char apids=0;
|
unsigned char apids=0;
|
||||||
@@ -2247,6 +2254,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
|
|||||||
apids |= TIMERD_APIDS_AC3;
|
apids |= TIMERD_APIDS_AC3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CTimerd::RecordingInfo recinfo;
|
CTimerd::RecordingInfo recinfo;
|
||||||
CTimerd::EventInfo eventinfo;
|
CTimerd::EventInfo eventinfo;
|
||||||
eventinfo.epgID = 0;
|
eventinfo.epgID = 0;
|
||||||
@@ -2280,8 +2288,8 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
|
|||||||
// get Default Recordingdir
|
// get Default Recordingdir
|
||||||
CConfigFile *Config = new CConfigFile(',');
|
CConfigFile *Config = new CConfigFile(',');
|
||||||
Config->loadConfig(NEUTRINO_CONFIGFILE);
|
Config->loadConfig(NEUTRINO_CONFIGFILE);
|
||||||
_rec_dir = Config->getString("network_nfs_recordingdir", "/mnt/filme");
|
_rec_dir = Config->getString("recording_dir_0", "/mnt/filme");
|
||||||
delete Config;//Memory leak: Config
|
delete Config;
|
||||||
}
|
}
|
||||||
if(changeApids)
|
if(changeApids)
|
||||||
eventinfo.apids = apids;
|
eventinfo.apids = apids;
|
||||||
@@ -2309,7 +2317,13 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
|
|||||||
if(hh->ParamList["id"] != "")
|
if(hh->ParamList["id"] != "")
|
||||||
{
|
{
|
||||||
unsigned modyId = atoi(hh->ParamList["id"].c_str());
|
unsigned modyId = atoi(hh->ParamList["id"].c_str());
|
||||||
NeutrinoAPI->Timerd->removeTimerEvent(modyId);
|
if(type == CTimerd::TIMER_RECORD)
|
||||||
|
NeutrinoAPI->Timerd->modifyRecordTimerEvent(modyId, announceTimeT, alarmTimeT, stopTimeT, rep,repCount,_rec_dir.c_str());
|
||||||
|
else
|
||||||
|
NeutrinoAPI->Timerd->modifyTimerEvent(modyId, announceTimeT, alarmTimeT, stopTimeT, rep,repCount);
|
||||||
|
// NeutrinoAPI->Timerd->removeTimerEvent(modyId);
|
||||||
|
if(changeApids)
|
||||||
|
NeutrinoAPI->Timerd->modifyTimerAPid(modyId,apids);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2327,15 +2341,18 @@ void CControlAPI::doNewTimer(CyhookHandler *hh)
|
|||||||
real_alarmTimeT -= pre;
|
real_alarmTimeT -= pre;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(; timer != timerlist.end(); ++timer)
|
for(; timer != timerlist.end();++timer)
|
||||||
if(timer->alarmTime == real_alarmTimeT)
|
if(timer->alarmTime == real_alarmTimeT)
|
||||||
{
|
{
|
||||||
NeutrinoAPI->Timerd->removeTimerEvent(timer->eventID);
|
NeutrinoAPI->Timerd->removeTimerEvent(timer->eventID);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
NeutrinoAPI->Timerd->addTimerEvent(type,data,announceTimeT,alarmTimeT,stopTimeT,rep,repCount);
|
NeutrinoAPI->Timerd->addTimerEvent(type,data,announceTimeT,alarmTimeT,stopTimeT,rep,repCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
NeutrinoAPI->Timerd->addTimerEvent(type,data,announceTimeT,alarmTimeT,stopTimeT,rep,repCount);
|
||||||
|
|
||||||
hh->SendOk();
|
hh->SendOk();
|
||||||
}
|
}
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user