2 Copyright (C) 1998 Paul Barton-Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __midiport_manager_h__
21 #define __midiport_manager_h__
29 #include "midi++/types.h"
30 #include "midi++/port.h"
32 #include "ardour/libardour_visibility.h"
33 #include "ardour/midi_port.h"
34 #include "ardour/types.h"
41 class LIBARDOUR_API MidiPortManager {
44 virtual ~MidiPortManager ();
46 /* Ports used for control. These are read/written to outside of the
47 * process callback (asynchronously with respect to when data
50 * More detail: we do actually read/write data for these ports
51 * inside the process callback, but incoming data is only parsed
52 * and outgoing data is only generated *outside* the process
56 boost::shared_ptr<ARDOUR::Port> midi_input_port () const { return _midi_in; }
57 boost::shared_ptr<ARDOUR::Port> midi_output_port () const { return _midi_out; }
59 boost::shared_ptr<ARDOUR::Port> mmc_input_port() const { return boost::dynamic_pointer_cast<MidiPort>(_mmc_in); }
60 boost::shared_ptr<ARDOUR::Port> mmc_output_port() const { return boost::dynamic_pointer_cast<MidiPort>(_mmc_out); }
62 boost::shared_ptr<ARDOUR::Port> scene_input_port() const { return boost::dynamic_pointer_cast<MidiPort>(_scene_in); }
63 boost::shared_ptr<ARDOUR::Port> scene_output_port() const { return boost::dynamic_pointer_cast<MidiPort>(_scene_out); }
65 /* Ports used to send synchronization. These have their output handled inside the
69 boost::shared_ptr<MidiPort> mtc_output_port() const { return _mtc_output_port; }
70 boost::shared_ptr<MidiPort> midi_clock_output_port() const { return _midi_clock_output_port; }
72 void set_midi_port_states (const XMLNodeList&);
73 std::list<XMLNode*> get_midi_port_states () const;
75 PBD::Signal0<void> PortsChanged;
78 /* asynchronously handled ports: ARDOUR::AsyncMIDIPort */
79 boost::shared_ptr<Port> _midi_in;
80 boost::shared_ptr<Port> _midi_out;
81 boost::shared_ptr<Port> _mmc_in;
82 boost::shared_ptr<Port> _mmc_out;
83 boost::shared_ptr<Port> _scene_in;
84 boost::shared_ptr<Port> _scene_out;
86 /* synchronously handled ports: ARDOUR::MidiPort */
87 boost::shared_ptr<MidiPort> _mtc_output_port;
88 boost::shared_ptr<MidiPort> _midi_clock_output_port;
96 #endif // __midi_port_manager_h__