diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-05-31 11:59:00 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2013-06-10 11:06:45 +0300 |
commit | 2c71af29bc189aeddd2457e850c1feab4a3811ee (patch) | |
tree | 83974681098eae710e90cb2a7368448513f141e9 /tools/bluetooth-player.c | |
parent | 11930196373d605c76fb6cda0b77b71ab3584a8d (diff) | |
download | bluez-2c71af29bc189aeddd2457e850c1feab4a3811ee.tar.gz |
tools/bluetooth-player: Add select command
Add support for select command which can be used to set the default
player
Diffstat (limited to 'tools/bluetooth-player.c')
-rw-r--r-- | tools/bluetooth-player.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/bluetooth-player.c b/tools/bluetooth-player.c index 3737318a9..858cd3a2f 100644 --- a/tools/bluetooth-player.c +++ b/tools/bluetooth-player.c @@ -441,6 +441,28 @@ static void cmd_show(int argc, char *argv[]) print_property(proxy, "Track"); } +static void cmd_select(int argc, char *argv[]) +{ + GDBusProxy *proxy; + + if (argc < 2) { + rl_printf("Missing player address argument\n"); + return; + } + + proxy = find_player(argv[1]); + if (proxy == NULL) { + rl_printf("Player %s not available\n", argv[1]); + return; + } + + if (default_player == proxy) + return; + + default_player = proxy, + print_player(proxy, NULL); +} + static const struct { const char *cmd; const char *arg; @@ -449,6 +471,7 @@ static const struct { } cmd_table[] = { { "list", NULL, cmd_list, "List available players" }, { "show", "[player]", cmd_show, "Player information" }, + { "select", "<player>", cmd_select, "Select default player" }, { "play", NULL, cmd_play, "Start playback" }, { "pause", NULL, cmd_pause, "Pause playback" }, { "stop", NULL, cmd_stop, "Stop playback" }, |