-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ac16dd
commit cd4faaf
Showing
7 changed files
with
185 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,47 @@ | ||
import { Slider } from 'antd'; | ||
import { FileName, Wrapper } from './styles'; | ||
import { Button } from 'antd'; | ||
import { faS, faVolumeMute } from '@fortawesome/free-solid-svg-icons'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { FileName, VolumeControl, VolumeSlider, Wrapper } from './styles'; | ||
|
||
export interface AudioVolumeProps { | ||
name: string; | ||
volume: number; | ||
isMuted: boolean; | ||
isSoloed: boolean; | ||
onChange: (value: number) => void; | ||
onSoloClick: () => void; | ||
onMuteClick: () => void; | ||
} | ||
|
||
export function AudioVolume({ name, volume, onChange }: AudioVolumeProps) { | ||
export function AudioVolume({ | ||
name, | ||
volume, | ||
onChange, | ||
isMuted, | ||
isSoloed, | ||
onSoloClick, | ||
onMuteClick, | ||
}: AudioVolumeProps) { | ||
return ( | ||
<Wrapper> | ||
<FileName>{name}</FileName> | ||
<Slider defaultValue={volume * 100} onChange={onChange} /> | ||
<VolumeControl> | ||
<VolumeSlider value={volume} onChange={onChange} /> | ||
<Button | ||
shape="circle" | ||
type={isMuted ? 'primary' : 'default'} | ||
size="small" | ||
icon={<FontAwesomeIcon icon={faVolumeMute} />} | ||
onClick={onMuteClick} | ||
/> | ||
<Button | ||
shape="circle" | ||
type={isSoloed ? 'primary' : 'default'} | ||
size="small" | ||
icon={<FontAwesomeIcon icon={faS} />} | ||
onClick={onSoloClick} | ||
/> | ||
</VolumeControl> | ||
</Wrapper> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export interface VolumeControl { | ||
trackName: string; | ||
volume: number; | ||
previousVolume?: number; | ||
isMuted: boolean; | ||
isSoloed: boolean; | ||
} |