461 |
void gtk_audio_addtrack(GtkWidget *Abtn, gpointer Adata) |
void gtk_audio_addtrack(GtkWidget *Abtn, gpointer Adata) |
462 |
{ |
{ |
463 |
GHashTable *Lhash = (GHashTable *)Adata; |
GHashTable *Lhash = (GHashTable *)Adata; |
464 |
|
GtkWidget *Lwindow1 = GTK_WIDGET(g_hash_table_lookup(Lhash, "topwindow")); |
465 |
GtkTreeView *Lliste = GTK_TREE_VIEW(g_hash_table_lookup(Lhash, "LISTEAUDIO")); |
GtkTreeView *Lliste = GTK_TREE_VIEW(g_hash_table_lookup(Lhash, "LISTEAUDIO")); |
466 |
guint32 *Laudiolen = (guint32 *)g_hash_table_lookup(Lhash, "audiolen"); |
guint32 *Laudiolen = (guint32 *)g_hash_table_lookup(Lhash, "audiolen"); |
467 |
guint32 *Laudiomaxlen = (guint32 *)g_hash_table_lookup(Lhash, "audiomaxlen"); |
guint32 *Laudiomaxlen = (guint32 *)g_hash_table_lookup(Lhash, "audiomaxlen"); |
476 |
|
|
477 |
Lfiles = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(Lpistesel)); |
Lfiles = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(Lpistesel)); |
478 |
|
|
479 |
|
set_cursor(Lwindow1, GDK_WATCH); |
480 |
for (Lcur = Lfiles; Lcur && Lcur->data; Lcur = Lcur->next) { |
for (Lcur = Lfiles; Lcur && Lcur->data; Lcur = Lcur->next) { |
481 |
_add_a_piste((gchar *) Lcur->data, GTK_LIST_STORE(Ltreemodel), Lhash); |
_add_a_piste((gchar *) Lcur->data, GTK_LIST_STORE(Ltreemodel), Lhash); |
482 |
} |
} |
483 |
|
unset_cursor(Lwindow1); |
484 |
|
|
485 |
g_slist_free(Lfiles); |
g_slist_free(Lfiles); |
486 |
} |
} |
494 |
void gtk_data_adddirectory(GtkWidget *btn, gpointer Adata) |
void gtk_data_adddirectory(GtkWidget *btn, gpointer Adata) |
495 |
{ |
{ |
496 |
GHashTable *Lhash = (GHashTable *)Adata; |
GHashTable *Lhash = (GHashTable *)Adata; |
497 |
|
GtkWidget *Lwindow1 = GTK_WIDGET(g_hash_table_lookup(Lhash, "topwindow")); |
498 |
GtkTreeView *Lliste = GTK_TREE_VIEW(g_hash_table_lookup(Lhash, "_current_list")); |
GtkTreeView *Lliste = GTK_TREE_VIEW(g_hash_table_lookup(Lhash, "_current_list")); |
499 |
GtkTreeSelection *Lselection = gtk_tree_view_get_selection(GTK_TREE_VIEW(Lliste)); |
GtkTreeSelection *Lselection = gtk_tree_view_get_selection(GTK_TREE_VIEW(Lliste)); |
500 |
GtkTreeModel *Ltreemodel = gtk_tree_view_get_model(GTK_TREE_VIEW(Lliste)); |
GtkTreeModel *Ltreemodel = gtk_tree_view_get_model(GTK_TREE_VIEW(Lliste)); |
526 |
|
|
527 |
use_last_dir(GTK_FILE_CHOOSER(Lfilesel)); |
use_last_dir(GTK_FILE_CHOOSER(Lfilesel)); |
528 |
if (gtk_dialog_run(GTK_DIALOG(Lfilesel))==GTK_RESPONSE_ACCEPT) { |
if (gtk_dialog_run(GTK_DIALOG(Lfilesel))==GTK_RESPONSE_ACCEPT) { |
529 |
|
set_cursor(Lwindow1, GDK_WATCH); |
530 |
save_last_dir(GTK_FILE_CHOOSER(Lfilesel)); |
save_last_dir(GTK_FILE_CHOOSER(Lfilesel)); |
531 |
|
|
532 |
Lfiles = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(Lfilesel)); |
Lfiles = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(Lfilesel)); |
541 |
gtk_tree_view_expand_row(Lliste, Lpath, TRUE); |
gtk_tree_view_expand_row(Lliste, Lpath, TRUE); |
542 |
gtk_tree_path_free(Lpath); |
gtk_tree_path_free(Lpath); |
543 |
} |
} |
544 |
|
unset_cursor(Lwindow1); |
545 |
} |
} |
546 |
gtk_widget_destroy(Lfilesel); |
gtk_widget_destroy(Lfilesel); |
547 |
|
|
1565 |
gchar *Lfilename = NULL; |
gchar *Lfilename = NULL; |
1566 |
|
|
1567 |
for (i=0; ((Lallname[i])); i++) { |
for (i=0; ((Lallname[i])); i++) { |
1568 |
Lunfic = g_strchomp(Lallname[i]); |
if ((!(Lunfic = g_strchomp(Lallname[i]))) || !*Lunfic) continue; |
1569 |
|
|
1570 |
/* on ne gere que les fichiers locaux pour le moment, et c'est deja ça !! */ |
/* on ne gere que les fichiers locaux pour le moment, et c'est deja ça !! */ |
1571 |
if (g_ascii_strncasecmp(Lunfic, "file://", 7) || ( |
if (g_ascii_strncasecmp(Lunfic, "file://", 7) || ( |
1572 |
! ( |
! ( |
1578 |
#endif |
#endif |
1579 |
sc_str_has_casesuffix(Lunfic, WAV)))) continue; |
sc_str_has_casesuffix(Lunfic, WAV)))) continue; |
1580 |
|
|
1581 |
Lfilename = g_filename_from_uri(Lunfic, NULL, NULL); |
if (!(Lfilename = g_filename_from_uri(Lunfic, NULL, NULL))) continue; |
1582 |
_add_a_piste(Lfilename, GTK_LIST_STORE(Ltreemodel), Lhash); |
_add_a_piste(Lfilename, GTK_LIST_STORE(Ltreemodel), Lhash); |
1583 |
g_free(Lfilename); |
g_free(Lfilename); |
1584 |
} |
} |
1614 |
void data_dnd_data_received (GtkWidget *Aliste, GdkDragContext *Acontext, gint Ax, gint Ay, GtkSelectionData *Aseldata, guint Ainfo, guint Atime, gpointer Adata) |
void data_dnd_data_received (GtkWidget *Aliste, GdkDragContext *Acontext, gint Ax, gint Ay, GtkSelectionData *Aseldata, guint Ainfo, guint Atime, gpointer Adata) |
1615 |
{ |
{ |
1616 |
GHashTable *Lhash = (GHashTable *)Adata; |
GHashTable *Lhash = (GHashTable *)Adata; |
1617 |
guint64 *Ldatasize; // = (guint64 *)g_hash_table_lookup(Lhash, "datasize"); |
guint64 *Ldatasize; |
1618 |
guint64 *Ldatamaxsize; // = (guint64 *)g_hash_table_lookup(Lhash, "datamaxsize"); |
guint64 *Ldatamaxsize; |
1619 |
GtkProgressBar *Lcontenance; // = GTK_PROGRESS_BAR(g_hash_table_lookup(Lhash, "datasizebar")); |
GtkProgressBar *Lcontenance; |
1620 |
GtkTreeModel *Ltreemodel = gtk_tree_view_get_model(GTK_TREE_VIEW(Aliste)); |
GtkTreeModel *Ltreemodel = gtk_tree_view_get_model(GTK_TREE_VIEW(Aliste)); |
|
printf("ICI DNDN\n"); |
|
1621 |
|
|
1622 |
_REMPLISSAGE_VALUE(Lhash, Aliste, Ldatasize, Ldatamaxsize, Lcontenance); |
_REMPLISSAGE_VALUE(Lhash, Aliste, Ldatasize, Ldatamaxsize, Lcontenance); |
1623 |
|
|
1640 |
gtk_tree_model_get_iter(Ltreemodel, &Liter, Lpath); |
gtk_tree_model_get_iter(Ltreemodel, &Liter, Lpath); |
1641 |
gtk_tree_path_free(Lpath); |
gtk_tree_path_free(Lpath); |
1642 |
} |
} |
1643 |
printf("ok encore la\n"); |
|
1644 |
for (i=0; ((Lallname[i])); i++) { |
for (i=0; ((Lallname[i])); i++) { |
1645 |
printf("ok encore la 0\n"); |
if ((!(Lunfic = g_strchomp(Lallname[i]))) || !*Lunfic) continue; |
1646 |
Lunfic = g_strchomp(Lallname[i]); |
if (g_ascii_strncasecmp(Lunfic, "file://", 7)) continue; |
1647 |
printf("ok encore la 1\n"); |
if (!(Lfilename = g_filename_from_uri(Lunfic, NULL, NULL))) continue; |
|
if (!*Lunfic) continue; |
|
|
printf("ok encore la 2 [%s]\n", Lunfic); |
|
|
|
|
|
// Lfilename = g_filename_from_uri(Lunfic, NULL, NULL); |
|
|
Lfilename = g_strdup(Lunfic); |
|
|
printf("ok encore la 3 [%s]\n", Lfilename); |
|
1648 |
|
|
1649 |
_add_a_file(Lfilename, GTK_TREE_STORE(Ltreemodel), &Liter, Lhash, Ldatasize); |
_add_a_file(Lfilename, GTK_TREE_STORE(Ltreemodel), &Liter, Lhash, Ldatasize); |
1650 |
|
|