Skip to content

Latest commit

 

History

History
87 lines (71 loc) · 3.58 KB

README.adoc

File metadata and controls

87 lines (71 loc) · 3.58 KB

LineDJ Radio Player

This module implements a player for internet radio streams.

Functionality

The radio player application comes with a minimum UI that has two buttons for starting and stopping playback, and a combo box for selecting the radio source to be played. A status line shows some information about the currently played radio source. If supported by the radio station, metadata about the stream is retrieved and displayed; this typically contains information about the currently played title and artist.

Radio sources are defined in a configuration file (see below). In the future, there may be a graphical editor for the configuration of radio sources, but currently all configuration has to be done manually.

What makes this application special, is the option to define under which conditions a specific radio source should not be played. Exclusion criteria can be defined in the configuration for radio sources based on

  • temporal intervals

  • metadata information provided by the radio source

The radio player monitors these exclusion criteria continuously and automatically switches to a replacement source when a match is found. When the exclusion no longer applies, playback switches back to the original source. That way unwanted content can be skipped, for instance artists or songs you do not like or blocks with advertisements.

Installation

The radio player application is an OSGi application. It requires an OSGi framework for its execution and has to be setup accordingly. The main Build file has a subproject named radioOsgiImage that generates an executable OSGi image for this application. Note that you may have to tweak the build to adapt the image to the OSGi framework of your choice. Information how this is done and about OSGi images in general is available in the README of the images folder.

Provided that you have a working build configuration, start sbt passing it the path to your OSGi image templates, e.g.

sbt -mem 4096 -Dosgi.image.rootPath=/data/dev/osgi-templates

Then execute the following commands:

$ project radioOsgiImage
$ clean
$ osgiImage

This compiles the necessary projects and generates the executable OSGi image in the folder ../images/radio/target/image/.

Configuration

The application uses the Radio player engine config module to load the configuration of the radio player engine. Refer to this module for further details.

In addition to the settings supported by the radio player engine, there are some specific options for this player application. They are listed in the table below:

Table 1. Radio player configuration options
Property Description

metadataMaxLen

The maximum length of a text that can be displayed directly in the field for metadata. Longer texts are shortened and rotated.

metadataRotateSpeed

If metadata exceeds the length configured via the metadataMaxLen property, the text is rotated, so that all characters are eventually visible. The rotation speed is based on the playback time with an additional factor specified by this property. It basically means the number of characters that are rotated per second. A value of 2.0 for instance means two characters - one every 500 milliseconds. Note that rotation depends on the update of current playback time. Here an update occurs every 100 milliseconds; therefore, one rotation step every 100 milliseconds is also the limit for the rotation speed.