Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
45
Src/Plugins/Library/ml_plg/AlbumID.cpp
Normal file
45
Src/Plugins/Library/ml_plg/AlbumID.cpp
Normal file
|
@ -0,0 +1,45 @@
|
|||
#include "playlist.h"
|
||||
#include "main.h"
|
||||
#include "api__ml_plg.h"
|
||||
#include "../../General/gen_ml/ml.h"
|
||||
#include <atlbase.h>
|
||||
#include "IDScanner.h"
|
||||
|
||||
IConnectionPoint *GetConnectionPoint(IUnknown *punk, REFIID riid)
|
||||
{
|
||||
if (!punk)
|
||||
return 0;
|
||||
|
||||
IConnectionPointContainer *pcpc;
|
||||
IConnectionPoint *pcp = 0;
|
||||
|
||||
HRESULT hr = punk->QueryInterface(IID_IConnectionPointContainer, (void **) & pcpc);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
pcpc->FindConnectionPoint(riid, &pcp);
|
||||
pcpc->Release();
|
||||
}
|
||||
return pcp;
|
||||
}
|
||||
|
||||
bool IDScanner::SetupMusicID()
|
||||
{
|
||||
if (!SetupPlaylistSDK())
|
||||
return false;
|
||||
|
||||
if (musicID)
|
||||
return true;
|
||||
|
||||
musicID = AGAVE_API_GRACENOTE->GetMusicID();
|
||||
if (musicID)
|
||||
{
|
||||
IConnectionPoint *icp = GetConnectionPoint(musicID, DIID__ICDDBMusicIDManagerEvents);
|
||||
if (icp)
|
||||
{
|
||||
icp->Advise(static_cast<IDispatch *>(this), &m_dwCookie);
|
||||
icp->Release();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue