Skip to content

Commit

Permalink
Implements processing of whole event stream
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciro S. Costa committed Jul 4, 2018
1 parent 774443d commit 7653d3a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions commands/speed.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ var Speed = cli.Command{
If no file name is specified as a positional argument, a cast is
expected to be serverd via stdin.
If no range is specified (start=0, end=0), the whole event stream
is processed.
Once the transformation has been performed, the resulting cast is
either written to a file specified in the '--out' flag or to stdout
(default).
Expand Down Expand Up @@ -63,6 +66,11 @@ type SpeedTransformation struct {
}

func (t *SpeedTransformation) Transform(c *cast.Cast) (err error) {
if t.from == 0 && t.to == 0 {
t.from = c.EventStream[0].Time
t.to = c.EventStream[len(c.EventStream)-1].Time
}

err = editor.Speed(c, t.factor, t.from, t.to)
return
}
Expand Down

0 comments on commit 7653d3a

Please sign in to comment.