2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.yamahareceiver.internal.protocol;
15 import static java.util.stream.Collectors.toSet;
16 import static org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingConstants.Inputs.*;
18 import java.io.IOException;
20 import java.util.stream.Stream;
23 * The navigation control protocol interface
25 * @author David Graeff - Initial contribution
26 * @author Tomasz Maruszak - refactoring
28 public interface InputWithNavigationControl extends IStateUpdatable {
30 * List all inputs that are compatible with this kind of control
32 Set<String> SUPPORTED_INPUTS = Stream
33 .of(INPUT_NET_RADIO, INPUT_NET_RADIO_LEGACY, INPUT_USB, INPUT_IPOD_USB, INPUT_DOCK, INPUT_PC, INPUT_NAPSTER,
34 INPUT_PANDORA, INPUT_SIRIUS, INPUT_RHAPSODY, INPUT_IPOD, INPUT_HD_RADIO)
40 * @throws ReceivedMessageParseException
43 void goBack() throws ReceivedMessageParseException, IOException;
48 * @throws ReceivedMessageParseException
51 void goUp() throws IOException, ReceivedMessageParseException;
56 * @throws ReceivedMessageParseException
59 void goDown() throws IOException, ReceivedMessageParseException;
62 * Navigate left. Not for all zones or functions available.
64 * @throws ReceivedMessageParseException
67 void goLeft() throws IOException, ReceivedMessageParseException;
70 * Navigate right. Not for all zones or functions available.
72 * @throws ReceivedMessageParseException
75 void goRight() throws IOException, ReceivedMessageParseException;
78 * Select current item. Not for all zones or functions available.
80 * @throws ReceivedMessageParseException
83 void selectCurrentItem() throws IOException, ReceivedMessageParseException;
86 * Navigate to root menu
88 * @throws ReceivedMessageParseException
91 boolean goToRoot() throws IOException, ReceivedMessageParseException;
94 * Navigate to the given page. The Yamaha protocol separates list of items into pages.
96 * @param page The page, starting with 1.
98 * @throws ReceivedMessageParseException
100 void goToPage(int page) throws IOException, ReceivedMessageParseException;
103 * Provide a full path to the menu and menu item
106 * @throws IOException
107 * @throws ReceivedMessageParseException
109 void selectItemFullPath(String fullPath) throws IOException, ReceivedMessageParseException;