Source Code Project Mantis - FSSCP
View Issue Details
0003150FSSCPSEXPspublic2015-03-17 22:422015-04-10 20:18
ReporterAxem 
Assigned Toniffiwan 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version3.7.2 RC5 
Target VersionFixed in Version 
Summary0003150: Adjusting music volume doesn't work with sexps
DescriptionIn the sexp_adjust_audio_volume() function (line 10487ish) there's a lookup function to see what selected option corresponds with its integer index. Music is 0, Effects is 1, Voice is 2. The issue occurs after the look up when we get...

if (option > 0)

Which won't include music (0). *Sadfaec*

Can we get an extra equals sign up in there?
TagsNo tags attached.
Attached Filespatch mantis3150-svn.patch (1,234) 2015-03-18 06:18
http://scp.indiegames.us/mantis/file_download.php?file_id=2676&type=bug

Notes
(0016566)
MageKing17   
2015-03-17 23:42   
Seems straightforward enough.
(0016567)
niffiwan   
2015-03-18 00:09   
Seems fine to me, I just haven't tested running the sexp
(0016569)
MageKing17   
2015-03-18 02:12   
Actually, I'm unassigning this from me because it's really Axem's fix; I just turned it into a .patch file.
(0016570)
niffiwan   
2015-03-18 05:13   
(Last edited: 2015-03-18 06:20)
I've tested the change and I think there's another issue here. I set the music volume to 0% at 5 secs, then back to 100% at 20 secs with "$Event Music: 5: Deuteronomy". The music doesn't change volume at 5 secs, and it fades away completely just before 20 secs and doesn't return (ever!) unless I modify the volume in the F2 Options screen, or press escape, or take some other action.

Anyway, I'm poking around further to see if I can figure out what's going on.

Update: music from play-sound-from-file also doesn't change volume. I suspect that there's nothing (re)setting the music volume except when a track starts, e.g. when event music switches, or a loop restarts.

Update2: I think I've found the issue and have added code to trigger a volume change for all music when the music volume is changed. See attached patch mantis3150-svn.patch. I've tested this with event music and play-sound-from-file. Could you give it a test to see if it works as expected in your test case(s) as well?

(0016583)
niffiwan   
2015-03-28 00:16   
Here's a binary to test with: http://www.mediafire.com/download/icrdaaa73rrpi93/fs2_open_3_7_1_SSE2_mantis3150.7z
(0016612)
Axem   
2015-04-07 21:39   
The build didn't seem to have the patch applied since it didn't fix the problem.

But I took the patch and applied it to my own stuff here and the resulting build fixed all the issues.

Hooray!
(0016638)
niffiwan   
2015-04-10 20:17   
:headdesk:
I have really got to test those Windows builds before publishing them... regardless, thanks for testing!
(0016639)
niffiwan   
2015-04-10 20:18   
Fix committed to trunk@11299.

Issue History
2015-03-17 22:42AxemNew Issue
2015-03-17 23:42MageKing17Note Added: 0016566
2015-03-17 23:42MageKing17Assigned To => MageKing17
2015-03-17 23:42MageKing17Statusnew => code review
2015-03-17 23:45MageKing17File Added: sexp.cpp.patch
2015-03-18 00:09niffiwanNote Added: 0016567
2015-03-18 02:12MageKing17Note Added: 0016569
2015-03-18 02:12MageKing17Assigned ToMageKing17 =>
2015-03-18 05:13niffiwanNote Added: 0016570
2015-03-18 05:59niffiwanNote Edited: 0016570bug_revision_view_page.php?bugnote_id=16570#r1024
2015-03-18 06:18niffiwanFile Added: mantis3150-svn.patch
2015-03-18 06:20niffiwanNote Edited: 0016570bug_revision_view_page.php?bugnote_id=16570#r1025
2015-03-18 18:02MageKing17File Deleted: sexp.cpp.patch
2015-03-18 18:02MageKing17Assigned To => niffiwan
2015-03-18 18:02MageKing17Statuscode review => assigned
2015-03-18 18:03MageKing17Statusassigned => code review
2015-03-28 00:16niffiwanNote Added: 0016583
2015-04-07 21:39AxemNote Added: 0016612
2015-04-10 20:17niffiwanNote Added: 0016638
2015-04-10 20:18niffiwanChangeset attached => fs2open trunk r11299
2015-04-10 20:18niffiwanNote Added: 0016639
2015-04-10 20:18niffiwanStatuscode review => resolved
2015-04-10 20:18niffiwanResolutionopen => fixed