Mercurial > hg > piper-cpp
comparison bits/PreservingPluginHandleMapper.h @ 51:f4244a2d55ac
Introduce and use output id mappers
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Fri, 16 Sep 2016 15:10:57 +0100 |
parents | 55d69b26d4db |
children | e90fd30990eb |
comparison
equal
deleted
inserted
replaced
50:12e3b396544c | 51:f4244a2d55ac |
---|---|
34 | 34 |
35 #ifndef VAMPIPE_PRESERVING_PLUGIN_HANDLE_MAPPER_H | 35 #ifndef VAMPIPE_PRESERVING_PLUGIN_HANDLE_MAPPER_H |
36 #define VAMPIPE_PRESERVING_PLUGIN_HANDLE_MAPPER_H | 36 #define VAMPIPE_PRESERVING_PLUGIN_HANDLE_MAPPER_H |
37 | 37 |
38 #include "PluginHandleMapper.h" | 38 #include "PluginHandleMapper.h" |
39 #include "PreservingPluginOutputIdMapper.h" | |
39 | 40 |
40 #include <iostream> | 41 #include <iostream> |
41 | 42 |
42 namespace vampipe { | 43 namespace vampipe { |
44 | |
45 //!!! document -- this is a passthrough thing for a single plugin | |
46 //!!! handle only, it does not use actually valid Plugin pointers at | |
47 //!!! all | |
43 | 48 |
44 class PreservingPluginHandleMapper : public PluginHandleMapper | 49 class PreservingPluginHandleMapper : public PluginHandleMapper |
45 { | 50 { |
46 public: | 51 public: |
47 PreservingPluginHandleMapper() : m_handle(0), m_plugin(0) { } | 52 PreservingPluginHandleMapper() : m_handle(0), m_plugin(0) { } |
61 m_handle = h; | 66 m_handle = h; |
62 m_plugin = reinterpret_cast<Vamp::Plugin *>(h); | 67 m_plugin = reinterpret_cast<Vamp::Plugin *>(h); |
63 return m_plugin; | 68 return m_plugin; |
64 } | 69 } |
65 | 70 |
71 virtual const PluginOutputIdMapper &pluginToOutputIdMapper(Vamp::Plugin *) const { | |
72 return m_omapper; | |
73 } | |
74 | |
75 virtual const PluginOutputIdMapper &handleToOutputIdMapper(int32_t h) const { | |
76 return m_omapper; | |
77 } | |
78 | |
66 private: | 79 private: |
67 mutable int32_t m_handle; | 80 mutable int32_t m_handle; |
68 mutable Vamp::Plugin *m_plugin; | 81 mutable Vamp::Plugin *m_plugin; |
82 PreservingPluginOutputIdMapper m_omapper; | |
69 }; | 83 }; |
70 | 84 |
71 } | 85 } |
72 | 86 |
73 #endif | 87 #endif |