diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-07-19 18:21:58 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-07-19 18:21:58 +0000 |
commit | 47add43cd028855cda2292bef9dcde607f948490 (patch) | |
tree | beeabf195c19b89322079d391670dfaa95325d3a /libs/midi++2/midifactory.cc | |
parent | fdfa8a0d9372693eab36428829dd23866f5f8b4b (diff) |
new functionality to add MIDI ports from the options editor, not totally finished but functional
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2152 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/midi++2/midifactory.cc')
-rw-r--r-- | libs/midi++2/midifactory.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libs/midi++2/midifactory.cc b/libs/midi++2/midifactory.cc index 0a86c94cb9..0912c8ae7b 100644 --- a/libs/midi++2/midifactory.cc +++ b/libs/midi++2/midifactory.cc @@ -17,6 +17,8 @@ $Id$ */ +#include <pbd/error.h> + #include <midi++/types.h> #include <midi++/factory.h> #include <midi++/nullmidi.h> @@ -101,3 +103,32 @@ PortFactory::ignore_duplicate_devices (Port::Type type) return ret; } +int +PortFactory::get_known_ports (vector<PortSet>& ports) +{ + int n = 0; +#ifdef WITH_ALSA + n += ALSA_SequencerMidiPort::discover (ports); +#endif // WITH_ALSA + +#if WITH_COREMIDI + n += CoreMidi_MidiPort::discover (ports); +#endif // WITH_COREMIDI + + return n; +} + +std::string +PortFactory::default_port_type () +{ + +#ifdef WITH_ALSA + return "alsa/sequencer"; +#endif + +#ifdef WITH_COREMIDI + return "coremidi"; +#endif // WITH_COREMIDI + + PBD::fatal << "programming error: no default port type defined in midifactory.cc" << endmsg; +} |