-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgenericFilechooserWindow.hpp
304 lines (278 loc) · 8.6 KB
/
genericFilechooserWindow.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
#ifndef CPP_GENERICFILECHOOSERWINDOW_CLASS_H
#define CPP_GENERICFILECHOOSERWINDOW_CLASS_H
/*!
* \project_name EBU Player
* \file genericFilechooserWindow.hpp
* \brief Generic filechooser window specifications
* \details This class is used to load a generic filechooser
* \authors Marco Dos Santos Oliveira
* \version 0.1
* \date 4 march 2013
* \copyright GNU GPLv3
*
*/
#include <gtkmm.h>
#include <gdkmm.h>
#include <iostream>
#include <string>
#include <fstream>
#include "genericAlertWindow.hpp"
#include "genericConfirmationWindow.hpp"
#include "genericFeatures.hpp"
class genericFilechooserWindow : public Gtk::FileChooserDialog
{
public:
/*!*
* @brief Class constructor
* @brief The genericFilechooserWindow class constructor instantiates a new filechooser with alert messages required.\n\n
* @param[in] Gtk::Window& parent : The parent window which instantiates the filechooser
* @param[in] const Glib::ustring& title : The title of the filechooser message window
* @param[in] Gtk::FileChooserAction action : The type of action supported by the FileChooser
* @param[in] Glib::ustring currentFolder : Set the directory of entry of the filechooser
* @param[in] bool multipleSelection : Allow the selection of several files
* @param[in] int mimeType : Set the mime type filter \n\n
0 : By default -> all files (*.*)\n\n
1 : from player -> multimedia files (audio, video, container, etc.)\n\n
2 from playlist -> playlist files (folder, m3u)\n\n
3 from metadata viewer -> ebucore files (EBUCore MXF, EBUCore XML)\n\n
4 from mxf generator output -> MXF container \n\n
5 from mxf generator raw video input -> any raw video files\n\n
6 from mxf generator raw audio input -> any raw audio files\n\n
7 from mxf generator raw ebucore input -> any raw ebucore files\n\n
8 from mxf generator raw AVC-Intra video input -> any raw AVC-Intra video files\n\n
9 from mxf generator segmentation and data text input -> any raw AVC-Intra text files
*/
genericFilechooserWindow
(
Gtk::Window& parent,
const Glib::ustring& title,
Gtk::FileChooserAction action,
Glib::ustring currentFolder,
bool multipleSelection,
int mimeType = 0
);
virtual ~genericFilechooserWindow
(
void
);
/**
* @fn int getResponse(void)
* @brief This function will return the Gtk::ResponType of the filechooser
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return int if all is right or an error at compilation time.
*/
int getResponse
(
void
);
/**
* @fn Glib::ustring getURIToFile(void)
* @brief This function will return the URI to the selected file
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return Glib::ustring if all is right or an error at compilation time.
*/
Glib::ustring getURIToFile
(
void
);
/**
* @fn std::vector<Glib::ustring> getURIToFiles(void)
* @brief This function will return a vector with the URI to all selected files
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return std::vector<Glib::ustring> if all is right or an error at compilation time.
*/
std::vector<Glib::ustring> getURIToFiles
(
void
);
/**
* @fn Glib::ustring getURIToFolder(void)
* @brief This function will return the URI to the selected folder
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return Glib::ustring if all is right or an error at compilation time.
*/
Glib::ustring getURIToFolder
(
void
);
/**
* @fn std::string getPathToFile(void)
* @brief This function will return the path to the selected file
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return std::string if all is right or an error at compilation time.
*/
std::string getPathToFile
(
void
);
/**
* @fn std::string getPathToM(void)
* @brief This function will return the path to file in which the playlist must be saved
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return std::string if all is right or an error at compilation time.
*/
std::string getPathToM3U
(
void
);
/**
* @fn std::vector<std::string> getPathToFiles(void)
* @brief This function will return a vector with the path to all selected files
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return std::vector<std::string> if all is right or an error at compilation time.
*/
std::vector<std::string> getPathToFiles
(
void
);
/**
* @fn std::string getPathToFolder(void)
* @brief This function will return the path to the selected folder
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return std::string if all is right or an error at compilation time.
*/
std::string getPathToFolder
(
void
);
protected:
int response; /*!< response the Gtk::ResponType selected by the user into the filechooser */
std::string outputM3U;/*!< outputM3U this string will return the path to the output file */
/**
* @fn void setVideoFilter(void)
* @brief This function filters files whose mime type corresponds to video files. All others mime types are excluded
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return void if all is right or an error at compilation time.
*/
void setVideoFilter
(
void
);
/**
* @fn void setAudioFilter(void)
* @brief This function filters files whose mime type corresponds to audio files. All others mime types are excluded
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return void if all is right or an error at compilation time.
*/
void setAudioFilter
(
void
);
/**
* @fn void setPlaylistFilter(void)
* @brief This function filters files whose mime type corresponds to playlist files. All others mime types are excluded
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return void if all is right or an error at compilation time.
*/
void setPlaylistFilter
(
void
);
/**
* @fn void setAnyEBUCoreFilter(void)
* @brief This function filters files whose mime type corresponds to any EBUCore files (XML EBUCore or MXF EBUCore). All others mime types are excluded
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return void if all is right or an error at compilation time.
*/
void setAnyEBUCoreFilter
(
void
);
/**
* @fn void setXMLEBUCoreFilter(void)
* @brief This function filters files whose mime type corresponds to XML EBUCore files. All others mime types are excluded
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return void if all is right or an error at compilation time.
*/
void setXMLEBUCoreFilter
(
void
);
/**
* @fn void setMXFFilter(void)
* @brief This function filters files whose mime type corresponds to MXF files. All others mime types are excluded
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return void if all is right or an error at compilation time.
*/
void setMXFFilter
(
void
);
/**
* @fn void setAVCITextFilter(void)
* @brief This function filters files whose mime type corresponds to AVC-Intra text files. All others mime types are excluded
* @brief
* @note Currently, only *.txt files and *.dat files are allowed.
* @note needs more documentation
* @param[in] void : no params
* @return void if all is right or an error at compilation time.
*/
void setAVCITextFilter
(
void
);
/**
* @fn void setAllFilesFilter(void)
* @brief This functions defines the filter "All Files" ; this means all files are visible and accessible.
* @brief
* @note needs more documentation
* @param[in] void : no params
* @return void if all is right or an error at compilation time.
*/
void setAllFilesFilter
(
void
);
/**
* @fn void setFilters(int mimeType)
* @brief This function allows you to set the appropriate mime types
* @brief
* @note needs more documentation
* @param[in] int mimeType : this int defines the appropriate mime types
* @note Values for mime types are : \n
* \li \c \b 1 : All the mime types readable by the mediaplayer
* \li \c \b 2 : All the mime types readable by the playlist
* \li \c \b 3 : All the mime types readable by the EBUCore Metadata Viewer
* \li \c \b 4 : Only MXF mime types
* \li \c \b 5 : All the mime types of raw video
* \li \c \b 6 : All the mime types of raw audio
* \li \c \b 7 : All the mime types of raw ebucore
* \li \c \b 8 : All the mime types of raw AVC-Intra video
* \li \c \b 9 : All the mime types of raw AVC-Intra text
* \li \c \b 0 : By default, do nothing.
* @return nothning if all is right or an error at compilation time.
*/
void setFilters
(
int mimeType
);
};
#endif /*CPP_GENERICFILECHOOSERWINDOW_CLASS_H*/