Class: DetectorHandler

DetectorHandler()

new DetectorHandler()

Handles all the detectors, organized in categories under the same object
Source:

Methods

(static) addDetector(detectorObj)

Add a new detector to the DetectorHandler object.
Parameters:
Name Type Description
detectorObj Object Detector object. It is added unded the corresponding category. After adding it, the benchmarking process begins. This process also sets the delay and realTime attributes.
Source:

(static) analyseMedia(mediaType, lookingFor, mediaPath) → {Promise.<number>}

Analyse the media passed as an argument looking for affective data.
Parameters:
Name Type Description
mediaType string Type of media passed. E.g. image, video, sound or text.
lookingFor Array List of affective channels that must be analysed. E.g. face, voice, text, signal, etc.
mediaPath string Path to the media file, local or remote.
Source:
Returns:
Promise with the number of detectors that could attend the request.
Type
Promise.<number>

(static) filter(filteringFunction) → {number}

Filter all detectors by a certain criteria
Parameters:
Name Type Description
filteringFunction function Function to apply in a filter.
Source:
Returns:
Number of detectors filtered
Type
number

(static) getChannelResults(channel, resulsType) → {Array|Object}

Get results from a specific channel in a specific format
Parameters:
Name Type Description
channel string Name of the channel from which the results are requested.
resulsType string Format desired for the results. E.g. pad or raw.
Source:
Returns:
Array with the results or a object with a string holding the error message.
Type
Array | Object

(static) getChannels(channelNames) → {Array.<Detector>}

Return array of channels
Parameters:
Name Type Description
channelNames Array Array of strings of channel names.
Source:
Returns:
Array of channels (being a channel an array of Detector)
Type
Array.<Detector>

(static) getChannelsKeys() → {Array}

Return array of channels
Source:
Returns:
Array of channels
Type
Array

(static) getDetectors() → {Array}

Return all the detectors in a single array
Source:
Returns:
Array with all the detectors in DetectorHandler.
Type
Array

(static) lengthDetectors() → {number}

Return total number of detectors
Source:
Returns:
Total number of detectors.
Type
number

(static) quitCategory(types) → {number}

Remove a whole category of detectors
Parameters:
Name Type Description
types Array | string String of a single type or array of several types.
Source:
Returns:
Number of detectors deleted
Type
number

(static) setupDetectors(preferences) → {number}

Parameters:
Name Type Description
preferences Object JSON object with the setting information (see /setup)
Source:
Returns:
Number of filtered (removed) detectors.
Type
number

getChannelDetectors(channelName) → {Array.<Detector>}

Return detectors of a channel
Parameters:
Name Type Description
channelName String Name of a channel.
Source:
Returns:
Array of channels (being a channel an array of Detector)
Type
Array.<Detector>

mergeResults(channel, localStrategy, globalStrategy) → {Array}

Merge results from specified channels
Parameters:
Name Type Description
channel String | Array String 'all' or array of channel names
localStrategy String Name of local strategy. This strategy can be found in tools/merge.js
globalStrategy String Name of global strategy. This strategy can be found in tools/merge.js
Source:
Returns:
Triplet of aggregated data.
Type
Array