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

Add PVR_TIMER_TYPE_SUPPORTS_READONLY_DELETE flag #14507

Merged
merged 1 commit into from
Oct 3, 2018
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
#define ADDON_INSTANCE_VERSION_PERIPHERAL_DEPENDS "addon-instance/Peripheral.h" \
"addon-instance/PeripheralUtils.h"

#define ADDON_INSTANCE_VERSION_PVR "5.10.2"
#define ADDON_INSTANCE_VERSION_PVR "5.10.3"
#define ADDON_INSTANCE_VERSION_PVR_MIN "5.10.0"
#define ADDON_INSTANCE_VERSION_PVR_XML_ID "kodi.binary.instance.pvr"
#define ADDON_INSTANCE_VERSION_PVR_DEPENDS "xbmc_pvr_dll.h" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ extern "C" {
const unsigned int PVR_TIMER_TYPE_REQUIRES_EPG_SERIES_ON_CREATE = 0x00800000; /*!< @brief this type should not appear on any create menus unless associated with an EPG tag with 'series' attributes (EPG_TAG.iFlags & EPG_TAG_FLAG_IS_SERIES || EPG_TAG.iSeriesNumber > 0 || EPG_TAG.iEpisodeNumber > 0 || EPG_TAG.iEpisodePartNumber > 0). Implies PVR_TIMER_TYPE_REQUIRES_EPG_TAG_ON_CREATE */
const unsigned int PVR_TIMER_TYPE_SUPPORTS_ANY_CHANNEL = 0x01000000; /*!< @brief this type supports 'any channel', for example when defining a timer rule that should match any channel instaed of a particular channel */
const unsigned int PVR_TIMER_TYPE_REQUIRES_EPG_SERIESLINK_ON_CREATE = 0x02000000; /*!< @brief this type should not appear on any create menus which don't provide an associated EPG tag with a series link */
const unsigned int PVR_TIMER_TYPE_SUPPORTS_READONLY_DELETE = 0x04000000; /*!< @brief this type allows deletion of an otherwise read-only timer */

/*!
* @brief PVR timer weekdays (PVR_TIMER.iWeekdays values)
Expand Down
2 changes: 1 addition & 1 deletion xbmc/pvr/PVRContextMenus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ namespace PVR
if (timer && (!item.GetEPGInfoTag() || !URIUtils::PathEquals(item.GetPath(), CPVRTimersPath::PATH_ADDTIMER)) && !timer->IsRecording())
{
const CPVRTimerTypePtr timerType(timer->GetTimerType());
return timerType && !timerType->IsReadOnly();
return timerType && timerType->AllowsDelete();
}

return false;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/pvr/PVRGUIActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ namespace PVR
return false;
}
}
else if (timer->HasTimerType() && timer->GetTimerType()->IsReadOnly())
else if (timer->HasTimerType() && !timer->GetTimerType()->AllowsDelete())
{
return false;
}
Expand Down
12 changes: 12 additions & 0 deletions xbmc/pvr/timers/PVRTimerType.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ namespace PVR
*/
bool IsReadOnly() const { return (m_iAttributes & PVR_TIMER_TYPE_IS_READONLY) > 0; }

/*!
* @brief Check whether this type allows deletion.
* @return True if type allows deletion, false otherwise.
*/
bool AllowsDelete() const { return !IsReadOnly() || SupportsReadOnlyDelete(); }

/*!
* @brief Check whether this type forbids creation of new timers of this type.
* @return True if new instances are forbidden, false otherwise.
Expand Down Expand Up @@ -280,6 +286,12 @@ namespace PVR
*/
bool SupportsAnyChannel() const { return (m_iAttributes & PVR_TIMER_TYPE_SUPPORTS_ANY_CHANNEL) > 0; }

/*!
* @brief Check whether this type supports deletion of an otherwise read-only timer.
* @return True if read-only deletion is supported, false otherwise.
*/
bool SupportsReadOnlyDelete() const { return (m_iAttributes & PVR_TIMER_TYPE_SUPPORTS_READONLY_DELETE) > 0; }

/*!
* @brief Obtain a list with all possible values for the priority attribute.
* @param list out, the list with the values or an empty list, if priority is not supported by this type.
Expand Down