use super::super::effects::*;
use std::collections::HashMap;
use std::time::Duration;
pub fn create_test_fixture(name: &str, universe: u16, address: u16) -> FixtureInfo {
let mut channels = HashMap::new();
channels.insert("red".to_string(), 1);
channels.insert("green".to_string(), 2);
channels.insert("blue".to_string(), 3);
channels.insert("strobe".to_string(), 4);
FixtureInfo::new(
name.to_string(),
universe,
address,
"RGB_Par".to_string(),
channels,
Some(20.0),
)
}
pub fn create_effect_with_layering(
id: String,
effect_type: EffectType,
target_fixtures: Vec<String>,
layer: EffectLayer,
blend_mode: BlendMode,
) -> EffectInstance {
let mut effect = EffectInstance::new(id, effect_type, target_fixtures, None, None, None);
effect.layer = layer;
effect.blend_mode = blend_mode;
if effect.hold_time.is_none() {
effect.hold_time = Some(Duration::from_secs(10));
}
effect
}
pub fn create_effect_with_timing(
id: String,
effect_type: EffectType,
target_fixtures: Vec<String>,
layer: EffectLayer,
blend_mode: BlendMode,
up_time: Option<Duration>,
down_time: Option<Duration>,
) -> EffectInstance {
let mut effect =
EffectInstance::new(id, effect_type, target_fixtures, up_time, None, down_time);
effect.layer = layer;
effect.blend_mode = blend_mode;
effect.up_time = up_time;
effect.down_time = down_time;
effect
}