I don't think it's nearly as easy as you're making it out to be
As far as I know, there's no simple 'is_music_playing' type of function. I think you'd have to actually check if x prx is loaded, if y is activated, if etc, etc check which channels are in use, etc. In short, it's complicated.
Of course, I have limited knowledge in this particular department of xmb coding. Your best bet might be to look through pspaudio.h in the pspsdk... I see some functions there of use
eg. might be of some use?
Code:
/**
* Get count of unplayed samples remaining
*
* @param channel - The channel number.
*
* @return Number of samples to be played, an error if less than 0.
*/
int sceAudioGetChannelRestLen(int channel);
With 8 being the maximum amount of channels allowed to be used... so if this function returns 8 then essentially that means there's 8 channels being unplayed, or music in xmb isn't being played?
Just a wild guess here