hi gabriel,

> Like this.  There may be typos... I didn't have time to try and compile
> it.  I usually divide it up into two functions so that you can call class
> methods normally instead of doing a bunch of
> ((JackOutput*)arg)->my_method(foo);
> 
> diff --git a/libs/hydrogen/include/hydrogen/IO/JackOutput.h
> b/libs/hydrogen/include/hydrogen/IO/JackOutput.h
> index 6364a7b..7aa84cd 100644
> --- a/libs/hydrogen/include/hydrogen/IO/JackOutput.h
> +++ b/libs/hydrogen/include/hydrogen/IO/JackOutput.h
> @@ -100,6 +100,17 @@ public:
>         void calculateFrameOffset();
>         void locateInNCycles( unsigned long frame, int cycles_to_wait = 2 );
> 
> +protected:
> +       static void jack_timebase_callback(jack_transport_state_t state,
> +                                          jack_nframes_t nframes,
> +                                          jack_position_t *pos,
> +                                          int new_pos,
> +                                          void *arg);
> +       void jack_timebase_callback_impl(jack_transport_state_t state,
> +                                        jack_nframes_t nframes,
> +                                        jack_position_t *pos,
> +                                        int new_pos);
> +
>  private:
>         void relocateBBT();
>         long long bbt_frame_offset;
> diff --git a/libs/hydrogen/src/IO/jack_output.cpp
> b/libs/hydrogen/src/IO/jack_output.cpp
> index a5a8e57..9a43be6 100644
> --- a/libs/hydrogen/src/IO/jack_output.cpp
> +++ b/libs/hydrogen/src/IO/jack_output.cpp
> @@ -693,9 +693,18 @@ void JackOutput::com_release()
> 
> 
>  ///this must be fixed to a valid c++ callback as a member of JackOutput
> -void jack_timebase_callback(jack_transport_state_t state, jack_nframes_t
> nframes,
> +void JackOutput::jack_timebase_callback(jack_transport_state_t state,
> jack_nframes_t nframes,
>               jack_position_t *pos, int new_pos, void *arg)
>  {
> +       JackOutput *me = dynamic_cast<JackOutput*>(arg);
> +       if(me) {
> +               me->jack_timebase_callback_impl(state, nframes, pos,
> new_pos);
> +       }
> +}
> +
> +void JackOutput::jack_timebase_callback_impl(jack_transport_state_t
> state, jack_nframes_t nframes,
> +                                            jack_position_t *pos, int
> new_pos)
> +{
>         Hydrogen * H = Hydrogen::get_instance();
> 
>         //static double jack_tick;
> 

thank you, that looks very good.
The next days I will try to change the callback funktion.
In the moment I read a little bit here http://www.newty.de/fpt/index.html to 
get more
experience with funktions pointers. Chapter  2 + 3  

greetings wolke

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel

Reply via email to