#4039 closed enhancement (fixed)
[PATCH] Volume control slider
Reported by: | Damien PIQUET | Owned by: | Damien PIQUET |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 22 |
Component: | Core engine | Keywords: | patch |
Cc: | Patch: |
Description
Use a slider to control the sound volume.
Attachments (6)
Change History (25)
by , 8 years ago
Attachment: | 4039.patch added |
---|
comment:1 by , 8 years ago
Keywords: | review patch added |
---|---|
Owner: | set to |
by , 8 years ago
Attachment: | 4039-2.patch added |
---|
comment:2 by , 8 years ago
nice work! Here are a few quick comments (without proper review of the code):
- you must add a way to display the selected value of the slider (maybe in a tooltip ?), and the min and max could be displayed too.
- it seems that your slider implementation is a ratio between 0 and 1? but that's not always wanted: the default gains were all between 0 and 1, but I'm not sure that these were supposed to be relative gain vs the maximum gain (in particular the master gain, but someone knowing the sound system should comment), and there are other places where we could use a slider not necessarily between 0 and 1. Ideally, we should have min/max values of the slider in options.json, and these values would be used to define the min/max of the slider or to make a conversion between the value between 0 and 1 returned by the slider, and the output of the slider which should be between min and max.
- futhermore, as the slider should never return a value outside its min/max range, lines 166-169 seem useless.
comment:3 by , 8 years ago
Keywords: | review removed |
---|
#2593 points out other desired features, but I wouldn't mind if we get basic slider support now and add more in that ticket if you can't implement all things easily.
Before comitting you should IMO at least address these points:
- Agreeing with mimo that one should be able to pass
min
andmax
to the slider, so that it's versatile and easily usable. If that computation isn't done in C++ it would have to be done in JS which would likely end in code duplication. - Reuse the
caption
field for the value like other GUI object types do. - Those lines mimo mentioned indeed some redundant.
- Displaying the min/max/current value is likely irrelevant for this ticket, if it's going to be a 0-100% thing anyway. It would become more important when one can select values from a given range.
Coding style:
- L99 first check
MouseOver
then!MouseOver
in the else part, also that one pair of braces is not needed Draw a sprite at the % position
comment not really needed as it states the same as the code// Cursor should 5% of it's parent with a max ?
didn't understand that one
comment:4 by , 8 years ago
Summary: | Volume control slider → [PATCH] Volume control slider |
---|
by , 8 years ago
Attachment: | slider.png added |
---|
comment:9 by , 8 years ago
Keywords: | rfc added |
---|
comment:10 by , 8 years ago
Current slider works with max/min values, uses the checkbox button image.
by , 8 years ago
Attachment: | slider2.png added |
---|
comment:12 by , 8 years ago
Looks good. I don't think the "another style" works for our interface, but the first is OK. However the knobs don't go all the way to the left and I get an error when I open the options screen (something about width).
by , 8 years ago
Attachment: | 4039_slider.2.patch added |
---|
Added missed width, used the first design, buttons move to ends of both sides
comment:13 by , 8 years ago
Currently the upper bound of sound gain is 10.0: http://trac.wildfiregames.com/wiki/Manual_Settings. But 1.0 is normal sound gain (not increased, not decreased), so probably, make the upper bound in [1.0, 2.0], because user with normal settings will have a problem to make gain in [0.5, 1.0], also the default gain value is 0.5.
follow-up: 15 comment:14 by , 8 years ago
While you're at it, IMO, the "Gain" part of the sound settings names should be renamed "volume".
comment:15 by , 8 years ago
Replying to echotangoecho:
While you're at it, IMO, the "Gain" part of the sound settings names should be renamed "volume".
I agree, but in a separated commit.
comment:17 by , 7 years ago
Component: | UI & Simulation → Core engine |
---|---|
Keywords: | rfc removed |
Milestone: | Backlog → Alpha 22 |
Priority: | Nice to Have → Should Have |
Thanks for the patch guys!
Resize & revert changes fixes; corrected class description (reported by Imarok and s0600204)