Hi Miguel,
I plan to release all the code eventually, don't worry. =)
I'm not sure what 'changes' you're talking about. All it takes for non-
Latin to work is to handle strings in wchar_t* at all times instead of
char*. On the Winamp side, I make sure to use the message
IPC_GET_EXTENDED_FILE_INFOW. Notice that it ends in 'W'. That ensures
that Winamp will return a wchar_t based string. There is a
IPC_GET_EXTENDED_FILE_INFO message as well, which doesn't support
Unicode. Next, I have to send it on to Snarl with the
SnarlInterface::ShowMessage method which is defined for both char and
wchar_t, so it just works when I pass it the string I receive from
Winamp.
Here's some code.
//do_once = false;
wchar_t *filename = (wchar_t*)SendMessage
(plugin.hwndParent,WM_WA_IPC,0,IPC_GET_PLAYING_FILENAME);
extendedFileInfoStructW song_data;
// sigh, it has to be a hard coded length...
// this means that things longer than that
// will just get truncated which I guess is
// fine.
const int buffer_length = 256;
wchar_t title[buffer_length] = L""; bool success_title =
false;
wchar_t artist[buffer_length] = L""; bool success_artist =
false;
wchar_t album[buffer_length] = L""; bool success_album =
false;
wchar_t snarl_notification_title[buffer_length] = L"";
wchar_t snarl_notification_text[buffer_length] = L"";
wchar_t buffer[buffer_length];
song_data.filename = filename;
song_data.metadata = L"title";
song_data.ret = buffer;
song_data.retlen = buffer_length;
// ask for the infoz
// returns 1 if the decoder supports a getExtendedFileInfo
method
static const int WINAMP_SUCCESS = 1;
if (SendMessage(plugin.hwndParent,WM_WA_IPC,(WPARAM)
&song_data,IPC_GET_EXTENDED_FILE_INFOW) == WINAMP_SUCCESS) {
success_title = true;
wcscpy_s(title, buffer);
}
song_data.metadata = L"artist";
// ask for the infoz
if (SendMessage(plugin.hwndParent,WM_WA_IPC,(WPARAM)
&song_data,IPC_GET_EXTENDED_FILE_INFOW) == WINAMP_SUCCESS) {
success_artist = true;
wcscpy_s(artist, buffer);
}
song_data.metadata = L"album";
// ask for the infoz
if (SendMessage(plugin.hwndParent,WM_WA_IPC,(WPARAM)
&song_data,IPC_GET_EXTENDED_FILE_INFOW) == WINAMP_SUCCESS) {
success_album = true;
wcscpy_s(album, buffer);
}
snarl->ShowMessage(artist, title, 3, L"C:\\Program Files\
\Winamp\\Plugins\\notfound.png");
This runs when a new song has just come up.
Cheers,
George