| | |
| | | import com.hdl.sdk.hdl_core.Util.NetUtil.NetWorkUtil; |
| | | import com.hdl.sdk.hdl_core.Util.SPUtil.SPUtils; |
| | | import com.hdl.sdk.hdl_core.Util.TransformUtil.HDLUtlis; |
| | | import com.hdl.sdk.hdl_core.Util.TransformUtil.StringUtil; |
| | | |
| | | import org.greenrobot.eventbus.EventBus; |
| | | |
| | |
| | | public static void audioCtrl(AppliancesInfo info, int type) { |
| | | byte[] musicBytes; |
| | | int command; |
| | | int sourceId = info.getIntCurState(); |
| | | switch (type) { |
| | | case HDLAudio.SET_AUDIO_PLAYSTOP: |
| | | command = Configuration.AUDIO_CTRL_READ_COMMAND; |
| | | musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x4C, 0x41, 0x59, 0x53, 0x54, 0x4F, 0x50, 0x0D}; |
| | | // musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x4C, 0x41, 0x59, 0x53, 0x54, 0x4F, 0x50, 0x0D}; |
| | | musicBytes = StringUtil.GetMusicBytes("*S" +sourceId + "PLAYSTOP"); |
| | | break; |
| | | case HDLAudio.SET_AUDIO_PLAYPAUSE: |
| | | command = Configuration.AUDIO_CTRL_READ_COMMAND; |
| | | musicBytes = new byte[]{42, 83, 49, 80, 76, 65, 89, 80, 65, 85, 83, 69, 0x0D}; |
| | | // musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x4C, 0x41, 0x59, 0x50, 0x41, 0x55, 0x53, 0x45, 0x0D}; |
| | | musicBytes = StringUtil.GetMusicBytes("*S" +sourceId + "PLAYPAUSE"); |
| | | break; |
| | | case HDLAudio.SET_NEXT_SONG: |
| | | command = Configuration.AUDIO_CTRL_READ_COMMAND; |
| | | musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4E, 0x45, 0x58, 0x54, 0x0D}; |
| | | // musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4E, 0x45, 0x58, 0x54, 0x0D}; |
| | | musicBytes = StringUtil.GetMusicBytes("*S" +sourceId + "NEXT"); |
| | | break; |
| | | case HDLAudio.SET_PRE_SONG: |
| | | command = Configuration.AUDIO_CTRL_READ_COMMAND; |
| | | musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x52, 0x45, 0x56, 0x0D}; |
| | | // musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x52, 0x45, 0x56, 0x0D}; |
| | | musicBytes = StringUtil.GetMusicBytes("*S" +sourceId + "PREV"); |
| | | break; |
| | | case HDLAudio.GET_AUDIO_MODE: |
| | | command = Configuration.AUDIO_CTRL_READ_COMMAND; |
| | | musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x4C, 0x41, 0x59, 0x4D, 0x4F, 0x44, 0x45, 0x3F, 0x0D}; |
| | | // musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x4C, 0x41, 0x59, 0x4D, 0x4F, 0x44, 0x45, 0x3F, 0x0D}; |
| | | musicBytes = StringUtil.GetMusicBytes("*S" +sourceId + "PLAYMODE?"); |
| | | break; |
| | | case HDLAudio.SET_AUDIO_MODE_UP: |
| | | command = Configuration.AUDIO_CTRL_READ_COMMAND; |
| | | musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4D, 0x4F, 0x44, 0x45, 0x2B, 0x0D}; |
| | | // musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4D, 0x4F, 0x44, 0x45, 0x2B, 0x0D}; |
| | | musicBytes = StringUtil.GetMusicBytes("*S" +sourceId + "MODE+"); |
| | | break; |
| | | case HDLAudio.SET_AUDIO_MODE_DOWN: |
| | | command = Configuration.AUDIO_CTRL_READ_COMMAND; |
| | | musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4D, 0x4F, 0x44, 0x45, 0x2D, 0x0D}; |
| | | // musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4D, 0x4F, 0x44, 0x45, 0x2D, 0x0D}; |
| | | musicBytes = StringUtil.GetMusicBytes("*S" +sourceId + "MODE-"); |
| | | break; |
| | | case HDLAudio.GET_AUDIO_CURRRENT_INFO: |
| | | command = Configuration.AUDIO_CTRL_READ_COMMAND; |
| | | //*Z1STAUS?归为键 |
| | | musicBytes = new byte[]{0x2A, 0x5A, 0x31, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x3F, 0x0D}; |
| | | // musicBytes = new byte[]{0x2A, 0x5A, 0x31, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x3F, 0x0D}; |
| | | musicBytes = StringUtil.GetMusicBytes("*S" +sourceId + "STATUS?"); |
| | | break; |
| | | case HDLAudio.SET_PRE_LIST: |
| | | HDLAudio.isSetPreNextList = true; |
| | | command = Configuration.AUDIO_CTRL_READ_COMMAND; |
| | | musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x52, 0x45, 0x56, 0x4C, 0x49, 0x53, 0x54, 0x0D}; |
| | | // musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x50, 0x52, 0x45, 0x56, 0x4C, 0x49, 0x53, 0x54, 0x0D}; |
| | | musicBytes = StringUtil.GetMusicBytes("*S" +sourceId + "PREVLIST"); |
| | | break; |
| | | case HDLAudio.SET_NEXT_LIST: |
| | | HDLAudio.isSetPreNextList = true; |
| | | command = Configuration.AUDIO_CTRL_READ_COMMAND; |
| | | musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4E, 0x45, 0x58, 0x54, 0x4C, 0x49, 0x53, 0x54, 0x0D}; |
| | | // musicBytes = new byte[]{0x2A, 0x53, 0x31, 0x4E, 0x45, 0x58, 0x54, 0x4C, 0x49, 0x53, 0x54, 0x0D}; |
| | | musicBytes = StringUtil.GetMusicBytes("*S" +sourceId + "NEXTLIST"); |
| | | break; |
| | | case HDLAudio.TEXT: |
| | | command = Configuration.AUDIO_MenuPlay_INSTRUCTION_COMMAND; |
| | | musicBytes = new byte[]{0x2A, 0x5A, 0x30, 0x31, 0x31, 0x4C, 0x49, 0x53, 0x54, 0x30, 0x30, 0x31, 0x30, 0x30, 0x32, 0x31, 0x0D}; |
| | | // musicBytes = new byte[]{0x2A, 0x5A, 0x30, 0x31, 0x31, 0x4C, 0x49, 0x53, 0x54, 0x30, 0x30, 0x31, 0x30, 0x30, 0x32, 0x31, 0x0D}; |
| | | musicBytes = StringUtil.GetMusicBytes("*Z01" +sourceId + "LIST0010021"); |
| | | break; |
| | | default: |
| | | command = 0; |
| | |
| | | public static void audioCtrl(AppliancesInfo info, int type, int value) { |
| | | byte[] musicBytes; |
| | | int command; |
| | | int sourceId = info.getIntCurState(); |
| | | switch (type) { |
| | | case HDLAudio.GET_AUDIO_LIST: |
| | | HDLAudio.numStr.clear(); |
| | |
| | | HDLAudio.curListNum = value; |
| | | command = Configuration.AUDIO_MenuPlay_INSTRUCTION_COMMAND; |
| | | //*Z011TYPE0011归位键 |
| | | musicBytes = new byte[]{0x2A, 0x5A, 0x30, 0x31, 0x31, 0x54, 0x59, 0x50, 0x45, 0x30, 0x30, 0x31, 0x31, 0x0D}; |
| | | // musicBytes = new byte[]{0x2A, 0x5A, 0x30, 0x31, 0x31, 0x54, 0x59, 0x50, 0x45, 0x30, 0x30, 0x31, 0x31, 0x0D}; |
| | | musicBytes = StringUtil.GetMusicBytes("*Z01" + sourceId + "TYPE0011"); |
| | | break; |
| | | case HDLAudio.SET_AUDIO_VOL: |
| | | command = Configuration.AUDIO_CTRL_READ_COMMAND; |
| | |
| | | public static void audioCtrl(AppliancesInfo info, int type, int listId, int songId) { |
| | | byte[] musicBytes; |
| | | int command; |
| | | int sourceId = info.getIntCurState(); |
| | | switch (type) { |
| | | |
| | | case HDLAudio.SET_CHOOSE_PLAY_SONG: |
| | | command = Configuration.AUDIO_MenuPlay_INSTRUCTION_COMMAND; |
| | | musicBytes = HDLAudio.audioChooseSongParse(listId, songId); |
| | | musicBytes = HDLAudio.audioChooseSongParse(listId, songId, sourceId); |
| | | break; |
| | | default: |
| | | command = 0; |