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;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
22 * On a Pulseaudio server Sinks are the devices the audio streams are routed to
23 * (playback devices) it can be a single item or a group of other Sinks that are
24 * combined to one playback device
26 * @author Tobias Bräutigam - Initial contribution
29 public class Sink extends AbstractAudioDeviceConfig {
31 protected List<String> combinedSinkNames;
32 protected List<Sink> combinedSinks;
34 public Sink(int id, String name, @Nullable Module module) {
35 super(id, name, module);
36 combinedSinkNames = new ArrayList<>();
37 combinedSinks = new ArrayList<>();
40 public void addCombinedSinkName(String name) {
41 this.combinedSinkNames.add(name);
44 public boolean isCombinedSink() {
45 return !combinedSinkNames.isEmpty();
48 public List<String> getCombinedSinkNames() {
49 return combinedSinkNames;
52 public List<Sink> getCombinedSinks() {
56 public void setCombinedSinks(List<Sink> combinedSinks) {
57 this.combinedSinks = combinedSinks;
60 public void addCombinedSink(@Nullable Sink sink) {
62 this.combinedSinks.add(sink);