MythTV  master
upnpcdsmusic.h
Go to the documentation of this file.
1 // Program Name: upnpcdsmusic.h
3 //
4 // Purpose - uPnp Content Directory Extension for Music
5 //
6 // Created By : David Blain Created On : Jan. 24, 2005
7 // Modified By : Modified On:
8 //
10 
11 #ifndef UPnpCDSMusic_H_
12 #define UPnpCDSMusic_H_
13 
14 #include <QString>
15 
16 #include "upnpcds.h"
17 
19 //
21 class MSqlQuery;
23 {
24  public:
25 
26  UPnpCDSMusic();
27  ~UPnpCDSMusic() override = default;
28 
29  protected:
30 
31  bool IsBrowseRequestForUs( UPnpCDSRequest *pRequest ) override; // UPnpCDSExtension
32  bool IsSearchRequestForUs( UPnpCDSRequest *pRequest ) override; // UPnpCDSExtension
33 
34  void CreateRoot ( ) override; // UPnpCDSExtension
35 
36  bool LoadMetadata( const UPnpCDSRequest *pRequest,
37  UPnpCDSExtensionResults *pResults,
38  const IDTokenMap& tokens,
39  const QString& currentToken ) override; // UPnpCDSExtension
40  bool LoadChildren( const UPnpCDSRequest *pRequest,
41  UPnpCDSExtensionResults *pResults,
42  const IDTokenMap& tokens,
43  const QString& currentToken ) override; // UPnpCDSExtension
44 
45  private:
46 
47  QUrl m_uriBase;
48 
49  void PopulateArtworkURIS( CDSObject *pItem,
50  int songID );
51 
52  static bool LoadArtists(const UPnpCDSRequest *pRequest,
53  UPnpCDSExtensionResults *pResults,
54  const IDTokenMap& tokens);
55  bool LoadAlbums(const UPnpCDSRequest *pRequest,
56  UPnpCDSExtensionResults *pResults,
57  const IDTokenMap& tokens);
58  static bool LoadGenres(const UPnpCDSRequest *pRequest,
59  UPnpCDSExtensionResults *pResults,
60  const IDTokenMap& tokens);
61  bool LoadTracks(const UPnpCDSRequest *pRequest,
62  UPnpCDSExtensionResults *pResults,
63  const IDTokenMap& tokens);
64 
65  // Common code helpers
66  static QString BuildWhereClause( QStringList clauses,
67  IDTokenMap tokens );
68  static void BindValues ( MSqlQuery &query,
69  IDTokenMap tokens );
70 };
71 
72 #endif
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:126
UPnpCDSMusic::CreateRoot
void CreateRoot() override
Definition: upnpcdsmusic.cpp:80
UPnpCDSExtension
Definition: upnpcds.h:203
UPnpCDSMusic::UPnpCDSMusic
UPnpCDSMusic()
Music Extension for UPnP ContentDirectory Service.
Definition: upnpcdsmusic.cpp:58
UPnpCDSMusic::IsSearchRequestForUs
bool IsSearchRequestForUs(UPnpCDSRequest *pRequest) override
Definition: upnpcdsmusic.cpp:215
CDSObject
Definition: upnpcdsobjects.h:184
UPnpCDSMusic::LoadMetadata
bool LoadMetadata(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens, const QString &currentToken) override
Fetch just the metadata for the item identified in the request.
Definition: upnpcdsmusic.cpp:260
UPnpCDSMusic::~UPnpCDSMusic
~UPnpCDSMusic() override=default
UPnpCDSMusic::PopulateArtworkURIS
void PopulateArtworkURIS(CDSObject *pItem, int songID)
Definition: upnpcdsmusic.cpp:368
upnpcds.h
UPnpCDSMusic::LoadChildren
bool LoadChildren(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens, const QString &currentToken) override
Fetch the children of the container identified in the request.
Definition: upnpcdsmusic.cpp:324
UPnpCDSMusic::LoadTracks
bool LoadTracks(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens)
Definition: upnpcdsmusic.cpp:706
UPnpCDSMusic::IsBrowseRequestForUs
bool IsBrowseRequestForUs(UPnpCDSRequest *pRequest) override
Definition: upnpcdsmusic.cpp:182
UPnpCDSMusic::LoadArtists
static bool LoadArtists(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens)
Definition: upnpcdsmusic.cpp:551
UPnpCDSMusic::BindValues
static void BindValues(MSqlQuery &query, IDTokenMap tokens)
Definition: upnpcdsmusic.cpp:879
UPnpCDSMusic::LoadGenres
static bool LoadGenres(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens)
Definition: upnpcdsmusic.cpp:634
IDTokenMap
QMap< QString, QString > IDTokenMap
Definition: upnpcds.h:199
UPnpCDSMusic::LoadAlbums
bool LoadAlbums(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens)
Definition: upnpcdsmusic.cpp:459
UPnpCDSMusic
Definition: upnpcdsmusic.h:23
UPnpCDSMusic::BuildWhereClause
static QString BuildWhereClause(QStringList clauses, IDTokenMap tokens)
Definition: upnpcdsmusic.cpp:844
UPnpCDSExtensionResults
Definition: upnpcds.h:106
UPnpCDSMusic::m_uriBase
QUrl m_uriBase
Definition: upnpcdsmusic.h:47
query
MSqlQuery query(MSqlQuery::InitCon())
UPnpCDSRequest
Definition: upnpcds.h:72