sub new {
my $class = shift;
+ my $current_slide = shift || die "need current slide coderef!";
my $self = {
last_nr => -42,
+ current_slide => $current_slide,
};
bless $self, $class;
}
-sub show {
- my ( $self, $nr ) = @_;
-
- if ( $self->{last_nr} == $nr ) {
- $self->{app}->sync if $self->{app};
- return;
- }
+sub current_slide {
+ my $self = shift;
+ $self->{current_slide}->( shift );
+}
- $self->{last_nr} = $nr;
+sub show {
+ my ( $self, $t ) = @_;
my @subtitles =
sort {
-y => $y,
);
- my $pos = $nr + $i - 5;
+ my $pos = $self->current_slide($t) + $i - 5;
if ( $pos < 0 ) {