Add AVRCP control volume up / down method
[platform/core/connectivity/bluetooth-frwk.git] / include / bluetooth-media-control.h
index f0a0195..d1932cd 100644 (file)
@@ -1,12 +1,5 @@
 /*
- *   bluetooth-media-control
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:    Hocheol Seo <hocheol.seo@samsung.com>
- *             Girishashok Joshi <girish.joshi@samsung.com>
- *             Chanyeol Park <chanyeol.park@samsung.com>
- *
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -47,6 +40,11 @@ typedef enum {
 } media_player_property_type;
 
 typedef enum {
+       DELAY = 0x01,
+       VOLUME
+} media_transport_property_type;
+
+typedef enum {
        EQUALIZER_OFF = 0x01,
        EQUALIZER_ON,
        EQUALIZER_INVALID,
@@ -61,23 +59,12 @@ typedef enum {
 } media_player_repeat_status;
 
 typedef enum {
-       STATUS_STOPPED = 0x00,
-       STATUS_PLAYING,
-       STATUS_PAUSED,
-       STATUS_FORWARD_SEEK,
-       STATUS_REVERSE_SEEK,
-       STATUS_ERROR,
-       STATUS_INVALID
-} media_player_status;
-
-typedef enum {
        SHUFFLE_MODE_OFF = 0x01,
        SHUFFLE_ALL_TRACK,
        SHUFFLE_GROUP,
        SHUFFLE_INVALID,
 } media_player_shuffle_status;
 
-/* bluez 4.101 */
 typedef enum {
        SCAN_MODE_OFF = 0x01,
        SCAN_ALL_TRACK,
@@ -86,13 +73,27 @@ typedef enum {
 } media_player_scan_status;
 
 typedef enum {
+       STATUS_STOPPED = 0x00,
+       STATUS_PLAYING,
+       STATUS_PAUSED,
+       STATUS_FORWARD_SEEK,
+       STATUS_REVERSE_SEEK,
+       STATUS_ERROR,
+       STATUS_INVALID
+} media_player_status;
+
+typedef enum {
        PLAY = 0x01,
        PAUSE,
        STOP,
        NEXT,
        PREVIOUS,
-       FAST_FORWARD,
-       REWIND
+       PRESS_FAST_FORWARD,
+       RELEASE_FAST_FORWARD,
+       PRESS_REWIND,
+       RELEASE_REWIND,
+       VOLUME_UP,
+       VOLUME_DOWN
 } media_player_control_cmd;
 
 typedef struct {
@@ -102,7 +103,7 @@ typedef struct {
        const char *genre;
        unsigned int total_tracks;
        unsigned int number;
-       int64_t duration;
+       unsigned int duration;
 } media_metadata_attributes_t;
 
 typedef struct {
@@ -172,7 +173,7 @@ int bluetooth_media_player_deinit(void);
  * @param[in]   setting - The music player properties
  *
  * @remark       None
- * @see         None
+ * @see        None
  */
 int bluetooth_media_player_set_properties(
                        media_player_settings_t *setting);
@@ -193,7 +194,7 @@ int bluetooth_media_player_set_properties(
  *                      value - Value of the property which is changed
  *
  * @remark       None
- * @see         None
+ * @see        None
  */
 int bluetooth_media_player_change_property(
                        media_player_property_type type,
@@ -210,10 +211,10 @@ int bluetooth_media_player_change_property(
  *              BT_MEDIA_CONTROL_ERROR - Error \n
  *
  * @exception   None
- * @param[in]    metadata -Meida attributes
+ * @param[in]  metadata -Meida attributes
  *
  * @remark       None
- * @see         None
+ * @see        None
  */
 int bluetooth_media_player_change_track(
                        media_metadata_attributes_t *metadata);
@@ -249,7 +250,7 @@ int bluetooth_media_control_init(media_cb_func_ptr callback_ptr,
  * @remark      None
  *
  */
- int bluetooth_media_control_deinit(void);
+int bluetooth_media_control_deinit(void);
 
 /**
  * @brief      The function bluetooth_media_control_connect is called to establish an AVRCP
@@ -272,10 +273,30 @@ int bluetooth_media_control_connect(bluetooth_device_address_t *remote_address);
 int bluetooth_media_control_disconnect(bluetooth_device_address_t *remote_address);
 
 /**
+ * @brief      The function bluetooth_media_target_connect is called to establish an AVRCP
+ *     target role connection with  the specified device.
+ *
+ * @param[in]  remote_address  Bluetooth device address.
+ * @return     int     Zero on Success or reason for error if any.
+ *
+ */
+int bluetooth_media_target_connect(bluetooth_device_address_t *remote_address);
+
+/**
+ * @brief      The function bluetooth_media_target_disconnect is called to disconnect an
+ *     existing AVRCP target role connection with the specified device.
+ *
+ * @param[in]  remote_address  Bluetooth device address.
+ * @return     int     Zero on Success or reason for error if any.
+ *
+ */
+int bluetooth_media_target_disconnect(bluetooth_device_address_t *remote_address);
+
+/**
  * @brief      The function bluetooth_media_control_command is called to send
  *     the  AVRCP Control command like Play, Pause, FF, Rewind to the target device.
  *
- * @param[in]  type    media_player_control_cmd.
+ * @param[in]  type    media_player_control_cmd.
  * @return     int     Zero on Success or reason for error if any.
  *
  */
@@ -295,9 +316,9 @@ int bluetooth_media_control_command(media_player_control_cmd type);
  * @param[in]   setting - The music control properties
  *
  * @remark       None
- * @see         None
+ * @see        None
  */
- int bluetooth_media_control_set_property(media_player_property_type type, unsigned int value);
+int bluetooth_media_control_set_property(media_player_property_type type, unsigned int value);
 
 /**
  * @fn int bluetooth_media_control_get_property(media_player_property_type type, unsigned int *value)
@@ -313,11 +334,29 @@ int bluetooth_media_control_command(media_player_control_cmd type);
  * @param[in]   setting - The music control properties
  *
  * @remark       None
- * @see         None
+ * @see        None
  */
 int bluetooth_media_control_get_property(media_player_property_type type, unsigned int *value);
 
 /**
+ * @fn int bluetooth_media_transport_set_property(media_transport_property_type type, unsigned int value)
+ * @brief Notifies the remote bluetooth target with change in audio transport settings
+ *
+ * This function is a asynchronous call.
+ * No event for this api.
+ *
+ * @return  BT_MEDIA_TRANSPORT_SUCCESS  - Success \n
+ *              BT_MEDIA_TRANSPORT_ERROR - Error \n
+ *
+ * @exception   None
+ * @param[in]   setting - The audio transport properties
+ *
+ * @remark       None
+ * @see        None
+ */
+int bluetooth_media_transport_set_property(media_transport_property_type type, unsigned int value);
+
+/**
  * @fn int bluetooth_media_control_get_track_info(media_metadata_attributes_t *metadata)
  * @brief reads the track metadata from the remote target player.
  *
@@ -331,9 +370,9 @@ int bluetooth_media_control_get_property(media_player_property_type type, unsign
  * @param[in]   metadata - The music meta data information.
  *
  * @remark       None
- * @see         None
+ * @see        None
  */
- int bluetooth_media_control_get_track_info(media_metadata_attributes_t *metadata);
+int bluetooth_media_control_get_track_info(media_metadata_attributes_t *metadata);
 
 #ifdef __cplusplus
 }