mp3splt-gtk

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

split_mode_window.c
Go to the documentation of this file.
1 /**********************************************************
2 *
3 * mp3splt-gtk -- utility based on mp3splt,
4 * for mp3/ogg splitting without decoding
5 *
6 * Copyright: (C) 2005-2013 Alexandru Munteanu
7 * Contact: m@ioalex.net
8 *
9 * http://mp3splt.sourceforge.net/
10 *
11 *********************************************************/
12
13 /**********************************************************
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *********************************************************/
31
32 /*!********************************************************
33 * \file
34 * The batch processing tab
35 *
36 * this file is for the special split tab, where automatic
37 * split modes can be selected
38 *..*******************************************************/
39
40 #include "split_mode_window.h"
41
43 static gint get_selected_split_mode(GtkToggleButton *radio_b)
44 {
45 GSList *radio_button_list = gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio_b));
46
47 gint i = 0;
48 for(i = 0; i < NUMBER_OF_SPLIT_MODES;i++)
49 {
50 GtkToggleButton *test = (GtkToggleButton *) g_slist_nth_data(radio_button_list,i);
51 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(test)))
52 {
53 return GPOINTER_TO_INT(g_object_get_data(G_OBJECT(test), "split_type_id"));
54 }
55 }
56
57 return SELECTED_SPLIT_NORMAL;
58 }
59
61 void select_split_mode(int split_mode, ui_state *ui)
62 {
63 GSList *split_mode_radio_button_list =
64 gtk_radio_button_get_group(GTK_RADIO_BUTTON(ui->gui->split_mode_radio_button));
65
66 gint i = 0;
67 for(i = 0; i < NUMBER_OF_SPLIT_MODES;i++)
68 {
69 GtkToggleButton *test = (GtkToggleButton *) g_slist_nth_data(split_mode_radio_button_list, i);
70 int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(test), "split_type_id"));
71 if (split_mode == id)
72 {
73 gtk_toggle_button_set_active(test, TRUE);
74 return;
75 }
76 }
77 }
78
79 gint get_selected_split_mode_safe(ui_state *ui)
80 {
81 lock_mutex(&ui->variables_mutex);
82 gint selected_split_mode = ui->status->selected_split_mode;
83 unlock_mutex(&ui->variables_mutex);
84 return selected_split_mode;
85 }
86
87 void set_selected_split_mode_safe(gint value, ui_state *ui)
88 {
89 lock_mutex(&ui->variables_mutex);
90 ui->status->selected_split_mode = value;
91 unlock_mutex(&ui->variables_mutex);
92 }
93
94 static void deactivate_silence_parameters(gui_state *gui)
95 {
96 gtk_widget_set_sensitive(gui->all_spinner_silence_number_tracks, FALSE);
97 gtk_widget_set_sensitive(gui->all_spinner_silence_minimum, FALSE);
98 gtk_widget_set_sensitive(gui->all_spinner_track_minimum, FALSE);
99 gtk_widget_set_sensitive(gui->all_spinner_silence_offset, FALSE);
100 gtk_widget_set_sensitive(gui->all_spinner_silence_threshold, FALSE);
101 gtk_widget_set_sensitive(gui->all_silence_remove_silence, FALSE);
102 gtk_widget_set_sensitive(gui->all_threshold_label, FALSE);
103 gtk_widget_set_sensitive(gui->all_offset_label, FALSE);
104 gtk_widget_set_sensitive(gui->all_number_of_tracks_label, FALSE);
105 gtk_widget_set_sensitive(gui->all_min_silence_label, FALSE);
106 gtk_widget_set_sensitive(gui->all_min_track_label, FALSE);
107 }
108
109 static void activate_silence_parameters(gui_state *gui)
110 {
111 gtk_widget_set_sensitive(gui->all_spinner_silence_number_tracks, TRUE);
112 gtk_widget_set_sensitive(gui->all_spinner_silence_minimum, TRUE);
113 gtk_widget_set_sensitive(gui->all_spinner_track_minimum, TRUE);
114 gtk_widget_set_sensitive(gui->all_spinner_silence_offset, TRUE);
115 gtk_widget_set_sensitive(gui->all_spinner_silence_threshold, TRUE);
116 gtk_widget_set_sensitive(gui->all_silence_remove_silence, TRUE);
117 gtk_widget_set_sensitive(gui->all_threshold_label, TRUE);
118 gtk_widget_set_sensitive(gui->all_offset_label, TRUE);
119 gtk_widget_set_sensitive(gui->all_number_of_tracks_label, TRUE);
120 gtk_widget_set_sensitive(gui->all_min_silence_label, TRUE);
121 gtk_widget_set_sensitive(gui->all_min_track_label, TRUE);
122 }
123
124 static void deactivate_trim_parameters(gui_state *gui)
125 {
126 gtk_widget_set_sensitive(gui->all_spinner_trim_silence_threshold, FALSE);
127 gtk_widget_set_sensitive(gui->all_trim_threshold_label, FALSE);
128 }
129
130 static void activate_trim_parameters(gui_state *gui)
131 {
132 gtk_widget_set_sensitive(gui->all_spinner_trim_silence_threshold, TRUE);
133 gtk_widget_set_sensitive(gui->all_trim_threshold_label, TRUE);
134 }
135
137 static void split_mode_changed(GtkToggleButton *radio_b, ui_state *ui)
138 {
139 gint selected_split_mode = get_selected_split_mode(radio_b);
140 set_selected_split_mode_safe(selected_split_mode, ui);
141
142 int enable_time = (selected_split_mode == SELECTED_SPLIT_TIME);
143 gtk_widget_set_sensitive(ui->gui->spinner_time, enable_time);
144 gtk_widget_set_sensitive(ui->gui->time_label, enable_time);
145 gtk_widget_set_sensitive(ui->gui->time_label_after, enable_time);
146
147 int enable_split_equal_time = (selected_split_mode == SELECTED_SPLIT_EQUAL_TIME_TRACKS);
148 gtk_widget_set_sensitive(ui->gui->spinner_equal_tracks, enable_split_equal_time);
149 gtk_widget_set_sensitive(ui->gui->equal_tracks_label, enable_split_equal_time);
150 gtk_widget_set_sensitive(ui->gui->equal_tracks_label_after, enable_split_equal_time);
151
152 if (selected_split_mode == SELECTED_SPLIT_SILENCE)
153 {
154 activate_silence_parameters(ui->gui);
155 }
156 else
157 {
158 deactivate_silence_parameters(ui->gui);
159 }
160
161 if (selected_split_mode == SELECTED_SPLIT_TRIM_SILENCE)
162 {
163 activate_trim_parameters(ui->gui);
164 }
165 else
166 {
167 deactivate_trim_parameters(ui->gui);
168 }
169
170 ui_save_preferences(NULL, ui);
171 }
172
174 static void spinner_time_changed(GtkSpinButton *spinner, ui_state *ui)
175 {
176 ui_save_preferences(NULL, ui);
177 }
178
180 static void spinner_equal_tracks_changed(GtkSpinButton *spinner, ui_state *ui)
181 {
182 ui_save_preferences(NULL, ui);
183 }
184
186 static GtkWidget *create_split_mode(ui_state *ui)
187 {
188 GtkWidget *local_vbox = wh_vbox_new();
189 gtk_container_set_border_width(GTK_CONTAINER(local_vbox), 3);
190
191 //normal split
192 GtkWidget *split_mode_radio_button =
193 gtk_radio_button_new_with_label(NULL, _("Use manual single file splitpoints"));
194 gtk_widget_set_tooltip_text(split_mode_radio_button,
195 _("Split files using the manually defined splitpoints"));
196 ui->gui->split_mode_radio_button = split_mode_radio_button;
197 gtk_box_pack_start(GTK_BOX(local_vbox), split_mode_radio_button, FALSE, FALSE, 2);
198 g_signal_connect(GTK_TOGGLE_BUTTON(split_mode_radio_button),
199 "toggled", G_CALLBACK(split_mode_changed), ui);
200 g_object_set_data(G_OBJECT(split_mode_radio_button), "split_type_id",
201 GINT_TO_POINTER(SELECTED_SPLIT_NORMAL));
202
203 //time split
204 split_mode_radio_button = gtk_radio_button_new_with_label_from_widget
205 (GTK_RADIO_BUTTON(split_mode_radio_button), _("Time"));
206 gtk_widget_set_tooltip_text(split_mode_radio_button,
207 _("Split every fixed time length; last track will most likely be smaller"));
208 ui->gui->split_mode_radio_button = split_mode_radio_button;
209 gtk_box_pack_start(GTK_BOX(local_vbox), split_mode_radio_button, FALSE, FALSE, 2);
210 g_signal_connect(GTK_TOGGLE_BUTTON(split_mode_radio_button), "toggled",
211 G_CALLBACK(split_mode_changed), ui);
212 g_object_set_data(G_OBJECT(split_mode_radio_button), "split_type_id",
213 GINT_TO_POINTER(SELECTED_SPLIT_TIME));
214
215 //
216 GtkWidget *big_horiz_fake = wh_hbox_new();
217 gtk_box_pack_start(GTK_BOX(local_vbox), big_horiz_fake, FALSE, FALSE, 0);
218
219 GtkWidget *horiz_fake = wh_hbox_new();
220 gtk_box_pack_start(GTK_BOX(big_horiz_fake), horiz_fake, FALSE, FALSE, 25);
221
222 gint default_time = 60;
223
224 GtkWidget *time_label = gtk_label_new(_("Split every"));
225 ui->gui->time_label = time_label;
226 gtk_box_pack_start(GTK_BOX(horiz_fake), time_label, FALSE, FALSE, 0);
227
228 GtkAdjustment *adj = (GtkAdjustment *)gtk_adjustment_new(0.0, 1, 2000, 1.0, 10.0, 0.0);
229 GtkWidget *spinner_time = gtk_spin_button_new(adj, 1, 0);
230 ui->gui->spinner_time = spinner_time;
231 gtk_box_pack_start(GTK_BOX(horiz_fake), spinner_time, FALSE, FALSE, 6);
232 gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinner_time), default_time);
233 gtk_widget_set_sensitive(GTK_WIDGET(spinner_time), FALSE);
234 gtk_widget_set_sensitive(time_label, FALSE);
235 g_signal_connect(G_OBJECT(spinner_time), "value-changed", G_CALLBACK(spinner_time_changed), ui);
236
237 GtkWidget *time_label_after = gtk_label_new(_("seconds."));
238 ui->gui->time_label_after = time_label_after;
239 gtk_box_pack_start(GTK_BOX(horiz_fake), time_label_after, FALSE, FALSE, 0);
240 gtk_widget_set_sensitive(time_label_after, FALSE);
241
242 //split in equal length
243 split_mode_radio_button = gtk_radio_button_new_with_label_from_widget
244 (GTK_RADIO_BUTTON(split_mode_radio_button), _("Equal time tracks"));
245 gtk_widget_set_tooltip_text(split_mode_radio_button,
246 _("Create smaller tracks having exactly the same time length"));
247 ui->gui->split_mode_radio_button = split_mode_radio_button;
248 gtk_box_pack_start(GTK_BOX(local_vbox), split_mode_radio_button, FALSE, FALSE, 2);
249 g_signal_connect(GTK_TOGGLE_BUTTON(split_mode_radio_button), "toggled",
250 G_CALLBACK(split_mode_changed), ui);
251 g_object_set_data(G_OBJECT(split_mode_radio_button), "split_type_id",
252 GINT_TO_POINTER(SELECTED_SPLIT_EQUAL_TIME_TRACKS));
253
254 //
255 big_horiz_fake = wh_hbox_new();
256 gtk_box_pack_start(GTK_BOX(local_vbox), big_horiz_fake, FALSE, FALSE, 0);
257
258 horiz_fake = wh_hbox_new();
259 gtk_box_pack_start(GTK_BOX(big_horiz_fake), horiz_fake, FALSE, FALSE, 25);
260
261 GtkWidget *equal_tracks_label = gtk_label_new(_("Split in"));
262 ui->gui->equal_tracks_label = equal_tracks_label;
263 gtk_box_pack_start(GTK_BOX(horiz_fake), equal_tracks_label, FALSE, FALSE, 0);
264
265 adj = (GtkAdjustment *)gtk_adjustment_new(0.0, 1, 2000, 1.0, 10.0, 0.0);
266 GtkWidget *spinner_equal_tracks = gtk_spin_button_new(adj, 1, 0);
267 ui->gui->spinner_equal_tracks = spinner_equal_tracks;
268 gtk_box_pack_start(GTK_BOX(horiz_fake), spinner_equal_tracks, FALSE, FALSE, 6);
269 gtk_spin_button_set_value(GTK_SPIN_BUTTON(spinner_equal_tracks), default_time);
270 gtk_widget_set_sensitive(GTK_WIDGET(spinner_equal_tracks), FALSE);
271 gtk_widget_set_sensitive(equal_tracks_label, FALSE);
272 g_signal_connect(G_OBJECT(spinner_equal_tracks), "value-changed",
273 G_CALLBACK(spinner_equal_tracks_changed), ui);
274
275 GtkWidget *equal_tracks_label_after = gtk_label_new(_("equal tracks."));
276 ui->gui->equal_tracks_label_after = equal_tracks_label_after;
277 gtk_box_pack_start(GTK_BOX(horiz_fake), equal_tracks_label_after, FALSE, FALSE, 0);
278 gtk_widget_set_sensitive(equal_tracks_label_after, FALSE);
279
280 //trim using silence detection
281 split_mode_radio_button = gtk_radio_button_new_with_label_from_widget
282 (GTK_RADIO_BUTTON(split_mode_radio_button), _("Trim using silence detection"));
283 gtk_widget_set_tooltip_text(split_mode_radio_button,
284 _("Split by discarding silence from the begin and from the end\n"
285 "If no silence is found, the output file is still created"));
286 ui->gui->split_mode_radio_button = split_mode_radio_button;
287 gtk_box_pack_start(GTK_BOX(local_vbox), split_mode_radio_button, FALSE, FALSE, 2);
288 g_signal_connect(GTK_TOGGLE_BUTTON(split_mode_radio_button), "toggled",
289 G_CALLBACK(split_mode_changed), ui);
290 g_object_set_data(G_OBJECT(split_mode_radio_button), "split_type_id",
291 GINT_TO_POINTER(SELECTED_SPLIT_TRIM_SILENCE));
292
293 horiz_fake = wh_hbox_new();
294 gtk_box_pack_start(GTK_BOX(local_vbox), horiz_fake, FALSE, FALSE, 0);
295
296 GtkWidget *param_vbox = wh_vbox_new();
297 gtk_box_pack_start(GTK_BOX(horiz_fake), param_vbox, FALSE, FALSE, 25);
298
299 horiz_fake = wh_hbox_new();
300 gtk_box_pack_start(GTK_BOX(param_vbox), horiz_fake, FALSE, FALSE, 0);
301
302 GtkWidget *all_trim_threshold_label = gtk_label_new(_("Threshold level (dB) : "));
303 ui->gui->all_trim_threshold_label = all_trim_threshold_label;
304 gtk_box_pack_start(GTK_BOX(horiz_fake), all_trim_threshold_label, FALSE, FALSE, 0);
305
306 adj = (GtkAdjustment *)gtk_adjustment_new(0.0, -96.0, 0.0, 0.5, 10.0, 0.0);
307 GtkWidget *all_spinner_trim_silence_threshold = gtk_spin_button_new(adj, 0.5, 2);
308 ui->gui->all_spinner_trim_silence_threshold = all_spinner_trim_silence_threshold;
309 gtk_box_pack_start(GTK_BOX(horiz_fake), all_spinner_trim_silence_threshold, FALSE, FALSE, 0);
310
311 //silence split
312 split_mode_radio_button = gtk_radio_button_new_with_label_from_widget
313 (GTK_RADIO_BUTTON(split_mode_radio_button), _("Silence - split with silence detection"));
314 gtk_widget_set_tooltip_text(split_mode_radio_button, _("Split where silence is found"));
315 ui->gui->split_mode_radio_button = split_mode_radio_button;
316 gtk_box_pack_start(GTK_BOX(local_vbox), split_mode_radio_button, FALSE, FALSE, 2);
317 g_signal_connect(GTK_TOGGLE_BUTTON(split_mode_radio_button), "toggled",
318 G_CALLBACK(split_mode_changed), ui);
319 g_object_set_data(G_OBJECT(split_mode_radio_button), "split_type_id",
320 GINT_TO_POINTER(SELECTED_SPLIT_SILENCE));
321
322 horiz_fake = wh_hbox_new();
323 gtk_box_pack_start(GTK_BOX(local_vbox), horiz_fake, FALSE, FALSE, 0);
324
325 param_vbox = wh_vbox_new();
326 gtk_box_pack_start(GTK_BOX(horiz_fake), param_vbox, FALSE, FALSE, 25);
327
328 horiz_fake = wh_hbox_new();
329 gtk_box_pack_start(GTK_BOX(param_vbox), horiz_fake, FALSE, FALSE, 0);
330
331 GtkWidget *all_threshold_label = gtk_label_new(_("Threshold level (dB) : "));
332 ui->gui->all_threshold_label = all_threshold_label;
333 gtk_box_pack_start(GTK_BOX(horiz_fake), all_threshold_label, FALSE, FALSE, 0);
334
335 adj = (GtkAdjustment *)gtk_adjustment_new(0.0, -96.0, 0.0, 0.5, 10.0, 0.0);
336 GtkWidget *all_spinner_silence_threshold = gtk_spin_button_new(adj, 0.5, 2);
337 ui->gui->all_spinner_silence_threshold = all_spinner_silence_threshold;
338 gtk_box_pack_start(GTK_BOX(horiz_fake), all_spinner_silence_threshold, FALSE, FALSE, 0);
339
340 horiz_fake = wh_hbox_new();
341 gtk_box_pack_start(GTK_BOX(param_vbox), horiz_fake, FALSE, FALSE, 0);
342
343 GtkWidget *all_offset_label = gtk_label_new(_("Cutpoint offset (0 is the begin of silence,and 1 the end) : "));
344 ui->gui->all_offset_label = all_offset_label;
345 gtk_box_pack_start(GTK_BOX(horiz_fake), all_offset_label, FALSE, FALSE, 0);
346
347 adj = (GtkAdjustment *)gtk_adjustment_new(0.0, -2, 2, 0.05, 10.0, 0.0);
348 GtkWidget *all_spinner_silence_offset = gtk_spin_button_new(adj, 0.05, 2);
349 ui->gui->all_spinner_silence_offset = all_spinner_silence_offset;
350 gtk_box_pack_start(GTK_BOX(horiz_fake), all_spinner_silence_offset, FALSE, FALSE, 0);
351
352 horiz_fake = wh_hbox_new();
353 gtk_box_pack_start(GTK_BOX(param_vbox), horiz_fake, FALSE, FALSE, 0);
354
355 GtkWidget *all_number_of_tracks_label = gtk_label_new(_("Number of tracks (0 means all tracks) : "));
356 ui->gui->all_number_of_tracks_label = all_number_of_tracks_label;
357 gtk_box_pack_start(GTK_BOX(horiz_fake), all_number_of_tracks_label, FALSE, FALSE, 0);
358
359 adj = (GtkAdjustment *)gtk_adjustment_new(0.0, 0, 2000, 1, 10.0, 0.0);
360 GtkWidget *all_spinner_silence_number_tracks = gtk_spin_button_new(adj, 1, 0);
361 ui->gui->all_spinner_silence_number_tracks = all_spinner_silence_number_tracks;
362 gtk_box_pack_start(GTK_BOX(horiz_fake), all_spinner_silence_number_tracks, FALSE, FALSE, 0);
363
364 horiz_fake = wh_hbox_new();
365 gtk_box_pack_start(GTK_BOX(param_vbox), horiz_fake, FALSE, FALSE, 0);
366
367 GtkWidget *all_min_silence_label = gtk_label_new(_("Minimum silence length (seconds) : "));
368 ui->gui->all_min_silence_label = all_min_silence_label;
369 gtk_box_pack_start(GTK_BOX(horiz_fake), all_min_silence_label, FALSE, FALSE, 0);
370
371 adj = (GtkAdjustment *)gtk_adjustment_new(0.0, 0, 2000, 0.5, 10.0, 0.0);
372 GtkWidget *all_spinner_silence_minimum = gtk_spin_button_new(adj, 1, 2);
373 ui->gui->all_spinner_silence_minimum = all_spinner_silence_minimum;
374 gtk_box_pack_start(GTK_BOX(horiz_fake), all_spinner_silence_minimum, FALSE, FALSE, 0);
375
376 horiz_fake = wh_hbox_new();
377 gtk_box_pack_start(GTK_BOX(param_vbox), horiz_fake, FALSE, FALSE, 0);
378
379 GtkWidget *all_min_track_label = gtk_label_new(_("Minimum track length (seconds) : "));
380 ui->gui->all_min_track_label = all_min_track_label;
381 gtk_box_pack_start(GTK_BOX(horiz_fake), all_min_track_label, FALSE, FALSE, 0);
382
383 adj = (GtkAdjustment *)gtk_adjustment_new(0.0, 0, 2000, 0.5, 10.0, 0.0);
384 GtkWidget *all_spinner_track_minimum = gtk_spin_button_new(adj, 1, 2);
385 ui->gui->all_spinner_track_minimum = all_spinner_track_minimum;
386 gtk_box_pack_start(GTK_BOX(horiz_fake), all_spinner_track_minimum, FALSE, FALSE, 0);
387
388 GtkWidget *all_silence_remove_silence =
389 gtk_check_button_new_with_label(_("Remove silence between tracks"));
390 ui->gui->all_silence_remove_silence = all_silence_remove_silence;
391 gtk_box_pack_start(GTK_BOX(param_vbox), all_silence_remove_silence, FALSE, FALSE, 0);
392
393 gtk_spin_button_set_value(GTK_SPIN_BUTTON(all_spinner_silence_number_tracks),
394 SPLT_DEFAULT_PARAM_TRACKS);
395 gtk_spin_button_set_value(GTK_SPIN_BUTTON(all_spinner_silence_minimum),
396 SPLT_DEFAULT_PARAM_MINIMUM_LENGTH);
397 gtk_spin_button_set_value(GTK_SPIN_BUTTON(all_spinner_silence_offset),
398 SPLT_DEFAULT_PARAM_OFFSET);
399 gtk_spin_button_set_value(GTK_SPIN_BUTTON(all_spinner_silence_threshold),
400 SPLT_DEFAULT_PARAM_THRESHOLD);
401 gtk_spin_button_set_value(GTK_SPIN_BUTTON(all_spinner_trim_silence_threshold),
402 SPLT_DEFAULT_PARAM_THRESHOLD);
403
404 deactivate_silence_parameters(ui->gui);
405 deactivate_trim_parameters(ui->gui);
406
407 //wrap split
408 split_mode_radio_button = gtk_radio_button_new_with_label_from_widget
409 (GTK_RADIO_BUTTON(split_mode_radio_button),
410 _("Wrap - split files created with mp3wrap or albumwrap (mp3 only)"));
411 ui->gui->split_mode_radio_button = split_mode_radio_button;
412 gtk_box_pack_start(GTK_BOX(local_vbox), split_mode_radio_button, FALSE, FALSE, 2);
413 g_signal_connect(GTK_TOGGLE_BUTTON(split_mode_radio_button), "toggled",
414 G_CALLBACK(split_mode_changed), ui);
415 g_object_set_data(G_OBJECT(split_mode_radio_button), "split_type_id",
416 GINT_TO_POINTER(SELECTED_SPLIT_WRAP));
417
418 //error mode split
419 split_mode_radio_button = gtk_radio_button_new_with_label_from_widget
420 (GTK_RADIO_BUTTON(split_mode_radio_button), _("Synchronisation error mode (mp3 only)"));
421 gtk_widget_set_tooltip_text(split_mode_radio_button,
422 _("Split where synchronisation errors are found\n"
423 "Useful for splitting concatenated files"));
424 ui->gui->split_mode_radio_button = split_mode_radio_button;
425 gtk_box_pack_start(GTK_BOX(local_vbox), split_mode_radio_button, FALSE, FALSE, 2);
426 g_signal_connect(GTK_TOGGLE_BUTTON(split_mode_radio_button), "toggled",
427 G_CALLBACK(split_mode_changed), ui);
428 g_object_set_data(G_OBJECT(split_mode_radio_button), "split_type_id",
429 GINT_TO_POINTER(SELECTED_SPLIT_ERROR));
430
431 select_split_mode(SELECTED_SPLIT_NORMAL, ui);
432
433 GtkWidget *scrolled_window = wh_create_scrolled_window();
434 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
435 GTK_WIDGET(local_vbox));
436
437 return scrolled_window;
438 }
439
441 static GtkWidget *create_single_multiple_split_modes(ui_state *ui)
442 {
443 GtkWidget *local_vbox = wh_vbox_new();
444 gtk_container_set_border_width(GTK_CONTAINER(local_vbox), 0);
445
446 GtkWidget *multiple_files_hbox = wh_hbox_new();
447 gtk_box_pack_start(GTK_BOX(local_vbox), multiple_files_hbox, TRUE, TRUE, 0);
448
449 GtkWidget *multiple_files_component = create_multiple_files_component(ui);
450 gtk_box_pack_start(GTK_BOX(multiple_files_hbox), multiple_files_component, TRUE, TRUE, 0);
451 ui->gui->multiple_files_component = multiple_files_component;
452
453 return local_vbox;
454 }
455
457 GtkWidget *create_special_split_page(ui_state *ui)
458 {
459 GtkWidget *vbox = wh_vbox_new();;
460
461 #if GTK_MAJOR_VERSION <= 2
462 GtkWidget *paned_widget = gtk_vpaned_new();
463 #else
464 GtkWidget *paned_widget = gtk_paned_new(GTK_ORIENTATION_VERTICAL);
465 #endif
466
467 gtk_box_pack_start(GTK_BOX(vbox), paned_widget, TRUE, TRUE, 0);
468
469 gtk_paned_add1(GTK_PANED(paned_widget), create_single_multiple_split_modes(ui));
470 gtk_paned_add2(GTK_PANED(paned_widget), create_split_mode(ui));
471
472 gtk_paned_set_position(GTK_PANED(paned_widget), 150);
473
474 return vbox;
475 }
476
wh_create_scrolled_window
GtkWidget * wh_create_scrolled_window()
creates a scrolled window
Definition: widgets_helper.c:286
create_special_split_page
GtkWidget * create_special_split_page(ui_state *ui)
creates the special split page
Definition: split_mode_window.c:457
select_split_mode
void select_split_mode(int split_mode, ui_state *ui)
Set the split mode.
Definition: split_mode_window.c:61
ui_state
Definition: ui_types.h:485
gui_state
Definition: ui_types.h:202