~ubuntu-branches/ubuntu/oneiric/rhythmbox/oneiric

« back to all changes in this revision

Viewing changes to plugins/audiocd/rb-audiocd-source.c

  • Committer: Bazaar Package Importer
  • Author(s): Rico Tzschichholz
  • Date: 2011-07-29 16:41:38 UTC
  • mto: This revision was merged to the branch mainline in revision 191.
  • Revision ID: james.westby@ubuntu.com-20110729164138-wwicy8nqalm18ck7
Tags: upstream-2.90.1~20110802
ImportĀ upstreamĀ versionĀ 2.90.1~20110802

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include <gst/gst.h>
40
40
#include <gst/cdda/gstcddabasesrc.h>
41
41
 
42
 
#include "rb-plugin.h"
43
42
#include "rhythmdb.h"
44
 
#include "eel-gconf-extensions.h"
45
43
#include "rb-shell.h"
46
44
#include "rb-audiocd-source.h"
47
45
#include "rb-util.h"
48
46
#include "rb-debug.h"
49
47
#include "rb-dialog.h"
50
48
#include "rb-builder-helpers.h"
 
49
#include "rb-file-helpers.h"
51
50
 
52
51
#ifdef HAVE_SJ_METADATA_GETTER
53
52
#include "sj-metadata-getter.h"
140
139
        GtkActionGroup *action_group;
141
140
} RBAudioCdSourcePrivate;
142
141
 
143
 
RB_PLUGIN_DEFINE_TYPE (RBAudioCdSource, rb_audiocd_source, RB_TYPE_REMOVABLE_MEDIA_SOURCE)
 
142
G_DEFINE_DYNAMIC_TYPE (RBAudioCdSource, rb_audiocd_source, RB_TYPE_REMOVABLE_MEDIA_SOURCE)
144
143
#define AUDIOCD_SOURCE_GET_PRIVATE(o)   (G_TYPE_INSTANCE_GET_PRIVATE ((o), RB_TYPE_AUDIOCD_SOURCE, RBAudioCdSourcePrivate))
145
144
 
146
145
/* entry type */
147
146
typedef struct _RhythmDBEntryType RBAudioCdEntryType;
148
147
typedef struct _RhythmDBEntryTypeClass RBAudioCdEntryTypeClass;
149
148
 
150
 
static void rb_audiocd_entry_type_class_init (RBAudioCdEntryTypeClass *klass);
151
 
static void rb_audiocd_entry_type_init (RBAudioCdEntryType *etype);
152
149
GType rb_audiocd_entry_type_get_type (void);
153
150
 
154
 
G_DEFINE_TYPE (RBAudioCdEntryType, rb_audiocd_entry_type, RHYTHMDB_TYPE_ENTRY_TYPE);
 
151
G_DEFINE_DYNAMIC_TYPE (RBAudioCdEntryType, rb_audiocd_entry_type, RHYTHMDB_TYPE_ENTRY_TYPE);
155
152
 
156
153
#ifdef HAVE_SJ_METADATA_GETTER
157
154
static AlbumDetails* multiple_album_dialog (GList *albums, RBAudioCdSource *source);
177
174
}
178
175
 
179
176
static void
 
177
rb_audiocd_entry_type_class_finalize (RBAudioCdEntryTypeClass *klass)
 
178
{
 
179
}
 
180
 
 
181
static void
180
182
rb_audiocd_entry_type_init (RBAudioCdEntryType *etype)
181
183
{
182
184
}
233
235
}
234
236
 
235
237
static void
 
238
rb_audiocd_source_class_finalize (RBAudioCdSourceClass *klass)
 
239
{
 
240
}
 
241
 
 
242
static void
236
243
rb_audiocd_source_init (RBAudioCdSource *self)
237
244
{
238
245
}
305
312
        GtkTreeViewColumn *extract;
306
313
        GtkWidget *widget;
307
314
        GtkAction *action;
308
 
        RBPlugin *plugin;
 
315
        GObject *plugin;
309
316
        RBShell *shell;
310
317
        char *ui_file;
311
318
        int toggle_width;
380
387
 
381
388
        /* set up the album info widgets */
382
389
        g_object_get (source, "plugin", &plugin, NULL);
383
 
        ui_file = rb_plugin_find_file (plugin, "album-info.ui");
 
390
        ui_file = rb_find_plugin_data_file (G_OBJECT (plugin), "album-info.ui");
384
391
        g_object_unref (plugin);
385
392
 
386
393
        if (ui_file == NULL) {
436
443
                g_signal_connect_object (priv->year_entry, "focus-out-event", G_CALLBACK (update_year_cb), source, 0);
437
444
                g_signal_connect_object (priv->disc_number_entry, "focus-out-event", G_CALLBACK (update_disc_number_cb), source, 0);
438
445
 
 
446
                gtk_widget_set_vexpand (table, FALSE);
439
447
                gtk_box_pack_start (GTK_BOX (priv->box), table, FALSE, FALSE, 0);
440
448
                gtk_box_reorder_child (GTK_BOX (priv->box), table, 0);
441
449
                g_object_unref (builder);
446
454
}
447
455
 
448
456
RBSource *
449
 
rb_audiocd_source_new (RBPlugin *plugin,
 
457
rb_audiocd_source_new (GObject *plugin,
450
458
                       RBShell *shell,
451
459
                       GVolume *volume)
452
460
{
453
461
        GObject *source;
 
462
        GSettings *settings;
454
463
        RhythmDBEntryType *entry_type;
455
464
        RhythmDB *db;
456
465
        char *name;
472
481
        g_object_unref (db);
473
482
        g_free (name);
474
483
 
 
484
        settings = g_settings_new ("org.gnome.rhythmbox.plugins.audiocd");
475
485
        source = g_object_new (RB_TYPE_AUDIOCD_SOURCE,
476
486
                               "entry-type", entry_type,
477
487
                               "volume", volume,
478
488
                               "shell", shell,
479
 
                               "sorting-key", NULL,
480
489
                               "plugin", plugin,
 
490
                               "show-browser", FALSE,
 
491
                               "settings", g_settings_get_child (settings, "source"),
481
492
                               NULL);
 
493
        g_object_unref (settings);
482
494
 
483
495
        rb_shell_register_entry_type_for_source (shell, RB_SOURCE (source), entry_type);
484
496
 
608
620
        entry_set_string_prop (db, entry, RHYTHMDB_PROP_ARTIST, FALSE, NULL);
609
621
        entry_set_string_prop (db, entry, RHYTHMDB_PROP_ALBUM, FALSE, NULL);
610
622
        entry_set_string_prop (db, entry, RHYTHMDB_PROP_GENRE, FALSE, NULL);
611
 
        entry_set_string_prop (db, entry, RHYTHMDB_PROP_MIMETYPE, TRUE, "audio/x-raw-int");
 
623
        entry_set_string_prop (db, entry, RHYTHMDB_PROP_MEDIA_TYPE, TRUE, "audio/x-raw-int");
612
624
 
613
625
        extra_data = RHYTHMDB_ENTRY_GET_TYPE_DATA (entry, RBAudioCDEntryData);
614
626
        extra_data->extract = TRUE;
728
740
        GtkBuilder *builder;
729
741
        GtkTreeViewColumn *column;
730
742
        GtkCellRenderer *text_renderer;
731
 
        RBPlugin *plugin;
 
743
        GObject *plugin;
732
744
        char *builder_file;
733
745
 
734
746
        gdk_threads_enter ();
737
749
        g_assert (plugin != NULL);
738
750
 
739
751
        /* create dialog */
740
 
        builder_file = rb_plugin_find_file (plugin, "multiple-album.ui");
 
752
        builder_file = rb_find_plugin_data_file (plugin, "multiple-album.ui");
741
753
        g_object_unref (plugin);
742
754
 
743
755
        if (builder_file == NULL) {
1434
1446
        g_object_unref (model);
1435
1447
        g_object_unref (library);
1436
1448
}
 
1449
 
 
1450
void
 
1451
_rb_audiocd_source_register_type (GTypeModule *module)
 
1452
{
 
1453
        rb_audiocd_source_register_type (module);
 
1454
        rb_audiocd_entry_type_register_type (module);
 
1455
}