From b562a582ac3a288193e6e4f57c5eff8a344305a4 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期五, 27 九月 2024 13:52:17 +0800
Subject: [PATCH] Update AndroidManifest.xml
---
HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs | 58 +++++++++++++++++++++++++++++++++++-----------------------
1 files changed, 35 insertions(+), 23 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
index 494f967..e41d821 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Music/MusicMain.cs
@@ -10,16 +10,16 @@
{
public class MusicMain : FrameLayout
{
- private static MusicMain m_MusicMain = null;
- public static MusicMain mMusicMain
+ private static MusicMain s_Current = null;
+ public static MusicMain Current
{
get
{
- if (m_MusicMain == null)
+ if (s_Current == null)
{
- m_MusicMain = new MusicMain();
+ s_Current = new MusicMain();
}
- return m_MusicMain;
+ return s_Current;
}
}
@@ -36,7 +36,7 @@
public override void RemoveFromParent()
{
base.RemoveFromParent();
- clearA31Threads();
+ ClearA31Threads();
//杩涙潵娌℃湁闊充箰琚敹钘忚繃锛岄��鍑烘湁闊充箰琚敹钘忚繃
//A31MusicModel.ReadMusicStates();
}
@@ -47,7 +47,7 @@
/// <summary>
/// 绉婚櫎绾跨▼
/// </summary>
- static void clearA31Threads()
+ static void ClearA31Threads()
{
var threads = threadLists.FindAll((obj) => { return obj.Name == "A31"; });
@@ -79,6 +79,7 @@
public void Show()
{
+
#region 鐣岄潰甯冨眬
this.BackgroundColor = MusicColor.ViewColor;
var topView = new TopView();
@@ -119,13 +120,13 @@
{
verticalRefresh.RemoveAll();
A31MusicModel.A31MusicModelList.Clear();
- var musicListFunction = FunctionList.List.GetMusicList();
- for (int i = 0; i < musicListFunction.Count; i++)
+ var musicDeviceList= FunctionList.List.GetMusicList();
+ for (int i = 0; i < musicDeviceList.Count; i++)
{
- var function = musicListFunction[i];
+ var function = musicDeviceList[i];
var music = A31MusicModel.A31MusicModelList.Find((obj) =>
- (obj.functionMusic.deviceId == function.deviceId && function.spk == "music.standard") || (
- obj.functionMusic.deviceId == function.deviceId && function.spk == "av.music")
+ (obj.functionMusic.deviceId == function.deviceId && function.spk == SPK.MusicStandard) || (
+ obj.functionMusic.deviceId == function.deviceId && function.spk == SPK.AvMusic)
);
if (music == null)
{
@@ -141,7 +142,7 @@
{
var a31player = A31MusicModel.A31MusicModelList[i];
- //if (a31player.functionMusic.online == false)
+ //if (a31player.functionMusic.isOnline() == false)
//{
// //涓嶅湪绾夸笉鏄剧ず
// continue;
@@ -149,7 +150,14 @@
Application.RunOnMainThread(() =>
{
- MusicListView(a31player);
+ try
+ {
+ MusicListView(a31player);
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log("Error", $"MusicListView 鏂规硶寮傚父锛歿ex.StackTrace}");
+ }
});
}
///杩涙潵璇讳竴娆¢煶涔愭挱鏀惧櫒鐘舵��
@@ -157,7 +165,7 @@
{
var a31player = A31MusicModel.A31MusicModelList[i];
- if (a31player.functionMusic.online == false)
+ if (a31player.functionMusic.isOnline() == false)
{
//涓嶅湪绾夸笉璇诲彇
continue;
@@ -167,7 +175,8 @@
{
try
{
- SendMethod.mMethod.RefreshDeviceStatus(new List<string> { a31player.functionMusic.deviceId });
+
+ SendMethod.Current.RefreshDeviceStatus(new List<string> { a31player.functionMusic.deviceId });
System.Threading.Thread.Sleep(500);
}
catch { }
@@ -192,7 +201,7 @@
musicView.singerBtn.Text = player.functionMusic.GetAttrState(KeyProperty.song_name);
musicView.songNameBtn.Text = player.functionMusic.GetAttrState(KeyProperty.song_name);
musicView.musicNameBtn.Text = player.functionMusic.name;
- musicView.collectIconBtn.Visible = false;//鍏堟殏鏃堕殣钘忔敹钘忓姛鑳�
+ //musicView.collectIconBtn.Visible = false;//鍏堟殏鏃堕殣钘忔敹钘忓姛鑳�
///鏀惰棌浜嬩欢
musicView.collectIconBtn.MouseUpEventHandler += (sender, e) =>
{
@@ -205,6 +214,7 @@
{
player.functionMusic.collect = false;
}
+ player.functionMusic.CollectFunction();
};
@@ -232,7 +242,7 @@
player.functionMusic.SetAttrState(KeyProperty.song_step, ValueProperty.up);
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add(KeyProperty.song_step, ValueProperty.up);
- SendMethod.mMethod.SendControlCommand(player.functionMusic, dic);
+ SendMethod.Current.SendControlCommand(player.functionMusic, dic);
};
musicView.prevBtn.MouseUpEventHandler += (sender, e) =>
{
@@ -245,7 +255,7 @@
if (musicView.playBtn.IsSelected)
{
musicView.playBtn.IsSelected = false;
- status = ValueProperty.pause;
+ status = ValueProperty.off;
}
else
{
@@ -255,7 +265,7 @@
player.functionMusic.SetAttrState(KeyProperty.on_off, status);
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add(KeyProperty.on_off, status);
- SendMethod.mMethod.SendControlCommand(player.functionMusic, dic);
+ SendMethod.Current.SendControlCommand(player.functionMusic, dic);
};
///涓嬩竴鏇茬偣鍑讳簨浠�
musicView.nextBtn.MouseDownEventHandler += (sender, e) =>
@@ -264,7 +274,7 @@
player.functionMusic.SetAttrState(KeyProperty.song_step, ValueProperty.down);
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add(KeyProperty.song_step, ValueProperty.down);
- SendMethod.mMethod.SendControlCommand(player.functionMusic, dic);
+ SendMethod.Current.SendControlCommand(player.functionMusic, dic);
};
musicView.nextBtn.MouseUpEventHandler += (sender, e) =>
{
@@ -275,13 +285,13 @@
{
while (true)
{
- if (!player.functionMusic.online)
+ if (!player.functionMusic.isOnline())
{
///涓嶅湪绾夸笉璇荤姸鎬�
continue;
}
//SendMethod.ReadStatus(player);
- SendMethod.mMethod.GetDeviceStatus(ref player, new List<string> { player.functionMusic.deviceId }, player.functionMusic.sid);
+ SendMethod.Current.GetDeviceStatus(ref player, new List<string> { player.functionMusic.deviceId }, player.functionMusic.sid);
System.Threading.Thread.Sleep(1000);
Application.RunOnMainThread(() =>
{
@@ -428,6 +438,8 @@
catch { }
});
}
+
+
}
}
--
Gitblit v1.8.0