2017 © Pedro Peláez
 

library pmpd

PHP Music Player Daemon control implementation

image

smt/pmpd

PHP Music Player Daemon control implementation

  • Wednesday, December 2, 2015
  • by smt
  • Repository
  • 1 Watchers
  • 2 Stars
  • 38 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PMPD

PHP client library for Music Player Daemon, (*1)

Prerequesties

  • PHP 5.6+
  • Running MPD :)

Installation

composer require smt/pmpd dev-develop

Usage

use Smt\Pmpd\Client\Impl\DefaultClient;
use Smt\Pmpd\Configuration\HostConfiguration;
use Smt\Pmpd\Connection\Commands;
use Smt\Pmpd\Connection\ConnectionFactory;
use Smt\Pmpd\Entity\Enum\PlaybackState;
use Smt\Pmpd\Response\FailResponse;

$connectionFactory = new ConnectionFactory();
$config = new HostConfiguration();
$config->setHost('127.0.0.1');
$connection = $connectionFactory->createConnection($config);
$client = new DefaultClient($connection);

echo $client->getCurrent()->getTitle() . ' playing: ';
echo $client->getStatus()->getState() == PlaybackState::PLAYING . PHP_EOL;
$client->next();
$client->toggle();
$client->play();
$client->updateDatabaseAsync();
$response = $client->query(Commands::ADD_AND_RETURN_ID, 'Asking Alexandria - Not The American Average.flac', 1); // Add it to first position
if ($response instanceof FailResponse) {
    echo 'Something gone wrong :(' . PHP_EOL . PHP_EOL . $response->getMessage();
} else {
    echo 'Id in playlist:' . $response->get('Id') . PHP_EOL;
}

For more see documentation, (*2)

Roadmap

  • [X] Implement connection with password;
  • [X] Write API documentation;
  • [X] Cover with tests
  • [ ] Rewrite client to facade with subsystems;

License

This library is licensed under MIT license, (*3)

The Versions

02/12 2015

dev-develop

dev-develop

PHP Music Player Daemon control implementation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kirill Saksin

mpd mpc music player daemon

02/12 2015

v1.0.0

1.0.0.0

PHP Music Player Daemon control implementation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kirill Saksin

mpd mpc music player daemon