]> git.basschouten.com Git - openhab-addons.git/blob
e06f3de752adfbb3b6df65f50753a8ffa4fe8ccf
[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 play controls protocol interface
24  *
25  * @author David Graeff - Initial contribution
26  * @author Tomasz Maruszak - Spotify support, adding Server to supported preset inputs
27  */
28 public interface InputWithPlayControl extends IStateUpdatable {
29     /**
30      * List all inputs that are compatible with this kind of control
31      */
32     Set<String> SUPPORTED_INPUTS = Stream.of(INPUT_NET_RADIO, INPUT_NET_RADIO_LEGACY, INPUT_USB, INPUT_IPOD_USB,
33             INPUT_IPOD, INPUT_DOCK, INPUT_PC, INPUT_NAPSTER, INPUT_PANDORA, INPUT_SIRIUS, INPUT_RHAPSODY,
34             INPUT_BLUETOOTH, INPUT_SPOTIFY, INPUT_SERVER, INPUT_HD_RADIO).collect(toSet());
35
36     /**
37      * Start the playback of the content which is usually selected by the means of the Navigation control class or
38      * which has been stopped by stop().
39      *
40      * @throws IOException
41      * @throws ReceivedMessageParseException
42      */
43     void play() throws IOException, ReceivedMessageParseException;
44
45     /**
46      * Stop the currently playing content. Use start() to start again.
47      *
48      * @throws IOException
49      * @throws ReceivedMessageParseException
50      */
51     void stop() throws IOException, ReceivedMessageParseException;
52
53     /**
54      * Pause the currently playing content. This is not available for streaming content like on NET_RADIO.
55      *
56      * @throws IOException
57      * @throws ReceivedMessageParseException
58      */
59     void pause() throws IOException, ReceivedMessageParseException;
60
61     /**
62      * Skip forward. This is not available for streaming content like on NET_RADIO.
63      *
64      * @throws IOException
65      * @throws ReceivedMessageParseException
66      */
67     void skipFF() throws IOException, ReceivedMessageParseException;
68
69     /**
70      * Skip reverse. This is not available for streaming content like on NET_RADIO.
71      *
72      * @throws IOException
73      * @throws ReceivedMessageParseException
74      */
75     void skipREV() throws IOException, ReceivedMessageParseException;
76
77     /**
78      * Next track. This is not available for streaming content like on NET_RADIO.
79      *
80      * @throws IOException
81      * @throws ReceivedMessageParseException
82      */
83     void nextTrack() throws IOException, ReceivedMessageParseException;
84
85     /**
86      * Previous track. This is not available for streaming content like on NET_RADIO.
87      *
88      * @throws IOException
89      * @throws ReceivedMessageParseException
90      */
91     void previousTrack() throws IOException, ReceivedMessageParseException;
92 }