Saturday, 21 November 2015

New version 0.9.4. Internet Radios lovers, this version goes for you.

Hi guys,
There's a new cool feature. You can now add Internet Radios to your current playlist in foobar2000 right form your phone.
It's fairly easy. Select the internet radio from your web browser and click to download it. You'll be prompted to select with which application you want to open the link. Select foobar2000 and it'll be directly added to your playlist.


Btw, this feature was suggested by a user, so feel free to suggest new cool features like this one. I'll do my best to include all your requests.

There are a couple of more things added in this version.

Release notes

New features:
  • Add Internet Radios to your foobar2000 directly browsing from your device web browser. Supported formats: .m3u and .pls.
  • Added sort by Disc Number in playlist.

Solved issues:
  • Added a setting to disable muting of volume keys for those devices where the whole device sound gets muted (i.e. Nexus 7 2012).

Saturday, 10 October 2015

New version 0.9.3.8. Get playing song info from your app!

Hi guys,
I've added a new feature especially useful for advanced users.
There's a new available Intent action.
"com.cav.foobar2000controller.GET_PLAYING_SONG"

It will allow you to get the current song info via Intent without havng to care about http requests or foobar2000 HTTP Control API.

Unlike previous Intent actions, this one is a bit more complicated to work with, but it's actually fairly easy.

You'll need to send a broadcast specifying a callback Intent action string for me to send you back the information in form of JSON-like string.
Here's an example:

Sending the Broadcast
// Create a Bundle with the action you want to be called from foobar2000 controller
Bundle extras = new Bundle();

// This is mandatory! The key MUST BE "callbackAction". The action "com.mybroadcast.song_info" can be any of your choice
extras.putString("callbackAction", "com.mybroadcast.song_info");

// Create a new Intent. Set the new action and add the extras.
Intent intent = new Intent();
intent.setAction("com.cav.foobar2000controller.GET_PLAYING_SONG");
intent.putExtras(extras);

// Send the Broadcast. foobar2000 controller will receive it and send you back a Broadcast with the song information
sendBroadcast(intent);
 Receiving the information
// You need to have a BroadcastReceiver. It can be a custom class of yours.
BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override public void onReceive(Context context, Intent intent) {
Bundle extras = intent.getExtras();
if (extras != null) {
// This is where the song info is stored.
// It will be like: {"title":"Song title", "artist":"Song artist", "album":"Song album", "length": 123, "rating":5}
// You can convert it to JSONObject (or any other implementation)
String song = extras.getString("song");
// Do whatever you want with the retrieved song.
Toast.makeText(MainActivity.this, song, Toast.LENGTH_LONG).show();
}
}
};
// Register the receiver with the action you've provided before
registerReceiver(broadcastReceiver, new IntentFilter("com.mybroadcast.song_info"));
Here's a full Android studio project example using this new Intent action;
https://www.dropbox.com/s/vyuuiyjlgwkavcs/SendBroadcastTest.zip?dl=1

Enjoy!