aboutsummaryrefslogtreecommitdiffstats
path: root/daemon/src/connection_manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/src/connection_manager.h')
-rw-r--r--daemon/src/connection_manager.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/daemon/src/connection_manager.h b/daemon/src/connection_manager.h
new file mode 100644
index 0000000..240e436
--- /dev/null
+++ b/daemon/src/connection_manager.h
@@ -0,0 +1,34 @@
+#pragma once
+
+#include "types.h"
+#include "message.h"
+
+#include <functional>
+#include <string>
+#include <map>
+#include <memory>
+
+class RtMidi;
+
+namespace midi_router
+{
+
+struct Device_Connection;
+
+class Connection_Manager
+{
+public:
+ Connection_Manager(Device_Map const & device_map, std::function<void(Message const &)> const & submit);
+
+ ~Connection_Manager();
+
+private:
+ static bool
+ open_port(RtMidi* const midi, std::string const & name);
+
+ Device_Map const & m_device_map;
+ std::function<void(Message const &)> m_submit;
+ std::map<std::string, std::unique_ptr<Device_Connection>> m_connections;
+};
+
+} // namespace midi_router