~serge-hallyn/ubuntu/precise/rhythmbox/rhythmbox-sort

« back to all changes in this revision

Viewing changes to metadata/sj-metadata.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2005-12-02 19:23:18 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051202192318-7ayjionj59dq1wk4
Tags: 0.9.2-0ubuntu3
* debian/control.in:
  - Build-Depends on libmusicbrainz4-dev so rhythmbox does the CD 
    query on internet (Ubuntu: #20363).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * sj-metadata.c
 
3
 * Copyright (C) 2003 Ross Burton <ross@burtonini.com>
 
4
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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.
 
19
 */
 
20
 
 
21
#include <glib-object.h>
 
22
#include "sj-metadata.h"
 
23
#include "sj-metadata-marshal.h"
 
24
 
 
25
enum {
 
26
  METADATA,
 
27
  LAST_SIGNAL
 
28
};
 
29
 
 
30
static int signals[LAST_SIGNAL] = { 0 };
 
31
 
 
32
static void
 
33
sj_metadata_base_init (gpointer g_class)
 
34
{
 
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;
 
45
  }
 
46
}
 
47
 
 
48
GType
 
49
sj_metadata_get_type (void)
 
50
{
 
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 */
 
60
      0,
 
61
      0,              /* n_preallocs */
 
62
      NULL,
 
63
      NULL
 
64
    };
 
65
    
 
66
    type = g_type_register_static (G_TYPE_INTERFACE, "SjMetadata", &info, 0);
 
67
    g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
 
68
  }
 
69
  return type;
 
70
}
 
71
 
 
72
GError *
 
73
sj_metadata_get_new_error (SjMetadata *metadata)
 
74
{
 
75
  return SJ_METADATA_GET_CLASS (metadata)->get_new_error (metadata);
 
76
}
 
77
 
 
78
void
 
79
sj_metadata_set_cdrom (SjMetadata *metadata, const char* device)
 
80
{
 
81
  SJ_METADATA_GET_CLASS (metadata)->set_cdrom (metadata, device);
 
82
}
 
83
 
 
84
void
 
85
sj_metadata_set_proxy (SjMetadata *metadata, const char* proxy)
 
86
{
 
87
  SJ_METADATA_GET_CLASS (metadata)->set_proxy (metadata, proxy);
 
88
}
 
89
 
 
90
void
 
91
sj_metadata_set_proxy_port (SjMetadata *metadata, const int proxy_port)
 
92
{
 
93
  SJ_METADATA_GET_CLASS (metadata)->set_proxy_port (metadata, proxy_port);
 
94
}
 
95
 
 
96
void
 
97
sj_metadata_list_albums (SjMetadata *metadata, GError **error)
 
98
{
 
99
  SJ_METADATA_GET_CLASS (metadata)->list_albums (metadata, error);
 
100
}