]> git.basschouten.com Git - openhab-addons.git/blob
ce4771bc02fc1bce61204a8634cf8a772b107316
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.pulseaudio.internal.items;
14
15 import java.util.ArrayList;
16 import java.util.List;
17
18 /**
19  * On a Pulseaudio server Sinks are the devices the audio streams are routed to
20  * (playback devices) it can be a single item or a group of other Sinks that are
21  * combined to one playback device
22  *
23  * @author Tobias Bräutigam - Initial contribution
24  */
25 public class Sink extends AbstractAudioDeviceConfig {
26
27     protected List<String> combinedSinkNames;
28     protected List<Sink> combinedSinks;
29
30     public Sink(int id, String name, Module module) {
31         super(id, name, module);
32         combinedSinkNames = new ArrayList<>();
33         combinedSinks = new ArrayList<>();
34     }
35
36     public void addCombinedSinkName(String name) {
37         this.combinedSinkNames.add(name);
38     }
39
40     public boolean isCombinedSink() {
41         return !combinedSinkNames.isEmpty();
42     }
43
44     public List<String> getCombinedSinkNames() {
45         return combinedSinkNames;
46     }
47
48     public List<Sink> getCombinedSinks() {
49         return combinedSinks;
50     }
51
52     public void setCombinedSinks(List<Sink> combinedSinks) {
53         this.combinedSinks = combinedSinks;
54     }
55
56     public void addCombinedSink(Sink sink) {
57         if (sink != null) {
58             this.combinedSinks.add(sink);
59         }
60     }
61 }