Skip to content

Commit fba33a3

Browse files
committed
Release 1.0.7
* Improved preset loading for incomplete presets that are missing some plugin parameters. * Fixed broken configuration save and load with relative file paths. * Extended possibilities of configuration export: now passing configuration serializer is possible. * Fixed possible concurrency problems on LADSPA/LV2/LV2UI library initialization. * Fixed possible cases of access to the deallocated memory when working with the SwitchedPort port. * Added possibility to preview the audio file contents in the file dialog.
2 parents 3e1f0df + f88bb8a commit fba33a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+6795
-1978
lines changed

CHANGELOG

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
* RECENT CHANGES
33
*******************************************************************************
44

5+
=== 1.0.7 ===
6+
* Improved preset loading for incomplete presets that are missing some plugin parameters.
7+
* Fixed broken configuration save and load with relative file paths.
8+
* Extended possibilities of configuration export: now passing configuration serializer is possible.
9+
* Fixed possible concurrency problems on LADSPA/LV2/LV2UI library initialization.
10+
* Fixed possible cases of access to the deallocated memory when working with the SwitchedPort port.
11+
* Added possibility to preview the audio file contents in the file dialog.
12+
513
=== 1.0.6 ===
614
* Fixed Clang warnings and errors.
715

include/lsp-plug.in/plug-fw/const.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#define SPEC_FREQ_MAX LSP_DSP_UNITS_SPEC_FREQ_MAX
3636

3737
// Other constants
38-
#define MAX_SAMPLE_RATE 192000 /* Maximum supported sample rate [samples / s] */
38+
#define MAX_SAMPLE_RATE 384000 /* Maximum supported sample rate [samples / s] */
3939
#define MAX_SOUND_SPEED 500 /* Maximum speed of the sound [ m/s ] */
4040
#define BPM_MIN 1.0f /* Minimum BPM */
4141
#define BPM_MAX 1000.0f /* Maximum BPM */
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
/*
2+
* Copyright (C) 2022 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2022 Vladimir Sadovnikov <[email protected]>
4+
*
5+
* This file is part of lsp-plugin-fw
6+
* Created on: 18 дек. 2022 г.
7+
*
8+
* lsp-plugin-fw is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU Lesser General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* any later version.
12+
*
13+
* lsp-plugin-fw is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Lesser General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Lesser General Public License
19+
* along with lsp-plugin-fw. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
22+
#ifndef LSP_PLUG_IN_PLUG_FW_CORE_SAMPLEPLAYER_H_
23+
#define LSP_PLUG_IN_PLUG_FW_CORE_SAMPLEPLAYER_H_
24+
25+
#include <lsp-plug.in/plug-fw/version.h>
26+
27+
#include <lsp-plug.in/dsp-units/sampling/SamplePlayer.h>
28+
#include <lsp-plug.in/ipc/ITask.h>
29+
#include <lsp-plug.in/plug-fw/plug.h>
30+
31+
32+
namespace lsp
33+
{
34+
namespace core
35+
{
36+
/**
37+
* Sample player class for playing audio files on demand
38+
*/
39+
class SamplePlayer
40+
{
41+
private:
42+
SamplePlayer & operator = (const SamplePlayer &);
43+
44+
protected:
45+
class LoadTask: public ipc::ITask
46+
{
47+
private:
48+
SamplePlayer *pCore;
49+
50+
public:
51+
explicit LoadTask(SamplePlayer *core);
52+
virtual ~LoadTask();
53+
54+
public:
55+
virtual status_t run();
56+
};
57+
58+
class GCTask: public ipc::ITask
59+
{
60+
private:
61+
SamplePlayer *pCore;
62+
63+
public:
64+
explicit GCTask(SamplePlayer *core);
65+
virtual ~GCTask();
66+
67+
public:
68+
virtual status_t run();
69+
};
70+
71+
private:
72+
const meta::plugin_t *pMetadata;
73+
plug::IWrapper *pWrapper;
74+
LoadTask sLoadTask;
75+
GCTask sGCTask;
76+
77+
dspu::SamplePlayer vPlayers[2];
78+
dspu::Playback vPlaybacks[2];
79+
plug::IPort *pOut[2];
80+
size_t nSampleRate;
81+
82+
dspu::Sample *pLoaded; // Loaded sample
83+
dspu::Sample *pGCList; // Garbage collection
84+
85+
wssize_t nPlayPosition; // Playback position
86+
wssize_t nFileLength; // Length of the file
87+
88+
char sFileName[PATH_MAX]; // Actual file name
89+
char sReqFileName[PATH_MAX]; // Requested file name
90+
wsize_t nReqPosition; // Requested playback position
91+
bool bReqRelease; // Release request
92+
size_t nUpdateReq; // Update request counter
93+
size_t nUpdateResp; // Update response counter
94+
95+
protected:
96+
static void destroy_sample(dspu::Sample * &sample);
97+
static void destroy_samples(dspu::Sample *gc_list);
98+
99+
static plug::IPort *find_out_port(const char *id, plug::IPort **ports, size_t count);
100+
101+
protected:
102+
void connect_outputs(plug::IPort **ports, size_t count);
103+
status_t load_sample();
104+
status_t perform_gc();
105+
void play_current_sample(wsize_t position);
106+
void process_async_requests();
107+
void process_gc_tasks();
108+
void process_playback(size_t samples);
109+
110+
public:
111+
explicit SamplePlayer(const meta::plugin_t *meta);
112+
~SamplePlayer();
113+
114+
void init(plug::IWrapper *wrapper, plug::IPort **ports, size_t count);
115+
void destroy();
116+
117+
public:
118+
void set_sample_rate(size_t sample_rate);
119+
void process(size_t samples);
120+
void play_sample(const char *file, wsize_t position, bool release);
121+
void play_sample(wsize_t position, bool release);
122+
123+
inline wssize_t position() const { return nPlayPosition; }
124+
inline wssize_t sample_length() const { return nFileLength; }
125+
inline char *requested_file_name() { return sReqFileName; }
126+
};
127+
128+
} /* namespace core */
129+
} /* namespace lsp */
130+
131+
132+
133+
#endif /* LSP_PLUG_IN_PLUG_FW_CORE_SAMPLEPLAYER_H_ */

include/lsp-plug.in/plug-fw/ctl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@
6262
#include <lsp-plug.in/plug-fw/ctl/simple/Hyperlink.h>
6363
#include <lsp-plug.in/plug-fw/ctl/simple/Fader.h>
6464
#include <lsp-plug.in/plug-fw/ctl/simple/ProgressBar.h>
65+
#include <lsp-plug.in/plug-fw/ctl/simple/CheckBox.h>
6566

6667
#include <lsp-plug.in/plug-fw/ctl/containers/Box.h>
6768
#include <lsp-plug.in/plug-fw/ctl/containers/Align.h>
6869
#include <lsp-plug.in/plug-fw/ctl/containers/Group.h>
6970
#include <lsp-plug.in/plug-fw/ctl/containers/Grid.h>
7071
#include <lsp-plug.in/plug-fw/ctl/containers/Cell.h>
7172
#include <lsp-plug.in/plug-fw/ctl/containers/MultiLabel.h>
73+
#include <lsp-plug.in/plug-fw/ctl/containers/TabControl.h>
7274

7375
#include <lsp-plug.in/plug-fw/ctl/compound/ComboBox.h>
7476
#include <lsp-plug.in/plug-fw/ctl/compound/ComboGroup.h>

include/lsp-plug.in/plug-fw/ctl/PluginWindow.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ namespace lsp
8383
{
8484
ctl::PluginWindow *ctl;
8585
tk::MenuItem *item;
86+
bool patch;
8687
LSPString location;
8788
} preset_sel_t;
8889

@@ -123,6 +124,7 @@ namespace lsp
123124
tk::FileDialog *wExport; // Export settings dialog
124125
tk::FileDialog *wImport; // Import settings dialog
125126
tk::MenuItem *wPreferHost; // Prefer host menu item
127+
tk::CheckBox *wRelPaths; // Relative path checkbox
126128

127129
ui::IPort *pPVersion;
128130
ui::IPort *pPBypass;
@@ -196,6 +198,8 @@ namespace lsp
196198
static status_t slot_scale_mouse_move(tk::Widget *sender, void *ptr, void *data);
197199
static status_t slot_scale_mouse_up(tk::Widget *sender, void *ptr, void *data);
198200

201+
static status_t slot_relative_path_changed(tk::Widget *sender, void *ptr, void *data);
202+
199203
protected:
200204
static i18n::IDictionary *get_default_dict(tk::Widget *src);
201205
static tk::FileFilters *create_config_filters(tk::FileDialog *dlg);

include/lsp-plug.in/plug-fw/ctl/compound/ComboGroup.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,21 @@ namespace lsp
6060
static status_t slot_combo_submit(tk::Widget *sender, void *ptr, void *data);
6161

6262
protected:
63-
void sync_metadata(ui::IPort *port);
6463
void submit_value();
6564
void select_active_widget();
6665

6766
public:
6867
explicit ComboGroup(ui::IWrapper *wrapper, tk::ComboGroup *cgroup);
6968
virtual ~ComboGroup();
7069

71-
virtual status_t init();
70+
virtual status_t init() override;
7271

7372
public:
74-
virtual void set(ui::UIContext *ctx, const char *name, const char *value);
75-
virtual status_t add(ui::UIContext *ctx, ctl::Widget *child);
76-
virtual void end(ui::UIContext *ctx);
77-
virtual void notify(ui::IPort *port);
73+
virtual void sync_metadata(ui::IPort *port) override;
74+
virtual void set(ui::UIContext *ctx, const char *name, const char *value) override;
75+
virtual status_t add(ui::UIContext *ctx, ctl::Widget *child) override;
76+
virtual void end(ui::UIContext *ctx) override;
77+
virtual void notify(ui::IPort *port) override;
7878
};
7979

8080
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
* Copyright (C) 2022 Linux Studio Plugins Project <https://lsp-plug.in/>
3+
* (C) 2022 Vladimir Sadovnikov <[email protected]>
4+
*
5+
* This file is part of lsp-plugin-fw
6+
* Created on: 14 нояб. 2022 г.
7+
*
8+
* lsp-plugin-fw is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU Lesser General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* any later version.
12+
*
13+
* lsp-plugin-fw is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU Lesser General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Lesser General Public License
19+
* along with lsp-plugin-fw. If not, see <https://www.gnu.org/licenses/>.
20+
*/
21+
22+
#ifndef LSP_PLUG_IN_PLUG_FW_CTL_CONTAINERS_TABCONTROL_H_
23+
#define LSP_PLUG_IN_PLUG_FW_CTL_CONTAINERS_TABCONTROL_H_
24+
25+
#ifndef LSP_PLUG_IN_PLUG_FW_CTL_IMPL_
26+
#error "Use #include <lsp-plug.in/plug-fw/ctl.h>"
27+
#endif /* LSP_PLUG_IN_PLUG_FW_CTL_IMPL_ */
28+
29+
#include <lsp-plug.in/plug-fw/version.h>
30+
#include <lsp-plug.in/tk/tk.h>
31+
32+
namespace lsp
33+
{
34+
namespace ctl
35+
{
36+
/**
37+
* Tab control
38+
*/
39+
class TabControl: public Widget
40+
{
41+
public:
42+
static const ctl_class_t metadata;
43+
44+
protected:
45+
ui::IPort *pPort;
46+
float fMin;
47+
float fMax;
48+
float fStep;
49+
ssize_t nActive;
50+
51+
ctl::Color sBorderColor;
52+
ctl::Color sHeadingColor;
53+
ctl::Color sHeadingSpacingColor;
54+
ctl::Color sHeadingGapColor;
55+
ctl::Integer sBorderSize;
56+
ctl::Integer sBorderRadius;
57+
ctl::Integer sTabSpacing;
58+
ctl::Integer sHeadingSpacing;
59+
ctl::Integer sHeadingGap;
60+
ctl::Float sHeadingGapBrightness;
61+
ctl::Embedding sEmbedding;
62+
ctl::Boolean sTabJoint;
63+
ctl::Boolean sHeadingFill;
64+
ctl::Boolean sHeadingSpacingFill;
65+
ctl::Expression sActive;
66+
67+
lltl::parray<tk::Tab> vTabs;
68+
69+
protected:
70+
static status_t slot_submit(tk::Widget *sender, void *ptr, void *data);
71+
72+
protected:
73+
void submit_value();
74+
void select_active_widget();
75+
tk::Tab *create_new_tab(tk::Widget *child, tk::Registry *registry);
76+
77+
public:
78+
explicit TabControl(ui::IWrapper *wrapper, tk::TabControl *tc);
79+
virtual ~TabControl();
80+
81+
virtual status_t init() override;
82+
83+
public:
84+
virtual void sync_metadata(ui::IPort *port) override;
85+
virtual void set(ui::UIContext *ctx, const char *name, const char *value) override;
86+
virtual status_t add(ui::UIContext *ctx, ctl::Widget *child) override;
87+
virtual void end(ui::UIContext *ctx) override;
88+
virtual void notify(ui::IPort *port) override;
89+
};
90+
91+
} /* namespace ctl */
92+
} /* namespace lsp */
93+
94+
95+
#endif /* LSP_PLUG_IN_PLUG_FW_CTL_CONTAINERS_TABCONTROL_H_ */

0 commit comments

Comments
 (0)