1 |
/*************************************************************************** |
/*************************************************************************** |
2 |
* * |
* * |
3 |
* Copyright (C) 2007 - 2021 Christian Schoenebeck * |
* Copyright (C) 2007 - 2022 Christian Schoenebeck * |
4 |
* * |
* * |
5 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
6 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
34 |
createInstrumentEditorInnerFactory() { \ |
createInstrumentEditorInnerFactory() { \ |
35 |
return new LinuxSampler::InstrumentEditorFactory::InnerFactoryTemplate<PluginClass>(); \ |
return new LinuxSampler::InstrumentEditorFactory::InnerFactoryTemplate<PluginClass>(); \ |
36 |
} |
} |
37 |
|
//FIXME: missing a destruction function for Windows |
38 |
|
|
39 |
|
//NOTE: using Windows' DllMain() API callback function is probably not a |
40 |
|
// viable alternative, as that callback is too limited of what is allowed |
41 |
|
// to do (e.g. Windows prohibits any thread synchronization mechanisms) |
42 |
#else |
#else |
43 |
# define REGISTER_INSTRUMENT_EDITOR(PluginClass) \ |
# define REGISTER_INSTRUMENT_EDITOR(PluginClass) \ |
44 |
LinuxSampler::InstrumentEditorFactory::InnerFactoryRegistrator<PluginClass> \ |
LinuxSampler::InstrumentEditorFactory::InnerFactoryRegistrator<PluginClass> \ |
85 |
} |
} |
86 |
|
|
87 |
~InnerFactoryRegistrator() { |
~InnerFactoryRegistrator() { |
88 |
|
//FIXME: potential race with ClosePlugins() |
89 |
|
// (see comments in the latter for details) |
90 |
InnerFactoryTemplate<PluginClass_T> innerFactory; |
InnerFactoryTemplate<PluginClass_T> innerFactory; |
91 |
InstrumentEditor* pEditor = innerFactory.Create(); |
InstrumentEditor* pEditor = innerFactory.Create(); |
92 |
if (InnerFactories.count(pEditor->Name())) { |
if (InnerFactories.count(pEditor->Name())) { |