Re: [LAD] Inter thread Communication: Design Approach

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-audio-dev@...>
Date: Friday, September 2, 2011 - 10:50 am

On 09/02/2011 12:04 PM, Fons Adriaensen wrote:

boost::function serves this purpose for me in jass. To
create and pass a functor that assigns a new auditor generator to the
one in the engine, and then tells it to play i do for example:

write_blocking_command(assign(engine_.auditor_gen, p));
write_blocking_command(boost::bind(&engine::play_auditor,
boost::ref(engine_))); assign() is just a utility template to make
creating functors that do assignments easier.. boost::bind is used to
make all passed functors 0-ary (e.g for binding member functions to
their instance or binding arguments to the functor.. and
write_blocking_command is just a utility function that disables the GUI
until the acknowledgement from the engine has come back to the GUI,, The
command ringbuffer is just a ringbuffer holding
boost::fucntion objects..

typedef ringbuffer > command_ringbuffer;

Examples from here:
https://github.com/fps/jass/blob/master/main_window.h
https://github.com/fps/jass/blob/master/assign.h
https://github.com/fps/jass/blob/master/engine.h Regards, Flo

> Ciao,

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAD] Inter thread Communication: Design Approach, Harry van Haaren, (Sat Aug 20, 2:19 pm)
Re: [LAD] Inter thread Communication: Design Approach, Gabriel Beddingfield, (Sat Aug 20, 3:04 pm)
Re: [LAD] Inter thread Communication: Design Approach, David Robillard, (Thu Sep 1, 6:18 pm)
Re: [LAD] Inter thread Communication: Design Approach, Gabriel Beddingfield, (Fri Sep 2, 2:29 am)
Re: [LAD] Inter thread Communication: Design Approach, David Robillard, (Fri Sep 2, 3:22 pm)
Re: [LAD] Inter thread Communication: Design Approach, Gabriel Beddingfield, (Fri Sep 2, 4:03 pm)
Re: [LAD] Inter thread Communication: Design Approach, David Robillard, (Fri Sep 2, 4:29 pm)
Re: [LAD] Inter thread Communication: Design Approach, Harry van Haaren, (Thu Sep 1, 8:37 pm)
Re: [LAD] Inter thread Communication: Design Approach, Florian Paul Schmidt, (Fri Sep 2, 8:36 am)
Re: [LAD] Inter thread Communication: Design Approach, David Robillard, (Fri Sep 2, 3:13 pm)
Re: [LAD] Inter thread Communication: Design Approach, Florian Paul Schmidt, (Fri Sep 2, 5:29 pm)
Re: [LAD] Inter thread Communication: Design Approach, Harry van Haaren, (Fri Sep 2, 11:59 am)
Re: [LAD] Inter thread Communication: Design Approach, Fons Adriaensen, (Thu Sep 1, 6:37 pm)
Re: [LAD] Inter thread Communication: Design Approach, David Robillard, (Thu Sep 1, 8:30 pm)
Re: [LAD] Inter thread Communication: Design Approach, Fons Adriaensen, (Fri Sep 2, 10:04 am)
Re: [LAD] Inter thread Communication: Design Approach, Fons Adriaensen, (Sat Sep 3, 9:25 pm)
Re: [LAD] Inter thread Communication: Design Approach, Florian Paul Schmidt, (Sun Sep 4, 10:22 am)
Re: [LAD] Inter thread Communication: Design Approach, Florian Paul Schmidt, (Fri Sep 2, 10:50 am)
Re: [LAD] Inter thread Communication: Design Approach, David Robillard, (Thu Sep 1, 8:34 pm)
Re: [LAD] Inter thread Communication: Design Approach, Harry van Haaren, (Sat Aug 20, 4:17 pm)
Re: [LAD] Inter thread Communication: Design Approach, Arnold Krille, (Sat Aug 20, 3:57 pm)