Not Logged In
|
Login
|
Register
Home
|
News
|
Projects
|
Releases
Bugs
|
RFE
|
Repositories
|
Help
projects
/
xestiaab
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
XABAccountView: Removed virtual declaration from certain functions
[xestiaab/.git]
/
source
/
contacteditor
/
frmContactEditor-Sound.cpp
diff --git
a/source/contacteditor/frmContactEditor-Sound.cpp
b/source/contacteditor/frmContactEditor-Sound.cpp
index
ba1a0c9
..
7d9fcde
100644
(file)
--- a/
source/contacteditor/frmContactEditor-Sound.cpp
+++ b/
source/contacteditor/frmContactEditor-Sound.cpp
@@
-17,10
+17,6
@@
// with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
#include "frmContactEditor.h"
// with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
#include "frmContactEditor.h"
-#include "frmContactEditorSound.h"
-#include "../common/base64.h"
-#include <SFML/Audio.hpp>
-#include <thread>
void frmContactEditor::AddSound( wxCommandEvent& event )
{
void frmContactEditor::AddSound( wxCommandEvent& event )
{
@@
-107,7
+103,7
@@
void frmContactEditor::PlaySoundDetach()
// Play the sound and detach.
// Play the sound and detach.
- if (!AudioStreamPlayback
.
openFromMemory(base64dec.c_str(), base64declen)){
+ if (!AudioStreamPlayback
Pointer->
openFromMemory(base64dec.c_str(), base64declen)){
// Can't load file. We must flee...
// Also show an error message too.
// Can't load file. We must flee...
// Also show an error message too.
@@
-120,17
+116,18
@@
void frmContactEditor::PlaySoundDetach()
btnStop->Enable();
btnStop->Enable();
- AudioStreamPlayback
.
play();
+ AudioStreamPlayback
Pointer->
play();
- while (AudioStreamPlayback
.
getStatus() == sf::SoundSource::Playing){
+ while (AudioStreamPlayback
Pointer->
getStatus() == sf::SoundSource::Playing){
// We poll this every 100ms in order to conserve CPU usage.
// We poll this every 100ms in order to conserve CPU usage.
- SleepFor(10000000
0
);
+ SleepFor(10000000);
}
}
-
+
btnStop->Disable();
btnStop->Disable();
+ btnPlay->Enable();
}
}
@@
-142,11
+139,17
@@
void frmContactEditor::PlaySound( wxCommandEvent& event )
long longSelected = -1;
int intSelectedData = 0;
long longSelected = -1;
int intSelectedData = 0;
+ if (AudioStreamPlaybackPointer == nullptr){
+
+ AudioStreamPlaybackPointer = new AudioStream;
+
+ }
+
// Check if sound is still being played and if it is, stop it.
// Check if sound is still being played and if it is, stop it.
- if (AudioStreamPlayback
.
getStatus() == sf::SoundSource::Playing){
+ if (AudioStreamPlayback
Pointer->
getStatus() == sf::SoundSource::Playing){
- AudioStreamPlayback
.
stop();
+ AudioStreamPlayback
Pointer->
stop();
}
}
@@
-155,7
+158,9
@@
void frmContactEditor::PlaySound( wxCommandEvent& event )
&intSelectedData)){
return;
}
&intSelectedData)){
return;
}
-
+
+ btnPlay->Disable();
+
std::map<int, std::string>::iterator initier;
initier = ContactEditorData.SoundsList.find(intSelectedData);
std::map<int, std::string>::iterator initier;
initier = ContactEditorData.SoundsList.find(intSelectedData);
@@
-174,14
+179,15
@@
void frmContactEditor::StopSound( wxCommandEvent& event )
{
// Stop the sound.
{
// Stop the sound.
-
- if (AudioStreamPlayback.getStatus() == sf::SoundSource::Playing){
-
- AudioStreamPlayback.stop();
+
+ if (AudioStreamPlaybackPointer != nullptr && AudioStreamPlaybackPointer->getStatus() == sf::SoundSource::Playing){
+ AudioStreamPlaybackPointer->stop();
+
}
btnStop->Disable();
}
btnStop->Disable();
+ btnPlay->Enable();
return;
return;
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software
Xestia Address Book
Xestia Calendar
Development
Xestia Gelforn
Everything else
About
News
Privacy Policy