From a7d20263f28aa009ef8e064a7f9700d7cd642492 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期三, 10 六月 2020 10:06:47 +0800
Subject: [PATCH] 2020-06-10-1
---
HDL_ON/UI/Music/View/DialogView.cs | 165 ++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 126 insertions(+), 39 deletions(-)
diff --git a/HDL_ON/UI/Music/View/DialogView.cs b/HDL_ON/UI/Music/View/DialogView.cs
index ebc8951..b136a9a 100644
--- a/HDL_ON/UI/Music/View/DialogView.cs
+++ b/HDL_ON/UI/Music/View/DialogView.cs
@@ -402,7 +402,7 @@
if (playList1.Count <= 1)
{
- new PublicAssmebly().TipMsgAutoClose("鑷冲皯閫変腑涓や釜浠ヤ笂鎾斁鍣�", false);
+ new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.selectAtLeastTwoPlayers), false);
return;
}
int number = 0;
@@ -415,7 +415,7 @@
}
if (number >= 2)
{
- new PublicAssmebly().TipMsgAutoClose("涓嶈兘閫変腑涓や釜鎴栦袱涓互涓婁富鎾斁鍣ㄨ繘琛岀粍鍚�", false);
+ new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.cannotSelectTwoOrMoreMainPlayersToCombine), false);
//濡傛灉閮芥槸涓绘挱鏀炬垜灏变笉鑳界粍鍚�;
return;
}
@@ -663,7 +663,7 @@
{
if (selectedBtn.Name.ToString() == "No")
{
- new PublicAssmebly().TipMsgAutoClose("杩樻病閫変腑鎾斁鍣�", false);
+ new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.noSelectedPlay), false);
return;
}
dialogF.Close();
@@ -739,8 +739,8 @@
TextColor = Color.TextColor,
TextSize = TextSize.Text16,
TextAlignment = TextAlignment.Center,
- //TextID = StringId.selectedMergence,
- Text = "閫変腑瑙i櫎鎾斁鍣�",
+ TextID = StringId.checkTheReleasePlayer,
+ //Text = "閫変腑瑙i櫎鎾斁鍣�",
IsBold = true,
};
topFra.AddChidren(txetBtn);
@@ -864,7 +864,7 @@
{
if (playList1.Count == 0)
{
- new PublicAssmebly().TipMsgAutoClose("杩樻病鏈夐�夋嫨瑙i櫎缁勬挱鏀惧櫒", false);
+ new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.noCheckTheReleasePlayer), false);
return;
}
dialog.Close();
@@ -878,7 +878,7 @@
/// <param name="musicList1"></param>
void MergeThreading(A31MusicModel serverMusic, List<A31MusicModel> musicList1)
{
- MusicMain.loading.Start("閰嶇疆涓�...");
+ MusicMain.loading.Start(Language.StringByID(StringId.inConfiguration));
bool _if = false;
System.Threading.Tasks.Task.Run(() =>
{
@@ -998,7 +998,7 @@
/// <param name="playList1"></param>
void RemoveThreading(A31MusicModel a31player, List<A31MusicModel> playList1)
{
- MusicMain.loading.Start("瑙i櫎涓�...");
+ MusicMain.loading.Start(Language.StringByID(StringId.lifting));
var slaveList = new List<Slave>();
slaveList.AddRange(a31player.Slave.slave_list);
// bool host_If = false; //琛ㄧず鏄惁鏄剧ず瑙i櫎鐨勬挱鏀�
@@ -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
@@ -1200,8 +1224,7 @@
TextColor = Color.TextColor,
TextSize = TextSize.Text16,
TextAlignment = TextAlignment.Center,
- //TextID = StringId.readyPlay,
- Text="璋冭妭闊抽噺",
+ TextID = StringId.volumeAdjustment,
IsBold = true,
};
topFra.AddChidren(txetBtn);
@@ -1220,18 +1243,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 +1273,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,16 +1295,16 @@
TextColor = Color.MusicNoTxetColor,
TextSize = TextSize.Text10,
TextAlignment = TextAlignment.CenterLeft,
-
+
};
volumeFra.AddChidren(volumeTextBtn);
if (player.ServerClientType == -1)
{
- volumeTextBtn.Text = player.Name + "闊抽噺";
+ volumeTextBtn.Text = player.Name + Language.StringByID(StringId.volumeMusic);
}
else if (player.ServerClientType == 1)
{
- volumeTextBtn.Text = "鎬婚煶閲�";
+ volumeTextBtn.Text = Language.StringByID(StringId.totalVolume);
}
DiyImageSeekBar volSeekBar = new DiyImageSeekBar
@@ -1286,11 +1319,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 +1337,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 +1372,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