1 /* GSequencer - Advanced GTK Sequencer
2  * Copyright (C) 2005-2019 Joël Krähemann
3  *
4  * This file is part of GSequencer.
5  *
6  * GSequencer 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 3 of the License, or
9  * (at your option) any later version.
10  *
11  * GSequencer is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with GSequencer.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #include <ags/audio/recall/ags_volume_recycling.h>
21 
22 #include <ags/audio/recall/ags_volume_audio_signal.h>
23 
24 void ags_volume_recycling_class_init(AgsVolumeRecyclingClass *volume_recycling);
25 void ags_volume_recycling_init(AgsVolumeRecycling *volume_recycling);
26 void ags_volume_recycling_finalize(GObject *gobject);
27 
28 /**
29  * SECTION:ags_volume_recycling
30  * @short_description: volumes recycling
31  * @title: AgsVolumeRecycling
32  * @section_id:
33  * @include: ags/audio/recall/ags_volume_recycling.h
34  *
35  * The #AgsVolumeRecycling class volumes the recycling.
36  */
37 
38 static gpointer ags_volume_recycling_parent_class = NULL;
39 
40 GType
ags_volume_recycling_get_type()41 ags_volume_recycling_get_type()
42 {
43   static volatile gsize g_define_type_id__volatile = 0;
44 
45   if(g_once_init_enter (&g_define_type_id__volatile)){
46     GType ags_type_volume_recycling = 0;
47 
48     static const GTypeInfo ags_volume_recycling_info = {
49       sizeof (AgsVolumeRecyclingClass),
50       NULL, /* base_init */
51       NULL, /* base_finalize */
52       (GClassInitFunc) ags_volume_recycling_class_init,
53       NULL, /* class_finalize */
54       NULL, /* class_data */
55       sizeof (AgsVolumeRecycling),
56       0,    /* n_preallocs */
57       (GInstanceInitFunc) ags_volume_recycling_init,
58     };
59 
60     ags_type_volume_recycling = g_type_register_static(AGS_TYPE_RECALL_RECYCLING,
61 						       "AgsVolumeRecycling",
62 						       &ags_volume_recycling_info,
63 						       0);
64 
65     g_once_init_leave(&g_define_type_id__volatile, ags_type_volume_recycling);
66   }
67 
68   return g_define_type_id__volatile;
69 }
70 
71 void
ags_volume_recycling_class_init(AgsVolumeRecyclingClass * volume_recycling)72 ags_volume_recycling_class_init(AgsVolumeRecyclingClass *volume_recycling)
73 {
74   GObjectClass *gobject;
75 
76   ags_volume_recycling_parent_class = g_type_class_peek_parent(volume_recycling);
77 
78   /* GObjectClass */
79   gobject = (GObjectClass *) volume_recycling;
80 
81   gobject->finalize = ags_volume_recycling_finalize;
82 }
83 
84 void
ags_volume_recycling_init(AgsVolumeRecycling * volume_recycling)85 ags_volume_recycling_init(AgsVolumeRecycling *volume_recycling)
86 {
87   AGS_RECALL(volume_recycling)->name = "ags-volume";
88   AGS_RECALL(volume_recycling)->version = AGS_RECALL_DEFAULT_VERSION;
89   AGS_RECALL(volume_recycling)->build_id = AGS_RECALL_DEFAULT_BUILD_ID;
90   AGS_RECALL(volume_recycling)->xml_type = "ags-volume-recycling";
91   AGS_RECALL(volume_recycling)->port = NULL;
92 
93   AGS_RECALL(volume_recycling)->child_type = AGS_TYPE_VOLUME_AUDIO_SIGNAL;
94 
95   AGS_RECALL_RECYCLING(volume_recycling)->flags |= (AGS_RECALL_RECYCLING_MAP_CHILD_SOURCE);
96 }
97 
98 void
ags_volume_recycling_finalize(GObject * gobject)99 ags_volume_recycling_finalize(GObject *gobject)
100 {
101   /* call parent */
102   G_OBJECT_CLASS(ags_volume_recycling_parent_class)->finalize(gobject);
103 }
104 
105 /**
106  * ags_volume_recycling_new:
107  * @source: the #AgsRecycling
108  *
109  * Create a new instance of #AgsVolumeRecycling
110  *
111  * Returns: the new #AgsVolumeRecycling
112  *
113  * Since: 3.0.0
114  */
115 AgsVolumeRecycling*
ags_volume_recycling_new(AgsRecycling * source)116 ags_volume_recycling_new(AgsRecycling *source)
117 {
118   AgsVolumeRecycling *volume_recycling;
119 
120   volume_recycling = (AgsVolumeRecycling *) g_object_new(AGS_TYPE_VOLUME_RECYCLING,
121 							 "source", source,
122 							 NULL);
123 
124   return(volume_recycling);
125 }
126 
127