mp3splt-gtk

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

ui_types.h
1 /**********************************************************
2 * mp3splt-gtk -- utility based on mp3splt,
3 *
4 *
5 * Contact: m@ioalex.net
6 * Copyright: (C) 2005-2013 Alexandru Munteanu
7 *
8 * http://mp3splt.sourceforge.net/
9 *
10 *********************************************************/
11
12 /**********************************************************
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
27 * USA.
28 *
29 *********************************************************/
30
31 #ifndef UI_TYPES_H
32
33 #define UI_TYPES_H
34
35 #include <libmp3splt/mp3splt.h>
36
37 #ifndef NO_GSTREAMER
38 #include <gst/gst.h>
39 #endif
40
41 #ifndef NO_AUDACIOUS
42 #include <audacious/audctrl.h>
43 #include <audacious/dbus.h>
44 #endif
45
46 #ifdef __WIN32__
47 #include <windows.h>
48 #include <winsock2.h>
49 #endif
50
51 typedef struct {
52 gchar* main_key;
53 gchar* second_key;
54 gint default_value;
55 GtkWidget *spinner;
56 void (*update_spinner_value_cb)(GtkWidget *spinner, gpointer data);
57 gpointer user_data_for_cb;
58 } spinner_int_preference;
59
60 typedef struct {
61 gchar* main_key;
62 gchar* second_key;
63 gint default_value;
64 GtkWidget *range;
65 void (*update_adjustment_value)(GtkAdjustment *adjustment, gpointer data);
66 gpointer user_data_for_cb;
67 } range_preference;
68
69 typedef struct {
70 GArray *spinner_int_preferences;
71 GArray *range_preferences;
72 } preferences_state;
73
74 typedef struct
75 {
76 gboolean checked;
77 gint mins;
78 gint secs;
79 gint hundr_secs;
80 } Split_point;
81
82 typedef struct {
83 gint root_x_pos;
84 gint root_y_pos;
85 gint width;
86 gint height;
87 } ui_main_window;
88
89 typedef struct {
90 long time;
91 float level;
92 } silence_wave;
93
94 typedef struct {
95 gint index;
96 gpointer data;
97 } preview_index_and_data;
98
99 typedef struct {
100 gchar *browser_directory;
101 ui_main_window *main_win;
102 GList *text_options_list;
103
104 silence_wave *silence_points;
105 gint number_of_silence_points;
106 gint malloced_num_of_silence_points;
107
108 gint player_seconds;
109 gint player_minutes;
110 gint player_hundr_secs;
111 //only for internal use when we change manually we have the real
112 //time which is player_seconds and the imaginary time player_seconds2
113 gint player_seconds2;
114 gint player_minutes2;
115 gint player_hundr_secs2;
116
117 gfloat total_time;
118 gfloat current_time;
119
120 gint splitnumber;
121 gint width_drawing_area;
122 gfloat zoom_coeff;
123 gfloat zoom_coeff_old;
124
125 gint hundr_secs_th;
126 gint tens_of_secs_th;
127 gint secs_th;
128 gint ten_secs_th;
129 gint minutes_th;
130 gint ten_minutes_th;
131
132 gint one_minute_time;
133 gint three_minutes_time;
134 gint six_minutes_time;
135 gint ten_minutes_time;
136 gint twenty_minutes_time;
137 gint fourty_minutes_time;
138
139 GArray *preview_time_windows;
140
141 GPtrArray *filtered_points_presence;
142 gint silence_wave_number_of_points_threshold;
143
144 gint selected_player;
145
146 gdouble douglas_peucker_thresholds[6];
147 gdouble douglas_peucker_thresholds_defaults[6];
148
149 gint debug_is_active;
150
151 gfloat silence_threshold_value;
152 gfloat silence_offset_value;
153 gint silence_number_of_tracks;
154 gfloat silence_minimum_length;
155 gfloat silence_minimum_track_length;
156 gboolean silence_remove_silence_between_tracks;
157
158 gint freedb_table_number;
159 gint playlist_tree_number;
160 gint multiple_files_tree_number;
161
162 gint freedb_selected_id;
163
164 splt_freedb_results *freedb_search_results;
165
166 gint split_file_mode;
167
168 GString *outputdirname;
169
170 preview_index_and_data preview_indexes[6];
171
172 gint timeout_value;
173 } ui_infos;
174
175 typedef struct {
176 #ifndef NO_GSTREAMER
177 const gchar *song_artist;
178 const gchar *song_title;
179 gint rate;
180 GstElement *play;
181 GstBus *bus;
182 gint _gstreamer_is_running;
183 #endif
184
185 #ifndef NO_AUDACIOUS
186 DBusGProxy *dbus_proxy;
187 DBusGConnection *dbus_connection;
188 #endif
189
190 //snackamp
191 FILE *in;
192 FILE *out;
193 gboolean connected;
194 #ifdef __WIN32__
195 SOCKET socket_id;
196 #else
197 gint socket_id;
198 #endif
199
200 } player_infos;
201
202 typedef struct {
203 GtkWidget *window;
204
205 GtkActionGroup *action_group;
206 GtkWidget *open_file_chooser_button;
207 GString *input_filename;
208
209 GtkWidget *player_box;
210 GtkWidget *playlist_box;
211
212 GtkWidget *song_name_label;
213 GtkWidget *song_infos;
214 GtkWidget *label_time;
215
216 GtkAdjustment *progress_adj;
217 GtkWidget *progress_bar;
218
219 GtkTreeView *tree_view;
220
221 GtkWidget *drawing_area;
222 GtkProgressBar *percent_progress_bar;
223 GtkWidget *drawing_area_expander;
224
225 //drawing area variables
226 gint margin;
227 gint real_erase_split_length;
228 gint real_move_split_length;
229 gint real_checkbox_length;
230 gint real_wave_length;
231
232 gint erase_split_ylimit;
233 gint progress_ylimit;
234 gint splitpoint_ypos;
235 gint checkbox_ypos;
236 gint text_ypos;
237 gint wave_ypos;
238
239 GPtrArray *wave_quality_das;
240 GtkWidget *player_scrolled_window;
241
242 GtkStatusbar *status_bar;
243
244 GtkWidget *add_button;
245 GtkWidget *remove_row_button;
246 GtkWidget *remove_all_button;
247
248 GtkTextTagTable *mess_hist_tag_table;
249 GtkTextBuffer *mess_hist_buffer;
250
251 GtkToggleButton *names_from_filename;
252
253 GtkWidget *pause_button;
254
255 GtkBox *player_buttons_hbox;
256
257 //player button images
258 GtkWidget *Go_BegButton_active;
259 GtkWidget *Go_BegButton_inactive;
260 GtkWidget *Go_EndButton_active;
261 GtkWidget *Go_EndButton_inactive;
262 GtkWidget *PlayButton_active;
263 GtkWidget *PlayButton_inactive;
264 GtkWidget *StopButton_active;
265 GtkWidget *StopButton_inactive;
266 GtkWidget *PauseButton_active;
267 GtkWidget *PauseButton_inactive;
268
269 //player buttons
270 GtkWidget *play_button;
271 GtkWidget *stop_button;
272 GtkWidget *player_add_button;
273 GtkWidget *go_beg_button;
274 GtkWidget *go_end_button;
275
276 GtkWidget *connect_button;
277 GtkWidget *disconnect_button;
278
279 GtkWidget *silence_wave_check_button;
280
281 GtkWidget *cancel_button;
282
283 GtkWidget *volume_button;
284
285 GtkTreeView *playlist_tree;
286
287 GtkWidget *playlist_remove_file_button;
288 GtkWidget *playlist_remove_all_files_button;
289
290 GtkWidget *frame_mode;
291 GtkWidget *adjust_mode;
292
293 GtkWidget *spinner_adjust_offset;
294 GtkWidget *spinner_adjust_gap;
295 GtkWidget *spinner_adjust_min;
296 GtkWidget *spinner_adjust_threshold;
297
298 GtkWidget *adjust_param_vbox;
299
300 GtkWidget *spinner_time;
301 GtkWidget *spinner_equal_tracks;
302
303 GtkWidget *all_spinner_silence_number_tracks;
304 GtkWidget *all_spinner_silence_minimum;
305 GtkWidget *all_spinner_track_minimum;
306 GtkWidget *all_spinner_silence_offset;
307 GtkWidget *all_spinner_trim_silence_threshold;
308 GtkWidget *all_spinner_silence_threshold;
309 GtkWidget *all_silence_remove_silence;
310
311 GtkWidget *all_threshold_label;
312 GtkWidget *all_trim_threshold_label;
313 GtkWidget *all_offset_label;
314 GtkWidget *all_number_of_tracks_label;
315 GtkWidget *all_min_silence_label;
316 GtkWidget *all_min_track_label;
317
318 GtkWidget *tags_radio;
319 GtkWidget *tags_version_radio;
320
321 GtkWidget *output_dir_radio;
322 GtkWidget *custom_dir_file_chooser_button;
323 GtkWidget *example_output_dir_entry;
324 GtkWidget *example_output_dir_box;
325
326 GtkWidget *replace_underscore_by_space_check_box;
327 GtkComboBox *artist_text_properties_combo;
328 GtkComboBox *album_text_properties_combo;
329 GtkComboBox *title_text_properties_combo;
330 GtkComboBox *comment_text_properties_combo;
331 GtkComboBox *genre_combo;
332 GtkWidget *comment_tag_entry;
333 GtkWidget *regex_entry;
334 GtkWidget *test_regex_fname_entry;
335 GtkWidget *sample_result_label;
336 GtkWidget *extract_tags_box;
337
338 GtkWidget *create_dirs_from_output_files;
339
340 GtkWidget *output_entry;
341 GtkWidget *output_label;
342 GtkWidget *output_default_label;
343
344 GtkTreeView *split_tree;
345
346 GtkWidget *spinner_minutes;
347 GtkWidget *spinner_seconds;
348 GtkWidget *spinner_hundr_secs;
349
350 GtkWidget *scan_trim_silence_button;
351 GtkWidget *scan_trim_silence_button_player;
352 GtkWidget *scan_silence_button;
353 GtkWidget *scan_silence_button_player;
354
355 GtkWidget *spinner_silence_number_tracks;
356 GtkWidget *spinner_silence_minimum;
357 GtkWidget *spinner_silence_minimum_track;
358 GtkWidget *spinner_silence_offset;
359 GtkWidget *spinner_silence_threshold;
360 GtkWidget *silence_remove_silence;
361
362 GtkWidget *queue_files_button;
363 GtkWidget *remove_file_button;
364 GtkWidget *remove_all_files_button;
365
366 GtkWidget *freedb_entry;
367 GtkWidget *freedb_search_button;
368 GtkWidget *freedb_spinner;
369 GtkTreeView *freedb_tree;
370 GtkWidget *freedb_add_button;
371
372 GtkWidget *radio_output;
373
374 GtkWidget *split_mode_radio_button;
375
376 GtkWidget *time_label;
377 GtkWidget *time_label_after;
378 GtkWidget *equal_tracks_label;
379 GtkWidget *equal_tracks_label_after;
380
381 GtkWidget *multiple_files_component;
382
383 GtkWidget *player_combo_box;
384 GtkWidget *radio_button;
385
386 GPtrArray *wave_preview_labels;
387
388 GtkWidget *mess_history_window;
389 GtkWidget *mess_hist_view;
390
391 GtkTreeView *multiple_files_tree;
392
393 GtkWidget *multiple_files_remove_file_button;
394 GtkWidget *multiple_files_remove_all_files_button;
395
396 GtkWidget *preferences_widget;
397 GtkWidget *preferences_window;
398
399 GtkWidget *split_files_widget;
400 GtkWidget *split_files_window;
401
402 GtkWidget *freedb_widget;
403 GtkWidget *freedb_window;
404
405 GtkWidget *splitpoints_widget;
406 GtkWidget *splitpoints_window;
407 } gui_state;
408
409 typedef struct {
410 gint splitting;
411 gint process_in_progress;
412 gint mouse_on_progress_bar;
413 gint currently_compute_douglas_peucker_filters;
414 gint show_silence_wave;
415 gboolean playing;
416 gboolean timer_active;
417
418 gint quick_preview_end_splitpoint;
419 gint preview_start_splitpoint;
420
421 gfloat move_time;
422
423 gboolean button1_pressed;
424 gboolean button2_pressed;
425 gboolean quick_preview;
426
427 gint button_x;
428 gint button_y;
429 gint button_x2;
430 gint button_y2;
431
432 gboolean move_splitpoints;
433 gint splitpoint_to_move;
434 gboolean remove_splitpoints;
435 gboolean select_splitpoints;
436 gboolean check_splitpoint;
437
438 gint first_splitpoint_selected;
439
440 gint spin_mins;
441 gint spin_secs;
442 gint spin_hundr_secs;
443
444 gchar current_description[255];
445
446 gint preview_start_position;
447
448 gint timeout_id;
449
450 gint currently_scanning_for_silence;
451
452 gchar *filename_to_split;
453
454 gint douglas_callback_counter;
455
456 gboolean stream;
457
458 gint only_press_pause;
459
460 gboolean change_volume;
461 gboolean on_the_volume_button;
462 gint file_browsed;
463 gint preview_row;
464 gint selected_split_mode;
465
466 gint should_trim;
467
468 gint file_selection_changed;
469
470 gint stop_split;
471
472 long previous_first_time_drawed;
473 gint previous_first_x_drawed;
474 long previous_second_time_drawed;
475 gint previous_second_x_drawed;
476 GHashTable *previous_distance_by_time;
477 gfloat previous_zoom_coeff;
478 gint previous_interpolation_level;
479
480 gint lock_cue_export;
481 } gui_status;
482
483 #define SPLT_MUTEX GStaticMutex
484
485 typedef struct {
486 gint return_code;
487
488 ui_infos *infos;
489 preferences_state *preferences;
490 splt_state *mp3splt_state;
491
492 GArray *splitpoints;
493 gui_state *gui;
494 gui_status *status;
495 player_infos *pi;
496
497 GPtrArray *files_to_split;
498
499 SPLT_MUTEX variables_mutex;
500
501 int importing_cue_from_configuration_directory;
502 } ui_state;
503
504 typedef struct {
505 gint err;
506 ui_state *ui;
507 } ui_with_err;
508
509 typedef struct {
510 ui_state *ui;
511 char *fname;
512 } ui_with_fname;
513
514 #endif
515
player_infos
Definition: ui_types.h:175
gui_status
Definition: ui_types.h:409
spinner_int_preference
Definition: ui_types.h:51
Split_point
Definition: ui_types.h:74
ui_with_fname
Definition: ui_types.h:509
ui_infos
Definition: ui_types.h:99
ui_state
Definition: ui_types.h:485
preferences_state
Definition: ui_types.h:69
ui_main_window
Definition: ui_types.h:82
silence_wave
Definition: ui_types.h:89
ui_with_err
Definition: ui_types.h:504
gui_state
Definition: ui_types.h:202
preview_index_and_data
Definition: ui_types.h:94
range_preference
Definition: ui_types.h:60