foobar2000 SDK  2015-08-03
component.h
Go to the documentation of this file.
1 #include "foobar2000.h"
2 
3 // This is a helper class that gets reliably static-instantiated in all components so any special code that must be executed on startup can be shoved into its constructor.
5 public:
7 #ifdef _MSC_VER
8 #ifndef _DEBUG
10 #endif
11 #endif
12  }
13 };
14 
15 class NOVTABLE foobar2000_client
16 {
17 public:
19 
20  enum {
21  FOOBAR2000_CLIENT_VERSION_COMPATIBLE = 72,
22  FOOBAR2000_CLIENT_VERSION = FOOBAR2000_TARGET_VERSION,
23  };
24  virtual t_uint32 get_version() = 0;
25  virtual pservice_factory_base get_service_list() = 0;
26 
27  virtual void get_config(stream_writer * p_stream,abort_callback & p_abort) = 0;
28  virtual void set_config(stream_reader * p_stream,abort_callback & p_abort) = 0;
29  virtual void set_library_path(const char * path,const char * name) = 0;
30  virtual void services_init(bool val) = 0;
31  virtual bool is_debug() = 0;
32 protected:
35 };
36 
37 class NOVTABLE foobar2000_api {
38 public:
39  virtual service_class_ref service_enum_find_class(const GUID & p_guid) = 0;
40  virtual bool service_enum_create(service_ptr_t<service_base> & p_out,service_class_ref p_class,t_size p_index) = 0;
41  virtual t_size service_enum_get_count(service_class_ref p_class) = 0;
42  virtual HWND get_main_window()=0;
43  virtual bool assert_main_thread()=0;
44  virtual bool is_main_thread()=0;
45  virtual bool is_shutting_down()=0;
46  virtual const char * get_profile_path()=0;
47  virtual bool is_initializing() = 0;
48 
49  //New in 0.9.6
50  virtual bool is_portable_mode_enabled() = 0;
51  virtual bool is_quiet_mode_enabled() = 0;
52 protected:
55 };
56 
bool is_shutting_down()
Returns whether the app is currently shutting down.
Definition: pfc.h:71
bool is_initializing()
Returns whether the app is currently initializing.
const void * service_class_ref
Definition: service.h:4
const char * get_profile_path()
Returns filesystem path to directory with user settings, e.g. file://c:.
service_factory_base * pservice_factory_base
Definition: component.h:18
size_t t_size
Definition: int_types.h:48
bool is_quiet_mode_enabled()
Returns whether foobar2000 is currently running in quiet mode. Quiet mode bypasses all GUI features...
foobar2000_api * g_foobar2000_api
bool assert_main_thread()
Tests whether calling thread is main app thread, and shows diagnostic message in debugger output if i...
HWND get_main_window()
Retrieves main app window. WARNING: this is provided for parent of dialog windows and such only; usin...
bool is_portable_mode_enabled()
Returns whether foobar2000 has been installed in "portable" mode.
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
static void OverrideCrtAbort()
Definition: fb2kdebug.h:98
bool is_main_thread()
Returns true if calling thread is main app thread, false otherwise.
uint32_t t_uint32
Definition: int_types.h:5