foxx1337 / foo_nowplaying2

MIT License
32 stars 1 forks source link

Log artist/title from dynamic radio stream metadata? #2

Closed sveakul closed 7 months ago

sveakul commented 10 months ago

The original foo_np_simple could log artist/title from songs played on radio streams when the metadata carried it and the now archived foo_dyndec was installed. Is there any way foo_nowplaying2 can be used the same way? The only thing logged from streams now is the radio station name. As I listen to streams most of the time the component just isn't useable anymore for me. Thanks for anything you can do.

foxx1337 commented 9 months ago

Can you recommend me such a stream, for research purposes?

sveakul commented 9 months ago

Sure, from many hundreds:

Lush (somaFM)

Cathedral XIII

marc2k3 commented 8 months ago

This really should be stupidly easy. The cmake stuff is putting me off a pull request but combing this extra flag here..

flag_on_playback_dynamic_info_track

https://github.com/foxx1337/foo_nowplaying2/blob/25b002274716ec7e35de7f5965dbada287f76dc1/src/nowplaying.h#L13

and bringing this method to life...

https://github.com/foxx1337/foo_nowplaying2/blob/25b002274716ec7e35de7f5965dbada287f76dc1/src/nowplaying.h#L39

void on_playback_dynamic_info_track(const file_info& p_info) override
{
    update(current_track_);
}

should probably do it.

Now some servers trigger this callback multiple times in quick succession so you might need safeguards to check if the artist/title has changed since the last time.

foxx1337 commented 7 months ago

Thanks for the snippet!