blob: 9e8c3e733012d0dd28e5119460be27da0e8acdeb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
|
/*******************************************************************/
/*! \file mgmedia.h
* \brief Top level access to media in vdr plugin muggle
* for the vdr muggle plugindatabase
********************************************************************
* \version $Revision: 1.2 $
* \date $Date: 2004/02/02 02:01:11 $
* \author Ralf Klueber, Lars von Wedel, Andreas Kellner
* \author file owner: $Author: MountainMan $
*
*
*/
/*******************************************************************/
/* makes sur we dont use parse the same declarations twice */
#ifndef _MG_MEDIA_H
#define _MG_MEDIA_H
#include <string>
#include <vector>
#include <mysql/mysql.h>
class mgPlaylist;
class mgTracklist;
class mgSelectionTreeNode;
/*!
*******************************************************************
* \class mgFilter
*
********************************************************************/
class mgFilter
{
public:
typedef enum filterType { UNDEF=0, INT, STRING, BOOL }filterType;
protected:
filterType m_type;
char* m_name;
public:
mgFilter(const char* name);
virtual ~mgFilter();
filterType getType();
const char* getName();
virtual std::string getStrVal()=0;
};
class mgFilterInt : public mgFilter
{
private:
int m_min;
int m_max;
int m_intval;
public:
mgFilterInt(const char *name, int value, int min = 0, int max = INT_MAX);
virtual ~mgFilterInt();
int getVal();
int getMin();
int getMax();
virtual std::string getStrVal();
void setVal(int value);
};
class mgFilterString : public mgFilter
{
private:
char* m_strval;
public:
mgFilterString(const char *name, const char* value);
virtual ~mgFilterString();
const char* getVal();
virtual std::string getStrVal();
void setVal(const char* val);
};
class mgFilterBool : public mgFilter
{
private:
bool m_bval;
public:
mgFilterBool(const char *name, bool value);
virtual ~mgFilterBool();
bool getVal();
virtual std::string getStrVal();
void setVal(bool val);
};
class mgTrackFilters
{
protected:
std::vector<mgFilter*> m_filters;
public:
mgTrackFilters();
virtual ~mgTrackFilters();
std::vector<mgFilter*> *getFilters();
virtual std::string CreateSQL()=0;
virtual void clear()=0;
};
/*!
*******************************************************************
* \class mgMedia
*
* \brief main class to access content in the vdr plugin muggle
********************************************************************/
class mgMedia
{
public:
typedef enum contentType{
DUMMY =0,
GD_MP3
} contentType;
private:
MYSQL m_db;
contentType m_mediatype;
std::string m_sql_trackfilter;
int m_defaultView;
public:
mgMedia(contentType mediatype);
~mgMedia();
std::string getMediaTypeName();
mgSelectionTreeNode* getSelectionRoot();
std::vector<mgFilter*> *getTrackFilters();
void setTrackFilters(std::vector<mgFilter*> *filters);
// playlist management
mgPlaylist* createTemporaryPlaylist();
mgPlaylist* loadPlaylist( std::string name );
std::vector<std::string> *getStoredPlaylists();
std::vector<int> getDefaultCols();
mgTracklist* getTracks();
};
#endif /* END _CONTENT_INTERFACE_H */
|