remove a couple of boost::signals2 trouble spots; fix some --strict compile time...
[ardour.git] / libs / ardour / ardour / midi_ui.h
1 #ifndef __libardour_midi_ui_h__
2 #define __libardour_midi_ui_h__
3
4 #include <list>
5 #include <boost/signals2.hpp>
6 #include "pbd/abstract_ui.h"
7 #include "pbd/signals.h"
8
9 namespace MIDI { 
10         class Port;
11 }
12
13 namespace ARDOUR {
14
15 class Session;
16
17 /* this is mostly a placeholder because I suspect that at some
18    point we will want to add more members to accomodate
19    certain types of requests to the MIDI UI
20 */
21
22 struct MidiUIRequest : public BaseUI::BaseRequestObject {
23   public:
24         MidiUIRequest () {}
25         ~MidiUIRequest() {}
26 };
27
28 class MidiControlUI : public AbstractUI<MidiUIRequest>
29 {
30   public:
31         MidiControlUI (Session& s);
32         ~MidiControlUI ();
33         
34         static BaseUI::RequestType PortChange;
35         
36         void change_midi_ports ();
37         
38   protected:
39         void thread_init ();
40         void do_request (MidiUIRequest*);
41         
42   private:
43         typedef std::list<GSource*> PortSources;
44         PortSources port_sources;
45         ARDOUR::Session& _session;
46         PBD::ScopedConnection rebind_connection;
47
48         bool midi_input_handler (Glib::IOCondition, MIDI::Port*);
49         void reset_ports ();
50         void clear_ports ();
51 };
52
53 }
54
55 #endif /* __libardour_midi_ui_h__ */