[squeezebox] Add new channels for additional tags (#14201)
* New channels for additional tags Signed-off-by: Mark Hilbush <mark@hilbush.com>
This commit is contained in:
parent
a1ef87cca9
commit
858ff4b244
@ -115,6 +115,11 @@ All devices support some of the following channels:
|
|||||||
| artist | String | Artist name of the current song |
|
| artist | String | Artist name of the current song |
|
||||||
| year | String | Release year of the current song |
|
| year | String | Release year of the current song |
|
||||||
| genre | String | Genre name of the current song |
|
| genre | String | Genre name of the current song |
|
||||||
|
| albumArtist | String | Main artist of the entire album |
|
||||||
|
| trackArtist | String | Main artist of the track |
|
||||||
|
| band | String | Band/orchestra that performed the work |
|
||||||
|
| composer | String | Original composer of the work |
|
||||||
|
| conductor | String | Person who conducted the performance |
|
||||||
| coverartdata | Image | Image data of cover art of the current song |
|
| coverartdata | Image | Image data of cover art of the current song |
|
||||||
| ircode | String | Received IR code |
|
| ircode | String | Received IR code |
|
||||||
| numberPlaylistTracks | Number | Number of playlist tracks |
|
| numberPlaylistTracks | Number | Number of playlist tracks |
|
||||||
|
|||||||
@ -59,6 +59,11 @@ public class SqueezeBoxBindingConstants {
|
|||||||
public static final String CHANNEL_ARTIST = "artist";
|
public static final String CHANNEL_ARTIST = "artist";
|
||||||
public static final String CHANNEL_YEAR = "year";
|
public static final String CHANNEL_YEAR = "year";
|
||||||
public static final String CHANNEL_GENRE = "genre";
|
public static final String CHANNEL_GENRE = "genre";
|
||||||
|
public static final String CHANNEL_ALBUM_ARTIST = "albumArtist";
|
||||||
|
public static final String CHANNEL_TRACK_ARTIST = "trackArtist";
|
||||||
|
public static final String CHANNEL_BAND = "band";
|
||||||
|
public static final String CHANNEL_COMPOSER = "composer";
|
||||||
|
public static final String CHANNEL_CONDUCTOR = "conductor";
|
||||||
public static final String CHANNEL_COVERART_DATA = "coverartdata";
|
public static final String CHANNEL_COVERART_DATA = "coverartdata";
|
||||||
public static final String CHANNEL_IRCODE = "ircode";
|
public static final String CHANNEL_IRCODE = "ircode";
|
||||||
public static final String CHANNEL_IP = "ip";
|
public static final String CHANNEL_IP = "ip";
|
||||||
|
|||||||
@ -191,6 +191,26 @@ public class SqueezeBoxPlayerDiscoveryParticipant extends AbstractDiscoveryServi
|
|||||||
public void genreChangeEvent(String mac, String genre) {
|
public void genreChangeEvent(String mac, String genre) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void albumArtistChangeEvent(String mac, String albumArtist) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void trackArtistChangeEvent(String mac, String trackArtist) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bandChangeEvent(String mac, String band) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void composerChangeEvent(String mac, String composer) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void conductorChangeEvent(String mac, String conductor) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remoteTitleChangeEvent(String mac, String title) {
|
public void remoteTitleChangeEvent(String mac, String title) {
|
||||||
}
|
}
|
||||||
|
|||||||
@ -201,6 +201,26 @@ public final class SqueezeBoxNotificationListener implements SqueezeBoxPlayerEve
|
|||||||
public void genreChangeEvent(String mac, String genre) {
|
public void genreChangeEvent(String mac, String genre) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void albumArtistChangeEvent(String mac, String albumArtist) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void trackArtistChangeEvent(String mac, String trackArtist) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bandChangeEvent(String mac, String band) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void composerChangeEvent(String mac, String composer) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void conductorChangeEvent(String mac, String conductor) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remoteTitleChangeEvent(String mac, String title) {
|
public void remoteTitleChangeEvent(String mac, String title) {
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,6 +73,16 @@ public interface SqueezeBoxPlayerEventListener {
|
|||||||
|
|
||||||
void genreChangeEvent(String mac, String genre);
|
void genreChangeEvent(String mac, String genre);
|
||||||
|
|
||||||
|
void albumArtistChangeEvent(String mac, String albumArtist);
|
||||||
|
|
||||||
|
void trackArtistChangeEvent(String mac, String trackArtist);
|
||||||
|
|
||||||
|
void bandChangeEvent(String mac, String band);
|
||||||
|
|
||||||
|
void composerChangeEvent(String mac, String composer);
|
||||||
|
|
||||||
|
void conductorChangeEvent(String mac, String conductor);
|
||||||
|
|
||||||
void remoteTitleChangeEvent(String mac, String title);
|
void remoteTitleChangeEvent(String mac, String title);
|
||||||
|
|
||||||
void irCodeChangeEvent(String mac, String ircode);
|
void irCodeChangeEvent(String mac, String ircode);
|
||||||
|
|||||||
@ -436,6 +436,31 @@ public class SqueezeBoxPlayerHandler extends BaseThingHandler implements Squeeze
|
|||||||
updateChannel(mac, CHANNEL_ARTIST, new StringType(artist));
|
updateChannel(mac, CHANNEL_ARTIST, new StringType(artist));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void albumArtistChangeEvent(String mac, String albumArtist) {
|
||||||
|
updateChannel(mac, CHANNEL_ALBUM_ARTIST, new StringType(albumArtist));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void trackArtistChangeEvent(String mac, String trackArtist) {
|
||||||
|
updateChannel(mac, CHANNEL_TRACK_ARTIST, new StringType(trackArtist));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bandChangeEvent(String mac, String band) {
|
||||||
|
updateChannel(mac, CHANNEL_BAND, new StringType(band));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void composerChangeEvent(String mac, String composer) {
|
||||||
|
updateChannel(mac, CHANNEL_COMPOSER, new StringType(composer));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void conductorChangeEvent(String mac, String conductor) {
|
||||||
|
updateChannel(mac, CHANNEL_CONDUCTOR, new StringType(conductor));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void coverArtChangeEvent(String mac, String coverArtUrl) {
|
public void coverArtChangeEvent(String mac, String coverArtUrl) {
|
||||||
updateChannel(mac, CHANNEL_COVERART_DATA, createImage(downloadImage(mac, coverArtUrl)));
|
updateChannel(mac, CHANNEL_COVERART_DATA, createImage(downloadImage(mac, coverArtUrl)));
|
||||||
|
|||||||
@ -576,7 +576,7 @@ public class SqueezeBoxServerHandler extends BaseBridgeHandler {
|
|||||||
players.put(macAddress, player);
|
players.put(macAddress, player);
|
||||||
updatePlayer(listener -> listener.playerAdded(player));
|
updatePlayer(listener -> listener.playerAdded(player));
|
||||||
// tell the server we want to subscribe to player updates
|
// tell the server we want to subscribe to player updates
|
||||||
sendCommand(player.macAddress + " status - 1 subscribe:10 tags:yagJlNKjc");
|
sendCommand(player.macAddress + " status - 1 subscribe:10 tags:yagJlNKjcA");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (final SqueezeBoxPlayer player : players.values()) {
|
for (final SqueezeBoxPlayer player : players.values()) {
|
||||||
@ -674,7 +674,8 @@ public class SqueezeBoxServerHandler extends BaseBridgeHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void handleStatusMessage(final String mac, String[] messageParts) {
|
private void handleStatusMessage(final String mac, String[] messageParts) {
|
||||||
String remoteTitle = "", artist = "", album = "", genre = "", year = "";
|
String remoteTitle = "", artist = "", album = "", genre = "", year = "", albumArtist = "", trackArtist = "",
|
||||||
|
band = "", composer = "", conductor = "";
|
||||||
boolean coverart = false;
|
boolean coverart = false;
|
||||||
String coverid = null;
|
String coverid = null;
|
||||||
String artworkUrl = null;
|
String artworkUrl = null;
|
||||||
@ -745,6 +746,26 @@ public class SqueezeBoxServerHandler extends BaseBridgeHandler {
|
|||||||
else if ("genre".equals(entry.key)) {
|
else if ("genre".equals(entry.key)) {
|
||||||
genre = entry.value;
|
genre = entry.value;
|
||||||
}
|
}
|
||||||
|
// Parameter Album Artist
|
||||||
|
else if ("albumartist".equals(entry.key)) {
|
||||||
|
albumArtist = entry.value;
|
||||||
|
}
|
||||||
|
// Parameter Track Artist
|
||||||
|
else if ("trackartist".equals(entry.key)) {
|
||||||
|
trackArtist = entry.value;
|
||||||
|
}
|
||||||
|
// Parameter Band
|
||||||
|
else if ("band".equals(entry.key)) {
|
||||||
|
band = entry.value;
|
||||||
|
}
|
||||||
|
// Parameter Composer
|
||||||
|
else if ("composer".equals(entry.key)) {
|
||||||
|
composer = entry.value;
|
||||||
|
}
|
||||||
|
// Parameter Conductor
|
||||||
|
else if ("conductor".equals(entry.key)) {
|
||||||
|
conductor = entry.value;
|
||||||
|
}
|
||||||
// Parameter Year
|
// Parameter Year
|
||||||
else if ("year".equals(entry.key)) {
|
else if ("year".equals(entry.key)) {
|
||||||
year = entry.value;
|
year = entry.value;
|
||||||
@ -776,6 +797,11 @@ public class SqueezeBoxServerHandler extends BaseBridgeHandler {
|
|||||||
final String finalAlbum = album;
|
final String finalAlbum = album;
|
||||||
final String finalGenre = genre;
|
final String finalGenre = genre;
|
||||||
final String finalYear = year;
|
final String finalYear = year;
|
||||||
|
final String finalAlbumArtist = albumArtist;
|
||||||
|
final String finalTrackArtist = trackArtist;
|
||||||
|
final String finalBand = band;
|
||||||
|
final String finalComposer = composer;
|
||||||
|
final String finalConductor = conductor;
|
||||||
|
|
||||||
updatePlayer(listener -> {
|
updatePlayer(listener -> {
|
||||||
listener.coverArtChangeEvent(mac, finalUrl);
|
listener.coverArtChangeEvent(mac, finalUrl);
|
||||||
@ -784,6 +810,11 @@ public class SqueezeBoxServerHandler extends BaseBridgeHandler {
|
|||||||
listener.albumChangeEvent(mac, finalAlbum);
|
listener.albumChangeEvent(mac, finalAlbum);
|
||||||
listener.genreChangeEvent(mac, finalGenre);
|
listener.genreChangeEvent(mac, finalGenre);
|
||||||
listener.yearChangeEvent(mac, finalYear);
|
listener.yearChangeEvent(mac, finalYear);
|
||||||
|
listener.albumArtistChangeEvent(mac, finalAlbumArtist);
|
||||||
|
listener.trackArtistChangeEvent(mac, finalTrackArtist);
|
||||||
|
listener.bandChangeEvent(mac, finalBand);
|
||||||
|
listener.composerChangeEvent(mac, finalComposer);
|
||||||
|
listener.conductorChangeEvent(mac, finalConductor);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -79,6 +79,11 @@
|
|||||||
<channel id="artist" typeId="artist"/>
|
<channel id="artist" typeId="artist"/>
|
||||||
<channel id="year" typeId="year"/>
|
<channel id="year" typeId="year"/>
|
||||||
<channel id="genre" typeId="genre"/>
|
<channel id="genre" typeId="genre"/>
|
||||||
|
<channel id="albumArtist" typeId="albumArtist"/>
|
||||||
|
<channel id="trackArtist" typeId="trackArtist"/>
|
||||||
|
<channel id="band" typeId="band"/>
|
||||||
|
<channel id="composer" typeId="composer"/>
|
||||||
|
<channel id="conductor" typeId="conductor"/>
|
||||||
<channel id="coverartdata" typeId="coverartdata"/>
|
<channel id="coverartdata" typeId="coverartdata"/>
|
||||||
<channel id="ircode" typeId="ircode"/>
|
<channel id="ircode" typeId="ircode"/>
|
||||||
<channel id="numberPlaylistTracks" typeId="numberPlaylistTracks"/>
|
<channel id="numberPlaylistTracks" typeId="numberPlaylistTracks"/>
|
||||||
@ -282,6 +287,36 @@
|
|||||||
<description>Genre name of the current song</description>
|
<description>Genre name of the current song</description>
|
||||||
<state readOnly="true" pattern="%s"></state>
|
<state readOnly="true" pattern="%s"></state>
|
||||||
</channel-type>
|
</channel-type>
|
||||||
|
<channel-type id="albumArtist" advanced="true">
|
||||||
|
<item-type>String</item-type>
|
||||||
|
<label>Album Artist</label>
|
||||||
|
<description>Main artist for the album</description>
|
||||||
|
<state readOnly="true" pattern="%s"></state>
|
||||||
|
</channel-type>
|
||||||
|
<channel-type id="trackArtist" advanced="true">
|
||||||
|
<item-type>String</item-type>
|
||||||
|
<label>Track Artist</label>
|
||||||
|
<description>Main artist for the track</description>
|
||||||
|
<state readOnly="true" pattern="%s"></state>
|
||||||
|
</channel-type>
|
||||||
|
<channel-type id="band" advanced="true">
|
||||||
|
<item-type>String</item-type>
|
||||||
|
<label>Band/Orchestra</label>
|
||||||
|
<description>Band/orchestra performing the work</description>
|
||||||
|
<state readOnly="true" pattern="%s"></state>
|
||||||
|
</channel-type>
|
||||||
|
<channel-type id="composer" advanced="true">
|
||||||
|
<item-type>String</item-type>
|
||||||
|
<label>Composer</label>
|
||||||
|
<description>Original composer of the work</description>
|
||||||
|
<state readOnly="true" pattern="%s"></state>
|
||||||
|
</channel-type>
|
||||||
|
<channel-type id="conductor" advanced="true">
|
||||||
|
<item-type>String</item-type>
|
||||||
|
<label>Conductor</label>
|
||||||
|
<description>Conductor</description>
|
||||||
|
<state readOnly="true" pattern="%s"></state>
|
||||||
|
</channel-type>
|
||||||
<channel-type id="coverartdata">
|
<channel-type id="coverartdata">
|
||||||
<item-type>Image</item-type>
|
<item-type>Image</item-type>
|
||||||
<label>Cover Art</label>
|
<label>Cover Art</label>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user