MythTV  master
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
UPnpCDSExtension Class Reference

#include <upnpcds.h>

Inheritance diagram for UPnpCDSExtension:
Inheritance graph
[legend]
Collaboration diagram for UPnpCDSExtension:
Collaboration graph
[legend]

Public Member Functions

 UPnpCDSExtension (const QString &sName, QString sExtensionId, QString sClass)
 
virtual CDSObjectGetRoot ()
 
virtual ~UPnpCDSExtension ()
 
virtual UPnpCDSExtensionResultsBrowse (UPnpCDSRequest *pRequest)
 
virtual UPnpCDSExtensionResultsSearch (UPnpCDSRequest *pRequest)
 
virtual QString GetSearchCapabilities ()
 
virtual QString GetSortCapabilities ()
 
virtual CDSShortCutList GetShortCuts ()
 

Public Attributes

QString m_sExtensionId
 
QString m_sName
 
QString m_sClass
 
CDSShortCutList m_shortcuts
 

Protected Member Functions

virtual bool IsBrowseRequestForUs (UPnpCDSRequest *pRequest)
 
virtual bool IsSearchRequestForUs (UPnpCDSRequest *pRequest)
 
virtual int GetRootCount ()
 
virtual int GetRootContainerCount ()
 
virtual void CreateRoot ()
 
virtual bool LoadMetadata (const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens, const QString &currentToken)
 Fetch just the metadata for the item identified in the request. More...
 
virtual bool LoadChildren (const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens, const QString &currentToken)
 Fetch the children of the container identified in the request. More...
 

Static Protected Member Functions

static QString RemoveToken (const QString &sToken, const QString &sStr, int num)
 
static IDTokenMap TokenizeIDString (const QString &Id)
 Split the 'Id' String up into tokens for handling by each extension. More...
 
static IDToken GetCurrentToken (const QString &Id)
 Split the 'Id' String up into tokens and return the last (current) token. More...
 
static QString CreateIDString (const QString &RequestId, const QString &Name, int Value)
 
static QString CreateIDString (const QString &RequestId, const QString &Name, const QString &Value)
 

Protected Attributes

CDSObjectm_pRoot {nullptr}
 

Detailed Description

Definition at line 202 of file upnpcds.h.

Constructor & Destructor Documentation

◆ UPnpCDSExtension()

UPnpCDSExtension::UPnpCDSExtension ( const QString &  sName,
QString  sExtensionId,
QString  sClass 
)
inline

Definition at line 252 of file upnpcds.h.

◆ ~UPnpCDSExtension()

UPnpCDSExtension::~UPnpCDSExtension ( )
virtual

Definition at line 797 of file upnpcds.cpp.

Member Function Documentation

◆ RemoveToken()

QString UPnpCDSExtension::RemoveToken ( const QString &  sToken,
const QString &  sStr,
int  num 
)
staticprotected

Definition at line 937 of file upnpcds.cpp.

◆ IsBrowseRequestForUs()

bool UPnpCDSExtension::IsBrowseRequestForUs ( UPnpCDSRequest pRequest)
protectedvirtual

◆ IsSearchRequestForUs()

bool UPnpCDSExtension::IsSearchRequestForUs ( UPnpCDSRequest pRequest)
protectedvirtual

◆ GetRootCount()

virtual int UPnpCDSExtension::GetRootCount ( )
inlineprotectedvirtual

Definition at line 223 of file upnpcds.h.

◆ GetRootContainerCount()

virtual int UPnpCDSExtension::GetRootContainerCount ( )
inlineprotectedvirtual

Definition at line 224 of file upnpcds.h.

◆ CreateRoot()

void UPnpCDSExtension::CreateRoot ( )
protectedvirtual

Reimplemented in UPnpCDSVideo, UPnpCDSTv, and UPnpCDSMusic.

Definition at line 1083 of file upnpcds.cpp.

Referenced by GetRoot().

◆ LoadMetadata()

bool UPnpCDSExtension::LoadMetadata ( const UPnpCDSRequest pRequest,
UPnpCDSExtensionResults pResults,
const IDTokenMap tokens,
const QString &  currentToken 
)
protectedvirtual

Fetch just the metadata for the item identified in the request.

This is the 'BrowseMetadata' request type.

The ID may refer to a container or an object.

  • pRequest The request object to read the id from
  • pResults The result object to write into
Returns
true if we could load the metadata

Reimplemented in UPnpCDSVideo, UPnpCDSTv, and UPnpCDSMusic.

Definition at line 968 of file upnpcds.cpp.

Referenced by Browse().

◆ LoadChildren()

bool UPnpCDSExtension::LoadChildren ( const UPnpCDSRequest pRequest,
UPnpCDSExtensionResults pResults,
const IDTokenMap tokens,
const QString &  currentToken 
)
protectedvirtual

Fetch the children of the container identified in the request.

This is the 'BrowseDirectChildren' request type.

The ID may only refer to a container.

  • pRequest The request object to read the id from
  • pResults The result object to write into
Returns
true if we could load the children

Reimplemented in UPnpCDSVideo, UPnpCDSTv, and UPnpCDSMusic.

Definition at line 990 of file upnpcds.cpp.

Referenced by Browse().

◆ TokenizeIDString()

IDTokenMap UPnpCDSExtension::TokenizeIDString ( const QString &  Id)
staticprotected

Split the 'Id' String up into tokens for handling by each extension.

Some example strings:

Recordings/RecGroup=3/Date=1380844800 (2013-10-04 in 'epoch' form)
Video/Genre=10
Music/Artist=123/Album=15
Music/Genre=32/Artist=616/Album=13/Track=2632

Special case where we only care about the last token:

Video/Directory=45/Directory=63/Directory=82

Definition at line 1012 of file upnpcds.cpp.

Referenced by Browse().

◆ GetCurrentToken()

IDToken UPnpCDSExtension::GetCurrentToken ( const QString &  Id)
staticprotected

Split the 'Id' String up into tokens and return the last (current) token.

Some example strings:

Recordings/RecGroup=3/Date=1380844800 (2013-10-04 in 'epoch' form)
Video/Genre=10
Music/Artist=123/Album=15
Music/Genre=32/Artist=616/Album=13/Track=2632

Special case where we only care about the last token:

Video/Directory=45/Directory=63/Directory=82

Definition at line 1048 of file upnpcds.cpp.

Referenced by Browse(), and CreateIDString().

◆ CreateIDString() [1/2]

QString UPnpCDSExtension::CreateIDString ( const QString &  RequestId,
const QString &  Name,
int  Value 
)
staticprotected

◆ CreateIDString() [2/2]

QString UPnpCDSExtension::CreateIDString ( const QString &  RequestId,
const QString &  Name,
const QString &  Value 
)
staticprotected

Definition at line 1065 of file upnpcds.cpp.

◆ GetRoot()

CDSObject * UPnpCDSExtension::GetRoot ( )
virtual

◆ Browse()

UPnpCDSExtensionResults * UPnpCDSExtension::Browse ( UPnpCDSRequest pRequest)
virtual

Definition at line 824 of file upnpcds.cpp.

◆ Search()

UPnpCDSExtensionResults * UPnpCDSExtension::Search ( UPnpCDSRequest pRequest)
virtual

Definition at line 906 of file upnpcds.cpp.

◆ GetSearchCapabilities()

virtual QString UPnpCDSExtension::GetSearchCapabilities ( )
inlinevirtual

Definition at line 268 of file upnpcds.h.

◆ GetSortCapabilities()

virtual QString UPnpCDSExtension::GetSortCapabilities ( )
inlinevirtual

Definition at line 269 of file upnpcds.h.

◆ GetShortCuts()

virtual CDSShortCutList UPnpCDSExtension::GetShortCuts ( )
inlinevirtual

Definition at line 270 of file upnpcds.h.

Referenced by UPnpCDS::RegisterExtension().

Member Data Documentation

◆ m_sExtensionId

QString UPnpCDSExtension::m_sExtensionId

◆ m_sName

QString UPnpCDSExtension::m_sName

◆ m_sClass

QString UPnpCDSExtension::m_sClass

Definition at line 208 of file upnpcds.h.

Referenced by IsSearchRequestForUs(), and Search().

◆ m_shortcuts

CDSShortCutList UPnpCDSExtension::m_shortcuts

◆ m_pRoot

CDSObject* UPnpCDSExtension::m_pRoot {nullptr}
protected

The documentation for this class was generated from the following files: