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 } media_player_property_type;
44 REPEAT_MODE_OFF = 0x01,
48 } media_player_repeat_status;
51 STATUS_STOPPED = 0x00,
55 } media_player_status;
58 SHUFFLE_MODE_OFF = 0x01,
62 } media_player_shuffle_status;
69 unsigned int tracknumber;
70 unsigned int duration;
71 } media_metadata_attributes_t;
74 media_player_repeat_status loopstatus;
75 media_player_status playbackstatus;
78 media_metadata_attributes_t metadata;
79 } media_player_settings_t;
86 } media_event_param_t;
88 typedef void (*media_cb_func_ptr)(int, media_event_param_t*, void*);
92 * @fn int bluetooth_media_player_init(media_cb_func_ptr callback_ptr, void *user_data)
93 * @brief Initialize AVRCP service and register the callback
95 * This function is a synchronous call.
97 * @param[in] callback_ptr - Callback function (A2DP connected / Disconnected)
98 * @param[in] user_data - User data
100 * @return BT_MEDIA_ERROR_NONE - Success \n
101 * BT_MEDIA_ERROR_ALREADY_INITIALIZED - Already initialized \n
102 * BT_MEDIA_ERROR_INTERNAL - Internal error \n
107 int bluetooth_media_player_init(media_cb_func_ptr callback_ptr,
111 * @fn int bluetooth_media_player_deinit(void)
112 * @brief Deinitialize AVRCP service and register the callback
114 * This function is a synchronous call.
116 * @return BT_MEDIA_CONTROL_SUCCESS - Success \n
117 * BT_MEDIA_CONTROL_ERROR - Error \n
122 int bluetooth_media_player_deinit(void);
125 * @fn int bluetooth_media_player_set_properties(media_player_settings_t *setting)
126 * @brief Notifies the remote bluetooth headset with change in music player settings
128 * This function is a asynchronous call.
129 * No event for this api..
131 * @return BT_MEDIA_CONTROL_SUCCESS - Success \n
132 * BT_MEDIA_CONTROL_ERROR - Error \n
135 * @param[in] setting - The music player properties
140 int bluetooth_media_player_set_properties(
141 media_player_settings_t *setting);
144 * @fn int bluetooth_media_player_change_property(media_player_property_type type,
145 * unsigned int value);
146 * @brief Notifies the remote bluetooth headset with change in music player settings
148 * This function is a asynchronous call.
149 * No event for this api..
151 * @return BT_MEDIA_CONTROL_SUCCESS - Success \n
152 * BT_MEDIA_CONTROL_ERROR - Error \n
155 * @param[in] type - Type of the music player property
156 * value - Value of the property which is changed
161 int bluetooth_media_player_change_property(
162 media_player_property_type type,
166 * @fn int bluetooth_media_player_change_track(media_metadata_attributes_t metadata)
167 * @briefNotifies the remote bluetooth headset with change in media attributes of the track
169 * This function is a asynchronous call.
170 * No event for this api..
172 * @return BT_MEDIA_CONTROL_SUCCESS - Success \n
173 * BT_MEDIA_CONTROL_ERROR - Error \n
176 * @param[in] metadata -Meida attributes
181 int bluetooth_media_player_change_track(
182 media_metadata_attributes_t *metadata);
186 #endif /*__cplusplus*/
188 #endif /*_BT_MP_CONTROL_H_*/