Skip to content

Commit

Permalink
* Fixed compilation on modern compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
sadko4u committed Oct 9, 2024
1 parent e2cbdba commit 63a98ff
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 40 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*******************************************************************************

=== 1.0.22 ===

* Fixed compilation on modern compilers.

=== 1.0.21 ===
* Added support of sidechain passed by shared memory link.
Expand Down
81 changes: 42 additions & 39 deletions src/main/plug/mb_gate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,48 +38,51 @@ namespace lsp
{
//-------------------------------------------------------------------------
// Plugin factory
typedef struct plugin_settings_t
inline namespace
{
const meta::plugin_t *metadata;
bool sc;
uint8_t mode;
} plugin_settings_t;
typedef struct plugin_settings_t
{
const meta::plugin_t *metadata;
bool sc;
uint8_t mode;
} plugin_settings_t;

static const meta::plugin_t *plugins[] =
{
&meta::mb_gate_mono,
&meta::mb_gate_stereo,
&meta::mb_gate_lr,
&meta::mb_gate_ms,
&meta::sc_mb_gate_mono,
&meta::sc_mb_gate_stereo,
&meta::sc_mb_gate_lr,
&meta::sc_mb_gate_ms
};

static const plugin_settings_t plugin_settings[] =
{
{ &meta::mb_gate_mono, false, mb_gate::MBGM_MONO },
{ &meta::mb_gate_stereo, false, mb_gate::MBGM_STEREO },
{ &meta::mb_gate_lr, false, mb_gate::MBGM_LR },
{ &meta::mb_gate_ms, false, mb_gate::MBGM_MS },
{ &meta::sc_mb_gate_mono, true, mb_gate::MBGM_MONO },
{ &meta::sc_mb_gate_stereo, true, mb_gate::MBGM_STEREO },
{ &meta::sc_mb_gate_lr, true, mb_gate::MBGM_LR },
{ &meta::sc_mb_gate_ms, true, mb_gate::MBGM_MS },

{ NULL, 0, false }
};

static plug::Module *plugin_factory(const meta::plugin_t *meta)
{
for (const plugin_settings_t *s = plugin_settings; s->metadata != NULL; ++s)
if (s->metadata == meta)
return new mb_gate(s->metadata, s->sc, s->mode);
return NULL;
}
static const meta::plugin_t *plugins[] =
{
&meta::mb_gate_mono,
&meta::mb_gate_stereo,
&meta::mb_gate_lr,
&meta::mb_gate_ms,
&meta::sc_mb_gate_mono,
&meta::sc_mb_gate_stereo,
&meta::sc_mb_gate_lr,
&meta::sc_mb_gate_ms
};

static const plugin_settings_t plugin_settings[] =
{
{ &meta::mb_gate_mono, false, mb_gate::MBGM_MONO },
{ &meta::mb_gate_stereo, false, mb_gate::MBGM_STEREO },
{ &meta::mb_gate_lr, false, mb_gate::MBGM_LR },
{ &meta::mb_gate_ms, false, mb_gate::MBGM_MS },
{ &meta::sc_mb_gate_mono, true, mb_gate::MBGM_MONO },
{ &meta::sc_mb_gate_stereo, true, mb_gate::MBGM_STEREO },
{ &meta::sc_mb_gate_lr, true, mb_gate::MBGM_LR },
{ &meta::sc_mb_gate_ms, true, mb_gate::MBGM_MS },

{ NULL, 0, false }
};

static plug::Module *plugin_factory(const meta::plugin_t *meta)
{
for (const plugin_settings_t *s = plugin_settings; s->metadata != NULL; ++s)
if (s->metadata == meta)
return new mb_gate(s->metadata, s->sc, s->mode);
return NULL;
}

static plug::Factory factory(plugin_factory, plugins, 8);
static plug::Factory factory(plugin_factory, plugins, 8);
} /* inline namespace */

//-------------------------------------------------------------------------
mb_gate::mb_gate(const meta::plugin_t *metadata, bool sc, size_t mode):
Expand Down

0 comments on commit 63a98ff

Please sign in to comment.