Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #75 from janbar/4.9.0
Browse files Browse the repository at this point in the history
4.9.0
  • Loading branch information
janbar committed Nov 3, 2016
2 parents 6db30fb + 87dc759 commit 038cee0
Show file tree
Hide file tree
Showing 11 changed files with 194 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pvr.mythtv/addon.xml.in
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon
id="pvr.mythtv"
version="4.8.0"
version="4.9.0"
name="MythTV PVR Client"
provider-name="Christian Fetzer, Jean-Luc Barrière">
<requires>
Expand Down
3 changes: 3 additions & 0 deletions pvr.mythtv/changelog.txt
@@ -1,3 +1,6 @@
v4.9.0
- Extra timer info

v4.8.0
- New setting to send (original) Airdate to Kodi instead of the recording's Start Date/Time.

Expand Down
26 changes: 22 additions & 4 deletions pvr.mythtv/resources/language/resource.language.en_gb/strings.po
Expand Up @@ -209,7 +209,11 @@ msgctxt "#30065"
msgid "Limit channel tuning attempts"
msgstr ""

#empty strings from id 30066 to 30099
msgctxt "#30066"
msgid "Show all inactive upcomings by default (alternative/recorded/expired)"
msgstr ""

#empty strings from id 30067 to 30099

# Systeminformation labels
msgctxt "#30100"
Expand Down Expand Up @@ -304,7 +308,7 @@ msgstr ""
#empty strings from id 30413 to 30420

msgctxt "#30421"
msgid "Show/hide inactive upcomings"
msgid "Toggle display of alternative/recorded/expired"
msgstr ""

msgctxt "#30422"
Expand Down Expand Up @@ -345,7 +349,17 @@ msgctxt "#30456"
msgid "Zombie"
msgstr ""

#empty strings from id 30457 to 30459
msgctxt "#30457"
msgid "Alternative"
msgstr ""

msgctxt "#30458"
msgid "Currently recorded"
msgstr ""

msgctxt "#30459"
msgid "Expired recording"
msgstr ""

msgctxt "#30460"
msgid "Manual"
Expand Down Expand Up @@ -383,7 +397,11 @@ msgctxt "#30468"
msgid "Search people"
msgstr ""

#empty strings from id 30469 to 30500
msgctxt "#30469"
msgid "Rule disabled"
msgstr ""

#empty strings from id 30470 to 30500

msgctxt "#30501"
msgid "Don't match duplicates"
Expand Down
1 change: 1 addition & 0 deletions pvr.mythtv/resources/settings.xml
Expand Up @@ -34,5 +34,6 @@
<setting id="enable_edl" type="enum" label="30058" lvalues="30059|30060|30061" default="0" />
<setting id="channel_icons" type="bool" label="30063" default="true" />
<setting id="recording_icons" type="bool" label="30064" default="true" />
<setting id="inactive_upcomings" type="bool" label="30066" default="true" />
</category>
</settings>
19 changes: 19 additions & 0 deletions src/client.cpp
Expand Up @@ -61,6 +61,7 @@ bool g_bUseAirdate = DEFAULT_USE_AIRDATE;
int g_iEnableEDL = ENABLE_EDL_ALWAYS;
bool g_bBlockMythShutdown = DEFAULT_BLOCK_SHUTDOWN;
bool g_bLimitTuneAttempts = DEFAULT_LIMIT_TUNE_ATTEMPTS;
bool g_bShowNotRecording = false;

///* Client member variables */
ADDON_STATUS m_CurStatus = ADDON_STATUS_UNKNOWN;
Expand Down Expand Up @@ -321,6 +322,14 @@ ADDON_STATUS ADDON_Create(void *hdl, void *props)
g_bLimitTuneAttempts = DEFAULT_LIMIT_TUNE_ATTEMPTS;
}

/* Read setting "inactive_upcomings" from settings.xml */
if (!XBMC->GetSetting("inactive_upcomings", &g_bShowNotRecording))
{
/* If setting is unknown fallback to defaults */
XBMC->Log(LOG_ERROR, "Couldn't get 'inactive_upcomings' setting, falling back to '%b' as default", DEFAULT_SHOW_NOT_RECORDING);
g_bShowNotRecording = DEFAULT_SHOW_NOT_RECORDING;
}

free (buffer);
XBMC->Log(LOG_DEBUG, "Loading settings...done");

Expand Down Expand Up @@ -671,6 +680,16 @@ ADDON_STATUS ADDON_SetSetting(const char *settingName, const void *settingValue)
if (g_bLimitTuneAttempts != *(bool*)settingValue)
g_bLimitTuneAttempts = *(bool*)settingValue;
}
else if (str == "inactive_upcomings")
{
XBMC->Log(LOG_INFO, "Changed Setting 'inactive_upcomings' from %u to %u", g_bShowNotRecording, *(bool*)settingValue);
if (g_bShowNotRecording != *(bool*)settingValue)
{
g_bShowNotRecording = *(bool*)settingValue;
if (g_client)
g_client->HandleScheduleChange();
}
}
return ADDON_STATUS_OK;
}

Expand Down
2 changes: 2 additions & 0 deletions src/client.h
Expand Up @@ -64,6 +64,7 @@
#define ENABLE_EDL_NEVER 2
#define DEFAULT_BLOCK_SHUTDOWN true
#define DEFAULT_LIMIT_TUNE_ATTEMPTS true
#define DEFAULT_SHOW_NOT_RECORDING true

/*!
* @brief PVR macros for string exchange
Expand Down Expand Up @@ -113,6 +114,7 @@ extern bool g_bUseAirdate;
extern int g_iEnableEDL;
extern bool g_bBlockMythShutdown;
extern bool g_bLimitTuneAttempts; ///< Limit channel tuning attempts to first card
extern bool g_bShowNotRecording;

extern ADDON::CHelper_libXBMC_addon *XBMC;
extern CHelper_libXBMC_pvr *PVR;
Expand Down
98 changes: 97 additions & 1 deletion src/cppmyth/MythScheduleHelper75.cpp
Expand Up @@ -250,6 +250,23 @@ MythTimerTypeList MythScheduleHelper75::GetTimerTypes() const
GetRuleRecordingGroupList(),
GetRuleRecordingGroupDefaultId())));

m_timerTypeList.push_back(MythTimerTypePtr(new MythTimerType(TIMER_TYPE_RULE_INACTIVE,
PVR_TIMER_TYPE_FORBIDS_NEW_INSTANCES |
PVR_TIMER_TYPE_SUPPORTS_ENABLE_DISABLE |
PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN |
PVR_TIMER_TYPE_SUPPORTS_PRIORITY |
PVR_TIMER_TYPE_SUPPORTS_LIFETIME |
PVR_TIMER_TYPE_SUPPORTS_RECORDING_GROUP,
XBMC->GetLocalizedString(30469), // Rule Disabled
GetRulePriorityList(),
GetRulePriorityDefaultId(),
emptyList,
0, // n&v
autoExpireList,
autoExpire1,
GetRuleRecordingGroupList(),
GetRuleRecordingGroupDefaultId())));

m_timerTypeList.push_back(MythTimerTypePtr(new MythTimerType(TIMER_TYPE_UPCOMING,
PVR_TIMER_TYPE_FORBIDS_NEW_INSTANCES |
PVR_TIMER_TYPE_SUPPORTS_ENABLE_DISABLE |
Expand All @@ -267,6 +284,57 @@ MythTimerTypeList MythScheduleHelper75::GetTimerTypes() const
GetRuleRecordingGroupList(),
GetRuleRecordingGroupDefaultId())));

m_timerTypeList.push_back(MythTimerTypePtr(new MythTimerType(TIMER_TYPE_UPCOMING_ALTERNATE,
PVR_TIMER_TYPE_FORBIDS_NEW_INSTANCES |
PVR_TIMER_TYPE_SUPPORTS_ENABLE_DISABLE |
PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN |
PVR_TIMER_TYPE_SUPPORTS_PRIORITY |
PVR_TIMER_TYPE_SUPPORTS_LIFETIME |
PVR_TIMER_TYPE_SUPPORTS_RECORDING_GROUP,
XBMC->GetLocalizedString(30457), // Alternative
GetRulePriorityList(),
GetRulePriorityDefaultId(),
emptyList,
0, // n&v
autoExpireList,
autoExpire1,
GetRuleRecordingGroupList(),
GetRuleRecordingGroupDefaultId())));

m_timerTypeList.push_back(MythTimerTypePtr(new MythTimerType(TIMER_TYPE_UPCOMING_RECORDED,
PVR_TIMER_TYPE_FORBIDS_NEW_INSTANCES |
PVR_TIMER_TYPE_SUPPORTS_ENABLE_DISABLE |
PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN |
PVR_TIMER_TYPE_SUPPORTS_PRIORITY |
PVR_TIMER_TYPE_SUPPORTS_LIFETIME |
PVR_TIMER_TYPE_SUPPORTS_RECORDING_GROUP,
XBMC->GetLocalizedString(30458), // Currently recorded
GetRulePriorityList(),
GetRulePriorityDefaultId(),
emptyList,
0, // n&v
autoExpireList,
autoExpire1,
GetRuleRecordingGroupList(),
GetRuleRecordingGroupDefaultId())));

m_timerTypeList.push_back(MythTimerTypePtr(new MythTimerType(TIMER_TYPE_UPCOMING_EXPIRED,
PVR_TIMER_TYPE_FORBIDS_NEW_INSTANCES |
PVR_TIMER_TYPE_SUPPORTS_ENABLE_DISABLE |
PVR_TIMER_TYPE_SUPPORTS_START_END_MARGIN |
PVR_TIMER_TYPE_SUPPORTS_PRIORITY |
PVR_TIMER_TYPE_SUPPORTS_LIFETIME |
PVR_TIMER_TYPE_SUPPORTS_RECORDING_GROUP,
XBMC->GetLocalizedString(30459), // Expired recording
GetRulePriorityList(),
GetRulePriorityDefaultId(),
emptyList,
0, // n&v
autoExpireList,
autoExpire1,
GetRuleRecordingGroupList(),
GetRuleRecordingGroupDefaultId())));

m_timerTypeList.push_back(MythTimerTypePtr(new MythTimerType(TIMER_TYPE_OVERRIDE,
PVR_TIMER_TYPE_FORBIDS_NEW_INSTANCES |
PVR_TIMER_TYPE_SUPPORTS_ENABLE_DISABLE |
Expand Down Expand Up @@ -632,7 +700,27 @@ bool MythScheduleHelper75::FillTimerEntryWithUpcoming(MythTimerEntry& entry, con
if (node->GetMainRule().SearchType() == Myth::ST_ManualSearch)
entry.timerType = TIMER_TYPE_UPCOMING_MANUAL;
else
entry.timerType = TIMER_TYPE_UPCOMING;
{
switch (recording.Status())
{
case Myth::RS_EARLIER_RECORDING: //will record earlier
case Myth::RS_LATER_SHOWING: //will record later
entry.timerType = TIMER_TYPE_UPCOMING_ALTERNATE;
break;
case Myth::RS_CURRENT_RECORDING: //Already in the current library
entry.timerType = TIMER_TYPE_UPCOMING_RECORDED;
break;
case Myth::RS_PREVIOUS_RECORDING: //Previoulsy recorded but no longer in the library
entry.timerType = TIMER_TYPE_UPCOMING_EXPIRED;
break;
case Myth::RS_INACTIVE:
entry.timerType = TIMER_TYPE_RULE_INACTIVE;
break;
default:
entry.timerType = TIMER_TYPE_UPCOMING;
break;
}
}
}
entry.startOffset = rule.StartOffset();
entry.endOffset = rule.EndOffset();
Expand All @@ -645,6 +733,10 @@ bool MythScheduleHelper75::FillTimerEntryWithUpcoming(MythTimerEntry& entry, con
switch (entry.timerType)
{
case TIMER_TYPE_UPCOMING:
case TIMER_TYPE_RULE_INACTIVE:
case TIMER_TYPE_UPCOMING_ALTERNATE:
case TIMER_TYPE_UPCOMING_RECORDED:
case TIMER_TYPE_UPCOMING_EXPIRED:
case TIMER_TYPE_OVERRIDE:
case TIMER_TYPE_UPCOMING_MANUAL:
entry.epgCheck = true;
Expand Down Expand Up @@ -1131,6 +1223,10 @@ MythRecordingRule MythScheduleHelper75::NewFromTimer(const MythTimerEntry& entry
rule.SetInactive(entry.isInactive);
return rule;
case TIMER_TYPE_UPCOMING:
case TIMER_TYPE_RULE_INACTIVE:
case TIMER_TYPE_UPCOMING_ALTERNATE:
case TIMER_TYPE_UPCOMING_RECORDED:
case TIMER_TYPE_UPCOMING_EXPIRED:
case TIMER_TYPE_UPCOMING_MANUAL:
case TIMER_TYPE_ZOMBIE:
rule.SetType(Myth::RT_SingleRecord);
Expand Down
4 changes: 4 additions & 0 deletions src/cppmyth/MythScheduleHelper76.cpp
Expand Up @@ -600,6 +600,10 @@ MythRecordingRule MythScheduleHelper76::NewFromTimer(const MythTimerEntry& entry
rule.SetInactive(entry.isInactive);
return rule;
case TIMER_TYPE_UPCOMING:
case TIMER_TYPE_RULE_INACTIVE:
case TIMER_TYPE_UPCOMING_ALTERNATE:
case TIMER_TYPE_UPCOMING_RECORDED:
case TIMER_TYPE_UPCOMING_EXPIRED:
case TIMER_TYPE_UPCOMING_MANUAL:
case TIMER_TYPE_ZOMBIE:
rule.SetType(Myth::RT_SingleRecord);
Expand Down
26 changes: 25 additions & 1 deletion src/cppmyth/MythScheduleHelper85.cpp
Expand Up @@ -79,7 +79,27 @@ bool MythScheduleHelper85::FillTimerEntryWithUpcoming(MythTimerEntry& entry, con
if (node->GetMainRule().SearchType() == Myth::ST_ManualSearch)
entry.timerType = TIMER_TYPE_UPCOMING_MANUAL;
else
entry.timerType = TIMER_TYPE_UPCOMING;
{
switch (recording.Status())
{
case Myth::RS_EARLIER_RECORDING: //will record earlier
case Myth::RS_LATER_SHOWING: //will record later
entry.timerType = TIMER_TYPE_UPCOMING_ALTERNATE;
break;
case Myth::RS_CURRENT_RECORDING: //Already in the current library
entry.timerType = TIMER_TYPE_UPCOMING_RECORDED;
break;
case Myth::RS_PREVIOUS_RECORDING: //Previoulsy recorded but no longer in the library
entry.timerType = TIMER_TYPE_UPCOMING_EXPIRED;
break;
case Myth::RS_INACTIVE: //Parent rule is disabled
entry.timerType = TIMER_TYPE_RULE_INACTIVE;
break;
default:
entry.timerType = TIMER_TYPE_UPCOMING;
break;
}
}
}
entry.startOffset = rule.StartOffset();
entry.endOffset = rule.EndOffset();
Expand All @@ -92,6 +112,10 @@ bool MythScheduleHelper85::FillTimerEntryWithUpcoming(MythTimerEntry& entry, con
switch (entry.timerType)
{
case TIMER_TYPE_UPCOMING:
case TIMER_TYPE_RULE_INACTIVE:
case TIMER_TYPE_UPCOMING_ALTERNATE:
case TIMER_TYPE_UPCOMING_RECORDED:
case TIMER_TYPE_UPCOMING_EXPIRED:
case TIMER_TYPE_OVERRIDE:
case TIMER_TYPE_UPCOMING_MANUAL:
entry.epgCheck = true;
Expand Down
18 changes: 15 additions & 3 deletions src/cppmyth/MythScheduleManager.cpp
Expand Up @@ -134,7 +134,6 @@ MythScheduleManager::MythScheduleManager(const std::string& server, unsigned pro
, m_recordings(NULL)
, m_recordingIndexByRuleId(NULL)
, m_templates(NULL)
, m_showNotRecording(false)
{
m_control = new Myth::Control(server, protoPort, wsapiPort, wsapiSecurityPin);
this->Update();
Expand Down Expand Up @@ -260,6 +259,10 @@ MythScheduleManager::MSM_ERROR MythScheduleManager::UpdateTimer(const MythTimerE
switch (entry.timerType)
{
case TIMER_TYPE_UPCOMING:
case TIMER_TYPE_RULE_INACTIVE:
case TIMER_TYPE_UPCOMING_ALTERNATE:
case TIMER_TYPE_UPCOMING_RECORDED:
case TIMER_TYPE_UPCOMING_EXPIRED:
case TIMER_TYPE_DONT_RECORD:
case TIMER_TYPE_OVERRIDE:
{
Expand Down Expand Up @@ -295,6 +298,10 @@ MythScheduleManager::MSM_ERROR MythScheduleManager::DeleteTimer(const MythTimerE
switch (entry.timerType)
{
case TIMER_TYPE_UPCOMING:
case TIMER_TYPE_RULE_INACTIVE:
case TIMER_TYPE_UPCOMING_ALTERNATE:
case TIMER_TYPE_UPCOMING_RECORDED:
case TIMER_TYPE_UPCOMING_EXPIRED:
return DisableRecording(entry.entryIndex);
case TIMER_TYPE_DONT_RECORD:
case TIMER_TYPE_OVERRIDE:
Expand Down Expand Up @@ -968,8 +975,13 @@ MythRecordingRuleList MythScheduleManager::GetTemplateRules() const

bool MythScheduleManager::ToggleShowNotRecording()
{
m_showNotRecording ^= true;
return m_showNotRecording;
g_bShowNotRecording ^= true;
return g_bShowNotRecording;
}

bool MythScheduleManager::ShowNotRecording()
{
return g_bShowNotRecording;
}

///////////////////////////////////////////////////////////////////////////////
Expand Down
7 changes: 5 additions & 2 deletions src/cppmyth/MythScheduleManager.h
Expand Up @@ -45,6 +45,10 @@ typedef enum
TIMER_TYPE_SEARCH_PEOPLE, // Search people
// Keep last
TIMER_TYPE_UPCOMING, // Upcoming
TIMER_TYPE_RULE_INACTIVE, // Parent Rule is disable
TIMER_TYPE_UPCOMING_ALTERNATE, // Upcoming will record at another time
TIMER_TYPE_UPCOMING_RECORDED, // Upcoming currently recorded
TIMER_TYPE_UPCOMING_EXPIRED, // Upcoming previously recorded and expired
TIMER_TYPE_OVERRIDE, // Override
TIMER_TYPE_DONT_RECORD, // Don't record
TIMER_TYPE_UNHANDLED, // Unhandled rule
Expand Down Expand Up @@ -185,7 +189,7 @@ class MythScheduleManager
MythRecordingRuleList GetTemplateRules() const;

bool ToggleShowNotRecording();
bool ShowNotRecording() const { return m_showNotRecording; }
bool ShowNotRecording();

class VersionHelper
{
Expand Down Expand Up @@ -234,7 +238,6 @@ class MythScheduleManager
RecordingIndexByRuleId* m_recordingIndexByRuleId;
MythRecordingRuleList* m_templates;

bool m_showNotRecording;
};

///////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 038cee0

Please sign in to comment.