|
1
|
1 #pragma once
|
|
|
2 //! Service used to access various external (online) track info lookup services, such as freedb, to update file tags with info retrieved from those services.
|
|
|
3 class NOVTABLE info_lookup_handler : public service_base {
|
|
|
4 public:
|
|
|
5 enum {
|
|
|
6 flag_album_lookup = 1 << 0,
|
|
|
7 flag_track_lookup = 1 << 1,
|
|
|
8 //! \since 2.2: supports lookup_noninteractive() call; before 2.2, lookup_noninteractive was assumed supported if info_lookup_handler_v2 was implemented.
|
|
|
9 flag_noninteractive = 1 << 2,
|
|
|
10 };
|
|
|
11
|
|
|
12 //! Retrieves human-readable name of the lookup handler to display in user interface.
|
|
|
13 virtual void get_name(pfc::string_base & p_out) = 0;
|
|
|
14
|
|
|
15 //! Returns one or more of flag_track_lookup, flag_album_lookup, flag_noninteractive.
|
|
|
16 virtual t_uint32 get_flags() = 0;
|
|
|
17
|
|
|
18 virtual fb2k::hicon_t get_icon(int p_width, int p_height) = 0;
|
|
|
19
|
|
|
20 //! Performs a lookup. Creates a modeless dialog and returns immediately.
|
|
|
21 //! @param items Items to look up.
|
|
|
22 //! @param notify Callback to notify caller when the operation has completed. Call on_completion with status code 0 to signal failure/abort, or with code 1 to signal success / new infos in metadb.
|
|
|
23 //! @param parent Parent window for the lookup dialog. Caller will typically disable the window while lookup is in progress and enable it back when completion is signaled.
|
|
|
24 virtual void lookup(metadb_handle_list_cref items,completion_notify::ptr notify,fb2k::hwnd_t parent) = 0;
|
|
|
25
|
|
|
26 FB2K_MAKE_SERVICE_INTERFACE_ENTRYPOINT(info_lookup_handler);
|
|
|
27 };
|
|
|
28
|
|
|
29
|
|
|
30 class NOVTABLE info_lookup_handler_v2 : public info_lookup_handler {
|
|
|
31 FB2K_MAKE_SERVICE_INTERFACE(info_lookup_handler_v2, info_lookup_handler);
|
|
|
32 public:
|
|
|
33 virtual double merit() {return 0;}
|
|
|
34 virtual void lookup_noninteractive(metadb_handle_list_cref items, completion_notify::ptr notify, fb2k::hwnd_t parent) = 0;
|
|
|
35 };
|
|
|
36
|
|
|
37 //! Since 2.2
|
|
|
38 class NOVTABLE info_lookup_handler_v3 : public info_lookup_handler_v2 {
|
|
|
39 FB2K_MAKE_SERVICE_INTERFACE(info_lookup_handler_v3, info_lookup_handler_v2);
|
|
|
40 public:
|
|
|
41 //! Some handlers depend on user settings to access multiple actual online services. \n
|
|
|
42 //! Use this method to retrieve individual handlers for specific services, with proper name, icon, etc.
|
|
|
43 //! @returns Array of info_lookup_handler objects, null if there are no subhandlers and this object should be used.
|
|
|
44 virtual fb2k::arrayRef subhandlers() { return nullptr; }
|
|
|
45 }; |