diff options
author | Eddy Pedroni <epedroni@pm.me> | 2025-07-22 22:00:00 +0200 |
---|---|---|
committer | Eddy Pedroni <epedroni@pm.me> | 2025-07-22 22:00:00 +0200 |
commit | 6da14e1590935710055ebc81ba55017b457ca1ad (patch) | |
tree | 799daf6f75331183ea48ece00d62ec92f0fc7a51 /daemon/src/connection_manager.h | |
parent | f0835be9ffcae8e5c74c8fc6a0da2f7bc49343ac (diff) |
Initial daemon implementation, no routing yet
Diffstat (limited to 'daemon/src/connection_manager.h')
-rw-r--r-- | daemon/src/connection_manager.h | 34 |
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 |