foobar2000 SDK  2015-08-03
main_thread_callback.cpp
Go to the documentation of this file.
1 #include "foobar2000.h"
2 
3 
6 }
7 
8 void main_thread_callback_add(main_thread_callback::ptr ptr) {
10 }
11 
12 namespace {
13  typedef std::function<void ()> func_t;
14  class mtcallback_func : public main_thread_callback {
15  public:
16  mtcallback_func(func_t const & f) : m_f(f) {}
17 
18  void callback_run() {
19  m_f();
20  }
21 
22  private:
23  func_t m_f;
24  };
25 }
26 
27 void fb2k::inMainThread( std::function<void () > f ) {
29 }
Template implementing reference-counting features of service_base. Intended for dynamic instantiation...
Definition: service_impl.h:4
void main_thread_callback_add(main_thread_callback::ptr ptr)
void inMainThread(std::function< void() > f)
virtual void callback_run()=0
Gets called from main app thread. See main_thread_callback_manager description for more info...
Helper template used to easily access core services. Usage: static_api_ptr_t<myclass> api; api->doso...
Definition: service.h:533
Callback object class for main_thread_callback_manager service.