Skip to content

Commit 55bdaf2

Browse files
committed
Release 1.0.33
* Fixed widget redrawing atrifacts for some use cases. * Updated behaviour of the Knob for better quantization support. * Updated module versions in dependencies.
2 parents ce4a359 + d604620 commit 55bdaf2

9 files changed

Lines changed: 69 additions & 47 deletions

File tree

CHANGELOG

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

5+
=== 1.0.33 ===
6+
* Fixed widget redrawing atrifacts for some use cases.
7+
* Updated behaviour of the Knob for better quantization support.
8+
* Updated module versions in dependencies.
9+
510
=== 1.0.32 ===
611
* Implemented tk::Image widget that can load and hold raster images.
712
* Added frame skipping if surface is not ready for rendering. This may be useful

include/lsp-plug.in/tk/prop/multi/RangeFloat.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ namespace lsp
6868
virtual void push() override;
6969
virtual void commit(atom_t property) override;
7070

71-
float climited(float v) const;
71+
float climited(float v, bool write) const;
7272
float change(float k, float step);
7373
float do_limit(float v, bool write) const;
7474
float transform(float v, bool write) const;
@@ -95,7 +95,7 @@ namespace lsp
9595
inline bool range_locked() const { return nFlags & F_RANGE_LOCK; }
9696
inline bool auto_limit() const { return nFlags & F_AUTO_LIMIT; }
9797

98-
float set(float v);
98+
float set(float v, bool cyclic = false);
9999
float set_all(float v, float min, float max);
100100
float set_min(float v);
101101
float set_max(float v);

include/lsp-plug.in/tk/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#define LSP_TK_LIB_MAJOR 1
2626
#define LSP_TK_LIB_MINOR 0
27-
#define LSP_TK_LIB_MICRO 32
27+
#define LSP_TK_LIB_MICRO 33
2828

2929
#if defined(LSP_TK_LIB_PUBLISHER)
3030
#define LSP_TK_LIB_PUBLIC LSP_EXPORT_MODIFIER

include/lsp-plug.in/tk/widgets/simple/Knob.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ namespace lsp
103103

104104
protected:
105105
ssize_t nLastY;
106+
float fLastValue;
107+
float fDelta;
106108
size_t nState;
107109
size_t nButtons;
108110

@@ -132,7 +134,6 @@ namespace lsp
132134

133135
protected:
134136
size_t check_mouse_over(ssize_t x, ssize_t y);
135-
void update_value(float delta);
136137
void on_click(ssize_t x, ssize_t y);
137138
style::KnobColors *select_colors();
138139

modules.mk

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#
2020

2121
# Variables that describe dependencies
22-
LSP_COMMON_LIB_VERSION := 1.0.45
22+
LSP_COMMON_LIB_VERSION := 1.0.46
2323
LSP_COMMON_LIB_NAME := lsp-common-lib
2424
LSP_COMMON_LIB_TYPE := src
2525
LSP_COMMON_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_COMMON_LIB_NAME).git
@@ -31,49 +31,49 @@ LSP_TEST_FW_TYPE := src
3131
LSP_TEST_FW_URL_RO := https://github.com/lsp-plugins/$(LSP_TEST_FW_NAME).git
3232
LSP_TEST_FW_URL_RW := git@github.com:lsp-plugins/$(LSP_TEST_FW_NAME).git
3333

34-
LSP_LLTL_LIB_VERSION := 1.0.29
34+
LSP_LLTL_LIB_VERSION := 1.0.30
3535
LSP_LLTL_LIB_NAME := lsp-lltl-lib
3636
LSP_LLTL_LIB_TYPE := src
3737
LSP_LLTL_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_LLTL_LIB_NAME).git
3838
LSP_LLTL_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_LLTL_LIB_NAME).git
3939

40-
LSP_RUNTIME_LIB_VERSION := 1.0.32
40+
LSP_RUNTIME_LIB_VERSION := 1.0.33
4141
LSP_RUNTIME_LIB_NAME := lsp-runtime-lib
4242
LSP_RUNTIME_LIB_TYPE := src
4343
LSP_RUNTIME_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_RUNTIME_LIB_NAME).git
4444
LSP_RUNTIME_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_RUNTIME_LIB_NAME).git
4545

46-
LSP_R3D_IFACE_VERSION := 1.0.27
46+
LSP_R3D_IFACE_VERSION := 1.0.28
4747
LSP_R3D_IFACE_NAME := lsp-r3d-iface
4848
LSP_R3D_IFACE_TYPE := src
4949
LSP_R3D_IFACE_URL_RO := https://github.com/lsp-plugins/$(LSP_R3D_IFACE_NAME).git
5050
LSP_R3D_IFACE_URL_RW := git@github.com:lsp-plugins/$(LSP_R3D_IFACE_NAME).git
5151

52-
LSP_R3D_BASE_LIB_VERSION := 1.0.27
52+
LSP_R3D_BASE_LIB_VERSION := 1.0.28
5353
LSP_R3D_BASE_LIB_NAME := lsp-r3d-base-lib
5454
LSP_R3D_BASE_LIB_TYPE := src
5555
LSP_R3D_BASE_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_R3D_BASE_LIB_NAME).git
5656
LSP_R3D_BASE_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_R3D_BASE_LIB_NAME).git
5757

58-
LSP_R3D_GLX_LIB_VERSION := 1.0.27
58+
LSP_R3D_GLX_LIB_VERSION := 1.0.28
5959
LSP_R3D_GLX_LIB_NAME := lsp-r3d-glx-lib
6060
LSP_R3D_GLX_LIB_TYPE := src
6161
LSP_R3D_GLX_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_R3D_GLX_LIB_NAME).git
6262
LSP_R3D_GLX_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_R3D_GLX_LIB_NAME).git
6363

64-
LSP_R3D_WGL_LIB_VERSION := 1.0.22
64+
LSP_R3D_WGL_LIB_VERSION := 1.0.23
6565
LSP_R3D_WGL_LIB_NAME := lsp-r3d-wgl-lib
6666
LSP_R3D_WGL_LIB_TYPE := src
6767
LSP_R3D_WGL_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_R3D_WGL_LIB_NAME).git
6868
LSP_R3D_WGL_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_R3D_WGL_LIB_NAME).git
6969

70-
LSP_WS_LIB_VERSION := 1.0.32
70+
LSP_WS_LIB_VERSION := 1.0.33
7171
LSP_WS_LIB_NAME := lsp-ws-lib
7272
LSP_WS_LIB_TYPE := src
7373
LSP_WS_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_WS_LIB_NAME).git
7474
LSP_WS_LIB_URL_RW := git@github.com:lsp-plugins/$(LSP_WS_LIB_NAME).git
7575

76-
LSP_DSP_LIB_VERSION := 1.0.34
76+
LSP_DSP_LIB_VERSION := 1.0.35
7777
LSP_DSP_LIB_NAME := lsp-dsp-lib
7878
LSP_DSP_LIB_TYPE := src
7979
LSP_DSP_LIB_URL_RO := https://github.com/lsp-plugins/$(LSP_DSP_LIB_NAME).git

project.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ ARTIFACT_ID = LSP_TK_LIB
2323
ARTIFACT_NAME = lsp-tk-lib
2424
ARTIFACT_DESC = Graphical toolkit library for Linux Studio Plugins Project
2525
ARTIFACT_HEADERS = lsp-plug.in
26-
ARTIFACT_VERSION = 1.0.32
26+
ARTIFACT_VERSION = 1.0.33
2727
ARTIFACT_EXPORT_ALL = 1

src/main/prop/multi/RangeFloat.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@ namespace lsp
177177
return old;
178178
}
179179

180-
float RangeFloat::set(float value)
180+
float RangeFloat::set(float value, bool cyclic)
181181
{
182182
float old = fValue;
183-
value = do_limit(value, true);
183+
value = (cyclic) ? climited(value, true) : do_limit(value, true);
184184
if (value == old)
185185
return old;
186186

@@ -218,7 +218,7 @@ namespace lsp
218218
value;
219219
}
220220

221-
float RangeFloat::climited(float value) const
221+
float RangeFloat::climited(float value, bool write) const
222222
{
223223
if (!(nFlags & F_AUTO_LIMIT))
224224
return value;
@@ -239,7 +239,7 @@ namespace lsp
239239
value += delta;
240240
}
241241

242-
return do_limit(value, false);
242+
return do_limit(value, write);
243243
}
244244

245245
float RangeFloat::change(float k, float step)
@@ -257,7 +257,7 @@ namespace lsp
257257
float RangeFloat::add(float v, bool cyclic)
258258
{
259259
float old = fValue;
260-
v = (cyclic) ? climited(old + v) : do_limit(old + v, true);
260+
v = (cyclic) ? climited(old + v, true) : do_limit(old + v, true);
261261
if (old == v)
262262
return old;
263263

@@ -269,7 +269,7 @@ namespace lsp
269269
float RangeFloat::sub(float v, bool cyclic)
270270
{
271271
float old = fValue;
272-
v = (cyclic) ? climited(old - v) : do_limit(old - v, true);
272+
v = (cyclic) ? climited(old - v, true) : do_limit(old - v, true);
273273
if (old == v)
274274
return old;
275275

src/main/widgets/base/Widget.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ namespace lsp
273273
const style::WidgetColors *colors = select_colors();
274274
const size_t redraw = redraw_flags(colors->property_changed(prop));
275275
if (redraw != 0)
276-
query_draw(redraw & (REDRAW_CHILD | REDRAW_BG));
276+
query_draw(redraw);
277277

278278
if (sActive.is(prop))
279279
query_draw();
@@ -752,8 +752,17 @@ namespace lsp
752752
return false;
753753

754754
// Execute slot and commit size
755-
ws::rectangle_t xr = *r;
756-
sSlots.execute(SLOT_RESIZE, this, &xr);
755+
ws::event_t ev;
756+
ws::init_event(&ev);
757+
758+
ev.nType = ws::UIE_RESIZE;
759+
ev.nTime = system::get_time_millis();
760+
ev.nLeft = r->nLeft;
761+
ev.nTop = r->nTop;
762+
ev.nWidth = r->nWidth;
763+
ev.nHeight = r->nHeight;
764+
765+
sSlots.execute(SLOT_RESIZE, this, &ev);
757766
sSize = *r;
758767
nFlags |= REALIZED;
759768

@@ -941,9 +950,6 @@ namespace lsp
941950
{
942951
const style::WidgetColors *colors = select_colors();
943952

944-
// if (sTag.get() == 42)
945-
// lsp_trace("debug");
946-
947953
if (brightness < 0.0f)
948954
brightness = colors->sBgBrightness.get();
949955

src/main/widgets/simple/Knob.cpp

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ namespace lsp
157157
sInvertMouseVScroll(&sProperties)
158158
{
159159
nLastY = -1;
160+
fLastValue = 0.0f;
161+
fDelta = 0.0f;
160162
nState = 0;
161163
nButtons = 0;
162164

@@ -263,16 +265,6 @@ namespace lsp
263265
return (self != NULL) ? self->on_end_edit() : STATUS_BAD_ARGUMENTS;
264266
}
265267

266-
void Knob::update_value(float delta)
267-
{
268-
// lsp_trace("value=%f, delta=%f", sValue.get(), delta);
269-
270-
// Check that value is in range
271-
float old = sValue.add(delta, sCycling.get());
272-
if (old != sValue.get())
273-
sSlots.execute(SLOT_CHANGE, this);
274-
}
275-
276268
void Knob::on_click(ssize_t x, ssize_t y)
277269
{
278270
x -= sSize.nLeft;
@@ -397,10 +389,11 @@ namespace lsp
397389
if (nState != S_NONE)
398390
sSlots.execute(SLOT_BEGIN_EDIT, this);
399391
}
392+
nLastY = e->nTop;
393+
fLastValue = sValue.get();
400394
}
401395

402396
nButtons |= (size_t(1) << e->nCode);
403-
nLastY = e->nTop;
404397

405398
return STATUS_OK;
406399
}
@@ -417,6 +410,8 @@ namespace lsp
417410
if (nState != S_NONE)
418411
sSlots.execute(SLOT_END_EDIT, this);
419412
nState = S_NONE;
413+
414+
fDelta = 0.0f;
420415
}
421416

422417
return STATUS_OK;
@@ -431,13 +426,15 @@ namespace lsp
431426
return STATUS_OK;
432427

433428
// Update value
434-
float scaling = lsp_max(0.0f, sScaling.get());
435-
bool accel = (e->nState & ws::MCF_CONTROL);
436-
bool decel = bool(e->nState & ws::MCF_SHIFT) != bool(nButtons & ws::MCF_RIGHT);
429+
const float scaling = lsp_max(0.0f, sScaling.get());
430+
const bool accel = (e->nState & ws::MCF_CONTROL);
431+
const bool decel = bool(e->nState & ws::MCF_SHIFT) != bool(nButtons & ws::MCF_RIGHT);
432+
const float step = sStep.get(accel, decel);
437433

438-
float step = sStep.get(accel, decel);
439-
update_value(step * (nLastY - e->nTop) / scaling);
440-
nLastY = e->nTop;
434+
// Update value
435+
const float old = sValue.set(fLastValue + step * (nLastY - e->nTop) / scaling, sCycling.get());
436+
if (old != sValue.get())
437+
sSlots.execute(SLOT_CHANGE, this);
441438
}
442439
else if (nState == S_CLICK)
443440
{
@@ -455,13 +452,15 @@ namespace lsp
455452
// lsp_trace("x=%d, y=%d, state=%x, code=%x", int(e->nLeft), int(e->nTop), int(e->nState), int(e->nCode));
456453
if (!sEditable.get())
457454
return STATUS_OK;
455+
if (nButtons != 0)
456+
return STATUS_OK;
458457

459458
float step = sStep.get(e->nState & ws::MCF_CONTROL, e->nState & ws::MCF_SHIFT);
460459
if (sInvertMouseVScroll.get())
461460
step = -step;
462461

463462
// Compute delta
464-
float delta = 0.0;
463+
float delta = 0.0f;
465464
if (e->nCode == ws::MCD_UP)
466465
delta = step;
467466
else if (e->nCode == ws::MCD_DOWN)
@@ -470,9 +469,20 @@ namespace lsp
470469
return STATUS_OK;
471470

472471
// Update value
473-
sSlots.execute(SLOT_BEGIN_EDIT, this);
474-
update_value(delta);
475-
sSlots.execute(SLOT_END_EDIT, this);
472+
if (fDelta == 0.0f)
473+
fLastValue = sValue.get();
474+
fDelta += delta;
475+
476+
const float old = sValue.set(fLastValue + fDelta, sCycling.get());
477+
if (old != sValue.get())
478+
{
479+
fLastValue = sValue.get();
480+
fDelta = 0.0f;
481+
482+
sSlots.execute(SLOT_BEGIN_EDIT, this);
483+
sSlots.execute(SLOT_CHANGE, this);
484+
sSlots.execute(SLOT_END_EDIT, this);
485+
}
476486

477487
return STATUS_OK;
478488
}

0 commit comments

Comments
 (0)