IPB

Welcome Guest ( Log In | Register )

> foobar2000 Development Forum Rules

This forum is for developer discussions only. If you have a problem / bug report / idea / feature request that isn't related to foobar2000 SDK, post it in an appropiate forum instead - tech support questions go to support forum, everything else goes to general forum.
All non-developer posts on this forum will be removed. Continued abuse of this forum will result in admin actions (warnings, account suspension).

 
Reply to this topicStart new topic
Get raw title from stream
HunsAffe
post May 5 2012, 16:13
Post #1





Group: Members
Posts: 3
Joined: 5-May 12
Member No.: 99509



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
    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
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?
Go to the top of the page
+Quote Post
HunsAffe
post May 10 2012, 01:19
Post #2





Group: Members
Posts: 3
Joined: 5-May 12
Member No.: 99509



So as nobody can provide a working example for this trivial task I take it foobar2000 is simply broken.
Go to the top of the page
+Quote Post
db1989
post May 10 2012, 06:01
Post #3





Group: Super Moderator
Posts: 5275
Joined: 23-June 06
Member No.: 32180



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!

This post has been edited by db1989: May 10 2012, 06:04
Go to the top of the page
+Quote Post
kode54
post May 10 2012, 08:40
Post #4





Group: Admin
Posts: 4576
Joined: 15-December 02
Member No.: 4082



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.
Go to the top of the page
+Quote Post
foosion
post May 10 2012, 09:03
Post #5





Group: FB2K Moderator (Donating)
Posts: 4409
Joined: 24-February 03
Member No.: 5153



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
Go to the top of the page
+Quote Post
kode54
post May 10 2012, 09:09
Post #6





Group: Admin
Posts: 4576
Joined: 15-December 02
Member No.: 4082



Thanks for resolving that to an exact function and parameters. I guess I just got lazy.
Go to the top of the page
+Quote Post
HunsAffe
post May 11 2012, 02:15
Post #7





Group: Members
Posts: 3
Joined: 5-May 12
Member No.: 99509



QUOTE (db1989 @ May 10 2012, 06:01) *
Someone said something bad about my favourite player and that makes me feel very insecure about myself.
Sorry, can't help you there buddy.




QUOTE (kode54 @ May 10 2012, 08:40) *
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.

QUOTE (foosion @ May 10 2012, 09:03) *
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()
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th July 2014 - 19:02