2009/01/16 yoshy - 0.021 リリースタグ(094_SDK72対応)
@@ -0,0 +1,3044 @@ | ||
1 | +#define BUILD_UNICODE | |
2 | + | |
3 | +#if defined(BUILD_UNICODE) | |
4 | +#if !defined(UNICODE) | |
5 | +#define _UNICODE | |
6 | +#define UNICODE | |
7 | +#endif | |
8 | +#endif | |
9 | + | |
10 | +#if defined(UNICODE) && !defined(BUILD_UNICODE) | |
11 | +#define BUILD_UNICODE | |
12 | +#endif | |
13 | + | |
14 | +#define LONG_PTR_TO_WNDPROC(p) (reinterpret_cast<WNDPROC>(p)) | |
15 | +#define WNDPROC_TO_LONG_PTR(p) (reinterpret_cast<LONG_PTR>(p)) | |
16 | + | |
17 | +#include <windows.h> | |
18 | +#include <lmcons.h> | |
19 | +#include <process.h> | |
20 | +#include <shlobj.h> | |
21 | + | |
22 | +#include <string> | |
23 | +#include <vector> | |
24 | +#include <map> | |
25 | + | |
26 | +#include "../SDK/foobar2000.h" | |
27 | +#include "../SDK/component.h" | |
28 | +#include "../helpers/helpers.h" | |
29 | + | |
30 | +#include "huy_ipc.h" | |
31 | + | |
32 | +#include "resource.h" | |
33 | + | |
34 | +#if defined(_FOOBAR2000_UTF8API_H_) | |
35 | +# define FB2K_MAJOR_VERSION 8 | |
36 | +#else | |
37 | +# define FB2K_MAJOR_VERSION 9 | |
38 | +#endif | |
39 | + | |
40 | +#define IS_FB2K_VER08 (FB2K_MAJOR_VERSION == 8) | |
41 | +#define IS_FB2K_VER09 (FB2K_MAJOR_VERSION == 9) | |
42 | + | |
43 | +#define FB2K_COMPONENTS_DIR _T("components\\") | |
44 | +#define DEFAULT_HUYGENS_TITLE "Huygens" | |
45 | + | |
46 | +#define PLUGIN_CAPTION "Huygens - The Free Song Information Exploring Probe" | |
47 | +#define PLUGIN_CAPTION_JP "無料曲情報探索突入機 Huygens" | |
48 | + | |
49 | +#define ADVANCED_SETTINGS_CAPTION "高度な設定" | |
50 | +#define DEBUG_SETTINGS_CAPTION "デバッグ用の設定" | |
51 | + | |
52 | +#define PLUGIN_VERSION_VAL "0.021" | |
53 | +#define PLUGIN_VERSION_PREFIX "No. " | |
54 | +#define PLUGIN_VERSION _T(PLUGIN_VERSION_PREFIX) _T(PLUGIN_VERSION_VAL) | |
55 | + | |
56 | +#define FILE_PROTOCOL "file://" | |
57 | + | |
58 | +#define DEFAULT_HUYGENS_TITLE_FORMAT "[%artist% - ]$if(%title%,%title%,%_filename%)" | |
59 | + | |
60 | +#define URL_FOO_HUYGENS_HOME "http://foo-huygens.sourceforge.jp/" | |
61 | + | |
62 | +#if IS_FB2K_VER08 | |
63 | +#define CLASSNAME DEFAULT_HUYGENS_TITLE " v1.x" | |
64 | +#else | |
65 | +#define CLASSNAME _T(DEFAULT_HUYGENS_TITLE) _T(" v1.x") | |
66 | +#endif | |
67 | + | |
68 | +#define FORMAT_FB2KVERSION "%_foobar2000_version%" | |
69 | +#define FORMAT_FILEPATH "%_path%" | |
70 | +#define FORMAT_FILEPATHRAW "%_path_raw%" | |
71 | +#define FORMAT_ARTIST "%artist%" | |
72 | +#define FORMAT_TRACKTITLE "%title%" | |
73 | +#define FORMAT_ALBUMTITLE "%album%" | |
74 | +#define FORMAT_GENRE "%genre%" | |
75 | +#define FORMAT_TRACKDATE "%date%" | |
76 | +#define FORMAT_COMPOSER "%composer%" | |
77 | +#define FORMAT_PERFORMER "%performer%" | |
78 | +#define FORMAT_ALBUMARTIST "%album artist%" | |
79 | +#define FORMAT_TRACKARTIST "%track artist%" | |
80 | +#if IS_FB2K_VER08 | |
81 | +#define FORMAT_SUBSONG "%_subsong%" | |
82 | +#elif IS_FB2K_VER09 | |
83 | +#define FORMAT_SUBSONG "%subsong%" | |
84 | +#endif | |
85 | +#define FORMAT_TRACKNUMBER "%tracknumber%" | |
86 | +#define FORMAT_TRACKTOTAL "%totaltracks%" | |
87 | +#define FORMAT_DISCNUMBER "%discnumber%" | |
88 | +#define FORMAT_DISCTOTAL "%totaldiscs%" | |
89 | +#define FORMAT_COMMENT "%comment%" | |
90 | + | |
91 | +#define FORMAT_SAMPLERATE "%__samplerate%" | |
92 | +#define FORMAT_BITRATE "%__bitrate%" | |
93 | +#define FORMAT_BITRATE_NOMINAL "%__bitrate_nominal%" | |
94 | +#define FORMAT_BITRATE_DYNAMIC "%__bitrate_dynamic%" | |
95 | +#define FORMAT_CHANNELS "%__channels%" | |
96 | +#define FORMAT_BITSPERSAMPLE "%__bitspersample%" | |
97 | +#define FORMAT_CODEC "%__codec%" | |
98 | +#define FORMAT_CODECPROFILE "%__codec_profile%" | |
99 | +#define FORMAT_LOSSLESS "$if2($strcmp(%__encoding%,lossless), 0)" | |
100 | +#define FORMAT_TAGTYPE "%__tagtype%" | |
101 | + | |
102 | +#define FORMAT_EXTRAINFO "%__extrainfo %" | |
103 | +#define FORMAT_TOOL "%__tool%" | |
104 | +#define FORMAT_CUEEMBEDDED "$if2($strcmp(%__cue_embedded%,yes), 0)" | |
105 | +#define FORMAT_AUDIOMD5HASH "%__MD5%" | |
106 | +#define FORMAT_MP3STEREOMODE "$if2($strcmp(%__mp3_stereo_mode%,joint stereo), 0)" | |
107 | +#define FORMAT_MP3ACCURATELENGTH "$if2($strcmp(%__mp3_accurate_length%,yes), 0)" | |
108 | +#define FORMAT_MP3ENCDELAY "%__enc_delay%" | |
109 | +#define FORMAT_MP3ENCPADDING "%__enc_padding%" | |
110 | +#define FORMAT_APEVERSION "%__version%" | |
111 | +#define FORMAT_APEFLAGS "%__flags%" | |
112 | + | |
113 | +#define FORMAT_REPLAYGAIN_ALBUMGAIN "%__replaygain_album_gain%" | |
114 | +#define FORMAT_REPLAYGAIN_ALBUMPEEK "%__replaygain_album_peek%" | |
115 | +#define FORMAT_REPLAYGAIN_TRACKGAIN "%__replaygain_track_gain%" | |
116 | +#define FORMAT_REPLAYGAIN_TRACKPEEK "%__replaygain_track_peek%" | |
117 | + | |
118 | +#define FORMAT_FILESIZE "%filesize%" | |
119 | +#define FORMAT_FILECREATED "fileCreated" | |
120 | +#define FORMAT_FILELASTMOD "fileLastModified" | |
121 | +#define FORMAT_ISINMEDIALIB "isInMediaLib" | |
122 | + | |
123 | + | |
124 | +#if IS_FB2K_VER08 | |
125 | +#define FORMAT_LENGTHSAMPLES "%length_samples%" | |
126 | +#define FORMAT_LISTINDEX "%_playlist_number%" | |
127 | +#define FORMAT_LISTTOTAL "%_playlist_total%" | |
128 | +#define FORMAT_PLAYLIST_NAME "%_playlist_name%" | |
129 | +#elif IS_FB2K_VER09 | |
130 | +#define FORMAT_LENGTHSAMPLES "%length_samples%" | |
131 | +#define FORMAT_LISTINDEX "%list_index%" | |
132 | +#define FORMAT_LISTTOTAL "%list_total%" | |
133 | +#define FORMAT_PLAYLIST_NAME "%playlist_name%" | |
134 | +#endif | |
135 | + | |
136 | +#if IS_FB2K_VER09 | |
137 | +using namespace pfc; | |
138 | +using namespace pfc::stringcvt; | |
139 | +#define pfc_string_to_float string_to_float | |
140 | +#endif | |
141 | + | |
142 | +/* | |
143 | + foo_huygens: project dependencies | |
144 | + | |
145 | + foo_huygens | |
146 | + foobar2000_SDK | |
147 | + utf8api(0.8.3) | |
148 | + pfc | |
149 | + foobar2000_sdk_helpers | |
150 | + pfc | |
151 | + foobar2000_component_client | |
152 | + | |
153 | + library dependencies: ../shared/shared.lib(0.9.X), shlwapi.lib(0.9.X) | |
154 | + runtime library: Multi-Thread (DLL) or (Debug,DLL) | |
155 | + !! ensure all projects that depended from this project are correctly set to MT DLL !! | |
156 | + ignore: LIBCMT [Win32 Release] (or LIBCMTD [Win32 Debug]) | |
157 | +*/ | |
158 | + | |
159 | +// if wxWidgets are updated, change lib names below and linker libpath option. | |
160 | + | |
161 | +#if IS_FB2K_VER09 | |
162 | +#pragma comment(lib, "../shared/shared.lib") | |
163 | + | |
164 | +// for StrCmpLogicalW in metadb_handle_list.cpp | |
165 | +#pragma comment(lib, "shlwapi.lib") | |
166 | +#endif | |
167 | + | |
168 | +typedef std::basic_string<TCHAR> tstring; | |
169 | + | |
170 | +typedef TCHAR Str64K[65536]; | |
171 | +typedef char StrDBCS64K[65536]; | |
172 | + | |
173 | +tstring GetErrorMessage(DWORD errCode); | |
174 | +void putLogError(LPCTSTR pMethod, LPCTSTR pErrMsg, DWORD dwErrCode); | |
175 | +void setDlgVersionInfo(HWND wnd, UINT idc_version, UINT idc_build); | |
176 | +void DebugPrint(LPCTSTR lpszFormat, ...); | |
177 | +void DebugPrint8(LPCSTR lpszFormat, ...); | |
178 | + | |
179 | +#define LOGLEVEL_NONE 0 | |
180 | +#define LOGLEVEL_DEBUG 1 | |
181 | +#define LOGLEVEL_TRACE 2 | |
182 | + | |
183 | +#define LOG_TRACE(f, ...) if(cfg_enable_debug_log) DebugPrint(f, __VA_ARGS__) | |
184 | +#define LOG_DEBUG(f, ...) if(cfg_enable_debug_log) DebugPrint(f, __VA_ARGS__) | |
185 | + | |
186 | +#define LOG_TRACE8(f, ...) if(cfg_enable_debug_log) DebugPrint8(f, __VA_ARGS__) | |
187 | +#define LOG_DEBUG8(f, ...) if(cfg_enable_debug_log) DebugPrint8(f, __VA_ARGS__) | |
188 | + | |
189 | +#define LOG_INFO(f, ...) DebugPrint(f, __VA_ARGS__) | |
190 | +#define LOG_WARN(f, ...) DebugPrint(f, __VA_ARGS__) | |
191 | +#define LOG_ERROR(f, ...) DebugPrint(f, __VA_ARGS__) | |
192 | + | |
193 | +#if defined(BUILD_UNICODE) | |
194 | +#define TRACE_DBCS(f, ...) if(cfg_enable_debug_log) DebugPrintDBCS(f, __VA_ARGS__) | |
195 | +#else | |
196 | +#define TRACE_DBCS(f, ...) if(cfg_enable_debug_log) DebugPrint(f, __VA_ARGS__) | |
197 | +#endif | |
198 | + | |
199 | +#define DEBUG_HUYGENS_INIT(f, ...) if(cfg_debug_huygens_init >= LOGLEVEL_DEBUG) LOG_DEBUG(f, __VA_ARGS__) | |
200 | +#define TRACE_HUYGENS_INIT(f, ...) if(cfg_debug_huygens_init >= LOGLEVEL_TRACE) LOG_TRACE(f, __VA_ARGS__) | |
201 | + | |
202 | +#define DEBUG_HUYGENS_PROC(f, ...) if(cfg_debug_huygens_proc >= LOGLEVEL_DEBUG) LOG_DEBUG(f, __VA_ARGS__) | |
203 | +#define DEBUG_HUYGENS_PROC8(f, ...) if(cfg_debug_huygens_proc >= LOGLEVEL_DEBUG) LOG_DEBUG8(f, __VA_ARGS__) | |
204 | +#define TRACE_HUYGENS_PROC(f, ...) if(cfg_debug_huygens_proc >= LOGLEVEL_TRACE) LOG_TRACE(f, __VA_ARGS__) | |
205 | +#define TRACE_HUYGENS_PROC8(f, ...) if(cfg_debug_huygens_proc >= LOGLEVEL_TRACE) LOG_TRACE8(f, __VA_ARGS__) | |
206 | + | |
207 | +#define DEBUG_TRACK_INFO(f, ...) if(cfg_debug_track_info >= LOGLEVEL_DEBUG) LOG_DEBUG(f, __VA_ARGS__) | |
208 | +#define DEBUG_TRACK_INFO8(f, ...) if(cfg_debug_track_info >= LOGLEVEL_DEBUG) LOG_DEBUG8(f, __VA_ARGS__) | |
209 | +#define TRACE_TRACK_INFO(f, ...) if(cfg_debug_track_info >= LOGLEVEL_TRACE) LOG_TRACE(f, __VA_ARGS__) | |
210 | +#define TRACE_TRACK_INFO8(f, ...) if(cfg_debug_track_info >= LOGLEVEL_TRACE) LOG_TRACE8(f, __VA_ARGS__) | |
211 | + | |
212 | +#define DEBUG_PLUGIN(f, ...) if(cfg_debug_plugin >= LOGLEVEL_DEBUG) LOG_DEBUG(f, __VA_ARGS__) | |
213 | +#define TRACE_PLUGIN(f, ...) if(cfg_debug_plugin >= LOGLEVEL_TRACE) LOG_TRACE(f, __VA_ARGS__) | |
214 | + | |
215 | +#define DEBUG_CALLBACK(f, ...) if(cfg_debug_callback >= LOGLEVEL_DEBUG) LOG_DEBUG(f, __VA_ARGS__) | |
216 | +#define TRACE_CALLBACK(f, ...) if(cfg_debug_callback >= LOGLEVEL_TRACE) LOG_TRACE(f, __VA_ARGS__) | |
217 | + | |
218 | +static string_utf8_from_os g_pluginCaption8(_T(PLUGIN_CAPTION_JP)); | |
219 | +static string_utf8_from_os g_pluginVersion8(PLUGIN_VERSION); | |
220 | +static string_utf8_from_os g_pluginAbout8(_T(PLUGIN_CAPTION_JP) _T(" ") PLUGIN_VERSION _T("\nCopyright (C) 2008, 2009 Yossiepon Oniichan, All Rights Reserved.")); | |
221 | + | |
222 | +DECLARE_COMPONENT_VERSION(g_pluginCaption8, g_pluginVersion8, g_pluginAbout8); | |
223 | + | |
224 | +static string_utf8_from_os g_advancedSettingsCaption8(_T(ADVANCED_SETTINGS_CAPTION)); | |
225 | +static string_utf8_from_os g_debugSettingsCaption8(_T(DEBUG_SETTINGS_CAPTION)); | |
226 | + | |
227 | +static string_utf8_from_os g_menu_item(_T("Components/Huygens/Huygens の応答機能を有効にする")); | |
228 | + | |
229 | +static string_utf8_from_os g_menu_item_title(_T("Huygens の応答機能を有効にする")); | |
230 | +static string_utf8_from_os g_menu_item_description(_T("Cassini 等の外部ツールからのメッセージに対する応答機能について、有効/無効を切り替えます")); | |
231 | + | |
232 | +#if IS_FB2K_VER08 | |
233 | +static cfg_int cfg_use_plugin("usePlugin", 1); | |
234 | + | |
235 | +static cfg_int cfg_show_huygens("ShowHuygens", 0); | |
236 | +static cfg_string cfg_huygens_title_format("HuygensTitleFormat", DEFAULT_HUYGENS_TITLE_FORMAT); | |
237 | +static cfg_string cfg_huygens_playlist_format("HuygensPlaylistFormat", DEFAULT_HUYGENS_TITLE_FORMAT); | |
238 | +static cfg_int cfg_disable_ansi_trans("DisableAnsiTrans", 1); | |
239 | + | |
240 | +static cfg_int cfg_enable_debug_log("EnableDebugLog", 1); | |
241 | +static cfg_int cfg_debug_huygens_init("DebugHuygensInit", 1); | |
242 | +static cfg_int cfg_debug_huygens_proc("DebugHuygensProc", 1); | |
243 | +static cfg_int cfg_debug_track_info("DebugTrackInfo", 1); | |
244 | +static cfg_int cfg_debug_plugin("DebugPlugin", 1); | |
245 | +static cfg_int cfg_debug_callback("DebugCallback", 1); | |
246 | +#elif IS_FB2K_VER09 | |
247 | +// {0F6B1827-F2B6-4a3d-B566-1740AA4DA80A} | |
248 | +static const GUID cfg_use_plugin_guid = { 0xf6b1827, 0xf2b6, 0x4a3d, { 0xb5, 0x66, 0x17, 0x40, 0xaa, 0x4d, 0xa8, 0xa } }; | |
249 | +static cfg_int cfg_use_plugin(cfg_use_plugin_guid, 1); | |
250 | + | |
251 | +// {58C73D35-1BFC-4f60-B942-F06CAFD74CCD} | |
252 | +static const GUID cfg_show_huygens_guid = { 0x58c73d35, 0x1bfc, 0x4f60, { 0xb9, 0x42, 0xf0, 0x6c, 0xaf, 0xd7, 0x4c, 0xcd } }; | |
253 | +static cfg_int cfg_show_huygens(cfg_show_huygens_guid, 0); | |
254 | +// {E4EE2EFC-9CFD-4abe-93FE-01DDD5CCA4BF} | |
255 | +static const GUID cfg_huygens_title_format_guid = { 0xe4ee2efc, 0x9cfd, 0x4abe, { 0x93, 0xfe, 0x1, 0xdd, 0xd5, 0xcc, 0xa4, 0xbf } }; | |
256 | +static cfg_string cfg_huygens_title_format(cfg_huygens_title_format_guid, DEFAULT_HUYGENS_TITLE_FORMAT); | |
257 | +// {6FA295D0-DE65-4688-81E6-3D9E5D11DCD4} | |
258 | +static const GUID cfg_huygens_playlist_format_guid = { 0x6fa295d0, 0xde65, 0x4688, { 0x81, 0xe6, 0x3d, 0x9e, 0x5d, 0x11, 0xdc, 0xd4 } }; | |
259 | +static cfg_string cfg_huygens_playlist_format(cfg_huygens_title_format_guid, DEFAULT_HUYGENS_TITLE_FORMAT); | |
260 | + | |
261 | +// {14675AAF-BD88-46cf-89EB-9145424CFE04} | |
262 | +static const GUID cfg_disable_ansi_trans_guid = { 0x14675aaf, 0xbd88, 0x46cf, { 0x89, 0xeb, 0x91, 0x45, 0x42, 0x4c, 0xfe, 0x4 } }; | |
263 | +static cfg_int cfg_disable_ansi_trans(cfg_disable_ansi_trans_guid, 1); | |
264 | + | |
265 | +// {85624EA1-F4BF-4909-B1B1-7EDD0237EAF2} | |
266 | +static const GUID cfg_enable_debug_log_guid = { 0x85624ea1, 0xf4bf, 0x4909, { 0xb1, 0xb1, 0x7e, 0xdd, 0x2, 0x37, 0xea, 0xf2 } }; | |
267 | +static cfg_int cfg_enable_debug_log(cfg_enable_debug_log_guid, 1); // debug log enabled | |
268 | +// {65CDEA92-6057-47b5-8BF7-40192788CCB6} | |
269 | +static const GUID cfg_debug_huygens_init_guid = { 0x65cdea92, 0x6057, 0x47b5, { 0x8b, 0xf7, 0x40, 0x19, 0x27, 0x88, 0xcc, 0xb6 } }; | |
270 | +static cfg_int cfg_debug_huygens_init(cfg_debug_huygens_init_guid, 1); // debug level | |
271 | +// {D3DDB68F-0BD0-47b9-8E1E-5E46BC16D89B} | |
272 | +static const GUID cfg_debug_huygens_proc_guid = { 0xd3ddb68f, 0xbd0, 0x47b9, { 0x8e, 0x1e, 0x5e, 0x46, 0xbc, 0x16, 0xd8, 0x9b } }; | |
273 | +static cfg_int cfg_debug_huygens_proc(cfg_debug_huygens_proc_guid, 1); // debug level | |
274 | +// {1F654881-CCD5-4a75-A7FC-2073B84EEAC1} | |
275 | +static const GUID cfg_debug_track_info_guid = { 0x1f654881, 0xccd5, 0x4a75, { 0xa7, 0xfc, 0x20, 0x73, 0xb8, 0x4e, 0xea, 0xc1 } }; | |
276 | +static cfg_int cfg_debug_track_info(cfg_debug_track_info_guid, 1); // debug level | |
277 | +// {A4C79E60-72A1-4a08-ACA0-F56F3DD6452D} | |
278 | +static const GUID cfg_debug_plugin_guid = { 0xa4c79e60, 0x72a1, 0x4a08, { 0xac, 0xa0, 0xf5, 0x6f, 0x3d, 0xd6, 0x45, 0x2d } }; | |
279 | +static cfg_int cfg_debug_plugin(cfg_debug_plugin_guid, 1); // debug level | |
280 | +// {CDCB6FAB-7A14-455e-80EA-D7F3E14E13AE} | |
281 | +static const GUID cfg_debug_callback_guid = { 0xcdcb6fab, 0x7a14, 0x455e, { 0x80, 0xea, 0xd7, 0xf3, 0xe1, 0x4e, 0x13, 0xae } }; | |
282 | +static cfg_int cfg_debug_callback(cfg_debug_callback_guid, 1); // debug level | |
283 | +#endif | |
284 | + | |
285 | +struct TRACK_INFO8 | |
286 | +{ | |
287 | + std::map<std::string, std::string> m_infoMap8; | |
288 | + std::map<std::string, std::string> m_infoMapAnsi; | |
289 | + | |
290 | + std::map<std::string, UINT> m_infoMapNum; | |
291 | + | |
292 | + std::string m_nullStr; | |
293 | + | |
294 | + void clear() | |
295 | + { | |
296 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::clear - called.")); | |
297 | + | |
298 | + m_infoMap8.clear(); | |
299 | + m_infoMapAnsi.clear(); | |
300 | + m_infoMapNum.clear(); | |
301 | + } | |
302 | + | |
303 | + bool isEmpty() const { return m_infoMap8.empty() | m_infoMapNum.empty(); } | |
304 | + | |
305 | +public: | |
306 | + | |
307 | +#if IS_FB2K_VER08 | |
308 | + void setStrings(std::vector<std::string> & keys, metadb_handle * track) | |
309 | +#elif IS_FB2K_VER09 | |
310 | + void setStrings(std::vector<std::string> & keys, metadb_handle_ptr track) | |
311 | +#endif | |
312 | + { | |
313 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setStrings - called.")); | |
314 | + | |
315 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
316 | + | |
317 | + for(it = beginIt; it != endIt; it ++) { | |
318 | + | |
319 | + string8 info8; | |
320 | + | |
321 | +#if IS_FB2K_VER08 | |
322 | + track->handle_format_title(info8, it->c_str(), 0); | |
323 | +#elif IS_FB2K_VER09 | |
324 | + service_ptr_t<titleformat_object> titleformat; | |
325 | + | |
326 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
327 | + track->format_title(NULL, info8, titleformat, 0); | |
328 | +#endif | |
329 | + DEBUG_TRACK_INFO8("TRACK_INFO8::setStrings - %s: %s", it->c_str(), (LPCSTR)info8); | |
330 | + | |
331 | + m_infoMap8.insert(std::make_pair(*it, info8)); | |
332 | + | |
333 | + if(cfg_disable_ansi_trans == 0) | |
334 | + { | |
335 | +#if IS_FB2K_VER08 | |
336 | + string_wide_from_utf8 infoW(info8); | |
337 | + string_ansi_from_wide infoAnsi(infoW); | |
338 | +#elif IS_FB2K_VER09 | |
339 | + string_ansi_from_utf8 infoAnsi(info8); | |
340 | +#endif | |
341 | + | |
342 | + m_infoMapAnsi.insert(std::make_pair(*it, infoAnsi)); | |
343 | + } | |
344 | + } | |
345 | + } | |
346 | + | |
347 | + void setDynamicStrings(std::vector<std::string> & keys) | |
348 | + { | |
349 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setDynamicStrings - called.")); | |
350 | + | |
351 | +#if IS_FB2K_VER08 | |
352 | + metadb_handle *track = play_control::get()->get_now_playing(); | |
353 | +#elif IS_FB2K_VER09 | |
354 | + metadb_handle_ptr track; | |
355 | + static_api_ptr_t<playback_control>()->get_now_playing(track); | |
356 | +#endif | |
357 | + | |
358 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
359 | + | |
360 | + for(it = beginIt; it != endIt; it ++) { | |
361 | + | |
362 | + string8 info8; | |
363 | + | |
364 | +#if IS_FB2K_VER08 | |
365 | + play_control::get()->playback_format_title_ex(track, info8, it->c_str(), NULL, false, true); | |
366 | +#elif IS_FB2K_VER09 | |
367 | + service_ptr_t<titleformat_object> titleformat; | |
368 | + | |
369 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
370 | + static_api_ptr_t<playback_control>()->playback_format_title_ex(track, NULL, info8, titleformat, NULL, play_control::display_level_titles); | |
371 | +#endif | |
372 | + TRACE_TRACK_INFO8("TRACK_INFO8::setDynamicStrings - %s: %s", it->c_str(), (LPCSTR)info8); | |
373 | + | |
374 | + const std::string &oldValue = getString(*it); | |
375 | + | |
376 | + if((::strcmp(info8, "?") == 0) || (oldValue.length() == 0)) | |
377 | + { | |
378 | + m_infoMap8.insert(std::make_pair(*it, info8)); | |
379 | + | |
380 | + if(cfg_disable_ansi_trans == 0) | |
381 | + { | |
382 | +#if IS_FB2K_VER08 | |
383 | + string_wide_from_utf8 infoW(info8); | |
384 | + string_ansi_from_wide infoAnsi(infoW); | |
385 | +#elif IS_FB2K_VER09 | |
386 | + string_ansi_from_utf8 infoAnsi(info8); | |
387 | +#endif | |
388 | + | |
389 | + m_infoMapAnsi.insert(std::make_pair(*it, infoAnsi)); | |
390 | + } | |
391 | + } | |
392 | + } | |
393 | + | |
394 | +#if IS_FB2K_VER08 | |
395 | + if(track) { | |
396 | + track->handle_release(); | |
397 | + } | |
398 | +#endif | |
399 | + } | |
400 | + | |
401 | + void setPlaylistStrings(std::vector<std::string> & keys) | |
402 | + { | |
403 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setPlaylistStrings - called.")); | |
404 | + | |
405 | +#if IS_FB2K_VER08 | |
406 | + int track_index; | |
407 | + track_index = playlist_oper::get()->get_now_playing(); | |
408 | +#elif IS_FB2K_VER09 | |
409 | + t_size playlist_index, track_index; | |
410 | + static_api_ptr_t<playlist_manager>()->get_playing_item_location(&playlist_index, &track_index); | |
411 | +#endif | |
412 | + | |
413 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
414 | + | |
415 | + for(it = beginIt; it != endIt; it ++) { | |
416 | + | |
417 | + string8 info8; | |
418 | + | |
419 | +#if IS_FB2K_VER08 | |
420 | + playlist_oper::get()->format_title(track_index, info8, it->c_str(), NULL); | |
421 | +#elif IS_FB2K_VER09 | |
422 | + service_ptr_t<titleformat_object> titleformat; | |
423 | + | |
424 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
425 | + static_api_ptr_t<playlist_manager>()->playlist_item_format_title(playlist_index, track_index, | |
426 | + NULL, info8, titleformat, NULL, play_control::display_level_titles); | |
427 | +#endif | |
428 | + DEBUG_TRACK_INFO8("TRACK_INFO8::setPlaylistStrings - %s: %s", it->c_str(), (LPCSTR)info8); | |
429 | + | |
430 | + m_infoMap8.insert(std::make_pair(*it, info8)); | |
431 | + | |
432 | + if(cfg_disable_ansi_trans == 0) | |
433 | + { | |
434 | +#if IS_FB2K_VER08 | |
435 | + string_wide_from_utf8 infoW(info8); | |
436 | + string_ansi_from_wide infoAnsi(infoW); | |
437 | +#elif IS_FB2K_VER09 | |
438 | + string_ansi_from_utf8 infoAnsi(info8); | |
439 | +#endif | |
440 | + | |
441 | + m_infoMapAnsi.insert(std::make_pair(*it, infoAnsi)); | |
442 | + } | |
443 | + } | |
444 | + } | |
445 | + | |
446 | +#if IS_FB2K_VER08 | |
447 | + void setNumbers(std::vector<std::string> & keys, metadb_handle * track) | |
448 | +#elif IS_FB2K_VER09 | |
449 | + void setNumbers(std::vector<std::string> & keys, metadb_handle_ptr track) | |
450 | +#endif | |
451 | + { | |
452 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setNumbers - called.")); | |
453 | + | |
454 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
455 | + | |
456 | + for(it = beginIt; it != endIt; it ++) { | |
457 | + | |
458 | + string8 info8; | |
459 | + | |
460 | +#if IS_FB2K_VER08 | |
461 | + track->handle_format_title(info8, it->c_str(), 0); | |
462 | +#elif IS_FB2K_VER09 | |
463 | + service_ptr_t<titleformat_object> titleformat; | |
464 | + | |
465 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
466 | + track->format_title(NULL, info8, titleformat, 0); | |
467 | +#endif | |
468 | + DEBUG_TRACK_INFO8("TRACK_INFO8::setNumbers - %s: %s", it->c_str(), (LPCSTR)info8); | |
469 | + | |
470 | + m_infoMapNum.insert(std::make_pair(*it, static_cast<UINT>(::atol(info8)) ) ); | |
471 | + } | |
472 | + } | |
473 | + | |
474 | + void setDynamicNumbers(std::vector<std::string> & keys) | |
475 | + { | |
476 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setDynamicNumbers - called.")); | |
477 | + | |
478 | +#if IS_FB2K_VER08 | |
479 | + metadb_handle *track = play_control::get()->get_now_playing(); | |
480 | +#elif IS_FB2K_VER09 | |
481 | + metadb_handle_ptr track; | |
482 | + static_api_ptr_t<playback_control>()->get_now_playing(track); | |
483 | +#endif | |
484 | + | |
485 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
486 | + | |
487 | + for(it = beginIt; it != endIt; it ++) { | |
488 | + | |
489 | + string8 info8; | |
490 | + | |
491 | +#if IS_FB2K_VER08 | |
492 | + play_control::get()->playback_format_title_ex(track, info8, it->c_str(), NULL, false, true); | |
493 | +#elif IS_FB2K_VER09 | |
494 | + service_ptr_t<titleformat_object> titleformat; | |
495 | + | |
496 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
497 | + static_api_ptr_t<playback_control>()->playback_format_title_ex(track, NULL, info8, titleformat, NULL, play_control::display_level_titles); | |
498 | +#endif | |
499 | + TRACE_TRACK_INFO8("TRACK_INFO8::setDynamicNumbers - %s: %s", it->c_str(), (LPCSTR)info8); | |
500 | + | |
501 | + UINT newValue = ::atol(info8); | |
502 | + UINT oldValue = getNumber(*it); | |
503 | + | |
504 | + if((newValue != 0) || (oldValue == 0)) { | |
505 | + m_infoMapNum.insert(std::make_pair(*it, static_cast<UINT>(newValue) ) ); | |
506 | + } | |
507 | + } | |
508 | + | |
509 | +#if IS_FB2K_VER08 | |
510 | + if(track) { | |
511 | + track->handle_release(); | |
512 | + } | |
513 | +#endif | |
514 | + } | |
515 | + | |
516 | + void setPlaylistNumbers(std::vector<std::string> & keys) | |
517 | + { | |
518 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setPlaylistNumbers - called.")); | |
519 | + | |
520 | +#if IS_FB2K_VER08 | |
521 | + int track_index; | |
522 | + track_index = playlist_oper::get()->get_now_playing(); | |
523 | +#elif IS_FB2K_VER09 | |
524 | + t_size playlist_index, track_index; | |
525 | + static_api_ptr_t<playlist_manager>()->get_playing_item_location(&playlist_index, &track_index); | |
526 | +#endif | |
527 | + | |
528 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
529 | + | |
530 | + for(it = beginIt; it != endIt; it ++) { | |
531 | + | |
532 | + string8 info8; | |
533 | + | |
534 | +#if IS_FB2K_VER08 | |
535 | + playlist_oper::get()->format_title(track_index, info8, it->c_str(), NULL); | |
536 | +#elif IS_FB2K_VER09 | |
537 | + service_ptr_t<titleformat_object> titleformat; | |
538 | + | |
539 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
540 | + static_api_ptr_t<playlist_manager>()->playlist_item_format_title(playlist_index, track_index, | |
541 | + NULL, info8, titleformat, NULL, play_control::display_level_titles); | |
542 | +#endif | |
543 | + DEBUG_TRACK_INFO8("TRACK_INFO8::setPlaylistNumbers - %s: %s", it->c_str(), (LPCSTR)info8); | |
544 | + | |
545 | + m_infoMapNum.insert(std::make_pair(*it, static_cast<UINT>(::atol(info8)) ) ); | |
546 | + } | |
547 | + } | |
548 | + | |
549 | + void putString(const std::string &key, const std::string &value) | |
550 | + { | |
551 | + DEBUG_TRACK_INFO8("TRACK_INFO8::putString - %s: %s", key.c_str(), value.c_str()); | |
552 | + | |
553 | + m_infoMap8.insert(std::make_pair(key, value.c_str())); | |
554 | + | |
555 | + if(cfg_disable_ansi_trans == 0) | |
556 | + { | |
557 | +#if IS_FB2K_VER08 | |
558 | + string_wide_from_utf8 valueW(value.c_str()); | |
559 | + string_ansi_from_wide valueAnsi(valueW); | |
560 | +#elif IS_FB2K_VER09 | |
561 | + string_ansi_from_utf8 valueAnsi(value.c_str()); | |
562 | +#endif | |
563 | + | |
564 | + m_infoMapAnsi.insert(std::make_pair(key, valueAnsi)); | |
565 | + } | |
566 | + } | |
567 | + | |
568 | + void putNumber(const std::string &key, UINT value) | |
569 | + { | |
570 | + DEBUG_TRACK_INFO8("TRACK_INFO8::putNumber - %s: %u", key.c_str(), value); | |
571 | + | |
572 | + m_infoMapNum.insert(std::make_pair(key, value)); | |
573 | + } | |
574 | + | |
575 | + const std::string &getString(const std::string &key, bool bForceUTF8 = false) const { | |
576 | + | |
577 | + if((bForceUTF8 == true) || (cfg_disable_ansi_trans == 1)) | |
578 | + { | |
579 | + std::map<std::string, std::string>::const_iterator it(m_infoMap8.find(key)), endIt(m_infoMap8.end()); | |
580 | + | |
581 | + if(it == endIt) { | |
582 | + return m_nullStr; | |
583 | + } | |
584 | + | |
585 | + return it->second; | |
586 | + } | |
587 | + else | |
588 | + { | |
589 | + std::map<std::string, std::string>::const_iterator it(m_infoMapAnsi.find(key)), endIt(m_infoMapAnsi.end()); | |
590 | + | |
591 | + if(it == endIt) { | |
592 | + return m_nullStr; | |
593 | + } | |
594 | + | |
595 | + return it->second; | |
596 | + } | |
597 | + } | |
598 | + | |
599 | + const UINT getNumber(const std::string &key) const { | |
600 | + | |
601 | + std::map<std::string, UINT>::const_iterator it(m_infoMapNum.find(key)), endIt(m_infoMapNum.end()); | |
602 | + | |
603 | + if(it == endIt) { | |
604 | + return 0; | |
605 | + } | |
606 | + | |
607 | + return it->second; | |
608 | + } | |
609 | + | |
610 | +}; | |
611 | + | |
612 | +class PlayInfo | |
613 | +{ | |
614 | + public: | |
615 | + | |
616 | + enum EPlayStatus | |
617 | + { | |
618 | + PLAY_STOP = 0, | |
619 | + PLAY_START = 1, | |
620 | + PLAY_PAUSE = 3 | |
621 | + }; | |
622 | + | |
623 | + public: | |
624 | + | |
625 | + PlayInfo() : | |
626 | + m_playStatus(PLAY_STOP), | |
627 | + m_playLength(0), | |
628 | + m_playPosition(0), | |
629 | + m_playCount(0) { | |
630 | + } | |
631 | + | |
632 | + public: | |
633 | + | |
634 | + void setPlayStatusStart() { | |
635 | + setPlayStatus(PLAY_START); | |
636 | + } | |
637 | + | |
638 | + void setPlayStatusStop() { | |
639 | + setPlayStatus(PLAY_STOP); | |
640 | + } | |
641 | + | |
642 | + void setPlayStatusPause() { | |
643 | + setPlayStatus(PLAY_PAUSE); | |
644 | + } | |
645 | + | |
646 | + void clearPlayInfo() | |
647 | + { | |
648 | + setPlayStatusStop(); | |
649 | + setPlayPosition(0); | |
650 | + setPlayLength(0); | |
651 | + } | |
652 | + | |
653 | + void incrementPlayCount() { | |
654 | + setPlayCount(getPlayCount() + 1); | |
655 | + } | |
656 | + | |
657 | + public: | |
658 | + | |
659 | + EPlayStatus getPlayStatus() const { | |
660 | + return m_playStatus; | |
661 | + } | |
662 | + | |
663 | + void setPlayStatus(EPlayStatus status) { | |
664 | + m_playStatus = status; | |
665 | + } | |
666 | + | |
667 | + int getPlayPosition() const { | |
668 | + return m_playPosition; | |
669 | + } | |
670 | + | |
671 | + void setPlayPosition(int pos) { | |
672 | + m_playPosition = pos; | |
673 | + } | |
674 | + | |
675 | + double getPlayLength() const { | |
676 | + return m_playLength; | |
677 | + } | |
678 | + | |
679 | + void setPlayLength(double len) { | |
680 | + m_playLength = len; | |
681 | + } | |
682 | + | |
683 | + int getPlayCount() const { | |
684 | + return m_playCount; | |
685 | + } | |
686 | + | |
687 | + void setPlayCount(int count) { | |
688 | + m_playCount = count; | |
689 | + } | |
690 | + | |
691 | + protected: | |
692 | + | |
693 | + EPlayStatus m_playStatus; | |
694 | + | |
695 | + double m_playLength; | |
696 | + int m_playPosition; | |
697 | + int m_playCount; | |
698 | +}; | |
699 | + | |
700 | +class Probe | |
701 | +{ | |
702 | + public: | |
703 | + | |
704 | + Probe() : | |
705 | + m_hHuygensWnd((HWND)INVALID_HANDLE_VALUE), | |
706 | + m_GETPLAYLISTFILE_time(0) { | |
707 | + | |
708 | + m_huygensTitle = _T(DEFAULT_HUYGENS_TITLE); | |
709 | + } | |
710 | + | |
711 | + ~Probe() | |
712 | + { | |
713 | + release(); | |
714 | + } | |
715 | + | |
716 | + public: | |
717 | + | |
718 | + static Probe *getInstance() | |
719 | + { | |
720 | + if(m_pMe == NULL) | |
721 | + { | |
722 | + m_pMe = new Probe(); | |
723 | + } | |
724 | + | |
725 | + return m_pMe; | |
726 | + } | |
727 | + | |
728 | + void load() | |
729 | + { | |
730 | + TRACE_HUYGENS_INIT(_T("Probe::load - called.")); | |
731 | + | |
732 | + // create huygens window | |
733 | + createWindow(); | |
734 | + } | |
735 | + | |
736 | + void release() | |
737 | + { | |
738 | + TRACE_HUYGENS_INIT(_T("Probe::release - called.")); | |
739 | + | |
740 | + // destruct huygens window | |
741 | + destroyWindow(); | |
742 | + } | |
743 | + | |
744 | + void updateProbeTitle() | |
745 | + { | |
746 | + tstring huygensTitle = makeProbeTitle(getBaseHuygensTitle()); | |
747 | + | |
748 | + setHuygensTitle(huygensTitle.c_str()); | |
749 | + | |
750 | + ::SetWindowText(getWnd(), huygensTitle.c_str()); | |
751 | + } | |
752 | + | |
753 | + void clearProbeTitle() | |
754 | + { | |
755 | + uSetWindowText(getWnd(), DEFAULT_HUYGENS_TITLE); | |
756 | + } | |
757 | + | |
758 | + void createWindow() | |
759 | + { | |
760 | + TRACE_PLUGIN(_T("Probe::createWindow - called.")); | |
761 | + | |
762 | + if(getWnd() == INVALID_HANDLE_VALUE) | |
763 | + { | |
764 | + // create huygens window | |
765 | + setWnd(createHuygensWindow()); | |
766 | + } | |
767 | + } | |
768 | + | |
769 | + public: | |
770 | + | |
771 | + HWND getWnd() const { | |
772 | + return m_hHuygensWnd; | |
773 | + } | |
774 | + | |
775 | + const TRACK_INFO8 &getTrackInfo8() const { | |
776 | + return m_trackInfo8; | |
777 | + } | |
778 | + | |
779 | + TRACK_INFO8 &getMutableTrackInfo8() { | |
780 | + return m_trackInfo8; | |
781 | + } | |
782 | + | |
783 | + void setTrackInfo8(const TRACK_INFO8 &trackInfo8) { | |
784 | + m_trackInfo8 = trackInfo8; | |
785 | + } | |
786 | + | |
787 | + PlayInfo &getPlayInfo() { | |
788 | + return m_playInfo; | |
789 | + } | |
790 | + | |
791 | + const PlayInfo &getPlayInfo() const { | |
792 | + return m_playInfo; | |
793 | + } | |
794 | + | |
795 | + void setPlaylistTitle(LPCTSTR pTitle) { | |
796 | + | |
797 | + TRACE_PLUGIN(_T("Probe::setPlayListTitle - %s"), pTitle); | |
798 | + | |
799 | + m_playlistTitle = pTitle; | |
800 | + | |
801 | + string_utf8_from_os playListTitle8(pTitle); | |
802 | + | |
803 | + if(cfg_disable_ansi_trans == 1) | |
804 | + { | |
805 | + | |
806 | + m_playlistTitle8 = playListTitle8; | |
807 | + } | |
808 | + else | |
809 | + { | |
810 | +#if IS_FB2K_VER08 | |
811 | + string_wide_from_utf8 playListTitleW(playListTitle8); | |
812 | + string_ansi_from_wide playListTitleAnsi(playListTitleW); | |
813 | +#elif IS_FB2K_VER09 | |
814 | + string_ansi_from_utf8 playListTitleAnsi(playListTitle8); | |
815 | +#endif | |
816 | + m_playlistTitle8 = playListTitleAnsi; | |
817 | + } | |
818 | + } | |
819 | + | |
820 | + const tstring &getPlaylistTitle() const { | |
821 | + return m_playlistTitle; | |
822 | + } | |
823 | + | |
824 | + const string8 &getPlaylistTitle8() const { | |
825 | + return m_playlistTitle8; | |
826 | + } | |
827 | + | |
828 | + void setHuygensTitle(LPCTSTR pTitle) { | |
829 | + | |
830 | + TRACE_PLUGIN(_T("Probe::setHuygensTitle - %s"), pTitle); | |
831 | + | |
832 | + m_huygensTitle = pTitle; | |
833 | + } | |
834 | + | |
835 | + const tstring &getHuygensTitle() const { | |
836 | + return m_huygensTitle; | |
837 | + } | |
838 | + | |
839 | + void setBaseHuygensTitle(LPCTSTR pTitle) | |
840 | + { | |
841 | + TRACE_PLUGIN(_T("Probe::setBaseHuygensTitle - %s"), pTitle); | |
842 | + | |
843 | + m_baseHuygensTitle = pTitle; | |
844 | + | |
845 | + updateProbeTitle(); | |
846 | + } | |
847 | + | |
848 | + const tstring &getBaseHuygensTitle() const { | |
849 | + return m_baseHuygensTitle; | |
850 | + } | |
851 | + | |
852 | + void showProbeWindow(bool bShow) { | |
853 | + showProbeWindow(getWnd(), bShow); | |
854 | + } | |
855 | + | |
856 | + protected: | |
857 | + | |
858 | + void setWnd(HWND hWnd) { | |
859 | + m_hHuygensWnd = hWnd; | |
860 | + } | |
861 | + | |
862 | + int getGetPlayListFileTime() const { | |
863 | + return m_GETPLAYLISTFILE_time; | |
864 | + } | |
865 | + | |
866 | + void setGetPlayListFileTime(int time) { | |
867 | + m_GETPLAYLISTFILE_time = time; | |
868 | + } | |
869 | + | |
870 | + protected: | |
871 | + | |
872 | + HWND createHuygensWindow() | |
873 | + { | |
874 | + TRACE_PLUGIN(_T("Probe::createHuygensWindow - called.")); | |
875 | + | |
876 | + static bool isInited = false; | |
877 | + | |
878 | +#if IS_FB2K_VER08 | |
879 | + static const char class_name[] = CLASSNAME; | |
880 | + if (!isInited) | |
881 | + { | |
882 | + isInited = true; | |
883 | + uWNDCLASS wc; | |
884 | + memset(&wc,0,sizeof(wc)); | |
885 | + wc.style = 0; | |
886 | + wc.lpfnWndProc = windowproc; | |
887 | + wc.hInstance = core_api::get_my_instance(); | |
888 | + wc.hCursor = NULL; //uLoadCursor(0, IDC_ARROW); | |
889 | + wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); | |
890 | + wc.lpszClassName = class_name; | |
891 | + uRegisterClass(&wc); | |
892 | + } | |
893 | + HWND hHuygensWnd = uCreateWindowEx( | |
894 | + 0, class_name, DEFAULT_HUYGENS_TITLE, | |
895 | + WS_OVERLAPPED|WS_CAPTION|WS_SIZEBOX, | |
896 | + CW_USEDEFAULT, CW_USEDEFAULT, 300, 150, | |
897 | + core_api::get_main_window(), 0, core_api::get_my_instance(), NULL | |
898 | + ); | |
899 | +#elif IS_FB2K_VER09 | |
900 | + static const TCHAR class_name[] = CLASSNAME; | |
901 | + if (!isInited) | |
902 | + { | |
903 | + isInited = true; | |
904 | + WNDCLASS wc; | |
905 | + memset(&wc,0,sizeof(wc)); | |
906 | + wc.style = 0; | |
907 | + wc.lpfnWndProc = windowproc; | |
908 | + wc.hInstance = core_api::get_my_instance(); | |
909 | + wc.hCursor = NULL; //uLoadCursor(0, IDC_ARROW); | |
910 | + wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); | |
911 | + wc.lpszClassName = class_name; | |
912 | + RegisterClass(&wc); | |
913 | + } | |
914 | + HWND hHuygensWnd = CreateWindowEx( | |
915 | + 0, class_name, _T(DEFAULT_HUYGENS_TITLE), | |
916 | + WS_OVERLAPPED|WS_CAPTION|WS_SIZEBOX, | |
917 | + CW_USEDEFAULT, CW_USEDEFAULT, 300, 150, | |
918 | + core_api::get_main_window(), 0, core_api::get_my_instance(), NULL | |
919 | + ); | |
920 | +#endif | |
921 | + if (!hHuygensWnd) | |
922 | + { | |
923 | + LOG_ERROR(_T("Probe::createHuygensWindow - Create Probe window failed.")); | |
924 | + | |
925 | + return NULL; | |
926 | + } | |
927 | + | |
928 | + DEBUG_PLUGIN(_T("Probe::createHuygensWindow - Probe window created.")); | |
929 | + | |
930 | + showProbeWindow(hHuygensWnd, cfg_show_huygens == 1); | |
931 | + | |
932 | + return hHuygensWnd; | |
933 | + } | |
934 | + | |
935 | + void showProbeWindow(HWND hHuygensWnd, bool bShow) | |
936 | + { | |
937 | + if(bShow) { | |
938 | + ShowWindow(hHuygensWnd, SW_SHOW); | |
939 | + } else { | |
940 | + ShowWindow(hHuygensWnd, SW_HIDE); | |
941 | + } | |
942 | + } | |
943 | + | |
944 | + void destroyWindow() | |
945 | + { | |
946 | + TRACE_PLUGIN(_T("Probe::destroyWindow - called.")); | |
947 | + | |
948 | + if(getWnd() != INVALID_HANDLE_VALUE) | |
949 | + { | |
950 | + uDestroyWindow(getWnd()); | |
951 | + | |
952 | +#if IS_FB2K_VER08 | |
953 | + uUnregisterClass(CLASSNAME, core_api::get_my_instance()); | |
954 | +#elif IS_FB2K_VER09 | |
955 | + UnregisterClass(CLASSNAME, core_api::get_my_instance()); | |
956 | +#endif | |
957 | + | |
958 | + setWnd((HWND)INVALID_HANDLE_VALUE); | |
959 | + } | |
960 | + } | |
961 | + | |
962 | + tstring makeProbeTitle(const tstring &rawTitle) | |
963 | + { | |
964 | + TRACE_PLUGIN(_T("Probe::makeProbeTitle - called.")); | |
965 | + | |
966 | + Str64K formatBuf; | |
967 | + | |
968 | + _stprintf_s( | |
969 | + formatBuf, sizeof(formatBuf) / sizeof(TCHAR), | |
970 | + _T("%d. %s - ") _T(DEFAULT_HUYGENS_TITLE), | |
971 | + m_trackInfo8.getNumber(FORMAT_LISTINDEX), | |
972 | + (LPCTSTR)rawTitle.c_str() | |
973 | + ); | |
974 | + | |
975 | + return formatBuf; | |
976 | + } | |
977 | + | |
978 | + void refreshTitle() | |
979 | + { | |
980 | + // get formatted dynamic titles | |
981 | + string8 huygens_title8; | |
982 | + string8 playlist_title8; | |
983 | +#if IS_FB2K_VER08 | |
984 | + metadb_handle *track = play_control::get()->get_now_playing(); | |
985 | + if(track) | |
986 | + { | |
987 | + play_control::get()->playback_format_title_ex(track, huygens_title8, cfg_huygens_title_format, NULL, false, true); | |
988 | + play_control::get()->playback_format_title_ex(track, playlist_title8, cfg_huygens_playlist_format, NULL, false, true); | |
989 | + track->handle_release(); | |
990 | + } | |
991 | +#elif IS_FB2K_VER09 | |
992 | + metadb_handle_ptr track; | |
993 | + static_api_ptr_t<playback_control>()->get_now_playing(track); | |
994 | + | |
995 | + service_ptr_t<titleformat_object> titleformat; | |
996 | + | |
997 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, cfg_huygens_title_format); | |
998 | + static_api_ptr_t<playback_control>()->playback_format_title_ex(track, NULL, huygens_title8, titleformat, NULL, play_control::display_level_all); | |
999 | + | |
1000 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, cfg_huygens_playlist_format); | |
1001 | + static_api_ptr_t<playback_control>()->playback_format_title_ex(track, NULL, playlist_title8, titleformat, NULL, play_control::display_level_all); | |
1002 | +#endif | |
1003 | + // convert utf8 track informations to os charset | |
1004 | + string_os_from_utf8 huygens_title(huygens_title8); | |
1005 | + string_os_from_utf8 playlist_title(playlist_title8); | |
1006 | + | |
1007 | + // set base huygens title to huygens | |
1008 | + setBaseHuygensTitle(huygens_title); | |
1009 | + | |
1010 | + // set huygens playlist current item title to huygens | |
1011 | + setPlaylistTitle(playlist_title); | |
1012 | + } | |
1013 | + | |
1014 | + protected: | |
1015 | + | |
1016 | + static LRESULT WINAPI windowproc(HWND wnd,UINT msg, WPARAM wp, LPARAM lp); | |
1017 | + static std::pair<bool, LRESULT> WINAPI huyIpcWindowProc(HWND wnd,UINT msg, WPARAM wp, LPARAM lp); | |
1018 | + | |
1019 | + protected: | |
1020 | + | |
1021 | + static Probe *m_pMe; | |
1022 | + | |
1023 | + HWND m_hHuygensWnd; | |
1024 | + | |
1025 | + PlayInfo m_playInfo; | |
1026 | + | |
1027 | + TRACK_INFO8 m_trackInfo8; | |
1028 | + int m_GETPLAYLISTFILE_time; | |
1029 | + | |
1030 | + tstring m_playlistTitle; | |
1031 | + string8 m_playlistTitle8; | |
1032 | + | |
1033 | + tstring m_huygensTitle; | |
1034 | + tstring m_baseHuygensTitle; | |
1035 | +}; | |
1036 | + | |
1037 | +Probe *Probe::m_pMe = NULL; | |
1038 | + | |
1039 | +LRESULT CALLBACK Probe::windowproc(HWND wnd,UINT msg, WPARAM wp, LPARAM lp) | |
1040 | +{ | |
1041 | + switch(msg) | |
1042 | + { | |
1043 | + case WM_CLOSE: | |
1044 | + DEBUG_HUYGENS_PROC(_T("Probe::windowproc - WM_CLOSE")); | |
1045 | + Probe::getInstance()->destroyWindow(); | |
1046 | + return 0; | |
1047 | + | |
1048 | + case WM_HUY_IPC: | |
1049 | + { | |
1050 | + if(cfg_use_plugin == 1) { | |
1051 | + std::pair<bool, LRESULT> res = huyIpcWindowProc(wnd, msg, wp, lp); | |
1052 | + if(res.first == true) { | |
1053 | + return res.second; | |
1054 | + } | |
1055 | + } | |
1056 | + } | |
1057 | + break; | |
1058 | + | |
1059 | + default: | |
1060 | + if(InSendMessage()) { | |
1061 | + TRACE_HUYGENS_PROC(_T("Probe::windowproc - Unknown MSG from other thread / MSG:%04x, W:%08x, L:%08x"), msg, wp, lp); | |
1062 | + } | |
1063 | + break; | |
1064 | + } | |
1065 | + | |
1066 | + return uDefWindowProc(wnd,msg,wp,lp); | |
1067 | +} | |
1068 | + | |
1069 | +std::pair<bool, LRESULT> WINAPI Probe::huyIpcWindowProc(HWND wnd,UINT msg, WPARAM wp, LPARAM lp) | |
1070 | +{ | |
1071 | + static string8 pluginVersion = PLUGIN_VERSION_VAL; | |
1072 | + | |
1073 | + switch(msg) | |
1074 | + { | |
1075 | + case WM_HUY_IPC: | |
1076 | + { | |
1077 | + PlayInfo::EPlayStatus playStatus = Probe::getInstance()->getPlayInfo().getPlayStatus(); | |
1078 | + double playLength = Probe::getInstance()->getPlayInfo().getPlayLength(); | |
1079 | + int playCount = Probe::getInstance()->getPlayInfo().getPlayCount(); | |
1080 | + | |
1081 | + switch(lp) | |
1082 | + { | |
1083 | + case HUY_GETVERSION: // 0x0000 | |
1084 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETVERSION / version [%s]", (LPCSTR)pluginVersion); | |
1085 | + return std::make_pair(true, (LRESULT)(LPCSTR)pluginVersion); | |
1086 | + | |
1087 | + case HUY_GETFB2KVERSION: // 0x0001 | |
1088 | + { | |
1089 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETFB2KVERSION / version [%s]", | |
1090 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_FB2KVERSION, true).c_str()); | |
1091 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_FB2KVERSION).c_str()); | |
1092 | + } | |
1093 | + | |
1094 | + case HUY_GETENCODEMODE: // 0x0002 | |
1095 | + { | |
1096 | + UINT isUTF8 = cfg_disable_ansi_trans == 1 ? 1 : 0; | |
1097 | + | |
1098 | + TRACE_HUYGENS_PROC( | |
1099 | + _T("Probe::huyIpcWindowProc - HUY_GETENCODEMODE / encode mode [%u]"), isUTF8); | |
1100 | + | |
1101 | + return std::make_pair(true, isUTF8); | |
1102 | + } | |
1103 | + | |
1104 | + case HUY_GETFILEPATH: // 0x0100 | |
1105 | + { | |
1106 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETFILEPATH / path [%s]", | |
1107 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILEPATH, true).c_str()); | |
1108 | + | |
1109 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILEPATH).c_str()); | |
1110 | + } | |
1111 | + | |
1112 | + case HUY_GETDURATION: // 0x0101 | |
1113 | + | |
1114 | + if(playStatus == PlayInfo::PLAY_START) | |
1115 | + { | |
1116 | + UINT duration = static_cast<int>(playLength * 1000); | |
1117 | + | |
1118 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETDURATION / length [%.3f sec.]"), duration / 1000.0); | |
1119 | + return std::make_pair(true, duration); | |
1120 | + } | |
1121 | + | |
1122 | + return std::make_pair(true, -1); | |
1123 | + | |
1124 | + case HUY_GETARTIST: // 0x0102 | |
1125 | + { | |
1126 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETARTIST / artist [%s]", | |
1127 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_ARTIST, true).c_str()); | |
1128 | + | |
1129 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_ARTIST).c_str()); | |
1130 | + } | |
1131 | + | |
1132 | + case HUY_GETTRACKTITLE: // 0x0103 | |
1133 | + { | |
1134 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETTRACKTITLE / title [%s]", | |
1135 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKTITLE, true).c_str()); | |
1136 | + | |
1137 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKTITLE).c_str()); | |
1138 | + } | |
1139 | + | |
1140 | + case HUY_GETALBUMTITLE: // 0x0104 | |
1141 | + { | |
1142 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETALBUMTITLE / album [%s]", | |
1143 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_ALBUMTITLE, true).c_str()); | |
1144 | + | |
1145 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_ALBUMTITLE).c_str()); | |
1146 | + } | |
1147 | + | |
1148 | + case HUY_GETDATE: // 0x0105 | |
1149 | + { | |
1150 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETDATE / date [%s]", | |
1151 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKDATE, true).c_str()); | |
1152 | + | |
1153 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKDATE).c_str()); | |
1154 | + } | |
1155 | + | |
1156 | + case HUY_GETCOMPOSER: // 0x0106 | |
1157 | + { | |
1158 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETCOMPOSER / composer [%s]", | |
1159 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_COMPOSER, true).c_str()); | |
1160 | + | |
1161 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_COMPOSER).c_str()); | |
1162 | + } | |
1163 | + | |
1164 | + case HUY_GETPERFORMER: // 0x0107 | |
1165 | + { | |
1166 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETPERFORMER / performer [%s]", | |
1167 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_PERFORMER, true).c_str()); | |
1168 | + | |
1169 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_PERFORMER).c_str()); | |
1170 | + } | |
1171 | + | |
1172 | + case HUY_GETALBUMARTIST: // 0x0108 | |
1173 | + { | |
1174 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETALBUMARTIST / album artist [%s]", | |
1175 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_ALBUMARTIST, true).c_str()); | |
1176 | + | |
1177 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_ALBUMARTIST).c_str()); | |
1178 | + } | |
1179 | + | |
1180 | + case HUY_GETTRACKARTIST: // 0x0119 | |
1181 | + { | |
1182 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETTRACKARTIST / track artist [%s]", | |
1183 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKARTIST, true).c_str()); | |
1184 | + | |
1185 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKARTIST).c_str()); | |
1186 | + } | |
1187 | + | |
1188 | + case HUY_GETTRACKNO: // 0x0109 | |
1189 | + { | |
1190 | + UINT nTrack = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_TRACKNUMBER); | |
1191 | + | |
1192 | + TRACE_HUYGENS_PROC( | |
1193 | + _T("Probe::huyIpcWindowProc - HUY_GETTRACKNO / track number [%u]"), nTrack); | |
1194 | + | |
1195 | + return std::make_pair(true, nTrack); | |
1196 | + } | |
1197 | + | |
1198 | + case HUY_GETTOTALTRACKS: // 0x010A | |
1199 | + { | |
1200 | + UINT nTrack = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_TRACKTOTAL); | |
1201 | + | |
1202 | + TRACE_HUYGENS_PROC( | |
1203 | + _T("Probe::huyIpcWindowProc - HUY_GETTOTALTRACK / total track number [%u]"), nTrack); | |
1204 | + | |
1205 | + return std::make_pair(true, nTrack); | |
1206 | + } | |
1207 | + | |
1208 | + case HUY_GETDISCNO: // 0x010B | |
1209 | + { | |
1210 | + UINT nDisc = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_DISCNUMBER); | |
1211 | + | |
1212 | + TRACE_HUYGENS_PROC( | |
1213 | + _T("Probe::huyIpcWindowProc - HUY_GETDISCNO / disc number [%u]"), nDisc); | |
1214 | + | |
1215 | + return std::make_pair(true, nDisc); | |
1216 | + } | |
1217 | + | |
1218 | + case HUY_GETTOTALDISCS: // 0x010C | |
1219 | + { | |
1220 | + UINT nDisc = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_DISCTOTAL); | |
1221 | + | |
1222 | + TRACE_HUYGENS_PROC( | |
1223 | + _T("Probe::huyIpcWindowProc - HUY_GETTOTALDISC / total track number [%u]"), nDisc); | |
1224 | + | |
1225 | + return std::make_pair(true, nDisc); | |
1226 | + } | |
1227 | + | |
1228 | + case HUY_GETCOMMENT: // 0x010D | |
1229 | + { | |
1230 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETCOMMENT / comment [%s]", | |
1231 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_COMMENT, true).c_str()); | |
1232 | + | |
1233 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_COMMENT).c_str()); | |
1234 | + } | |
1235 | + | |
1236 | + case HUY_GETSAMPLERATE: // 0x010E | |
1237 | + { | |
1238 | + UINT nRate = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_SAMPLERATE); | |
1239 | + | |
1240 | + TRACE_HUYGENS_PROC( | |
1241 | + _T("Probe::huyIpcWindowProc - HUY_GETSAMPLERATE / sampling rate [%u Hz]"), nRate); | |
1242 | + | |
1243 | + return std::make_pair(true, nRate); | |
1244 | + } | |
1245 | + | |
1246 | + case HUY_GETBITRATE: // 0x010F | |
1247 | + { | |
1248 | + UINT nRate = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_BITRATE); | |
1249 | + | |
1250 | + TRACE_HUYGENS_PROC( | |
1251 | + _T("Probe::huyIpcWindowProc - HUY_GETBITRATE / bitrate [%u kbps]"), nRate); | |
1252 | + | |
1253 | + return std::make_pair(true, nRate); | |
1254 | + } | |
1255 | + | |
1256 | + case HUY_GETBITRATENOMINAL: // 0x0127 | |
1257 | + { | |
1258 | + UINT nRate = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_BITRATE_NOMINAL); | |
1259 | + | |
1260 | + TRACE_HUYGENS_PROC( | |
1261 | + _T("Probe::huyIpcWindowProc - HUY_GETBITRATENOMINAL / nominal bitrate [%u kbps]"), nRate); | |
1262 | + | |
1263 | + return std::make_pair(true, nRate); | |
1264 | + } | |
1265 | + | |
1266 | + case HUY_GETBITRATEDYNAMIC: // 0x012C | |
1267 | + { | |
1268 | + UINT nRate = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_BITRATE_DYNAMIC); | |
1269 | + | |
1270 | + TRACE_HUYGENS_PROC( | |
1271 | + _T("Probe::huyIpcWindowProc - HUY_GETBITRATEDYNAMIC / dynamic bitrate [%u kbps]"), nRate); | |
1272 | + | |
1273 | + return std::make_pair(true, nRate); | |
1274 | + } | |
1275 | + | |
1276 | + case HUY_GETCHANNELS: // 0x0110 | |
1277 | + { | |
1278 | + UINT nCh = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_CHANNELS); | |
1279 | + | |
1280 | + TRACE_HUYGENS_PROC( | |
1281 | + _T("Probe::huyIpcWindowProc - HUY_GETCHANNELS / channels [%u]"), nCh); | |
1282 | + | |
1283 | + return std::make_pair(true, nCh); | |
1284 | + } | |
1285 | + | |
1286 | + case HUY_GETBITSPERSAMPLE: // 0x011C | |
1287 | + { | |
1288 | + UINT nBitsPerSample = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_BITSPERSAMPLE); | |
1289 | + | |
1290 | + TRACE_HUYGENS_PROC( | |
1291 | + _T("Probe::huyIpcWindowProc - HUY_GETBITSPERSAMPLE / bits/Sample [%u]"), nBitsPerSample); | |
1292 | + | |
1293 | + return std::make_pair(true, nBitsPerSample); | |
1294 | + } | |
1295 | + | |
1296 | + case HUY_GETCODEC: // 0x0111 | |
1297 | + { | |
1298 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETCODEC / codec [%s]", | |
1299 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_CODEC, true).c_str()); | |
1300 | + | |
1301 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_CODEC).c_str()); | |
1302 | + } | |
1303 | + | |
1304 | + case HUY_GETCODECPROFILE: // 0x0112 | |
1305 | + { | |
1306 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETCODECPROFILE / codec profile [%s]", | |
1307 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_CODECPROFILE, true).c_str()); | |
1308 | + | |
1309 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_CODECPROFILE).c_str()); | |
1310 | + } | |
1311 | + | |
1312 | + case HUY_ISLOSSLESS: // 0x0113 | |
1313 | + { | |
1314 | + UINT isLossless = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_LOSSLESS); | |
1315 | + | |
1316 | + TRACE_HUYGENS_PROC( | |
1317 | + _T("Probe::huyIpcWindowProc - HUY_ISLOSSLESS / lossless flag [%u]"), isLossless); | |
1318 | + | |
1319 | + return std::make_pair(true, isLossless); | |
1320 | + } | |
1321 | + | |
1322 | + case HUY_GETTAGTYPE: // 0x0114 | |
1323 | + { | |
1324 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETTAGTYPE / tag type [%s]", | |
1325 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_TAGTYPE, true).c_str()); | |
1326 | + | |
1327 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_TAGTYPE).c_str()); | |
1328 | + } | |
1329 | + | |
1330 | + case HUY_GETEXTRAINFO: // 0x011D | |
1331 | + { | |
1332 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETEXTRAINFO / extrainfo [%s]", | |
1333 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_EXTRAINFO, true).c_str()); | |
1334 | + | |
1335 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_EXTRAINFO).c_str()); | |
1336 | + } | |
1337 | + | |
1338 | + case HUY_GETTOOL: // 0x011E | |
1339 | + { | |
1340 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETTOOL / tool [%s]", | |
1341 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_TOOL, true).c_str()); | |
1342 | + | |
1343 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_TOOL).c_str()); | |
1344 | + } | |
1345 | + | |
1346 | + case HUY_GETCUEEMBEDDED: // 0x011F | |
1347 | + { | |
1348 | + UINT isEmbedded = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_CUEEMBEDDED); | |
1349 | + | |
1350 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETCUEEMBEDDED / embedded flag [%u]", isEmbedded); | |
1351 | + | |
1352 | + return std::make_pair(true, (LRESULT)(LPCSTR)isEmbedded); | |
1353 | + } | |
1354 | + | |
1355 | + case HUY_GETAUDIOMD5HASH: // 0x0120 | |
1356 | + { | |
1357 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETAUDIOMD5HASH / tag type [%s]", | |
1358 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_AUDIOMD5HASH, true).c_str()); | |
1359 | + | |
1360 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_AUDIOMD5HASH).c_str()); | |
1361 | + } | |
1362 | + | |
1363 | + case HUY_GETMP3STEREOMODE: // 0x0121 | |
1364 | + { | |
1365 | + UINT isJointStereo = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_MP3STEREOMODE); | |
1366 | + | |
1367 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETMP3STEREOMODE / stereo mode [%u]", isJointStereo); | |
1368 | + | |
1369 | + return std::make_pair(true, (LRESULT)(LPCSTR)isJointStereo); | |
1370 | + } | |
1371 | + | |
1372 | + case HUY_GETMP3ACCURATELENGTH: // 0x0122 | |
1373 | + { | |
1374 | + UINT isAcculateLength = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_MP3ACCURATELENGTH); | |
1375 | + | |
1376 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETMP3ACCULATELENGTH / acculate length flag [%u]", isAcculateLength); | |
1377 | + | |
1378 | + return std::make_pair(true, (LRESULT)(LPCSTR)isAcculateLength); | |
1379 | + } | |
1380 | + | |
1381 | + case HUY_GETMP3ENCDELAY: // 0x0123 | |
1382 | + { | |
1383 | + UINT nEncDelay = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_MP3ENCDELAY); | |
1384 | + | |
1385 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETMP3ENCDELAY / encoder delay [%u]", nEncDelay); | |
1386 | + | |
1387 | + return std::make_pair(true, (LRESULT)(LPCSTR)nEncDelay); | |
1388 | + } | |
1389 | + | |
1390 | + case HUY_GETMP3ENCPADDING: // 0x0124 | |
1391 | + { | |
1392 | + UINT nEncPadding = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_MP3ENCPADDING); | |
1393 | + | |
1394 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETMP3ENCPADDING / encoder padding [%u]", nEncPadding); | |
1395 | + | |
1396 | + return std::make_pair(true, (LRESULT)(LPCSTR)nEncPadding); | |
1397 | + } | |
1398 | + | |
1399 | + case HUY_GETAPEVERSION: // 0x0125 | |
1400 | + { | |
1401 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETAPEVERSION / ape version [%s]", | |
1402 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_APEVERSION, true).c_str()); | |
1403 | + | |
1404 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_APEVERSION).c_str()); | |
1405 | + } | |
1406 | + | |
1407 | + case HUY_GETAPEFLAGS: // 0x0126 | |
1408 | + { | |
1409 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETAPEFLAGS / ape flags [%s]", | |
1410 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_APEFLAGS, true).c_str()); | |
1411 | + | |
1412 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_APEFLAGS).c_str()); | |
1413 | + } | |
1414 | + | |
1415 | + case HUY_GETREPLAYGAIN_ALBUMGAIN: // 0x0128 | |
1416 | + { | |
1417 | + UINT nAlbumGain = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_REPLAYGAIN_ALBUMGAIN); | |
1418 | + | |
1419 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETREPLAYGAIN_ALBUMGAIN / album gain [%u]", nAlbumGain); | |
1420 | + | |
1421 | + return std::make_pair(true, (LRESULT)(LPCSTR)nAlbumGain); | |
1422 | + } | |
1423 | + | |
1424 | + case HUY_GETREPLAYGAIN_ALBUMPEEK: // 0x0129 | |
1425 | + { | |
1426 | + UINT nAlbumPeek = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_REPLAYGAIN_ALBUMPEEK); | |
1427 | + | |
1428 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETREPLAYGAIN_ALBUMPEEK / album peek [%u]", nAlbumPeek); | |
1429 | + | |
1430 | + return std::make_pair(true, (LRESULT)(LPCSTR)nAlbumPeek); | |
1431 | + } | |
1432 | + | |
1433 | + case HUY_GETREPLAYGAIN_TRACKGAIN: // 0x012A | |
1434 | + { | |
1435 | + UINT nTrackGain = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_REPLAYGAIN_TRACKGAIN); | |
1436 | + | |
1437 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETREPLAYGAIN_TRACKGAIN / track gain [%u]", nTrackGain); | |
1438 | + | |
1439 | + return std::make_pair(true, (LRESULT)(LPCSTR)nTrackGain); | |
1440 | + } | |
1441 | + | |
1442 | + case HUY_GETREPLAYGAIN_TRACKPEEK: // 0x012B | |
1443 | + { | |
1444 | + UINT nTrackPeek = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_REPLAYGAIN_TRACKPEEK); | |
1445 | + | |
1446 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETREPLAYGAIN_TRACKPEEK / track peek [%u]", nTrackPeek); | |
1447 | + | |
1448 | + return std::make_pair(true, (LRESULT)(LPCSTR)nTrackPeek); | |
1449 | + } | |
1450 | + | |
1451 | + case HUY_GETFILESIZE: // 0x0115 | |
1452 | + { | |
1453 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETFILESIZE / filesize [%s]"), | |
1454 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILESIZE, true).c_str()); | |
1455 | + | |
1456 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILESIZE).c_str()); | |
1457 | + } | |
1458 | + | |
1459 | + case HUY_GETFILECREATED: // 0x0116 | |
1460 | + { | |
1461 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETFILECREATED / created date [%s]"), | |
1462 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILECREATED, true).c_str()); | |
1463 | + | |
1464 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILECREATED).c_str()); | |
1465 | + } | |
1466 | + | |
1467 | + case HUY_GETFILELASTMOD: // 0x0117 | |
1468 | + { | |
1469 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETFILELASTMOD / last modified date [%s]"), | |
1470 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILELASTMOD, true).c_str()); | |
1471 | + | |
1472 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILELASTMOD).c_str()); | |
1473 | + } | |
1474 | + | |
1475 | + case HUY_ISINMEDIALIB: // 0x0118 | |
1476 | + { | |
1477 | + UINT isInMediaLibrary = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_ISINMEDIALIB); | |
1478 | + | |
1479 | + TRACE_HUYGENS_PROC( | |
1480 | + _T("Probe::huyIpcWindowProc - HUY_ISINMEDIALIB / lossless flag [%u]"), isInMediaLibrary); | |
1481 | + | |
1482 | + return std::make_pair(true, isInMediaLibrary); | |
1483 | + } | |
1484 | + | |
1485 | + case HUY_GETSTATUS: // 0x0200 | |
1486 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETSTATUS / status [%d]"), playStatus); | |
1487 | + return std::make_pair(true, playStatus); | |
1488 | + | |
1489 | + case HUY_GETPOS: // 0x0201 | |
1490 | + | |
1491 | + if(playStatus == PlayInfo::PLAY_START) | |
1492 | + { | |
1493 | +#if IS_FB2K_VER08 | |
1494 | + UINT playPosition = static_cast<UINT>(play_control::get()->get_playback_time() * 1000); | |
1495 | +#else IS_FB2K_VER09 | |
1496 | + UINT playPosition = static_cast<UINT>(static_api_ptr_t<playback_control>()->playback_get_position() * 1000); | |
1497 | +#endif | |
1498 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETPOS / position [%.3f sec.]"), playPosition / 1000.0); | |
1499 | + return std::make_pair(true, playPosition); | |
1500 | + } | |
1501 | + | |
1502 | + return std::make_pair(true, -1); | |
1503 | + | |
1504 | + case HUY_GETREPEAT: // 0x0202 | |
1505 | + { | |
1506 | +#if IS_FB2K_VER08 | |
1507 | + UINT nPlaybackOrder = | |
1508 | + menu_manager::is_command_checked("Playback/Order/Repeat") ? 1 : | |
1509 | + menu_manager::is_command_checked("Playback/Order/Repeat One") ? 2 : 0; | |
1510 | +#else IS_FB2K_VER09 | |
1511 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1512 | + nPlaybackOrder = (nPlaybackOrder >= 1) && (nPlaybackOrder <= 2) ? nPlaybackOrder : 0; | |
1513 | +#endif | |
1514 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETREPEAT / repeat mode [%u]"), nPlaybackOrder); | |
1515 | + return std::make_pair(true, nPlaybackOrder); | |
1516 | + } | |
1517 | + | |
1518 | + case HUY_GETSHUFFLE: // 0x0203 | |
1519 | + { | |
1520 | +#if IS_FB2K_VER08 | |
1521 | + UINT nPlaybackOrder = 0; | |
1522 | +#else IS_FB2K_VER09 | |
1523 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1524 | + nPlaybackOrder = (nPlaybackOrder >= 4) && (nPlaybackOrder <= 6) ? nPlaybackOrder - 3 : 0; | |
1525 | +#endif | |
1526 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETSHUFFLE / shuffle mode [%u]"), nPlaybackOrder); | |
1527 | + return std::make_pair(true, nPlaybackOrder); | |
1528 | + } | |
1529 | + | |
1530 | + case HUY_GETRANDOM: // 0x0204 | |
1531 | + { | |
1532 | +#if IS_FB2K_VER08 | |
1533 | + UINT nPlaybackOrder = menu_manager::is_command_checked("Playback/Order/Random"); | |
1534 | +#else IS_FB2K_VER09 | |
1535 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1536 | + nPlaybackOrder = (nPlaybackOrder == 3) ? 1 : 0; | |
1537 | +#endif | |
1538 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETRANDOM / random mode [%u]"), nPlaybackOrder); | |
1539 | + return std::make_pair(true, nPlaybackOrder); | |
1540 | + } | |
1541 | + | |
1542 | + case HUY_GETPLAYBACKORDER: // 0x0205 | |
1543 | + { | |
1544 | +#if IS_FB2K_VER08 | |
1545 | + UINT nPlaybackOrder = | |
1546 | + menu_manager::is_command_checked("Playback/Order/Repeat") ? 1 : | |
1547 | + menu_manager::is_command_checked("Playback/Order/Random") ? 3 : | |
1548 | + menu_manager::is_command_checked("Playback/Order/Default") ? 0 : | |
1549 | + menu_manager::is_command_checked("Playback/Order/Repeat One") ? 2 : 0; | |
1550 | +#else IS_FB2K_VER09 | |
1551 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1552 | + nPlaybackOrder = (nPlaybackOrder >= 1) && (nPlaybackOrder <= 6) ? nPlaybackOrder : 0; | |
1553 | +#endif | |
1554 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETPLAYBACKORDER / playback order [%u]"), nPlaybackOrder); | |
1555 | + return std::make_pair(true, nPlaybackOrder); | |
1556 | + } | |
1557 | + | |
1558 | + case HUY_GETLISTFOCUSPOS: // 0x0304 | |
1559 | + { | |
1560 | +#if IS_FB2K_VER08 | |
1561 | + int index = playlist_oper::get()->get_focus(); | |
1562 | +#elif IS_FB2K_VER09 | |
1563 | + t_size activeListIndex = static_api_ptr_t<playlist_manager>()->get_active_playlist(); | |
1564 | + t_size index = static_api_ptr_t<playlist_manager>()->playlist_get_focus_item(activeListIndex); | |
1565 | +#endif | |
1566 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETLISTFOCUSPOS / index [%u]"), index); | |
1567 | + return std::make_pair(true, index); | |
1568 | + } | |
1569 | + | |
1570 | + case HUY_GETENTRYTITLE: // 0x0303 | |
1571 | + { | |
1572 | + const string8 &playlistTitle8 = Probe::getInstance()->getPlaylistTitle8(); | |
1573 | + | |
1574 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETENTRYTITLE" | |
1575 | + " / title [%s]", (LPCSTR)playlistTitle8); | |
1576 | + | |
1577 | + return std::make_pair(true, (LRESULT)(LPCSTR)playlistTitle8); | |
1578 | + } | |
1579 | + | |
1580 | + case HUY_PLAY: // 0x0800 | |
1581 | + { | |
1582 | +#if IS_FB2K_VER08 | |
1583 | + bool bRes = true; | |
1584 | + play_control::get()->play_start(); | |
1585 | +#else IS_FB2K_VER09 | |
1586 | + bool bRes = standard_commands::main_play(); | |
1587 | +#endif | |
1588 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_PLAY"); | |
1589 | + | |
1590 | + return std::make_pair(true, bRes ? 0 : -1); | |
1591 | + } | |
1592 | + | |
1593 | + case HUY_PLAYORPAUSE: // 0x0814 | |
1594 | + { | |
1595 | +#if IS_FB2K_VER08 | |
1596 | + bool bRes = true; | |
1597 | + if(play_control::get()->is_paused()) { | |
1598 | + play_control::get()->play_start(); | |
1599 | + } else { | |
1600 | + play_control::get()->pause(); | |
1601 | + } | |
1602 | +#else IS_FB2K_VER09 | |
1603 | + bool bRes = standard_commands::main_play_or_pause(); | |
1604 | +#endif | |
1605 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_PLAYORPAUSE"); | |
1606 | + | |
1607 | + return std::make_pair(true, bRes ? 0 : -1); | |
1608 | + } | |
1609 | + | |
1610 | + case HUY_STOP: // 0x0801 | |
1611 | + { | |
1612 | +#if IS_FB2K_VER08 | |
1613 | + bool bRes = true; | |
1614 | + play_control::get()->play_stop(); | |
1615 | +#else IS_FB2K_VER09 | |
1616 | + bool bRes = standard_commands::main_stop(); | |
1617 | +#endif | |
1618 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_STOP"); | |
1619 | + | |
1620 | + return std::make_pair(true, bRes ? 0 : -1); | |
1621 | + } | |
1622 | + | |
1623 | + case HUY_PAUSE: // 0x0802 | |
1624 | + { | |
1625 | +#if IS_FB2K_VER08 | |
1626 | + bool bRes = true; | |
1627 | + play_control::get()->pause(); | |
1628 | +#else IS_FB2K_VER09 | |
1629 | + bool bRes = standard_commands::main_pause(); | |
1630 | +#endif | |
1631 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_PAUSE"); | |
1632 | + | |
1633 | + return std::make_pair(true, bRes ? 0 : -1); | |
1634 | + } | |
1635 | + | |
1636 | + case HUY_FASTFORWARD: // 0x0803 | |
1637 | + | |
1638 | + if(playStatus == PlayInfo::PLAY_START) | |
1639 | + { | |
1640 | + bool bRes = false; | |
1641 | + static int ffsecs[] = { 1, 5, 10, 30, 60, 120, 300, 600 }; | |
1642 | +#if IS_FB2K_VER08 | |
1643 | + lp = (lp >= 0) && (lp <= 7) ? lp : 0; | |
1644 | + play_control::get()->playback_seek_delta(ffsecs[lp]); | |
1645 | + bRes = true; | |
1646 | +#else IS_FB2K_VER09 | |
1647 | + switch(lp) | |
1648 | + { | |
1649 | + case 0: | |
1650 | + default: | |
1651 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_1s); | |
1652 | + lp = 0; | |
1653 | + break; | |
1654 | + case 1: | |
1655 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_5s); | |
1656 | + break; | |
1657 | + case 2: | |
1658 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_10s); | |
1659 | + break; | |
1660 | + case 3: | |
1661 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_30s); | |
1662 | + break; | |
1663 | + case 4: | |
1664 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_1min); | |
1665 | + break; | |
1666 | + case 5: | |
1667 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_2min); | |
1668 | + break; | |
1669 | + case 6: | |
1670 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_5min); | |
1671 | + break; | |
1672 | + case 7: | |
1673 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_10min); | |
1674 | + break; | |
1675 | + } | |
1676 | +#endif | |
1677 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_FASTFORWARD / seek ahead [%u secs.]", ffsecs[lp]); | |
1678 | + | |
1679 | + return std::make_pair(true, bRes ? 0 : -1); | |
1680 | + } | |
1681 | + | |
1682 | + return std::make_pair(true, -1); | |
1683 | + | |
1684 | + case HUY_REWIND: // 0x0804 | |
1685 | + | |
1686 | + if(playStatus == PlayInfo::PLAY_START) | |
1687 | + { | |
1688 | + bool bRes = false; | |
1689 | + static int rewsecs[] = { 1, 5, 10, 30, 60, 120, 300, 600 }; | |
1690 | +#if IS_FB2K_VER08 | |
1691 | + lp = (lp >= 0) && (lp <= 7) ? lp : 0; | |
1692 | + play_control::get()->playback_seek_delta(-rewsecs[lp]); | |
1693 | + bRes = true; | |
1694 | +#else IS_FB2K_VER09 | |
1695 | + switch(lp) | |
1696 | + { | |
1697 | + case 0: | |
1698 | + default: | |
1699 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_1s); | |
1700 | + lp = 0; | |
1701 | + break; | |
1702 | + case 1: | |
1703 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_5s); | |
1704 | + break; | |
1705 | + case 2: | |
1706 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_10s); | |
1707 | + break; | |
1708 | + case 3: | |
1709 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_30s); | |
1710 | + break; | |
1711 | + case 4: | |
1712 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_1min); | |
1713 | + break; | |
1714 | + case 5: | |
1715 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_2min); | |
1716 | + break; | |
1717 | + case 6: | |
1718 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_5min); | |
1719 | + break; | |
1720 | + case 7: | |
1721 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_10min); | |
1722 | + break; | |
1723 | + } | |
1724 | +#endif | |
1725 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_REWIND / seek back [%u sec.]", rewsecs[lp]); | |
1726 | + | |
1727 | + return std::make_pair(true, bRes ? 0 : -1); | |
1728 | + } | |
1729 | + | |
1730 | + return std::make_pair(true, -1); | |
1731 | + | |
1732 | + case HUY_PREVIOUS: // 0x0807 | |
1733 | + { | |
1734 | +#if IS_FB2K_VER08 | |
1735 | + bool bRes = true; | |
1736 | + play_control::get()->play_start(play_control::TRACK_COMMAND_PREV); | |
1737 | +#else IS_FB2K_VER09 | |
1738 | + bool bRes = standard_commands::main_previous(); | |
1739 | +#endif | |
1740 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_PREVIOUS"); | |
1741 | + | |
1742 | + return std::make_pair(true, bRes ? 0 : -1); | |
1743 | + } | |
1744 | + | |
1745 | + case HUY_NEXT: // 0x0808 | |
1746 | + { | |
1747 | +#if IS_FB2K_VER08 | |
1748 | + bool bRes = true; | |
1749 | + play_control::get()->play_start (play_control::TRACK_COMMAND_NEXT); | |
1750 | +#else IS_FB2K_VER09 | |
1751 | + bool bRes = standard_commands::main_next(); | |
1752 | +#endif | |
1753 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_NEXT"); | |
1754 | + | |
1755 | + return std::make_pair(true, bRes ? 0 : -1); | |
1756 | + } | |
1757 | + | |
1758 | + case HUY_SEEK: // 0x0809 | |
1759 | + | |
1760 | + if(playStatus == PlayInfo::PLAY_START) | |
1761 | + { | |
1762 | + double jumpPos = wp / 1000.0; | |
1763 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_SEEK") | |
1764 | + _T(" / jump to [%.3f sec.]"), jumpPos); | |
1765 | + | |
1766 | + if(jumpPos > playLength) | |
1767 | + { | |
1768 | + // eof | |
1769 | + return std::make_pair(true, 1); | |
1770 | + } | |
1771 | + else | |
1772 | + { | |
1773 | +#if IS_FB2K_VER08 | |
1774 | + play_control::get()->playback_seek(jumpPos); | |
1775 | +#else IS_FB2K_VER09 | |
1776 | + static_api_ptr_t<playback_control>()->playback_seek(jumpPos); | |
1777 | +#endif | |
1778 | + return std::make_pair(true, 0); | |
1779 | + } | |
1780 | + | |
1781 | + } | |
1782 | + | |
1783 | + return std::make_pair(true, -1); | |
1784 | + | |
1785 | + case HUY_VOLUMEUP: // 0x080B | |
1786 | + { | |
1787 | +#if IS_FB2K_VER08 | |
1788 | + bool bRes = true; | |
1789 | + play_control::get()->volume_up(); | |
1790 | +#else IS_FB2K_VER09 | |
1791 | + bool bRes = standard_commands::main_volume_up(); | |
1792 | +#endif | |
1793 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_VOLUMEUP"); | |
1794 | + | |
1795 | + return std::make_pair(true, bRes ? 0 : -1); | |
1796 | + } | |
1797 | + | |
1798 | + case HUY_VOLUMEDOWN: // 0x080C | |
1799 | + { | |
1800 | +#if IS_FB2K_VER08 | |
1801 | + bool bRes = true; | |
1802 | + play_control::get()->volume_down(); | |
1803 | +#else IS_FB2K_VER09 | |
1804 | + bool bRes = standard_commands::main_volume_down(); | |
1805 | +#endif | |
1806 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_VOLUMEDOWN"); | |
1807 | + | |
1808 | + return std::make_pair(true, bRes ? 0 : -1); | |
1809 | + } | |
1810 | + | |
1811 | + case HUY_SETREPEAT: // 0x080F | |
1812 | + { | |
1813 | + static LPCSTR modes[] = { "default", "repeat playlist", "repeat track" }; | |
1814 | + lp = (lp >= 0) && (lp <= 2) ? lp : 0; | |
1815 | +#if IS_FB2K_VER08 | |
1816 | + bool bRes = false; | |
1817 | + switch(lp) | |
1818 | + { | |
1819 | + case 0: | |
1820 | + default: | |
1821 | + bRes = menu_manager::run_command("Playback/Order/Default"); | |
1822 | + break; | |
1823 | + case 1: | |
1824 | + bRes = menu_manager::run_command("Playback/Order/Repeat"); | |
1825 | + break; | |
1826 | + case 2: | |
1827 | + bRes = menu_manager::run_command("Playback/Order/Repeat One"); | |
1828 | + break; | |
1829 | + } | |
1830 | +#else IS_FB2K_VER09 | |
1831 | + bool bRes = true; | |
1832 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(lp); | |
1833 | +#endif | |
1834 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_SETREPEAT / repeat mode [%s]", modes[lp]); | |
1835 | + | |
1836 | + return std::make_pair(true, bRes ? 0 : -1); | |
1837 | + } | |
1838 | + | |
1839 | + case HUY_SETSHUFFLE: // 0x0810 | |
1840 | + { | |
1841 | + static LPCSTR modes[] = { "default", "shuffle tracks", "shuffle albums", "shuffle folders" }; | |
1842 | + lp = (lp >= 1) && (lp <= 3) ? lp : 0; | |
1843 | + | |
1844 | +#if IS_FB2K_VER08 | |
1845 | + return std::make_pair(true, -1); | |
1846 | +#else IS_FB2K_VER09 | |
1847 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active((lp >= 1) && (lp <= 3) ? lp + 3 : 0); | |
1848 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_SETSHUFFLE / shuffle mode [%s]", modes[lp]); | |
1849 | + | |
1850 | + return std::make_pair(true, 0); | |
1851 | +#endif | |
1852 | + } | |
1853 | + | |
1854 | + case HUY_SETRANDOM: // 0x080E | |
1855 | + { | |
1856 | + static LPCSTR modes[] = { "default", "random" }; | |
1857 | +#if IS_FB2K_VER08 | |
1858 | + bool bRes = false; | |
1859 | + bRes = menu_manager::run_command("Playback/Order/Random"); | |
1860 | + if(lp != 1) { | |
1861 | + lp = 0; | |
1862 | + } | |
1863 | +#else IS_FB2K_VER09 | |
1864 | + bool bRes = true; | |
1865 | + switch(lp) | |
1866 | + { | |
1867 | + case 0: | |
1868 | + default: | |
1869 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(0); | |
1870 | + lp = 0; | |
1871 | + break; | |
1872 | + case 1: | |
1873 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(3); | |
1874 | + break; | |
1875 | + } | |
1876 | +#endif | |
1877 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_SETRANDOM / random mode [%s]", modes[lp]); | |
1878 | + | |
1879 | + return std::make_pair(true, bRes ? 0 : -1); | |
1880 | + } | |
1881 | + | |
1882 | + case HUY_SETPLAYBACKORDER: // 0x0815 | |
1883 | + { | |
1884 | + static LPCSTR modes[] = { "default", "repeat playlist", "repeat track", "random", "shuffle tracks", "shuffle albums", "shuffle folders" }; | |
1885 | +#if IS_FB2K_VER08 | |
1886 | + bool bRes = false; | |
1887 | + switch(lp) | |
1888 | + { | |
1889 | + case 0: | |
1890 | + default: | |
1891 | + bRes = menu_manager::run_command("Playback/Order/Default"); | |
1892 | + lp = 0; | |
1893 | + break; | |
1894 | + case 1: | |
1895 | + bRes = menu_manager::run_command("Playback/Order/Repeat"); | |
1896 | + break; | |
1897 | + case 2: | |
1898 | + bRes = menu_manager::run_command("Playback/Order/Repeat One"); | |
1899 | + break; | |
1900 | + case 3: | |
1901 | + bRes = menu_manager::run_command("Playback/Order/Random"); | |
1902 | + break; | |
1903 | + } | |
1904 | +#else IS_FB2K_VER09 | |
1905 | + bool bRes = true; | |
1906 | + lp = (lp >= 0) && (lp <= 6) ? lp : 0; | |
1907 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(lp); | |
1908 | +#endif | |
1909 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_SETPLAYBACKORDER / repeat mode [%s]", modes[lp]); | |
1910 | + | |
1911 | + return std::make_pair(true, bRes ? 0 : -1); | |
1912 | + } | |
1913 | + | |
1914 | + case HUY_TOGGLEREPEAT: // 0x0812 | |
1915 | + { | |
1916 | + bool bRes = false; | |
1917 | + static LPCSTR modes[] = { "repeat track", "repeat playlist", "default" }; | |
1918 | +#if IS_FB2K_VER08 | |
1919 | + UINT nPlaybackOrder = menu_manager::is_command_checked("Playback/Order/Repeat") ? 1 : | |
1920 | + menu_manager::is_command_checked("Playback/Order/Repeat One") ? 2 : 0; | |
1921 | + switch(nPlaybackOrder) | |
1922 | + { | |
1923 | + case 0: | |
1924 | + default: | |
1925 | + bRes = menu_manager::run_command("Playback/Order/Repeat"); | |
1926 | + break; | |
1927 | + case 1: | |
1928 | + bRes = menu_manager::run_command("Playback/Order/Repeat One"); | |
1929 | + break; | |
1930 | + case 2: | |
1931 | + bRes = menu_manager::run_command("Playback/Order/Default"); | |
1932 | + break; | |
1933 | + } | |
1934 | +#else IS_FB2K_VER09 | |
1935 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1936 | + nPlaybackOrder = (nPlaybackOrder >= 1) && (nPlaybackOrder <= 2) ? 3 - nPlaybackOrder : 0; | |
1937 | + | |
1938 | + switch(nPlaybackOrder) | |
1939 | + { | |
1940 | + case 0: | |
1941 | + default: | |
1942 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(1); | |
1943 | + break; | |
1944 | + case 1: | |
1945 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(2); | |
1946 | + break; | |
1947 | + case 2: | |
1948 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(0); | |
1949 | + break; | |
1950 | + } | |
1951 | +#endif | |
1952 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_TOGGLEREPEAT / repeat mode [%s]", modes[nPlaybackOrder]); | |
1953 | + | |
1954 | + return std::make_pair(true, bRes ? 0 : -1); | |
1955 | + } | |
1956 | + | |
1957 | + case HUY_TOGGLESHUFFLE: // 0x0813 | |
1958 | + { | |
1959 | + bool bRes = false; | |
1960 | + static LPCSTR modes[] = { "shuffle tracks", "shuffle albums", "shuffle folders", "default" }; | |
1961 | +#if IS_FB2K_VER08 | |
1962 | + return std::make_pair(true, -1); | |
1963 | +#else IS_FB2K_VER09 | |
1964 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1965 | + nPlaybackOrder = (nPlaybackOrder >= 4) && (nPlaybackOrder <= 6) ? nPlaybackOrder - 3 : 0; | |
1966 | + | |
1967 | + switch(nPlaybackOrder) | |
1968 | + { | |
1969 | + case 0: | |
1970 | + default: | |
1971 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(4); | |
1972 | + break; | |
1973 | + case 1: | |
1974 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(5); | |
1975 | + break; | |
1976 | + case 2: | |
1977 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(6); | |
1978 | + break; | |
1979 | + case 3: | |
1980 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(0); | |
1981 | + break; | |
1982 | + } | |
1983 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_TOGGLESHUFFLE / shuffle mode [%s]", modes[nPlaybackOrder]); | |
1984 | + | |
1985 | + return std::make_pair(true, bRes ? 0 : -1); | |
1986 | +#endif | |
1987 | + } | |
1988 | + | |
1989 | + case HUY_TOGGLERANDOM: // 0x0811 | |
1990 | + { | |
1991 | + static LPCSTR modes[] = { "randome", "default" }; | |
1992 | +#if IS_FB2K_VER08 | |
1993 | + bool bRes = false; | |
1994 | + UINT nPlaybackOrder = menu_manager::is_command_checked ("Playback/Order/Random") ? 1 : 0; | |
1995 | + switch(nPlaybackOrder) | |
1996 | + { | |
1997 | + case 0: | |
1998 | + default: | |
1999 | + bRes = menu_manager::run_command("Playback/Order/Random"); | |
2000 | + break; | |
2001 | + case 1: | |
2002 | + bRes = menu_manager::run_command("Playback/Order/Default"); | |
2003 | + break; | |
2004 | + } | |
2005 | +#else IS_FB2K_VER09 | |
2006 | + bool bRes = true; | |
2007 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
2008 | + nPlaybackOrder = (nPlaybackOrder == 3) ? 1 : 0; | |
2009 | + | |
2010 | + switch(nPlaybackOrder) | |
2011 | + { | |
2012 | + case 0: | |
2013 | + default: | |
2014 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(3); | |
2015 | + break; | |
2016 | + case 1: | |
2017 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(0); | |
2018 | + break; | |
2019 | + } | |
2020 | +#endif | |
2021 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_TOGGLERANDOM / random mode [%s]"), modes[nPlaybackOrder]); | |
2022 | + return std::make_pair(true, bRes ? 0 : -1); | |
2023 | + } | |
2024 | + | |
2025 | + case HUY_TOGGLEPLAYBACKORDER: // 0x0816 | |
2026 | + { | |
2027 | +#if IS_FB2K_VER08 | |
2028 | + static LPCSTR modes[] = { "repeat playlist", "repeat track", "random", "default" }; | |
2029 | + bool bRes = false; | |
2030 | + UINT nPlaybackOrder = | |
2031 | + menu_manager::is_command_checked("Playback/Order/Repeat") ? 1 : | |
2032 | + menu_manager::is_command_checked("Playback/Order/Random") ? 3 : | |
2033 | + menu_manager::is_command_checked("Playback/Order/Default") ? 0 : | |
2034 | + menu_manager::is_command_checked("Playback/Order/Repeat One") ? 2 : 0; | |
2035 | + | |
2036 | + switch(nPlaybackOrder) | |
2037 | + { | |
2038 | + case 0: | |
2039 | + default: | |
2040 | + bRes = menu_manager::run_command("Playback/Order/Repeat"); | |
2041 | + break; | |
2042 | + case 1: | |
2043 | + bRes = menu_manager::run_command("Playback/Order/Repeat One"); | |
2044 | + break; | |
2045 | + case 2: | |
2046 | + bRes = menu_manager::run_command("Playback/Order/Random"); | |
2047 | + break; | |
2048 | + case 3: | |
2049 | + bRes = menu_manager::run_command("Playback/Order/Default"); | |
2050 | + break; | |
2051 | + } | |
2052 | +#else IS_FB2K_VER09 | |
2053 | + static LPCSTR modes[] = { "repeat playlist", "repeat track", "random", "shuffle tracks", "shuffle albums", "shuffle folders", "default" }; | |
2054 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
2055 | + nPlaybackOrder = (nPlaybackOrder >= 1) && (nPlaybackOrder <= 6) ? (nPlaybackOrder + 1) % 6 : 1; | |
2056 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(nPlaybackOrder); | |
2057 | +#endif | |
2058 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_TOGGLEPLAYBACKORDER / playback order [%u]"), nPlaybackOrder); | |
2059 | + return std::make_pair(true, nPlaybackOrder); | |
2060 | + } | |
2061 | + | |
2062 | + case HUY_REFRESHLISTINFO: // 0x0A00 | |
2063 | + { | |
2064 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_REFRESHLISTINFO / refresh internal playlist informations.")); | |
2065 | + | |
2066 | + // make playlist info formats array | |
2067 | + std::vector<std::string> plStrKeys, plNumKeys; | |
2068 | + | |
2069 | + plStrKeys.push_back(FORMAT_PLAYLIST_NAME); | |
2070 | + | |
2071 | + plNumKeys.push_back(FORMAT_LISTINDEX); | |
2072 | + plNumKeys.push_back(FORMAT_LISTTOTAL); | |
2073 | + | |
2074 | + // set current track informations | |
2075 | + TRACK_INFO8 trackInfo8(Probe::getInstance()->getTrackInfo8()); | |
2076 | + | |
2077 | + trackInfo8.setPlaylistStrings(plStrKeys); | |
2078 | + trackInfo8.setPlaylistNumbers(plNumKeys); | |
2079 | + | |
2080 | + Probe::getInstance()->setTrackInfo8(trackInfo8); | |
2081 | + | |
2082 | + // refresh huygens title | |
2083 | + Probe::getInstance()->refreshTitle(); | |
2084 | + | |
2085 | + return std::make_pair(true, 0); | |
2086 | + } | |
2087 | + | |
2088 | + case HUY_REFRESHDYNINFO: // 0x0A01 | |
2089 | + { | |
2090 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_REFRESHDYNINFO / refresh internal dynamic informations.")); | |
2091 | + | |
2092 | + // make dynamic info formats array | |
2093 | + std::vector<std::string> dynStrKeys, dynNumKeys; | |
2094 | + | |
2095 | + dynStrKeys.push_back(FORMAT_ARTIST); | |
2096 | + dynStrKeys.push_back(FORMAT_TRACKTITLE); | |
2097 | + dynStrKeys.push_back(FORMAT_ALBUMTITLE); | |
2098 | + dynStrKeys.push_back(FORMAT_GENRE); | |
2099 | + dynStrKeys.push_back(FORMAT_TRACKDATE); | |
2100 | + dynStrKeys.push_back(FORMAT_COMPOSER); | |
2101 | + dynStrKeys.push_back(FORMAT_PERFORMER); | |
2102 | + dynStrKeys.push_back(FORMAT_ALBUMARTIST); | |
2103 | + dynStrKeys.push_back(FORMAT_TRACKARTIST); | |
2104 | + dynStrKeys.push_back(FORMAT_COMMENT); | |
2105 | + | |
2106 | + dynStrKeys.push_back(FORMAT_LENGTHSAMPLES); | |
2107 | + | |
2108 | + dynNumKeys.push_back(FORMAT_SUBSONG); | |
2109 | + dynNumKeys.push_back(FORMAT_TRACKNUMBER); | |
2110 | + dynNumKeys.push_back(FORMAT_TRACKTOTAL); | |
2111 | + dynNumKeys.push_back(FORMAT_DISCNUMBER); | |
2112 | + dynNumKeys.push_back(FORMAT_DISCTOTAL); | |
2113 | + | |
2114 | + dynNumKeys.push_back(FORMAT_BITRATE_DYNAMIC); | |
2115 | + | |
2116 | + // set current track informations | |
2117 | + TRACK_INFO8 trackInfo8(Probe::getInstance()->getTrackInfo8()); | |
2118 | + | |
2119 | + trackInfo8.setDynamicStrings(dynStrKeys); | |
2120 | + trackInfo8.setDynamicNumbers(dynNumKeys); | |
2121 | + | |
2122 | + Probe::getInstance()->setTrackInfo8(trackInfo8); | |
2123 | + | |
2124 | + // refresh huygens title | |
2125 | + Probe::getInstance()->refreshTitle(); | |
2126 | + | |
2127 | + return std::make_pair(true, 0); | |
2128 | + } | |
2129 | + | |
2130 | + default: | |
2131 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - WM_HUY_IPC (Unknown IPC command) / W:%08x, L:%08x"), wp, lp); | |
2132 | + break; | |
2133 | + } | |
2134 | + } | |
2135 | + break; | |
2136 | + } | |
2137 | + | |
2138 | + return std::make_pair(false, 0); | |
2139 | +} | |
2140 | + | |
2141 | +#if IS_FB2K_VER08 | |
2142 | +class play_callback_huygens : public play_callback | |
2143 | +#elif IS_FB2K_VER09 | |
2144 | +class play_callback_huygens : public play_callback_static | |
2145 | +#endif | |
2146 | +{ | |
2147 | +#if IS_FB2K_VER09 | |
2148 | + virtual unsigned get_flags() { | |
2149 | + return flag_on_playback_all; | |
2150 | + } | |
2151 | +#endif | |
2152 | + | |
2153 | +#if IS_FB2K_VER08 | |
2154 | + virtual void on_playback_starting() | |
2155 | +#elif IS_FB2K_VER09 | |
2156 | + virtual void on_playback_starting(play_control::t_track_command command, bool paused) | |
2157 | +#endif | |
2158 | + { | |
2159 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_starting - called.")); | |
2160 | + } | |
2161 | + | |
2162 | +#if IS_FB2K_VER08 | |
2163 | + virtual void on_playback_new_track(metadb_handle * track) | |
2164 | +#elif IS_FB2K_VER09 | |
2165 | + virtual void on_playback_new_track(metadb_handle_ptr track) | |
2166 | +#endif | |
2167 | + { | |
2168 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_new_track - called.")); | |
2169 | + | |
2170 | + // make currently playbacked track information keys | |
2171 | + std::vector<std::string> strKeys; | |
2172 | + std::vector<std::string> numKeys; | |
2173 | + | |
2174 | + strKeys.push_back(FORMAT_FB2KVERSION); | |
2175 | + strKeys.push_back(FORMAT_FILEPATH); | |
2176 | + strKeys.push_back(FORMAT_FILEPATHRAW); | |
2177 | + strKeys.push_back(FORMAT_ARTIST); | |
2178 | + strKeys.push_back(FORMAT_TRACKTITLE); | |
2179 | + strKeys.push_back(FORMAT_ALBUMTITLE); | |
2180 | + strKeys.push_back(FORMAT_GENRE); | |
2181 | + strKeys.push_back(FORMAT_TRACKDATE); | |
2182 | + strKeys.push_back(FORMAT_COMPOSER); | |
2183 | + strKeys.push_back(FORMAT_PERFORMER); | |
2184 | + strKeys.push_back(FORMAT_ALBUMARTIST); | |
2185 | + strKeys.push_back(FORMAT_TRACKARTIST); | |
2186 | + strKeys.push_back(FORMAT_COMMENT); | |
2187 | + strKeys.push_back(FORMAT_CODEC); | |
2188 | + strKeys.push_back(FORMAT_CODECPROFILE); | |
2189 | + strKeys.push_back(FORMAT_TAGTYPE); | |
2190 | + strKeys.push_back(FORMAT_EXTRAINFO); | |
2191 | + strKeys.push_back(FORMAT_TOOL); | |
2192 | + strKeys.push_back(FORMAT_AUDIOMD5HASH); | |
2193 | + strKeys.push_back(FORMAT_APEVERSION); | |
2194 | + strKeys.push_back(FORMAT_APEFLAGS); | |
2195 | + | |
2196 | + strKeys.push_back(FORMAT_FILESIZE); | |
2197 | +// strKeys.push_back(FORMAT_FILECREATED); | |
2198 | +// strKeys.push_back(FORMAT_FILELASTMOD); | |
2199 | + | |
2200 | + numKeys.push_back(FORMAT_SUBSONG); | |
2201 | + numKeys.push_back(FORMAT_TRACKNUMBER); | |
2202 | + numKeys.push_back(FORMAT_TRACKTOTAL); | |
2203 | + numKeys.push_back(FORMAT_DISCNUMBER); | |
2204 | + numKeys.push_back(FORMAT_DISCTOTAL); | |
2205 | + numKeys.push_back(FORMAT_SAMPLERATE); | |
2206 | + | |
2207 | + numKeys.push_back(FORMAT_BITRATE); | |
2208 | + numKeys.push_back(FORMAT_BITRATE_NOMINAL); | |
2209 | + numKeys.push_back(FORMAT_CHANNELS); | |
2210 | + numKeys.push_back(FORMAT_BITSPERSAMPLE); | |
2211 | + numKeys.push_back(FORMAT_LOSSLESS); | |
2212 | + numKeys.push_back(FORMAT_CUEEMBEDDED); | |
2213 | + numKeys.push_back(FORMAT_MP3STEREOMODE); | |
2214 | + numKeys.push_back(FORMAT_MP3ACCURATELENGTH); | |
2215 | + numKeys.push_back(FORMAT_MP3ENCDELAY); | |
2216 | + numKeys.push_back(FORMAT_MP3ENCPADDING); | |
2217 | + | |
2218 | + numKeys.push_back(FORMAT_REPLAYGAIN_ALBUMGAIN); | |
2219 | + numKeys.push_back(FORMAT_REPLAYGAIN_ALBUMPEEK); | |
2220 | + numKeys.push_back(FORMAT_REPLAYGAIN_TRACKGAIN); | |
2221 | + numKeys.push_back(FORMAT_REPLAYGAIN_TRACKPEEK); | |
2222 | + | |
2223 | + // set current track informations | |
2224 | + m_trackInfo8.clear(); | |
2225 | + m_trackInfo8.setStrings(strKeys, track); | |
2226 | + m_trackInfo8.setNumbers(numKeys, track); | |
2227 | + | |
2228 | + // is playback track in media library? | |
2229 | +#if IS_FB2K_VER08 | |
2230 | + m_trackInfo8.putNumber(FORMAT_ISINMEDIALIB, track->handle_is_permcached()); | |
2231 | +#elif IS_FB2K_VER09 | |
2232 | + m_trackInfo8.putNumber(FORMAT_ISINMEDIALIB, static_api_ptr_t<library_manager>()->is_item_in_library(track) ? 1 : 0); | |
2233 | +#endif | |
2234 | + | |
2235 | + // get song total length | |
2236 | +#if IS_FB2K_VER08 | |
2237 | + double total_sec = track->handle_get_length(); | |
2238 | +#elif IS_FB2K_VER09 | |
2239 | + double total_sec = track->get_length(); | |
2240 | +#endif | |
2241 | + | |
2242 | + // set file created and last modifed datetime | |
2243 | +#if IS_FB2K_VER08 | |
2244 | + putFileInfo(track->handle_get_path()); | |
2245 | +#elif IS_FB2K_VER09 | |
2246 | + putFileInfo(track->get_path()); | |
2247 | +#endif | |
2248 | + | |
2249 | + // set trackinfo to huygens | |
2250 | + Probe::getInstance()->setTrackInfo8(m_trackInfo8); | |
2251 | + | |
2252 | + // clear playinfo on huygens | |
2253 | + Probe::getInstance()->getPlayInfo().clearPlayInfo(); | |
2254 | + | |
2255 | + // set huygens status PLAY_START | |
2256 | + Probe::getInstance()->getPlayInfo().setPlayStatusStart(); | |
2257 | + | |
2258 | + // set song total length | |
2259 | + Probe::getInstance()->getPlayInfo().setPlayLength(total_sec); | |
2260 | + | |
2261 | + // increment play counter on huygens | |
2262 | + Probe::getInstance()->getPlayInfo().incrementPlayCount(); | |
2263 | + | |
2264 | + // post HUY_REFRESHLISTINFO | |
2265 | + ::PostMessage(Probe::getInstance()->getWnd(), WM_HUY_IPC, 0, HUY_REFRESHLISTINFO); | |
2266 | + DEBUG_CALLBACK(_T("play_callback_huygens::on_playback_new_track - HUY_REFRESHLISTINFO posted.")); | |
2267 | + } | |
2268 | + | |
2269 | +#if IS_FB2K_VER08 | |
2270 | + virtual void on_playback_stop(play_control::stop_reason reason) | |
2271 | +#elif IS_FB2K_VER09 | |
2272 | + virtual void on_playback_stop(play_control::t_stop_reason reason) | |
2273 | +#endif | |
2274 | + { | |
2275 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_stop - called.")); | |
2276 | + | |
2277 | + // set huygens status PLAY_STOP | |
2278 | + Probe::getInstance()->getPlayInfo().setPlayStatusStop(); | |
2279 | + | |
2280 | + // clear huygens title | |
2281 | + Probe::getInstance()->clearProbeTitle(); | |
2282 | + } | |
2283 | + | |
2284 | + virtual void on_playback_seek(double time) // time is second. | |
2285 | + { | |
2286 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_seek - called.")); | |
2287 | + | |
2288 | + // update current position on huygens | |
2289 | + Probe::getInstance()->getPlayInfo().setPlayPosition((int)(time * 1000)); | |
2290 | + } | |
2291 | + | |
2292 | +#if IS_FB2K_VER08 | |
2293 | + virtual void on_playback_pause(int state) | |
2294 | +#elif IS_FB2K_VER09 | |
2295 | + virtual void on_playback_pause(bool state) | |
2296 | +#endif | |
2297 | + { | |
2298 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_pause - called.")); | |
2299 | + | |
2300 | +#if IS_FB2K_VER08 | |
2301 | + if(state == 1) | |
2302 | +#elif IS_FB2K_VER09 | |
2303 | + if(state == true) | |
2304 | +#endif | |
2305 | + { | |
2306 | + // set huygens status PLAY_PAUSE | |
2307 | + Probe::getInstance()->getPlayInfo().setPlayStatusPause(); | |
2308 | + | |
2309 | + DEBUG_CALLBACK(_T("play_callback_huygens::on_playback_pause - fb2k paused.")); | |
2310 | + } | |
2311 | + else | |
2312 | + { | |
2313 | + // set huygens status PLAY_START | |
2314 | + Probe::getInstance()->getPlayInfo().setPlayStatusStart(); | |
2315 | + | |
2316 | + DEBUG_CALLBACK(_T("play_callback_huygens::on_playback_pause - fb2k unpaused.")); | |
2317 | + } | |
2318 | + } | |
2319 | + | |
2320 | +#if IS_FB2K_VER08 | |
2321 | + virtual void on_playback_edited(metadb_handle * track){}//currently played file got edited | |
2322 | +#elif IS_FB2K_VER09 | |
2323 | + virtual void on_playback_edited(metadb_handle_ptr track){}//currently played file got edited | |
2324 | +#endif | |
2325 | + | |
2326 | +#if IS_FB2K_VER08 | |
2327 | + virtual void on_playback_dynamic_info(const file_info * info,bool b_track_change) | |
2328 | +#elif IS_FB2K_VER09 | |
2329 | + virtual void on_playback_dynamic_info(const file_info & info) | |
2330 | +#endif | |
2331 | + { | |
2332 | + if(cfg_use_plugin == 0) { | |
2333 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_dynamic_info - called.")); | |
2334 | + return ; | |
2335 | + } | |
2336 | + | |
2337 | +#if IS_FB2K_VER08 | |
2338 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_dynamic_info - HUY_REFRESHDYNINFO posted.")); | |
2339 | + ::PostMessage(Probe::getInstance()->getWnd(), WM_HUY_IPC, 0, HUY_REFRESHDYNINFO); | |
2340 | +#endif | |
2341 | + } | |
2342 | + | |
2343 | +#if IS_FB2K_VER09 | |
2344 | + virtual void on_playback_dynamic_info_track(const file_info & p_info) | |
2345 | + { | |
2346 | + if(cfg_use_plugin == 0) { | |
2347 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_dynamic_info_track - called.")); | |
2348 | + return ; | |
2349 | + } | |
2350 | + | |
2351 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_dynamic_info_track - HUY_REFRESHDYNINFO posted.")); | |
2352 | + ::PostMessage(Probe::getInstance()->getWnd(), WM_HUY_IPC, 0, HUY_REFRESHDYNINFO); | |
2353 | + } | |
2354 | +#endif | |
2355 | + | |
2356 | +#if IS_FB2K_VER08 | |
2357 | + virtual void on_playback_time(metadb_handle * track, double time)//called every second | |
2358 | +#elif IS_FB2K_VER09 | |
2359 | + virtual void on_playback_time(double time)//called every second | |
2360 | +#endif | |
2361 | + { | |
2362 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_time - called.")); | |
2363 | + | |
2364 | + // update current position on huygens | |
2365 | + Probe::getInstance()->getPlayInfo().setPlayPosition((int)(time * 1000)); | |
2366 | + } | |
2367 | + | |
2368 | +#if IS_FB2K_VER09 | |
2369 | + // User changed volume settings. Possibly called when not playing. | |
2370 | + virtual void on_volume_change(float new_val) {} | |
2371 | +#endif | |
2372 | + | |
2373 | +protected: | |
2374 | + | |
2375 | + void putFileInfo(const std::string &rawFilePath8) | |
2376 | + { | |
2377 | + std::string localFilePath8 = getLocalFilePath(rawFilePath8); | |
2378 | + | |
2379 | + if(localFilePath8.empty() == false) | |
2380 | + { | |
2381 | + WIN32_FIND_DATA wfd; | |
2382 | + | |
2383 | + // ファイル検索API関数によりファイル日時を取得 | |
2384 | + string_os_from_utf8 localFilePathOS(localFilePath8.c_str()); | |
2385 | + | |
2386 | + HANDLE hFindFirstFile = ::FindFirstFile(localFilePathOS, &wfd); | |
2387 | + if(hFindFirstFile != INVALID_HANDLE_VALUE) { | |
2388 | + | |
2389 | + // ハンドルを閉じる | |
2390 | + ::FindClose(hFindFirstFile); | |
2391 | + | |
2392 | + // ファイル作成日時 | |
2393 | + putFileTime(FORMAT_FILECREATED, wfd.ftCreationTime); | |
2394 | + | |
2395 | + // ファイル最終書込日時 | |
2396 | + putFileTime(FORMAT_FILELASTMOD, wfd.ftLastWriteTime); | |
2397 | + | |
2398 | + } else { | |
2399 | + | |
2400 | + putLogError(_T("play_callback_huygens::putFileInfo"), | |
2401 | + _T("ファイル日時属性の取得(FindFirstFile)に失敗しました"), ::GetLastError()); | |
2402 | + } | |
2403 | + } | |
2404 | + } | |
2405 | + | |
2406 | + static std::string getLocalFilePath(const std::string &rawFilePath) | |
2407 | + { | |
2408 | + std::string filePath; | |
2409 | + | |
2410 | + bool isFileProtocol = rawFilePath.find(FILE_PROTOCOL) != std::string::npos; | |
2411 | + | |
2412 | + if(isFileProtocol) | |
2413 | + { | |
2414 | + filePath = rawFilePath.substr(::lstrlenA(FILE_PROTOCOL)); | |
2415 | + } | |
2416 | + else if(rawFilePath.length() >= 3) | |
2417 | + { | |
2418 | + LPCSTR pRawFilePath = rawFilePath.c_str(); | |
2419 | + bool isDriveName = ::isalpha(pRawFilePath[0]) && (pRawFilePath[1] == ':') && (pRawFilePath[2] == '\\'); | |
2420 | + | |
2421 | + if(isDriveName) | |
2422 | + { | |
2423 | + filePath = rawFilePath.substr(::lstrlenA(FILE_PROTOCOL)); | |
2424 | + } | |
2425 | + } | |
2426 | + | |
2427 | + return filePath; | |
2428 | + } | |
2429 | + | |
2430 | + void putFileTime(LPCSTR key, const FILETIME &fileTime) | |
2431 | + { | |
2432 | + SYSTEMTIME systemTime; | |
2433 | + FileTimeToSystemTime(&fileTime, &systemTime); | |
2434 | + | |
2435 | + StrDBCS64K formattedTime; | |
2436 | + | |
2437 | + //DEBUG_CALLBACK(_T("putFileTime - FILETIME: H-%lu, L-%lu"), fileTime.dwHighDateTime, fileTime.dwLowDateTime); | |
2438 | + | |
2439 | + sprintf_s(formattedTime, sizeof(StrDBCS64K), "%04d%02d%02d%02d%02d%02d.%03d%03d%1d00", | |
2440 | + systemTime.wYear, systemTime.wMonth, systemTime.wDay, | |
2441 | + systemTime.wHour, systemTime.wMinute, systemTime.wSecond, | |
2442 | + systemTime.wMilliseconds, | |
2443 | + (fileTime.dwLowDateTime / 10 % 1000), // microseconds | |
2444 | + fileTime.dwLowDateTime % 10 // nanoseconds | |
2445 | + ); | |
2446 | + | |
2447 | + m_trackInfo8.putString(key, formattedTime); | |
2448 | + } | |
2449 | + | |
2450 | +protected: | |
2451 | + | |
2452 | + TRACK_INFO8 m_trackInfo8; | |
2453 | +}; | |
2454 | + | |
2455 | + | |
2456 | +class initquit_send : public initquit | |
2457 | +{ | |
2458 | + typedef std::auto_ptr<Probe> ProbeAutoPtr; | |
2459 | + ProbeAutoPtr m_apProbe; | |
2460 | + | |
2461 | + virtual void on_init() | |
2462 | + { | |
2463 | + m_apProbe = ProbeAutoPtr(Probe::getInstance()); | |
2464 | + m_apProbe->load(); | |
2465 | + } | |
2466 | + | |
2467 | + virtual void on_quit() | |
2468 | + { | |
2469 | + m_apProbe->release(); | |
2470 | + { | |
2471 | + ProbeAutoPtr sink(m_apProbe); | |
2472 | + } | |
2473 | + } | |
2474 | + | |
2475 | + virtual void on_system_shutdown() | |
2476 | + { | |
2477 | + on_quit(); | |
2478 | + } | |
2479 | +}; | |
2480 | + | |
2481 | +#if IS_FB2K_VER08 | |
2482 | +class menu_item_huygens : public menu_item_main | |
2483 | +#elif IS_FB2K_VER09 | |
2484 | +// {C6379E09-0AD9-43a0-A37A-5CACC2A347E5} | |
2485 | +static const GUID menu_item_huygens_guid = { 0xc6379e09, 0xad9, 0x43a0, { 0xa3, 0x7a, 0x5c, 0xac, 0xc2, 0xa3, 0x47, 0xe5 } }; | |
2486 | +class menu_item_huygens : public mainmenu_commands | |
2487 | +#endif | |
2488 | +{ | |
2489 | +#if IS_FB2K_VER08 | |
2490 | + virtual unsigned get_num_items() { | |
2491 | +#elif IS_FB2K_VER09 | |
2492 | + virtual t_uint32 get_command_count() { | |
2493 | +#endif | |
2494 | + return 1; | |
2495 | + } | |
2496 | + | |
2497 | +#if IS_FB2K_VER08 | |
2498 | + virtual void enum_item(unsigned n, string_base & out) { | |
2499 | + out = (n==0 ? g_menu_item : ""); | |
2500 | + } | |
2501 | +#elif IS_FB2K_VER09 | |
2502 | + virtual GUID get_command(t_uint32 p_index) | |
2503 | + { | |
2504 | + if (p_index == 0) { | |
2505 | + return menu_item_huygens_guid; | |
2506 | + } | |
2507 | + | |
2508 | + return pfc::guid_null; | |
2509 | + } | |
2510 | + | |
2511 | + virtual void get_name(t_uint32 p_index, string_base & p_out) | |
2512 | + { | |
2513 | + if (p_index == 0) { | |
2514 | + p_out = g_menu_item_title; | |
2515 | + } | |
2516 | + } | |
2517 | + | |
2518 | + virtual bool get_description(t_uint32 p_index, string_base & p_out) | |
2519 | + { | |
2520 | + if (p_index == 0) | |
2521 | + p_out = g_menu_item_description; | |
2522 | + else | |
2523 | + return false; | |
2524 | + | |
2525 | + return true; | |
2526 | + } | |
2527 | + virtual GUID get_parent() { | |
2528 | + return mainmenu_groups::playback_etc; | |
2529 | + } | |
2530 | + | |
2531 | +#endif | |
2532 | + | |
2533 | +#if IS_FB2K_VER08 | |
2534 | + virtual bool is_checked(int index) | |
2535 | + { | |
2536 | + bool flags = false; | |
2537 | + static const bool flag_checked = TRUE; | |
2538 | +#elif IS_FB2K_VER09 | |
2539 | + virtual bool get_display(t_uint32 index, pfc::string_base & text, t_uint32 & flags) | |
2540 | + { | |
2541 | + flags = 0; | |
2542 | +#endif | |
2543 | + switch (index) | |
2544 | + { | |
2545 | + case 0: | |
2546 | + if (cfg_use_plugin == 1) flags = flag_checked; | |
2547 | + break; | |
2548 | + } | |
2549 | + | |
2550 | +#if IS_FB2K_VER08 | |
2551 | + return flags; | |
2552 | +#elif IS_FB2K_VER09 | |
2553 | + get_name(index, text); | |
2554 | + return true; | |
2555 | +#endif | |
2556 | + } | |
2557 | + | |
2558 | +#if IS_FB2K_VER08 | |
2559 | + virtual void perform_command(unsigned index) | |
2560 | + { | |
2561 | +#elif IS_FB2K_VER09 | |
2562 | + virtual void execute(t_uint32 index, service_ptr_t<service_base> /* reserved for future use */) | |
2563 | + { | |
2564 | +#endif | |
2565 | + if ((index == 0) && core_api::assert_main_thread()) | |
2566 | + { | |
2567 | + cfg_use_plugin = 1 - cfg_use_plugin; | |
2568 | + | |
2569 | + if(cfg_use_plugin > 1) | |
2570 | + { | |
2571 | + cfg_use_plugin = 1; | |
2572 | + } | |
2573 | + else if(cfg_use_plugin < 0) | |
2574 | + { | |
2575 | + cfg_use_plugin = 0; | |
2576 | + } | |
2577 | + | |
2578 | + if (cfg_use_plugin == 1) | |
2579 | + { | |
2580 | + DEBUG_PLUGIN(_T("menu_item_huygens::execute - Huygens の応答機能を有効にしました")); | |
2581 | + } | |
2582 | + else | |
2583 | + { | |
2584 | + DEBUG_PLUGIN(_T("menu_item_huygens::execute - Huygens の応答機能を無効にしました")); | |
2585 | + } | |
2586 | + } | |
2587 | + } | |
2588 | +}; | |
2589 | + | |
2590 | +#if IS_FB2K_VER08 | |
2591 | +class config_page_huygens : public config | |
2592 | +#elif IS_FB2K_VER09 | |
2593 | +// {81110BB1-9F51-473d-BB40-C91D2F0A8329} | |
2594 | +static const GUID config_page_huygens_guid = { 0x81110bb1, 0x9f51, 0x473d, { 0xbb, 0x40, 0xc9, 0x1d, 0x2f, 0xa, 0x83, 0x29 } }; | |
2595 | +class config_page_huygens : public preferences_page | |
2596 | +#endif | |
2597 | +{ | |
2598 | + static BOOL CALLBACK ConfigProc(HWND wnd,UINT msg,WPARAM wp,LPARAM lp) | |
2599 | + { | |
2600 | + switch(msg) | |
2601 | + { | |
2602 | + case WM_INITDIALOG: | |
2603 | + { | |
2604 | + uButton_SetCheck(wnd, IDC_USE_PLUGIN, (cfg_use_plugin == 1) ? true : false); | |
2605 | + | |
2606 | + setDlgVersionInfo(wnd, IDC_VERSION, IDC_BUILD); | |
2607 | + } | |
2608 | + break; | |
2609 | + | |
2610 | + case WM_COMMAND: | |
2611 | + switch(wp) | |
2612 | + { | |
2613 | + case (BN_CLICKED<<16)|IDC_USE_PLUGIN: | |
2614 | + cfg_use_plugin = uButton_GetCheck(wnd, IDC_USE_PLUGIN) ? 1 : 0; | |
2615 | + break; | |
2616 | + } | |
2617 | + break; | |
2618 | + | |
2619 | + } | |
2620 | + | |
2621 | + return 0; | |
2622 | + } | |
2623 | + | |
2624 | +public: | |
2625 | + virtual HWND create(HWND parent) | |
2626 | + { | |
2627 | + return uCreateDialog(IDD_PREFERENCE, parent, ConfigProc); | |
2628 | + } | |
2629 | + | |
2630 | + virtual const char * get_name() { | |
2631 | + return g_pluginCaption8; | |
2632 | + } | |
2633 | + | |
2634 | + virtual const char * get_parent_name() { | |
2635 | + return "Components"; | |
2636 | + } | |
2637 | + | |
2638 | +#if IS_FB2K_VER09 | |
2639 | + virtual GUID get_guid() { | |
2640 | + return config_page_huygens_guid; | |
2641 | + } | |
2642 | + | |
2643 | + virtual GUID get_parent_guid() { | |
2644 | + return guid_tools; | |
2645 | + } | |
2646 | + | |
2647 | + virtual bool reset_query() { | |
2648 | + return true; | |
2649 | + } | |
2650 | + | |
2651 | + virtual void reset() | |
2652 | + { | |
2653 | + cfg_use_plugin = 1; | |
2654 | + } | |
2655 | + | |
2656 | + virtual bool get_help_url(pfc::string_base & p_out) | |
2657 | + { | |
2658 | + p_out = URL_FOO_HUYGENS_HOME; | |
2659 | + return true; | |
2660 | + } | |
2661 | +#endif | |
2662 | +}; | |
2663 | + | |
2664 | +#if IS_FB2K_VER08 | |
2665 | +class config_page_huygens_advanced : public config | |
2666 | +#elif IS_FB2K_VER09 | |
2667 | +// {237E0DDE-DE84-42f1-B3FA-AA2AB0A4B0B0} | |
2668 | +static const GUID config_page_huygens_advanced_guid = { 0x237e0dde, 0xde84, 0x42f1, { 0xb3, 0xfa, 0xaa, 0x2a, 0xb0, 0xa4, 0xb0, 0xb0 } }; | |
2669 | +class config_page_huygens_advanced : public preferences_page_v2 | |
2670 | +#endif | |
2671 | +{ | |
2672 | + static int nOldDummyMp3Location; | |
2673 | + static string8 oldGenMixiPath; | |
2674 | + | |
2675 | + static BOOL CALLBACK ConfigProc(HWND wnd,UINT msg,WPARAM wp,LPARAM lp) | |
2676 | + { | |
2677 | + switch(msg) | |
2678 | + { | |
2679 | + case WM_INITDIALOG: | |
2680 | + { | |
2681 | + uSetDlgItemText(wnd, IDC_CAPTION_ADVANCED, g_advancedSettingsCaption8); | |
2682 | + | |
2683 | + uButton_SetCheck(wnd, IDC_SHOW_HUYGENS, (cfg_show_huygens == 1) ? true : false); | |
2684 | + if(Probe::getInstance()->getWnd() == INVALID_HANDLE_VALUE) { | |
2685 | + HWND hControlWnd = uGetDlgItem(wnd, IDC_SHOW_HUYGENS); | |
2686 | + uEnableWindow(hControlWnd, false); | |
2687 | + } | |
2688 | + | |
2689 | + uSetDlgItemText(wnd, IDC_HUYGENS_TITLE_FORMAT, cfg_huygens_title_format); | |
2690 | + uSetDlgItemText(wnd, IDC_HUYGENS_PLAYLIST_FORMAT, cfg_huygens_playlist_format); | |
2691 | + | |
2692 | + uButton_SetCheck(wnd, IDC_DISABLE_ANSI_TRANS, (cfg_disable_ansi_trans == 1) ? true : false); | |
2693 | + | |
2694 | + setDlgVersionInfo(wnd, IDC_VERSION_ADVANCED, IDC_BUILD_ADVANCED); | |
2695 | + } | |
2696 | + break; | |
2697 | + | |
2698 | + case WM_COMMAND: | |
2699 | + switch(wp) | |
2700 | + { | |
2701 | + case (BN_CLICKED<<16)|IDC_SHOW_HUYGENS: | |
2702 | + { | |
2703 | + bool bShowProbe = uButton_GetCheck(wnd, IDC_SHOW_HUYGENS); | |
2704 | + cfg_show_huygens = bShowProbe ? 1 : 0; | |
2705 | + | |
2706 | + Probe::getInstance()->showProbeWindow(bShowProbe); | |
2707 | + } | |
2708 | + break; | |
2709 | + | |
2710 | + case (EN_CHANGE<<16)|IDC_HUYGENS_PLAYLIST_FORMAT: | |
2711 | + { | |
2712 | + string8 format; | |
2713 | + uGetWindowText(reinterpret_cast<HWND>(lp), format); | |
2714 | + cfg_huygens_title_format = format; | |
2715 | + } | |
2716 | + break; | |
2717 | + | |
2718 | + case (EN_CHANGE<<16)|IDC_HUYGENS_TITLE_FORMAT: | |
2719 | + { | |
2720 | + string8 format; | |
2721 | + uGetWindowText(reinterpret_cast<HWND>(lp), format); | |
2722 | + cfg_huygens_playlist_format = format; | |
2723 | + } | |
2724 | + break; | |
2725 | + | |
2726 | + case (BN_CLICKED<<16)|IDC_DISABLE_ANSI_TRANS: | |
2727 | + { | |
2728 | + cfg_disable_ansi_trans = uButton_GetCheck(wnd, IDC_DISABLE_ANSI_TRANS) ? 1 : 0; | |
2729 | + } | |
2730 | + break; | |
2731 | + | |
2732 | + default: | |
2733 | + break; | |
2734 | + } | |
2735 | + break; | |
2736 | + } | |
2737 | + | |
2738 | + return 0; | |
2739 | + } | |
2740 | + | |
2741 | +public: | |
2742 | + | |
2743 | + virtual HWND create(HWND parent) | |
2744 | + { | |
2745 | + return uCreateDialog(IDD_ADVANCED_SETTINGS, parent, ConfigProc); | |
2746 | + } | |
2747 | + | |
2748 | + virtual const char * get_name() { | |
2749 | + return g_advancedSettingsCaption8; | |
2750 | + } | |
2751 | + virtual const char * get_parent_name() { | |
2752 | + return g_pluginCaption8; | |
2753 | + } | |
2754 | + | |
2755 | +#if IS_FB2K_VER09 | |
2756 | + virtual GUID get_guid() { | |
2757 | + return config_page_huygens_advanced_guid; | |
2758 | + } | |
2759 | + | |
2760 | + virtual GUID get_parent_guid() { | |
2761 | + return config_page_huygens_guid; | |
2762 | + } | |
2763 | + | |
2764 | + virtual double get_sort_priority() { | |
2765 | + return 1.0; | |
2766 | + } | |
2767 | + | |
2768 | + virtual bool reset_query() { | |
2769 | + return true; | |
2770 | + } | |
2771 | + | |
2772 | + virtual void reset() { | |
2773 | + cfg_show_huygens = 0; | |
2774 | + cfg_huygens_title_format = DEFAULT_HUYGENS_TITLE; | |
2775 | + cfg_huygens_playlist_format = DEFAULT_HUYGENS_TITLE; | |
2776 | + } | |
2777 | + | |
2778 | + virtual bool get_help_url(pfc::string_base & p_out) { | |
2779 | + p_out = URL_FOO_HUYGENS_HOME; | |
2780 | + return true; | |
2781 | + } | |
2782 | +#endif | |
2783 | +}; | |
2784 | + | |
2785 | +#if IS_FB2K_VER08 | |
2786 | +class config_page_huygens_debug : public config | |
2787 | +#elif IS_FB2K_VER09 | |
2788 | +// {C0B24574-B65A-430e-9F27-D7BBADB28053} | |
2789 | +static const GUID config_page_huygens_debug_guid = { 0xc0b24574, 0xb65a, 0x430e, { 0x9f, 0x27, 0xd7, 0xbb, 0xad, 0xb2, 0x80, 0x53 } }; | |
2790 | +class config_page_huygens_debug : public preferences_page_v2 | |
2791 | +#endif | |
2792 | +{ | |
2793 | + static BOOL CALLBACK ConfigProc(HWND wnd,UINT msg,WPARAM wp,LPARAM lp) | |
2794 | + { | |
2795 | + switch(msg) | |
2796 | + { | |
2797 | + case WM_INITDIALOG: | |
2798 | + { | |
2799 | + uSetDlgItemText(wnd, IDC_CAPTION_DEBUG, g_debugSettingsCaption8); | |
2800 | + | |
2801 | + bool bDebugLogEnabled = (cfg_enable_debug_log == 1) ? true : false; | |
2802 | + uButton_SetCheck(wnd, IDC_ENABLE_DEBUG_LOG, bDebugLogEnabled); | |
2803 | + | |
2804 | + InitDebugLevelList(wnd, IDC_DEBUG_HUYGENS_INIT); | |
2805 | + InitDebugLevelList(wnd, IDC_DEBUG_HUYGENS_PROC); | |
2806 | + InitDebugLevelList(wnd, IDC_DEBUG_TRACK_INFO); | |
2807 | + InitDebugLevelList(wnd, IDC_DEBUG_PLUGIN); | |
2808 | + InitDebugLevelList(wnd, IDC_DEBUG_CALLBACK); | |
2809 | + | |
2810 | + EnableDebugLevelLists(wnd, bDebugLogEnabled); | |
2811 | + | |
2812 | + uSendDlgItemMessage(wnd, IDC_DEBUG_HUYGENS_INIT, CB_SETCURSEL, (int)cfg_debug_huygens_init, 0); | |
2813 | + uSendDlgItemMessage(wnd, IDC_DEBUG_HUYGENS_PROC, CB_SETCURSEL, (int)cfg_debug_huygens_proc, 0); | |
2814 | + uSendDlgItemMessage(wnd, IDC_DEBUG_TRACK_INFO, CB_SETCURSEL, (int)cfg_debug_track_info, 0); | |
2815 | + uSendDlgItemMessage(wnd, IDC_DEBUG_PLUGIN, CB_SETCURSEL, (int)cfg_debug_plugin, 0); | |
2816 | + uSendDlgItemMessage(wnd, IDC_DEBUG_CALLBACK, CB_SETCURSEL, (int)cfg_debug_callback, 0); | |
2817 | + | |
2818 | + setDlgVersionInfo(wnd, IDC_VERSION_DEBUG, IDC_BUILD_DEBUG); | |
2819 | + } | |
2820 | + break; | |
2821 | + | |
2822 | + case WM_COMMAND: | |
2823 | + switch(wp) | |
2824 | + { | |
2825 | + case (BN_CLICKED<<16)|IDC_ENABLE_DEBUG_LOG: | |
2826 | + { | |
2827 | + bool bDebugLogEnabled = uButton_GetCheck(wnd, IDC_ENABLE_DEBUG_LOG); | |
2828 | + cfg_enable_debug_log = bDebugLogEnabled ? 1 : 0; | |
2829 | + | |
2830 | + EnableDebugLevelLists(wnd, bDebugLogEnabled); | |
2831 | + } | |
2832 | + break; | |
2833 | + | |
2834 | + case (CBN_SELCHANGE<<16)|IDC_DEBUG_HUYGENS_INIT: | |
2835 | + { | |
2836 | + int sel = uSendMessage(reinterpret_cast<HWND>(lp), CB_GETCURSEL, 0, 0); | |
2837 | + cfg_debug_huygens_init = sel; | |
2838 | + } | |
2839 | + break; | |
2840 | + | |
2841 | + case (CBN_SELCHANGE<<16)|IDC_DEBUG_HUYGENS_PROC: | |
2842 | + { | |
2843 | + int sel = uSendMessage(reinterpret_cast<HWND>(lp), CB_GETCURSEL, 0, 0); | |
2844 | + cfg_debug_huygens_proc = sel; | |
2845 | + } | |
2846 | + break; | |
2847 | + | |
2848 | + case (CBN_SELCHANGE<<16)|IDC_DEBUG_TRACK_INFO: | |
2849 | + { | |
2850 | + int sel = uSendMessage(reinterpret_cast<HWND>(lp), CB_GETCURSEL, 0, 0); | |
2851 | + cfg_debug_track_info = sel; | |
2852 | + } | |
2853 | + break; | |
2854 | + | |
2855 | + case (CBN_SELCHANGE<<16)|IDC_DEBUG_PLUGIN: | |
2856 | + { | |
2857 | + int sel = uSendMessage(reinterpret_cast<HWND>(lp), CB_GETCURSEL, 0, 0); | |
2858 | + cfg_debug_plugin = sel; | |
2859 | + } | |
2860 | + break; | |
2861 | + | |
2862 | + case (CBN_SELCHANGE<<16)|IDC_DEBUG_CALLBACK: | |
2863 | + { | |
2864 | + int sel = uSendMessage(reinterpret_cast<HWND>(lp), CB_GETCURSEL, 0, 0); | |
2865 | + cfg_debug_callback = sel; | |
2866 | + } | |
2867 | + break; | |
2868 | + | |
2869 | + default: | |
2870 | + break; | |
2871 | + } | |
2872 | + break; | |
2873 | + | |
2874 | + case WM_DESTROY: | |
2875 | + break; | |
2876 | + } | |
2877 | + | |
2878 | + return 0; | |
2879 | + } | |
2880 | + | |
2881 | +protected: | |
2882 | + | |
2883 | + static void InitDebugLevelList(HWND wnd, UINT id) | |
2884 | + { | |
2885 | + uSendDlgItemMessage(wnd, id, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(_T("なし"))); | |
2886 | + uSendDlgItemMessage(wnd, id, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(_T("簡易レベル"))); | |
2887 | + uSendDlgItemMessage(wnd, id, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(_T("詳細レベル"))); | |
2888 | + } | |
2889 | + | |
2890 | + static void EnableDebugLevelLists(HWND wnd, bool bDebugLogEnabled) | |
2891 | + { | |
2892 | + EnableDebugLevelList(wnd, IDC_DEBUG_HUYGENS_INIT, bDebugLogEnabled); | |
2893 | + EnableDebugLevelList(wnd, IDC_DEBUG_HUYGENS_PROC, bDebugLogEnabled); | |
2894 | + EnableDebugLevelList(wnd, IDC_DEBUG_TRACK_INFO, bDebugLogEnabled); | |
2895 | + EnableDebugLevelList(wnd, IDC_DEBUG_PLUGIN, bDebugLogEnabled); | |
2896 | + EnableDebugLevelList(wnd, IDC_DEBUG_CALLBACK, bDebugLogEnabled); | |
2897 | + } | |
2898 | + | |
2899 | + static void EnableDebugLevelList(HWND wnd, UINT id, bool bEnable) | |
2900 | + { | |
2901 | + HWND hControlWnd = uGetDlgItem(wnd, id); | |
2902 | + uEnableWindow(hControlWnd, bEnable); | |
2903 | + } | |
2904 | + | |
2905 | +public: | |
2906 | + | |
2907 | + virtual HWND create(HWND parent) | |
2908 | + { | |
2909 | + return uCreateDialog(IDD_DEBUG_SETTINGS, parent, ConfigProc); | |
2910 | + } | |
2911 | + | |
2912 | + virtual const char * get_name() { | |
2913 | + return g_debugSettingsCaption8; | |
2914 | + } | |
2915 | + virtual const char * get_parent_name() { | |
2916 | + return g_pluginCaption8; | |
2917 | + } | |
2918 | + | |
2919 | +#if IS_FB2K_VER09 | |
2920 | + virtual GUID get_guid() { | |
2921 | + return config_page_huygens_debug_guid; | |
2922 | + } | |
2923 | + | |
2924 | + virtual GUID get_parent_guid() { | |
2925 | + return config_page_huygens_guid; | |
2926 | + } | |
2927 | + | |
2928 | + virtual double get_sort_priority() { | |
2929 | + return 2.0; | |
2930 | + } | |
2931 | + | |
2932 | + virtual bool reset_query() { | |
2933 | + return true; | |
2934 | + } | |
2935 | + | |
2936 | + virtual void reset() { | |
2937 | + cfg_enable_debug_log = 1; | |
2938 | + cfg_debug_huygens_init = 1; | |
2939 | + cfg_debug_huygens_proc = 1; | |
2940 | + cfg_debug_track_info = 1; | |
2941 | + cfg_debug_plugin = 1; | |
2942 | + cfg_debug_callback = 1; | |
2943 | + } | |
2944 | + | |
2945 | + virtual bool get_help_url(pfc::string_base & p_out) { | |
2946 | + p_out = URL_FOO_HUYGENS_HOME; | |
2947 | + return true; | |
2948 | + } | |
2949 | +#endif | |
2950 | +}; | |
2951 | + | |
2952 | +#if IS_FB2K_VER08 | |
2953 | +static service_factory_single_t<play_callback, play_callback_huygens> foo1; | |
2954 | +static service_factory_single_t<initquit, initquit_send> foo2; | |
2955 | +static menu_item_factory<menu_item_huygens> foo3; | |
2956 | +static service_factory_single_t<config, config_page_huygens> foo4; | |
2957 | +static service_factory_single_t<config, config_page_huygens_advanced> foo5; | |
2958 | +static service_factory_single_t<config, config_page_huygens_debug> foo6; | |
2959 | +#elif IS_FB2K_VER09 | |
2960 | +static service_factory_single_t<play_callback_huygens> foo1; | |
2961 | +static initquit_factory_t<initquit_send> foo2; | |
2962 | +static mainmenu_commands_factory_t<menu_item_huygens> foo3; | |
2963 | +static preferences_page_factory_t<config_page_huygens> foo4; | |
2964 | +static preferences_page_factory_t<config_page_huygens_advanced> foo5; | |
2965 | +static preferences_page_factory_t<config_page_huygens_debug> foo6; | |
2966 | +#endif | |
2967 | + | |
2968 | +tstring GetErrorMessage(DWORD errCode) | |
2969 | +{ | |
2970 | + | |
2971 | + LPVOID lpMsgBuf; | |
2972 | + | |
2973 | + FormatMessage( | |
2974 | + FORMAT_MESSAGE_ALLOCATE_BUFFER | | |
2975 | + FORMAT_MESSAGE_FROM_SYSTEM | | |
2976 | + FORMAT_MESSAGE_IGNORE_INSERTS, | |
2977 | + NULL, | |
2978 | + errCode, | |
2979 | + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // デフォルト言語 | |
2980 | + (LPTSTR) &lpMsgBuf, | |
2981 | + 0, | |
2982 | + NULL | |
2983 | + ); | |
2984 | + | |
2985 | + tstring msg((LPCTSTR)lpMsgBuf); | |
2986 | + | |
2987 | + GlobalFree(lpMsgBuf); | |
2988 | + | |
2989 | + return msg; | |
2990 | +} | |
2991 | + | |
2992 | +void putLogError(LPCTSTR pMethod, LPCTSTR pErrMsg, DWORD dwErrCode) | |
2993 | +{ | |
2994 | + tstring errMsg = GetErrorMessage(dwErrCode); | |
2995 | + | |
2996 | + LOG_ERROR(_T("%s - %s"), pMethod, pErrMsg); | |
2997 | + LOG_ERROR(_T("%s - コード: %08x, 理由: %s"), pMethod, dwErrCode, errMsg.c_str()); | |
2998 | +} | |
2999 | + | |
3000 | +void setDlgVersionInfo(HWND wnd, UINT idc_version, UINT idc_build) { | |
3001 | + | |
3002 | + StrDBCS64K version; | |
3003 | + | |
3004 | + sprintf_s(version, sizeof(StrDBCS64K), PLUGIN_CAPTION " " PLUGIN_VERSION_PREFIX PLUGIN_VERSION_VAL " with SDK%d (compatible%d)", | |
3005 | + foobar2000_client::FOOBAR2000_CLIENT_VERSION, foobar2000_client::FOOBAR2000_CLIENT_VERSION_COMPATIBLE); | |
3006 | + | |
3007 | + uSetDlgItemText(wnd, idc_version, version); | |
3008 | + uSetDlgItemText(wnd, idc_build, "build on " __DATE__ ", " __TIME__); | |
3009 | +} | |
3010 | + | |
3011 | +void DebugPrint(LPCTSTR lpszFormat, ...) | |
3012 | +{ | |
3013 | + static Str64K buf; | |
3014 | + va_list marker; | |
3015 | + | |
3016 | + va_start(marker, lpszFormat); | |
3017 | + _vstprintf_s(buf, sizeof(Str64K) / sizeof(TCHAR), lpszFormat, marker); | |
3018 | + va_end(marker); | |
3019 | + | |
3020 | + OutputDebugString(buf); | |
3021 | + OutputDebugString(_T("\n")); | |
3022 | + | |
3023 | + string_utf8_from_os tmp(buf); | |
3024 | + | |
3025 | + console::info(tmp); | |
3026 | +} | |
3027 | + | |
3028 | +void DebugPrint8(LPCSTR lpszFormat, ...) | |
3029 | +{ | |
3030 | + static StrDBCS64K buf; | |
3031 | + | |
3032 | + va_list marker; | |
3033 | + | |
3034 | + va_start(marker, lpszFormat); | |
3035 | + vsprintf_s(buf, sizeof(StrDBCS64K), lpszFormat, marker); | |
3036 | + va_end(marker); | |
3037 | + | |
3038 | + console::info(buf); | |
3039 | + | |
3040 | + string_os_from_utf8 tmp(buf); | |
3041 | + | |
3042 | + OutputDebugString(tmp); | |
3043 | + OutputDebugString(_T("\n")); | |
3044 | +} |
@@ -0,0 +1,298 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +#if !defined(HUY_IPC_H_CE87645E_DFB8_4418_A904_403DCB282C84) | |
4 | + | |
5 | +#define HUY_IPC_H_CE87645E_DFB8_4418_A904_403DCB282C84 | |
6 | + | |
7 | +//! Huygens IPC コマンド | |
8 | +#define WM_HUY_IPC WM_APP | |
9 | + | |
10 | +//! Huygensカテゴリ:プラグイン情報 | |
11 | +#define HUY_INFO_PLUGIN 0x0000 | |
12 | +//! Huygensカテゴリ:トラック情報 | |
13 | +#define HUY_INFO_TRACK 0x0100 | |
14 | +//! Huygensカテゴリ:再生情報 | |
15 | +#define HUY_INFO_PLAYBACK 0x0200 | |
16 | +//! Huygensカテゴリ:プレイリスト情報 | |
17 | +#define HUY_INFO_PLAYLIST 0x0300 | |
18 | +//! Huygensカテゴリ:プラグイン制御 | |
19 | +#define HUY_CTRL_PLUGIN 0x0A00 | |
20 | +//! Huygensカテゴリ:再生制御 | |
21 | +#define HUY_CTRL_PLAYBACK 0x0800 | |
22 | +//! Huygensカテゴリ:プレイリスト制御 | |
23 | +#define HUY_CTRL_PLAYLIST 0x0900 | |
24 | + | |
25 | +//! プラグインバージョンの取得 (out:string [d.ddd]) | |
26 | +#define HUY_GETVERSION (HUY_INFO_PLUGIN | 0x00) | |
27 | + | |
28 | +//! foobar2000 バージョンの取得 (out:string) | |
29 | +#define HUY_GETFB2KVERSION (HUY_INFO_PLUGIN | 0x01) | |
30 | + | |
31 | +//! エンコードモードの取得(0:OS codepage [ShiftJIS], 1:UTF-8) (out:int) | |
32 | +#define HUY_GETENCODEMODE (HUY_INFO_PLUGIN | 0x02) | |
33 | + | |
34 | +//! ファイルパスを取得 (out:string) | |
35 | +#define HUY_GETFILEPATH (HUY_INFO_TRACK | 0x00) | |
36 | + | |
37 | +//! プロトコルを含んだファイルパスを取得 (out:string) | |
38 | +#define HUY_GETFILEPATHRAW (HUY_INFO_TRACK | 0x2D) | |
39 | + | |
40 | +//! 曲の長さを取得 [msec.×1000] (out:int) | |
41 | +#define HUY_GETDURATION (HUY_INFO_TRACK | 0x01) | |
42 | + | |
43 | +//! アーティスト名を取得 (out:string) | |
44 | +#define HUY_GETARTIST (HUY_INFO_TRACK | 0x02) | |
45 | + | |
46 | +//! トラックタイトルを取得 (out:string) | |
47 | +#define HUY_GETTRACKTITLE (HUY_INFO_TRACK | 0x03) | |
48 | + | |
49 | +//! アルバムタイトルを取得 (out:string) | |
50 | +#define HUY_GETALBUMTITLE (HUY_INFO_TRACK | 0x04) | |
51 | + | |
52 | +//! ジャンルを取得 (out:string) | |
53 | +#define HUY_GETGENRE (HUY_INFO_TRACK | 0x1B) | |
54 | + | |
55 | +//! 出版年月日を取得 (out:string) | |
56 | +#define HUY_GETDATE (HUY_INFO_TRACK | 0x05) | |
57 | + | |
58 | +//! 作曲者を取得 (out:string) | |
59 | +#define HUY_GETCOMPOSER (HUY_INFO_TRACK | 0x06) | |
60 | + | |
61 | +//! 演奏者を取得 (out:string) | |
62 | +#define HUY_GETPERFORMER (HUY_INFO_TRACK | 0x07) | |
63 | + | |
64 | +//! アルバムアーティスト名を取得 (out:string) | |
65 | +#define HUY_GETALBUMARTIST (HUY_INFO_TRACK | 0x08) | |
66 | + | |
67 | +//! トラックアーティスト名を取得 (out:string) | |
68 | +#define HUY_GETTRACKARTIST (HUY_INFO_TRACK | 0x19) | |
69 | + | |
70 | +//! サブソングインデックスを取得 (out:int) | |
71 | +#define HUY_GETSUBSONG (HUY_INFO_TRACK | 0x1A) | |
72 | + | |
73 | +//! トラック番号を取得 (out:int) | |
74 | +#define HUY_GETTRACKNO (HUY_INFO_TRACK | 0x09) | |
75 | + | |
76 | +//! 総トラック数を取得 (out:int) | |
77 | +#define HUY_GETTOTALTRACKS (HUY_INFO_TRACK | 0x0A) | |
78 | + | |
79 | +//! ディスク番号を取得 (out:int) | |
80 | +#define HUY_GETDISCNO (HUY_INFO_TRACK | 0x0B) | |
81 | + | |
82 | +//! 総ディスク数を取得 (out:int) | |
83 | +#define HUY_GETTOTALDISCS (HUY_INFO_TRACK | 0x0C) | |
84 | + | |
85 | +//! コメントを取得 (out:string) | |
86 | +#define HUY_GETCOMMENT (HUY_INFO_TRACK | 0x0D) | |
87 | + | |
88 | +//! サンプリングレート[Hz]の取得 (out:int) | |
89 | +#define HUY_GETSAMPLERATE (HUY_INFO_TRACK | 0x0E) | |
90 | + | |
91 | +//! ビットレート[kbps]の取得 (out:int) | |
92 | +#define HUY_GETBITRATE (HUY_INFO_TRACK | 0x0F) | |
93 | + | |
94 | +//! 公称ビットレート[kbps]の取得 (out:int) | |
95 | +#define HUY_GETBITRATENOMINAL (HUY_INFO_TRACK | 0x27) | |
96 | + | |
97 | +//! 動的ビットレート[kbps]の取得 (out:int) | |
98 | +#define HUY_GETBITRATEDYNAMIC (HUY_INFO_TRACK | 0x2C) | |
99 | + | |
100 | +//! チャンネル数の取得 (out:int) | |
101 | +#define HUY_GETCHANNELS (HUY_INFO_TRACK | 0x10) | |
102 | + | |
103 | +//! ビット数/サンプルの取得 (out:int) | |
104 | +#define HUY_GETBITSPERSAMPLE (HUY_INFO_TRACK | 0x1C) | |
105 | + | |
106 | +//! コーデック名の取得 (out:string) | |
107 | +#define HUY_GETCODEC (HUY_INFO_TRACK | 0x11) | |
108 | + | |
109 | +//! コーデックプロファイルの取得 (out:string) | |
110 | +#define HUY_GETCODECPROFILE (HUY_INFO_TRACK | 0x12) | |
111 | + | |
112 | +//! 可逆/非可逆の取得(0:lossy、1:lossless) | |
113 | +#define HUY_ISLOSSLESS (HUY_INFO_TRACK | 0x13) | |
114 | + | |
115 | +//! タグタイプの取得 (out:string) | |
116 | +#define HUY_GETTAGTYPE (HUY_INFO_TRACK | 0x14) | |
117 | + | |
118 | +//! extrainfo の取得 (out:string) | |
119 | +#define HUY_GETEXTRAINFO (HUY_INFO_TRACK | 0x1D) | |
120 | + | |
121 | +//! tool の取得 (out:string) | |
122 | +#define HUY_GETTOOL (HUY_INFO_TRACK | 0x1E) | |
123 | + | |
124 | +//! cue_embedded の取得(0:no、1:yes) (out:int) | |
125 | +#define HUY_GETCUEEMBEDDED (HUY_INFO_TRACK | 0x1F) | |
126 | + | |
127 | +//! audio md5 hash の取得 (out:string) | |
128 | +#define HUY_GETAUDIOMD5HASH (HUY_INFO_TRACK | 0x20) | |
129 | + | |
130 | +//! mp3 stereo mode の取得(0:stereo、1:joint stereo) (out:int) | |
131 | +#define HUY_GETMP3STEREOMODE (HUY_INFO_TRACK | 0x21) | |
132 | + | |
133 | +//! mp3 acuurate length の取得 (out:int) | |
134 | +#define HUY_GETMP3ACCURATELENGTH (HUY_INFO_TRACK | 0x22) | |
135 | + | |
136 | +//! mp3 enc_delay の取得 (out:int) | |
137 | +#define HUY_GETMP3ENCDELAY (HUY_INFO_TRACK | 0x23) | |
138 | + | |
139 | +//! mp3 enc_padding の取得 (out:string) | |
140 | +#define HUY_GETMP3ENCPADDING (HUY_INFO_TRACK | 0x24) | |
141 | + | |
142 | +//! ape version の取得 (out:string) | |
143 | +#define HUY_GETAPEVERSION (HUY_INFO_TRACK | 0x25) | |
144 | + | |
145 | +//! ape flags の取得 (out:string) | |
146 | +#define HUY_GETAPEFLAGS (HUY_INFO_TRACK | 0x26) | |
147 | + | |
148 | +//! ReplayGain album gain の取得 (out:int) | |
149 | +#define HUY_GETREPLAYGAIN_ALBUMGAIN (HUY_INFO_TRACK | 0x28) | |
150 | + | |
151 | +//! ReplayGain album peek の取得 (out:int) | |
152 | +#define HUY_GETREPLAYGAIN_ALBUMPEEK (HUY_INFO_TRACK | 0x29) | |
153 | + | |
154 | +//! ReplayGain track gain の取得 (out:int) | |
155 | +#define HUY_GETREPLAYGAIN_TRACKGAIN (HUY_INFO_TRACK | 0x2A) | |
156 | + | |
157 | +//! ReplayGain track peek の取得 (out:int) | |
158 | +#define HUY_GETREPLAYGAIN_TRACKPEEK (HUY_INFO_TRACK | 0x2B) | |
159 | + | |
160 | +//! ファイルサイズの取得 (out:string ※not int, max. = UINT64_MAX) | |
161 | +#define HUY_GETFILESIZE (HUY_INFO_TRACK | 0x15) | |
162 | + | |
163 | +//! ファイル作成日時の取得 (UTC) [YYYYMMDDHH24MISS.mmmuuun00] (out:string) | |
164 | +#define HUY_GETFILECREATED (HUY_INFO_TRACK | 0x16) | |
165 | + | |
166 | +//! ファイル更新日時の取得 (UTC) [YYYYMMDDHH24MISS.mmmuuun00] (out:string) | |
167 | +#define HUY_GETFILELASTMOD (HUY_INFO_TRACK | 0x17) | |
168 | + | |
169 | +//! メディアライブラリへの登録の有無の取得(0:登録なし、1:登録あり) | |
170 | +#define HUY_ISINMEDIALIB (HUY_INFO_TRACK | 0x18) | |
171 | + | |
172 | +//! 再生状態の取得(1:再生中、0:停止中、3:一時停止中) (out:int) | |
173 | +#define HUY_GETSTATUS (HUY_INFO_PLAYBACK | 0x00) | |
174 | + | |
175 | +//! 再生位置の取得 [msec.×1000] (out:int) | |
176 | +#define HUY_GETPOS (HUY_INFO_PLAYBACK | 0x01) | |
177 | + | |
178 | +//! リピート状態の取得(1:repeat playlist、2:repeat track、0:not repeat) (out:int) | |
179 | +#define HUY_GETREPEAT (HUY_INFO_PLAYBACK | 0x02) | |
180 | + | |
181 | +//! シャッフル状態の取得(1:shuffle tracks、2:shuffle albums、3:shuffle folders、0:not shuffle [0.8.3 always 0]) (out:int) | |
182 | +#define HUY_GETSHUFFLE (HUY_INFO_PLAYBACK | 0x03) | |
183 | + | |
184 | +//! ランダム状態の取得(1:random、0:not random) (out:int) | |
185 | +#define HUY_GETRANDOM (HUY_INFO_PLAYBACK | 0x04) | |
186 | + | |
187 | +//! 再生順の取得 | |
188 | +// (0:default、1:repeat playlist、2:repeat track、3:random、 | |
189 | +// 4:shuffle tracks [0.9+]、5:shuffle albums [0.9+]、6:shuffle folders [0.9+]) (out:int) | |
190 | +#define HUY_GETPLAYBACKORDER (HUY_INFO_PLAYBACK | 0x05) | |
191 | + | |
192 | +//! プレイリストのファイルパスを取得する | |
193 | +#define HUY_GETLISTFILEPATH (HUY_INFO_PLAYLIST | 0x00) | |
194 | + | |
195 | +//! プレイリスト名を取得する | |
196 | +#define HUY_GETLISTNAME (HUY_INFO_PLAYLIST | 0x01) | |
197 | + | |
198 | +//! プレイリストの長さを取得する | |
199 | +#define HUY_GETLISTLENGTH (HUY_INFO_PLAYLIST | 0x02) | |
200 | + | |
201 | +//! エントリタイトルを取得する | |
202 | +#define HUY_GETENTRYTITLE (HUY_INFO_PLAYLIST | 0x03) | |
203 | + | |
204 | +//! フォーカス中のプレイリスト位置を取得する | |
205 | +#define HUY_GETLISTFOCUSPOS (HUY_INFO_PLAYLIST | 0x04) | |
206 | + | |
207 | +//! プレイリスト情報の更新(Huygens内部制御用) | |
208 | +#define HUY_REFRESHLISTINFO (HUY_CTRL_PLUGIN | 0x00) | |
209 | + | |
210 | +//! 動的トラック情報の更新(Huygens内部制御用) | |
211 | +#define HUY_REFRESHDYNINFO (HUY_CTRL_PLUGIN | 0x01) | |
212 | + | |
213 | +//! 再生 | |
214 | +#define HUY_PLAY (HUY_CTRL_PLAYBACK | 0x00) | |
215 | + | |
216 | +//! 再生と一時停止のトグル | |
217 | +#define HUY_PLAYORPAUSE (HUY_CTRL_PLAYBACK | 0x14) | |
218 | + | |
219 | +//! 停止 | |
220 | +#define HUY_STOP (HUY_CTRL_PLAYBACK | 0x01) | |
221 | + | |
222 | +//! 一時停止 | |
223 | +#define HUY_PAUSE (HUY_CTRL_PLAYBACK | 0x02) | |
224 | + | |
225 | +//! 早送り(0:1s、1:5s、2:10s、3:30s、4:1min、5:2min、6:5min、7:10min) (in:int) | |
226 | +#define HUY_FASTFORWARD (HUY_CTRL_PLAYBACK | 0x03) | |
227 | + | |
228 | +//! 巻き戻し(0:1s、1:5s、2:10s、3:30s、4:1min、5:2min、6:5min、7:10min) (in:int) | |
229 | +#define HUY_REWIND (HUY_CTRL_PLAYBACK | 0x04) | |
230 | + | |
231 | +//! 前の曲へ | |
232 | +#define HUY_PREVIOUS (HUY_CTRL_PLAYBACK | 0x07) | |
233 | + | |
234 | +//! 次の曲へ | |
235 | +#define HUY_NEXT (HUY_CTRL_PLAYBACK | 0x08) | |
236 | + | |
237 | +//! 再生位置の指定 [msec.×1000] (in:int) | |
238 | +#define HUY_SEEK (HUY_CTRL_PLAYBACK | 0x09) | |
239 | + | |
240 | +//! ボリュームの指定(最小:0〜最大:255) (in:int) | |
241 | +#define HUY_SETVOLUME (HUY_CTRL_PLAYBACK | 0x0A) | |
242 | + | |
243 | +//! ボリュームを上げる | |
244 | +#define HUY_VOLUMEUP (HUY_CTRL_PLAYBACK | 0x0B) | |
245 | + | |
246 | +//! ボリュームを下げる | |
247 | +#define HUY_VOLUMEDOWN (HUY_CTRL_PLAYBACK | 0x0C) | |
248 | + | |
249 | +//! パンの指定(左:0〜右:255) (in:int) | |
250 | +#define HUY_SETPANNING (HUY_CTRL_PLAYBACK | 0x0D) | |
251 | + | |
252 | +//! リピートの指定(1:repeat playlist、2:repeat track、0:not repeat) (in:int) | |
253 | +#define HUY_SETREPEAT (HUY_CTRL_PLAYBACK | 0x0F) | |
254 | + | |
255 | +//! シャッフルの指定(1:shuffle tracks、2:shuffle albums、3:shuffle folders、0:not shuffle) (in:int) [0.9+] | |
256 | +#define HUY_SETSHUFFLE (HUY_CTRL_PLAYBACK | 0x10) | |
257 | + | |
258 | +//! ランダムの指定(1:random、0:not random) (in:int) | |
259 | +#define HUY_SETRANDOM (HUY_CTRL_PLAYBACK | 0x0E) | |
260 | + | |
261 | +//! 再生順の指定 | |
262 | +// (0:default、1:repeat playlist、2:repeat track、3:random、 | |
263 | +// 4:shuffle tracks [0.9+]、5:shuffle albums [0.9+]、6:shuffle folders [0.9+]) (in:int) | |
264 | +#define HUY_SETPLAYBACKORDER (HUY_CTRL_PLAYBACK | 0x15) | |
265 | + | |
266 | +//! リピートのトグル(not repeat→repeat playlist→repeat track→not repeat) | |
267 | +#define HUY_TOGGLEREPEAT (HUY_CTRL_PLAYBACK | 0x12) | |
268 | + | |
269 | +//! シャッフルのトグル(not shuffle→shuffle tracks→shuffle albums→shuffle folders→not shuffle) [0.9+] | |
270 | +#define HUY_TOGGLESHUFFLE (HUY_CTRL_PLAYBACK | 0x13) | |
271 | + | |
272 | +//! ランダムのトグル(not random→random→not random) | |
273 | +#define HUY_TOGGLERANDOM (HUY_CTRL_PLAYBACK | 0x11) | |
274 | + | |
275 | +//! 再生順の指定 | |
276 | +// (default→repeat playlist→repeat track→rando→ | |
277 | +// shuffle tracks [0.9+]→shuffle albums [0.9+]→shuffle folders [0.9+]→ default) | |
278 | +#define HUY_TOGGLEPLAYBACKORDER (HUY_CTRL_PLAYBACK | 0x16) | |
279 | + | |
280 | +//! 新規プレイリストを作成する | |
281 | +#define HUY_CREATELIST (HUY_CTRL_PLAYLIST | 0x00) | |
282 | + | |
283 | +//! プレイリストを読み込む | |
284 | +#define HUY_READLIST (HUY_CTRL_PLAYLIST | 0x01) | |
285 | + | |
286 | +//! プレイリストをファイルに出力する | |
287 | +#define HUY_WRITELIST (HUY_CTRL_PLAYLIST | 0x02); | |
288 | + | |
289 | +//! プレイリスト上の指定位置を選択する | |
290 | +#define HUY_SETLISTFOCUSPOS (HUY_CTRL_PLAYLIST | 0x03); | |
291 | + | |
292 | +//! ファイルをプレイリストに挿入する | |
293 | +#define HUY_INSERTFILE (HUY_CTRL_PLAYLIST | 0x04) | |
294 | + | |
295 | +//! ファイルをプレイリストから削除する | |
296 | +#define HUY_DELETEFILE (HUY_CTRL_PLAYLIST | 0x05); | |
297 | + | |
298 | +#endif // !definedHUY_IPC_H_CE87645E_DFB8_4418_A904_403DCB282C84 |
@@ -0,0 +1,674 @@ | ||
1 | + GNU GENERAL PUBLIC LICENSE | |
2 | + Version 3, 29 June 2007 | |
3 | + | |
4 | + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | |
5 | + Everyone is permitted to copy and distribute verbatim copies | |
6 | + of this license document, but changing it is not allowed. | |
7 | + | |
8 | + Preamble | |
9 | + | |
10 | + The GNU General Public License is a free, copyleft license for | |
11 | +software and other kinds of works. | |
12 | + | |
13 | + The licenses for most software and other practical works are designed | |
14 | +to take away your freedom to share and change the works. By contrast, | |
15 | +the GNU General Public License is intended to guarantee your freedom to | |
16 | +share and change all versions of a program--to make sure it remains free | |
17 | +software for all its users. We, the Free Software Foundation, use the | |
18 | +GNU General Public License for most of our software; it applies also to | |
19 | +any other work released this way by its authors. You can apply it to | |
20 | +your programs, too. | |
21 | + | |
22 | + When we speak of free software, we are referring to freedom, not | |
23 | +price. Our General Public Licenses are designed to make sure that you | |
24 | +have the freedom to distribute copies of free software (and charge for | |
25 | +them if you wish), that you receive source code or can get it if you | |
26 | +want it, that you can change the software or use pieces of it in new | |
27 | +free programs, and that you know you can do these things. | |
28 | + | |
29 | + To protect your rights, we need to prevent others from denying you | |
30 | +these rights or asking you to surrender the rights. Therefore, you have | |
31 | +certain responsibilities if you distribute copies of the software, or if | |
32 | +you modify it: responsibilities to respect the freedom of others. | |
33 | + | |
34 | + For example, if you distribute copies of such a program, whether | |
35 | +gratis or for a fee, you must pass on to the recipients the same | |
36 | +freedoms that you received. You must make sure that they, too, receive | |
37 | +or can get the source code. And you must show them these terms so they | |
38 | +know their rights. | |
39 | + | |
40 | + Developers that use the GNU GPL protect your rights with two steps: | |
41 | +(1) assert copyright on the software, and (2) offer you this License | |
42 | +giving you legal permission to copy, distribute and/or modify it. | |
43 | + | |
44 | + For the developers' and authors' protection, the GPL clearly explains | |
45 | +that there is no warranty for this free software. For both users' and | |
46 | +authors' sake, the GPL requires that modified versions be marked as | |
47 | +changed, so that their problems will not be attributed erroneously to | |
48 | +authors of previous versions. | |
49 | + | |
50 | + Some devices are designed to deny users access to install or run | |
51 | +modified versions of the software inside them, although the manufacturer | |
52 | +can do so. This is fundamentally incompatible with the aim of | |
53 | +protecting users' freedom to change the software. The systematic | |
54 | +pattern of such abuse occurs in the area of products for individuals to | |
55 | +use, which is precisely where it is most unacceptable. Therefore, we | |
56 | +have designed this version of the GPL to prohibit the practice for those | |
57 | +products. If such problems arise substantially in other domains, we | |
58 | +stand ready to extend this provision to those domains in future versions | |
59 | +of the GPL, as needed to protect the freedom of users. | |
60 | + | |
61 | + Finally, every program is threatened constantly by software patents. | |
62 | +States should not allow patents to restrict development and use of | |
63 | +software on general-purpose computers, but in those that do, we wish to | |
64 | +avoid the special danger that patents applied to a free program could | |
65 | +make it effectively proprietary. To prevent this, the GPL assures that | |
66 | +patents cannot be used to render the program non-free. | |
67 | + | |
68 | + The precise terms and conditions for copying, distribution and | |
69 | +modification follow. | |
70 | + | |
71 | + TERMS AND CONDITIONS | |
72 | + | |
73 | + 0. Definitions. | |
74 | + | |
75 | + "This License" refers to version 3 of the GNU General Public License. | |
76 | + | |
77 | + "Copyright" also means copyright-like laws that apply to other kinds of | |
78 | +works, such as semiconductor masks. | |
79 | + | |
80 | + "The Program" refers to any copyrightable work licensed under this | |
81 | +License. Each licensee is addressed as "you". "Licensees" and | |
82 | +"recipients" may be individuals or organizations. | |
83 | + | |
84 | + To "modify" a work means to copy from or adapt all or part of the work | |
85 | +in a fashion requiring copyright permission, other than the making of an | |
86 | +exact copy. The resulting work is called a "modified version" of the | |
87 | +earlier work or a work "based on" the earlier work. | |
88 | + | |
89 | + A "covered work" means either the unmodified Program or a work based | |
90 | +on the Program. | |
91 | + | |
92 | + To "propagate" a work means to do anything with it that, without | |
93 | +permission, would make you directly or secondarily liable for | |
94 | +infringement under applicable copyright law, except executing it on a | |
95 | +computer or modifying a private copy. Propagation includes copying, | |
96 | +distribution (with or without modification), making available to the | |
97 | +public, and in some countries other activities as well. | |
98 | + | |
99 | + To "convey" a work means any kind of propagation that enables other | |
100 | +parties to make or receive copies. Mere interaction with a user through | |
101 | +a computer network, with no transfer of a copy, is not conveying. | |
102 | + | |
103 | + An interactive user interface displays "Appropriate Legal Notices" | |
104 | +to the extent that it includes a convenient and prominently visible | |
105 | +feature that (1) displays an appropriate copyright notice, and (2) | |
106 | +tells the user that there is no warranty for the work (except to the | |
107 | +extent that warranties are provided), that licensees may convey the | |
108 | +work under this License, and how to view a copy of this License. If | |
109 | +the interface presents a list of user commands or options, such as a | |
110 | +menu, a prominent item in the list meets this criterion. | |
111 | + | |
112 | + 1. Source Code. | |
113 | + | |
114 | + The "source code" for a work means the preferred form of the work | |
115 | +for making modifications to it. "Object code" means any non-source | |
116 | +form of a work. | |
117 | + | |
118 | + A "Standard Interface" means an interface that either is an official | |
119 | +standard defined by a recognized standards body, or, in the case of | |
120 | +interfaces specified for a particular programming language, one that | |
121 | +is widely used among developers working in that language. | |
122 | + | |
123 | + The "System Libraries" of an executable work include anything, other | |
124 | +than the work as a whole, that (a) is included in the normal form of | |
125 | +packaging a Major Component, but which is not part of that Major | |
126 | +Component, and (b) serves only to enable use of the work with that | |
127 | +Major Component, or to implement a Standard Interface for which an | |
128 | +implementation is available to the public in source code form. A | |
129 | +"Major Component", in this context, means a major essential component | |
130 | +(kernel, window system, and so on) of the specific operating system | |
131 | +(if any) on which the executable work runs, or a compiler used to | |
132 | +produce the work, or an object code interpreter used to run it. | |
133 | + | |
134 | + The "Corresponding Source" for a work in object code form means all | |
135 | +the source code needed to generate, install, and (for an executable | |
136 | +work) run the object code and to modify the work, including scripts to | |
137 | +control those activities. However, it does not include the work's | |
138 | +System Libraries, or general-purpose tools or generally available free | |
139 | +programs which are used unmodified in performing those activities but | |
140 | +which are not part of the work. For example, Corresponding Source | |
141 | +includes interface definition files associated with source files for | |
142 | +the work, and the source code for shared libraries and dynamically | |
143 | +linked subprograms that the work is specifically designed to require, | |
144 | +such as by intimate data communication or control flow between those | |
145 | +subprograms and other parts of the work. | |
146 | + | |
147 | + The Corresponding Source need not include anything that users | |
148 | +can regenerate automatically from other parts of the Corresponding | |
149 | +Source. | |
150 | + | |
151 | + The Corresponding Source for a work in source code form is that | |
152 | +same work. | |
153 | + | |
154 | + 2. Basic Permissions. | |
155 | + | |
156 | + All rights granted under this License are granted for the term of | |
157 | +copyright on the Program, and are irrevocable provided the stated | |
158 | +conditions are met. This License explicitly affirms your unlimited | |
159 | +permission to run the unmodified Program. The output from running a | |
160 | +covered work is covered by this License only if the output, given its | |
161 | +content, constitutes a covered work. This License acknowledges your | |
162 | +rights of fair use or other equivalent, as provided by copyright law. | |
163 | + | |
164 | + You may make, run and propagate covered works that you do not | |
165 | +convey, without conditions so long as your license otherwise remains | |
166 | +in force. You may convey covered works to others for the sole purpose | |
167 | +of having them make modifications exclusively for you, or provide you | |
168 | +with facilities for running those works, provided that you comply with | |
169 | +the terms of this License in conveying all material for which you do | |
170 | +not control copyright. Those thus making or running the covered works | |
171 | +for you must do so exclusively on your behalf, under your direction | |
172 | +and control, on terms that prohibit them from making any copies of | |
173 | +your copyrighted material outside their relationship with you. | |
174 | + | |
175 | + Conveying under any other circumstances is permitted solely under | |
176 | +the conditions stated below. Sublicensing is not allowed; section 10 | |
177 | +makes it unnecessary. | |
178 | + | |
179 | + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | |
180 | + | |
181 | + No covered work shall be deemed part of an effective technological | |
182 | +measure under any applicable law fulfilling obligations under article | |
183 | +11 of the WIPO copyright treaty adopted on 20 December 1996, or | |
184 | +similar laws prohibiting or restricting circumvention of such | |
185 | +measures. | |
186 | + | |
187 | + When you convey a covered work, you waive any legal power to forbid | |
188 | +circumvention of technological measures to the extent such circumvention | |
189 | +is effected by exercising rights under this License with respect to | |
190 | +the covered work, and you disclaim any intention to limit operation or | |
191 | +modification of the work as a means of enforcing, against the work's | |
192 | +users, your or third parties' legal rights to forbid circumvention of | |
193 | +technological measures. | |
194 | + | |
195 | + 4. Conveying Verbatim Copies. | |
196 | + | |
197 | + You may convey verbatim copies of the Program's source code as you | |
198 | +receive it, in any medium, provided that you conspicuously and | |
199 | +appropriately publish on each copy an appropriate copyright notice; | |
200 | +keep intact all notices stating that this License and any | |
201 | +non-permissive terms added in accord with section 7 apply to the code; | |
202 | +keep intact all notices of the absence of any warranty; and give all | |
203 | +recipients a copy of this License along with the Program. | |
204 | + | |
205 | + You may charge any price or no price for each copy that you convey, | |
206 | +and you may offer support or warranty protection for a fee. | |
207 | + | |
208 | + 5. Conveying Modified Source Versions. | |
209 | + | |
210 | + You may convey a work based on the Program, or the modifications to | |
211 | +produce it from the Program, in the form of source code under the | |
212 | +terms of section 4, provided that you also meet all of these conditions: | |
213 | + | |
214 | + a) The work must carry prominent notices stating that you modified | |
215 | + it, and giving a relevant date. | |
216 | + | |
217 | + b) The work must carry prominent notices stating that it is | |
218 | + released under this License and any conditions added under section | |
219 | + 7. This requirement modifies the requirement in section 4 to | |
220 | + "keep intact all notices". | |
221 | + | |
222 | + c) You must license the entire work, as a whole, under this | |
223 | + License to anyone who comes into possession of a copy. This | |
224 | + License will therefore apply, along with any applicable section 7 | |
225 | + additional terms, to the whole of the work, and all its parts, | |
226 | + regardless of how they are packaged. This License gives no | |
227 | + permission to license the work in any other way, but it does not | |
228 | + invalidate such permission if you have separately received it. | |
229 | + | |
230 | + d) If the work has interactive user interfaces, each must display | |
231 | + Appropriate Legal Notices; however, if the Program has interactive | |
232 | + interfaces that do not display Appropriate Legal Notices, your | |
233 | + work need not make them do so. | |
234 | + | |
235 | + A compilation of a covered work with other separate and independent | |
236 | +works, which are not by their nature extensions of the covered work, | |
237 | +and which are not combined with it such as to form a larger program, | |
238 | +in or on a volume of a storage or distribution medium, is called an | |
239 | +"aggregate" if the compilation and its resulting copyright are not | |
240 | +used to limit the access or legal rights of the compilation's users | |
241 | +beyond what the individual works permit. Inclusion of a covered work | |
242 | +in an aggregate does not cause this License to apply to the other | |
243 | +parts of the aggregate. | |
244 | + | |
245 | + 6. Conveying Non-Source Forms. | |
246 | + | |
247 | + You may convey a covered work in object code form under the terms | |
248 | +of sections 4 and 5, provided that you also convey the | |
249 | +machine-readable Corresponding Source under the terms of this License, | |
250 | +in one of these ways: | |
251 | + | |
252 | + a) Convey the object code in, or embodied in, a physical product | |
253 | + (including a physical distribution medium), accompanied by the | |
254 | + Corresponding Source fixed on a durable physical medium | |
255 | + customarily used for software interchange. | |
256 | + | |
257 | + b) Convey the object code in, or embodied in, a physical product | |
258 | + (including a physical distribution medium), accompanied by a | |
259 | + written offer, valid for at least three years and valid for as | |
260 | + long as you offer spare parts or customer support for that product | |
261 | + model, to give anyone who possesses the object code either (1) a | |
262 | + copy of the Corresponding Source for all the software in the | |
263 | + product that is covered by this License, on a durable physical | |
264 | + medium customarily used for software interchange, for a price no | |
265 | + more than your reasonable cost of physically performing this | |
266 | + conveying of source, or (2) access to copy the | |
267 | + Corresponding Source from a network server at no charge. | |
268 | + | |
269 | + c) Convey individual copies of the object code with a copy of the | |
270 | + written offer to provide the Corresponding Source. This | |
271 | + alternative is allowed only occasionally and noncommercially, and | |
272 | + only if you received the object code with such an offer, in accord | |
273 | + with subsection 6b. | |
274 | + | |
275 | + d) Convey the object code by offering access from a designated | |
276 | + place (gratis or for a charge), and offer equivalent access to the | |
277 | + Corresponding Source in the same way through the same place at no | |
278 | + further charge. You need not require recipients to copy the | |
279 | + Corresponding Source along with the object code. If the place to | |
280 | + copy the object code is a network server, the Corresponding Source | |
281 | + may be on a different server (operated by you or a third party) | |
282 | + that supports equivalent copying facilities, provided you maintain | |
283 | + clear directions next to the object code saying where to find the | |
284 | + Corresponding Source. Regardless of what server hosts the | |
285 | + Corresponding Source, you remain obligated to ensure that it is | |
286 | + available for as long as needed to satisfy these requirements. | |
287 | + | |
288 | + e) Convey the object code using peer-to-peer transmission, provided | |
289 | + you inform other peers where the object code and Corresponding | |
290 | + Source of the work are being offered to the general public at no | |
291 | + charge under subsection 6d. | |
292 | + | |
293 | + A separable portion of the object code, whose source code is excluded | |
294 | +from the Corresponding Source as a System Library, need not be | |
295 | +included in conveying the object code work. | |
296 | + | |
297 | + A "User Product" is either (1) a "consumer product", which means any | |
298 | +tangible personal property which is normally used for personal, family, | |
299 | +or household purposes, or (2) anything designed or sold for incorporation | |
300 | +into a dwelling. In determining whether a product is a consumer product, | |
301 | +doubtful cases shall be resolved in favor of coverage. For a particular | |
302 | +product received by a particular user, "normally used" refers to a | |
303 | +typical or common use of that class of product, regardless of the status | |
304 | +of the particular user or of the way in which the particular user | |
305 | +actually uses, or expects or is expected to use, the product. A product | |
306 | +is a consumer product regardless of whether the product has substantial | |
307 | +commercial, industrial or non-consumer uses, unless such uses represent | |
308 | +the only significant mode of use of the product. | |
309 | + | |
310 | + "Installation Information" for a User Product means any methods, | |
311 | +procedures, authorization keys, or other information required to install | |
312 | +and execute modified versions of a covered work in that User Product from | |
313 | +a modified version of its Corresponding Source. The information must | |
314 | +suffice to ensure that the continued functioning of the modified object | |
315 | +code is in no case prevented or interfered with solely because | |
316 | +modification has been made. | |
317 | + | |
318 | + If you convey an object code work under this section in, or with, or | |
319 | +specifically for use in, a User Product, and the conveying occurs as | |
320 | +part of a transaction in which the right of possession and use of the | |
321 | +User Product is transferred to the recipient in perpetuity or for a | |
322 | +fixed term (regardless of how the transaction is characterized), the | |
323 | +Corresponding Source conveyed under this section must be accompanied | |
324 | +by the Installation Information. But this requirement does not apply | |
325 | +if neither you nor any third party retains the ability to install | |
326 | +modified object code on the User Product (for example, the work has | |
327 | +been installed in ROM). | |
328 | + | |
329 | + The requirement to provide Installation Information does not include a | |
330 | +requirement to continue to provide support service, warranty, or updates | |
331 | +for a work that has been modified or installed by the recipient, or for | |
332 | +the User Product in which it has been modified or installed. Access to a | |
333 | +network may be denied when the modification itself materially and | |
334 | +adversely affects the operation of the network or violates the rules and | |
335 | +protocols for communication across the network. | |
336 | + | |
337 | + Corresponding Source conveyed, and Installation Information provided, | |
338 | +in accord with this section must be in a format that is publicly | |
339 | +documented (and with an implementation available to the public in | |
340 | +source code form), and must require no special password or key for | |
341 | +unpacking, reading or copying. | |
342 | + | |
343 | + 7. Additional Terms. | |
344 | + | |
345 | + "Additional permissions" are terms that supplement the terms of this | |
346 | +License by making exceptions from one or more of its conditions. | |
347 | +Additional permissions that are applicable to the entire Program shall | |
348 | +be treated as though they were included in this License, to the extent | |
349 | +that they are valid under applicable law. If additional permissions | |
350 | +apply only to part of the Program, that part may be used separately | |
351 | +under those permissions, but the entire Program remains governed by | |
352 | +this License without regard to the additional permissions. | |
353 | + | |
354 | + When you convey a copy of a covered work, you may at your option | |
355 | +remove any additional permissions from that copy, or from any part of | |
356 | +it. (Additional permissions may be written to require their own | |
357 | +removal in certain cases when you modify the work.) You may place | |
358 | +additional permissions on material, added by you to a covered work, | |
359 | +for which you have or can give appropriate copyright permission. | |
360 | + | |
361 | + Notwithstanding any other provision of this License, for material you | |
362 | +add to a covered work, you may (if authorized by the copyright holders of | |
363 | +that material) supplement the terms of this License with terms: | |
364 | + | |
365 | + a) Disclaiming warranty or limiting liability differently from the | |
366 | + terms of sections 15 and 16 of this License; or | |
367 | + | |
368 | + b) Requiring preservation of specified reasonable legal notices or | |
369 | + author attributions in that material or in the Appropriate Legal | |
370 | + Notices displayed by works containing it; or | |
371 | + | |
372 | + c) Prohibiting misrepresentation of the origin of that material, or | |
373 | + requiring that modified versions of such material be marked in | |
374 | + reasonable ways as different from the original version; or | |
375 | + | |
376 | + d) Limiting the use for publicity purposes of names of licensors or | |
377 | + authors of the material; or | |
378 | + | |
379 | + e) Declining to grant rights under trademark law for use of some | |
380 | + trade names, trademarks, or service marks; or | |
381 | + | |
382 | + f) Requiring indemnification of licensors and authors of that | |
383 | + material by anyone who conveys the material (or modified versions of | |
384 | + it) with contractual assumptions of liability to the recipient, for | |
385 | + any liability that these contractual assumptions directly impose on | |
386 | + those licensors and authors. | |
387 | + | |
388 | + All other non-permissive additional terms are considered "further | |
389 | +restrictions" within the meaning of section 10. If the Program as you | |
390 | +received it, or any part of it, contains a notice stating that it is | |
391 | +governed by this License along with a term that is a further | |
392 | +restriction, you may remove that term. If a license document contains | |
393 | +a further restriction but permits relicensing or conveying under this | |
394 | +License, you may add to a covered work material governed by the terms | |
395 | +of that license document, provided that the further restriction does | |
396 | +not survive such relicensing or conveying. | |
397 | + | |
398 | + If you add terms to a covered work in accord with this section, you | |
399 | +must place, in the relevant source files, a statement of the | |
400 | +additional terms that apply to those files, or a notice indicating | |
401 | +where to find the applicable terms. | |
402 | + | |
403 | + Additional terms, permissive or non-permissive, may be stated in the | |
404 | +form of a separately written license, or stated as exceptions; | |
405 | +the above requirements apply either way. | |
406 | + | |
407 | + 8. Termination. | |
408 | + | |
409 | + You may not propagate or modify a covered work except as expressly | |
410 | +provided under this License. Any attempt otherwise to propagate or | |
411 | +modify it is void, and will automatically terminate your rights under | |
412 | +this License (including any patent licenses granted under the third | |
413 | +paragraph of section 11). | |
414 | + | |
415 | + However, if you cease all violation of this License, then your | |
416 | +license from a particular copyright holder is reinstated (a) | |
417 | +provisionally, unless and until the copyright holder explicitly and | |
418 | +finally terminates your license, and (b) permanently, if the copyright | |
419 | +holder fails to notify you of the violation by some reasonable means | |
420 | +prior to 60 days after the cessation. | |
421 | + | |
422 | + Moreover, your license from a particular copyright holder is | |
423 | +reinstated permanently if the copyright holder notifies you of the | |
424 | +violation by some reasonable means, this is the first time you have | |
425 | +received notice of violation of this License (for any work) from that | |
426 | +copyright holder, and you cure the violation prior to 30 days after | |
427 | +your receipt of the notice. | |
428 | + | |
429 | + Termination of your rights under this section does not terminate the | |
430 | +licenses of parties who have received copies or rights from you under | |
431 | +this License. If your rights have been terminated and not permanently | |
432 | +reinstated, you do not qualify to receive new licenses for the same | |
433 | +material under section 10. | |
434 | + | |
435 | + 9. Acceptance Not Required for Having Copies. | |
436 | + | |
437 | + You are not required to accept this License in order to receive or | |
438 | +run a copy of the Program. Ancillary propagation of a covered work | |
439 | +occurring solely as a consequence of using peer-to-peer transmission | |
440 | +to receive a copy likewise does not require acceptance. However, | |
441 | +nothing other than this License grants you permission to propagate or | |
442 | +modify any covered work. These actions infringe copyright if you do | |
443 | +not accept this License. Therefore, by modifying or propagating a | |
444 | +covered work, you indicate your acceptance of this License to do so. | |
445 | + | |
446 | + 10. Automatic Licensing of Downstream Recipients. | |
447 | + | |
448 | + Each time you convey a covered work, the recipient automatically | |
449 | +receives a license from the original licensors, to run, modify and | |
450 | +propagate that work, subject to this License. You are not responsible | |
451 | +for enforcing compliance by third parties with this License. | |
452 | + | |
453 | + An "entity transaction" is a transaction transferring control of an | |
454 | +organization, or substantially all assets of one, or subdividing an | |
455 | +organization, or merging organizations. If propagation of a covered | |
456 | +work results from an entity transaction, each party to that | |
457 | +transaction who receives a copy of the work also receives whatever | |
458 | +licenses to the work the party's predecessor in interest had or could | |
459 | +give under the previous paragraph, plus a right to possession of the | |
460 | +Corresponding Source of the work from the predecessor in interest, if | |
461 | +the predecessor has it or can get it with reasonable efforts. | |
462 | + | |
463 | + You may not impose any further restrictions on the exercise of the | |
464 | +rights granted or affirmed under this License. For example, you may | |
465 | +not impose a license fee, royalty, or other charge for exercise of | |
466 | +rights granted under this License, and you may not initiate litigation | |
467 | +(including a cross-claim or counterclaim in a lawsuit) alleging that | |
468 | +any patent claim is infringed by making, using, selling, offering for | |
469 | +sale, or importing the Program or any portion of it. | |
470 | + | |
471 | + 11. Patents. | |
472 | + | |
473 | + A "contributor" is a copyright holder who authorizes use under this | |
474 | +License of the Program or a work on which the Program is based. The | |
475 | +work thus licensed is called the contributor's "contributor version". | |
476 | + | |
477 | + A contributor's "essential patent claims" are all patent claims | |
478 | +owned or controlled by the contributor, whether already acquired or | |
479 | +hereafter acquired, that would be infringed by some manner, permitted | |
480 | +by this License, of making, using, or selling its contributor version, | |
481 | +but do not include claims that would be infringed only as a | |
482 | +consequence of further modification of the contributor version. For | |
483 | +purposes of this definition, "control" includes the right to grant | |
484 | +patent sublicenses in a manner consistent with the requirements of | |
485 | +this License. | |
486 | + | |
487 | + Each contributor grants you a non-exclusive, worldwide, royalty-free | |
488 | +patent license under the contributor's essential patent claims, to | |
489 | +make, use, sell, offer for sale, import and otherwise run, modify and | |
490 | +propagate the contents of its contributor version. | |
491 | + | |
492 | + In the following three paragraphs, a "patent license" is any express | |
493 | +agreement or commitment, however denominated, not to enforce a patent | |
494 | +(such as an express permission to practice a patent or covenant not to | |
495 | +sue for patent infringement). To "grant" such a patent license to a | |
496 | +party means to make such an agreement or commitment not to enforce a | |
497 | +patent against the party. | |
498 | + | |
499 | + If you convey a covered work, knowingly relying on a patent license, | |
500 | +and the Corresponding Source of the work is not available for anyone | |
501 | +to copy, free of charge and under the terms of this License, through a | |
502 | +publicly available network server or other readily accessible means, | |
503 | +then you must either (1) cause the Corresponding Source to be so | |
504 | +available, or (2) arrange to deprive yourself of the benefit of the | |
505 | +patent license for this particular work, or (3) arrange, in a manner | |
506 | +consistent with the requirements of this License, to extend the patent | |
507 | +license to downstream recipients. "Knowingly relying" means you have | |
508 | +actual knowledge that, but for the patent license, your conveying the | |
509 | +covered work in a country, or your recipient's use of the covered work | |
510 | +in a country, would infringe one or more identifiable patents in that | |
511 | +country that you have reason to believe are valid. | |
512 | + | |
513 | + If, pursuant to or in connection with a single transaction or | |
514 | +arrangement, you convey, or propagate by procuring conveyance of, a | |
515 | +covered work, and grant a patent license to some of the parties | |
516 | +receiving the covered work authorizing them to use, propagate, modify | |
517 | +or convey a specific copy of the covered work, then the patent license | |
518 | +you grant is automatically extended to all recipients of the covered | |
519 | +work and works based on it. | |
520 | + | |
521 | + A patent license is "discriminatory" if it does not include within | |
522 | +the scope of its coverage, prohibits the exercise of, or is | |
523 | +conditioned on the non-exercise of one or more of the rights that are | |
524 | +specifically granted under this License. You may not convey a covered | |
525 | +work if you are a party to an arrangement with a third party that is | |
526 | +in the business of distributing software, under which you make payment | |
527 | +to the third party based on the extent of your activity of conveying | |
528 | +the work, and under which the third party grants, to any of the | |
529 | +parties who would receive the covered work from you, a discriminatory | |
530 | +patent license (a) in connection with copies of the covered work | |
531 | +conveyed by you (or copies made from those copies), or (b) primarily | |
532 | +for and in connection with specific products or compilations that | |
533 | +contain the covered work, unless you entered into that arrangement, | |
534 | +or that patent license was granted, prior to 28 March 2007. | |
535 | + | |
536 | + Nothing in this License shall be construed as excluding or limiting | |
537 | +any implied license or other defenses to infringement that may | |
538 | +otherwise be available to you under applicable patent law. | |
539 | + | |
540 | + 12. No Surrender of Others' Freedom. | |
541 | + | |
542 | + If conditions are imposed on you (whether by court order, agreement or | |
543 | +otherwise) that contradict the conditions of this License, they do not | |
544 | +excuse you from the conditions of this License. If you cannot convey a | |
545 | +covered work so as to satisfy simultaneously your obligations under this | |
546 | +License and any other pertinent obligations, then as a consequence you may | |
547 | +not convey it at all. For example, if you agree to terms that obligate you | |
548 | +to collect a royalty for further conveying from those to whom you convey | |
549 | +the Program, the only way you could satisfy both those terms and this | |
550 | +License would be to refrain entirely from conveying the Program. | |
551 | + | |
552 | + 13. Use with the GNU Affero General Public License. | |
553 | + | |
554 | + Notwithstanding any other provision of this License, you have | |
555 | +permission to link or combine any covered work with a work licensed | |
556 | +under version 3 of the GNU Affero General Public License into a single | |
557 | +combined work, and to convey the resulting work. The terms of this | |
558 | +License will continue to apply to the part which is the covered work, | |
559 | +but the special requirements of the GNU Affero General Public License, | |
560 | +section 13, concerning interaction through a network will apply to the | |
561 | +combination as such. | |
562 | + | |
563 | + 14. Revised Versions of this License. | |
564 | + | |
565 | + The Free Software Foundation may publish revised and/or new versions of | |
566 | +the GNU General Public License from time to time. Such new versions will | |
567 | +be similar in spirit to the present version, but may differ in detail to | |
568 | +address new problems or concerns. | |
569 | + | |
570 | + Each version is given a distinguishing version number. If the | |
571 | +Program specifies that a certain numbered version of the GNU General | |
572 | +Public License "or any later version" applies to it, you have the | |
573 | +option of following the terms and conditions either of that numbered | |
574 | +version or of any later version published by the Free Software | |
575 | +Foundation. If the Program does not specify a version number of the | |
576 | +GNU General Public License, you may choose any version ever published | |
577 | +by the Free Software Foundation. | |
578 | + | |
579 | + If the Program specifies that a proxy can decide which future | |
580 | +versions of the GNU General Public License can be used, that proxy's | |
581 | +public statement of acceptance of a version permanently authorizes you | |
582 | +to choose that version for the Program. | |
583 | + | |
584 | + Later license versions may give you additional or different | |
585 | +permissions. However, no additional obligations are imposed on any | |
586 | +author or copyright holder as a result of your choosing to follow a | |
587 | +later version. | |
588 | + | |
589 | + 15. Disclaimer of Warranty. | |
590 | + | |
591 | + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | |
592 | +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | |
593 | +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | |
594 | +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | |
595 | +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
596 | +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | |
597 | +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | |
598 | +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |
599 | + | |
600 | + 16. Limitation of Liability. | |
601 | + | |
602 | + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
603 | +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | |
604 | +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | |
605 | +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | |
606 | +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | |
607 | +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | |
608 | +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | |
609 | +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | |
610 | +SUCH DAMAGES. | |
611 | + | |
612 | + 17. Interpretation of Sections 15 and 16. | |
613 | + | |
614 | + If the disclaimer of warranty and limitation of liability provided | |
615 | +above cannot be given local legal effect according to their terms, | |
616 | +reviewing courts shall apply local law that most closely approximates | |
617 | +an absolute waiver of all civil liability in connection with the | |
618 | +Program, unless a warranty or assumption of liability accompanies a | |
619 | +copy of the Program in return for a fee. | |
620 | + | |
621 | + END OF TERMS AND CONDITIONS | |
622 | + | |
623 | + How to Apply These Terms to Your New Programs | |
624 | + | |
625 | + If you develop a new program, and you want it to be of the greatest | |
626 | +possible use to the public, the best way to achieve this is to make it | |
627 | +free software which everyone can redistribute and change under these terms. | |
628 | + | |
629 | + To do so, attach the following notices to the program. It is safest | |
630 | +to attach them to the start of each source file to most effectively | |
631 | +state the exclusion of warranty; and each file should have at least | |
632 | +the "copyright" line and a pointer to where the full notice is found. | |
633 | + | |
634 | + <one line to give the program's name and a brief idea of what it does.> | |
635 | + Copyright (C) <year> <name of author> | |
636 | + | |
637 | + This program is free software: you can redistribute it and/or modify | |
638 | + it under the terms of the GNU General Public License as published by | |
639 | + the Free Software Foundation, either version 3 of the License, or | |
640 | + (at your option) any later version. | |
641 | + | |
642 | + This program is distributed in the hope that it will be useful, | |
643 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
644 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
645 | + GNU General Public License for more details. | |
646 | + | |
647 | + You should have received a copy of the GNU General Public License | |
648 | + along with this program. If not, see <http://www.gnu.org/licenses/>. | |
649 | + | |
650 | +Also add information on how to contact you by electronic and paper mail. | |
651 | + | |
652 | + If the program does terminal interaction, make it output a short | |
653 | +notice like this when it starts in an interactive mode: | |
654 | + | |
655 | + <program> Copyright (C) <year> <name of author> | |
656 | + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
657 | + This is free software, and you are welcome to redistribute it | |
658 | + under certain conditions; type `show c' for details. | |
659 | + | |
660 | +The hypothetical commands `show w' and `show c' should show the appropriate | |
661 | +parts of the General Public License. Of course, your program's commands | |
662 | +might be different; for a GUI interface, you would use an "about box". | |
663 | + | |
664 | + You should also get your employer (if you work as a programmer) or school, | |
665 | +if any, to sign a "copyright disclaimer" for the program, if necessary. | |
666 | +For more information on this, and how to apply and follow the GNU GPL, see | |
667 | +<http://www.gnu.org/licenses/>. | |
668 | + | |
669 | + The GNU General Public License does not permit incorporating your program | |
670 | +into proprietary programs. If your program is a subroutine library, you | |
671 | +may consider it more useful to permit linking proprietary applications with | |
672 | +the library. If this is what you want to do, use the GNU Lesser General | |
673 | +Public License instead of this License. But first, please read | |
674 | +<http://www.gnu.org/philosophy/why-not-lgpl.html>. |
@@ -0,0 +1,39 @@ | ||
1 | +//{{NO_DEPENDENCIES}} | |
2 | +// Microsoft Visual C++ generated include file. | |
3 | +// Used by foo_huygens.rc | |
4 | +// | |
5 | +#define IDD_PREFERENCE 101 | |
6 | +#define IDD_ADVANCED_SETTINGS 102 | |
7 | +#define IDD_DEBUG_SETTINGS 103 | |
8 | +#define IDC_CONFIGURE 1000 | |
9 | +#define IDC_USE_PLUGIN 1001 | |
10 | +#define IDC_VERSION 1002 | |
11 | +#define IDC_BUILD 1003 | |
12 | +#define IDC_CAPTION_ADVANCED 1004 | |
13 | +#define IDC_VERSION_ADVANCED 1005 | |
14 | +#define IDC_BUILD_ADVANCED 1006 | |
15 | +#define IDC_HUYGENS_FRAME 1007 | |
16 | +#define IDC_SHOW_HUYGENS 1008 | |
17 | +#define IDC_HUYGENS_TITLE_FORMAT 1009 | |
18 | +#define IDC_HUYGENS_PLAYLIST_FORMAT 1010 | |
19 | +#define IDC_DISABLE_ANSI_TRANS 1011 | |
20 | +#define IDC_CAPTION_DEBUG 1012 | |
21 | +#define IDC_ENABLE_DEBUG_LOG 1013 | |
22 | +#define IDC_DEBUG_HUYGENS_INIT 1014 | |
23 | +#define IDC_DEBUG_HUYGENS_PROC 1015 | |
24 | +#define IDC_DEBUG_TRACK_INFO 1016 | |
25 | +#define IDC_DEBUG_PLUGIN 1017 | |
26 | +#define IDC_DEBUG_CALLBACK 1018 | |
27 | +#define IDC_VERSION_DEBUG 1019 | |
28 | +#define IDC_BUILD_DEBUG 1020 | |
29 | + | |
30 | +// Next default values for new objects | |
31 | +// | |
32 | +#ifdef APSTUDIO_INVOKED | |
33 | +#ifndef APSTUDIO_READONLY_SYMBOLS | |
34 | +#define _APS_NEXT_RESOURCE_VALUE 104 | |
35 | +#define _APS_NEXT_COMMAND_VALUE 40001 | |
36 | +#define _APS_NEXT_CONTROL_VALUE 1021 | |
37 | +#define _APS_NEXT_SYMED_VALUE 101 | |
38 | +#endif | |
39 | +#endif |
@@ -0,0 +1,3044 @@ | ||
1 | +#define BUILD_UNICODE | |
2 | + | |
3 | +#if defined(BUILD_UNICODE) | |
4 | +#if !defined(UNICODE) | |
5 | +#define _UNICODE | |
6 | +#define UNICODE | |
7 | +#endif | |
8 | +#endif | |
9 | + | |
10 | +#if defined(UNICODE) && !defined(BUILD_UNICODE) | |
11 | +#define BUILD_UNICODE | |
12 | +#endif | |
13 | + | |
14 | +#define LONG_PTR_TO_WNDPROC(p) (reinterpret_cast<WNDPROC>(p)) | |
15 | +#define WNDPROC_TO_LONG_PTR(p) (reinterpret_cast<LONG_PTR>(p)) | |
16 | + | |
17 | +#include <windows.h> | |
18 | +#include <lmcons.h> | |
19 | +#include <process.h> | |
20 | +#include <shlobj.h> | |
21 | + | |
22 | +#include <string> | |
23 | +#include <vector> | |
24 | +#include <map> | |
25 | + | |
26 | +#include "../SDK/foobar2000.h" | |
27 | +#include "../SDK/component.h" | |
28 | +#include "../helpers/helpers.h" | |
29 | + | |
30 | +#include "huy_ipc.h" | |
31 | + | |
32 | +#include "resource.h" | |
33 | + | |
34 | +#if defined(_FOOBAR2000_UTF8API_H_) | |
35 | +# define FB2K_MAJOR_VERSION 8 | |
36 | +#else | |
37 | +# define FB2K_MAJOR_VERSION 9 | |
38 | +#endif | |
39 | + | |
40 | +#define IS_FB2K_VER08 (FB2K_MAJOR_VERSION == 8) | |
41 | +#define IS_FB2K_VER09 (FB2K_MAJOR_VERSION == 9) | |
42 | + | |
43 | +#define FB2K_COMPONENTS_DIR _T("components\\") | |
44 | +#define DEFAULT_HUYGENS_TITLE "Huygens" | |
45 | + | |
46 | +#define PLUGIN_CAPTION "Huygens - The Free Song Information Exploring Probe" | |
47 | +#define PLUGIN_CAPTION_JP "無料曲情報探索突入機 Huygens" | |
48 | + | |
49 | +#define ADVANCED_SETTINGS_CAPTION "高度な設定" | |
50 | +#define DEBUG_SETTINGS_CAPTION "デバッグ用の設定" | |
51 | + | |
52 | +#define PLUGIN_VERSION_VAL "0.021" | |
53 | +#define PLUGIN_VERSION_PREFIX "No. " | |
54 | +#define PLUGIN_VERSION _T(PLUGIN_VERSION_PREFIX) _T(PLUGIN_VERSION_VAL) | |
55 | + | |
56 | +#define FILE_PROTOCOL "file://" | |
57 | + | |
58 | +#define DEFAULT_HUYGENS_TITLE_FORMAT "[%artist% - ]$if(%title%,%title%,%_filename%)" | |
59 | + | |
60 | +#define URL_FOO_HUYGENS_HOME "http://foo-huygens.sourceforge.jp/" | |
61 | + | |
62 | +#if IS_FB2K_VER08 | |
63 | +#define CLASSNAME DEFAULT_HUYGENS_TITLE " v1.x" | |
64 | +#else | |
65 | +#define CLASSNAME _T(DEFAULT_HUYGENS_TITLE) _T(" v1.x") | |
66 | +#endif | |
67 | + | |
68 | +#define FORMAT_FB2KVERSION "%_foobar2000_version%" | |
69 | +#define FORMAT_FILEPATH "%_path%" | |
70 | +#define FORMAT_FILEPATHRAW "%_path_raw%" | |
71 | +#define FORMAT_ARTIST "%artist%" | |
72 | +#define FORMAT_TRACKTITLE "%title%" | |
73 | +#define FORMAT_ALBUMTITLE "%album%" | |
74 | +#define FORMAT_GENRE "%genre%" | |
75 | +#define FORMAT_TRACKDATE "%date%" | |
76 | +#define FORMAT_COMPOSER "%composer%" | |
77 | +#define FORMAT_PERFORMER "%performer%" | |
78 | +#define FORMAT_ALBUMARTIST "%album artist%" | |
79 | +#define FORMAT_TRACKARTIST "%track artist%" | |
80 | +#if IS_FB2K_VER08 | |
81 | +#define FORMAT_SUBSONG "%_subsong%" | |
82 | +#elif IS_FB2K_VER09 | |
83 | +#define FORMAT_SUBSONG "%subsong%" | |
84 | +#endif | |
85 | +#define FORMAT_TRACKNUMBER "%tracknumber%" | |
86 | +#define FORMAT_TRACKTOTAL "%totaltracks%" | |
87 | +#define FORMAT_DISCNUMBER "%discnumber%" | |
88 | +#define FORMAT_DISCTOTAL "%totaldiscs%" | |
89 | +#define FORMAT_COMMENT "%comment%" | |
90 | + | |
91 | +#define FORMAT_SAMPLERATE "%__samplerate%" | |
92 | +#define FORMAT_BITRATE "%__bitrate%" | |
93 | +#define FORMAT_BITRATE_NOMINAL "%__bitrate_nominal%" | |
94 | +#define FORMAT_BITRATE_DYNAMIC "%__bitrate_dynamic%" | |
95 | +#define FORMAT_CHANNELS "%__channels%" | |
96 | +#define FORMAT_BITSPERSAMPLE "%__bitspersample%" | |
97 | +#define FORMAT_CODEC "%__codec%" | |
98 | +#define FORMAT_CODECPROFILE "%__codec_profile%" | |
99 | +#define FORMAT_LOSSLESS "$if2($strcmp(%__encoding%,lossless), 0)" | |
100 | +#define FORMAT_TAGTYPE "%__tagtype%" | |
101 | + | |
102 | +#define FORMAT_EXTRAINFO "%__extrainfo %" | |
103 | +#define FORMAT_TOOL "%__tool%" | |
104 | +#define FORMAT_CUEEMBEDDED "$if2($strcmp(%__cue_embedded%,yes), 0)" | |
105 | +#define FORMAT_AUDIOMD5HASH "%__MD5%" | |
106 | +#define FORMAT_MP3STEREOMODE "$if2($strcmp(%__mp3_stereo_mode%,joint stereo), 0)" | |
107 | +#define FORMAT_MP3ACCURATELENGTH "$if2($strcmp(%__mp3_accurate_length%,yes), 0)" | |
108 | +#define FORMAT_MP3ENCDELAY "%__enc_delay%" | |
109 | +#define FORMAT_MP3ENCPADDING "%__enc_padding%" | |
110 | +#define FORMAT_APEVERSION "%__version%" | |
111 | +#define FORMAT_APEFLAGS "%__flags%" | |
112 | + | |
113 | +#define FORMAT_REPLAYGAIN_ALBUMGAIN "%__replaygain_album_gain%" | |
114 | +#define FORMAT_REPLAYGAIN_ALBUMPEEK "%__replaygain_album_peek%" | |
115 | +#define FORMAT_REPLAYGAIN_TRACKGAIN "%__replaygain_track_gain%" | |
116 | +#define FORMAT_REPLAYGAIN_TRACKPEEK "%__replaygain_track_peek%" | |
117 | + | |
118 | +#define FORMAT_FILESIZE "%filesize%" | |
119 | +#define FORMAT_FILECREATED "fileCreated" | |
120 | +#define FORMAT_FILELASTMOD "fileLastModified" | |
121 | +#define FORMAT_ISINMEDIALIB "isInMediaLib" | |
122 | + | |
123 | + | |
124 | +#if IS_FB2K_VER08 | |
125 | +#define FORMAT_LENGTHSAMPLES "%length_samples%" | |
126 | +#define FORMAT_LISTINDEX "%_playlist_number%" | |
127 | +#define FORMAT_LISTTOTAL "%_playlist_total%" | |
128 | +#define FORMAT_PLAYLIST_NAME "%_playlist_name%" | |
129 | +#elif IS_FB2K_VER09 | |
130 | +#define FORMAT_LENGTHSAMPLES "%length_samples%" | |
131 | +#define FORMAT_LISTINDEX "%list_index%" | |
132 | +#define FORMAT_LISTTOTAL "%list_total%" | |
133 | +#define FORMAT_PLAYLIST_NAME "%playlist_name%" | |
134 | +#endif | |
135 | + | |
136 | +#if IS_FB2K_VER09 | |
137 | +using namespace pfc; | |
138 | +using namespace pfc::stringcvt; | |
139 | +#define pfc_string_to_float string_to_float | |
140 | +#endif | |
141 | + | |
142 | +/* | |
143 | + foo_huygens: project dependencies | |
144 | + | |
145 | + foo_huygens | |
146 | + foobar2000_SDK | |
147 | + utf8api(0.8.3) | |
148 | + pfc | |
149 | + foobar2000_sdk_helpers | |
150 | + pfc | |
151 | + foobar2000_component_client | |
152 | + | |
153 | + library dependencies: ../shared/shared.lib(0.9.X), shlwapi.lib(0.9.X) | |
154 | + runtime library: Multi-Thread (DLL) or (Debug,DLL) | |
155 | + !! ensure all projects that depended from this project are correctly set to MT DLL !! | |
156 | + ignore: LIBCMT [Win32 Release] (or LIBCMTD [Win32 Debug]) | |
157 | +*/ | |
158 | + | |
159 | +// if wxWidgets are updated, change lib names below and linker libpath option. | |
160 | + | |
161 | +#if IS_FB2K_VER09 | |
162 | +#pragma comment(lib, "../shared/shared.lib") | |
163 | + | |
164 | +// for StrCmpLogicalW in metadb_handle_list.cpp | |
165 | +#pragma comment(lib, "shlwapi.lib") | |
166 | +#endif | |
167 | + | |
168 | +typedef std::basic_string<TCHAR> tstring; | |
169 | + | |
170 | +typedef TCHAR Str64K[65536]; | |
171 | +typedef char StrDBCS64K[65536]; | |
172 | + | |
173 | +tstring GetErrorMessage(DWORD errCode); | |
174 | +void putLogError(LPCTSTR pMethod, LPCTSTR pErrMsg, DWORD dwErrCode); | |
175 | +void setDlgVersionInfo(HWND wnd, UINT idc_version, UINT idc_build); | |
176 | +void DebugPrint(LPCTSTR lpszFormat, ...); | |
177 | +void DebugPrint8(LPCSTR lpszFormat, ...); | |
178 | + | |
179 | +#define LOGLEVEL_NONE 0 | |
180 | +#define LOGLEVEL_DEBUG 1 | |
181 | +#define LOGLEVEL_TRACE 2 | |
182 | + | |
183 | +#define LOG_TRACE(f, ...) if(cfg_enable_debug_log) DebugPrint(f, __VA_ARGS__) | |
184 | +#define LOG_DEBUG(f, ...) if(cfg_enable_debug_log) DebugPrint(f, __VA_ARGS__) | |
185 | + | |
186 | +#define LOG_TRACE8(f, ...) if(cfg_enable_debug_log) DebugPrint8(f, __VA_ARGS__) | |
187 | +#define LOG_DEBUG8(f, ...) if(cfg_enable_debug_log) DebugPrint8(f, __VA_ARGS__) | |
188 | + | |
189 | +#define LOG_INFO(f, ...) DebugPrint(f, __VA_ARGS__) | |
190 | +#define LOG_WARN(f, ...) DebugPrint(f, __VA_ARGS__) | |
191 | +#define LOG_ERROR(f, ...) DebugPrint(f, __VA_ARGS__) | |
192 | + | |
193 | +#if defined(BUILD_UNICODE) | |
194 | +#define TRACE_DBCS(f, ...) if(cfg_enable_debug_log) DebugPrintDBCS(f, __VA_ARGS__) | |
195 | +#else | |
196 | +#define TRACE_DBCS(f, ...) if(cfg_enable_debug_log) DebugPrint(f, __VA_ARGS__) | |
197 | +#endif | |
198 | + | |
199 | +#define DEBUG_HUYGENS_INIT(f, ...) if(cfg_debug_huygens_init >= LOGLEVEL_DEBUG) LOG_DEBUG(f, __VA_ARGS__) | |
200 | +#define TRACE_HUYGENS_INIT(f, ...) if(cfg_debug_huygens_init >= LOGLEVEL_TRACE) LOG_TRACE(f, __VA_ARGS__) | |
201 | + | |
202 | +#define DEBUG_HUYGENS_PROC(f, ...) if(cfg_debug_huygens_proc >= LOGLEVEL_DEBUG) LOG_DEBUG(f, __VA_ARGS__) | |
203 | +#define DEBUG_HUYGENS_PROC8(f, ...) if(cfg_debug_huygens_proc >= LOGLEVEL_DEBUG) LOG_DEBUG8(f, __VA_ARGS__) | |
204 | +#define TRACE_HUYGENS_PROC(f, ...) if(cfg_debug_huygens_proc >= LOGLEVEL_TRACE) LOG_TRACE(f, __VA_ARGS__) | |
205 | +#define TRACE_HUYGENS_PROC8(f, ...) if(cfg_debug_huygens_proc >= LOGLEVEL_TRACE) LOG_TRACE8(f, __VA_ARGS__) | |
206 | + | |
207 | +#define DEBUG_TRACK_INFO(f, ...) if(cfg_debug_track_info >= LOGLEVEL_DEBUG) LOG_DEBUG(f, __VA_ARGS__) | |
208 | +#define DEBUG_TRACK_INFO8(f, ...) if(cfg_debug_track_info >= LOGLEVEL_DEBUG) LOG_DEBUG8(f, __VA_ARGS__) | |
209 | +#define TRACE_TRACK_INFO(f, ...) if(cfg_debug_track_info >= LOGLEVEL_TRACE) LOG_TRACE(f, __VA_ARGS__) | |
210 | +#define TRACE_TRACK_INFO8(f, ...) if(cfg_debug_track_info >= LOGLEVEL_TRACE) LOG_TRACE8(f, __VA_ARGS__) | |
211 | + | |
212 | +#define DEBUG_PLUGIN(f, ...) if(cfg_debug_plugin >= LOGLEVEL_DEBUG) LOG_DEBUG(f, __VA_ARGS__) | |
213 | +#define TRACE_PLUGIN(f, ...) if(cfg_debug_plugin >= LOGLEVEL_TRACE) LOG_TRACE(f, __VA_ARGS__) | |
214 | + | |
215 | +#define DEBUG_CALLBACK(f, ...) if(cfg_debug_callback >= LOGLEVEL_DEBUG) LOG_DEBUG(f, __VA_ARGS__) | |
216 | +#define TRACE_CALLBACK(f, ...) if(cfg_debug_callback >= LOGLEVEL_TRACE) LOG_TRACE(f, __VA_ARGS__) | |
217 | + | |
218 | +static string_utf8_from_os g_pluginCaption8(_T(PLUGIN_CAPTION_JP)); | |
219 | +static string_utf8_from_os g_pluginVersion8(PLUGIN_VERSION); | |
220 | +static string_utf8_from_os g_pluginAbout8(_T(PLUGIN_CAPTION_JP) _T(" ") PLUGIN_VERSION _T("\nCopyright (C) 2008, 2009 Yossiepon Oniichan, All Rights Reserved.")); | |
221 | + | |
222 | +DECLARE_COMPONENT_VERSION(g_pluginCaption8, g_pluginVersion8, g_pluginAbout8); | |
223 | + | |
224 | +static string_utf8_from_os g_advancedSettingsCaption8(_T(ADVANCED_SETTINGS_CAPTION)); | |
225 | +static string_utf8_from_os g_debugSettingsCaption8(_T(DEBUG_SETTINGS_CAPTION)); | |
226 | + | |
227 | +static string_utf8_from_os g_menu_item(_T("Components/Huygens/Huygens の応答機能を有効にする")); | |
228 | + | |
229 | +static string_utf8_from_os g_menu_item_title(_T("Huygens の応答機能を有効にする")); | |
230 | +static string_utf8_from_os g_menu_item_description(_T("Cassini 等の外部ツールからのメッセージに対する応答機能について、有効/無効を切り替えます")); | |
231 | + | |
232 | +#if IS_FB2K_VER08 | |
233 | +static cfg_int cfg_use_plugin("usePlugin", 1); | |
234 | + | |
235 | +static cfg_int cfg_show_huygens("ShowHuygens", 0); | |
236 | +static cfg_string cfg_huygens_title_format("HuygensTitleFormat", DEFAULT_HUYGENS_TITLE_FORMAT); | |
237 | +static cfg_string cfg_huygens_playlist_format("HuygensPlaylistFormat", DEFAULT_HUYGENS_TITLE_FORMAT); | |
238 | +static cfg_int cfg_disable_ansi_trans("DisableAnsiTrans", 1); | |
239 | + | |
240 | +static cfg_int cfg_enable_debug_log("EnableDebugLog", 1); | |
241 | +static cfg_int cfg_debug_huygens_init("DebugHuygensInit", 1); | |
242 | +static cfg_int cfg_debug_huygens_proc("DebugHuygensProc", 1); | |
243 | +static cfg_int cfg_debug_track_info("DebugTrackInfo", 1); | |
244 | +static cfg_int cfg_debug_plugin("DebugPlugin", 1); | |
245 | +static cfg_int cfg_debug_callback("DebugCallback", 1); | |
246 | +#elif IS_FB2K_VER09 | |
247 | +// {0F6B1827-F2B6-4a3d-B566-1740AA4DA80A} | |
248 | +static const GUID cfg_use_plugin_guid = { 0xf6b1827, 0xf2b6, 0x4a3d, { 0xb5, 0x66, 0x17, 0x40, 0xaa, 0x4d, 0xa8, 0xa } }; | |
249 | +static cfg_int cfg_use_plugin(cfg_use_plugin_guid, 1); | |
250 | + | |
251 | +// {58C73D35-1BFC-4f60-B942-F06CAFD74CCD} | |
252 | +static const GUID cfg_show_huygens_guid = { 0x58c73d35, 0x1bfc, 0x4f60, { 0xb9, 0x42, 0xf0, 0x6c, 0xaf, 0xd7, 0x4c, 0xcd } }; | |
253 | +static cfg_int cfg_show_huygens(cfg_show_huygens_guid, 0); | |
254 | +// {E4EE2EFC-9CFD-4abe-93FE-01DDD5CCA4BF} | |
255 | +static const GUID cfg_huygens_title_format_guid = { 0xe4ee2efc, 0x9cfd, 0x4abe, { 0x93, 0xfe, 0x1, 0xdd, 0xd5, 0xcc, 0xa4, 0xbf } }; | |
256 | +static cfg_string cfg_huygens_title_format(cfg_huygens_title_format_guid, DEFAULT_HUYGENS_TITLE_FORMAT); | |
257 | +// {6FA295D0-DE65-4688-81E6-3D9E5D11DCD4} | |
258 | +static const GUID cfg_huygens_playlist_format_guid = { 0x6fa295d0, 0xde65, 0x4688, { 0x81, 0xe6, 0x3d, 0x9e, 0x5d, 0x11, 0xdc, 0xd4 } }; | |
259 | +static cfg_string cfg_huygens_playlist_format(cfg_huygens_title_format_guid, DEFAULT_HUYGENS_TITLE_FORMAT); | |
260 | + | |
261 | +// {14675AAF-BD88-46cf-89EB-9145424CFE04} | |
262 | +static const GUID cfg_disable_ansi_trans_guid = { 0x14675aaf, 0xbd88, 0x46cf, { 0x89, 0xeb, 0x91, 0x45, 0x42, 0x4c, 0xfe, 0x4 } }; | |
263 | +static cfg_int cfg_disable_ansi_trans(cfg_disable_ansi_trans_guid, 1); | |
264 | + | |
265 | +// {85624EA1-F4BF-4909-B1B1-7EDD0237EAF2} | |
266 | +static const GUID cfg_enable_debug_log_guid = { 0x85624ea1, 0xf4bf, 0x4909, { 0xb1, 0xb1, 0x7e, 0xdd, 0x2, 0x37, 0xea, 0xf2 } }; | |
267 | +static cfg_int cfg_enable_debug_log(cfg_enable_debug_log_guid, 1); // debug log enabled | |
268 | +// {65CDEA92-6057-47b5-8BF7-40192788CCB6} | |
269 | +static const GUID cfg_debug_huygens_init_guid = { 0x65cdea92, 0x6057, 0x47b5, { 0x8b, 0xf7, 0x40, 0x19, 0x27, 0x88, 0xcc, 0xb6 } }; | |
270 | +static cfg_int cfg_debug_huygens_init(cfg_debug_huygens_init_guid, 1); // debug level | |
271 | +// {D3DDB68F-0BD0-47b9-8E1E-5E46BC16D89B} | |
272 | +static const GUID cfg_debug_huygens_proc_guid = { 0xd3ddb68f, 0xbd0, 0x47b9, { 0x8e, 0x1e, 0x5e, 0x46, 0xbc, 0x16, 0xd8, 0x9b } }; | |
273 | +static cfg_int cfg_debug_huygens_proc(cfg_debug_huygens_proc_guid, 1); // debug level | |
274 | +// {1F654881-CCD5-4a75-A7FC-2073B84EEAC1} | |
275 | +static const GUID cfg_debug_track_info_guid = { 0x1f654881, 0xccd5, 0x4a75, { 0xa7, 0xfc, 0x20, 0x73, 0xb8, 0x4e, 0xea, 0xc1 } }; | |
276 | +static cfg_int cfg_debug_track_info(cfg_debug_track_info_guid, 1); // debug level | |
277 | +// {A4C79E60-72A1-4a08-ACA0-F56F3DD6452D} | |
278 | +static const GUID cfg_debug_plugin_guid = { 0xa4c79e60, 0x72a1, 0x4a08, { 0xac, 0xa0, 0xf5, 0x6f, 0x3d, 0xd6, 0x45, 0x2d } }; | |
279 | +static cfg_int cfg_debug_plugin(cfg_debug_plugin_guid, 1); // debug level | |
280 | +// {CDCB6FAB-7A14-455e-80EA-D7F3E14E13AE} | |
281 | +static const GUID cfg_debug_callback_guid = { 0xcdcb6fab, 0x7a14, 0x455e, { 0x80, 0xea, 0xd7, 0xf3, 0xe1, 0x4e, 0x13, 0xae } }; | |
282 | +static cfg_int cfg_debug_callback(cfg_debug_callback_guid, 1); // debug level | |
283 | +#endif | |
284 | + | |
285 | +struct TRACK_INFO8 | |
286 | +{ | |
287 | + std::map<std::string, std::string> m_infoMap8; | |
288 | + std::map<std::string, std::string> m_infoMapAnsi; | |
289 | + | |
290 | + std::map<std::string, UINT> m_infoMapNum; | |
291 | + | |
292 | + std::string m_nullStr; | |
293 | + | |
294 | + void clear() | |
295 | + { | |
296 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::clear - called.")); | |
297 | + | |
298 | + m_infoMap8.clear(); | |
299 | + m_infoMapAnsi.clear(); | |
300 | + m_infoMapNum.clear(); | |
301 | + } | |
302 | + | |
303 | + bool isEmpty() const { return m_infoMap8.empty() | m_infoMapNum.empty(); } | |
304 | + | |
305 | +public: | |
306 | + | |
307 | +#if IS_FB2K_VER08 | |
308 | + void setStrings(std::vector<std::string> & keys, metadb_handle * track) | |
309 | +#elif IS_FB2K_VER09 | |
310 | + void setStrings(std::vector<std::string> & keys, metadb_handle_ptr track) | |
311 | +#endif | |
312 | + { | |
313 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setStrings - called.")); | |
314 | + | |
315 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
316 | + | |
317 | + for(it = beginIt; it != endIt; it ++) { | |
318 | + | |
319 | + string8 info8; | |
320 | + | |
321 | +#if IS_FB2K_VER08 | |
322 | + track->handle_format_title(info8, it->c_str(), 0); | |
323 | +#elif IS_FB2K_VER09 | |
324 | + service_ptr_t<titleformat_object> titleformat; | |
325 | + | |
326 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
327 | + track->format_title(NULL, info8, titleformat, 0); | |
328 | +#endif | |
329 | + DEBUG_TRACK_INFO8("TRACK_INFO8::setStrings - %s: %s", it->c_str(), (LPCSTR)info8); | |
330 | + | |
331 | + m_infoMap8.insert(std::make_pair(*it, info8)); | |
332 | + | |
333 | + if(cfg_disable_ansi_trans == 0) | |
334 | + { | |
335 | +#if IS_FB2K_VER08 | |
336 | + string_wide_from_utf8 infoW(info8); | |
337 | + string_ansi_from_wide infoAnsi(infoW); | |
338 | +#elif IS_FB2K_VER09 | |
339 | + string_ansi_from_utf8 infoAnsi(info8); | |
340 | +#endif | |
341 | + | |
342 | + m_infoMapAnsi.insert(std::make_pair(*it, infoAnsi)); | |
343 | + } | |
344 | + } | |
345 | + } | |
346 | + | |
347 | + void setDynamicStrings(std::vector<std::string> & keys) | |
348 | + { | |
349 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setDynamicStrings - called.")); | |
350 | + | |
351 | +#if IS_FB2K_VER08 | |
352 | + metadb_handle *track = play_control::get()->get_now_playing(); | |
353 | +#elif IS_FB2K_VER09 | |
354 | + metadb_handle_ptr track; | |
355 | + static_api_ptr_t<playback_control>()->get_now_playing(track); | |
356 | +#endif | |
357 | + | |
358 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
359 | + | |
360 | + for(it = beginIt; it != endIt; it ++) { | |
361 | + | |
362 | + string8 info8; | |
363 | + | |
364 | +#if IS_FB2K_VER08 | |
365 | + play_control::get()->playback_format_title_ex(track, info8, it->c_str(), NULL, false, true); | |
366 | +#elif IS_FB2K_VER09 | |
367 | + service_ptr_t<titleformat_object> titleformat; | |
368 | + | |
369 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
370 | + static_api_ptr_t<playback_control>()->playback_format_title_ex(track, NULL, info8, titleformat, NULL, play_control::display_level_titles); | |
371 | +#endif | |
372 | + TRACE_TRACK_INFO8("TRACK_INFO8::setDynamicStrings - %s: %s", it->c_str(), (LPCSTR)info8); | |
373 | + | |
374 | + const std::string &oldValue = getString(*it); | |
375 | + | |
376 | + if((::strcmp(info8, "?") == 0) || (oldValue.length() == 0)) | |
377 | + { | |
378 | + m_infoMap8.insert(std::make_pair(*it, info8)); | |
379 | + | |
380 | + if(cfg_disable_ansi_trans == 0) | |
381 | + { | |
382 | +#if IS_FB2K_VER08 | |
383 | + string_wide_from_utf8 infoW(info8); | |
384 | + string_ansi_from_wide infoAnsi(infoW); | |
385 | +#elif IS_FB2K_VER09 | |
386 | + string_ansi_from_utf8 infoAnsi(info8); | |
387 | +#endif | |
388 | + | |
389 | + m_infoMapAnsi.insert(std::make_pair(*it, infoAnsi)); | |
390 | + } | |
391 | + } | |
392 | + } | |
393 | + | |
394 | +#if IS_FB2K_VER08 | |
395 | + if(track) { | |
396 | + track->handle_release(); | |
397 | + } | |
398 | +#endif | |
399 | + } | |
400 | + | |
401 | + void setPlaylistStrings(std::vector<std::string> & keys) | |
402 | + { | |
403 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setPlaylistStrings - called.")); | |
404 | + | |
405 | +#if IS_FB2K_VER08 | |
406 | + int track_index; | |
407 | + track_index = playlist_oper::get()->get_now_playing(); | |
408 | +#elif IS_FB2K_VER09 | |
409 | + t_size playlist_index, track_index; | |
410 | + static_api_ptr_t<playlist_manager>()->get_playing_item_location(&playlist_index, &track_index); | |
411 | +#endif | |
412 | + | |
413 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
414 | + | |
415 | + for(it = beginIt; it != endIt; it ++) { | |
416 | + | |
417 | + string8 info8; | |
418 | + | |
419 | +#if IS_FB2K_VER08 | |
420 | + playlist_oper::get()->format_title(track_index, info8, it->c_str(), NULL); | |
421 | +#elif IS_FB2K_VER09 | |
422 | + service_ptr_t<titleformat_object> titleformat; | |
423 | + | |
424 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
425 | + static_api_ptr_t<playlist_manager>()->playlist_item_format_title(playlist_index, track_index, | |
426 | + NULL, info8, titleformat, NULL, play_control::display_level_titles); | |
427 | +#endif | |
428 | + DEBUG_TRACK_INFO8("TRACK_INFO8::setPlaylistStrings - %s: %s", it->c_str(), (LPCSTR)info8); | |
429 | + | |
430 | + m_infoMap8.insert(std::make_pair(*it, info8)); | |
431 | + | |
432 | + if(cfg_disable_ansi_trans == 0) | |
433 | + { | |
434 | +#if IS_FB2K_VER08 | |
435 | + string_wide_from_utf8 infoW(info8); | |
436 | + string_ansi_from_wide infoAnsi(infoW); | |
437 | +#elif IS_FB2K_VER09 | |
438 | + string_ansi_from_utf8 infoAnsi(info8); | |
439 | +#endif | |
440 | + | |
441 | + m_infoMapAnsi.insert(std::make_pair(*it, infoAnsi)); | |
442 | + } | |
443 | + } | |
444 | + } | |
445 | + | |
446 | +#if IS_FB2K_VER08 | |
447 | + void setNumbers(std::vector<std::string> & keys, metadb_handle * track) | |
448 | +#elif IS_FB2K_VER09 | |
449 | + void setNumbers(std::vector<std::string> & keys, metadb_handle_ptr track) | |
450 | +#endif | |
451 | + { | |
452 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setNumbers - called.")); | |
453 | + | |
454 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
455 | + | |
456 | + for(it = beginIt; it != endIt; it ++) { | |
457 | + | |
458 | + string8 info8; | |
459 | + | |
460 | +#if IS_FB2K_VER08 | |
461 | + track->handle_format_title(info8, it->c_str(), 0); | |
462 | +#elif IS_FB2K_VER09 | |
463 | + service_ptr_t<titleformat_object> titleformat; | |
464 | + | |
465 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
466 | + track->format_title(NULL, info8, titleformat, 0); | |
467 | +#endif | |
468 | + DEBUG_TRACK_INFO8("TRACK_INFO8::setNumbers - %s: %s", it->c_str(), (LPCSTR)info8); | |
469 | + | |
470 | + m_infoMapNum.insert(std::make_pair(*it, static_cast<UINT>(::atol(info8)) ) ); | |
471 | + } | |
472 | + } | |
473 | + | |
474 | + void setDynamicNumbers(std::vector<std::string> & keys) | |
475 | + { | |
476 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setDynamicNumbers - called.")); | |
477 | + | |
478 | +#if IS_FB2K_VER08 | |
479 | + metadb_handle *track = play_control::get()->get_now_playing(); | |
480 | +#elif IS_FB2K_VER09 | |
481 | + metadb_handle_ptr track; | |
482 | + static_api_ptr_t<playback_control>()->get_now_playing(track); | |
483 | +#endif | |
484 | + | |
485 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
486 | + | |
487 | + for(it = beginIt; it != endIt; it ++) { | |
488 | + | |
489 | + string8 info8; | |
490 | + | |
491 | +#if IS_FB2K_VER08 | |
492 | + play_control::get()->playback_format_title_ex(track, info8, it->c_str(), NULL, false, true); | |
493 | +#elif IS_FB2K_VER09 | |
494 | + service_ptr_t<titleformat_object> titleformat; | |
495 | + | |
496 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
497 | + static_api_ptr_t<playback_control>()->playback_format_title_ex(track, NULL, info8, titleformat, NULL, play_control::display_level_titles); | |
498 | +#endif | |
499 | + TRACE_TRACK_INFO8("TRACK_INFO8::setDynamicNumbers - %s: %s", it->c_str(), (LPCSTR)info8); | |
500 | + | |
501 | + UINT newValue = ::atol(info8); | |
502 | + UINT oldValue = getNumber(*it); | |
503 | + | |
504 | + if((newValue != 0) || (oldValue == 0)) { | |
505 | + m_infoMapNum.insert(std::make_pair(*it, static_cast<UINT>(newValue) ) ); | |
506 | + } | |
507 | + } | |
508 | + | |
509 | +#if IS_FB2K_VER08 | |
510 | + if(track) { | |
511 | + track->handle_release(); | |
512 | + } | |
513 | +#endif | |
514 | + } | |
515 | + | |
516 | + void setPlaylistNumbers(std::vector<std::string> & keys) | |
517 | + { | |
518 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setPlaylistNumbers - called.")); | |
519 | + | |
520 | +#if IS_FB2K_VER08 | |
521 | + int track_index; | |
522 | + track_index = playlist_oper::get()->get_now_playing(); | |
523 | +#elif IS_FB2K_VER09 | |
524 | + t_size playlist_index, track_index; | |
525 | + static_api_ptr_t<playlist_manager>()->get_playing_item_location(&playlist_index, &track_index); | |
526 | +#endif | |
527 | + | |
528 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
529 | + | |
530 | + for(it = beginIt; it != endIt; it ++) { | |
531 | + | |
532 | + string8 info8; | |
533 | + | |
534 | +#if IS_FB2K_VER08 | |
535 | + playlist_oper::get()->format_title(track_index, info8, it->c_str(), NULL); | |
536 | +#elif IS_FB2K_VER09 | |
537 | + service_ptr_t<titleformat_object> titleformat; | |
538 | + | |
539 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
540 | + static_api_ptr_t<playlist_manager>()->playlist_item_format_title(playlist_index, track_index, | |
541 | + NULL, info8, titleformat, NULL, play_control::display_level_titles); | |
542 | +#endif | |
543 | + DEBUG_TRACK_INFO8("TRACK_INFO8::setPlaylistNumbers - %s: %s", it->c_str(), (LPCSTR)info8); | |
544 | + | |
545 | + m_infoMapNum.insert(std::make_pair(*it, static_cast<UINT>(::atol(info8)) ) ); | |
546 | + } | |
547 | + } | |
548 | + | |
549 | + void putString(const std::string &key, const std::string &value) | |
550 | + { | |
551 | + DEBUG_TRACK_INFO8("TRACK_INFO8::putString - %s: %s", key.c_str(), value.c_str()); | |
552 | + | |
553 | + m_infoMap8.insert(std::make_pair(key, value.c_str())); | |
554 | + | |
555 | + if(cfg_disable_ansi_trans == 0) | |
556 | + { | |
557 | +#if IS_FB2K_VER08 | |
558 | + string_wide_from_utf8 valueW(value.c_str()); | |
559 | + string_ansi_from_wide valueAnsi(valueW); | |
560 | +#elif IS_FB2K_VER09 | |
561 | + string_ansi_from_utf8 valueAnsi(value.c_str()); | |
562 | +#endif | |
563 | + | |
564 | + m_infoMapAnsi.insert(std::make_pair(key, valueAnsi)); | |
565 | + } | |
566 | + } | |
567 | + | |
568 | + void putNumber(const std::string &key, UINT value) | |
569 | + { | |
570 | + DEBUG_TRACK_INFO8("TRACK_INFO8::putNumber - %s: %u", key.c_str(), value); | |
571 | + | |
572 | + m_infoMapNum.insert(std::make_pair(key, value)); | |
573 | + } | |
574 | + | |
575 | + const std::string &getString(const std::string &key, bool bForceUTF8 = false) const { | |
576 | + | |
577 | + if((bForceUTF8 == true) || (cfg_disable_ansi_trans == 1)) | |
578 | + { | |
579 | + std::map<std::string, std::string>::const_iterator it(m_infoMap8.find(key)), endIt(m_infoMap8.end()); | |
580 | + | |
581 | + if(it == endIt) { | |
582 | + return m_nullStr; | |
583 | + } | |
584 | + | |
585 | + return it->second; | |
586 | + } | |
587 | + else | |
588 | + { | |
589 | + std::map<std::string, std::string>::const_iterator it(m_infoMapAnsi.find(key)), endIt(m_infoMapAnsi.end()); | |
590 | + | |
591 | + if(it == endIt) { | |
592 | + return m_nullStr; | |
593 | + } | |
594 | + | |
595 | + return it->second; | |
596 | + } | |
597 | + } | |
598 | + | |
599 | + const UINT getNumber(const std::string &key) const { | |
600 | + | |
601 | + std::map<std::string, UINT>::const_iterator it(m_infoMapNum.find(key)), endIt(m_infoMapNum.end()); | |
602 | + | |
603 | + if(it == endIt) { | |
604 | + return 0; | |
605 | + } | |
606 | + | |
607 | + return it->second; | |
608 | + } | |
609 | + | |
610 | +}; | |
611 | + | |
612 | +class PlayInfo | |
613 | +{ | |
614 | + public: | |
615 | + | |
616 | + enum EPlayStatus | |
617 | + { | |
618 | + PLAY_STOP = 0, | |
619 | + PLAY_START = 1, | |
620 | + PLAY_PAUSE = 3 | |
621 | + }; | |
622 | + | |
623 | + public: | |
624 | + | |
625 | + PlayInfo() : | |
626 | + m_playStatus(PLAY_STOP), | |
627 | + m_playLength(0), | |
628 | + m_playPosition(0), | |
629 | + m_playCount(0) { | |
630 | + } | |
631 | + | |
632 | + public: | |
633 | + | |
634 | + void setPlayStatusStart() { | |
635 | + setPlayStatus(PLAY_START); | |
636 | + } | |
637 | + | |
638 | + void setPlayStatusStop() { | |
639 | + setPlayStatus(PLAY_STOP); | |
640 | + } | |
641 | + | |
642 | + void setPlayStatusPause() { | |
643 | + setPlayStatus(PLAY_PAUSE); | |
644 | + } | |
645 | + | |
646 | + void clearPlayInfo() | |
647 | + { | |
648 | + setPlayStatusStop(); | |
649 | + setPlayPosition(0); | |
650 | + setPlayLength(0); | |
651 | + } | |
652 | + | |
653 | + void incrementPlayCount() { | |
654 | + setPlayCount(getPlayCount() + 1); | |
655 | + } | |
656 | + | |
657 | + public: | |
658 | + | |
659 | + EPlayStatus getPlayStatus() const { | |
660 | + return m_playStatus; | |
661 | + } | |
662 | + | |
663 | + void setPlayStatus(EPlayStatus status) { | |
664 | + m_playStatus = status; | |
665 | + } | |
666 | + | |
667 | + int getPlayPosition() const { | |
668 | + return m_playPosition; | |
669 | + } | |
670 | + | |
671 | + void setPlayPosition(int pos) { | |
672 | + m_playPosition = pos; | |
673 | + } | |
674 | + | |
675 | + double getPlayLength() const { | |
676 | + return m_playLength; | |
677 | + } | |
678 | + | |
679 | + void setPlayLength(double len) { | |
680 | + m_playLength = len; | |
681 | + } | |
682 | + | |
683 | + int getPlayCount() const { | |
684 | + return m_playCount; | |
685 | + } | |
686 | + | |
687 | + void setPlayCount(int count) { | |
688 | + m_playCount = count; | |
689 | + } | |
690 | + | |
691 | + protected: | |
692 | + | |
693 | + EPlayStatus m_playStatus; | |
694 | + | |
695 | + double m_playLength; | |
696 | + int m_playPosition; | |
697 | + int m_playCount; | |
698 | +}; | |
699 | + | |
700 | +class Probe | |
701 | +{ | |
702 | + public: | |
703 | + | |
704 | + Probe() : | |
705 | + m_hHuygensWnd((HWND)INVALID_HANDLE_VALUE), | |
706 | + m_GETPLAYLISTFILE_time(0) { | |
707 | + | |
708 | + m_huygensTitle = _T(DEFAULT_HUYGENS_TITLE); | |
709 | + } | |
710 | + | |
711 | + ~Probe() | |
712 | + { | |
713 | + release(); | |
714 | + } | |
715 | + | |
716 | + public: | |
717 | + | |
718 | + static Probe *getInstance() | |
719 | + { | |
720 | + if(m_pMe == NULL) | |
721 | + { | |
722 | + m_pMe = new Probe(); | |
723 | + } | |
724 | + | |
725 | + return m_pMe; | |
726 | + } | |
727 | + | |
728 | + void load() | |
729 | + { | |
730 | + TRACE_HUYGENS_INIT(_T("Probe::load - called.")); | |
731 | + | |
732 | + // create huygens window | |
733 | + createWindow(); | |
734 | + } | |
735 | + | |
736 | + void release() | |
737 | + { | |
738 | + TRACE_HUYGENS_INIT(_T("Probe::release - called.")); | |
739 | + | |
740 | + // destruct huygens window | |
741 | + destroyWindow(); | |
742 | + } | |
743 | + | |
744 | + void updateProbeTitle() | |
745 | + { | |
746 | + tstring huygensTitle = makeProbeTitle(getBaseHuygensTitle()); | |
747 | + | |
748 | + setHuygensTitle(huygensTitle.c_str()); | |
749 | + | |
750 | + ::SetWindowText(getWnd(), huygensTitle.c_str()); | |
751 | + } | |
752 | + | |
753 | + void clearProbeTitle() | |
754 | + { | |
755 | + uSetWindowText(getWnd(), DEFAULT_HUYGENS_TITLE); | |
756 | + } | |
757 | + | |
758 | + void createWindow() | |
759 | + { | |
760 | + TRACE_PLUGIN(_T("Probe::createWindow - called.")); | |
761 | + | |
762 | + if(getWnd() == INVALID_HANDLE_VALUE) | |
763 | + { | |
764 | + // create huygens window | |
765 | + setWnd(createHuygensWindow()); | |
766 | + } | |
767 | + } | |
768 | + | |
769 | + public: | |
770 | + | |
771 | + HWND getWnd() const { | |
772 | + return m_hHuygensWnd; | |
773 | + } | |
774 | + | |
775 | + const TRACK_INFO8 &getTrackInfo8() const { | |
776 | + return m_trackInfo8; | |
777 | + } | |
778 | + | |
779 | + TRACK_INFO8 &getMutableTrackInfo8() { | |
780 | + return m_trackInfo8; | |
781 | + } | |
782 | + | |
783 | + void setTrackInfo8(const TRACK_INFO8 &trackInfo8) { | |
784 | + m_trackInfo8 = trackInfo8; | |
785 | + } | |
786 | + | |
787 | + PlayInfo &getPlayInfo() { | |
788 | + return m_playInfo; | |
789 | + } | |
790 | + | |
791 | + const PlayInfo &getPlayInfo() const { | |
792 | + return m_playInfo; | |
793 | + } | |
794 | + | |
795 | + void setPlaylistTitle(LPCTSTR pTitle) { | |
796 | + | |
797 | + TRACE_PLUGIN(_T("Probe::setPlayListTitle - %s"), pTitle); | |
798 | + | |
799 | + m_playlistTitle = pTitle; | |
800 | + | |
801 | + string_utf8_from_os playListTitle8(pTitle); | |
802 | + | |
803 | + if(cfg_disable_ansi_trans == 1) | |
804 | + { | |
805 | + | |
806 | + m_playlistTitle8 = playListTitle8; | |
807 | + } | |
808 | + else | |
809 | + { | |
810 | +#if IS_FB2K_VER08 | |
811 | + string_wide_from_utf8 playListTitleW(playListTitle8); | |
812 | + string_ansi_from_wide playListTitleAnsi(playListTitleW); | |
813 | +#elif IS_FB2K_VER09 | |
814 | + string_ansi_from_utf8 playListTitleAnsi(playListTitle8); | |
815 | +#endif | |
816 | + m_playlistTitle8 = playListTitleAnsi; | |
817 | + } | |
818 | + } | |
819 | + | |
820 | + const tstring &getPlaylistTitle() const { | |
821 | + return m_playlistTitle; | |
822 | + } | |
823 | + | |
824 | + const string8 &getPlaylistTitle8() const { | |
825 | + return m_playlistTitle8; | |
826 | + } | |
827 | + | |
828 | + void setHuygensTitle(LPCTSTR pTitle) { | |
829 | + | |
830 | + TRACE_PLUGIN(_T("Probe::setHuygensTitle - %s"), pTitle); | |
831 | + | |
832 | + m_huygensTitle = pTitle; | |
833 | + } | |
834 | + | |
835 | + const tstring &getHuygensTitle() const { | |
836 | + return m_huygensTitle; | |
837 | + } | |
838 | + | |
839 | + void setBaseHuygensTitle(LPCTSTR pTitle) | |
840 | + { | |
841 | + TRACE_PLUGIN(_T("Probe::setBaseHuygensTitle - %s"), pTitle); | |
842 | + | |
843 | + m_baseHuygensTitle = pTitle; | |
844 | + | |
845 | + updateProbeTitle(); | |
846 | + } | |
847 | + | |
848 | + const tstring &getBaseHuygensTitle() const { | |
849 | + return m_baseHuygensTitle; | |
850 | + } | |
851 | + | |
852 | + void showProbeWindow(bool bShow) { | |
853 | + showProbeWindow(getWnd(), bShow); | |
854 | + } | |
855 | + | |
856 | + protected: | |
857 | + | |
858 | + void setWnd(HWND hWnd) { | |
859 | + m_hHuygensWnd = hWnd; | |
860 | + } | |
861 | + | |
862 | + int getGetPlayListFileTime() const { | |
863 | + return m_GETPLAYLISTFILE_time; | |
864 | + } | |
865 | + | |
866 | + void setGetPlayListFileTime(int time) { | |
867 | + m_GETPLAYLISTFILE_time = time; | |
868 | + } | |
869 | + | |
870 | + protected: | |
871 | + | |
872 | + HWND createHuygensWindow() | |
873 | + { | |
874 | + TRACE_PLUGIN(_T("Probe::createHuygensWindow - called.")); | |
875 | + | |
876 | + static bool isInited = false; | |
877 | + | |
878 | +#if IS_FB2K_VER08 | |
879 | + static const char class_name[] = CLASSNAME; | |
880 | + if (!isInited) | |
881 | + { | |
882 | + isInited = true; | |
883 | + uWNDCLASS wc; | |
884 | + memset(&wc,0,sizeof(wc)); | |
885 | + wc.style = 0; | |
886 | + wc.lpfnWndProc = windowproc; | |
887 | + wc.hInstance = core_api::get_my_instance(); | |
888 | + wc.hCursor = NULL; //uLoadCursor(0, IDC_ARROW); | |
889 | + wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); | |
890 | + wc.lpszClassName = class_name; | |
891 | + uRegisterClass(&wc); | |
892 | + } | |
893 | + HWND hHuygensWnd = uCreateWindowEx( | |
894 | + 0, class_name, DEFAULT_HUYGENS_TITLE, | |
895 | + WS_OVERLAPPED|WS_CAPTION|WS_SIZEBOX, | |
896 | + CW_USEDEFAULT, CW_USEDEFAULT, 300, 150, | |
897 | + core_api::get_main_window(), 0, core_api::get_my_instance(), NULL | |
898 | + ); | |
899 | +#elif IS_FB2K_VER09 | |
900 | + static const TCHAR class_name[] = CLASSNAME; | |
901 | + if (!isInited) | |
902 | + { | |
903 | + isInited = true; | |
904 | + WNDCLASS wc; | |
905 | + memset(&wc,0,sizeof(wc)); | |
906 | + wc.style = 0; | |
907 | + wc.lpfnWndProc = windowproc; | |
908 | + wc.hInstance = core_api::get_my_instance(); | |
909 | + wc.hCursor = NULL; //uLoadCursor(0, IDC_ARROW); | |
910 | + wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); | |
911 | + wc.lpszClassName = class_name; | |
912 | + RegisterClass(&wc); | |
913 | + } | |
914 | + HWND hHuygensWnd = CreateWindowEx( | |
915 | + 0, class_name, _T(DEFAULT_HUYGENS_TITLE), | |
916 | + WS_OVERLAPPED|WS_CAPTION|WS_SIZEBOX, | |
917 | + CW_USEDEFAULT, CW_USEDEFAULT, 300, 150, | |
918 | + core_api::get_main_window(), 0, core_api::get_my_instance(), NULL | |
919 | + ); | |
920 | +#endif | |
921 | + if (!hHuygensWnd) | |
922 | + { | |
923 | + LOG_ERROR(_T("Probe::createHuygensWindow - Create Probe window failed.")); | |
924 | + | |
925 | + return NULL; | |
926 | + } | |
927 | + | |
928 | + DEBUG_PLUGIN(_T("Probe::createHuygensWindow - Probe window created.")); | |
929 | + | |
930 | + showProbeWindow(hHuygensWnd, cfg_show_huygens == 1); | |
931 | + | |
932 | + return hHuygensWnd; | |
933 | + } | |
934 | + | |
935 | + void showProbeWindow(HWND hHuygensWnd, bool bShow) | |
936 | + { | |
937 | + if(bShow) { | |
938 | + ShowWindow(hHuygensWnd, SW_SHOW); | |
939 | + } else { | |
940 | + ShowWindow(hHuygensWnd, SW_HIDE); | |
941 | + } | |
942 | + } | |
943 | + | |
944 | + void destroyWindow() | |
945 | + { | |
946 | + TRACE_PLUGIN(_T("Probe::destroyWindow - called.")); | |
947 | + | |
948 | + if(getWnd() != INVALID_HANDLE_VALUE) | |
949 | + { | |
950 | + uDestroyWindow(getWnd()); | |
951 | + | |
952 | +#if IS_FB2K_VER08 | |
953 | + uUnregisterClass(CLASSNAME, core_api::get_my_instance()); | |
954 | +#elif IS_FB2K_VER09 | |
955 | + UnregisterClass(CLASSNAME, core_api::get_my_instance()); | |
956 | +#endif | |
957 | + | |
958 | + setWnd((HWND)INVALID_HANDLE_VALUE); | |
959 | + } | |
960 | + } | |
961 | + | |
962 | + tstring makeProbeTitle(const tstring &rawTitle) | |
963 | + { | |
964 | + TRACE_PLUGIN(_T("Probe::makeProbeTitle - called.")); | |
965 | + | |
966 | + Str64K formatBuf; | |
967 | + | |
968 | + _stprintf_s( | |
969 | + formatBuf, sizeof(formatBuf) / sizeof(TCHAR), | |
970 | + _T("%d. %s - ") _T(DEFAULT_HUYGENS_TITLE), | |
971 | + m_trackInfo8.getNumber(FORMAT_LISTINDEX), | |
972 | + (LPCTSTR)rawTitle.c_str() | |
973 | + ); | |
974 | + | |
975 | + return formatBuf; | |
976 | + } | |
977 | + | |
978 | + void refreshTitle() | |
979 | + { | |
980 | + // get formatted dynamic titles | |
981 | + string8 huygens_title8; | |
982 | + string8 playlist_title8; | |
983 | +#if IS_FB2K_VER08 | |
984 | + metadb_handle *track = play_control::get()->get_now_playing(); | |
985 | + if(track) | |
986 | + { | |
987 | + play_control::get()->playback_format_title_ex(track, huygens_title8, cfg_huygens_title_format, NULL, false, true); | |
988 | + play_control::get()->playback_format_title_ex(track, playlist_title8, cfg_huygens_playlist_format, NULL, false, true); | |
989 | + track->handle_release(); | |
990 | + } | |
991 | +#elif IS_FB2K_VER09 | |
992 | + metadb_handle_ptr track; | |
993 | + static_api_ptr_t<playback_control>()->get_now_playing(track); | |
994 | + | |
995 | + service_ptr_t<titleformat_object> titleformat; | |
996 | + | |
997 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, cfg_huygens_title_format); | |
998 | + static_api_ptr_t<playback_control>()->playback_format_title_ex(track, NULL, huygens_title8, titleformat, NULL, play_control::display_level_all); | |
999 | + | |
1000 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, cfg_huygens_playlist_format); | |
1001 | + static_api_ptr_t<playback_control>()->playback_format_title_ex(track, NULL, playlist_title8, titleformat, NULL, play_control::display_level_all); | |
1002 | +#endif | |
1003 | + // convert utf8 track informations to os charset | |
1004 | + string_os_from_utf8 huygens_title(huygens_title8); | |
1005 | + string_os_from_utf8 playlist_title(playlist_title8); | |
1006 | + | |
1007 | + // set base huygens title to huygens | |
1008 | + setBaseHuygensTitle(huygens_title); | |
1009 | + | |
1010 | + // set huygens playlist current item title to huygens | |
1011 | + setPlaylistTitle(playlist_title); | |
1012 | + } | |
1013 | + | |
1014 | + protected: | |
1015 | + | |
1016 | + static LRESULT WINAPI windowproc(HWND wnd,UINT msg, WPARAM wp, LPARAM lp); | |
1017 | + static std::pair<bool, LRESULT> WINAPI huyIpcWindowProc(HWND wnd,UINT msg, WPARAM wp, LPARAM lp); | |
1018 | + | |
1019 | + protected: | |
1020 | + | |
1021 | + static Probe *m_pMe; | |
1022 | + | |
1023 | + HWND m_hHuygensWnd; | |
1024 | + | |
1025 | + PlayInfo m_playInfo; | |
1026 | + | |
1027 | + TRACK_INFO8 m_trackInfo8; | |
1028 | + int m_GETPLAYLISTFILE_time; | |
1029 | + | |
1030 | + tstring m_playlistTitle; | |
1031 | + string8 m_playlistTitle8; | |
1032 | + | |
1033 | + tstring m_huygensTitle; | |
1034 | + tstring m_baseHuygensTitle; | |
1035 | +}; | |
1036 | + | |
1037 | +Probe *Probe::m_pMe = NULL; | |
1038 | + | |
1039 | +LRESULT CALLBACK Probe::windowproc(HWND wnd,UINT msg, WPARAM wp, LPARAM lp) | |
1040 | +{ | |
1041 | + switch(msg) | |
1042 | + { | |
1043 | + case WM_CLOSE: | |
1044 | + DEBUG_HUYGENS_PROC(_T("Probe::windowproc - WM_CLOSE")); | |
1045 | + Probe::getInstance()->destroyWindow(); | |
1046 | + return 0; | |
1047 | + | |
1048 | + case WM_HUY_IPC: | |
1049 | + { | |
1050 | + if(cfg_use_plugin == 1) { | |
1051 | + std::pair<bool, LRESULT> res = huyIpcWindowProc(wnd, msg, wp, lp); | |
1052 | + if(res.first == true) { | |
1053 | + return res.second; | |
1054 | + } | |
1055 | + } | |
1056 | + } | |
1057 | + break; | |
1058 | + | |
1059 | + default: | |
1060 | + if(InSendMessage()) { | |
1061 | + TRACE_HUYGENS_PROC(_T("Probe::windowproc - Unknown MSG from other thread / MSG:%04x, W:%08x, L:%08x"), msg, wp, lp); | |
1062 | + } | |
1063 | + break; | |
1064 | + } | |
1065 | + | |
1066 | + return uDefWindowProc(wnd,msg,wp,lp); | |
1067 | +} | |
1068 | + | |
1069 | +std::pair<bool, LRESULT> WINAPI Probe::huyIpcWindowProc(HWND wnd,UINT msg, WPARAM wp, LPARAM lp) | |
1070 | +{ | |
1071 | + static string8 pluginVersion = PLUGIN_VERSION_VAL; | |
1072 | + | |
1073 | + switch(msg) | |
1074 | + { | |
1075 | + case WM_HUY_IPC: | |
1076 | + { | |
1077 | + PlayInfo::EPlayStatus playStatus = Probe::getInstance()->getPlayInfo().getPlayStatus(); | |
1078 | + double playLength = Probe::getInstance()->getPlayInfo().getPlayLength(); | |
1079 | + int playCount = Probe::getInstance()->getPlayInfo().getPlayCount(); | |
1080 | + | |
1081 | + switch(lp) | |
1082 | + { | |
1083 | + case HUY_GETVERSION: // 0x0000 | |
1084 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETVERSION / version [%s]", (LPCSTR)pluginVersion); | |
1085 | + return std::make_pair(true, (LRESULT)(LPCSTR)pluginVersion); | |
1086 | + | |
1087 | + case HUY_GETFB2KVERSION: // 0x0001 | |
1088 | + { | |
1089 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETFB2KVERSION / version [%s]", | |
1090 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_FB2KVERSION, true).c_str()); | |
1091 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_FB2KVERSION).c_str()); | |
1092 | + } | |
1093 | + | |
1094 | + case HUY_GETENCODEMODE: // 0x0002 | |
1095 | + { | |
1096 | + UINT isUTF8 = cfg_disable_ansi_trans == 1 ? 1 : 0; | |
1097 | + | |
1098 | + TRACE_HUYGENS_PROC( | |
1099 | + _T("Probe::huyIpcWindowProc - HUY_GETENCODEMODE / encode mode [%u]"), isUTF8); | |
1100 | + | |
1101 | + return std::make_pair(true, isUTF8); | |
1102 | + } | |
1103 | + | |
1104 | + case HUY_GETFILEPATH: // 0x0100 | |
1105 | + { | |
1106 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETFILEPATH / path [%s]", | |
1107 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILEPATH, true).c_str()); | |
1108 | + | |
1109 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILEPATH).c_str()); | |
1110 | + } | |
1111 | + | |
1112 | + case HUY_GETDURATION: // 0x0101 | |
1113 | + | |
1114 | + if(playStatus == PlayInfo::PLAY_START) | |
1115 | + { | |
1116 | + UINT duration = static_cast<int>(playLength * 1000); | |
1117 | + | |
1118 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETDURATION / length [%.3f sec.]"), duration / 1000.0); | |
1119 | + return std::make_pair(true, duration); | |
1120 | + } | |
1121 | + | |
1122 | + return std::make_pair(true, -1); | |
1123 | + | |
1124 | + case HUY_GETARTIST: // 0x0102 | |
1125 | + { | |
1126 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETARTIST / artist [%s]", | |
1127 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_ARTIST, true).c_str()); | |
1128 | + | |
1129 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_ARTIST).c_str()); | |
1130 | + } | |
1131 | + | |
1132 | + case HUY_GETTRACKTITLE: // 0x0103 | |
1133 | + { | |
1134 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETTRACKTITLE / title [%s]", | |
1135 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKTITLE, true).c_str()); | |
1136 | + | |
1137 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKTITLE).c_str()); | |
1138 | + } | |
1139 | + | |
1140 | + case HUY_GETALBUMTITLE: // 0x0104 | |
1141 | + { | |
1142 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETALBUMTITLE / album [%s]", | |
1143 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_ALBUMTITLE, true).c_str()); | |
1144 | + | |
1145 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_ALBUMTITLE).c_str()); | |
1146 | + } | |
1147 | + | |
1148 | + case HUY_GETDATE: // 0x0105 | |
1149 | + { | |
1150 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETDATE / date [%s]", | |
1151 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKDATE, true).c_str()); | |
1152 | + | |
1153 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKDATE).c_str()); | |
1154 | + } | |
1155 | + | |
1156 | + case HUY_GETCOMPOSER: // 0x0106 | |
1157 | + { | |
1158 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETCOMPOSER / composer [%s]", | |
1159 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_COMPOSER, true).c_str()); | |
1160 | + | |
1161 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_COMPOSER).c_str()); | |
1162 | + } | |
1163 | + | |
1164 | + case HUY_GETPERFORMER: // 0x0107 | |
1165 | + { | |
1166 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETPERFORMER / performer [%s]", | |
1167 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_PERFORMER, true).c_str()); | |
1168 | + | |
1169 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_PERFORMER).c_str()); | |
1170 | + } | |
1171 | + | |
1172 | + case HUY_GETALBUMARTIST: // 0x0108 | |
1173 | + { | |
1174 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETALBUMARTIST / album artist [%s]", | |
1175 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_ALBUMARTIST, true).c_str()); | |
1176 | + | |
1177 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_ALBUMARTIST).c_str()); | |
1178 | + } | |
1179 | + | |
1180 | + case HUY_GETTRACKARTIST: // 0x0119 | |
1181 | + { | |
1182 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETTRACKARTIST / track artist [%s]", | |
1183 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKARTIST, true).c_str()); | |
1184 | + | |
1185 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKARTIST).c_str()); | |
1186 | + } | |
1187 | + | |
1188 | + case HUY_GETTRACKNO: // 0x0109 | |
1189 | + { | |
1190 | + UINT nTrack = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_TRACKNUMBER); | |
1191 | + | |
1192 | + TRACE_HUYGENS_PROC( | |
1193 | + _T("Probe::huyIpcWindowProc - HUY_GETTRACKNO / track number [%u]"), nTrack); | |
1194 | + | |
1195 | + return std::make_pair(true, nTrack); | |
1196 | + } | |
1197 | + | |
1198 | + case HUY_GETTOTALTRACKS: // 0x010A | |
1199 | + { | |
1200 | + UINT nTrack = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_TRACKTOTAL); | |
1201 | + | |
1202 | + TRACE_HUYGENS_PROC( | |
1203 | + _T("Probe::huyIpcWindowProc - HUY_GETTOTALTRACK / total track number [%u]"), nTrack); | |
1204 | + | |
1205 | + return std::make_pair(true, nTrack); | |
1206 | + } | |
1207 | + | |
1208 | + case HUY_GETDISCNO: // 0x010B | |
1209 | + { | |
1210 | + UINT nDisc = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_DISCNUMBER); | |
1211 | + | |
1212 | + TRACE_HUYGENS_PROC( | |
1213 | + _T("Probe::huyIpcWindowProc - HUY_GETDISCNO / disc number [%u]"), nDisc); | |
1214 | + | |
1215 | + return std::make_pair(true, nDisc); | |
1216 | + } | |
1217 | + | |
1218 | + case HUY_GETTOTALDISCS: // 0x010C | |
1219 | + { | |
1220 | + UINT nDisc = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_DISCTOTAL); | |
1221 | + | |
1222 | + TRACE_HUYGENS_PROC( | |
1223 | + _T("Probe::huyIpcWindowProc - HUY_GETTOTALDISC / total track number [%u]"), nDisc); | |
1224 | + | |
1225 | + return std::make_pair(true, nDisc); | |
1226 | + } | |
1227 | + | |
1228 | + case HUY_GETCOMMENT: // 0x010D | |
1229 | + { | |
1230 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETCOMMENT / comment [%s]", | |
1231 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_COMMENT, true).c_str()); | |
1232 | + | |
1233 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_COMMENT).c_str()); | |
1234 | + } | |
1235 | + | |
1236 | + case HUY_GETSAMPLERATE: // 0x010E | |
1237 | + { | |
1238 | + UINT nRate = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_SAMPLERATE); | |
1239 | + | |
1240 | + TRACE_HUYGENS_PROC( | |
1241 | + _T("Probe::huyIpcWindowProc - HUY_GETSAMPLERATE / sampling rate [%u Hz]"), nRate); | |
1242 | + | |
1243 | + return std::make_pair(true, nRate); | |
1244 | + } | |
1245 | + | |
1246 | + case HUY_GETBITRATE: // 0x010F | |
1247 | + { | |
1248 | + UINT nRate = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_BITRATE); | |
1249 | + | |
1250 | + TRACE_HUYGENS_PROC( | |
1251 | + _T("Probe::huyIpcWindowProc - HUY_GETBITRATE / bitrate [%u kbps]"), nRate); | |
1252 | + | |
1253 | + return std::make_pair(true, nRate); | |
1254 | + } | |
1255 | + | |
1256 | + case HUY_GETBITRATENOMINAL: // 0x0127 | |
1257 | + { | |
1258 | + UINT nRate = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_BITRATE_NOMINAL); | |
1259 | + | |
1260 | + TRACE_HUYGENS_PROC( | |
1261 | + _T("Probe::huyIpcWindowProc - HUY_GETBITRATENOMINAL / nominal bitrate [%u kbps]"), nRate); | |
1262 | + | |
1263 | + return std::make_pair(true, nRate); | |
1264 | + } | |
1265 | + | |
1266 | + case HUY_GETBITRATEDYNAMIC: // 0x012C | |
1267 | + { | |
1268 | + UINT nRate = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_BITRATE_DYNAMIC); | |
1269 | + | |
1270 | + TRACE_HUYGENS_PROC( | |
1271 | + _T("Probe::huyIpcWindowProc - HUY_GETBITRATEDYNAMIC / dynamic bitrate [%u kbps]"), nRate); | |
1272 | + | |
1273 | + return std::make_pair(true, nRate); | |
1274 | + } | |
1275 | + | |
1276 | + case HUY_GETCHANNELS: // 0x0110 | |
1277 | + { | |
1278 | + UINT nCh = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_CHANNELS); | |
1279 | + | |
1280 | + TRACE_HUYGENS_PROC( | |
1281 | + _T("Probe::huyIpcWindowProc - HUY_GETCHANNELS / channels [%u]"), nCh); | |
1282 | + | |
1283 | + return std::make_pair(true, nCh); | |
1284 | + } | |
1285 | + | |
1286 | + case HUY_GETBITSPERSAMPLE: // 0x011C | |
1287 | + { | |
1288 | + UINT nBitsPerSample = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_BITSPERSAMPLE); | |
1289 | + | |
1290 | + TRACE_HUYGENS_PROC( | |
1291 | + _T("Probe::huyIpcWindowProc - HUY_GETBITSPERSAMPLE / bits/Sample [%u]"), nBitsPerSample); | |
1292 | + | |
1293 | + return std::make_pair(true, nBitsPerSample); | |
1294 | + } | |
1295 | + | |
1296 | + case HUY_GETCODEC: // 0x0111 | |
1297 | + { | |
1298 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETCODEC / codec [%s]", | |
1299 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_CODEC, true).c_str()); | |
1300 | + | |
1301 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_CODEC).c_str()); | |
1302 | + } | |
1303 | + | |
1304 | + case HUY_GETCODECPROFILE: // 0x0112 | |
1305 | + { | |
1306 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETCODECPROFILE / codec profile [%s]", | |
1307 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_CODECPROFILE, true).c_str()); | |
1308 | + | |
1309 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_CODECPROFILE).c_str()); | |
1310 | + } | |
1311 | + | |
1312 | + case HUY_ISLOSSLESS: // 0x0113 | |
1313 | + { | |
1314 | + UINT isLossless = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_LOSSLESS); | |
1315 | + | |
1316 | + TRACE_HUYGENS_PROC( | |
1317 | + _T("Probe::huyIpcWindowProc - HUY_ISLOSSLESS / lossless flag [%u]"), isLossless); | |
1318 | + | |
1319 | + return std::make_pair(true, isLossless); | |
1320 | + } | |
1321 | + | |
1322 | + case HUY_GETTAGTYPE: // 0x0114 | |
1323 | + { | |
1324 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETTAGTYPE / tag type [%s]", | |
1325 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_TAGTYPE, true).c_str()); | |
1326 | + | |
1327 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_TAGTYPE).c_str()); | |
1328 | + } | |
1329 | + | |
1330 | + case HUY_GETEXTRAINFO: // 0x011D | |
1331 | + { | |
1332 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETEXTRAINFO / extrainfo [%s]", | |
1333 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_EXTRAINFO, true).c_str()); | |
1334 | + | |
1335 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_EXTRAINFO).c_str()); | |
1336 | + } | |
1337 | + | |
1338 | + case HUY_GETTOOL: // 0x011E | |
1339 | + { | |
1340 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETTOOL / tool [%s]", | |
1341 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_TOOL, true).c_str()); | |
1342 | + | |
1343 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_TOOL).c_str()); | |
1344 | + } | |
1345 | + | |
1346 | + case HUY_GETCUEEMBEDDED: // 0x011F | |
1347 | + { | |
1348 | + UINT isEmbedded = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_CUEEMBEDDED); | |
1349 | + | |
1350 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETCUEEMBEDDED / embedded flag [%u]", isEmbedded); | |
1351 | + | |
1352 | + return std::make_pair(true, (LRESULT)(LPCSTR)isEmbedded); | |
1353 | + } | |
1354 | + | |
1355 | + case HUY_GETAUDIOMD5HASH: // 0x0120 | |
1356 | + { | |
1357 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETAUDIOMD5HASH / tag type [%s]", | |
1358 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_AUDIOMD5HASH, true).c_str()); | |
1359 | + | |
1360 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_AUDIOMD5HASH).c_str()); | |
1361 | + } | |
1362 | + | |
1363 | + case HUY_GETMP3STEREOMODE: // 0x0121 | |
1364 | + { | |
1365 | + UINT isJointStereo = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_MP3STEREOMODE); | |
1366 | + | |
1367 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETMP3STEREOMODE / stereo mode [%u]", isJointStereo); | |
1368 | + | |
1369 | + return std::make_pair(true, (LRESULT)(LPCSTR)isJointStereo); | |
1370 | + } | |
1371 | + | |
1372 | + case HUY_GETMP3ACCURATELENGTH: // 0x0122 | |
1373 | + { | |
1374 | + UINT isAcculateLength = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_MP3ACCURATELENGTH); | |
1375 | + | |
1376 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETMP3ACCULATELENGTH / acculate length flag [%u]", isAcculateLength); | |
1377 | + | |
1378 | + return std::make_pair(true, (LRESULT)(LPCSTR)isAcculateLength); | |
1379 | + } | |
1380 | + | |
1381 | + case HUY_GETMP3ENCDELAY: // 0x0123 | |
1382 | + { | |
1383 | + UINT nEncDelay = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_MP3ENCDELAY); | |
1384 | + | |
1385 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETMP3ENCDELAY / encoder delay [%u]", nEncDelay); | |
1386 | + | |
1387 | + return std::make_pair(true, (LRESULT)(LPCSTR)nEncDelay); | |
1388 | + } | |
1389 | + | |
1390 | + case HUY_GETMP3ENCPADDING: // 0x0124 | |
1391 | + { | |
1392 | + UINT nEncPadding = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_MP3ENCPADDING); | |
1393 | + | |
1394 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETMP3ENCPADDING / encoder padding [%u]", nEncPadding); | |
1395 | + | |
1396 | + return std::make_pair(true, (LRESULT)(LPCSTR)nEncPadding); | |
1397 | + } | |
1398 | + | |
1399 | + case HUY_GETAPEVERSION: // 0x0125 | |
1400 | + { | |
1401 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETAPEVERSION / ape version [%s]", | |
1402 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_APEVERSION, true).c_str()); | |
1403 | + | |
1404 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_APEVERSION).c_str()); | |
1405 | + } | |
1406 | + | |
1407 | + case HUY_GETAPEFLAGS: // 0x0126 | |
1408 | + { | |
1409 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETAPEFLAGS / ape flags [%s]", | |
1410 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_APEFLAGS, true).c_str()); | |
1411 | + | |
1412 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_APEFLAGS).c_str()); | |
1413 | + } | |
1414 | + | |
1415 | + case HUY_GETREPLAYGAIN_ALBUMGAIN: // 0x0128 | |
1416 | + { | |
1417 | + UINT nAlbumGain = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_REPLAYGAIN_ALBUMGAIN); | |
1418 | + | |
1419 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETREPLAYGAIN_ALBUMGAIN / album gain [%u]", nAlbumGain); | |
1420 | + | |
1421 | + return std::make_pair(true, (LRESULT)(LPCSTR)nAlbumGain); | |
1422 | + } | |
1423 | + | |
1424 | + case HUY_GETREPLAYGAIN_ALBUMPEEK: // 0x0129 | |
1425 | + { | |
1426 | + UINT nAlbumPeek = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_REPLAYGAIN_ALBUMPEEK); | |
1427 | + | |
1428 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETREPLAYGAIN_ALBUMPEEK / album peek [%u]", nAlbumPeek); | |
1429 | + | |
1430 | + return std::make_pair(true, (LRESULT)(LPCSTR)nAlbumPeek); | |
1431 | + } | |
1432 | + | |
1433 | + case HUY_GETREPLAYGAIN_TRACKGAIN: // 0x012A | |
1434 | + { | |
1435 | + UINT nTrackGain = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_REPLAYGAIN_TRACKGAIN); | |
1436 | + | |
1437 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETREPLAYGAIN_TRACKGAIN / track gain [%u]", nTrackGain); | |
1438 | + | |
1439 | + return std::make_pair(true, (LRESULT)(LPCSTR)nTrackGain); | |
1440 | + } | |
1441 | + | |
1442 | + case HUY_GETREPLAYGAIN_TRACKPEEK: // 0x012B | |
1443 | + { | |
1444 | + UINT nTrackPeek = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_REPLAYGAIN_TRACKPEEK); | |
1445 | + | |
1446 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETREPLAYGAIN_TRACKPEEK / track peek [%u]", nTrackPeek); | |
1447 | + | |
1448 | + return std::make_pair(true, (LRESULT)(LPCSTR)nTrackPeek); | |
1449 | + } | |
1450 | + | |
1451 | + case HUY_GETFILESIZE: // 0x0115 | |
1452 | + { | |
1453 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETFILESIZE / filesize [%s]"), | |
1454 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILESIZE, true).c_str()); | |
1455 | + | |
1456 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILESIZE).c_str()); | |
1457 | + } | |
1458 | + | |
1459 | + case HUY_GETFILECREATED: // 0x0116 | |
1460 | + { | |
1461 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETFILECREATED / created date [%s]"), | |
1462 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILECREATED, true).c_str()); | |
1463 | + | |
1464 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILECREATED).c_str()); | |
1465 | + } | |
1466 | + | |
1467 | + case HUY_GETFILELASTMOD: // 0x0117 | |
1468 | + { | |
1469 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETFILELASTMOD / last modified date [%s]"), | |
1470 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILELASTMOD, true).c_str()); | |
1471 | + | |
1472 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILELASTMOD).c_str()); | |
1473 | + } | |
1474 | + | |
1475 | + case HUY_ISINMEDIALIB: // 0x0118 | |
1476 | + { | |
1477 | + UINT isInMediaLibrary = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_ISINMEDIALIB); | |
1478 | + | |
1479 | + TRACE_HUYGENS_PROC( | |
1480 | + _T("Probe::huyIpcWindowProc - HUY_ISINMEDIALIB / lossless flag [%u]"), isInMediaLibrary); | |
1481 | + | |
1482 | + return std::make_pair(true, isInMediaLibrary); | |
1483 | + } | |
1484 | + | |
1485 | + case HUY_GETSTATUS: // 0x0200 | |
1486 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETSTATUS / status [%d]"), playStatus); | |
1487 | + return std::make_pair(true, playStatus); | |
1488 | + | |
1489 | + case HUY_GETPOS: // 0x0201 | |
1490 | + | |
1491 | + if(playStatus == PlayInfo::PLAY_START) | |
1492 | + { | |
1493 | +#if IS_FB2K_VER08 | |
1494 | + UINT playPosition = static_cast<UINT>(play_control::get()->get_playback_time() * 1000); | |
1495 | +#else IS_FB2K_VER09 | |
1496 | + UINT playPosition = static_cast<UINT>(static_api_ptr_t<playback_control>()->playback_get_position() * 1000); | |
1497 | +#endif | |
1498 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETPOS / position [%.3f sec.]"), playPosition / 1000.0); | |
1499 | + return std::make_pair(true, playPosition); | |
1500 | + } | |
1501 | + | |
1502 | + return std::make_pair(true, -1); | |
1503 | + | |
1504 | + case HUY_GETREPEAT: // 0x0202 | |
1505 | + { | |
1506 | +#if IS_FB2K_VER08 | |
1507 | + UINT nPlaybackOrder = | |
1508 | + menu_manager::is_command_checked("Playback/Order/Repeat") ? 1 : | |
1509 | + menu_manager::is_command_checked("Playback/Order/Repeat One") ? 2 : 0; | |
1510 | +#else IS_FB2K_VER09 | |
1511 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1512 | + nPlaybackOrder = (nPlaybackOrder >= 1) && (nPlaybackOrder <= 2) ? nPlaybackOrder : 0; | |
1513 | +#endif | |
1514 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETREPEAT / repeat mode [%u]"), nPlaybackOrder); | |
1515 | + return std::make_pair(true, nPlaybackOrder); | |
1516 | + } | |
1517 | + | |
1518 | + case HUY_GETSHUFFLE: // 0x0203 | |
1519 | + { | |
1520 | +#if IS_FB2K_VER08 | |
1521 | + UINT nPlaybackOrder = 0; | |
1522 | +#else IS_FB2K_VER09 | |
1523 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1524 | + nPlaybackOrder = (nPlaybackOrder >= 4) && (nPlaybackOrder <= 6) ? nPlaybackOrder - 3 : 0; | |
1525 | +#endif | |
1526 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETSHUFFLE / shuffle mode [%u]"), nPlaybackOrder); | |
1527 | + return std::make_pair(true, nPlaybackOrder); | |
1528 | + } | |
1529 | + | |
1530 | + case HUY_GETRANDOM: // 0x0204 | |
1531 | + { | |
1532 | +#if IS_FB2K_VER08 | |
1533 | + UINT nPlaybackOrder = menu_manager::is_command_checked("Playback/Order/Random"); | |
1534 | +#else IS_FB2K_VER09 | |
1535 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1536 | + nPlaybackOrder = (nPlaybackOrder == 3) ? 1 : 0; | |
1537 | +#endif | |
1538 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETRANDOM / random mode [%u]"), nPlaybackOrder); | |
1539 | + return std::make_pair(true, nPlaybackOrder); | |
1540 | + } | |
1541 | + | |
1542 | + case HUY_GETPLAYBACKORDER: // 0x0205 | |
1543 | + { | |
1544 | +#if IS_FB2K_VER08 | |
1545 | + UINT nPlaybackOrder = | |
1546 | + menu_manager::is_command_checked("Playback/Order/Repeat") ? 1 : | |
1547 | + menu_manager::is_command_checked("Playback/Order/Random") ? 3 : | |
1548 | + menu_manager::is_command_checked("Playback/Order/Default") ? 0 : | |
1549 | + menu_manager::is_command_checked("Playback/Order/Repeat One") ? 2 : 0; | |
1550 | +#else IS_FB2K_VER09 | |
1551 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1552 | + nPlaybackOrder = (nPlaybackOrder >= 1) && (nPlaybackOrder <= 6) ? nPlaybackOrder : 0; | |
1553 | +#endif | |
1554 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETPLAYBACKORDER / playback order [%u]"), nPlaybackOrder); | |
1555 | + return std::make_pair(true, nPlaybackOrder); | |
1556 | + } | |
1557 | + | |
1558 | + case HUY_GETLISTFOCUSPOS: // 0x0304 | |
1559 | + { | |
1560 | +#if IS_FB2K_VER08 | |
1561 | + int index = playlist_oper::get()->get_focus(); | |
1562 | +#elif IS_FB2K_VER09 | |
1563 | + t_size activeListIndex = static_api_ptr_t<playlist_manager>()->get_active_playlist(); | |
1564 | + t_size index = static_api_ptr_t<playlist_manager>()->playlist_get_focus_item(activeListIndex); | |
1565 | +#endif | |
1566 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETLISTFOCUSPOS / index [%u]"), index); | |
1567 | + return std::make_pair(true, index); | |
1568 | + } | |
1569 | + | |
1570 | + case HUY_GETENTRYTITLE: // 0x0303 | |
1571 | + { | |
1572 | + const string8 &playlistTitle8 = Probe::getInstance()->getPlaylistTitle8(); | |
1573 | + | |
1574 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETENTRYTITLE" | |
1575 | + " / title [%s]", (LPCSTR)playlistTitle8); | |
1576 | + | |
1577 | + return std::make_pair(true, (LRESULT)(LPCSTR)playlistTitle8); | |
1578 | + } | |
1579 | + | |
1580 | + case HUY_PLAY: // 0x0800 | |
1581 | + { | |
1582 | +#if IS_FB2K_VER08 | |
1583 | + bool bRes = true; | |
1584 | + play_control::get()->play_start(); | |
1585 | +#else IS_FB2K_VER09 | |
1586 | + bool bRes = standard_commands::main_play(); | |
1587 | +#endif | |
1588 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_PLAY"); | |
1589 | + | |
1590 | + return std::make_pair(true, bRes ? 0 : -1); | |
1591 | + } | |
1592 | + | |
1593 | + case HUY_PLAYORPAUSE: // 0x0814 | |
1594 | + { | |
1595 | +#if IS_FB2K_VER08 | |
1596 | + bool bRes = true; | |
1597 | + if(play_control::get()->is_paused()) { | |
1598 | + play_control::get()->play_start(); | |
1599 | + } else { | |
1600 | + play_control::get()->pause(); | |
1601 | + } | |
1602 | +#else IS_FB2K_VER09 | |
1603 | + bool bRes = standard_commands::main_play_or_pause(); | |
1604 | +#endif | |
1605 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_PLAYORPAUSE"); | |
1606 | + | |
1607 | + return std::make_pair(true, bRes ? 0 : -1); | |
1608 | + } | |
1609 | + | |
1610 | + case HUY_STOP: // 0x0801 | |
1611 | + { | |
1612 | +#if IS_FB2K_VER08 | |
1613 | + bool bRes = true; | |
1614 | + play_control::get()->play_stop(); | |
1615 | +#else IS_FB2K_VER09 | |
1616 | + bool bRes = standard_commands::main_stop(); | |
1617 | +#endif | |
1618 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_STOP"); | |
1619 | + | |
1620 | + return std::make_pair(true, bRes ? 0 : -1); | |
1621 | + } | |
1622 | + | |
1623 | + case HUY_PAUSE: // 0x0802 | |
1624 | + { | |
1625 | +#if IS_FB2K_VER08 | |
1626 | + bool bRes = true; | |
1627 | + play_control::get()->pause(); | |
1628 | +#else IS_FB2K_VER09 | |
1629 | + bool bRes = standard_commands::main_pause(); | |
1630 | +#endif | |
1631 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_PAUSE"); | |
1632 | + | |
1633 | + return std::make_pair(true, bRes ? 0 : -1); | |
1634 | + } | |
1635 | + | |
1636 | + case HUY_FASTFORWARD: // 0x0803 | |
1637 | + | |
1638 | + if(playStatus == PlayInfo::PLAY_START) | |
1639 | + { | |
1640 | + bool bRes = false; | |
1641 | + static int ffsecs[] = { 1, 5, 10, 30, 60, 120, 300, 600 }; | |
1642 | +#if IS_FB2K_VER08 | |
1643 | + lp = (lp >= 0) && (lp <= 7) ? lp : 0; | |
1644 | + play_control::get()->playback_seek_delta(ffsecs[lp]); | |
1645 | + bRes = true; | |
1646 | +#else IS_FB2K_VER09 | |
1647 | + switch(lp) | |
1648 | + { | |
1649 | + case 0: | |
1650 | + default: | |
1651 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_1s); | |
1652 | + lp = 0; | |
1653 | + break; | |
1654 | + case 1: | |
1655 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_5s); | |
1656 | + break; | |
1657 | + case 2: | |
1658 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_10s); | |
1659 | + break; | |
1660 | + case 3: | |
1661 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_30s); | |
1662 | + break; | |
1663 | + case 4: | |
1664 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_1min); | |
1665 | + break; | |
1666 | + case 5: | |
1667 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_2min); | |
1668 | + break; | |
1669 | + case 6: | |
1670 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_5min); | |
1671 | + break; | |
1672 | + case 7: | |
1673 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_10min); | |
1674 | + break; | |
1675 | + } | |
1676 | +#endif | |
1677 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_FASTFORWARD / seek ahead [%u secs.]", ffsecs[lp]); | |
1678 | + | |
1679 | + return std::make_pair(true, bRes ? 0 : -1); | |
1680 | + } | |
1681 | + | |
1682 | + return std::make_pair(true, -1); | |
1683 | + | |
1684 | + case HUY_REWIND: // 0x0804 | |
1685 | + | |
1686 | + if(playStatus == PlayInfo::PLAY_START) | |
1687 | + { | |
1688 | + bool bRes = false; | |
1689 | + static int rewsecs[] = { 1, 5, 10, 30, 60, 120, 300, 600 }; | |
1690 | +#if IS_FB2K_VER08 | |
1691 | + lp = (lp >= 0) && (lp <= 7) ? lp : 0; | |
1692 | + play_control::get()->playback_seek_delta(-rewsecs[lp]); | |
1693 | + bRes = true; | |
1694 | +#else IS_FB2K_VER09 | |
1695 | + switch(lp) | |
1696 | + { | |
1697 | + case 0: | |
1698 | + default: | |
1699 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_1s); | |
1700 | + lp = 0; | |
1701 | + break; | |
1702 | + case 1: | |
1703 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_5s); | |
1704 | + break; | |
1705 | + case 2: | |
1706 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_10s); | |
1707 | + break; | |
1708 | + case 3: | |
1709 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_30s); | |
1710 | + break; | |
1711 | + case 4: | |
1712 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_1min); | |
1713 | + break; | |
1714 | + case 5: | |
1715 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_2min); | |
1716 | + break; | |
1717 | + case 6: | |
1718 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_5min); | |
1719 | + break; | |
1720 | + case 7: | |
1721 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_10min); | |
1722 | + break; | |
1723 | + } | |
1724 | +#endif | |
1725 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_REWIND / seek back [%u sec.]", rewsecs[lp]); | |
1726 | + | |
1727 | + return std::make_pair(true, bRes ? 0 : -1); | |
1728 | + } | |
1729 | + | |
1730 | + return std::make_pair(true, -1); | |
1731 | + | |
1732 | + case HUY_PREVIOUS: // 0x0807 | |
1733 | + { | |
1734 | +#if IS_FB2K_VER08 | |
1735 | + bool bRes = true; | |
1736 | + play_control::get()->play_start(play_control::TRACK_COMMAND_PREV); | |
1737 | +#else IS_FB2K_VER09 | |
1738 | + bool bRes = standard_commands::main_previous(); | |
1739 | +#endif | |
1740 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_PREVIOUS"); | |
1741 | + | |
1742 | + return std::make_pair(true, bRes ? 0 : -1); | |
1743 | + } | |
1744 | + | |
1745 | + case HUY_NEXT: // 0x0808 | |
1746 | + { | |
1747 | +#if IS_FB2K_VER08 | |
1748 | + bool bRes = true; | |
1749 | + play_control::get()->play_start (play_control::TRACK_COMMAND_NEXT); | |
1750 | +#else IS_FB2K_VER09 | |
1751 | + bool bRes = standard_commands::main_next(); | |
1752 | +#endif | |
1753 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_NEXT"); | |
1754 | + | |
1755 | + return std::make_pair(true, bRes ? 0 : -1); | |
1756 | + } | |
1757 | + | |
1758 | + case HUY_SEEK: // 0x0809 | |
1759 | + | |
1760 | + if(playStatus == PlayInfo::PLAY_START) | |
1761 | + { | |
1762 | + double jumpPos = wp / 1000.0; | |
1763 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_SEEK") | |
1764 | + _T(" / jump to [%.3f sec.]"), jumpPos); | |
1765 | + | |
1766 | + if(jumpPos > playLength) | |
1767 | + { | |
1768 | + // eof | |
1769 | + return std::make_pair(true, 1); | |
1770 | + } | |
1771 | + else | |
1772 | + { | |
1773 | +#if IS_FB2K_VER08 | |
1774 | + play_control::get()->playback_seek(jumpPos); | |
1775 | +#else IS_FB2K_VER09 | |
1776 | + static_api_ptr_t<playback_control>()->playback_seek(jumpPos); | |
1777 | +#endif | |
1778 | + return std::make_pair(true, 0); | |
1779 | + } | |
1780 | + | |
1781 | + } | |
1782 | + | |
1783 | + return std::make_pair(true, -1); | |
1784 | + | |
1785 | + case HUY_VOLUMEUP: // 0x080B | |
1786 | + { | |
1787 | +#if IS_FB2K_VER08 | |
1788 | + bool bRes = true; | |
1789 | + play_control::get()->volume_up(); | |
1790 | +#else IS_FB2K_VER09 | |
1791 | + bool bRes = standard_commands::main_volume_up(); | |
1792 | +#endif | |
1793 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_VOLUMEUP"); | |
1794 | + | |
1795 | + return std::make_pair(true, bRes ? 0 : -1); | |
1796 | + } | |
1797 | + | |
1798 | + case HUY_VOLUMEDOWN: // 0x080C | |
1799 | + { | |
1800 | +#if IS_FB2K_VER08 | |
1801 | + bool bRes = true; | |
1802 | + play_control::get()->volume_down(); | |
1803 | +#else IS_FB2K_VER09 | |
1804 | + bool bRes = standard_commands::main_volume_down(); | |
1805 | +#endif | |
1806 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_VOLUMEDOWN"); | |
1807 | + | |
1808 | + return std::make_pair(true, bRes ? 0 : -1); | |
1809 | + } | |
1810 | + | |
1811 | + case HUY_SETREPEAT: // 0x080F | |
1812 | + { | |
1813 | + static LPCSTR modes[] = { "default", "repeat playlist", "repeat track" }; | |
1814 | + lp = (lp >= 0) && (lp <= 2) ? lp : 0; | |
1815 | +#if IS_FB2K_VER08 | |
1816 | + bool bRes = false; | |
1817 | + switch(lp) | |
1818 | + { | |
1819 | + case 0: | |
1820 | + default: | |
1821 | + bRes = menu_manager::run_command("Playback/Order/Default"); | |
1822 | + break; | |
1823 | + case 1: | |
1824 | + bRes = menu_manager::run_command("Playback/Order/Repeat"); | |
1825 | + break; | |
1826 | + case 2: | |
1827 | + bRes = menu_manager::run_command("Playback/Order/Repeat One"); | |
1828 | + break; | |
1829 | + } | |
1830 | +#else IS_FB2K_VER09 | |
1831 | + bool bRes = true; | |
1832 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(lp); | |
1833 | +#endif | |
1834 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_SETREPEAT / repeat mode [%s]", modes[lp]); | |
1835 | + | |
1836 | + return std::make_pair(true, bRes ? 0 : -1); | |
1837 | + } | |
1838 | + | |
1839 | + case HUY_SETSHUFFLE: // 0x0810 | |
1840 | + { | |
1841 | + static LPCSTR modes[] = { "default", "shuffle tracks", "shuffle albums", "shuffle folders" }; | |
1842 | + lp = (lp >= 1) && (lp <= 3) ? lp : 0; | |
1843 | + | |
1844 | +#if IS_FB2K_VER08 | |
1845 | + return std::make_pair(true, -1); | |
1846 | +#else IS_FB2K_VER09 | |
1847 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active((lp >= 1) && (lp <= 3) ? lp + 3 : 0); | |
1848 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_SETSHUFFLE / shuffle mode [%s]", modes[lp]); | |
1849 | + | |
1850 | + return std::make_pair(true, 0); | |
1851 | +#endif | |
1852 | + } | |
1853 | + | |
1854 | + case HUY_SETRANDOM: // 0x080E | |
1855 | + { | |
1856 | + static LPCSTR modes[] = { "default", "random" }; | |
1857 | +#if IS_FB2K_VER08 | |
1858 | + bool bRes = false; | |
1859 | + bRes = menu_manager::run_command("Playback/Order/Random"); | |
1860 | + if(lp != 1) { | |
1861 | + lp = 0; | |
1862 | + } | |
1863 | +#else IS_FB2K_VER09 | |
1864 | + bool bRes = true; | |
1865 | + switch(lp) | |
1866 | + { | |
1867 | + case 0: | |
1868 | + default: | |
1869 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(0); | |
1870 | + lp = 0; | |
1871 | + break; | |
1872 | + case 1: | |
1873 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(3); | |
1874 | + break; | |
1875 | + } | |
1876 | +#endif | |
1877 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_SETRANDOM / random mode [%s]", modes[lp]); | |
1878 | + | |
1879 | + return std::make_pair(true, bRes ? 0 : -1); | |
1880 | + } | |
1881 | + | |
1882 | + case HUY_SETPLAYBACKORDER: // 0x0815 | |
1883 | + { | |
1884 | + static LPCSTR modes[] = { "default", "repeat playlist", "repeat track", "random", "shuffle tracks", "shuffle albums", "shuffle folders" }; | |
1885 | +#if IS_FB2K_VER08 | |
1886 | + bool bRes = false; | |
1887 | + switch(lp) | |
1888 | + { | |
1889 | + case 0: | |
1890 | + default: | |
1891 | + bRes = menu_manager::run_command("Playback/Order/Default"); | |
1892 | + lp = 0; | |
1893 | + break; | |
1894 | + case 1: | |
1895 | + bRes = menu_manager::run_command("Playback/Order/Repeat"); | |
1896 | + break; | |
1897 | + case 2: | |
1898 | + bRes = menu_manager::run_command("Playback/Order/Repeat One"); | |
1899 | + break; | |
1900 | + case 3: | |
1901 | + bRes = menu_manager::run_command("Playback/Order/Random"); | |
1902 | + break; | |
1903 | + } | |
1904 | +#else IS_FB2K_VER09 | |
1905 | + bool bRes = true; | |
1906 | + lp = (lp >= 0) && (lp <= 6) ? lp : 0; | |
1907 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(lp); | |
1908 | +#endif | |
1909 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_SETPLAYBACKORDER / repeat mode [%s]", modes[lp]); | |
1910 | + | |
1911 | + return std::make_pair(true, bRes ? 0 : -1); | |
1912 | + } | |
1913 | + | |
1914 | + case HUY_TOGGLEREPEAT: // 0x0812 | |
1915 | + { | |
1916 | + bool bRes = false; | |
1917 | + static LPCSTR modes[] = { "repeat track", "repeat playlist", "default" }; | |
1918 | +#if IS_FB2K_VER08 | |
1919 | + UINT nPlaybackOrder = menu_manager::is_command_checked("Playback/Order/Repeat") ? 1 : | |
1920 | + menu_manager::is_command_checked("Playback/Order/Repeat One") ? 2 : 0; | |
1921 | + switch(nPlaybackOrder) | |
1922 | + { | |
1923 | + case 0: | |
1924 | + default: | |
1925 | + bRes = menu_manager::run_command("Playback/Order/Repeat"); | |
1926 | + break; | |
1927 | + case 1: | |
1928 | + bRes = menu_manager::run_command("Playback/Order/Repeat One"); | |
1929 | + break; | |
1930 | + case 2: | |
1931 | + bRes = menu_manager::run_command("Playback/Order/Default"); | |
1932 | + break; | |
1933 | + } | |
1934 | +#else IS_FB2K_VER09 | |
1935 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1936 | + nPlaybackOrder = (nPlaybackOrder >= 1) && (nPlaybackOrder <= 2) ? 3 - nPlaybackOrder : 0; | |
1937 | + | |
1938 | + switch(nPlaybackOrder) | |
1939 | + { | |
1940 | + case 0: | |
1941 | + default: | |
1942 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(1); | |
1943 | + break; | |
1944 | + case 1: | |
1945 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(2); | |
1946 | + break; | |
1947 | + case 2: | |
1948 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(0); | |
1949 | + break; | |
1950 | + } | |
1951 | +#endif | |
1952 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_TOGGLEREPEAT / repeat mode [%s]", modes[nPlaybackOrder]); | |
1953 | + | |
1954 | + return std::make_pair(true, bRes ? 0 : -1); | |
1955 | + } | |
1956 | + | |
1957 | + case HUY_TOGGLESHUFFLE: // 0x0813 | |
1958 | + { | |
1959 | + bool bRes = false; | |
1960 | + static LPCSTR modes[] = { "shuffle tracks", "shuffle albums", "shuffle folders", "default" }; | |
1961 | +#if IS_FB2K_VER08 | |
1962 | + return std::make_pair(true, -1); | |
1963 | +#else IS_FB2K_VER09 | |
1964 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1965 | + nPlaybackOrder = (nPlaybackOrder >= 4) && (nPlaybackOrder <= 6) ? nPlaybackOrder - 3 : 0; | |
1966 | + | |
1967 | + switch(nPlaybackOrder) | |
1968 | + { | |
1969 | + case 0: | |
1970 | + default: | |
1971 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(4); | |
1972 | + break; | |
1973 | + case 1: | |
1974 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(5); | |
1975 | + break; | |
1976 | + case 2: | |
1977 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(6); | |
1978 | + break; | |
1979 | + case 3: | |
1980 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(0); | |
1981 | + break; | |
1982 | + } | |
1983 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_TOGGLESHUFFLE / shuffle mode [%s]", modes[nPlaybackOrder]); | |
1984 | + | |
1985 | + return std::make_pair(true, bRes ? 0 : -1); | |
1986 | +#endif | |
1987 | + } | |
1988 | + | |
1989 | + case HUY_TOGGLERANDOM: // 0x0811 | |
1990 | + { | |
1991 | + static LPCSTR modes[] = { "randome", "default" }; | |
1992 | +#if IS_FB2K_VER08 | |
1993 | + bool bRes = false; | |
1994 | + UINT nPlaybackOrder = menu_manager::is_command_checked ("Playback/Order/Random") ? 1 : 0; | |
1995 | + switch(nPlaybackOrder) | |
1996 | + { | |
1997 | + case 0: | |
1998 | + default: | |
1999 | + bRes = menu_manager::run_command("Playback/Order/Random"); | |
2000 | + break; | |
2001 | + case 1: | |
2002 | + bRes = menu_manager::run_command("Playback/Order/Default"); | |
2003 | + break; | |
2004 | + } | |
2005 | +#else IS_FB2K_VER09 | |
2006 | + bool bRes = true; | |
2007 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
2008 | + nPlaybackOrder = (nPlaybackOrder == 3) ? 1 : 0; | |
2009 | + | |
2010 | + switch(nPlaybackOrder) | |
2011 | + { | |
2012 | + case 0: | |
2013 | + default: | |
2014 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(3); | |
2015 | + break; | |
2016 | + case 1: | |
2017 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(0); | |
2018 | + break; | |
2019 | + } | |
2020 | +#endif | |
2021 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_TOGGLERANDOM / random mode [%s]"), modes[nPlaybackOrder]); | |
2022 | + return std::make_pair(true, bRes ? 0 : -1); | |
2023 | + } | |
2024 | + | |
2025 | + case HUY_TOGGLEPLAYBACKORDER: // 0x0816 | |
2026 | + { | |
2027 | +#if IS_FB2K_VER08 | |
2028 | + static LPCSTR modes[] = { "repeat playlist", "repeat track", "random", "default" }; | |
2029 | + bool bRes = false; | |
2030 | + UINT nPlaybackOrder = | |
2031 | + menu_manager::is_command_checked("Playback/Order/Repeat") ? 1 : | |
2032 | + menu_manager::is_command_checked("Playback/Order/Random") ? 3 : | |
2033 | + menu_manager::is_command_checked("Playback/Order/Default") ? 0 : | |
2034 | + menu_manager::is_command_checked("Playback/Order/Repeat One") ? 2 : 0; | |
2035 | + | |
2036 | + switch(nPlaybackOrder) | |
2037 | + { | |
2038 | + case 0: | |
2039 | + default: | |
2040 | + bRes = menu_manager::run_command("Playback/Order/Repeat"); | |
2041 | + break; | |
2042 | + case 1: | |
2043 | + bRes = menu_manager::run_command("Playback/Order/Repeat One"); | |
2044 | + break; | |
2045 | + case 2: | |
2046 | + bRes = menu_manager::run_command("Playback/Order/Random"); | |
2047 | + break; | |
2048 | + case 3: | |
2049 | + bRes = menu_manager::run_command("Playback/Order/Default"); | |
2050 | + break; | |
2051 | + } | |
2052 | +#else IS_FB2K_VER09 | |
2053 | + static LPCSTR modes[] = { "repeat playlist", "repeat track", "random", "shuffle tracks", "shuffle albums", "shuffle folders", "default" }; | |
2054 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
2055 | + nPlaybackOrder = (nPlaybackOrder >= 1) && (nPlaybackOrder <= 6) ? (nPlaybackOrder + 1) % 6 : 1; | |
2056 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(nPlaybackOrder); | |
2057 | +#endif | |
2058 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_TOGGLEPLAYBACKORDER / playback order [%u]"), nPlaybackOrder); | |
2059 | + return std::make_pair(true, nPlaybackOrder); | |
2060 | + } | |
2061 | + | |
2062 | + case HUY_REFRESHLISTINFO: // 0x0A00 | |
2063 | + { | |
2064 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_REFRESHLISTINFO / refresh internal playlist informations.")); | |
2065 | + | |
2066 | + // make playlist info formats array | |
2067 | + std::vector<std::string> plStrKeys, plNumKeys; | |
2068 | + | |
2069 | + plStrKeys.push_back(FORMAT_PLAYLIST_NAME); | |
2070 | + | |
2071 | + plNumKeys.push_back(FORMAT_LISTINDEX); | |
2072 | + plNumKeys.push_back(FORMAT_LISTTOTAL); | |
2073 | + | |
2074 | + // set current track informations | |
2075 | + TRACK_INFO8 trackInfo8(Probe::getInstance()->getTrackInfo8()); | |
2076 | + | |
2077 | + trackInfo8.setPlaylistStrings(plStrKeys); | |
2078 | + trackInfo8.setPlaylistNumbers(plNumKeys); | |
2079 | + | |
2080 | + Probe::getInstance()->setTrackInfo8(trackInfo8); | |
2081 | + | |
2082 | + // refresh huygens title | |
2083 | + Probe::getInstance()->refreshTitle(); | |
2084 | + | |
2085 | + return std::make_pair(true, 0); | |
2086 | + } | |
2087 | + | |
2088 | + case HUY_REFRESHDYNINFO: // 0x0A01 | |
2089 | + { | |
2090 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_REFRESHDYNINFO / refresh internal dynamic informations.")); | |
2091 | + | |
2092 | + // make dynamic info formats array | |
2093 | + std::vector<std::string> dynStrKeys, dynNumKeys; | |
2094 | + | |
2095 | + dynStrKeys.push_back(FORMAT_ARTIST); | |
2096 | + dynStrKeys.push_back(FORMAT_TRACKTITLE); | |
2097 | + dynStrKeys.push_back(FORMAT_ALBUMTITLE); | |
2098 | + dynStrKeys.push_back(FORMAT_GENRE); | |
2099 | + dynStrKeys.push_back(FORMAT_TRACKDATE); | |
2100 | + dynStrKeys.push_back(FORMAT_COMPOSER); | |
2101 | + dynStrKeys.push_back(FORMAT_PERFORMER); | |
2102 | + dynStrKeys.push_back(FORMAT_ALBUMARTIST); | |
2103 | + dynStrKeys.push_back(FORMAT_TRACKARTIST); | |
2104 | + dynStrKeys.push_back(FORMAT_COMMENT); | |
2105 | + | |
2106 | + dynStrKeys.push_back(FORMAT_LENGTHSAMPLES); | |
2107 | + | |
2108 | + dynNumKeys.push_back(FORMAT_SUBSONG); | |
2109 | + dynNumKeys.push_back(FORMAT_TRACKNUMBER); | |
2110 | + dynNumKeys.push_back(FORMAT_TRACKTOTAL); | |
2111 | + dynNumKeys.push_back(FORMAT_DISCNUMBER); | |
2112 | + dynNumKeys.push_back(FORMAT_DISCTOTAL); | |
2113 | + | |
2114 | + dynNumKeys.push_back(FORMAT_BITRATE_DYNAMIC); | |
2115 | + | |
2116 | + // set current track informations | |
2117 | + TRACK_INFO8 trackInfo8(Probe::getInstance()->getTrackInfo8()); | |
2118 | + | |
2119 | + trackInfo8.setDynamicStrings(dynStrKeys); | |
2120 | + trackInfo8.setDynamicNumbers(dynNumKeys); | |
2121 | + | |
2122 | + Probe::getInstance()->setTrackInfo8(trackInfo8); | |
2123 | + | |
2124 | + // refresh huygens title | |
2125 | + Probe::getInstance()->refreshTitle(); | |
2126 | + | |
2127 | + return std::make_pair(true, 0); | |
2128 | + } | |
2129 | + | |
2130 | + default: | |
2131 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - WM_HUY_IPC (Unknown IPC command) / W:%08x, L:%08x"), wp, lp); | |
2132 | + break; | |
2133 | + } | |
2134 | + } | |
2135 | + break; | |
2136 | + } | |
2137 | + | |
2138 | + return std::make_pair(false, 0); | |
2139 | +} | |
2140 | + | |
2141 | +#if IS_FB2K_VER08 | |
2142 | +class play_callback_huygens : public play_callback | |
2143 | +#elif IS_FB2K_VER09 | |
2144 | +class play_callback_huygens : public play_callback_static | |
2145 | +#endif | |
2146 | +{ | |
2147 | +#if IS_FB2K_VER09 | |
2148 | + virtual unsigned get_flags() { | |
2149 | + return flag_on_playback_all; | |
2150 | + } | |
2151 | +#endif | |
2152 | + | |
2153 | +#if IS_FB2K_VER08 | |
2154 | + virtual void on_playback_starting() | |
2155 | +#elif IS_FB2K_VER09 | |
2156 | + virtual void on_playback_starting(play_control::t_track_command command, bool paused) | |
2157 | +#endif | |
2158 | + { | |
2159 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_starting - called.")); | |
2160 | + } | |
2161 | + | |
2162 | +#if IS_FB2K_VER08 | |
2163 | + virtual void on_playback_new_track(metadb_handle * track) | |
2164 | +#elif IS_FB2K_VER09 | |
2165 | + virtual void on_playback_new_track(metadb_handle_ptr track) | |
2166 | +#endif | |
2167 | + { | |
2168 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_new_track - called.")); | |
2169 | + | |
2170 | + // make currently playbacked track information keys | |
2171 | + std::vector<std::string> strKeys; | |
2172 | + std::vector<std::string> numKeys; | |
2173 | + | |
2174 | + strKeys.push_back(FORMAT_FB2KVERSION); | |
2175 | + strKeys.push_back(FORMAT_FILEPATH); | |
2176 | + strKeys.push_back(FORMAT_FILEPATHRAW); | |
2177 | + strKeys.push_back(FORMAT_ARTIST); | |
2178 | + strKeys.push_back(FORMAT_TRACKTITLE); | |
2179 | + strKeys.push_back(FORMAT_ALBUMTITLE); | |
2180 | + strKeys.push_back(FORMAT_GENRE); | |
2181 | + strKeys.push_back(FORMAT_TRACKDATE); | |
2182 | + strKeys.push_back(FORMAT_COMPOSER); | |
2183 | + strKeys.push_back(FORMAT_PERFORMER); | |
2184 | + strKeys.push_back(FORMAT_ALBUMARTIST); | |
2185 | + strKeys.push_back(FORMAT_TRACKARTIST); | |
2186 | + strKeys.push_back(FORMAT_COMMENT); | |
2187 | + strKeys.push_back(FORMAT_CODEC); | |
2188 | + strKeys.push_back(FORMAT_CODECPROFILE); | |
2189 | + strKeys.push_back(FORMAT_TAGTYPE); | |
2190 | + strKeys.push_back(FORMAT_EXTRAINFO); | |
2191 | + strKeys.push_back(FORMAT_TOOL); | |
2192 | + strKeys.push_back(FORMAT_AUDIOMD5HASH); | |
2193 | + strKeys.push_back(FORMAT_APEVERSION); | |
2194 | + strKeys.push_back(FORMAT_APEFLAGS); | |
2195 | + | |
2196 | + strKeys.push_back(FORMAT_FILESIZE); | |
2197 | +// strKeys.push_back(FORMAT_FILECREATED); | |
2198 | +// strKeys.push_back(FORMAT_FILELASTMOD); | |
2199 | + | |
2200 | + numKeys.push_back(FORMAT_SUBSONG); | |
2201 | + numKeys.push_back(FORMAT_TRACKNUMBER); | |
2202 | + numKeys.push_back(FORMAT_TRACKTOTAL); | |
2203 | + numKeys.push_back(FORMAT_DISCNUMBER); | |
2204 | + numKeys.push_back(FORMAT_DISCTOTAL); | |
2205 | + numKeys.push_back(FORMAT_SAMPLERATE); | |
2206 | + | |
2207 | + numKeys.push_back(FORMAT_BITRATE); | |
2208 | + numKeys.push_back(FORMAT_BITRATE_NOMINAL); | |
2209 | + numKeys.push_back(FORMAT_CHANNELS); | |
2210 | + numKeys.push_back(FORMAT_BITSPERSAMPLE); | |
2211 | + numKeys.push_back(FORMAT_LOSSLESS); | |
2212 | + numKeys.push_back(FORMAT_CUEEMBEDDED); | |
2213 | + numKeys.push_back(FORMAT_MP3STEREOMODE); | |
2214 | + numKeys.push_back(FORMAT_MP3ACCURATELENGTH); | |
2215 | + numKeys.push_back(FORMAT_MP3ENCDELAY); | |
2216 | + numKeys.push_back(FORMAT_MP3ENCPADDING); | |
2217 | + | |
2218 | + numKeys.push_back(FORMAT_REPLAYGAIN_ALBUMGAIN); | |
2219 | + numKeys.push_back(FORMAT_REPLAYGAIN_ALBUMPEEK); | |
2220 | + numKeys.push_back(FORMAT_REPLAYGAIN_TRACKGAIN); | |
2221 | + numKeys.push_back(FORMAT_REPLAYGAIN_TRACKPEEK); | |
2222 | + | |
2223 | + // set current track informations | |
2224 | + m_trackInfo8.clear(); | |
2225 | + m_trackInfo8.setStrings(strKeys, track); | |
2226 | + m_trackInfo8.setNumbers(numKeys, track); | |
2227 | + | |
2228 | + // is playback track in media library? | |
2229 | +#if IS_FB2K_VER08 | |
2230 | + m_trackInfo8.putNumber(FORMAT_ISINMEDIALIB, track->handle_is_permcached()); | |
2231 | +#elif IS_FB2K_VER09 | |
2232 | + m_trackInfo8.putNumber(FORMAT_ISINMEDIALIB, static_api_ptr_t<library_manager>()->is_item_in_library(track) ? 1 : 0); | |
2233 | +#endif | |
2234 | + | |
2235 | + // get song total length | |
2236 | +#if IS_FB2K_VER08 | |
2237 | + double total_sec = track->handle_get_length(); | |
2238 | +#elif IS_FB2K_VER09 | |
2239 | + double total_sec = track->get_length(); | |
2240 | +#endif | |
2241 | + | |
2242 | + // set file created and last modifed datetime | |
2243 | +#if IS_FB2K_VER08 | |
2244 | + putFileInfo(track->handle_get_path()); | |
2245 | +#elif IS_FB2K_VER09 | |
2246 | + putFileInfo(track->get_path()); | |
2247 | +#endif | |
2248 | + | |
2249 | + // set trackinfo to huygens | |
2250 | + Probe::getInstance()->setTrackInfo8(m_trackInfo8); | |
2251 | + | |
2252 | + // clear playinfo on huygens | |
2253 | + Probe::getInstance()->getPlayInfo().clearPlayInfo(); | |
2254 | + | |
2255 | + // set huygens status PLAY_START | |
2256 | + Probe::getInstance()->getPlayInfo().setPlayStatusStart(); | |
2257 | + | |
2258 | + // set song total length | |
2259 | + Probe::getInstance()->getPlayInfo().setPlayLength(total_sec); | |
2260 | + | |
2261 | + // increment play counter on huygens | |
2262 | + Probe::getInstance()->getPlayInfo().incrementPlayCount(); | |
2263 | + | |
2264 | + // post HUY_REFRESHLISTINFO | |
2265 | + ::PostMessage(Probe::getInstance()->getWnd(), WM_HUY_IPC, 0, HUY_REFRESHLISTINFO); | |
2266 | + DEBUG_CALLBACK(_T("play_callback_huygens::on_playback_new_track - HUY_REFRESHLISTINFO posted.")); | |
2267 | + } | |
2268 | + | |
2269 | +#if IS_FB2K_VER08 | |
2270 | + virtual void on_playback_stop(play_control::stop_reason reason) | |
2271 | +#elif IS_FB2K_VER09 | |
2272 | + virtual void on_playback_stop(play_control::t_stop_reason reason) | |
2273 | +#endif | |
2274 | + { | |
2275 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_stop - called.")); | |
2276 | + | |
2277 | + // set huygens status PLAY_STOP | |
2278 | + Probe::getInstance()->getPlayInfo().setPlayStatusStop(); | |
2279 | + | |
2280 | + // clear huygens title | |
2281 | + Probe::getInstance()->clearProbeTitle(); | |
2282 | + } | |
2283 | + | |
2284 | + virtual void on_playback_seek(double time) // time is second. | |
2285 | + { | |
2286 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_seek - called.")); | |
2287 | + | |
2288 | + // update current position on huygens | |
2289 | + Probe::getInstance()->getPlayInfo().setPlayPosition((int)(time * 1000)); | |
2290 | + } | |
2291 | + | |
2292 | +#if IS_FB2K_VER08 | |
2293 | + virtual void on_playback_pause(int state) | |
2294 | +#elif IS_FB2K_VER09 | |
2295 | + virtual void on_playback_pause(bool state) | |
2296 | +#endif | |
2297 | + { | |
2298 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_pause - called.")); | |
2299 | + | |
2300 | +#if IS_FB2K_VER08 | |
2301 | + if(state == 1) | |
2302 | +#elif IS_FB2K_VER09 | |
2303 | + if(state == true) | |
2304 | +#endif | |
2305 | + { | |
2306 | + // set huygens status PLAY_PAUSE | |
2307 | + Probe::getInstance()->getPlayInfo().setPlayStatusPause(); | |
2308 | + | |
2309 | + DEBUG_CALLBACK(_T("play_callback_huygens::on_playback_pause - fb2k paused.")); | |
2310 | + } | |
2311 | + else | |
2312 | + { | |
2313 | + // set huygens status PLAY_START | |
2314 | + Probe::getInstance()->getPlayInfo().setPlayStatusStart(); | |
2315 | + | |
2316 | + DEBUG_CALLBACK(_T("play_callback_huygens::on_playback_pause - fb2k unpaused.")); | |
2317 | + } | |
2318 | + } | |
2319 | + | |
2320 | +#if IS_FB2K_VER08 | |
2321 | + virtual void on_playback_edited(metadb_handle * track){}//currently played file got edited | |
2322 | +#elif IS_FB2K_VER09 | |
2323 | + virtual void on_playback_edited(metadb_handle_ptr track){}//currently played file got edited | |
2324 | +#endif | |
2325 | + | |
2326 | +#if IS_FB2K_VER08 | |
2327 | + virtual void on_playback_dynamic_info(const file_info * info,bool b_track_change) | |
2328 | +#elif IS_FB2K_VER09 | |
2329 | + virtual void on_playback_dynamic_info(const file_info & info) | |
2330 | +#endif | |
2331 | + { | |
2332 | + if(cfg_use_plugin == 0) { | |
2333 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_dynamic_info - called.")); | |
2334 | + return ; | |
2335 | + } | |
2336 | + | |
2337 | +#if IS_FB2K_VER08 | |
2338 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_dynamic_info - HUY_REFRESHDYNINFO posted.")); | |
2339 | + ::PostMessage(Probe::getInstance()->getWnd(), WM_HUY_IPC, 0, HUY_REFRESHDYNINFO); | |
2340 | +#endif | |
2341 | + } | |
2342 | + | |
2343 | +#if IS_FB2K_VER09 | |
2344 | + virtual void on_playback_dynamic_info_track(const file_info & p_info) | |
2345 | + { | |
2346 | + if(cfg_use_plugin == 0) { | |
2347 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_dynamic_info_track - called.")); | |
2348 | + return ; | |
2349 | + } | |
2350 | + | |
2351 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_dynamic_info_track - HUY_REFRESHDYNINFO posted.")); | |
2352 | + ::PostMessage(Probe::getInstance()->getWnd(), WM_HUY_IPC, 0, HUY_REFRESHDYNINFO); | |
2353 | + } | |
2354 | +#endif | |
2355 | + | |
2356 | +#if IS_FB2K_VER08 | |
2357 | + virtual void on_playback_time(metadb_handle * track, double time)//called every second | |
2358 | +#elif IS_FB2K_VER09 | |
2359 | + virtual void on_playback_time(double time)//called every second | |
2360 | +#endif | |
2361 | + { | |
2362 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_time - called.")); | |
2363 | + | |
2364 | + // update current position on huygens | |
2365 | + Probe::getInstance()->getPlayInfo().setPlayPosition((int)(time * 1000)); | |
2366 | + } | |
2367 | + | |
2368 | +#if IS_FB2K_VER09 | |
2369 | + // User changed volume settings. Possibly called when not playing. | |
2370 | + virtual void on_volume_change(float new_val) {} | |
2371 | +#endif | |
2372 | + | |
2373 | +protected: | |
2374 | + | |
2375 | + void putFileInfo(const std::string &rawFilePath8) | |
2376 | + { | |
2377 | + std::string localFilePath8 = getLocalFilePath(rawFilePath8); | |
2378 | + | |
2379 | + if(localFilePath8.empty() == false) | |
2380 | + { | |
2381 | + WIN32_FIND_DATA wfd; | |
2382 | + | |
2383 | + // ファイル検索API関数によりファイル日時を取得 | |
2384 | + string_os_from_utf8 localFilePathOS(localFilePath8.c_str()); | |
2385 | + | |
2386 | + HANDLE hFindFirstFile = ::FindFirstFile(localFilePathOS, &wfd); | |
2387 | + if(hFindFirstFile != INVALID_HANDLE_VALUE) { | |
2388 | + | |
2389 | + // ハンドルを閉じる | |
2390 | + ::FindClose(hFindFirstFile); | |
2391 | + | |
2392 | + // ファイル作成日時 | |
2393 | + putFileTime(FORMAT_FILECREATED, wfd.ftCreationTime); | |
2394 | + | |
2395 | + // ファイル最終書込日時 | |
2396 | + putFileTime(FORMAT_FILELASTMOD, wfd.ftLastWriteTime); | |
2397 | + | |
2398 | + } else { | |
2399 | + | |
2400 | + putLogError(_T("play_callback_huygens::putFileInfo"), | |
2401 | + _T("ファイル日時属性の取得(FindFirstFile)に失敗しました"), ::GetLastError()); | |
2402 | + } | |
2403 | + } | |
2404 | + } | |
2405 | + | |
2406 | + static std::string getLocalFilePath(const std::string &rawFilePath) | |
2407 | + { | |
2408 | + std::string filePath; | |
2409 | + | |
2410 | + bool isFileProtocol = rawFilePath.find(FILE_PROTOCOL) != std::string::npos; | |
2411 | + | |
2412 | + if(isFileProtocol) | |
2413 | + { | |
2414 | + filePath = rawFilePath.substr(::lstrlenA(FILE_PROTOCOL)); | |
2415 | + } | |
2416 | + else if(rawFilePath.length() >= 3) | |
2417 | + { | |
2418 | + LPCSTR pRawFilePath = rawFilePath.c_str(); | |
2419 | + bool isDriveName = ::isalpha(pRawFilePath[0]) && (pRawFilePath[1] == ':') && (pRawFilePath[2] == '\\'); | |
2420 | + | |
2421 | + if(isDriveName) | |
2422 | + { | |
2423 | + filePath = rawFilePath.substr(::lstrlenA(FILE_PROTOCOL)); | |
2424 | + } | |
2425 | + } | |
2426 | + | |
2427 | + return filePath; | |
2428 | + } | |
2429 | + | |
2430 | + void putFileTime(LPCSTR key, const FILETIME &fileTime) | |
2431 | + { | |
2432 | + SYSTEMTIME systemTime; | |
2433 | + FileTimeToSystemTime(&fileTime, &systemTime); | |
2434 | + | |
2435 | + StrDBCS64K formattedTime; | |
2436 | + | |
2437 | + //DEBUG_CALLBACK(_T("putFileTime - FILETIME: H-%lu, L-%lu"), fileTime.dwHighDateTime, fileTime.dwLowDateTime); | |
2438 | + | |
2439 | + sprintf_s(formattedTime, sizeof(StrDBCS64K), "%04d%02d%02d%02d%02d%02d.%03d%03d%1d00", | |
2440 | + systemTime.wYear, systemTime.wMonth, systemTime.wDay, | |
2441 | + systemTime.wHour, systemTime.wMinute, systemTime.wSecond, | |
2442 | + systemTime.wMilliseconds, | |
2443 | + (fileTime.dwLowDateTime / 10 % 1000), // microseconds | |
2444 | + fileTime.dwLowDateTime % 10 // nanoseconds | |
2445 | + ); | |
2446 | + | |
2447 | + m_trackInfo8.putString(key, formattedTime); | |
2448 | + } | |
2449 | + | |
2450 | +protected: | |
2451 | + | |
2452 | + TRACK_INFO8 m_trackInfo8; | |
2453 | +}; | |
2454 | + | |
2455 | + | |
2456 | +class initquit_send : public initquit | |
2457 | +{ | |
2458 | + typedef std::auto_ptr<Probe> ProbeAutoPtr; | |
2459 | + ProbeAutoPtr m_apProbe; | |
2460 | + | |
2461 | + virtual void on_init() | |
2462 | + { | |
2463 | + m_apProbe = ProbeAutoPtr(Probe::getInstance()); | |
2464 | + m_apProbe->load(); | |
2465 | + } | |
2466 | + | |
2467 | + virtual void on_quit() | |
2468 | + { | |
2469 | + m_apProbe->release(); | |
2470 | + { | |
2471 | + ProbeAutoPtr sink(m_apProbe); | |
2472 | + } | |
2473 | + } | |
2474 | + | |
2475 | + virtual void on_system_shutdown() | |
2476 | + { | |
2477 | + on_quit(); | |
2478 | + } | |
2479 | +}; | |
2480 | + | |
2481 | +#if IS_FB2K_VER08 | |
2482 | +class menu_item_huygens : public menu_item_main | |
2483 | +#elif IS_FB2K_VER09 | |
2484 | +// {C6379E09-0AD9-43a0-A37A-5CACC2A347E5} | |
2485 | +static const GUID menu_item_huygens_guid = { 0xc6379e09, 0xad9, 0x43a0, { 0xa3, 0x7a, 0x5c, 0xac, 0xc2, 0xa3, 0x47, 0xe5 } }; | |
2486 | +class menu_item_huygens : public mainmenu_commands | |
2487 | +#endif | |
2488 | +{ | |
2489 | +#if IS_FB2K_VER08 | |
2490 | + virtual unsigned get_num_items() { | |
2491 | +#elif IS_FB2K_VER09 | |
2492 | + virtual t_uint32 get_command_count() { | |
2493 | +#endif | |
2494 | + return 1; | |
2495 | + } | |
2496 | + | |
2497 | +#if IS_FB2K_VER08 | |
2498 | + virtual void enum_item(unsigned n, string_base & out) { | |
2499 | + out = (n==0 ? g_menu_item : ""); | |
2500 | + } | |
2501 | +#elif IS_FB2K_VER09 | |
2502 | + virtual GUID get_command(t_uint32 p_index) | |
2503 | + { | |
2504 | + if (p_index == 0) { | |
2505 | + return menu_item_huygens_guid; | |
2506 | + } | |
2507 | + | |
2508 | + return pfc::guid_null; | |
2509 | + } | |
2510 | + | |
2511 | + virtual void get_name(t_uint32 p_index, string_base & p_out) | |
2512 | + { | |
2513 | + if (p_index == 0) { | |
2514 | + p_out = g_menu_item_title; | |
2515 | + } | |
2516 | + } | |
2517 | + | |
2518 | + virtual bool get_description(t_uint32 p_index, string_base & p_out) | |
2519 | + { | |
2520 | + if (p_index == 0) | |
2521 | + p_out = g_menu_item_description; | |
2522 | + else | |
2523 | + return false; | |
2524 | + | |
2525 | + return true; | |
2526 | + } | |
2527 | + virtual GUID get_parent() { | |
2528 | + return mainmenu_groups::playback_etc; | |
2529 | + } | |
2530 | + | |
2531 | +#endif | |
2532 | + | |
2533 | +#if IS_FB2K_VER08 | |
2534 | + virtual bool is_checked(int index) | |
2535 | + { | |
2536 | + bool flags = false; | |
2537 | + static const bool flag_checked = TRUE; | |
2538 | +#elif IS_FB2K_VER09 | |
2539 | + virtual bool get_display(t_uint32 index, pfc::string_base & text, t_uint32 & flags) | |
2540 | + { | |
2541 | + flags = 0; | |
2542 | +#endif | |
2543 | + switch (index) | |
2544 | + { | |
2545 | + case 0: | |
2546 | + if (cfg_use_plugin == 1) flags = flag_checked; | |
2547 | + break; | |
2548 | + } | |
2549 | + | |
2550 | +#if IS_FB2K_VER08 | |
2551 | + return flags; | |
2552 | +#elif IS_FB2K_VER09 | |
2553 | + get_name(index, text); | |
2554 | + return true; | |
2555 | +#endif | |
2556 | + } | |
2557 | + | |
2558 | +#if IS_FB2K_VER08 | |
2559 | + virtual void perform_command(unsigned index) | |
2560 | + { | |
2561 | +#elif IS_FB2K_VER09 | |
2562 | + virtual void execute(t_uint32 index, service_ptr_t<service_base> /* reserved for future use */) | |
2563 | + { | |
2564 | +#endif | |
2565 | + if ((index == 0) && core_api::assert_main_thread()) | |
2566 | + { | |
2567 | + cfg_use_plugin = 1 - cfg_use_plugin; | |
2568 | + | |
2569 | + if(cfg_use_plugin > 1) | |
2570 | + { | |
2571 | + cfg_use_plugin = 1; | |
2572 | + } | |
2573 | + else if(cfg_use_plugin < 0) | |
2574 | + { | |
2575 | + cfg_use_plugin = 0; | |
2576 | + } | |
2577 | + | |
2578 | + if (cfg_use_plugin == 1) | |
2579 | + { | |
2580 | + DEBUG_PLUGIN(_T("menu_item_huygens::execute - Huygens の応答機能を有効にしました")); | |
2581 | + } | |
2582 | + else | |
2583 | + { | |
2584 | + DEBUG_PLUGIN(_T("menu_item_huygens::execute - Huygens の応答機能を無効にしました")); | |
2585 | + } | |
2586 | + } | |
2587 | + } | |
2588 | +}; | |
2589 | + | |
2590 | +#if IS_FB2K_VER08 | |
2591 | +class config_page_huygens : public config | |
2592 | +#elif IS_FB2K_VER09 | |
2593 | +// {81110BB1-9F51-473d-BB40-C91D2F0A8329} | |
2594 | +static const GUID config_page_huygens_guid = { 0x81110bb1, 0x9f51, 0x473d, { 0xbb, 0x40, 0xc9, 0x1d, 0x2f, 0xa, 0x83, 0x29 } }; | |
2595 | +class config_page_huygens : public preferences_page | |
2596 | +#endif | |
2597 | +{ | |
2598 | + static BOOL CALLBACK ConfigProc(HWND wnd,UINT msg,WPARAM wp,LPARAM lp) | |
2599 | + { | |
2600 | + switch(msg) | |
2601 | + { | |
2602 | + case WM_INITDIALOG: | |
2603 | + { | |
2604 | + uButton_SetCheck(wnd, IDC_USE_PLUGIN, (cfg_use_plugin == 1) ? true : false); | |
2605 | + | |
2606 | + setDlgVersionInfo(wnd, IDC_VERSION, IDC_BUILD); | |
2607 | + } | |
2608 | + break; | |
2609 | + | |
2610 | + case WM_COMMAND: | |
2611 | + switch(wp) | |
2612 | + { | |
2613 | + case (BN_CLICKED<<16)|IDC_USE_PLUGIN: | |
2614 | + cfg_use_plugin = uButton_GetCheck(wnd, IDC_USE_PLUGIN) ? 1 : 0; | |
2615 | + break; | |
2616 | + } | |
2617 | + break; | |
2618 | + | |
2619 | + } | |
2620 | + | |
2621 | + return 0; | |
2622 | + } | |
2623 | + | |
2624 | +public: | |
2625 | + virtual HWND create(HWND parent) | |
2626 | + { | |
2627 | + return uCreateDialog(IDD_PREFERENCE, parent, ConfigProc); | |
2628 | + } | |
2629 | + | |
2630 | + virtual const char * get_name() { | |
2631 | + return g_pluginCaption8; | |
2632 | + } | |
2633 | + | |
2634 | + virtual const char * get_parent_name() { | |
2635 | + return "Components"; | |
2636 | + } | |
2637 | + | |
2638 | +#if IS_FB2K_VER09 | |
2639 | + virtual GUID get_guid() { | |
2640 | + return config_page_huygens_guid; | |
2641 | + } | |
2642 | + | |
2643 | + virtual GUID get_parent_guid() { | |
2644 | + return guid_tools; | |
2645 | + } | |
2646 | + | |
2647 | + virtual bool reset_query() { | |
2648 | + return true; | |
2649 | + } | |
2650 | + | |
2651 | + virtual void reset() | |
2652 | + { | |
2653 | + cfg_use_plugin = 1; | |
2654 | + } | |
2655 | + | |
2656 | + virtual bool get_help_url(pfc::string_base & p_out) | |
2657 | + { | |
2658 | + p_out = URL_FOO_HUYGENS_HOME; | |
2659 | + return true; | |
2660 | + } | |
2661 | +#endif | |
2662 | +}; | |
2663 | + | |
2664 | +#if IS_FB2K_VER08 | |
2665 | +class config_page_huygens_advanced : public config | |
2666 | +#elif IS_FB2K_VER09 | |
2667 | +// {237E0DDE-DE84-42f1-B3FA-AA2AB0A4B0B0} | |
2668 | +static const GUID config_page_huygens_advanced_guid = { 0x237e0dde, 0xde84, 0x42f1, { 0xb3, 0xfa, 0xaa, 0x2a, 0xb0, 0xa4, 0xb0, 0xb0 } }; | |
2669 | +class config_page_huygens_advanced : public preferences_page_v2 | |
2670 | +#endif | |
2671 | +{ | |
2672 | + static int nOldDummyMp3Location; | |
2673 | + static string8 oldGenMixiPath; | |
2674 | + | |
2675 | + static BOOL CALLBACK ConfigProc(HWND wnd,UINT msg,WPARAM wp,LPARAM lp) | |
2676 | + { | |
2677 | + switch(msg) | |
2678 | + { | |
2679 | + case WM_INITDIALOG: | |
2680 | + { | |
2681 | + uSetDlgItemText(wnd, IDC_CAPTION_ADVANCED, g_advancedSettingsCaption8); | |
2682 | + | |
2683 | + uButton_SetCheck(wnd, IDC_SHOW_HUYGENS, (cfg_show_huygens == 1) ? true : false); | |
2684 | + if(Probe::getInstance()->getWnd() == INVALID_HANDLE_VALUE) { | |
2685 | + HWND hControlWnd = uGetDlgItem(wnd, IDC_SHOW_HUYGENS); | |
2686 | + uEnableWindow(hControlWnd, false); | |
2687 | + } | |
2688 | + | |
2689 | + uSetDlgItemText(wnd, IDC_HUYGENS_TITLE_FORMAT, cfg_huygens_title_format); | |
2690 | + uSetDlgItemText(wnd, IDC_HUYGENS_PLAYLIST_FORMAT, cfg_huygens_playlist_format); | |
2691 | + | |
2692 | + uButton_SetCheck(wnd, IDC_DISABLE_ANSI_TRANS, (cfg_disable_ansi_trans == 1) ? true : false); | |
2693 | + | |
2694 | + setDlgVersionInfo(wnd, IDC_VERSION_ADVANCED, IDC_BUILD_ADVANCED); | |
2695 | + } | |
2696 | + break; | |
2697 | + | |
2698 | + case WM_COMMAND: | |
2699 | + switch(wp) | |
2700 | + { | |
2701 | + case (BN_CLICKED<<16)|IDC_SHOW_HUYGENS: | |
2702 | + { | |
2703 | + bool bShowProbe = uButton_GetCheck(wnd, IDC_SHOW_HUYGENS); | |
2704 | + cfg_show_huygens = bShowProbe ? 1 : 0; | |
2705 | + | |
2706 | + Probe::getInstance()->showProbeWindow(bShowProbe); | |
2707 | + } | |
2708 | + break; | |
2709 | + | |
2710 | + case (EN_CHANGE<<16)|IDC_HUYGENS_PLAYLIST_FORMAT: | |
2711 | + { | |
2712 | + string8 format; | |
2713 | + uGetWindowText(reinterpret_cast<HWND>(lp), format); | |
2714 | + cfg_huygens_title_format = format; | |
2715 | + } | |
2716 | + break; | |
2717 | + | |
2718 | + case (EN_CHANGE<<16)|IDC_HUYGENS_TITLE_FORMAT: | |
2719 | + { | |
2720 | + string8 format; | |
2721 | + uGetWindowText(reinterpret_cast<HWND>(lp), format); | |
2722 | + cfg_huygens_playlist_format = format; | |
2723 | + } | |
2724 | + break; | |
2725 | + | |
2726 | + case (BN_CLICKED<<16)|IDC_DISABLE_ANSI_TRANS: | |
2727 | + { | |
2728 | + cfg_disable_ansi_trans = uButton_GetCheck(wnd, IDC_DISABLE_ANSI_TRANS) ? 1 : 0; | |
2729 | + } | |
2730 | + break; | |
2731 | + | |
2732 | + default: | |
2733 | + break; | |
2734 | + } | |
2735 | + break; | |
2736 | + } | |
2737 | + | |
2738 | + return 0; | |
2739 | + } | |
2740 | + | |
2741 | +public: | |
2742 | + | |
2743 | + virtual HWND create(HWND parent) | |
2744 | + { | |
2745 | + return uCreateDialog(IDD_ADVANCED_SETTINGS, parent, ConfigProc); | |
2746 | + } | |
2747 | + | |
2748 | + virtual const char * get_name() { | |
2749 | + return g_advancedSettingsCaption8; | |
2750 | + } | |
2751 | + virtual const char * get_parent_name() { | |
2752 | + return g_pluginCaption8; | |
2753 | + } | |
2754 | + | |
2755 | +#if IS_FB2K_VER09 | |
2756 | + virtual GUID get_guid() { | |
2757 | + return config_page_huygens_advanced_guid; | |
2758 | + } | |
2759 | + | |
2760 | + virtual GUID get_parent_guid() { | |
2761 | + return config_page_huygens_guid; | |
2762 | + } | |
2763 | + | |
2764 | + virtual double get_sort_priority() { | |
2765 | + return 1.0; | |
2766 | + } | |
2767 | + | |
2768 | + virtual bool reset_query() { | |
2769 | + return true; | |
2770 | + } | |
2771 | + | |
2772 | + virtual void reset() { | |
2773 | + cfg_show_huygens = 0; | |
2774 | + cfg_huygens_title_format = DEFAULT_HUYGENS_TITLE; | |
2775 | + cfg_huygens_playlist_format = DEFAULT_HUYGENS_TITLE; | |
2776 | + } | |
2777 | + | |
2778 | + virtual bool get_help_url(pfc::string_base & p_out) { | |
2779 | + p_out = URL_FOO_HUYGENS_HOME; | |
2780 | + return true; | |
2781 | + } | |
2782 | +#endif | |
2783 | +}; | |
2784 | + | |
2785 | +#if IS_FB2K_VER08 | |
2786 | +class config_page_huygens_debug : public config | |
2787 | +#elif IS_FB2K_VER09 | |
2788 | +// {C0B24574-B65A-430e-9F27-D7BBADB28053} | |
2789 | +static const GUID config_page_huygens_debug_guid = { 0xc0b24574, 0xb65a, 0x430e, { 0x9f, 0x27, 0xd7, 0xbb, 0xad, 0xb2, 0x80, 0x53 } }; | |
2790 | +class config_page_huygens_debug : public preferences_page_v2 | |
2791 | +#endif | |
2792 | +{ | |
2793 | + static BOOL CALLBACK ConfigProc(HWND wnd,UINT msg,WPARAM wp,LPARAM lp) | |
2794 | + { | |
2795 | + switch(msg) | |
2796 | + { | |
2797 | + case WM_INITDIALOG: | |
2798 | + { | |
2799 | + uSetDlgItemText(wnd, IDC_CAPTION_DEBUG, g_debugSettingsCaption8); | |
2800 | + | |
2801 | + bool bDebugLogEnabled = (cfg_enable_debug_log == 1) ? true : false; | |
2802 | + uButton_SetCheck(wnd, IDC_ENABLE_DEBUG_LOG, bDebugLogEnabled); | |
2803 | + | |
2804 | + InitDebugLevelList(wnd, IDC_DEBUG_HUYGENS_INIT); | |
2805 | + InitDebugLevelList(wnd, IDC_DEBUG_HUYGENS_PROC); | |
2806 | + InitDebugLevelList(wnd, IDC_DEBUG_TRACK_INFO); | |
2807 | + InitDebugLevelList(wnd, IDC_DEBUG_PLUGIN); | |
2808 | + InitDebugLevelList(wnd, IDC_DEBUG_CALLBACK); | |
2809 | + | |
2810 | + EnableDebugLevelLists(wnd, bDebugLogEnabled); | |
2811 | + | |
2812 | + uSendDlgItemMessage(wnd, IDC_DEBUG_HUYGENS_INIT, CB_SETCURSEL, (int)cfg_debug_huygens_init, 0); | |
2813 | + uSendDlgItemMessage(wnd, IDC_DEBUG_HUYGENS_PROC, CB_SETCURSEL, (int)cfg_debug_huygens_proc, 0); | |
2814 | + uSendDlgItemMessage(wnd, IDC_DEBUG_TRACK_INFO, CB_SETCURSEL, (int)cfg_debug_track_info, 0); | |
2815 | + uSendDlgItemMessage(wnd, IDC_DEBUG_PLUGIN, CB_SETCURSEL, (int)cfg_debug_plugin, 0); | |
2816 | + uSendDlgItemMessage(wnd, IDC_DEBUG_CALLBACK, CB_SETCURSEL, (int)cfg_debug_callback, 0); | |
2817 | + | |
2818 | + setDlgVersionInfo(wnd, IDC_VERSION_DEBUG, IDC_BUILD_DEBUG); | |
2819 | + } | |
2820 | + break; | |
2821 | + | |
2822 | + case WM_COMMAND: | |
2823 | + switch(wp) | |
2824 | + { | |
2825 | + case (BN_CLICKED<<16)|IDC_ENABLE_DEBUG_LOG: | |
2826 | + { | |
2827 | + bool bDebugLogEnabled = uButton_GetCheck(wnd, IDC_ENABLE_DEBUG_LOG); | |
2828 | + cfg_enable_debug_log = bDebugLogEnabled ? 1 : 0; | |
2829 | + | |
2830 | + EnableDebugLevelLists(wnd, bDebugLogEnabled); | |
2831 | + } | |
2832 | + break; | |
2833 | + | |
2834 | + case (CBN_SELCHANGE<<16)|IDC_DEBUG_HUYGENS_INIT: | |
2835 | + { | |
2836 | + int sel = uSendMessage(reinterpret_cast<HWND>(lp), CB_GETCURSEL, 0, 0); | |
2837 | + cfg_debug_huygens_init = sel; | |
2838 | + } | |
2839 | + break; | |
2840 | + | |
2841 | + case (CBN_SELCHANGE<<16)|IDC_DEBUG_HUYGENS_PROC: | |
2842 | + { | |
2843 | + int sel = uSendMessage(reinterpret_cast<HWND>(lp), CB_GETCURSEL, 0, 0); | |
2844 | + cfg_debug_huygens_proc = sel; | |
2845 | + } | |
2846 | + break; | |
2847 | + | |
2848 | + case (CBN_SELCHANGE<<16)|IDC_DEBUG_TRACK_INFO: | |
2849 | + { | |
2850 | + int sel = uSendMessage(reinterpret_cast<HWND>(lp), CB_GETCURSEL, 0, 0); | |
2851 | + cfg_debug_track_info = sel; | |
2852 | + } | |
2853 | + break; | |
2854 | + | |
2855 | + case (CBN_SELCHANGE<<16)|IDC_DEBUG_PLUGIN: | |
2856 | + { | |
2857 | + int sel = uSendMessage(reinterpret_cast<HWND>(lp), CB_GETCURSEL, 0, 0); | |
2858 | + cfg_debug_plugin = sel; | |
2859 | + } | |
2860 | + break; | |
2861 | + | |
2862 | + case (CBN_SELCHANGE<<16)|IDC_DEBUG_CALLBACK: | |
2863 | + { | |
2864 | + int sel = uSendMessage(reinterpret_cast<HWND>(lp), CB_GETCURSEL, 0, 0); | |
2865 | + cfg_debug_callback = sel; | |
2866 | + } | |
2867 | + break; | |
2868 | + | |
2869 | + default: | |
2870 | + break; | |
2871 | + } | |
2872 | + break; | |
2873 | + | |
2874 | + case WM_DESTROY: | |
2875 | + break; | |
2876 | + } | |
2877 | + | |
2878 | + return 0; | |
2879 | + } | |
2880 | + | |
2881 | +protected: | |
2882 | + | |
2883 | + static void InitDebugLevelList(HWND wnd, UINT id) | |
2884 | + { | |
2885 | + uSendDlgItemMessage(wnd, id, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(_T("なし"))); | |
2886 | + uSendDlgItemMessage(wnd, id, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(_T("簡易レベル"))); | |
2887 | + uSendDlgItemMessage(wnd, id, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(_T("詳細レベル"))); | |
2888 | + } | |
2889 | + | |
2890 | + static void EnableDebugLevelLists(HWND wnd, bool bDebugLogEnabled) | |
2891 | + { | |
2892 | + EnableDebugLevelList(wnd, IDC_DEBUG_HUYGENS_INIT, bDebugLogEnabled); | |
2893 | + EnableDebugLevelList(wnd, IDC_DEBUG_HUYGENS_PROC, bDebugLogEnabled); | |
2894 | + EnableDebugLevelList(wnd, IDC_DEBUG_TRACK_INFO, bDebugLogEnabled); | |
2895 | + EnableDebugLevelList(wnd, IDC_DEBUG_PLUGIN, bDebugLogEnabled); | |
2896 | + EnableDebugLevelList(wnd, IDC_DEBUG_CALLBACK, bDebugLogEnabled); | |
2897 | + } | |
2898 | + | |
2899 | + static void EnableDebugLevelList(HWND wnd, UINT id, bool bEnable) | |
2900 | + { | |
2901 | + HWND hControlWnd = uGetDlgItem(wnd, id); | |
2902 | + uEnableWindow(hControlWnd, bEnable); | |
2903 | + } | |
2904 | + | |
2905 | +public: | |
2906 | + | |
2907 | + virtual HWND create(HWND parent) | |
2908 | + { | |
2909 | + return uCreateDialog(IDD_DEBUG_SETTINGS, parent, ConfigProc); | |
2910 | + } | |
2911 | + | |
2912 | + virtual const char * get_name() { | |
2913 | + return g_debugSettingsCaption8; | |
2914 | + } | |
2915 | + virtual const char * get_parent_name() { | |
2916 | + return g_pluginCaption8; | |
2917 | + } | |
2918 | + | |
2919 | +#if IS_FB2K_VER09 | |
2920 | + virtual GUID get_guid() { | |
2921 | + return config_page_huygens_debug_guid; | |
2922 | + } | |
2923 | + | |
2924 | + virtual GUID get_parent_guid() { | |
2925 | + return config_page_huygens_guid; | |
2926 | + } | |
2927 | + | |
2928 | + virtual double get_sort_priority() { | |
2929 | + return 2.0; | |
2930 | + } | |
2931 | + | |
2932 | + virtual bool reset_query() { | |
2933 | + return true; | |
2934 | + } | |
2935 | + | |
2936 | + virtual void reset() { | |
2937 | + cfg_enable_debug_log = 1; | |
2938 | + cfg_debug_huygens_init = 1; | |
2939 | + cfg_debug_huygens_proc = 1; | |
2940 | + cfg_debug_track_info = 1; | |
2941 | + cfg_debug_plugin = 1; | |
2942 | + cfg_debug_callback = 1; | |
2943 | + } | |
2944 | + | |
2945 | + virtual bool get_help_url(pfc::string_base & p_out) { | |
2946 | + p_out = URL_FOO_HUYGENS_HOME; | |
2947 | + return true; | |
2948 | + } | |
2949 | +#endif | |
2950 | +}; | |
2951 | + | |
2952 | +#if IS_FB2K_VER08 | |
2953 | +static service_factory_single_t<play_callback, play_callback_huygens> foo1; | |
2954 | +static service_factory_single_t<initquit, initquit_send> foo2; | |
2955 | +static menu_item_factory<menu_item_huygens> foo3; | |
2956 | +static service_factory_single_t<config, config_page_huygens> foo4; | |
2957 | +static service_factory_single_t<config, config_page_huygens_advanced> foo5; | |
2958 | +static service_factory_single_t<config, config_page_huygens_debug> foo6; | |
2959 | +#elif IS_FB2K_VER09 | |
2960 | +static service_factory_single_t<play_callback_huygens> foo1; | |
2961 | +static initquit_factory_t<initquit_send> foo2; | |
2962 | +static mainmenu_commands_factory_t<menu_item_huygens> foo3; | |
2963 | +static preferences_page_factory_t<config_page_huygens> foo4; | |
2964 | +static preferences_page_factory_t<config_page_huygens_advanced> foo5; | |
2965 | +static preferences_page_factory_t<config_page_huygens_debug> foo6; | |
2966 | +#endif | |
2967 | + | |
2968 | +tstring GetErrorMessage(DWORD errCode) | |
2969 | +{ | |
2970 | + | |
2971 | + LPVOID lpMsgBuf; | |
2972 | + | |
2973 | + FormatMessage( | |
2974 | + FORMAT_MESSAGE_ALLOCATE_BUFFER | | |
2975 | + FORMAT_MESSAGE_FROM_SYSTEM | | |
2976 | + FORMAT_MESSAGE_IGNORE_INSERTS, | |
2977 | + NULL, | |
2978 | + errCode, | |
2979 | + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // デフォルト言語 | |
2980 | + (LPTSTR) &lpMsgBuf, | |
2981 | + 0, | |
2982 | + NULL | |
2983 | + ); | |
2984 | + | |
2985 | + tstring msg((LPCTSTR)lpMsgBuf); | |
2986 | + | |
2987 | + GlobalFree(lpMsgBuf); | |
2988 | + | |
2989 | + return msg; | |
2990 | +} | |
2991 | + | |
2992 | +void putLogError(LPCTSTR pMethod, LPCTSTR pErrMsg, DWORD dwErrCode) | |
2993 | +{ | |
2994 | + tstring errMsg = GetErrorMessage(dwErrCode); | |
2995 | + | |
2996 | + LOG_ERROR(_T("%s - %s"), pMethod, pErrMsg); | |
2997 | + LOG_ERROR(_T("%s - コード: %08x, 理由: %s"), pMethod, dwErrCode, errMsg.c_str()); | |
2998 | +} | |
2999 | + | |
3000 | +void setDlgVersionInfo(HWND wnd, UINT idc_version, UINT idc_build) { | |
3001 | + | |
3002 | + StrDBCS64K version; | |
3003 | + | |
3004 | + sprintf_s(version, sizeof(StrDBCS64K), PLUGIN_CAPTION " " PLUGIN_VERSION_PREFIX PLUGIN_VERSION_VAL " with SDK%d (compatible%d)", | |
3005 | + foobar2000_client::FOOBAR2000_CLIENT_VERSION, foobar2000_client::FOOBAR2000_CLIENT_VERSION_COMPATIBLE); | |
3006 | + | |
3007 | + uSetDlgItemText(wnd, idc_version, version); | |
3008 | + uSetDlgItemText(wnd, idc_build, "build on " __DATE__ ", " __TIME__); | |
3009 | +} | |
3010 | + | |
3011 | +void DebugPrint(LPCTSTR lpszFormat, ...) | |
3012 | +{ | |
3013 | + static Str64K buf; | |
3014 | + va_list marker; | |
3015 | + | |
3016 | + va_start(marker, lpszFormat); | |
3017 | + _vstprintf_s(buf, sizeof(Str64K) / sizeof(TCHAR), lpszFormat, marker); | |
3018 | + va_end(marker); | |
3019 | + | |
3020 | + OutputDebugString(buf); | |
3021 | + OutputDebugString(_T("\n")); | |
3022 | + | |
3023 | + string_utf8_from_os tmp(buf); | |
3024 | + | |
3025 | + console::info(tmp); | |
3026 | +} | |
3027 | + | |
3028 | +void DebugPrint8(LPCSTR lpszFormat, ...) | |
3029 | +{ | |
3030 | + static StrDBCS64K buf; | |
3031 | + | |
3032 | + va_list marker; | |
3033 | + | |
3034 | + va_start(marker, lpszFormat); | |
3035 | + vsprintf_s(buf, sizeof(StrDBCS64K), lpszFormat, marker); | |
3036 | + va_end(marker); | |
3037 | + | |
3038 | + console::info(buf); | |
3039 | + | |
3040 | + string_os_from_utf8 tmp(buf); | |
3041 | + | |
3042 | + OutputDebugString(tmp); | |
3043 | + OutputDebugString(_T("\n")); | |
3044 | +} |
@@ -0,0 +1,298 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +#if !defined(HUY_IPC_H_CE87645E_DFB8_4418_A904_403DCB282C84) | |
4 | + | |
5 | +#define HUY_IPC_H_CE87645E_DFB8_4418_A904_403DCB282C84 | |
6 | + | |
7 | +//! Huygens IPC コマンド | |
8 | +#define WM_HUY_IPC WM_APP | |
9 | + | |
10 | +//! Huygensカテゴリ:プラグイン情報 | |
11 | +#define HUY_INFO_PLUGIN 0x0000 | |
12 | +//! Huygensカテゴリ:トラック情報 | |
13 | +#define HUY_INFO_TRACK 0x0100 | |
14 | +//! Huygensカテゴリ:再生情報 | |
15 | +#define HUY_INFO_PLAYBACK 0x0200 | |
16 | +//! Huygensカテゴリ:プレイリスト情報 | |
17 | +#define HUY_INFO_PLAYLIST 0x0300 | |
18 | +//! Huygensカテゴリ:プラグイン制御 | |
19 | +#define HUY_CTRL_PLUGIN 0x0A00 | |
20 | +//! Huygensカテゴリ:再生制御 | |
21 | +#define HUY_CTRL_PLAYBACK 0x0800 | |
22 | +//! Huygensカテゴリ:プレイリスト制御 | |
23 | +#define HUY_CTRL_PLAYLIST 0x0900 | |
24 | + | |
25 | +//! プラグインバージョンの取得 (out:string [d.ddd]) | |
26 | +#define HUY_GETVERSION (HUY_INFO_PLUGIN | 0x00) | |
27 | + | |
28 | +//! foobar2000 バージョンの取得 (out:string) | |
29 | +#define HUY_GETFB2KVERSION (HUY_INFO_PLUGIN | 0x01) | |
30 | + | |
31 | +//! エンコードモードの取得(0:OS codepage [ShiftJIS], 1:UTF-8) (out:int) | |
32 | +#define HUY_GETENCODEMODE (HUY_INFO_PLUGIN | 0x02) | |
33 | + | |
34 | +//! ファイルパスを取得 (out:string) | |
35 | +#define HUY_GETFILEPATH (HUY_INFO_TRACK | 0x00) | |
36 | + | |
37 | +//! プロトコルを含んだファイルパスを取得 (out:string) | |
38 | +#define HUY_GETFILEPATHRAW (HUY_INFO_TRACK | 0x2D) | |
39 | + | |
40 | +//! 曲の長さを取得 [msec.×1000] (out:int) | |
41 | +#define HUY_GETDURATION (HUY_INFO_TRACK | 0x01) | |
42 | + | |
43 | +//! アーティスト名を取得 (out:string) | |
44 | +#define HUY_GETARTIST (HUY_INFO_TRACK | 0x02) | |
45 | + | |
46 | +//! トラックタイトルを取得 (out:string) | |
47 | +#define HUY_GETTRACKTITLE (HUY_INFO_TRACK | 0x03) | |
48 | + | |
49 | +//! アルバムタイトルを取得 (out:string) | |
50 | +#define HUY_GETALBUMTITLE (HUY_INFO_TRACK | 0x04) | |
51 | + | |
52 | +//! ジャンルを取得 (out:string) | |
53 | +#define HUY_GETGENRE (HUY_INFO_TRACK | 0x1B) | |
54 | + | |
55 | +//! 出版年月日を取得 (out:string) | |
56 | +#define HUY_GETDATE (HUY_INFO_TRACK | 0x05) | |
57 | + | |
58 | +//! 作曲者を取得 (out:string) | |
59 | +#define HUY_GETCOMPOSER (HUY_INFO_TRACK | 0x06) | |
60 | + | |
61 | +//! 演奏者を取得 (out:string) | |
62 | +#define HUY_GETPERFORMER (HUY_INFO_TRACK | 0x07) | |
63 | + | |
64 | +//! アルバムアーティスト名を取得 (out:string) | |
65 | +#define HUY_GETALBUMARTIST (HUY_INFO_TRACK | 0x08) | |
66 | + | |
67 | +//! トラックアーティスト名を取得 (out:string) | |
68 | +#define HUY_GETTRACKARTIST (HUY_INFO_TRACK | 0x19) | |
69 | + | |
70 | +//! サブソングインデックスを取得 (out:int) | |
71 | +#define HUY_GETSUBSONG (HUY_INFO_TRACK | 0x1A) | |
72 | + | |
73 | +//! トラック番号を取得 (out:int) | |
74 | +#define HUY_GETTRACKNO (HUY_INFO_TRACK | 0x09) | |
75 | + | |
76 | +//! 総トラック数を取得 (out:int) | |
77 | +#define HUY_GETTOTALTRACKS (HUY_INFO_TRACK | 0x0A) | |
78 | + | |
79 | +//! ディスク番号を取得 (out:int) | |
80 | +#define HUY_GETDISCNO (HUY_INFO_TRACK | 0x0B) | |
81 | + | |
82 | +//! 総ディスク数を取得 (out:int) | |
83 | +#define HUY_GETTOTALDISCS (HUY_INFO_TRACK | 0x0C) | |
84 | + | |
85 | +//! コメントを取得 (out:string) | |
86 | +#define HUY_GETCOMMENT (HUY_INFO_TRACK | 0x0D) | |
87 | + | |
88 | +//! サンプリングレート[Hz]の取得 (out:int) | |
89 | +#define HUY_GETSAMPLERATE (HUY_INFO_TRACK | 0x0E) | |
90 | + | |
91 | +//! ビットレート[kbps]の取得 (out:int) | |
92 | +#define HUY_GETBITRATE (HUY_INFO_TRACK | 0x0F) | |
93 | + | |
94 | +//! 公称ビットレート[kbps]の取得 (out:int) | |
95 | +#define HUY_GETBITRATENOMINAL (HUY_INFO_TRACK | 0x27) | |
96 | + | |
97 | +//! 動的ビットレート[kbps]の取得 (out:int) | |
98 | +#define HUY_GETBITRATEDYNAMIC (HUY_INFO_TRACK | 0x2C) | |
99 | + | |
100 | +//! チャンネル数の取得 (out:int) | |
101 | +#define HUY_GETCHANNELS (HUY_INFO_TRACK | 0x10) | |
102 | + | |
103 | +//! ビット数/サンプルの取得 (out:int) | |
104 | +#define HUY_GETBITSPERSAMPLE (HUY_INFO_TRACK | 0x1C) | |
105 | + | |
106 | +//! コーデック名の取得 (out:string) | |
107 | +#define HUY_GETCODEC (HUY_INFO_TRACK | 0x11) | |
108 | + | |
109 | +//! コーデックプロファイルの取得 (out:string) | |
110 | +#define HUY_GETCODECPROFILE (HUY_INFO_TRACK | 0x12) | |
111 | + | |
112 | +//! 可逆/非可逆の取得(0:lossy、1:lossless) | |
113 | +#define HUY_ISLOSSLESS (HUY_INFO_TRACK | 0x13) | |
114 | + | |
115 | +//! タグタイプの取得 (out:string) | |
116 | +#define HUY_GETTAGTYPE (HUY_INFO_TRACK | 0x14) | |
117 | + | |
118 | +//! extrainfo の取得 (out:string) | |
119 | +#define HUY_GETEXTRAINFO (HUY_INFO_TRACK | 0x1D) | |
120 | + | |
121 | +//! tool の取得 (out:string) | |
122 | +#define HUY_GETTOOL (HUY_INFO_TRACK | 0x1E) | |
123 | + | |
124 | +//! cue_embedded の取得(0:no、1:yes) (out:int) | |
125 | +#define HUY_GETCUEEMBEDDED (HUY_INFO_TRACK | 0x1F) | |
126 | + | |
127 | +//! audio md5 hash の取得 (out:string) | |
128 | +#define HUY_GETAUDIOMD5HASH (HUY_INFO_TRACK | 0x20) | |
129 | + | |
130 | +//! mp3 stereo mode の取得(0:stereo、1:joint stereo) (out:int) | |
131 | +#define HUY_GETMP3STEREOMODE (HUY_INFO_TRACK | 0x21) | |
132 | + | |
133 | +//! mp3 acuurate length の取得 (out:int) | |
134 | +#define HUY_GETMP3ACCURATELENGTH (HUY_INFO_TRACK | 0x22) | |
135 | + | |
136 | +//! mp3 enc_delay の取得 (out:int) | |
137 | +#define HUY_GETMP3ENCDELAY (HUY_INFO_TRACK | 0x23) | |
138 | + | |
139 | +//! mp3 enc_padding の取得 (out:string) | |
140 | +#define HUY_GETMP3ENCPADDING (HUY_INFO_TRACK | 0x24) | |
141 | + | |
142 | +//! ape version の取得 (out:string) | |
143 | +#define HUY_GETAPEVERSION (HUY_INFO_TRACK | 0x25) | |
144 | + | |
145 | +//! ape flags の取得 (out:string) | |
146 | +#define HUY_GETAPEFLAGS (HUY_INFO_TRACK | 0x26) | |
147 | + | |
148 | +//! ReplayGain album gain の取得 (out:int) | |
149 | +#define HUY_GETREPLAYGAIN_ALBUMGAIN (HUY_INFO_TRACK | 0x28) | |
150 | + | |
151 | +//! ReplayGain album peek の取得 (out:int) | |
152 | +#define HUY_GETREPLAYGAIN_ALBUMPEEK (HUY_INFO_TRACK | 0x29) | |
153 | + | |
154 | +//! ReplayGain track gain の取得 (out:int) | |
155 | +#define HUY_GETREPLAYGAIN_TRACKGAIN (HUY_INFO_TRACK | 0x2A) | |
156 | + | |
157 | +//! ReplayGain track peek の取得 (out:int) | |
158 | +#define HUY_GETREPLAYGAIN_TRACKPEEK (HUY_INFO_TRACK | 0x2B) | |
159 | + | |
160 | +//! ファイルサイズの取得 (out:string ※not int, max. = UINT64_MAX) | |
161 | +#define HUY_GETFILESIZE (HUY_INFO_TRACK | 0x15) | |
162 | + | |
163 | +//! ファイル作成日時の取得 (UTC) [YYYYMMDDHH24MISS.mmmuuun00] (out:string) | |
164 | +#define HUY_GETFILECREATED (HUY_INFO_TRACK | 0x16) | |
165 | + | |
166 | +//! ファイル更新日時の取得 (UTC) [YYYYMMDDHH24MISS.mmmuuun00] (out:string) | |
167 | +#define HUY_GETFILELASTMOD (HUY_INFO_TRACK | 0x17) | |
168 | + | |
169 | +//! メディアライブラリへの登録の有無の取得(0:登録なし、1:登録あり) | |
170 | +#define HUY_ISINMEDIALIB (HUY_INFO_TRACK | 0x18) | |
171 | + | |
172 | +//! 再生状態の取得(1:再生中、0:停止中、3:一時停止中) (out:int) | |
173 | +#define HUY_GETSTATUS (HUY_INFO_PLAYBACK | 0x00) | |
174 | + | |
175 | +//! 再生位置の取得 [msec.×1000] (out:int) | |
176 | +#define HUY_GETPOS (HUY_INFO_PLAYBACK | 0x01) | |
177 | + | |
178 | +//! リピート状態の取得(1:repeat playlist、2:repeat track、0:not repeat) (out:int) | |
179 | +#define HUY_GETREPEAT (HUY_INFO_PLAYBACK | 0x02) | |
180 | + | |
181 | +//! シャッフル状態の取得(1:shuffle tracks、2:shuffle albums、3:shuffle folders、0:not shuffle [0.8.3 always 0]) (out:int) | |
182 | +#define HUY_GETSHUFFLE (HUY_INFO_PLAYBACK | 0x03) | |
183 | + | |
184 | +//! ランダム状態の取得(1:random、0:not random) (out:int) | |
185 | +#define HUY_GETRANDOM (HUY_INFO_PLAYBACK | 0x04) | |
186 | + | |
187 | +//! 再生順の取得 | |
188 | +// (0:default、1:repeat playlist、2:repeat track、3:random、 | |
189 | +// 4:shuffle tracks [0.9+]、5:shuffle albums [0.9+]、6:shuffle folders [0.9+]) (out:int) | |
190 | +#define HUY_GETPLAYBACKORDER (HUY_INFO_PLAYBACK | 0x05) | |
191 | + | |
192 | +//! プレイリストのファイルパスを取得する | |
193 | +#define HUY_GETLISTFILEPATH (HUY_INFO_PLAYLIST | 0x00) | |
194 | + | |
195 | +//! プレイリスト名を取得する | |
196 | +#define HUY_GETLISTNAME (HUY_INFO_PLAYLIST | 0x01) | |
197 | + | |
198 | +//! プレイリストの長さを取得する | |
199 | +#define HUY_GETLISTLENGTH (HUY_INFO_PLAYLIST | 0x02) | |
200 | + | |
201 | +//! エントリタイトルを取得する | |
202 | +#define HUY_GETENTRYTITLE (HUY_INFO_PLAYLIST | 0x03) | |
203 | + | |
204 | +//! フォーカス中のプレイリスト位置を取得する | |
205 | +#define HUY_GETLISTFOCUSPOS (HUY_INFO_PLAYLIST | 0x04) | |
206 | + | |
207 | +//! プレイリスト情報の更新(Huygens内部制御用) | |
208 | +#define HUY_REFRESHLISTINFO (HUY_CTRL_PLUGIN | 0x00) | |
209 | + | |
210 | +//! 動的トラック情報の更新(Huygens内部制御用) | |
211 | +#define HUY_REFRESHDYNINFO (HUY_CTRL_PLUGIN | 0x01) | |
212 | + | |
213 | +//! 再生 | |
214 | +#define HUY_PLAY (HUY_CTRL_PLAYBACK | 0x00) | |
215 | + | |
216 | +//! 再生と一時停止のトグル | |
217 | +#define HUY_PLAYORPAUSE (HUY_CTRL_PLAYBACK | 0x14) | |
218 | + | |
219 | +//! 停止 | |
220 | +#define HUY_STOP (HUY_CTRL_PLAYBACK | 0x01) | |
221 | + | |
222 | +//! 一時停止 | |
223 | +#define HUY_PAUSE (HUY_CTRL_PLAYBACK | 0x02) | |
224 | + | |
225 | +//! 早送り(0:1s、1:5s、2:10s、3:30s、4:1min、5:2min、6:5min、7:10min) (in:int) | |
226 | +#define HUY_FASTFORWARD (HUY_CTRL_PLAYBACK | 0x03) | |
227 | + | |
228 | +//! 巻き戻し(0:1s、1:5s、2:10s、3:30s、4:1min、5:2min、6:5min、7:10min) (in:int) | |
229 | +#define HUY_REWIND (HUY_CTRL_PLAYBACK | 0x04) | |
230 | + | |
231 | +//! 前の曲へ | |
232 | +#define HUY_PREVIOUS (HUY_CTRL_PLAYBACK | 0x07) | |
233 | + | |
234 | +//! 次の曲へ | |
235 | +#define HUY_NEXT (HUY_CTRL_PLAYBACK | 0x08) | |
236 | + | |
237 | +//! 再生位置の指定 [msec.×1000] (in:int) | |
238 | +#define HUY_SEEK (HUY_CTRL_PLAYBACK | 0x09) | |
239 | + | |
240 | +//! ボリュームの指定(最小:0〜最大:255) (in:int) | |
241 | +#define HUY_SETVOLUME (HUY_CTRL_PLAYBACK | 0x0A) | |
242 | + | |
243 | +//! ボリュームを上げる | |
244 | +#define HUY_VOLUMEUP (HUY_CTRL_PLAYBACK | 0x0B) | |
245 | + | |
246 | +//! ボリュームを下げる | |
247 | +#define HUY_VOLUMEDOWN (HUY_CTRL_PLAYBACK | 0x0C) | |
248 | + | |
249 | +//! パンの指定(左:0〜右:255) (in:int) | |
250 | +#define HUY_SETPANNING (HUY_CTRL_PLAYBACK | 0x0D) | |
251 | + | |
252 | +//! リピートの指定(1:repeat playlist、2:repeat track、0:not repeat) (in:int) | |
253 | +#define HUY_SETREPEAT (HUY_CTRL_PLAYBACK | 0x0F) | |
254 | + | |
255 | +//! シャッフルの指定(1:shuffle tracks、2:shuffle albums、3:shuffle folders、0:not shuffle) (in:int) [0.9+] | |
256 | +#define HUY_SETSHUFFLE (HUY_CTRL_PLAYBACK | 0x10) | |
257 | + | |
258 | +//! ランダムの指定(1:random、0:not random) (in:int) | |
259 | +#define HUY_SETRANDOM (HUY_CTRL_PLAYBACK | 0x0E) | |
260 | + | |
261 | +//! 再生順の指定 | |
262 | +// (0:default、1:repeat playlist、2:repeat track、3:random、 | |
263 | +// 4:shuffle tracks [0.9+]、5:shuffle albums [0.9+]、6:shuffle folders [0.9+]) (in:int) | |
264 | +#define HUY_SETPLAYBACKORDER (HUY_CTRL_PLAYBACK | 0x15) | |
265 | + | |
266 | +//! リピートのトグル(not repeat→repeat playlist→repeat track→not repeat) | |
267 | +#define HUY_TOGGLEREPEAT (HUY_CTRL_PLAYBACK | 0x12) | |
268 | + | |
269 | +//! シャッフルのトグル(not shuffle→shuffle tracks→shuffle albums→shuffle folders→not shuffle) [0.9+] | |
270 | +#define HUY_TOGGLESHUFFLE (HUY_CTRL_PLAYBACK | 0x13) | |
271 | + | |
272 | +//! ランダムのトグル(not random→random→not random) | |
273 | +#define HUY_TOGGLERANDOM (HUY_CTRL_PLAYBACK | 0x11) | |
274 | + | |
275 | +//! 再生順の指定 | |
276 | +// (default→repeat playlist→repeat track→rando→ | |
277 | +// shuffle tracks [0.9+]→shuffle albums [0.9+]→shuffle folders [0.9+]→ default) | |
278 | +#define HUY_TOGGLEPLAYBACKORDER (HUY_CTRL_PLAYBACK | 0x16) | |
279 | + | |
280 | +//! 新規プレイリストを作成する | |
281 | +#define HUY_CREATELIST (HUY_CTRL_PLAYLIST | 0x00) | |
282 | + | |
283 | +//! プレイリストを読み込む | |
284 | +#define HUY_READLIST (HUY_CTRL_PLAYLIST | 0x01) | |
285 | + | |
286 | +//! プレイリストをファイルに出力する | |
287 | +#define HUY_WRITELIST (HUY_CTRL_PLAYLIST | 0x02); | |
288 | + | |
289 | +//! プレイリスト上の指定位置を選択する | |
290 | +#define HUY_SETLISTFOCUSPOS (HUY_CTRL_PLAYLIST | 0x03); | |
291 | + | |
292 | +//! ファイルをプレイリストに挿入する | |
293 | +#define HUY_INSERTFILE (HUY_CTRL_PLAYLIST | 0x04) | |
294 | + | |
295 | +//! ファイルをプレイリストから削除する | |
296 | +#define HUY_DELETEFILE (HUY_CTRL_PLAYLIST | 0x05); | |
297 | + | |
298 | +#endif // !definedHUY_IPC_H_CE87645E_DFB8_4418_A904_403DCB282C84 |
@@ -0,0 +1,674 @@ | ||
1 | + GNU GENERAL PUBLIC LICENSE | |
2 | + Version 3, 29 June 2007 | |
3 | + | |
4 | + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | |
5 | + Everyone is permitted to copy and distribute verbatim copies | |
6 | + of this license document, but changing it is not allowed. | |
7 | + | |
8 | + Preamble | |
9 | + | |
10 | + The GNU General Public License is a free, copyleft license for | |
11 | +software and other kinds of works. | |
12 | + | |
13 | + The licenses for most software and other practical works are designed | |
14 | +to take away your freedom to share and change the works. By contrast, | |
15 | +the GNU General Public License is intended to guarantee your freedom to | |
16 | +share and change all versions of a program--to make sure it remains free | |
17 | +software for all its users. We, the Free Software Foundation, use the | |
18 | +GNU General Public License for most of our software; it applies also to | |
19 | +any other work released this way by its authors. You can apply it to | |
20 | +your programs, too. | |
21 | + | |
22 | + When we speak of free software, we are referring to freedom, not | |
23 | +price. Our General Public Licenses are designed to make sure that you | |
24 | +have the freedom to distribute copies of free software (and charge for | |
25 | +them if you wish), that you receive source code or can get it if you | |
26 | +want it, that you can change the software or use pieces of it in new | |
27 | +free programs, and that you know you can do these things. | |
28 | + | |
29 | + To protect your rights, we need to prevent others from denying you | |
30 | +these rights or asking you to surrender the rights. Therefore, you have | |
31 | +certain responsibilities if you distribute copies of the software, or if | |
32 | +you modify it: responsibilities to respect the freedom of others. | |
33 | + | |
34 | + For example, if you distribute copies of such a program, whether | |
35 | +gratis or for a fee, you must pass on to the recipients the same | |
36 | +freedoms that you received. You must make sure that they, too, receive | |
37 | +or can get the source code. And you must show them these terms so they | |
38 | +know their rights. | |
39 | + | |
40 | + Developers that use the GNU GPL protect your rights with two steps: | |
41 | +(1) assert copyright on the software, and (2) offer you this License | |
42 | +giving you legal permission to copy, distribute and/or modify it. | |
43 | + | |
44 | + For the developers' and authors' protection, the GPL clearly explains | |
45 | +that there is no warranty for this free software. For both users' and | |
46 | +authors' sake, the GPL requires that modified versions be marked as | |
47 | +changed, so that their problems will not be attributed erroneously to | |
48 | +authors of previous versions. | |
49 | + | |
50 | + Some devices are designed to deny users access to install or run | |
51 | +modified versions of the software inside them, although the manufacturer | |
52 | +can do so. This is fundamentally incompatible with the aim of | |
53 | +protecting users' freedom to change the software. The systematic | |
54 | +pattern of such abuse occurs in the area of products for individuals to | |
55 | +use, which is precisely where it is most unacceptable. Therefore, we | |
56 | +have designed this version of the GPL to prohibit the practice for those | |
57 | +products. If such problems arise substantially in other domains, we | |
58 | +stand ready to extend this provision to those domains in future versions | |
59 | +of the GPL, as needed to protect the freedom of users. | |
60 | + | |
61 | + Finally, every program is threatened constantly by software patents. | |
62 | +States should not allow patents to restrict development and use of | |
63 | +software on general-purpose computers, but in those that do, we wish to | |
64 | +avoid the special danger that patents applied to a free program could | |
65 | +make it effectively proprietary. To prevent this, the GPL assures that | |
66 | +patents cannot be used to render the program non-free. | |
67 | + | |
68 | + The precise terms and conditions for copying, distribution and | |
69 | +modification follow. | |
70 | + | |
71 | + TERMS AND CONDITIONS | |
72 | + | |
73 | + 0. Definitions. | |
74 | + | |
75 | + "This License" refers to version 3 of the GNU General Public License. | |
76 | + | |
77 | + "Copyright" also means copyright-like laws that apply to other kinds of | |
78 | +works, such as semiconductor masks. | |
79 | + | |
80 | + "The Program" refers to any copyrightable work licensed under this | |
81 | +License. Each licensee is addressed as "you". "Licensees" and | |
82 | +"recipients" may be individuals or organizations. | |
83 | + | |
84 | + To "modify" a work means to copy from or adapt all or part of the work | |
85 | +in a fashion requiring copyright permission, other than the making of an | |
86 | +exact copy. The resulting work is called a "modified version" of the | |
87 | +earlier work or a work "based on" the earlier work. | |
88 | + | |
89 | + A "covered work" means either the unmodified Program or a work based | |
90 | +on the Program. | |
91 | + | |
92 | + To "propagate" a work means to do anything with it that, without | |
93 | +permission, would make you directly or secondarily liable for | |
94 | +infringement under applicable copyright law, except executing it on a | |
95 | +computer or modifying a private copy. Propagation includes copying, | |
96 | +distribution (with or without modification), making available to the | |
97 | +public, and in some countries other activities as well. | |
98 | + | |
99 | + To "convey" a work means any kind of propagation that enables other | |
100 | +parties to make or receive copies. Mere interaction with a user through | |
101 | +a computer network, with no transfer of a copy, is not conveying. | |
102 | + | |
103 | + An interactive user interface displays "Appropriate Legal Notices" | |
104 | +to the extent that it includes a convenient and prominently visible | |
105 | +feature that (1) displays an appropriate copyright notice, and (2) | |
106 | +tells the user that there is no warranty for the work (except to the | |
107 | +extent that warranties are provided), that licensees may convey the | |
108 | +work under this License, and how to view a copy of this License. If | |
109 | +the interface presents a list of user commands or options, such as a | |
110 | +menu, a prominent item in the list meets this criterion. | |
111 | + | |
112 | + 1. Source Code. | |
113 | + | |
114 | + The "source code" for a work means the preferred form of the work | |
115 | +for making modifications to it. "Object code" means any non-source | |
116 | +form of a work. | |
117 | + | |
118 | + A "Standard Interface" means an interface that either is an official | |
119 | +standard defined by a recognized standards body, or, in the case of | |
120 | +interfaces specified for a particular programming language, one that | |
121 | +is widely used among developers working in that language. | |
122 | + | |
123 | + The "System Libraries" of an executable work include anything, other | |
124 | +than the work as a whole, that (a) is included in the normal form of | |
125 | +packaging a Major Component, but which is not part of that Major | |
126 | +Component, and (b) serves only to enable use of the work with that | |
127 | +Major Component, or to implement a Standard Interface for which an | |
128 | +implementation is available to the public in source code form. A | |
129 | +"Major Component", in this context, means a major essential component | |
130 | +(kernel, window system, and so on) of the specific operating system | |
131 | +(if any) on which the executable work runs, or a compiler used to | |
132 | +produce the work, or an object code interpreter used to run it. | |
133 | + | |
134 | + The "Corresponding Source" for a work in object code form means all | |
135 | +the source code needed to generate, install, and (for an executable | |
136 | +work) run the object code and to modify the work, including scripts to | |
137 | +control those activities. However, it does not include the work's | |
138 | +System Libraries, or general-purpose tools or generally available free | |
139 | +programs which are used unmodified in performing those activities but | |
140 | +which are not part of the work. For example, Corresponding Source | |
141 | +includes interface definition files associated with source files for | |
142 | +the work, and the source code for shared libraries and dynamically | |
143 | +linked subprograms that the work is specifically designed to require, | |
144 | +such as by intimate data communication or control flow between those | |
145 | +subprograms and other parts of the work. | |
146 | + | |
147 | + The Corresponding Source need not include anything that users | |
148 | +can regenerate automatically from other parts of the Corresponding | |
149 | +Source. | |
150 | + | |
151 | + The Corresponding Source for a work in source code form is that | |
152 | +same work. | |
153 | + | |
154 | + 2. Basic Permissions. | |
155 | + | |
156 | + All rights granted under this License are granted for the term of | |
157 | +copyright on the Program, and are irrevocable provided the stated | |
158 | +conditions are met. This License explicitly affirms your unlimited | |
159 | +permission to run the unmodified Program. The output from running a | |
160 | +covered work is covered by this License only if the output, given its | |
161 | +content, constitutes a covered work. This License acknowledges your | |
162 | +rights of fair use or other equivalent, as provided by copyright law. | |
163 | + | |
164 | + You may make, run and propagate covered works that you do not | |
165 | +convey, without conditions so long as your license otherwise remains | |
166 | +in force. You may convey covered works to others for the sole purpose | |
167 | +of having them make modifications exclusively for you, or provide you | |
168 | +with facilities for running those works, provided that you comply with | |
169 | +the terms of this License in conveying all material for which you do | |
170 | +not control copyright. Those thus making or running the covered works | |
171 | +for you must do so exclusively on your behalf, under your direction | |
172 | +and control, on terms that prohibit them from making any copies of | |
173 | +your copyrighted material outside their relationship with you. | |
174 | + | |
175 | + Conveying under any other circumstances is permitted solely under | |
176 | +the conditions stated below. Sublicensing is not allowed; section 10 | |
177 | +makes it unnecessary. | |
178 | + | |
179 | + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | |
180 | + | |
181 | + No covered work shall be deemed part of an effective technological | |
182 | +measure under any applicable law fulfilling obligations under article | |
183 | +11 of the WIPO copyright treaty adopted on 20 December 1996, or | |
184 | +similar laws prohibiting or restricting circumvention of such | |
185 | +measures. | |
186 | + | |
187 | + When you convey a covered work, you waive any legal power to forbid | |
188 | +circumvention of technological measures to the extent such circumvention | |
189 | +is effected by exercising rights under this License with respect to | |
190 | +the covered work, and you disclaim any intention to limit operation or | |
191 | +modification of the work as a means of enforcing, against the work's | |
192 | +users, your or third parties' legal rights to forbid circumvention of | |
193 | +technological measures. | |
194 | + | |
195 | + 4. Conveying Verbatim Copies. | |
196 | + | |
197 | + You may convey verbatim copies of the Program's source code as you | |
198 | +receive it, in any medium, provided that you conspicuously and | |
199 | +appropriately publish on each copy an appropriate copyright notice; | |
200 | +keep intact all notices stating that this License and any | |
201 | +non-permissive terms added in accord with section 7 apply to the code; | |
202 | +keep intact all notices of the absence of any warranty; and give all | |
203 | +recipients a copy of this License along with the Program. | |
204 | + | |
205 | + You may charge any price or no price for each copy that you convey, | |
206 | +and you may offer support or warranty protection for a fee. | |
207 | + | |
208 | + 5. Conveying Modified Source Versions. | |
209 | + | |
210 | + You may convey a work based on the Program, or the modifications to | |
211 | +produce it from the Program, in the form of source code under the | |
212 | +terms of section 4, provided that you also meet all of these conditions: | |
213 | + | |
214 | + a) The work must carry prominent notices stating that you modified | |
215 | + it, and giving a relevant date. | |
216 | + | |
217 | + b) The work must carry prominent notices stating that it is | |
218 | + released under this License and any conditions added under section | |
219 | + 7. This requirement modifies the requirement in section 4 to | |
220 | + "keep intact all notices". | |
221 | + | |
222 | + c) You must license the entire work, as a whole, under this | |
223 | + License to anyone who comes into possession of a copy. This | |
224 | + License will therefore apply, along with any applicable section 7 | |
225 | + additional terms, to the whole of the work, and all its parts, | |
226 | + regardless of how they are packaged. This License gives no | |
227 | + permission to license the work in any other way, but it does not | |
228 | + invalidate such permission if you have separately received it. | |
229 | + | |
230 | + d) If the work has interactive user interfaces, each must display | |
231 | + Appropriate Legal Notices; however, if the Program has interactive | |
232 | + interfaces that do not display Appropriate Legal Notices, your | |
233 | + work need not make them do so. | |
234 | + | |
235 | + A compilation of a covered work with other separate and independent | |
236 | +works, which are not by their nature extensions of the covered work, | |
237 | +and which are not combined with it such as to form a larger program, | |
238 | +in or on a volume of a storage or distribution medium, is called an | |
239 | +"aggregate" if the compilation and its resulting copyright are not | |
240 | +used to limit the access or legal rights of the compilation's users | |
241 | +beyond what the individual works permit. Inclusion of a covered work | |
242 | +in an aggregate does not cause this License to apply to the other | |
243 | +parts of the aggregate. | |
244 | + | |
245 | + 6. Conveying Non-Source Forms. | |
246 | + | |
247 | + You may convey a covered work in object code form under the terms | |
248 | +of sections 4 and 5, provided that you also convey the | |
249 | +machine-readable Corresponding Source under the terms of this License, | |
250 | +in one of these ways: | |
251 | + | |
252 | + a) Convey the object code in, or embodied in, a physical product | |
253 | + (including a physical distribution medium), accompanied by the | |
254 | + Corresponding Source fixed on a durable physical medium | |
255 | + customarily used for software interchange. | |
256 | + | |
257 | + b) Convey the object code in, or embodied in, a physical product | |
258 | + (including a physical distribution medium), accompanied by a | |
259 | + written offer, valid for at least three years and valid for as | |
260 | + long as you offer spare parts or customer support for that product | |
261 | + model, to give anyone who possesses the object code either (1) a | |
262 | + copy of the Corresponding Source for all the software in the | |
263 | + product that is covered by this License, on a durable physical | |
264 | + medium customarily used for software interchange, for a price no | |
265 | + more than your reasonable cost of physically performing this | |
266 | + conveying of source, or (2) access to copy the | |
267 | + Corresponding Source from a network server at no charge. | |
268 | + | |
269 | + c) Convey individual copies of the object code with a copy of the | |
270 | + written offer to provide the Corresponding Source. This | |
271 | + alternative is allowed only occasionally and noncommercially, and | |
272 | + only if you received the object code with such an offer, in accord | |
273 | + with subsection 6b. | |
274 | + | |
275 | + d) Convey the object code by offering access from a designated | |
276 | + place (gratis or for a charge), and offer equivalent access to the | |
277 | + Corresponding Source in the same way through the same place at no | |
278 | + further charge. You need not require recipients to copy the | |
279 | + Corresponding Source along with the object code. If the place to | |
280 | + copy the object code is a network server, the Corresponding Source | |
281 | + may be on a different server (operated by you or a third party) | |
282 | + that supports equivalent copying facilities, provided you maintain | |
283 | + clear directions next to the object code saying where to find the | |
284 | + Corresponding Source. Regardless of what server hosts the | |
285 | + Corresponding Source, you remain obligated to ensure that it is | |
286 | + available for as long as needed to satisfy these requirements. | |
287 | + | |
288 | + e) Convey the object code using peer-to-peer transmission, provided | |
289 | + you inform other peers where the object code and Corresponding | |
290 | + Source of the work are being offered to the general public at no | |
291 | + charge under subsection 6d. | |
292 | + | |
293 | + A separable portion of the object code, whose source code is excluded | |
294 | +from the Corresponding Source as a System Library, need not be | |
295 | +included in conveying the object code work. | |
296 | + | |
297 | + A "User Product" is either (1) a "consumer product", which means any | |
298 | +tangible personal property which is normally used for personal, family, | |
299 | +or household purposes, or (2) anything designed or sold for incorporation | |
300 | +into a dwelling. In determining whether a product is a consumer product, | |
301 | +doubtful cases shall be resolved in favor of coverage. For a particular | |
302 | +product received by a particular user, "normally used" refers to a | |
303 | +typical or common use of that class of product, regardless of the status | |
304 | +of the particular user or of the way in which the particular user | |
305 | +actually uses, or expects or is expected to use, the product. A product | |
306 | +is a consumer product regardless of whether the product has substantial | |
307 | +commercial, industrial or non-consumer uses, unless such uses represent | |
308 | +the only significant mode of use of the product. | |
309 | + | |
310 | + "Installation Information" for a User Product means any methods, | |
311 | +procedures, authorization keys, or other information required to install | |
312 | +and execute modified versions of a covered work in that User Product from | |
313 | +a modified version of its Corresponding Source. The information must | |
314 | +suffice to ensure that the continued functioning of the modified object | |
315 | +code is in no case prevented or interfered with solely because | |
316 | +modification has been made. | |
317 | + | |
318 | + If you convey an object code work under this section in, or with, or | |
319 | +specifically for use in, a User Product, and the conveying occurs as | |
320 | +part of a transaction in which the right of possession and use of the | |
321 | +User Product is transferred to the recipient in perpetuity or for a | |
322 | +fixed term (regardless of how the transaction is characterized), the | |
323 | +Corresponding Source conveyed under this section must be accompanied | |
324 | +by the Installation Information. But this requirement does not apply | |
325 | +if neither you nor any third party retains the ability to install | |
326 | +modified object code on the User Product (for example, the work has | |
327 | +been installed in ROM). | |
328 | + | |
329 | + The requirement to provide Installation Information does not include a | |
330 | +requirement to continue to provide support service, warranty, or updates | |
331 | +for a work that has been modified or installed by the recipient, or for | |
332 | +the User Product in which it has been modified or installed. Access to a | |
333 | +network may be denied when the modification itself materially and | |
334 | +adversely affects the operation of the network or violates the rules and | |
335 | +protocols for communication across the network. | |
336 | + | |
337 | + Corresponding Source conveyed, and Installation Information provided, | |
338 | +in accord with this section must be in a format that is publicly | |
339 | +documented (and with an implementation available to the public in | |
340 | +source code form), and must require no special password or key for | |
341 | +unpacking, reading or copying. | |
342 | + | |
343 | + 7. Additional Terms. | |
344 | + | |
345 | + "Additional permissions" are terms that supplement the terms of this | |
346 | +License by making exceptions from one or more of its conditions. | |
347 | +Additional permissions that are applicable to the entire Program shall | |
348 | +be treated as though they were included in this License, to the extent | |
349 | +that they are valid under applicable law. If additional permissions | |
350 | +apply only to part of the Program, that part may be used separately | |
351 | +under those permissions, but the entire Program remains governed by | |
352 | +this License without regard to the additional permissions. | |
353 | + | |
354 | + When you convey a copy of a covered work, you may at your option | |
355 | +remove any additional permissions from that copy, or from any part of | |
356 | +it. (Additional permissions may be written to require their own | |
357 | +removal in certain cases when you modify the work.) You may place | |
358 | +additional permissions on material, added by you to a covered work, | |
359 | +for which you have or can give appropriate copyright permission. | |
360 | + | |
361 | + Notwithstanding any other provision of this License, for material you | |
362 | +add to a covered work, you may (if authorized by the copyright holders of | |
363 | +that material) supplement the terms of this License with terms: | |
364 | + | |
365 | + a) Disclaiming warranty or limiting liability differently from the | |
366 | + terms of sections 15 and 16 of this License; or | |
367 | + | |
368 | + b) Requiring preservation of specified reasonable legal notices or | |
369 | + author attributions in that material or in the Appropriate Legal | |
370 | + Notices displayed by works containing it; or | |
371 | + | |
372 | + c) Prohibiting misrepresentation of the origin of that material, or | |
373 | + requiring that modified versions of such material be marked in | |
374 | + reasonable ways as different from the original version; or | |
375 | + | |
376 | + d) Limiting the use for publicity purposes of names of licensors or | |
377 | + authors of the material; or | |
378 | + | |
379 | + e) Declining to grant rights under trademark law for use of some | |
380 | + trade names, trademarks, or service marks; or | |
381 | + | |
382 | + f) Requiring indemnification of licensors and authors of that | |
383 | + material by anyone who conveys the material (or modified versions of | |
384 | + it) with contractual assumptions of liability to the recipient, for | |
385 | + any liability that these contractual assumptions directly impose on | |
386 | + those licensors and authors. | |
387 | + | |
388 | + All other non-permissive additional terms are considered "further | |
389 | +restrictions" within the meaning of section 10. If the Program as you | |
390 | +received it, or any part of it, contains a notice stating that it is | |
391 | +governed by this License along with a term that is a further | |
392 | +restriction, you may remove that term. If a license document contains | |
393 | +a further restriction but permits relicensing or conveying under this | |
394 | +License, you may add to a covered work material governed by the terms | |
395 | +of that license document, provided that the further restriction does | |
396 | +not survive such relicensing or conveying. | |
397 | + | |
398 | + If you add terms to a covered work in accord with this section, you | |
399 | +must place, in the relevant source files, a statement of the | |
400 | +additional terms that apply to those files, or a notice indicating | |
401 | +where to find the applicable terms. | |
402 | + | |
403 | + Additional terms, permissive or non-permissive, may be stated in the | |
404 | +form of a separately written license, or stated as exceptions; | |
405 | +the above requirements apply either way. | |
406 | + | |
407 | + 8. Termination. | |
408 | + | |
409 | + You may not propagate or modify a covered work except as expressly | |
410 | +provided under this License. Any attempt otherwise to propagate or | |
411 | +modify it is void, and will automatically terminate your rights under | |
412 | +this License (including any patent licenses granted under the third | |
413 | +paragraph of section 11). | |
414 | + | |
415 | + However, if you cease all violation of this License, then your | |
416 | +license from a particular copyright holder is reinstated (a) | |
417 | +provisionally, unless and until the copyright holder explicitly and | |
418 | +finally terminates your license, and (b) permanently, if the copyright | |
419 | +holder fails to notify you of the violation by some reasonable means | |
420 | +prior to 60 days after the cessation. | |
421 | + | |
422 | + Moreover, your license from a particular copyright holder is | |
423 | +reinstated permanently if the copyright holder notifies you of the | |
424 | +violation by some reasonable means, this is the first time you have | |
425 | +received notice of violation of this License (for any work) from that | |
426 | +copyright holder, and you cure the violation prior to 30 days after | |
427 | +your receipt of the notice. | |
428 | + | |
429 | + Termination of your rights under this section does not terminate the | |
430 | +licenses of parties who have received copies or rights from you under | |
431 | +this License. If your rights have been terminated and not permanently | |
432 | +reinstated, you do not qualify to receive new licenses for the same | |
433 | +material under section 10. | |
434 | + | |
435 | + 9. Acceptance Not Required for Having Copies. | |
436 | + | |
437 | + You are not required to accept this License in order to receive or | |
438 | +run a copy of the Program. Ancillary propagation of a covered work | |
439 | +occurring solely as a consequence of using peer-to-peer transmission | |
440 | +to receive a copy likewise does not require acceptance. However, | |
441 | +nothing other than this License grants you permission to propagate or | |
442 | +modify any covered work. These actions infringe copyright if you do | |
443 | +not accept this License. Therefore, by modifying or propagating a | |
444 | +covered work, you indicate your acceptance of this License to do so. | |
445 | + | |
446 | + 10. Automatic Licensing of Downstream Recipients. | |
447 | + | |
448 | + Each time you convey a covered work, the recipient automatically | |
449 | +receives a license from the original licensors, to run, modify and | |
450 | +propagate that work, subject to this License. You are not responsible | |
451 | +for enforcing compliance by third parties with this License. | |
452 | + | |
453 | + An "entity transaction" is a transaction transferring control of an | |
454 | +organization, or substantially all assets of one, or subdividing an | |
455 | +organization, or merging organizations. If propagation of a covered | |
456 | +work results from an entity transaction, each party to that | |
457 | +transaction who receives a copy of the work also receives whatever | |
458 | +licenses to the work the party's predecessor in interest had or could | |
459 | +give under the previous paragraph, plus a right to possession of the | |
460 | +Corresponding Source of the work from the predecessor in interest, if | |
461 | +the predecessor has it or can get it with reasonable efforts. | |
462 | + | |
463 | + You may not impose any further restrictions on the exercise of the | |
464 | +rights granted or affirmed under this License. For example, you may | |
465 | +not impose a license fee, royalty, or other charge for exercise of | |
466 | +rights granted under this License, and you may not initiate litigation | |
467 | +(including a cross-claim or counterclaim in a lawsuit) alleging that | |
468 | +any patent claim is infringed by making, using, selling, offering for | |
469 | +sale, or importing the Program or any portion of it. | |
470 | + | |
471 | + 11. Patents. | |
472 | + | |
473 | + A "contributor" is a copyright holder who authorizes use under this | |
474 | +License of the Program or a work on which the Program is based. The | |
475 | +work thus licensed is called the contributor's "contributor version". | |
476 | + | |
477 | + A contributor's "essential patent claims" are all patent claims | |
478 | +owned or controlled by the contributor, whether already acquired or | |
479 | +hereafter acquired, that would be infringed by some manner, permitted | |
480 | +by this License, of making, using, or selling its contributor version, | |
481 | +but do not include claims that would be infringed only as a | |
482 | +consequence of further modification of the contributor version. For | |
483 | +purposes of this definition, "control" includes the right to grant | |
484 | +patent sublicenses in a manner consistent with the requirements of | |
485 | +this License. | |
486 | + | |
487 | + Each contributor grants you a non-exclusive, worldwide, royalty-free | |
488 | +patent license under the contributor's essential patent claims, to | |
489 | +make, use, sell, offer for sale, import and otherwise run, modify and | |
490 | +propagate the contents of its contributor version. | |
491 | + | |
492 | + In the following three paragraphs, a "patent license" is any express | |
493 | +agreement or commitment, however denominated, not to enforce a patent | |
494 | +(such as an express permission to practice a patent or covenant not to | |
495 | +sue for patent infringement). To "grant" such a patent license to a | |
496 | +party means to make such an agreement or commitment not to enforce a | |
497 | +patent against the party. | |
498 | + | |
499 | + If you convey a covered work, knowingly relying on a patent license, | |
500 | +and the Corresponding Source of the work is not available for anyone | |
501 | +to copy, free of charge and under the terms of this License, through a | |
502 | +publicly available network server or other readily accessible means, | |
503 | +then you must either (1) cause the Corresponding Source to be so | |
504 | +available, or (2) arrange to deprive yourself of the benefit of the | |
505 | +patent license for this particular work, or (3) arrange, in a manner | |
506 | +consistent with the requirements of this License, to extend the patent | |
507 | +license to downstream recipients. "Knowingly relying" means you have | |
508 | +actual knowledge that, but for the patent license, your conveying the | |
509 | +covered work in a country, or your recipient's use of the covered work | |
510 | +in a country, would infringe one or more identifiable patents in that | |
511 | +country that you have reason to believe are valid. | |
512 | + | |
513 | + If, pursuant to or in connection with a single transaction or | |
514 | +arrangement, you convey, or propagate by procuring conveyance of, a | |
515 | +covered work, and grant a patent license to some of the parties | |
516 | +receiving the covered work authorizing them to use, propagate, modify | |
517 | +or convey a specific copy of the covered work, then the patent license | |
518 | +you grant is automatically extended to all recipients of the covered | |
519 | +work and works based on it. | |
520 | + | |
521 | + A patent license is "discriminatory" if it does not include within | |
522 | +the scope of its coverage, prohibits the exercise of, or is | |
523 | +conditioned on the non-exercise of one or more of the rights that are | |
524 | +specifically granted under this License. You may not convey a covered | |
525 | +work if you are a party to an arrangement with a third party that is | |
526 | +in the business of distributing software, under which you make payment | |
527 | +to the third party based on the extent of your activity of conveying | |
528 | +the work, and under which the third party grants, to any of the | |
529 | +parties who would receive the covered work from you, a discriminatory | |
530 | +patent license (a) in connection with copies of the covered work | |
531 | +conveyed by you (or copies made from those copies), or (b) primarily | |
532 | +for and in connection with specific products or compilations that | |
533 | +contain the covered work, unless you entered into that arrangement, | |
534 | +or that patent license was granted, prior to 28 March 2007. | |
535 | + | |
536 | + Nothing in this License shall be construed as excluding or limiting | |
537 | +any implied license or other defenses to infringement that may | |
538 | +otherwise be available to you under applicable patent law. | |
539 | + | |
540 | + 12. No Surrender of Others' Freedom. | |
541 | + | |
542 | + If conditions are imposed on you (whether by court order, agreement or | |
543 | +otherwise) that contradict the conditions of this License, they do not | |
544 | +excuse you from the conditions of this License. If you cannot convey a | |
545 | +covered work so as to satisfy simultaneously your obligations under this | |
546 | +License and any other pertinent obligations, then as a consequence you may | |
547 | +not convey it at all. For example, if you agree to terms that obligate you | |
548 | +to collect a royalty for further conveying from those to whom you convey | |
549 | +the Program, the only way you could satisfy both those terms and this | |
550 | +License would be to refrain entirely from conveying the Program. | |
551 | + | |
552 | + 13. Use with the GNU Affero General Public License. | |
553 | + | |
554 | + Notwithstanding any other provision of this License, you have | |
555 | +permission to link or combine any covered work with a work licensed | |
556 | +under version 3 of the GNU Affero General Public License into a single | |
557 | +combined work, and to convey the resulting work. The terms of this | |
558 | +License will continue to apply to the part which is the covered work, | |
559 | +but the special requirements of the GNU Affero General Public License, | |
560 | +section 13, concerning interaction through a network will apply to the | |
561 | +combination as such. | |
562 | + | |
563 | + 14. Revised Versions of this License. | |
564 | + | |
565 | + The Free Software Foundation may publish revised and/or new versions of | |
566 | +the GNU General Public License from time to time. Such new versions will | |
567 | +be similar in spirit to the present version, but may differ in detail to | |
568 | +address new problems or concerns. | |
569 | + | |
570 | + Each version is given a distinguishing version number. If the | |
571 | +Program specifies that a certain numbered version of the GNU General | |
572 | +Public License "or any later version" applies to it, you have the | |
573 | +option of following the terms and conditions either of that numbered | |
574 | +version or of any later version published by the Free Software | |
575 | +Foundation. If the Program does not specify a version number of the | |
576 | +GNU General Public License, you may choose any version ever published | |
577 | +by the Free Software Foundation. | |
578 | + | |
579 | + If the Program specifies that a proxy can decide which future | |
580 | +versions of the GNU General Public License can be used, that proxy's | |
581 | +public statement of acceptance of a version permanently authorizes you | |
582 | +to choose that version for the Program. | |
583 | + | |
584 | + Later license versions may give you additional or different | |
585 | +permissions. However, no additional obligations are imposed on any | |
586 | +author or copyright holder as a result of your choosing to follow a | |
587 | +later version. | |
588 | + | |
589 | + 15. Disclaimer of Warranty. | |
590 | + | |
591 | + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | |
592 | +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | |
593 | +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | |
594 | +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | |
595 | +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
596 | +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | |
597 | +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | |
598 | +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |
599 | + | |
600 | + 16. Limitation of Liability. | |
601 | + | |
602 | + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
603 | +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | |
604 | +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | |
605 | +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | |
606 | +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | |
607 | +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | |
608 | +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | |
609 | +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | |
610 | +SUCH DAMAGES. | |
611 | + | |
612 | + 17. Interpretation of Sections 15 and 16. | |
613 | + | |
614 | + If the disclaimer of warranty and limitation of liability provided | |
615 | +above cannot be given local legal effect according to their terms, | |
616 | +reviewing courts shall apply local law that most closely approximates | |
617 | +an absolute waiver of all civil liability in connection with the | |
618 | +Program, unless a warranty or assumption of liability accompanies a | |
619 | +copy of the Program in return for a fee. | |
620 | + | |
621 | + END OF TERMS AND CONDITIONS | |
622 | + | |
623 | + How to Apply These Terms to Your New Programs | |
624 | + | |
625 | + If you develop a new program, and you want it to be of the greatest | |
626 | +possible use to the public, the best way to achieve this is to make it | |
627 | +free software which everyone can redistribute and change under these terms. | |
628 | + | |
629 | + To do so, attach the following notices to the program. It is safest | |
630 | +to attach them to the start of each source file to most effectively | |
631 | +state the exclusion of warranty; and each file should have at least | |
632 | +the "copyright" line and a pointer to where the full notice is found. | |
633 | + | |
634 | + <one line to give the program's name and a brief idea of what it does.> | |
635 | + Copyright (C) <year> <name of author> | |
636 | + | |
637 | + This program is free software: you can redistribute it and/or modify | |
638 | + it under the terms of the GNU General Public License as published by | |
639 | + the Free Software Foundation, either version 3 of the License, or | |
640 | + (at your option) any later version. | |
641 | + | |
642 | + This program is distributed in the hope that it will be useful, | |
643 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
644 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
645 | + GNU General Public License for more details. | |
646 | + | |
647 | + You should have received a copy of the GNU General Public License | |
648 | + along with this program. If not, see <http://www.gnu.org/licenses/>. | |
649 | + | |
650 | +Also add information on how to contact you by electronic and paper mail. | |
651 | + | |
652 | + If the program does terminal interaction, make it output a short | |
653 | +notice like this when it starts in an interactive mode: | |
654 | + | |
655 | + <program> Copyright (C) <year> <name of author> | |
656 | + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
657 | + This is free software, and you are welcome to redistribute it | |
658 | + under certain conditions; type `show c' for details. | |
659 | + | |
660 | +The hypothetical commands `show w' and `show c' should show the appropriate | |
661 | +parts of the General Public License. Of course, your program's commands | |
662 | +might be different; for a GUI interface, you would use an "about box". | |
663 | + | |
664 | + You should also get your employer (if you work as a programmer) or school, | |
665 | +if any, to sign a "copyright disclaimer" for the program, if necessary. | |
666 | +For more information on this, and how to apply and follow the GNU GPL, see | |
667 | +<http://www.gnu.org/licenses/>. | |
668 | + | |
669 | + The GNU General Public License does not permit incorporating your program | |
670 | +into proprietary programs. If your program is a subroutine library, you | |
671 | +may consider it more useful to permit linking proprietary applications with | |
672 | +the library. If this is what you want to do, use the GNU Lesser General | |
673 | +Public License instead of this License. But first, please read | |
674 | +<http://www.gnu.org/philosophy/why-not-lgpl.html>. |
@@ -0,0 +1,39 @@ | ||
1 | +//{{NO_DEPENDENCIES}} | |
2 | +// Microsoft Visual C++ generated include file. | |
3 | +// Used by foo_huygens.rc | |
4 | +// | |
5 | +#define IDD_PREFERENCE 101 | |
6 | +#define IDD_ADVANCED_SETTINGS 102 | |
7 | +#define IDD_DEBUG_SETTINGS 103 | |
8 | +#define IDC_CONFIGURE 1000 | |
9 | +#define IDC_USE_PLUGIN 1001 | |
10 | +#define IDC_VERSION 1002 | |
11 | +#define IDC_BUILD 1003 | |
12 | +#define IDC_CAPTION_ADVANCED 1004 | |
13 | +#define IDC_VERSION_ADVANCED 1005 | |
14 | +#define IDC_BUILD_ADVANCED 1006 | |
15 | +#define IDC_HUYGENS_FRAME 1007 | |
16 | +#define IDC_SHOW_HUYGENS 1008 | |
17 | +#define IDC_HUYGENS_TITLE_FORMAT 1009 | |
18 | +#define IDC_HUYGENS_PLAYLIST_FORMAT 1010 | |
19 | +#define IDC_DISABLE_ANSI_TRANS 1011 | |
20 | +#define IDC_CAPTION_DEBUG 1012 | |
21 | +#define IDC_ENABLE_DEBUG_LOG 1013 | |
22 | +#define IDC_DEBUG_HUYGENS_INIT 1014 | |
23 | +#define IDC_DEBUG_HUYGENS_PROC 1015 | |
24 | +#define IDC_DEBUG_TRACK_INFO 1016 | |
25 | +#define IDC_DEBUG_PLUGIN 1017 | |
26 | +#define IDC_DEBUG_CALLBACK 1018 | |
27 | +#define IDC_VERSION_DEBUG 1019 | |
28 | +#define IDC_BUILD_DEBUG 1020 | |
29 | + | |
30 | +// Next default values for new objects | |
31 | +// | |
32 | +#ifdef APSTUDIO_INVOKED | |
33 | +#ifndef APSTUDIO_READONLY_SYMBOLS | |
34 | +#define _APS_NEXT_RESOURCE_VALUE 104 | |
35 | +#define _APS_NEXT_COMMAND_VALUE 40001 | |
36 | +#define _APS_NEXT_CONTROL_VALUE 1021 | |
37 | +#define _APS_NEXT_SYMED_VALUE 101 | |
38 | +#endif | |
39 | +#endif |
@@ -0,0 +1,3044 @@ | ||
1 | +#define BUILD_UNICODE | |
2 | + | |
3 | +#if defined(BUILD_UNICODE) | |
4 | +#if !defined(UNICODE) | |
5 | +#define _UNICODE | |
6 | +#define UNICODE | |
7 | +#endif | |
8 | +#endif | |
9 | + | |
10 | +#if defined(UNICODE) && !defined(BUILD_UNICODE) | |
11 | +#define BUILD_UNICODE | |
12 | +#endif | |
13 | + | |
14 | +#define LONG_PTR_TO_WNDPROC(p) (reinterpret_cast<WNDPROC>(p)) | |
15 | +#define WNDPROC_TO_LONG_PTR(p) (reinterpret_cast<LONG_PTR>(p)) | |
16 | + | |
17 | +#include <windows.h> | |
18 | +#include <lmcons.h> | |
19 | +#include <process.h> | |
20 | +#include <shlobj.h> | |
21 | + | |
22 | +#include <string> | |
23 | +#include <vector> | |
24 | +#include <map> | |
25 | + | |
26 | +#include "../SDK/foobar2000.h" | |
27 | +#include "../SDK/component.h" | |
28 | +#include "../helpers/helpers.h" | |
29 | + | |
30 | +#include "huy_ipc.h" | |
31 | + | |
32 | +#include "resource.h" | |
33 | + | |
34 | +#if defined(_FOOBAR2000_UTF8API_H_) | |
35 | +# define FB2K_MAJOR_VERSION 8 | |
36 | +#else | |
37 | +# define FB2K_MAJOR_VERSION 9 | |
38 | +#endif | |
39 | + | |
40 | +#define IS_FB2K_VER08 (FB2K_MAJOR_VERSION == 8) | |
41 | +#define IS_FB2K_VER09 (FB2K_MAJOR_VERSION == 9) | |
42 | + | |
43 | +#define FB2K_COMPONENTS_DIR _T("components\\") | |
44 | +#define DEFAULT_HUYGENS_TITLE "Huygens" | |
45 | + | |
46 | +#define PLUGIN_CAPTION "Huygens - The Free Song Information Exploring Probe" | |
47 | +#define PLUGIN_CAPTION_JP "無料曲情報探索突入機 Huygens" | |
48 | + | |
49 | +#define ADVANCED_SETTINGS_CAPTION "高度な設定" | |
50 | +#define DEBUG_SETTINGS_CAPTION "デバッグ用の設定" | |
51 | + | |
52 | +#define PLUGIN_VERSION_VAL "0.021" | |
53 | +#define PLUGIN_VERSION_PREFIX "No. " | |
54 | +#define PLUGIN_VERSION _T(PLUGIN_VERSION_PREFIX) _T(PLUGIN_VERSION_VAL) | |
55 | + | |
56 | +#define FILE_PROTOCOL "file://" | |
57 | + | |
58 | +#define DEFAULT_HUYGENS_TITLE_FORMAT "[%artist% - ]$if(%title%,%title%,%_filename%)" | |
59 | + | |
60 | +#define URL_FOO_HUYGENS_HOME "http://foo-huygens.sourceforge.jp/" | |
61 | + | |
62 | +#if IS_FB2K_VER08 | |
63 | +#define CLASSNAME DEFAULT_HUYGENS_TITLE " v1.x" | |
64 | +#else | |
65 | +#define CLASSNAME _T(DEFAULT_HUYGENS_TITLE) _T(" v1.x") | |
66 | +#endif | |
67 | + | |
68 | +#define FORMAT_FB2KVERSION "%_foobar2000_version%" | |
69 | +#define FORMAT_FILEPATH "%_path%" | |
70 | +#define FORMAT_FILEPATHRAW "%_path_raw%" | |
71 | +#define FORMAT_ARTIST "%artist%" | |
72 | +#define FORMAT_TRACKTITLE "%title%" | |
73 | +#define FORMAT_ALBUMTITLE "%album%" | |
74 | +#define FORMAT_GENRE "%genre%" | |
75 | +#define FORMAT_TRACKDATE "%date%" | |
76 | +#define FORMAT_COMPOSER "%composer%" | |
77 | +#define FORMAT_PERFORMER "%performer%" | |
78 | +#define FORMAT_ALBUMARTIST "%album artist%" | |
79 | +#define FORMAT_TRACKARTIST "%track artist%" | |
80 | +#if IS_FB2K_VER08 | |
81 | +#define FORMAT_SUBSONG "%_subsong%" | |
82 | +#elif IS_FB2K_VER09 | |
83 | +#define FORMAT_SUBSONG "%subsong%" | |
84 | +#endif | |
85 | +#define FORMAT_TRACKNUMBER "%tracknumber%" | |
86 | +#define FORMAT_TRACKTOTAL "%totaltracks%" | |
87 | +#define FORMAT_DISCNUMBER "%discnumber%" | |
88 | +#define FORMAT_DISCTOTAL "%totaldiscs%" | |
89 | +#define FORMAT_COMMENT "%comment%" | |
90 | + | |
91 | +#define FORMAT_SAMPLERATE "%__samplerate%" | |
92 | +#define FORMAT_BITRATE "%__bitrate%" | |
93 | +#define FORMAT_BITRATE_NOMINAL "%__bitrate_nominal%" | |
94 | +#define FORMAT_BITRATE_DYNAMIC "%__bitrate_dynamic%" | |
95 | +#define FORMAT_CHANNELS "%__channels%" | |
96 | +#define FORMAT_BITSPERSAMPLE "%__bitspersample%" | |
97 | +#define FORMAT_CODEC "%__codec%" | |
98 | +#define FORMAT_CODECPROFILE "%__codec_profile%" | |
99 | +#define FORMAT_LOSSLESS "$if2($strcmp(%__encoding%,lossless), 0)" | |
100 | +#define FORMAT_TAGTYPE "%__tagtype%" | |
101 | + | |
102 | +#define FORMAT_EXTRAINFO "%__extrainfo %" | |
103 | +#define FORMAT_TOOL "%__tool%" | |
104 | +#define FORMAT_CUEEMBEDDED "$if2($strcmp(%__cue_embedded%,yes), 0)" | |
105 | +#define FORMAT_AUDIOMD5HASH "%__MD5%" | |
106 | +#define FORMAT_MP3STEREOMODE "$if2($strcmp(%__mp3_stereo_mode%,joint stereo), 0)" | |
107 | +#define FORMAT_MP3ACCURATELENGTH "$if2($strcmp(%__mp3_accurate_length%,yes), 0)" | |
108 | +#define FORMAT_MP3ENCDELAY "%__enc_delay%" | |
109 | +#define FORMAT_MP3ENCPADDING "%__enc_padding%" | |
110 | +#define FORMAT_APEVERSION "%__version%" | |
111 | +#define FORMAT_APEFLAGS "%__flags%" | |
112 | + | |
113 | +#define FORMAT_REPLAYGAIN_ALBUMGAIN "%__replaygain_album_gain%" | |
114 | +#define FORMAT_REPLAYGAIN_ALBUMPEEK "%__replaygain_album_peek%" | |
115 | +#define FORMAT_REPLAYGAIN_TRACKGAIN "%__replaygain_track_gain%" | |
116 | +#define FORMAT_REPLAYGAIN_TRACKPEEK "%__replaygain_track_peek%" | |
117 | + | |
118 | +#define FORMAT_FILESIZE "%filesize%" | |
119 | +#define FORMAT_FILECREATED "fileCreated" | |
120 | +#define FORMAT_FILELASTMOD "fileLastModified" | |
121 | +#define FORMAT_ISINMEDIALIB "isInMediaLib" | |
122 | + | |
123 | + | |
124 | +#if IS_FB2K_VER08 | |
125 | +#define FORMAT_LENGTHSAMPLES "%length_samples%" | |
126 | +#define FORMAT_LISTINDEX "%_playlist_number%" | |
127 | +#define FORMAT_LISTTOTAL "%_playlist_total%" | |
128 | +#define FORMAT_PLAYLIST_NAME "%_playlist_name%" | |
129 | +#elif IS_FB2K_VER09 | |
130 | +#define FORMAT_LENGTHSAMPLES "%length_samples%" | |
131 | +#define FORMAT_LISTINDEX "%list_index%" | |
132 | +#define FORMAT_LISTTOTAL "%list_total%" | |
133 | +#define FORMAT_PLAYLIST_NAME "%playlist_name%" | |
134 | +#endif | |
135 | + | |
136 | +#if IS_FB2K_VER09 | |
137 | +using namespace pfc; | |
138 | +using namespace pfc::stringcvt; | |
139 | +#define pfc_string_to_float string_to_float | |
140 | +#endif | |
141 | + | |
142 | +/* | |
143 | + foo_huygens: project dependencies | |
144 | + | |
145 | + foo_huygens | |
146 | + foobar2000_SDK | |
147 | + utf8api(0.8.3) | |
148 | + pfc | |
149 | + foobar2000_sdk_helpers | |
150 | + pfc | |
151 | + foobar2000_component_client | |
152 | + | |
153 | + library dependencies: ../shared/shared.lib(0.9.X), shlwapi.lib(0.9.X) | |
154 | + runtime library: Multi-Thread (DLL) or (Debug,DLL) | |
155 | + !! ensure all projects that depended from this project are correctly set to MT DLL !! | |
156 | + ignore: LIBCMT [Win32 Release] (or LIBCMTD [Win32 Debug]) | |
157 | +*/ | |
158 | + | |
159 | +// if wxWidgets are updated, change lib names below and linker libpath option. | |
160 | + | |
161 | +#if IS_FB2K_VER09 | |
162 | +#pragma comment(lib, "../shared/shared.lib") | |
163 | + | |
164 | +// for StrCmpLogicalW in metadb_handle_list.cpp | |
165 | +#pragma comment(lib, "shlwapi.lib") | |
166 | +#endif | |
167 | + | |
168 | +typedef std::basic_string<TCHAR> tstring; | |
169 | + | |
170 | +typedef TCHAR Str64K[65536]; | |
171 | +typedef char StrDBCS64K[65536]; | |
172 | + | |
173 | +tstring GetErrorMessage(DWORD errCode); | |
174 | +void putLogError(LPCTSTR pMethod, LPCTSTR pErrMsg, DWORD dwErrCode); | |
175 | +void setDlgVersionInfo(HWND wnd, UINT idc_version, UINT idc_build); | |
176 | +void DebugPrint(LPCTSTR lpszFormat, ...); | |
177 | +void DebugPrint8(LPCSTR lpszFormat, ...); | |
178 | + | |
179 | +#define LOGLEVEL_NONE 0 | |
180 | +#define LOGLEVEL_DEBUG 1 | |
181 | +#define LOGLEVEL_TRACE 2 | |
182 | + | |
183 | +#define LOG_TRACE(f, ...) if(cfg_enable_debug_log) DebugPrint(f, __VA_ARGS__) | |
184 | +#define LOG_DEBUG(f, ...) if(cfg_enable_debug_log) DebugPrint(f, __VA_ARGS__) | |
185 | + | |
186 | +#define LOG_TRACE8(f, ...) if(cfg_enable_debug_log) DebugPrint8(f, __VA_ARGS__) | |
187 | +#define LOG_DEBUG8(f, ...) if(cfg_enable_debug_log) DebugPrint8(f, __VA_ARGS__) | |
188 | + | |
189 | +#define LOG_INFO(f, ...) DebugPrint(f, __VA_ARGS__) | |
190 | +#define LOG_WARN(f, ...) DebugPrint(f, __VA_ARGS__) | |
191 | +#define LOG_ERROR(f, ...) DebugPrint(f, __VA_ARGS__) | |
192 | + | |
193 | +#if defined(BUILD_UNICODE) | |
194 | +#define TRACE_DBCS(f, ...) if(cfg_enable_debug_log) DebugPrintDBCS(f, __VA_ARGS__) | |
195 | +#else | |
196 | +#define TRACE_DBCS(f, ...) if(cfg_enable_debug_log) DebugPrint(f, __VA_ARGS__) | |
197 | +#endif | |
198 | + | |
199 | +#define DEBUG_HUYGENS_INIT(f, ...) if(cfg_debug_huygens_init >= LOGLEVEL_DEBUG) LOG_DEBUG(f, __VA_ARGS__) | |
200 | +#define TRACE_HUYGENS_INIT(f, ...) if(cfg_debug_huygens_init >= LOGLEVEL_TRACE) LOG_TRACE(f, __VA_ARGS__) | |
201 | + | |
202 | +#define DEBUG_HUYGENS_PROC(f, ...) if(cfg_debug_huygens_proc >= LOGLEVEL_DEBUG) LOG_DEBUG(f, __VA_ARGS__) | |
203 | +#define DEBUG_HUYGENS_PROC8(f, ...) if(cfg_debug_huygens_proc >= LOGLEVEL_DEBUG) LOG_DEBUG8(f, __VA_ARGS__) | |
204 | +#define TRACE_HUYGENS_PROC(f, ...) if(cfg_debug_huygens_proc >= LOGLEVEL_TRACE) LOG_TRACE(f, __VA_ARGS__) | |
205 | +#define TRACE_HUYGENS_PROC8(f, ...) if(cfg_debug_huygens_proc >= LOGLEVEL_TRACE) LOG_TRACE8(f, __VA_ARGS__) | |
206 | + | |
207 | +#define DEBUG_TRACK_INFO(f, ...) if(cfg_debug_track_info >= LOGLEVEL_DEBUG) LOG_DEBUG(f, __VA_ARGS__) | |
208 | +#define DEBUG_TRACK_INFO8(f, ...) if(cfg_debug_track_info >= LOGLEVEL_DEBUG) LOG_DEBUG8(f, __VA_ARGS__) | |
209 | +#define TRACE_TRACK_INFO(f, ...) if(cfg_debug_track_info >= LOGLEVEL_TRACE) LOG_TRACE(f, __VA_ARGS__) | |
210 | +#define TRACE_TRACK_INFO8(f, ...) if(cfg_debug_track_info >= LOGLEVEL_TRACE) LOG_TRACE8(f, __VA_ARGS__) | |
211 | + | |
212 | +#define DEBUG_PLUGIN(f, ...) if(cfg_debug_plugin >= LOGLEVEL_DEBUG) LOG_DEBUG(f, __VA_ARGS__) | |
213 | +#define TRACE_PLUGIN(f, ...) if(cfg_debug_plugin >= LOGLEVEL_TRACE) LOG_TRACE(f, __VA_ARGS__) | |
214 | + | |
215 | +#define DEBUG_CALLBACK(f, ...) if(cfg_debug_callback >= LOGLEVEL_DEBUG) LOG_DEBUG(f, __VA_ARGS__) | |
216 | +#define TRACE_CALLBACK(f, ...) if(cfg_debug_callback >= LOGLEVEL_TRACE) LOG_TRACE(f, __VA_ARGS__) | |
217 | + | |
218 | +static string_utf8_from_os g_pluginCaption8(_T(PLUGIN_CAPTION_JP)); | |
219 | +static string_utf8_from_os g_pluginVersion8(PLUGIN_VERSION); | |
220 | +static string_utf8_from_os g_pluginAbout8(_T(PLUGIN_CAPTION_JP) _T(" ") PLUGIN_VERSION _T("\nCopyright (C) 2008, 2009 Yossiepon Oniichan, All Rights Reserved.")); | |
221 | + | |
222 | +DECLARE_COMPONENT_VERSION(g_pluginCaption8, g_pluginVersion8, g_pluginAbout8); | |
223 | + | |
224 | +static string_utf8_from_os g_advancedSettingsCaption8(_T(ADVANCED_SETTINGS_CAPTION)); | |
225 | +static string_utf8_from_os g_debugSettingsCaption8(_T(DEBUG_SETTINGS_CAPTION)); | |
226 | + | |
227 | +static string_utf8_from_os g_menu_item(_T("Components/Huygens/Huygens の応答機能を有効にする")); | |
228 | + | |
229 | +static string_utf8_from_os g_menu_item_title(_T("Huygens の応答機能を有効にする")); | |
230 | +static string_utf8_from_os g_menu_item_description(_T("Cassini 等の外部ツールからのメッセージに対する応答機能について、有効/無効を切り替えます")); | |
231 | + | |
232 | +#if IS_FB2K_VER08 | |
233 | +static cfg_int cfg_use_plugin("usePlugin", 1); | |
234 | + | |
235 | +static cfg_int cfg_show_huygens("ShowHuygens", 0); | |
236 | +static cfg_string cfg_huygens_title_format("HuygensTitleFormat", DEFAULT_HUYGENS_TITLE_FORMAT); | |
237 | +static cfg_string cfg_huygens_playlist_format("HuygensPlaylistFormat", DEFAULT_HUYGENS_TITLE_FORMAT); | |
238 | +static cfg_int cfg_disable_ansi_trans("DisableAnsiTrans", 1); | |
239 | + | |
240 | +static cfg_int cfg_enable_debug_log("EnableDebugLog", 1); | |
241 | +static cfg_int cfg_debug_huygens_init("DebugHuygensInit", 1); | |
242 | +static cfg_int cfg_debug_huygens_proc("DebugHuygensProc", 1); | |
243 | +static cfg_int cfg_debug_track_info("DebugTrackInfo", 1); | |
244 | +static cfg_int cfg_debug_plugin("DebugPlugin", 1); | |
245 | +static cfg_int cfg_debug_callback("DebugCallback", 1); | |
246 | +#elif IS_FB2K_VER09 | |
247 | +// {0F6B1827-F2B6-4a3d-B566-1740AA4DA80A} | |
248 | +static const GUID cfg_use_plugin_guid = { 0xf6b1827, 0xf2b6, 0x4a3d, { 0xb5, 0x66, 0x17, 0x40, 0xaa, 0x4d, 0xa8, 0xa } }; | |
249 | +static cfg_int cfg_use_plugin(cfg_use_plugin_guid, 1); | |
250 | + | |
251 | +// {58C73D35-1BFC-4f60-B942-F06CAFD74CCD} | |
252 | +static const GUID cfg_show_huygens_guid = { 0x58c73d35, 0x1bfc, 0x4f60, { 0xb9, 0x42, 0xf0, 0x6c, 0xaf, 0xd7, 0x4c, 0xcd } }; | |
253 | +static cfg_int cfg_show_huygens(cfg_show_huygens_guid, 0); | |
254 | +// {E4EE2EFC-9CFD-4abe-93FE-01DDD5CCA4BF} | |
255 | +static const GUID cfg_huygens_title_format_guid = { 0xe4ee2efc, 0x9cfd, 0x4abe, { 0x93, 0xfe, 0x1, 0xdd, 0xd5, 0xcc, 0xa4, 0xbf } }; | |
256 | +static cfg_string cfg_huygens_title_format(cfg_huygens_title_format_guid, DEFAULT_HUYGENS_TITLE_FORMAT); | |
257 | +// {6FA295D0-DE65-4688-81E6-3D9E5D11DCD4} | |
258 | +static const GUID cfg_huygens_playlist_format_guid = { 0x6fa295d0, 0xde65, 0x4688, { 0x81, 0xe6, 0x3d, 0x9e, 0x5d, 0x11, 0xdc, 0xd4 } }; | |
259 | +static cfg_string cfg_huygens_playlist_format(cfg_huygens_title_format_guid, DEFAULT_HUYGENS_TITLE_FORMAT); | |
260 | + | |
261 | +// {14675AAF-BD88-46cf-89EB-9145424CFE04} | |
262 | +static const GUID cfg_disable_ansi_trans_guid = { 0x14675aaf, 0xbd88, 0x46cf, { 0x89, 0xeb, 0x91, 0x45, 0x42, 0x4c, 0xfe, 0x4 } }; | |
263 | +static cfg_int cfg_disable_ansi_trans(cfg_disable_ansi_trans_guid, 1); | |
264 | + | |
265 | +// {85624EA1-F4BF-4909-B1B1-7EDD0237EAF2} | |
266 | +static const GUID cfg_enable_debug_log_guid = { 0x85624ea1, 0xf4bf, 0x4909, { 0xb1, 0xb1, 0x7e, 0xdd, 0x2, 0x37, 0xea, 0xf2 } }; | |
267 | +static cfg_int cfg_enable_debug_log(cfg_enable_debug_log_guid, 1); // debug log enabled | |
268 | +// {65CDEA92-6057-47b5-8BF7-40192788CCB6} | |
269 | +static const GUID cfg_debug_huygens_init_guid = { 0x65cdea92, 0x6057, 0x47b5, { 0x8b, 0xf7, 0x40, 0x19, 0x27, 0x88, 0xcc, 0xb6 } }; | |
270 | +static cfg_int cfg_debug_huygens_init(cfg_debug_huygens_init_guid, 1); // debug level | |
271 | +// {D3DDB68F-0BD0-47b9-8E1E-5E46BC16D89B} | |
272 | +static const GUID cfg_debug_huygens_proc_guid = { 0xd3ddb68f, 0xbd0, 0x47b9, { 0x8e, 0x1e, 0x5e, 0x46, 0xbc, 0x16, 0xd8, 0x9b } }; | |
273 | +static cfg_int cfg_debug_huygens_proc(cfg_debug_huygens_proc_guid, 1); // debug level | |
274 | +// {1F654881-CCD5-4a75-A7FC-2073B84EEAC1} | |
275 | +static const GUID cfg_debug_track_info_guid = { 0x1f654881, 0xccd5, 0x4a75, { 0xa7, 0xfc, 0x20, 0x73, 0xb8, 0x4e, 0xea, 0xc1 } }; | |
276 | +static cfg_int cfg_debug_track_info(cfg_debug_track_info_guid, 1); // debug level | |
277 | +// {A4C79E60-72A1-4a08-ACA0-F56F3DD6452D} | |
278 | +static const GUID cfg_debug_plugin_guid = { 0xa4c79e60, 0x72a1, 0x4a08, { 0xac, 0xa0, 0xf5, 0x6f, 0x3d, 0xd6, 0x45, 0x2d } }; | |
279 | +static cfg_int cfg_debug_plugin(cfg_debug_plugin_guid, 1); // debug level | |
280 | +// {CDCB6FAB-7A14-455e-80EA-D7F3E14E13AE} | |
281 | +static const GUID cfg_debug_callback_guid = { 0xcdcb6fab, 0x7a14, 0x455e, { 0x80, 0xea, 0xd7, 0xf3, 0xe1, 0x4e, 0x13, 0xae } }; | |
282 | +static cfg_int cfg_debug_callback(cfg_debug_callback_guid, 1); // debug level | |
283 | +#endif | |
284 | + | |
285 | +struct TRACK_INFO8 | |
286 | +{ | |
287 | + std::map<std::string, std::string> m_infoMap8; | |
288 | + std::map<std::string, std::string> m_infoMapAnsi; | |
289 | + | |
290 | + std::map<std::string, UINT> m_infoMapNum; | |
291 | + | |
292 | + std::string m_nullStr; | |
293 | + | |
294 | + void clear() | |
295 | + { | |
296 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::clear - called.")); | |
297 | + | |
298 | + m_infoMap8.clear(); | |
299 | + m_infoMapAnsi.clear(); | |
300 | + m_infoMapNum.clear(); | |
301 | + } | |
302 | + | |
303 | + bool isEmpty() const { return m_infoMap8.empty() | m_infoMapNum.empty(); } | |
304 | + | |
305 | +public: | |
306 | + | |
307 | +#if IS_FB2K_VER08 | |
308 | + void setStrings(std::vector<std::string> & keys, metadb_handle * track) | |
309 | +#elif IS_FB2K_VER09 | |
310 | + void setStrings(std::vector<std::string> & keys, metadb_handle_ptr track) | |
311 | +#endif | |
312 | + { | |
313 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setStrings - called.")); | |
314 | + | |
315 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
316 | + | |
317 | + for(it = beginIt; it != endIt; it ++) { | |
318 | + | |
319 | + string8 info8; | |
320 | + | |
321 | +#if IS_FB2K_VER08 | |
322 | + track->handle_format_title(info8, it->c_str(), 0); | |
323 | +#elif IS_FB2K_VER09 | |
324 | + service_ptr_t<titleformat_object> titleformat; | |
325 | + | |
326 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
327 | + track->format_title(NULL, info8, titleformat, 0); | |
328 | +#endif | |
329 | + DEBUG_TRACK_INFO8("TRACK_INFO8::setStrings - %s: %s", it->c_str(), (LPCSTR)info8); | |
330 | + | |
331 | + m_infoMap8.insert(std::make_pair(*it, info8)); | |
332 | + | |
333 | + if(cfg_disable_ansi_trans == 0) | |
334 | + { | |
335 | +#if IS_FB2K_VER08 | |
336 | + string_wide_from_utf8 infoW(info8); | |
337 | + string_ansi_from_wide infoAnsi(infoW); | |
338 | +#elif IS_FB2K_VER09 | |
339 | + string_ansi_from_utf8 infoAnsi(info8); | |
340 | +#endif | |
341 | + | |
342 | + m_infoMapAnsi.insert(std::make_pair(*it, infoAnsi)); | |
343 | + } | |
344 | + } | |
345 | + } | |
346 | + | |
347 | + void setDynamicStrings(std::vector<std::string> & keys) | |
348 | + { | |
349 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setDynamicStrings - called.")); | |
350 | + | |
351 | +#if IS_FB2K_VER08 | |
352 | + metadb_handle *track = play_control::get()->get_now_playing(); | |
353 | +#elif IS_FB2K_VER09 | |
354 | + metadb_handle_ptr track; | |
355 | + static_api_ptr_t<playback_control>()->get_now_playing(track); | |
356 | +#endif | |
357 | + | |
358 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
359 | + | |
360 | + for(it = beginIt; it != endIt; it ++) { | |
361 | + | |
362 | + string8 info8; | |
363 | + | |
364 | +#if IS_FB2K_VER08 | |
365 | + play_control::get()->playback_format_title_ex(track, info8, it->c_str(), NULL, false, true); | |
366 | +#elif IS_FB2K_VER09 | |
367 | + service_ptr_t<titleformat_object> titleformat; | |
368 | + | |
369 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
370 | + static_api_ptr_t<playback_control>()->playback_format_title_ex(track, NULL, info8, titleformat, NULL, play_control::display_level_titles); | |
371 | +#endif | |
372 | + TRACE_TRACK_INFO8("TRACK_INFO8::setDynamicStrings - %s: %s", it->c_str(), (LPCSTR)info8); | |
373 | + | |
374 | + const std::string &oldValue = getString(*it); | |
375 | + | |
376 | + if((::strcmp(info8, "?") == 0) || (oldValue.length() == 0)) | |
377 | + { | |
378 | + m_infoMap8.insert(std::make_pair(*it, info8)); | |
379 | + | |
380 | + if(cfg_disable_ansi_trans == 0) | |
381 | + { | |
382 | +#if IS_FB2K_VER08 | |
383 | + string_wide_from_utf8 infoW(info8); | |
384 | + string_ansi_from_wide infoAnsi(infoW); | |
385 | +#elif IS_FB2K_VER09 | |
386 | + string_ansi_from_utf8 infoAnsi(info8); | |
387 | +#endif | |
388 | + | |
389 | + m_infoMapAnsi.insert(std::make_pair(*it, infoAnsi)); | |
390 | + } | |
391 | + } | |
392 | + } | |
393 | + | |
394 | +#if IS_FB2K_VER08 | |
395 | + if(track) { | |
396 | + track->handle_release(); | |
397 | + } | |
398 | +#endif | |
399 | + } | |
400 | + | |
401 | + void setPlaylistStrings(std::vector<std::string> & keys) | |
402 | + { | |
403 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setPlaylistStrings - called.")); | |
404 | + | |
405 | +#if IS_FB2K_VER08 | |
406 | + int track_index; | |
407 | + track_index = playlist_oper::get()->get_now_playing(); | |
408 | +#elif IS_FB2K_VER09 | |
409 | + t_size playlist_index, track_index; | |
410 | + static_api_ptr_t<playlist_manager>()->get_playing_item_location(&playlist_index, &track_index); | |
411 | +#endif | |
412 | + | |
413 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
414 | + | |
415 | + for(it = beginIt; it != endIt; it ++) { | |
416 | + | |
417 | + string8 info8; | |
418 | + | |
419 | +#if IS_FB2K_VER08 | |
420 | + playlist_oper::get()->format_title(track_index, info8, it->c_str(), NULL); | |
421 | +#elif IS_FB2K_VER09 | |
422 | + service_ptr_t<titleformat_object> titleformat; | |
423 | + | |
424 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
425 | + static_api_ptr_t<playlist_manager>()->playlist_item_format_title(playlist_index, track_index, | |
426 | + NULL, info8, titleformat, NULL, play_control::display_level_titles); | |
427 | +#endif | |
428 | + DEBUG_TRACK_INFO8("TRACK_INFO8::setPlaylistStrings - %s: %s", it->c_str(), (LPCSTR)info8); | |
429 | + | |
430 | + m_infoMap8.insert(std::make_pair(*it, info8)); | |
431 | + | |
432 | + if(cfg_disable_ansi_trans == 0) | |
433 | + { | |
434 | +#if IS_FB2K_VER08 | |
435 | + string_wide_from_utf8 infoW(info8); | |
436 | + string_ansi_from_wide infoAnsi(infoW); | |
437 | +#elif IS_FB2K_VER09 | |
438 | + string_ansi_from_utf8 infoAnsi(info8); | |
439 | +#endif | |
440 | + | |
441 | + m_infoMapAnsi.insert(std::make_pair(*it, infoAnsi)); | |
442 | + } | |
443 | + } | |
444 | + } | |
445 | + | |
446 | +#if IS_FB2K_VER08 | |
447 | + void setNumbers(std::vector<std::string> & keys, metadb_handle * track) | |
448 | +#elif IS_FB2K_VER09 | |
449 | + void setNumbers(std::vector<std::string> & keys, metadb_handle_ptr track) | |
450 | +#endif | |
451 | + { | |
452 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setNumbers - called.")); | |
453 | + | |
454 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
455 | + | |
456 | + for(it = beginIt; it != endIt; it ++) { | |
457 | + | |
458 | + string8 info8; | |
459 | + | |
460 | +#if IS_FB2K_VER08 | |
461 | + track->handle_format_title(info8, it->c_str(), 0); | |
462 | +#elif IS_FB2K_VER09 | |
463 | + service_ptr_t<titleformat_object> titleformat; | |
464 | + | |
465 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
466 | + track->format_title(NULL, info8, titleformat, 0); | |
467 | +#endif | |
468 | + DEBUG_TRACK_INFO8("TRACK_INFO8::setNumbers - %s: %s", it->c_str(), (LPCSTR)info8); | |
469 | + | |
470 | + m_infoMapNum.insert(std::make_pair(*it, static_cast<UINT>(::atol(info8)) ) ); | |
471 | + } | |
472 | + } | |
473 | + | |
474 | + void setDynamicNumbers(std::vector<std::string> & keys) | |
475 | + { | |
476 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setDynamicNumbers - called.")); | |
477 | + | |
478 | +#if IS_FB2K_VER08 | |
479 | + metadb_handle *track = play_control::get()->get_now_playing(); | |
480 | +#elif IS_FB2K_VER09 | |
481 | + metadb_handle_ptr track; | |
482 | + static_api_ptr_t<playback_control>()->get_now_playing(track); | |
483 | +#endif | |
484 | + | |
485 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
486 | + | |
487 | + for(it = beginIt; it != endIt; it ++) { | |
488 | + | |
489 | + string8 info8; | |
490 | + | |
491 | +#if IS_FB2K_VER08 | |
492 | + play_control::get()->playback_format_title_ex(track, info8, it->c_str(), NULL, false, true); | |
493 | +#elif IS_FB2K_VER09 | |
494 | + service_ptr_t<titleformat_object> titleformat; | |
495 | + | |
496 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
497 | + static_api_ptr_t<playback_control>()->playback_format_title_ex(track, NULL, info8, titleformat, NULL, play_control::display_level_titles); | |
498 | +#endif | |
499 | + TRACE_TRACK_INFO8("TRACK_INFO8::setDynamicNumbers - %s: %s", it->c_str(), (LPCSTR)info8); | |
500 | + | |
501 | + UINT newValue = ::atol(info8); | |
502 | + UINT oldValue = getNumber(*it); | |
503 | + | |
504 | + if((newValue != 0) || (oldValue == 0)) { | |
505 | + m_infoMapNum.insert(std::make_pair(*it, static_cast<UINT>(newValue) ) ); | |
506 | + } | |
507 | + } | |
508 | + | |
509 | +#if IS_FB2K_VER08 | |
510 | + if(track) { | |
511 | + track->handle_release(); | |
512 | + } | |
513 | +#endif | |
514 | + } | |
515 | + | |
516 | + void setPlaylistNumbers(std::vector<std::string> & keys) | |
517 | + { | |
518 | + TRACE_TRACK_INFO(_T("TRACK_INFO8::setPlaylistNumbers - called.")); | |
519 | + | |
520 | +#if IS_FB2K_VER08 | |
521 | + int track_index; | |
522 | + track_index = playlist_oper::get()->get_now_playing(); | |
523 | +#elif IS_FB2K_VER09 | |
524 | + t_size playlist_index, track_index; | |
525 | + static_api_ptr_t<playlist_manager>()->get_playing_item_location(&playlist_index, &track_index); | |
526 | +#endif | |
527 | + | |
528 | + std::vector<std::string>::iterator beginIt(keys.begin()), endIt(keys.end()), it; | |
529 | + | |
530 | + for(it = beginIt; it != endIt; it ++) { | |
531 | + | |
532 | + string8 info8; | |
533 | + | |
534 | +#if IS_FB2K_VER08 | |
535 | + playlist_oper::get()->format_title(track_index, info8, it->c_str(), NULL); | |
536 | +#elif IS_FB2K_VER09 | |
537 | + service_ptr_t<titleformat_object> titleformat; | |
538 | + | |
539 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, it->c_str()); | |
540 | + static_api_ptr_t<playlist_manager>()->playlist_item_format_title(playlist_index, track_index, | |
541 | + NULL, info8, titleformat, NULL, play_control::display_level_titles); | |
542 | +#endif | |
543 | + DEBUG_TRACK_INFO8("TRACK_INFO8::setPlaylistNumbers - %s: %s", it->c_str(), (LPCSTR)info8); | |
544 | + | |
545 | + m_infoMapNum.insert(std::make_pair(*it, static_cast<UINT>(::atol(info8)) ) ); | |
546 | + } | |
547 | + } | |
548 | + | |
549 | + void putString(const std::string &key, const std::string &value) | |
550 | + { | |
551 | + DEBUG_TRACK_INFO8("TRACK_INFO8::putString - %s: %s", key.c_str(), value.c_str()); | |
552 | + | |
553 | + m_infoMap8.insert(std::make_pair(key, value.c_str())); | |
554 | + | |
555 | + if(cfg_disable_ansi_trans == 0) | |
556 | + { | |
557 | +#if IS_FB2K_VER08 | |
558 | + string_wide_from_utf8 valueW(value.c_str()); | |
559 | + string_ansi_from_wide valueAnsi(valueW); | |
560 | +#elif IS_FB2K_VER09 | |
561 | + string_ansi_from_utf8 valueAnsi(value.c_str()); | |
562 | +#endif | |
563 | + | |
564 | + m_infoMapAnsi.insert(std::make_pair(key, valueAnsi)); | |
565 | + } | |
566 | + } | |
567 | + | |
568 | + void putNumber(const std::string &key, UINT value) | |
569 | + { | |
570 | + DEBUG_TRACK_INFO8("TRACK_INFO8::putNumber - %s: %u", key.c_str(), value); | |
571 | + | |
572 | + m_infoMapNum.insert(std::make_pair(key, value)); | |
573 | + } | |
574 | + | |
575 | + const std::string &getString(const std::string &key, bool bForceUTF8 = false) const { | |
576 | + | |
577 | + if((bForceUTF8 == true) || (cfg_disable_ansi_trans == 1)) | |
578 | + { | |
579 | + std::map<std::string, std::string>::const_iterator it(m_infoMap8.find(key)), endIt(m_infoMap8.end()); | |
580 | + | |
581 | + if(it == endIt) { | |
582 | + return m_nullStr; | |
583 | + } | |
584 | + | |
585 | + return it->second; | |
586 | + } | |
587 | + else | |
588 | + { | |
589 | + std::map<std::string, std::string>::const_iterator it(m_infoMapAnsi.find(key)), endIt(m_infoMapAnsi.end()); | |
590 | + | |
591 | + if(it == endIt) { | |
592 | + return m_nullStr; | |
593 | + } | |
594 | + | |
595 | + return it->second; | |
596 | + } | |
597 | + } | |
598 | + | |
599 | + const UINT getNumber(const std::string &key) const { | |
600 | + | |
601 | + std::map<std::string, UINT>::const_iterator it(m_infoMapNum.find(key)), endIt(m_infoMapNum.end()); | |
602 | + | |
603 | + if(it == endIt) { | |
604 | + return 0; | |
605 | + } | |
606 | + | |
607 | + return it->second; | |
608 | + } | |
609 | + | |
610 | +}; | |
611 | + | |
612 | +class PlayInfo | |
613 | +{ | |
614 | + public: | |
615 | + | |
616 | + enum EPlayStatus | |
617 | + { | |
618 | + PLAY_STOP = 0, | |
619 | + PLAY_START = 1, | |
620 | + PLAY_PAUSE = 3 | |
621 | + }; | |
622 | + | |
623 | + public: | |
624 | + | |
625 | + PlayInfo() : | |
626 | + m_playStatus(PLAY_STOP), | |
627 | + m_playLength(0), | |
628 | + m_playPosition(0), | |
629 | + m_playCount(0) { | |
630 | + } | |
631 | + | |
632 | + public: | |
633 | + | |
634 | + void setPlayStatusStart() { | |
635 | + setPlayStatus(PLAY_START); | |
636 | + } | |
637 | + | |
638 | + void setPlayStatusStop() { | |
639 | + setPlayStatus(PLAY_STOP); | |
640 | + } | |
641 | + | |
642 | + void setPlayStatusPause() { | |
643 | + setPlayStatus(PLAY_PAUSE); | |
644 | + } | |
645 | + | |
646 | + void clearPlayInfo() | |
647 | + { | |
648 | + setPlayStatusStop(); | |
649 | + setPlayPosition(0); | |
650 | + setPlayLength(0); | |
651 | + } | |
652 | + | |
653 | + void incrementPlayCount() { | |
654 | + setPlayCount(getPlayCount() + 1); | |
655 | + } | |
656 | + | |
657 | + public: | |
658 | + | |
659 | + EPlayStatus getPlayStatus() const { | |
660 | + return m_playStatus; | |
661 | + } | |
662 | + | |
663 | + void setPlayStatus(EPlayStatus status) { | |
664 | + m_playStatus = status; | |
665 | + } | |
666 | + | |
667 | + int getPlayPosition() const { | |
668 | + return m_playPosition; | |
669 | + } | |
670 | + | |
671 | + void setPlayPosition(int pos) { | |
672 | + m_playPosition = pos; | |
673 | + } | |
674 | + | |
675 | + double getPlayLength() const { | |
676 | + return m_playLength; | |
677 | + } | |
678 | + | |
679 | + void setPlayLength(double len) { | |
680 | + m_playLength = len; | |
681 | + } | |
682 | + | |
683 | + int getPlayCount() const { | |
684 | + return m_playCount; | |
685 | + } | |
686 | + | |
687 | + void setPlayCount(int count) { | |
688 | + m_playCount = count; | |
689 | + } | |
690 | + | |
691 | + protected: | |
692 | + | |
693 | + EPlayStatus m_playStatus; | |
694 | + | |
695 | + double m_playLength; | |
696 | + int m_playPosition; | |
697 | + int m_playCount; | |
698 | +}; | |
699 | + | |
700 | +class Probe | |
701 | +{ | |
702 | + public: | |
703 | + | |
704 | + Probe() : | |
705 | + m_hHuygensWnd((HWND)INVALID_HANDLE_VALUE), | |
706 | + m_GETPLAYLISTFILE_time(0) { | |
707 | + | |
708 | + m_huygensTitle = _T(DEFAULT_HUYGENS_TITLE); | |
709 | + } | |
710 | + | |
711 | + ~Probe() | |
712 | + { | |
713 | + release(); | |
714 | + } | |
715 | + | |
716 | + public: | |
717 | + | |
718 | + static Probe *getInstance() | |
719 | + { | |
720 | + if(m_pMe == NULL) | |
721 | + { | |
722 | + m_pMe = new Probe(); | |
723 | + } | |
724 | + | |
725 | + return m_pMe; | |
726 | + } | |
727 | + | |
728 | + void load() | |
729 | + { | |
730 | + TRACE_HUYGENS_INIT(_T("Probe::load - called.")); | |
731 | + | |
732 | + // create huygens window | |
733 | + createWindow(); | |
734 | + } | |
735 | + | |
736 | + void release() | |
737 | + { | |
738 | + TRACE_HUYGENS_INIT(_T("Probe::release - called.")); | |
739 | + | |
740 | + // destruct huygens window | |
741 | + destroyWindow(); | |
742 | + } | |
743 | + | |
744 | + void updateProbeTitle() | |
745 | + { | |
746 | + tstring huygensTitle = makeProbeTitle(getBaseHuygensTitle()); | |
747 | + | |
748 | + setHuygensTitle(huygensTitle.c_str()); | |
749 | + | |
750 | + ::SetWindowText(getWnd(), huygensTitle.c_str()); | |
751 | + } | |
752 | + | |
753 | + void clearProbeTitle() | |
754 | + { | |
755 | + uSetWindowText(getWnd(), DEFAULT_HUYGENS_TITLE); | |
756 | + } | |
757 | + | |
758 | + void createWindow() | |
759 | + { | |
760 | + TRACE_PLUGIN(_T("Probe::createWindow - called.")); | |
761 | + | |
762 | + if(getWnd() == INVALID_HANDLE_VALUE) | |
763 | + { | |
764 | + // create huygens window | |
765 | + setWnd(createHuygensWindow()); | |
766 | + } | |
767 | + } | |
768 | + | |
769 | + public: | |
770 | + | |
771 | + HWND getWnd() const { | |
772 | + return m_hHuygensWnd; | |
773 | + } | |
774 | + | |
775 | + const TRACK_INFO8 &getTrackInfo8() const { | |
776 | + return m_trackInfo8; | |
777 | + } | |
778 | + | |
779 | + TRACK_INFO8 &getMutableTrackInfo8() { | |
780 | + return m_trackInfo8; | |
781 | + } | |
782 | + | |
783 | + void setTrackInfo8(const TRACK_INFO8 &trackInfo8) { | |
784 | + m_trackInfo8 = trackInfo8; | |
785 | + } | |
786 | + | |
787 | + PlayInfo &getPlayInfo() { | |
788 | + return m_playInfo; | |
789 | + } | |
790 | + | |
791 | + const PlayInfo &getPlayInfo() const { | |
792 | + return m_playInfo; | |
793 | + } | |
794 | + | |
795 | + void setPlaylistTitle(LPCTSTR pTitle) { | |
796 | + | |
797 | + TRACE_PLUGIN(_T("Probe::setPlayListTitle - %s"), pTitle); | |
798 | + | |
799 | + m_playlistTitle = pTitle; | |
800 | + | |
801 | + string_utf8_from_os playListTitle8(pTitle); | |
802 | + | |
803 | + if(cfg_disable_ansi_trans == 1) | |
804 | + { | |
805 | + | |
806 | + m_playlistTitle8 = playListTitle8; | |
807 | + } | |
808 | + else | |
809 | + { | |
810 | +#if IS_FB2K_VER08 | |
811 | + string_wide_from_utf8 playListTitleW(playListTitle8); | |
812 | + string_ansi_from_wide playListTitleAnsi(playListTitleW); | |
813 | +#elif IS_FB2K_VER09 | |
814 | + string_ansi_from_utf8 playListTitleAnsi(playListTitle8); | |
815 | +#endif | |
816 | + m_playlistTitle8 = playListTitleAnsi; | |
817 | + } | |
818 | + } | |
819 | + | |
820 | + const tstring &getPlaylistTitle() const { | |
821 | + return m_playlistTitle; | |
822 | + } | |
823 | + | |
824 | + const string8 &getPlaylistTitle8() const { | |
825 | + return m_playlistTitle8; | |
826 | + } | |
827 | + | |
828 | + void setHuygensTitle(LPCTSTR pTitle) { | |
829 | + | |
830 | + TRACE_PLUGIN(_T("Probe::setHuygensTitle - %s"), pTitle); | |
831 | + | |
832 | + m_huygensTitle = pTitle; | |
833 | + } | |
834 | + | |
835 | + const tstring &getHuygensTitle() const { | |
836 | + return m_huygensTitle; | |
837 | + } | |
838 | + | |
839 | + void setBaseHuygensTitle(LPCTSTR pTitle) | |
840 | + { | |
841 | + TRACE_PLUGIN(_T("Probe::setBaseHuygensTitle - %s"), pTitle); | |
842 | + | |
843 | + m_baseHuygensTitle = pTitle; | |
844 | + | |
845 | + updateProbeTitle(); | |
846 | + } | |
847 | + | |
848 | + const tstring &getBaseHuygensTitle() const { | |
849 | + return m_baseHuygensTitle; | |
850 | + } | |
851 | + | |
852 | + void showProbeWindow(bool bShow) { | |
853 | + showProbeWindow(getWnd(), bShow); | |
854 | + } | |
855 | + | |
856 | + protected: | |
857 | + | |
858 | + void setWnd(HWND hWnd) { | |
859 | + m_hHuygensWnd = hWnd; | |
860 | + } | |
861 | + | |
862 | + int getGetPlayListFileTime() const { | |
863 | + return m_GETPLAYLISTFILE_time; | |
864 | + } | |
865 | + | |
866 | + void setGetPlayListFileTime(int time) { | |
867 | + m_GETPLAYLISTFILE_time = time; | |
868 | + } | |
869 | + | |
870 | + protected: | |
871 | + | |
872 | + HWND createHuygensWindow() | |
873 | + { | |
874 | + TRACE_PLUGIN(_T("Probe::createHuygensWindow - called.")); | |
875 | + | |
876 | + static bool isInited = false; | |
877 | + | |
878 | +#if IS_FB2K_VER08 | |
879 | + static const char class_name[] = CLASSNAME; | |
880 | + if (!isInited) | |
881 | + { | |
882 | + isInited = true; | |
883 | + uWNDCLASS wc; | |
884 | + memset(&wc,0,sizeof(wc)); | |
885 | + wc.style = 0; | |
886 | + wc.lpfnWndProc = windowproc; | |
887 | + wc.hInstance = core_api::get_my_instance(); | |
888 | + wc.hCursor = NULL; //uLoadCursor(0, IDC_ARROW); | |
889 | + wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); | |
890 | + wc.lpszClassName = class_name; | |
891 | + uRegisterClass(&wc); | |
892 | + } | |
893 | + HWND hHuygensWnd = uCreateWindowEx( | |
894 | + 0, class_name, DEFAULT_HUYGENS_TITLE, | |
895 | + WS_OVERLAPPED|WS_CAPTION|WS_SIZEBOX, | |
896 | + CW_USEDEFAULT, CW_USEDEFAULT, 300, 150, | |
897 | + core_api::get_main_window(), 0, core_api::get_my_instance(), NULL | |
898 | + ); | |
899 | +#elif IS_FB2K_VER09 | |
900 | + static const TCHAR class_name[] = CLASSNAME; | |
901 | + if (!isInited) | |
902 | + { | |
903 | + isInited = true; | |
904 | + WNDCLASS wc; | |
905 | + memset(&wc,0,sizeof(wc)); | |
906 | + wc.style = 0; | |
907 | + wc.lpfnWndProc = windowproc; | |
908 | + wc.hInstance = core_api::get_my_instance(); | |
909 | + wc.hCursor = NULL; //uLoadCursor(0, IDC_ARROW); | |
910 | + wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1); | |
911 | + wc.lpszClassName = class_name; | |
912 | + RegisterClass(&wc); | |
913 | + } | |
914 | + HWND hHuygensWnd = CreateWindowEx( | |
915 | + 0, class_name, _T(DEFAULT_HUYGENS_TITLE), | |
916 | + WS_OVERLAPPED|WS_CAPTION|WS_SIZEBOX, | |
917 | + CW_USEDEFAULT, CW_USEDEFAULT, 300, 150, | |
918 | + core_api::get_main_window(), 0, core_api::get_my_instance(), NULL | |
919 | + ); | |
920 | +#endif | |
921 | + if (!hHuygensWnd) | |
922 | + { | |
923 | + LOG_ERROR(_T("Probe::createHuygensWindow - Create Probe window failed.")); | |
924 | + | |
925 | + return NULL; | |
926 | + } | |
927 | + | |
928 | + DEBUG_PLUGIN(_T("Probe::createHuygensWindow - Probe window created.")); | |
929 | + | |
930 | + showProbeWindow(hHuygensWnd, cfg_show_huygens == 1); | |
931 | + | |
932 | + return hHuygensWnd; | |
933 | + } | |
934 | + | |
935 | + void showProbeWindow(HWND hHuygensWnd, bool bShow) | |
936 | + { | |
937 | + if(bShow) { | |
938 | + ShowWindow(hHuygensWnd, SW_SHOW); | |
939 | + } else { | |
940 | + ShowWindow(hHuygensWnd, SW_HIDE); | |
941 | + } | |
942 | + } | |
943 | + | |
944 | + void destroyWindow() | |
945 | + { | |
946 | + TRACE_PLUGIN(_T("Probe::destroyWindow - called.")); | |
947 | + | |
948 | + if(getWnd() != INVALID_HANDLE_VALUE) | |
949 | + { | |
950 | + uDestroyWindow(getWnd()); | |
951 | + | |
952 | +#if IS_FB2K_VER08 | |
953 | + uUnregisterClass(CLASSNAME, core_api::get_my_instance()); | |
954 | +#elif IS_FB2K_VER09 | |
955 | + UnregisterClass(CLASSNAME, core_api::get_my_instance()); | |
956 | +#endif | |
957 | + | |
958 | + setWnd((HWND)INVALID_HANDLE_VALUE); | |
959 | + } | |
960 | + } | |
961 | + | |
962 | + tstring makeProbeTitle(const tstring &rawTitle) | |
963 | + { | |
964 | + TRACE_PLUGIN(_T("Probe::makeProbeTitle - called.")); | |
965 | + | |
966 | + Str64K formatBuf; | |
967 | + | |
968 | + _stprintf_s( | |
969 | + formatBuf, sizeof(formatBuf) / sizeof(TCHAR), | |
970 | + _T("%d. %s - ") _T(DEFAULT_HUYGENS_TITLE), | |
971 | + m_trackInfo8.getNumber(FORMAT_LISTINDEX), | |
972 | + (LPCTSTR)rawTitle.c_str() | |
973 | + ); | |
974 | + | |
975 | + return formatBuf; | |
976 | + } | |
977 | + | |
978 | + void refreshTitle() | |
979 | + { | |
980 | + // get formatted dynamic titles | |
981 | + string8 huygens_title8; | |
982 | + string8 playlist_title8; | |
983 | +#if IS_FB2K_VER08 | |
984 | + metadb_handle *track = play_control::get()->get_now_playing(); | |
985 | + if(track) | |
986 | + { | |
987 | + play_control::get()->playback_format_title_ex(track, huygens_title8, cfg_huygens_title_format, NULL, false, true); | |
988 | + play_control::get()->playback_format_title_ex(track, playlist_title8, cfg_huygens_playlist_format, NULL, false, true); | |
989 | + track->handle_release(); | |
990 | + } | |
991 | +#elif IS_FB2K_VER09 | |
992 | + metadb_handle_ptr track; | |
993 | + static_api_ptr_t<playback_control>()->get_now_playing(track); | |
994 | + | |
995 | + service_ptr_t<titleformat_object> titleformat; | |
996 | + | |
997 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, cfg_huygens_title_format); | |
998 | + static_api_ptr_t<playback_control>()->playback_format_title_ex(track, NULL, huygens_title8, titleformat, NULL, play_control::display_level_all); | |
999 | + | |
1000 | + static_api_ptr_t<titleformat_compiler>()->compile_safe(titleformat, cfg_huygens_playlist_format); | |
1001 | + static_api_ptr_t<playback_control>()->playback_format_title_ex(track, NULL, playlist_title8, titleformat, NULL, play_control::display_level_all); | |
1002 | +#endif | |
1003 | + // convert utf8 track informations to os charset | |
1004 | + string_os_from_utf8 huygens_title(huygens_title8); | |
1005 | + string_os_from_utf8 playlist_title(playlist_title8); | |
1006 | + | |
1007 | + // set base huygens title to huygens | |
1008 | + setBaseHuygensTitle(huygens_title); | |
1009 | + | |
1010 | + // set huygens playlist current item title to huygens | |
1011 | + setPlaylistTitle(playlist_title); | |
1012 | + } | |
1013 | + | |
1014 | + protected: | |
1015 | + | |
1016 | + static LRESULT WINAPI windowproc(HWND wnd,UINT msg, WPARAM wp, LPARAM lp); | |
1017 | + static std::pair<bool, LRESULT> WINAPI huyIpcWindowProc(HWND wnd,UINT msg, WPARAM wp, LPARAM lp); | |
1018 | + | |
1019 | + protected: | |
1020 | + | |
1021 | + static Probe *m_pMe; | |
1022 | + | |
1023 | + HWND m_hHuygensWnd; | |
1024 | + | |
1025 | + PlayInfo m_playInfo; | |
1026 | + | |
1027 | + TRACK_INFO8 m_trackInfo8; | |
1028 | + int m_GETPLAYLISTFILE_time; | |
1029 | + | |
1030 | + tstring m_playlistTitle; | |
1031 | + string8 m_playlistTitle8; | |
1032 | + | |
1033 | + tstring m_huygensTitle; | |
1034 | + tstring m_baseHuygensTitle; | |
1035 | +}; | |
1036 | + | |
1037 | +Probe *Probe::m_pMe = NULL; | |
1038 | + | |
1039 | +LRESULT CALLBACK Probe::windowproc(HWND wnd,UINT msg, WPARAM wp, LPARAM lp) | |
1040 | +{ | |
1041 | + switch(msg) | |
1042 | + { | |
1043 | + case WM_CLOSE: | |
1044 | + DEBUG_HUYGENS_PROC(_T("Probe::windowproc - WM_CLOSE")); | |
1045 | + Probe::getInstance()->destroyWindow(); | |
1046 | + return 0; | |
1047 | + | |
1048 | + case WM_HUY_IPC: | |
1049 | + { | |
1050 | + if(cfg_use_plugin == 1) { | |
1051 | + std::pair<bool, LRESULT> res = huyIpcWindowProc(wnd, msg, wp, lp); | |
1052 | + if(res.first == true) { | |
1053 | + return res.second; | |
1054 | + } | |
1055 | + } | |
1056 | + } | |
1057 | + break; | |
1058 | + | |
1059 | + default: | |
1060 | + if(InSendMessage()) { | |
1061 | + TRACE_HUYGENS_PROC(_T("Probe::windowproc - Unknown MSG from other thread / MSG:%04x, W:%08x, L:%08x"), msg, wp, lp); | |
1062 | + } | |
1063 | + break; | |
1064 | + } | |
1065 | + | |
1066 | + return uDefWindowProc(wnd,msg,wp,lp); | |
1067 | +} | |
1068 | + | |
1069 | +std::pair<bool, LRESULT> WINAPI Probe::huyIpcWindowProc(HWND wnd,UINT msg, WPARAM wp, LPARAM lp) | |
1070 | +{ | |
1071 | + static string8 pluginVersion = PLUGIN_VERSION_VAL; | |
1072 | + | |
1073 | + switch(msg) | |
1074 | + { | |
1075 | + case WM_HUY_IPC: | |
1076 | + { | |
1077 | + PlayInfo::EPlayStatus playStatus = Probe::getInstance()->getPlayInfo().getPlayStatus(); | |
1078 | + double playLength = Probe::getInstance()->getPlayInfo().getPlayLength(); | |
1079 | + int playCount = Probe::getInstance()->getPlayInfo().getPlayCount(); | |
1080 | + | |
1081 | + switch(lp) | |
1082 | + { | |
1083 | + case HUY_GETVERSION: // 0x0000 | |
1084 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETVERSION / version [%s]", (LPCSTR)pluginVersion); | |
1085 | + return std::make_pair(true, (LRESULT)(LPCSTR)pluginVersion); | |
1086 | + | |
1087 | + case HUY_GETFB2KVERSION: // 0x0001 | |
1088 | + { | |
1089 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETFB2KVERSION / version [%s]", | |
1090 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_FB2KVERSION, true).c_str()); | |
1091 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_FB2KVERSION).c_str()); | |
1092 | + } | |
1093 | + | |
1094 | + case HUY_GETENCODEMODE: // 0x0002 | |
1095 | + { | |
1096 | + UINT isUTF8 = cfg_disable_ansi_trans == 1 ? 1 : 0; | |
1097 | + | |
1098 | + TRACE_HUYGENS_PROC( | |
1099 | + _T("Probe::huyIpcWindowProc - HUY_GETENCODEMODE / encode mode [%u]"), isUTF8); | |
1100 | + | |
1101 | + return std::make_pair(true, isUTF8); | |
1102 | + } | |
1103 | + | |
1104 | + case HUY_GETFILEPATH: // 0x0100 | |
1105 | + { | |
1106 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETFILEPATH / path [%s]", | |
1107 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILEPATH, true).c_str()); | |
1108 | + | |
1109 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILEPATH).c_str()); | |
1110 | + } | |
1111 | + | |
1112 | + case HUY_GETDURATION: // 0x0101 | |
1113 | + | |
1114 | + if(playStatus == PlayInfo::PLAY_START) | |
1115 | + { | |
1116 | + UINT duration = static_cast<int>(playLength * 1000); | |
1117 | + | |
1118 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETDURATION / length [%.3f sec.]"), duration / 1000.0); | |
1119 | + return std::make_pair(true, duration); | |
1120 | + } | |
1121 | + | |
1122 | + return std::make_pair(true, -1); | |
1123 | + | |
1124 | + case HUY_GETARTIST: // 0x0102 | |
1125 | + { | |
1126 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETARTIST / artist [%s]", | |
1127 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_ARTIST, true).c_str()); | |
1128 | + | |
1129 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_ARTIST).c_str()); | |
1130 | + } | |
1131 | + | |
1132 | + case HUY_GETTRACKTITLE: // 0x0103 | |
1133 | + { | |
1134 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETTRACKTITLE / title [%s]", | |
1135 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKTITLE, true).c_str()); | |
1136 | + | |
1137 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKTITLE).c_str()); | |
1138 | + } | |
1139 | + | |
1140 | + case HUY_GETALBUMTITLE: // 0x0104 | |
1141 | + { | |
1142 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETALBUMTITLE / album [%s]", | |
1143 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_ALBUMTITLE, true).c_str()); | |
1144 | + | |
1145 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_ALBUMTITLE).c_str()); | |
1146 | + } | |
1147 | + | |
1148 | + case HUY_GETDATE: // 0x0105 | |
1149 | + { | |
1150 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETDATE / date [%s]", | |
1151 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKDATE, true).c_str()); | |
1152 | + | |
1153 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKDATE).c_str()); | |
1154 | + } | |
1155 | + | |
1156 | + case HUY_GETCOMPOSER: // 0x0106 | |
1157 | + { | |
1158 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETCOMPOSER / composer [%s]", | |
1159 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_COMPOSER, true).c_str()); | |
1160 | + | |
1161 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_COMPOSER).c_str()); | |
1162 | + } | |
1163 | + | |
1164 | + case HUY_GETPERFORMER: // 0x0107 | |
1165 | + { | |
1166 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETPERFORMER / performer [%s]", | |
1167 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_PERFORMER, true).c_str()); | |
1168 | + | |
1169 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_PERFORMER).c_str()); | |
1170 | + } | |
1171 | + | |
1172 | + case HUY_GETALBUMARTIST: // 0x0108 | |
1173 | + { | |
1174 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETALBUMARTIST / album artist [%s]", | |
1175 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_ALBUMARTIST, true).c_str()); | |
1176 | + | |
1177 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_ALBUMARTIST).c_str()); | |
1178 | + } | |
1179 | + | |
1180 | + case HUY_GETTRACKARTIST: // 0x0119 | |
1181 | + { | |
1182 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETTRACKARTIST / track artist [%s]", | |
1183 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKARTIST, true).c_str()); | |
1184 | + | |
1185 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_TRACKARTIST).c_str()); | |
1186 | + } | |
1187 | + | |
1188 | + case HUY_GETTRACKNO: // 0x0109 | |
1189 | + { | |
1190 | + UINT nTrack = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_TRACKNUMBER); | |
1191 | + | |
1192 | + TRACE_HUYGENS_PROC( | |
1193 | + _T("Probe::huyIpcWindowProc - HUY_GETTRACKNO / track number [%u]"), nTrack); | |
1194 | + | |
1195 | + return std::make_pair(true, nTrack); | |
1196 | + } | |
1197 | + | |
1198 | + case HUY_GETTOTALTRACKS: // 0x010A | |
1199 | + { | |
1200 | + UINT nTrack = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_TRACKTOTAL); | |
1201 | + | |
1202 | + TRACE_HUYGENS_PROC( | |
1203 | + _T("Probe::huyIpcWindowProc - HUY_GETTOTALTRACK / total track number [%u]"), nTrack); | |
1204 | + | |
1205 | + return std::make_pair(true, nTrack); | |
1206 | + } | |
1207 | + | |
1208 | + case HUY_GETDISCNO: // 0x010B | |
1209 | + { | |
1210 | + UINT nDisc = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_DISCNUMBER); | |
1211 | + | |
1212 | + TRACE_HUYGENS_PROC( | |
1213 | + _T("Probe::huyIpcWindowProc - HUY_GETDISCNO / disc number [%u]"), nDisc); | |
1214 | + | |
1215 | + return std::make_pair(true, nDisc); | |
1216 | + } | |
1217 | + | |
1218 | + case HUY_GETTOTALDISCS: // 0x010C | |
1219 | + { | |
1220 | + UINT nDisc = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_DISCTOTAL); | |
1221 | + | |
1222 | + TRACE_HUYGENS_PROC( | |
1223 | + _T("Probe::huyIpcWindowProc - HUY_GETTOTALDISC / total track number [%u]"), nDisc); | |
1224 | + | |
1225 | + return std::make_pair(true, nDisc); | |
1226 | + } | |
1227 | + | |
1228 | + case HUY_GETCOMMENT: // 0x010D | |
1229 | + { | |
1230 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETCOMMENT / comment [%s]", | |
1231 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_COMMENT, true).c_str()); | |
1232 | + | |
1233 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_COMMENT).c_str()); | |
1234 | + } | |
1235 | + | |
1236 | + case HUY_GETSAMPLERATE: // 0x010E | |
1237 | + { | |
1238 | + UINT nRate = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_SAMPLERATE); | |
1239 | + | |
1240 | + TRACE_HUYGENS_PROC( | |
1241 | + _T("Probe::huyIpcWindowProc - HUY_GETSAMPLERATE / sampling rate [%u Hz]"), nRate); | |
1242 | + | |
1243 | + return std::make_pair(true, nRate); | |
1244 | + } | |
1245 | + | |
1246 | + case HUY_GETBITRATE: // 0x010F | |
1247 | + { | |
1248 | + UINT nRate = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_BITRATE); | |
1249 | + | |
1250 | + TRACE_HUYGENS_PROC( | |
1251 | + _T("Probe::huyIpcWindowProc - HUY_GETBITRATE / bitrate [%u kbps]"), nRate); | |
1252 | + | |
1253 | + return std::make_pair(true, nRate); | |
1254 | + } | |
1255 | + | |
1256 | + case HUY_GETBITRATENOMINAL: // 0x0127 | |
1257 | + { | |
1258 | + UINT nRate = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_BITRATE_NOMINAL); | |
1259 | + | |
1260 | + TRACE_HUYGENS_PROC( | |
1261 | + _T("Probe::huyIpcWindowProc - HUY_GETBITRATENOMINAL / nominal bitrate [%u kbps]"), nRate); | |
1262 | + | |
1263 | + return std::make_pair(true, nRate); | |
1264 | + } | |
1265 | + | |
1266 | + case HUY_GETBITRATEDYNAMIC: // 0x012C | |
1267 | + { | |
1268 | + UINT nRate = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_BITRATE_DYNAMIC); | |
1269 | + | |
1270 | + TRACE_HUYGENS_PROC( | |
1271 | + _T("Probe::huyIpcWindowProc - HUY_GETBITRATEDYNAMIC / dynamic bitrate [%u kbps]"), nRate); | |
1272 | + | |
1273 | + return std::make_pair(true, nRate); | |
1274 | + } | |
1275 | + | |
1276 | + case HUY_GETCHANNELS: // 0x0110 | |
1277 | + { | |
1278 | + UINT nCh = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_CHANNELS); | |
1279 | + | |
1280 | + TRACE_HUYGENS_PROC( | |
1281 | + _T("Probe::huyIpcWindowProc - HUY_GETCHANNELS / channels [%u]"), nCh); | |
1282 | + | |
1283 | + return std::make_pair(true, nCh); | |
1284 | + } | |
1285 | + | |
1286 | + case HUY_GETBITSPERSAMPLE: // 0x011C | |
1287 | + { | |
1288 | + UINT nBitsPerSample = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_BITSPERSAMPLE); | |
1289 | + | |
1290 | + TRACE_HUYGENS_PROC( | |
1291 | + _T("Probe::huyIpcWindowProc - HUY_GETBITSPERSAMPLE / bits/Sample [%u]"), nBitsPerSample); | |
1292 | + | |
1293 | + return std::make_pair(true, nBitsPerSample); | |
1294 | + } | |
1295 | + | |
1296 | + case HUY_GETCODEC: // 0x0111 | |
1297 | + { | |
1298 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETCODEC / codec [%s]", | |
1299 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_CODEC, true).c_str()); | |
1300 | + | |
1301 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_CODEC).c_str()); | |
1302 | + } | |
1303 | + | |
1304 | + case HUY_GETCODECPROFILE: // 0x0112 | |
1305 | + { | |
1306 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETCODECPROFILE / codec profile [%s]", | |
1307 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_CODECPROFILE, true).c_str()); | |
1308 | + | |
1309 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_CODECPROFILE).c_str()); | |
1310 | + } | |
1311 | + | |
1312 | + case HUY_ISLOSSLESS: // 0x0113 | |
1313 | + { | |
1314 | + UINT isLossless = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_LOSSLESS); | |
1315 | + | |
1316 | + TRACE_HUYGENS_PROC( | |
1317 | + _T("Probe::huyIpcWindowProc - HUY_ISLOSSLESS / lossless flag [%u]"), isLossless); | |
1318 | + | |
1319 | + return std::make_pair(true, isLossless); | |
1320 | + } | |
1321 | + | |
1322 | + case HUY_GETTAGTYPE: // 0x0114 | |
1323 | + { | |
1324 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETTAGTYPE / tag type [%s]", | |
1325 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_TAGTYPE, true).c_str()); | |
1326 | + | |
1327 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_TAGTYPE).c_str()); | |
1328 | + } | |
1329 | + | |
1330 | + case HUY_GETEXTRAINFO: // 0x011D | |
1331 | + { | |
1332 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETEXTRAINFO / extrainfo [%s]", | |
1333 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_EXTRAINFO, true).c_str()); | |
1334 | + | |
1335 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_EXTRAINFO).c_str()); | |
1336 | + } | |
1337 | + | |
1338 | + case HUY_GETTOOL: // 0x011E | |
1339 | + { | |
1340 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETTOOL / tool [%s]", | |
1341 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_TOOL, true).c_str()); | |
1342 | + | |
1343 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_TOOL).c_str()); | |
1344 | + } | |
1345 | + | |
1346 | + case HUY_GETCUEEMBEDDED: // 0x011F | |
1347 | + { | |
1348 | + UINT isEmbedded = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_CUEEMBEDDED); | |
1349 | + | |
1350 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETCUEEMBEDDED / embedded flag [%u]", isEmbedded); | |
1351 | + | |
1352 | + return std::make_pair(true, (LRESULT)(LPCSTR)isEmbedded); | |
1353 | + } | |
1354 | + | |
1355 | + case HUY_GETAUDIOMD5HASH: // 0x0120 | |
1356 | + { | |
1357 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETAUDIOMD5HASH / tag type [%s]", | |
1358 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_AUDIOMD5HASH, true).c_str()); | |
1359 | + | |
1360 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_AUDIOMD5HASH).c_str()); | |
1361 | + } | |
1362 | + | |
1363 | + case HUY_GETMP3STEREOMODE: // 0x0121 | |
1364 | + { | |
1365 | + UINT isJointStereo = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_MP3STEREOMODE); | |
1366 | + | |
1367 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETMP3STEREOMODE / stereo mode [%u]", isJointStereo); | |
1368 | + | |
1369 | + return std::make_pair(true, (LRESULT)(LPCSTR)isJointStereo); | |
1370 | + } | |
1371 | + | |
1372 | + case HUY_GETMP3ACCURATELENGTH: // 0x0122 | |
1373 | + { | |
1374 | + UINT isAcculateLength = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_MP3ACCURATELENGTH); | |
1375 | + | |
1376 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETMP3ACCULATELENGTH / acculate length flag [%u]", isAcculateLength); | |
1377 | + | |
1378 | + return std::make_pair(true, (LRESULT)(LPCSTR)isAcculateLength); | |
1379 | + } | |
1380 | + | |
1381 | + case HUY_GETMP3ENCDELAY: // 0x0123 | |
1382 | + { | |
1383 | + UINT nEncDelay = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_MP3ENCDELAY); | |
1384 | + | |
1385 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETMP3ENCDELAY / encoder delay [%u]", nEncDelay); | |
1386 | + | |
1387 | + return std::make_pair(true, (LRESULT)(LPCSTR)nEncDelay); | |
1388 | + } | |
1389 | + | |
1390 | + case HUY_GETMP3ENCPADDING: // 0x0124 | |
1391 | + { | |
1392 | + UINT nEncPadding = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_MP3ENCPADDING); | |
1393 | + | |
1394 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETMP3ENCPADDING / encoder padding [%u]", nEncPadding); | |
1395 | + | |
1396 | + return std::make_pair(true, (LRESULT)(LPCSTR)nEncPadding); | |
1397 | + } | |
1398 | + | |
1399 | + case HUY_GETAPEVERSION: // 0x0125 | |
1400 | + { | |
1401 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETAPEVERSION / ape version [%s]", | |
1402 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_APEVERSION, true).c_str()); | |
1403 | + | |
1404 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_APEVERSION).c_str()); | |
1405 | + } | |
1406 | + | |
1407 | + case HUY_GETAPEFLAGS: // 0x0126 | |
1408 | + { | |
1409 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETAPEFLAGS / ape flags [%s]", | |
1410 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_APEFLAGS, true).c_str()); | |
1411 | + | |
1412 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_APEFLAGS).c_str()); | |
1413 | + } | |
1414 | + | |
1415 | + case HUY_GETREPLAYGAIN_ALBUMGAIN: // 0x0128 | |
1416 | + { | |
1417 | + UINT nAlbumGain = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_REPLAYGAIN_ALBUMGAIN); | |
1418 | + | |
1419 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETREPLAYGAIN_ALBUMGAIN / album gain [%u]", nAlbumGain); | |
1420 | + | |
1421 | + return std::make_pair(true, (LRESULT)(LPCSTR)nAlbumGain); | |
1422 | + } | |
1423 | + | |
1424 | + case HUY_GETREPLAYGAIN_ALBUMPEEK: // 0x0129 | |
1425 | + { | |
1426 | + UINT nAlbumPeek = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_REPLAYGAIN_ALBUMPEEK); | |
1427 | + | |
1428 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETREPLAYGAIN_ALBUMPEEK / album peek [%u]", nAlbumPeek); | |
1429 | + | |
1430 | + return std::make_pair(true, (LRESULT)(LPCSTR)nAlbumPeek); | |
1431 | + } | |
1432 | + | |
1433 | + case HUY_GETREPLAYGAIN_TRACKGAIN: // 0x012A | |
1434 | + { | |
1435 | + UINT nTrackGain = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_REPLAYGAIN_TRACKGAIN); | |
1436 | + | |
1437 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETREPLAYGAIN_TRACKGAIN / track gain [%u]", nTrackGain); | |
1438 | + | |
1439 | + return std::make_pair(true, (LRESULT)(LPCSTR)nTrackGain); | |
1440 | + } | |
1441 | + | |
1442 | + case HUY_GETREPLAYGAIN_TRACKPEEK: // 0x012B | |
1443 | + { | |
1444 | + UINT nTrackPeek = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_REPLAYGAIN_TRACKPEEK); | |
1445 | + | |
1446 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETREPLAYGAIN_TRACKPEEK / track peek [%u]", nTrackPeek); | |
1447 | + | |
1448 | + return std::make_pair(true, (LRESULT)(LPCSTR)nTrackPeek); | |
1449 | + } | |
1450 | + | |
1451 | + case HUY_GETFILESIZE: // 0x0115 | |
1452 | + { | |
1453 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETFILESIZE / filesize [%s]"), | |
1454 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILESIZE, true).c_str()); | |
1455 | + | |
1456 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILESIZE).c_str()); | |
1457 | + } | |
1458 | + | |
1459 | + case HUY_GETFILECREATED: // 0x0116 | |
1460 | + { | |
1461 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETFILECREATED / created date [%s]"), | |
1462 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILECREATED, true).c_str()); | |
1463 | + | |
1464 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILECREATED).c_str()); | |
1465 | + } | |
1466 | + | |
1467 | + case HUY_GETFILELASTMOD: // 0x0117 | |
1468 | + { | |
1469 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETFILELASTMOD / last modified date [%s]"), | |
1470 | + Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILELASTMOD, true).c_str()); | |
1471 | + | |
1472 | + return std::make_pair(true, (LRESULT)(LPCSTR)Probe::getInstance()->getTrackInfo8().getString(FORMAT_FILELASTMOD).c_str()); | |
1473 | + } | |
1474 | + | |
1475 | + case HUY_ISINMEDIALIB: // 0x0118 | |
1476 | + { | |
1477 | + UINT isInMediaLibrary = Probe::getInstance()->getTrackInfo8().getNumber(FORMAT_ISINMEDIALIB); | |
1478 | + | |
1479 | + TRACE_HUYGENS_PROC( | |
1480 | + _T("Probe::huyIpcWindowProc - HUY_ISINMEDIALIB / lossless flag [%u]"), isInMediaLibrary); | |
1481 | + | |
1482 | + return std::make_pair(true, isInMediaLibrary); | |
1483 | + } | |
1484 | + | |
1485 | + case HUY_GETSTATUS: // 0x0200 | |
1486 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETSTATUS / status [%d]"), playStatus); | |
1487 | + return std::make_pair(true, playStatus); | |
1488 | + | |
1489 | + case HUY_GETPOS: // 0x0201 | |
1490 | + | |
1491 | + if(playStatus == PlayInfo::PLAY_START) | |
1492 | + { | |
1493 | +#if IS_FB2K_VER08 | |
1494 | + UINT playPosition = static_cast<UINT>(play_control::get()->get_playback_time() * 1000); | |
1495 | +#else IS_FB2K_VER09 | |
1496 | + UINT playPosition = static_cast<UINT>(static_api_ptr_t<playback_control>()->playback_get_position() * 1000); | |
1497 | +#endif | |
1498 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETPOS / position [%.3f sec.]"), playPosition / 1000.0); | |
1499 | + return std::make_pair(true, playPosition); | |
1500 | + } | |
1501 | + | |
1502 | + return std::make_pair(true, -1); | |
1503 | + | |
1504 | + case HUY_GETREPEAT: // 0x0202 | |
1505 | + { | |
1506 | +#if IS_FB2K_VER08 | |
1507 | + UINT nPlaybackOrder = | |
1508 | + menu_manager::is_command_checked("Playback/Order/Repeat") ? 1 : | |
1509 | + menu_manager::is_command_checked("Playback/Order/Repeat One") ? 2 : 0; | |
1510 | +#else IS_FB2K_VER09 | |
1511 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1512 | + nPlaybackOrder = (nPlaybackOrder >= 1) && (nPlaybackOrder <= 2) ? nPlaybackOrder : 0; | |
1513 | +#endif | |
1514 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETREPEAT / repeat mode [%u]"), nPlaybackOrder); | |
1515 | + return std::make_pair(true, nPlaybackOrder); | |
1516 | + } | |
1517 | + | |
1518 | + case HUY_GETSHUFFLE: // 0x0203 | |
1519 | + { | |
1520 | +#if IS_FB2K_VER08 | |
1521 | + UINT nPlaybackOrder = 0; | |
1522 | +#else IS_FB2K_VER09 | |
1523 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1524 | + nPlaybackOrder = (nPlaybackOrder >= 4) && (nPlaybackOrder <= 6) ? nPlaybackOrder - 3 : 0; | |
1525 | +#endif | |
1526 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETSHUFFLE / shuffle mode [%u]"), nPlaybackOrder); | |
1527 | + return std::make_pair(true, nPlaybackOrder); | |
1528 | + } | |
1529 | + | |
1530 | + case HUY_GETRANDOM: // 0x0204 | |
1531 | + { | |
1532 | +#if IS_FB2K_VER08 | |
1533 | + UINT nPlaybackOrder = menu_manager::is_command_checked("Playback/Order/Random"); | |
1534 | +#else IS_FB2K_VER09 | |
1535 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1536 | + nPlaybackOrder = (nPlaybackOrder == 3) ? 1 : 0; | |
1537 | +#endif | |
1538 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETRANDOM / random mode [%u]"), nPlaybackOrder); | |
1539 | + return std::make_pair(true, nPlaybackOrder); | |
1540 | + } | |
1541 | + | |
1542 | + case HUY_GETPLAYBACKORDER: // 0x0205 | |
1543 | + { | |
1544 | +#if IS_FB2K_VER08 | |
1545 | + UINT nPlaybackOrder = | |
1546 | + menu_manager::is_command_checked("Playback/Order/Repeat") ? 1 : | |
1547 | + menu_manager::is_command_checked("Playback/Order/Random") ? 3 : | |
1548 | + menu_manager::is_command_checked("Playback/Order/Default") ? 0 : | |
1549 | + menu_manager::is_command_checked("Playback/Order/Repeat One") ? 2 : 0; | |
1550 | +#else IS_FB2K_VER09 | |
1551 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1552 | + nPlaybackOrder = (nPlaybackOrder >= 1) && (nPlaybackOrder <= 6) ? nPlaybackOrder : 0; | |
1553 | +#endif | |
1554 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETPLAYBACKORDER / playback order [%u]"), nPlaybackOrder); | |
1555 | + return std::make_pair(true, nPlaybackOrder); | |
1556 | + } | |
1557 | + | |
1558 | + case HUY_GETLISTFOCUSPOS: // 0x0304 | |
1559 | + { | |
1560 | +#if IS_FB2K_VER08 | |
1561 | + int index = playlist_oper::get()->get_focus(); | |
1562 | +#elif IS_FB2K_VER09 | |
1563 | + t_size activeListIndex = static_api_ptr_t<playlist_manager>()->get_active_playlist(); | |
1564 | + t_size index = static_api_ptr_t<playlist_manager>()->playlist_get_focus_item(activeListIndex); | |
1565 | +#endif | |
1566 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_GETLISTFOCUSPOS / index [%u]"), index); | |
1567 | + return std::make_pair(true, index); | |
1568 | + } | |
1569 | + | |
1570 | + case HUY_GETENTRYTITLE: // 0x0303 | |
1571 | + { | |
1572 | + const string8 &playlistTitle8 = Probe::getInstance()->getPlaylistTitle8(); | |
1573 | + | |
1574 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_GETENTRYTITLE" | |
1575 | + " / title [%s]", (LPCSTR)playlistTitle8); | |
1576 | + | |
1577 | + return std::make_pair(true, (LRESULT)(LPCSTR)playlistTitle8); | |
1578 | + } | |
1579 | + | |
1580 | + case HUY_PLAY: // 0x0800 | |
1581 | + { | |
1582 | +#if IS_FB2K_VER08 | |
1583 | + bool bRes = true; | |
1584 | + play_control::get()->play_start(); | |
1585 | +#else IS_FB2K_VER09 | |
1586 | + bool bRes = standard_commands::main_play(); | |
1587 | +#endif | |
1588 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_PLAY"); | |
1589 | + | |
1590 | + return std::make_pair(true, bRes ? 0 : -1); | |
1591 | + } | |
1592 | + | |
1593 | + case HUY_PLAYORPAUSE: // 0x0814 | |
1594 | + { | |
1595 | +#if IS_FB2K_VER08 | |
1596 | + bool bRes = true; | |
1597 | + if(play_control::get()->is_paused()) { | |
1598 | + play_control::get()->play_start(); | |
1599 | + } else { | |
1600 | + play_control::get()->pause(); | |
1601 | + } | |
1602 | +#else IS_FB2K_VER09 | |
1603 | + bool bRes = standard_commands::main_play_or_pause(); | |
1604 | +#endif | |
1605 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_PLAYORPAUSE"); | |
1606 | + | |
1607 | + return std::make_pair(true, bRes ? 0 : -1); | |
1608 | + } | |
1609 | + | |
1610 | + case HUY_STOP: // 0x0801 | |
1611 | + { | |
1612 | +#if IS_FB2K_VER08 | |
1613 | + bool bRes = true; | |
1614 | + play_control::get()->play_stop(); | |
1615 | +#else IS_FB2K_VER09 | |
1616 | + bool bRes = standard_commands::main_stop(); | |
1617 | +#endif | |
1618 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_STOP"); | |
1619 | + | |
1620 | + return std::make_pair(true, bRes ? 0 : -1); | |
1621 | + } | |
1622 | + | |
1623 | + case HUY_PAUSE: // 0x0802 | |
1624 | + { | |
1625 | +#if IS_FB2K_VER08 | |
1626 | + bool bRes = true; | |
1627 | + play_control::get()->pause(); | |
1628 | +#else IS_FB2K_VER09 | |
1629 | + bool bRes = standard_commands::main_pause(); | |
1630 | +#endif | |
1631 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_PAUSE"); | |
1632 | + | |
1633 | + return std::make_pair(true, bRes ? 0 : -1); | |
1634 | + } | |
1635 | + | |
1636 | + case HUY_FASTFORWARD: // 0x0803 | |
1637 | + | |
1638 | + if(playStatus == PlayInfo::PLAY_START) | |
1639 | + { | |
1640 | + bool bRes = false; | |
1641 | + static int ffsecs[] = { 1, 5, 10, 30, 60, 120, 300, 600 }; | |
1642 | +#if IS_FB2K_VER08 | |
1643 | + lp = (lp >= 0) && (lp <= 7) ? lp : 0; | |
1644 | + play_control::get()->playback_seek_delta(ffsecs[lp]); | |
1645 | + bRes = true; | |
1646 | +#else IS_FB2K_VER09 | |
1647 | + switch(lp) | |
1648 | + { | |
1649 | + case 0: | |
1650 | + default: | |
1651 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_1s); | |
1652 | + lp = 0; | |
1653 | + break; | |
1654 | + case 1: | |
1655 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_5s); | |
1656 | + break; | |
1657 | + case 2: | |
1658 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_10s); | |
1659 | + break; | |
1660 | + case 3: | |
1661 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_30s); | |
1662 | + break; | |
1663 | + case 4: | |
1664 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_1min); | |
1665 | + break; | |
1666 | + case 5: | |
1667 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_2min); | |
1668 | + break; | |
1669 | + case 6: | |
1670 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_5min); | |
1671 | + break; | |
1672 | + case 7: | |
1673 | + bRes = standard_commands::run_main(standard_commands::guid_seek_ahead_10min); | |
1674 | + break; | |
1675 | + } | |
1676 | +#endif | |
1677 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_FASTFORWARD / seek ahead [%u secs.]", ffsecs[lp]); | |
1678 | + | |
1679 | + return std::make_pair(true, bRes ? 0 : -1); | |
1680 | + } | |
1681 | + | |
1682 | + return std::make_pair(true, -1); | |
1683 | + | |
1684 | + case HUY_REWIND: // 0x0804 | |
1685 | + | |
1686 | + if(playStatus == PlayInfo::PLAY_START) | |
1687 | + { | |
1688 | + bool bRes = false; | |
1689 | + static int rewsecs[] = { 1, 5, 10, 30, 60, 120, 300, 600 }; | |
1690 | +#if IS_FB2K_VER08 | |
1691 | + lp = (lp >= 0) && (lp <= 7) ? lp : 0; | |
1692 | + play_control::get()->playback_seek_delta(-rewsecs[lp]); | |
1693 | + bRes = true; | |
1694 | +#else IS_FB2K_VER09 | |
1695 | + switch(lp) | |
1696 | + { | |
1697 | + case 0: | |
1698 | + default: | |
1699 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_1s); | |
1700 | + lp = 0; | |
1701 | + break; | |
1702 | + case 1: | |
1703 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_5s); | |
1704 | + break; | |
1705 | + case 2: | |
1706 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_10s); | |
1707 | + break; | |
1708 | + case 3: | |
1709 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_30s); | |
1710 | + break; | |
1711 | + case 4: | |
1712 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_1min); | |
1713 | + break; | |
1714 | + case 5: | |
1715 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_2min); | |
1716 | + break; | |
1717 | + case 6: | |
1718 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_5min); | |
1719 | + break; | |
1720 | + case 7: | |
1721 | + bRes = standard_commands::run_main(standard_commands::guid_seek_back_10min); | |
1722 | + break; | |
1723 | + } | |
1724 | +#endif | |
1725 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_REWIND / seek back [%u sec.]", rewsecs[lp]); | |
1726 | + | |
1727 | + return std::make_pair(true, bRes ? 0 : -1); | |
1728 | + } | |
1729 | + | |
1730 | + return std::make_pair(true, -1); | |
1731 | + | |
1732 | + case HUY_PREVIOUS: // 0x0807 | |
1733 | + { | |
1734 | +#if IS_FB2K_VER08 | |
1735 | + bool bRes = true; | |
1736 | + play_control::get()->play_start(play_control::TRACK_COMMAND_PREV); | |
1737 | +#else IS_FB2K_VER09 | |
1738 | + bool bRes = standard_commands::main_previous(); | |
1739 | +#endif | |
1740 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_PREVIOUS"); | |
1741 | + | |
1742 | + return std::make_pair(true, bRes ? 0 : -1); | |
1743 | + } | |
1744 | + | |
1745 | + case HUY_NEXT: // 0x0808 | |
1746 | + { | |
1747 | +#if IS_FB2K_VER08 | |
1748 | + bool bRes = true; | |
1749 | + play_control::get()->play_start (play_control::TRACK_COMMAND_NEXT); | |
1750 | +#else IS_FB2K_VER09 | |
1751 | + bool bRes = standard_commands::main_next(); | |
1752 | +#endif | |
1753 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_NEXT"); | |
1754 | + | |
1755 | + return std::make_pair(true, bRes ? 0 : -1); | |
1756 | + } | |
1757 | + | |
1758 | + case HUY_SEEK: // 0x0809 | |
1759 | + | |
1760 | + if(playStatus == PlayInfo::PLAY_START) | |
1761 | + { | |
1762 | + double jumpPos = wp / 1000.0; | |
1763 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_SEEK") | |
1764 | + _T(" / jump to [%.3f sec.]"), jumpPos); | |
1765 | + | |
1766 | + if(jumpPos > playLength) | |
1767 | + { | |
1768 | + // eof | |
1769 | + return std::make_pair(true, 1); | |
1770 | + } | |
1771 | + else | |
1772 | + { | |
1773 | +#if IS_FB2K_VER08 | |
1774 | + play_control::get()->playback_seek(jumpPos); | |
1775 | +#else IS_FB2K_VER09 | |
1776 | + static_api_ptr_t<playback_control>()->playback_seek(jumpPos); | |
1777 | +#endif | |
1778 | + return std::make_pair(true, 0); | |
1779 | + } | |
1780 | + | |
1781 | + } | |
1782 | + | |
1783 | + return std::make_pair(true, -1); | |
1784 | + | |
1785 | + case HUY_VOLUMEUP: // 0x080B | |
1786 | + { | |
1787 | +#if IS_FB2K_VER08 | |
1788 | + bool bRes = true; | |
1789 | + play_control::get()->volume_up(); | |
1790 | +#else IS_FB2K_VER09 | |
1791 | + bool bRes = standard_commands::main_volume_up(); | |
1792 | +#endif | |
1793 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_VOLUMEUP"); | |
1794 | + | |
1795 | + return std::make_pair(true, bRes ? 0 : -1); | |
1796 | + } | |
1797 | + | |
1798 | + case HUY_VOLUMEDOWN: // 0x080C | |
1799 | + { | |
1800 | +#if IS_FB2K_VER08 | |
1801 | + bool bRes = true; | |
1802 | + play_control::get()->volume_down(); | |
1803 | +#else IS_FB2K_VER09 | |
1804 | + bool bRes = standard_commands::main_volume_down(); | |
1805 | +#endif | |
1806 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_VOLUMEDOWN"); | |
1807 | + | |
1808 | + return std::make_pair(true, bRes ? 0 : -1); | |
1809 | + } | |
1810 | + | |
1811 | + case HUY_SETREPEAT: // 0x080F | |
1812 | + { | |
1813 | + static LPCSTR modes[] = { "default", "repeat playlist", "repeat track" }; | |
1814 | + lp = (lp >= 0) && (lp <= 2) ? lp : 0; | |
1815 | +#if IS_FB2K_VER08 | |
1816 | + bool bRes = false; | |
1817 | + switch(lp) | |
1818 | + { | |
1819 | + case 0: | |
1820 | + default: | |
1821 | + bRes = menu_manager::run_command("Playback/Order/Default"); | |
1822 | + break; | |
1823 | + case 1: | |
1824 | + bRes = menu_manager::run_command("Playback/Order/Repeat"); | |
1825 | + break; | |
1826 | + case 2: | |
1827 | + bRes = menu_manager::run_command("Playback/Order/Repeat One"); | |
1828 | + break; | |
1829 | + } | |
1830 | +#else IS_FB2K_VER09 | |
1831 | + bool bRes = true; | |
1832 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(lp); | |
1833 | +#endif | |
1834 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_SETREPEAT / repeat mode [%s]", modes[lp]); | |
1835 | + | |
1836 | + return std::make_pair(true, bRes ? 0 : -1); | |
1837 | + } | |
1838 | + | |
1839 | + case HUY_SETSHUFFLE: // 0x0810 | |
1840 | + { | |
1841 | + static LPCSTR modes[] = { "default", "shuffle tracks", "shuffle albums", "shuffle folders" }; | |
1842 | + lp = (lp >= 1) && (lp <= 3) ? lp : 0; | |
1843 | + | |
1844 | +#if IS_FB2K_VER08 | |
1845 | + return std::make_pair(true, -1); | |
1846 | +#else IS_FB2K_VER09 | |
1847 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active((lp >= 1) && (lp <= 3) ? lp + 3 : 0); | |
1848 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_SETSHUFFLE / shuffle mode [%s]", modes[lp]); | |
1849 | + | |
1850 | + return std::make_pair(true, 0); | |
1851 | +#endif | |
1852 | + } | |
1853 | + | |
1854 | + case HUY_SETRANDOM: // 0x080E | |
1855 | + { | |
1856 | + static LPCSTR modes[] = { "default", "random" }; | |
1857 | +#if IS_FB2K_VER08 | |
1858 | + bool bRes = false; | |
1859 | + bRes = menu_manager::run_command("Playback/Order/Random"); | |
1860 | + if(lp != 1) { | |
1861 | + lp = 0; | |
1862 | + } | |
1863 | +#else IS_FB2K_VER09 | |
1864 | + bool bRes = true; | |
1865 | + switch(lp) | |
1866 | + { | |
1867 | + case 0: | |
1868 | + default: | |
1869 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(0); | |
1870 | + lp = 0; | |
1871 | + break; | |
1872 | + case 1: | |
1873 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(3); | |
1874 | + break; | |
1875 | + } | |
1876 | +#endif | |
1877 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_SETRANDOM / random mode [%s]", modes[lp]); | |
1878 | + | |
1879 | + return std::make_pair(true, bRes ? 0 : -1); | |
1880 | + } | |
1881 | + | |
1882 | + case HUY_SETPLAYBACKORDER: // 0x0815 | |
1883 | + { | |
1884 | + static LPCSTR modes[] = { "default", "repeat playlist", "repeat track", "random", "shuffle tracks", "shuffle albums", "shuffle folders" }; | |
1885 | +#if IS_FB2K_VER08 | |
1886 | + bool bRes = false; | |
1887 | + switch(lp) | |
1888 | + { | |
1889 | + case 0: | |
1890 | + default: | |
1891 | + bRes = menu_manager::run_command("Playback/Order/Default"); | |
1892 | + lp = 0; | |
1893 | + break; | |
1894 | + case 1: | |
1895 | + bRes = menu_manager::run_command("Playback/Order/Repeat"); | |
1896 | + break; | |
1897 | + case 2: | |
1898 | + bRes = menu_manager::run_command("Playback/Order/Repeat One"); | |
1899 | + break; | |
1900 | + case 3: | |
1901 | + bRes = menu_manager::run_command("Playback/Order/Random"); | |
1902 | + break; | |
1903 | + } | |
1904 | +#else IS_FB2K_VER09 | |
1905 | + bool bRes = true; | |
1906 | + lp = (lp >= 0) && (lp <= 6) ? lp : 0; | |
1907 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(lp); | |
1908 | +#endif | |
1909 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_SETPLAYBACKORDER / repeat mode [%s]", modes[lp]); | |
1910 | + | |
1911 | + return std::make_pair(true, bRes ? 0 : -1); | |
1912 | + } | |
1913 | + | |
1914 | + case HUY_TOGGLEREPEAT: // 0x0812 | |
1915 | + { | |
1916 | + bool bRes = false; | |
1917 | + static LPCSTR modes[] = { "repeat track", "repeat playlist", "default" }; | |
1918 | +#if IS_FB2K_VER08 | |
1919 | + UINT nPlaybackOrder = menu_manager::is_command_checked("Playback/Order/Repeat") ? 1 : | |
1920 | + menu_manager::is_command_checked("Playback/Order/Repeat One") ? 2 : 0; | |
1921 | + switch(nPlaybackOrder) | |
1922 | + { | |
1923 | + case 0: | |
1924 | + default: | |
1925 | + bRes = menu_manager::run_command("Playback/Order/Repeat"); | |
1926 | + break; | |
1927 | + case 1: | |
1928 | + bRes = menu_manager::run_command("Playback/Order/Repeat One"); | |
1929 | + break; | |
1930 | + case 2: | |
1931 | + bRes = menu_manager::run_command("Playback/Order/Default"); | |
1932 | + break; | |
1933 | + } | |
1934 | +#else IS_FB2K_VER09 | |
1935 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1936 | + nPlaybackOrder = (nPlaybackOrder >= 1) && (nPlaybackOrder <= 2) ? 3 - nPlaybackOrder : 0; | |
1937 | + | |
1938 | + switch(nPlaybackOrder) | |
1939 | + { | |
1940 | + case 0: | |
1941 | + default: | |
1942 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(1); | |
1943 | + break; | |
1944 | + case 1: | |
1945 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(2); | |
1946 | + break; | |
1947 | + case 2: | |
1948 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(0); | |
1949 | + break; | |
1950 | + } | |
1951 | +#endif | |
1952 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_TOGGLEREPEAT / repeat mode [%s]", modes[nPlaybackOrder]); | |
1953 | + | |
1954 | + return std::make_pair(true, bRes ? 0 : -1); | |
1955 | + } | |
1956 | + | |
1957 | + case HUY_TOGGLESHUFFLE: // 0x0813 | |
1958 | + { | |
1959 | + bool bRes = false; | |
1960 | + static LPCSTR modes[] = { "shuffle tracks", "shuffle albums", "shuffle folders", "default" }; | |
1961 | +#if IS_FB2K_VER08 | |
1962 | + return std::make_pair(true, -1); | |
1963 | +#else IS_FB2K_VER09 | |
1964 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
1965 | + nPlaybackOrder = (nPlaybackOrder >= 4) && (nPlaybackOrder <= 6) ? nPlaybackOrder - 3 : 0; | |
1966 | + | |
1967 | + switch(nPlaybackOrder) | |
1968 | + { | |
1969 | + case 0: | |
1970 | + default: | |
1971 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(4); | |
1972 | + break; | |
1973 | + case 1: | |
1974 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(5); | |
1975 | + break; | |
1976 | + case 2: | |
1977 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(6); | |
1978 | + break; | |
1979 | + case 3: | |
1980 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(0); | |
1981 | + break; | |
1982 | + } | |
1983 | + TRACE_HUYGENS_PROC8("Probe::huyIpcWindowProc - HUY_TOGGLESHUFFLE / shuffle mode [%s]", modes[nPlaybackOrder]); | |
1984 | + | |
1985 | + return std::make_pair(true, bRes ? 0 : -1); | |
1986 | +#endif | |
1987 | + } | |
1988 | + | |
1989 | + case HUY_TOGGLERANDOM: // 0x0811 | |
1990 | + { | |
1991 | + static LPCSTR modes[] = { "randome", "default" }; | |
1992 | +#if IS_FB2K_VER08 | |
1993 | + bool bRes = false; | |
1994 | + UINT nPlaybackOrder = menu_manager::is_command_checked ("Playback/Order/Random") ? 1 : 0; | |
1995 | + switch(nPlaybackOrder) | |
1996 | + { | |
1997 | + case 0: | |
1998 | + default: | |
1999 | + bRes = menu_manager::run_command("Playback/Order/Random"); | |
2000 | + break; | |
2001 | + case 1: | |
2002 | + bRes = menu_manager::run_command("Playback/Order/Default"); | |
2003 | + break; | |
2004 | + } | |
2005 | +#else IS_FB2K_VER09 | |
2006 | + bool bRes = true; | |
2007 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
2008 | + nPlaybackOrder = (nPlaybackOrder == 3) ? 1 : 0; | |
2009 | + | |
2010 | + switch(nPlaybackOrder) | |
2011 | + { | |
2012 | + case 0: | |
2013 | + default: | |
2014 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(3); | |
2015 | + break; | |
2016 | + case 1: | |
2017 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(0); | |
2018 | + break; | |
2019 | + } | |
2020 | +#endif | |
2021 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_TOGGLERANDOM / random mode [%s]"), modes[nPlaybackOrder]); | |
2022 | + return std::make_pair(true, bRes ? 0 : -1); | |
2023 | + } | |
2024 | + | |
2025 | + case HUY_TOGGLEPLAYBACKORDER: // 0x0816 | |
2026 | + { | |
2027 | +#if IS_FB2K_VER08 | |
2028 | + static LPCSTR modes[] = { "repeat playlist", "repeat track", "random", "default" }; | |
2029 | + bool bRes = false; | |
2030 | + UINT nPlaybackOrder = | |
2031 | + menu_manager::is_command_checked("Playback/Order/Repeat") ? 1 : | |
2032 | + menu_manager::is_command_checked("Playback/Order/Random") ? 3 : | |
2033 | + menu_manager::is_command_checked("Playback/Order/Default") ? 0 : | |
2034 | + menu_manager::is_command_checked("Playback/Order/Repeat One") ? 2 : 0; | |
2035 | + | |
2036 | + switch(nPlaybackOrder) | |
2037 | + { | |
2038 | + case 0: | |
2039 | + default: | |
2040 | + bRes = menu_manager::run_command("Playback/Order/Repeat"); | |
2041 | + break; | |
2042 | + case 1: | |
2043 | + bRes = menu_manager::run_command("Playback/Order/Repeat One"); | |
2044 | + break; | |
2045 | + case 2: | |
2046 | + bRes = menu_manager::run_command("Playback/Order/Random"); | |
2047 | + break; | |
2048 | + case 3: | |
2049 | + bRes = menu_manager::run_command("Playback/Order/Default"); | |
2050 | + break; | |
2051 | + } | |
2052 | +#else IS_FB2K_VER09 | |
2053 | + static LPCSTR modes[] = { "repeat playlist", "repeat track", "random", "shuffle tracks", "shuffle albums", "shuffle folders", "default" }; | |
2054 | + t_size nPlaybackOrder = static_api_ptr_t<playlist_manager>()->playback_order_get_active(); | |
2055 | + nPlaybackOrder = (nPlaybackOrder >= 1) && (nPlaybackOrder <= 6) ? (nPlaybackOrder + 1) % 6 : 1; | |
2056 | + static_api_ptr_t<playlist_manager>()->playback_order_set_active(nPlaybackOrder); | |
2057 | +#endif | |
2058 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_TOGGLEPLAYBACKORDER / playback order [%u]"), nPlaybackOrder); | |
2059 | + return std::make_pair(true, nPlaybackOrder); | |
2060 | + } | |
2061 | + | |
2062 | + case HUY_REFRESHLISTINFO: // 0x0A00 | |
2063 | + { | |
2064 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_REFRESHLISTINFO / refresh internal playlist informations.")); | |
2065 | + | |
2066 | + // make playlist info formats array | |
2067 | + std::vector<std::string> plStrKeys, plNumKeys; | |
2068 | + | |
2069 | + plStrKeys.push_back(FORMAT_PLAYLIST_NAME); | |
2070 | + | |
2071 | + plNumKeys.push_back(FORMAT_LISTINDEX); | |
2072 | + plNumKeys.push_back(FORMAT_LISTTOTAL); | |
2073 | + | |
2074 | + // set current track informations | |
2075 | + TRACK_INFO8 trackInfo8(Probe::getInstance()->getTrackInfo8()); | |
2076 | + | |
2077 | + trackInfo8.setPlaylistStrings(plStrKeys); | |
2078 | + trackInfo8.setPlaylistNumbers(plNumKeys); | |
2079 | + | |
2080 | + Probe::getInstance()->setTrackInfo8(trackInfo8); | |
2081 | + | |
2082 | + // refresh huygens title | |
2083 | + Probe::getInstance()->refreshTitle(); | |
2084 | + | |
2085 | + return std::make_pair(true, 0); | |
2086 | + } | |
2087 | + | |
2088 | + case HUY_REFRESHDYNINFO: // 0x0A01 | |
2089 | + { | |
2090 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - HUY_REFRESHDYNINFO / refresh internal dynamic informations.")); | |
2091 | + | |
2092 | + // make dynamic info formats array | |
2093 | + std::vector<std::string> dynStrKeys, dynNumKeys; | |
2094 | + | |
2095 | + dynStrKeys.push_back(FORMAT_ARTIST); | |
2096 | + dynStrKeys.push_back(FORMAT_TRACKTITLE); | |
2097 | + dynStrKeys.push_back(FORMAT_ALBUMTITLE); | |
2098 | + dynStrKeys.push_back(FORMAT_GENRE); | |
2099 | + dynStrKeys.push_back(FORMAT_TRACKDATE); | |
2100 | + dynStrKeys.push_back(FORMAT_COMPOSER); | |
2101 | + dynStrKeys.push_back(FORMAT_PERFORMER); | |
2102 | + dynStrKeys.push_back(FORMAT_ALBUMARTIST); | |
2103 | + dynStrKeys.push_back(FORMAT_TRACKARTIST); | |
2104 | + dynStrKeys.push_back(FORMAT_COMMENT); | |
2105 | + | |
2106 | + dynStrKeys.push_back(FORMAT_LENGTHSAMPLES); | |
2107 | + | |
2108 | + dynNumKeys.push_back(FORMAT_SUBSONG); | |
2109 | + dynNumKeys.push_back(FORMAT_TRACKNUMBER); | |
2110 | + dynNumKeys.push_back(FORMAT_TRACKTOTAL); | |
2111 | + dynNumKeys.push_back(FORMAT_DISCNUMBER); | |
2112 | + dynNumKeys.push_back(FORMAT_DISCTOTAL); | |
2113 | + | |
2114 | + dynNumKeys.push_back(FORMAT_BITRATE_DYNAMIC); | |
2115 | + | |
2116 | + // set current track informations | |
2117 | + TRACK_INFO8 trackInfo8(Probe::getInstance()->getTrackInfo8()); | |
2118 | + | |
2119 | + trackInfo8.setDynamicStrings(dynStrKeys); | |
2120 | + trackInfo8.setDynamicNumbers(dynNumKeys); | |
2121 | + | |
2122 | + Probe::getInstance()->setTrackInfo8(trackInfo8); | |
2123 | + | |
2124 | + // refresh huygens title | |
2125 | + Probe::getInstance()->refreshTitle(); | |
2126 | + | |
2127 | + return std::make_pair(true, 0); | |
2128 | + } | |
2129 | + | |
2130 | + default: | |
2131 | + TRACE_HUYGENS_PROC(_T("Probe::huyIpcWindowProc - WM_HUY_IPC (Unknown IPC command) / W:%08x, L:%08x"), wp, lp); | |
2132 | + break; | |
2133 | + } | |
2134 | + } | |
2135 | + break; | |
2136 | + } | |
2137 | + | |
2138 | + return std::make_pair(false, 0); | |
2139 | +} | |
2140 | + | |
2141 | +#if IS_FB2K_VER08 | |
2142 | +class play_callback_huygens : public play_callback | |
2143 | +#elif IS_FB2K_VER09 | |
2144 | +class play_callback_huygens : public play_callback_static | |
2145 | +#endif | |
2146 | +{ | |
2147 | +#if IS_FB2K_VER09 | |
2148 | + virtual unsigned get_flags() { | |
2149 | + return flag_on_playback_all; | |
2150 | + } | |
2151 | +#endif | |
2152 | + | |
2153 | +#if IS_FB2K_VER08 | |
2154 | + virtual void on_playback_starting() | |
2155 | +#elif IS_FB2K_VER09 | |
2156 | + virtual void on_playback_starting(play_control::t_track_command command, bool paused) | |
2157 | +#endif | |
2158 | + { | |
2159 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_starting - called.")); | |
2160 | + } | |
2161 | + | |
2162 | +#if IS_FB2K_VER08 | |
2163 | + virtual void on_playback_new_track(metadb_handle * track) | |
2164 | +#elif IS_FB2K_VER09 | |
2165 | + virtual void on_playback_new_track(metadb_handle_ptr track) | |
2166 | +#endif | |
2167 | + { | |
2168 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_new_track - called.")); | |
2169 | + | |
2170 | + // make currently playbacked track information keys | |
2171 | + std::vector<std::string> strKeys; | |
2172 | + std::vector<std::string> numKeys; | |
2173 | + | |
2174 | + strKeys.push_back(FORMAT_FB2KVERSION); | |
2175 | + strKeys.push_back(FORMAT_FILEPATH); | |
2176 | + strKeys.push_back(FORMAT_FILEPATHRAW); | |
2177 | + strKeys.push_back(FORMAT_ARTIST); | |
2178 | + strKeys.push_back(FORMAT_TRACKTITLE); | |
2179 | + strKeys.push_back(FORMAT_ALBUMTITLE); | |
2180 | + strKeys.push_back(FORMAT_GENRE); | |
2181 | + strKeys.push_back(FORMAT_TRACKDATE); | |
2182 | + strKeys.push_back(FORMAT_COMPOSER); | |
2183 | + strKeys.push_back(FORMAT_PERFORMER); | |
2184 | + strKeys.push_back(FORMAT_ALBUMARTIST); | |
2185 | + strKeys.push_back(FORMAT_TRACKARTIST); | |
2186 | + strKeys.push_back(FORMAT_COMMENT); | |
2187 | + strKeys.push_back(FORMAT_CODEC); | |
2188 | + strKeys.push_back(FORMAT_CODECPROFILE); | |
2189 | + strKeys.push_back(FORMAT_TAGTYPE); | |
2190 | + strKeys.push_back(FORMAT_EXTRAINFO); | |
2191 | + strKeys.push_back(FORMAT_TOOL); | |
2192 | + strKeys.push_back(FORMAT_AUDIOMD5HASH); | |
2193 | + strKeys.push_back(FORMAT_APEVERSION); | |
2194 | + strKeys.push_back(FORMAT_APEFLAGS); | |
2195 | + | |
2196 | + strKeys.push_back(FORMAT_FILESIZE); | |
2197 | +// strKeys.push_back(FORMAT_FILECREATED); | |
2198 | +// strKeys.push_back(FORMAT_FILELASTMOD); | |
2199 | + | |
2200 | + numKeys.push_back(FORMAT_SUBSONG); | |
2201 | + numKeys.push_back(FORMAT_TRACKNUMBER); | |
2202 | + numKeys.push_back(FORMAT_TRACKTOTAL); | |
2203 | + numKeys.push_back(FORMAT_DISCNUMBER); | |
2204 | + numKeys.push_back(FORMAT_DISCTOTAL); | |
2205 | + numKeys.push_back(FORMAT_SAMPLERATE); | |
2206 | + | |
2207 | + numKeys.push_back(FORMAT_BITRATE); | |
2208 | + numKeys.push_back(FORMAT_BITRATE_NOMINAL); | |
2209 | + numKeys.push_back(FORMAT_CHANNELS); | |
2210 | + numKeys.push_back(FORMAT_BITSPERSAMPLE); | |
2211 | + numKeys.push_back(FORMAT_LOSSLESS); | |
2212 | + numKeys.push_back(FORMAT_CUEEMBEDDED); | |
2213 | + numKeys.push_back(FORMAT_MP3STEREOMODE); | |
2214 | + numKeys.push_back(FORMAT_MP3ACCURATELENGTH); | |
2215 | + numKeys.push_back(FORMAT_MP3ENCDELAY); | |
2216 | + numKeys.push_back(FORMAT_MP3ENCPADDING); | |
2217 | + | |
2218 | + numKeys.push_back(FORMAT_REPLAYGAIN_ALBUMGAIN); | |
2219 | + numKeys.push_back(FORMAT_REPLAYGAIN_ALBUMPEEK); | |
2220 | + numKeys.push_back(FORMAT_REPLAYGAIN_TRACKGAIN); | |
2221 | + numKeys.push_back(FORMAT_REPLAYGAIN_TRACKPEEK); | |
2222 | + | |
2223 | + // set current track informations | |
2224 | + m_trackInfo8.clear(); | |
2225 | + m_trackInfo8.setStrings(strKeys, track); | |
2226 | + m_trackInfo8.setNumbers(numKeys, track); | |
2227 | + | |
2228 | + // is playback track in media library? | |
2229 | +#if IS_FB2K_VER08 | |
2230 | + m_trackInfo8.putNumber(FORMAT_ISINMEDIALIB, track->handle_is_permcached()); | |
2231 | +#elif IS_FB2K_VER09 | |
2232 | + m_trackInfo8.putNumber(FORMAT_ISINMEDIALIB, static_api_ptr_t<library_manager>()->is_item_in_library(track) ? 1 : 0); | |
2233 | +#endif | |
2234 | + | |
2235 | + // get song total length | |
2236 | +#if IS_FB2K_VER08 | |
2237 | + double total_sec = track->handle_get_length(); | |
2238 | +#elif IS_FB2K_VER09 | |
2239 | + double total_sec = track->get_length(); | |
2240 | +#endif | |
2241 | + | |
2242 | + // set file created and last modifed datetime | |
2243 | +#if IS_FB2K_VER08 | |
2244 | + putFileInfo(track->handle_get_path()); | |
2245 | +#elif IS_FB2K_VER09 | |
2246 | + putFileInfo(track->get_path()); | |
2247 | +#endif | |
2248 | + | |
2249 | + // set trackinfo to huygens | |
2250 | + Probe::getInstance()->setTrackInfo8(m_trackInfo8); | |
2251 | + | |
2252 | + // clear playinfo on huygens | |
2253 | + Probe::getInstance()->getPlayInfo().clearPlayInfo(); | |
2254 | + | |
2255 | + // set huygens status PLAY_START | |
2256 | + Probe::getInstance()->getPlayInfo().setPlayStatusStart(); | |
2257 | + | |
2258 | + // set song total length | |
2259 | + Probe::getInstance()->getPlayInfo().setPlayLength(total_sec); | |
2260 | + | |
2261 | + // increment play counter on huygens | |
2262 | + Probe::getInstance()->getPlayInfo().incrementPlayCount(); | |
2263 | + | |
2264 | + // post HUY_REFRESHLISTINFO | |
2265 | + ::PostMessage(Probe::getInstance()->getWnd(), WM_HUY_IPC, 0, HUY_REFRESHLISTINFO); | |
2266 | + DEBUG_CALLBACK(_T("play_callback_huygens::on_playback_new_track - HUY_REFRESHLISTINFO posted.")); | |
2267 | + } | |
2268 | + | |
2269 | +#if IS_FB2K_VER08 | |
2270 | + virtual void on_playback_stop(play_control::stop_reason reason) | |
2271 | +#elif IS_FB2K_VER09 | |
2272 | + virtual void on_playback_stop(play_control::t_stop_reason reason) | |
2273 | +#endif | |
2274 | + { | |
2275 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_stop - called.")); | |
2276 | + | |
2277 | + // set huygens status PLAY_STOP | |
2278 | + Probe::getInstance()->getPlayInfo().setPlayStatusStop(); | |
2279 | + | |
2280 | + // clear huygens title | |
2281 | + Probe::getInstance()->clearProbeTitle(); | |
2282 | + } | |
2283 | + | |
2284 | + virtual void on_playback_seek(double time) // time is second. | |
2285 | + { | |
2286 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_seek - called.")); | |
2287 | + | |
2288 | + // update current position on huygens | |
2289 | + Probe::getInstance()->getPlayInfo().setPlayPosition((int)(time * 1000)); | |
2290 | + } | |
2291 | + | |
2292 | +#if IS_FB2K_VER08 | |
2293 | + virtual void on_playback_pause(int state) | |
2294 | +#elif IS_FB2K_VER09 | |
2295 | + virtual void on_playback_pause(bool state) | |
2296 | +#endif | |
2297 | + { | |
2298 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_pause - called.")); | |
2299 | + | |
2300 | +#if IS_FB2K_VER08 | |
2301 | + if(state == 1) | |
2302 | +#elif IS_FB2K_VER09 | |
2303 | + if(state == true) | |
2304 | +#endif | |
2305 | + { | |
2306 | + // set huygens status PLAY_PAUSE | |
2307 | + Probe::getInstance()->getPlayInfo().setPlayStatusPause(); | |
2308 | + | |
2309 | + DEBUG_CALLBACK(_T("play_callback_huygens::on_playback_pause - fb2k paused.")); | |
2310 | + } | |
2311 | + else | |
2312 | + { | |
2313 | + // set huygens status PLAY_START | |
2314 | + Probe::getInstance()->getPlayInfo().setPlayStatusStart(); | |
2315 | + | |
2316 | + DEBUG_CALLBACK(_T("play_callback_huygens::on_playback_pause - fb2k unpaused.")); | |
2317 | + } | |
2318 | + } | |
2319 | + | |
2320 | +#if IS_FB2K_VER08 | |
2321 | + virtual void on_playback_edited(metadb_handle * track){}//currently played file got edited | |
2322 | +#elif IS_FB2K_VER09 | |
2323 | + virtual void on_playback_edited(metadb_handle_ptr track){}//currently played file got edited | |
2324 | +#endif | |
2325 | + | |
2326 | +#if IS_FB2K_VER08 | |
2327 | + virtual void on_playback_dynamic_info(const file_info * info,bool b_track_change) | |
2328 | +#elif IS_FB2K_VER09 | |
2329 | + virtual void on_playback_dynamic_info(const file_info & info) | |
2330 | +#endif | |
2331 | + { | |
2332 | + if(cfg_use_plugin == 0) { | |
2333 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_dynamic_info - called.")); | |
2334 | + return ; | |
2335 | + } | |
2336 | + | |
2337 | +#if IS_FB2K_VER08 | |
2338 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_dynamic_info - HUY_REFRESHDYNINFO posted.")); | |
2339 | + ::PostMessage(Probe::getInstance()->getWnd(), WM_HUY_IPC, 0, HUY_REFRESHDYNINFO); | |
2340 | +#endif | |
2341 | + } | |
2342 | + | |
2343 | +#if IS_FB2K_VER09 | |
2344 | + virtual void on_playback_dynamic_info_track(const file_info & p_info) | |
2345 | + { | |
2346 | + if(cfg_use_plugin == 0) { | |
2347 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_dynamic_info_track - called.")); | |
2348 | + return ; | |
2349 | + } | |
2350 | + | |
2351 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_dynamic_info_track - HUY_REFRESHDYNINFO posted.")); | |
2352 | + ::PostMessage(Probe::getInstance()->getWnd(), WM_HUY_IPC, 0, HUY_REFRESHDYNINFO); | |
2353 | + } | |
2354 | +#endif | |
2355 | + | |
2356 | +#if IS_FB2K_VER08 | |
2357 | + virtual void on_playback_time(metadb_handle * track, double time)//called every second | |
2358 | +#elif IS_FB2K_VER09 | |
2359 | + virtual void on_playback_time(double time)//called every second | |
2360 | +#endif | |
2361 | + { | |
2362 | + TRACE_CALLBACK(_T("play_callback_huygens::on_playback_time - called.")); | |
2363 | + | |
2364 | + // update current position on huygens | |
2365 | + Probe::getInstance()->getPlayInfo().setPlayPosition((int)(time * 1000)); | |
2366 | + } | |
2367 | + | |
2368 | +#if IS_FB2K_VER09 | |
2369 | + // User changed volume settings. Possibly called when not playing. | |
2370 | + virtual void on_volume_change(float new_val) {} | |
2371 | +#endif | |
2372 | + | |
2373 | +protected: | |
2374 | + | |
2375 | + void putFileInfo(const std::string &rawFilePath8) | |
2376 | + { | |
2377 | + std::string localFilePath8 = getLocalFilePath(rawFilePath8); | |
2378 | + | |
2379 | + if(localFilePath8.empty() == false) | |
2380 | + { | |
2381 | + WIN32_FIND_DATA wfd; | |
2382 | + | |
2383 | + // ファイル検索API関数によりファイル日時を取得 | |
2384 | + string_os_from_utf8 localFilePathOS(localFilePath8.c_str()); | |
2385 | + | |
2386 | + HANDLE hFindFirstFile = ::FindFirstFile(localFilePathOS, &wfd); | |
2387 | + if(hFindFirstFile != INVALID_HANDLE_VALUE) { | |
2388 | + | |
2389 | + // ハンドルを閉じる | |
2390 | + ::FindClose(hFindFirstFile); | |
2391 | + | |
2392 | + // ファイル作成日時 | |
2393 | + putFileTime(FORMAT_FILECREATED, wfd.ftCreationTime); | |
2394 | + | |
2395 | + // ファイル最終書込日時 | |
2396 | + putFileTime(FORMAT_FILELASTMOD, wfd.ftLastWriteTime); | |
2397 | + | |
2398 | + } else { | |
2399 | + | |
2400 | + putLogError(_T("play_callback_huygens::putFileInfo"), | |
2401 | + _T("ファイル日時属性の取得(FindFirstFile)に失敗しました"), ::GetLastError()); | |
2402 | + } | |
2403 | + } | |
2404 | + } | |
2405 | + | |
2406 | + static std::string getLocalFilePath(const std::string &rawFilePath) | |
2407 | + { | |
2408 | + std::string filePath; | |
2409 | + | |
2410 | + bool isFileProtocol = rawFilePath.find(FILE_PROTOCOL) != std::string::npos; | |
2411 | + | |
2412 | + if(isFileProtocol) | |
2413 | + { | |
2414 | + filePath = rawFilePath.substr(::lstrlenA(FILE_PROTOCOL)); | |
2415 | + } | |
2416 | + else if(rawFilePath.length() >= 3) | |
2417 | + { | |
2418 | + LPCSTR pRawFilePath = rawFilePath.c_str(); | |
2419 | + bool isDriveName = ::isalpha(pRawFilePath[0]) && (pRawFilePath[1] == ':') && (pRawFilePath[2] == '\\'); | |
2420 | + | |
2421 | + if(isDriveName) | |
2422 | + { | |
2423 | + filePath = rawFilePath.substr(::lstrlenA(FILE_PROTOCOL)); | |
2424 | + } | |
2425 | + } | |
2426 | + | |
2427 | + return filePath; | |
2428 | + } | |
2429 | + | |
2430 | + void putFileTime(LPCSTR key, const FILETIME &fileTime) | |
2431 | + { | |
2432 | + SYSTEMTIME systemTime; | |
2433 | + FileTimeToSystemTime(&fileTime, &systemTime); | |
2434 | + | |
2435 | + StrDBCS64K formattedTime; | |
2436 | + | |
2437 | + //DEBUG_CALLBACK(_T("putFileTime - FILETIME: H-%lu, L-%lu"), fileTime.dwHighDateTime, fileTime.dwLowDateTime); | |
2438 | + | |
2439 | + sprintf_s(formattedTime, sizeof(StrDBCS64K), "%04d%02d%02d%02d%02d%02d.%03d%03d%1d00", | |
2440 | + systemTime.wYear, systemTime.wMonth, systemTime.wDay, | |
2441 | + systemTime.wHour, systemTime.wMinute, systemTime.wSecond, | |
2442 | + systemTime.wMilliseconds, | |
2443 | + (fileTime.dwLowDateTime / 10 % 1000), // microseconds | |
2444 | + fileTime.dwLowDateTime % 10 // nanoseconds | |
2445 | + ); | |
2446 | + | |
2447 | + m_trackInfo8.putString(key, formattedTime); | |
2448 | + } | |
2449 | + | |
2450 | +protected: | |
2451 | + | |
2452 | + TRACK_INFO8 m_trackInfo8; | |
2453 | +}; | |
2454 | + | |
2455 | + | |
2456 | +class initquit_send : public initquit | |
2457 | +{ | |
2458 | + typedef std::auto_ptr<Probe> ProbeAutoPtr; | |
2459 | + ProbeAutoPtr m_apProbe; | |
2460 | + | |
2461 | + virtual void on_init() | |
2462 | + { | |
2463 | + m_apProbe = ProbeAutoPtr(Probe::getInstance()); | |
2464 | + m_apProbe->load(); | |
2465 | + } | |
2466 | + | |
2467 | + virtual void on_quit() | |
2468 | + { | |
2469 | + m_apProbe->release(); | |
2470 | + { | |
2471 | + ProbeAutoPtr sink(m_apProbe); | |
2472 | + } | |
2473 | + } | |
2474 | + | |
2475 | + virtual void on_system_shutdown() | |
2476 | + { | |
2477 | + on_quit(); | |
2478 | + } | |
2479 | +}; | |
2480 | + | |
2481 | +#if IS_FB2K_VER08 | |
2482 | +class menu_item_huygens : public menu_item_main | |
2483 | +#elif IS_FB2K_VER09 | |
2484 | +// {C6379E09-0AD9-43a0-A37A-5CACC2A347E5} | |
2485 | +static const GUID menu_item_huygens_guid = { 0xc6379e09, 0xad9, 0x43a0, { 0xa3, 0x7a, 0x5c, 0xac, 0xc2, 0xa3, 0x47, 0xe5 } }; | |
2486 | +class menu_item_huygens : public mainmenu_commands | |
2487 | +#endif | |
2488 | +{ | |
2489 | +#if IS_FB2K_VER08 | |
2490 | + virtual unsigned get_num_items() { | |
2491 | +#elif IS_FB2K_VER09 | |
2492 | + virtual t_uint32 get_command_count() { | |
2493 | +#endif | |
2494 | + return 1; | |
2495 | + } | |
2496 | + | |
2497 | +#if IS_FB2K_VER08 | |
2498 | + virtual void enum_item(unsigned n, string_base & out) { | |
2499 | + out = (n==0 ? g_menu_item : ""); | |
2500 | + } | |
2501 | +#elif IS_FB2K_VER09 | |
2502 | + virtual GUID get_command(t_uint32 p_index) | |
2503 | + { | |
2504 | + if (p_index == 0) { | |
2505 | + return menu_item_huygens_guid; | |
2506 | + } | |
2507 | + | |
2508 | + return pfc::guid_null; | |
2509 | + } | |
2510 | + | |
2511 | + virtual void get_name(t_uint32 p_index, string_base & p_out) | |
2512 | + { | |
2513 | + if (p_index == 0) { | |
2514 | + p_out = g_menu_item_title; | |
2515 | + } | |
2516 | + } | |
2517 | + | |
2518 | + virtual bool get_description(t_uint32 p_index, string_base & p_out) | |
2519 | + { | |
2520 | + if (p_index == 0) | |
2521 | + p_out = g_menu_item_description; | |
2522 | + else | |
2523 | + return false; | |
2524 | + | |
2525 | + return true; | |
2526 | + } | |
2527 | + virtual GUID get_parent() { | |
2528 | + return mainmenu_groups::playback_etc; | |
2529 | + } | |
2530 | + | |
2531 | +#endif | |
2532 | + | |
2533 | +#if IS_FB2K_VER08 | |
2534 | + virtual bool is_checked(int index) | |
2535 | + { | |
2536 | + bool flags = false; | |
2537 | + static const bool flag_checked = TRUE; | |
2538 | +#elif IS_FB2K_VER09 | |
2539 | + virtual bool get_display(t_uint32 index, pfc::string_base & text, t_uint32 & flags) | |
2540 | + { | |
2541 | + flags = 0; | |
2542 | +#endif | |
2543 | + switch (index) | |
2544 | + { | |
2545 | + case 0: | |
2546 | + if (cfg_use_plugin == 1) flags = flag_checked; | |
2547 | + break; | |
2548 | + } | |
2549 | + | |
2550 | +#if IS_FB2K_VER08 | |
2551 | + return flags; | |
2552 | +#elif IS_FB2K_VER09 | |
2553 | + get_name(index, text); | |
2554 | + return true; | |
2555 | +#endif | |
2556 | + } | |
2557 | + | |
2558 | +#if IS_FB2K_VER08 | |
2559 | + virtual void perform_command(unsigned index) | |
2560 | + { | |
2561 | +#elif IS_FB2K_VER09 | |
2562 | + virtual void execute(t_uint32 index, service_ptr_t<service_base> /* reserved for future use */) | |
2563 | + { | |
2564 | +#endif | |
2565 | + if ((index == 0) && core_api::assert_main_thread()) | |
2566 | + { | |
2567 | + cfg_use_plugin = 1 - cfg_use_plugin; | |
2568 | + | |
2569 | + if(cfg_use_plugin > 1) | |
2570 | + { | |
2571 | + cfg_use_plugin = 1; | |
2572 | + } | |
2573 | + else if(cfg_use_plugin < 0) | |
2574 | + { | |
2575 | + cfg_use_plugin = 0; | |
2576 | + } | |
2577 | + | |
2578 | + if (cfg_use_plugin == 1) | |
2579 | + { | |
2580 | + DEBUG_PLUGIN(_T("menu_item_huygens::execute - Huygens の応答機能を有効にしました")); | |
2581 | + } | |
2582 | + else | |
2583 | + { | |
2584 | + DEBUG_PLUGIN(_T("menu_item_huygens::execute - Huygens の応答機能を無効にしました")); | |
2585 | + } | |
2586 | + } | |
2587 | + } | |
2588 | +}; | |
2589 | + | |
2590 | +#if IS_FB2K_VER08 | |
2591 | +class config_page_huygens : public config | |
2592 | +#elif IS_FB2K_VER09 | |
2593 | +// {81110BB1-9F51-473d-BB40-C91D2F0A8329} | |
2594 | +static const GUID config_page_huygens_guid = { 0x81110bb1, 0x9f51, 0x473d, { 0xbb, 0x40, 0xc9, 0x1d, 0x2f, 0xa, 0x83, 0x29 } }; | |
2595 | +class config_page_huygens : public preferences_page | |
2596 | +#endif | |
2597 | +{ | |
2598 | + static BOOL CALLBACK ConfigProc(HWND wnd,UINT msg,WPARAM wp,LPARAM lp) | |
2599 | + { | |
2600 | + switch(msg) | |
2601 | + { | |
2602 | + case WM_INITDIALOG: | |
2603 | + { | |
2604 | + uButton_SetCheck(wnd, IDC_USE_PLUGIN, (cfg_use_plugin == 1) ? true : false); | |
2605 | + | |
2606 | + setDlgVersionInfo(wnd, IDC_VERSION, IDC_BUILD); | |
2607 | + } | |
2608 | + break; | |
2609 | + | |
2610 | + case WM_COMMAND: | |
2611 | + switch(wp) | |
2612 | + { | |
2613 | + case (BN_CLICKED<<16)|IDC_USE_PLUGIN: | |
2614 | + cfg_use_plugin = uButton_GetCheck(wnd, IDC_USE_PLUGIN) ? 1 : 0; | |
2615 | + break; | |
2616 | + } | |
2617 | + break; | |
2618 | + | |
2619 | + } | |
2620 | + | |
2621 | + return 0; | |
2622 | + } | |
2623 | + | |
2624 | +public: | |
2625 | + virtual HWND create(HWND parent) | |
2626 | + { | |
2627 | + return uCreateDialog(IDD_PREFERENCE, parent, ConfigProc); | |
2628 | + } | |
2629 | + | |
2630 | + virtual const char * get_name() { | |
2631 | + return g_pluginCaption8; | |
2632 | + } | |
2633 | + | |
2634 | + virtual const char * get_parent_name() { | |
2635 | + return "Components"; | |
2636 | + } | |
2637 | + | |
2638 | +#if IS_FB2K_VER09 | |
2639 | + virtual GUID get_guid() { | |
2640 | + return config_page_huygens_guid; | |
2641 | + } | |
2642 | + | |
2643 | + virtual GUID get_parent_guid() { | |
2644 | + return guid_tools; | |
2645 | + } | |
2646 | + | |
2647 | + virtual bool reset_query() { | |
2648 | + return true; | |
2649 | + } | |
2650 | + | |
2651 | + virtual void reset() | |
2652 | + { | |
2653 | + cfg_use_plugin = 1; | |
2654 | + } | |
2655 | + | |
2656 | + virtual bool get_help_url(pfc::string_base & p_out) | |
2657 | + { | |
2658 | + p_out = URL_FOO_HUYGENS_HOME; | |
2659 | + return true; | |
2660 | + } | |
2661 | +#endif | |
2662 | +}; | |
2663 | + | |
2664 | +#if IS_FB2K_VER08 | |
2665 | +class config_page_huygens_advanced : public config | |
2666 | +#elif IS_FB2K_VER09 | |
2667 | +// {237E0DDE-DE84-42f1-B3FA-AA2AB0A4B0B0} | |
2668 | +static const GUID config_page_huygens_advanced_guid = { 0x237e0dde, 0xde84, 0x42f1, { 0xb3, 0xfa, 0xaa, 0x2a, 0xb0, 0xa4, 0xb0, 0xb0 } }; | |
2669 | +class config_page_huygens_advanced : public preferences_page_v2 | |
2670 | +#endif | |
2671 | +{ | |
2672 | + static int nOldDummyMp3Location; | |
2673 | + static string8 oldGenMixiPath; | |
2674 | + | |
2675 | + static BOOL CALLBACK ConfigProc(HWND wnd,UINT msg,WPARAM wp,LPARAM lp) | |
2676 | + { | |
2677 | + switch(msg) | |
2678 | + { | |
2679 | + case WM_INITDIALOG: | |
2680 | + { | |
2681 | + uSetDlgItemText(wnd, IDC_CAPTION_ADVANCED, g_advancedSettingsCaption8); | |
2682 | + | |
2683 | + uButton_SetCheck(wnd, IDC_SHOW_HUYGENS, (cfg_show_huygens == 1) ? true : false); | |
2684 | + if(Probe::getInstance()->getWnd() == INVALID_HANDLE_VALUE) { | |
2685 | + HWND hControlWnd = uGetDlgItem(wnd, IDC_SHOW_HUYGENS); | |
2686 | + uEnableWindow(hControlWnd, false); | |
2687 | + } | |
2688 | + | |
2689 | + uSetDlgItemText(wnd, IDC_HUYGENS_TITLE_FORMAT, cfg_huygens_title_format); | |
2690 | + uSetDlgItemText(wnd, IDC_HUYGENS_PLAYLIST_FORMAT, cfg_huygens_playlist_format); | |
2691 | + | |
2692 | + uButton_SetCheck(wnd, IDC_DISABLE_ANSI_TRANS, (cfg_disable_ansi_trans == 1) ? true : false); | |
2693 | + | |
2694 | + setDlgVersionInfo(wnd, IDC_VERSION_ADVANCED, IDC_BUILD_ADVANCED); | |
2695 | + } | |
2696 | + break; | |
2697 | + | |
2698 | + case WM_COMMAND: | |
2699 | + switch(wp) | |
2700 | + { | |
2701 | + case (BN_CLICKED<<16)|IDC_SHOW_HUYGENS: | |
2702 | + { | |
2703 | + bool bShowProbe = uButton_GetCheck(wnd, IDC_SHOW_HUYGENS); | |
2704 | + cfg_show_huygens = bShowProbe ? 1 : 0; | |
2705 | + | |
2706 | + Probe::getInstance()->showProbeWindow(bShowProbe); | |
2707 | + } | |
2708 | + break; | |
2709 | + | |
2710 | + case (EN_CHANGE<<16)|IDC_HUYGENS_PLAYLIST_FORMAT: | |
2711 | + { | |
2712 | + string8 format; | |
2713 | + uGetWindowText(reinterpret_cast<HWND>(lp), format); | |
2714 | + cfg_huygens_title_format = format; | |
2715 | + } | |
2716 | + break; | |
2717 | + | |
2718 | + case (EN_CHANGE<<16)|IDC_HUYGENS_TITLE_FORMAT: | |
2719 | + { | |
2720 | + string8 format; | |
2721 | + uGetWindowText(reinterpret_cast<HWND>(lp), format); | |
2722 | + cfg_huygens_playlist_format = format; | |
2723 | + } | |
2724 | + break; | |
2725 | + | |
2726 | + case (BN_CLICKED<<16)|IDC_DISABLE_ANSI_TRANS: | |
2727 | + { | |
2728 | + cfg_disable_ansi_trans = uButton_GetCheck(wnd, IDC_DISABLE_ANSI_TRANS) ? 1 : 0; | |
2729 | + } | |
2730 | + break; | |
2731 | + | |
2732 | + default: | |
2733 | + break; | |
2734 | + } | |
2735 | + break; | |
2736 | + } | |
2737 | + | |
2738 | + return 0; | |
2739 | + } | |
2740 | + | |
2741 | +public: | |
2742 | + | |
2743 | + virtual HWND create(HWND parent) | |
2744 | + { | |
2745 | + return uCreateDialog(IDD_ADVANCED_SETTINGS, parent, ConfigProc); | |
2746 | + } | |
2747 | + | |
2748 | + virtual const char * get_name() { | |
2749 | + return g_advancedSettingsCaption8; | |
2750 | + } | |
2751 | + virtual const char * get_parent_name() { | |
2752 | + return g_pluginCaption8; | |
2753 | + } | |
2754 | + | |
2755 | +#if IS_FB2K_VER09 | |
2756 | + virtual GUID get_guid() { | |
2757 | + return config_page_huygens_advanced_guid; | |
2758 | + } | |
2759 | + | |
2760 | + virtual GUID get_parent_guid() { | |
2761 | + return config_page_huygens_guid; | |
2762 | + } | |
2763 | + | |
2764 | + virtual double get_sort_priority() { | |
2765 | + return 1.0; | |
2766 | + } | |
2767 | + | |
2768 | + virtual bool reset_query() { | |
2769 | + return true; | |
2770 | + } | |
2771 | + | |
2772 | + virtual void reset() { | |
2773 | + cfg_show_huygens = 0; | |
2774 | + cfg_huygens_title_format = DEFAULT_HUYGENS_TITLE; | |
2775 | + cfg_huygens_playlist_format = DEFAULT_HUYGENS_TITLE; | |
2776 | + } | |
2777 | + | |
2778 | + virtual bool get_help_url(pfc::string_base & p_out) { | |
2779 | + p_out = URL_FOO_HUYGENS_HOME; | |
2780 | + return true; | |
2781 | + } | |
2782 | +#endif | |
2783 | +}; | |
2784 | + | |
2785 | +#if IS_FB2K_VER08 | |
2786 | +class config_page_huygens_debug : public config | |
2787 | +#elif IS_FB2K_VER09 | |
2788 | +// {C0B24574-B65A-430e-9F27-D7BBADB28053} | |
2789 | +static const GUID config_page_huygens_debug_guid = { 0xc0b24574, 0xb65a, 0x430e, { 0x9f, 0x27, 0xd7, 0xbb, 0xad, 0xb2, 0x80, 0x53 } }; | |
2790 | +class config_page_huygens_debug : public preferences_page_v2 | |
2791 | +#endif | |
2792 | +{ | |
2793 | + static BOOL CALLBACK ConfigProc(HWND wnd,UINT msg,WPARAM wp,LPARAM lp) | |
2794 | + { | |
2795 | + switch(msg) | |
2796 | + { | |
2797 | + case WM_INITDIALOG: | |
2798 | + { | |
2799 | + uSetDlgItemText(wnd, IDC_CAPTION_DEBUG, g_debugSettingsCaption8); | |
2800 | + | |
2801 | + bool bDebugLogEnabled = (cfg_enable_debug_log == 1) ? true : false; | |
2802 | + uButton_SetCheck(wnd, IDC_ENABLE_DEBUG_LOG, bDebugLogEnabled); | |
2803 | + | |
2804 | + InitDebugLevelList(wnd, IDC_DEBUG_HUYGENS_INIT); | |
2805 | + InitDebugLevelList(wnd, IDC_DEBUG_HUYGENS_PROC); | |
2806 | + InitDebugLevelList(wnd, IDC_DEBUG_TRACK_INFO); | |
2807 | + InitDebugLevelList(wnd, IDC_DEBUG_PLUGIN); | |
2808 | + InitDebugLevelList(wnd, IDC_DEBUG_CALLBACK); | |
2809 | + | |
2810 | + EnableDebugLevelLists(wnd, bDebugLogEnabled); | |
2811 | + | |
2812 | + uSendDlgItemMessage(wnd, IDC_DEBUG_HUYGENS_INIT, CB_SETCURSEL, (int)cfg_debug_huygens_init, 0); | |
2813 | + uSendDlgItemMessage(wnd, IDC_DEBUG_HUYGENS_PROC, CB_SETCURSEL, (int)cfg_debug_huygens_proc, 0); | |
2814 | + uSendDlgItemMessage(wnd, IDC_DEBUG_TRACK_INFO, CB_SETCURSEL, (int)cfg_debug_track_info, 0); | |
2815 | + uSendDlgItemMessage(wnd, IDC_DEBUG_PLUGIN, CB_SETCURSEL, (int)cfg_debug_plugin, 0); | |
2816 | + uSendDlgItemMessage(wnd, IDC_DEBUG_CALLBACK, CB_SETCURSEL, (int)cfg_debug_callback, 0); | |
2817 | + | |
2818 | + setDlgVersionInfo(wnd, IDC_VERSION_DEBUG, IDC_BUILD_DEBUG); | |
2819 | + } | |
2820 | + break; | |
2821 | + | |
2822 | + case WM_COMMAND: | |
2823 | + switch(wp) | |
2824 | + { | |
2825 | + case (BN_CLICKED<<16)|IDC_ENABLE_DEBUG_LOG: | |
2826 | + { | |
2827 | + bool bDebugLogEnabled = uButton_GetCheck(wnd, IDC_ENABLE_DEBUG_LOG); | |
2828 | + cfg_enable_debug_log = bDebugLogEnabled ? 1 : 0; | |
2829 | + | |
2830 | + EnableDebugLevelLists(wnd, bDebugLogEnabled); | |
2831 | + } | |
2832 | + break; | |
2833 | + | |
2834 | + case (CBN_SELCHANGE<<16)|IDC_DEBUG_HUYGENS_INIT: | |
2835 | + { | |
2836 | + int sel = uSendMessage(reinterpret_cast<HWND>(lp), CB_GETCURSEL, 0, 0); | |
2837 | + cfg_debug_huygens_init = sel; | |
2838 | + } | |
2839 | + break; | |
2840 | + | |
2841 | + case (CBN_SELCHANGE<<16)|IDC_DEBUG_HUYGENS_PROC: | |
2842 | + { | |
2843 | + int sel = uSendMessage(reinterpret_cast<HWND>(lp), CB_GETCURSEL, 0, 0); | |
2844 | + cfg_debug_huygens_proc = sel; | |
2845 | + } | |
2846 | + break; | |
2847 | + | |
2848 | + case (CBN_SELCHANGE<<16)|IDC_DEBUG_TRACK_INFO: | |
2849 | + { | |
2850 | + int sel = uSendMessage(reinterpret_cast<HWND>(lp), CB_GETCURSEL, 0, 0); | |
2851 | + cfg_debug_track_info = sel; | |
2852 | + } | |
2853 | + break; | |
2854 | + | |
2855 | + case (CBN_SELCHANGE<<16)|IDC_DEBUG_PLUGIN: | |
2856 | + { | |
2857 | + int sel = uSendMessage(reinterpret_cast<HWND>(lp), CB_GETCURSEL, 0, 0); | |
2858 | + cfg_debug_plugin = sel; | |
2859 | + } | |
2860 | + break; | |
2861 | + | |
2862 | + case (CBN_SELCHANGE<<16)|IDC_DEBUG_CALLBACK: | |
2863 | + { | |
2864 | + int sel = uSendMessage(reinterpret_cast<HWND>(lp), CB_GETCURSEL, 0, 0); | |
2865 | + cfg_debug_callback = sel; | |
2866 | + } | |
2867 | + break; | |
2868 | + | |
2869 | + default: | |
2870 | + break; | |
2871 | + } | |
2872 | + break; | |
2873 | + | |
2874 | + case WM_DESTROY: | |
2875 | + break; | |
2876 | + } | |
2877 | + | |
2878 | + return 0; | |
2879 | + } | |
2880 | + | |
2881 | +protected: | |
2882 | + | |
2883 | + static void InitDebugLevelList(HWND wnd, UINT id) | |
2884 | + { | |
2885 | + uSendDlgItemMessage(wnd, id, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(_T("なし"))); | |
2886 | + uSendDlgItemMessage(wnd, id, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(_T("簡易レベル"))); | |
2887 | + uSendDlgItemMessage(wnd, id, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(_T("詳細レベル"))); | |
2888 | + } | |
2889 | + | |
2890 | + static void EnableDebugLevelLists(HWND wnd, bool bDebugLogEnabled) | |
2891 | + { | |
2892 | + EnableDebugLevelList(wnd, IDC_DEBUG_HUYGENS_INIT, bDebugLogEnabled); | |
2893 | + EnableDebugLevelList(wnd, IDC_DEBUG_HUYGENS_PROC, bDebugLogEnabled); | |
2894 | + EnableDebugLevelList(wnd, IDC_DEBUG_TRACK_INFO, bDebugLogEnabled); | |
2895 | + EnableDebugLevelList(wnd, IDC_DEBUG_PLUGIN, bDebugLogEnabled); | |
2896 | + EnableDebugLevelList(wnd, IDC_DEBUG_CALLBACK, bDebugLogEnabled); | |
2897 | + } | |
2898 | + | |
2899 | + static void EnableDebugLevelList(HWND wnd, UINT id, bool bEnable) | |
2900 | + { | |
2901 | + HWND hControlWnd = uGetDlgItem(wnd, id); | |
2902 | + uEnableWindow(hControlWnd, bEnable); | |
2903 | + } | |
2904 | + | |
2905 | +public: | |
2906 | + | |
2907 | + virtual HWND create(HWND parent) | |
2908 | + { | |
2909 | + return uCreateDialog(IDD_DEBUG_SETTINGS, parent, ConfigProc); | |
2910 | + } | |
2911 | + | |
2912 | + virtual const char * get_name() { | |
2913 | + return g_debugSettingsCaption8; | |
2914 | + } | |
2915 | + virtual const char * get_parent_name() { | |
2916 | + return g_pluginCaption8; | |
2917 | + } | |
2918 | + | |
2919 | +#if IS_FB2K_VER09 | |
2920 | + virtual GUID get_guid() { | |
2921 | + return config_page_huygens_debug_guid; | |
2922 | + } | |
2923 | + | |
2924 | + virtual GUID get_parent_guid() { | |
2925 | + return config_page_huygens_guid; | |
2926 | + } | |
2927 | + | |
2928 | + virtual double get_sort_priority() { | |
2929 | + return 2.0; | |
2930 | + } | |
2931 | + | |
2932 | + virtual bool reset_query() { | |
2933 | + return true; | |
2934 | + } | |
2935 | + | |
2936 | + virtual void reset() { | |
2937 | + cfg_enable_debug_log = 1; | |
2938 | + cfg_debug_huygens_init = 1; | |
2939 | + cfg_debug_huygens_proc = 1; | |
2940 | + cfg_debug_track_info = 1; | |
2941 | + cfg_debug_plugin = 1; | |
2942 | + cfg_debug_callback = 1; | |
2943 | + } | |
2944 | + | |
2945 | + virtual bool get_help_url(pfc::string_base & p_out) { | |
2946 | + p_out = URL_FOO_HUYGENS_HOME; | |
2947 | + return true; | |
2948 | + } | |
2949 | +#endif | |
2950 | +}; | |
2951 | + | |
2952 | +#if IS_FB2K_VER08 | |
2953 | +static service_factory_single_t<play_callback, play_callback_huygens> foo1; | |
2954 | +static service_factory_single_t<initquit, initquit_send> foo2; | |
2955 | +static menu_item_factory<menu_item_huygens> foo3; | |
2956 | +static service_factory_single_t<config, config_page_huygens> foo4; | |
2957 | +static service_factory_single_t<config, config_page_huygens_advanced> foo5; | |
2958 | +static service_factory_single_t<config, config_page_huygens_debug> foo6; | |
2959 | +#elif IS_FB2K_VER09 | |
2960 | +static service_factory_single_t<play_callback_huygens> foo1; | |
2961 | +static initquit_factory_t<initquit_send> foo2; | |
2962 | +static mainmenu_commands_factory_t<menu_item_huygens> foo3; | |
2963 | +static preferences_page_factory_t<config_page_huygens> foo4; | |
2964 | +static preferences_page_factory_t<config_page_huygens_advanced> foo5; | |
2965 | +static preferences_page_factory_t<config_page_huygens_debug> foo6; | |
2966 | +#endif | |
2967 | + | |
2968 | +tstring GetErrorMessage(DWORD errCode) | |
2969 | +{ | |
2970 | + | |
2971 | + LPVOID lpMsgBuf; | |
2972 | + | |
2973 | + FormatMessage( | |
2974 | + FORMAT_MESSAGE_ALLOCATE_BUFFER | | |
2975 | + FORMAT_MESSAGE_FROM_SYSTEM | | |
2976 | + FORMAT_MESSAGE_IGNORE_INSERTS, | |
2977 | + NULL, | |
2978 | + errCode, | |
2979 | + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // デフォルト言語 | |
2980 | + (LPTSTR) &lpMsgBuf, | |
2981 | + 0, | |
2982 | + NULL | |
2983 | + ); | |
2984 | + | |
2985 | + tstring msg((LPCTSTR)lpMsgBuf); | |
2986 | + | |
2987 | + GlobalFree(lpMsgBuf); | |
2988 | + | |
2989 | + return msg; | |
2990 | +} | |
2991 | + | |
2992 | +void putLogError(LPCTSTR pMethod, LPCTSTR pErrMsg, DWORD dwErrCode) | |
2993 | +{ | |
2994 | + tstring errMsg = GetErrorMessage(dwErrCode); | |
2995 | + | |
2996 | + LOG_ERROR(_T("%s - %s"), pMethod, pErrMsg); | |
2997 | + LOG_ERROR(_T("%s - コード: %08x, 理由: %s"), pMethod, dwErrCode, errMsg.c_str()); | |
2998 | +} | |
2999 | + | |
3000 | +void setDlgVersionInfo(HWND wnd, UINT idc_version, UINT idc_build) { | |
3001 | + | |
3002 | + StrDBCS64K version; | |
3003 | + | |
3004 | + sprintf_s(version, sizeof(StrDBCS64K), PLUGIN_CAPTION " " PLUGIN_VERSION_PREFIX PLUGIN_VERSION_VAL " with SDK%d (compatible%d)", | |
3005 | + foobar2000_client::FOOBAR2000_CLIENT_VERSION, foobar2000_client::FOOBAR2000_CLIENT_VERSION_COMPATIBLE); | |
3006 | + | |
3007 | + uSetDlgItemText(wnd, idc_version, version); | |
3008 | + uSetDlgItemText(wnd, idc_build, "build on " __DATE__ ", " __TIME__); | |
3009 | +} | |
3010 | + | |
3011 | +void DebugPrint(LPCTSTR lpszFormat, ...) | |
3012 | +{ | |
3013 | + static Str64K buf; | |
3014 | + va_list marker; | |
3015 | + | |
3016 | + va_start(marker, lpszFormat); | |
3017 | + _vstprintf_s(buf, sizeof(Str64K) / sizeof(TCHAR), lpszFormat, marker); | |
3018 | + va_end(marker); | |
3019 | + | |
3020 | + OutputDebugString(buf); | |
3021 | + OutputDebugString(_T("\n")); | |
3022 | + | |
3023 | + string_utf8_from_os tmp(buf); | |
3024 | + | |
3025 | + console::info(tmp); | |
3026 | +} | |
3027 | + | |
3028 | +void DebugPrint8(LPCSTR lpszFormat, ...) | |
3029 | +{ | |
3030 | + static StrDBCS64K buf; | |
3031 | + | |
3032 | + va_list marker; | |
3033 | + | |
3034 | + va_start(marker, lpszFormat); | |
3035 | + vsprintf_s(buf, sizeof(StrDBCS64K), lpszFormat, marker); | |
3036 | + va_end(marker); | |
3037 | + | |
3038 | + console::info(buf); | |
3039 | + | |
3040 | + string_os_from_utf8 tmp(buf); | |
3041 | + | |
3042 | + OutputDebugString(tmp); | |
3043 | + OutputDebugString(_T("\n")); | |
3044 | +} |
@@ -0,0 +1,298 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +#if !defined(HUY_IPC_H_CE87645E_DFB8_4418_A904_403DCB282C84) | |
4 | + | |
5 | +#define HUY_IPC_H_CE87645E_DFB8_4418_A904_403DCB282C84 | |
6 | + | |
7 | +//! Huygens IPC コマンド | |
8 | +#define WM_HUY_IPC WM_APP | |
9 | + | |
10 | +//! Huygensカテゴリ:プラグイン情報 | |
11 | +#define HUY_INFO_PLUGIN 0x0000 | |
12 | +//! Huygensカテゴリ:トラック情報 | |
13 | +#define HUY_INFO_TRACK 0x0100 | |
14 | +//! Huygensカテゴリ:再生情報 | |
15 | +#define HUY_INFO_PLAYBACK 0x0200 | |
16 | +//! Huygensカテゴリ:プレイリスト情報 | |
17 | +#define HUY_INFO_PLAYLIST 0x0300 | |
18 | +//! Huygensカテゴリ:プラグイン制御 | |
19 | +#define HUY_CTRL_PLUGIN 0x0A00 | |
20 | +//! Huygensカテゴリ:再生制御 | |
21 | +#define HUY_CTRL_PLAYBACK 0x0800 | |
22 | +//! Huygensカテゴリ:プレイリスト制御 | |
23 | +#define HUY_CTRL_PLAYLIST 0x0900 | |
24 | + | |
25 | +//! プラグインバージョンの取得 (out:string [d.ddd]) | |
26 | +#define HUY_GETVERSION (HUY_INFO_PLUGIN | 0x00) | |
27 | + | |
28 | +//! foobar2000 バージョンの取得 (out:string) | |
29 | +#define HUY_GETFB2KVERSION (HUY_INFO_PLUGIN | 0x01) | |
30 | + | |
31 | +//! エンコードモードの取得(0:OS codepage [ShiftJIS], 1:UTF-8) (out:int) | |
32 | +#define HUY_GETENCODEMODE (HUY_INFO_PLUGIN | 0x02) | |
33 | + | |
34 | +//! ファイルパスを取得 (out:string) | |
35 | +#define HUY_GETFILEPATH (HUY_INFO_TRACK | 0x00) | |
36 | + | |
37 | +//! プロトコルを含んだファイルパスを取得 (out:string) | |
38 | +#define HUY_GETFILEPATHRAW (HUY_INFO_TRACK | 0x2D) | |
39 | + | |
40 | +//! 曲の長さを取得 [msec.×1000] (out:int) | |
41 | +#define HUY_GETDURATION (HUY_INFO_TRACK | 0x01) | |
42 | + | |
43 | +//! アーティスト名を取得 (out:string) | |
44 | +#define HUY_GETARTIST (HUY_INFO_TRACK | 0x02) | |
45 | + | |
46 | +//! トラックタイトルを取得 (out:string) | |
47 | +#define HUY_GETTRACKTITLE (HUY_INFO_TRACK | 0x03) | |
48 | + | |
49 | +//! アルバムタイトルを取得 (out:string) | |
50 | +#define HUY_GETALBUMTITLE (HUY_INFO_TRACK | 0x04) | |
51 | + | |
52 | +//! ジャンルを取得 (out:string) | |
53 | +#define HUY_GETGENRE (HUY_INFO_TRACK | 0x1B) | |
54 | + | |
55 | +//! 出版年月日を取得 (out:string) | |
56 | +#define HUY_GETDATE (HUY_INFO_TRACK | 0x05) | |
57 | + | |
58 | +//! 作曲者を取得 (out:string) | |
59 | +#define HUY_GETCOMPOSER (HUY_INFO_TRACK | 0x06) | |
60 | + | |
61 | +//! 演奏者を取得 (out:string) | |
62 | +#define HUY_GETPERFORMER (HUY_INFO_TRACK | 0x07) | |
63 | + | |
64 | +//! アルバムアーティスト名を取得 (out:string) | |
65 | +#define HUY_GETALBUMARTIST (HUY_INFO_TRACK | 0x08) | |
66 | + | |
67 | +//! トラックアーティスト名を取得 (out:string) | |
68 | +#define HUY_GETTRACKARTIST (HUY_INFO_TRACK | 0x19) | |
69 | + | |
70 | +//! サブソングインデックスを取得 (out:int) | |
71 | +#define HUY_GETSUBSONG (HUY_INFO_TRACK | 0x1A) | |
72 | + | |
73 | +//! トラック番号を取得 (out:int) | |
74 | +#define HUY_GETTRACKNO (HUY_INFO_TRACK | 0x09) | |
75 | + | |
76 | +//! 総トラック数を取得 (out:int) | |
77 | +#define HUY_GETTOTALTRACKS (HUY_INFO_TRACK | 0x0A) | |
78 | + | |
79 | +//! ディスク番号を取得 (out:int) | |
80 | +#define HUY_GETDISCNO (HUY_INFO_TRACK | 0x0B) | |
81 | + | |
82 | +//! 総ディスク数を取得 (out:int) | |
83 | +#define HUY_GETTOTALDISCS (HUY_INFO_TRACK | 0x0C) | |
84 | + | |
85 | +//! コメントを取得 (out:string) | |
86 | +#define HUY_GETCOMMENT (HUY_INFO_TRACK | 0x0D) | |
87 | + | |
88 | +//! サンプリングレート[Hz]の取得 (out:int) | |
89 | +#define HUY_GETSAMPLERATE (HUY_INFO_TRACK | 0x0E) | |
90 | + | |
91 | +//! ビットレート[kbps]の取得 (out:int) | |
92 | +#define HUY_GETBITRATE (HUY_INFO_TRACK | 0x0F) | |
93 | + | |
94 | +//! 公称ビットレート[kbps]の取得 (out:int) | |
95 | +#define HUY_GETBITRATENOMINAL (HUY_INFO_TRACK | 0x27) | |
96 | + | |
97 | +//! 動的ビットレート[kbps]の取得 (out:int) | |
98 | +#define HUY_GETBITRATEDYNAMIC (HUY_INFO_TRACK | 0x2C) | |
99 | + | |
100 | +//! チャンネル数の取得 (out:int) | |
101 | +#define HUY_GETCHANNELS (HUY_INFO_TRACK | 0x10) | |
102 | + | |
103 | +//! ビット数/サンプルの取得 (out:int) | |
104 | +#define HUY_GETBITSPERSAMPLE (HUY_INFO_TRACK | 0x1C) | |
105 | + | |
106 | +//! コーデック名の取得 (out:string) | |
107 | +#define HUY_GETCODEC (HUY_INFO_TRACK | 0x11) | |
108 | + | |
109 | +//! コーデックプロファイルの取得 (out:string) | |
110 | +#define HUY_GETCODECPROFILE (HUY_INFO_TRACK | 0x12) | |
111 | + | |
112 | +//! 可逆/非可逆の取得(0:lossy、1:lossless) | |
113 | +#define HUY_ISLOSSLESS (HUY_INFO_TRACK | 0x13) | |
114 | + | |
115 | +//! タグタイプの取得 (out:string) | |
116 | +#define HUY_GETTAGTYPE (HUY_INFO_TRACK | 0x14) | |
117 | + | |
118 | +//! extrainfo の取得 (out:string) | |
119 | +#define HUY_GETEXTRAINFO (HUY_INFO_TRACK | 0x1D) | |
120 | + | |
121 | +//! tool の取得 (out:string) | |
122 | +#define HUY_GETTOOL (HUY_INFO_TRACK | 0x1E) | |
123 | + | |
124 | +//! cue_embedded の取得(0:no、1:yes) (out:int) | |
125 | +#define HUY_GETCUEEMBEDDED (HUY_INFO_TRACK | 0x1F) | |
126 | + | |
127 | +//! audio md5 hash の取得 (out:string) | |
128 | +#define HUY_GETAUDIOMD5HASH (HUY_INFO_TRACK | 0x20) | |
129 | + | |
130 | +//! mp3 stereo mode の取得(0:stereo、1:joint stereo) (out:int) | |
131 | +#define HUY_GETMP3STEREOMODE (HUY_INFO_TRACK | 0x21) | |
132 | + | |
133 | +//! mp3 acuurate length の取得 (out:int) | |
134 | +#define HUY_GETMP3ACCURATELENGTH (HUY_INFO_TRACK | 0x22) | |
135 | + | |
136 | +//! mp3 enc_delay の取得 (out:int) | |
137 | +#define HUY_GETMP3ENCDELAY (HUY_INFO_TRACK | 0x23) | |
138 | + | |
139 | +//! mp3 enc_padding の取得 (out:string) | |
140 | +#define HUY_GETMP3ENCPADDING (HUY_INFO_TRACK | 0x24) | |
141 | + | |
142 | +//! ape version の取得 (out:string) | |
143 | +#define HUY_GETAPEVERSION (HUY_INFO_TRACK | 0x25) | |
144 | + | |
145 | +//! ape flags の取得 (out:string) | |
146 | +#define HUY_GETAPEFLAGS (HUY_INFO_TRACK | 0x26) | |
147 | + | |
148 | +//! ReplayGain album gain の取得 (out:int) | |
149 | +#define HUY_GETREPLAYGAIN_ALBUMGAIN (HUY_INFO_TRACK | 0x28) | |
150 | + | |
151 | +//! ReplayGain album peek の取得 (out:int) | |
152 | +#define HUY_GETREPLAYGAIN_ALBUMPEEK (HUY_INFO_TRACK | 0x29) | |
153 | + | |
154 | +//! ReplayGain track gain の取得 (out:int) | |
155 | +#define HUY_GETREPLAYGAIN_TRACKGAIN (HUY_INFO_TRACK | 0x2A) | |
156 | + | |
157 | +//! ReplayGain track peek の取得 (out:int) | |
158 | +#define HUY_GETREPLAYGAIN_TRACKPEEK (HUY_INFO_TRACK | 0x2B) | |
159 | + | |
160 | +//! ファイルサイズの取得 (out:string ※not int, max. = UINT64_MAX) | |
161 | +#define HUY_GETFILESIZE (HUY_INFO_TRACK | 0x15) | |
162 | + | |
163 | +//! ファイル作成日時の取得 (UTC) [YYYYMMDDHH24MISS.mmmuuun00] (out:string) | |
164 | +#define HUY_GETFILECREATED (HUY_INFO_TRACK | 0x16) | |
165 | + | |
166 | +//! ファイル更新日時の取得 (UTC) [YYYYMMDDHH24MISS.mmmuuun00] (out:string) | |
167 | +#define HUY_GETFILELASTMOD (HUY_INFO_TRACK | 0x17) | |
168 | + | |
169 | +//! メディアライブラリへの登録の有無の取得(0:登録なし、1:登録あり) | |
170 | +#define HUY_ISINMEDIALIB (HUY_INFO_TRACK | 0x18) | |
171 | + | |
172 | +//! 再生状態の取得(1:再生中、0:停止中、3:一時停止中) (out:int) | |
173 | +#define HUY_GETSTATUS (HUY_INFO_PLAYBACK | 0x00) | |
174 | + | |
175 | +//! 再生位置の取得 [msec.×1000] (out:int) | |
176 | +#define HUY_GETPOS (HUY_INFO_PLAYBACK | 0x01) | |
177 | + | |
178 | +//! リピート状態の取得(1:repeat playlist、2:repeat track、0:not repeat) (out:int) | |
179 | +#define HUY_GETREPEAT (HUY_INFO_PLAYBACK | 0x02) | |
180 | + | |
181 | +//! シャッフル状態の取得(1:shuffle tracks、2:shuffle albums、3:shuffle folders、0:not shuffle [0.8.3 always 0]) (out:int) | |
182 | +#define HUY_GETSHUFFLE (HUY_INFO_PLAYBACK | 0x03) | |
183 | + | |
184 | +//! ランダム状態の取得(1:random、0:not random) (out:int) | |
185 | +#define HUY_GETRANDOM (HUY_INFO_PLAYBACK | 0x04) | |
186 | + | |
187 | +//! 再生順の取得 | |
188 | +// (0:default、1:repeat playlist、2:repeat track、3:random、 | |
189 | +// 4:shuffle tracks [0.9+]、5:shuffle albums [0.9+]、6:shuffle folders [0.9+]) (out:int) | |
190 | +#define HUY_GETPLAYBACKORDER (HUY_INFO_PLAYBACK | 0x05) | |
191 | + | |
192 | +//! プレイリストのファイルパスを取得する | |
193 | +#define HUY_GETLISTFILEPATH (HUY_INFO_PLAYLIST | 0x00) | |
194 | + | |
195 | +//! プレイリスト名を取得する | |
196 | +#define HUY_GETLISTNAME (HUY_INFO_PLAYLIST | 0x01) | |
197 | + | |
198 | +//! プレイリストの長さを取得する | |
199 | +#define HUY_GETLISTLENGTH (HUY_INFO_PLAYLIST | 0x02) | |
200 | + | |
201 | +//! エントリタイトルを取得する | |
202 | +#define HUY_GETENTRYTITLE (HUY_INFO_PLAYLIST | 0x03) | |
203 | + | |
204 | +//! フォーカス中のプレイリスト位置を取得する | |
205 | +#define HUY_GETLISTFOCUSPOS (HUY_INFO_PLAYLIST | 0x04) | |
206 | + | |
207 | +//! プレイリスト情報の更新(Huygens内部制御用) | |
208 | +#define HUY_REFRESHLISTINFO (HUY_CTRL_PLUGIN | 0x00) | |
209 | + | |
210 | +//! 動的トラック情報の更新(Huygens内部制御用) | |
211 | +#define HUY_REFRESHDYNINFO (HUY_CTRL_PLUGIN | 0x01) | |
212 | + | |
213 | +//! 再生 | |
214 | +#define HUY_PLAY (HUY_CTRL_PLAYBACK | 0x00) | |
215 | + | |
216 | +//! 再生と一時停止のトグル | |
217 | +#define HUY_PLAYORPAUSE (HUY_CTRL_PLAYBACK | 0x14) | |
218 | + | |
219 | +//! 停止 | |
220 | +#define HUY_STOP (HUY_CTRL_PLAYBACK | 0x01) | |
221 | + | |
222 | +//! 一時停止 | |
223 | +#define HUY_PAUSE (HUY_CTRL_PLAYBACK | 0x02) | |
224 | + | |
225 | +//! 早送り(0:1s、1:5s、2:10s、3:30s、4:1min、5:2min、6:5min、7:10min) (in:int) | |
226 | +#define HUY_FASTFORWARD (HUY_CTRL_PLAYBACK | 0x03) | |
227 | + | |
228 | +//! 巻き戻し(0:1s、1:5s、2:10s、3:30s、4:1min、5:2min、6:5min、7:10min) (in:int) | |
229 | +#define HUY_REWIND (HUY_CTRL_PLAYBACK | 0x04) | |
230 | + | |
231 | +//! 前の曲へ | |
232 | +#define HUY_PREVIOUS (HUY_CTRL_PLAYBACK | 0x07) | |
233 | + | |
234 | +//! 次の曲へ | |
235 | +#define HUY_NEXT (HUY_CTRL_PLAYBACK | 0x08) | |
236 | + | |
237 | +//! 再生位置の指定 [msec.×1000] (in:int) | |
238 | +#define HUY_SEEK (HUY_CTRL_PLAYBACK | 0x09) | |
239 | + | |
240 | +//! ボリュームの指定(最小:0〜最大:255) (in:int) | |
241 | +#define HUY_SETVOLUME (HUY_CTRL_PLAYBACK | 0x0A) | |
242 | + | |
243 | +//! ボリュームを上げる | |
244 | +#define HUY_VOLUMEUP (HUY_CTRL_PLAYBACK | 0x0B) | |
245 | + | |
246 | +//! ボリュームを下げる | |
247 | +#define HUY_VOLUMEDOWN (HUY_CTRL_PLAYBACK | 0x0C) | |
248 | + | |
249 | +//! パンの指定(左:0〜右:255) (in:int) | |
250 | +#define HUY_SETPANNING (HUY_CTRL_PLAYBACK | 0x0D) | |
251 | + | |
252 | +//! リピートの指定(1:repeat playlist、2:repeat track、0:not repeat) (in:int) | |
253 | +#define HUY_SETREPEAT (HUY_CTRL_PLAYBACK | 0x0F) | |
254 | + | |
255 | +//! シャッフルの指定(1:shuffle tracks、2:shuffle albums、3:shuffle folders、0:not shuffle) (in:int) [0.9+] | |
256 | +#define HUY_SETSHUFFLE (HUY_CTRL_PLAYBACK | 0x10) | |
257 | + | |
258 | +//! ランダムの指定(1:random、0:not random) (in:int) | |
259 | +#define HUY_SETRANDOM (HUY_CTRL_PLAYBACK | 0x0E) | |
260 | + | |
261 | +//! 再生順の指定 | |
262 | +// (0:default、1:repeat playlist、2:repeat track、3:random、 | |
263 | +// 4:shuffle tracks [0.9+]、5:shuffle albums [0.9+]、6:shuffle folders [0.9+]) (in:int) | |
264 | +#define HUY_SETPLAYBACKORDER (HUY_CTRL_PLAYBACK | 0x15) | |
265 | + | |
266 | +//! リピートのトグル(not repeat→repeat playlist→repeat track→not repeat) | |
267 | +#define HUY_TOGGLEREPEAT (HUY_CTRL_PLAYBACK | 0x12) | |
268 | + | |
269 | +//! シャッフルのトグル(not shuffle→shuffle tracks→shuffle albums→shuffle folders→not shuffle) [0.9+] | |
270 | +#define HUY_TOGGLESHUFFLE (HUY_CTRL_PLAYBACK | 0x13) | |
271 | + | |
272 | +//! ランダムのトグル(not random→random→not random) | |
273 | +#define HUY_TOGGLERANDOM (HUY_CTRL_PLAYBACK | 0x11) | |
274 | + | |
275 | +//! 再生順の指定 | |
276 | +// (default→repeat playlist→repeat track→rando→ | |
277 | +// shuffle tracks [0.9+]→shuffle albums [0.9+]→shuffle folders [0.9+]→ default) | |
278 | +#define HUY_TOGGLEPLAYBACKORDER (HUY_CTRL_PLAYBACK | 0x16) | |
279 | + | |
280 | +//! 新規プレイリストを作成する | |
281 | +#define HUY_CREATELIST (HUY_CTRL_PLAYLIST | 0x00) | |
282 | + | |
283 | +//! プレイリストを読み込む | |
284 | +#define HUY_READLIST (HUY_CTRL_PLAYLIST | 0x01) | |
285 | + | |
286 | +//! プレイリストをファイルに出力する | |
287 | +#define HUY_WRITELIST (HUY_CTRL_PLAYLIST | 0x02); | |
288 | + | |
289 | +//! プレイリスト上の指定位置を選択する | |
290 | +#define HUY_SETLISTFOCUSPOS (HUY_CTRL_PLAYLIST | 0x03); | |
291 | + | |
292 | +//! ファイルをプレイリストに挿入する | |
293 | +#define HUY_INSERTFILE (HUY_CTRL_PLAYLIST | 0x04) | |
294 | + | |
295 | +//! ファイルをプレイリストから削除する | |
296 | +#define HUY_DELETEFILE (HUY_CTRL_PLAYLIST | 0x05); | |
297 | + | |
298 | +#endif // !definedHUY_IPC_H_CE87645E_DFB8_4418_A904_403DCB282C84 |
@@ -0,0 +1,674 @@ | ||
1 | + GNU GENERAL PUBLIC LICENSE | |
2 | + Version 3, 29 June 2007 | |
3 | + | |
4 | + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | |
5 | + Everyone is permitted to copy and distribute verbatim copies | |
6 | + of this license document, but changing it is not allowed. | |
7 | + | |
8 | + Preamble | |
9 | + | |
10 | + The GNU General Public License is a free, copyleft license for | |
11 | +software and other kinds of works. | |
12 | + | |
13 | + The licenses for most software and other practical works are designed | |
14 | +to take away your freedom to share and change the works. By contrast, | |
15 | +the GNU General Public License is intended to guarantee your freedom to | |
16 | +share and change all versions of a program--to make sure it remains free | |
17 | +software for all its users. We, the Free Software Foundation, use the | |
18 | +GNU General Public License for most of our software; it applies also to | |
19 | +any other work released this way by its authors. You can apply it to | |
20 | +your programs, too. | |
21 | + | |
22 | + When we speak of free software, we are referring to freedom, not | |
23 | +price. Our General Public Licenses are designed to make sure that you | |
24 | +have the freedom to distribute copies of free software (and charge for | |
25 | +them if you wish), that you receive source code or can get it if you | |
26 | +want it, that you can change the software or use pieces of it in new | |
27 | +free programs, and that you know you can do these things. | |
28 | + | |
29 | + To protect your rights, we need to prevent others from denying you | |
30 | +these rights or asking you to surrender the rights. Therefore, you have | |
31 | +certain responsibilities if you distribute copies of the software, or if | |
32 | +you modify it: responsibilities to respect the freedom of others. | |
33 | + | |
34 | + For example, if you distribute copies of such a program, whether | |
35 | +gratis or for a fee, you must pass on to the recipients the same | |
36 | +freedoms that you received. You must make sure that they, too, receive | |
37 | +or can get the source code. And you must show them these terms so they | |
38 | +know their rights. | |
39 | + | |
40 | + Developers that use the GNU GPL protect your rights with two steps: | |
41 | +(1) assert copyright on the software, and (2) offer you this License | |
42 | +giving you legal permission to copy, distribute and/or modify it. | |
43 | + | |
44 | + For the developers' and authors' protection, the GPL clearly explains | |
45 | +that there is no warranty for this free software. For both users' and | |
46 | +authors' sake, the GPL requires that modified versions be marked as | |
47 | +changed, so that their problems will not be attributed erroneously to | |
48 | +authors of previous versions. | |
49 | + | |
50 | + Some devices are designed to deny users access to install or run | |
51 | +modified versions of the software inside them, although the manufacturer | |
52 | +can do so. This is fundamentally incompatible with the aim of | |
53 | +protecting users' freedom to change the software. The systematic | |
54 | +pattern of such abuse occurs in the area of products for individuals to | |
55 | +use, which is precisely where it is most unacceptable. Therefore, we | |
56 | +have designed this version of the GPL to prohibit the practice for those | |
57 | +products. If such problems arise substantially in other domains, we | |
58 | +stand ready to extend this provision to those domains in future versions | |
59 | +of the GPL, as needed to protect the freedom of users. | |
60 | + | |
61 | + Finally, every program is threatened constantly by software patents. | |
62 | +States should not allow patents to restrict development and use of | |
63 | +software on general-purpose computers, but in those that do, we wish to | |
64 | +avoid the special danger that patents applied to a free program could | |
65 | +make it effectively proprietary. To prevent this, the GPL assures that | |
66 | +patents cannot be used to render the program non-free. | |
67 | + | |
68 | + The precise terms and conditions for copying, distribution and | |
69 | +modification follow. | |
70 | + | |
71 | + TERMS AND CONDITIONS | |
72 | + | |
73 | + 0. Definitions. | |
74 | + | |
75 | + "This License" refers to version 3 of the GNU General Public License. | |
76 | + | |
77 | + "Copyright" also means copyright-like laws that apply to other kinds of | |
78 | +works, such as semiconductor masks. | |
79 | + | |
80 | + "The Program" refers to any copyrightable work licensed under this | |
81 | +License. Each licensee is addressed as "you". "Licensees" and | |
82 | +"recipients" may be individuals or organizations. | |
83 | + | |
84 | + To "modify" a work means to copy from or adapt all or part of the work | |
85 | +in a fashion requiring copyright permission, other than the making of an | |
86 | +exact copy. The resulting work is called a "modified version" of the | |
87 | +earlier work or a work "based on" the earlier work. | |
88 | + | |
89 | + A "covered work" means either the unmodified Program or a work based | |
90 | +on the Program. | |
91 | + | |
92 | + To "propagate" a work means to do anything with it that, without | |
93 | +permission, would make you directly or secondarily liable for | |
94 | +infringement under applicable copyright law, except executing it on a | |
95 | +computer or modifying a private copy. Propagation includes copying, | |
96 | +distribution (with or without modification), making available to the | |
97 | +public, and in some countries other activities as well. | |
98 | + | |
99 | + To "convey" a work means any kind of propagation that enables other | |
100 | +parties to make or receive copies. Mere interaction with a user through | |
101 | +a computer network, with no transfer of a copy, is not conveying. | |
102 | + | |
103 | + An interactive user interface displays "Appropriate Legal Notices" | |
104 | +to the extent that it includes a convenient and prominently visible | |
105 | +feature that (1) displays an appropriate copyright notice, and (2) | |
106 | +tells the user that there is no warranty for the work (except to the | |
107 | +extent that warranties are provided), that licensees may convey the | |
108 | +work under this License, and how to view a copy of this License. If | |
109 | +the interface presents a list of user commands or options, such as a | |
110 | +menu, a prominent item in the list meets this criterion. | |
111 | + | |
112 | + 1. Source Code. | |
113 | + | |
114 | + The "source code" for a work means the preferred form of the work | |
115 | +for making modifications to it. "Object code" means any non-source | |
116 | +form of a work. | |
117 | + | |
118 | + A "Standard Interface" means an interface that either is an official | |
119 | +standard defined by a recognized standards body, or, in the case of | |
120 | +interfaces specified for a particular programming language, one that | |
121 | +is widely used among developers working in that language. | |
122 | + | |
123 | + The "System Libraries" of an executable work include anything, other | |
124 | +than the work as a whole, that (a) is included in the normal form of | |
125 | +packaging a Major Component, but which is not part of that Major | |
126 | +Component, and (b) serves only to enable use of the work with that | |
127 | +Major Component, or to implement a Standard Interface for which an | |
128 | +implementation is available to the public in source code form. A | |
129 | +"Major Component", in this context, means a major essential component | |
130 | +(kernel, window system, and so on) of the specific operating system | |
131 | +(if any) on which the executable work runs, or a compiler used to | |
132 | +produce the work, or an object code interpreter used to run it. | |
133 | + | |
134 | + The "Corresponding Source" for a work in object code form means all | |
135 | +the source code needed to generate, install, and (for an executable | |
136 | +work) run the object code and to modify the work, including scripts to | |
137 | +control those activities. However, it does not include the work's | |
138 | +System Libraries, or general-purpose tools or generally available free | |
139 | +programs which are used unmodified in performing those activities but | |
140 | +which are not part of the work. For example, Corresponding Source | |
141 | +includes interface definition files associated with source files for | |
142 | +the work, and the source code for shared libraries and dynamically | |
143 | +linked subprograms that the work is specifically designed to require, | |
144 | +such as by intimate data communication or control flow between those | |
145 | +subprograms and other parts of the work. | |
146 | + | |
147 | + The Corresponding Source need not include anything that users | |
148 | +can regenerate automatically from other parts of the Corresponding | |
149 | +Source. | |
150 | + | |
151 | + The Corresponding Source for a work in source code form is that | |
152 | +same work. | |
153 | + | |
154 | + 2. Basic Permissions. | |
155 | + | |
156 | + All rights granted under this License are granted for the term of | |
157 | +copyright on the Program, and are irrevocable provided the stated | |
158 | +conditions are met. This License explicitly affirms your unlimited | |
159 | +permission to run the unmodified Program. The output from running a | |
160 | +covered work is covered by this License only if the output, given its | |
161 | +content, constitutes a covered work. This License acknowledges your | |
162 | +rights of fair use or other equivalent, as provided by copyright law. | |
163 | + | |
164 | + You may make, run and propagate covered works that you do not | |
165 | +convey, without conditions so long as your license otherwise remains | |
166 | +in force. You may convey covered works to others for the sole purpose | |
167 | +of having them make modifications exclusively for you, or provide you | |
168 | +with facilities for running those works, provided that you comply with | |
169 | +the terms of this License in conveying all material for which you do | |
170 | +not control copyright. Those thus making or running the covered works | |
171 | +for you must do so exclusively on your behalf, under your direction | |
172 | +and control, on terms that prohibit them from making any copies of | |
173 | +your copyrighted material outside their relationship with you. | |
174 | + | |
175 | + Conveying under any other circumstances is permitted solely under | |
176 | +the conditions stated below. Sublicensing is not allowed; section 10 | |
177 | +makes it unnecessary. | |
178 | + | |
179 | + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | |
180 | + | |
181 | + No covered work shall be deemed part of an effective technological | |
182 | +measure under any applicable law fulfilling obligations under article | |
183 | +11 of the WIPO copyright treaty adopted on 20 December 1996, or | |
184 | +similar laws prohibiting or restricting circumvention of such | |
185 | +measures. | |
186 | + | |
187 | + When you convey a covered work, you waive any legal power to forbid | |
188 | +circumvention of technological measures to the extent such circumvention | |
189 | +is effected by exercising rights under this License with respect to | |
190 | +the covered work, and you disclaim any intention to limit operation or | |
191 | +modification of the work as a means of enforcing, against the work's | |
192 | +users, your or third parties' legal rights to forbid circumvention of | |
193 | +technological measures. | |
194 | + | |
195 | + 4. Conveying Verbatim Copies. | |
196 | + | |
197 | + You may convey verbatim copies of the Program's source code as you | |
198 | +receive it, in any medium, provided that you conspicuously and | |
199 | +appropriately publish on each copy an appropriate copyright notice; | |
200 | +keep intact all notices stating that this License and any | |
201 | +non-permissive terms added in accord with section 7 apply to the code; | |
202 | +keep intact all notices of the absence of any warranty; and give all | |
203 | +recipients a copy of this License along with the Program. | |
204 | + | |
205 | + You may charge any price or no price for each copy that you convey, | |
206 | +and you may offer support or warranty protection for a fee. | |
207 | + | |
208 | + 5. Conveying Modified Source Versions. | |
209 | + | |
210 | + You may convey a work based on the Program, or the modifications to | |
211 | +produce it from the Program, in the form of source code under the | |
212 | +terms of section 4, provided that you also meet all of these conditions: | |
213 | + | |
214 | + a) The work must carry prominent notices stating that you modified | |
215 | + it, and giving a relevant date. | |
216 | + | |
217 | + b) The work must carry prominent notices stating that it is | |
218 | + released under this License and any conditions added under section | |
219 | + 7. This requirement modifies the requirement in section 4 to | |
220 | + "keep intact all notices". | |
221 | + | |
222 | + c) You must license the entire work, as a whole, under this | |
223 | + License to anyone who comes into possession of a copy. This | |
224 | + License will therefore apply, along with any applicable section 7 | |
225 | + additional terms, to the whole of the work, and all its parts, | |
226 | + regardless of how they are packaged. This License gives no | |
227 | + permission to license the work in any other way, but it does not | |
228 | + invalidate such permission if you have separately received it. | |
229 | + | |
230 | + d) If the work has interactive user interfaces, each must display | |
231 | + Appropriate Legal Notices; however, if the Program has interactive | |
232 | + interfaces that do not display Appropriate Legal Notices, your | |
233 | + work need not make them do so. | |
234 | + | |
235 | + A compilation of a covered work with other separate and independent | |
236 | +works, which are not by their nature extensions of the covered work, | |
237 | +and which are not combined with it such as to form a larger program, | |
238 | +in or on a volume of a storage or distribution medium, is called an | |
239 | +"aggregate" if the compilation and its resulting copyright are not | |
240 | +used to limit the access or legal rights of the compilation's users | |
241 | +beyond what the individual works permit. Inclusion of a covered work | |
242 | +in an aggregate does not cause this License to apply to the other | |
243 | +parts of the aggregate. | |
244 | + | |
245 | + 6. Conveying Non-Source Forms. | |
246 | + | |
247 | + You may convey a covered work in object code form under the terms | |
248 | +of sections 4 and 5, provided that you also convey the | |
249 | +machine-readable Corresponding Source under the terms of this License, | |
250 | +in one of these ways: | |
251 | + | |
252 | + a) Convey the object code in, or embodied in, a physical product | |
253 | + (including a physical distribution medium), accompanied by the | |
254 | + Corresponding Source fixed on a durable physical medium | |
255 | + customarily used for software interchange. | |
256 | + | |
257 | + b) Convey the object code in, or embodied in, a physical product | |
258 | + (including a physical distribution medium), accompanied by a | |
259 | + written offer, valid for at least three years and valid for as | |
260 | + long as you offer spare parts or customer support for that product | |
261 | + model, to give anyone who possesses the object code either (1) a | |
262 | + copy of the Corresponding Source for all the software in the | |
263 | + product that is covered by this License, on a durable physical | |
264 | + medium customarily used for software interchange, for a price no | |
265 | + more than your reasonable cost of physically performing this | |
266 | + conveying of source, or (2) access to copy the | |
267 | + Corresponding Source from a network server at no charge. | |
268 | + | |
269 | + c) Convey individual copies of the object code with a copy of the | |
270 | + written offer to provide the Corresponding Source. This | |
271 | + alternative is allowed only occasionally and noncommercially, and | |
272 | + only if you received the object code with such an offer, in accord | |
273 | + with subsection 6b. | |
274 | + | |
275 | + d) Convey the object code by offering access from a designated | |
276 | + place (gratis or for a charge), and offer equivalent access to the | |
277 | + Corresponding Source in the same way through the same place at no | |
278 | + further charge. You need not require recipients to copy the | |
279 | + Corresponding Source along with the object code. If the place to | |
280 | + copy the object code is a network server, the Corresponding Source | |
281 | + may be on a different server (operated by you or a third party) | |
282 | + that supports equivalent copying facilities, provided you maintain | |
283 | + clear directions next to the object code saying where to find the | |
284 | + Corresponding Source. Regardless of what server hosts the | |
285 | + Corresponding Source, you remain obligated to ensure that it is | |
286 | + available for as long as needed to satisfy these requirements. | |
287 | + | |
288 | + e) Convey the object code using peer-to-peer transmission, provided | |
289 | + you inform other peers where the object code and Corresponding | |
290 | + Source of the work are being offered to the general public at no | |
291 | + charge under subsection 6d. | |
292 | + | |
293 | + A separable portion of the object code, whose source code is excluded | |
294 | +from the Corresponding Source as a System Library, need not be | |
295 | +included in conveying the object code work. | |
296 | + | |
297 | + A "User Product" is either (1) a "consumer product", which means any | |
298 | +tangible personal property which is normally used for personal, family, | |
299 | +or household purposes, or (2) anything designed or sold for incorporation | |
300 | +into a dwelling. In determining whether a product is a consumer product, | |
301 | +doubtful cases shall be resolved in favor of coverage. For a particular | |
302 | +product received by a particular user, "normally used" refers to a | |
303 | +typical or common use of that class of product, regardless of the status | |
304 | +of the particular user or of the way in which the particular user | |
305 | +actually uses, or expects or is expected to use, the product. A product | |
306 | +is a consumer product regardless of whether the product has substantial | |
307 | +commercial, industrial or non-consumer uses, unless such uses represent | |
308 | +the only significant mode of use of the product. | |
309 | + | |
310 | + "Installation Information" for a User Product means any methods, | |
311 | +procedures, authorization keys, or other information required to install | |
312 | +and execute modified versions of a covered work in that User Product from | |
313 | +a modified version of its Corresponding Source. The information must | |
314 | +suffice to ensure that the continued functioning of the modified object | |
315 | +code is in no case prevented or interfered with solely because | |
316 | +modification has been made. | |
317 | + | |
318 | + If you convey an object code work under this section in, or with, or | |
319 | +specifically for use in, a User Product, and the conveying occurs as | |
320 | +part of a transaction in which the right of possession and use of the | |
321 | +User Product is transferred to the recipient in perpetuity or for a | |
322 | +fixed term (regardless of how the transaction is characterized), the | |
323 | +Corresponding Source conveyed under this section must be accompanied | |
324 | +by the Installation Information. But this requirement does not apply | |
325 | +if neither you nor any third party retains the ability to install | |
326 | +modified object code on the User Product (for example, the work has | |
327 | +been installed in ROM). | |
328 | + | |
329 | + The requirement to provide Installation Information does not include a | |
330 | +requirement to continue to provide support service, warranty, or updates | |
331 | +for a work that has been modified or installed by the recipient, or for | |
332 | +the User Product in which it has been modified or installed. Access to a | |
333 | +network may be denied when the modification itself materially and | |
334 | +adversely affects the operation of the network or violates the rules and | |
335 | +protocols for communication across the network. | |
336 | + | |
337 | + Corresponding Source conveyed, and Installation Information provided, | |
338 | +in accord with this section must be in a format that is publicly | |
339 | +documented (and with an implementation available to the public in | |
340 | +source code form), and must require no special password or key for | |
341 | +unpacking, reading or copying. | |
342 | + | |
343 | + 7. Additional Terms. | |
344 | + | |
345 | + "Additional permissions" are terms that supplement the terms of this | |
346 | +License by making exceptions from one or more of its conditions. | |
347 | +Additional permissions that are applicable to the entire Program shall | |
348 | +be treated as though they were included in this License, to the extent | |
349 | +that they are valid under applicable law. If additional permissions | |
350 | +apply only to part of the Program, that part may be used separately | |
351 | +under those permissions, but the entire Program remains governed by | |
352 | +this License without regard to the additional permissions. | |
353 | + | |
354 | + When you convey a copy of a covered work, you may at your option | |
355 | +remove any additional permissions from that copy, or from any part of | |
356 | +it. (Additional permissions may be written to require their own | |
357 | +removal in certain cases when you modify the work.) You may place | |
358 | +additional permissions on material, added by you to a covered work, | |
359 | +for which you have or can give appropriate copyright permission. | |
360 | + | |
361 | + Notwithstanding any other provision of this License, for material you | |
362 | +add to a covered work, you may (if authorized by the copyright holders of | |
363 | +that material) supplement the terms of this License with terms: | |
364 | + | |
365 | + a) Disclaiming warranty or limiting liability differently from the | |
366 | + terms of sections 15 and 16 of this License; or | |
367 | + | |
368 | + b) Requiring preservation of specified reasonable legal notices or | |
369 | + author attributions in that material or in the Appropriate Legal | |
370 | + Notices displayed by works containing it; or | |
371 | + | |
372 | + c) Prohibiting misrepresentation of the origin of that material, or | |
373 | + requiring that modified versions of such material be marked in | |
374 | + reasonable ways as different from the original version; or | |
375 | + | |
376 | + d) Limiting the use for publicity purposes of names of licensors or | |
377 | + authors of the material; or | |
378 | + | |
379 | + e) Declining to grant rights under trademark law for use of some | |
380 | + trade names, trademarks, or service marks; or | |
381 | + | |
382 | + f) Requiring indemnification of licensors and authors of that | |
383 | + material by anyone who conveys the material (or modified versions of | |
384 | + it) with contractual assumptions of liability to the recipient, for | |
385 | + any liability that these contractual assumptions directly impose on | |
386 | + those licensors and authors. | |
387 | + | |
388 | + All other non-permissive additional terms are considered "further | |
389 | +restrictions" within the meaning of section 10. If the Program as you | |
390 | +received it, or any part of it, contains a notice stating that it is | |
391 | +governed by this License along with a term that is a further | |
392 | +restriction, you may remove that term. If a license document contains | |
393 | +a further restriction but permits relicensing or conveying under this | |
394 | +License, you may add to a covered work material governed by the terms | |
395 | +of that license document, provided that the further restriction does | |
396 | +not survive such relicensing or conveying. | |
397 | + | |
398 | + If you add terms to a covered work in accord with this section, you | |
399 | +must place, in the relevant source files, a statement of the | |
400 | +additional terms that apply to those files, or a notice indicating | |
401 | +where to find the applicable terms. | |
402 | + | |
403 | + Additional terms, permissive or non-permissive, may be stated in the | |
404 | +form of a separately written license, or stated as exceptions; | |
405 | +the above requirements apply either way. | |
406 | + | |
407 | + 8. Termination. | |
408 | + | |
409 | + You may not propagate or modify a covered work except as expressly | |
410 | +provided under this License. Any attempt otherwise to propagate or | |
411 | +modify it is void, and will automatically terminate your rights under | |
412 | +this License (including any patent licenses granted under the third | |
413 | +paragraph of section 11). | |
414 | + | |
415 | + However, if you cease all violation of this License, then your | |
416 | +license from a particular copyright holder is reinstated (a) | |
417 | +provisionally, unless and until the copyright holder explicitly and | |
418 | +finally terminates your license, and (b) permanently, if the copyright | |
419 | +holder fails to notify you of the violation by some reasonable means | |
420 | +prior to 60 days after the cessation. | |
421 | + | |
422 | + Moreover, your license from a particular copyright holder is | |
423 | +reinstated permanently if the copyright holder notifies you of the | |
424 | +violation by some reasonable means, this is the first time you have | |
425 | +received notice of violation of this License (for any work) from that | |
426 | +copyright holder, and you cure the violation prior to 30 days after | |
427 | +your receipt of the notice. | |
428 | + | |
429 | + Termination of your rights under this section does not terminate the | |
430 | +licenses of parties who have received copies or rights from you under | |
431 | +this License. If your rights have been terminated and not permanently | |
432 | +reinstated, you do not qualify to receive new licenses for the same | |
433 | +material under section 10. | |
434 | + | |
435 | + 9. Acceptance Not Required for Having Copies. | |
436 | + | |
437 | + You are not required to accept this License in order to receive or | |
438 | +run a copy of the Program. Ancillary propagation of a covered work | |
439 | +occurring solely as a consequence of using peer-to-peer transmission | |
440 | +to receive a copy likewise does not require acceptance. However, | |
441 | +nothing other than this License grants you permission to propagate or | |
442 | +modify any covered work. These actions infringe copyright if you do | |
443 | +not accept this License. Therefore, by modifying or propagating a | |
444 | +covered work, you indicate your acceptance of this License to do so. | |
445 | + | |
446 | + 10. Automatic Licensing of Downstream Recipients. | |
447 | + | |
448 | + Each time you convey a covered work, the recipient automatically | |
449 | +receives a license from the original licensors, to run, modify and | |
450 | +propagate that work, subject to this License. You are not responsible | |
451 | +for enforcing compliance by third parties with this License. | |
452 | + | |
453 | + An "entity transaction" is a transaction transferring control of an | |
454 | +organization, or substantially all assets of one, or subdividing an | |
455 | +organization, or merging organizations. If propagation of a covered | |
456 | +work results from an entity transaction, each party to that | |
457 | +transaction who receives a copy of the work also receives whatever | |
458 | +licenses to the work the party's predecessor in interest had or could | |
459 | +give under the previous paragraph, plus a right to possession of the | |
460 | +Corresponding Source of the work from the predecessor in interest, if | |
461 | +the predecessor has it or can get it with reasonable efforts. | |
462 | + | |
463 | + You may not impose any further restrictions on the exercise of the | |
464 | +rights granted or affirmed under this License. For example, you may | |
465 | +not impose a license fee, royalty, or other charge for exercise of | |
466 | +rights granted under this License, and you may not initiate litigation | |
467 | +(including a cross-claim or counterclaim in a lawsuit) alleging that | |
468 | +any patent claim is infringed by making, using, selling, offering for | |
469 | +sale, or importing the Program or any portion of it. | |
470 | + | |
471 | + 11. Patents. | |
472 | + | |
473 | + A "contributor" is a copyright holder who authorizes use under this | |
474 | +License of the Program or a work on which the Program is based. The | |
475 | +work thus licensed is called the contributor's "contributor version". | |
476 | + | |
477 | + A contributor's "essential patent claims" are all patent claims | |
478 | +owned or controlled by the contributor, whether already acquired or | |
479 | +hereafter acquired, that would be infringed by some manner, permitted | |
480 | +by this License, of making, using, or selling its contributor version, | |
481 | +but do not include claims that would be infringed only as a | |
482 | +consequence of further modification of the contributor version. For | |
483 | +purposes of this definition, "control" includes the right to grant | |
484 | +patent sublicenses in a manner consistent with the requirements of | |
485 | +this License. | |
486 | + | |
487 | + Each contributor grants you a non-exclusive, worldwide, royalty-free | |
488 | +patent license under the contributor's essential patent claims, to | |
489 | +make, use, sell, offer for sale, import and otherwise run, modify and | |
490 | +propagate the contents of its contributor version. | |
491 | + | |
492 | + In the following three paragraphs, a "patent license" is any express | |
493 | +agreement or commitment, however denominated, not to enforce a patent | |
494 | +(such as an express permission to practice a patent or covenant not to | |
495 | +sue for patent infringement). To "grant" such a patent license to a | |
496 | +party means to make such an agreement or commitment not to enforce a | |
497 | +patent against the party. | |
498 | + | |
499 | + If you convey a covered work, knowingly relying on a patent license, | |
500 | +and the Corresponding Source of the work is not available for anyone | |
501 | +to copy, free of charge and under the terms of this License, through a | |
502 | +publicly available network server or other readily accessible means, | |
503 | +then you must either (1) cause the Corresponding Source to be so | |
504 | +available, or (2) arrange to deprive yourself of the benefit of the | |
505 | +patent license for this particular work, or (3) arrange, in a manner | |
506 | +consistent with the requirements of this License, to extend the patent | |
507 | +license to downstream recipients. "Knowingly relying" means you have | |
508 | +actual knowledge that, but for the patent license, your conveying the | |
509 | +covered work in a country, or your recipient's use of the covered work | |
510 | +in a country, would infringe one or more identifiable patents in that | |
511 | +country that you have reason to believe are valid. | |
512 | + | |
513 | + If, pursuant to or in connection with a single transaction or | |
514 | +arrangement, you convey, or propagate by procuring conveyance of, a | |
515 | +covered work, and grant a patent license to some of the parties | |
516 | +receiving the covered work authorizing them to use, propagate, modify | |
517 | +or convey a specific copy of the covered work, then the patent license | |
518 | +you grant is automatically extended to all recipients of the covered | |
519 | +work and works based on it. | |
520 | + | |
521 | + A patent license is "discriminatory" if it does not include within | |
522 | +the scope of its coverage, prohibits the exercise of, or is | |
523 | +conditioned on the non-exercise of one or more of the rights that are | |
524 | +specifically granted under this License. You may not convey a covered | |
525 | +work if you are a party to an arrangement with a third party that is | |
526 | +in the business of distributing software, under which you make payment | |
527 | +to the third party based on the extent of your activity of conveying | |
528 | +the work, and under which the third party grants, to any of the | |
529 | +parties who would receive the covered work from you, a discriminatory | |
530 | +patent license (a) in connection with copies of the covered work | |
531 | +conveyed by you (or copies made from those copies), or (b) primarily | |
532 | +for and in connection with specific products or compilations that | |
533 | +contain the covered work, unless you entered into that arrangement, | |
534 | +or that patent license was granted, prior to 28 March 2007. | |
535 | + | |
536 | + Nothing in this License shall be construed as excluding or limiting | |
537 | +any implied license or other defenses to infringement that may | |
538 | +otherwise be available to you under applicable patent law. | |
539 | + | |
540 | + 12. No Surrender of Others' Freedom. | |
541 | + | |
542 | + If conditions are imposed on you (whether by court order, agreement or | |
543 | +otherwise) that contradict the conditions of this License, they do not | |
544 | +excuse you from the conditions of this License. If you cannot convey a | |
545 | +covered work so as to satisfy simultaneously your obligations under this | |
546 | +License and any other pertinent obligations, then as a consequence you may | |
547 | +not convey it at all. For example, if you agree to terms that obligate you | |
548 | +to collect a royalty for further conveying from those to whom you convey | |
549 | +the Program, the only way you could satisfy both those terms and this | |
550 | +License would be to refrain entirely from conveying the Program. | |
551 | + | |
552 | + 13. Use with the GNU Affero General Public License. | |
553 | + | |
554 | + Notwithstanding any other provision of this License, you have | |
555 | +permission to link or combine any covered work with a work licensed | |
556 | +under version 3 of the GNU Affero General Public License into a single | |
557 | +combined work, and to convey the resulting work. The terms of this | |
558 | +License will continue to apply to the part which is the covered work, | |
559 | +but the special requirements of the GNU Affero General Public License, | |
560 | +section 13, concerning interaction through a network will apply to the | |
561 | +combination as such. | |
562 | + | |
563 | + 14. Revised Versions of this License. | |
564 | + | |
565 | + The Free Software Foundation may publish revised and/or new versions of | |
566 | +the GNU General Public License from time to time. Such new versions will | |
567 | +be similar in spirit to the present version, but may differ in detail to | |
568 | +address new problems or concerns. | |
569 | + | |
570 | + Each version is given a distinguishing version number. If the | |
571 | +Program specifies that a certain numbered version of the GNU General | |
572 | +Public License "or any later version" applies to it, you have the | |
573 | +option of following the terms and conditions either of that numbered | |
574 | +version or of any later version published by the Free Software | |
575 | +Foundation. If the Program does not specify a version number of the | |
576 | +GNU General Public License, you may choose any version ever published | |
577 | +by the Free Software Foundation. | |
578 | + | |
579 | + If the Program specifies that a proxy can decide which future | |
580 | +versions of the GNU General Public License can be used, that proxy's | |
581 | +public statement of acceptance of a version permanently authorizes you | |
582 | +to choose that version for the Program. | |
583 | + | |
584 | + Later license versions may give you additional or different | |
585 | +permissions. However, no additional obligations are imposed on any | |
586 | +author or copyright holder as a result of your choosing to follow a | |
587 | +later version. | |
588 | + | |
589 | + 15. Disclaimer of Warranty. | |
590 | + | |
591 | + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | |
592 | +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | |
593 | +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | |
594 | +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | |
595 | +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
596 | +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | |
597 | +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | |
598 | +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |
599 | + | |
600 | + 16. Limitation of Liability. | |
601 | + | |
602 | + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
603 | +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | |
604 | +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | |
605 | +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | |
606 | +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | |
607 | +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | |
608 | +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | |
609 | +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | |
610 | +SUCH DAMAGES. | |
611 | + | |
612 | + 17. Interpretation of Sections 15 and 16. | |
613 | + | |
614 | + If the disclaimer of warranty and limitation of liability provided | |
615 | +above cannot be given local legal effect according to their terms, | |
616 | +reviewing courts shall apply local law that most closely approximates | |
617 | +an absolute waiver of all civil liability in connection with the | |
618 | +Program, unless a warranty or assumption of liability accompanies a | |
619 | +copy of the Program in return for a fee. | |
620 | + | |
621 | + END OF TERMS AND CONDITIONS | |
622 | + | |
623 | + How to Apply These Terms to Your New Programs | |
624 | + | |
625 | + If you develop a new program, and you want it to be of the greatest | |
626 | +possible use to the public, the best way to achieve this is to make it | |
627 | +free software which everyone can redistribute and change under these terms. | |
628 | + | |
629 | + To do so, attach the following notices to the program. It is safest | |
630 | +to attach them to the start of each source file to most effectively | |
631 | +state the exclusion of warranty; and each file should have at least | |
632 | +the "copyright" line and a pointer to where the full notice is found. | |
633 | + | |
634 | + <one line to give the program's name and a brief idea of what it does.> | |
635 | + Copyright (C) <year> <name of author> | |
636 | + | |
637 | + This program is free software: you can redistribute it and/or modify | |
638 | + it under the terms of the GNU General Public License as published by | |
639 | + the Free Software Foundation, either version 3 of the License, or | |
640 | + (at your option) any later version. | |
641 | + | |
642 | + This program is distributed in the hope that it will be useful, | |
643 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | |
644 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
645 | + GNU General Public License for more details. | |
646 | + | |
647 | + You should have received a copy of the GNU General Public License | |
648 | + along with this program. If not, see <http://www.gnu.org/licenses/>. | |
649 | + | |
650 | +Also add information on how to contact you by electronic and paper mail. | |
651 | + | |
652 | + If the program does terminal interaction, make it output a short | |
653 | +notice like this when it starts in an interactive mode: | |
654 | + | |
655 | + <program> Copyright (C) <year> <name of author> | |
656 | + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
657 | + This is free software, and you are welcome to redistribute it | |
658 | + under certain conditions; type `show c' for details. | |
659 | + | |
660 | +The hypothetical commands `show w' and `show c' should show the appropriate | |
661 | +parts of the General Public License. Of course, your program's commands | |
662 | +might be different; for a GUI interface, you would use an "about box". | |
663 | + | |
664 | + You should also get your employer (if you work as a programmer) or school, | |
665 | +if any, to sign a "copyright disclaimer" for the program, if necessary. | |
666 | +For more information on this, and how to apply and follow the GNU GPL, see | |
667 | +<http://www.gnu.org/licenses/>. | |
668 | + | |
669 | + The GNU General Public License does not permit incorporating your program | |
670 | +into proprietary programs. If your program is a subroutine library, you | |
671 | +may consider it more useful to permit linking proprietary applications with | |
672 | +the library. If this is what you want to do, use the GNU Lesser General | |
673 | +Public License instead of this License. But first, please read | |
674 | +<http://www.gnu.org/philosophy/why-not-lgpl.html>. |
@@ -0,0 +1,39 @@ | ||
1 | +//{{NO_DEPENDENCIES}} | |
2 | +// Microsoft Visual C++ generated include file. | |
3 | +// Used by foo_huygens.rc | |
4 | +// | |
5 | +#define IDD_PREFERENCE 101 | |
6 | +#define IDD_ADVANCED_SETTINGS 102 | |
7 | +#define IDD_DEBUG_SETTINGS 103 | |
8 | +#define IDC_CONFIGURE 1000 | |
9 | +#define IDC_USE_PLUGIN 1001 | |
10 | +#define IDC_VERSION 1002 | |
11 | +#define IDC_BUILD 1003 | |
12 | +#define IDC_CAPTION_ADVANCED 1004 | |
13 | +#define IDC_VERSION_ADVANCED 1005 | |
14 | +#define IDC_BUILD_ADVANCED 1006 | |
15 | +#define IDC_HUYGENS_FRAME 1007 | |
16 | +#define IDC_SHOW_HUYGENS 1008 | |
17 | +#define IDC_HUYGENS_TITLE_FORMAT 1009 | |
18 | +#define IDC_HUYGENS_PLAYLIST_FORMAT 1010 | |
19 | +#define IDC_DISABLE_ANSI_TRANS 1011 | |
20 | +#define IDC_CAPTION_DEBUG 1012 | |
21 | +#define IDC_ENABLE_DEBUG_LOG 1013 | |
22 | +#define IDC_DEBUG_HUYGENS_INIT 1014 | |
23 | +#define IDC_DEBUG_HUYGENS_PROC 1015 | |
24 | +#define IDC_DEBUG_TRACK_INFO 1016 | |
25 | +#define IDC_DEBUG_PLUGIN 1017 | |
26 | +#define IDC_DEBUG_CALLBACK 1018 | |
27 | +#define IDC_VERSION_DEBUG 1019 | |
28 | +#define IDC_BUILD_DEBUG 1020 | |
29 | + | |
30 | +// Next default values for new objects | |
31 | +// | |
32 | +#ifdef APSTUDIO_INVOKED | |
33 | +#ifndef APSTUDIO_READONLY_SYMBOLS | |
34 | +#define _APS_NEXT_RESOURCE_VALUE 104 | |
35 | +#define _APS_NEXT_COMMAND_VALUE 40001 | |
36 | +#define _APS_NEXT_CONTROL_VALUE 1021 | |
37 | +#define _APS_NEXT_SYMED_VALUE 101 | |
38 | +#endif | |
39 | +#endif |