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  virtual ~UPnpCDSMusic() = 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  IDTokenMap tokens,
39  QString currentToken ) override; // UPnpCDSExtension
40  bool LoadChildren( const UPnpCDSRequest *pRequest,
41  UPnpCDSExtensionResults *pResults,
42  IDTokenMap tokens,
43  QString currentToken ) override; // UPnpCDSExtension
44 
45  private:
46 
47  QUrl m_URIBase;
48 
49  void PopulateArtworkURIS( CDSObject *pItem,
50  int songID );
51 
52  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  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  QString BuildWhereClause( QStringList clauses,
67  IDTokenMap tokens );
68  void BindValues ( MSqlQuery &query,
69  IDTokenMap tokens );
70 };
71 
72 #endif
void CreateRoot() override
virtual ~UPnpCDSMusic()=default
void BindValues(MSqlQuery &query, IDTokenMap tokens)
bool LoadChildren(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, IDTokenMap tokens, QString currentToken) override
Fetch the children of the container identified in the request.
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
bool IsSearchRequestForUs(UPnpCDSRequest *pRequest) override
bool LoadMetadata(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, IDTokenMap tokens, QString currentToken) override
Fetch just the metadata for the item identified in the request.
bool LoadAlbums(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens)
bool LoadArtists(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens)
bool LoadGenres(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens)
bool LoadTracks(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens)
bool IsBrowseRequestForUs(UPnpCDSRequest *pRequest) override
void PopulateArtworkURIS(CDSObject *pItem, int songID)
QString BuildWhereClause(QStringList clauses, IDTokenMap tokens)
UPnpCDSMusic()
Music Extension for UPnP ContentDirectory Service.
QMap< QString, QString > IDTokenMap
Definition: upnpcds.h:197