Music-Audioscrobbler-MPD

 view release on metacpan or  search on metacpan

lib/Music/Audioscrobbler/MPD.pm  view on Meta::CPAN


=item mpd_server			

hostname of mpd_server

=item mpd_port

port for mpd_server

=item mpd_password		

mpd password

=item verbose				

Set verbosity level (1 through 4)

=item logfile				

File to output loginfo to

=item scrobblequeue		

Path to file to queue info to

=item music_directory		

Root to MP3 files

=item get_mbid_from_mb

Use the Music::Tag::MusicBrainz plugin to get missing "mbid" value.

=item runonsubmit			

Array of commands to run after submit

=item runonstart			

Array of commands to run on start of play

=item monitor				

True if monitor should be turned on

=item musictag			

True if you want to use Music::Tag to get info from file

=item musictag_overwrite			

True if you want to Music::Tag info to override file info


=item music_tag_opts		

Options for Music::Tag 

=item proxy_server

Specify a procy server in the form http://proxy.server.tld:8080.  Please note that environment is checked for HTTP_PROXY, so you may not need this option.

=item allow_stream

If set to true, will scrobble HTTP streams. 

=back

=back

=cut

sub options {
    my $self = shift;
    if ( exists $self->{_options} ) {
        return $self->{_options}->options(@_);
    }
    else {
        $self->{_options} = Config::Options->new();
        return $self->{_options}->options(@_);
    }
}

=head1 INTERNAL METHODS (for reference)

=over

=item mpdsock()

returns open socket to mpd program.

=cut

sub mpdsock {
    my $self = shift;
    my $new  = shift;
    if ($new) {
        $self->{mpdsock} = $new;
    }
    unless ( exists $self->{mpdsock} ) {
        $self->{mpdsock} = undef;
    }
    return $self->{mpdsock};
}

=item connect()

Connect to MPD if necessary

=cut

sub connect {
    my $self = shift;
    if ( ( $self->mpdsock ) && ( $self->is_connected ) ) {
        $self->status( 3, "Already connected just fine." );
        return 1;
    }

    $self->mpdsock(
                    IO::Socket::INET->new( PeerAddr => $self->options("mpd_server"),
                                           PeerPort => $self->options("mpd_port"),



( run in 0.508 second using v1.01-cache-2.11-cpan-71847e10f99 )