Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: newbie SDK question (Read 2503 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

newbie SDK question

Forgive my ignorance, but I wasn't really sure where to start.
If all I want to do is play / enqueue a file in foobar, which function under which class would I call?
I realize I could just "execute" the file in Windows with foobar being the default audio player, but I'm hoping to do this more elegantly..  Can anyone help?

While I'm asking.. is there a simple way to use foobar to return file info (ie. bitrate, length, etc) for various audio file formats? I'm growing a bit weary using separate DLLs for each type of audio file format to support in my app. 
Thanks a bunch!

 

newbie SDK question

Reply #1
Adding a track to the active playlist:
Code: [Select]
playlist_oper::get()->add_location("C:\\bla\\music.ext");

Playing a track on the active playlist:
Code: [Select]
playlist_oper::get()->play_item(index);

Activating another playlist:
Code: [Select]
playlist_switcher::get()->set_active_playlist(index);


There is currently no standard way to programmatically get information from foobar2000 to another process; there are some third party extensions that allow this to a certain degree (foo_remote for example).