1 /*****************************************************************************
2 * playlist.hpp: Header for the playlist
3 *****************************************************************************
4 * Copyright (C) 1999-2005 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef _WXVLC_PLAYLIST_H_
25 #define _WXVLC_PLAYLIST_H_
27 #include "wxwidgets.hpp"
29 #include <wx/treectrl.h>
46 class Playlist: public wxFrame
50 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
53 void UpdatePlaylist();
54 void ShowPlaylist( bool show );
55 void UpdateItem( int );
56 void AppendItem( wxCommandEvent& );
59 int i_items_to_append;
62 void RemoveItem( int );
63 void DeleteTreeItem( wxTreeItemId );
64 void DeleteItem( int item );
65 void DeleteNode( playlist_item_t *node );
67 void RecursiveDeleteSelection( wxTreeItemId );
69 /* Event handlers (these functions should _not_ be virtual) */
72 void OnAddFile( wxCommandEvent& event );
73 void OnAddDir( wxCommandEvent& event );
74 void OnAddMRL( wxCommandEvent& event );
75 void OnMenuClose( wxCommandEvent& event );
76 void OnClose( wxCloseEvent& WXUNUSED(event) );
78 void OnDeleteSelection( wxCommandEvent& event );
80 void OnOpen( wxCommandEvent& event );
81 void OnSave( wxCommandEvent& event );
84 void OnSearch( wxCommandEvent& event );
85 /*void OnSearchTextChange( wxCommandEvent& event );*/
86 wxTextCtrl *search_text;
87 wxButton *search_button;
88 wxTreeItemId search_current;
90 void OnEnDis( wxCommandEvent& event );
94 void OnSort( wxCommandEvent& event );
97 int i_duration_sorted;
100 void OnMenuEvent( wxCommandEvent& event );
101 void OnMenuOpen( wxMenuEvent& event );
107 void OnUp( wxCommandEvent& event);
108 void OnDown( wxCommandEvent& event);
110 void OnRandom( wxCommandEvent& event );
111 void OnRepeat( wxCommandEvent& event );
112 void OnLoop ( wxCommandEvent& event );
114 void OnActivateItem( wxTreeEvent& event );
115 void OnKeyDown( wxTreeEvent& event );
116 void OnNewGroup( wxCommandEvent& event );
121 wxTreeItemId i_wx_popup_item;
124 void OnPopup( wxContextMenuEvent& event );
125 void OnPopupPlay( wxCommandEvent& event );
126 void OnPopupPreparse( wxCommandEvent& event );
127 void OnPopupSort( wxCommandEvent& event );
128 void OnPopupDel( wxCommandEvent& event );
129 void OnPopupEna( wxCommandEvent& event );
130 void OnPopupInfo( wxCommandEvent& event );
131 void Rebuild( vlc_bool_t );
136 void UpdateNode( playlist_item_t*, wxTreeItemId );
137 void UpdateNodeChildren( playlist_item_t*, wxTreeItemId );
138 void CreateNode( playlist_item_t*, wxTreeItemId );
139 void UpdateTreeItem( wxTreeItemId );
141 /* Search (internal) */
142 int CountItems( wxTreeItemId);
143 wxTreeItemId FindItem( wxTreeItemId, int );
144 wxTreeItemId FindItemByName( wxTreeItemId, wxString,
145 wxTreeItemId, vlc_bool_t *);
147 wxTreeItemId saved_tree_item;
150 playlist_t *p_playlist;
154 void OnPlaylistEvent( wxCommandEvent& event );
156 DECLARE_EVENT_TABLE();
160 wxStatusBar *statusbar;
161 ItemInfoDialog *iteminfo_dialog;
163 int i_update_counter;
165 intf_thread_t *p_intf;
166 wxTreeCtrl *treectrl;
168 vlc_bool_t b_changed_view;
174 } // end of wxvlc namespace