]> git.basschouten.com Git - openhab-addons.git/blob
4e3ec0a6e505b11279cc51872ff88c17ce438f8e
[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.heos.internal.json.payload;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 import com.google.gson.annotations.SerializedName;
19
20 /**
21  * Data class for response payloads from now_playing commands
22  *
23  * @author Martin van Wingerden - Initial contribution
24  */
25 @NonNullByDefault
26 public class Media {
27     public static final int SOURCE_PANDORA = 1;
28     public static final int SOURCE_RHAPSODY = 2;
29     public static final int SOURCE_TUNE_IN = 3;
30     public static final int SOURCE_SPOTIFY = 4;
31     public static final int SOURCE_DEEZER = 5;
32     public static final int SOURCE_NAPSTER = 6;
33     public static final int SOURCE_I_HEART_RADIO = 7;
34     public static final int SOURCE_SIRIUS_XM = 8;
35     public static final int SOURCE_SOUNDCLOUD = 9;
36     public static final int SOURCE_TIDAL = 10;
37     // public static final int SOURCE_FUTURE_SERVICE = 11;
38     public static final int SOURCE_RDIO = 12;
39     public static final int SOURCE_AMAZON_MUSIC = 13;
40     // public static final int SOURCE_FUTURE_SERVICE = 14;
41     public static final int SOURCE_MOODMIX = 15;
42     public static final int SOURCE_JUKE = 16;
43     // public static final int SOURCE_FUTURE_SERVICE = 17;
44     public static final int SOURCE_Q_Q_MUSIC = 18;
45
46     public static final int SOURCE_LOCAL = 1024;
47     public static final int SOURCE_PLAYLIST = 1025;
48     public static final int SOURCE_HISTORY = 1026;
49     public static final int SOURCE_AUX = 1027;
50     public static final int SOURCE_FAVORITES = 1028;
51
52     public @Nullable String type;
53     public @Nullable String song;
54     public @Nullable String station;
55     public @Nullable String album;
56     public @Nullable String artist;
57     public @Nullable String imageUrl;
58     public @Nullable String albumId;
59     @SerializedName("mid")
60     public @Nullable String mediaId;
61     @SerializedName("qid")
62     public int queueId;
63     @SerializedName("sid")
64     public int sourceId;
65
66     public String combinedSongArtist() {
67         return String.format("%s - %s", artist, song);
68     }
69
70     @Override
71     public String toString() {
72         return "Media{" + "type='" + type + '\'' + ", song='" + song + '\'' + ", station='" + station + '\''
73                 + ", album='" + album + '\'' + ", artist='" + artist + '\'' + ", imageUrl='" + imageUrl + '\''
74                 + ", albumId='" + albumId + '\'' + ", mediaId='" + mediaId + '\'' + ", queueId=" + queueId
75                 + ", sourceId=" + sourceId + '}';
76     }
77 }