Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
noux
README
list.h
main.cc
ring_buffer.h
target.mk

README

This directory contains a rudimentary audio player. It plays all tracks from
a given playlist and reports the currently playing track.


Configuration
~~~~~~~~~~~~~

A typical example configuration looks as follows:

! <config>
!   <report progress="yes" interval="3" playlist="yes"/>
!   <libc>
!     <vfs>
!       <rom name="foo.flac"/>
!       <rom name="foo.mp3"/>
!       <rom name="foo.ogg"/>
!     </vfs>
!   </libc>
! </config>

The audio player obtains its audio files from the libc VFS. In this example,
the VFS is configured to present three ROM modules as files in the root
directory. In addition the audio player requests another ROM module that
contains the actual playlist:

! <playlist mode="repeat">
!   <track path="foo.ogg"/>
!   <track path="foo.flac"/>
! </playlist>

The prior mentioned files are then referred to by the subsequent '<track>'
nodes within the '<playlist>' node. How the player processes the playlist is
specified via the 'mode' attribute. Valid values are 'once' and 'repeat'
whereat 'once' is the default mode. Everytime the playlist is altered, the
audio player updates its internal representation of the playlist but keeps
playing the current track till its end.

Playback can be paused, stopped and of course started again by setting the
'state' attribute of the '<config>' node to 'playing', 'paused' or 'stopped'.
The player is automatically stopped if the 'state' attribute is missing.
When playback is started the player starts playing at the first track of the
playlist. Furthermore the player can be instructed to start at a different
track by specifying the number of the track in the 'selected_track' attribute.
This attribute may also be used to select a different track while the player
is playing.

The initial configuration must include the VFS configuration, all following
configurations may safely ommit it.


Status reporting
~~~~~~~~~~~~~~~~

Every time the player changes the track it generates a report that contains
information about the track that is now being played. A typical report looks
like this:

! <current_track id="1" path="foo.ogg" artist="Foobar" album="SNAFU" title="blubb" duration="60000"/>

The duration is given in milliseconds.

When the 'report' node is present in the configuration additional reports
are generated. If the 'progress' attribute is set to 'yes' the player will
report the current progress in the 'current_track' report. The frequencey
of reporting is specified by setting the 'interval' attribute. The interval
is given in seconds. if the 'playlist' attribute is set to 'yes' the
player will generate a report containing the playlist but each '<track>' node
is enriched by the meta information of each track like in the 'current_track'
report.


Example
~~~~~~~

Please refer to the _gems/run/audio_player.run_ script for a practical example of
using the audio player.

There is also a selection of bash scripts in _gems/src/app/audio_player/noux_
which can be used from Noux to control the audio player.