13 my $class = ref($proto) || $proto;
16 verify (%options, qw/ -name -audio / ) if $SDL::DEBUG;
18 my $n = $options{-name} || die "SDL::SMPEG must supply a filename to SDL::SMPEG::new\n";
19 my $a = $options{'-audio'} ? 1 : 0;
20 my $info = new SDL::MPEG();
22 my $self = \SDL::NewSMPEG($n,$$info,$a);
23 croak SDL::GetError() unless $$self;
31 SDL::FreeSMPEG(${$_[0]});
35 SDL::SMPEGError(${$_[0]});
39 SDL::SMPEGEnableAudio( ${$_[0]}, $_[1]);
43 SDL::SMPEGEnableSMPEG( ${$_[0]}, $_[1]);
47 SDL::SMPEGSetVolume( ${$_[0]}, $_[1] );
51 croak "SDL::SMPEG::Display requires a SDL::Surface\n" unless $_[1]->isa('SDL::Surface');
52 SDL::SMPEGSetDisplay( ${$_[0]}, ${$_[1]}, 0);
56 return SDL::SMPEGScaleXY(${$_[0]},$_[1],$_[2]) if (@_ == 3 );
57 return SDL::SMPEGScaleXY(${$_[0]},$_[1]->width(),$_[1]->height()) if $_[1]->isa('SDL::Surface');
58 SDL::SMPEGScale(${$_[0]},$_[1]);
62 SDL::SMPEGPlay(${$_[0]});
66 SDL::SMPEGPause(${$_[0]});
70 SDL::SMPEGStop(${$_[0]});
74 SDL::SMPEGRewind(${$_[0]});
78 SDL::SMPEGSeek(${$_[0]},$_[1]);
82 SDL::SMPEGSkip(${$_[0]},$_[1]);
86 SDL::SMPEGLoop(${$_[0]},$_[1]);
90 croak "SDL::SMPEG::region requires a SDL::Rect\n" unless $_[1]->isa('SDL::Rect');
91 SDL::SMPEGDisplayRegion(${$_[0]},${$_[1]});
95 SDL::SMPEGRenderFrame(${$_[0]},$_[1]);
99 new SDL::MPEG -from => $_[0];
103 SDL::SMPEGStatus(${$_[0]});
115 SDL::SMPEG - a SDL perl extension
119 $video = new SDL::SMPEG ( -name => 'pr0n.mpg' );
123 C<SDL::SMPEG> adds support for MPEG video to your
124 SDL Perl application. SMPEGs are objects bound to
125 surfaces, whose playback is controled through the
135 C<SDL::SMPEG::error()> returns any error messages associated with playback
139 C<SDL::SMPEG::audio(bool)> enables or disables audio playback, (on by default)
143 C<SDL::SMPEG::video(bool)> enables or disable video playback, (on by default)
147 C<SDL::SMPEG::loop(bool)> enables or disable playback looping (off by default)
151 C<SDL::SMPEG::volume(int)> set the volume as per the mixer volume
155 C<SDL::SMPEG:display(surface)> binds the clip to a display surface
159 C<SDL::SMPEG::scale([x,y]|[surface]|int)> scales the clip by either x,y
160 factors, scales to the image dimensions, or a single scalar.
164 C<SDL::SMPEG::play()> plays the video clip, call C<SDL::SMPEG::display()> before playing
168 C<SDL::SMPEG::pause()> pauses video playback
172 C<SDL::SMPEG::stop()> stops video playback
176 C<SDL::SMPEG::rewind()> resets the clip to the beginning
180 C<SDL::SMPEG::seek(offset)> seeks to a particular byte offset
184 C<SDL::SMPEG::skip(time)> skips to a particular time
188 C<SDL::SMPEG::region(rect)> takes a SDL::Rect and defines the display area
192 C<SDL::SMPEG::frame(int)> renders a specific frame to the screen
196 C<SDL::SMPEG::info()> returns a new C<SDL::MPEG> object reflecting the current status
200 C<SDL::SMPEG::status()> returns either SMPEG_PLAYING or SMPEG_STOPPED or SMPEG_ERROR
210 perl(1) SDL::Surface(3) SDL::MPEG(3)