wjc
2023-02-03 c484347d42f8c14f03f498e689069a14a45abc93
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
using System;
using HDL_ON.Entity;
 
namespace HDL_ON.UI.UI2.FuntionControlView.Music
{
    public class KeyProperty
    {
        private static KeyProperty sMusicPropertyKey = null;
 
        public static KeyProperty sMusicProperty
        {
            get
            {
                if (sMusicPropertyKey == null)
                {
                    sMusicPropertyKey = new KeyProperty();
                }
                return sMusicPropertyKey;
            }
        }
 
        #region    ---属性----
 
        /// <summary>
        /// 开关<on/off>
        /// </summary>
        public const string on_off = "on_off";
        /// <summary>
        /// 音量<0-100>
        /// </summary>
        public const string volume = "volume";
        /// <summary>
        /// 模式<single/single_cycle/order/list_cycle/random>
        /// </summary>
        public const string mode = "mode";
        /// <summary>
        /// 音源<sdcard/audio_in/ftp/radio/bluetooth>
        /// </summary>
        public const string source = "source";
        /// <summary>
        /// 列表名
        /// </summary>
        public const string playlist_name = "playlist_name";
        /// <summary>
        /// 歌曲名
        /// </summary>
        public const string song_name = "song_name";
        /// <summary>
        /// 切歌<up/down>
        /// </summary>
        public const string song_step = "song_step";
        /// <summary>
        /// 当前歌曲总时间<0-9999(s)>
        /// </summary>
        public const string song_time = "song_time";
        /// <summary>
        /// 当前歌曲播放时间<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
 
 
 
        /// <summary>
        /// 获取on_off值
        /// </summary>
        /// <param name="function">当前音乐</param>
        /// <returns></returns>
        public string GetOnOffKeyValue(Function function)
        {
            if (function == null)
            {
                return "";
            }
            return function.GetAttrState(on_off);
 
        }
        /// <summary>
        /// 设置on_off值
        /// </summary>
        /// <param name="function">当前音乐</param>
        /// <returns></returns>
        public void SetOnOffKeyValue(Function function, string stateValue)
        {
            if (function == null)
            {
                return;
            }
            function.SetAttrState(on_off, stateValue);
 
        }
 
    }
    public class ValueProperty
    {
        #region    ---属性值----
        /// <summary>
        /// <up>
        /// </summary>
        public const string up = "up";
        /// <summary>
        /// <down>
        /// </summary>
        public const string down = "down";
        /// <summary>
        /// 开<on>
        /// </summary>
        public const string on = "on";
        /// <summary>
        /// 关<off>
        /// </summary>
        public const string off = "off";
        /// <summary>
        /// 单曲<single>
        /// </summary>
        public const string single = "single";
        /// <summary>
        /// 单曲循环
        /// </summary>
        public const string single_cycle = "single_cycle";
        /// <summary>
        /// 循序循环
        /// </summary>
        public const string order = "order";
        /// <summary>
        /// 列表循环
        /// </summary>
        public const string list_cycle = "list_cycle";
        /// <summary>
        /// 随机播放
        /// </summary>
        public const string random = "random";
 
        #endregion
 
 
 
    }
 
    public enum Source
    {
 
        sdcard,//usb
        audio_in,//音频输入
        ftp,
        radio,//收音机
        bluetooth//蓝牙
 
    }
}