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_mute_recycling.h>
21 
22 #include <ags/audio/recall/ags_mute_audio_signal.h>
23 
24 void ags_mute_recycling_class_init(AgsMuteRecyclingClass *mute_recycling);
25 void ags_mute_recycling_init(AgsMuteRecycling *mute_recycling);
26 void ags_mute_recycling_finalize(GObject *gobject);
27 
28 /**
29  * SECTION:ags_mute_recycling
30  * @short_description: mutes recycling
31  * @title: AgsMuteRecycling
32  * @section_id:
33  * @include: ags/audio/recall/ags_mute_recycling.h
34  *
35  * The #AgsMuteRecycling class mutes the recycling.
36  */
37 
38 static gpointer ags_mute_recycling_parent_class = NULL;
39 
40 GType
ags_mute_recycling_get_type()41 ags_mute_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_mute_recycling = 0;
47 
48     static const GTypeInfo ags_mute_recycling_info = {
49       sizeof (AgsMuteRecyclingClass),
50       NULL, /* base_init */
51       NULL, /* base_finalize */
52       (GClassInitFunc) ags_mute_recycling_class_init,
53       NULL, /* class_finalize */
54       NULL, /* class_data */
55       sizeof (AgsMuteRecycling),
56       0,    /* n_preallocs */
57       (GInstanceInitFunc) ags_mute_recycling_init,
58     };
59 
60     ags_type_mute_recycling = g_type_register_static(AGS_TYPE_RECALL_RECYCLING,
61 						     "AgsMuteRecycling",
62 						     &ags_mute_recycling_info,
63 						     0);
64 
65     g_once_init_leave(&g_define_type_id__volatile, ags_type_mute_recycling);
66   }
67 
68   return g_define_type_id__volatile;
69 }
70 
71 void
ags_mute_recycling_class_init(AgsMuteRecyclingClass * mute_recycling)72 ags_mute_recycling_class_init(AgsMuteRecyclingClass *mute_recycling)
73 {
74   GObjectClass *gobject;
75   AgsRecallClass *recall;
76 
77   ags_mute_recycling_parent_class = g_type_class_peek_parent(mute_recycling);
78 
79   /* GObjectClass */
80   gobject = (GObjectClass *) mute_recycling;
81 
82   gobject->finalize = ags_mute_recycling_finalize;
83 
84   /* AgsRecallClass */
85   recall = (AgsRecallClass *) mute_recycling;
86 }
87 
88 void
ags_mute_recycling_init(AgsMuteRecycling * mute_recycling)89 ags_mute_recycling_init(AgsMuteRecycling *mute_recycling)
90 {
91   AGS_RECALL(mute_recycling)->name = "ags-mute";
92   AGS_RECALL(mute_recycling)->version = AGS_RECALL_DEFAULT_VERSION;
93   AGS_RECALL(mute_recycling)->build_id = AGS_RECALL_DEFAULT_BUILD_ID;
94   AGS_RECALL(mute_recycling)->xml_type = "ags-mute-recycling";
95   AGS_RECALL(mute_recycling)->port = NULL;
96 
97   AGS_RECALL(mute_recycling)->child_type = AGS_TYPE_MUTE_AUDIO_SIGNAL;
98 }
99 
100 void
ags_mute_recycling_finalize(GObject * gobject)101 ags_mute_recycling_finalize(GObject *gobject)
102 {
103   /* call parent */
104   G_OBJECT_CLASS(ags_mute_recycling_parent_class)->finalize(gobject);
105 }
106 
107 /**
108  * ags_mute_recycling_new:
109  * @source: the #AgsRecycling
110  *
111  * Create a new instance of #AgsMuteRecycling
112  *
113  * Returns: the new #AgsMuteRecycling
114  *
115  * Since: 3.0.0
116  */
117 AgsMuteRecycling*
ags_mute_recycling_new(AgsRecycling * source)118 ags_mute_recycling_new(AgsRecycling *source)
119 {
120   AgsMuteRecycling *mute_recycling;
121 
122   mute_recycling = (AgsMuteRecycling *) g_object_new(AGS_TYPE_MUTE_RECYCLING,
123 						     "source", source,
124 						     NULL);
125 
126   return(mute_recycling);
127 }
128