Skip to main content

Topic: Get raw title from stream (Read 2299 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • HunsAffe
  • [*]
Get raw title from stream
I feel kinda stupid for asking this question, but googling for 20 minutes didn't bring up anything related to my problem.
So I'm writing a component for foobar2000, just getting started and trying to do basic things like getting the current track's meta-data.
Everything works fine for local files, but when playing a stream, I can't seem to get the stream's title as transmited by the server.

I read that foobar2000 tries to be smart and splits the stream title at the first - to fill the artist and title fields.
In foobar's playlist this even works as expected, I see artist and title assigned properly. However, in my component I get the station name as the title, and nothing as the artist.
Also, for debugging I tried reading directly from the file_info struct, but even there things are "messed up"

This is my test code:
Code: [Select]
    metadb_handle_ptr track;
    static_api_ptr_t<play_control>()->get_now_playing(track);
    file_info_impl fi;
    track->get_info(fi); // List ALL meta tags for this track
    for (int i = fi.meta_get_count() - 1; i >= 0; --i) {
        dlog("Have: %s(%d) -> %s", fi.meta_enum_name(i), (int)fi.meta_enum_value_count(i), fi.meta_enum_value(i, 0));
    }


The result in my debug log is:
Code: [Select]
Have: url(1) -> http://www.facebook.com/BigBRadio143
Have: genre(1) -> Chinese Asian CPOP Cantonese Mandarin C-POP Asian Canto-Pop Mando-Pop Taiwan China Singapore Malaysia Taiwanese World International
Have: title(1) -> Big B Radio - CPOP | The Hot Station for Asian Music

In Winamp for example, this stream displays as "Jess Lee - Shoes (Big B Radio - CPOP | The Hot Station for Asian Music)"

Any help?

  • HunsAffe
  • [*]
Get raw title from stream
Reply #1
So as nobody can provide a working example for this trivial task I take it foobar2000 is simply broken.

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
Get raw title from stream
Reply #2
As you cannot comprehend the possibility that people simply did not notice your thread due to having other things to do in their lives, I take it you are simply an egomaniac who’d rather discredit an entire project than entertain the prospect that the world does not revolve around you.

Hey, this game is fun!
  • Last Edit: 10 May, 2012, 01:04:35 AM by db1989

  • kode54
  • [*][*][*][*][*]
  • Administrator
Get raw title from stream
Reply #3
All I can tell you is that the info retrieval function you are using only retrieves static information. There may be a way to retrieve dynamic information, but the only thing I know of is format_now_playing.

  • foosion
  • [*][*][*][*][*]
  • Moderator
Get raw title from stream
Reply #4
I guess what kode54 means is playback_control::playback_format_title() with p_level set to display_level_titles or display_level_all.
http://foosion.foobar2000.org/ - my components for foobar2000

  • kode54
  • [*][*][*][*][*]
  • Administrator
Get raw title from stream
Reply #5
Thanks for resolving that to an exact function and parameters. I guess I just got lazy.

  • HunsAffe
  • [*]
Get raw title from stream
Reply #6
Someone said something bad about my favourite player and that makes me feel very insecure about myself.
Sorry, can't help you there buddy.




All I can tell you is that the info retrieval function you are using only retrieves static information. There may be a way to retrieve dynamic information, but the only thing I know of is format_now_playing.

I guess what kode54 means is playback_control::playback_format_title() with p_level set to display_level_titles or display_level_all.

Thanks guys, that did the trick! I focused too much on the metadb_handle object you get via playback_control::get_now_playing()