//Config is created for Sync. If you need it request it from Sync.
//Do not create new instance, only one sync per one sync device!
var Config = function () {
  //DEMO OR SYNC MODE?
  //var demomode = false;
  var demomode = true;

  //Path to the rocket xml file
  var rocketXML = "stockholm.rocket";

  //audio paht
  var audioPath = "bin/nosfe-catfoodremixedittiin.mp3";

  //image path
  var imagePath = "bin/kuvat/";

  //Image files and texture parameters:
  //  name : file name
  //  id : the id used to fetch the texture in the demo
  //  mapping : THREE constant default is THREE.UVMapping
  //  wrapS : THREE constant default is THREE.ClampToEdgeWrapping
  //  wrapT : THREE constant default is THREE.ClampToEdgeWrapping
  //  magFilter : THREE constant default is THREE.LinearFilter (note that for pixel stuff THREE.NearestFilter is the best)
  //  minFilter : THREE constant default is THREE.LinearMipMapLinearFilter (note that for pixel stuff THREE.NearestFilter is the best)
  //  format : THREE constant default is THREE.RGBAFormat but for jpg the format is automatically changed to THREE.RGBFormat
  //  flipY : boolean default true
  //  repeat : Array of 2 integers that telss how many times the texture is repeated in X and Y axis
  //  offset : Array of 2 integers that telss how much offset the texture has in X and Y axis
  var imageFiles = [
    {
      name : "0.jpg",
      id : 0,
      format: THREE.RGBFormat
    },
    {
      name : "1.jpg",
      id : 1,
      format: THREE.RGBFormat
    },
    {
      name : "2.jpg",
      id : 2,
      format: THREE.RGBAFormat
    },
    {
      name : "3.jpg",
      id : 3,
      format: THREE.RGBFormat
    },
    {
      name : "4.jpg",
      id : 4,
      format: THREE.RGBFormat
    },
    {
      name : "5.jpg",
      id : 5,
      format: THREE.RGBFormat
    },
    {
      name : "6.jpg",
      id : 6,
      format: THREE.RGBFormat
    },
    {
      name : "7.jpg",
      id : 7,
      format: THREE.RGBFormat
    },
    {
      name : "8.jpg",
      id : 8,
      format: THREE.RGBFormat
    },
    {
      name : "9.jpg",
      id : 9,
      format: THREE.RGBAFormat
    },
    {
      name : "10.jpg",
      id : 10,
      format: THREE.RGBFormat
    },
    {
      name : "11.jpg",
      id : 11,
      format: THREE.RGBFormat
    },
    {
      name : "12.jpg",
      id : 12,
      format: THREE.RGBFormat
    },
    {
      name : "13.jpg",
      id : 13,
      format: THREE.RGBFormat
    },
        {
      name : "14.jpg",
      id : 14,
      format: THREE.RGBFormat
    },
    {
      name : "15.jpg",
      id : 15,
      format: THREE.RGBFormat
    },
    {
      name : "16.jpg",
      id : 16,
      format: THREE.RGBFormat
    },
    {
      name : "17.jpg",
      id : 17,
      format: THREE.RGBFormat
    },
        {
      name : "18.jpg",
      id : 18,
      format: THREE.RGBFormat
    },
    {
      name : "19.jpg",
      id : 19,
      format: THREE.RGBFormat
    },
    {
      name : "20.jpg",
      id : 20,
      format: THREE.RGBFormat
    },
    {
      name : "21.jpg",
      id : 21,
      format: THREE.RGBFormat
    },
    {
      name : "22.jpg",
      id : 22,
      format: THREE.RGBFormat
    },
    {
      name : "23.jpg",
      id : 23,
      format: THREE.RGBFormat
    },
    {
      name : "24.jpg",
      id : 24,
      format: THREE.RGBFormat
    },
    {
      name : "25.jpg",
      id : 25,
      format: THREE.RGBFormat
    },
        {
      name : "26.jpg",
      id : 26,
      format: THREE.RGBFormat
    },
    {
      name : "27.jpg",
      id : 27,
      format: THREE.RGBFormat
    },
    {
      name : "28.jpg",
      id : 28,
      format: THREE.RGBFormat
    },
    {
      name : "29.jpg",
      id : 29,
      format: THREE.RGBFormat
    },
    {
      name : "30.jpg",
      id : 30,
      format: THREE.RGBFormat
    },
    {
      name : "31.jpg",
      id : 31,
      format: THREE.RGBFormat
    },
    {
      name : "32.jpg",
      id : 32,
      format: THREE.RGBFormat
    },
  ];

  //video path
  var videoPath = "bin/videot/";
  //Video files that are used as resources
  //name is the file name with it's file extension
  //id is the id that will be set to the HTML video element
  var videoFiles = [];

  //MUSIC RELATED VARIABLES FOR SYNC
  //Beats per minute
  var bpm = 120;
  //beats per row
  var bpr = 4;
  //row rate
  var rr = (bpm / 60) * bpr;
  //current row
  var row = 0;

  return {
    getBeatsPerMinute: function () {
      return bpm;
    },

    getBeatsPerRow: function () {
      return bpr;
    },

    getRowRate: function () {
      return rr;
    },

    getRow: function () {
      return row;
    },

    setRow: function (r) {
      row = r;
    },

    isDemoMode: function () {
      return demomode;
    },

    getXML: function () {
      return rocketXML;
    },

    getAudioPath: function () {
      return audioPath;
    },

    getImagePath: function () {
      return imagePath;
    },

    getImageFiles: function () {
      return imageFiles;
    },

    getVideoPath: function () {
      return videoPath;
    },

    getVideoFiles: function () {
      return videoFiles;
    },
  };
};
