#warn "Loading $file\n";
$self->{'new'}->set_opacity(0);
$self->{'new'}->set_from_file($file);
+ $self->{'new'}->set_opacity(0);
#$self->{'stage'}->add($self->{'new'});
+#warn "Going to show $file\n";
if ($self->{'last_file'} eq '') {
fade_in(undef, $self);
} else {
-warn "Fade out old\n";
- my $old_effect = Clutter::EffectTemplate->new_for_duration(2000, 'main::smoothstep_dec' );
- my $old = Clutter::Effect->fade($old_effect, $self->{'new'}, 0, $self->can('fade_in'), $self);
- $old->start();
-
- sleep 10;
+ $self->fade_out();
}
$self->{'last_file'} = $file;
}
sub fade_in {
- my ($actor, $self) = @_;
+ my ($old_timeline, $self) = @_;
-warn "Fade in new\n";
- my $new_effect = Clutter::EffectTemplate->new_for_duration(2000, 'main::smoothstep_inc');
- my $new = Clutter::Effect->fade($new_effect, $self->{'new'}, 255);
+ my $new_effect = Clutter::EffectTemplate->new_for_duration(1000, 'main::smoothstep_inc');
+ my $new = Clutter::Effect->fade($new_effect, $self->{'new'}, 255, $self->can('post_fade_in'), $self);
$new->start();
+# my $timeline = Clutter::Timeline->new_for_duration(1000);
+# $timeline->signal_connect('completed', $self->can('post_fade_in'), $self);
+# my $alpha = Clutter::Alpha->new($timeline, 'main::smoothstep_inc');
+# my $opacity = Clutter::Behaviour::Opacity->new($alpha, 0, 255);
+# $opacity->apply($self->{'new'});
+#warn "Setup timeline, time to start it.\n";
+# $timeline->start();
+}
+
+sub post_fade_in {
+ my ($old_timeline, $self) = @_;
+
my $temp = $self->{'old'};
$self->{'old'} = $self->{'new'};
$self->{'new'} = $temp;
}
+sub fade_out {
+ my ($self) = @_;
+
+ my $old_effect = Clutter::EffectTemplate->new_for_duration(1000, 'main::smoothstep_inc' );
+ my $old = Clutter::Effect->fade($old_effect, $self->{'old'}, 0, $self->can('fade_in'), $self);
+ $old->start();
+
+# my $timeline = Clutter::Timeline->new_for_duration(1000);
+# $timeline->signal_connect('completed', \&fade_in, $self);
+# my $alpha = Clutter::Alpha->new($timeline, 'main::smoothstep_dec');
+# my $opacity = Clutter::Behaviour::Opacity->new($alpha, 255, 0);
+# $opacity->apply($self->{'old'});
+# $timeline->start();
+}
+
+
sub display {
my $self = shift;
$self->{'kernel'}->post('FSpotDB',
- single => { sql => $self->{'sql'}, event => fspot_display_photo }
+ single => { sql => $self->{'sql'}, event => 'fspot_display_photo' }
);
}
$self->{'stage'}->add($self->{$age});
}
+warn "Going to yield\n";
$self->{'kernel'}->yield('fspot_display');
}