mirror of
https://github.com/captbaritone/webamp.git
synced 2026-08-01 22:45:18 +00:00
Fix eqf value normalization
This commit is contained in:
parent
ea7bd51aed
commit
1e1b5eb628
2 changed files with 9 additions and 2 deletions
|
|
@ -95,7 +95,8 @@ export function toggleShuffle() {
|
|||
return { type: TOGGLE_SHUFFLE };
|
||||
}
|
||||
|
||||
const normalize = hrz => hrz / 63 * 100;
|
||||
export const normalize = hrz => Math.round((hrz - 1) / 63 * 100);
|
||||
|
||||
function setEqFromFile(file) {
|
||||
return dispatch => {
|
||||
file.processBuffer(arrayBuffer => {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ import {
|
|||
setEqBand,
|
||||
setEqToMax,
|
||||
setEqToMin,
|
||||
setEqToMid
|
||||
setEqToMid,
|
||||
normalize
|
||||
} from "./actionCreators";
|
||||
|
||||
test("stop", () => {
|
||||
|
|
@ -123,3 +124,8 @@ test("setEqToMid", () => {
|
|||
]);
|
||||
expect(mockDispatch.mock.calls).toEqual(expectedCalls);
|
||||
});
|
||||
|
||||
test("normalize", () => {
|
||||
expect(normalize(1)).toBe(0);
|
||||
expect(normalize(64)).toBe(100);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue