1 /* GSequencer - Advanced GTK Sequencer 2 * Copyright (C) 2005-2020 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 #ifndef __AGS_EFFECT_PAD_H__ 21 #define __AGS_EFFECT_PAD_H__ 22 23 #include <glib.h> 24 #include <glib-object.h> 25 26 #include <gtk/gtk.h> 27 28 #include <ags/libags.h> 29 #include <ags/libags-audio.h> 30 31 #include <ags/libags-gui.h> 32 33 G_BEGIN_DECLS 34 35 #define AGS_TYPE_EFFECT_PAD (ags_effect_pad_get_type()) 36 #define AGS_EFFECT_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_EFFECT_PAD, AgsEffectPad)) 37 #define AGS_EFFECT_PAD_CLASS(class) (G_TYPE_CHECK_CLASS_CAST((class), AGS_TYPE_EFFECT_PAD, AgsEffectPadClass)) 38 #define AGS_IS_EFFECT_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), AGS_TYPE_EFFECT_PAD)) 39 #define AGS_IS_EFFECT_PAD_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE((class), AGS_TYPE_EFFECT_PAD)) 40 #define AGS_EFFECT_PAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), AGS_TYPE_EFFECT_PAD, AgsEffectPadClass)) 41 42 #define AGS_EFFECT_PAD_DEFAULT_VERSION "0.7.8" 43 #define AGS_EFFECT_PAD_DEFAULT_BUILD_ID "CEST 01-03-2016 00:23" 44 45 #define AGS_EFFECT_PAD_COLUMNS_COUNT (2) 46 47 typedef struct _AgsEffectPad AgsEffectPad; 48 typedef struct _AgsEffectPadClass AgsEffectPadClass; 49 50 typedef enum{ 51 AGS_EFFECT_PAD_MAPPED_RECALL = 1, 52 AGS_EFFECT_PAD_PREMAPPED_RECALL = 1 << 1, 53 AGS_EFFECT_PAD_CONNECTED = 1 << 2, 54 AGS_EFFECT_PAD_SHOW_GROUPING = 1 << 3, 55 AGS_EFFECT_PAD_GROUP_ALL = 1 << 4, 56 AGS_EFFECT_PAD_GROUP_LINE = 1 << 5, 57 }AgsEffectPadFlags; 58 59 struct _AgsEffectPad 60 { 61 GtkBox box; 62 63 guint flags; 64 65 gchar *name; 66 67 gchar *version; 68 gchar *build_id; 69 70 guint samplerate; 71 guint buffer_size; 72 guint format; 73 74 AgsChannel *channel; 75 76 guint cols; 77 GtkGrid *grid; 78 }; 79 80 struct _AgsEffectPadClass 81 { 82 GtkBoxClass box; 83 84 void (*samplerate_changed)(AgsEffectPad *effect_pad, 85 guint samplerate, guint old_samplerate); 86 void (*buffer_size_changed)(AgsEffectPad *effect_pad, 87 guint buffer_size, guint old_buffer_size); 88 void (*format_changed)(AgsEffectPad *effect_pad, 89 guint format, guint old_format); 90 91 void (*set_channel)(AgsEffectPad *effect_pad, AgsChannel *channel); 92 93 void (*resize_lines)(AgsEffectPad *effect_pad, GType line_type, 94 guint audio_channels, guint audio_channels_old); 95 96 void (*map_recall)(AgsEffectPad *effect_pad); 97 GList* (*find_port)(AgsEffectPad *effect_pad); 98 }; 99 100 GType ags_effect_pad_get_type(void); 101 102 void ags_effect_pad_samplerate_changed(AgsEffectPad *effect_pad, 103 guint samplerate, guint old_samplerate); 104 void ags_effect_pad_buffer_size_changed(AgsEffectPad *effect_pad, 105 guint buffer_size, guint old_buffer_size); 106 void ags_effect_pad_format_changed(AgsEffectPad *effect_pad, 107 guint format, guint old_format); 108 109 void ags_effect_pad_set_channel(AgsEffectPad *effect_pad, AgsChannel *channel); 110 111 void ags_effect_pad_resize_lines(AgsEffectPad *effect_pad, GType line_type, 112 guint audio_channels, guint audio_channels_old); 113 114 void ags_effect_pad_map_recall(AgsEffectPad *effect_pad); 115 GList* ags_effect_pad_find_port(AgsEffectPad *effect_pad); 116 117 AgsEffectPad* ags_effect_pad_new(AgsChannel *channel); 118 119 G_END_DECLS 120 121 #endif /*__AGS_EFFECT_PAD_H__*/ 122