Source for file Music.php

Documentation is available at Music.php

  1. <?php
  2.  
  3.  
  4. # Copyright (c) 2002-2005 Cunningham & Cunningham, Inc.
  5. # Released under the terms of the GNU General Public License version 2 or later.
  6. #
  7. # PHP5 translation by Luis A. Floreani <luis.floreani@gmail.com>
  8.  
  9. class Music {
  10. public static $status = "ready";
  11.  
  12. public $title;
  13. public $artist;
  14. public $album;
  15. public $genre;
  16. public $size;
  17. public $seconds;
  18. public $trackNumber;
  19. public $trackCount;
  20. public $year;
  21. public $date;
  22. public $selected = false;
  23.  
  24.  
  25. public function track() {
  26. return $this->trackNumber . " of " . $this->trackCount;
  27. }
  28.  
  29. public function time() {
  30. return round($this->seconds / 0.6) / 100.0;
  31. }
  32.  
  33. public static function parse($string) {
  34. $m = new Music();
  35. $t = split("\t", $string);
  36. $m->title = $t[0];
  37. $m->artist = $t[1];
  38. $m->album = $t[2];
  39. $m->genre = $t[3];
  40. $m->size = $t[4];
  41. $m->seconds = $t[5];
  42. $m->trackNumber = $t[6];
  43. $m->trackCount = $t[7];
  44. $m->year = $t[8];
  45. $m->date = $t[9];
  46. return $m;
  47. }
  48. }
  49. ?>

Documentation generated on Sun, 02 Apr 2006 16:01:05 +0200 by phpDocumentor 1.3.0RC5