1 /* Copyright 2016 The Chromium OS Authors. All rights reserved. 2 * Use of this source code is governed by a BSD-style license that can be 3 * found in the LICENSE file. 4 */ 5 6 #ifndef CRAS_BT_PLAYER_H_ 7 #define CRAS_BT_PLAYER_H_ 8 9 #include <dbus/dbus.h> 10 #include <stdbool.h> 11 12 #include "cras_bt_adapter.h" 13 14 /* Object to register as media player so that bluetoothd will report hardware 15 * volume from device through bt_transport. Properties of the player are defined 16 * in BlueZ's media API. 17 */ 18 struct cras_bt_player { 19 const char *object_path; 20 const char *playback_status; 21 const char *identity; 22 const char *loop_status; 23 int position; 24 bool can_go_next; 25 bool can_go_prev; 26 bool can_play; 27 bool can_pause; 28 bool can_control; 29 bool shuffle; 30 void (*message_cb)(const char *message); 31 }; 32 33 /* Creates a player object and register it to bluetoothd. 34 * Args: 35 * conn - The dbus connection. 36 */ 37 int cras_bt_player_create(DBusConnection *conn); 38 39 /* Registers created player to bluetoothd. This is used when an bluetooth 40 * adapter got enumerated. 41 * Args: 42 * conn - The dbus connection. 43 * adapter - The enumerated bluetooth adapter. 44 */ 45 int cras_bt_register_player(DBusConnection *conn, 46 const struct cras_bt_adapter *adapter); 47 48 #endif /* CRAS_BT_PLAYER_H_ */ 49