1
by Alessio Treglia
Import upstream version 0.2.5 |
1 |
// -------------------------------------------------------------------------------- //
|
1.1.5
by Alessio Treglia
Import upstream version 0.3.7~ds0 |
2 |
// Copyright (C) 2008-2013 J.Rios
|
1
by Alessio Treglia
Import upstream version 0.2.5 |
3 |
// anonbeat@gmail.com
|
4 |
//
|
|
5 |
// This Program is free software; you can redistribute it and/or modify
|
|
6 |
// it under the terms of the GNU General Public License as published by
|
|
1.1.3
by Alessio Treglia
Import upstream version 0.3.1~dfsg0 |
7 |
// the Free Software Foundation; either version 3, or (at your option)
|
1
by Alessio Treglia
Import upstream version 0.2.5 |
8 |
// any later version.
|
9 |
//
|
|
10 |
// This Program is distributed in the hope that it will be useful,
|
|
11 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 |
// GNU General Public License for more details.
|
|
14 |
//
|
|
15 |
// You should have received a copy of the GNU General Public License
|
|
16 |
// along with this program; see the file LICENSE. If not, write to
|
|
17 |
// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
18 |
// http://www.gnu.org/copyleft/gpl.html
|
|
19 |
//
|
|
20 |
// -------------------------------------------------------------------------------- //
|
|
21 |
#ifndef DYNAMICPLAYLIST_H
|
|
22 |
#define DYNAMICPLAYLIST_H
|
|
23 |
||
24 |
#include "RatingCtrl.h" |
|
25 |
||
26 |
#include <wx/dynarray.h> |
|
27 |
#include <wx/arrimpl.cpp> |
|
28 |
#include <wx/string.h> |
|
29 |
#include <wx/listbox.h> |
|
30 |
#include <wx/gdicmn.h> |
|
31 |
#include <wx/font.h> |
|
32 |
#include <wx/colour.h> |
|
33 |
#include <wx/settings.h> |
|
34 |
#include <wx/stattext.h> |
|
35 |
#include <wx/choice.h> |
|
36 |
#include <wx/textctrl.h> |
|
37 |
#include <wx/bitmap.h> |
|
38 |
#include <wx/image.h> |
|
39 |
#include <wx/icon.h> |
|
40 |
#include <wx/bmpbuttn.h> |
|
41 |
#include <wx/button.h> |
|
42 |
#include <wx/sizer.h> |
|
43 |
#include <wx/statbox.h> |
|
44 |
#include <wx/checkbox.h> |
|
45 |
#include <wx/spinctrl.h> |
|
46 |
#include <wx/dialog.h> |
|
47 |
||
48 |
enum guDYNAMIC_FILTER_TYPE { |
|
49 |
guDYNAMIC_FILTER_TYPE_TITLE = 0, |
|
50 |
guDYNAMIC_FILTER_TYPE_ARTIST, |
|
1.1.1
by Alessio Treglia
Import upstream version 0.2.7 |
51 |
guDYNAMIC_FILTER_TYPE_ALBUMARTIST, |
1
by Alessio Treglia
Import upstream version 0.2.5 |
52 |
guDYNAMIC_FILTER_TYPE_ALBUM, |
53 |
guDYNAMIC_FILTER_TYPE_GENRE, |
|
54 |
guDYNAMIC_FILTER_TYPE_LABEL, |
|
55 |
guDYNAMIC_FILTER_TYPE_COMPOSER, |
|
56 |
guDYNAMIC_FILTER_TYPE_COMMENT, |
|
57 |
guDYNAMIC_FILTER_TYPE_PATH, |
|
58 |
guDYNAMIC_FILTER_TYPE_YEAR, |
|
59 |
guDYNAMIC_FILTER_TYPE_RATING, |
|
60 |
guDYNAMIC_FILTER_TYPE_LENGTH, |
|
61 |
guDYNAMIC_FILTER_TYPE_PLAYCOUNT, |
|
62 |
guDYNAMIC_FILTER_TYPE_LASTPLAY, |
|
1.1.2
by Alessio Treglia
Import upstream version 0.2.9 |
63 |
guDYNAMIC_FILTER_TYPE_ADDEDDATE, |
64 |
guDYNAMIC_FILTER_TYPE_TRACKNUMBER, |
|
65 |
guDYNAMIC_FILTER_TYPE_BITRATE, |
|
66 |
guDYNAMIC_FILTER_TYPE_SIZE, |
|
67 |
guDYNAMIC_FILTER_TYPE_DISK, |
|
68 |
guDYNAMIC_FILTER_TYPE_HASARTWORK
|
|
1
by Alessio Treglia
Import upstream version 0.2.5 |
69 |
};
|
70 |
||
71 |
enum guDYNAMIC_FILTER_ORDER { |
|
72 |
guDYNAMIC_FILTER_ORDER_TITLE = 0, |
|
73 |
guDYNAMIC_FILTER_ORDER_ARTIST, |
|
1.1.1
by Alessio Treglia
Import upstream version 0.2.7 |
74 |
guDYNAMIC_FILTER_ORDER_ALBUMARTIST, |
1
by Alessio Treglia
Import upstream version 0.2.5 |
75 |
guDYNAMIC_FILTER_ORDER_ALBUM, |
76 |
guDYNAMIC_FILTER_ORDER_GENRE, |
|
77 |
guDYNAMIC_FILTER_ORDER_LABEL, |
|
78 |
guDYNAMIC_FILTER_ORDER_COMPOSER, |
|
79 |
//guDYNAMIC_FILTER_ORDER_PATH,
|
|
80 |
guDYNAMIC_FILTER_ORDER_YEAR, |
|
81 |
guDYNAMIC_FILTER_ORDER_RATING, |
|
82 |
guDYNAMIC_FILTER_ORDER_LENGTH, |
|
83 |
guDYNAMIC_FILTER_ORDER_PLAYCOUNT, |
|
84 |
guDYNAMIC_FILTER_ORDER_LASTPLAY, |
|
85 |
guDYNAMIC_FILTER_ORDER_ADDEDDATE, |
|
86 |
guDYNAMIC_FILTER_ORDER_RANDOM
|
|
87 |
};
|
|
88 |
||
89 |
enum guDYNAMIC_FILTER_OPTION_STRING { |
|
90 |
guDYNAMIC_FILTER_OPTION_STRING_CONTAINS = 0, |
|
91 |
guDYNAMIC_FILTER_OPTION_STRING_NOT_CONTAINS, |
|
1.1.1
by Alessio Treglia
Import upstream version 0.2.7 |
92 |
guDYNAMIC_FILTER_OPTION_STRING_IS, |
93 |
guDYNAMIC_FILTER_OPTION_STRING_ISNOT, |
|
1
by Alessio Treglia
Import upstream version 0.2.5 |
94 |
guDYNAMIC_FILTER_OPTION_STRING_START_WITH, |
95 |
guDYNAMIC_FILTER_OPTION_STRING_ENDS_WITH
|
|
96 |
};
|
|
97 |
||
1.1.1
by Alessio Treglia
Import upstream version 0.2.7 |
98 |
enum guDYNAMIC_FILTER_OPTION_LABELS { |
99 |
guDYNAMIC_FILTER_OPTION_LABELS_CONTAINS = 0, |
|
100 |
guDYNAMIC_FILTER_OPTION_LABELS_NOT_CONTAINS, |
|
101 |
guDYNAMIC_FILTER_OPTION_LABELS_IS, |
|
102 |
guDYNAMIC_FILTER_OPTION_LABELS_ISNOT, |
|
103 |
guDYNAMIC_FILTER_OPTION_LABELS_START_WITH, |
|
104 |
guDYNAMIC_FILTER_OPTION_LABELS_ENDS_WITH, |
|
105 |
guDYNAMIC_FILTER_OPTION_LABELS_NOTSET
|
|
106 |
};
|
|
107 |
||
1
by Alessio Treglia
Import upstream version 0.2.5 |
108 |
enum guDYNAMIC_FILTER_OPTION_YEAR { |
1.1.1
by Alessio Treglia
Import upstream version 0.2.7 |
109 |
guDYNAMIC_FILTER_OPTION_YEAR_IS = 0, |
110 |
guDYNAMIC_FILTER_OPTION_YEAR_ISNOT, |
|
1
by Alessio Treglia
Import upstream version 0.2.5 |
111 |
guDYNAMIC_FILTER_OPTION_YEAR_AFTER, |
1.1.2
by Alessio Treglia
Import upstream version 0.2.9 |
112 |
guDYNAMIC_FILTER_OPTION_YEAR_BEFORE
|
1
by Alessio Treglia
Import upstream version 0.2.5 |
113 |
};
|
114 |
||
115 |
enum guDYNAMIC_FILTER_OPTION_NUMERIC { |
|
1.1.1
by Alessio Treglia
Import upstream version 0.2.7 |
116 |
guDYNAMIC_FILTER_OPTION_NUMERIC_IS = 0, |
117 |
guDYNAMIC_FILTER_OPTION_NUMERIC_ISNOT, |
|
1
by Alessio Treglia
Import upstream version 0.2.5 |
118 |
guDYNAMIC_FILTER_OPTION_NUMERIC_AT_LEAST, |
1.1.2
by Alessio Treglia
Import upstream version 0.2.9 |
119 |
guDYNAMIC_FILTER_OPTION_NUMERIC_AT_MOST
|
1
by Alessio Treglia
Import upstream version 0.2.5 |
120 |
};
|
121 |
||
122 |
enum guDYNAMIC_FILTER_OPTION_DATE { |
|
123 |
guDYNAMIC_FILTER_OPTION_DATE_IN_THE_LAST = 0, |
|
124 |
guDYNAMIC_FILTER_OPTION_DATE_BEFORE_THE_LAST
|
|
125 |
};
|
|
126 |
||
1.1.2
by Alessio Treglia
Import upstream version 0.2.9 |
127 |
enum guDYNAMIC_FILTER_OPTION_BOOL { |
128 |
guDYNAMIC_FILTER_OPTION_BOOL_FALSE = 0, |
|
129 |
guDYNAMIC_FILTER_OPTION_BOOL_TRUE
|
|
130 |
};
|
|
131 |
||
1
by Alessio Treglia
Import upstream version 0.2.5 |
132 |
enum guDYNAMIC_FILTER_LIMIT { |
133 |
guDYNAMIC_FILTER_LIMIT_TRACKS = 0, |
|
134 |
guDYNAMIC_FILTER_LIMIT_MINUTES, |
|
135 |
guDYNAMIC_FILTER_LIMIT_MEGABYTES, |
|
136 |
guDYNAMIC_FILTER_LIMIT_GIGABYTES
|
|
137 |
};
|
|
138 |
||
139 |
||
140 |
// -------------------------------------------------------------------------------- //
|
|
141 |
class guFilterItem |
|
142 |
{
|
|
143 |
public : |
|
144 |
int m_Type; |
|
145 |
int m_Option; |
|
146 |
wxString m_Text; |
|
147 |
int m_Number; |
|
148 |
int m_Option2; |
|
149 |
wxString m_Label; |
|
150 |
||
151 |
guFilterItem() { m_Type = 0; }; |
|
152 |
~guFilterItem() {}; |
|
153 |
void Set( int type, int option, const wxString &text ); |
|
154 |
void Set( int type, int option, int number, int option2 ); |
|
155 |
wxString GetLabel( void ) { return m_Label; }; |
|
156 |
void SetFilterLabel( void ); |
|
157 |
||
158 |
};
|
|
159 |
WX_DECLARE_OBJARRAY(guFilterItem, guFilterItemArray); |
|
160 |
||
161 |
// -------------------------------------------------------------------------------- //
|
|
162 |
class guDynPlayList |
|
163 |
{
|
|
164 |
public : |
|
165 |
int m_Id; |
|
166 |
wxString m_Name; |
|
167 |
guFilterItemArray m_Filters; |
|
168 |
bool m_Limited; |
|
169 |
int m_LimitValue; |
|
170 |
int m_LimitType; |
|
171 |
bool m_Sorted; |
|
172 |
int m_SortType; |
|
173 |
bool m_SortDesc; |
|
174 |
bool m_AnyOption; |
|
175 |
||
176 |
guDynPlayList() { m_Id = 0; m_Limited = false; m_LimitValue = 0; m_LimitType = 0; |
|
177 |
m_Sorted = false; m_SortType = 0; m_SortDesc = false; m_AnyOption = false; }; |
|
178 |
~guDynPlayList() {}; |
|
179 |
||
1.1.4
by Alessio Treglia
Import upstream version 0.3.5~ds0 |
180 |
wxString ToString( void ); |
181 |
void FromString( const wxString &playlist ); |
|
182 |
bool IsEmpty( void ) { return m_Filters.IsEmpty(); } |
|
1
by Alessio Treglia
Import upstream version 0.2.5 |
183 |
};
|
1.1.2
by Alessio Treglia
Import upstream version 0.2.9 |
184 |
WX_DECLARE_OBJARRAY(guDynPlayList, guDynPlayListArray); |
1
by Alessio Treglia
Import upstream version 0.2.5 |
185 |
|
186 |
// -------------------------------------------------------------------------------- //
|
|
187 |
class guDynPlayListEditor : public wxDialog |
|
188 |
{
|
|
189 |
private: |
|
190 |
||
191 |
protected: |
|
192 |
guDynPlayList * m_PlayList; |
|
193 |
guFilterItemArray * m_Filters; |
|
194 |
int m_CurFilter; |
|
195 |
bool m_HasChanged; |
|
196 |
bool m_AlbumFilter; |
|
197 |
||
1.1.4
by Alessio Treglia
Import upstream version 0.3.5~ds0 |
198 |
wxTextCtrl * m_NameTextCtrl; |
199 |
wxListBox * m_FiltersListBox; |
|
200 |
wxChoice * m_FilterFieldChoice; |
|
201 |
wxChoice * m_FilterTextOptionChoice; |
|
202 |
wxChoice * m_FilterLabelOptionChoice; |
|
203 |
wxTextCtrl * m_FilterText; |
|
204 |
guRating * m_FilterRating; |
|
205 |
wxChoice * m_FilterDateOption2Choice; |
|
206 |
wxSpinCtrl * m_LengthHours; |
|
207 |
wxStaticText * m_LengthSeparator1; |
|
208 |
wxSpinCtrl * m_LengthMinutes; |
|
209 |
wxStaticText * m_LengthSeparator2; |
|
210 |
wxSpinCtrl * m_LengthSeconds; |
|
211 |
wxBoxSizer * m_FilterEditSizer; |
|
212 |
wxBitmapButton * m_FilterAdd; |
|
213 |
wxBitmapButton * m_FilterDel; |
|
214 |
wxBitmapButton * m_FilterAccept; |
|
215 |
wxCheckBox * m_LimitCheckBox; |
|
216 |
wxSpinCtrl * m_LimitSpinCtrl; |
|
217 |
wxChoice * m_LimitChoice; |
|
218 |
wxCheckBox * m_SortCheckBox; |
|
219 |
wxChoice * m_SortChoice; |
|
220 |
wxCheckBox * m_DescCheckBox; |
|
221 |
||
222 |
wxCheckBox * m_AddOnAnyCheckBox; |
|
223 |
||
224 |
wxButton * m_BtnOk; |
|
1
by Alessio Treglia
Import upstream version 0.2.5 |
225 |
|
226 |
// event handlers, overide them in your derived class
|
|
1.1.4
by Alessio Treglia
Import upstream version 0.3.5~ds0 |
227 |
void OnFiltersSelected( wxCommandEvent &event ); |
228 |
void OnFilterFieldSelected( wxCommandEvent& event ); |
|
229 |
void OnFilterOptionSelected( wxCommandEvent& event ); |
|
230 |
void OnFilterTextChanged( wxCommandEvent& event ); |
|
231 |
void OnFilterDateOption2Selected( wxCommandEvent &event ); |
|
232 |
void OnFilterAddClicked( wxCommandEvent& event ); |
|
233 |
void OnFilterDelClicked( wxCommandEvent& event ); |
|
234 |
void OnFilterUpdateClicked( wxCommandEvent& event ); |
|
235 |
void OnLImitChecked( wxCommandEvent& event ); |
|
236 |
void OnSortChecked( wxCommandEvent& event ); |
|
237 |
void OnRatingChanged( guRatingEvent &event ); |
|
238 |
void OnNameChanged( wxCommandEvent &event ); |
|
1.1.5
by Alessio Treglia
Import upstream version 0.3.7~ds0 |
239 |
void OnHoursChanged( wxSpinEvent &event ); |
240 |
void OnMinutesChanged( wxSpinEvent &event ); |
|
241 |
void OnSecondsChanged( wxSpinEvent &event ); |
|
1
by Alessio Treglia
Import upstream version 0.2.5 |
242 |
|
1.1.4
by Alessio Treglia
Import upstream version 0.3.5~ds0 |
243 |
bool FilterHasChanged( void ); |
244 |
guFilterItem GetFilterItem( void ); |
|
245 |
void UpdateEditor( int FilterType ); |
|
1
by Alessio Treglia
Import upstream version 0.2.5 |
246 |
|
247 |
||
248 |
public: |
|
249 |
guDynPlayListEditor( wxWindow * parent, guDynPlayList * playlist, const bool albumfilter = false ); |
|
250 |
~guDynPlayListEditor(); |
|
251 |
||
1.1.4
by Alessio Treglia
Import upstream version 0.3.5~ds0 |
252 |
void FillPlayListEditData( void ); |
1
by Alessio Treglia
Import upstream version 0.2.5 |
253 |
|
254 |
};
|
|
255 |
||
256 |
#endif
|
|
1.1.4
by Alessio Treglia
Import upstream version 0.3.5~ds0 |
257 |
|
1
by Alessio Treglia
Import upstream version 0.2.5 |
258 |
// -------------------------------------------------------------------------------- //
|