Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Music::Audioscrobbler::MPD
Module providing routines to submit songs to last.fm from MPD.

Music::Audioscrobbler::MPD - Module providing routines to submit songs to last.fm from MPD.



NAME

Music::Audioscrobbler::MPD - Module providing routines to submit songs to last.fm from MPD.


SYNOPSIS


        use Music::Audioscrobbler::MPD

        my $mpds = Music::Audioscrobbler::MPD->new(\%options); 

        $mpds->monitor_mpd();


AUTHOR

Edward Allen, ealleniii _at_ cpan _dot_ org


DESCRIPTION

Music::Audioscrobbler::MPD is a scrobbler for MPD. It may one day be distributed in a package called Music::Audioscrobbler, but is independent at the momment.

All internal code is subject to change. See musicmpdscrobble for usage info.


METHODS

new()

        my $mpds = Music::Audioscrobbler::MPD->new($options);
monitor_mpd()
Starts the main loop.

options()
Get or set options via hash. Here is a list of available options:
optionfile
Perl file used to get options from

lastfm_username
lastfm username

lastfm_password
lastfm password. Not needed if lastfm_md5password is set.

lastfm_md5password
MD5 hash of lastfm password.

lastfm_client_id
Client ID provided by last.fm. Defaults to ``tst'', which is valid for testing only.

lastfm_client_version
Set to the version of your program when setting a valid client_id. Defaults to ``1.0''

mpd_server
hostname of mpd_server

mpd_port
port for mpd_server

mpd_password
mpd password

verbose
Set verbosity level (1 throuch 4)

logfile
File to output loginfo to

scrobblequue
Path to file to queue info to

music_directory
Root to MP3 files

get_mbid_from_mb
Use the Music::Tag::MusicBrainz plugin to get missing ``mbid'' value.

runonsubmit
Array of commands to run after submit

runonstart
Array of commands to run on start of play

monitor
True if monitor should be turned on

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

musicdb
True to use MusicDB plugin for Music::Tag

music_tag_opts
Options for Music::Tag


INTERNAL METHODS (for reference)

mpdsock()
returns open socket to mpd program.

connect()
Connect to MPD if necessary

is_connected()
Return true if connected to mpd.

process_feedback
Process response from mpd.

send_command($command)
send a commnd to mpd.

send_command($command)
send password to mpd.

get_info($command)
Send mpd a command and parse the output if output is a column seperated list.

get_status($command)
get_status command. Returns hashref with:

    *  volume: (0-100)

    * repeat: (0 or 1)

    * random: (0 or 1)

    * playlist: (31-bit unsigned integer, the playlist version number)

    * playlistlength: (integer, the length of the playlist)

    * playlistqueue: (integer, the temporary fifo playlist version number)

    * xfade: <int seconds> (crossfade in seconds)

    * state: ("play", "stop", or "pause")

    * song: (current song stopped on or playing, playlist song number)

    * songid: (current song stopped on or playing, playlist songid)

    * time: <int elapsed>:<time total> (of current playing/paused song)

    * bitrate: <int bitrate> (instantaneous bitrate in kbps)

    * audio: <int sampleRate>:<int bits>:<int channels>

    * updating_db: <int job id>

    * error: if there is an error, returns message here

get_current_song_info($command)
get_status command. Returns hashref with:

    file: albums/bob_marley/songs_of_freedom/disc_four/12.bob_marley_-_could_you_be_loved_(12"_mix).flac

    Time: 327

    Album: Songs Of Freedom - Disc Four

    Artist: Bob Marley

    Title: Could You Be Loved (12" Mix)

    Track: 12

    Pos: 11

    Id: 6601

status($level, @message)
Print to log.

logfileout
returns filehandle to log.

new_info($cinfo)
reset current song info.

song_change($cinfo)
Run on song change

update_info()
Run on poll

monitor()
print current status to STDERR

scrobble()
Scrobble current song

run_commands()
Fork and run list of commands.


SEE ALSO

musicmpdscrobble, the Music::Tag manpage


COPYRIGHT

Copyright (c) 2007 Edward J. Allen III

Some code and inspiration from the Audio::MPD manpage Copyright (c) 2005 Tue Abrahamsen, Copyright (c) 2006 Nicholas J. Humfrey, Copyright (c) 2007 Jerome Quelin

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy