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 );
118 void OnDragItemBegin( wxTreeEvent& event );
119 void OnDragItemEnd( wxTreeEvent& event );
120 wxTreeItemId draged_tree_item;
125 wxTreeItemId i_wx_popup_item;
128 void OnPopup( wxContextMenuEvent& event );
129 void OnPopupPlay( wxCommandEvent& event );
130 void OnPopupPreparse( wxCommandEvent& event );
131 void OnPopupSort( wxCommandEvent& event );
132 void OnPopupDel( wxCommandEvent& event );
133 void OnPopupEna( wxCommandEvent& event );
134 void OnPopupInfo( wxCommandEvent& event );
135 void OnPopupAddNode( wxCommandEvent& event );
136 void Rebuild( vlc_bool_t );
141 void UpdateNode( playlist_item_t*, wxTreeItemId );
142 void UpdateNodeChildren( playlist_item_t*, wxTreeItemId );
143 void CreateNode( playlist_item_t*, wxTreeItemId );
144 void UpdateTreeItem( wxTreeItemId );
146 /* Search (internal) */
147 int CountItems( wxTreeItemId);
148 wxTreeItemId FindItem( wxTreeItemId, int );
149 wxTreeItemId FindItemByName( wxTreeItemId, wxString,
150 wxTreeItemId, vlc_bool_t *);
152 wxTreeItemId saved_tree_item;
155 playlist_t *p_playlist;
159 void OnPlaylistEvent( wxCommandEvent& event );
161 DECLARE_EVENT_TABLE();
165 wxStatusBar *statusbar;
166 ItemInfoDialog *iteminfo_dialog;
168 int i_update_counter;
170 intf_thread_t *p_intf;
171 wxTreeCtrl *treectrl;
173 vlc_bool_t b_changed_view;
179 } // end of wxvlc namespace