4 *Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef _BT_MP_CONTROL_H_
21 #define _BT_MP_CONTROL_H_
25 #endif /*__cplusplus*/
29 #define BT_MEDIA_ERROR_NONE ((int)0)
31 #define BT_MEDIA_ERROR_BASE ((int)0)
32 #define BT_MEDIA_ERROR_INTERNAL ((int)BT_MEDIA_ERROR_BASE - 0x01)
33 #define BT_MEDIA_ERROR_ALREADY_INITIALIZED ((int)BT_MEDIA_ERROR_BASE - 0x02)
41 EQUALIZER = 0x02, /* bluez 4.101 */
42 REPEAT, /* bluez 4.101 */
43 SCAN, /* bluez 4.101 */
44 STATUS, /* bluez 4.101 */
45 } media_player_property_type;
52 } media_player_equalizer_status;
55 REPEAT_MODE_OFF = 0x01,
58 REPEAT_GROUP, /* bluez 4.101 */
60 } media_player_repeat_status;
63 STATUS_STOPPED = 0x00,
66 STATUS_FORWARD_SEEK, /* bluez 4.101 */
67 STATUS_REVERSE_SEEK, /* bluez 4.101 */
68 STATUS_ERROR, /* bluez 4.101 */
70 } media_player_status;
73 SHUFFLE_MODE_OFF = 0x01,
77 } media_player_shuffle_status;
85 } media_player_scan_status;
92 unsigned int tracknumber;
93 const char *artist; /* bluez 4.101 */
94 const char *genre; /* bluez 4.101 */
95 unsigned int total_tracks; /* bluez 4.101 */
96 unsigned int number; /* bluez 4.101 */
97 unsigned int duration;
98 } media_metadata_attributes_t;
101 media_player_repeat_status loopstatus;
102 media_player_status playbackstatus;
103 gboolean shuffle_mode;
105 media_metadata_attributes_t metadata;
106 media_player_equalizer_status equalizer; /* bluez 4.101 */
107 media_player_repeat_status repeat; /* bluez 4.101 */
108 media_player_shuffle_status shuffle; /* bluez 4.101 */
109 media_player_scan_status scan; /* bluez 4.101 */
110 media_player_status status; /* bluez 4.101 */
111 } media_player_settings_t;
118 } media_event_param_t;
120 typedef void (*media_cb_func_ptr)(int, media_event_param_t*, void*);
124 * @fn int bluetooth_media_player_init(media_cb_func_ptr callback_ptr, void *user_data)
125 * @brief Initialize AVRCP service and register the callback
127 * This function is a synchronous call.
129 * @param[in] callback_ptr - Callback function (A2DP connected / Disconnected)
130 * @param[in] user_data - User data
132 * @return BT_MEDIA_ERROR_NONE - Success \n
133 * BT_MEDIA_ERROR_ALREADY_INITIALIZED - Already initialized \n
134 * BT_MEDIA_ERROR_INTERNAL - Internal error \n
139 int bluetooth_media_player_init(media_cb_func_ptr callback_ptr,
143 * @fn int bluetooth_media_player_deinit(void)
144 * @brief Deinitialize AVRCP service and register the callback
146 * This function is a synchronous call.
148 * @return BT_MEDIA_CONTROL_SUCCESS - Success \n
149 * BT_MEDIA_CONTROL_ERROR - Error \n
154 int bluetooth_media_player_deinit(void);
157 * @fn int bluetooth_media_player_set_properties(media_player_settings_t *setting)
158 * @brief Notifies the remote bluetooth headset with change in music player settings
160 * This function is a asynchronous call.
161 * No event for this api..
163 * @return BT_MEDIA_CONTROL_SUCCESS - Success \n
164 * BT_MEDIA_CONTROL_ERROR - Error \n
167 * @param[in] setting - The music player properties
172 int bluetooth_media_player_set_properties(
173 media_player_settings_t *setting);
176 * @fn int bluetooth_media_player_change_property(media_player_property_type type,
177 * unsigned int value);
178 * @brief Notifies the remote bluetooth headset with change in music player settings
180 * This function is a asynchronous call.
181 * No event for this api..
183 * @return BT_MEDIA_CONTROL_SUCCESS - Success \n
184 * BT_MEDIA_CONTROL_ERROR - Error \n
187 * @param[in] type - Type of the music player property
188 * value - Value of the property which is changed
193 int bluetooth_media_player_change_property(
194 media_player_property_type type,
198 * @fn int bluetooth_media_player_change_track(media_metadata_attributes_t metadata)
199 * @briefNotifies the remote bluetooth headset with change in media attributes of the track
201 * This function is a asynchronous call.
202 * No event for this api..
204 * @return BT_MEDIA_CONTROL_SUCCESS - Success \n
205 * BT_MEDIA_CONTROL_ERROR - Error \n
208 * @param[in] metadata -Meida attributes
213 int bluetooth_media_player_change_track(
214 media_metadata_attributes_t *metadata);
218 #endif /*__cplusplus*/
220 #endif /*_BT_MP_CONTROL_H_*/