Class: Spielbash::RecordInteractor

Inherits:
Object
  • Object
show all
Defined in:
lib/spielbash/interactor/record_interactor.rb

Instance Method Summary collapse

Instance Method Details

#execute(script_path, output_path) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/spielbash/interactor/record_interactor.rb', line 5

def execute(script_path, output_path)
  script = YAML.load_file(script_path)
  title = script['title']
  opts = script['options']

  typing_delay_s = opts['typing_delay_s']
  reading_delay_s = opts['reading_delay_s']
  wait = opts['wait']
  width = opts['width']
  height = opts['height']
  wait_check_cmd = opts['wait_check_cmd']

  context = Spielbash::Context.new(typing_delay_s, reading_delay_s, wait, width, height, wait_check_cmd)

  actions = create_actions(context, script['scenes'])
  pre_run_actions = create_actions(context, script['pre-run'])
  post_run_actions = create_actions(context, script['post-run'])

  movie = Spielbash::Movie.new(title, pre_run_actions, actions, post_run_actions, context, output_path)
  movie.shoot
end