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.
20 #include <midi++/types.h>
21 #include <midi++/factory.h>
22 #include <midi++/nullmidi.h>
23 #include <midi++/fifomidi.h>
26 #include <midi++/alsa_sequencer.h>
27 #include <midi++/alsa_rawmidi.h>
31 #include <midi++/coremidi_midiport.h>
32 #endif // WITH_COREMIDI
39 PortFactory::create_port (PortRequest &req)
46 case Port::ALSA_RawMidi:
47 port = new ALSA_RawMidiPort (req);
50 case Port::ALSA_Sequencer:
51 port = new ALSA_SequencerMidiPort (req);
56 case Port::CoreMidi_MidiPort:
57 port = new CoreMidi_MidiPort (req);
59 #endif // WITH_COREMIDI
62 port = new Null_MidiPort (req);
66 port = new FIFO_MidiPort (req);
70 req.status = PortRequest::TypeUnsupported;
74 req.status = PortRequest::OK;
80 PortFactory::add_port_request (vector<PortRequest *> &reqs,
86 req = new PortRequest;
87 req->devname = strdup (str.c_str());
88 req->tagname = strdup (str.c_str());
91 req->type = Port::ALSA_RawMidi;