View Single Post
Old 8th September 2015, 06:01   #1
Junior Member
Join Date: Oct 2013
Posts: 3
Querying media library

I'm working on my plugin again, and seem to be failing to understand the IPC interface to query the media library. Based on what I read in ml.h I was thinking I could do something along these lines:

wsprintf( queryString, L"(artist == \"%s\")", artistName );
trackQuery.query = queryString;
trackQuery.max_results = 0; // 0 for unlimited
SendMessage( Plugin.hwndWinampParent, WM_ML_IPC, (WPARAM)(&trackQuery), ML_IPC_DB_RUNQUERYW );
wsprintf( queryMsg, L"Query string '%s' got %d matches.", queryString, trackQuery.results.Size );

But it seems like no matter what I put for artistName, I end up with zero matches. Am I missing something fundamental here? I've read through Media Library Plugin and Media Library API on the wiki and I felt like I understood them. My plugin's working; I can attach to process in Visual Studio and step through, etc. Just Size == 0 on my queries.
Ghantu is offline   Reply With Quote