]> git.sesse.net Git - vlc/blob - modules/gui/wxwidgets/dialogs/vlm/vlm_panel.hpp
* wx/vlm: add "Load" & "Save" buttons
[vlc] / modules / gui / wxwidgets / dialogs / vlm / vlm_panel.hpp
1 /*****************************************************************************
2  * vlm_panel.hpp: Header for the VLM panel
3  *****************************************************************************
4  * Copyright (C) 1999-2005 the VideoLAN team
5  * $Id: wxwidgets.h 12502 2005-09-09 19:38:01Z gbazin $
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *
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.
13  *
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.
18  *
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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 #ifndef _WXVLC_VLMPANEL_H_
25 #define _WXVLC_VLMPANEL_H_
26
27 #include "wxwidgets.hpp"
28 #include "dialogs/open.hpp"
29 #include "dialogs/streamout.hpp"
30 #include <wx/notebook.h>
31
32 #include <vector>
33 using namespace std;
34
35
36 class VLMWrapper;
37 class VLMStream;
38 class VLMBroadcastStream;
39 class VLMVODStream;
40
41 namespace wxvlc
42 {
43     class VLMStreamPanel;
44     class VLMBroadcastStreamPanel;
45     class VLMVODStreamPanel;
46
47     /** This class is the panel to add or edit a VLM stream
48      * It can be embedded in the main VLM panel or on a separate frame
49      */
50     class VLMAddStreamPanel : public wxPanel
51     {
52     public:
53         VLMAddStreamPanel( intf_thread_t *, wxWindow *, VLMWrapper *,
54                            vlc_bool_t, vlc_bool_t );
55         virtual ~VLMAddStreamPanel();
56         void Load( VLMStream *);
57     private:
58         void OnCreate( wxCommandEvent& );
59         void OnClear( wxCommandEvent& );
60         void OnChooseInput( wxCommandEvent& );
61         void OnChooseOutput( wxCommandEvent& );
62
63         wxTextCtrl *name_text;
64         wxTextCtrl *input_text;
65         wxTextCtrl *output_text;
66
67         wxCheckBox *enabled_checkbox;
68         wxCheckBox *loop_checkbox;
69
70         intf_thread_t *p_intf;
71         VLMWrapper *p_vlm;
72
73         vlc_bool_t b_edit, b_broadcast;
74
75         OpenDialog *p_open_dialog;
76         SoutDialog *p_sout_dialog;
77
78         DECLARE_EVENT_TABLE();
79     };
80
81     /**
82      * This class is the main VLM Manager panel
83      */
84     class VLMPanel : public wxPanel
85     {
86     public:
87         VLMPanel( intf_thread_t *p_intf, wxWindow * );
88         virtual ~VLMPanel();
89
90         void Update();
91
92     protected:
93
94     private:
95         VLMWrapper *p_vlm;
96         intf_thread_t *p_intf;
97         wxWindow *p_parent;
98
99         wxFileDialog *p_file_dialog;
100         wxTimer timer;
101         void OnTimer( wxTimerEvent &);
102         void OnClose( wxCommandEvent& );
103         void OnLoad( wxCommandEvent& );
104         void OnSave( wxCommandEvent& );
105
106         /** Notebook */
107         wxNotebook *p_notebook;
108         DECLARE_EVENT_TABLE();
109
110         /* Broadcast stuff */
111         vector<VLMBroadcastStreamPanel *> broadcasts;
112         wxPanel *broadcasts_panel;
113         wxBoxSizer *broadcasts_sizer;
114         wxScrolledWindow *scrolled_broadcasts;
115         wxBoxSizer *scrolled_broadcasts_sizer;
116         wxPanel *BroadcastPanel( wxWindow *);
117         wxPanel *AddBroadcastPanel( wxPanel *);
118         void AppendBroadcast( VLMBroadcastStream *);
119         void RemoveBroadcast( VLMBroadcastStreamPanel *);
120
121         /* VOD stuff */
122         vector<VLMVODStreamPanel *> vods;
123         wxPanel *vods_panel;
124         wxBoxSizer *vods_sizer;
125         wxScrolledWindow *scrolled_vods;
126         wxBoxSizer *scrolled_vods_sizer;
127         wxPanel *VODPanel( wxWindow *);
128         wxPanel *AddVODPanel( wxPanel *);
129         void AppendVOD( VLMVODStream *);
130         void RemoveVOD( VLMVODStreamPanel *);
131
132     };
133
134     /** This class is the standard VLM frame
135      * It only consists of the VLM panel
136      */
137     class VLMFrame: public wxFrame
138     {
139     public:
140         VLMFrame( intf_thread_t *p_intf, wxWindow * );
141         virtual ~VLMFrame();
142
143         void Update();
144         void OnClose( wxCloseEvent& );
145     private:
146         VLMPanel *vlm_panel;
147         DECLARE_EVENT_TABLE();
148     };
149
150     /** This class is the edit dialog for a stream
151      * It only consists of the VLM edit panel
152      */
153     class VLMEditStreamFrame: public wxFrame
154     {
155     public:
156         VLMEditStreamFrame( intf_thread_t *p_intf, wxWindow *,
157                             VLMWrapper * , vlc_bool_t, VLMStream * );
158         virtual ~VLMEditStreamFrame();
159
160     private:
161         VLMAddStreamPanel *vlm_panel;
162     };
163 };
164
165 #endif