Preparing library for export.

Reconfigured webpack.

Removed unused packages.

Added library exports (webpack configured to export IIFE).

Created showcase directory.
This commit is contained in:
2022-04-17 17:44:52 -05:00
parent 61f9ae82ed
commit ec6ce48988
14 changed files with 6950 additions and 333 deletions

View File

@@ -7,4 +7,10 @@
// TODO: Demo functions.
// TODO: basic playlist display.
// TODO: Detect annotated elements.
// TODO: Create getting started.
// TODO: Create getting started.
import * as mappings from "./mapping/mappings.js";
import * as player from "./player/player.js";
import * as visualization from "./visualization/visualization.js";
export { mappings, player, visualization };

6
src/mapping/mappings.js Normal file
View File

@@ -0,0 +1,6 @@
import * as colors from "./colors.js";
import * as dimensions from "./dimensions.js";
import * as easings from "./easings.js";
import * as generic from "./generic.js";
export { colors, dimensions, easings, generic };

View File

@@ -1,6 +1,7 @@
import SongPlayer from "./SongPlayer.js";
import SongPlaylist from "./SongPlaylist.js";
import VisualizedSongPlayer from "./VisualizedSongPlayer.js";
import PlayListSong from "./PlaylistSong.js";
/**
* Instantiates a song player with a given playlist.
@@ -25,7 +26,7 @@ export function createSongPlaylist(name) {
}
/**
* Creates a song player that manages the visualizers for individual songs, as well as the listeners for the visualizations.
* Instantiates a song player that manages the visualizers for individual songs, as well as the listeners for the visualizations.
*
* @see VisualizedSongPlayer for more information about the returned object.
* @param {SongPlaylist} playlist the playlist this visualized song player will play through.
@@ -34,4 +35,17 @@ export function createSongPlaylist(name) {
*/
export function createVisualizedSongPlayer(playlist, fftSize = 1024) {
return new VisualizedSongPlayer(playlist, fftSize);
}
/**
* Instantiates a playlist song.
*
* @see PlaylistSong for more information about the returned object.
* @param {string} url The url at which the audio for the song can be retrieved.
* @param {string} name The name of the song.
* @param {string} author The name of the author(s).
* @returns {PlayListSong} The playlist song that is instantiated.
*/
export function createPlaylistSong(url, name, author) {
return new PlayListSong(url, name, author);
}