2 * Copyright (C) 2006-2007 John Anderson
3 * Copyright (C) 2008-2015 Paul Davis <paul@linuxaudiosystems.com>
4 * Copyright (C) 2010-2011 Carl Hetherington <carl@carlh.net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #ifndef surface_port_h
21 #define surface_port_h
23 #include <midi++/types.h>
25 #include "pbd/signals.h"
28 #include "midi_byte_array.h"
42 namespace ArdourSurface {
44 class MackieControlProtocol;
52 Make a relationship between a midi port and a Mackie device.
58 SurfacePort (Mackie::Surface&);
59 virtual ~SurfacePort();
61 /// an easier way to output bytes via midi
62 int write (const MidiByteArray&);
64 MIDI::Port& input_port() const { return *_input_port; }
65 MIDI::Port& output_port() const { return *_output_port; }
67 ARDOUR::Port& input() const { return *_async_in; }
68 ARDOUR::Port& output() const { return *_async_out; }
70 std::string input_name() const;
71 std::string output_name() const;
75 XMLNode& get_state ();
76 int set_state (const XMLNode&, int version);
81 Mackie::Surface* _surface;
82 MIDI::Port* _input_port;
83 MIDI::Port* _output_port;
84 boost::shared_ptr<ARDOUR::Port> _async_in;
85 boost::shared_ptr<ARDOUR::Port> _async_out;
88 std::ostream& operator << (std::ostream& , const SurfacePort& port);