1
1
// -------------------------------------------------------------------------------- //
2
// Copyright (C) 2008-2010 J.Rios
2
// Copyright (C) 2008-2011 J.Rios
3
3
// anonbeat@gmail.com
5
5
// This Program is free software; you can redistribute it and/or modify
6
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation; either version 2, or (at your option)
7
// the Free Software Foundation; either version 3, or (at your option)
8
8
// any later version.
10
10
// This Program is distributed in the hope that it will be useful,
48
49
#define guPODCASTS_COLUMN_LASTPLAY 8
49
50
#define guPODCASTS_COLUMN_ADDEDDATE 9
52
#define guPODCASTS_COLUMN_COUNT 10
51
54
// -------------------------------------------------------------------------------- //
52
55
class guChannelsListBox : public guListBox
77
80
class guPodcastListBox : public guListView
81
guPodcastItemArray m_PodItems;
82
wxArrayInt m_PodChFilters;
85
wxImage * m_Images[ guPODCAST_STATUS_ERROR + 1 ];
86
wxArrayString m_ColumnNames;
84
guPodcastItemArray m_PodItems;
85
wxArrayInt m_PodChFilters;
88
wxImage * m_Images[ guPODCAST_STATUS_ERROR + 1 ];
89
wxArrayString m_ColumnNames;
88
91
virtual void DrawItem( wxDC &dc, const wxRect &rect, const int row, const int col ) const;
89
92
virtual void CreateContextMenu( wxMenu * Menu ) const;
94
97
virtual int GetDragFiles( wxFileDataObject * files );
95
98
virtual void OnKeyDown( wxKeyEvent &event );
100
void OnConfigUpdated( wxCommandEvent &event );
101
void CreateAcceleratorTable();
98
104
guPodcastListBox( wxWindow * parent, guDbLibrary * NewDb );
99
105
~guPodcastListBox();
117
123
class guMainFrame;
119
125
// -------------------------------------------------------------------------------- //
120
class guPodcastPanel : public wxPanel
126
class guPodcastPanel : public guAuiManagedPanel
123
129
void MainSplitterOnIdle( wxIdleEvent& );
133
139
void OnPodcastItemPlay( wxCommandEvent &event );
134
140
void OnPodcastItemEnqueue( wxCommandEvent &event );
135
void OnPodcastItemEnqueueAsNext( wxCommandEvent &event );
136
141
void OnPodcastItemDelete( wxCommandEvent &event );
137
142
void OnPodcastItemDownload( wxCommandEvent &event );
138
143
void OnPodcastItemCopyTo( wxCommandEvent &event );
142
wxAuiManager m_AuiManager;
143
unsigned int m_VisiblePanels;
145
147
guDbLibrary * m_Db;
146
148
guMainFrame * m_MainFrame;
147
149
guPlayerPanel * m_PlayerPanel;
149
151
int m_LastChannelInfoId;
150
152
int m_LastPodcastInfoId;
152
// wxSplitterWindow * m_MainSplitter;
153
// wxSplitterWindow * m_TopSplitter;
154
154
guChannelsListBox * m_ChannelsListBox;
155
155
guPodcastListBox * m_PodcastsListBox;
156
156
wxBoxSizer * m_DetailMainSizer;
177
177
void UpdateChannels( wxCommandEvent &event );
179
179
void ClearDownloadThread( void );
180
void OnSelectPodcasts( bool enqueue = false, const bool asnext = false );
180
void OnSelectPodcasts( bool enqueue = false, const int aftercurrent = 0 );
182
182
void OnConfigUpdated( wxCommandEvent &event );
184
void OnPaneClose( wxAuiManagerEvent &event );
187
185
guPodcastPanel( wxWindow * parent, guDbLibrary * db, guMainFrame * mainframe, guPlayerPanel * playerpanel );
188
186
~guPodcastPanel();
190
bool IsPanelShown( const int panelid ) const;
191
void ShowPanel( const int panelid, bool show );
193
void SelectPodcast( const int podcastid );
194
void SelectChannel( const int channelid );
188
virtual void InitPanelData( void );
189
void SelectPodcast( const int podcastid );
190
void SelectChannel( const int channelid );
196
192
void GetCounters( wxLongLong * count, wxLongLong * len, wxLongLong * size )
198
194
m_Db->GetPodcastCounters( m_PodcastsListBox->GetFilters(), count, len, size );
197
virtual int GetListViewColumnCount( void ) { return guPODCASTS_COLUMN_COUNT; }
198
virtual bool GetListViewColumnData( const int id, int * index, int * width, bool * enabled ) { return m_PodcastsListBox->GetColumnData( id, index, width, enabled ); }
199
virtual bool SetListViewColumnData( const int id, const int index, const int width, const bool enabled, const bool refresh = false ) { return m_PodcastsListBox->SetColumnData( id, index, width, enabled, refresh ); }
201
202
friend class guPodcastDownloadQueueThread;