1
wxr
2023-03-31 7e42cc13a14b7de31c9f5d5c61cdf24f3246335d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
using System;
using System.Collections.Generic;
 
namespace Shared
{
    [System.Serializable]
    public class MusicModel : Common
    {
        public MusicModel ()
            : base ()
        {
            this.Type = DeviceType.MusicModel;
            DeviceTextID = SimpleControl.R.MyInternationalizationString.Music;
        }
        /// <summary>
        /// 音乐命令变成byte数组
        /// </summary>
        /// <param name="commandString"></param>
        /// <returns></returns>
        public static byte [] MusiceBytes (string commandString)
        {
            byte [] bytes = System.Text.Encoding.ASCII.GetBytes (commandString);
            byte [] sendBytes = new byte [bytes.Length + 1];
            sendBytes [bytes.Length] = 0x0D;
            Array.Copy (bytes, 0, sendBytes, 0, bytes.Length);
            return sendBytes;
        }
 
        /// <summary>
        /// 当前源SD1  ......
        /// </summary>
        public int CurrentSource;
 
        /// <summary>
        /// 通道号
        /// </summary>
        public byte ChNumber;
 
        /// <summary>
        /// 总数
        /// </summary>
        public byte ChNumberCount;
        /// <summary>
        /// 1 HDL 
        /// 2 第三方旧音乐
        /// </summary>
        public byte MusicType = 1;
 
        public string IPAddress = string.Empty;
 
        public string RouteIPAddress = string.Empty;
 
        public string IPMAC = string.Empty;
 
        public string SubnetMask = string.Empty;
 
        public byte DHCP = 0;
 
        public string curPlayMusicName = string.Empty;
 
        public string SourceID = "1";
 
        public string ZoneID = string.Empty;
 
        public string CurVol = "0";
 
        /// <summary>
        /// 音源
        /// </summary>
        public string SoundGenerator = string.Empty;
 
        //public string musicListNumber = "0";//音乐列表号
        /// <summary>
        /// 当前播放的音乐列表名称(第二层名称)
        /// </summary>
        public string curMusicListName = string.Empty;
        /// <summary>
        /// 音乐号
        /// </summary>
        //public string musicFileNumber = "0";//音乐号
        /// <summary>
        /// 歌曲总时间
        /// </summary>
        public string musicTime = string.Empty;//歌曲总时间
                                               /// <summary>
                                               /// 上一次更新的时间
                                               /// </summary>
        public DateTime LastDateTime;
        /// <summary>
        /// 当前播放进度
        /// </summary>
        public string musicPalyTime = string.Empty;//当前播放进度
 
 
        public string musicCurPalyStatus = "1";
 
        /// <summary>
        /// 当前类型号,固定是001
        /// </summary>
        public string curTypeNumber = "001";
        /// <summary>
        /// 当前列表的ID如:001
        /// </summary>
        public string curListNumber = string.Empty;
        /// <summary>
        /// 当前歌曲的ID如:001
        /// </summary>
        public string curSongNumber = string.Empty;
 
 
        public List<KeyAndValue> SDCardTypeList = new List<KeyAndValue> ();
        public List<KeyAndValue> SDCardListList = new List<KeyAndValue> ();
        public List<KeyAndValue> SDCardSongList = new List<KeyAndValue> ();
 
        public List<KeyAndValue> NASTypeList = new List<KeyAndValue> ();
        public List<KeyAndValue> NASListList = new List<KeyAndValue> ();
        public List<KeyAndValue> NasSongList = new List<KeyAndValue> ();
 
        public List<KeyAndValue> LovePlayList = new List<KeyAndValue> ();
 
 
 
        public enum Status
        {
            /// <summary>
            /// 播放中
            /// </summary>
            Play,
            /// <summary>
            /// 停止
            /// </summary>
            Stop,
            /// <summary>
            /// 暂停
            /// </summary>
            Pause
        }
        /// <summary>
        /// 当前播放状态
        /// </summary>
        public Status PlayStatus = Status.Stop;
 
        /// <summary>
        /// 1单曲播放,
        /// 2单曲循环,
        /// 3连续播放,
        /// 4连播循环,    
        /// </summary>
        public int playMode;
        //internal List<Music> SongList;
        public List<Music> SongList = new List<Music> ();
        internal int Port;
    }
 
    [System.Serializable]
    public class KeyAndValue
    {
        /// <summary>
        /// 序号 如:001
        /// </summary>
        public string number;
        /// <summary>
        /// 内容
        /// </summary>
        public string name;
    }
    [System.Serializable]
    public class Music
    {
        public string Songname;
        public string zhuanji;
    }
 
}