Пример #1
0
 protected override void ExecuteJsonCommand(SuperWebSocket.WebSocketSession session, ShowSiteReceiveData commandInfo)
 {
     //TODO: first check if bgmusic already exists instead of creating a new entry
     if (commandInfo.AlwaysBgMusic == true)
     {
         MuteApp.BackgroundMusic bgMusic = MuteApp.MuteTunesConfigUtil.FindBgMusic(commandInfo.TabUrl, MuteApp.SmartVolManagerPackage.BgMusicManager.MuteTunesConfig);
         if (bgMusic == null)
         {
             bgMusic = MuteApp.MuteTunesConfigUtil.CreateWeb(commandInfo.TabTitle, commandInfo.TabUrl);
             MuteApp.MuteTunesConfigUtil.AddBgMusic(bgMusic, BgMusicManager.MuteTunesConfig);
         }
         MixerWebSocketServerHelper.SendCommand("BGMUSICSITES", new GetBgMusicSiteSendData());
         MuteApp.MuteTunesConfigUtil.Save(BgMusicManager.MuteTunesConfig);
         UiPackage.UiCommands.OnOperation(bgMusic.Id, Operation.ChangeMusic, "");
         UiPackage.UiCommands.OnOperation(Operation.Show);
     }
     else
     {
         MuteApp.BackgroundMusic bgMusic = MuteApp.MuteTunesConfigUtil.FindBgMusic(commandInfo.TabUrl, MuteApp.SmartVolManagerPackage.BgMusicManager.MuteTunesConfig);
         if (bgMusic != null)
         {
             UiPackage.UiCommands.OnOperation(bgMusic.Id, Operation.ChangeMusic, "");
             UiPackage.UiCommands.ShowWebBgMusic();
         }
         else
         {
             UiPackage.UiCommands.ShowSite(commandInfo.TabTitle, commandInfo.TabUrl);
         }
     }
 }
Пример #2
0
        protected override void ExecuteJsonCommand(SuperWebSocket.WebSocketSession session, PlayerHtmlReceiveData commandInfo)
        {
            //Read in player html and send it back
            string             html    = MuteApp.WebServer.GetExtensionPlayerHtml();
            PlayerHtmlSendData request = new PlayerHtmlSendData();

            request.Html = html;
            MixerWebSocketServerHelper.SendCommand("PLAYERHTML", request);
        }
Пример #3
0
        private static void m_WebSocketServer_NewSessionConnected(WebSocketSession session)
        {
            _sessions.Add(session);
            //WinSoundServer.OsIntegrationPackage.PidManager.AddSocketServerProcName(""); could get it from first received data (if so, don't do this here)

            //Read in player html and send it back
            string             html    = MuteApp.WebServer.GetExtensionPlayerHtml();
            PlayerHtmlSendData request = new PlayerHtmlSendData();

            request.Html = html;
            MixerWebSocketServerHelper.SendCommand("PLAYERHTML", request);
            UiPackage.UiCommands.UpdateUiForState(); // sends playerstate
            MixerWebSocketServerHelper.SendCommand("BGMUSICSITES", new GetBgMusicSiteSendData());
            int x = 0;

            x++;
        }
Пример #4
0
 protected override void ExecuteJsonCommand(SuperWebSocket.WebSocketSession session, GetBgMusicSiteReceiveData commandInfo)
 {
     MixerWebSocketServerHelper.SendCommand("BGMUSICSITES", new GetBgMusicSiteSendData());
 }
Пример #5
0
        protected override void ExecuteJsonCommand(SuperWebSocket.WebSocketSession session, SettingsRequestReceiveData commandInfo)
        {
            SettingsSendData request = new SettingsSendData(BgMusicManager.MuteTunesConfig);

            MixerWebSocketServerHelper.SendCommand("SETTINGS", request);
        }