Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Commit

Permalink
Added the playback controller and updated the README.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbart committed Dec 28, 2012
1 parent 978a82f commit e345799
Show file tree
Hide file tree
Showing 3 changed files with 187 additions and 1 deletion.
171 changes: 171 additions & 0 deletions Client/Controller/Playback.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
<?php

/**
* Plex Client Playback Controller
*
* @category php-plex
* @package Plex_Client
* @subpackage Plex_Client_Controller
* @author <[email protected]> Nick Bartkowiak
* @copyright (c) 2012 Nick Bartkowiak
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU Public Licence (GPLv3)
* @version 0.0.1
*
* This file is part of php-plex.
*
* php-plex is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* php-plex is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

/**
* Represents a Plex client on the network.
*
* @category php-plex
* @package Plex_Client
* @subpackage Plex_Client_Controller
* @author <[email protected]> Nick Bartkowiak
* @copyright (c) 2012 Nick Bartkowiak
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU Public Licence (GPLv3)
* @version 0.0.1
*/
class Plex_Client_Controller_Playback extends Plex_Client_ControllerAbstract
{
/**
* Executes the play command.
*
* @uses Plex_Client_ControllerAbstract::executeCommand()
*
* @return void
*/
public function play()
{
$this->executeCommand();
}

/**
* Executes the pause command.
*
* @uses Plex_Client_ControllerAbstract::executeCommand()
*
* @return void
*/
public function pause()
{
$this->executeCommand();
}

/**
* Executes the stop command.
*
* @uses Plex_Client_ControllerAbstract::executeCommand()
*
* @return void
*/
public function stop()
{
$this->executeCommand();
}

/**
* Executes the rewind command.
*
* @uses Plex_Client_ControllerAbstract::executeCommand()
*
* @return void
*/
public function rewind()
{
$this->executeCommand();
}

/**
* Executes the fast forward command.
*
* @uses Plex_Client_ControllerAbstract::executeCommand()
*
* @return void
*/
public function fastForward()
{
$this->executeCommand();
}

/**
* Executes the step forward command.
*
* @uses Plex_Client_ControllerAbstract::executeCommand()
*
* @return void
*/
public function stepForward()
{
$this->executeCommand();
}

/**
* Executes the big step forward command.
*
* @uses Plex_Client_ControllerAbstract::executeCommand()
*
* @return void
*/
public function bigStepForward()
{
$this->executeCommand();
}

/**
* Executes the step back command.
*
* @uses Plex_Client_ControllerAbstract::executeCommand()
*
* @return void
*/
public function stepBack()
{
$this->executeCommand();
}

/**
* Executes the big step back command.
*
* @uses Plex_Client_ControllerAbstract::executeCommand()
*
* @return void
*/
public function bigStepBack()
{
$this->executeCommand();
}

/**
* Executes the skip next command.
*
* @uses Plex_Client_ControllerAbstract::executeCommand()
*
* @return void
*/
public function skipNext()
{
$this->executeCommand();
}

/**
* Executes the skip previous command.
*
* @uses Plex_Client_ControllerAbstract::executeCommand()
*
* @return void
*/
public function skipPrevious()
{
$this->executeCommand();
}
}
2 changes: 1 addition & 1 deletion Client/ControllerAbstract.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* Plex Client Controller Abstract
* Plex Client Controller
*
* @category php-plex
* @package Plex_Client
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,18 @@ Artists, albums, and tracks
$trackByIndex = $albumByExactTitleMatch->getTrack(3);
$trackByKey = $albumByExactTitleMatch->getTrack('/library/metadata/57726');
$trackByExactTitleMatch = $albumByExactTitleMatch->getTrack('Rewind');

Playback controller

$playback = $client->getPlaybackController();
$playback->play();
$playback->pause();
$playback->stop();
$playback->rewind();
$playback->fastForward();
$playback->stepForward();
$playback->bigStepForward();
$playback->stepBack();
$playback->bigStepBack();
$playback->skipNext();
$playback->skipPrevious();

0 comments on commit e345799

Please sign in to comment.