2 terminatorX - realtime audio scratching software
3 Copyright (C) 2002 Arthur Peters
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 Description: Header to tX_midiin.cc
23 Changes (Alexander König <alex@lisas.de>:
24 - Default Constructor for tX_midievents
25 - new handlers for destroy and remove binding events
29 #define _tx_midiin_h 1
32 #include <libxml/xmlmemory.h>
33 #include <libxml/parser.h>
34 #include <libxml/encoding.h>
53 int number; // note # or controller #
55 float value; // controller value or note velocity
56 bool is_noteon; // note on or off?
58 bool type_matches( const tX_midievent& other ) const
60 return channel == other.channel && type == other.type && number == other.number;
69 tX_midievent() : channel(0), type(NONE), number(0), value(0.0), is_noteon(false) {}
73 #ifdef USE_ALSA_MIDI_IN
75 #include <alsa/asoundlib.h>
80 snd_seq_t *ALSASeqHandle;
81 tX_midievent last_event;
83 tX_seqpar *sp_to_learn;
84 GtkWidget *learn_dialog;
97 void configure_bindings( vtt_class* );
99 const tX_midievent& get_last_event()
104 void set_midi_learn_sp(tX_seqpar *);
105 void cancel_midi_learn();
106 void store_connections(FILE *rc, char *indent);
107 void restore_connections(xmlNodePtr node);
109 static gboolean midi_learn_cancel(GtkWidget *, tX_midiin *);
110 static gboolean midi_learn_destroy(GtkWidget *, tX_midiin *);
114 class midi_binding_gui
117 midi_binding_gui( GtkTreeModel* _model, tX_midiin* _midi );
122 GtkWidget *parameter_treeview;
123 GtkWidget *midi_event_info;
124 GtkWidget *bind_button;
130 tX_midievent last_event;
132 static void window_closed( GtkWidget *widget, gpointer _this );
133 static void unbind_clicked( GtkButton *button, gpointer _this );
134 static void bind_clicked( GtkButton *button, gpointer _this );
135 static void close_clicked( GtkButton *button, gpointer _this );
136 static gint timer( gpointer _this );
145 #endif // USE_ALSA_MIDI_IN
147 #endif // ndef _tx_midiin_h