Video::Xine::Event::Queue - Event queue for Xine streams


Video-Xine documentation Contained in the Video-Xine distribution.

Index


Code Index:

NAME

Top

Video::Xine::Event::Queue -- Event queue for Xine streams

SYNOPSIS

Top

  use Video::Xine;
  use Video::Xine::Event::Queue;

  my $queue = Video::Xine::Event::Queue->new($stream);

  my $event = $queue->get_event();

METHODS

Top

new()

  Video::Xine::Event::Queue->new($stream)

Returns an event queue object.

get_event()

  my $event = $queue->get_event();

Gets an event from the event queue. If there are no events waiting, returns undef.

wait_event()

 my $event = $queue->wait_event();

Waits for an event from the event queue, then returns it. Blocks if no events are waiting.


Video-Xine documentation Contained in the Video-Xine distribution.

package Video::Xine::Event::Queue;

use strict;
use warnings;

use Video::Xine::Event;

sub new {
  my $type = shift;
  my ($stream) = @_;

  my $self = {};
  $self->{'stream'} = $stream;
  $self->{'queue'} = xine_event_new_queue($stream->{'stream'});
  bless $self, $type;
}

sub get_event {
  my $self = shift;
  my $event = xine_event_get($self->{'queue'})
    or return;
  bless $event, 'Video::Xine::Event';
}

sub wait_event {
    my $self = shift;

    my $event = xine_event_wait($self->{'queue'});

    bless $event, 'Video::Xine::Event';
}

1;

__END__