AnyEvent::DAAP::Server::Track - Base class of daap tracks
This class abstractly represents one track. Usually you will want to use AnyEvent::DAAP::Server::Track::File::MP3 for local mp3 files.
Abstract method. Should return track's music data immediately. If $track allows ranged request, the $pos parameter may be supplied. If so, $track should return data from the position at $pos byte.
Override this to return true if this track allows ranged request (i.e. skip/pause). Defaults to return 0.
Override this method if you want to send data to clients asynchronously.
$connection argument is an AnyEvent::DAAP::Server::Connection. $connection->handle is an AnyEvent::Handle so call $connection->handle->push_write() this to send data.
$res argument is partially filled HTTP::Response, without $res->content and $res->content_length.
$pos argument is requested start-position of music data or undef.
After writing all data, you should send $connection->handle->push_shutdown().
Read AnyEvent::DAAP::Server::Track::File::MP3's source to grab what these mean.
motemen <motemen@gmail.com>
AnyEvent::DAAP::Server::Track::File::MP3
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install AnyEvent::DAAP::Server, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AnyEvent::DAAP::Server
CPAN shell
perl -MCPAN -e shell install AnyEvent::DAAP::Server
For more information on module installation, please visit the detailed CPAN module installation guide.