Repository navigation
Add set_timebase_callback() - #14
Vampouille wants to merge 6 commits into
Conversation
|
To be honest, I don't understand what exactly such a callback is supposed to do ... Could you please give a simple example? Probably something I can use for testing? I would wait with this until #7 is done, because then you can drop all this useless Are you planning to implement If yes, I think it would make sense to do that first, otherwise it may be hard to test the callback, right? BTW, what do you think about #12? |
|
This callback is used to set bpm and bbt (and bbt_offset) : position in bar beat ticks. Server only fill 'frame' field of position struct. Then callback have to set BPM and then compute bar, beat, ticks fields according to current bpm and frame count. In the original version of jack-Client jack_transport_reposition() was not declared as 'TODO' but was not implemented, so I just turn declaration into 'TODO'. In my application, I have feature to jump to a specified position in song in 'bar' (and change tempo). My first idea was to use jack_transport_reposition() function to change position or to change bpm. But this is not the way to do in jack because bpm will be overwritten on next process cycle by timebasemaster. For jumping in song I use transport_locate() function. I use timebase_callback to change bpm. For me jack_transport_reposition() is useless. Are you interesting in testing my app ? I'm looking for tester... and maybe my app can be useful for you. |
There was a problem hiding this comment.
Please change the order of conditional and timebase_callback and make former optional with conditional=False (I guess this is the right default value?).
Please also rename timebase_callback to callback, like in the other callback setters.
|
Thanks for the explanations. In the meantime, I closed #7 and #12, can you please update your PR accordingly? I also added a few comments within the code.
OK, we can leave it as "TODO" for now. |
|
It would be nice if This can be done by changing the signature to: def set_timebase_callback(self, callback=None, conditional=False):... and adding this in the very beginning of the function: if callback is None:
return lambda cb: self.set_timebase_callback(cb, conditional) |
There was a problem hiding this comment.
In other places, the result variable is called err, you should also use this for consistency.
There was a problem hiding this comment.
... and you should make the line break directly after (, then the rest would fit in 1 line.
There was a problem hiding this comment.
I just realized that if you change the name according to my first comment, my second comment becomes obsolete, so just forget it!
…st of return values
|
Thanks for the changes! Did you already create an issue for JACK2? I would like to add the issue URL as a comment in our code. |
|
Le 01/06/2015 17:09, Matthias Geier a écrit :
|
|
Wow, that was quick, it's been already merged into master! You should close jackaudio/jack2#122 and add jackaudio/jack2#123 as a comment here in this PR. Something like this: # Because of a bug in JACK2 version <= 1.9.10, we also check for -1.
# See https://github.com/jackaudio/jack2/pull/123. |
|
I squashed your changes into ce009fe. Thanks for the PR! |
|
I have a test/example file for |
I add set_timebase_callback() method and set jack_transport_reposition() as TODO