From a09b0a281e9038cb137a40aec37c868654704dec Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期二, 09 六月 2020 17:33:35 +0800 Subject: [PATCH] 2020-06-09-3 --- HDL_ON/UI/Music/MusicMain.cs | 20 +++++++++ HDL_ON/UI/Music/A31PlayMusicPage.cs | 67 ++++++++++++++++++++++++--------- HDL_ON/UI/Music/A31MusicModel.cs | 6 ++- .vs/HDL_APP_Project/xs/sqlite3/storage.ide | 0 .vs/HDL_APP_Project/xs/UserPrefs.xml | 19 ++++++--- HDL_ON/UI/Music/View/PlayView.cs | 1 .vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal | 0 7 files changed, 85 insertions(+), 28 deletions(-) diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml index b439be9..4255481 100644 --- a/.vs/HDL_APP_Project/xs/UserPrefs.xml +++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml @@ -1,12 +1,15 @@ 锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> - <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/Music/A31MusicSourcePage.cs"> + <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/Music/View/PlayView.cs"> <Files> - <File FileName="HDL_ON/UI/Music/View/DialogView.cs" Line="998" Column="45" /> - <File FileName="HDL_ON/UI/Music/MusicMain.cs" Line="133" Column="45" /> + <File FileName="HDL_ON/UI/Music/View/DialogView.cs" Line="988" Column="26" /> + <File FileName="HDL_ON/UI/Music/MusicMain.cs" Line="84" Column="17" /> <File FileName="HDL_ON/UI/Music/SendMethod.cs" Line="1" Column="1" /> - <File FileName="HDL_ON/UI/Music/A31PlayMusicPage.cs" Line="358" Column="15" /> <File FileName="HDL_ON/UI/Music/A31USBMusicList.cs" Line="217" Column="63" /> - <File FileName="HDL_ON/UI/Music/A31MusicSourcePage.cs" Line="17" Column="33" /> + <File FileName="HDL_ON/UI/Music/A31MusicSourcePage.cs" Line="163" Column="23" /> + <File FileName="HDL_ON/UI/Music/A31MusicModel.cs" Line="70" Column="33" /> + <File FileName="HDL_ON/UI/Music/View/MusicView.cs" Line="18" Column="19" /> + <File FileName="HDL_ON/UI/Music/A31PlayMusicPage.cs" Line="31" Column="48" /> + <File FileName="HDL_ON/UI/Music/View/PlayView.cs" Line="185" Column="51" /> </Files> <Pads> <Pad Id="ProjectPad"> @@ -15,11 +18,13 @@ <Node name="HDL_ON" expanded="True"> <Node name="UI" expanded="True"> <Node name="Music" expanded="True"> - <Node name="View" expanded="True" /> - <Node name="A31MusicSourcePage.cs" selected="True" /> + <Node name="View" expanded="True"> + <Node name="PlayView.cs" selected="True" /> + </Node> </Node> </Node> </Node> + <Node name="HDL-ON_Android" expanded="True" /> </Node> </State> </Pad> diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide index e4c7967..76cd244 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-wal b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal index fcbe081..62bc6d7 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/UI/Music/A31MusicModel.cs b/HDL_ON/UI/Music/A31MusicModel.cs index ec7df2c..7d510c8 100644 --- a/HDL_ON/UI/Music/A31MusicModel.cs +++ b/HDL_ON/UI/Music/A31MusicModel.cs @@ -64,8 +64,10 @@ /// </summary> public int Port = 49153; - - public bool IsEnd; + /// <summary> + /// 鏄惁鏄挱鏀惧櫒鍒楄〃鏈�鍚庝竴涓�(true) + /// </summary> + public bool IsEnd=false; public int A31DeviceType; diff --git a/HDL_ON/UI/Music/A31PlayMusicPage.cs b/HDL_ON/UI/Music/A31PlayMusicPage.cs index a44db92..4c7c132 100644 --- a/HDL_ON/UI/Music/A31PlayMusicPage.cs +++ b/HDL_ON/UI/Music/A31PlayMusicPage.cs @@ -26,15 +26,29 @@ } catch { } } - + if (VolumeThread != null) + { + try + { + if (VolumeThread.IsAlive) + { + VolumeThread.Abort(); + } + } + catch { } + } + } View.PlayView playView = new View.PlayView(); - + int startVolume = 0;//涔嬪墠鐨勯煶閲� + int endVolume = 0;//鐜板湪鐨勯煶閲� public void Show() { ///1绉掑畾鏃舵洿鏂扮姸鎬� timerUpdateStatus(); + ///0.5绉掔洃鍚煶閲忕姸鎬� + VolumeUpdateSend(); #region ---鐣岄潰甯冨眬--- this.BackgroundColor = Color.ViewColor; var topView = new TopView(); @@ -345,16 +359,18 @@ } }; ///闊抽噺杩涘害鏉$偣鍑讳簨浠� - int startVolume =0;//涔嬪墠鐨勯煶閲� + //int startVolume =0;//涔嬪墠鐨勯煶閲� + //int endVolume = 0; EventHandler<int> progressClick = (sender, e) => { playView.volValueBtn.Text = playView.volSeekBar.Progress + "%"; - if (startVolume != e) - { - startVolume = e; - SendMethod.ControlVolume(e, A31MusicModel.Current); - A31MusicModel.Current.A31PlayStatus.vol = e.ToString(); - } + endVolume = e; + //if (startVolume != e) + //{ + // startVolume = e; + // SendMethod.ControlVolume(e, A31MusicModel.Current); + // A31MusicModel.Current.A31PlayStatus.vol = e.ToString(); + //} }; playView.volSeekBar.OnProgressChangedEvent += progressClick; playView.volSeekBar.OnStopTrackingTouchEvent += progressClick; @@ -413,6 +429,28 @@ }; } + System.Threading.Thread VolumeThread; + /// <summary> + /// 闊抽噺鍙戦�� + /// </summary> + void VolumeUpdateSend() + { + VolumeThread = new System.Threading.Thread((obj) => + { + while (true) + { + if (startVolume != endVolume) + { + startVolume = endVolume; + SendMethod.ControlVolume(endVolume, A31MusicModel.Current); + A31MusicModel.Current.A31PlayStatus.vol = endVolume.ToString(); + } + System.Threading.Thread.Sleep(300); + } + }) + { IsBackground = true }; + VolumeThread.Start(); + } System.Threading.Thread timerThread; /// <summary> /// 瀹氭椂鏇存柊鐘舵�� @@ -423,13 +461,6 @@ { while (true) { - //if (startVolume != endVolume) - //{ - // startVolume = endVolume; - // SendMethod.ControlVolume(endVolume, A31MusicModel.Current); - // A31MusicModel.Current.A31PlayStatus.vol = endVolume.ToString(); - //} - Application.RunOnMainThread(() => { try @@ -521,8 +552,8 @@ //鏇存柊鎾斁鍣ㄩ煶閲忕粰绯荤粺闊抽噺 Volume.MusicVolume = playView.volSeekBar.Progress; //褰撳墠鎾斁闊充箰鏃堕棿 - int playSecond = int.Parse(A31MusicModel.Current.A31PlayStatus.curpos) / 1000+(int)(DateTime.Now - A31MusicModel.Current.LastDateTime).TotalSeconds; - + int playSecond = int.Parse(A31MusicModel.Current.A31PlayStatus.curpos) / 1000 + (int)(DateTime.Now - A31MusicModel.Current.LastDateTime).TotalSeconds; + int playMusicMinute = playSecond / 60; //绉掗挓 int playMusicSecond = playSecond % 60; diff --git a/HDL_ON/UI/Music/MusicMain.cs b/HDL_ON/UI/Music/MusicMain.cs index 5bf0f19..fd99774 100644 --- a/HDL_ON/UI/Music/MusicMain.cs +++ b/HDL_ON/UI/Music/MusicMain.cs @@ -93,6 +93,14 @@ { continue; } + if (A31MusicModel.A31MusicModelList.Count - 1 == i) + { + a31player.IsEnd = true; + } + else + { + a31player.IsEnd = false; + } ///鍔犺浇鐣岄潰鏃堕粯璁や笉鍦ㄧ嚎 ///杩欓噷鏍囪鏄负浜嗕笉璇诲彇涓嶅湪绾挎挱鏀惧櫒鐘舵�� a31player.IsOnLine = false; @@ -165,6 +173,14 @@ { continue; } + if (A31MusicModel.A31MusicModelList.Count - 1 == i) + { + a31player.IsEnd = true; + } + else + { + a31player.IsEnd = false; + } MusicListView(a31player); } @@ -204,7 +220,9 @@ musicView.songNameBtn.Text = a31player.A31PlayStatus.Title; musicView.musicNameBtn.Text = new View.DialogView { }.NamePlayer(a31player); musicView.regionBtn.TextID = StringId.region; - + if (a31player.IsEnd) { + musicView.muiscFl.Height =Application.GetRealHeight(12 + 139 + 12); + } EventHandler<MouseEventArgs> clickMergence = (sender, e) => { if (a31player.ServerClientType == 0) diff --git a/HDL_ON/UI/Music/View/PlayView.cs b/HDL_ON/UI/Music/View/PlayView.cs index f1f7e20..622037b 100644 --- a/HDL_ON/UI/Music/View/PlayView.cs +++ b/HDL_ON/UI/Music/View/PlayView.cs @@ -182,6 +182,7 @@ ThumbImagePath = "MusicIcon/progressIcon.png",//杩涘害鏉℃寜閽浘鏍� ThumbImageHeight = Application.GetMinRealAverage(54),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級 SeekBarViewHeight = Application.GetMinRealAverage(8),//杩涘害鏉$殑楂樺害 + //ProgressChangeDelayTime=1000,//涓�绉掑彂閫佷竴娆� }; /// <summary> -- Gitblit v1.8.0