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_copy_channel_run.h>
21
22 #include <ags/audio/recall/ags_copy_recycling.h>
23
24 #include <stdlib.h>
25 #include <stdio.h>
26
27 void ags_copy_channel_run_class_init(AgsCopyChannelRunClass *copy_channel_run);
28 void ags_copy_channel_run_init(AgsCopyChannelRun *copy_channel_run);
29 void ags_copy_channel_run_finalize(GObject *gobject);
30
31 /**
32 * SECTION:ags_copy_channel_run
33 * @short_description: copy channel
34 * @title: AgsCopyChannelRun
35 * @section_id:
36 * @include: ags/audio/recall/ags_copy_channel_run.h
37 *
38 * The #AgsCopyChannelRun class copies the channel.
39 */
40
41 static gpointer ags_copy_channel_run_parent_class = NULL;
42
43 GType
ags_copy_channel_run_get_type()44 ags_copy_channel_run_get_type()
45 {
46 static volatile gsize g_define_type_id__volatile = 0;
47
48 if(g_once_init_enter (&g_define_type_id__volatile)){
49 GType ags_type_copy_channel_run = 0;
50
51 static const GTypeInfo ags_copy_channel_run_info = {
52 sizeof(AgsCopyChannelRunClass),
53 NULL, /* base_init */
54 NULL, /* base_finalize */
55 (GClassInitFunc) ags_copy_channel_run_class_init,
56 NULL, /* class_finalize */
57 NULL, /* class_data */
58 sizeof(AgsCopyChannelRun),
59 0, /* n_preallocs */
60 (GInstanceInitFunc) ags_copy_channel_run_init,
61 };
62
63 ags_type_copy_channel_run = g_type_register_static(AGS_TYPE_RECALL_CHANNEL_RUN,
64 "AgsCopyChannelRun",
65 &ags_copy_channel_run_info,
66 0);
67
68 g_once_init_leave(&g_define_type_id__volatile, ags_type_copy_channel_run);
69 }
70
71 return g_define_type_id__volatile;
72 }
73
74 void
ags_copy_channel_run_class_init(AgsCopyChannelRunClass * copy_channel_run)75 ags_copy_channel_run_class_init(AgsCopyChannelRunClass *copy_channel_run)
76 {
77 GObjectClass *gobject;
78
79 ags_copy_channel_run_parent_class = g_type_class_peek_parent(copy_channel_run);
80
81 /* GObjectClass */
82 gobject = (GObjectClass *) copy_channel_run;
83
84 gobject->finalize = ags_copy_channel_run_finalize;
85 }
86
87 void
ags_copy_channel_run_init(AgsCopyChannelRun * copy_channel_run)88 ags_copy_channel_run_init(AgsCopyChannelRun *copy_channel_run)
89 {
90 ags_recall_set_ability_flags((AgsRecall *) copy_channel_run, (AGS_SOUND_ABILITY_SEQUENCER |
91 AGS_SOUND_ABILITY_NOTATION |
92 AGS_SOUND_ABILITY_WAVE |
93 AGS_SOUND_ABILITY_MIDI));
94
95 AGS_RECALL(copy_channel_run)->name = "ags-copy";
96 AGS_RECALL(copy_channel_run)->version = AGS_RECALL_DEFAULT_VERSION;
97 AGS_RECALL(copy_channel_run)->build_id = AGS_RECALL_DEFAULT_BUILD_ID;
98 AGS_RECALL(copy_channel_run)->xml_type = "ags-copy-channel-run";
99 AGS_RECALL(copy_channel_run)->port = NULL;
100
101 AGS_RECALL(copy_channel_run)->child_type = AGS_TYPE_COPY_RECYCLING;
102 }
103
104 void
ags_copy_channel_run_finalize(GObject * gobject)105 ags_copy_channel_run_finalize(GObject *gobject)
106 {
107 /* call parent */
108 G_OBJECT_CLASS(ags_copy_channel_run_parent_class)->finalize(gobject);
109 }
110
111 /**
112 * ags_copy_channel_run_new:
113 * @destination: the destination #AgsChannel
114 * @source: the source #AgsChannel
115 *
116 * Create a new instance of #AgsCopyChannelRun
117 *
118 * Returns: the new #AgsCopyChannelRun
119 *
120 * Since: 3.0.0
121 */
122 AgsCopyChannelRun*
ags_copy_channel_run_new(AgsChannel * destination,AgsChannel * source)123 ags_copy_channel_run_new(AgsChannel *destination,
124 AgsChannel *source)
125 {
126 AgsCopyChannelRun *copy_channel_run;
127
128 copy_channel_run = (AgsCopyChannelRun *) g_object_new(AGS_TYPE_COPY_CHANNEL_RUN,
129 "destination", destination,
130 "source", source,
131 NULL);
132
133 return(copy_channel_run);
134 }
135