function initialize(userConfig) {
		var ready = false;

		/*
  	Reset the config on init so we have a clean slate. This is if the
  	user has to re-init.
  */
		_helpers2.default.resetConfig();

		/*
  	Initialize event handlers on init. This will clear any old
  	event handlers on the amplitude element and re-bind what is
  	necessary.
  */
		_events2.default.initializeEvents();

		/*
  	Initializes debugging right away so we can use it for the rest
  	of the configuration.
  */
		_config2.default.debug = userConfig.debug != undefined ? userConfig.debug : false;

		/*
  	Checks to see if the user has songs defined.
  */
		if (userConfig.songs) {
			/*
   	Checks to see if the user has some songs in the songs array.
   */
			if (userConfig.songs.length != 0) {
				/*
    	Copies over the user defined songs. and prepares
    	Amplitude for the rest of the configuration.
    */
				_config2.default.songs = userConfig.songs;
				/*
    	Flag amplitude as ready.
    */
				ready = true;
			} else {
				_helpers2.default.writeDebugMessage('Please add some songs, to your songs object!');
			}
		} else {
			_helpers2.default.writeDebugMessage('Please provide a songs object for AmplitudeJS to run!');
		}

		/**
   * Initializes the audio context. In this method it checks to see if the
   * user wants to use visualizations or not before proceeding.
   * @todo MAKE HANDLED BY AMPLITUDE FX.
   */
		//privateHelpInitializeAudioContext();

		/*
  	Checks if the user has any playlists defined. If they do
  	we have to initialize the functionality for the playlists.
  */
		if (userConfig.playlists && countPlaylists(userConfig.playlists) > 0) {
			/*
   	Copy the playlists over to Amplitude
   */
			_config2.default.playlists = userConfig.playlists;

			/*
   	Initialize default live settings
   */
			initializeDefaultLiveSettings();

			/*
   	Check to see if the user has valid song indexes in their playlist.
   */
			checkValidSongsInPlaylists();

			/*
   	Initialize the shuffle status of the playlists.
   */
			initializePlaylistShuffleStatuses();

			/*
   	Initialize the repeat status for the playlits.
   */
			initializePlaylistsRepeatStatuses();

			/*
   	Initialize temporary place holders for shuffle lists.
   */
			initializePlaylistShuffleLists();

			/*
   	Initializes the active shuffled indexes for shuffled playlists.
   */
			initializePlaylistShuffleIndexes();

			/*
   	Initializes the first song in the playlist
   */
			initializeFirstSongInPlaylistMetaData();
		}

		/*
  	When the preliminary config is ready, we are ready to proceed.
  */
		if (ready) {
			/*
   	Copies over the soundcloud information to the global config
   	which will determine where we go from there.
   */
			_config2.default.soundcloud_client = userConfig.soundcloud_client != undefined ? userConfig.soundcloud_client : '';

			/*
   	Checks if we want to use the art loaded from soundcloud.
   */
			_config2.default.soundcloud_use_art = userConfig.soundcloud_use_art != undefined ? userConfig.soundcloud_use_art : '';

			/*
   	If the user provides a soundcloud client then we assume that
   	there are URLs in their songs that will reference SoundcCloud.
   	We then copy over the user config they provided to the
   	temp_user_config so we don't mess up the global or their configs
   	and load the soundcloud information.
   */
			var tempUserConfig = {};

			if (_config2.default.soundcloud_client != '') {
				tempUserConfig = userConfig;

				/*
    	Load up SoundCloud for use with AmplitudeJS.
    */
				_soundcloud2.default.loadSoundCloud(tempUserConfig);
			} else {
				/*
    	The user is not using Soundcloud with Amplitude at this point
    	so we just finish the configuration with the users's preferences.
    */
				setConfig(userConfig);
			}
		}

		/*
  	Debug out what was initialized with AmplitudeJS.
  */
		_helpers2.default.writeDebugMessage('Initialized With: ');
		_helpers2.default.writeDebugMessage(_config2.default);
	}
/**
   * The main init function.  The user will call this through
  * Amplitude.init({}) and pass in their settings.
  *
  * Public Accessor: Amplitude.init( user_config_json )
  * @access public
   * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.
   */
The main init function.  The user will call this through
Amplitude.init({}) and pass in their settings.

Public Accessor: Amplitude.init( user_config_json )
@access public
@param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.
The main init function . The user will call this through Amplitude . init ( {} ) and pass in their settings . Public Accessor : Amplitude . init ( user_config_json ) @access public @param { object } userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS .
function initialize(userConfig) {
		var ready = false;
		_helpers2.default.resetConfig();
		_events2.default.initializeEvents();
		_config2.default.debug = userConfig.debug != undefined ? userConfig.debug : false;
		if (userConfig.songs) {
			if (userConfig.songs.length != 0) {
				_config2.default.songs = userConfig.songs;
				ready = true;
			} else {
				_helpers2.default.writeDebugMessage('Please add some songs, to your songs object!');
			}
		} else {
			_helpers2.default.writeDebugMessage('Please provide a songs object for AmplitudeJS to run!');
		}
		if (userConfig.playlists && countPlaylists(userConfig.playlists) > 0) {
			_config2.default.playlists = userConfig.playlists;
			initializeDefaultLiveSettings();
			checkValidSongsInPlaylists();
			initializePlaylistShuffleStatuses();
			initializePlaylistsRepeatStatuses();
			initializePlaylistShuffleLists();
			initializePlaylistShuffleIndexes();
			initializeFirstSongInPlaylistMetaData();
		}
		if (ready) {
			_config2.default.soundcloud_client = userConfig.soundcloud_client != undefined ? userConfig.soundcloud_client : '';
			_config2.default.soundcloud_use_art = userConfig.soundcloud_use_art != undefined ? userConfig.soundcloud_use_art : '';
			var tempUserConfig = {};
			if (_config2.default.soundcloud_client != '') {
				tempUserConfig = userConfig;
				_soundcloud2.default.loadSoundCloud(tempUserConfig);
			} else {
				setConfig(userConfig);
			}
		}
		_helpers2.default.writeDebugMessage('Initialized With: ');
		_helpers2.default.writeDebugMessage(_config2.default);
	}
function initialize ( userConfig ) { var ready = false ; _helpers2 . default . resetConfig ( ) ; _events2 . default . initializeEvents ( ) ; _config2 . default . debug = userConfig . debug != undefined ? userConfig . debug : false ; if ( userConfig . songs ) { if ( userConfig . songs . length != 0 ) { _config2 . default . songs = userConfig . songs ; ready = true ; } else { _helpers2 . default . writeDebugMessage ( 'Please add some songs, to your songs object!' ) ; } } else { _helpers2 . default . writeDebugMessage ( 'Please provide a songs object for AmplitudeJS to run!' ) ; } if ( userConfig . playlists && countPlaylists ( userConfig . playlists ) > 0 ) { _config2 . default . playlists = userConfig . playlists ; initializeDefaultLiveSettings ( ) ; checkValidSongsInPlaylists ( ) ; initializePlaylistShuffleStatuses ( ) ; initializePlaylistsRepeatStatuses ( ) ; initializePlaylistShuffleLists ( ) ; initializePlaylistShuffleIndexes ( ) ; initializeFirstSongInPlaylistMetaData ( ) ; } if ( ready ) { _config2 . default . soundcloud_client = userConfig . soundcloud_client != undefined ? userConfig . soundcloud_client : '' ; _config2 . default . soundcloud_use_art = userConfig . soundcloud_use_art != undefined ? userConfig . soundcloud_use_art : '' ; var tempUserConfig = { } ; if ( _config2 . default . soundcloud_client != '' ) { tempUserConfig = userConfig ; _soundcloud2 . default . loadSoundCloud ( tempUserConfig ) ; } else { setConfig ( userConfig ) ; } } _helpers2 . default . writeDebugMessage ( 'Initialized With: ' ) ; _helpers2 . default . writeDebugMessage ( _config2 . default ) ; }
The main init function.
The main init function .
/*
  	Reset the config on init so we have a clean slate. This is if the
  	user has to re-init.
  */ /*
  	Initialize event handlers on init. This will clear any old
  	event handlers on the amplitude element and re-bind what is
  	necessary.
  */ /*
  	Initializes debugging right away so we can use it for the rest
  	of the configuration.
  */ /*
  	Checks to see if the user has songs defined.
  */ /*
   	Checks to see if the user has some songs in the songs array.
   */ /*
    	Copies over the user defined songs. and prepares
    	Amplitude for the rest of the configuration.
    */ /*
    	Flag amplitude as ready.
    */ /**
   * Initializes the audio context. In this method it checks to see if the
   * user wants to use visualizations or not before proceeding.
   * @todo MAKE HANDLED BY AMPLITUDE FX.
   */ //privateHelpInitializeAudioContext(); /*
  	Checks if the user has any playlists defined. If they do
  	we have to initialize the functionality for the playlists.
  */ /*
   	Copy the playlists over to Amplitude
   */ /*
   	Initialize default live settings
   */ /*
   	Check to see if the user has valid song indexes in their playlist.
   */ /*
   	Initialize the shuffle status of the playlists.
   */ /*
   	Initialize the repeat status for the playlits.
   */ /*
   	Initialize temporary place holders for shuffle lists.
   */ /*
   	Initializes the active shuffled indexes for shuffled playlists.
   */ /*
   	Initializes the first song in the playlist
   */ /*
  	When the preliminary config is ready, we are ready to proceed.
  */ /*
   	Copies over the soundcloud information to the global config
   	which will determine where we go from there.
   */ /*
   	Checks if we want to use the art loaded from soundcloud.
   */ /*
   	If the user provides a soundcloud client then we assume that
   	there are URLs in their songs that will reference SoundcCloud.
   	We then copy over the user config they provided to the
   	temp_user_config so we don't mess up the global or their configs
   	and load the soundcloud information.
   */ /*
    	Load up SoundCloud for use with AmplitudeJS.
    */ /*
    	The user is not using Soundcloud with Amplitude at this point
    	so we just finish the configuration with the users's preferences.
    */ /*
  	Debug out what was initialized with AmplitudeJS.
  */