Feature request: BASS_CHANNELINFO filename when using BASS_StreamCreateFileUser

Started by MB_SOFT,

MB_SOFT

i use BASS_CHANNELINFO filename to display in the user interface the current playing filename or URL.

However when i use BASS_StreamCreateFileUser the field filename is empty and it would be nice if you can add a way to custom set that string after the BASS_StreamCreateFileUser stream is created.

Ian @ un4seen

Perhaps you could use the BASS_ATTRIB_USER option to hold the custom filename? For example, something like this:

stream = BASS_StreamCreateFileUser(...); // create stream
BASS_ChannelSetAttributeEx(stream, BASS_ATTRIB_USER, strdup(filename), sizeof(char*)); // set filename

...

BASS_CHANNELINFO info;
BASS_ChannelGetInfo(stream, &info);
if (!info.filename) // don't have filename
    BASS_ChannelGetAttributeEx(stream, BASS_ATTRIB_USER, &info.filename, sizeof(info.filename)); // get it from USER attrib

...

char *filename = 0;
BASS_ChannelGetAttributeEx(stream, BASS_ATTRIB_USER, &filename, sizeof(filename));
if (filename) free(filename); // free filename
BASS_StreamFree(stream); // free stream