-
Notifications
You must be signed in to change notification settings - Fork 4
/
metadataWindow.hpp
347 lines (311 loc) · 10.9 KB
/
metadataWindow.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
#ifndef CPP_METADATAWINDOW_CLASS_H
#define CPP_METADATAWINDOW_CLASS_H
/*!
* \project_name EBU Player
* \file metadataWindow.hpp
* \brief metadata window specifications
* \details This class is used to load the EBUCore Metadata viewer and his functionnalities
* \authors Marco Dos Santos Oliveira
* \version 0.1
* \dateOfCreation 20 august 2012
* \dateOfUpdate 21 march 2012
* \copyright This software is published under MPL v2.0
*
*/
#include <gtkmm.h>
#include <gtkmm/cssprovider.h>
#include <gtkmm/stylecontext.h>
#include <iostream>
#include <string>
//#include <boost/regex.hpp>
#include <stdexcept>
#include <fstream>
// include files and libraries
#include "metadataEncapsulationDialog.hpp"
#include "metadataEncapsulationInputOutputDialog.hpp"
#include "remoteStreamFileChooser.hpp"
#include "genericFilechooserWindow.hpp"
#include "genericFilechooserInputOutput.hpp"
#include "metadataEngine.hpp"
#define MXFMETADATAMIMETYPE 4
#define XMLMETADATAMIMETYPE 7
class metadataWindow : public Gtk::Window
{
public:
/*!*
* @brief Class constructor
* @brief The metadataWindow class constructor instantiates a new EBUCore Metadata window and all its features.\n\n
* @param[in] cobject : GObject is the fundamental type providing the common attributes and methods for all object types in GTK+. In this case, cobject define the instantiate gtk widget
* @param[in] refGlade : This is the reference to your glade design
*/
metadataWindow
(
BaseObjectType* cobject,
const Glib::RefPtr<Gtk::Builder>& refGlade
);
/*!*
* @brief Class destructor
* @brief The metadataWindow class destructor destroys all variables and instanciate objects of metadataWindow class. This is the garbage collector class. It is always called at the end of class life.
*
*/
~metadataWindow
(
void
);
protected:
// Glade reference
Glib::RefPtr<Gtk::Builder> m_refGlade; /*!< Glade references */
// gtk button
Gtk::Switch* switchEBUCoreEdition; /*!< switchEBUCoreEdition edition mode button */
Gtk::Button* createEBUCore;
Gtk::MenuButton* removeEBUCore; /*!< disable edition mode button */
Gtk::MenuButton* importEBUCore; /*!< import an EBUCore file button */
Gtk::MenuButton* exportEBUCore; /*!< export an EBUCore file button */
Gtk::MenuButton* generateEBUCoreST434; /*!< export an EBUCore file button */
// Menu, UIManager and ActionGroups
Gtk::Menu* importEBUCoreMenuPopup;
Gtk::Menu* importEBUCoreXMLMenuPopup;
Gtk::Menu* importEBUCoreMXFMenuPopup;
Gtk::Menu* exportEBUCoreMenuPopup;
Gtk::Menu* removeEBUCoreMenuPopup;
Gtk::Menu* generateEBUCoreST434MenuPopup;
Glib::RefPtr<Gtk::UIManager> importEBUCoreUIManager;
Glib::RefPtr<Gtk::UIManager> importEBUCoreXMLUIManager;
Glib::RefPtr<Gtk::UIManager> importEBUCoreMXFUIManager;
Glib::RefPtr<Gtk::UIManager> exportEBUCoreUIManager;
Glib::RefPtr<Gtk::UIManager> removeEBUCoreUIManager;
Glib::RefPtr<Gtk::UIManager> generateEBUCoreST434UIManager;
Glib::RefPtr<Gtk::ActionGroup> importEBUCoreActionGroup;
Glib::RefPtr<Gtk::ActionGroup> importEBUCoreXMLActionGroup;
Glib::RefPtr<Gtk::ActionGroup> importEBUCoreMXFActionGroup;
Glib::RefPtr<Gtk::ActionGroup> exportEBUCoreActionGroup;
Glib::RefPtr<Gtk::ActionGroup> removeEBUCoreActionGroup;
Glib::RefPtr<Gtk::ActionGroup> generateEBUCoreST434ActionGroup;
// window widgets
Gtk::Viewport* viewportTree; /*!< viewportTree the Gtk Viewport where is stored the expander */
Gtk::Expander * expanderRoot; /*!< expanderRoot the Gtk Expander is the EBUCore Metadata xml tree root */
Gtk::ScrolledWindow * FirstScrolledWindowBox; /*!< FirstScrolledWindowBox */
Gtk::Box * SecondScrolledWindowBox; /*!< SecondScrolledWindowBox */
Gtk::Box * boxEntries; /*!< boxEntries */
Gtk::Box * boxStatus; /*!< boxStatus */
// right side widgets
Gtk::Label * status;
Gtk::Label * source, * sourceLabel;
Gtk::Label * size, * sizeValue;
Gtk::Box * lineOne, * lineTwo;
// left side widgets
// engine
metadataEngine * engine;
//css
// Glib::RefPtr<Gtk::CssProvider> css;
// Glib::RefPtr<Gtk::StyleContext> style_context;
/**
* @fn void refGladeWidgets(const Glib::RefPtr<Gtk::Builder>& refGlade)
* @brief To link the glade references to the required player widgets
* @brief This method loads all required glade's references to connect the player widgets. If you add a new widget to the media player into the Glade design, you must append his reference in this function.\n \n
* @brief Currently, the following widgets have been referenced :\n
* \li \c \b expander1 We use this widget to encapsulate the multiple levels of XML DOM
* \li \c \b viewport1 We use this widget to encapsulate the expander1\n \n
* @param[in] refGlade : This is the reference to your glade widgets - It's mandatory.
* @return noting or gtkmm-critical error/segmentation fault
* @note This function and his documentation must be completed or transfert
*/
void refGladeWidgets
(
const Glib::RefPtr<Gtk::Builder>& refGlade
);
/**
* @fn refGladeButton(const Glib::RefPtr<Gtk::Builder>& refGlade)
* @brief To link the glade references to the buttons
* @brief This method loads all required glade's references to connect the metadata viewer buttons. If you add a new button to the metadata viewer into the Glade design, you must append his reference in this function.\n \n
* @brief Currently, the following buttons have been referenced :\n
* \li \c \b importXML When clicked, this button should import an XML metatada file into the metadata viewer
* \li \c \b exportXML When clicked, this button should export an XML metatada from metadata viewer into an XML file.
* \li \c \b modifyXML When clicked, this button should open a secondary metadata viewer where the user will modify the metadata of the first viewer.
* \li \c \b saveXML When clicked, this button will save the XML metadata into the MXF file.
* \li \c \b XMLconformance When clicked, this button starts an EBUCore conformance analysis on the metadata. \n \n
* @param[in] refGlade : This is the reference to your glade player features - It's mandatory.
* @return nothing if all is right or gtkmm-critical error/segmentation fault
* @note This function and his documentation must be completed
*/
void refGladeButton
(
const Glib::RefPtr<Gtk::Builder>& refGlade
);
/**
* @fn void connectSignals (void)
* @brief To connect the clicked signal to events handler
* @brief This method connects each widgets clicked with its own signal. If you add a new clicked event, you must append its signal connection here.\n \n
* @brief Currently, the following clicked signals have been connected:\n
* \li \c \b importXML When connected, this button sends a signal to import an XML metatada file into the metadata first viewer
* \li \c \b exportXML When connected, this button sends a signal to export an XML metatada from metadata viewer into an XML file.
* \li \c \b modifyXML When connected, this button sends a signal to open a secondary metadata viewer where the user will modify the metadata of the first viewer.
* \li \c \b saveXML When connected, this button sends a signal to save the XML metadata into the currently loaded MXF file.
* \li \c \b XMLconformance When connected, this button sends a signal to run an EBUCore conformance analysis on the metadata.\n \n
* @param[in] void : No params required
* @return nothing if all is right or an error at compilation time.
* @note This function and his documentation must be completed
*/
void connectSignals
(
void
);
/**
* @fn void on_createEBUCore_clicked(void)
* @brief
* @brief
* @note needs more documentation
* @return nothing if all is right or an error at compilation time.
*/
void on_createEBUCore_clicked
(
void
);
/**
* @fn void on_importEBUCore_clicked(void)
* @brief
* @brief
* @note needs more documentation
* @param[in] bool EBUCoreKind : this boolean will determine if we want open an XML or MXF EBUCore file (0 = XML, 1 = MXF).
* @param[in] bool isRemote : this boolean will determine if we want open a local file or a remote file (0 = local, 1 = remote)
* @return nothing if all is right or an error at compilation time.
*/
void on_importEBUCore_clicked
(
bool EBUCoreKind,
bool isRemote
);
/**
* @fn void on_switchEBUCoreEdition_activate(void)
* @brief
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return nothing if all is right or an error at compilation time.
*/
void on_switchEBUCoreEdition_activate
(
void
);
/**
* @fn void on_embedXML2MXFEBUCore_clicked(void)
* @brief
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return nothing if all is right or an error at compilation time.
*/
void on_embedXML2MXFEBUCore_clicked
(
void
);
/**
* @fn void on_embedEBUCore_clicked(void)
* @brief
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return nothing if all is right or an error at compilation time.
*/
void on_embedEBUCore_clicked
(
void
);
/**
* @fn void on_exportMXF2XMLEBUCore_clicked(void)
* @brief
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return nothing if all is right or an error at compilation time.
*/
void on_exportMXF2XMLEBUCore_clicked
(
void
);
/**
* @fn void on_exportEBUCore_clicked(void)
* @brief
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return nothing if all is right or an error at compilation time.
*/
void on_exportEBUCore_clicked
(
void
);
/**
* @fn void on_removeEBUCore_clicked(void)
* @brief
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return nothing if all is right or an error at compilation time.
*/
void on_removeEBUCore_clicked
(
void
);
/**
* @fn void on_saveAndRemoveEBUCore_clicked(void)
* @brief
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return nothing if all is right or an error at compilation time.
*/
void on_saveAndRemoveEBUCore_clicked
(
void
);
void on_generateEBUCoreST434Metadata_clicked
(
void
);
void on_generateEBUCoreST434Mux_clicked
(
void
);
void on_generateEBUCoreST434Deep_clicked
(
void
);
/**
* @fn void initMetadataMenuPopup(void)
* @brief To initiliaze the popup menu of the importing/exporting metadata button.
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return nothing if all is right or an error at compilation time.
*/
void initMetadataMenuPopup
(
void
);
/**
* @fn void initMetadataWindow(void)
* @brief To initiliaze the metadata window interface elements/states
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return nothing if all is right or an error at compilation time.
*/
void initMetadataWindow
(
void
);
/**
* @fn void initRightSide(void)
* @brief To initiliaze the right side of the metadata window interface elements/states
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return nothing if all is right or an error at compilation time.
*/
void initRightSide
(
void
);
};
#endif