Ejemplo n.º 1
0
static void
rb_import_errors_source_init (RBImportErrorsSource *source)
{
	source->priv = G_TYPE_INSTANCE_GET_PRIVATE (source, RB_TYPE_IMPORT_ERRORS_SOURCE, RBImportErrorsSourcePrivate);

	rb_display_page_set_icon_name (RB_DISPLAY_PAGE (source), "dialog-error-symbolic");
}
static void
rb_missing_files_source_init (RBMissingFilesSource *source)
{
	source->priv = G_TYPE_INSTANCE_GET_PRIVATE (source, RB_TYPE_MISSING_FILES_SOURCE, RBMissingFilesSourcePrivate);

	rb_display_page_set_icon_name (RB_DISPLAY_PAGE (source), "dialog-warning-symbolic");
}
Ejemplo n.º 3
0
RBSource *
rb_grilo_source_new (GObject *plugin, GrlSource *grilo_source)
{
	GObject *source;
	RBShell *shell;
	GSettings *settings;
	RhythmDBEntryType *entry_type;
	RhythmDB *db;
	char *name;

	name = g_strdup_printf ("grilo:%s", grl_source_get_id (grilo_source));

	g_object_get (plugin, "object", &shell, NULL);
	g_object_get (shell, "db", &db, NULL);
	entry_type = g_object_new (rb_grilo_entry_type_get_type (),
				   "db", db,
				   "name", name,
				   "save-to-disk", FALSE,
				   "category", RHYTHMDB_ENTRY_NORMAL,
				   "type-data-size", sizeof(RBGriloEntryData),
				   NULL);
	rhythmdb_register_entry_type (db, entry_type);
	g_object_unref (db);
	g_free (name);

	settings = g_settings_new ("org.gnome.rhythmbox.plugins.grilo");
	source = g_object_new (RB_TYPE_GRILO_SOURCE,
			       "name", grl_source_get_name (grilo_source),
			       "entry-type", entry_type,
			       "shell", shell,
			       "plugin", plugin,
			       "show-browser", FALSE,
			       "settings", g_settings_get_child (settings, "source"),
			       "grilo-source", grilo_source,
			       NULL);
	g_object_unref (settings);
	rb_display_page_set_icon_name (RB_DISPLAY_PAGE (source), "network-server-symbolic");

	rb_shell_register_entry_type_for_source (shell, RB_SOURCE (source), entry_type);

	g_object_unref (shell);
	return RB_SOURCE (source);
}
Ejemplo n.º 4
0
static void
rb_mtp_source_constructed (GObject *object)
{
	RBMtpSource *source;
	RBEntryView *tracks;
	RBShell *shell;
	RBShellPlayer *shell_player;
	GObject *player_backend;

	RB_CHAIN_GOBJECT_METHOD (rb_mtp_source_parent_class, constructed, object);
	source = RB_MTP_SOURCE (object);

	tracks = rb_source_get_entry_view (RB_SOURCE (source));
	rb_entry_view_append_column (tracks, RB_ENTRY_VIEW_COL_RATING, FALSE);
	rb_entry_view_append_column (tracks, RB_ENTRY_VIEW_COL_LAST_PLAYED, FALSE);

	/* the source element needs our cooperation */
	g_object_get (source, "shell", &shell, NULL);
	g_object_get (shell, "shell-player", &shell_player, NULL);
	g_object_get (shell_player, "player", &player_backend, NULL);
	g_object_unref (shell_player);

	g_signal_connect_object (player_backend,
				 "prepare-source",
				 G_CALLBACK (prepare_player_source_cb),
				 source, 0);

	g_object_unref (player_backend);
	g_object_unref (shell);

	g_signal_connect_object (rb_encoder_factory_get (),
				 "prepare-source",
				 G_CALLBACK (prepare_encoder_source_cb),
				 source, 0);
	g_signal_connect_object (rb_encoder_factory_get (),
				 "prepare-sink",
				 G_CALLBACK (prepare_encoder_sink_cb),
				 source, 0);

	rb_display_page_set_icon_name (RB_DISPLAY_PAGE (source), "multimedia-player-symbolic");
}