--
-$Id: ChangeLog 22 2005-04-02 22:29:50Z tilman $
+$Id: ChangeLog 23 2005-04-02 23:20:32Z tilman $
++
2005-04-03 Tilman Sauerbeck (tilman at code-monkey de)
* lib/redact/part.rb: Use symbols instead of constants for text
effects
* lib/redact/part.rb: Code cleanup
+ * lib/redact/program.rb: Use symbols instead of constants for
+ tween modes
2005-04-02 Tilman Sauerbeck (tilman at code-monkey de)
* lib/redact/part.rb: Made 'step' and 'aspect' parameters
#--
-# $Id: program.rb 1 2005-03-26 01:32:38Z tilman $
+# $Id: program.rb 23 2005-04-02 23:20:32Z tilman $
#
# Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de)
#
end
class SetStateProgram < Program
- MODE_LINEAR = 1
- MODE_SINUSOIDAL = 2
- MODE_ACCELERATE = 3
- MODE_DECELERATE = 4
-
attr_reader :targets
attr_accessor :state, :value, :mode, :time
@type = TYPE_SET_STATE
@state = "default"
@value = 0.0
- @mode = MODE_LINEAR
+ @mode = :linear
@time = 0.0
@targets = ProgramArgs.new(collection)
end
def to_eet_properties
+ mode = case @mode
+ when :linear: 1
+ when :sinusoidal: 2
+ when :accelerate: 3
+ when :decelerate: 4
+ else
+ raise(RedactError, "invalid mode - #{@mode}")
+ end
+
super.merge!(
{"state" => [@state],
"value" => [@value, :double],
- "tween.mode" => [@mode],
+ "tween.mode" => [mode],
"tween.time" => [@time, :double],
"targets" => [@targets]})
end