Start getting the playlist visualizer threaded through

This commit is contained in:
Jordan Eldredge 2018-05-23 19:48:34 +01:00
parent 5bf56908fc
commit b495e4f958
3 changed files with 16 additions and 3 deletions

View file

@ -322,3 +322,10 @@
top: 4px;
right: 30px;
}
#webamp #playlist-window #visualizer {
position: absolute;
/* TODO: These numbers are not quite right */
top: 10px;
left: 5px;
}

View file

@ -31,11 +31,12 @@ const App = ({
}
switch (id) {
case "main":
// TODO: Pass only the analyser node
return <MainWindow mediaPlayer={media} filePickers={filePickers} />;
case "equalizer":
return <EqualizerWindow />;
case "playlist":
return <PlaylistWindow />;
return <PlaylistWindow analyser={media._analyser} />;
default:
if (!w.generic) {
throw new Error("Tried to render an unknown window:", id);

View file

@ -23,6 +23,7 @@ import {
import { clamp } from "../../utils";
import DropTarget from "../DropTarget";
import Visualizer from "../Visualizer";
import PlaylistShade from "./PlaylistShade";
import AddMenu from "./AddMenu";
import RemoveMenu from "./RemoveMenu";
@ -61,7 +62,8 @@ class PlaylistWindow extends React.Component {
playlistWindowPixelSize,
playlistShade,
close,
toggleShade
toggleShade,
analyser
} = this.props;
if (playlistShade) {
return <PlaylistShade />;
@ -128,7 +130,10 @@ class PlaylistWindow extends React.Component {
<div
className="playlist-visualizer"
onClick={this.props.toggleVisualizerStyle}
/>
>
{/* TODO: Resize the visualizer so it fits */
false && <Visualizer analyser={analyser} />}
</div>
<PlaylistActionArea />
<ListMenu />
<div