Extension qnx.radio

qnx.radio

Allow control of radio tuners, presets, and stations

Methods

getActiveTuner

Get the active tuner name. NOTE: if you require more details about the tuner, use the getTuners method to get detailed information.
Returns:
The active tuner name
Type
  • String

getMetadata

Get the current station metadata
Returns:
A station metadata object
Type
  • Object
Example
{
    tuner: {String},         //tuner name, e.g. 'fm'
    station: {Number},       //current station, e.g. 91.5
    artist: {String},        //current artist, e.g. 'Bjork'
    genre: {String},         //current genre, e.g. 'News & Entertainment'
    song: {String},          //current song title, e.g. 'All is Full of Love'
    stationName: {String},   //current station name, e.g. 'CBC Radio 1'
    hd: {Boolean},           //true if station is HD, otherwise false
}

getPresets

Get the presets for the current tuner. Optionally, a tuner name can be specified, returning presets for the specified tuner.
Parameters:
Name Type Description
tuner String The tuner of the presets [optional]; if not specified, the active tuner is used
Returns:
An object containing an attribute corresponding to the tuner name with its associated preset list
Type
  • Object
Example
{
    {String}:        //tuner name .e.g.: 'am'
    {Array}:         //Array of stations e.g.: [1200, 1210, 1340, 1400, 1400, 1500],
}

getStation

Get the current station for the active tuner
Parameters:
Name Type Description
tuner String The station tune name [optional]; if not specified, the current station for the active tuner is returned
Returns:
The current station
Type
  • Number

getTuners

Return the list of available tuners
Returns:
An object containing attributes corresponding to each tuner object. The attribute name is the name of the tuner.
Type
  • Object
Example
{
{String}:    {               //tuner name, e.g. 'am'
    type: {String},         //type of tuner, e.g. 'analog'
    rangeMin: {Number},     //the minimum frequency of the tuner, e.g. 880
    rangeMax: {Number},     //the maximum frequency of teh tuner, e.g. 1710
    rangeStep: {Number},    //the step between tuner frequencies 10
            },
}

scan

Call this method to scan for available radio stations in the given direction
Parameters:
Name Type Description
direction String The direction to seek ('up' or 'down')

scanStop

Stop station scanning if in progress

seek

Call this method to seek for the next radio station in the given direction
Parameters:
Name Type Description
direction String The direction to seek ('up' or 'down')

setPreset

Set the current station as a preset at the specified index. You can optionally specify a different station and tuner as a preset.
Parameters:
Name Type Description
index Number The preset index
station Number The station to set as the preset [optional]; if this is not specified, the current station is used
tuner String The station's tuner [optional]; if not specified, the active tuner is used

setPresets

Set the entire list of presets for the specified tuner(s)
Parameters:
Name Type Description
presets Object An object containing one or more tuner preset lists
Example
{
{String}:                    //tuner name. e.g.: 'am'
    {Array}:                //Array of stations. Ex: [1200, 1210, 1340, 1400, 1400, 1500],
{String}:                    //tuner name. e.g.: 'fm'
    {Array}                 //Array of stations. Ex: [87.9, 91.5, 95.1, 103.4, 105.1, 107.1],
}

setStation

Tune to a specific station, optionally targeting a specific tuner. If the specified tuner is not the active tuner, then the station will be automatically selected the next time that tuner is set as active.
Parameters:
Name Type Description
station Number The target station
tuner String The target tuner name [optional]; if not specified, the active tuner is used

setTuner

Set the active tuner by name
Parameters:
Name Type Description
tuner String The name of tuner to set as active