PageRenderTime 20ms CodeModel.GetById 13ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/SDL/SMPEG/Info.pm

http://github.com/PerlGameDev/SDL
Perl | 105 lines | 57 code | 18 blank | 30 comment | 3 complexity | 9232d8381e668237b452fa35e8ccced4 MD5 | raw file
  1#!/usr/bin/env perl
  2#
  3# MPEG.pm
  4#
  5# Copyright (C) 2005 David J. Goehrig <dgoehrig@cpan.org>
  6#
  7# ------------------------------------------------------------------------------
  8#
  9# This library is free software; you can redistribute it and/or
 10# modify it under the terms of the GNU Lesser General Public
 11# License as published by the Free Software Foundation; either
 12# version 2.1 of the License, or (at your option) any later version.
 13#
 14# This library is distributed in the hope that it will be useful,
 15# but WITHOUT ANY WARRANTY; without even the implied warranty of
 16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 17# Lesser General Public License for more details.
 18#
 19# You should have received a copy of the GNU Lesser General Public
 20# License along with this library; if not, write to the Free Software
 21# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 22#
 23# ------------------------------------------------------------------------------
 24#
 25# Please feel free to send questions, suggestions or improvements to:
 26#
 27#	David J. Goehrig
 28#	dgoehrig@cpan.org
 29#
 30
 31package SDL::SMPEG::Info;
 32
 33use strict;
 34use warnings;
 35use Carp;
 36use SDL;
 37our @ISA = qw(Exporter DynaLoader);
 38use SDL::SMPEG;
 39use SDL::Internal::Loader;
 40internal_load_dlls(__PACKAGE__);
 41
 42our $VERSION = 2.548;
 43
 44bootstrap SDL::SMPEG::Info;
 45
 46sub new {
 47	my $proto   = shift;
 48	my $class   = ref($proto) || $proto;
 49	my %options = @_;
 50
 51	my $self;
 52	if ( $options{-from} ) {
 53		$self = \SDL::SMPEG::SMPEGGetInfo( $options{-from} );
 54	} else {
 55		$self = \NewSMPEGInfo();
 56	}
 57	bless $self, $class;
 58	return $self;
 59}
 60
 61sub DESTROY {
 62#	FreeSMPEGInfo(  $_[0] );
 63}
 64
 65sub has_audio {
 66	SMPEGInfoHasAudio(  $_[0] );
 67}
 68
 69sub has_video {
 70	SMPEGInfoHasVideo(  $_[0] );
 71}
 72
 73sub width {
 74	SMPEGInfoWidth(  $_[0] );
 75}
 76
 77sub height {
 78	SMPEGInfoHeight(  $_[0] );
 79}
 80
 81sub size {
 82	SMPEGInfoTotalSize(  $_[0] );
 83}
 84
 85sub offset {
 86	SMPEGInfoCurrentOffset(  $_[0] );
 87}
 88
 89sub frame {
 90	SMPEGInfoCurrentFrame(  $_[0] );
 91}
 92
 93sub fps {
 94	SMPEGInfoCurrentFPS(  $_[0] );
 95}
 96
 97sub time {
 98	SMPEGInfoCurrentTime(  $_[0] );
 99}
100
101sub length {
102	SMPEGInfoTotalTime(  $_[0] );
103}
104
1051;