ReplayGain support + audio normalization (web player) (#1988)
* ReplayGain support - extract ReplayGain tags from files, expose via native api - use metadata to normalize audio in web player * make pre-push happy * remove unnecessary prints * remove another unnecessary print * add tooltips, see metadata * address comments, use settings instead * remove console.log * use better language for gain modes
This commit is contained in:
@@ -17,15 +17,21 @@ import inflection from 'inflection'
|
||||
import { BitrateField, SizeField } from './index'
|
||||
import { MultiLineTextField } from './MultiLineTextField'
|
||||
import { makeStyles } from '@material-ui/core/styles'
|
||||
import config from '../config'
|
||||
|
||||
const useStyles = makeStyles({
|
||||
gain: {
|
||||
'&:after': {
|
||||
content: (props) => (props.gain ? " ' db'" : ''),
|
||||
},
|
||||
},
|
||||
tableCell: {
|
||||
width: '17.5%',
|
||||
},
|
||||
})
|
||||
|
||||
export const SongInfo = (props) => {
|
||||
const classes = useStyles()
|
||||
const classes = useStyles({ gain: config.enableReplayGain })
|
||||
const translate = useTranslate()
|
||||
const record = useRecordContext(props)
|
||||
const data = {
|
||||
@@ -54,6 +60,15 @@ export const SongInfo = (props) => {
|
||||
data.playDate = <DateField record={record} source="playDate" showTime />
|
||||
}
|
||||
|
||||
if (config.enableReplayGain) {
|
||||
data.albumGain = (
|
||||
<NumberField source="rgAlbumGain" className={classes.gain} />
|
||||
)
|
||||
data.trackGain = (
|
||||
<NumberField source="rgTrackGain" className={classes.gain} />
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<TableContainer>
|
||||
<Table aria-label="song details" size="small">
|
||||
|
||||
Reference in New Issue
Block a user