HydrogenAudio

Hosted Forums => foobar2000 => Development - (fb2k) => Topic started by: D3zmodos on 2021-08-28 21:23:58

Title: Access to dynamic track metadata
Post by: D3zmodos on 2021-08-28 21:23:58
I'm trying to use metadata for internet radio streams. I've enabled dynamic track titles and I can query the info returned in on_playback_dynamic_info/_track callbacks given by play_callback, however that seems to be the only place that the correct data is retrieved. Is that intentional or is there some piece of API for this that I've missed?

Judging from its documentation I would have expected metadb_handle::get_browse_info (and its variants for ref/merged/etc) to return exactly this data given the metadb handle for that track (as returned by playback_control::get_now_playing). Is "browse info" a different thing?
Title: Re: Access to dynamic track metadata
Post by: marc2k3 on 2021-08-28 22:25:07
You don't need a handle of any kind. Look at

playback_control.h -> playback_format_title

and

playlist.h -> activeplaylist_item_format_title
Title: Re: Access to dynamic track metadata
Post by: D3zmodos on 2021-08-29 09:43:32
Yeah I've seen that format_title from the playlist will give the correct data. The issue with those two for me is that I'm doing some async processing (specifically looking for lyrics (https://github.com/jacquesh/foo_openlyrics)) meaning that there can be a significant delay between requesting the processing and actually needing get at the metadata and in that time the playlist or now-playing track could have changed. I could of course compute all the info I might ever need up front but honestly I was hoping to be able to avoid that. If that's the path I have to take then I may as well do that in the dynamic info callback where I don't need the format_title APIs anyway >_<

What is "browse info" though? The docs specifically call out title info for internet radio streams as an example and that's exactly what I'm trying to get.
Title: Re: Access to dynamic track metadata
Post by: marc2k3 on 2021-08-29 11:00:24
I'd not looked at browse info before but not sure it's useful for what you want???

Code: [Select]
Example: internet radio stream provides no metadata but its playlist XML has title (radio station name), %title% resolves to the radio station name from the playlist.

Seems to be that technique is used filling the properties dialog as opposed to the dynamic artist/title I'm retrieving in my playlist viewer.

(https://i.imgur.com/Iliinbs.png)

IIRC, most streams supply a single string and it's split by a hyphen into artist/title "tags" as a convenience. There is generally nothing more to be had.

But I really have no idea what I'm talking about. Hopefully someone more knowledgable will be along... :P