[rotel] New command to toggle between stereo and bypass (#13203)
Concerns the models RSP-1570, RSP-1572 and RSX-1562 BYPASS as DSP mode is also removed for these models. Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
@@ -50,10 +50,10 @@ public enum RotelModel {
|
||||
concatenate(DSP_CMDS_SET1, MENU2_CTRL_CMDS, OTHER_CMDS_SET1, List.of(REMOTE_VOLUME_UP, REMOTE_VOLUME_DOWN)),
|
||||
(byte) 0xA0, 13, 8, true, RotelFlagsMapping.MAPPING1),
|
||||
RSP1570("RSP-1570", 115200, 1, 3, true, 96, true, 6, false, RECORD_FONCTION_SELECT, 3,
|
||||
concatenate(DSP_CMDS_SET1, MENU2_CTRL_CMDS, OTHER_CMDS_SET1, OTHER_CMDS_SET2, List.of(RESET_FACTORY)),
|
||||
concatenate(DSP_CMDS_SET2, MENU2_CTRL_CMDS, OTHER_CMDS_SET1, OTHER_CMDS_SET2, List.of(RESET_FACTORY)),
|
||||
(byte) 0xA3, 42, 5, true, RotelFlagsMapping.MAPPING5),
|
||||
RSP1572("RSP-1572", 115200, 2, 3, true, 96, true, null, false, RECORD_FONCTION_SELECT, 4,
|
||||
concatenate(DSP_CMDS_SET1, NUMERIC_KEY_CMDS, MENU3_CTRL_CMDS, OTHER_CMDS_SET1, OTHER_CMDS_SET4),
|
||||
concatenate(DSP_CMDS_SET2, NUMERIC_KEY_CMDS, MENU3_CTRL_CMDS, OTHER_CMDS_SET1, OTHER_CMDS_SET4),
|
||||
(byte) 0xA5, 42, 5, true, RotelFlagsMapping.MAPPING5),
|
||||
RSX1055("RSX-1055", 19200, 3, 1, false, 90, false, 12, false, ZONE_SELECT, 1,
|
||||
concatenate(DSP_CMDS_SET1, TUNER_CMDS_SET1, NUMERIC_KEY_CMDS, MENU2_CTRL_CMDS, OTHER_CMDS_SET1),
|
||||
@@ -88,7 +88,7 @@ public enum RotelModel {
|
||||
List.of(RESET_FACTORY)),
|
||||
(byte) 0xCA, 42, 5, true, RotelFlagsMapping.MAPPING5),
|
||||
RSX1562("RSX-1562", 115200, 2, 3, true, 96, true, null, false, RECORD_FONCTION_SELECT, 4,
|
||||
concatenate(DSP_CMDS_SET1, TUNER_CMDS_SET2, ZONE234_TUNER_CMDS_SET1, NUMERIC_KEY_CMDS,
|
||||
concatenate(DSP_CMDS_SET2, TUNER_CMDS_SET2, ZONE234_TUNER_CMDS_SET1, NUMERIC_KEY_CMDS,
|
||||
ZONE234_NUMERIC_KEY_CMDS, MENU3_CTRL_CMDS, OTHER_CMDS_SET1, OTHER_CMDS_SET4),
|
||||
(byte) 0xCC, 42, 5, true, RotelFlagsMapping.MAPPING5),
|
||||
A11("A11", 115200, 4, 96, true, 10, 15, false, -1, false, true, true, 6, 0, SRC_CTRL_CMDS_SET1,
|
||||
|
||||
@@ -19,7 +19,6 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNull;
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.binding.rotel.internal.RotelException;
|
||||
@@ -216,6 +215,7 @@ public enum RotelCommand {
|
||||
ZONE4_SOURCE_INPUT_C("Zone 4 Source Input C", null, "z4:input_c"),
|
||||
ZONE4_SOURCE_INPUT_D("Zone 4 Source Input D", null, "z4:input_d"),
|
||||
STEREO("Stereo", PRIMARY_CMD, (byte) 0x11, "2channel", "2channel"),
|
||||
STEREO_BYPASS_TOGGLE("Stereo / Bypass Toggle", PRIMARY_CMD, (byte) 0x11),
|
||||
STEREO3("Dolby 3 Stereo ", PRIMARY_CMD, (byte) 0x12, "3channel", "3channel"),
|
||||
STEREO5("5 Channel Stereo", PRIMARY_CMD, (byte) 0x5B, "5channel", "5channel"),
|
||||
STEREO7("7 Channel Stereo", PRIMARY_CMD, (byte) 0x5C, "7channel", "7channel"),
|
||||
@@ -244,7 +244,7 @@ public enum RotelCommand {
|
||||
NEO6_CINEMA("dts Neo:6 Cinema", PRIMARY_CMD, (byte) 0x61, "neo6_cinema", "neo6_cinema"),
|
||||
ATMOS("Dolby Atmos", "dolby_atmos", "dolby_atmos"),
|
||||
NEURAL_X("dts Neural:X", "dts_neural", "dts_neural"),
|
||||
BYPASS("Analog Bypass", PRIMARY_CMD, (byte) 0x11, "bypass", "bypass"),
|
||||
BYPASS("Analog Bypass", "bypass", "bypass"),
|
||||
NEXT_MODE("Next Surround Mode", PRIMARY_CMD, (byte) 0x22),
|
||||
DSP_MODE("Request current DSP mode", "get_dsp_mode", null),
|
||||
TONE_MAX("Request Max tone level", "get_tone_max", null),
|
||||
@@ -479,6 +479,9 @@ public enum RotelCommand {
|
||||
public static final List<RotelCommand> DSP_CMDS_SET1 = List.of(DSP_TOGGLE, PROLOGIC_TOGGLE, DOLBY_TOGGLE,
|
||||
PLII_PANORAMA_TOGGLE, PLII_DIMENSION_UP, PLII_DIMENSION_DOWN, PLII_CENTER_WIDTH_UP, PLII_CENTER_WIDTH_DOWN,
|
||||
DDEX_TOGGLE, NEO6_TOGGLE, NEXT_MODE);
|
||||
public static final List<RotelCommand> DSP_CMDS_SET2 = List.of(STEREO_BYPASS_TOGGLE, DSP_TOGGLE, PROLOGIC_TOGGLE,
|
||||
DOLBY_TOGGLE, PLII_PANORAMA_TOGGLE, PLII_DIMENSION_UP, PLII_DIMENSION_DOWN, PLII_CENTER_WIDTH_UP,
|
||||
PLII_CENTER_WIDTH_DOWN, DDEX_TOGGLE, NEO6_TOGGLE, NEXT_MODE);
|
||||
|
||||
public static final List<RotelCommand> SRC_CTRL_CMDS_SET1 = List.of(PLAY, STOP, PAUSE, TRACK_FWD, TRACK_BACK);
|
||||
public static final List<RotelCommand> SRC_CTRL_CMDS_SET2 = List.of(FAST_FWD, FAST_BACK, RANDOM_TOGGLE,
|
||||
@@ -641,7 +644,7 @@ public enum RotelCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NonNull String toString() {
|
||||
public String toString() {
|
||||
return label;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ public enum RotelDsp {
|
||||
CAT2_NEO6_CINEMA(2, "NEO6CINEMA", RotelCommand.NEO6_CINEMA, "dts_neo:6_cinema"),
|
||||
CAT2_NEO6_MUSIC(2, "NEO6MUSIC", RotelCommand.NEO6_MUSIC, "dts_neo:6_music"),
|
||||
|
||||
CAT3_BYPASS(3, "BYPASS", RotelCommand.BYPASS, "analog_bypass"),
|
||||
CAT3_NONE(3, "NONE", RotelCommand.STEREO, "stereo"),
|
||||
CAT3_STEREO3(3, "STEREO3", RotelCommand.STEREO3, "dolby_3_stereo"),
|
||||
CAT3_STEREO5(3, "STEREO5", RotelCommand.STEREO5, "5_channel_stereo"),
|
||||
@@ -72,7 +71,6 @@ public enum RotelDsp {
|
||||
CAT3_NEO6_CINEMA(3, "NEO6CINEMA", RotelCommand.NEO6_CINEMA, "dts_neo:6_cinema"),
|
||||
CAT3_NEO6_MUSIC(3, "NEO6MUSIC", RotelCommand.NEO6_MUSIC, "dts_neo:6_music"),
|
||||
|
||||
CAT4_BYPASS(4, "BYPASS", RotelCommand.BYPASS, "analog_bypass"),
|
||||
CAT4_NONE(4, "NONE", RotelCommand.STEREO, "stereo"),
|
||||
CAT4_STEREO3(4, "STEREO3", RotelCommand.STEREO3, "dolby_3_stereo"),
|
||||
CAT4_STEREO5(4, "STEREO5", RotelCommand.STEREO5, "5_channel_stereo"),
|
||||
|
||||
@@ -61,6 +61,7 @@ public class RotelSimuConnector extends RotelConnector {
|
||||
private RotelSource recordSource;
|
||||
private boolean multiinput;
|
||||
private RotelDsp dsp = RotelDsp.CAT4_NONE;
|
||||
private boolean bypass = false;
|
||||
private int[] volumes = { 50, 10, 20, 30, 40 };
|
||||
private boolean[] mutes = { false, false, false, false, false };
|
||||
private boolean tcbypass;
|
||||
@@ -824,7 +825,7 @@ public class RotelSimuConnector extends RotelConnector {
|
||||
break;
|
||||
case STEREO:
|
||||
dsp = RotelDsp.CAT4_NONE;
|
||||
textLine2 = "STEREO";
|
||||
textLine2 = bypass ? "BYPASS" : "STEREO";
|
||||
textAscii = buildDspAsciiResponse();
|
||||
break;
|
||||
case STEREO3:
|
||||
@@ -914,13 +915,16 @@ public class RotelSimuConnector extends RotelConnector {
|
||||
textAscii = buildDspAsciiResponse();
|
||||
break;
|
||||
case BYPASS:
|
||||
dsp = RotelDsp.CAT4_BYPASS;
|
||||
textLine2 = "BYPASS";
|
||||
dsp = RotelDsp.CAT5_BYPASS;
|
||||
textAscii = buildDspAsciiResponse();
|
||||
break;
|
||||
case DSP_MODE:
|
||||
textAscii = buildDspAsciiResponse();
|
||||
break;
|
||||
case STEREO_BYPASS_TOGGLE:
|
||||
bypass = !bypass;
|
||||
textLine2 = bypass ? "BYPASS" : "STEREO";
|
||||
break;
|
||||
case FREQUENCY:
|
||||
textAscii = model.getNumberOfZones() > 1 ? buildAsciiResponse(KEY_FREQ, "44.1,48,none,176.4")
|
||||
: buildAsciiResponse(KEY_FREQ, "44.1");
|
||||
|
||||
@@ -487,7 +487,7 @@ public class RotelHexProtocolHandler extends RotelAbstractProtocolHandler {
|
||||
logger.debug("Invalid value {} for MULTI IN", value);
|
||||
}
|
||||
} else if (searchDsp && valueLowerCase.startsWith(KEY_HEX_BYPASS)) {
|
||||
dispatchKeyValue(KEY_DSP_MODE, RotelDsp.CAT4_BYPASS.getFeedback());
|
||||
dispatchKeyValue(KEY_DSP_MODE, RotelDsp.CAT4_NONE.getFeedback());
|
||||
} else if (searchDsp && searchStereo && valueLowerCase.startsWith(KEY_HEX_STEREO)) {
|
||||
dispatchKeyValue(KEY_DSP_MODE, RotelDsp.CAT4_NONE.getFeedback());
|
||||
} else if (searchDsp && (valueLowerCase.startsWith(KEY1_HEX_3CH) || valueLowerCase.startsWith(KEY2_HEX_3CH))) {
|
||||
|
||||
@@ -119,6 +119,7 @@ channel-type.rotel.otherCommand.description = Choose the command to send to the
|
||||
channel-type.rotel.otherCommand.command.option.POWER_OFF_ALL_ZONES = Power Off All Zones
|
||||
channel-type.rotel.otherCommand.command.option.REMOTE_VOLUME_UP = Remote Volume Up
|
||||
channel-type.rotel.otherCommand.command.option.REMOTE_VOLUME_DOWN = Remote Volume Down
|
||||
channel-type.rotel.otherCommand.command.option.STEREO_BYPASS_TOGGLE = Stereo / Bypass Toggle
|
||||
channel-type.rotel.otherCommand.command.option.PROLOGIC_TOGGLE = Dolby Pro Logic Toggle
|
||||
channel-type.rotel.otherCommand.command.option.DSP_TOGGLE = DSP Music Mode Toggle
|
||||
channel-type.rotel.otherCommand.command.option.DOLBY_TOGGLE = Dolby 3 Stereo / Pro Logic Toggle
|
||||
|
||||
Reference in New Issue
Block a user