From 3597e2aa1281f0e517c5ed8a9fe7e8f72030c744 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期一, 08 六月 2020 14:57:07 +0800 Subject: [PATCH] 2020-06-08-1 --- HDL_ON/UI/Music/A31USBMusicList.cs | 12 + HDL-ON_Android/Assets/Phone/.DS_Store | 0 HDL_ON/UI/Music/A31PlayMusicPage.cs | 81 ++++++++++-- HDL_ON/UI/Music/SendMethod.cs | 2 .vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm | 0 HDL_ON/UI/Music/A31LoveRadioList.cs | 12 + HDL_ON/UI/Music/A31LoveList.cs | 13 + HDL_ON/UI/Music/A31MyList.cs | 12 + HDL_ON/UI/Music/A31MyListMusic.cs | 12 + HDL_ON/UI/Music/A31LoveMusicList.cs | 12 + HDL_ON/UI/Music/A31LocalMusicList.cs | 12 + .DS_Store | 0 .vs/HDL_APP_Project/xs/sqlite3/storage.ide | 0 .vs/HDL_APP_Project/xs/UserPrefs.xml | 29 +--- HDL_ON/UI/Music/View/.DS_Store | 0 .vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal | 0 HDL_ON/UI/Music/View/DialogView.cs | 142 +++++++++++++++++++---- 17 files changed, 259 insertions(+), 80 deletions(-) diff --git a/.DS_Store b/.DS_Store index 7c8d1bc..7118bfb 100644 --- a/.DS_Store +++ b/.DS_Store Binary files differ diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml index 3ada873..fb8d022 100644 --- a/.vs/HDL_APP_Project/xs/UserPrefs.xml +++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml @@ -1,35 +1,22 @@ 锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> - <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/Music/View/DialogView.cs"> + <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/Music/A31PlayMusicPage.cs"> <Files> - <File FileName="HDL_ON/UI/Music/View/DialogView.cs" Line="1" Column="1" /> - <File FileName="HDL_ON/UI/Music/MusicMain.cs" Line="200" Column="42" /> - <File FileName="HDL_ON/UI/Music/SendMethod.cs" Line="150" Column="49" /> - <File FileName="HDL_ON/UI/Music/A31MusicModel.cs" Line="217" Column="29" /> - <File FileName="HDL_ON/UI/Music/A31PlayMusicPage.cs" Line="384" Column="19" /> - <File FileName="HDL_ON/UI/Music/View/MusicView.cs" Line="211" Column="12" /> + <File FileName="HDL_ON/UI/Music/View/DialogView.cs" Line="1141" Column="36" /> + <File FileName="HDL_ON/UI/Music/MusicMain.cs" Line="330" Column="22" /> + <File FileName="HDL_ON/UI/Music/SendMethod.cs" Line="291" Column="22" /> + <File FileName="HDL_ON/UI/Music/A31MusicModel.cs" Line="1" Column="1" /> + <File FileName="HDL_ON/UI/Music/A31PlayMusicPage.cs" Line="32" Column="5" /> </Files> <Pads> <Pad Id="ProjectPad"> <State name="__root__"> <Node name="HDL_APP_Project" expanded="True"> <Node name="HDL_ON" expanded="True"> - <Node name="Common" expanded="True" /> - <Node name="Entity" expanded="True" /> <Node name="UI" expanded="True"> <Node name="Music" expanded="True"> - <Node name="View" expanded="True"> - <Node name="Dialog_View.cs" selected="True" /> - </Node> + <Node name="View" expanded="True" /> + <Node name="A31PlayMusicPage.cs" selected="True" /> </Node> - <Node name="UI0-Public" expanded="True" /> - <Node name="UI2" expanded="True"> - <Node name="2-Classification" expanded="True" /> - </Node> - </Node> - </Node> - <Node name="HDL-ON_Android" expanded="True"> - <Node name="Assets" expanded="True"> - <Node name="Phone" expanded="True" /> </Node> </Node> </Node> diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide index 5d83525..868db9c 100644 --- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide +++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide Binary files differ diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm index 4076a34..5ca52fd 100644 --- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm +++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm Binary files differ diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal index 047f5a9..b2dd167 100644 --- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal +++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/.DS_Store b/HDL-ON_Android/Assets/Phone/.DS_Store index 489f345..fe4a572 100644 --- a/HDL-ON_Android/Assets/Phone/.DS_Store +++ b/HDL-ON_Android/Assets/Phone/.DS_Store Binary files differ diff --git a/HDL_ON/UI/Music/A31LocalMusicList.cs b/HDL_ON/UI/Music/A31LocalMusicList.cs index a999bc9..75c5ff6 100644 --- a/HDL_ON/UI/Music/A31LocalMusicList.cs +++ b/HDL_ON/UI/Music/A31LocalMusicList.cs @@ -23,9 +23,17 @@ topView.topNameBtn.TextID = StringId.localMusic; topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { - if (updateSelectedMusicThread != null || updateSelectedMusicThread.IsAlive) + if (updateSelectedMusicThread != null) { - updateSelectedMusicThread.Abort(); + try + { + if (updateSelectedMusicThread.IsAlive) + { + updateSelectedMusicThread.Abort(); + ///鍏抽棴绾跨▼ + } + } + catch { } } this.RemoveFromParent(); }; diff --git a/HDL_ON/UI/Music/A31LoveList.cs b/HDL_ON/UI/Music/A31LoveList.cs index 6dc4eb7..f20602e 100644 --- a/HDL_ON/UI/Music/A31LoveList.cs +++ b/HDL_ON/UI/Music/A31LoveList.cs @@ -21,9 +21,18 @@ topView.topNameBtn.TextID = StringId.myLove; topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { - if (updateSelectedMusicThread != null || updateSelectedMusicThread.IsAlive) + + if (updateSelectedMusicThread != null) { - updateSelectedMusicThread.Abort(); + try + { + if (updateSelectedMusicThread.IsAlive) + { + updateSelectedMusicThread.Abort(); + ///鍏抽棴绾跨▼ + } + } + catch { } } this.RemoveFromParent(); }; diff --git a/HDL_ON/UI/Music/A31LoveMusicList.cs b/HDL_ON/UI/Music/A31LoveMusicList.cs index 9f97cd0..af52c41 100644 --- a/HDL_ON/UI/Music/A31LoveMusicList.cs +++ b/HDL_ON/UI/Music/A31LoveMusicList.cs @@ -28,9 +28,17 @@ topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { - if (updateSelectedMusicThread != null || updateSelectedMusicThread.IsAlive) + if (updateSelectedMusicThread != null) { - updateSelectedMusicThread.Abort(); + try + { + if (updateSelectedMusicThread.IsAlive) + { + updateSelectedMusicThread.Abort(); + ///鍏抽棴绾跨▼ + } + } + catch { } } this.RemoveFromParent(); }; diff --git a/HDL_ON/UI/Music/A31LoveRadioList.cs b/HDL_ON/UI/Music/A31LoveRadioList.cs index 2b065d2..4bfffa5 100644 --- a/HDL_ON/UI/Music/A31LoveRadioList.cs +++ b/HDL_ON/UI/Music/A31LoveRadioList.cs @@ -27,9 +27,17 @@ topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { - if (updateSelectedMusicThread != null || updateSelectedMusicThread.IsAlive) + if (updateSelectedMusicThread != null) { - updateSelectedMusicThread.Abort(); + try + { + if (updateSelectedMusicThread.IsAlive) + { + updateSelectedMusicThread.Abort(); + ///鍏抽棴绾跨▼ + } + } + catch { } } this.RemoveFromParent(); }; diff --git a/HDL_ON/UI/Music/A31MyList.cs b/HDL_ON/UI/Music/A31MyList.cs index 92d8d3f..4cc95ef 100644 --- a/HDL_ON/UI/Music/A31MyList.cs +++ b/HDL_ON/UI/Music/A31MyList.cs @@ -20,9 +20,17 @@ topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { - if (updateSelectedMusicThread == null || updateSelectedMusicThread.IsAlive) + if (updateSelectedMusicThread != null) { - updateSelectedMusicThread.Abort(); + try + { + if (updateSelectedMusicThread.IsAlive) + { + updateSelectedMusicThread.Abort(); + ///鍏抽棴绾跨▼ + } + } + catch { } } this.RemoveFromParent(); }; diff --git a/HDL_ON/UI/Music/A31MyListMusic.cs b/HDL_ON/UI/Music/A31MyListMusic.cs index 37266dc..3f594f5 100644 --- a/HDL_ON/UI/Music/A31MyListMusic.cs +++ b/HDL_ON/UI/Music/A31MyListMusic.cs @@ -26,9 +26,17 @@ topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { - if (updateSelectedMusicThread != null || updateSelectedMusicThread.IsAlive) + if (updateSelectedMusicThread != null) { - updateSelectedMusicThread.Abort(); + try + { + if (updateSelectedMusicThread.IsAlive) + { + updateSelectedMusicThread.Abort(); + ///鍏抽棴绾跨▼ + } + } + catch { } } this.RemoveFromParent(); }; diff --git a/HDL_ON/UI/Music/A31PlayMusicPage.cs b/HDL_ON/UI/Music/A31PlayMusicPage.cs index 57cd533..7805a56 100644 --- a/HDL_ON/UI/Music/A31PlayMusicPage.cs +++ b/HDL_ON/UI/Music/A31PlayMusicPage.cs @@ -14,10 +14,23 @@ public override void RemoveFromParent() { base.RemoveFromParent(); - timerThread?.Abort(); Volume.VolumeChange = null; + if (timerThread != null) + { + try + { + if (timerThread.IsAlive) + { + timerThread.Abort(); + } + } + catch { } + } + } View.PlayView playView = new View.PlayView(); + + public void Show() { ///1绉掑畾鏃舵洿鏂扮姸鎬� @@ -104,11 +117,6 @@ } A31MusicModel.Save(); - - ////淇濆瓨 - //string saveRoomUIName = "A31_" + A31MusicModel.Current.IPAddress; - //Shared.IO.FileUtils.WriteFileByBytes(saveRoomUIName, - //Shared.SimpleControl.CommonPage.MyEncodingUTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(A31MusicModel.Current))); }; ///鍒囨崲鎾斁妯″紡鐐瑰嚮浜嬩欢; playView.playOrderBtn.MouseUpEventHandler += (sender, e) => @@ -234,11 +242,20 @@ ///绉婚櫎鐣岄潰 EventHandler<MouseEventArgs> removeFromParentView = (sen, e1) => { - if (updateSelectedMusicThread != null && updateSelectedMusicThread.IsAlive) + + if (updateSelectedMusicThread != null) { - updateSelectedMusicThread.Abort(); - ///鍏抽棴绾跨▼ + try + { + if (updateSelectedMusicThread.IsAlive) + { + updateSelectedMusicThread.Abort(); + ///鍏抽棴绾跨▼ + } + } + catch { } } + popFra.RemoveFromParent(); }; backIextBtn.MouseUpEventHandler += removeFromParentView; @@ -318,15 +335,25 @@ { if (A31MusicModel.Current.ServerClientType == 1 && A31MusicModel.Current.Slave.slave_list.Count != 0) { ///涓绘挱鏀惧櫒 - new View.DialogView { }.PlayerVolumeView(A31MusicModel.Current); + //new View.DialogView { }.PlayerVolumeView(A31MusicModel.Current); + + var volumeView = new View.DialogView { }; + volumeView.PlayerVolumeView(A31MusicModel.Current); + volumeView.UpdateVolume(); + } }; ///闊抽噺杩涘害鏉$偣鍑讳簨浠� + int startVolume =0;//涔嬪墠鐨勯煶閲� EventHandler<int> progressClick = (sender, e) => { playView.volValueBtn.Text = playView.volSeekBar.Progress + "%"; - SendMethod.ControlVolume(playView.volSeekBar.Progress, A31MusicModel.Current); - A31MusicModel.Current.A31PlayStatus.vol = playView.volSeekBar.Progress.ToString(); + if (startVolume != e) + { + startVolume = e; + SendMethod.ControlVolume(e, A31MusicModel.Current); + A31MusicModel.Current.A31PlayStatus.vol = e.ToString(); + } }; playView.volSeekBar.OnProgressChangedEvent += progressClick; playView.volSeekBar.OnStopTrackingTouchEvent += progressClick; @@ -374,8 +401,14 @@ return; } playView.volSeekBar.Progress = volume; - SendMethod.ControlVolume(playView.volSeekBar.Progress, A31MusicModel.Current); - A31MusicModel.Current.A31PlayStatus.vol = playView.volSeekBar.Progress.ToString(); + + if (startVolume != volume) + { + startVolume = volume; + SendMethod.ControlVolume(volume, A31MusicModel.Current); + A31MusicModel.Current.A31PlayStatus.vol = volume.ToString(); + } + }; } @@ -389,6 +422,13 @@ { while (true) { + //if (startVolume != endVolume) + //{ + // startVolume = endVolume; + // SendMethod.ControlVolume(endVolume, A31MusicModel.Current); + // A31MusicModel.Current.A31PlayStatus.vol = endVolume.ToString(); + //} + Application.RunOnMainThread(() => { try @@ -771,10 +811,17 @@ ///鐐瑰嚮鎾斁浜嬩欢 clickBtn.MouseUpEventHandler += (sender, e) => { - if (updateSelectedMusicThread != null && updateSelectedMusicThread.IsAlive) + if (updateSelectedMusicThread != null) { - updateSelectedMusicThread.Abort(); - ///鍏抽棴绾跨▼ + try + { + if (updateSelectedMusicThread.IsAlive) + { + updateSelectedMusicThread.Abort(); + ///鍏抽棴绾跨▼ + } + } + catch { } } System.Threading.Tasks.Task.Run(() => { diff --git a/HDL_ON/UI/Music/A31USBMusicList.cs b/HDL_ON/UI/Music/A31USBMusicList.cs index 45926e2..afca128 100644 --- a/HDL_ON/UI/Music/A31USBMusicList.cs +++ b/HDL_ON/UI/Music/A31USBMusicList.cs @@ -25,9 +25,17 @@ topView.clickBackBtn.MouseUpEventHandler += (sender, e) => { - if (updateSelectedMusicThread != null || updateSelectedMusicThread.IsAlive) + if (updateSelectedMusicThread != null) { - updateSelectedMusicThread.Abort(); + try + { + if (updateSelectedMusicThread.IsAlive) + { + updateSelectedMusicThread.Abort(); + ///鍏抽棴绾跨▼ + } + } + catch { } } this.RemoveFromParent(); }; diff --git a/HDL_ON/UI/Music/SendMethod.cs b/HDL_ON/UI/Music/SendMethod.cs index a6ae4bb..60ec371 100644 --- a/HDL_ON/UI/Music/SendMethod.cs +++ b/HDL_ON/UI/Music/SendMethod.cs @@ -171,7 +171,7 @@ webClient.Headers.Add("CONTENT-TYPE", "text/xml; charset=\"utf-8\""); var recevieBytes = webClient.UploadData(new Uri("http://" + a31MusicModel.IPAddress + ":" + a31MusicModel.Port + "/upnp/control/rendertransport1"), "POST", System.Text.Encoding.UTF8.GetBytes("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"><s:Body><u:GetInfoEx xmlns:u=\"urn:schemas-upnp-org:service:AVTransport:1\"><InstanceID>0</InstanceID></u:GetInfoEx></s:Body></s:Envelope>")); - a31MusicModel.LastDateTime = DateTime.Now; + a31MusicModel.LastDateTime = DateTime.Now;//璁板綍鏁版嵁鍙嶉鐨勬椂闂�(鍥犱负鏈夋椂闂寸綉缁滃樊鏁版嵁涓嶅洖澶嶏紝瀵艰嚧褰撳墠鎾斁闊充箰鏃堕棿鏄剧ず涓嶆纭�) var se = System.Security.SecurityElement.FromString(System.Text.Encoding.UTF8.GetString(recevieBytes)).SearchForChildByTag("s:Body").SearchForChildByTag("u:GetInfoExResponse"); diff --git a/HDL_ON/UI/Music/View/.DS_Store b/HDL_ON/UI/Music/View/.DS_Store new file mode 100644 index 0000000..5008ddf --- /dev/null +++ b/HDL_ON/UI/Music/View/.DS_Store Binary files differ diff --git a/HDL_ON/UI/Music/View/DialogView.cs b/HDL_ON/UI/Music/View/DialogView.cs index ebc8951..e6bc935 100644 --- a/HDL_ON/UI/Music/View/DialogView.cs +++ b/HDL_ON/UI/Music/View/DialogView.cs @@ -1135,25 +1135,38 @@ return a31player.Name; } } + + List<A31MusicModel> volumePlayList = new List<A31MusicModel>(); + A31MusicModel currVolumePlay = null;//褰撳墠鐨勬挱鏀惧櫒 + int startVolume = 0;//涔嬪墠鐨勯煶閲� + int endVolume = 0;//鐜板湪鐨勯煶閲� /// <summary> /// 鎾斁鍣ㄩ煶閲忕殑鐣岄潰 /// </summary> /// <param name="a31player">涓绘挱鏀惧櫒</param> - public void PlayerVolumeView(A31MusicModel a31player) + public void PlayerVolumeView(A31MusicModel a31player) { #region //涓绘帶浠� - Dialog dialog = new Dialog() - { - //BackgroundColor = Color.PopupBackgroundColor, - }; - dialog.Show(); + Dialog volumedialog = new Dialog(); + volumedialog.Show(); //鐖舵帶浠� FrameLayout frame = new FrameLayout { }; - dialog.AddChidren(frame); + volumedialog.AddChidren(frame); frame.MouseUpEventHandler += (sen, e) => { - dialog.Close(); + volumedialog.Close(); + if (updateVolumeThread != null) + { + try + { + if (updateVolumeThread.IsAlive) + { + updateVolumeThread.Abort(); + } + } + catch { } + } }; //鐧借壊蹇埗鎺т欢 FrameLayout dialogFra = new FrameLayout() @@ -1188,7 +1201,18 @@ topFra.AddChidren(cancelnBtn); cancelnBtn.MouseUpEventHandler += (sen, e) => { - dialog.Close(); + volumedialog.Close(); + if (updateVolumeThread != null) + { + try + { + if (updateVolumeThread.IsAlive) + { + updateVolumeThread.Abort(); + } + } + catch { } + } }; //鏍囬鎺т欢 Button txetBtn = new Button @@ -1220,18 +1244,28 @@ topFra.AddChidren(confirmBtn); confirmBtn.MouseUpEventHandler += (sen, e) => { - dialog.Close(); + volumedialog.Close(); + if (updateVolumeThread != null) + { + try + { + if (updateVolumeThread.IsAlive) + { + updateVolumeThread.Abort(); + } + } + catch { } + } }; - VerticalScrolViewLayout verticalScrolViewLayout = new VerticalScrolViewLayout + VerticalScrolViewLayout volumeViewLayout = new VerticalScrolViewLayout { Y = Application.GetRealHeight(58), Height = dialogFra.Height - Application.GetRealHeight(58), Width = Application.GetRealWidth(343), }; - dialogFra.AddChidren(verticalScrolViewLayout); - - var playList = new List<A31MusicModel>(); + dialogFra.AddChidren(volumeViewLayout); + volumePlayList.Clear(); for (int i = 0; i < a31player.Slave.slave_list.Count; i++) { var slave = a31player.Slave.slave_list[i]; @@ -1240,19 +1274,19 @@ { music_If.ServerClientType = -1; music_If.A31PlayStatus.vol = slave.volume; - playList.Add(music_If); + volumePlayList.Add(music_If); } } - playList.Add(a31player); + volumePlayList.Add(a31player); - for (int i = 0; i < playList.Count; i++) + for (int i = 0; i < volumePlayList.Count; i++) { - var player = playList[i]; + var player = volumePlayList[i]; FrameLayout volumeFra = new FrameLayout { Height = Application.GetRealHeight(64), }; - verticalScrolViewLayout.AddChidren(volumeFra); + volumeViewLayout.AddChidren(volumeFra); Button volumeTextBtn = new Button { X = Application.GetRealWidth(28), @@ -1262,7 +1296,7 @@ TextColor = Color.MusicNoTxetColor, TextSize = TextSize.Text10, TextAlignment = TextAlignment.CenterLeft, - + }; volumeFra.AddChidren(volumeTextBtn); if (player.ServerClientType == -1) @@ -1286,11 +1320,11 @@ ThumbImagePath = "MusicIcon/progressIcon.png",//杩涘害鏉℃寜閽浘鏍� ThumbImageHeight = Application.GetMinRealAverage(54),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級 SeekBarViewHeight = Application.GetMinRealAverage(8),//杩涘害鏉$殑楂樺害 - Progress=int.Parse(player.A31PlayStatus.vol), + Progress = int.Parse(player.A31PlayStatus.vol), //ProgressChangeDelayTime= }; volumeFra.AddChidren(volSeekBar); - + Button valueBtn = new Button { X = Application.GetRealWidth(289), @@ -1304,25 +1338,32 @@ }; volumeFra.AddChidren(valueBtn); + ///闊抽噺杩涘害鏉$偣鍑讳簨浠� EventHandler<int> progressClick = (sender, e) => { + + if (currVolumePlay == null || (currVolumePlay != null && currVolumePlay.UniqueDeviceName != player.UniqueDeviceName)) + { + currVolumePlay = player; + } + endVolume = e; if (player.ServerClientType == -1) { valueBtn.Text = volSeekBar.Progress + "%"; - SendMethod.ControlVolume(volSeekBar.Progress, player); + //SendMethod.ControlVolume(volSeekBar.Progress, player); } else if (player.ServerClientType == 1) { - for (int j = 0; j < playList.Count; j++) + for (int j = 0; j < volumePlayList.Count; j++) { - var music = playList[j]; - var frameLayout = (FrameLayout)verticalScrolViewLayout.GetChildren(j); + var music = volumePlayList[j]; + var frameLayout = (FrameLayout)volumeViewLayout.GetChildren(j); var diyImageSeekBar = (DiyImageSeekBar)frameLayout.GetChildren(1); var button = (Button)frameLayout.GetChildren(2); diyImageSeekBar.Progress = volSeekBar.Progress; button.Text = volSeekBar.Progress + "%"; - SendMethod.ControlVolume(volSeekBar.Progress, music); + //SendMethod.ControlVolume(volSeekBar.Progress, music); } } }; @@ -1332,7 +1373,54 @@ #endregion } + /// <summary> + /// 瀹氭椂闊抽噺骞朵笖鍙戦�佸懡浠� + /// </summary> + System.Threading.Thread updateVolumeThread; + public void UpdateVolume() + { + if (updateVolumeThread != null) { + try + { + if (updateVolumeThread.IsAlive) { + updateVolumeThread.Abort(); + } + } + catch { } + } + updateVolumeThread = new System.Threading.Thread(() => + { + try + { + while (true) + { + System.Threading.Thread.Sleep(500); + if (startVolume == endVolume || currVolumePlay == null) + { + continue; + } + startVolume = endVolume; + if (currVolumePlay.ServerClientType == -1) + { + SendMethod.ControlVolume(endVolume, currVolumePlay); + } + else if (currVolumePlay.ServerClientType == 1) + { + for (int j = 0; j < volumePlayList.Count; j++) + { + var music = volumePlayList[j]; + SendMethod.ControlVolume(endVolume, music); + } + } + + } + } + catch { } + }) + { IsBackground = true }; + updateVolumeThread.Start(); + } } [System.Serializable] -- Gitblit v1.8.0