comparison audacious/input.c @ 1231:502b369314c1 trunk

[svn] - InputPlugin class: + get_song_tuple(gchar *filename); + set_song_tuple(TitleInput *tuple); - input_get_song_tuple() utility function to retrieve a songtuple/generic tuple
author nenolod
date Wed, 14 Jun 2006 20:49:47 -0700
parents ed26947bbf57
children 7918849bad3e
comparison
equal deleted inserted replaced
1230:a5d5f404b933 1231:502b369314c1
489 } 489 }
490 490
491 g_free(filename_proxy); 491 g_free(filename_proxy);
492 } 492 }
493 493
494 TitleInput *
495 input_get_song_tuple(const gchar * filename)
496 {
497 InputPlugin *ip = NULL;
498 TitleInput *input;
499 GList *node;
500 gchar *tmp = NULL, *ext;
501 gchar *filename_proxy;
502
503 if (filename == NULL)
504 return NULL;
505
506 filename_proxy = g_strdup(filename);
507
508 for (node = get_input_list(); node != NULL; node = g_list_next(node)) {
509 ip = INPUT_PLUGIN(node->data);
510 if (input_is_enabled(ip->filename) && ip->is_our_file(filename_proxy))
511 break;
512 }
513
514 if (ip && node && ip->get_song_tuple)
515 input = ip->get_song_tuple(filename_proxy);
516 else {
517 input = bmp_title_input_new();
518
519 tmp = g_strdup(filename);
520 if ((ext = strrchr(tmp, '.')))
521 *ext = '\0';
522
523 input->file_name = g_path_get_basename(tmp);
524 input->file_ext = ext ? ext + 1 : NULL;
525 input->file_path = tmp;
526 }
527
528 return input;
529 }
530
494 static void 531 static void
495 input_general_file_info_box(const gchar * filename, InputPlugin * ip) 532 input_general_file_info_box(const gchar * filename, InputPlugin * ip)
496 { 533 {
497 GtkWidget *window, *vbox; 534 GtkWidget *window, *vbox;
498 GtkWidget *label, *filename_hbox, *filename_entry; 535 GtkWidget *label, *filename_hbox, *filename_entry;