"use strict";

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var AudioParam = require("./AudioParam");

var _require = require("../constants/AudioParamRate"),
    AUDIO_RATE = _require.AUDIO_RATE;

var SpatialListener = function () {
  /**
   * @param {AudioContext} context
   */
  function SpatialListener(context) {
    _classCallCheck(this, SpatialListener);

    this.context = context;
    this._positionX = new AudioParam(context, { rate: AUDIO_RATE, defaultValue: 0 });
    this._positionY = new AudioParam(context, { rate: AUDIO_RATE, defaultValue: 0 });
    this._positionZ = new AudioParam(context, { rate: AUDIO_RATE, defaultValue: 0 });
    this._forwardX = new AudioParam(context, { rate: AUDIO_RATE, defaultValue: 0 });
    this._forwardY = new AudioParam(context, { rate: AUDIO_RATE, defaultValue: 0 });
    this._forwardZ = new AudioParam(context, { rate: AUDIO_RATE, defaultValue: 0 });
    this._upX = new AudioParam(context, { rate: AUDIO_RATE, defaultValue: 0 });
    this._upY = new AudioParam(context, { rate: AUDIO_RATE, defaultValue: 0 });
    this._upZ = new AudioParam(context, { rate: AUDIO_RATE, defaultValue: 0 });
  }

  /**
   * @return {AudioParam}
   */


  _createClass(SpatialListener, [{
    key: "getPositionX",
    value: function getPositionX() {
      return this._positionX;
    }

    /**
     * @return {AudioParam}
     */

  }, {
    key: "getPositionY",
    value: function getPositionY() {
      return this._positionY;
    }

    /**
     * @return {AudioParam}
     */

  }, {
    key: "getPositionZ",
    value: function getPositionZ() {
      return this._positionZ;
    }

    /**
     * @return {AudioParam}
     */

  }, {
    key: "getForwardX",
    value: function getForwardX() {
      return this._forwardX;
    }

    /**
     * @return {AudioParam}
     */

  }, {
    key: "getForwardY",
    value: function getForwardY() {
      return this._forwardY;
    }

    /**
     * @return {AudioParam}
     */

  }, {
    key: "getForwardZ",
    value: function getForwardZ() {
      return this._forwardZ;
    }

    /**
     * @return {AudioParam}
     */

  }, {
    key: "getUpX",
    value: function getUpX() {
      return this._upX;
    }

    /**
     * @return {AudioParam}
     */

  }, {
    key: "getUpY",
    value: function getUpY() {
      return this._upY;
    }

    /**
     * @return {AudioParam}
     */

  }, {
    key: "getUpZ",
    value: function getUpZ() {
      return this._upZ;
    }
  }]);

  return SpatialListener;
}();

module.exports = SpatialListener;