diff options
-rw-r--r-- | jack_transport/jack_transport.c | 13 | ||||
-rw-r--r-- | jack_transport/jack_transport.pd | 18 |
2 files changed, 20 insertions, 11 deletions
diff --git a/jack_transport/jack_transport.c b/jack_transport/jack_transport.c index 053e75b..84b269e 100644 --- a/jack_transport/jack_transport.c +++ b/jack_transport/jack_transport.c @@ -92,14 +92,20 @@ static void jack_transport_bang(jack_transport_t * x) float f; if (!x->x_jack_client) return; - - jack_transport_query(x->x_jack_client,x->x_pos); - f = x->x_pos->frame; + f = (float)jack_get_current_transport_frame(x->x_jack_client); outlet_float(x->x_outlet, f); } +static void jack_transport_float(jack_transport_t * x, float f) +{ + if (!x->x_jack_client) + return; + + jack_transport_locate(x->x_jack_client, (jack_nframes_t)f); +} + void jack_transport_setup(void) { @@ -112,5 +118,6 @@ void jack_transport_setup(void) class_addmethod(jack_transport_class, (t_method)jack_transport_stoper, gensym("stop"),0,0); class_addbang(jack_transport_class, (t_method)jack_transport_bang); + class_addfloat(jack_transport_class, (t_method)jack_transport_float); } diff --git a/jack_transport/jack_transport.pd b/jack_transport/jack_transport.pd index e29286b..4460085 100644 --- a/jack_transport/jack_transport.pd +++ b/jack_transport/jack_transport.pd @@ -1,11 +1,13 @@ #N canvas 0 0 450 300 10; -#X floatatom 243 177 10 0 0 0 - - -; -#X obj 243 129 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X obj 100 141 jack_transport; +#X floatatom 140 118 5 0 0 0 - - -; +#X msg 191 120 stop; +#X msg 191 97 start; +#X floatatom 87 174 9 0 0 0 - - -; +#X obj 42 58 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; -#X obj 243 153 jack_transport; -#X obj 243 203 / 48000; -#X floatatom 243 227 5 0 0 0 - - -; -#X connect 0 0 3 0; -#X connect 1 0 2 0; +#X connect 0 0 4 0; +#X connect 1 0 0 0; #X connect 2 0 0 0; -#X connect 3 0 4 0; +#X connect 3 0 0 0; +#X connect 5 0 0 0; |