hythmbox-2.98/plugins/daap/rb-daap-record-factory.c

No issues found

 1 /*
 2  *  RBDAAPRecord factory class
 3  *
 4  *  Copyright (C) 2008 W. Michael Petullo <mike@flyn.org>
 5  *
 6  *  This program is free software; you can redistribute it and/or modify
 7  *  it under the terms of the GNU General Public License as published by
 8  *  the Free Software Foundation; either version 2 of the License, or
 9  *  (at your option) any later version.
10  *
11  *  The Rhythmbox authors hereby grant permission for non-GPL compatible
12  *  GStreamer plugins to be used and distributed together with GStreamer
13  *  and Rhythmbox. This permission is above and beyond the permissions granted
14  *  by the GPL license by which Rhythmbox is covered. If you modify this code
15  *  you may extend this exception to your version of the code, but you are not
16  *  obligated to do so. If you do not wish to do so, delete this exception
17  *  statement from your version.
18  *
19  *  This program is distributed in the hope that it will be useful,
20  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  *  GNU General Public License for more details.
23  *
24  *  You should have received a copy of the GNU General Public License
25  *  along with this program; if not, write to the Free Software
26  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
27  *
28  */
29 
30 #include "rhythmdb.h"
31 #include "rb-daap-record-factory.h"
32 #include "rb-daap-record.h"
33 
34 DMAPRecord *
35 rb_daap_record_factory_create  (DMAPRecordFactory *factory,
36 				gpointer user_data)
37 {
38 	DAAPRecord *record;
39 
40 	record = DAAP_RECORD (rb_daap_record_new ((RhythmDBEntry *) user_data));
41 
42 	return (DMAP_RECORD (record));
43 }
44 
45 static void
46 rb_daap_record_factory_init (RBDAAPRecordFactory *factory)
47 {
48 }
49 
50 static void
51 rb_daap_record_factory_class_init (RBDAAPRecordFactoryClass *klass)
52 {
53 }
54 
55 static void
56 rb_daap_record_factory_class_finalize (RBDAAPRecordFactoryClass *klass)
57 {
58 }
59 
60 static void
61 rb_daap_record_factory_interface_init (gpointer iface, gpointer data)
62 {
63 	DMAPRecordFactoryIface *factory = iface;
64 
65 	g_assert (G_TYPE_FROM_INTERFACE (factory) == DMAP_TYPE_RECORD_FACTORY);
66 
67 	factory->create = rb_daap_record_factory_create;
68 }
69 
70 G_DEFINE_DYNAMIC_TYPE_EXTENDED (RBDAAPRecordFactory,
71 				rb_daap_record_factory,
72 				G_TYPE_OBJECT,
73 				0,
74 				G_IMPLEMENT_INTERFACE_DYNAMIC (DMAP_TYPE_RECORD_FACTORY,
75 							       rb_daap_record_factory_interface_init))
76 
77 RBDAAPRecordFactory *
78 rb_daap_record_factory_new (void)
79 {
80 	RBDAAPRecordFactory *factory;
81 
82 	factory = RB_DAAP_RECORD_FACTORY (g_object_new (RB_TYPE_DAAP_RECORD_FACTORY, NULL));
83 
84 	return factory;
85 }
86 
87 void
88 _rb_daap_record_factory_register_type (GTypeModule *module)
89 {
90 	rb_daap_record_factory_register_type (module);
91 }