Querying media library

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Ghantu
    Junior Member
    • Oct 2013
    • 4

    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:

    code:
    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.
  • thinktink
    Forum King
    • May 2009
    • 3371

    #2
    I thought you had to SendMessage to the ML Window, not the main Winamp window?
    | Opus Audio Codec plugins 2.0 | Embedded Album Art | DiskWrite |
    | Save your playlist first! | Live voice-over | X-Fade 2.5 |
    | AterKast (Source DSP) | More of my stuff... |

    Comment

    • Benski
      Ben Allison
      Former Winamp Developer
      • Jan 2005
      • 1058

      #3
      Send the message to
      code:
      Plugin.hwndLibraryParent
      instead

      Comment

      Working...
      X