foobar2000 SDK  2015-08-03
Public Member Functions
config_io_callbackabstract

#include <config_io_callback.h>

+ Inheritance diagram for config_io_callback:

Public Member Functions

 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT (config_io_callback)
 
virtual void on_read ()=0
 
virtual void on_write (bool reset)=0
 
- Public Member Functions inherited from service_base
template<typename outPtr_t >
bool cast (outPtr_t &outPtr)
 
virtual int service_add_ref ()=0 throw ()
 
virtual bool service_query (service_ptr_t< service_base > &p_out, const GUID &p_guid)
 
template<class T >
bool service_query_t (service_ptr_t< T > &p_out)
 
virtual int service_release ()=0 throw ()
 

Additional Inherited Members

- Public Types inherited from service_base
typedef service_base t_interface
 
- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

Implementing this interface lets you maintain your own configuration files rather than depending on the cfg_var system.
Note that you must not make assumptions about what happens first: config_io_callback::on_read(), initialization of cfg_var values or config_io_callback::on_read() in other components. Order of these things is undefined and will change with each run.
Use service_factory_single_t<myclass> to register your implementations. Do not call other people's implementations, core is responsible for doing that when appropriate.

Definition at line 4 of file config_io_callback.h.

Member Function Documentation

config_io_callback::FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT ( config_io_callback  )
virtual void config_io_callback::on_read ( )
pure virtual

Called on startup. You can read your configuration file from here.
Hint: use core_api::get_profile_path() to retrieve the path of the folder where foobar2000 configuration files are stored.

virtual void config_io_callback::on_write ( bool  reset)
pure virtual

Called typically on shutdown but you should expect a call at any point after on_read(). You can write your configuration file from here. Hint: use core_api::get_profile_path() to retrieve the path of the folder where foobar2000 configuration files are stored.

Parameters
resetIf set to true, our configuration is being reset, so you should wipe your files rather than rewrite them with current configuration.

The documentation for this class was generated from the following file: