1  /**
     2   * properties.SoundShortcuts
     3   * List of default special properties for Sounds
     4   * The function names are strange/inverted because it makes for easier debugging (alphabetic order). They're only for internal use (on this class) anyways.
     5   *
     6   * @author		Zeh Fernando, Nate Chatellier, Arthur Debert
     7   * @version		1.0.0
     8   */
     9  
    10  import caurina.transitions.Tweener;
    11  
    12  class caurina.transitions.properties.SoundShortcuts {
    13  
    14  	/**
    15  	 * There's no constructor.
    16  	 */
    17  	public function SoundShortcuts () {
    18  		trace ("This is an static class and should not be instantiated.")
    19  	}
    20  
    21  	/**
    22  	 * Registers all the special properties to the Tweener class, so the Tweener knows what to do with them.
    23  	 */
    24  	public static function init():Void {
    25  
    26  		// Normal properties
    27  		Tweener.registerSpecialProperty("_sound_volume", _sound_volume_get, _sound_volume_set);
    28  		Tweener.registerSpecialProperty("_sound_pan", _sound_pan_get, _sound_pan_set);
    29  
    30  	}
    31  
    32  
    33  	// ==================================================================================================================================
    34  	// NORMAL SPECIAL PROPERTY functions ------------------------------------------------------------------------------------------------
    35  
    36  	// ----------------------------------------------------------------------------------------------------------------------------------
    37  	// _sound_volume
    38  
    39  	/**
    40  	 * Returns the current sound volume
    41  	 *
    42  	 * @param		p_obj				Object		Sound object
    43  	 * @return							Number		The current volume
    44  	 */
    45  	public static function _sound_volume_get (p_obj:Object):Number {
    46  		return p_obj.getVolume();
    47  	}
    48  
    49  	/**
    50  	 * Sets the sound volume
    51  	 *
    52  	 * @param		p_obj				Object		Sound object
    53  	 * @param		p_value				Number		New volume
    54  	 */
    55  	public static function _sound_volume_set (p_obj:Object, p_value:Number):Void {
    56  		p_obj.setVolume(p_value);
    57  	}
    58  
    59  
    60  	// ----------------------------------------------------------------------------------------------------------------------------------
    61  	// _sound_pan
    62  
    63  	/**
    64  	 * Returns the current sound pan
    65  	 *
    66  	 * @param		p_obj				Object		Sound object
    67  	 * @return							Number		The current pan
    68  	 */
    69  	public static function _sound_pan_get (p_obj:Object):Number {
    70  		return p_obj.getPan();
    71  	}
    72  
    73  	/**
    74  	 * Sets the sound volume
    75  	 *
    76  	 * @param		p_obj				Object		Sound object
    77  	 * @param		p_value				Number		New pan
    78  	 */
    79  	public static function _sound_pan_set (p_obj:Object, p_value:Number):Void {
    80  		p_obj.setPan(p_value);
    81  	}
    82  
    83  }
    84