Mark Ethan Trostler > TiVo-HME > TiVo::HME::Resource

Download:
TiVo-HME-1.3.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 1.1   Source  

NAME ^

TiVo::HME::Resource - Perl encapsulation of a TiVo HME resource.

SYNOPSIS ^

  use TiVo::HME::Application;
  @ISA = qw(TiVo::HME::Applicaton);

    # create a buncha resources

    # Color
    # r,g,b,alpha = 0 ... 255
    my $color = $T_RESOURCE->color($red, $green, $blue, $alpha);

    # Font
    my $font = $T_RESOURCE->font([ 'system' | 'default' ], $point_size, STYLE);
    # point size is a float
    # STYLE is one of:
    # $T_CONST->FONT_PLAIN      
    # $T_CONST->FONT_BOLD       
    # $T_CONST->FONT_ITALIC     
    # $T_CONST->FONT_BOLDITALIC 

    # True Type Font (you need a file containing it)
    my $ttf = $T_RESOURCE->ttf_file($ttf_file_name);

    # Text
    my $text = $T_RESOURCE->text($font, $color, $string);
    # $font (TTF or Font) & $color are created as above
    # $string is yer string

    # Image (jpeg, mpeg, or png)
    my $image = $T_RESOURCE->image_file($path_to_image_file);

    # Sound
    my $sound = $T_RESOURCE->sound_file($path_to_sound_file);

    # Stream
    my $sound = $T_RESOURCE->stream($url, $content_type, $play);
    # $url points to stream resouce 
    # $content_type is a hint to TiVo so it knows what the stream is
    # $play, 1 = play, 0 = pause

    # Animation
    my $anim = $T_RESOURCE->animation($duration, $ease);
    # $duration is in miliseconds
    # $ease = -1. <= $ease <= 1.  0 = linear

    # Set active
    $resource->set_active ( [ 0 | 1 ] );

    # Set position
    $resource->position($pos);
    # $pos = milliseconds into resource

    # Set speed
    $resource->set_speed( 0 .. 1.);
    # 0 = paused
    # 1 = play at normal speed

    # Make key event
    my $event = $T_RESOURCE->make_key_event(1, $action, $code, $rawcode);
    # just put the '1' there for now...
    # $action can be anything BUT you can use:
    # $T_CONST->KEY_PRESS       
    # $T_CONST->KEY_REPEAT      
    # $T_CONST->KEY_RELEASE     

    # $code - see all the key codes defined in TiVo::HME::CONST
    # $rawcode can be anything

    # Send key event
    $T_RESOURCE->set_event(1, $animation, $event);
    # just put the '1' there for now...
    # $animation is an (optional) animation resource (0 to ignore)
    # $event is from 'make_key_event'

    # Close
    $resource->close;

    # Remove resource from TiVo
    $resource->remove;









    my $image = $T_RESOURCE->image_file('tivo.jpg');

DESCRIPTION ^

You create & manipulate resources - eventually assigning them to Views to be displayed/played by your TiVo.

SEE ALSO ^

http://tivohme.sourceforge.net TiVo::HME::Application

AUTHOR ^

Mark Ethan Trostler, <mark@zzo.com>

COPYRIGHT AND LICENSE ^

Copyright 2005 by Mark Ethan Trostler

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: