diff options
author | David Robillard <d@drobilla.net> | 2012-11-16 01:16:46 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-11-16 01:16:46 +0000 |
commit | 797a9a172729e43c467ea6b2c84eb9d39035170e (patch) | |
tree | 0bc74e6b6224b5501edd97e8b799a14c96aef3c1 /src/jalv.c | |
parent | 39aca5e3ca582d27fb7df724c274afc67596406b (diff) | |
download | jalv-797a9a172729e43c467ea6b2c84eb9d39035170e.tar.gz jalv-797a9a172729e43c467ea6b2c84eb9d39035170e.tar.bz2 jalv-797a9a172729e43c467ea6b2c84eb9d39035170e.zip |
Send new time information to plugin when Jack tempo changes.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@4818 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/jalv.c')
-rw-r--r-- | src/jalv.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -362,7 +362,8 @@ jack_process_cb(jack_nframes_t nframes, void* data) /* If transport state is not as expected, then something has changed */ const bool xport_changed = (rolling != jalv->rolling || - pos.frame != jalv->position); + pos.frame != jalv->position || + pos.beats_per_minute != jalv->bpm); uint8_t pos_buf[256]; LV2_Atom* lv2_pos = (LV2_Atom*)pos_buf; @@ -401,6 +402,7 @@ jack_process_cb(jack_nframes_t nframes, void* data) /* Update transport state to expected values for next cycle */ jalv->position = rolling ? pos.frame + nframes : pos.frame; + jalv->bpm = pos.beats_per_minute; jalv->rolling = rolling; switch (jalv->play_state) { @@ -753,6 +755,7 @@ main(int argc, char** argv) jalv.block_length = 4096; // Should be set by jack_buffer_size_cb jalv.midi_buf_size = 1024; // Should be set by jack_buffer_size_cb jalv.play_state = JALV_PAUSED; + jalv.bpm = 120.0f; if (jalv_init(&argc, &argv, &jalv.opts)) { return EXIT_FAILURE; |