Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat equalizer #296

Merged
merged 16 commits into from
Mar 31, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(sound): replace Sound components by react-sound-html5 module
  • Loading branch information
Charles Jacquin committed Mar 31, 2019
commit 723c572507dbc480400c8856c4e417df59c54dcb
3 changes: 2 additions & 1 deletion app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { bindActionCreators } from 'redux';
import { NavLink, withRouter } from 'react-router-dom';
import classnames from 'classnames';
import _ from 'lodash';
import Sound from 'react-sound-html5';

import * as Actions from './actions';
import * as PlayerActions from './actions/player';
import * as PlaylistsActions from './actions/playlists';
Expand All @@ -25,7 +27,6 @@ import { config as PluginConfig } from './plugins/config';
import settingsConst from './constants/settings';

import PlaylistsSubMenu from './components/PlaylistsSubMenu';
import Sound from './components/Sound';
import Footer from './components/Footer';
import Navbar from './components/Navbar';
import VerticalPanel from './components/VerticalPanel';
Expand Down
2 changes: 1 addition & 1 deletion app/actions/player.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Sound from '../components/Sound';
import Sound from 'react-sound-html5';
import { sendPaused, sendPlay } from '../mpris';

export const START_PLAYBACK = 'START_PLAYBACK';
Expand Down
170 changes: 0 additions & 170 deletions app/components/Sound/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions app/components/Sound/styles.scss

This file was deleted.

2 changes: 1 addition & 1 deletion app/containers/ShortcutsContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as Mousetrap from 'mousetrap';
import Sound from 'react-sound-html5';

import Sound from '../../components/Sound';
import * as PlayerActions from '../../actions/player';
import * as QueueActions from '../../actions/queue';

Expand Down
8 changes: 6 additions & 2 deletions app/containers/SoundContainer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { withRouter } from 'react-router-dom';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import _ from 'lodash';
import Sound from 'react-sound-html5';

import * as Actions from '../../actions';
import * as PlayerActions from '../../actions/player';
import * as QueueActions from '../../actions/queue';
import * as ScrobblingActions from '../../actions/scrobbling';
import * as LyricsActions from '../../actions/lyrics';
import Sound from '../../components/Sound';
import { filterFrequencies } from '../../components/Equalizer';
import { getSelectedStream } from '../../utils';
import * as Autoradio from './autoradio';
import globals from '../../globals';
Expand Down Expand Up @@ -168,7 +169,10 @@ class SoundContainer extends React.Component {
onLoad={this.handleLoaded.bind(this)}
position={player.seek}
volume={player.muted ? 0 : player.volume}
equalizer={equalizer}
equalizer={filterFrequencies.reduce((acc, freq, idx) => ({
...acc,
[freq]: equalizer[idx] || 0
}), {})}
/>
);
}
Expand Down
2 changes: 1 addition & 1 deletion app/reducers/player.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Sound from '../components/Sound';
import Sound from 'react-sound-html5';

import {
START_PLAYBACK,
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
"billboard-top-100": "^2.0.8",
"bluebird": "^3.5.3",
"body-parser": "^1.18.3",
"cors": "^2.8.5",
"chart.js": "^2.8.0",
"cheerio": "^1.0.0-rc.2",
"cors": "^2.8.5",
"d3-drag": "^1.2.3",
"d3-selection": "^1.4.0",
"electron-platform": "^1.2.0",
Expand All @@ -72,6 +72,7 @@
"react-dom": "^16.3.2",
"react-image-smooth-loading": "^2.0.0",
"react-range-progress": "^4.0.3",
"react-sound-html5": "^1.0.1",
"react-toastify": "^4.5.2",
"semantic-ui-react": "^0.82.1",
"simple-get-lyrics": "0.0.4",
Expand Down