mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Moved effect configurations from the config file to effect directory
Former-commit-id: b8db13f25b93a0007adf613f0310a1cfbb6b8224
This commit is contained in:
parent
f1acf5a9e4
commit
0537fdc741
@ -2,399 +2,402 @@
|
|||||||
// Generated by: HyperCon (The Hyperion deamon configuration file builder
|
// Generated by: HyperCon (The Hyperion deamon configuration file builder
|
||||||
|
|
||||||
{
|
{
|
||||||
/// Device configuration contains the following fields:
|
/// Device configuration contains the following fields:
|
||||||
/// * 'name' : The user friendly name of the device (only used for display purposes)
|
/// * 'name' : The user friendly name of the device (only used for display purposes)
|
||||||
/// * 'type' : The type of the device or leds (known types for now are 'ws2801', 'ldp8806',
|
/// * 'type' : The type of the device or leds (known types for now are 'ws2801', 'ldp8806',
|
||||||
/// 'lpd6803', 'sedu', 'adalight', 'lightpack', 'test' and 'none')
|
/// 'lpd6803', 'sedu', 'adalight', 'lightpack', 'test' and 'none')
|
||||||
/// * 'output' : The output specification depends on selected device. This can for example be the
|
/// * 'output' : The output specification depends on selected device. This can for example be the
|
||||||
/// device specifier, device serial number, or the output file name
|
/// device specifier, device serial number, or the output file name
|
||||||
/// * 'rate' : The baudrate of the output to the device
|
/// * 'rate' : The baudrate of the output to the device
|
||||||
/// * 'colorOrder' : The order of the color bytes ('rgb', 'rbg', 'bgr', etc.).
|
/// * 'colorOrder' : The order of the color bytes ('rgb', 'rbg', 'bgr', etc.).
|
||||||
"device" :
|
"device" :
|
||||||
{
|
{
|
||||||
"name" : "MyPi",
|
"name" : "MyPi",
|
||||||
"type" : "ws2801",
|
"type" : "ws2801",
|
||||||
"output" : "/dev/spidev0.0",
|
"output" : "/dev/spidev0.0",
|
||||||
"rate" : 500000,
|
"rate" : 500000,
|
||||||
"colorOrder" : "rgb"
|
"colorOrder" : "rgb"
|
||||||
},
|
},
|
||||||
|
|
||||||
/// Color manipulation configuration used to tune the output colors to specific surroundings. Contains the following fields:
|
/// Color manipulation configuration used to tune the output colors to specific surroundings. Contains the following fields:
|
||||||
/// * 'hsv' : The manipulation in the Hue-Saturation-Value color domain with the following tuning parameters:
|
/// * 'hsv' : The manipulation in the Hue-Saturation-Value color domain with the following tuning parameters:
|
||||||
/// - 'saturationGain' The gain adjustement of the saturation
|
/// - 'saturationGain' The gain adjustement of the saturation
|
||||||
/// - 'valueGain' The gain adjustement of the value
|
/// - 'valueGain' The gain adjustement of the value
|
||||||
/// * 'red'/'green'/'blue' : The manipulation in the Red-Green-Blue color domain with the following tuning parameters for each channel:
|
/// * 'red'/'green'/'blue' : The manipulation in the Red-Green-Blue color domain with the following tuning parameters for each channel:
|
||||||
/// - 'threshold' The minimum required input value for the channel to be on (else zero)
|
/// - 'threshold' The minimum required input value for the channel to be on (else zero)
|
||||||
/// - 'gamma' The gamma-curve correction factor
|
/// - 'gamma' The gamma-curve correction factor
|
||||||
/// - 'blacklevel' The lowest possible value (when the channel is black)
|
/// - 'blacklevel' The lowest possible value (when the channel is black)
|
||||||
/// - 'whitelevel' The highest possible value (when the channel is white)
|
/// - 'whitelevel' The highest possible value (when the channel is white)
|
||||||
/// * 'smoothing' : Smoothing of the colors in the time-domain with the following tuning parameters:
|
/// * 'smoothing' : Smoothing of the colors in the time-domain with the following tuning parameters:
|
||||||
/// - 'type' The type of smoothing algorithm ('linear' or 'none')
|
/// - 'type' The type of smoothing algorithm ('linear' or 'none')
|
||||||
/// - 'time_ms' The time constant for smoothing algorithm in milliseconds
|
/// - 'time_ms' The time constant for smoothing algorithm in milliseconds
|
||||||
/// - 'updateFrequency' The update frequency of the leds in Hz
|
/// - 'updateFrequency' The update frequency of the leds in Hz
|
||||||
"color" :
|
"color" :
|
||||||
{
|
{
|
||||||
"hsv" :
|
"hsv" :
|
||||||
{
|
{
|
||||||
"saturationGain" : 1.0000,
|
"saturationGain" : 1.0000,
|
||||||
"valueGain" : 1.5000
|
"valueGain" : 1.5000
|
||||||
},
|
},
|
||||||
"red" :
|
"red" :
|
||||||
{
|
{
|
||||||
"threshold" : 0.1000,
|
"threshold" : 0.1000,
|
||||||
"gamma" : 2.0000,
|
"gamma" : 2.0000,
|
||||||
"blacklevel" : 0.0000,
|
"blacklevel" : 0.0000,
|
||||||
"whitelevel" : 0.8000
|
"whitelevel" : 0.8000
|
||||||
},
|
},
|
||||||
"green" :
|
"green" :
|
||||||
{
|
{
|
||||||
"threshold" : 0.1000,
|
"threshold" : 0.1000,
|
||||||
"gamma" : 2.0000,
|
"gamma" : 2.0000,
|
||||||
"blacklevel" : 0.0000,
|
"blacklevel" : 0.0000,
|
||||||
"whitelevel" : 1.0000
|
"whitelevel" : 1.0000
|
||||||
},
|
},
|
||||||
"blue" :
|
"blue" :
|
||||||
{
|
{
|
||||||
"threshold" : 0.1000,
|
"threshold" : 0.1000,
|
||||||
"gamma" : 2.0000,
|
"gamma" : 2.0000,
|
||||||
"blacklevel" : 0.0000,
|
"blacklevel" : 0.0000,
|
||||||
"whitelevel" : 1.0000
|
"whitelevel" : 1.0000
|
||||||
},
|
},
|
||||||
"smoothing" :
|
"smoothing" :
|
||||||
{
|
{
|
||||||
"type" : "none",
|
"type" : "none",
|
||||||
"time_ms" : 200,
|
"time_ms" : 200,
|
||||||
"updateFrequency" : 20.0000
|
"updateFrequency" : 20.0000
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/// The configuration for each individual led. This contains the specification of the area
|
/// The configuration for each individual led. This contains the specification of the area
|
||||||
/// averaged of an input image for each led to determine its color. Each item in the list
|
/// averaged of an input image for each led to determine its color. Each item in the list
|
||||||
/// contains the following fields:
|
/// contains the following fields:
|
||||||
/// * index: The index of the led. This determines its location in the string of leds; zero
|
/// * index: The index of the led. This determines its location in the string of leds; zero
|
||||||
/// being the first led.
|
/// being the first led.
|
||||||
/// * hscan: The fractional part of the image along the horizontal used for the averaging
|
/// * hscan: The fractional part of the image along the horizontal used for the averaging
|
||||||
/// (minimum and maximum inclusive)
|
/// (minimum and maximum inclusive)
|
||||||
/// * vscan: The fractional part of the image along the vertical used for the averaging
|
/// * vscan: The fractional part of the image along the vertical used for the averaging
|
||||||
/// (minimum and maximum inclusive)
|
/// (minimum and maximum inclusive)
|
||||||
"leds" :
|
"leds" :
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"index" : 0,
|
"index" : 0,
|
||||||
"hscan" : { "minimum" : 0.4375, "maximum" : 0.5000 },
|
"hscan" : { "minimum" : 0.4375, "maximum" : 0.5000 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 1,
|
"index" : 1,
|
||||||
"hscan" : { "minimum" : 0.3750, "maximum" : 0.4375 },
|
"hscan" : { "minimum" : 0.3750, "maximum" : 0.4375 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 2,
|
"index" : 2,
|
||||||
"hscan" : { "minimum" : 0.3125, "maximum" : 0.3750 },
|
"hscan" : { "minimum" : 0.3125, "maximum" : 0.3750 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 3,
|
"index" : 3,
|
||||||
"hscan" : { "minimum" : 0.2500, "maximum" : 0.3125 },
|
"hscan" : { "minimum" : 0.2500, "maximum" : 0.3125 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 4,
|
"index" : 4,
|
||||||
"hscan" : { "minimum" : 0.1875, "maximum" : 0.2500 },
|
"hscan" : { "minimum" : 0.1875, "maximum" : 0.2500 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 5,
|
"index" : 5,
|
||||||
"hscan" : { "minimum" : 0.1250, "maximum" : 0.1875 },
|
"hscan" : { "minimum" : 0.1250, "maximum" : 0.1875 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 6,
|
"index" : 6,
|
||||||
"hscan" : { "minimum" : 0.0625, "maximum" : 0.1250 },
|
"hscan" : { "minimum" : 0.0625, "maximum" : 0.1250 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 7,
|
"index" : 7,
|
||||||
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0625 },
|
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0625 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 8,
|
"index" : 8,
|
||||||
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 9,
|
"index" : 9,
|
||||||
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
||||||
"vscan" : { "minimum" : 0.8571, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.8571, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 10,
|
"index" : 10,
|
||||||
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
||||||
"vscan" : { "minimum" : 0.7143, "maximum" : 0.8571 }
|
"vscan" : { "minimum" : 0.7143, "maximum" : 0.8571 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 11,
|
"index" : 11,
|
||||||
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
||||||
"vscan" : { "minimum" : 0.5714, "maximum" : 0.7143 }
|
"vscan" : { "minimum" : 0.5714, "maximum" : 0.7143 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 12,
|
"index" : 12,
|
||||||
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
||||||
"vscan" : { "minimum" : 0.4286, "maximum" : 0.5714 }
|
"vscan" : { "minimum" : 0.4286, "maximum" : 0.5714 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 13,
|
"index" : 13,
|
||||||
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
||||||
"vscan" : { "minimum" : 0.2857, "maximum" : 0.4286 }
|
"vscan" : { "minimum" : 0.2857, "maximum" : 0.4286 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 14,
|
"index" : 14,
|
||||||
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
||||||
"vscan" : { "minimum" : 0.1429, "maximum" : 0.2857 }
|
"vscan" : { "minimum" : 0.1429, "maximum" : 0.2857 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 15,
|
"index" : 15,
|
||||||
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.1429 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.1429 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 16,
|
"index" : 16,
|
||||||
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0500 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 17,
|
"index" : 17,
|
||||||
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0625 },
|
"hscan" : { "minimum" : 0.0000, "maximum" : 0.0625 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 18,
|
"index" : 18,
|
||||||
"hscan" : { "minimum" : 0.0625, "maximum" : 0.1250 },
|
"hscan" : { "minimum" : 0.0625, "maximum" : 0.1250 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 19,
|
"index" : 19,
|
||||||
"hscan" : { "minimum" : 0.1250, "maximum" : 0.1875 },
|
"hscan" : { "minimum" : 0.1250, "maximum" : 0.1875 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 20,
|
"index" : 20,
|
||||||
"hscan" : { "minimum" : 0.1875, "maximum" : 0.2500 },
|
"hscan" : { "minimum" : 0.1875, "maximum" : 0.2500 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 21,
|
"index" : 21,
|
||||||
"hscan" : { "minimum" : 0.2500, "maximum" : 0.3125 },
|
"hscan" : { "minimum" : 0.2500, "maximum" : 0.3125 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 22,
|
"index" : 22,
|
||||||
"hscan" : { "minimum" : 0.3125, "maximum" : 0.3750 },
|
"hscan" : { "minimum" : 0.3125, "maximum" : 0.3750 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 23,
|
"index" : 23,
|
||||||
"hscan" : { "minimum" : 0.3750, "maximum" : 0.4375 },
|
"hscan" : { "minimum" : 0.3750, "maximum" : 0.4375 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 24,
|
"index" : 24,
|
||||||
"hscan" : { "minimum" : 0.4375, "maximum" : 0.5000 },
|
"hscan" : { "minimum" : 0.4375, "maximum" : 0.5000 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 25,
|
"index" : 25,
|
||||||
"hscan" : { "minimum" : 0.5000, "maximum" : 0.5625 },
|
"hscan" : { "minimum" : 0.5000, "maximum" : 0.5625 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 26,
|
"index" : 26,
|
||||||
"hscan" : { "minimum" : 0.5625, "maximum" : 0.6250 },
|
"hscan" : { "minimum" : 0.5625, "maximum" : 0.6250 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 27,
|
"index" : 27,
|
||||||
"hscan" : { "minimum" : 0.6250, "maximum" : 0.6875 },
|
"hscan" : { "minimum" : 0.6250, "maximum" : 0.6875 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 28,
|
"index" : 28,
|
||||||
"hscan" : { "minimum" : 0.6875, "maximum" : 0.7500 },
|
"hscan" : { "minimum" : 0.6875, "maximum" : 0.7500 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 29,
|
"index" : 29,
|
||||||
"hscan" : { "minimum" : 0.7500, "maximum" : 0.8125 },
|
"hscan" : { "minimum" : 0.7500, "maximum" : 0.8125 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 30,
|
"index" : 30,
|
||||||
"hscan" : { "minimum" : 0.8125, "maximum" : 0.8750 },
|
"hscan" : { "minimum" : 0.8125, "maximum" : 0.8750 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 31,
|
"index" : 31,
|
||||||
"hscan" : { "minimum" : 0.8750, "maximum" : 0.9375 },
|
"hscan" : { "minimum" : 0.8750, "maximum" : 0.9375 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 32,
|
"index" : 32,
|
||||||
"hscan" : { "minimum" : 0.9375, "maximum" : 1.0000 },
|
"hscan" : { "minimum" : 0.9375, "maximum" : 1.0000 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 33,
|
"index" : 33,
|
||||||
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.0800 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 34,
|
"index" : 34,
|
||||||
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
||||||
"vscan" : { "minimum" : 0.0000, "maximum" : 0.1429 }
|
"vscan" : { "minimum" : 0.0000, "maximum" : 0.1429 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 35,
|
"index" : 35,
|
||||||
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
||||||
"vscan" : { "minimum" : 0.1429, "maximum" : 0.2857 }
|
"vscan" : { "minimum" : 0.1429, "maximum" : 0.2857 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 36,
|
"index" : 36,
|
||||||
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
||||||
"vscan" : { "minimum" : 0.2857, "maximum" : 0.4286 }
|
"vscan" : { "minimum" : 0.2857, "maximum" : 0.4286 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 37,
|
"index" : 37,
|
||||||
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
||||||
"vscan" : { "minimum" : 0.4286, "maximum" : 0.5714 }
|
"vscan" : { "minimum" : 0.4286, "maximum" : 0.5714 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 38,
|
"index" : 38,
|
||||||
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
||||||
"vscan" : { "minimum" : 0.5714, "maximum" : 0.7143 }
|
"vscan" : { "minimum" : 0.5714, "maximum" : 0.7143 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 39,
|
"index" : 39,
|
||||||
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
||||||
"vscan" : { "minimum" : 0.7143, "maximum" : 0.8571 }
|
"vscan" : { "minimum" : 0.7143, "maximum" : 0.8571 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 40,
|
"index" : 40,
|
||||||
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
||||||
"vscan" : { "minimum" : 0.8571, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.8571, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 41,
|
"index" : 41,
|
||||||
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
"hscan" : { "minimum" : 0.9500, "maximum" : 1.0000 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 42,
|
"index" : 42,
|
||||||
"hscan" : { "minimum" : 0.9375, "maximum" : 1.0000 },
|
"hscan" : { "minimum" : 0.9375, "maximum" : 1.0000 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 43,
|
"index" : 43,
|
||||||
"hscan" : { "minimum" : 0.8750, "maximum" : 0.9375 },
|
"hscan" : { "minimum" : 0.8750, "maximum" : 0.9375 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 44,
|
"index" : 44,
|
||||||
"hscan" : { "minimum" : 0.8125, "maximum" : 0.8750 },
|
"hscan" : { "minimum" : 0.8125, "maximum" : 0.8750 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 45,
|
"index" : 45,
|
||||||
"hscan" : { "minimum" : 0.7500, "maximum" : 0.8125 },
|
"hscan" : { "minimum" : 0.7500, "maximum" : 0.8125 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 46,
|
"index" : 46,
|
||||||
"hscan" : { "minimum" : 0.6875, "maximum" : 0.7500 },
|
"hscan" : { "minimum" : 0.6875, "maximum" : 0.7500 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 47,
|
"index" : 47,
|
||||||
"hscan" : { "minimum" : 0.6250, "maximum" : 0.6875 },
|
"hscan" : { "minimum" : 0.6250, "maximum" : 0.6875 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 48,
|
"index" : 48,
|
||||||
"hscan" : { "minimum" : 0.5625, "maximum" : 0.6250 },
|
"hscan" : { "minimum" : 0.5625, "maximum" : 0.6250 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"index" : 49,
|
"index" : 49,
|
||||||
"hscan" : { "minimum" : 0.5000, "maximum" : 0.5625 },
|
"hscan" : { "minimum" : 0.5000, "maximum" : 0.5625 },
|
||||||
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
"vscan" : { "minimum" : 0.9200, "maximum" : 1.0000 }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
/// The black border configuration, contains the following items:
|
"effects" :
|
||||||
/// * enable : true if the detector should be activated
|
{
|
||||||
"blackborderdetector" :
|
"paths" : ["/home/pi/hyperion/effects"]
|
||||||
{
|
},
|
||||||
"enable" : true
|
|
||||||
},
|
|
||||||
|
|
||||||
/// The boot-sequence configuration, contains the following items:
|
/// The black border configuration, contains the following items:
|
||||||
/// * type : The type of the boot-sequence ('rainbow', 'knightrider', 'none')
|
/// * enable : true if the detector should be activated
|
||||||
/// * duration_ms : The length of the boot-sequence [ms]
|
"blackborderdetector" :
|
||||||
"bootsequence" :
|
{
|
||||||
{
|
"enable" : true
|
||||||
"type" : "Rainbow",
|
},
|
||||||
"duration_ms" : 3000
|
|
||||||
},
|
|
||||||
|
|
||||||
/// The configuration for the frame-grabber, contains the following items:
|
"bootsequence" :
|
||||||
/// * width : The width of the grabbed frames [pixels]
|
{
|
||||||
/// * height : The height of the grabbed frames [pixels]
|
"effect" : "rainbow-swirl-fast.json",
|
||||||
/// * frequency_Hz : The frequency of the frame grab [Hz]
|
"path" : "/home/pi/hyperion/effects",
|
||||||
"framegrabber" :
|
"duration_ms" : 3000
|
||||||
{
|
},
|
||||||
"width" : 64,
|
|
||||||
"height" : 64,
|
|
||||||
"frequency_Hz" : 10.0
|
|
||||||
},
|
|
||||||
|
|
||||||
/// The configuration of the XBMC connection used to enable and disable the frame-grabber. Contains the following fields:
|
/// The configuration for the frame-grabber, contains the following items:
|
||||||
/// * xbmcAddress : The IP address of the XBMC-host
|
/// * width : The width of the grabbed frames [pixels]
|
||||||
/// * xbmcTcpPort : The TCP-port of the XBMC-server
|
/// * height : The height of the grabbed frames [pixels]
|
||||||
/// * grabVideo : Flag indicating that the frame-grabber is on(true) during video playback
|
/// * frequency_Hz : The frequency of the frame grab [Hz]
|
||||||
/// * grabPictures : Flag indicating that the frame-grabber is on(true) during picture show
|
"framegrabber" :
|
||||||
/// * grabAudio : Flag indicating that the frame-grabber is on(true) during audio playback
|
{
|
||||||
/// * grabMenu : Flag indicating that the frame-grabber is on(true) in the XBMC menu
|
"width" : 64,
|
||||||
"xbmcVideoChecker" :
|
"height" : 64,
|
||||||
{
|
"frequency_Hz" : 10.0
|
||||||
"xbmcAddress" : "127.0.0.1",
|
},
|
||||||
"xbmcTcpPort" : 9090,
|
|
||||||
"grabVideo" : true,
|
|
||||||
"grabPictures" : true,
|
|
||||||
"grabAudio" : true,
|
|
||||||
"grabMenu" : false
|
|
||||||
},
|
|
||||||
|
|
||||||
/// The configuration of the Json server which enables the json remote interface
|
/// The configuration of the XBMC connection used to enable and disable the frame-grabber. Contains the following fields:
|
||||||
/// * port : Port at which the json server is started
|
/// * xbmcAddress : The IP address of the XBMC-host
|
||||||
"jsonServer" :
|
/// * xbmcTcpPort : The TCP-port of the XBMC-server
|
||||||
{
|
/// * grabVideo : Flag indicating that the frame-grabber is on(true) during video playback
|
||||||
"port" : 19444
|
/// * grabPictures : Flag indicating that the frame-grabber is on(true) during picture show
|
||||||
},
|
/// * grabAudio : Flag indicating that the frame-grabber is on(true) during audio playback
|
||||||
|
/// * grabMenu : Flag indicating that the frame-grabber is on(true) in the XBMC menu
|
||||||
|
"xbmcVideoChecker" :
|
||||||
|
{
|
||||||
|
"xbmcAddress" : "127.0.0.1",
|
||||||
|
"xbmcTcpPort" : 9090,
|
||||||
|
"grabVideo" : true,
|
||||||
|
"grabPictures" : true,
|
||||||
|
"grabAudio" : true,
|
||||||
|
"grabMenu" : false
|
||||||
|
},
|
||||||
|
|
||||||
/// The configuration of the Proto server which enables the protobuffer remote interface
|
/// The configuration of the Json server which enables the json remote interface
|
||||||
/// * port : Port at which the protobuffer server is started
|
/// * port : Port at which the json server is started
|
||||||
"protoServer" :
|
"jsonServer" :
|
||||||
{
|
{
|
||||||
"port" : 19445
|
"port" : 19444
|
||||||
},
|
},
|
||||||
|
|
||||||
/// The configuration of the boblight server which enables the boblight remote interface
|
/// The configuration of the Proto server which enables the protobuffer remote interface
|
||||||
/// * port : Port at which the boblight server is started
|
/// * port : Port at which the protobuffer server is started
|
||||||
|
"protoServer" :
|
||||||
|
{
|
||||||
|
"port" : 19445
|
||||||
|
},
|
||||||
|
|
||||||
|
/// The configuration of the boblight server which enables the boblight remote interface
|
||||||
|
/// * port : Port at which the boblight server is started
|
||||||
// "boblightServer" :
|
// "boblightServer" :
|
||||||
// {
|
// {
|
||||||
// "port" : 19333
|
// "port" : 19333
|
||||||
// },
|
// },
|
||||||
|
|
||||||
"end-of-json" : "end-of-json"
|
"end-of-json" : "end-of-json"
|
||||||
}
|
}
|
||||||
|
9
effects/knight-rider.json
Executable file
9
effects/knight-rider.json
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name" : "Knight rider",
|
||||||
|
"script" : "knight-rider.py",
|
||||||
|
"args" :
|
||||||
|
{
|
||||||
|
"speed" : 1.0,
|
||||||
|
"fadeFactor" : 0.7
|
||||||
|
}
|
||||||
|
}
|
12
effects/mood-blobs-blue.json
Executable file
12
effects/mood-blobs-blue.json
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name" : "Blue mood blobs",
|
||||||
|
"script" : "mood-blobs.py",
|
||||||
|
"args" :
|
||||||
|
{
|
||||||
|
"rotationTime" : 60.0,
|
||||||
|
"color" : [0,0,255],
|
||||||
|
"hueChange" : 60.0,
|
||||||
|
"blobs" : 5,
|
||||||
|
"reverse" : false
|
||||||
|
}
|
||||||
|
}
|
12
effects/mood-blobs-green.json
Executable file
12
effects/mood-blobs-green.json
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name" : "Green mood blobs",
|
||||||
|
"script" : "mood-blobs.py",
|
||||||
|
"args" :
|
||||||
|
{
|
||||||
|
"rotationTime" : 60.0,
|
||||||
|
"color" : [0,255,0],
|
||||||
|
"hueChange" : 60.0,
|
||||||
|
"blobs" : 5,
|
||||||
|
"reverse" : false
|
||||||
|
}
|
||||||
|
}
|
12
effects/mood-blobs-red.json
Executable file
12
effects/mood-blobs-red.json
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"name" : "Red mood blobs",
|
||||||
|
"script" : "mood-blobs.py",
|
||||||
|
"args" :
|
||||||
|
{
|
||||||
|
"rotationTime" : 60.0,
|
||||||
|
"color" : [255,0,0],
|
||||||
|
"hueChange" : 60.0,
|
||||||
|
"blobs" : 5,
|
||||||
|
"reverse" : false
|
||||||
|
}
|
||||||
|
}
|
10
effects/rainbow-mood.json
Executable file
10
effects/rainbow-mood.json
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"name" : "Rainbow mood",
|
||||||
|
"script" : "rainbow-mood.py",
|
||||||
|
"args" :
|
||||||
|
{
|
||||||
|
"rotation-time" : 60.0,
|
||||||
|
"brightness" : 1.0,
|
||||||
|
"reverse" : false
|
||||||
|
}
|
||||||
|
}
|
10
effects/rainbow-swirl-fast.json
Executable file
10
effects/rainbow-swirl-fast.json
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"name" : "Rainbow swirl fast",
|
||||||
|
"script" : "rainbow-swirl.py",
|
||||||
|
"args" :
|
||||||
|
{
|
||||||
|
"rotation-time" : 3.0,
|
||||||
|
"brightness" : 1.0,
|
||||||
|
"reverse" : false
|
||||||
|
}
|
||||||
|
}
|
10
effects/rainbow-swirl.json
Executable file
10
effects/rainbow-swirl.json
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"name" : "Rainbow swirl",
|
||||||
|
"script" : "rainbow-swirl.py",
|
||||||
|
"args" :
|
||||||
|
{
|
||||||
|
"rotation-time" : 20.0,
|
||||||
|
"brightness" : 1.0,
|
||||||
|
"reverse" : false
|
||||||
|
}
|
||||||
|
}
|
@ -26,6 +26,8 @@ public:
|
|||||||
|
|
||||||
const std::list<EffectDefinition> & getEffects() const;
|
const std::list<EffectDefinition> & getEffects() const;
|
||||||
|
|
||||||
|
static bool loadEffectDefinition(const std::string & path, const std::string & effectConfigFile, EffectDefinition &effectDefinition);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
/// Run the specified effect on the given priority channel and optionally specify a timeout
|
/// Run the specified effect on the given priority channel and optionally specify a timeout
|
||||||
int runEffect(const std::string &effectName, int priority, int timeout = -1);
|
int runEffect(const std::string &effectName, int priority, int timeout = -1);
|
||||||
|
@ -5,13 +5,24 @@
|
|||||||
// Bootsequence includes
|
// Bootsequence includes
|
||||||
#include <bootsequence/BootSequenceFactory.h>
|
#include <bootsequence/BootSequenceFactory.h>
|
||||||
|
|
||||||
|
// Effect engine includes
|
||||||
|
#include <effectengine/EffectEngine.h>
|
||||||
|
|
||||||
// Local Bootsequence includes
|
// Local Bootsequence includes
|
||||||
#include "EffectBootSequence.h"
|
#include "EffectBootSequence.h"
|
||||||
|
|
||||||
BootSequence * BootSequenceFactory::createBootSequence(Hyperion * hyperion, const Json::Value & jsonConfig)
|
BootSequence * BootSequenceFactory::createBootSequence(Hyperion * hyperion, const Json::Value & jsonConfig)
|
||||||
{
|
{
|
||||||
const std::string script = jsonConfig["script"].asString();
|
const std::string path = jsonConfig["path"].asString();
|
||||||
const Json::Value args = jsonConfig.get("args", Json::Value(Json::objectValue));
|
const std::string effectFile = jsonConfig["effect"].asString();
|
||||||
const unsigned duration = jsonConfig["duration_ms"].asUInt();
|
const unsigned duration = jsonConfig["duration_ms"].asUInt();
|
||||||
return new EffectBootSequence(hyperion, script, args, duration);
|
|
||||||
|
EffectDefinition effect;
|
||||||
|
if (EffectEngine::loadEffectDefinition(path, effectFile, effect))
|
||||||
|
{
|
||||||
|
return new EffectBootSequence(hyperion, effect, duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cerr << "Boot sequence could not be loaded" << std::endl;
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
#include "EffectBootSequence.h"
|
#include "EffectBootSequence.h"
|
||||||
|
|
||||||
EffectBootSequence::EffectBootSequence(Hyperion *hyperion, const std::string &script, const Json::Value &args, const unsigned duration_ms) :
|
EffectBootSequence::EffectBootSequence(Hyperion *hyperion, const EffectDefinition &effect, const unsigned duration_ms) :
|
||||||
BootSequence(),
|
BootSequence(),
|
||||||
_hyperion(hyperion),
|
_hyperion(hyperion),
|
||||||
_script(script),
|
_effect(effect),
|
||||||
_args(args),
|
|
||||||
_duration_ms(duration_ms)
|
_duration_ms(duration_ms)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -15,5 +14,5 @@ EffectBootSequence::~EffectBootSequence()
|
|||||||
|
|
||||||
void EffectBootSequence::start()
|
void EffectBootSequence::start()
|
||||||
{
|
{
|
||||||
_hyperion->setEffectScript(_script, _args, 0, _duration_ms);
|
_hyperion->setEffectScript(_effect.script, _effect.args, 0, _duration_ms);
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,10 @@ public:
|
|||||||
/// duration is the length the effect will run.
|
/// duration is the length the effect will run.
|
||||||
///
|
///
|
||||||
/// @param[in] hyperion The Hyperion instance
|
/// @param[in] hyperion The Hyperion instance
|
||||||
|
/// @param[in] effect The effect definition
|
||||||
/// @param[in] duration_ms The length of the sequence [ms]
|
/// @param[in] duration_ms The length of the sequence [ms]
|
||||||
///
|
///
|
||||||
EffectBootSequence(Hyperion * hyperion, const std::string & script, const Json::Value & args, const unsigned duration_ms);
|
EffectBootSequence(Hyperion * hyperion, const EffectDefinition & effect, const unsigned duration_ms);
|
||||||
virtual ~EffectBootSequence();
|
virtual ~EffectBootSequence();
|
||||||
|
|
||||||
virtual void start();
|
virtual void start();
|
||||||
@ -29,10 +30,7 @@ private:
|
|||||||
Hyperion * _hyperion;
|
Hyperion * _hyperion;
|
||||||
|
|
||||||
/// The script to execute
|
/// The script to execute
|
||||||
const std::string _script;
|
const EffectDefinition _effect;
|
||||||
|
|
||||||
/// The arguments of the script
|
|
||||||
const Json::Value _args;
|
|
||||||
|
|
||||||
/// Duration of the boot sequence
|
/// Duration of the boot sequence
|
||||||
const unsigned _duration_ms;
|
const unsigned _duration_ms;
|
||||||
|
@ -22,12 +22,18 @@ SET(EffectEngineSOURCES
|
|||||||
${CURRENT_SOURCE_DIR}/Effect.cpp
|
${CURRENT_SOURCE_DIR}/Effect.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
set(EffectEngine_RESOURCES ${CURRENT_SOURCE_DIR}/EffectEngine.qrc)
|
||||||
|
|
||||||
QT4_WRAP_CPP(EffectEngineHEADERS_MOC ${EffectEngineQT_HEADERS})
|
QT4_WRAP_CPP(EffectEngineHEADERS_MOC ${EffectEngineQT_HEADERS})
|
||||||
|
|
||||||
|
qt4_add_resources(EffectEngine_RESOURCES_RCC ${EffectEngine_RESOURCES} OPTIONS "-no-compress")
|
||||||
|
|
||||||
add_library(effectengine
|
add_library(effectengine
|
||||||
${EffectEngineHEADERS}
|
${EffectEngineHEADERS}
|
||||||
${EffectEngineQT_HEADERS}
|
${EffectEngineQT_HEADERS}
|
||||||
${EffectEngineHEADERS_MOC}
|
${EffectEngineHEADERS_MOC}
|
||||||
|
${EffectEngine_RESOURCES_RCC}
|
||||||
${EffectEngineSOURCES}
|
${EffectEngineSOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
342
libsrc/effectengine/EffectDefinition.schema.json
Normal file
342
libsrc/effectengine/EffectDefinition.schema.json
Normal file
@ -0,0 +1,342 @@
|
|||||||
|
{
|
||||||
|
"type" : "object",
|
||||||
|
"required" : true,
|
||||||
|
"properties" : {
|
||||||
|
"device" : {
|
||||||
|
"type" : "object",
|
||||||
|
"required" : true,
|
||||||
|
"properties" : {
|
||||||
|
"name" : {
|
||||||
|
"type" : "string",
|
||||||
|
"required" : true
|
||||||
|
},
|
||||||
|
"type" : {
|
||||||
|
"type" : "string",
|
||||||
|
"required" : true
|
||||||
|
},
|
||||||
|
"output" : {
|
||||||
|
"type" : "string",
|
||||||
|
"required" : true
|
||||||
|
},
|
||||||
|
"rate" : {
|
||||||
|
"type" : "integer",
|
||||||
|
"required" : true,
|
||||||
|
"minimum" : 0
|
||||||
|
},
|
||||||
|
"colorOrder" : {
|
||||||
|
"type" : "string",
|
||||||
|
"required" : false
|
||||||
|
},
|
||||||
|
"bgr-output" : { // deprecated
|
||||||
|
"type" : "boolean",
|
||||||
|
"required" : false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
},
|
||||||
|
"color": {
|
||||||
|
"type":"object",
|
||||||
|
"required":false,
|
||||||
|
"properties": {
|
||||||
|
"hsv" : {
|
||||||
|
"type" : "object",
|
||||||
|
"required" : false,
|
||||||
|
"properties" : {
|
||||||
|
"saturationGain" : {
|
||||||
|
"type" : "number",
|
||||||
|
"required" : false,
|
||||||
|
"minimum" : 0.0
|
||||||
|
},
|
||||||
|
"valueGain" : {
|
||||||
|
"type" : "number",
|
||||||
|
"required" : false,
|
||||||
|
"minimum" : 0.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
},
|
||||||
|
"red": {
|
||||||
|
"type":"object",
|
||||||
|
"required":false,
|
||||||
|
"properties":{
|
||||||
|
"gamma": {
|
||||||
|
"type":"number",
|
||||||
|
"required":false
|
||||||
|
},
|
||||||
|
"blacklevel": {
|
||||||
|
"type":"number",
|
||||||
|
"required":false
|
||||||
|
},
|
||||||
|
"whitelevel": {
|
||||||
|
"type":"number",
|
||||||
|
"required":false
|
||||||
|
},
|
||||||
|
"threshold": {
|
||||||
|
"type":"number",
|
||||||
|
"required":false,
|
||||||
|
"minimum" : 0.0,
|
||||||
|
"maximum" : 1.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
},
|
||||||
|
"green": {
|
||||||
|
"type":"object",
|
||||||
|
"required":false,
|
||||||
|
"properties":{
|
||||||
|
"gamma": {
|
||||||
|
"type":"number",
|
||||||
|
"required":false
|
||||||
|
},
|
||||||
|
"blacklevel": {
|
||||||
|
"type":"number",
|
||||||
|
"required":false
|
||||||
|
},
|
||||||
|
"whitelevel": {
|
||||||
|
"type":"number",
|
||||||
|
"required":false
|
||||||
|
},
|
||||||
|
"threshold": {
|
||||||
|
"type":"number",
|
||||||
|
"required":false,
|
||||||
|
"minimum" : 0.0,
|
||||||
|
"maximum" : 1.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
},
|
||||||
|
"blue": {
|
||||||
|
"type":"object",
|
||||||
|
"required":false,
|
||||||
|
"properties":{
|
||||||
|
"gamma": {
|
||||||
|
"type":"number",
|
||||||
|
"required":false
|
||||||
|
},
|
||||||
|
"whitelevel": {
|
||||||
|
"type":"number",
|
||||||
|
"required":false
|
||||||
|
},
|
||||||
|
"blacklevel": {
|
||||||
|
"type":"number",
|
||||||
|
"required":false
|
||||||
|
},
|
||||||
|
"threshold": {
|
||||||
|
"type":"number",
|
||||||
|
"required":false,
|
||||||
|
"minimum" : 0.0,
|
||||||
|
"maximum" : 1.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
},
|
||||||
|
"smoothing" : {
|
||||||
|
"type" : "object",
|
||||||
|
"required" : false,
|
||||||
|
"properties" : {
|
||||||
|
"type" : {
|
||||||
|
"type" : "enum",
|
||||||
|
"required" : true,
|
||||||
|
"values" : ["none", "linear"]
|
||||||
|
},
|
||||||
|
"time_ms" : {
|
||||||
|
"type" : "integer",
|
||||||
|
"required" : false,
|
||||||
|
"minimum" : 10
|
||||||
|
},
|
||||||
|
"updateFrequency" : {
|
||||||
|
"type" : "number",
|
||||||
|
"required" : false,
|
||||||
|
"minimum" : 0.001
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
},
|
||||||
|
"leds": {
|
||||||
|
"type":"array",
|
||||||
|
"required":true,
|
||||||
|
"items": {
|
||||||
|
"type":"object",
|
||||||
|
"properties": {
|
||||||
|
"index": {
|
||||||
|
"type":"integer",
|
||||||
|
"required":true
|
||||||
|
},
|
||||||
|
"hscan": {
|
||||||
|
"type":"object",
|
||||||
|
"required":true,
|
||||||
|
"properties": {
|
||||||
|
"minimum": {
|
||||||
|
"type":"number",
|
||||||
|
"required":true
|
||||||
|
},
|
||||||
|
"maximum": {
|
||||||
|
"type":"number",
|
||||||
|
"required":true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
},
|
||||||
|
"vscan": {
|
||||||
|
"type":"object",
|
||||||
|
"required":true,
|
||||||
|
"properties": {
|
||||||
|
"minimum": {
|
||||||
|
"type":"number",
|
||||||
|
"required":true
|
||||||
|
},
|
||||||
|
"maximum": {
|
||||||
|
"type":"number",
|
||||||
|
"required":true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"effects" :
|
||||||
|
{
|
||||||
|
"type" : "object",
|
||||||
|
"required" : false,
|
||||||
|
"properties" : {
|
||||||
|
"paths" : {
|
||||||
|
"type" : "array",
|
||||||
|
"required" : false,
|
||||||
|
"items" : {
|
||||||
|
"type" : "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
},
|
||||||
|
"blackborderdetector" :
|
||||||
|
{
|
||||||
|
"type" : "object",
|
||||||
|
"required" : false,
|
||||||
|
"properties" : {
|
||||||
|
"enable" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"required" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
},
|
||||||
|
"xbmcVideoChecker" :
|
||||||
|
{
|
||||||
|
"type" : "object",
|
||||||
|
"required" : false,
|
||||||
|
"properties" : {
|
||||||
|
"xbmcAddress" : {
|
||||||
|
"type" : "string",
|
||||||
|
"required" : true
|
||||||
|
},
|
||||||
|
"xbmcTcpPort" : {
|
||||||
|
"type" : "integer",
|
||||||
|
"required" : true
|
||||||
|
},
|
||||||
|
"grabVideo" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"required" : true
|
||||||
|
},
|
||||||
|
"grabPictures" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"required" : true
|
||||||
|
},
|
||||||
|
"grabAudio" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"required" : true
|
||||||
|
},
|
||||||
|
"grabMenu" : {
|
||||||
|
"type" : "boolean",
|
||||||
|
"required" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
},
|
||||||
|
"bootsequence" :
|
||||||
|
{
|
||||||
|
"type" : "object",
|
||||||
|
"required" : false,
|
||||||
|
"properties" : {
|
||||||
|
"path" : {
|
||||||
|
"type" : "string",
|
||||||
|
"required" : true
|
||||||
|
},
|
||||||
|
"effect" : {
|
||||||
|
"type" : "string",
|
||||||
|
"required" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
},
|
||||||
|
"framegrabber" :
|
||||||
|
{
|
||||||
|
"type" : "object",
|
||||||
|
"required" : false,
|
||||||
|
"properties" : {
|
||||||
|
"width" : {
|
||||||
|
"type" : "integer",
|
||||||
|
"required" : true
|
||||||
|
},
|
||||||
|
"height" : {
|
||||||
|
"type" : "integer",
|
||||||
|
"required" : true
|
||||||
|
},
|
||||||
|
"frequency_Hz" : {
|
||||||
|
"type" : "integer",
|
||||||
|
"required" : true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
},
|
||||||
|
"jsonServer" :
|
||||||
|
{
|
||||||
|
"type" : "object",
|
||||||
|
"required" : false,
|
||||||
|
"properties" : {
|
||||||
|
"port" : {
|
||||||
|
"type" : "integer",
|
||||||
|
"required" : true,
|
||||||
|
"minimum" : 0,
|
||||||
|
"maximum" : 65535
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
},
|
||||||
|
"protoServer" :
|
||||||
|
{
|
||||||
|
"type" : "object",
|
||||||
|
"required" : false,
|
||||||
|
"properties" : {
|
||||||
|
"port" : {
|
||||||
|
"type" : "integer",
|
||||||
|
"required" : true,
|
||||||
|
"minimum" : 0,
|
||||||
|
"maximum" : 65535
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
},
|
||||||
|
"boblightServer" :
|
||||||
|
{
|
||||||
|
"type" : "object",
|
||||||
|
"required" : false,
|
||||||
|
"properties" : {
|
||||||
|
"port" : {
|
||||||
|
"type" : "integer",
|
||||||
|
"required" : true,
|
||||||
|
"minimum" : 0,
|
||||||
|
"maximum" : 65535
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
|
}
|
@ -1,8 +1,17 @@
|
|||||||
// Python includes
|
// Python includes
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
|
|
||||||
|
// Stl includes
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
|
#include <QResource>
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QDir>
|
||||||
|
|
||||||
|
// hyperion util includes
|
||||||
|
#include <utils/jsonschema/JsonSchemaChecker.h>
|
||||||
|
|
||||||
// effect engine includes
|
// effect engine includes
|
||||||
#include <effectengine/EffectEngine.h>
|
#include <effectengine/EffectEngine.h>
|
||||||
@ -21,11 +30,26 @@ EffectEngine::EffectEngine(Hyperion * hyperion, const Json::Value & jsonEffectCo
|
|||||||
connect(_hyperion, SIGNAL(allChannelsCleared()), this, SLOT(allChannelsCleared()));
|
connect(_hyperion, SIGNAL(allChannelsCleared()), this, SLOT(allChannelsCleared()));
|
||||||
|
|
||||||
// read all effects
|
// read all effects
|
||||||
std::vector<std::string> effectNames = jsonEffectConfig.getMemberNames();
|
const Json::Value & paths = jsonEffectConfig["paths"];
|
||||||
for (const std::string & name : effectNames)
|
for (Json::UInt i = 0; i < paths.size(); ++i)
|
||||||
{
|
{
|
||||||
const Json::Value & info = jsonEffectConfig[name];
|
const std::string & path = paths[i].asString();
|
||||||
_availableEffects.push_back({name, info["script"].asString(), info["args"]});
|
QDir directory(QString::fromStdString(path));
|
||||||
|
if (!directory.exists())
|
||||||
|
{
|
||||||
|
std::cerr << "Effect directory can not be loaded: " << path << std::endl;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList filenames = directory.entryList(QStringList() << "*.json", QDir::Files, QDir::Name | QDir::IgnoreCase);
|
||||||
|
foreach (const QString & filename, filenames)
|
||||||
|
{
|
||||||
|
EffectDefinition def;
|
||||||
|
if (loadEffectDefinition(path, filename.toStdString(), def))
|
||||||
|
{
|
||||||
|
_availableEffects.push_back(def);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize the python interpreter
|
// initialize the python interpreter
|
||||||
@ -48,6 +72,51 @@ const std::list<EffectDefinition> &EffectEngine::getEffects() const
|
|||||||
return _availableEffects;
|
return _availableEffects;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EffectEngine::loadEffectDefinition(const std::string &path, const std::string &effectConfigFile, EffectDefinition & effectDefinition)
|
||||||
|
{
|
||||||
|
std::string fileName = path + QDir::separator().toAscii() + effectConfigFile;
|
||||||
|
std::ifstream file(fileName.c_str());
|
||||||
|
|
||||||
|
if (!file.is_open())
|
||||||
|
{
|
||||||
|
std::cerr << "Effect file '" << fileName << "' could not be loaded" << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read the json config file
|
||||||
|
Json::Reader jsonReader;
|
||||||
|
Json::Value config;
|
||||||
|
if (!jsonReader.parse(file, config, false))
|
||||||
|
{
|
||||||
|
std::cerr << "Error while reading effect '" << fileName << "': " << jsonReader.getFormattedErrorMessages() << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read the json schema file
|
||||||
|
QResource schemaData(":effect-schema");
|
||||||
|
JsonSchemaChecker schemaChecker;
|
||||||
|
Json::Value schema;
|
||||||
|
Json::Reader().parse(reinterpret_cast<const char *>(schemaData.data()), reinterpret_cast<const char *>(schemaData.data()) + schemaData.size(), schema, false);
|
||||||
|
schemaChecker.setSchema(schema);
|
||||||
|
if (!schemaChecker.validate(config))
|
||||||
|
{
|
||||||
|
const std::list<std::string> & errors = schemaChecker.getMessages();
|
||||||
|
foreach (const std::string & error, errors) {
|
||||||
|
std::cerr << "Error while checking '" << fileName << "':" << error << std::endl;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// setup the definition
|
||||||
|
effectDefinition.name = config["name"].asString();
|
||||||
|
effectDefinition.script = path + QDir::separator().toAscii() + config["script"].asString();
|
||||||
|
effectDefinition.args = config["args"];
|
||||||
|
|
||||||
|
// return succes
|
||||||
|
std::cout << "Effect loaded: " + effectDefinition.name << std::endl;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
int EffectEngine::runEffect(const std::string &effectName, int priority, int timeout)
|
int EffectEngine::runEffect(const std::string &effectName, int priority, int timeout)
|
||||||
{
|
{
|
||||||
return runEffect(effectName, Json::Value(Json::nullValue), priority, timeout);
|
return runEffect(effectName, Json::Value(Json::nullValue), priority, timeout);
|
||||||
|
5
libsrc/effectengine/EffectEngine.qrc
Normal file
5
libsrc/effectengine/EffectEngine.qrc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/">
|
||||||
|
<file alias="effect-schema">EffectDefinition.schema.json</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
@ -204,22 +204,16 @@
|
|||||||
{
|
{
|
||||||
"type" : "object",
|
"type" : "object",
|
||||||
"required" : false,
|
"required" : false,
|
||||||
"additionalProperties" :
|
"properties" : {
|
||||||
{
|
"paths" : {
|
||||||
"type" : "object",
|
"type" : "array",
|
||||||
"required" : false,
|
"required" : false,
|
||||||
"properties" :
|
"items" : {
|
||||||
{
|
"type" : "string"
|
||||||
"script" : {
|
|
||||||
"type" : "string",
|
|
||||||
"required" : true
|
|
||||||
},
|
|
||||||
"args" : {
|
|
||||||
"type" : "object",
|
|
||||||
"required" : false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"additionalProperties" : false
|
||||||
},
|
},
|
||||||
"blackborderdetector" :
|
"blackborderdetector" :
|
||||||
{
|
{
|
||||||
@ -270,17 +264,13 @@
|
|||||||
"type" : "object",
|
"type" : "object",
|
||||||
"required" : false,
|
"required" : false,
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"duration_ms" : {
|
"path" : {
|
||||||
"type" : "integer",
|
|
||||||
"required" : true
|
|
||||||
},
|
|
||||||
"script" : {
|
|
||||||
"type" : "string",
|
"type" : "string",
|
||||||
"required" : true
|
"required" : true
|
||||||
},
|
},
|
||||||
"args" : {
|
"effect" : {
|
||||||
"type" : "object",
|
"type" : "string",
|
||||||
"required" : false
|
"required" : true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties" : false
|
"additionalProperties" : false
|
||||||
|
Loading…
Reference in New Issue
Block a user