陈嘉乐
2020-06-04 7cf82866bff8144dd89746beecb8d185f7f8595e
2020-06-04-1
4个文件已修改
129 ■■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/sqlite3/storage.ide 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/Music/View/DialogView.cs 120 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,12 +1,11 @@
<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/Music/View/DialogView.cs">
    <Files>
      <File FileName="HDL_ON/UI/Music/SendMethod.cs" Line="203" Column="76" />
      <File FileName="../旧版本Music/MyMusic.cs" Line="263" Column="145" />
      <File FileName="HDL_ON/UI/Music/SendMethod.cs" Line="79" Column="32" />
      <File FileName="../旧版本Music/MyMusic.cs" Line="66" Column="58" />
      <File FileName="HDL_ON/UI/Music/A31MusicModel.cs" Line="199" Column="6" />
      <File FileName="HDL_ON/UI/Music/MusicMain.cs" Line="361" Column="99" />
      <File FileName="HDL_ON/UI/UI0-Public/PublicAssmebly.cs" Line="1" Column="1" />
      <File FileName="HDL_ON/UI/Music/View/DialogView.cs" Line="1" Column="1" />
      <File FileName="HDL_ON/UI/Music/MusicMain.cs" Line="125" Column="14" />
      <File FileName="HDL_ON/UI/Music/View/DialogView.cs" Line="6" Column="28" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
.vs/HDL_APP_Project/xs/sqlite3/storage.ide
Binary files differ
.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal
Binary files differ
HDL_ON/UI/Music/View/DialogView.cs
@@ -11,6 +11,7 @@
        /// <param name="musicInfo"></param>
        public void FieListView(MusicInfo musicInfo)
        {
            #region
            //主控件
            Dialog dialog = new Dialog()
            {
@@ -85,7 +86,7 @@
            };
            topFra.AddChidren(addIconBtn);
            #endregion
            VerticalScrolViewLayout verticalScrolViewLayout = new VerticalScrolViewLayout
            {
                Y = Application.GetRealHeight(70),
@@ -227,6 +228,9 @@
        /// </summary>
        public void PlayMergence()
        {
            #region
            //主控件
            Dialog dialog = new Dialog()
            {
@@ -394,40 +398,50 @@
                };
                PlayRow.AddChidren(lineBtn);
            }
            #endregion
            confirmBtn.MouseUpEventHandler += (sender, e) =>
            {
                if (playList1.Count <= 1)
                {
                    new PublicAssmebly().TipMsgAutoClose("至少选中两个以上播放器", false);
                    return;
                }
                var playList2 = new List<A31MusicModel>();
                for (int i = 0; i < playList1.Count; i++)
                ///查询是否已经存在主播放;
                var host_Music_If = playList1.Find((c) => c.ServerClientType == 1);
                if (host_Music_If == null)
                {
                    var musics = playList1[i];
                    if (musics.A31PlayStatus.playSource == "play")
                    var playList2 = new List<A31MusicModel>();
                    for (int i = 0; i < playList1.Count; i++)
                    {
                        playList2.Add(musics);
                        var musics = playList1[i];
                        if (musics.A31PlayStatus.playSource == "play")
                        {
                            playList2.Add(musics);
                        }
                    }
                }
                if (playList2.Count == 0)
                {
                    SelectedPlayerView(dialog, playList1, playList1);
                }
                else if (playList2.Count == 1)
                {
                    dialog.Close();
                    var player = playList2[0];
                    Threading(player, playList1);
                    if (playList2.Count == 0)
                    {
                        SelectedPlayerView(dialog, playList1, playList1);
                    }
                    else if (playList2.Count == 1)
                    {
                        //只有一个播放器在播放,默认为主播发器;
                        dialog.Close();
                        var player = playList2[0];
                        Threading(player, playList1);
                    }
                    else
                    {
                        SelectedPlayerView(dialog, playList1, playList2);
                    }
                }
                else
                {
                    SelectedPlayerView(dialog, playList1, playList2);
                    Threading(host_Music_If, playList1);
                }
            };
        }
@@ -438,7 +452,7 @@
        ///  /// <param name="musicList2">显示在播放音乐播放器列表</param>
        void SelectedPlayerView(Dialog dialogF, List<A31MusicModel> musicList1, List<A31MusicModel> musicList2)
        {
            #region
            //主控件
            Dialog dialog = new Dialog()
            {
@@ -584,7 +598,7 @@
                };
                addFlieRow.AddChidren(lineBtn);
            }
            #endregion
            confirmBtn.MouseUpEventHandler += (sender, e) =>
            {
                if (selectedBtn.Name.ToString() == "No")
@@ -643,6 +657,7 @@
                            continue;
                        }
                        System.Threading.Thread.Sleep(1000);//等待一秒再发数据
                        var dd = SendMethod.OpenWeb("http://" + clientMusic.IPAddress + "/httpapi.asp?command=ConnectMasterAp:ssid=" + ssid + ":ch=" + serverIfon.WifiChannel + ":auth=OPEN:encry=NONE:pwd=:chext=0:JoinGroupMaster:eth" + serverIfon.eth2 + ":wifi" + serverIfon.ra0 + ":uuid" + serverIfon.uuid);
                        if (null == SendMethod.OpenWeb("http://" + clientMusic.IPAddress + "/httpapi.asp?command=ConnectMasterAp:ssid=" + ssid + ":ch=" + serverIfon.WifiChannel + ":auth=OPEN:encry=NONE:pwd=:chext=0:JoinGroupMaster:eth" + serverIfon.eth2 + ":wifi" + serverIfon.ra0 + ":uuid" + serverIfon.uuid))
                        {
                            if (null == SendMethod.OpenWeb("http://" + clientMusic.IPAddress + "/httpapi.asp?command=ConnectMasterAp:ssid=" + ssid + ":ch=" + serverIfon.WifiChannel + ":auth=OPEN:encry=NONE:pwd=:chext=0:JoinGroupMaster:eth" + serverIfon.eth2 + ":wifi" + serverIfon.ra0 + ":uuid" + serverIfon.uuid))
@@ -725,6 +740,8 @@
        /// </summary>
        public void DetachPlayMergence(A31MusicModel a31player)
        {
            #region
            //主控件
            Dialog dialog = new Dialog()
            {
@@ -810,10 +827,24 @@
                Width = Application.GetRealWidth(344),
            };
            dialogFra.AddChidren(verticalScrolViewLayout);
            var  slaveList= new List<Slave>();
            var playList1 = new List<A31MusicModel>();
            playList1.Add(a31player);
            for (int i = 0; i < a31player.Slave.slave_list.Count; i++)
            {
                var slave = a31player.Slave.slave_list[i];
                var music_If = A31MusicModel.A31MusicModelList.Find((c) => c.UniqueDeviceName == slave.uuid.Replace("uuid:", ""));
                if (music_If != null)
                {
                    playList1.Add(music_If);
                }
            }
            var playList2 = new List<A31MusicModel>();
            for (int i = 0; i < playList1.Count; i++)
            {
                var player = playList1[i];
                RowLayout PlayRow = new RowLayout
                {
                    Height = Application.GetRealHeight(50),
@@ -833,7 +864,7 @@
                    TextColor = Color.TextColor,
                    TextSize = TextSize.Text14,
                    TextAlignment = TextAlignment.CenterLeft,
                    Text = slave.name,
                    Text = player.Name,
                };
                PlayRow.AddChidren(PlayNameBtn);
@@ -854,7 +885,7 @@
                Button clickBtn = new Button
                {
                    Height = Application.GetRealHeight(50),
                    Tag = slave.uuid.Replace("uuid:", ""),
                    Tag = player.UniqueDeviceName,
                };
                PlayRow.AddChidren(clickBtn);
@@ -862,19 +893,19 @@
                {
                    clickBtn.IsSelected = !clickBtn.IsSelected;
                    selectedIconBtn.IsSelected = clickBtn.IsSelected;
                    var uuid = slaveList.Find((obj) => obj.uuid.Replace("uuid:", "") == clickBtn.Tag.ToString());
                    var uuid = playList2.Find((obj) => obj.UniqueDeviceName== clickBtn.Tag.ToString());
                    if (selectedIconBtn.IsSelected)
                    {
                        if (uuid == null)
                        {
                            slaveList.Add(slave);
                            playList2.Add(player);
                        }
                    }
                    else
                    {
                        if (uuid != null)
                        {
                            slaveList.Remove(slave);
                            playList2.Remove(player);
                        }
                    }
                };
@@ -889,9 +920,10 @@
                };
                PlayRow.AddChidren(lineBtn);
            }
            #endregion
            confirmBtn.MouseUpEventHandler += (sender, e) =>
            {
                if (slaveList.Count == 0)
                if (playList1.Count == 0)
                {
                    new PublicAssmebly().TipMsgAutoClose("还没有选择解除组播放器", false);
                    return;
@@ -904,21 +936,37 @@
                {
                    try
                    {
                        for (int i = 0; i < slaveList.Count; i++)
                        var play_If = playList1.Find((obj) => obj.UniqueDeviceName == a31player.UniqueDeviceName);
                        if (play_If == null)
                        {
                            var clientMusic = slaveList[i];
                            if (null == SendMethod.OpenWeb("http://" + a31player.IPAddress + "/httpapi.asp?command=multiroom:SlaveKickout:" + clientMusic.ip))
                            //子音箱与主音箱断开的命令
                            for (int i = 0; i < playList1.Count; i++)
                            {
                                if (null == SendMethod.OpenWeb("http://" + a31player.IPAddress + "/httpapi.asp?command=multiroom:SlaveKickout:" + clientMusic.ip))
                                var clientMusic = playList1[i];
                                if (null == SendMethod.OpenWeb("http://" + a31player.IPAddress + "/httpapi.asp?command=multiroom:SlaveKickout:" + clientMusic.IPAddress))
                                {
                                    if (null == SendMethod.OpenWeb("http://" + a31player.IPAddress + "/httpapi.asp?command=multiroom:SlaveKickout:" + clientMusic.IPAddress))
                                    {
                                    }
                                }
                                ///每解除一个播放器需要等待3秒
                                System.Threading.Thread.Sleep(3000);//等待3秒再发数据
                            }
                        }
                        else
                        {
                            //解散组的命令
                            if (null == SendMethod.OpenWeb("http://" + a31player.IPAddress + "/httpapi.asp?command=multiroom:Ungroup"))
                            {
                                if (null == SendMethod.OpenWeb("http://" + a31player.IPAddress + "/httpapi.asp?command=multiroom:Ungroup"))
                                {
                                }
                            }
                            System.Threading.Thread.Sleep(2000);//等待2秒再发数据
                        }
                        DateTime dateTime = DateTime.Now;
                        while ((DateTime.Now - dateTime).TotalMilliseconds < 10 * 1000)
                        while ((DateTime.Now - dateTime).TotalMilliseconds < 12 * 1000)
                        {
                            System.Threading.Thread.Sleep(1000);
                            try