2 Copyright (C) 1998-99 Paul Barton-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.
21 #include <midi++/types.h>
22 #include <midi++/factory.h>
23 #include <midi++/nullmidi.h>
24 #include <midi++/fifomidi.h>
27 #include <midi++/jack.h>
28 #endif // WITH_JACK_MIDI
31 #include <midi++/alsa_sequencer.h>
32 #include <midi++/alsa_rawmidi.h>
36 #include <midi++/coremidi_midiport.h>
37 #endif // WITH_COREMIDI
43 // FIXME: void* data pointer, filthy
45 PortFactory::create_port (PortRequest &req, void* data)
54 port = new JACK_MidiPort (req, (jack_client_t*)data);
56 #endif // WITH_JACK_MIDI
59 case Port::ALSA_RawMidi:
60 port = new ALSA_RawMidiPort (req);
63 case Port::ALSA_Sequencer:
64 port = new ALSA_SequencerMidiPort (req);
69 case Port::CoreMidi_MidiPort:
70 port = new CoreMidi_MidiPort (req);
72 #endif // WITH_COREMIDI
75 port = new Null_MidiPort (req);
79 port = new FIFO_MidiPort (req);
83 req.status = PortRequest::TypeUnsupported;
87 req.status = PortRequest::OK;
93 PortFactory::add_port_request (vector<PortRequest *> &reqs,
99 req = new PortRequest;
100 req->devname = strdup (str.c_str());
101 req->tagname = strdup (str.c_str());
104 req->type = Port::ALSA_RawMidi;
106 reqs.push_back (req);