Kodi Development  20.0
for Binary and Script based Add-Ons
4. Channel edit (optional)

Detailed Description

Bring in this functions if you have set supportsChannelSettings to true or for OpenDialogChannelScan() set supportsChannelScan to true
The support of this is a pure option and not mandatory.


Channel edit parts in interface:
Copy this to your project and extend with your parts or leave functions complete away where not used or supported.

Header parts:

Definition: Channels.h:39
Definition: MenuHook.h:46
PVR_ERROR
Definition: pvr_general.h:35
virtual PVR_ERROR OpenDialogChannelAdd(const kodi::addon::PVRChannel &channel)
Show the dialog to add a channel on the backend, if supported by the backend.
Definition: PVR.h:1350
virtual PVR_ERROR RenameChannel(const kodi::addon::PVRChannel &channel)
Rename a channel on the backend.
Definition: PVR.h:1320
virtual PVR_ERROR OpenDialogChannelScan()
Show the channel scan dialog if this backend supports it.
Definition: PVR.h:1364
virtual PVR_ERROR OpenDialogChannelSettings(const kodi::addon::PVRChannel &channel)
Show the channel settings dialog, if supported by the backend.
Definition: PVR.h:1335
virtual PVR_ERROR DeleteChannel(const kodi::addon::PVRChannel &channel)
Delete a channel from the backend.
Definition: PVR.h:1298
virtual PVR_ERROR CallChannelMenuHook(const kodi::addon::PVRMenuhook &menuhook, const kodi::addon::PVRChannel &item)
Call one of the channel related menu hooks (if supported).
Definition: PVR.h:1381

Source parts:

PVR_ERROR CMyInstance::DeleteChannel(const kodi::addon::PVRChannel& channel)
{
}
PVR_ERROR CMyInstance::RenameChannel(const kodi::addon::PVRChannel& channel)
{
}
PVR_ERROR CMyInstance::OpenDialogChannelSettings(const kodi::addon::PVRChannel& channel)
{
}
PVR_ERROR CMyInstance::OpenDialogChannelAdd(const kodi::addon::PVRChannel& channel)
{
}
PVR_ERROR CMyInstance::OpenDialogChannelScan()
{
}
PVR_ERROR CMyInstance::CallChannelMenuHook(const kodi::addon::PVRMenuhook& menuhook, const kodi::addon::PVRChannel& item)
{
}
@ PVR_ERROR_NOT_IMPLEMENTED
-2 : The method that Kodi called is not implemented by the add-on.
Definition: pvr_general.h:43

Modules

 Group header include
 
 Group source include
 

Function Documentation

◆ DeleteChannel()

virtual PVR_ERROR DeleteChannel ( const kodi::addon::PVRChannel channel)
inlinevirtual

Delete a channel from the backend.

Parameters
[in]channelThe channel to delete.
Returns
PVR_ERROR_NO_ERROR if the channel has been deleted successfully.
Remarks
Required if supportsChannelSettings is set to true.

◆ RenameChannel()

virtual PVR_ERROR RenameChannel ( const kodi::addon::PVRChannel channel)
inlinevirtual

Rename a channel on the backend.

Parameters
[in]channelThe channel to rename, containing the new channel name.
Returns
PVR_ERROR_NO_ERROR if the channel has been renamed successfully.

The following table contains values that can be set with class PVRChannel :

Name Type Set call Get call Usage
Unique id unsigned int SetUniqueId GetUniqueId required to set
Is radio bool SetIsRadio GetIsRadio required to set
Channel number unsigned int SetChannelNumber GetChannelNumber optional
Sub channel number unsigned int SetSubChannelNumber GetSubChannelNumber optional
Channel name std::string SetChannelName GetChannelName optional
Mime type std::string SetMimeType GetMimeType optional
Encryption system unsigned int SetEncryptionSystem GetEncryptionSystem optional
Icon path std::string SetIconPath GetIconPath optional
Is hidden bool SetIsHidden GetIsHidden optional
Has archive bool SetHasArchive GetHasArchive optional
Order int SetOrder GetOrder optional
Client provider unique identifier int SetClientProviderUid GetClientProviderUid optional

Remarks
Optional, and only used if supportsChannelSettings is set to true.

◆ OpenDialogChannelSettings()

virtual PVR_ERROR OpenDialogChannelSettings ( const kodi::addon::PVRChannel channel)
inlinevirtual

Show the channel settings dialog, if supported by the backend.

Parameters
[in]channelThe channel to show the dialog for.
Returns
PVR_ERROR_NO_ERROR if the dialog has been displayed successfully.
Remarks
Required if supportsChannelSettings is set to true.
Note
Use kodi::gui::CWindow to create dialog for them.

◆ OpenDialogChannelAdd()

virtual PVR_ERROR OpenDialogChannelAdd ( const kodi::addon::PVRChannel channel)
inlinevirtual

Show the dialog to add a channel on the backend, if supported by the backend.

Parameters
[in]channelThe channel to add.
Returns
PVR_ERROR_NO_ERROR if the channel has been added successfully.
Remarks
Required if supportsChannelSettings is set to true.
Note
Use kodi::gui::CWindow to create dialog for them.

◆ OpenDialogChannelScan()

virtual PVR_ERROR OpenDialogChannelScan ( )
inlinevirtual

Show the channel scan dialog if this backend supports it.

Returns
PVR_ERROR_NO_ERROR if the dialog was displayed successfully.
Remarks
Required if supportsChannelScan is set to true.
Note
Use kodi::gui::CWindow to create dialog for them.

◆ CallChannelMenuHook()

virtual PVR_ERROR CallChannelMenuHook ( const kodi::addon::PVRMenuhook menuhook,
const kodi::addon::PVRChannel item 
)
inlinevirtual

Call one of the channel related menu hooks (if supported).

Supported class PVRMenuhook instances have to be added in constructor(), by calling AddMenuHook() on the callback.

Parameters
[in]menuhookThe hook to call.
[in]itemThe selected channel item for which the hook was called.
Returns
PVR_ERROR_NO_ERROR if the hook was called successfully.

The following table contains values that can be set with class PVRMenuhook :

Name Type Set call Get call Usage
This hook's identifier unsigned int SetHookId GetHookId required to set
Localized string Identifier unsigned int SetLocalizedStringId GetLocalizedStringId required to set
Category of menu hook PVR_MENUHOOK_CAT SetCategory GetCategory required to set