X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-Sound.cpp;h=cda5036d834069b01ee753878bcfbe290e085a84;hb=7c7382aec816add24a96a03f4cd37c461f48e9b6;hp=6138d97eaca9bef72628cb48b8a943411be501af;hpb=e30eba8679da6f7db7132efe79af6cb49c52750e;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-Sound.cpp b/source/contacteditor/frmContactEditor-Sound.cpp index 6138d97..cda5036 100644 --- a/source/contacteditor/frmContactEditor-Sound.cpp +++ b/source/contacteditor/frmContactEditor-Sound.cpp @@ -25,6 +25,8 @@ void frmContactEditor::AddSound( wxCommandEvent& event ) { + // Bring up a form to add sound. + int intResult = 0; frmContactEditorSound *frameCESound = new frmContactEditorSound ( this ); @@ -50,6 +52,8 @@ void frmContactEditor::AddSound( wxCommandEvent& event ) void frmContactEditor::ModifySound( wxCommandEvent& event ) { + // Bring up a form to modify sound. + long longSelected = -1; int intSelectedData = 0; @@ -81,6 +85,8 @@ void frmContactEditor::ModifySound( wxCommandEvent& event ) void frmContactEditor::DeleteSound( wxCommandEvent& event ) { + // Bring up a form to delete sound. + long longSelected = -1; int intSelectedData = 0; @@ -102,6 +108,8 @@ void frmContactEditor::DeleteSound( wxCommandEvent& event ) void frmContactEditor::PlaySoundDetach() { + // Play the sound and detach. + if (!AudioStreamPlayback.openFromMemory(base64dec.c_str(), base64declen)){ // Can't load file. We must flee... @@ -114,16 +122,9 @@ void frmContactEditor::PlaySoundDetach() } btnStop->Enable(); - - //AudioStreamPlayback.setbuffer(AudioBuffer); + AudioStreamPlayback.play(); - /*timespec n1, n2; - - n1.tv_sec = 0; - n1.tv_nsec = 100000000L;*/ - - //while (TimeA != TimeB){ while (AudioStreamPlayback.getStatus() == sf::SoundSource::Playing){ // We poll this every 100ms in order to conserve CPU usage. @@ -139,23 +140,7 @@ void frmContactEditor::PlaySoundDetach() void frmContactEditor::PlaySound( wxCommandEvent& event ) { - //sf::Music *AudioPlayback = new sf::Music; - //AudioStream *AudioStreamPlayback = new AudioStream; - //sf::SoundBuffer *AudioBuffer = new sf::SoundBuffer; - - //sf::Sound *AudioPlayback = new sf::Sound; - - //delete(AudioPlayback); - - //delete(AudioPlayback); - //delete(AudioStreamPlayback); - //delete(AudioBuffer); - - //AudioPlayback = NULL; - //AudioStreamPlayback = NULL; - //AudioBuffer = NULL; - - //return; + // Play the sound. long longSelected = -1; int intSelectedData = 0; @@ -190,6 +175,8 @@ void frmContactEditor::PlaySound( wxCommandEvent& event ) void frmContactEditor::StopSound( wxCommandEvent& event ) { + + // Stop the sound. if (AudioStreamPlayback.getStatus() == sf::SoundSource::Playing){ @@ -206,6 +193,8 @@ void frmContactEditor::StopSound( wxCommandEvent& event ) void frmContactEditor::SaveSound( wxCommandEvent &event ) { + // Save the sound. + long longSelected = -1; int intSelectedData = 0;