[TSAM-8559]Bluetooth headset scenarios added 90/90990/1
authorAlka Sethi <alka.sethi@samsung.com>
Wed, 5 Oct 2016 08:48:35 +0000 (14:18 +0530)
committerAlka Sethi <alka.sethi@samsung.com>
Wed, 5 Oct 2016 08:48:35 +0000 (14:18 +0530)
Change-Id: I6ce1fa17b3683e02080dafcaa1db4098991aa1d0
Signed-off-by: Alka Sethi <alka.sethi@samsung.com>
playview/src/core/include/vp-avrcp.h
playview/src/core/vp-avrcp.c
playview/src/vp-play-view.c

index 44580d4..08c3b97 100644 (file)
 #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);
index 166792b..b31d29f 100644 (file)
@@ -18,7 +18,9 @@
 #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 */
@@ -32,14 +34,26 @@ void _vp_avrcp_connection_state_changed_cb(bool connected,
         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);
@@ -48,7 +62,7 @@ bool vp_avrcp_initialize()
 
        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();
index ba91376..f692108 100644 (file)
@@ -1888,7 +1888,7 @@ play_view_handle vp_play_view_create(Evas_Object *pParent, Ecore_X_Window nParen
        }
 #endif
 
-       pPlayView->bAVRCP = vp_avrcp_initialize();
+       pPlayView->bAVRCP = vp_avrcp_initialize(pPlayView);
        pPlayView->bWifi = vp_play_wifi_initialize();
 
        bool bWifiConnect = FALSE;