X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-Sound.cpp;h=ba1a0c95b9f942aeb19e5c0e8c98a065bc4fbb0a;hb=298d2bd787b9b695d017ba16c7357bb5c05b43f7;hp=6138d97eaca9bef72628cb48b8a943411be501af;hpb=e30eba8679da6f7db7132efe79af6cb49c52750e;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-Sound.cpp b/source/contacteditor/frmContactEditor-Sound.cpp index 6138d97..ba1a0c9 100644 --- a/source/contacteditor/frmContactEditor-Sound.cpp +++ b/source/contacteditor/frmContactEditor-Sound.cpp @@ -25,11 +25,10 @@ void frmContactEditor::AddSound( wxCommandEvent& event ) { - int intResult = 0; - + // Bring up a form to add sound. + frmContactEditorSound *frameCESound = new frmContactEditorSound ( this ); frameCESound->SetEditorMode(FALSE); - intResult = GetLastInt(&ContactEditorData.SoundsList); frameCESound->SetupPointers(&ContactEditorData.SoundsList, &ContactEditorData.SoundsListAltID, &ContactEditorData.SoundsListPID, @@ -50,6 +49,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 +82,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 +105,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 +119,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 +137,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 +172,8 @@ void frmContactEditor::PlaySound( wxCommandEvent& event ) void frmContactEditor::StopSound( wxCommandEvent& event ) { + + // Stop the sound. if (AudioStreamPlayback.getStatus() == sf::SoundSource::Playing){ @@ -206,6 +190,8 @@ void frmContactEditor::StopSound( wxCommandEvent& event ) void frmContactEditor::SaveSound( wxCommandEvent &event ) { + // Save the sound. + long longSelected = -1; int intSelectedData = 0;