View on
MetaCPAN
モテメン > AnyEvent-DAAP-Server-0.01 > AnyEvent::DAAP::Server

Download:
AnyEvent-DAAP-Server-0.01.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.01   Source  

NAME ^

AnyEvent::DAAP::Server - DAAP Server implemented with AnyEvent

SYNOPSIS ^

  use AnyEvent;
  use AnyEvent::DAAP::Server;
  use AnyEvent::DAAP::Server::Track::File::MP3;
  use File::Find::Rule;

  my $daap = AnyEvent::DAAP::Server->new(port => 3689);

  foreach my $file (find name => '*.mp3', in => '.') {
      my $track = AnyEvent::DAAP::Server::Track::File::MP3->new(file => $file);
      $daap->add_track($track);
  }

  $daap->setup;

  AE::cv->wait;

DESCRIPTION ^

AnyEvent::DAAP::Server is a DAAP Server implementation on AnyEvent. It is like Net::DAAP::Server, but does not find files automatically (see SYNOPSIS.)

METHODS ^

my $daap = AnyEvent::DAAP::Server->new(name => 'AnyEvent::DAAP::Server', port => 3689);

Create new DAAP server instance.

$daap->setup;

Publish rendezvous service and setup handlers. Afterwards you will want to call AnyEvent::CondVar's recv().

$daap->add_track($track);

Add a new track that is an instance of AnyEvent::DAAP::Server::Track.

$daap->add_playlist($playlist);

Add a new playlist that is an instance of AnyEvent::DAAP::Server::Playlist.

$daap->database_updated;

After add_track() or add_playlist(), call this method to notify clients that the database is updated.

AUTHOR ^

motemen <motemen@gmail.com>

SEE ALSO ^

Net::DAAP::Server

LICENSE ^

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

syntax highlighting: