-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
64 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* Copyright (C) 2022 Linux Studio Plugins Project <https://lsp-plug.in/> | ||
* (C) 2022 Stefano Tronci <[email protected]> | ||
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/> | ||
* (C) 2023 Stefano Tronci <[email protected]> | ||
* | ||
* This file is part of lsp-plugins | ||
* Created on: 27 Feb 2022 | ||
|
@@ -153,19 +153,8 @@ namespace lsp | |
plug::IPort *pReactivity; // FFT reactivity | ||
plug::IPort *pShiftGain; // FFT gain shift | ||
|
||
public: | ||
explicit noise_generator(const meta::plugin_t *meta); | ||
virtual ~noise_generator(); | ||
|
||
virtual void init(plug::IWrapper *wrapper, plug::IPort **ports); | ||
void destroy(); | ||
|
||
public: | ||
virtual void update_sample_rate(long sr); | ||
virtual void update_settings(); | ||
virtual void process(size_t samples); | ||
virtual bool inline_display(plug::ICanvas *cv, size_t width, size_t height); | ||
virtual void dump(dspu::IStateDumper *v) const; | ||
protected: | ||
void do_destroy(); | ||
|
||
protected: | ||
inline ssize_t make_seed() const; | ||
|
@@ -174,9 +163,24 @@ namespace lsp | |
static dspu::ng_color_t get_color(size_t value); | ||
static dspu::stlt_slope_unit_t get_color_slope_unit(size_t value); | ||
static ch_mode_t get_channel_mode(size_t value); | ||
|
||
public: | ||
explicit noise_generator(const meta::plugin_t *meta); | ||
virtual ~noise_generator() override; | ||
|
||
virtual void init(plug::IWrapper *wrapper, plug::IPort **ports) override; | ||
void destroy() override; | ||
|
||
public: | ||
virtual void update_sample_rate(long sr) override; | ||
virtual void update_settings() override; | ||
virtual void process(size_t samples) override; | ||
virtual bool inline_display(plug::ICanvas *cv, size_t width, size_t height) override; | ||
virtual void dump(dspu::IStateDumper *v) const override; | ||
}; | ||
} | ||
} | ||
|
||
} /* namespace plugins */ | ||
} /* namespace lsp */ | ||
|
||
|
||
#endif /* PRIVATE_PLUGINS_NOISE_GENERATOR_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* Copyright (C) 2022 Linux Studio Plugins Project <https://lsp-plug.in/> | ||
* (C) 2022 Stefano Tronci <[email protected]> | ||
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/> | ||
* (C) 2023 Stefano Tronci <[email protected]> | ||
* | ||
* This file is part of lsp-plugins | ||
* Created on: 27 Feb 2022 | ||
|
@@ -75,6 +75,40 @@ namespace lsp | |
if (meta::is_audio_in_port(p)) | ||
++nChannels; | ||
|
||
for (size_t i=0; i<meta::noise_generator::NUM_GENERATORS; ++i) | ||
{ | ||
generator_t *g = &vGenerators[i]; | ||
|
||
g->fGain = 0.0f; | ||
g->bActive = false; | ||
g->bInaudible = false; | ||
g->bUpdPlots = true; | ||
|
||
g->vBuffer = NULL; | ||
g->vFreqChart = NULL; | ||
|
||
g->pNoiseType = NULL; | ||
g->pAmplitude = NULL; | ||
g->pOffset = NULL; | ||
g->pSlSw = NULL; | ||
g->pMtSw = NULL; | ||
g->pInaSw = NULL; | ||
g->pLCGdist = NULL; | ||
g->pVelvetType = NULL; | ||
g->pVelvetWin = NULL; | ||
g->pVelvetARNd = NULL; | ||
g->pVelvetCSW = NULL; | ||
g->pVelvetCpr = NULL; | ||
g->pColorSel = NULL; | ||
g->pCslopeNPN = NULL; | ||
g->pCslopeDBO = NULL; | ||
g->pCslopeDBD = NULL; | ||
g->pFft = NULL; | ||
g->pMeterOut = NULL; | ||
g->pMsh = NULL; | ||
g->pSpectrum = NULL; | ||
} | ||
|
||
// Initialize other parameters | ||
vChannels = NULL; | ||
vFreqs = NULL; | ||
|
@@ -97,7 +131,7 @@ namespace lsp | |
|
||
noise_generator::~noise_generator() | ||
{ | ||
destroy(); | ||
do_destroy(); | ||
} | ||
|
||
ssize_t noise_generator::make_seed() const | ||
|
@@ -422,6 +456,12 @@ namespace lsp | |
} | ||
|
||
void noise_generator::destroy() | ||
{ | ||
Module::destroy(); | ||
do_destroy(); | ||
} | ||
|
||
void noise_generator::do_destroy() | ||
{ | ||
// Drop inline display data structures | ||
if (pIDisplay != NULL) | ||
|
@@ -464,9 +504,6 @@ namespace lsp | |
|
||
// Destroy analyzer | ||
sAnalyzer.destroy(); | ||
|
||
// Destroy parent module | ||
Module::destroy(); | ||
} | ||
|
||
void noise_generator::update_sample_rate(long sr) | ||
|