BEAST/BSE - Better Audio System and Sound Engine
0.8.2
|
00001 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html 00002 #ifndef __BSE_INSTRUMENT_H__ 00003 #define __BSE_INSTRUMENT_H__ 00004 00005 #include <bse/bseitem.hh> 00006 00007 00008 #ifdef __cplusplus 00009 extern "C" { 00010 #endif /* __cplusplus */ 00011 00012 00013 /* --- BSE type macros --- */ 00014 #define BSE_TYPE_INSTRUMENT (BSE_TYPE_ID (BseInstrument)) 00015 #define BSE_INSTRUMENT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BSE_TYPE_INSTRUMENT, BseInstrument)) 00016 #define BSE_INSTRUMENT_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), BSE_TYPE_INSTRUMENT, BseInstrumentClass)) 00017 #define BSE_IS_INSTRUMENT(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BSE_TYPE_INSTRUMENT)) 00018 #define BSE_IS_INSTRUMENT_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), BSE_TYPE_INSTRUMENT)) 00019 #define BSE_INSTRUMENT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BSE_TYPE_INSTRUMENT, BseInstrumentClass)) 00020 00021 00022 /* --- BseInstrument --- */ 00023 typedef struct _BseEnvelope BseEnvelope; 00024 typedef enum 00025 { 00026 BSE_INSTRUMENT_NONE, /*< skip >*/ 00027 BSE_INSTRUMENT_WAVE, /*< nick=Custom Wave >*/ 00028 BSE_INSTRUMENT_SYNTH_NET, /*< nick=Custom Synth Net >*/ 00029 BSE_INSTRUMENT_STANDARD_PIANO, /*< nick=Piano >*/ 00030 BSE_INSTRUMENT_LAST /*< skip >*/ 00031 } BseInstrumentType; 00032 struct _BseEnvelope 00033 { 00034 guint delay_time; 00035 guint attack_time; 00036 gfloat attack_level; 00037 guint decay_time; 00038 gfloat sustain_level; 00039 guint sustain_time; 00040 gfloat release_level; 00041 guint release_time; 00042 }; 00043 struct _BseInstrument 00044 { 00045 BseItem parent_instance; 00046 00047 BseInstrumentType type; 00048 BseWave *wave; 00049 BseSNet *user_snet; 00050 BseSNet *seq_snet; /* sequencer snet */ 00051 00052 gfloat volume_factor; 00053 gint balance; 00054 gint transpose; 00055 gint fine_tune; 00056 00057 BseEnvelope env; 00058 }; 00059 struct _BseInstrumentClass 00060 { 00061 BseItemClass parent_class; 00062 }; 00063 00064 00065 /* --- prototypes -- */ 00066 00067 00068 00069 #ifdef __cplusplus 00070 } 00071 #endif /* __cplusplus */ 00072 00073 #endif /* __BSE_INSTRUMENT_H__ */