MP3_Playlist
[ class tree: MP3_Playlist ] [ index: MP3_Playlist ] [ all elements ]

Source for file result.php

Documentation is available at result.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker */
  3.  
  4. /**
  5.  * Load MP3_Playlist class.
  6.  */
  7. require_once 'MP3/Playlist.php';
  8.  
  9. if (isset($_POST['submit'])) {
  10.     // Default make parameters
  11.     $params = array();
  12.  
  13.     // Pick the type.
  14.     switch ($_POST['MakeType']{
  15.         case 'M3U':
  16.             $type MP3_Playlist::TYPE_M3U;
  17.             break;
  18.         case 'SMIL':
  19.             $type MP3_Playlist::TYPE_SMIL;
  20.             break;
  21.         case 'XML':
  22.             $type MP3_Playlist::TYPE_XML;
  23.             break;
  24.         case 'XHTML':
  25.             $type MP3_Playlist::TYPE_XHTML;
  26.             $params $_POST['ParamsXHTML'];
  27.             break;
  28.         case 'RSS':
  29.             $type MP3_Playlist::TYPE_RSS;
  30.             $params $_POST['ParamsRSS'];
  31.             break;
  32.         case 'SQLite':
  33.             $type MP3_Playlist::TYPE_SQLITE;
  34.             $params $_POST['ParamsSQLite'];
  35.             break;
  36.     }
  37.  
  38.     // Create new instance of MP3_Playlist.
  39.     $playlist = new MP3_Playlist($_POST['InputDir']$_POST['OutputDir'],
  40.                                  $_POST['BaseURL']$_POST['debug']);
  41.  
  42.     try {
  43.         // Call make() method, where 3 parameters (type, params and shuffle).
  44.         $playlist->make($type$params$_POST['shuffle']);
  45.  
  46.         $outputFunction $_POST['output''()';
  47.  
  48.         // Decoration.
  49.         if ($_POST['output'== 'show'{
  50.             print "<pre>\n";
  51.         }
  52.  
  53.         // Call output method.
  54.         $playlist->$_POST['output']($_POST['FileName']);
  55.  
  56.         // Decoration.
  57.         if ($_POST['output'== 'show'{
  58.             print "</pre>\n";
  59.         }
  60.     catch (PEAR_Exception $e{
  61.         print '<b>Error</b>: ' $e->getMessage();
  62.     }
  63. }
  64.  
  65. /*
  66.  * Local variables:
  67.  * mode: php
  68.  * tab-width: 4
  69.  * c-basic-offset: 4
  70.  * c-hanging-comment-ender-p: nil
  71.  * End:
  72.  */
  73. ?>

Documentation generated on Mon, 11 Mar 2019 15:39:05 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.