mirror of
https://github.com/captbaritone/webamp.git
synced 2026-08-01 22:45:18 +00:00
Add method to reopen Webamp
This commit is contained in:
parent
19db61ccf9
commit
47ba520c24
5 changed files with 16 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import {
|
||||
CLOSE_WINAMP,
|
||||
OPEN_WINAMP,
|
||||
STOP,
|
||||
TOGGLE_VISUALIZER_STYLE,
|
||||
CLOSE_REQUESTED,
|
||||
|
|
@ -108,6 +109,10 @@ export function close(): Dispatchable {
|
|||
};
|
||||
}
|
||||
|
||||
export function open(): Dispatchable {
|
||||
return { type: OPEN_WINAMP };
|
||||
}
|
||||
|
||||
export function toggleVisualizerStyle(): Dispatchable {
|
||||
return { type: TOGGLE_VISUALIZER_STYLE };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
export const ADD_TRACK_FROM_URL = "ADD_TRACK_FROM_URL";
|
||||
export const CLOSE_WINAMP = "CLOSE_WINAMP";
|
||||
export const OPEN_WINAMP = "OPEN_WINAMP";
|
||||
export const MINIMIZE_WINAMP = "MINIMIZE_WINAMP";
|
||||
export const IS_PLAYING = "IS_PLAYING";
|
||||
export const IS_STOPPED = "IS_STOPPED";
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import { createSelector } from "reselect";
|
|||
|
||||
import {
|
||||
CLOSE_WINAMP,
|
||||
OPEN_WINAMP,
|
||||
SET_SKIN_DATA,
|
||||
START_WORKING,
|
||||
STEP_MARQUEE,
|
||||
|
|
@ -143,6 +144,8 @@ const display = (
|
|||
return { ...state, working: true };
|
||||
case CLOSE_WINAMP:
|
||||
return { ...state, closed: true };
|
||||
case OPEN_WINAMP:
|
||||
return { ...state, closed: false };
|
||||
case LOADING:
|
||||
return { ...state, loading: true };
|
||||
case LOADED:
|
||||
|
|
|
|||
|
|
@ -253,6 +253,9 @@ export type Action =
|
|||
| {
|
||||
type: "CLOSE_WINAMP";
|
||||
}
|
||||
| {
|
||||
type: "OPEN_WINAMP";
|
||||
}
|
||||
| {
|
||||
type: "LOADING";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -307,6 +307,10 @@ class Winamp {
|
|||
return this._actionEmitter.on(CLOSE_WINAMP, cb);
|
||||
}
|
||||
|
||||
reopen(): void {
|
||||
this.store.dispatch(Actions.open());
|
||||
}
|
||||
|
||||
onTrackDidChange(cb: (trackInfo: LoadedURLTrack | null) => void): () => void {
|
||||
let previousTrackId: number | null = null;
|
||||
return this.store.subscribe(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue