]> git.sesse.net Git - vlc/blob - modules/gui/wxwidgets/dialogs/vlm/vlm_panel.hpp
p( vlc.getInterfaces().getInterface( "wxwidgets" ).isBroken() ) = 1/2
[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
29 #include <vector>
30 using namespace std;
31
32
33 class VLMWrapper;
34 class VLMStream;
35 class VLMBroadcastStream;
36 class VLMVODStream;
37
38 namespace wxvlc
39 {
40     class VLMStreamPanel;
41     class VLMBroadcastStreamPanel;
42     class VLMVODStreamPanel;
43
44     /** This class is the panel to add or edit a VLM stream
45      * It can be embedded in the main VLM panel or on a separate frame
46      */
47     class VLMAddStreamPanel : public wxPanel
48     {
49     public:
50         VLMAddStreamPanel( intf_thread_t *, wxWindow *, VLMWrapper *,
51                            vlc_bool_t, vlc_bool_t );
52         virtual ~VLMAddStreamPanel();
53         void Load( VLMStream *);
54     private:
55         void OnCreate( wxCommandEvent& );
56         void OnClear( wxCommandEvent& );
57
58         wxTextCtrl *name_text;
59         wxTextCtrl *input_text;
60         wxTextCtrl *output_text;
61
62         wxCheckBox *enabled_checkbox;
63         wxCheckBox *loop_checkbox;
64
65         intf_thread_t *p_intf;
66         VLMWrapper *p_vlm;
67
68
69         vlc_bool_t b_edit, b_broadcast;
70
71         DECLARE_EVENT_TABLE();
72     };
73
74     /**
75      * This class is the main VLM Manager panel
76      */
77     class VLMPanel : public wxPanel
78     {
79     public:
80         VLMPanel( intf_thread_t *p_intf, wxWindow * );
81         virtual ~VLMPanel();
82
83         void Update();
84
85     protected:
86
87     private:
88         VLMWrapper *p_vlm;
89         intf_thread_t *p_intf;
90
91         wxTimer timer;
92         void OnTimer( wxTimerEvent &);
93         /** Notebook */
94         wxNotebook *p_notebook;
95         DECLARE_EVENT_TABLE();
96
97         /* Broadcast stuff */
98         vector<VLMBroadcastStreamPanel *> broadcasts;
99         wxPanel *broadcasts_panel;
100         wxBoxSizer *broadcasts_sizer;
101         wxScrolledWindow *scrolled_broadcasts;
102         wxBoxSizer *scrolled_broadcasts_sizer;
103         wxPanel *BroadcastPanel( wxWindow *);
104         wxPanel *AddBroadcastPanel( wxPanel *);
105         void AppendBroadcast( VLMBroadcastStream *);
106         void RemoveBroadcast( VLMBroadcastStreamPanel *);
107
108         /* VOD stuff */
109         vector<VLMVODStreamPanel *> vods;
110         wxPanel *vods_panel;
111         wxBoxSizer *vods_sizer;
112         wxScrolledWindow *scrolled_vods;
113         wxBoxSizer *scrolled_vods_sizer;
114         wxPanel *VODPanel( wxWindow *);
115         wxPanel *AddVODPanel( wxPanel *);
116         void AppendVOD( VLMVODStream *);
117         void RemoveVOD( VLMVODStreamPanel *);
118
119     };
120
121     /** This class is the standard VLM frame
122      * It only consists of the VLM panel
123      */
124     class VLMFrame: public wxFrame
125     {
126     public:
127         VLMFrame( intf_thread_t *p_intf, wxWindow * );
128         virtual ~VLMFrame();
129
130         void Update();
131     private:
132         VLMPanel *vlm_panel;
133         DECLARE_EVENT_TABLE();
134         void OnClose( wxCloseEvent& );
135     };
136
137     /** This class is the edit dialog for a stream
138      * It only consists of the VLM edit panel
139      */
140     class VLMEditStreamFrame: public wxFrame
141     {
142     public:
143         VLMEditStreamFrame( intf_thread_t *p_intf, wxWindow *,
144                             VLMWrapper * , vlc_bool_t, VLMStream * );
145         virtual ~VLMEditStreamFrame();
146
147     private:
148         VLMAddStreamPanel *vlm_panel;
149     };
150 };
151
152 #endif