1: <?php
2: /**
3: * ManiaLib - Lightweight PHP framework for Manialinks
4: *
5: * @see http://code.google.com/p/manialib/
6: * @copyright Copyright (c) 2009-2011 NADEO (http://www.nadeo.com)
7: * @license http://www.gnu.org/licenses/lgpl.html LGPL License 3
8: * @version $Revision: 769 $:
9: * @author $Author: martin.gwendal $:
10: * @date $Date: 2012-12-13 10:49:17 +0100 (jeu., 13 déc. 2012) $:
11: */
12:
13: namespace ManiaLib\Gui\Elements;
14:
15: class Audio extends Music
16: {
17:
18: protected $xmlTagName = 'audio';
19: protected $posX = 0;
20: protected $posY = 0;
21: protected $posZ = 0;
22: protected $play;
23: protected $looping = 0;
24:
25: /**
26: * Autoplay the data when it's done loading
27: */
28: function autoPlay()
29: {
30: $this->play = 1;
31: }
32:
33: /**
34: * Loop when the end of the data is reached
35: */
36: function enableLooping()
37: {
38: $this->looping = 1;
39: }
40:
41: /**
42: * Returns whether auto playing is enabled
43: * @return boolean
44: */
45: function getAutoPlay()
46: {
47: return $this->play;
48: }
49:
50: /**
51: * Returns whether looping is enabled
52: * @return boolean
53: */
54: function getLooping()
55: {
56: return $this->looping;
57: }
58:
59: protected function postFilter()
60: {
61: parent::postFilter();
62: if($this->play !== null)
63: $this->xml->setAttribute('play', $this->play);
64: if($this->looping !== null)
65: $this->xml->setAttribute('looping', $this->looping);
66: }
67:
68: }
69:
70: ?>