aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2019-09-15 17:44:47 +0300
committerCrystalwarrior <varsash@gmail.com>2019-09-15 17:44:47 +0300
commite94640b3493700a266619388d75dac5e56b3189a (patch)
treeb24b8f976d40b64a8e0da04ebd5c3bc78017bdc4 /include
parenta2f9df4042585ab0849b54e2bb0b9699f9064aed (diff)
Looping SFX system - Defined this way:
[SoundL] sfx-roar = 1
Diffstat (limited to 'include')
-rw-r--r--include/aoapplication.h3
-rw-r--r--include/aosfxplayer.h13
2 files changed, 12 insertions, 4 deletions
diff --git a/include/aoapplication.h b/include/aoapplication.h
index 8164e166..88855968 100644
--- a/include/aoapplication.h
+++ b/include/aoapplication.h
@@ -151,6 +151,9 @@ public:
//Returns true if blank blips is enabled in config.ini and false otherwise
bool get_blank_blip();
+ //Returns true if looping sound effects are enabled in the config.ini
+ bool get_looping_sfx();
+
//Returns true if stop music on objection is enabled in the config.ini
bool objection_stop_music();
diff --git a/include/aosfxplayer.h b/include/aosfxplayer.h
index 19d4bdf3..112e3ec6 100644
--- a/include/aosfxplayer.h
+++ b/include/aosfxplayer.h
@@ -18,19 +18,24 @@ class AOSfxPlayer
public:
AOSfxPlayer(QWidget *parent, AOApplication *p_ao_app);
- void play(QString p_sfx, QString p_char = "", QString shout = "");
- void stop();
+ void clear();
+ void loop_clear();
+ void play(QString p_sfx, QString p_char = "", QString shout = "", int channel=-1);
+ void stop(int channel=-1);
void set_volume(qreal p_volume);
-
+ void set_looping(bool toggle, int channel=-1);
+ int m_channel = 0;
private:
QWidget *m_parent;
AOApplication *ao_app;
qreal m_volume = 0;
+ bool m_looping = true;
void set_volume_internal(qreal p_volume);
#if defined(BASSAUDIO)
- HSTREAM m_stream;
+ const int m_channelmax = 5;
+ HSTREAM m_stream_list[5];
#elif defined(QTAUDIO)
QSoundEffect m_sfx;
#endif