2006-12-12 James Livingston <doclivingston@gmail.com>
[rhythmbox.git] / metadata / sj-metadata.c
blobeba3066cf9c25d29b7788308ceaf1ba212501301
1 /*
2 * sj-metadata.c
3 * Copyright (C) 2003 Ross Burton <ross@burtonini.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 #include <glib-object.h>
22 #include "sj-metadata.h"
23 #include "sj-metadata-marshal.h"
25 enum {
26 METADATA,
27 LAST_SIGNAL
30 static int signals[LAST_SIGNAL] = { 0 };
32 static void
33 sj_metadata_base_init (gpointer g_class)
35 static gboolean initialized = FALSE;
36 if (!initialized) {
37 signals[METADATA] = g_signal_new ("metadata",
38 G_TYPE_FROM_CLASS (g_class),
39 G_SIGNAL_RUN_LAST,
40 G_STRUCT_OFFSET (SjMetadataClass, metadata),
41 NULL, NULL,
42 metadata_marshal_VOID__POINTER_POINTER,
43 G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
44 initialized = TRUE;
48 GType
49 sj_metadata_get_type (void)
51 static GType type = 0;
52 if (type == 0) {
53 static const GTypeInfo info = {
54 sizeof (SjMetadataClass), /* class_size */
55 sj_metadata_base_init, /* base_init */
56 NULL, /* base_finalize */
57 NULL,
58 NULL, /* class_finalize */
59 NULL, /* class_data */
61 0, /* n_preallocs */
62 NULL,
63 NULL
66 type = g_type_register_static (G_TYPE_INTERFACE, "SjMetadata", &info, 0);
67 g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
69 return type;
72 GError *
73 sj_metadata_get_new_error (SjMetadata *metadata)
75 return SJ_METADATA_GET_CLASS (metadata)->get_new_error (metadata);
78 void
79 sj_metadata_set_cdrom (SjMetadata *metadata, const char* device)
81 SJ_METADATA_GET_CLASS (metadata)->set_cdrom (metadata, device);
84 void
85 sj_metadata_set_proxy (SjMetadata *metadata, const char* proxy)
87 SJ_METADATA_GET_CLASS (metadata)->set_proxy (metadata, proxy);
90 void
91 sj_metadata_set_proxy_port (SjMetadata *metadata, const int proxy_port)
93 SJ_METADATA_GET_CLASS (metadata)->set_proxy_port (metadata, proxy_port);
96 void
97 sj_metadata_list_albums (SjMetadata *metadata, GError **error)
99 SJ_METADATA_GET_CLASS (metadata)->list_albums (metadata, error);
102 char *
103 sj_metadata_get_submit_url (SjMetadata *metadata)
105 if (SJ_METADATA_GET_CLASS (metadata)->get_submit_url)
106 return SJ_METADATA_GET_CLASS (metadata)->get_submit_url (metadata);
107 else
108 return NULL;