2 * Copyright (c) 2010-2022 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.pulseaudio.internal.items;
15 import java.util.ArrayList;
16 import java.util.List;
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
23 * @author Tobias Bräutigam - Initial contribution
25 public class Sink extends AbstractAudioDeviceConfig {
27 protected List<String> combinedSinkNames;
28 protected List<Sink> combinedSinks;
30 public Sink(int id, String name, Module module) {
31 super(id, name, module);
32 combinedSinkNames = new ArrayList<>();
33 combinedSinks = new ArrayList<>();
36 public void addCombinedSinkName(String name) {
37 this.combinedSinkNames.add(name);
40 public boolean isCombinedSink() {
41 return !combinedSinkNames.isEmpty();
44 public List<String> getCombinedSinkNames() {
45 return combinedSinkNames;
48 public List<Sink> getCombinedSinks() {
52 public void setCombinedSinks(List<Sink> combinedSinks) {
53 this.combinedSinks = combinedSinks;
56 public void addCombinedSink(Sink sink) {
58 this.combinedSinks.add(sink);