No announcement yet.

looking for the artist/song of currently playing file

  • Filter
  • Time
  • Show
Clear All
new posts

  • looking for the artist/song of currently playing file

    I'm working on a plugin and I have gotten it to run but I havent gotten it to do what I want it to do. Basically, I'm totally new to winamp plugin writing and dont know where to go next.

    I'm looking to get the song title and artist from whatever file is playing. Where would I find this? is their a struct that gets this info or is it something I have to set up? A point in the right direction would be wonderful. Thanks.

  • #2
    taken from the modified wa_ipc.h

    char* GetExtendedFileInfo(char* file, char* field){
    extendedFileInfoStruct exFIS = {0};
    static char metadata[256] = {0};
    exFIS.filename = file;
    exFIS.ret = metadata;
    exFIS.retlen = sizeof(metadata);
    exFIS.metadata = field;
    // can do stuff since data was received
    return metadata;
    return 0;

    that can be used (with 5.x) to query the artist and title as needed. the current song is obtained with char* file = (char*)SendMessage(hwnd_winamp,WM_WA_IPC,SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS),IPC_GETPLAYLISTFILE);

    WACUP Project <‖> "Winamp Ramblings" - Indie Winamp Dev Blog


    • #3
      Thanks a bunch for the help. I got it compiling again but winamp crashes when I try and use the "char* file = (char*)SendMessage(hwnd_winamp,WM_WA_IPC,SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GETLISTPOS),IPC_GETPLAYLISTFILE);"

      I had to change the hwnd to plugin.hwndParent cause I thought I remember reading somewhere that they are used the same way and the template I had used hwndParent. If I am wrong about that please let me know. Thanks again.

      EDIT: I just thought of something. Would it be a problem if nothing is being played at the time? When I first open winamp, nothing is being played so that may be causing the crash.


      • #4
        I get everything basically working. I've learned a lot in the past day or so. I'm still having one very strange problem.

        The first time I get all the info from the mp3 it works great. When the next song starts or I click a new song the info I get back is garbage. Does the code above only work for a 1 time deal? or maybe I'm doing somethign completely wrong.