private void flex_FlashCallback(YoYoStudio.Controls.Winform.FlexCallbackCommand cmd, List<string> args)
 {
     switch (cmd)
     {
         case FlexCallbackCommand.AudioStateChanged:
             break;
         case FlexCallbackCommand.ExtendVideo:
             break;
         case FlexCallbackCommand.LoadComplete:
              CallFlash(FlexCommand.ConnectRTMP, "rtmp://129.223.253.33/oflaDemo");
         CallFlash(FlexCommand.LoadMusics);
             break;
         case FlexCallbackCommand.None:
             break;
         case FlexCallbackCommand.ReportStatus:
             break;
         case FlexCallbackCommand.ScaleXDefault:
             break;
         case FlexCallbackCommand.ScaleXMirror:
             break;
         case FlexCallbackCommand.TakePicture:
             break;
         case FlexCallbackCommand.VideoStateChanged:
             break;
         case FlexCallbackCommand.ZoomIn:
             break;
         case FlexCallbackCommand.ZoomOut:
             break;
         default:
             break;
     }
 }
 void videoControl_FlashCallback(YoYoStudio.Controls.Winform.FlexCallbackCommand cmd, List<string> args)
 {
     switch (cmd)
     { 
         case YoYoStudio.Controls.Winform.FlexCallbackCommand.LoadComplete:
             var cameras = videoControl.CallFlash(YoYoStudio.Controls.Winform.FlexCommand.GetCameras).ToList();
             CameraWindowViewModel cvm = videoControl.DataContext as CameraWindowViewModel;
             if (cvm != null)
                 cvm.Cameras = new System.Collections.ObjectModel.ObservableCollection<string>(cameras);
             break;
     }
 }
 void videoControl_FlashCallback(YoYoStudio.Controls.Winform.FlexCallbackCommand cmd, List<string> args)
 {
     switch (cmd)
     {
         case YoYoStudio.Controls.Winform.FlexCallbackCommand.LoadComplete:
             var cameras = new List<string> { "" };
             string[] cams = videoControl.CallFlash(YoYoStudio.Controls.Winform.FlexCommand.GetCameras);
             if (cams != null && cams.Length > 0)
             {
                 cameras.AddRange(cams);
             }
             VideoConfigurationViewModel cvm = videoControl.DataContext as VideoConfigurationViewModel;
             if (cvm != null)
             {
                 cvm.Cameras = new System.Collections.ObjectModel.ObservableCollection<string>(cameras);
             }
             break;
     }
 }
 public ImageViewModel AddImage(YoYoStudio.Model.Core.ImageWithoutBody img)
 {
     string group = string.IsNullOrEmpty(img.ImageGroup) ? Const.DefaultImageGroup : img.ImageGroup;
     string path = Const.ImageRootFolderName + "\\" + img.ImageType_Id.ToString() + "\\" + group + "\\" + img.Id;
     var vm = new ImageViewModel
     {
         RelativePathWithoutExt = path,
         AbsolutePathWithoutExt = Path.Combine(Root, path),
         Id = img.Id,
         ImageGroup = group,
         Tag = img,
         Ext = img.Ext
     };
     vm.Initialize();
     lock (LocalCache.AllImages)
     {
         LocalCache.AllImages[img.ImageType_Id][img.Id] = vm;
     }            
     return vm;
 }
 void vc_FlashCallback(YoYoStudio.Controls.Winform.FlexCallbackCommand cmd, List<string> args)
 {
     VideoWindowViewModel vm = DataContext as VideoWindowViewModel;
     if (vm != null && vm.UserVM != null)
     {
         switch (cmd)
         {
             case YoYoStudio.Controls.Winform.FlexCallbackCommand.ZoomIn:
                 Width = Width * 1.1;
                 Height = Height * 1.1;
                 break;
             case YoYoStudio.Controls.Winform.FlexCallbackCommand.ZoomOut:
                 Width = Width * 0.9;
                 Height = Height * 0.9;
                 break;
             case YoYoStudio.Controls.Winform.FlexCallbackCommand.LoadComplete:
                 vc.CallFlash(YoYoStudio.Controls.Winform.FlexCommand.ConnectRTMP, vm.UserVM.RoomWindowVM.RoomVM.RtmpUrl);
                 break;
             default:
                 break;
         }
     }
 }
 public YoYoStudio.Model.Core.UserIdList AddUserIdList(int userId, string token, YoYoStudio.Model.Core.UserIdList idlist)
 {
     return client.AddUserIdList(application_Id, userId, token, idlist);
 }
 public YoYoStudio.Model.Core.UserApplicationInfo AddUserInfo(int userId, string token, YoYoStudio.Model.Core.UserApplicationInfo info)
 {
     return client.AddUserInfo(application_Id, userId, token, info);
 }
 public void UpdateApplication(int userId, string token, YoYoStudio.Model.Core.Application application)
 {
     client.UpdateApplication(application_Id, userId, token, application);
 }
 public YoYoStudio.Model.Core.RoleCommand AddRoleCommand(int userId, string token, YoYoStudio.Model.Core.RoleCommand roleCommand)
 {
     return client.AddRoleCommand(application_Id, userId, token, roleCommand);
 }
 public void UpdateBlockType(int userId, string token, YoYoStudio.Model.Core.BlockType blockType)
 {
     client.UpdateBlockType(application_Id, userId, token, blockType);
 }
 public void UpdateExchangeRate(int userId, string token, YoYoStudio.Model.Core.ExchangeRate eRate)
 {
     client.UpdateExchangeRate(application_Id, userId, token, eRate);
 }
 public YoYoStudio.Model.Core.User AddUser(int userId, string token, YoYoStudio.Model.Core.User user)
 {
     return client.AddUser(application_Id, userId, token, user);
 }
 public void UpdateBlockList(int userId, string token, YoYoStudio.Model.Core.BlockList blockL)
 {
     client.UpdateBlockList(application_Id, userId, token, blockL);
 }
 public YoYoStudio.Model.Chat.RoomRole AddRoomRole(int userId, string token, YoYoStudio.Model.Chat.RoomRole roomRole)
 {
     return client.AddRoomRole(application_Id, userId, token, roomRole);
 }
 public void UpdateUser(int userId, string token, YoYoStudio.Model.Core.User user)
 {
     client.UpdateUser(application_Id, userId, token, user);
 }
 public YoYoStudio.Model.Chat.Room AddRoom(int userId, string token, YoYoStudio.Model.Chat.Room room)
 {
     return client.AddRoom(application_Id, userId, token, room);
 }
 public void UpdateRoom(int userId, string token, YoYoStudio.Model.Chat.Room room)
 {
     client.UpdateRoom(application_Id, userId, token, room);
 }
 public YoYoStudio.Model.Chat.RoomGroup AddRoomGroup(int userId, string token, YoYoStudio.Model.Chat.RoomGroup roomGroup)
 {
     return client.AddRoomGroup(application_Id, userId, token, roomGroup);
 }
 public void UpdateUserInfo(int userId, string token, YoYoStudio.Model.Core.UserApplicationInfo info)
 {
     client.UpdateUserInfo(application_Id, userId, token, info);
 }
 public YoYoStudio.Model.Chat.GiftGroup AddGiftGroup(int userId, string token, YoYoStudio.Model.Chat.GiftGroup giftGroup)
 {
     return client.AddGiftGroup(application_Id, userId, token, giftGroup);
 }
 public YoYoStudio.Model.Core.BlockList AddBlockList(int userId, string token, YoYoStudio.Model.Core.BlockList blockL)
 {
     return client.AddBlockList(application_Id, userId, token, blockL);
 }
 public void UpdateGift(int userId, string token, YoYoStudio.Model.Chat.Gift gift)
 {
     client.UpdateGift(application_Id, userId, token, gift);
 }
 public YoYoStudio.Model.Core.BlockType AddBlockType(int userId, string token, YoYoStudio.Model.Core.BlockType blockType)
 {
     return client.AddBlockType(application_Id, userId, token, blockType);
 }
        private void flex_FlashCallback(YoYoStudio.Controls.Winform.FlexCallbackCommand cmd, List<string> args)
        {
            PlayMusicWindowViewModel vm = DataContext as PlayMusicWindowViewModel;
            switch (cmd)
            {
                case FlexCallbackCommand.None:
                    break;
                case FlexCallbackCommand.ReportStatus:
                    if (args != null && args.Count == 1)
                    {
                        if (args[0] == FlexStatusStrings.ConnectSucceed)
                        { 
                            //the connection has been setup with Red5
                            if (vm != null)
                            {
                                vm.RoomWindowVM.RoomCallback.StartMusicEvent += RoomCallback_StartMusicEvent;
                                vm.RoomWindowVM.RoomCallback.TogglePauseMusicEvent += RoomCallback_TogglePauseMusicEvent;
                                vm.RoomWindowVM.RoomCallback.SetMusicVolumeEvent += RoomCallback_SetMusicVolumeEvent;
                                vm.RoomWindowVM.RoomCallback.SetPlayPositionEvent += RoomCallback_SetPlayPositionEvent;
                                vm.RoomWindowVM.RoomCallback.StopMusicEvent += RoomCallback_StopMusicEvent;
                                vm.RoomWindowVM.RoomCallback.ReportMusicStatusEvent += RoomCallback_ReportMusicStatusEvent;
                                vm.RoomWindowVM.RoomCallback.UpdateMusicStatusEvent += RoomCallback_UpdateMusicStatusEvent;
                            }
                        }
                    }
                    break;
                case FlexCallbackCommand.LoadComplete:
                    //flex control has been loaded. Next we will connect the Rmtp and load the musics
                    
                    if (vm != null)
                    {
                        CallFlash(FlexCommand.ConnectRTMP, vm.MusicRtmpUrl);
                        CallFlash(FlexCommand.LoadMusics);
                        SynchronizePlayStatus();
                    }
                    break;
                case FlexCallbackCommand.PlayMusic:
                    vm.RoomWindowVM.RoomClient.StartMusic(vm.RoomWindowVM.RoomVM.Id, vm.Me.Id, args[0]);
                    break;
                case FlexCallbackCommand.StopMusic:
                    vm.RoomWindowVM.RoomClient.StopMusic(vm.RoomWindowVM.RoomVM.Id, vm.Me.Id);
                    break;
                case FlexCallbackCommand.SetPlayPosition:
                    //vm.RoomWindowVM.RoomClient.SetPlayPosition(vm.RoomWindowVM.RoomVM.Id, vm.Me.Id, int.Parse(args[0]));
                    break;
                case FlexCallbackCommand.SetVolume:
                    //vm.RoomWindowVM.RoomClient.SetMusicVolume(vm.RoomWindowVM.RoomVM.Id, vm.Me.Id, int.Parse(args[0]));
                    break;
                case FlexCallbackCommand.TogglePauseMusic:
                    //if (args != null && args.Count == 1)
                    //{
                    //    if (args[0] == FlexStatusStrings.MusicPaused)
                    //    {
                    //        vm.RoomWindowVM.RoomClient.TogglePauseMusic(vm.RoomWindowVM.RoomVM.Id, vm.Me.Id, true);
                    //    }
                    //    else
                    //    {
                    //        vm.RoomWindowVM.RoomClient.TogglePauseMusic(vm.RoomWindowVM.RoomVM.Id, vm.Me.Id,false);
                    //    }
                    //}
                    break;
                default:
                    break;
            }

            if (FlashCallback != null)
            {
                FlashCallback(cmd, args);
            }
        }
 public YoYoStudio.Model.Core.ExchangeRate AddExchangeRate(int userId, string token, YoYoStudio.Model.Core.ExchangeRate eRate)
 {
     return client.AddExchangeRate(application_Id, userId, token, eRate);
 }
 public void AddImage(int userId, string token, YoYoStudio.Model.Core.Image image)
 {
     client.AddImage(application_Id, userId, token, image);
 }
 public YoYoStudio.Model.Core.Application AddApplication(int userId, string token, YoYoStudio.Model.Core.Application application)
 {
     return client.AddApplication(application_Id, userId, token, application);
 }
 public void UpdateUserIdList(int userId, string token, YoYoStudio.Model.Core.UserIdList idlist)
 {
     client.UpdateUserIdList(application_Id, userId, token, idlist);
 }
 public YoYoStudio.Model.Chat.Gift AddGift(int userId, string token, YoYoStudio.Model.Chat.Gift gift)
 {
     return client.AddGift(application_Id, userId, token, gift);
 }
 public void UpdateRoleCommand(int userId, string token, YoYoStudio.Model.Core.RoleCommand roleCommand)
 {
     client.UpdateRoleCommand(application_Id, userId, token, roleCommand);
 }