NAME

Video::PlaybackMachine::FillProducer::FillShort -- Plays a randomly-chosen short from the fill contents database that fits into the time available.

DESCRIPTION

Plays a randomly-chosen short from the fill contents database that fits into the time available.

In a slightly scurvy trick, FillShort also defines its own time layout, which allows it to query the database whenever someone asks it.

METHODS

Class Methods

new()

Arguments:

TABLE -- ScheduleTable::DB

Creates a new FillShort which uses the DBI connection given.

get_time_layout()

Returns:

Video::PlaybackMachine::FillShort

In a scurvy trick, we're our own time layout object. That way, the time layout can query the database for minimum and preferred times.

start()

Arguments:

TIME: int -- time in seconds that we're to fill

min_time()

Returns the minimum amount of time this filler can run, i.e. the shortest short. Caches its values to minimize database calls.

If there is no filler at all, returns INT_MAX.

preferred_time()

Returns the length of the longest fillmovie. (Sorry, it just got too strange referring to the "longest short.") Possibly this behavior is a bug in the architecture, but it's the only sane deterministic value. Better behavior would be to return the length of the movie which we will play next, but there's a random factor there.

is_available()

Returns true if there are shorts available to play.

get_next()

Returns the sequence number of the next short to play