#include <stdbool.h>
#include <Elementary.h>
#include "vp-mm-player.h"
+#include "vp-play-type-define.h"
-bool vp_avrcp_initialize();
+bool vp_avrcp_initialize(PlayView* pViewHandle);
bool vp_avrcp_deinitialize();
bool vp_avrcp_noti_track(const char *title, const char *artist, const char *album, const char *genre, unsigned int duration);
bool vp_avrcp_noti_track_position(unsigned int position);
#include <network/bluetooth.h>
#include "vp-play-macro-define.h"
-
+#include "vp-play-type-define.h"
+#include "vp-play-normal-view.h"
+#include "vp-play-view.h"
#include "vp-avrcp.h"
/* check temp */
const char *remote_address,
void *user_data)
{
- VideoLogInfo("");
+ if (!user_data) {
+ return;
+ }
+ PlayView *pPlayView = (PlayView *)user_data;
+ VideoLogInfo("Bluetooth device!!");
+ vp_play_normal_view_show_volume_popup(pPlayView);
+ if (!connected) {
+ vp_play_normal_view_pause_player(pPlayView);
+ }
}
/* external functions */
-bool vp_avrcp_initialize()
+bool vp_avrcp_initialize(PlayView* pViewHandle)
{
VideoLogInfo("vp_avrcp_initialize start");
+ PlayView *pPlayView = (PlayView *)pViewHandle;
+ if(!pPlayView) {
+ return FALSE;
+ }
int nRet = bt_initialize();
if (nRet != BT_ERROR_NONE) {
VideoLogError("bt_initialize fail. nRet[%d]", nRet);
nRet =
bt_avrcp_target_initialize(_vp_avrcp_connection_state_changed_cb,
- NULL);
+ pPlayView);
if (nRet != BT_ERROR_NONE) {
VideoLogError("bt_avrcp_target_initialize fail. nRet[%d]", nRet);
bt_deinitialize();
}
#endif
- pPlayView->bAVRCP = vp_avrcp_initialize();
+ pPlayView->bAVRCP = vp_avrcp_initialize(pPlayView);
pPlayView->bWifi = vp_play_wifi_initialize();
bool bWifiConnect = FALSE;