Ardour  9.0-pre0-384-ga76afae0e9
mackie/surface_port.h
Go to the documentation of this file.
1 /*
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>
5  *
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.
10  *
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.
15  *
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.
19  */
20 #ifndef surface_port_h
21 #define surface_port_h
22 
23 #include <midi++/types.h>
24 
25 #include "pbd/signals.h"
26 #include "pbd/xml++.h"
27 
28 #include "midi_byte_array.h"
29 #include "types.h"
30 
31 namespace MIDI {
32  class Parser;
33  class Port;
34 }
35 
36 namespace ARDOUR {
37  class AsyncMIDIPort;
38  class Port;
39 }
40 
41 namespace ArdourSurface { namespace MACKIE_NAMESPACE {
42 
43 class MackieControlProtocol;
44 class Surface;
45 
51 {
52  public:
54  virtual ~SurfacePort();
55 
57  int write (const MidiByteArray&);
58 
59  MIDI::Port& input_port() const { return *_input_port; }
60  MIDI::Port& output_port() const { return *_output_port; }
61 
62  ARDOUR::Port& input() const { return *_async_in; }
63  ARDOUR::Port& output() const { return *_async_out; }
64 
65  std::string input_name() const;
66  std::string output_name() const;
67 
68  void reconnect ();
69 
70  XMLNode& get_state () const;
71  int set_state (const XMLNode&, int version);
72 
73  protected:
74 
75  private:
79  std::shared_ptr<ARDOUR::Port> _async_in;
80  std::shared_ptr<ARDOUR::Port> _async_out;
81 };
82 
83 std::ostream& operator << (std::ostream& , const SurfacePort& port);
84 
85 }
86 }
87 
88 #endif
std::shared_ptr< ARDOUR::Port > _async_in
std::shared_ptr< ARDOUR::Port > _async_out
int write(const MidiByteArray &)
an easier way to output bytes via midi
int set_state(const XMLNode &, int version)
Definition: xml++.h:114
std::ostream & operator<<(std::ostream &, const SurfacePort &port)
#define MACKIE_NAMESPACE