~audio-recorder/audio-recorder/trunk

« back to all changes in this revision

Viewing changes to src/audio-sources.c

  • Committer: Osmo Antero
  • Date: 2012-04-18 19:22:01 UTC
  • Revision ID: osmoma@gmail.com-20120418192201-ejjs6ikv7o4aznbi
New media-player interface that's based on the MediaPlayer2 standard. See src/dbus-mpris2.c.

Show diffs side-by-side

added added

removed removed

Lines of Context:
639
639
    // Disable "changed" signal
640
640
    gulong signal_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(combo), "selection-changed-signal"));
641
641
    g_signal_handler_block(combo, signal_id);
642
 
 
 
642
    
643
643
    // Clear the old combo list
644
644
    gtk_list_store_clear(GTK_LIST_STORE(model));
645
645
 
675
675
 
676
676
        GdkPixbuf *pixbuf = get_pixbuf_from_file(path, 22, 22);
677
677
 
 
678
        /* TODO: Create pixbuf from the real app icon.
 
679
 
 
680
        GtkWidget *image = gtk_image_new_from_icon_name("tar", GTK_ICON_SIZE_MENU);
 
681
        GtkWidget *image = gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU);
 
682
        if (GTK_IS_IMAGE(image)) {
 
683
            g_print("is image....\n");
 
684
        }
 
685
        GdkPixbuf *pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(image));
 
686
        */
 
687
 
678
688
        // Set column data
679
689
        gtk_list_store_set(GTK_LIST_STORE(model), &iter,
680
690
                           COL_DEVICE_TYPE, item->type, /* type */
681
691
                           COL_DEVICE_ID, item->id, /* internal device id or media player id */
682
692
                           COL_DEVICE_ICON, pixbuf, /* icon pixbuf */
683
 
                           COL_DEVICE_DESCR, item->description /* Visible text */, -1);
 
693
                           COL_DEVICE_DESCR, item->description /* visible text */, -1);
684
694
 
685
695
        // Pixbuf has a reference count of 2 now, as the list store has added its own
686
 
        g_object_unref(pixbuf);
 
696
        if (GDK_IS_PIXBUF(pixbuf))
 
697
            g_object_unref(pixbuf);
687
698
 
688
699
        g_free(path);
689
700
 
729
740
    }
730
741
}
731
742
 
732
 
gboolean audio_sources_combo_get_values(GtkWidget *combo, gchar **device_name, gchar **device_id, gint *device_type) {
 
743
gboolean audio_sources_combo_get_values(GtkWidget *combo, gchar **device_name, 
 
744
                                        gchar **device_id, gint *device_type) {
733
745
    *device_name = NULL;
734
746
    *device_id = NULL;
735
747
    *device_type = -1;