]> git.basschouten.com Git - openhab-addons.git/blob
a59e4e918185fd2a2ebe62efb14f851bf91609f9
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.yamahareceiver.internal.protocol;
14
15 import static java.util.stream.Collectors.toSet;
16 import static org.openhab.binding.yamahareceiver.internal.YamahaReceiverBindingConstants.Inputs.*;
17
18 import java.io.IOException;
19 import java.util.Set;
20 import java.util.stream.Stream;
21
22 /**
23  * The navigation control protocol interface
24  *
25  * @author David Graeff - Initial contribution
26  * @author Tomasz Maruszak - refactoring
27  */
28 public interface InputWithNavigationControl extends IStateUpdatable {
29     /**
30      * List all inputs that are compatible with this kind of control
31      */
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)
35             .collect(toSet());
36
37     /**
38      * Navigate back
39      *
40      * @throws ReceivedMessageParseException, IOException
41      */
42     void goBack() throws ReceivedMessageParseException, IOException;
43
44     /**
45      * Navigate up
46      *
47      * @throws ReceivedMessageParseException, IOException
48      */
49     void goUp() throws IOException, ReceivedMessageParseException;
50
51     /**
52      * Navigate down
53      *
54      * @throws ReceivedMessageParseException, IOException
55      */
56     void goDown() throws IOException, ReceivedMessageParseException;
57
58     /**
59      * Navigate left. Not for all zones or functions available.
60      *
61      * @throws ReceivedMessageParseException, IOException
62      */
63     void goLeft() throws IOException, ReceivedMessageParseException;
64
65     /**
66      * Navigate right. Not for all zones or functions available.
67      *
68      * @throws ReceivedMessageParseException, IOException
69      */
70     void goRight() throws IOException, ReceivedMessageParseException;
71
72     /**
73      * Select current item. Not for all zones or functions available.
74      *
75      * @throws ReceivedMessageParseException, IOException
76      */
77     void selectCurrentItem() throws IOException, ReceivedMessageParseException;
78
79     /**
80      * Navigate to root menu
81      *
82      * @throws ReceivedMessageParseException, IOException
83      */
84     boolean goToRoot() throws IOException, ReceivedMessageParseException;
85
86     /**
87      * Navigate to the given page. The Yamaha protocol separates list of items into pages.
88      *
89      * @param page The page, starting with 1.
90      * @throws IOException
91      * @throws ReceivedMessageParseException
92      */
93     void goToPage(int page) throws IOException, ReceivedMessageParseException;
94
95     /**
96      * Provide a full path to the menu and menu item
97      *
98      * @param fullPath
99      * @throws IOException
100      * @throws ReceivedMessageParseException
101      */
102     void selectItemFullPath(String fullPath) throws IOException, ReceivedMessageParseException;
103 }