From 369589e4601afc1f18c7d8c6d2b9c41c436717d4 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Sat, 1 Jul 2017 14:33:40 -0700 Subject: [PATCH] Add eq shade state to reducer --- js/actionCreators.js | 9 +++++++-- js/actionTypes.js | 1 + js/reducers.js | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/js/actionCreators.js b/js/actionCreators.js index 9337c728..fe64c9a0 100644 --- a/js/actionCreators.js +++ b/js/actionCreators.js @@ -20,7 +20,8 @@ import { TOGGLE_REPEAT, TOGGLE_SHUFFLE, SET_EQ_ON, - SET_EQ_OFF + SET_EQ_OFF, + TOGGLE_EQUALIZER_SHADE_MODE } from "./actionTypes"; export function play() { @@ -42,7 +43,7 @@ export function stop() { } export function seekForward(seconds) { - return function(dispatch, getState) { + return function (dispatch, getState) { const { media } = getState(); const { timeElapsed, length } = media; const newTimeElapsed = timeElapsed + seconds; @@ -222,3 +223,7 @@ export function downloadPreset() { downloadURI(dataURI, "entry.eqf"); }; } + +export function toggleEqualizerShadeMode() { + return { type: TOGGLE_EQUALIZER_SHADE_MODE }; +} diff --git a/js/actionTypes.js b/js/actionTypes.js index e8436fd7..450ab20f 100644 --- a/js/actionTypes.js +++ b/js/actionTypes.js @@ -32,6 +32,7 @@ export const SET_EQ_OFF = "SET_EQ_OFF"; export const TOGGLE_LLAMA_MODE = "TOGGLE_LLAMA_MODE"; export const TOGGLE_REPEAT = "TOGGLE_REPEAT"; export const TOGGLE_SHADE_MODE = "TOGGLE_SHADE_MODE"; +export const TOGGLE_EQUALIZER_SHADE_MODE = "TOGGLE_EQUALIZER_SHADE_MODE"; export const TOGGLE_SHUFFLE = "TOGGLE_SHUFFLE"; export const TOGGLE_TIME_MODE = "TOGGLE_TIME_MODE"; export const TOGGLE_VISUALIZER_STYLE = "TOGGLE_VISUALIZER_STYLE"; diff --git a/js/reducers.js b/js/reducers.js index 9c1bcce2..8bc80e06 100644 --- a/js/reducers.js +++ b/js/reducers.js @@ -26,6 +26,7 @@ import { TOGGLE_LLAMA_MODE, TOGGLE_REPEAT, TOGGLE_SHADE_MODE, + TOGGLE_EQUALIZER_SHADE_MODE, TOGGLE_SHUFFLE, TOGGLE_TIME_MODE, TOGGLE_VISUALIZER_STYLE, @@ -81,6 +82,7 @@ const display = (state, action) => { llama: false, closed: false, shade: false, + equalizerShade: false, working: false, skinImages: {}, skinColors: null, @@ -93,6 +95,8 @@ const display = (state, action) => { return { ...state, doubled: !state.doubled }; case TOGGLE_SHADE_MODE: return { ...state, shade: !state.shade }; + case TOGGLE_EQUALIZER_SHADE_MODE: + return { ...state, equalizerShade: !state.shade }; case TOGGLE_LLAMA_MODE: return { ...state, llama: !state.llama }; case STEP_MARQUEE: