2023年02月03日17:56:24
音乐增加usb功能
| | |
| | | // return; |
| | | // } |
| | | //} |
| | | //MainPage.Log($"A协议更新状态:{revString}"); |
| | | MainPage.Log($"音乐收到数据:{revString}"); |
| | | foreach (var attr in updateTemp.status) |
| | | { |
| | | localFunction.time_stamp = temp.time_stamp; |
| | | localFunction.SetAttrState(attr.key, attr.value); |
| | | //Console.WriteLine("音乐播放器添加缓存数据=======" + revString); |
| | | Console.WriteLine("音乐播放器添加缓存数据=======" + revString); |
| | | |
| | | } |
| | | |
| | |
| | | case SPK.AvMusic: |
| | | case SPK.MusicStandard: |
| | | //UI.Music.MusicMain.mMusicMain.RefreshView(updateTemp); |
| | | //Console.WriteLine("音乐播放器显示状态======="+ revString); |
| | | Console.WriteLine("音乐播放器显示状态======="+ revString); |
| | | //wjc |
| | | break; |
| | | case SPK.Inverter: |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\View\MusicSourceView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\View\SongView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\View\MyListView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\A31MusicFileList.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\A31SongPlay.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\MusicProperty.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AboutOn\SupportHomeKitNotesPage.cs" />
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\ChooseIocate.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\LogicView\ColorTemperature.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\MechanicalArmPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\A31UsbMusicList.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\CommonMethod.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\A31FlieList.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
|
| | |
| | | { |
| | | //HDL_ON.DriverLayer.Control.Ins.GetMusicDirectory(device); |
| | | //var palyListName = Music.SendMethod.mMethod.GetListName(device); |
| | | var palyList= Music.SendMethod.Current.GetListMusic(device, "hdl_special"); |
| | | List<string> musicNameList = new List<string>(); |
| | | var palyList= Music.SendMethod.Current.GetSingleSongList(device, "hdl_special",""); |
| | | List<string> songNameList = new List<string>(); |
| | | for (int i = 0; i < palyList.songs.Count; i++) |
| | | { |
| | | var music = palyList.songs[i]; |
| | | musicNameList.Add(music.name); |
| | | var song = palyList.songs[i]; |
| | | songNameList.Add(song.name); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | PublicInterface publicInterface = new PublicInterface(); |
| | | publicInterface.FrameOrVv(this, musicNameList, new List<string> { funTypeView.btnState.Text }, palyList.group, (index2) => |
| | | publicInterface.FrameOrVv(this, songNameList, new List<string> { funTypeView.btnState.Text }, palyList.group, (index2) => |
| | | { |
| | | var musicSelecetd = palyList.songs[index2]; |
| | | var songSelecetd = palyList.songs[index2]; |
| | | //界面显示选中值 |
| | | funTypeView.btnState.Text = musicSelecetd.name; |
| | | funTypeView.btnState.Text = songSelecetd.name; |
| | | //数据封装 |
| | | AddDictionary("playlist_name", palyList.group);//列表名 |
| | | AddDictionary("song_name", musicSelecetd.name);//歌曲名 |
| | | AddDictionary("song_name", songSelecetd.name);//歌曲名 |
| | | if (!string.IsNullOrEmpty(songSelecetd.url)) |
| | | { |
| | | //存在url就一起发送过去 |
| | | AddDictionary("url", songSelecetd.url); |
| | | } |
| | | |
| | | },false); |
| | | |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.UI.UI2.FuntionControlView.Music; |
| | | using Shared; |
| | | namespace HDL_ON.UI.Music |
| | | { |
| | | public class A31FlieList : FrameLayout |
| | | { |
| | | |
| | | public A31FlieList(string source,string title) |
| | | { |
| | | Tag = "Music"; |
| | | this.source = source; |
| | | this.title = title; |
| | | } |
| | | /// <summary> |
| | | /// 音乐源 |
| | | /// </summary> |
| | | private string source = string.Empty; |
| | | /// <summary> |
| | | /// 标题 |
| | | /// </summary> |
| | | private string title = string.Empty; |
| | | |
| | | VerticalRefreshLayout middViewLayout; |
| | | public void Show() |
| | | { |
| | | #region 界面布局------ |
| | | |
| | | this.BackgroundColor = MusicColor.ViewColor; |
| | | var topView = new TopView(); |
| | | this.AddChidren(topView.TopFLayoutView()); |
| | | topView.topNameBtn.Text=this.title; |
| | | topView.clickBackBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | this.RemoveFromParent(); |
| | | }; |
| | | middViewLayout = new VerticalRefreshLayout |
| | | { |
| | | BackgroundColor = MusicColor.WhiteColor, |
| | | Y = topView.fLayout.Bottom, |
| | | Height = Application.GetRealHeight(H_W.H - H_W.T_Height), |
| | | }; |
| | | this.AddChidren(middViewLayout); |
| | | #endregion |
| | | |
| | | middViewLayout.BeginHeaderRefreshingAction += () => |
| | | { |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | var Group = SendMethod.Current.GetSingleSourceListNameList(A31MusicModel.Current.functionMusic, this.source); |
| | | CommonMethod.Current.AddSourceGroupListMemory(Group);//保存缓存 |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var listNameList = CommonMethod.Current.GetListNameListMemory(this.source); |
| | | this.FileListView(listNameList); |
| | | middViewLayout.EndHeaderRefreshing(); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | }; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 加载列表 |
| | | /// </summary> |
| | | /// <param name="listNames">列表名列表</param> |
| | | public void FileListView(List<ListName> listNames) |
| | | { |
| | | middViewLayout.RemoveAll(); |
| | | for (int i = 0; i < listNames.Count; i++) |
| | | { |
| | | var listName= listNames[i]; |
| | | RowLayout addFlieRow = new RowLayout |
| | | { |
| | | Height = Application.GetRealHeight(104), |
| | | LineColor = MusicColor.WhiteColor, |
| | | SubViewWidth = Application.GetRealWidth(90),//改变编辑控件宽度多少; |
| | | }; |
| | | middViewLayout.AddChidren(addFlieRow); |
| | | //文件图标 |
| | | Button fileIconBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(8), |
| | | Width = Application.GetRealWidth(88), |
| | | Height = Application.GetRealWidth(88), |
| | | UnSelectedImagePath = "MusicIcon/fileList.png", |
| | | }; |
| | | addFlieRow.AddChidren(fileIconBtn); |
| | | |
| | | //文件名控件 |
| | | Button fileNameBtn = new Button |
| | | { |
| | | X = fileIconBtn.Right + Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(42), |
| | | Width = Application.GetRealWidth(217), |
| | | Height = Application.GetRealHeight(20), |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text14, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = listName.group, |
| | | }; |
| | | addFlieRow.AddChidren(fileNameBtn); |
| | | |
| | | Button clickBtn = new Button |
| | | { |
| | | X = fileIconBtn.Right + Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(375 - 138), |
| | | Height = Application.GetRealHeight(104), |
| | | Tag=listName.group |
| | | }; |
| | | addFlieRow.AddChidren(clickBtn); |
| | | clickBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | string groupName = clickBtn.Tag.ToString(); |
| | | Loading loading = new Loading(); |
| | | this.AddChidren(loading); |
| | | loading.Start(); |
| | | //向缓存拿列表 |
| | | var songListMemory = CommonMethod.Current.GetSongListMemory(groupName,this.source); |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | //缓存没有列表才去读取 |
| | | if (songListMemory.songs.Count == 0) |
| | | { |
| | | //读取歌曲列表 |
| | | var songList = SendMethod.Current.GetSingleSongList(A31MusicModel.Current.functionMusic, groupName, this.source); |
| | | CommonMethod.Current.AddSongListMemory(songList,this.source);//保存缓存 |
| | | songListMemory.songs.AddRange(songList.songs);//更新列表 |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | A31SongPlay a31Song = new A31SongPlay(); |
| | | MainPage.BasePageView.AddChidren(a31Song); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | a31Song.Show(songListMemory); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | }; |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | public string UniqueDeviceName = string.Empty; |
| | | |
| | | |
| | | |
| | | public MusicInfo CurrentMusic = new MusicInfo(); |
| | | |
| | | /// <summary> |
| | | ///当前播放的列表信息 |
| | | /// </summary> |
| | | public List<Songs> CurrentPlayMusicInfoList = new List<Songs>(); |
| | | |
| | | /// <summary> |
| | | /// 是否允许显示 |
| | | /// </summary> |
| | | public bool IsCanShow = true; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 列表 |
| | | /// 当前播放歌曲列表 |
| | | /// </summary> |
| | | public List<PalyList> palyLists = new List<PalyList>(); |
| | | |
| | | public List<SongList> CurrentPlayMusicInfoList = new List<SongList>(); |
| | | /// <summary> |
| | | /// 喜爱音乐列表 |
| | | /// </summary> |
| | | public List<Songs> LoveMusicInfoList = new List<Songs>(); |
| | | |
| | | public List<SongInfo> LoveMusicInfoList = new List<SongInfo>(); |
| | | /// <summary> |
| | | /// 所有【音乐列表】 |
| | | /// </summary> |
| | | public List<SongList> AllMusicLists = new List<SongList>(); |
| | | /// <summary> |
| | | /// 所有【音乐源】的列表 |
| | | /// </summary> |
| | | public List<GroupList> AllSourceGroupList = new List<GroupList>(); |
| | | /// <summary> |
| | | ///创建音乐文件列表 |
| | | /// </summary> |
| | |
| | | /// 指定列表名获取音乐列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public List<Songs> GetSongList(string listName) |
| | | public List<SongInfo> GetSongList(string listName) |
| | | { |
| | | var list = palyLists.Find((o) => o.group == listName); |
| | | var list = CurrentPlayMusicInfoList.Find((o) => o.group == listName); |
| | | if (list == null) |
| | | { |
| | | return new List<Songs>(); |
| | | return new List<SongInfo>(); |
| | | } |
| | | return list.songs; |
| | | } |
| | |
| | | /// <summary> |
| | | /// 列表歌曲信息 |
| | | /// </summary> |
| | | public List<Songs> MusicInfoList = new List<Songs>(); |
| | | public List<SongInfo> MusicInfoList = new List<SongInfo>(); |
| | | } |
| | | [System.Serializable] |
| | | public class TidalMusicInfo : MusicInfo |
| | |
| | | /// <summary> |
| | | /// 支持多个音乐 |
| | | /// </summary> |
| | | public class PalyListInfo |
| | | { |
| | | public class PalyerSongListInfo |
| | | { |
| | | /// <summary> |
| | | /// 音乐sid |
| | | /// </summary> |
| | | public string sid = string.Empty; |
| | | /// <summary> |
| | | /// 解释多个音乐 |
| | | /// 音乐源 |
| | | /// </summary> |
| | | public List<PalyList> playlist = new List<PalyList>(); |
| | | public string source = string.Empty; |
| | | /// <summary> |
| | | /// 列表信息 |
| | | /// </summary> |
| | | public List<SongList> playlist = new List<SongList>(); |
| | | } |
| | | |
| | | [System.Serializable] |
| | | /// <summary> |
| | | /// 列表信息 |
| | | /// </summary> |
| | | public class PalyList |
| | | public class SongList |
| | | { |
| | | /// <summary> |
| | | /// 列表名 |
| | | /// </summary> |
| | | public string group = string.Empty; |
| | | /// <summary> |
| | | /// 自己定义的(用识别是那个音乐源的列表) |
| | | /// </summary> |
| | | public string source = string.Empty; |
| | | /// <summary> |
| | | /// 列表歌曲信息 |
| | | /// </summary> |
| | | public List<Songs> songs = new List<Songs>(); |
| | | public List<SongInfo> songs = new List<SongInfo>(); |
| | | } |
| | | [System.Serializable] |
| | | public class Songs : MusicInfo |
| | | public class SongInfo : MusicInfo |
| | | { |
| | | /// <summary> |
| | | /// 歌曲名称 |
| | |
| | | /// 时长 |
| | | /// </summary> |
| | | public string time = string.Empty; |
| | | /// <summary> |
| | | /// 歌曲地址 |
| | | /// </summary> |
| | | public string url = string.Empty; |
| | | /// <summary> |
| | | /// 类型<自己用> |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public string sid = string.Empty; |
| | | /// <summary> |
| | | /// 音乐源 |
| | | /// </summary> |
| | | public string source = string.Empty; |
| | | /// <summary> |
| | | /// 列表名集合 |
| | | /// </summary> |
| | | public List<ListName> groupList = new List<ListName>(); |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Security; |
| | | using HDL_ON.UI.UI2.FuntionControlView.Music; |
| | | using Shared; |
| | | namespace HDL_ON.UI.Music |
| | | { |
| | | public class A31MusicSourcePage:FrameLayout |
| | | public class A31MusicSourcePage : FrameLayout |
| | | { |
| | | public A31MusicSourcePage() |
| | | { |
| | | Tag = "Music"; |
| | | } |
| | | |
| | | |
| | | |
| | | public void Show() |
| | | { |
| | | #region 界面布局------ |
| | |
| | | #region 基础信息( 播放器 蓝牙 区域) |
| | | FrameLayout fL1 = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(202-50), |
| | | Height = Application.GetRealHeight(202 - 50), |
| | | Width = Application.GetRealWidth(375), |
| | | }; |
| | | middViewLayout.AddChidren(fL1); |
| | |
| | | Height = Application.GetRealHeight(352), |
| | | Width = Application.GetRealWidth(375), |
| | | }; |
| | | //middViewLayout.AddChidren(fL3); |
| | | middViewLayout.AddChidren(fL3); |
| | | |
| | | View.MusicSourceView selectedSourceView = new View.MusicSourceView(); |
| | | selectedSourceView.fLayout.Height = Application.GetRealHeight(44); |
| | |
| | | selectedSourceView.textBtn.TextSize = TextSize.Text16; |
| | | selectedSourceView.inputTextBtn.Visible = false; |
| | | selectedSourceView.nextLevelBtn.Visible = false; |
| | | //selectedSourceView.FrameLayoutView(fL3, false); |
| | | selectedSourceView.FrameLayoutView(fL3, false); |
| | | |
| | | View.MusicSourceView musicSourceView = new View.MusicSourceView(); |
| | | musicSourceView.fLayout.Y = selectedSourceView.fLayout.Bottom; |
| | |
| | | musicSourceView.textBtn.TextID = StringId.localMusic; |
| | | //musicSourceView.FrameLayoutView(fL3); |
| | | |
| | | |
| | | View.MusicSourceView usbSourceView = new View.MusicSourceView(); |
| | | //usbSourceView.fLayout.Y = selectedSourceView.fLayout.Bottom; |
| | | usbSourceView.iconBtn.UnSelectedImagePath = "MusicIcon/usb.png"; |
| | | usbSourceView.textBtn.TextID = StringId.usb; |
| | | usbSourceView.FrameLayoutView(fL3); |
| | | |
| | | |
| | | |
| | | View.MusicSourceView bluetoothSourceView = new View.MusicSourceView(); |
| | | bluetoothSourceView.fLayout.Y = musicSourceView.fLayout.Bottom; |
| | | bluetoothSourceView.fLayout.Y = usbSourceView.fLayout.Bottom; |
| | | bluetoothSourceView.iconBtn.UnSelectedImagePath = "MusicIcon/bluetooth.png"; |
| | | bluetoothSourceView.textBtn.TextID = StringId.bluetooth; |
| | | //bluetoothSourceView.FrameLayoutView(fL3); |
| | |
| | | #endregion |
| | | |
| | | #region 所有点击事件 |
| | | ///事件 |
| | | ///本地音乐事件 |
| | | musicSourceView.clickBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | A31MusicFileList a31MusicFileList = new A31MusicFileList(); |
| | | MainPage.BasePageView.AddChidren(a31MusicFileList); |
| | | a31MusicFileList.Show(); |
| | | //A31UsbMusicList a31UsbMusicList = new A31UsbMusicList(); |
| | | //MainPage.BasePageView.AddChidren(a31UsbMusicList); |
| | | //a31UsbMusicList.Show(); |
| | | //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | //Loading loading = new Loading(); |
| | | //a31UsbMusicList.AddChidren(loading); |
| | | //loading.Start(); |
| | | //System.Threading.Tasks.Task.Run(() => |
| | | //{ |
| | | // try |
| | | // { |
| | | // if (A31MusicModel.Current.UsbMusicLists.Count == 0) |
| | | // { |
| | | // SendMethod.Current.GetCurrentPalyList(A31MusicModel.Current.functionMusic); |
| | | |
| | | // } |
| | | // } |
| | | // catch |
| | | // { |
| | | // } |
| | | // finally |
| | | // { |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // loading.Hide(); |
| | | // //a31UsbMusicList.FileView(); |
| | | // }); |
| | | // } |
| | | //}); |
| | | }; |
| | | |
| | | ///usb事件 |
| | | usbSourceView.clickBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | A31FlieList a31FlieList = new A31FlieList(KeyProperty.sdcard, usbSourceView.textBtn.Text); |
| | | MainPage.BasePageView.AddChidren(a31FlieList); |
| | | a31FlieList.Show(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | Loading loading = new Loading(); |
| | | a31MusicFileList.AddChidren(loading); |
| | | a31FlieList.AddChidren(loading); |
| | | loading.Start(); |
| | | var listNameList = CommonMethod.Current.GetListNameListMemory(KeyProperty.sdcard); |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | if (A31MusicModel.Current.palyLists.Count == 0) |
| | | |
| | | if (listNameList.Count == 0) |
| | | { |
| | | SendMethod.Current.GetPalyList(A31MusicModel.Current.functionMusic); |
| | | |
| | | var Group = SendMethod.Current.GetSingleSourceListNameList(A31MusicModel.Current.functionMusic, KeyProperty.sdcard); |
| | | CommonMethod.Current.AddSourceGroupListMemory(Group);//保存缓存 |
| | | listNameList.AddRange(Group.groupList);//更新列表值 |
| | | } |
| | | } |
| | | catch |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | a31MusicFileList.FileView(); |
| | | a31FlieList.FileListView(listNameList); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | }; |
| | | |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | SendMethod.Current.EditDeviceName(A31MusicModel.Current.functionMusic.deviceId,playerName); |
| | | SendMethod.Current.EditDeviceName(A31MusicModel.Current.functionMusic.deviceId, playerName); |
| | | } |
| | | catch { } |
| | | |
| | |
| | | }); |
| | | |
| | | }; |
| | | |
| | | |
| | | ///区域修改的事件 |
| | | areaText.clickBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | //a31MyList.Show(); |
| | | //a31MyList.UpdateSelectedFile(); |
| | | //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | |
| | | //HDL_ON.DriverLayer.Control.Ins.GetMusicDirectory(device); |
| | | var palyListName = Music.SendMethod.Current.GetListName(A31MusicModel.Current.functionMusic); |
| | | var palyList = Music.SendMethod.Current.GetListMusic(A31MusicModel.Current.functionMusic, "hdl_special"); |
| | | var palyList = Music.SendMethod.Current.GetSingleSongList(A31MusicModel.Current.functionMusic, "hdl_special", ""); |
| | | List<string> musicNameList = new List<string>(); |
| | | for (int i = 0; i < palyList.songs.Count; i++) |
| | | { |
| | |
| | | UI2.Intelligence.Automation.PublicInterface publicInterface = new UI2.Intelligence.Automation.PublicInterface(); |
| | | publicInterface.FrameOrVv(this, musicNameList, new List<string> { "123" }, palyList.group, (index) => |
| | | { |
| | | |
| | | |
| | | |
| | | |
| | | }, false); |
| | | |
| | | }); |
| | |
| | | |
| | | }); |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | ///蓝牙事件 |
| | | bluetoothSourceView.clickBtn.MouseUpEventHandler += (sender, e) => |
| | |
| | | { |
| | | |
| | | ///1秒定时更新状态 |
| | | timerUpdateStatus(); |
| | | TimerUpdateStatus(); |
| | | #region ---界面布局--- |
| | | this.BackgroundColor = MusicColor.ViewColor; |
| | | topView = new TopView(); |
| | |
| | | return name == musicInfo.name; |
| | | })) |
| | | { |
| | | A31MusicModel.Current.LoveMusicInfoList.Add(new Songs { name = name, time = songTime }); |
| | | A31MusicModel.Current.LoveMusicInfoList.Add(new SongInfo { name = name, time = songTime }); |
| | | } |
| | | } |
| | | else |
| | |
| | | ///下拉刷新 |
| | | myListView.verticalScrolViewLayout.BeginHeaderRefreshingAction += () => |
| | | { |
| | | System.Threading.Tasks.Task.Run(() => |
| | | System.Threading.Tasks.Task.Run((Action)(() => |
| | | { |
| | | try |
| | | { |
| | | A31MusicModel.Current.palyLists.Clear(); |
| | | if (A31MusicModel.Current.palyLists.Count == 0) |
| | | A31MusicModel.Current.CurrentPlayMusicInfoList.Clear(); |
| | | if (A31MusicModel.Current.CurrentPlayMusicInfoList.Count == 0) |
| | | { |
| | | SendMethod.Current.GetPalyList(A31MusicModel.Current.functionMusic); |
| | | SendMethod.Current.GetCurrentPalyList(A31MusicModel.Current.functionMusic); |
| | | |
| | | } |
| | | } |
| | |
| | | myListView.verticalScrolViewLayout.EndHeaderRefreshing(); |
| | | myListView.verticalScrolViewLayout.RemoveAll(); |
| | | var listName = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.playlist_name); |
| | | var source = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.source); |
| | | var musicList = A31MusicModel.Current.GetSongList(listName); |
| | | A31SongPlay.SongListView(myListView.verticalScrolViewLayout, musicList, listName, myListView.popFra); |
| | | |
| | | A31SongPlay.SongListView(myListView.verticalScrolViewLayout, musicList, listName, source, myListView.popFra); |
| | | }); |
| | | } |
| | | }); |
| | | })); |
| | | //结束刷新 |
| | | |
| | | }; |
| | |
| | | /// <summary> |
| | | /// 定时更新状态 |
| | | /// </summary> |
| | | void timerUpdateStatus() |
| | | void TimerUpdateStatus() |
| | | { |
| | | timerThread = new System.Threading.Thread((obj) => |
| | | { |
| | |
| | | void PlayListView(FrameLayout frameLayout, VerticalRefreshLayout verticalScrolViewLayout) |
| | | { |
| | | verticalScrolViewLayout.RemoveAll(); |
| | | //获取播放器名称 |
| | | var listName = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.playlist_name); |
| | | var source = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.source); |
| | | //获取缓存歌曲列表 |
| | | var musicList = A31MusicModel.Current.GetSongList(listName); |
| | | if (musicList.Count == 0) |
| | | { |
| | | System.Threading.Tasks.Task.Run(() => |
| | | System.Threading.Tasks.Task.Run((Action)(() => |
| | | { |
| | | try |
| | | { |
| | | A31MusicModel.Current.palyLists.Clear(); |
| | | if (A31MusicModel.Current.palyLists.Count == 0) |
| | | A31MusicModel.Current.CurrentPlayMusicInfoList.Clear(); |
| | | if (A31MusicModel.Current.CurrentPlayMusicInfoList.Count == 0) |
| | | { |
| | | //获取歌曲列表 |
| | | SendMethod.Current.GetPalyList(A31MusicModel.Current.functionMusic); |
| | | SendMethod.Current.GetCurrentPalyList(A31MusicModel.Current.functionMusic); |
| | | |
| | | } |
| | | } |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | musicList = A31MusicModel.Current.GetSongList(listName); |
| | | A31SongPlay.SongListView(verticalScrolViewLayout, musicList, listName, frameLayout); |
| | | A31SongPlay.SongListView(verticalScrolViewLayout, musicList, listName, source, frameLayout); |
| | | }); |
| | | } |
| | | }); |
| | | })); |
| | | } |
| | | else |
| | | { |
| | | A31SongPlay.SongListView(verticalScrolViewLayout, musicList, listName, frameLayout); |
| | | A31SongPlay.SongListView(verticalScrolViewLayout, musicList, listName, source, frameLayout); |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | using Shared; |
| | | using HDL_ON.UI.Music; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.UI.UI2.FuntionControlView.Music; |
| | | |
| | | namespace HDL_ON.UI.Music |
| | | { |
| | |
| | | Tag = "Music"; |
| | | } |
| | | |
| | | public void Show(List<Songs> musicList,string listName) |
| | | |
| | | public void Show(SongList songLists) |
| | | { |
| | | |
| | | this.BackgroundColor = MusicColor.ViewColor; |
| | | var topView = new TopView(); |
| | | this.AddChidren(topView.TopFLayoutView()); |
| | | topView.topNameBtn.TextID = StringId.localMusic; |
| | | topView.topNameBtn.Text=songLists.group; |
| | | topView.clickBackBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | this.RemoveFromParent(); |
| | |
| | | this.AddChidren(vv); |
| | | vv.BeginHeaderRefreshingAction += () => |
| | | { |
| | | vv.EndHeaderRefreshing(); |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | //获取歌曲列表 |
| | | var songList = SendMethod.Current.GetSingleSongList(A31MusicModel.Current.functionMusic, songLists.group, songLists.source); |
| | | CommonMethod.Current.AddSongListMemory(songList, songLists.source);//保存缓存 |
| | | } |
| | | catch |
| | | { |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | vv.EndHeaderRefreshing(); |
| | | //从缓存拿列表 |
| | | var songListMemory = CommonMethod.Current.GetSongListMemory(songLists.group, songLists.source); |
| | | ///加载音乐列表 |
| | | SongListView(vv, songListMemory.songs, songListMemory.group, songLists.source); |
| | | |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | ///加载音乐列表 |
| | | SongListView(vv, musicList, listName); |
| | | SongListView(vv, songLists.songs, songLists.group,songLists.source); |
| | | |
| | | |
| | | } |
| | |
| | | /// <param name="vv">父控件</param> |
| | | /// <param name="musicList">音乐列表</param> |
| | | /// <param name="listName">列表名</param> |
| | | public static void SongListView(VerticalRefreshLayout vv,List<Songs> musicList,string listName, FrameLayout frame = null) { |
| | | |
| | | /// <param name="source">音乐源</param> |
| | | public static void SongListView(VerticalRefreshLayout vv, List<SongInfo> musicList, string listName,string source, FrameLayout frame = null) |
| | | { |
| | | if (vv!=null) { |
| | | vv.RemoveAll(); |
| | | } |
| | | for (int i = 0; i < musicList.Count; i++) |
| | | { |
| | | var songs = musicList[i]; |
| | |
| | | System.Threading.Thread.Sleep(50); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //移除界面 |
| | | //修改缓存属性状态值 |
| | | A31MusicModel.Current.functionMusic.SetAttrState("song_name", songView.songBtn.Text); |
| | | A31MusicModel.Current.functionMusic.SetAttrState("playlist_name", listName); |
| | | //移除界面 |
| | |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | dic.Add("song_name", songView.songBtn.Text); |
| | | dic.Add("playlist_name", listName); |
| | | if (!string.IsNullOrEmpty(songs.url)) |
| | | { |
| | | dic.Add("url", songs.url); |
| | | } |
| | | if (!string.IsNullOrEmpty(source)) |
| | | { |
| | | dic.Add("source", source); |
| | | } |
| | | SendMethod.Current.SendControlCommand(A31MusicModel.Current.functionMusic, dic); |
| | | }); |
| | | }); |
| | |
| | | }); |
| | | updateSelectedMusicThread.Start(); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using HDL_ON.UI.Music; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI.UI2.FuntionControlView.Music |
| | | { |
| | | public class A31UsbMusicList:FrameLayout |
| | | { |
| | | public A31UsbMusicList() |
| | | { |
| | | Tag = "Music"; |
| | | } |
| | | VerticalRefreshLayout middViewLayout; |
| | | /// <summary> |
| | | /// 先加载界面出来 |
| | | /// </summary> |
| | | public void Show( ) |
| | | { |
| | | #region 界面布局------ |
| | | |
| | | this.BackgroundColor = MusicColor.ViewColor; |
| | | var topView = new TopView(); |
| | | this.AddChidren(topView.TopFLayoutView()); |
| | | topView.topNameBtn.Text ="USB"; |
| | | topView.clickBackBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | this.RemoveFromParent(); |
| | | }; |
| | | middViewLayout = new VerticalRefreshLayout |
| | | { |
| | | BackgroundColor = MusicColor.WhiteColor, |
| | | Y = topView.fLayout.Bottom, |
| | | Height = Application.GetRealHeight(H_W.H - H_W.T_Height), |
| | | }; |
| | | this.AddChidren(middViewLayout); |
| | | middViewLayout.BeginHeaderRefreshingAction += () => |
| | | { |
| | | middViewLayout.EndHeaderRefreshing(); |
| | | }; |
| | | #endregion |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.UI.Music; |
| | | |
| | | namespace HDL_ON.UI.UI2.FuntionControlView.Music |
| | | { |
| | | public class CommonMethod |
| | | { |
| | | public CommonMethod() |
| | | { |
| | | } |
| | | |
| | | private static CommonMethod commonMethod = null; |
| | | |
| | | public static CommonMethod Current |
| | | { |
| | | get |
| | | { |
| | | if (commonMethod == null) |
| | | { |
| | | commonMethod = new CommonMethod(); |
| | | } |
| | | return commonMethod; |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 获取【音乐列表】 |
| | | /// </summary> |
| | | /// <param name="listName">列表名</param> |
| | | /// <param name="source">音乐源</param> |
| | | /// <returns></returns> |
| | | public SongList GetSongListMemory(string listName, string source) |
| | | { |
| | | for (int i = 0; i < A31MusicModel.Current.AllMusicLists.Count; i++) |
| | | { |
| | | var songList = A31MusicModel.Current.AllMusicLists[i]; |
| | | if (songList.source == source && songList.group == listName) |
| | | { |
| | | return songList; |
| | | } |
| | | |
| | | } |
| | | return new SongList() {group=listName,source=source}; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加【音乐列表】(存在移除再添加) |
| | | /// </summary> |
| | | /// <param name="newSongList">音乐列表</param> |
| | | /// <param name="source">音乐源</param> |
| | | public void AddSongListMemory(SongList newSongList, string source) |
| | | { |
| | | |
| | | newSongList.source = source;//更新音乐源 |
| | | int existsInt = -1; |
| | | for (int i = 0; i < A31MusicModel.Current.AllMusicLists.Count; i++) |
| | | { |
| | | var songList = A31MusicModel.Current.AllMusicLists[i]; |
| | | if (songList.source == newSongList.source && songList.group == newSongList.group) |
| | | { |
| | | existsInt = i; |
| | | break; |
| | | } |
| | | |
| | | |
| | | } |
| | | if (existsInt > -1) |
| | | { |
| | | A31MusicModel.Current.AllMusicLists.RemoveAt(existsInt); |
| | | A31MusicModel.Current.AllMusicLists.Insert(existsInt, newSongList); |
| | | |
| | | } |
| | | else |
| | | { |
| | | A31MusicModel.Current.AllMusicLists.Add(newSongList); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取【音乐源】列表名列表 |
| | | /// </summary> |
| | | /// <param name="source">音乐源</param> |
| | | /// <returns></returns> |
| | | public List<ListName> GetListNameListMemory(string source) |
| | | { |
| | | |
| | | for (int i = 0; i < A31MusicModel.Current.AllSourceGroupList.Count; i++) |
| | | { |
| | | var group = A31MusicModel.Current.AllSourceGroupList[i]; |
| | | if (group.source == source) |
| | | { |
| | | return group.groupList; |
| | | } |
| | | |
| | | } |
| | | return new List<ListName>(); |
| | | } |
| | | /// <summary> |
| | | /// 添加【音乐源】(存在移除再添加) |
| | | /// </summary> |
| | | /// <param name="groupLists"></param> |
| | | public void AddSourceGroupListMemory(GroupList groupLists) |
| | | { |
| | | int existsInt = -1; |
| | | for (int i = 0; i < A31MusicModel.Current.AllSourceGroupList.Count; i++) |
| | | { |
| | | var group = A31MusicModel.Current.AllSourceGroupList[i]; |
| | | if (group.sid == groupLists.sid && group.source == groupLists.source) |
| | | { |
| | | existsInt = i; |
| | | break; |
| | | } |
| | | |
| | | |
| | | } |
| | | if (existsInt > -1) |
| | | { |
| | | A31MusicModel.Current.AllSourceGroupList.RemoveAt(existsInt); |
| | | A31MusicModel.Current.AllSourceGroupList.Insert(existsInt, groupLists); |
| | | |
| | | } |
| | | else |
| | | { |
| | | A31MusicModel.Current.AllSourceGroupList.Add(groupLists); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | /// 当前歌曲播放时间<0-9999(s)> |
| | | /// </summary> |
| | | public const string playing_time = "playing_time"; |
| | | /// <summary> |
| | | /// 【USB】音乐源 |
| | | /// </summary> |
| | | public const string sdcard = "sdcard"; |
| | | /// <summary> |
| | | /// 【音频输入】音乐源 |
| | | /// </summary> |
| | | public const string audio_in = "audio_in"; |
| | | /// <summary> |
| | | /// 【ftp】音乐源 |
| | | /// </summary> |
| | | public const string ftp = "ftp"; |
| | | /// <summary> |
| | | /// 【收音机】音乐源 |
| | | /// </summary> |
| | | public const string radio = "radio"; |
| | | /// <summary> |
| | | /// 【蓝牙】音乐源 |
| | | /// </summary> |
| | | public const string bluetooth = "bluetooth"; |
| | | |
| | | |
| | | |
| | | #endregion |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | public enum Source |
| | | { |
| | | |
| | | sdcard,//usb |
| | | audio_in,//音频输入 |
| | | ftp, |
| | | radio,//收音机 |
| | | bluetooth//蓝牙 |
| | | |
| | | } |
| | | } |
| | |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceIds", functionIds); |
| | | var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_RefreshDeviceStatus, "刷新设备状态"); |
| | | if (responsePackNew.Code != "0" || responsePackNew.Data == null || responsePackNew.Data.ToString() == "") |
| | | if (!this.dataChecking(responsePackNew)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取音乐列表 |
| | | /// 获取当前播放音乐列表 |
| | | /// </summary> |
| | | /// <param name="music"></param> |
| | | /// <param name="music">音乐播放器</param> |
| | | /// <returns></returns> |
| | | public void GetPalyList(Function music) |
| | | public void GetCurrentPalyList(Function music) |
| | | { |
| | | try |
| | | { |
| | |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceIds", new List<string> { music.deviceId }); |
| | | var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_PlayerList, "获取音乐列表"); |
| | | if (responsePackNew.Code != "0" || responsePackNew.Data == null || responsePackNew.Data.ToString() == "") |
| | | if (!this.dataChecking(responsePackNew)) |
| | | { |
| | | return; |
| | | } |
| | | //数据返序列化为Function对象 |
| | | var str = Newtonsoft.Json.JsonConvert.SerializeObject(responsePackNew.Data); |
| | | var palyLists = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PalyListInfo>>(str); |
| | | var palyLists = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PalyerSongListInfo>>(str); |
| | | if (palyLists == null) |
| | | { |
| | | palyLists =new List<PalyListInfo>(); |
| | | palyLists = new List<PalyerSongListInfo>(); |
| | | } |
| | | if (palyLists.Count > 0) |
| | | { |
| | | ///默认拿第一个列表 |
| | | A31MusicModel.Current.palyLists = palyLists[0].playlist; |
| | | A31MusicModel.Current.CurrentPlayMusicInfoList = palyLists[0].playlist; |
| | | } |
| | | } |
| | | catch |
| | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 获取列表名列表 |
| | | /// 获取【多个音乐源】列表名列表 |
| | | /// </summary> |
| | | /// <param name="music"></param> |
| | | /// <param name="source">音乐源为null,支持多个源获取</param> |
| | | /// <returns></returns> |
| | | public List<GroupList> GetListName(Function music) |
| | | public List<GroupList> GetMultipleSourceListName(Function music, string source) |
| | | { |
| | | try |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); |
| | | d.Add("deviceIds", new List<string> { music.deviceId }); |
| | | Dictionary<string, object> deviceIds = new Dictionary<string, object>(); |
| | | deviceIds.Add("deviceId", music.deviceId); |
| | | if (!string.IsNullOrEmpty(source)) |
| | | { |
| | | deviceIds.Add("source", source); |
| | | } |
| | | d.Add("deviceInfos", new List<Dictionary<string, object>> { deviceIds }); |
| | | var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_GroupList, "获取列表名列表"); |
| | | if (responsePackNew.Code != "0" || responsePackNew.Data == null || responsePackNew.Data.ToString() == "") |
| | | if (!this.dataChecking(responsePackNew)) |
| | | { |
| | | return new List<GroupList>(); |
| | | } |
| | |
| | | return new List<GroupList>(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取列表音乐 |
| | | /// 获取【单个音乐源】列表名列表(默认取定列表中一个) |
| | | /// </summary> |
| | | /// <param name="music"></param> |
| | | /// <param name="source">音乐源</param> |
| | | /// <returns></returns> |
| | | public GroupList GetSingleSourceListNameList(Function music, string source) |
| | | { |
| | | List<GroupList> groupList = this.GetMultipleSourceListName(music, source); |
| | | if (groupList.Count == 0) |
| | | { |
| | | return new GroupList(); |
| | | } |
| | | ////默认取定列表中一个 |
| | | return groupList.Count > 0 ? groupList[0] : new GroupList(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 通过列表名获取【多个歌曲列表】 |
| | | /// </summary> |
| | | /// <param name="music"></param> |
| | | /// <param name="listName">列表名</param> |
| | | /// <param name="source">音乐源</param> |
| | | /// <returns></returns> |
| | | public PalyList GetListMusic(Function music, string listName) |
| | | public List<PalyerSongListInfo> GetMultipleSongListM(Function music, string listName, string source) |
| | | { |
| | | try |
| | | { |
| | |
| | | d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId); |
| | | d2.Add("group", listName); |
| | | d1.Add("sid", music.sid); |
| | | if (!string.IsNullOrEmpty(source)) |
| | | { |
| | | d1.Add("source", source); |
| | | } |
| | | d1.Add("groupList", new List<Dictionary<string, object>> { d2 }); |
| | | d.Add("sidGroups", new List<Dictionary<string, object>> { d1 }); |
| | | |
| | | var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_GroupPlayerList, "获取列表音乐"); |
| | | if (responsePackNew.Code != "0" || responsePackNew.Data == null || responsePackNew.Data.ToString() == "") |
| | | var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_GroupPlayerList, "通过列表名获取歌曲列表"); |
| | | if (!this.dataChecking(responsePackNew)) |
| | | { |
| | | return new PalyList(); |
| | | return new List<PalyerSongListInfo>(); |
| | | } |
| | | //数据返序列化为Function对象 |
| | | var str = Newtonsoft.Json.JsonConvert.SerializeObject(responsePackNew.Data); |
| | | var palyLists = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PalyListInfo>>(str); |
| | | var palyLists = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PalyerSongListInfo>>(str); |
| | | if (palyLists == null) |
| | | { |
| | | palyLists = new List<PalyListInfo>(); |
| | | return new List<PalyerSongListInfo>(); |
| | | } |
| | | |
| | | if (palyLists.Count == 0) |
| | | { |
| | | return new PalyList(); |
| | | } |
| | | //默认第一个列表里面第一个音乐列表 |
| | | return palyLists[0].playlist.Count > 0 ? palyLists[0].playlist[0] : new PalyList(); |
| | | return palyLists; |
| | | |
| | | } |
| | | catch |
| | | { |
| | | return new PalyList(); |
| | | return new List<PalyerSongListInfo>(); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 通过列表名获取【单个歌曲列表】(默认取定列表中一个歌曲列表) |
| | | /// </summary> |
| | | /// <param name="music"></param> |
| | | /// <param name="listName">列表名</param> |
| | | /// <param name="source">音乐源</param> |
| | | /// <returns></returns> |
| | | public SongList GetSingleSongList(Function music, string listName, string source) |
| | | { |
| | | List<PalyerSongListInfo> listInfos = this.GetMultipleSongListM(music, listName, source); |
| | | if (listInfos.Count == 0) |
| | | { |
| | | return new SongList(); |
| | | } |
| | | ////默认第一个列表里面第一个音乐列表 |
| | | SongList songList = listInfos[0].playlist.Count > 0 ? listInfos[0].playlist[0] : new SongList(); |
| | | return songList; |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 检验数据回复成功或者失败 |
| | | /// </summary> |
| | | /// <param name="responsePackNew">回复数据对象</param> |
| | | /// <returns></returns> |
| | | private bool dataChecking(ResponsePackNew responsePackNew) |
| | | { |
| | | if (responsePackNew.Code != "0" || responsePackNew.Data == null || responsePackNew.Data.ToString() == "") |
| | | { |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <returns></returns> |
| | | public ResponsePackNew RequestServerhomeId(object o, string api_Url, string tag, int mTimeout = 5) |
| | | { |
| | | JObject jobject = JObject.Parse(Newtonsoft.Json.JsonConvert.SerializeObject(o)); |
| | | JObject jobject = JObject.Parse(Newtonsoft.Json.JsonConvert.SerializeObject(o)); |
| | | return UI2.Intelligence.Automation.Send.Current.RequestServerhomeId(jobject, api_Url, tag, mTimeout); |
| | | } |
| | | } |
| | |
| | | ///弹窗文件夹列表界面 |
| | | /// </summary> |
| | | /// <param name="musicInfo"></param> |
| | | public void FieListView(Songs musicInfo) |
| | | public void FieListView(SongInfo musicInfo) |
| | | { |
| | | #region |
| | | //主控件 |
| | |
| | | FileView(dialog, verticalScrolViewLayout, musicInfo); |
| | | |
| | | } |
| | | void FileView(Dialog dialog, VerticalScrolViewLayout verticalScrolViewLayout, Songs musicInfo) |
| | | void FileView(Dialog dialog, VerticalScrolViewLayout verticalScrolViewLayout, SongInfo musicInfo) |
| | | { |
| | | verticalScrolViewLayout.RemoveAll(); |
| | | for (int i = 0; i < A31MusicModel.Current.FileLists.Count; i++) |
| | |
| | | /// 布局歌曲信息的View |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public void SongFrameLayout(VerticalRefreshLayout refreshLayout, Songs songs) |
| | | public void SongFrameLayout(VerticalRefreshLayout refreshLayout, SongInfo songs) |
| | | { |
| | | musicViewFl.AddChidren(playIconBtn); |
| | | musicViewFl.AddChidren(songBtn); |