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_LED_ARRAY_H__ 21 #define __AGS_LED_ARRAY_H__ 22 23 #include <glib.h> 24 #include <glib-object.h> 25 26 #include <gtk/gtk.h> 27 28 #include "ags_led.h" 29 30 G_BEGIN_DECLS 31 32 #define AGS_TYPE_LED_ARRAY (ags_led_array_get_type()) 33 #define AGS_LED_ARRAY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_LED_ARRAY, AgsLedArray)) 34 #define AGS_LED_ARRAY_CLASS(class) (G_TYPE_CHECK_CLASS_CAST((class), AGS_TYPE_LED_ARRAY, AgsLedArrayClass)) 35 #define AGS_IS_LED_ARRAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), AGS_TYPE_LED_ARRAY)) 36 #define AGS_IS_LED_ARRAY_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE((class), AGS_TYPE_LED_ARRAY)) 37 #define AGS_LED_ARRAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), AGS_TYPE_LED_ARRAY, AgsLedArrayClass)) 38 39 #define AGS_LED_ARRAY_DEFAULT_LED_WIDTH (10) 40 #define AGS_LED_ARRAY_DEFAULT_LED_HEIGHT (10) 41 42 typedef struct _AgsLedArray AgsLedArray; 43 typedef struct _AgsLedArrayClass AgsLedArrayClass; 44 45 typedef enum{ 46 AGS_LED_ARRAY_ACTIVE = 1, 47 }AgsLedArrayFlags; 48 49 struct _AgsLedArray 50 { 51 GtkBin bin; 52 53 guint flags; 54 55 GtkBox *box; 56 57 guint led_width; 58 guint led_height; 59 60 AgsLed **led; 61 guint led_count; 62 }; 63 64 struct _AgsLedArrayClass 65 { 66 GtkBinClass bin; 67 }; 68 69 GType ags_led_array_get_type(void); 70 71 /* properties */ 72 guint ags_led_array_get_led_width(AgsLedArray *led_array); 73 void ags_led_array_set_led_width(AgsLedArray *led_array, 74 guint led_width); 75 76 guint ags_led_array_get_led_height(AgsLedArray *led_array); 77 void ags_led_array_set_led_height(AgsLedArray *led_array, 78 guint led_height); 79 80 guint ags_led_array_get_led_count(AgsLedArray *led_array); 81 void ags_led_array_set_led_count(AgsLedArray *led_array, 82 guint led_count); 83 84 /* control */ 85 void ags_led_array_unset_all(AgsLedArray *led_array); 86 void ags_led_array_set_nth(AgsLedArray *led_array, 87 guint nth); 88 89 /* instantiate */ 90 AgsLedArray* ags_led_array_new(); 91 92 G_END_DECLS 93 94 #endif /*__AGS_LED_ARRAY_H__*/ 95