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
void CreateRoot() override
static void BindValues(MSqlQuery &query, IDTokenMap tokens)
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
bool IsSearchRequestForUs(UPnpCDSRequest *pRequest) override
bool LoadChildren(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens, const QString &currentToken) override
Fetch the children of the container identified in the request.
~UPnpCDSMusic() override=default
bool LoadAlbums(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens)
static bool LoadArtists(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens)
static 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
QMap< QString, QString > IDTokenMap
Definition: upnpcds.h:199
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.
void PopulateArtworkURIS(CDSObject *pItem, int songID)
static QString BuildWhereClause(QStringList clauses, IDTokenMap tokens)
UPnpCDSMusic()
Music Extension for UPnP ContentDirectory Service.