ajax.php
changeset 5 9b96265b5918
parent 3 e7447a6044ec
child 6 5f35ebc4f9bb
equal deleted inserted replaced
4:cde92f6ec29f 5:9b96265b5918
     2 
     2 
     3 /**
     3 /**
     4  * Action servlet (play, pause, etc.)
     4  * Action servlet (play, pause, etc.)
     5  *
     5  *
     6  * Web control interface script for Amarok
     6  * Web control interface script for Amarok
     7  * Written by Dan Fuhry - 2008
     7  * Copyright (C) 2008 Dan Fuhry
     8  *
     8  *
     9  * This script is in the public domain. Use it for good, not evil.
     9  * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
       
    10  * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
       
    11  *
       
    12  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
       
    13  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
    10  */
    14  */
    11 
    15 
    12 status('initializing Services_JSON');
    16 status('initializing Services_JSON');
    13 $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
    17 $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
    14 
    18 
    51     case 'stop':
    55     case 'stop':
    52     case 'next':
    56     case 'next':
    53     case 'prev':
    57     case 'prev':
    54       if ( !$allowcontrol )
    58       if ( !$allowcontrol )
    55         return false;
    59         return false;
    56       echo dcop_action('player', 'stop');
    60       echo dcop_action('player', $action);
    57       break;
    61       break;
    58     case 'play':
    62     case 'play':
    59       if ( !$allowcontrol )
    63       if ( !$allowcontrol )
    60         return false;
    64         return false;
    61       echo dcop_action('player', 'playPause');
    65       echo dcop_action('player', 'playPause');