Make pause button unpause.
This commit is contained in:
parent
2b151649c9
commit
4a0958f1e5
2 changed files with 11 additions and 1 deletions
|
@ -445,6 +445,10 @@ export const pause = (player: number): AppThunk => (dispatch, getState) => {
|
|||
sendBAPSicleChannel({ channel: player, command: "PAUSE" });
|
||||
};
|
||||
|
||||
export const unpause = (player: number): AppThunk => (dispatch, getState) => {
|
||||
sendBAPSicleChannel({ channel: player, command: "UNPAUSE" });
|
||||
};
|
||||
|
||||
export const stop = (player: number): AppThunk => (dispatch, getState) => {
|
||||
sendBAPSicleChannel({ channel: player, command: "STOP" });
|
||||
};
|
||||
|
|
|
@ -368,7 +368,13 @@ export function Player({ id }: { id: number }) {
|
|||
<FaPlay />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => dispatch(MixerState.pause(id))}
|
||||
onClick={() =>
|
||||
dispatch(
|
||||
playerState.state === "paused"
|
||||
? MixerState.unpause(id)
|
||||
: MixerState.pause(id)
|
||||
)
|
||||
}
|
||||
className={
|
||||
playerState.state === "paused" ? "sp-state-paused" : ""
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue