Stan` Posted August 9, 2014 Report Share Posted August 9, 2014 (edited) HiI found that function : void StopMusic(ScriptInterface::CxPrivate* UNUSED(pCxPrivate)) in the JSInterfaceSound.cpp and I was wondering how to use it to stop music playback in atlas.From my little understanding I have to use it there (LINE 474) :void MapSidebar::OnSimPlay(wxCommandEvent& event){ float speed = 1.f; int newState = SimPlaying; if (event.GetId() == ID_SimFast) { speed = 8.f; newState = SimPlayingFast; } else if (event.GetId() == ID_SimSlow) { speed = 0.125f; newState = SimPlayingSlow; } if (m_SimState == SimInactive) { // Force update of player settings POST_MESSAGE(LoadPlayerSettings, (false)); POST_MESSAGE(SimStateSave, (L"default")); POST_MESSAGE(GuiSwitchPage, (L"page_session.xml")); POST_MESSAGE(SimPlay, (speed, true)); m_SimState = newState; } else // paused or already playing at a different speed { POST_MESSAGE(SimPlay, (speed, true)); m_SimState = newState; } UpdateSimButtons();}void MapSidebar::OnSimPause(wxCommandEvent& WXUNUSED(event)){ if (IsPlaying(m_SimState)) { POST_MESSAGE(SimPlay, (0.f, true)); m_SimState = SimPaused; StopMusic() } UpdateSimButtons();}void MapSidebar::OnSimReset(wxCommandEvent& WXUNUSED(event)){ if (IsPlaying(m_SimState)) { POST_MESSAGE(SimPlay, (0.f, true)); POST_MESSAGE(SimStateRestore, (L"default")); POST_MESSAGE(SimPlay, (0.f, false)); POST_MESSAGE(GuiSwitchPage, (L"page_atlas.xml")); m_SimState = SimInactive; } else if (m_SimState == SimPaused) { POST_MESSAGE(SimPlay, (0.f, true)); POST_MESSAGE(SimStateRestore, (L"default")); POST_MESSAGE(SimPlay, (0.f, false)); POST_MESSAGE(GuiSwitchPage, (L"page_atlas.xml")); m_SimState = SimInactive; } UpdateSimButtons();}But I was wondering if it would stop all sounds, and if it's the correct function to use. Edited August 9, 2014 by stanislas69 Quote Link to comment Share on other sites More sharing options...
niektb Posted August 9, 2014 Report Share Posted August 9, 2014 Is this literally copy-pasted? (I think I miss a semicolon ; at line 474) Quote Link to comment Share on other sites More sharing options...
Stan` Posted August 9, 2014 Author Report Share Posted August 9, 2014 It's because I did a undo. line 474 is the line I added. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted August 10, 2014 Report Share Posted August 10, 2014 It's easier to look at a diff/patch. If you're using SVN, you should be able to generate a patch of the file(s) you change. I don't know your OS, but on Windows w/ TortoiseSVN, just right-click the folder or file and choose TortoiseSVN > Create patch - you can then copy/paste the diff. On *nix, you would want something like "svn diff" to accomplish the same. Quote Link to comment Share on other sites More sharing options...
Stan` Posted August 10, 2014 Author Report Share Posted August 10, 2014 Sure I talked with leper about this one there is already a diff provided on trac by trompetin http://trac.wildfiregames.com/attachment/ticket/1712/sound_1712.patch Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.