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 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.eclipse.jdt.annotation.Nullable;
23 * On a Pulseaudio server Sinks are the devices the audio streams are routed to
24 * (playback devices) it can be a single item or a group of other Sinks that are
25 * combined to one playback device
27 * @author Tobias Bräutigam - Initial contribution
30 public class Sink extends AbstractAudioDeviceConfig {
32 protected List<String> combinedSinkNames;
33 protected List<Sink> combinedSinks;
35 public Sink(int id, String name, String description, Map<String, String> properties, @Nullable Module module) {
36 super(id, name, description, properties, module);
37 combinedSinkNames = new ArrayList<>();
38 combinedSinks = new ArrayList<>();
41 public void addCombinedSinkName(String name) {
42 this.combinedSinkNames.add(name);
45 public boolean isCombinedSink() {
46 return !combinedSinkNames.isEmpty();
49 public List<String> getCombinedSinkNames() {
50 return combinedSinkNames;
53 public List<Sink> getCombinedSinks() {
57 public void setCombinedSinks(List<Sink> combinedSinks) {
58 this.combinedSinks = combinedSinks;
61 public void addCombinedSink(@Nullable Sink sink) {
63 this.combinedSinks.add(sink);