objects/core/mouse_12.gml
From spelunky.gmk, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC, shown whole under the Spelunky User License v1.1b. Extracted by spelunky.ai's tools, an unofficial fan project, one file per script or event; the // ==== lines are the extractor's, naming each action of the event. Some scripts are others' work that Derek Yu credits in the source's readme.txt: Martin Piecyk's platform engine, ChevyRay's view scaling scripts and tsg1zzn's Super Sound System.
core's mouse 12 event, 105 lines of GML.
if mouse_button != mb_right then exit;switch show_menu("Set Frequency|-Get Frequency|Set Panning|-Get Panning|Set Volume|-Get Volume|-|Please SHOW INFO!!|-|Play Sound|Loop Sound|Resume Sound|Stop Sound|Pause Sound|Get Sound Playing State|Set Sound Position" ,-1) begin case 0: SS_SetSoundFreq(handle, get_integer("Frequency from 1000 to 100 000", SS_GetSoundFreq(handle))); break; case 1: show_message("Frequency: " + string(SS_GetSoundFreq(handle))); break; case 2: SS_SetSoundPan(handle,get_integer("Sound panning from -10 000 to 10 000", SS_GetSoundPan(handle))); break; case 3: show_message("Panning: " + string(SS_GetSoundPan(handle))); break; case 4: SS_SetSoundVol(handle, get_integer("Sound volume from 0 to 10 000", SS_GetSoundVol(handle))); break; case 5: show_message("Volume: "+string(SS_GetSoundVol(handle))); break; case 6: show_info(); break; case 7: if SS_IsSoundPlaying(handle) != true then SS_PlaySound(handle) else show_message("Why start it if it's already playing?"); break; case 8: if SS_IsSoundPlaying(handle) != true then SS_LoopSound(handle) else show_message("Why start it if it's already playing?"); break; case 9: if SS_IsSoundPaused(handle) then SS_ResumeSound(handle) else show_message("Sound isn't paused!"); break; case 10: SS_StopSound(handle) break; case 11: if SS_IsSoundPlaying(handle) then SS_PauseSound(handle) else show_message("Can't pause a sound that isn't playing") break; case 12: if SS_IsSoundPlaying(handle) then if SS_IsSoundLooping(handle) then show_message("Sound is LOOPING") else show_message("Sound is PLAYING") else if SS_IsSoundPaused(handle) then show_message("Sound is PAUSED") else show_message("Sound is STOPPED") break; case 13: if SS_IsSoundPaused(handle) then show_message("Can't set the position of a paused sound!") else SS_SetSoundPosition(handle, get_integer("Set sound position:", SS_GetSoundPosition(handle))); break;end;