Skip to content
Browse files

Using a better name for SDL::MPEG

  • Loading branch information...
1 parent f1523e6 commit 207837e922d194f0a8ff80faa9474432551c526c @kthakore kthakore committed Jan 6, 2011
Showing with 44 additions and 44 deletions.
  1. +3 −3 Build.PL
  2. +25 −25 lib/SDL/SMPEG.pm
  3. +14 −14 lib/SDL/{MPEG.pm → SMPEG/Info.pm}
  4. +1 −1 src/{MPEG.xs → SMPEG/Info.xs}
  5. +1 −1 t/smpeg.t
View
6 Build.PL
@@ -392,7 +392,7 @@ my %subsystems = (
libraries => [qw( SDL SDL_image )],
},
- SMPEG => {
+ SMPEG => {
file => {
from => 'src/SMPEG.xs',
to => 'lib/SDL/SMPEG.xs',
@@ -401,8 +401,8 @@ my %subsystems = (
},
MPEG => {
file => {
- from => 'src/MPEG.xs',
- to => 'lib/SDL/MPEG.xs',
+ from => 'src/SMPEG/Info.xs',
+ to => 'lib/SDL/SMPEG/Info.xs',
},
libraries => [qw( SDL smpeg)],
},
View
50 lib/SDL/SMPEG.pm
@@ -6,7 +6,7 @@ use warnings;
use Carp;
use SDL;
use SDL::Surface;
-use SDL::MPEG;
+use SDL::SMPEG::Info;
our @ISA = qw(Exporter DynaLoader);
use SDL::Internal::Loader;
@@ -23,9 +23,9 @@ sub new {
my $n = $options{-name}
|| die "SDL::SMPEG must supply a filename to SDL::SMPEG::new\n";
my $a = $options{'-audio'} ? 1 : 0;
- my $info = SDL::MPEG->new();
+ my $info = SDL::SMPEG::Info->new();
- my $self = \SDL::SMPEG::NewSMPEG( $n, $$info, $a );
+ my $self = \NewSMPEG( $n, $$info, $a );
Carp::confess SDL::get_error() unless $$self;
bless $self, $class;
$self->audio(1);
@@ -34,82 +34,82 @@ sub new {
}
sub DESTROY {
- SDL::SMPEG::FreeSMPEG( ${ $_[0] } );
+ FreeSMPEG( ${ $_[0] } );
}
sub error {
- SDL::SMPEG::SMPEGError( ${ $_[0] } );
+ SMPEGError( ${ $_[0] } );
}
sub audio {
- SDL::SMPEG::SMPEGEnableAudio( ${ $_[0] }, $_[1] );
+ SMPEGEnableAudio( ${ $_[0] }, $_[1] );
}
sub video {
- SDL::SMPEG::SMPEGEnableVideo( ${ $_[0] }, $_[1] );
+ SMPEGEnableVideo( ${ $_[0] }, $_[1] );
}
sub volume {
- SDL::SMPEG::SMPEGSetVolume( ${ $_[0] }, $_[1] );
+ SMPEGSetVolume( ${ $_[0] }, $_[1] );
}
sub display {
- Carp::confess "SDL::SMPEG::Display requires a SDL::Surface\n"
+ Carp::confess "Display requires a SDL::Surface\n"
unless $_[1]->isa('SDL::Surface');
- SDL::SMPEG::SMPEGSetDisplay( ${ $_[0] }, $_[1] , 0 );
+ SMPEGSetDisplay( ${ $_[0] }, $_[1] , 0 );
}
sub scale {
- return SDL::SMPEG::SMPEGScaleXY( ${ $_[0] }, $_[1], $_[2] ) if ( @_ == 3 );
- return SDL::SMPEG::SMPEGScaleXY( ${ $_[0] }, $_[1]->width(), $_[1]->height() )
+ return SMPEGScaleXY( ${ $_[0] }, $_[1], $_[2] ) if ( @_ == 3 );
+ return SMPEGScaleXY( ${ $_[0] }, $_[1]->width(), $_[1]->height() )
if $_[1]->isa('SDL::Surface');
- SDL::SMPEG::SMPEGScale( ${ $_[0] }, $_[1] );
+ SMPEGScale( ${ $_[0] }, $_[1] );
}
sub play {
- SDL::SMPEG::SMPEGPlay( ${ $_[0] } );
+ SMPEGPlay( ${ $_[0] } );
}
sub pause {
- SDL::SMPEG::SMPEGPause( ${ $_[0] } );
+ SMPEGPause( ${ $_[0] } );
}
sub stop {
- SDL::SMPEG::SMPEGStop( ${ $_[0] } );
+ SMPEGStop( ${ $_[0] } );
}
sub rewind {
- SDL::SMPEG::SMPEGRewind( ${ $_[0] } );
+ SMPEGRewind( ${ $_[0] } );
}
sub seek {
- SDL::SMPEG::SMPEGSeek( ${ $_[0] }, $_[1] );
+ SMPEGSeek( ${ $_[0] }, $_[1] );
}
sub skip {
- SDL::SMPEG::SMPEGSkip( ${ $_[0] }, $_[1] );
+ SMPEGSkip( ${ $_[0] }, $_[1] );
}
sub loop {
- SDL::SMPEG::SMPEGLoop( ${ $_[0] }, $_[1] );
+ SMPEGLoop( ${ $_[0] }, $_[1] );
}
sub region {
- Carp::confess "SDL::SMPEG::region requires a SDL::Rect\n"
+ Carp::confess "region requires a SDL::Rect\n"
unless $_[1]->isa('SDL::Rect');
- SDL::SMPEG::SMPEGDisplayRegion( ${ $_[0] }, ${ $_[1] } );
+ SMPEGDisplayRegion( ${ $_[0] }, ${ $_[1] } );
}
sub frame {
- SDL::SMPEG::SMPEGRenderFrame( ${ $_[0] }, $_[1] );
+ SMPEGRenderFrame( ${ $_[0] }, $_[1] );
}
sub info {
- SDL::MPEG->new( -from => $_[0] );
+ SDL::SMPEG::Info->new( -from => $_[0] );
}
sub status {
- SDL::SMPEG::SMPEGStatus( ${ $_[0] } );
+ SMPEGStatus( ${ $_[0] } );
}
1;
View
28 lib/SDL/MPEG.pm → lib/SDL/SMPEG/Info.pm
@@ -28,7 +28,7 @@
# dgoehrig@cpan.org
#
-package SDL::MPEG;
+package SDL::SMPEG::Info;
use strict;
use warnings;
@@ -39,7 +39,7 @@ use SDL::SMPEG;
use SDL::Internal::Loader;
internal_load_dlls(__PACKAGE__);
-bootstrap SDL::MPEG;
+bootstrap SDL::SMPEG::Info;
sub new {
my $proto = shift;
@@ -50,54 +50,54 @@ sub new {
if ( $options{-from} ) {
$self = \SDL::SMPEG::SMPEGGetInfo( ${ $options{-from} } );
} else {
- $self = \SDL::MPEG::NewSMPEGInfo();
+ $self = \NewSMPEGInfo();
}
bless $self, $class;
return $self;
}
sub DESTROY {
- SDL::MPEG::FreeSMPEGInfo( ${ $_[0] } );
+ FreeSMPEGInfo( ${ $_[0] } );
}
sub has_audio {
- SDL::MPEG::SMPEGInfoHasAudio( ${ $_[0] } );
+ SMPEGInfoHasAudio( ${ $_[0] } );
}
sub has_video {
- SDL::MPEG::SMPEGInfoHasVideo( ${ $_[0] } );
+ SMPEGInfoHasVideo( ${ $_[0] } );
}
sub width {
- SDL::MPEG::SMPEGInfoWidth( ${ $_[0] } );
+ SMPEGInfoWidth( ${ $_[0] } );
}
sub height {
- SDL::MPEG::SMPEGInfoHeight( ${ $_[0] } );
+ SMPEGInfoHeight( ${ $_[0] } );
}
sub size {
- SDL::MPEG::SMPEGInfoTotalSize( ${ $_[0] } );
+ SMPEGInfoTotalSize( ${ $_[0] } );
}
sub offset {
- SDL::MPEG::SMPEGInfoCurrentOffset( ${ $_[0] } );
+ SMPEGInfoCurrentOffset( ${ $_[0] } );
}
sub frame {
- SDL::MPEG::SMPEGInfoCurrentFrame( ${ $_[0] } );
+ SMPEGInfoCurrentFrame( ${ $_[0] } );
}
sub fps {
- SDL::MPEG::SMPEGInfoCurrentFPS( ${ $_[0] } );
+ SMPEGInfoCurrentFPS( ${ $_[0] } );
}
sub time {
- SDL::MPEG::SMPEGInfoCurrentTime( ${ $_[0] } );
+ SMPEGInfoCurrentTime( ${ $_[0] } );
}
sub length {
- SDL::MPEG::SMPEGInfoTotalTime( ${ $_[0] } );
+ SMPEGInfoTotalTime( ${ $_[0] } );
}
1;
View
2 src/MPEG.xs → src/SMPEG/Info.xs
@@ -14,7 +14,7 @@
-MODULE = SDL::MPEG PACKAGE = SDL::MPEG
+MODULE = SDL::SMPEG::Info PACKAGE = SDL::SMPEG::Info
PROTOTYPES : DISABLE
View
2 t/smpeg.t
@@ -64,7 +64,7 @@ SCOPE: {
# Get the video metadata
my $mpeg = $smpeg->info;
- isa_ok( $mpeg, 'SDL::MPEG' );
+ isa_ok( $mpeg, 'SDL::SMPEG::Info' );
# Check it matches what we expect
is( $mpeg->has_audio, 1, '->has_audio ok' );

0 comments on commit 207837e

Please sign in to comment.
Something went wrong with that request. Please try again.