mirror of
https://github.com/WinampDesktop/winamp.git
synced 2024-12-01 05:47:18 +01:00
53 lines
1.3 KiB
C++
53 lines
1.3 KiB
C++
#include "workorder.h"
|
|
#include "main.h"
|
|
#include "cddb.h"
|
|
#include <shlwapi.h>
|
|
CDDBModuleWorkOrderManagerInterface *workorder=0;
|
|
static HMODULE musicIDLib = 0;
|
|
|
|
void OpenMusicIDWorkOrder()
|
|
{
|
|
if (!workorder)
|
|
{
|
|
char pluginpath[MAX_PATH] = {0};
|
|
GetModuleFileNameA(line.hDllInstance, pluginpath, MAX_PATH);
|
|
PathRemoveFileSpecA(pluginpath);
|
|
PathAppendA(pluginpath, "Gracenote");
|
|
|
|
char musicidpath[MAX_PATH] = {0};
|
|
PathCombineA(musicidpath, pluginpath, "CddbWOManagerWinamp.dll");
|
|
|
|
musicIDLib = LoadLibraryA(musicidpath);
|
|
if (musicIDLib)
|
|
{
|
|
CDDBModuleQueryInterfaceFunc qi = (CDDBModuleQueryInterfaceFunc)GetProcAddress(musicIDLib, "CDDBModuleQueryInterface");
|
|
if (qi)
|
|
{
|
|
ICDDBControl *pControl;
|
|
Cddb_GetIControl((void**)&pControl);
|
|
workorder = (CDDBModuleWorkOrderManagerInterface*)qi("workordermanager");
|
|
if (!(workorder && workorder->base.version == CDDBMODULE_VERSION && workorder->version == CDDBMODULE_WORKORDER_MGR_VERSION
|
|
&& workorder->base.Init && workorder->base.Init(0)
|
|
&& workorder->Initialize(pControl, pluginpath) == 0))
|
|
{
|
|
workorder = 0;
|
|
FreeLibrary(musicIDLib);
|
|
musicIDLib=0;
|
|
}
|
|
if (pControl) pControl->Release();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void ShutdownMusicIDWorkOrder()
|
|
{
|
|
if (workorder)
|
|
workorder->Shutdown();
|
|
|
|
workorder=0;
|
|
|
|
if (musicIDLib)
|
|
FreeLibrary(musicIDLib);
|
|
musicIDLib=0;
|
|
} |