Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxAudioImpl.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXAUDIOIMPL_H_
13 #define CXAUDIOIMPL_H_
14 
15 #include "cxGuiExport.h"
16 
17 #include "cxAudio.h"
18 #include <QObject>
19 #include <QString>
20 #include <QDateTime>
21 #include <QMutex>
22 
23 namespace cx {
24 
32 class cxGui_EXPORT AudioInternal : public QObject
33 {
34  Q_OBJECT
35 public:
36  AudioInternal(QObject* parent=NULL);
37  void playSound(QString file);
38 signals:
39  void playSoundInternalSignal(QString file);
40 private slots:
41  void playSoundSlot(QString file);
42 private:
43  QMutex mLastPlayTimeMutex;
44  int mMinTimeBetweenEachSound;
45  QDateTime mLastPlayTime;
46  bool checkValidTime();
47 };
48 
49 
58 class cxGui_EXPORT AudioImpl : public Audio
59 {
60 public:
61  AudioImpl();
62  virtual ~AudioImpl();
63 
64  virtual void playStartSound();
65  virtual void playStopSound();
66  virtual void playCancelSound();
67 
68  virtual void playSuccessSound();
69  virtual void playWarningSound();
70  virtual void playErrorSound();
71 
72  virtual void playScreenShotSound();
73  virtual void playSampleSound();
74 
75 private:
76  boost::shared_ptr<AudioInternal> mInternal;
77 };
78 
79 }//namespace cx
80 
81 #endif /* CXAUDIOIMPL_H_ */
Interface for playing sounds.
Definition: cxAudio.h:29
Namespace for all CustusX production code.