1 /* This file is part of LED Pattern Editor.
3 * Copyright (C) 2010 Philipp Zabel
5 * LED Pattern Editor is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * LED Pattern Editor is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with LED Pattern Editor. If not, see <http://www.gnu.org/licenses/>.
19 class LedPattern : Object {
23 DISPLAY_OFF_ACT_DEAD = 2,
24 DISPLAY_ON_ACT_DEAD = 3,
25 DISPLAY_OFF_OR_ACT_DEAD = 4,
34 public double duration;
36 public signal void changed ();
50 class LedCommand : Object {
51 public CommandType type;
53 public double step_time;
54 public double duration;
58 public virtual void set_pwm (int _level) {
59 type = CommandType.SET_PWM;
64 public virtual void ramp_wait (double _step_time, int _steps) {
65 type = CommandType.RAMP_WAIT;
66 step_time = _step_time;
69 duration = step_time * (1 - steps);
71 duration = step_time * (steps + 1);
75 public virtual void go_to_start () {
76 type = CommandType.GO_TO_START;
80 public virtual void end (bool reset) {
81 type = CommandType.END;
82 steps = reset ? -255 : 0;
86 public signal void changed ();