| 1 | package Video::PlaybackMachine::TimeLayout::FixedTimeLayout; | ||
| 2 | |||
| 3 | 4 | our $VERSION = '0.09'; # VERSION | |
| 4 | |||
| 5 | #### | ||
| 6 | #### Video::PlaybackMachine::TimeLayout::FixedTimeLayout | ||
| 7 | #### | ||
| 8 | #### $Revision$ | ||
| 9 | #### | ||
| 10 | #### A TimeLayout that indicates that a certain FillProducer only | ||
| 11 | #### wants to generate content for a fixed amount of time. | ||
| 12 | #### | ||
| 13 | |||
| 14 | 4 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | 4 | has 'time' => ( | |
| 17 | is => 'ro', | ||
| 18 | required => 1 | ||
| 19 | ); | ||
| 20 | |||
| 21 | 4 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | |||
| 23 | 11 | ▶ | sub BUILDARGS { |
|
Subroutine
BUILDARGS: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 24 | 11 | my $type = shift; | |
| 25 | 11 | my ($time) = @_; | |
| 26 | |||
| 27 | 11 | return { time => $time }; | |
| 28 | } | ||
| 29 | |||
| 30 | ############################# Object Methods ############################## | ||
| 31 | |||
| 32 | ## | ||
| 33 | ## min_time() | ||
| 34 | ## | ||
| 35 | ## Returns the minimum amount of time the fill can take. In this case, | ||
| 36 | ## returns the fixed time. | ||
| 37 | ## | ||
| 38 | 20 | ▶ | sub min_time { |
|
Subroutine
min_time: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 39 | 20 | my $self = shift; | |
| 40 | |||
| 41 | 20 | return $self->time(); | |
| 42 | } | ||
| 43 | |||
| 44 | ## | ||
| 45 | ## preferred_time() | ||
| 46 | ## | ||
| 47 | ## Arguments: | ||
| 48 | ## TIME_LEFT | ||
| 49 | ## | ||
| 50 | ## Returns the fixed time. | ||
| 51 | ## | ||
| 52 | 6 | ▶ | sub preferred_time { |
|
Subroutine
preferred_time: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 53 | 6 | my $self = shift; | |
| 54 | |||
| 55 | 6 | return $self->time; | |
| 56 | } | ||
| 57 | |||
| 58 | 4 | 1; | |