~ubuntu-branches/ubuntu/precise/guayadeque/precise

« back to all changes in this revision

Viewing changes to .pc/03-curl_headers_location.patch/src/MainFrame.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2011-05-14 15:08:03 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110514150803-8b5evqetnaj35j34
Tags: 0.3.1~dfsg0-1
* New upstream release.
* Strip wxsqlite3 stuff out of upstream's tarballs.
* Update get-orig-source target in debian/rules.
* Update gbp config file.
* Bump Standards.
* Build-depend on libwxsqlite3-2.8-dev
* Enable parallel builds.
* Link binaries against the system-wide copy of wxsqlite3.
* Point sources to the correct wxcurl's headers location.
* Update copyright file as per DEP-5
* Improve debian/watch to handle the ~dfsg\d* suffix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -------------------------------------------------------------------------------- //
 
2
//      Copyright (C) 2008-2011 J.Rios
 
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
 
7
//    the Free Software Foundation; either version 3, or (at your option)
 
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 MAINFRAME_H
 
22
#define MAINFRAME_H
 
23
 
 
24
#include "AlbumBrowser.h"
 
25
#include "AuiNotebook.h"
 
26
#include "Config.h"
 
27
#include "CoverPanel.h"
 
28
#include "curl/http.h"
 
29
#include "dbus/gudbus.h"
 
30
#include "dbus/mpris.h"
 
31
#include "dbus/mpris2.h"
 
32
#include "dbus/mmkeys.h"
 
33
#include "dbus/gsession.h"
 
34
#include "dbus/notify.h"
 
35
#include "DbLibrary.h"
 
36
#include "DbCache.h"
 
37
#include "FileBrowser.h"
 
38
#include "Jamendo.h"
 
39
#include "LastFM.h"
 
40
#include "LastFMPanel.h"
 
41
#include "LibPanel.h"
 
42
#include "GIO_Volume.h"
 
43
#include "LyricsPanel.h"
 
44
#include "Magnatune.h"
 
45
#include "PlayerFilters.h"
 
46
#include "PlayerPanel.h"
 
47
#include "PlayListPanel.h"
 
48
#include "PodcastsPanel.h"
 
49
#include "PortableMedia.h"
 
50
#include "RadioPanel.h"
 
51
#include "StatusBar.h"
 
52
#include "SplashWin.h"
 
53
#include "TreePanel.h"
 
54
#include "Vumeters.h"
 
55
 
 
56
#include <wx/aui/aui.h>
 
57
#include <wx/wx.h>
 
58
#include <wx/splitter.h>
 
59
#include <wx/regex.h>
 
60
#include <wx/sstream.h>
 
61
#include <wx/uri.h>
 
62
#include <wx/xml/xml.h>
 
63
#include <wx/zstream.h>
 
64
 
 
65
#ifdef WITH_LIBINDICATE_SUPPORT
 
66
 
 
67
#define GUAYADEQUE_INDICATOR_NAME               "music.guayadeque"
 
68
#define GUAYADEQUE_DESKTOP_PATH                 "/usr/share/applications/guayadeque.desktop"
 
69
 
 
70
#include "libindicate/server.h"
 
71
#include "libindicate/indicator.h"
 
72
//#include "libindicate-gtk/indicator.h"
 
73
 
 
74
#endif
 
75
 
 
76
#define     guPANEL_MAIN_PLAYERPLAYLIST     ( 1 << 0 )
 
77
#define     guPANEL_MAIN_PLAYERFILTERS      ( 1 << 1 )
 
78
#define     guPANEL_MAIN_PLAYERVUMETERS     ( 1 << 2 )
 
79
#define     guPANEL_MAIN_LIBRARY            ( 1 << 3 )
 
80
#define     guPANEL_MAIN_RADIOS             ( 1 << 4 )
 
81
#define     guPANEL_MAIN_LASTFM             ( 1 << 5 )
 
82
#define     guPANEL_MAIN_LYRICS             ( 1 << 6 )
 
83
#define     guPANEL_MAIN_PLAYLISTS          ( 1 << 7 )
 
84
#define     guPANEL_MAIN_PODCASTS           ( 1 << 8 )
 
85
#define     guPANEL_MAIN_ALBUMBROWSER       ( 1 << 9 )
 
86
#define     guPANEL_MAIN_FILEBROWSER        ( 1 << 10 )
 
87
#define     guPANEL_MAIN_JAMENDO            ( 1 << 11 )
 
88
#define     guPANEL_MAIN_MAGNATUNE          ( 1 << 12 )
 
89
#define     guPANEL_MAIN_LOCATIONS          ( 1 << 13 )
 
90
#define     guPANEL_MAIN_SHOWCOVER          ( 1 << 14 )
 
91
#define     guPANEL_MAIN_TREEVIEW           ( 1 << 15 )
 
92
 
 
93
 
 
94
#define     guPANEL_MAIN_SELECTOR           ( guPANEL_MAIN_LIBRARY | guPANEL_MAIN_RADIOS |\
 
95
                                              guPANEL_MAIN_LASTFM | guPANEL_MAIN_LYRICS  |\
 
96
                                              guPANEL_MAIN_PLAYLISTS | guPANEL_MAIN_PODCASTS |\
 
97
                                              guPANEL_MAIN_ALBUMBROWSER | guPANEL_MAIN_FILEBROWSER |\
 
98
                                              guPANEL_MAIN_TREEVIEW )
 
99
#define     guPANEL_MAIN_VISIBLE_DEFAULT    ( guPANEL_MAIN_PLAYERPLAYLIST | guPANEL_MAIN_PLAYERFILTERS | \
 
100
                                              guPANEL_MAIN_SELECTOR )
 
101
 
 
102
#define     guPORTABLEDEVICE_COMMANDS_COUNT 20  // 0 .. 9 Main Window Commands
 
103
                                                // 10 .. 19 -> Library Pane Windows
 
104
 
 
105
#define     guWINDOW_STATE_NORMAL           0
 
106
#define     guWINDOW_STATE_FULLSCREEN       ( 1 << 0 )
 
107
#define     guWINDOW_STATE_MAXIMIZED        ( 1 << 1 )
 
108
#define     guWINDOW_STATE_NOSTATUSBAR      ( 1 << 3 )
 
109
 
 
110
enum guUPDATED_TRACKS {
 
111
    guUPDATED_TRACKS_NONE = 0,
 
112
    guUPDATED_TRACKS_PLAYER,
 
113
    guUPDATED_TRACKS_PLAYER_PLAYLIST,
 
114
    guUPDATED_TRACKS_LIBRARY,
 
115
    guUPDATED_TRACKS_PLAYLISTS,
 
116
    guUPDATED_TRACKS_TREEVIEW
 
117
};
 
118
 
 
119
class guTaskBarIcon;
 
120
class guLibUpdateThread;
 
121
class guLibCleanThread;
 
122
class guUpdatePodcastsTimer;
 
123
class guCopyToThread;
 
124
class guLocationPanel;
 
125
 
 
126
// -------------------------------------------------------------------------------- //
 
127
class guMainFrame : public wxFrame
 
128
{
 
129
  private:
 
130
    wxAuiManager                    m_AuiManager;
 
131
    unsigned int                    m_VisiblePanels;
 
132
 
 
133
    guAuiNotebook *                 m_CatNotebook;
 
134
    wxString                        m_NBPerspective;
 
135
    wxSplitterWindow *              m_PlayerSplitter;
 
136
    guPlayerFilters *               m_PlayerFilters;
 
137
    guPlayerPlayList *              m_PlayerPlayList;
 
138
    guPlayerVumeters *              m_PlayerVumeters;
 
139
    guPlayerPanel *                 m_PlayerPanel;
 
140
    guLibPanel *                    m_LibPanel;
 
141
    guRadioPanel *                  m_RadioPanel;
 
142
    guLastFMPanel *                 m_LastFMPanel;
 
143
    guLyricsPanel *                 m_LyricsPanel;
 
144
    guPlayListPanel *               m_PlayListPanel;
 
145
    guPodcastPanel *                m_PodcastsPanel;
 
146
    guAlbumBrowser *                m_AlbumBrowserPanel;
 
147
    guFileBrowser *                 m_FileBrowserPanel;
 
148
    guJamendoPanel *                m_JamendoPanel;
 
149
    guMagnatunePanel *              m_MagnatunePanel;
 
150
    guLocationPanel *               m_LocationPanel;
 
151
    guCoverPanel *                  m_CoverPanel;
 
152
    guTreeViewPanel *               m_TreeViewPanel;
 
153
 
 
154
    guTaskBarIcon *                 m_TaskBarIcon;
 
155
#ifdef WITH_LIBINDICATE_SUPPORT
 
156
    IndicateServer *                m_IndicateServer;
 
157
#endif
 
158
    guStatusBar *                   m_MainStatusBar;
 
159
 
 
160
    wxMenuItem *                    m_PlaySmartMenuItem;
 
161
    wxMenuItem *                    m_LoopPlayListMenuItem;
 
162
    wxMenuItem *                    m_LoopTrackMenuItem;
 
163
 
 
164
    wxMenu *                        m_MainMenu;
 
165
    wxMenu *                        m_LayoutLoadMenu;
 
166
    wxMenu *                        m_LayoutDelMenu;
 
167
 
 
168
    wxMenuItem *                    m_ViewPlayerPlayList;
 
169
    wxMenuItem *                    m_ViewPlayerFilters;
 
170
    wxMenuItem *                    m_ViewPlayerSelector;
 
171
    wxMenuItem *                    m_ViewPlayerVumeters;
 
172
    wxMenuItem *                    m_ViewMainLocations;
 
173
    wxMenuItem *                    m_ViewMainShowCover;
 
174
    wxMenuItem *                    m_ViewLibrary;
 
175
    wxMenuItem *                    m_ViewLibTextSearch;
 
176
    wxMenuItem *                    m_ViewLibLabels;
 
177
    wxMenuItem *                    m_ViewLibGenres;
 
178
    wxMenuItem *                    m_ViewLibArtists;
 
179
    wxMenuItem *                    m_ViewLibAlbums;
 
180
    wxMenuItem *                    m_ViewLibYears;
 
181
    wxMenuItem *                    m_ViewLibRatings;
 
182
    wxMenuItem *                    m_ViewLibPlayCounts;
 
183
    wxMenuItem *                    m_ViewLibComposers;
 
184
    wxMenuItem *                    m_ViewLibAlbumArtists;
 
185
 
 
186
    wxMenuItem *                    m_ViewRadios;
 
187
    wxMenuItem *                    m_ViewRadTextSearch;
 
188
    wxMenuItem *                    m_ViewRadLabels;
 
189
    wxMenuItem *                    m_ViewRadGenres;
 
190
 
 
191
    wxMenuItem *                    m_ViewLastFM;
 
192
    wxMenuItem *                    m_ViewLyrics;
 
193
 
 
194
    wxMenuItem *                    m_ViewPlayLists;
 
195
    wxMenuItem *                    m_ViewPLTextSearch;
 
196
 
 
197
    wxMenuItem *                    m_ViewAlbumBrowser;
 
198
 
 
199
    wxMenuItem *                    m_ViewFileBrowser;
 
200
 
 
201
    wxMenuItem *                    m_ViewJamendo;
 
202
    wxMenuItem *                    m_ViewJamTextSearch;
 
203
    wxMenuItem *                    m_ViewJamLabels;
 
204
    wxMenuItem *                    m_ViewJamGenres;
 
205
    wxMenuItem *                    m_ViewJamArtists;
 
206
    wxMenuItem *                    m_ViewJamAlbums;
 
207
    wxMenuItem *                    m_ViewJamYears;
 
208
    wxMenuItem *                    m_ViewJamRatings;
 
209
    wxMenuItem *                    m_ViewJamPlayCounts;
 
210
    wxMenuItem *                    m_ViewJamComposers;
 
211
    wxMenuItem *                    m_ViewJamAlbumArtists;
 
212
 
 
213
    wxMenuItem *                    m_ViewMagnatune;
 
214
    wxMenuItem *                    m_ViewMagTextSearch;
 
215
    wxMenuItem *                    m_ViewMagLabels;
 
216
    wxMenuItem *                    m_ViewMagGenres;
 
217
    wxMenuItem *                    m_ViewMagArtists;
 
218
    wxMenuItem *                    m_ViewMagAlbums;
 
219
    wxMenuItem *                    m_ViewMagYears;
 
220
    wxMenuItem *                    m_ViewMagRatings;
 
221
    wxMenuItem *                    m_ViewMagPlayCounts;
 
222
    wxMenuItem *                    m_ViewMagComposers;
 
223
    wxMenuItem *                    m_ViewMagAlbumArtists;
 
224
 
 
225
    wxMenuItem *                    m_ViewPodcasts;
 
226
    wxMenuItem *                    m_ViewPodChannels;
 
227
    wxMenuItem *                    m_ViewPodDetails;
 
228
 
 
229
    wxMenuItem *                    m_ViewTreeView;
 
230
    wxMenuItem *                    m_ViewTVTextSearch;
 
231
 
 
232
    wxMenuItem *                    m_ViewFullScreen;
 
233
    wxMenuItem *                    m_ViewStatusBar;
 
234
 
 
235
    wxMenuItem *                    m_ForceGaplessMenuItem;
 
236
    wxMenuItem *                    m_AudioScrobbleMenuItem;
 
237
 
 
238
    wxMenu *                        m_PortableDevicesMenu;
 
239
 
 
240
 
 
241
    guDbLibrary *                   m_Db;
 
242
    guDbCache *                     m_DbCache;
 
243
    guJamendoLibrary *              m_JamendoDb;
 
244
    guMagnatuneLibrary *            m_MagnatuneDb;
 
245
    guLibUpdateThread *             m_LibUpdateThread;
 
246
    guLibCleanThread *              m_LibCleanThread;
 
247
 
 
248
    wxIcon                          m_AppIcon;
 
249
 
 
250
    guUpdatePodcastsTimer *         m_UpdatePodcastsTimer;
 
251
 
 
252
    guPodcastDownloadQueueThread    * m_DownloadThread;
 
253
    wxMutex                         m_DownloadThreadMutex;
 
254
 
 
255
    guDBusServer *                  m_DBusServer;
 
256
    guMPRIS *                       m_MPRIS;
 
257
    guMPRIS2 *                      m_MPRIS2;
 
258
    guMMKeys *                      m_MMKeys;
 
259
    guGSession *                    m_GSession;
 
260
    guDBusNotify *                  m_NotifySrv;
 
261
 
 
262
    guGIO_VolumeMonitor *           m_VolumeMonitor;
 
263
//    guPortableMediaLibraryArray     m_PortableMediaDbs;
 
264
//    guPortableMediaPanelArray       m_PortableMediaPanels;
 
265
    guPortableMediaViewCtrlArray    m_PortableMediaViewCtrls;
 
266
 
 
267
    wxWindow *                      m_CurrentPage;
 
268
 
 
269
    wxLongLong                      m_SelCount;
 
270
    wxLongLong                      m_SelLength;
 
271
    wxLongLong                      m_SelSize;
 
272
 
 
273
    // Layouts
 
274
    wxSortedArrayString             m_LayoutNames;
 
275
 
 
276
    guCopyToThread *                m_CopyToThread;
 
277
    wxMutex                         m_CopyToThreadMutex;
 
278
 
 
279
    guLyricSearchEngine *           m_LyricSearchEngine;
 
280
    guLyricSearchContext *          m_LyricSearchContext;
 
281
 
 
282
    int                             m_LoadLayoutPending;
 
283
 
 
284
    void                            OnUpdateLibrary( wxCommandEvent &event );
 
285
    void                            OnUpdatePodcasts( wxCommandEvent &event );
 
286
    void                            OnUpdateCovers( wxCommandEvent &event );
 
287
    void                            OnUpdateTrack( wxCommandEvent &event );
 
288
    void                            OnPlayerStatusChanged( wxCommandEvent &event );
 
289
    void                            OnPlayerTrackListChanged( wxCommandEvent &event );
 
290
    void                            OnPlayerCapsChanged( wxCommandEvent &event );
 
291
    void                            OnPlayerVolumeChanged( wxCommandEvent &event );
 
292
    void                            OnAudioScrobbleUpdate( wxCommandEvent &event );
 
293
    void                            CreatePortablePlayersMenu( wxMenu * menu );
 
294
    void                            CreateMenu();
 
295
    void                            DoCreateStatusBar( int kind );
 
296
    void                            OnCloseWindow( wxCloseEvent &event );
 
297
    //void                            OnIconizeWindow( wxIconizeEvent &event );
 
298
    void                            OnPreferences( wxCommandEvent &event );
 
299
 
 
300
    void                            OnPlay( wxCommandEvent &event );
 
301
    void                            OnStop( wxCommandEvent &event );
 
302
    void                            OnStopAtEnd( wxCommandEvent &event );
 
303
    void                            OnClearPlaylist( wxCommandEvent &event );
 
304
    void                            OnNextTrack( wxCommandEvent &event );
 
305
    void                            OnPrevTrack( wxCommandEvent &event );
 
306
    void                            OnNextAlbum( wxCommandEvent &event );
 
307
    void                            OnPrevAlbum( wxCommandEvent &event );
 
308
    void                            OnSmartPlay( wxCommandEvent &event );
 
309
    void                            OnRandomize( wxCommandEvent &event );
 
310
    void                            OnRepeat( wxCommandEvent &event );
 
311
    void                            OnAbout( wxCommandEvent &event );
 
312
    void                            OnHelp( wxCommandEvent &event );
 
313
    void                            OnCommunity( wxCommandEvent &event );
 
314
    void                            OnCopyTracksTo( wxCommandEvent &event );
 
315
    void                            OnCopyTracksToDevice( wxCommandEvent &event );
 
316
    void                            OnCopyPlayListToDevice( wxCommandEvent &event );
 
317
    void                            OnUpdateLabels( wxCommandEvent &event );
 
318
    void                            OnPlayerPlayListUpdateTitle( wxCommandEvent &event );
 
319
 
 
320
    void                            CheckShowNotebook( void );
 
321
    void                            CheckHideNotebook( void );
 
322
 
 
323
    void                            OnGaugeCreate( wxCommandEvent &event );
 
324
    void                            OnGaugePulse( wxCommandEvent &event );
 
325
    void                            OnGaugeSetMax( wxCommandEvent &event );
 
326
    void                            OnGaugeUpdate( wxCommandEvent &event );
 
327
    void                            OnGaugeRemove( wxCommandEvent &event );
 
328
 
 
329
    void                            OnSelectTrack( wxCommandEvent &event );
 
330
    void                            OnSelectAlbum( wxCommandEvent &event );
 
331
    void                            OnSelectAlbumArtist( wxCommandEvent &event );
 
332
    void                            OnSelectComposer( wxCommandEvent &event );
 
333
    void                            OnSelectArtist( wxCommandEvent &event );
 
334
    void                            OnSelectYear( wxCommandEvent &event );
 
335
    void                            OnSelectGenre( wxCommandEvent &event );
 
336
    void                            OnSelectLocation( wxCommandEvent &event );
 
337
    void                            OnGenreSetSelection( wxCommandEvent &event );
 
338
    void                            OnAlbumArtistSetSelection( wxCommandEvent &event );
 
339
    void                            OnComposerSetSelection( wxCommandEvent &event );
 
340
    void                            OnArtistSetSelection( wxCommandEvent &event );
 
341
    void                            OnAlbumSetSelection( wxCommandEvent &event );
 
342
 
 
343
    void                            OnPlayListUpdated( wxCommandEvent &event );
 
344
 
 
345
    void                            CreateTaskBarIcon( void );
 
346
 
 
347
    void                            OnPodcastItemUpdated( wxCommandEvent &event );
 
348
    void                            OnRemovePodcastThread( wxCommandEvent &event );
 
349
 
 
350
    void                            OnIdle( wxIdleEvent &event );
 
351
    void                            OnSize( wxSizeEvent &event );
 
352
    void                            OnPageChanged( wxAuiNotebookEvent& event );
 
353
    void                            OnPageClosed( wxAuiNotebookEvent& event );
 
354
    void                            DoPageClose( wxPanel * panel );
 
355
 
 
356
//    void                            SetLibTracks( wxCommandEvent &event );
 
357
//    void                            SetRadioStations( wxCommandEvent &event );
 
358
//    void                            SetPlayListTracks( wxCommandEvent &event );
 
359
//    void                            SetPodcasts( wxCommandEvent &event );
 
360
    void                            OnUpdateSelInfo( wxCommandEvent &event );
 
361
    void                            OnRequestCurrentTrack( wxCommandEvent &event );
 
362
 
 
363
    //void                            OnSysColorChanged( wxSysColourChangedEvent &event );
 
364
 
 
365
    void                            OnCreateNewLayout( wxCommandEvent &event );
 
366
    void                            OnLoadLayout( wxCommandEvent &event );
 
367
    void                            OnDeleteLayout( wxCommandEvent &event );
 
368
    bool                            SaveCurrentLayout( const wxString &layoutname );
 
369
    void                            LoadLayoutNames( void );
 
370
    void                            CreateLayoutMenus( void );
 
371
 
 
372
    void                            OnPlayerShowPanel( wxCommandEvent &event );
 
373
    void                            ShowMainPanel( const int panelid, const bool enable );
 
374
 
 
375
    void                            OnViewLibrary( wxCommandEvent &event );
 
376
    void                            OnLibraryShowPanel( wxCommandEvent &event );
 
377
 
 
378
    void                            OnViewRadio( wxCommandEvent &event );
 
379
    void                            OnRadioShowPanel( wxCommandEvent &event );
 
380
 
 
381
    void                            OnViewLastFM( wxCommandEvent &event );
 
382
    void                            OnViewLyrics( wxCommandEvent &event );
 
383
 
 
384
    void                            OnViewPlayLists( wxCommandEvent &event );
 
385
    void                            OnPlayListShowPanel( wxCommandEvent &event );
 
386
 
 
387
    void                            OnViewPodcasts( wxCommandEvent &event );
 
388
    void                            OnPodcastsShowPanel( wxCommandEvent &event );
 
389
 
 
390
    void                            OnViewAlbumBrowser( wxCommandEvent &event );
 
391
 
 
392
    void                            OnViewFileBrowser( wxCommandEvent &event );
 
393
 
 
394
    void                            OnViewJamendo( wxCommandEvent &event );
 
395
    void                            OnJamendoShowPanel( wxCommandEvent &event );
 
396
 
 
397
    void                            OnViewMagnatune( wxCommandEvent &event );
 
398
    void                            OnMagnatuneShowPanel( wxCommandEvent &event );
 
399
 
 
400
    void                            OnViewPortableDevice( wxCommandEvent &event );
 
401
    void                            OnViewPortableDevicePanel( wxCommandEvent &event );
 
402
 
 
403
    void                            OnViewTreeView( wxCommandEvent &event );
 
404
    void                            OnTreeViewShowPanel( wxCommandEvent &event );
 
405
 
 
406
    void                            OnMainPaneClose( wxAuiManagerEvent &event );
 
407
 
 
408
    void                            LoadPerspective( const wxString &layout );
 
409
    void                            LoadTabsPerspective( const wxString &layout );
 
410
 
 
411
    void                            OnForceUpdateLibrary( wxCommandEvent &event );
 
412
    void                            OnAddLibraryPath( wxCommandEvent &event );
 
413
    void                            OnPlayStream( wxCommandEvent &event );
 
414
 
 
415
    void                            OnViewFullScreen( wxCommandEvent &event );
 
416
    void                            OnViewStatusBar( wxCommandEvent &event );
 
417
 
 
418
    // There is a bug that dont removes correctly the last window from the AuiNotebook
 
419
    // When a new one is inserted if it was already in the Notebook then
 
420
    // Its shown the last removed tab instead of the new we created.
 
421
    // As a workaround we control if we are going to remove the last window and if so
 
422
    // Instead of remove it we hide the Notebook
 
423
    // When inserting we need to control if it was hiden and if so add the new one and remove the first
 
424
    // We create two functions RemoveTabPanel and InsertTabPanel that controls this
 
425
    void                            RemoveTabPanel( wxPanel * panel );
 
426
    void                            InsertTabPanel( wxPanel * panel, const int index, const wxString &label );
 
427
 
 
428
    void                            OnLibraryCoverChanged( wxCommandEvent &event );
 
429
    void                            OnJamendoCoverDownloaded( wxCommandEvent &event );
 
430
    void                            OnMagnatuneCoverDownloaded( wxCommandEvent &event );
 
431
    void                            OnPlayerPanelCoverChanged( wxCommandEvent &event );
 
432
 
 
433
    void                            OnVolumeMonitorUpdated( wxCommandEvent &event );
 
434
    void                            CreatePortableMediaDeviceMenu( wxMenu * menu, const wxString &devicename, const int basecmd );
 
435
 
 
436
    void                            OnSetForceGapless( wxCommandEvent &event );
 
437
    void                            OnSetAudioScrobble( wxCommandEvent &event );
 
438
 
 
439
    void                            OnLyricFound( wxCommandEvent &event );
 
440
    void                            OnLyricSearchFirst( wxCommandEvent &event );
 
441
    void                            OnLyricSearchNext( wxCommandEvent &event );
 
442
    void                            OnLyricSaveChanges( wxCommandEvent &event );
 
443
    void                            OnLyricExecCommand( wxCommandEvent &event );
 
444
 
 
445
    void                            OnConfigUpdated( wxCommandEvent &event );
 
446
 
 
447
    void                            OnChangeVolume( wxCommandEvent &event );
 
448
 
 
449
    void                            ResetViewMenuState( void );
 
450
    void                            RefreshViewMenuState( void );
 
451
 
 
452
    void                            OnSongSetRating( wxCommandEvent &event );
 
453
 
 
454
    void                            OnSetAllowDenyFilter( wxCommandEvent &event );
 
455
 
 
456
    void                            OnRaiseWindow( wxCommandEvent &event );
 
457
    void                            OnLoadPlayList( wxCommandEvent &event );
 
458
 
 
459
  public:
 
460
                                    guMainFrame( wxWindow * parent, guDbLibrary * db, guDbCache * dbcache );
 
461
                                    ~guMainFrame();
 
462
    guDbLibrary *                   GetDb( void ) { return m_Db; }
 
463
    void                            DoLibraryClean( wxCommandEvent &event );
 
464
    void                            LibraryUpdated( wxCommandEvent &event );
 
465
    void                            OnJamendoUpdated( wxCommandEvent &event );
 
466
    void                            OnMagnatuneUpdated( wxCommandEvent &event );
 
467
    void                            LibraryCleanFinished( wxCommandEvent &event );
 
468
    void                            LibraryReloadControls( wxCommandEvent &event );
 
469
    void                            OnQuit( wxCommandEvent &event );
 
470
    void                            OnCloseTab( wxCommandEvent &event );
 
471
    void                            OnHideCaptions( wxCommandEvent &event );
 
472
    void                            UpdatePodcasts( void );
 
473
 
 
474
    void                            RemovePodcastsDownloadThread( void );
 
475
    void                            AddPodcastsDownloadItems( guPodcastItemArray * items );
 
476
    void                            RemovePodcastDownloadItems( guPodcastItemArray * items );
 
477
 
 
478
    void                            UpdatedTracks( int updatedby, const guTrackArray * tracks );
 
479
    void                            UpdatedTrack( int updatedby, const guTrack * track );
 
480
 
 
481
    guDBusNotify *                  GetNotifyObject( void ) { return m_NotifySrv; };
 
482
 
 
483
    guJamendoPanel *                GetJamendoPanel( void ) { return m_JamendoPanel; }
 
484
    guJamendoLibrary *              GetJamendoDb( void )
 
485
    {
 
486
        if( !m_JamendoDb )
 
487
            m_JamendoDb = new guJamendoLibrary( wxGetHomeDir() + wxT( "/.guayadeque/Jamendo/Jamendo.db" ) );
 
488
         return m_JamendoDb;
 
489
    }
 
490
    guMagnatunePanel *              GetMagnatunePanel( void ) { return m_MagnatunePanel; }
 
491
    guMagnatuneLibrary *            GetMagnatuneDb( void )
 
492
    {
 
493
        if( !m_MagnatuneDb )
 
494
            m_MagnatuneDb = new guMagnatuneLibrary( wxGetHomeDir() + wxT( "/.guayadeque/Magnatune/Magnatune.db" ) );
 
495
         return m_MagnatuneDb;
 
496
    }
 
497
 
 
498
    void                            CreateCopyToMenu( wxMenu * menu, const int basecmd );
 
499
 
 
500
    void                            CopyToThreadFinished( void );
 
501
    int                             VisiblePanels( void ) { return m_VisiblePanels; }
 
502
 
 
503
    wxArrayString                   PortableDeviceVolumeNames( void ) { return m_VolumeMonitor->GetMountNames(); }
 
504
 
 
505
    guPortableMediaViewCtrl *       GetPortableMediaViewCtrl( const int basecmd );
 
506
    guPortableMediaViewCtrl *       GetPortableMediaViewCtrl( wxWindow * libpanel, const int windowtype = guPANEL_MAIN_LIBRARY );
 
507
 
 
508
    guLyricSearchEngine *           LyricSearchEngine( void ) { return m_LyricSearchEngine; }
 
509
 
 
510
};
 
511
 
 
512
// -------------------------------------------------------------------------------- //
 
513
class guUpdateCoversThread : public wxThread
 
514
{
 
515
  private:
 
516
    guDbLibrary * m_Db;
 
517
    int         m_GaugeId;
 
518
 
 
519
  public:
 
520
    guUpdateCoversThread( guDbLibrary * db, int gaugeid );
 
521
    ~guUpdateCoversThread();
 
522
 
 
523
    virtual ExitCode Entry();
 
524
};
 
525
 
 
526
// -------------------------------------------------------------------------------- //
 
527
class guUpdatePodcastsTimer : public wxTimer
 
528
{
 
529
  protected :
 
530
    guDbLibrary * m_Db;
 
531
    guMainFrame * m_MainFrame;
 
532
 
 
533
  public:
 
534
    guUpdatePodcastsTimer( guMainFrame * mainframe, guDbLibrary * db );
 
535
 
 
536
    //Called each time the timer's timeout expires
 
537
    void Notify();
 
538
};
 
539
 
 
540
// -------------------------------------------------------------------------------- //
 
541
class guUpdatePodcastsThread : public wxThread
 
542
{
 
543
  protected :
 
544
    int             m_GaugeId;
 
545
    guDbLibrary *     m_Db;
 
546
    guMainFrame *   m_MainFrame;
 
547
 
 
548
  public :
 
549
    guUpdatePodcastsThread( guDbLibrary * db, guMainFrame * mainframe, int gaugeid );
 
550
    ~guUpdatePodcastsThread();
 
551
 
 
552
    virtual ExitCode Entry();
 
553
 
 
554
};
 
555
 
 
556
#endif
 
557
// -------------------------------------------------------------------------------- //