mp3splt-gtk: src/freedb_window.c Source File

mp3splt-gtk 0.9.3.1519

Loading...
Searching...
No Matches
freedb_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-2014 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 freedb tab
35 *
36 * this file is used for the cddb tab
37 * (for searching on freedb)
38 *********************************************************/
39
40#include "freedb_window.h"
41
42enum {
43 ALBUM_NAME,
44 NUMBER,
45 FREEDB_TABLE
46};
47
49static void add_freedb_row(gchar *album_name, gint album_id, gint revisions_number, ui_state *ui)
50{
51 GtkTreeModel *model = gtk_tree_view_get_model(ui->gui->freedb_tree);
52
53 GtkTreeIter iter;
54 gtk_tree_store_append (GTK_TREE_STORE(model), &iter,NULL);
55 gtk_tree_store_set(GTK_TREE_STORE(model), &iter,
56 ALBUM_NAME, album_name, NUMBER, album_id, -1);
57
58 gint malloc_number = strlen(album_name) + 20;
59 gchar *number = malloc(malloc_number * sizeof(gchar *));
60 gint i;
61 for(i = 0; i < revisions_number; i++)
62 {
63 g_snprintf(number,malloc_number, _("%s Revision %d"),album_name, i);
64
65 GtkTreeIter child_iter;
66 gtk_tree_store_append(GTK_TREE_STORE(model), &child_iter, &iter);
67 gtk_tree_store_set(GTK_TREE_STORE(model), &child_iter,
68 ALBUM_NAME, number, NUMBER, album_id + i + 1, -1);
69 }
70
71 ui->infos->freedb_table_number++;
72 g_free(number);
73}
74
76static GtkTreeModel *create_freedb_model()
77{
78 GtkTreeStore *model = gtk_tree_store_new(FREEDB_TABLE, G_TYPE_STRING, G_TYPE_INT);
79 return GTK_TREE_MODEL(model);
80}
81
83static GtkTreeView *create_freedb_tree()
84{
85 GtkTreeModel *model = create_freedb_model();
86 return GTK_TREE_VIEW(gtk_tree_view_new_with_model(model));
87}
88
90static void create_freedb_columns(GtkTreeView *freedb_tree)
91{
92 GtkCellRendererText *renderer = GTK_CELL_RENDERER_TEXT(gtk_cell_renderer_text_new());
93 g_object_set_data(G_OBJECT(renderer), "col", GINT_TO_POINTER(ALBUM_NAME));
94 GtkTreeViewColumn *name_column = gtk_tree_view_column_new_with_attributes
95 (_("Album title"), GTK_CELL_RENDERER(renderer), "text", ALBUM_NAME, NULL);
96
97 gtk_tree_view_insert_column(freedb_tree, GTK_TREE_VIEW_COLUMN(name_column), ALBUM_NAME);
98
99 gtk_tree_view_column_set_alignment(GTK_TREE_VIEW_COLUMN(name_column), 0.5);
100 gtk_tree_view_column_set_sizing(GTK_TREE_VIEW_COLUMN(name_column), GTK_TREE_VIEW_COLUMN_AUTOSIZE);
101 gtk_tree_view_column_set_expand(GTK_TREE_VIEW_COLUMN(name_column), TRUE);
102
103 gtk_tree_view_column_set_resizable(GTK_TREE_VIEW_COLUMN(name_column), TRUE);
104}
105
107static void freedb_selection_changed(GtkTreeSelection *selection, ui_state *ui)
108{
109 GtkTreeModel *model = gtk_tree_view_get_model(ui->gui->freedb_tree);
110
111 GtkTreeIter iter;
112 if (gtk_tree_selection_get_selected(selection, &model, &iter))
113 {
114 gchar *info;
115 gint selected_id;
116 gtk_tree_model_get(model, &iter, ALBUM_NAME, &info, NUMBER, &selected_id, -1);
117 g_free(info);
118
119 ui->infos->freedb_selected_id = selected_id;
120
121 gtk_widget_set_sensitive(ui->gui->freedb_add_button, TRUE);
122 }
123 else
124 {
125 gtk_widget_set_sensitive(ui->gui->freedb_add_button, FALSE);
126 }
127}
128
130static void remove_all_freedb_rows(ui_state *ui)
131{
132 GtkTreeModel *model = gtk_tree_view_get_model(ui->gui->freedb_tree);
133 while (ui->infos->freedb_table_number > 0)
134 {
135 GtkTreeIter iter;
136 gtk_tree_model_get_iter_first(model, &iter);
137 gtk_tree_store_remove(GTK_TREE_STORE(model), &iter);
138 ui->infos->freedb_table_number--;
139 }
140}
141
142static gboolean freedb_search_start(ui_state *ui)
143{
144 gui_state *gui = ui->gui;
145
146 gtk_widget_hide(gui->freedb_search_button);
147 gtk_widget_show(gui->freedb_spinner);
148 gtk_spinner_start(GTK_SPINNER(gui->freedb_spinner));
149
150 gtk_widget_set_sensitive(gui->freedb_add_button, FALSE);
151 gtk_widget_set_sensitive(gui->freedb_entry, FALSE);
152 gtk_widget_set_sensitive(GTK_WIDGET(gui->freedb_tree), FALSE);
153
154 put_status_message(_("please wait... contacting tracktype.org"), ui);
155
156 return FALSE;
157}
158
159static gboolean freedb_search_end(ui_with_err *ui_err)
160{
161 gui_state *gui = ui_err->ui->gui;
162 ui_infos *infos = ui_err->ui->infos;
163
164 remove_all_freedb_rows(ui_err->ui);
165
166 if (ui_err->err >= 0 && infos->freedb_search_results)
167 {
168 gboolean we_have_results = FALSE;
169
170 mp3splt_freedb_init_iterator(infos->freedb_search_results);
171 const splt_freedb_one_result *result = NULL;
172 while ((result = mp3splt_freedb_next(infos->freedb_search_results)))
173 {
174 const char *old_name = mp3splt_freedb_get_name(result);
175 if (old_name == NULL)
176 {
177 add_freedb_row("",
178 mp3splt_freedb_get_id(result),
179 mp3splt_freedb_get_number_of_revisions(result),
180 ui_err->ui);
181 we_have_results = TRUE;
182 continue;
183 }
184
185 char *name = strdup(old_name);
186
187 gint must_be_freed = SPLT_FALSE;
188 name = transform_to_utf8(name, TRUE, &must_be_freed);
189 add_freedb_row(name,
190 mp3splt_freedb_get_id(result),
191 mp3splt_freedb_get_number_of_revisions(result),
192 ui_err->ui);
193 if (must_be_freed) { free(name); }
194
195 we_have_results = TRUE;
196 }
197
198 if (we_have_results)
199 {
200 GtkTreeSelection *selection = gtk_tree_view_get_selection(gui->freedb_tree);
201 GtkTreeModel *model = gtk_tree_view_get_model(gui->freedb_tree);
202 GtkTreePath *path = gtk_tree_path_new_from_indices (0 ,-1);
203
204 GtkTreeIter iter;
205 gtk_tree_model_get_iter(model, &iter, path);
206 gtk_tree_selection_select_iter(selection, &iter);
207 gtk_tree_path_free(path);
208 }
209 }
210
211 gtk_widget_show(gui->freedb_search_button);
212 gtk_spinner_stop(GTK_SPINNER(gui->freedb_spinner));
213 gtk_widget_hide(gui->freedb_spinner);
214
215 gtk_widget_set_sensitive(gui->freedb_entry, TRUE);
216 gtk_widget_set_sensitive(GTK_WIDGET(gui->freedb_tree), TRUE);
217
218 set_process_in_progress_and_wait_safe(FALSE, ui_err->ui);
219
220 g_free(ui_err);
221
222 return FALSE;
223}
224
226static gpointer freedb_search(ui_with_fname *ui_fname)
227{
228 ui_state *ui = ui_fname->ui;
229
230 set_process_in_progress_and_wait_safe(TRUE, ui);
231
232 add_idle(G_PRIORITY_HIGH_IDLE, (GSourceFunc)freedb_search_start, ui, NULL);
233
234 gint err = SPLT_OK;
235
236 //freedb_search_results is only used in the idle of the end of the thread, so no mutex needed
237 ui->infos->freedb_search_results =
238 mp3splt_get_freedb_search(ui->mp3splt_state, ui_fname->fname, &err,
239 SPLT_FREEDB_SEARCH_TYPE_CDDB_CGI, "\0", -1);
240 print_status_bar_confirmation_in_idle(err, ui);
241
242 ui_with_err *ui_err = g_malloc0(sizeof(ui_with_err));
243 ui_err->err = err;
244 ui_err->ui = ui;
245 add_idle(G_PRIORITY_HIGH_IDLE, (GSourceFunc)freedb_search_end, ui_err, NULL);
246
247 g_free(ui_fname->fname);
248 g_free(ui_fname);
249
250 return NULL;
251}
252
254static void freedb_search_start_thread(ui_state *ui)
255{
256 ui_with_fname *ui_fname = g_malloc0(sizeof(ui_with_fname));
257 ui_fname->ui = ui;
258
259 const gchar *freedb_search_value = gtk_entry_get_text(GTK_ENTRY(ui->gui->freedb_entry));
260 if (freedb_search_value)
261 {
262 ui_fname->fname = g_strdup(freedb_search_value);
263 create_thread_and_unref((GThreadFunc)freedb_search, (gpointer)ui_fname, ui, "freedb search");
264 }
265}
266
268static void freedb_search_button_event(GtkWidget *widget, ui_state *ui)
269{
270 freedb_search_start_thread(ui);
271}
272
277static void freedb_entry_activate_event(GtkEntry *entry, ui_state *ui)
278{
279 freedb_search_start_thread(ui);
280}
281
283static void get_secs_mins_hundr(gfloat time, gint *mins,gint *secs, gint *hundr)
284{
285 *mins = (gint)(time / 6000);
286 *secs = (gint)(time - (*mins * 6000)) / 100;
287 *hundr = (gint)(time - (*mins * 6000) - (*secs * 100));
288}
289
290static void update_tags_from_mp3splt_state(gint number_of_rows, ui_state *ui)
291{
292 gint err = SPLT_OK;
293 splt_tags_group *tags_group = mp3splt_get_tags_group(ui->mp3splt_state, &err);
294 print_status_bar_confirmation(err, ui);
295
296 if (tags_group == NULL)
297 {
298 return;
299 }
300
301 mp3splt_tags_group_init_iterator(tags_group);
302
303 GtkTreeModel *model = gtk_tree_view_get_model(ui->gui->tree_view);
304
305 splt_tags *tags = NULL;
306 gint current_row = 0;
307 while ((tags = mp3splt_tags_group_next(tags_group)))
308 {
309 if ((current_row + 1) > number_of_rows)
310 {
311 break;
312 }
313
314 GtkTreePath *path = gtk_tree_path_new_from_indices(current_row, -1);
315 GtkTreeIter iter;
316 gtk_tree_model_get_iter(model, &iter, path);
317 gtk_tree_path_free(path);
318
319 char *utf8_str;
320 char *year_str = mp3splt_tags_get(tags, SPLT_TAGS_YEAR);
321 if (year_str != NULL)
322 {
323 gint must_be_freed = SPLT_FALSE;
324 utf8_str = transform_to_utf8(year_str, TRUE, &must_be_freed);
325 gint year = atoi(utf8_str);
326 if (must_be_freed) { free(utf8_str); }
327 gtk_list_store_set(GTK_LIST_STORE(model), &iter, COL_YEAR, year, -1);
328 }
329
330 char *track_str = mp3splt_tags_get(tags, SPLT_TAGS_TRACK);
331 if (track_str != NULL)
332 {
333 gint must_be_freed = SPLT_FALSE;
334 utf8_str = transform_to_utf8(track_str, TRUE, &must_be_freed);
335 gint track = atoi(utf8_str);
336 if (must_be_freed) { free(utf8_str); }
337 if (track < 0) { track = 0; }
338 gtk_list_store_set(GTK_LIST_STORE(model), &iter, COL_TRACK, track, -1);
339 }
340
341 char *title = mp3splt_tags_get(tags, SPLT_TAGS_TITLE);
342 if (title != NULL)
343 {
344 gint must_be_freed = SPLT_FALSE;
345 utf8_str = transform_to_utf8(title, TRUE, &must_be_freed);
346 gtk_list_store_set(GTK_LIST_STORE(model), &iter, COL_TITLE, utf8_str, -1);
347 if (must_be_freed) { free(utf8_str); }
348 }
349
350 char *performer = mp3splt_tags_get(tags, SPLT_TAGS_PERFORMER);
351 if (performer != NULL) {
352 gint must_be_freed = SPLT_FALSE;
353 utf8_str = transform_to_utf8(performer, TRUE, &must_be_freed);
354 gtk_list_store_set(GTK_LIST_STORE(model), &iter, COL_ARTIST, utf8_str, -1);
355 if (must_be_freed) {free(utf8_str);}
356 }
357 else {
358 char *artist = mp3splt_tags_get(tags, SPLT_TAGS_ARTIST);
359 if (artist != NULL)
360 {
361 gint must_be_freed = SPLT_FALSE;
362 utf8_str = transform_to_utf8(artist, TRUE, &must_be_freed);
363 gtk_list_store_set(GTK_LIST_STORE(model), &iter, COL_ARTIST, utf8_str, -1);
364 if (must_be_freed) { free(utf8_str); }
365 }
366 }
367
368 char *album = mp3splt_tags_get(tags, SPLT_TAGS_ALBUM);
369 if (album != NULL)
370 {
371 gint must_be_freed = SPLT_FALSE;
372 utf8_str = transform_to_utf8(album, TRUE, &must_be_freed);
373 gtk_list_store_set(GTK_LIST_STORE(model), &iter, COL_ALBUM, utf8_str, -1);
374 if (must_be_freed) { free(utf8_str); }
375 }
376
377 char *genre = mp3splt_tags_get(tags, SPLT_TAGS_GENRE);
378 if (genre != NULL)
379 {
380 gint must_be_freed = SPLT_FALSE;
381 utf8_str = transform_to_utf8(genre, TRUE, &must_be_freed);
382 gtk_list_store_set(GTK_LIST_STORE(model), &iter, COL_GENRE, utf8_str, -1);
383 if (must_be_freed) { free(utf8_str); }
384 }
385
386 char *comment = mp3splt_tags_get(tags, SPLT_TAGS_COMMENT);
387 if (comment != NULL)
388 {
389 gint must_be_freed = SPLT_FALSE;
390 utf8_str = transform_to_utf8(comment, TRUE, &must_be_freed);
391 gtk_list_store_set(GTK_LIST_STORE(model), &iter, COL_COMMENT, utf8_str, -1);
392 if (must_be_freed) { free(utf8_str); }
393 }
394
395 current_row++;
396 }
397}
398
405 void update_splitpoints_from_mp3splt_state(ui_state *ui)
406{
407 gint err = SPLT_OK;
408 splt_points *points = mp3splt_get_splitpoints(ui->mp3splt_state, &err);
409 print_status_bar_confirmation(err, ui);
410 if (points == NULL) { return; }
411
412 ui->status->lock_cue_export = SPLT_TRUE;
413
414 remove_all_rows(ui->gui->remove_all_button, ui);
415
416 mp3splt_points_init_iterator(points);
417 const splt_point *point = NULL;
418 gint number_of_rows = 0;
419 while ((point = mp3splt_points_next(points)))
420 {
421 //ugly hack
422 long old_point_value = mp3splt_point_get_value(point);
423 int point_value = 0;
424 if (old_point_value > INT_MAX)
425 {
426 point_value = 100 * 60 * 10000;
427 }
428 else {
429 point_value = (int) old_point_value;
430 }
431
432 get_secs_mins_hundr(point_value,
433 &ui->status->spin_mins, &ui->status->spin_secs, &ui->status->spin_hundr_secs);
434
435 gchar *result_utf8 = mp3splt_point_get_name(point);
436 if (result_utf8 != NULL)
437 {
438 gint must_be_free = FALSE;
439 result_utf8 = transform_to_utf8(result_utf8, FALSE, &must_be_free);
440 g_snprintf(ui->status->current_description, 255, "%s", result_utf8);
441 }
442 else
443 {
444 g_snprintf(ui->status->current_description, 255, "%s", _("description here"));
445 }
446
447 g_free(result_utf8);
448 result_utf8 = NULL;
449
450 splt_type_of_splitpoint type = mp3splt_point_get_type(point);
451 if (type == SPLT_SPLITPOINT)
452 {
453 add_row(TRUE, ui);
454 }
455 else if (type == SPLT_SKIPPOINT)
456 {
457 add_row(FALSE, ui);
458 }
459
460 number_of_rows++;
461 }
462
463 update_tags_from_mp3splt_state(number_of_rows, ui);
464
465 g_snprintf(ui->status->current_description, 255, "%s", _("description here"));
466
467 update_minutes_from_spinner(ui->gui->spinner_minutes, ui);
468 update_seconds_from_spinner(ui->gui->spinner_seconds, ui);
469 update_hundr_secs_from_spinner(ui->gui->spinner_hundr_secs, ui);
470
471 ui->status->lock_cue_export = SPLT_FALSE;
472
473 export_cue_file_in_configuration_directory(ui);
474}
475
476static gboolean put_freedb_splitpoints_start(ui_state *ui)
477{
478 gtk_widget_set_sensitive(ui->gui->freedb_add_button, FALSE);
479 gtk_widget_set_sensitive(GTK_WIDGET(ui->gui->freedb_tree), FALSE);
480
481 put_status_message(_("please wait... contacting tracktype.org"), ui);
482
483 return FALSE;
484}
485
486static gboolean put_freedb_splitpoints_end(ui_state *ui)
487{
488 update_splitpoints_from_mp3splt_state(ui);
489
490 gtk_widget_set_sensitive(ui->gui->freedb_add_button, TRUE);
491 gtk_widget_set_sensitive(GTK_WIDGET(ui->gui->freedb_tree), TRUE);
492
493 set_process_in_progress_and_wait_safe(FALSE, ui);
494
495 return FALSE;
496}
497
498static gpointer put_freedb_splitpoints(ui_for_split *ui_fs)
499{
500 ui_state *ui = ui_fs->ui;
501
502 set_process_in_progress_and_wait_safe(TRUE, ui);
503
504 gint selected_id = ui_fs->freedb_selected_id;
505
506 add_idle(G_PRIORITY_HIGH_IDLE, (GSourceFunc)put_freedb_splitpoints_start, ui, NULL);
507
508 gchar *configuration_directory = get_configuration_directory();
509 gint malloc_number = strlen(configuration_directory) + 20;
510 gchar *filename = malloc(malloc_number * sizeof(gchar));
511 g_snprintf(filename, malloc_number, "%s%s%s", configuration_directory, G_DIR_SEPARATOR_S,
512 "query.cddb");
513 g_free(configuration_directory);
514
515 gint err = mp3splt_write_freedb_file_result(ui->mp3splt_state, selected_id,
516 filename, SPLT_FREEDB_GET_FILE_TYPE_CDDB_CGI, "\0",-1);
517 print_status_bar_confirmation_in_idle(err, ui);
518
519 if (ui_fs->is_checked_output_radio_box)
520 {
521 mp3splt_set_int_option(ui->mp3splt_state, SPLT_OPT_OUTPUT_FILENAMES, SPLT_OUTPUT_DEFAULT);
522 }
523 else
524 {
525 mp3splt_set_int_option(ui->mp3splt_state, SPLT_OPT_OUTPUT_FILENAMES, SPLT_OUTPUT_FORMAT);
526 gint error = mp3splt_set_oformat(ui->mp3splt_state, ui_fs->output_format);
527 print_status_bar_confirmation_in_idle(error, ui);
528 }
529
530 err = mp3splt_import(ui->mp3splt_state, CDDB_IMPORT, filename);
531 print_status_bar_confirmation_in_idle(err, ui);
532
533 if (filename)
534 {
535 g_free(filename);
536 filename = NULL;
537 }
538
539 add_idle(G_PRIORITY_HIGH_IDLE, (GSourceFunc)put_freedb_splitpoints_end, ui, NULL);
540
541 free_ui_for_split(ui_fs);
542
543 return NULL;
544}
545
547static void freedb_add_button_clicked_event(GtkButton *button, ui_state *ui)
548{
549 ui_for_split *ui_fs = build_ui_for_split(ui);
550 ui_fs->freedb_selected_id = ui->infos->freedb_selected_id;
551 create_thread_and_unref((GThreadFunc)put_freedb_splitpoints,
552 (gpointer)ui_fs, ui, "put_freedb_points");
553}
554
556GtkWidget *create_freedb_frame(ui_state *ui)
557{
558 GtkWidget *freedb_hbox = wh_hbox_new();
559 gtk_container_set_border_width(GTK_CONTAINER(freedb_hbox), 0);
560
561 GtkWidget *freedb_vbox = wh_vbox_new();
562 gtk_box_pack_start(GTK_BOX(freedb_hbox), freedb_vbox, TRUE, TRUE, 4);
563
564 /* search box */
565 GtkWidget *search_hbox = wh_hbox_new();
566 gtk_box_pack_start(GTK_BOX(freedb_vbox), search_hbox, FALSE, FALSE, 2);
567
568 GtkWidget *label = gtk_label_new(_("Search tracktype.org:"));
569 gtk_box_pack_start(GTK_BOX(search_hbox), label, FALSE, FALSE, 0);
570
571 GtkWidget *freedb_entry = gtk_entry_new();
572 ui->gui->freedb_entry = freedb_entry;
573 gtk_editable_set_editable(GTK_EDITABLE(freedb_entry), TRUE);
574 gtk_box_pack_start(GTK_BOX(search_hbox), freedb_entry, TRUE, TRUE, 6);
575 g_signal_connect(G_OBJECT(freedb_entry), "activate",
576 G_CALLBACK(freedb_entry_activate_event), ui);
577
578 GtkWidget *freedb_search_button = wh_create_cool_button("edit-find", _("_Search"),FALSE);
579 ui->gui->freedb_search_button = freedb_search_button;
580 g_signal_connect(G_OBJECT(freedb_search_button), "clicked",
581 G_CALLBACK(freedb_search_button_event), ui);
582 gtk_box_pack_start(GTK_BOX(search_hbox), freedb_search_button, FALSE, FALSE, 0);
583
584 GtkWidget *freedb_spinner = gtk_spinner_new();
585 ui->gui->freedb_spinner = freedb_spinner;
586 gtk_box_pack_start(GTK_BOX(search_hbox), freedb_spinner, FALSE, FALSE, 4);
587
588 /* freedb scrolled window and the tree */
589 GtkTreeView *freedb_tree = create_freedb_tree();
590 ui->gui->freedb_tree = freedb_tree;
591
592 GtkWidget *scrolled_window = gtk_scrolled_window_new(NULL, NULL);
593 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled_window), GTK_SHADOW_NONE);
594 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window),
595 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
596 gtk_box_pack_start(GTK_BOX(freedb_vbox), scrolled_window, TRUE, TRUE, 1);
597
598 create_freedb_columns(freedb_tree);
599
600 gtk_container_add(GTK_CONTAINER(scrolled_window), GTK_WIDGET(freedb_tree));
601
602 GtkTreeSelection *freedb_tree_selection = gtk_tree_view_get_selection(freedb_tree);
603 g_signal_connect(G_OBJECT(freedb_tree_selection), "changed",
604 G_CALLBACK(freedb_selection_changed), ui);
605
606 /* add button */
607 GtkWidget *freedb_add_button = wh_create_cool_button("list-add", _("_Add splitpoints"), FALSE);
608 ui->gui->freedb_add_button = freedb_add_button;
609
610 gtk_widget_set_sensitive(freedb_add_button, FALSE);
611 g_signal_connect(G_OBJECT(freedb_add_button), "clicked",
612 G_CALLBACK(freedb_add_button_clicked_event), ui);
613 gtk_widget_set_tooltip_text(freedb_add_button, _("Set splitpoints to the splitpoints table"));
614
615 return freedb_hbox;
616}
617
618void hide_freedb_spinner(gui_state *gui)
619{
620 gtk_widget_hide(gui->freedb_spinner);
621}
622
623
update_splitpoints_from_mp3splt_state
void update_splitpoints_from_mp3splt_state(ui_state *ui)
updates the current splitpoints in ui->mp3splt_state
Definition freedb_window.c:405
create_freedb_frame
GtkWidget * create_freedb_frame(ui_state *ui)
creates the freedb box
Definition freedb_window.c:556
print_status_bar_confirmation
void print_status_bar_confirmation(gint error, ui_state *ui)
Output an error message from libmp3splt to the status bar.
Definition main_window.c:1344
put_status_message
void put_status_message(const gchar *text, ui_state *ui)
Output a info message to the status message bar.
Definition main_window.c:263
update_minutes_from_spinner
void update_minutes_from_spinner(GtkWidget *widget, ui_state *ui)
updates the minutes from the spinner
Definition splitpoints_window.c:109
update_seconds_from_spinner
void update_seconds_from_spinner(GtkWidget *widget, ui_state *ui)
updates the seconds from the spinner
Definition splitpoints_window.c:116
remove_all_rows
void remove_all_rows(GtkWidget *widget, ui_state *ui)
removes all rows from the table
Definition splitpoints_window.c:1355
update_hundr_secs_from_spinner
void update_hundr_secs_from_spinner(GtkWidget *widget, ui_state *ui)
updates the hundredth of seconds for the spinner
Definition splitpoints_window.c:123
add_row
void add_row(gboolean checked, ui_state *ui)
adds a row to the table
Definition splitpoints_window.c:931
gui_state
Definition ui_types.h:227
ui_for_split
Definition ui_types.h:571
ui_infos
Definition ui_types.h:104
ui_state
Definition ui_types.h:509
ui_with_err
Definition ui_types.h:531
ui_with_fname
Definition ui_types.h:545
transform_to_utf8
gchar * transform_to_utf8(gchar *text, gint free_or_not, gint *must_be_freed)
transform text to utf8
Definition utilities.c:131