Qt 4.8
Classes | Typedefs | Functions | Variables
qsound_x11.cpp File Reference
#include "qsound.h"
#include "qhash.h"
#include "qsocketnotifier.h"
#include "qapplication.h"
#include "qsound_p.h"
#include <audio/audiolib.h>
#include <audio/soundlib.h>
#include "qsound_x11.moc"

Go to the source code of this file.

Classes

class  QAuBucketNAS
 
class  QAuServerNAS
 
class  QAuServerNull
 

Typedefs

typedef QHash< void *, QAuServerNAS * > AuServerHash
 

Functions

static void callback (AuServer *, AuEventHandlerRec *, AuEvent *e, AuPointer p)
 
static AuBool eventPred (AuServer *, AuEvent *e, AuPointer p)
 
QAuServerqt_new_audio_server ()
 

Variables

static AuServerHashinprogress =0
 
static AuServer * nas =0
 

Typedef Documentation

◆ AuServerHash

typedef QHash<void*,QAuServerNAS*> AuServerHash

Definition at line 144 of file qsound_x11.cpp.

Function Documentation

◆ callback()

static void callback ( AuServer *  ,
AuEventHandlerRec *  ,
AuEvent *  e,
AuPointer  p 
)
static

Definition at line 170 of file qsound_x11.cpp.

Referenced by QSegfaultHandler::crashHandler(), QDeclarativeTypeData::done(), QDeclarativeTypeData::downloadProgressChanged(), QXmlQueryPrivate::dynamicContext(), QAuServerNAS::play(), qmlsqldatabase_change_version(), qmlsqldatabase_transaction_shared(), qwsEventSourceDispatch(), QRasterPaintEnginePrivate::rasterize(), QMeeGoGraphicsSystem::registerSwitchCallback(), and x11EventSourceDispatch().

171 {
172  if (inprogress->contains(p) && e) {
173  if (e->type==AuEventTypeElementNotify &&
174  e->auelementnotify.kind==AuElementNotifyKindState) {
175  if (e->auelementnotify.cur_state == AuStateStop) {
177  if (it != inprogress->end())
178  (*it)->setDone((QSound*)p);
179  }
180  }
181  }
182 }
#define it(className, varName)
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
Definition: qhash.h:872
static AuServerHash * inprogress
Definition: qsound_x11.cpp:145
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
Definition: qhash.h:467
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
Definition: qhash.h:330
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
Definition: qhash.h:865
The QSound class provides access to the platform audio facilities.
Definition: qsound.h:57

◆ eventPred()

static AuBool eventPred ( AuServer *  ,
AuEvent *  e,
AuPointer  p 
)
static

Definition at line 62 of file qsound_x11.cpp.

Referenced by QAuBucketNAS::~QAuBucketNAS().

63 {
64  if (e && (e->type == AuEventTypeElementNotify)) {
65  if (e->auelementnotify.flow == *((AuFlowID *)p))
66  return true;
67  }
68  return false;
69 }

◆ qt_new_audio_server()

QAuServer* qt_new_audio_server ( )

Definition at line 282 of file qsound_x11.cpp.

Referenced by QAuServer::play(), and server().

283 {
284 #ifndef QT_NO_NAS
285  QAuServer* s = new QAuServerNAS(qApp);
286  if (s->okay())
287  return s;
288  else
289  delete s;
290 #endif
291  return new QAuServerNull(qApp);
292 }
#define qApp
virtual bool okay()=0

Variable Documentation

◆ inprogress

AuServerHash* inprogress =0
static

Definition at line 145 of file qsound_x11.cpp.

◆ nas

AuServer* nas =0
static