|
1
|
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.
|
|
|
4 class foobar2000_component_globals {
|
|
|
5 public:
|
|
|
6 foobar2000_component_globals() {
|
|
|
7 #if defined(_MSC_VER) && !defined(_DEBUG) && !defined(_DLL)
|
|
|
8 // only with MSVC, non release build, static runtime
|
|
|
9 ::OverrideCrtAbort();
|
|
|
10 #endif
|
|
|
11 }
|
|
|
12 };
|
|
|
13
|
|
|
14 class NOVTABLE foobar2000_client
|
|
|
15 {
|
|
|
16 public:
|
|
|
17 typedef service_factory_base* pservice_factory_base;
|
|
|
18
|
|
|
19 enum {
|
|
|
20 FOOBAR2000_CLIENT_VERSION_COMPATIBLE = FOOBAR2000_TARGET_VERSION_COMPATIBLE,
|
|
|
21 FOOBAR2000_CLIENT_VERSION = FOOBAR2000_TARGET_VERSION,
|
|
|
22 };
|
|
|
23 virtual t_uint32 get_version() = 0;
|
|
|
24 virtual pservice_factory_base get_service_list() = 0;
|
|
|
25
|
|
|
26 virtual void get_config(stream_writer * p_stream,abort_callback & p_abort) = 0;
|
|
|
27 virtual void set_config(stream_reader * p_stream,abort_callback & p_abort) = 0;
|
|
|
28 virtual void set_library_path(const char * path,const char * name) = 0;
|
|
|
29 virtual void services_init(bool val) = 0;
|
|
|
30 virtual bool is_debug() = 0;
|
|
|
31 protected:
|
|
|
32 foobar2000_client() {}
|
|
|
33 ~foobar2000_client() {}
|
|
|
34 };
|
|
|
35
|
|
|
36 class NOVTABLE foobar2000_api {
|
|
|
37 public:
|
|
|
38 virtual service_class_ref service_enum_find_class(const GUID & p_guid) = 0;
|
|
|
39 virtual bool service_enum_create(service_ptr_t<service_base> & p_out,service_class_ref p_class,t_size p_index) = 0;
|
|
|
40 virtual t_size service_enum_get_count(service_class_ref p_class) = 0;
|
|
|
41 virtual fb2k::hwnd_t get_main_window()=0;
|
|
|
42 virtual bool assert_main_thread()=0;
|
|
|
43 virtual bool is_main_thread()=0;
|
|
|
44 virtual bool is_shutting_down()=0;
|
|
|
45 virtual const char * get_profile_path()=0;
|
|
|
46 virtual bool is_initializing() = 0;
|
|
|
47
|
|
|
48 //New in 0.9.6
|
|
|
49 virtual bool is_portable_mode_enabled() = 0;
|
|
|
50 virtual bool is_quiet_mode_enabled() = 0;
|
|
|
51 protected:
|
|
|
52 foobar2000_api() {}
|
|
|
53 ~foobar2000_api() {}
|
|
|
54 };
|
|
|
55
|
|
|
56 extern foobar2000_api * g_foobar2000_api;
|