Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
purr-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonathan Wilkes
purr-data
Commits
3cc78b56
Commit
3cc78b56
authored
11 years ago
by
Ivica Bukvic
Browse files
Options
Downloads
Patches
Plain Diff
fixed nasty regression where sliders got cross-contaminated in terms of last passed float
parent
2317d948
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pd/src/g_all_guis.h
+4
-0
4 additions, 0 deletions
pd/src/g_all_guis.h
pd/src/g_hslider.c
+7
-8
7 additions, 8 deletions
pd/src/g_hslider.c
pd/src/g_vslider.c
+7
-8
7 additions, 8 deletions
pd/src/g_vslider.c
with
18 additions
and
16 deletions
pd/src/g_all_guis.h
+
4
−
0
View file @
3cc78b56
...
@@ -248,6 +248,8 @@ typedef struct _hslider
...
@@ -248,6 +248,8 @@ typedef struct _hslider
double
x_min
;
double
x_min
;
double
x_max
;
double
x_max
;
double
x_k
;
double
x_k
;
double
x_last
;
int
x_is_last_float
;
}
t_hslider
;
}
t_hslider
;
typedef
struct
_hdial
typedef
struct
_hdial
...
@@ -288,6 +290,8 @@ typedef struct _vslider
...
@@ -288,6 +290,8 @@ typedef struct _vslider
double
x_min
;
double
x_min
;
double
x_max
;
double
x_max
;
double
x_k
;
double
x_k
;
double
x_last
;
int
x_is_last_float
;
}
t_vslider
;
}
t_vslider
;
typedef
struct
_vu
typedef
struct
_vu
...
...
This diff is collapsed.
Click to expand it.
pd/src/g_hslider.c
+
7
−
8
View file @
3cc78b56
...
@@ -33,9 +33,6 @@ static void hslider_draw_select(t_hslider* x,t_glist* glist);
...
@@ -33,9 +33,6 @@ static void hslider_draw_select(t_hslider* x,t_glist* glist);
t_widgetbehavior
hslider_widgetbehavior
;
t_widgetbehavior
hslider_widgetbehavior
;
static
t_class
*
hslider_class
;
static
t_class
*
hslider_class
;
static
double
last
;
static
int
is_last_float
=
0
;
/* widget helper functions */
/* widget helper functions */
static
void
hslider_draw_update
(
t_gobj
*
client
,
t_glist
*
glist
)
static
void
hslider_draw_update
(
t_gobj
*
client
,
t_glist
*
glist
)
...
@@ -648,8 +645,8 @@ static void hslider_bang(t_hslider *x)
...
@@ -648,8 +645,8 @@ static void hslider_bang(t_hslider *x)
if
(
x
->
x_lin0_log1
)
if
(
x
->
x_lin0_log1
)
out
=
x
->
x_min
*
exp
(
x
->
x_k
*
(
double
)(
x
->
x_val
)
*
0
.
01
);
out
=
x
->
x_min
*
exp
(
x
->
x_k
*
(
double
)(
x
->
x_val
)
*
0
.
01
);
else
{
else
{
if
(
is_last_float
&&
last
<=
x
->
x_max
&&
last
>=
x
->
x_min
)
if
(
x
->
x_
is_last_float
&&
x
->
x_
last
<=
x
->
x_max
&&
x
->
x_
last
>=
x
->
x_min
)
out
=
last
;
out
=
x
->
x_
last
;
else
else
out
=
(
double
)(
x
->
x_val
)
*
0
.
01
*
x
->
x_k
+
x
->
x_min
;
out
=
(
double
)(
x
->
x_val
)
*
0
.
01
*
x
->
x_k
+
x
->
x_min
;
}
}
...
@@ -705,7 +702,7 @@ static void hslider_dialog(t_hslider *x, t_symbol *s, int argc, t_atom *argv)
...
@@ -705,7 +702,7 @@ static void hslider_dialog(t_hslider *x, t_symbol *s, int argc, t_atom *argv)
static
void
hslider_motion
(
t_hslider
*
x
,
t_floatarg
dx
,
t_floatarg
dy
)
static
void
hslider_motion
(
t_hslider
*
x
,
t_floatarg
dx
,
t_floatarg
dy
)
{
{
is_last_float
=
0
;
x
->
x_
is_last_float
=
0
;
int
old
=
x
->
x_val
;
int
old
=
x
->
x_val
;
if
(
x
->
x_gui
.
x_fsf
.
x_finemoved
)
if
(
x
->
x_gui
.
x_fsf
.
x_finemoved
)
...
@@ -828,8 +825,8 @@ static void hslider_steady(t_hslider *x, t_floatarg f)
...
@@ -828,8 +825,8 @@ static void hslider_steady(t_hslider *x, t_floatarg f)
static
void
hslider_float
(
t_hslider
*
x
,
t_floatarg
f
)
static
void
hslider_float
(
t_hslider
*
x
,
t_floatarg
f
)
{
{
double
out
;
double
out
;
is_last_float
=
1
;
x
->
x_
is_last_float
=
1
;
last
=
f
;
x
->
x_
last
=
f
;
hslider_set
(
x
,
f
);
hslider_set
(
x
,
f
);
if
(
x
->
x_lin0_log1
)
if
(
x
->
x_lin0_log1
)
...
@@ -906,6 +903,8 @@ static void *hslider_new(t_symbol *s, int argc, t_atom *argv)
...
@@ -906,6 +903,8 @@ static void *hslider_new(t_symbol *s, int argc, t_atom *argv)
x
->
x_gui
.
x_fsf
.
x_snd_able
=
1
;
x
->
x_gui
.
x_fsf
.
x_snd_able
=
1
;
x
->
x_gui
.
x_fsf
.
x_rcv_able
=
1
;
x
->
x_gui
.
x_fsf
.
x_rcv_able
=
1
;
x
->
x_is_last_float
=
0
;
x
->
x_last
=
0
.
0
;
x
->
x_gui
.
x_glist
=
(
t_glist
*
)
canvas_getcurrent
();
x
->
x_gui
.
x_glist
=
(
t_glist
*
)
canvas_getcurrent
();
if
(
x
->
x_gui
.
x_isa
.
x_loadinit
)
if
(
x
->
x_gui
.
x_isa
.
x_loadinit
)
...
...
This diff is collapsed.
Click to expand it.
pd/src/g_vslider.c
+
7
−
8
View file @
3cc78b56
...
@@ -33,9 +33,6 @@ static void vslider_draw_select(t_vslider* x, t_glist* glist);
...
@@ -33,9 +33,6 @@ static void vslider_draw_select(t_vslider* x, t_glist* glist);
t_widgetbehavior
vslider_widgetbehavior
;
t_widgetbehavior
vslider_widgetbehavior
;
static
t_class
*
vslider_class
;
static
t_class
*
vslider_class
;
static
double
last
;
static
int
is_last_float
=
0
;
/* widget helper functions */
/* widget helper functions */
static
void
vslider_draw_update
(
t_gobj
*
client
,
t_glist
*
glist
)
static
void
vslider_draw_update
(
t_gobj
*
client
,
t_glist
*
glist
)
...
@@ -632,8 +629,8 @@ static void vslider_bang(t_vslider *x)
...
@@ -632,8 +629,8 @@ static void vslider_bang(t_vslider *x)
if
(
x
->
x_lin0_log1
)
if
(
x
->
x_lin0_log1
)
out
=
x
->
x_min
*
exp
(
x
->
x_k
*
(
double
)(
x
->
x_val
)
*
0
.
01
);
out
=
x
->
x_min
*
exp
(
x
->
x_k
*
(
double
)(
x
->
x_val
)
*
0
.
01
);
else
else
if
(
is_last_float
&&
last
<=
x
->
x_max
&&
last
>=
x
->
x_min
)
if
(
x
->
x_
is_last_float
&&
x
->
x_
last
<=
x
->
x_max
&&
x
->
x_
last
>=
x
->
x_min
)
out
=
last
;
out
=
x
->
x_
last
;
else
else
out
=
(
double
)(
x
->
x_val
)
*
0
.
01
*
x
->
x_k
+
x
->
x_min
;
out
=
(
double
)(
x
->
x_val
)
*
0
.
01
*
x
->
x_k
+
x
->
x_min
;
if
((
out
<
1.0e-10
)
&&
(
out
>
-
1.0e-10
))
if
((
out
<
1.0e-10
)
&&
(
out
>
-
1.0e-10
))
...
@@ -689,7 +686,7 @@ static void vslider_dialog(t_vslider *x, t_symbol *s, int argc, t_atom *argv)
...
@@ -689,7 +686,7 @@ static void vslider_dialog(t_vslider *x, t_symbol *s, int argc, t_atom *argv)
static
void
vslider_motion
(
t_vslider
*
x
,
t_floatarg
dx
,
t_floatarg
dy
)
static
void
vslider_motion
(
t_vslider
*
x
,
t_floatarg
dx
,
t_floatarg
dy
)
{
{
is_last_float
=
0
;
x
->
x_
is_last_float
=
0
;
int
old
=
x
->
x_val
;
int
old
=
x
->
x_val
;
if
(
x
->
x_gui
.
x_fsf
.
x_finemoved
)
if
(
x
->
x_gui
.
x_fsf
.
x_finemoved
)
...
@@ -778,8 +775,8 @@ static void vslider_set(t_vslider *x, t_floatarg f)
...
@@ -778,8 +775,8 @@ static void vslider_set(t_vslider *x, t_floatarg f)
static
void
vslider_float
(
t_vslider
*
x
,
t_floatarg
f
)
static
void
vslider_float
(
t_vslider
*
x
,
t_floatarg
f
)
{
{
is_last_float
=
1
;
x
->
x_
is_last_float
=
1
;
last
=
f
;
x
->
x_
last
=
f
;
vslider_set
(
x
,
f
);
vslider_set
(
x
,
f
);
if
(
x
->
x_gui
.
x_fsf
.
x_put_in2out
)
if
(
x
->
x_gui
.
x_fsf
.
x_put_in2out
)
vslider_bang
(
x
);
vslider_bang
(
x
);
...
@@ -899,6 +896,8 @@ static void *vslider_new(t_symbol *s, int argc, t_atom *argv)
...
@@ -899,6 +896,8 @@ static void *vslider_new(t_symbol *s, int argc, t_atom *argv)
x
->
x_gui
.
x_draw
=
(
t_iemfunptr
)
vslider_draw
;
x
->
x_gui
.
x_draw
=
(
t_iemfunptr
)
vslider_draw
;
x
->
x_gui
.
x_fsf
.
x_snd_able
=
1
;
x
->
x_gui
.
x_fsf
.
x_snd_able
=
1
;
x
->
x_gui
.
x_fsf
.
x_rcv_able
=
1
;
x
->
x_gui
.
x_fsf
.
x_rcv_able
=
1
;
x
->
x_is_last_float
=
0
;
x
->
x_last
=
0
.
0
;
x
->
x_gui
.
x_glist
=
(
t_glist
*
)
canvas_getcurrent
();
x
->
x_gui
.
x_glist
=
(
t_glist
*
)
canvas_getcurrent
();
if
(
x
->
x_gui
.
x_isa
.
x_loadinit
)
if
(
x
->
x_gui
.
x_isa
.
x_loadinit
)
x
->
x_val
=
v
;
x
->
x_val
=
v
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment