Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jarvis timer fixes #35

Merged
merged 4 commits into from Feb 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pvr.mediaportal.tvserver/addon.xml.in
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.mediaportal.tvserver"
version="1.12.0"
version="1.13.0"
name="MediaPortal PVR Client"
provider-name="Marcel Groothuis">
<requires>
Expand Down
6 changes: 6 additions & 0 deletions pvr.mediaportal.tvserver/changelog.txt
@@ -1,3 +1,9 @@
v1.13.0
- Timer: fixed: 'unable to resolve timer type' warnings (Kodi expects a manual, no EPG timer type)
- Timer: fixed: timer disabled state (PVR_TIMER_STATE_CANCELLED should now be PVR_TIMER_STATE_DISABLED)
- Timer: fixed: don't show the unsupported 'folder' field
- Coverity fixes

v1.12.0
- Timer: Add series recording timer types support
- Timer: Add an backward compatibility option to re-enable the pre-Jarvis series recording dialog
Expand Down
Expand Up @@ -263,7 +263,12 @@ msgctxt "#30121"
msgid "Anytime"
msgstr ""

# empty strings from id 30122 to 30124
msgctxt "#30122"
msgid "Manual"
msgstr ""

#empty strings from id 30123 to 30124
#Channel:

# Channel:
msgctxt "#30125"
Expand Down
3 changes: 3 additions & 0 deletions src/Socket.cpp
Expand Up @@ -451,6 +451,9 @@ bool Socket::reconnect()
if( !create() )
return false;

if (_sd == INVALID_SOCKET)
return false;

int status = ::connect ( _sd, reinterpret_cast<sockaddr*>(&_sockaddr), sizeof ( _sockaddr ) );

if ( status == SOCKET_ERROR )
Expand Down
1 change: 1 addition & 0 deletions src/lib/tsreader/DeMultiplexer.cpp
Expand Up @@ -55,6 +55,7 @@ namespace MPTV
m_ReqPatVersion(-1),
m_WaitNewPatTmo(0),
m_receivedPackets(0),
m_bStarting(false),
m_bAudioAtEof(false),
m_bVideoAtEof(false),
m_bGotNewChannel(false)
Expand Down
11 changes: 11 additions & 0 deletions src/pvrclient-mediaportal.cpp
Expand Up @@ -1369,6 +1369,17 @@ PVR_ERROR cPVRClientMediaPortal::GetTimerTypes(PVR_TIMER_TYPE types[], int *size
Timer::lifetimeValues->SetLifeTimeValues(types[count]);
count++;

if (count > maxsize)
return PVR_ERROR_NO_ERROR;

/* Kodi specific 'Manual' schedule type */
memset(&types[count], 0, sizeof(types[count]));
types[count].iId = cKodiTimerTypeOffset + TvDatabase::KodiManual;
types[count].iAttributes = MPTV_RECORD_MANUAL;
PVR_STRCPY(types[count].strDescription, XBMC->GetLocalizedString(30122)); /* Manual */
Timer::lifetimeValues->SetLifeTimeValues(types[count]);
count++;

return PVR_ERROR_NO_ERROR;
}

Expand Down
10 changes: 8 additions & 2 deletions src/timers.cpp
Expand Up @@ -55,7 +55,8 @@ cTimer::cTimer() :
}


cTimer::cTimer(const PVR_TIMER& timerinfo)
cTimer::cTimer(const PVR_TIMER& timerinfo):
m_genretable(NULL)
{

m_index = timerinfo.iClientIndex - cKodiTimerIndexOffset;
Expand Down Expand Up @@ -108,6 +109,10 @@ cTimer::cTimer(const PVR_TIMER& timerinfo)
SetKeepMethod(timerinfo.iLifetime);

m_schedtype = static_cast<enum TvDatabase::ScheduleRecordingType>(timerinfo.iTimerType - cKodiTimerTypeOffset);
if (m_schedtype == TvDatabase::KodiManual)
{
m_schedtype = TvDatabase::Once;
}

if ((m_schedtype == TvDatabase::Once) && (timerinfo.iWeekdays != PVR_WEEKDAY_NONE)) // huh, still repeating?
{
Expand Down Expand Up @@ -153,7 +158,7 @@ void cTimer::GetPVRtimerinfo(PVR_TIMER &tag)
else if (m_active)
tag.state = PVR_TIMER_STATE_SCHEDULED;
else
tag.state = PVR_TIMER_STATE_CANCELLED;
tag.state = PVR_TIMER_STATE_DISABLED;

if (m_schedtype == TvDatabase::EveryTimeOnEveryChannel)
{
Expand Down Expand Up @@ -356,6 +361,7 @@ int cTimer::SchedRecType2RepeatFlags(TvDatabase::ScheduleRecordingType schedtype
switch (schedtype)
{
case TvDatabase::Once:
case TvDatabase::KodiManual:
weekdays = PVR_WEEKDAY_NONE;
break;
case TvDatabase::Daily:
Expand Down
44 changes: 28 additions & 16 deletions src/timers.h
Expand Up @@ -43,7 +43,8 @@ enum ScheduleRecordingType
EveryTimeOnEveryChannel = 4, // Record every time on every channel
Weekends = 5, // Record Weekends
WorkingDays = 6, // Record Weekdays
WeeklyEveryTimeOnThisChannel = 7 // Weekly on this channel
WeeklyEveryTimeOnThisChannel = 7, // Weekly on this channel
KodiManual = 99 // Special type for Kodi since it distinguishes between 'Once (EPG based)' and 'manual'
};

// From MediaPortal: TvDatabase.KeepMethodType
Expand Down Expand Up @@ -96,7 +97,8 @@ const int MPTV_RECORD_ONCE =
PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN |
//PVR_TIMER_TYPE_SUPPORTS_PRIORITY |
PVR_TIMER_TYPE_SUPPORTS_LIFETIME |
PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;
PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH;
//PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;

const int MPTV_RECORD_EVERY_TIME_ON_THIS_CHANNEL =
PVR_TIMER_TYPE_IS_REPEATING |
Expand All @@ -105,8 +107,8 @@ const int MPTV_RECORD_EVERY_TIME_ON_THIS_CHANNEL =
PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN |
//PVR_TIMER_TYPE_SUPPORTS_PRIORITY |
PVR_TIMER_TYPE_SUPPORTS_LIFETIME |
PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH |
PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;
PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH;
//PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;

const int MPTV_RECORD_EVERY_TIME_ON_EVERY_CHANNEL =
PVR_TIMER_TYPE_IS_REPEATING |
Expand All @@ -116,8 +118,8 @@ const int MPTV_RECORD_EVERY_TIME_ON_EVERY_CHANNEL =
PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN |
//PVR_TIMER_TYPE_SUPPORTS_PRIORITY |
PVR_TIMER_TYPE_SUPPORTS_LIFETIME |
PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH |
PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;
PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH;
//PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;

const int MPTV_RECORD_WEEKLY =
PVR_TIMER_TYPE_IS_REPEATING |
Expand All @@ -128,8 +130,8 @@ const int MPTV_RECORD_WEEKLY =
PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN |
//PVR_TIMER_TYPE_SUPPORTS_PRIORITY |
PVR_TIMER_TYPE_SUPPORTS_LIFETIME |
PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH |
PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;
PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH;
//PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;

const int MPTV_RECORD_DAILY =
PVR_TIMER_TYPE_IS_REPEATING |
Expand All @@ -140,8 +142,8 @@ const int MPTV_RECORD_DAILY =
PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN |
//PVR_TIMER_TYPE_SUPPORTS_PRIORITY |
PVR_TIMER_TYPE_SUPPORTS_LIFETIME |
PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH |
PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;
PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH;
//PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;

const int MPTV_RECORD_WORKING_DAYS =
PVR_TIMER_TYPE_IS_REPEATING |
Expand All @@ -151,8 +153,8 @@ const int MPTV_RECORD_WORKING_DAYS =
PVR_TIMER_TYPE_SUPPORTS_END_TIME |
PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN |
//PVR_TIMER_TYPE_SUPPORTS_PRIORITY |
PVR_TIMER_TYPE_SUPPORTS_LIFETIME |
PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;
PVR_TIMER_TYPE_SUPPORTS_LIFETIME;
//PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;

const int MPTV_RECORD_WEEEKENDS =
PVR_TIMER_TYPE_IS_REPEATING |
Expand All @@ -162,8 +164,8 @@ const int MPTV_RECORD_WEEEKENDS =
PVR_TIMER_TYPE_SUPPORTS_END_TIME |
PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN |
//PVR_TIMER_TYPE_SUPPORTS_PRIORITY |
PVR_TIMER_TYPE_SUPPORTS_LIFETIME |
PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;
PVR_TIMER_TYPE_SUPPORTS_LIFETIME;
//PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;

const int MPTV_RECORD_WEEKLY_EVERY_TIME_ON_THIS_CHANNEL =
PVR_TIMER_TYPE_IS_REPEATING |
Expand All @@ -172,8 +174,18 @@ const int MPTV_RECORD_WEEKLY_EVERY_TIME_ON_THIS_CHANNEL =
PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN |
//PVR_TIMER_TYPE_SUPPORTS_PRIORITY |
PVR_TIMER_TYPE_SUPPORTS_LIFETIME |
PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH |
PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;
PVR_TIMER_TYPE_SUPPORTS_TITLE_EPG_MATCH;
//PVR_TIMER_TYPE_SUPPORTS_RECORDING_FOLDERS;

const int MPTV_RECORD_MANUAL =
PVR_TIMER_TYPE_IS_MANUAL |
PVR_TIMER_TYPE_SUPPORTS_ENABLE_DISABLE |
PVR_TIMER_TYPE_SUPPORTS_CHANNELS |
PVR_TIMER_TYPE_SUPPORTS_START_TIME |
PVR_TIMER_TYPE_SUPPORTS_END_TIME |
PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN |
//PVR_TIMER_TYPE_SUPPORTS_PRIORITY |
PVR_TIMER_TYPE_SUPPORTS_LIFETIME;

class cLifeTimeValues
{
Expand Down