From 24dce73df68f96c4e7ae4ef82658d5fc89f31e0b Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期一, 23 八月 2021 09:58:33 +0800
Subject: [PATCH] 1
---
HDL_ON/UI/UI2/FuntionControlView/Music/View/DialogView.cs | 356 ++++++++++++++++++++++++++++++++--------------------------
1 files changed, 197 insertions(+), 159 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/View/DialogView.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/View/DialogView.cs
index b136a9a..1c15666 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/View/DialogView.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/View/DialogView.cs
@@ -15,7 +15,7 @@
//涓绘帶浠�
Dialog dialog = new Dialog()
{
- BackgroundColor = Color.PopupBackgroundColor,
+ BackgroundColor = MusicColor.PopupBackgroundColor,
};
dialog.Show();
//鐖舵帶浠�
@@ -32,7 +32,7 @@
Y = Application.GetRealHeight(187),
Width = Application.GetRealWidth(344),
Height = Application.GetRealHeight(460),
- BackgroundColor = Color.WhiteColor,
+ BackgroundColor = MusicColor.WhiteColor,
Radius = (uint)Application.GetRealHeight(12),
};
frame.AddChidren(dialogFra);
@@ -52,7 +52,7 @@
Height = Application.GetRealHeight(20),
TextID = StringId.cancelMusic,
TextAlignment = TextAlignment.CenterLeft,
- TextColor = Color.MusicNoTxetColor,
+ TextColor = MusicColor.MusicNoTxetColor,
TextSize = TextSize.Text14,
};
topFra.AddChidren(cancelnBtn);
@@ -67,7 +67,7 @@
Y = Application.GetRealHeight(23),
Width = Application.GetRealWidth(152),
Height = Application.GetRealHeight(22),
- TextColor = Color.TextColor,
+ TextColor = MusicColor.TextColor,
TextSize = TextSize.Text16,
TextAlignment = TextAlignment.Center,
TextID = StringId.myList,
@@ -80,8 +80,8 @@
{
X = Application.GetRealWidth(304),
Y = Application.GetRealHeight(20),
- Width = Application.GetMinRealAverage(28),
- Height = Application.GetMinRealAverage(28),
+ Width = Application.GetRealWidth(28),
+ Height = Application.GetRealWidth(28),
UnSelectedImagePath = "MusicIcon/addMusic.png",
};
topFra.AddChidren(addIconBtn);
@@ -123,7 +123,7 @@
RowLayout addFlieRow = new RowLayout
{
Height = Application.GetRealHeight(78),
- LineColor = Color.WhiteColor,
+ LineColor = MusicColor.WhiteColor,
SubViewWidth = Application.GetRealWidth(80),//鏀瑰彉缂栬緫鎺т欢瀹藉害澶氬皯锛�
};
verticalScrolViewLayout.AddChidren(addFlieRow);
@@ -132,8 +132,8 @@
{
X = Application.GetRealWidth(12),
Y = Application.GetRealHeight(8),
- Width = Application.GetMinRealAverage(62),
- Height = Application.GetMinRealAverage(62),
+ Width = Application.GetRealWidth(62),
+ Height = Application.GetRealWidth(62),
UnSelectedImagePath = "MusicIcon/file.png",
};
addFlieRow.AddChidren(fileIconBtn);
@@ -145,7 +145,7 @@
Y = Application.GetRealHeight(29),
Width = Application.GetRealWidth(189),
Height = Application.GetRealHeight(20),
- TextColor = Color.TextColor,
+ TextColor = MusicColor.TextColor,
TextSize = TextSize.Text14,
TextAlignment = TextAlignment.CenterLeft,
Text = list.ListName,
@@ -155,9 +155,9 @@
///缂栬緫鎺т欢
var editBtn = new Button
{
- BackgroundColor = Color.MusicEditColor,
+ BackgroundColor = MusicColor.MusicEditColor,
Text = Language.StringByID(StringId.editMusic),
- TextColor = Color.WhiteColor,
+ TextColor = MusicColor.WhiteColor,
TextSize = TextSize.Text16,
};
addFlieRow.AddRightView(editBtn);
@@ -188,9 +188,9 @@
///鍒犻櫎鎺т欢
var delBtn = new Button
{
- BackgroundColor = Color.MusicDelColor,
+ BackgroundColor = MusicColor.MusicDelColor,
Text = Language.StringByID(StringId.delMusic),
- TextColor = Color.WhiteColor,
+ TextColor = MusicColor.WhiteColor,
TextSize = TextSize.Text16,
};
addFlieRow.AddRightView(delBtn);
@@ -216,6 +216,7 @@
string msg = Language.StringByID(StringId.addMusicList) + list.ListName;
new PublicAssmebly().TipMsgAutoClose(msg, false);
};
+ fileIconBtn.MouseUpEventHandler += click;
fileNameBtn.MouseUpEventHandler += click;
addFlieRow.MouseUpEventHandler += click;
}
@@ -225,7 +226,7 @@
/// <summary>
/// 閫変腑缁勫悎鐨勬挱鏀惧櫒鐨勭晫闈�
/// </summary>
- public void PlayMergence()
+ public void PlayMergence(A31MusicModel a31MusicModel)
{
#region
@@ -233,7 +234,7 @@
//涓绘帶浠�
Dialog dialog = new Dialog()
{
- BackgroundColor = Color.PopupBackgroundColor,
+ BackgroundColor = MusicColor.PopupBackgroundColor,
};
dialog.Show();
//鐖舵帶浠�
@@ -250,7 +251,7 @@
Y = Application.GetRealHeight(397),
Width = Application.GetRealWidth(344),
Height = Application.GetRealHeight(250),
- BackgroundColor = Color.WhiteColor,
+ BackgroundColor = MusicColor.WhiteColor,
Radius = (uint)Application.GetRealHeight(12),
};
frame.AddChidren(dialogFra);
@@ -270,7 +271,7 @@
Height = Application.GetRealHeight(20),
TextID = StringId.cancelMusic,
TextAlignment = TextAlignment.CenterLeft,
- TextColor = Color.MusicNoTxetColor,
+ TextColor = MusicColor.MusicNoTxetColor,
TextSize = TextSize.Text14,
};
topFra.AddChidren(cancelnBtn);
@@ -285,7 +286,7 @@
Y = Application.GetRealHeight(14),
Width = Application.GetRealWidth(152),
Height = Application.GetRealHeight(22),
- TextColor = Color.TextColor,
+ TextColor = MusicColor.TextColor,
TextSize = TextSize.Text16,
TextAlignment = TextAlignment.Center,
TextID = StringId.selectedMergence,
@@ -302,7 +303,7 @@
Height = Application.GetRealHeight(20),
TextID = StringId.confirmMusic,
TextAlignment = TextAlignment.CenterRight,
- TextColor = Color.SelectedColor,
+ TextColor = MusicColor.SelectedColor,
TextSize = TextSize.Text14,
};
topFra.AddChidren(confirmBtn);
@@ -326,7 +327,7 @@
RowLayout PlayRow = new RowLayout
{
Height = Application.GetRealHeight(50),
- LineColor = Color.WhiteColor,
+ LineColor = MusicColor.WhiteColor,
SubViewWidth = Application.GetRealWidth(80),//鏀瑰彉缂栬緫鎺т欢瀹藉害澶氬皯锛�
};
verticalScrolViewLayout.AddChidren(PlayRow);
@@ -339,7 +340,7 @@
Y = Application.GetRealHeight(15),
Width = Application.GetRealWidth(150),
Height = Application.GetRealHeight(20),
- TextColor = Color.TextColor,
+ TextColor = MusicColor.TextColor,
TextSize = TextSize.Text14,
TextAlignment = TextAlignment.CenterLeft,
Text = NamePlayer(player),
@@ -351,12 +352,13 @@
{
X = Application.GetRealWidth(303),
Y = Application.GetRealHeight(11),
- Width = Application.GetMinRealAverage(28),
- Height = Application.GetMinRealAverage(28),
+ Width = Application.GetRealWidth(28),
+ Height = Application.GetRealWidth(28),
UnSelectedImagePath = "MusicIcon/noSelectedIcon.png",
SelectedImagePath = "MusicIcon/selectedIcon.png",
};
PlayRow.AddChidren(selectedIconBtn);
+
///鍔犲ぇ鍑犵偣鑼冨洿
Button clickBtn = new Button
@@ -364,7 +366,11 @@
Height = Application.GetRealHeight(50),
};
PlayRow.AddChidren(clickBtn);
-
+ if (a31MusicModel.UniqueDeviceName == player.UniqueDeviceName)
+ {
+ clickBtn.IsSelected = selectedIconBtn.IsSelected = true;
+ playList1.Add(a31MusicModel);
+ }
clickBtn.MouseUpEventHandler += (sender, e) =>
{
clickBtn.IsSelected = !clickBtn.IsSelected;
@@ -392,7 +398,7 @@
X = Application.GetRealWidth(20),
Width = Application.GetRealWidth(304),
Height = 1,
- BackgroundColor = Color.LineColor,
+ BackgroundColor = MusicColor.LineColor,
};
PlayRow.AddChidren(lineBtn);
}
@@ -423,7 +429,6 @@
var host_Music_If = playList1.Find((c) => c.ServerClientType == 1);
if (host_Music_If == null)
{
-
var playList2 = new List<A31MusicModel>();
for (int i = 0; i < playList1.Count; i++)
{
@@ -432,7 +437,6 @@
{
playList2.Add(musics);
}
-
}
if (playList2.Count == 0)
@@ -486,7 +490,7 @@
Y = Application.GetRealHeight(397),
Width = Application.GetRealWidth(344),
Height = Application.GetRealHeight(250),
- BackgroundColor = Color.WhiteColor,
+ BackgroundColor = MusicColor.WhiteColor,
Radius = (uint)Application.GetRealHeight(12),
};
frame.AddChidren(dialogFra);
@@ -506,7 +510,7 @@
Height = Application.GetRealHeight(20),
TextID = StringId.cancelMusic,
TextAlignment = TextAlignment.CenterLeft,
- TextColor = Color.MusicNoTxetColor,
+ TextColor = MusicColor.MusicNoTxetColor,
TextSize = TextSize.Text14,
};
topFra.AddChidren(cancelnBtn);
@@ -521,7 +525,7 @@
Y = Application.GetRealHeight(14),
Width = Application.GetRealWidth(152),
Height = Application.GetRealHeight(22),
- TextColor = Color.TextColor,
+ TextColor = MusicColor.TextColor,
TextSize = TextSize.Text16,
TextAlignment = TextAlignment.Center,
TextID = StringId.readyPlay,
@@ -537,7 +541,7 @@
Height = Application.GetRealHeight(20),
TextID = StringId.confirmMusic,
TextAlignment = TextAlignment.CenterRight,
- TextColor = Color.SelectedColor,
+ TextColor = MusicColor.SelectedColor,
TextSize = TextSize.Text14,
};
topFra.AddChidren(confirmBtn);
@@ -557,7 +561,7 @@
RowLayout addFlieRow = new RowLayout
{
Height = Application.GetRealHeight(50),
- LineColor = Color.WhiteColor,
+ LineColor = MusicColor.WhiteColor,
};
verticalScrolViewLayout.AddChidren(addFlieRow);
@@ -569,7 +573,7 @@
Y = Application.GetRealHeight(15),
Width = Application.GetRealWidth(150),
Height = Application.GetRealHeight(20),
- TextColor = Color.TextColor,
+ TextColor = MusicColor.TextColor,
TextSize = TextSize.Text14,
TextAlignment = TextAlignment.CenterLeft,
Text = player.A31PlayStatus.Title,
@@ -577,32 +581,27 @@
addFlieRow.AddChidren(songNameBtn);
var wText = songNameBtn.GetTextWidth();//鑾峰彇鏂囨湰瀹藉害
- if (wText > 280)
+ if (wText >Application.GetRealWidth(220))
{
- songNameBtn.Width = Application.GetRealWidth(280);
+ songNameBtn.Width = Application.GetRealWidth(220);
}
else
{
- songNameBtn.Width = wText + 5;
+ songNameBtn.Width = wText + Application.GetRealWidth(15);
}
//姝屾墜鎺т欢
Button singerBtn = new Button
{
X = songNameBtn.Right,
Y = Application.GetRealHeight(15),
- Width = Application.GetRealWidth(280 - songNameBtn.Width),
+ Width = Application.GetRealWidth(220)- wText,
Height = Application.GetRealHeight(20),
- TextColor = Color.MusicNoTxetColor,
+ TextColor = MusicColor.MusicNoTxetColor,
TextSize = TextSize.Text12,
TextAlignment = TextAlignment.CenterLeft,
Text = "-" + player.A31PlayStatus.Artist.Trim(),
};
addFlieRow.AddChidren(singerBtn);
- if (wText > 280)
- {
- ///姝屽悕闀垮害灏忎簬250鎵嶅彲浠ユ樉绀烘瓕鎵嬪嚭鏉�
- singerBtn.Width = Application.GetRealWidth(0);
- }
}
else
{
@@ -613,7 +612,7 @@
Y = Application.GetRealHeight(15),
Width = Application.GetRealWidth(150),
Height = Application.GetRealHeight(20),
- TextColor = Color.TextColor,
+ TextColor = MusicColor.TextColor,
TextSize = TextSize.Text14,
TextAlignment = TextAlignment.CenterLeft,
Text = NamePlayer(player),
@@ -627,8 +626,8 @@
{
X = Application.GetRealWidth(303),
Y = Application.GetRealHeight(11),
- Width = Application.GetMinRealAverage(28),
- Height = Application.GetMinRealAverage(28),
+ Width = Application.GetRealWidth(28),
+ Height = Application.GetRealWidth(28),
UnSelectedImagePath = "MusicIcon/noSelectedIcon.png",
SelectedImagePath = "MusicIcon/selectedIcon.png",
Tag = player,
@@ -654,7 +653,7 @@
X = Application.GetRealWidth(20),
Width = Application.GetRealWidth(304),
Height = 1,
- BackgroundColor = Color.LineColor,
+ BackgroundColor = MusicColor.LineColor,
};
addFlieRow.AddChidren(lineBtn);
}
@@ -684,7 +683,7 @@
//涓绘帶浠�
Dialog dialog = new Dialog()
{
- BackgroundColor = Color.PopupBackgroundColor,
+ BackgroundColor = MusicColor.PopupBackgroundColor,
};
dialog.Show();
//鐖舵帶浠�
@@ -701,7 +700,7 @@
Y = Application.GetRealHeight(397),
Width = Application.GetRealWidth(344),
Height = Application.GetRealHeight(250),
- BackgroundColor = Color.WhiteColor,
+ BackgroundColor = MusicColor.WhiteColor,
Radius = (uint)Application.GetRealHeight(12),
};
frame.AddChidren(dialogFra);
@@ -721,7 +720,7 @@
Height = Application.GetRealHeight(20),
TextID = StringId.cancelMusic,
TextAlignment = TextAlignment.CenterLeft,
- TextColor = Color.MusicNoTxetColor,
+ TextColor = MusicColor.MusicNoTxetColor,
TextSize = TextSize.Text14,
};
topFra.AddChidren(cancelnBtn);
@@ -736,7 +735,7 @@
Y = Application.GetRealHeight(14),
Width = Application.GetRealWidth(152),
Height = Application.GetRealHeight(22),
- TextColor = Color.TextColor,
+ TextColor = MusicColor.TextColor,
TextSize = TextSize.Text16,
TextAlignment = TextAlignment.Center,
TextID = StringId.checkTheReleasePlayer,
@@ -754,7 +753,7 @@
Height = Application.GetRealHeight(20),
TextID = StringId.confirmMusic,
TextAlignment = TextAlignment.CenterRight,
- TextColor = Color.SelectedColor,
+ TextColor = MusicColor.SelectedColor,
TextSize = TextSize.Text14,
};
topFra.AddChidren(confirmBtn);
@@ -787,7 +786,7 @@
RowLayout PlayRow = new RowLayout
{
Height = Application.GetRealHeight(50),
- LineColor = Color.WhiteColor,
+ LineColor = MusicColor.WhiteColor,
SubViewWidth = Application.GetRealWidth(80),//鏀瑰彉缂栬緫鎺т欢瀹藉害澶氬皯锛�
};
verticalScrolViewLayout.AddChidren(PlayRow);
@@ -800,7 +799,7 @@
Y = Application.GetRealHeight(15),
Width = Application.GetRealWidth(150),
Height = Application.GetRealHeight(20),
- TextColor = Color.TextColor,
+ TextColor = MusicColor.TextColor,
TextSize = TextSize.Text14,
TextAlignment = TextAlignment.CenterLeft,
Text = NamePlayer(player),
@@ -813,8 +812,8 @@
{
X = Application.GetRealWidth(303),
Y = Application.GetRealHeight(11),
- Width = Application.GetMinRealAverage(28),
- Height = Application.GetMinRealAverage(28),
+ Width = Application.GetRealWidth(28),
+ Height = Application.GetRealWidth(28),
UnSelectedImagePath = "MusicIcon/noSelectedIcon.png",
SelectedImagePath = "MusicIcon/selectedIcon.png",
};
@@ -855,7 +854,7 @@
X = Application.GetRealWidth(20),
Width = Application.GetRealWidth(304),
Height = 1,
- BackgroundColor = Color.LineColor,
+ BackgroundColor = MusicColor.LineColor,
};
PlayRow.AddChidren(lineBtn);
}
@@ -878,6 +877,8 @@
/// <param name="musicList1"></param>
void MergeThreading(A31MusicModel serverMusic, List<A31MusicModel> musicList1)
{
+ A31MusicModel mainModel = null;
+ bool mainModelCollection = false;
MusicMain.loading.Start(Language.StringByID(StringId.inConfiguration));
bool _if = false;
System.Threading.Tasks.Task.Run(() =>
@@ -938,10 +939,14 @@
for (int j = 0; j < A31MusicModel.A31MusicModelList.Count; j++)
{
var music = A31MusicModel.A31MusicModelList[j];
+ if(music.collect && !mainModelCollection)
+ {
+ mainModelCollection = true;
+ }
if (music.UniqueDeviceName == serverMusic.UniqueDeviceName)
{
-
music.ServerClientType = 1;
+ mainModel = music;
music.Slave = tmepSlaves;
//杩囨护鎺変富鎾斁鍣�;
continue;
@@ -960,12 +965,17 @@
}
}
serverMusic.MainPlayName = str;
+ foreach(var music in A31MusicModel.A31MusicModelList)
+ {
+ if(music.ServerClientType == 1)
+ {
+ music.MainPlayCollection = mainModelCollection;
+ }
+ }
A31MusicModel.Save();
break;
}
}
-
-
}
catch { }
}
@@ -1050,7 +1060,6 @@
{
if (tmepSlaves.slave_list.Count == 0)
{
-
var host_music = A31MusicModel.A31MusicModelList.Find((c) => c.UniqueDeviceName == a31player.UniqueDeviceName);
if (host_music != null)
{
@@ -1082,7 +1091,6 @@
music.IsOnLine = false;//鍏堜笉鍏佽璇诲彇
}
}
-
}
var host_a31player = A31MusicModel.A31MusicModelList.Find((c) => c.UniqueDeviceName == a31player.UniqueDeviceName);
@@ -1123,7 +1131,9 @@
});
}
-
+ /// <summary>
+ /// 鎾斁鍣ㄥ悕绉�
+ /// </summary>
public string NamePlayer(A31MusicModel a31player)
{
if (a31player.ServerClientType == 1)
@@ -1140,12 +1150,26 @@
A31MusicModel currVolumePlay = null;//褰撳墠鐨勬挱鏀惧櫒
int startVolume = 0;//涔嬪墠鐨勯煶閲�
int endVolume = 0;//鐜板湪鐨勯煶閲�
+ string if_volume ="";//鏍囪鏄皟鑺傛�婚煶閲忚繕鏄崟涓挱鏀惧櫒闊抽噺;
/// <summary>
/// 鎾斁鍣ㄩ煶閲忕殑鐣岄潰
/// </summary>
/// <param name="a31player">涓绘挱鏀惧櫒</param>
public void PlayerVolumeView(A31MusicModel a31player)
{
+ volumePlayList.Clear();
+ 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)
+ {
+ music_If.ServerClientType = -1;
+ music_If.A31PlayStatus.vol = slave.volume;
+ volumePlayList.Add(music_If);
+ }
+ }
+ volumePlayList.Add(a31player);
#region
//涓绘帶浠�
Dialog volumedialog = new Dialog();
@@ -1153,32 +1177,18 @@
//鐖舵帶浠�
FrameLayout frame = new FrameLayout { };
volumedialog.AddChidren(frame);
- frame.MouseUpEventHandler += (sen, e) =>
- {
- volumedialog.Close();
- if (updateVolumeThread != null)
- {
- try
- {
- if (updateVolumeThread.IsAlive)
- {
- updateVolumeThread.Abort();
- }
- }
- catch { }
- }
- };
//鐧借壊蹇埗鎺т欢
FrameLayout dialogFra = new FrameLayout()
{
X = Application.GetRealWidth(16),
- Y = Application.GetRealHeight(397),
+ Y = Application.GetRealHeight(397-20),
Width = Application.GetRealWidth(344),
- Height = Application.GetRealHeight(250),
- BackgroundColor = Color.WhiteColor,
+ Height = Application.GetRealHeight(250+20),
+ BackgroundColor = MusicColor.WhiteColor,
Radius = (uint)Application.GetRealHeight(12),
};
frame.AddChidren(dialogFra);
+ #region 纭 鍙栨秷
//鏄剧ず澶撮儴淇℃伅鐖舵帶浠�
FrameLayout topFra = new FrameLayout()
{
@@ -1195,25 +1205,10 @@
Height = Application.GetRealHeight(20),
TextID = StringId.cancelMusic,
TextAlignment = TextAlignment.CenterLeft,
- TextColor = Color.MusicNoTxetColor,
+ TextColor = MusicColor.MusicNoTxetColor,
TextSize = TextSize.Text14,
};
topFra.AddChidren(cancelnBtn);
- cancelnBtn.MouseUpEventHandler += (sen, e) =>
- {
- volumedialog.Close();
- if (updateVolumeThread != null)
- {
- try
- {
- if (updateVolumeThread.IsAlive)
- {
- updateVolumeThread.Abort();
- }
- }
- catch { }
- }
- };
//鏍囬鎺т欢
Button txetBtn = new Button
{
@@ -1221,7 +1216,7 @@
Y = Application.GetRealHeight(14),
Width = Application.GetRealWidth(152),
Height = Application.GetRealHeight(22),
- TextColor = Color.TextColor,
+ TextColor = MusicColor.TextColor,
TextSize = TextSize.Text16,
TextAlignment = TextAlignment.Center,
TextID = StringId.volumeAdjustment,
@@ -1237,12 +1232,12 @@
Height = Application.GetRealHeight(20),
TextID = StringId.confirmMusic,
TextAlignment = TextAlignment.CenterRight,
- TextColor = Color.SelectedColor,
+ TextColor = MusicColor.SelectedColor,
TextSize = TextSize.Text14,
};
topFra.AddChidren(confirmBtn);
- confirmBtn.MouseUpEventHandler += (sen, e) =>
- {
+
+ EventHandler<MouseEventArgs> eventHandler= (sen,e) => {
volumedialog.Close();
if (updateVolumeThread != null)
{
@@ -1256,31 +1251,73 @@
catch { }
}
};
+ cancelnBtn.MouseUpEventHandler += eventHandler;
+ confirmBtn.MouseUpEventHandler += eventHandler;
+ frame.MouseUpEventHandler += eventHandler;
+ #endregion
+ #region 鎬婚煶閲忕殑View
+ FrameLayout totalVolumeFra = new FrameLayout
+ {
+ Height = Application.GetRealHeight(64),
+ Y = Application.GetRealHeight(58),
+ };
+ dialogFra.AddChidren(totalVolumeFra);
+ Button totalvolumeTextBtn = new Button
+ {
+ X = Application.GetRealWidth(28),
+ Y = Application.GetRealHeight(8),
+ Width = Application.GetRealWidth(200),
+ Height = Application.GetRealHeight(14),
+ TextColor = MusicColor.MusicNoTxetColor,
+ TextSize = TextSize.Text10,
+ TextAlignment = TextAlignment.CenterLeft,
+ Text = Language.StringByID(StringId.totalVolume),
+ };
+ totalVolumeFra.AddChidren(totalvolumeTextBtn);
+ DiyImageSeekBar totalVolSeekBar = new DiyImageSeekBar
+ {
+ Y = Application.GetRealHeight(12),
+ X = Application.GetRealWidth(28),
+ Width = Application.GetRealWidth(240),
+ Height = Application.GetRealHeight(54),//杩涘害鏉$埗鎺т欢鑳屾櫙楂樺害
+ IsProgressTextShow = false,//鏄剧ず鐧惧垎姣�
+ IsClickable = true,//杩涘害鏉℃槸鍚︽粦鍔�
+ ProgressBarColor = MusicColor.SelectedColor,//閫変腑杩涘害鏉¢鑹�
+ ThumbImagePath = "MusicIcon/progressIcon.png",//杩涘害鏉℃寜閽浘鏍�
+ ThumbImageHeight = Application.GetRealWidth(54),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級
+ SeekBarViewHeight = Application.GetRealWidth(8),//杩涘害鏉$殑楂樺害
+ Progress = int.Parse(a31player.A31PlayStatus.vol),
+ SeekBarPadding = Application.GetRealWidth(20),
+ //ProgressChangeDelayTime=
+ };
+ totalVolumeFra.AddChidren(totalVolSeekBar);
+
+ Button totalVolumeValueBtn = new Button
+ {
+ X = Application.GetRealWidth(289),
+ Y = Application.GetRealHeight(31),
+ Width = Application.GetRealWidth(26 + 15),
+ Height = Application.GetRealHeight(17),
+ TextColor = MusicColor.MusicNoTxetColor,
+ TextSize = TextSize.Text12,
+ TextAlignment = TextAlignment.CenterLeft,
+ Text = totalVolSeekBar.Progress.ToString() + "%",
+ };
+ totalVolumeFra.AddChidren(totalVolumeValueBtn);
+ #endregion
VerticalScrolViewLayout volumeViewLayout = new VerticalScrolViewLayout
{
- Y = Application.GetRealHeight(58),
- Height = dialogFra.Height - Application.GetRealHeight(58),
+ Y =Application.GetRealHeight(58+64),
+ Height = dialogFra.Height - Application.GetRealHeight(58+64),
Width = Application.GetRealWidth(343),
};
dialogFra.AddChidren(volumeViewLayout);
- volumePlayList.Clear();
- 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)
- {
- music_If.ServerClientType = -1;
- music_If.A31PlayStatus.vol = slave.volume;
- volumePlayList.Add(music_If);
- }
- }
- volumePlayList.Add(a31player);
for (int i = 0; i < volumePlayList.Count; i++)
{
var player = volumePlayList[i];
+ #region 璋冭妭褰撲釜鎾斁鍣╒iew
FrameLayout volumeFra = new FrameLayout
{
Height = Application.GetRealHeight(64),
@@ -1292,20 +1329,13 @@
Y = Application.GetRealHeight(8),
Width = Application.GetRealWidth(200),
Height = Application.GetRealHeight(14),
- TextColor = Color.MusicNoTxetColor,
+ TextColor = MusicColor.MusicNoTxetColor,
TextSize = TextSize.Text10,
TextAlignment = TextAlignment.CenterLeft,
+ Text = player.Name + Language.StringByID(StringId.volumeMusic),
};
volumeFra.AddChidren(volumeTextBtn);
- if (player.ServerClientType == -1)
- {
- volumeTextBtn.Text = player.Name + Language.StringByID(StringId.volumeMusic);
- }
- else if (player.ServerClientType == 1)
- {
- volumeTextBtn.Text = Language.StringByID(StringId.totalVolume);
- }
DiyImageSeekBar volSeekBar = new DiyImageSeekBar
{
@@ -1315,11 +1345,12 @@
Height = Application.GetRealHeight(54),//杩涘害鏉$埗鎺т欢鑳屾櫙楂樺害
IsProgressTextShow = false,//鏄剧ず鐧惧垎姣�
IsClickable = true,//杩涘害鏉℃槸鍚︽粦鍔�
- ProgressBarColor = Color.SelectedColor,//閫変腑杩涘害鏉¢鑹�
+ ProgressBarColor = MusicColor.SelectedColor,//閫変腑杩涘害鏉¢鑹�
ThumbImagePath = "MusicIcon/progressIcon.png",//杩涘害鏉℃寜閽浘鏍�
- ThumbImageHeight = Application.GetMinRealAverage(54),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級
- SeekBarViewHeight = Application.GetMinRealAverage(8),//杩涘害鏉$殑楂樺害
+ ThumbImageHeight = Application.GetRealWidth(54),//杩涘害鏉℃寜閽浘鏍囩殑楂樺害锛堥粯璁ゆ鏂瑰舰锛氬鍜岄珮涓�鏍凤級
+ SeekBarViewHeight = Application.GetRealWidth(8),//杩涘害鏉$殑楂樺害
Progress = int.Parse(player.A31PlayStatus.vol),
+ SeekBarPadding = Application.GetRealWidth(20),
//ProgressChangeDelayTime=
};
volumeFra.AddChidren(volSeekBar);
@@ -1328,47 +1359,47 @@
{
X = Application.GetRealWidth(289),
Y = Application.GetRealHeight(31),
- Width = Application.GetRealWidth(26),
+ Width = Application.GetRealWidth(26+15),
Height = Application.GetRealHeight(17),
- TextColor = Color.MusicNoTxetColor,
+ TextColor = MusicColor.MusicNoTxetColor,
TextSize = TextSize.Text12,
TextAlignment = TextAlignment.CenterLeft,
Text = player.A31PlayStatus.vol + "%",
};
volumeFra.AddChidren(valueBtn);
-
-
+ #endregion
///闊抽噺杩涘害鏉$偣鍑讳簨浠�
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);
- }
- else if (player.ServerClientType == 1)
- {
- for (int j = 0; j < volumePlayList.Count; 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);
- }
- }
+ if_volume = "Volume";
+ valueBtn.Text = volSeekBar.Progress + "%";
};
volSeekBar.OnProgressChangedEvent += progressClick;
volSeekBar.OnStopTrackingTouchEvent += progressClick;
}
+
+ EventHandler<int> totalProgressClick = (sender, e) =>
+ {
+ if_volume = "totalVolume";
+ endVolume = e;
+ totalVolumeValueBtn.Text = totalVolSeekBar.Progress + "%";
+ for (int j = 0; j < volumePlayList.Count; 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 = totalVolSeekBar.Progress;
+ button.Text = totalVolSeekBar.Progress + "%";
+ }
+ };
+ totalVolSeekBar.OnProgressChangedEvent += totalProgressClick;
+ totalVolSeekBar.OnStopTrackingTouchEvent += totalProgressClick;
#endregion
}
@@ -1394,24 +1425,31 @@
while (true)
{
System.Threading.Thread.Sleep(500);
- if (startVolume == endVolume || currVolumePlay == null)
+ if (startVolume == endVolume)
{
continue;
}
startVolume = endVolume;
-
- if (currVolumePlay.ServerClientType == -1)
- {
- SendMethod.ControlVolume(endVolume, currVolumePlay);
- }
- else if (currVolumePlay.ServerClientType == 1)
+ if (if_volume == "totalVolume")
{
for (int j = 0; j < volumePlayList.Count; j++)
{
var music = volumePlayList[j];
+ //姣忎釜500姣鍙戜粠鎾斁鍣ㄩ煶閲忓懡浠�
SendMethod.ControlVolume(endVolume, music);
+ System.Threading.Thread.Sleep(1000);
+
}
}
+ else if(if_volume == "Volume")
+ {
+ if (currVolumePlay == null)
+ {
+ continue;
+ }
+ SendMethod.ControlVolume(endVolume, currVolumePlay);
+ }
+
}
}
--
Gitblit v1.8.0