2 Copyright (C) 2004 Paul Davis
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2 of the License, or
6 (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __alsa_sequencer_midiport_h__
21 #define __alsa_sequencer_midiport_h__
29 #include <alsa/asoundlib.h>
30 #include <midi++/port.h>
34 class ALSA_SequencerMidiPort : public Port
38 ALSA_SequencerMidiPort (PortRequest &req);
39 virtual ~ALSA_SequencerMidiPort ();
41 /* select(2)/poll(2)-based I/O */
43 virtual int selectable() const;
47 int write (byte *msg, size_t msglen, timestamp_t timestamp);
48 int read (byte *buf, size_t max, timestamp_t timestamp);
51 snd_midi_event_t *decoder, *encoder;
55 int CreatePorts(PortRequest &req);
57 static int init_client (std::string name);
58 static snd_seq_t* seq;
61 }; /* namespace MIDI */
63 #endif // __alsa_sequencer_midiport_h__