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

« back to all changes in this revision

Viewing changes to src/PodcastsPanel.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
1
// -------------------------------------------------------------------------------- //
2
 
//      Copyright (C) 2008-2010 J.Rios
 
2
//      Copyright (C) 2008-2011 J.Rios
3
3
//      anonbeat@gmail.com
4
4
//
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.
9
9
//
10
10
//    This Program is distributed in the hope that it will be useful,
21
21
#ifndef PODCASTSPANEL_H
22
22
#define PODCASTSPANEL_H
23
23
 
 
24
#include "AuiManagedPanel.h"
24
25
#include "DbLibrary.h"
25
26
#include "PlayerPanel.h"
26
27
 
48
49
#define guPODCASTS_COLUMN_LASTPLAY      8
49
50
#define guPODCASTS_COLUMN_ADDEDDATE     9
50
51
 
 
52
#define guPODCASTS_COLUMN_COUNT         10
 
53
 
51
54
// -------------------------------------------------------------------------------- //
52
55
class guChannelsListBox : public guListBox
53
56
{
77
80
class guPodcastListBox : public guListView
78
81
{
79
82
  protected :
80
 
    guDbLibrary *       m_Db;
81
 
    guPodcastItemArray  m_PodItems;
82
 
    wxArrayInt          m_PodChFilters;
83
 
    int                 m_Order;
84
 
    bool                m_OrderDesc;
85
 
    wxImage *           m_Images[ guPODCAST_STATUS_ERROR + 1 ];
86
 
    wxArrayString       m_ColumnNames;
 
83
    guDbLibrary *               m_Db;
 
84
    guPodcastItemArray          m_PodItems;
 
85
    wxArrayInt                  m_PodChFilters;
 
86
    int                         m_Order;
 
87
    bool                        m_OrderDesc;
 
88
    wxImage *                   m_Images[ guPODCAST_STATUS_ERROR + 1 ];
 
89
    wxArrayString               m_ColumnNames;
87
90
 
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 );
96
99
 
 
100
    void                        OnConfigUpdated( wxCommandEvent &event );
 
101
    void                        CreateAcceleratorTable();
 
102
 
97
103
  public :
98
104
    guPodcastListBox( wxWindow * parent, guDbLibrary * NewDb );
99
105
    ~guPodcastListBox();
117
123
class guMainFrame;
118
124
 
119
125
// -------------------------------------------------------------------------------- //
120
 
class guPodcastPanel : public wxPanel
 
126
class guPodcastPanel : public guAuiManagedPanel
121
127
{
122
128
  private:
123
129
    void                MainSplitterOnIdle( wxIdleEvent& );
132
138
 
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 );
139
144
 
140
145
 
141
146
  protected:
142
 
    wxAuiManager                m_AuiManager;
143
 
    unsigned int                m_VisiblePanels;
144
 
 
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;
151
153
 
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 );
178
178
 
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 );
181
181
 
182
182
    void OnConfigUpdated( wxCommandEvent &event );
183
183
 
184
 
    void OnPaneClose( wxAuiManagerEvent &event );
185
 
 
186
184
public:
187
185
    guPodcastPanel( wxWindow * parent, guDbLibrary * db, guMainFrame * mainframe, guPlayerPanel * playerpanel );
188
186
    ~guPodcastPanel();
189
187
 
190
 
    bool IsPanelShown( const int panelid ) const;
191
 
    void ShowPanel( const int panelid, bool show );
192
 
 
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 );
195
191
 
196
192
    void GetCounters( wxLongLong * count, wxLongLong * len, wxLongLong * size )
197
193
    {
198
194
        m_Db->GetPodcastCounters( m_PodcastsListBox->GetFilters(), count, len, size );
199
195
    }
200
196
 
 
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 ); }
 
200
 
 
201
 
201
202
    friend class guPodcastDownloadQueueThread;
202
203
};
203
204