getmusicbee.com

Support => Developers' Area => MusicBee API => Topic started by: emilles on May 30, 2021, 04:47:03 PM

Title: Winamp API: get track length
Post by: emilles on May 30, 2021, 04:47:03 PM
Is there support in MusicBee's WinAmp (Output Plug-in) API for getting the length of the current track?  WinAmp supports this in 2 ways:
Code
DWORD error;
DWORD_PTR result;
SendMessage(window, WM_WA_IPC, (LPARAM) IPC_GETOUTPUTTIME, (WPARAM) 2, &error, &result);
time_t length = (time_t) result;

Code
void GetBasicFileInfo(time_t& length, const wchar_t* const filePath, HWND hWnd)
{
basicFileInfoStructW fileInfo;
fileInfo.filename = filePath;
fileInfo.quickCheck = 0;
fileInfo.title = NULL;
fileInfo.titlelen = 0;
fileInfo.length = 0;

SendMessageWithTimeout(hWnd, WM_WA_IPC, IPC_GET_BASIC_FILE_INFOW, (WPARAM) &fileInfo);
if (fileInfo.length > 0)
{
length = static_cast<time_t>(fileInfo.length) * 1000;
}
}

IPC_GET_BASIC_FILE_INFOW is 1291.  There is an older message 291 for non-wide chars as well.

I have been using the MusicBee IPC plug-in, which uses the standard MusicBee API and gives me access over IPC.  However, that plug-in seems to have been wiped from the internet.
Title: Re: Winamp API: get track length
Post by: Steven on May 31, 2021, 09:46:15 AM
MusicBee doesnt have native support. There is a plugin which is available on:
https://getmusicbee.com/forum/index.php?topic=11492.0
https://kerlilow.me/files/downloads/MusicBeeIPC.zip
https://kerlilow.me/files/downloads/MusicBeeIPC_src.zip