Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Example for playback_order_helper::modify_callback (Read 2982 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Example for playback_order_helper::modify_callback

Can somebody explain me how to use playback_order_helper::modify_callback? I want to use it but I have no idea how to do it 

Example for playback_order_helper::modify_callback

Reply #1
Create your callback function:

Code: [Select]
void callback_func (const char * newval,unsigned newidx)
{
   // do stuff in response to callback
}

Create an instance of playback_order_helper::modify_callback:

Code: [Select]
playback_order_helper::modify_callback cb(callback_func);

At least, that would be the first thing I'd try. 
Make sure you keep the modify_callback instance in scope for as long as you need the callback.

 

Example for playback_order_helper::modify_callback

Reply #2
Stupid me, that was far to easy 

Thanks for helping


Btw: this is the second way this could be done:

Code: [Select]
static void callback(const config_var_string * param)
{
    string8 test;
    param->get_value(test);
    // do something
}
static config_var_callback_simple<config_var_string> meh("CORE/Playback flow control", callback, true);