summaryrefslogtreecommitdiffstats
path: root/src/modules/snd
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/snd')
-rw-r--r--src/modules/snd/libkvisnd.cpp77
-rw-r--r--src/modules/snd/libkvisnd.h47
2 files changed, 58 insertions, 66 deletions
diff --git a/src/modules/snd/libkvisnd.cpp b/src/modules/snd/libkvisnd.cpp
index bf0d2ea..70ade83 100644
--- a/src/modules/snd/libkvisnd.cpp
+++ b/src/modules/snd/libkvisnd.cpp
@@ -34,13 +34,13 @@
#include "kvi_locale.h"
#include "kvi_qstring.h"
-#include <qsound.h>
+#include <tqsound.h>
#ifdef COMPILE_ON_WINDOWS
#include <mmsystem.h>
#else //!COMPILE_ON_WINDOWS
- #include <qfile.h>
+ #include <tqfile.h>
#include <unistd.h>
#include <errno.h>
@@ -78,12 +78,12 @@
static KviSoundPlayer * g_pSoundPlayer = 0;
KviSoundPlayer::KviSoundPlayer()
-: QObject()
+: TQObject()
{
m_pThreadList = new KviPointerList<KviSoundThread>;
m_pThreadList->setAutoDelete(true);
- m_pSoundSystemDict = new KviPointerHashTable<QString,SoundSystemRoutine>(17,false);
+ m_pSoundSystemDict = new KviPointerHashTable<TQString,SoundSystemRoutine>(17,false);
m_pSoundSystemDict->setAutoDelete(true);
#ifdef COMPILE_ON_WINDOWS
@@ -103,13 +103,8 @@ KviSoundPlayer::KviSoundPlayer()
#endif //COMPILE_ARTS_SUPPORT
#endif //!COMPILE_ON_WINDOWS
-#if QT_VERSION >= 0x030100
- if(QSound::isAvailable())
- m_pSoundSystemDict->insert("qt",new SoundSystemRoutine(KVI_PTR2MEMBER(KviSoundPlayer::playQt)));
-#else
- if(QSound::available())
- m_pSoundSystemDict->insert("qt",new SoundSystemRoutine(KVI_PTR2MEMBER(KviSoundPlayer::playQt)));
-#endif
+ if(TQSound::isAvailable())
+ m_pSoundSystemDict->insert("qt",new SoundSystemRoutine(KVI_PTR2MEMBER(KviSoundPlayer::playTQt)));
m_pSoundSystemDict->insert("null",new SoundSystemRoutine(KVI_PTR2MEMBER(KviSoundPlayer::playNull)));
@@ -132,9 +127,9 @@ KviSoundPlayer::~KviSoundPlayer()
g_pSoundPlayer = 0;
}
-void KviSoundPlayer::getAvailableSoundSystems(QStringList *l)
+void KviSoundPlayer::getAvailableSoundSystems(TQStringList *l)
{
- KviPointerHashTableIterator<QString,SoundSystemRoutine> it(*m_pSoundSystemDict);
+ KviPointerHashTableIterator<TQString,SoundSystemRoutine> it(*m_pSoundSystemDict);
while(it.current())
{
l->append(it.currentKey());
@@ -158,7 +153,7 @@ void KviSoundPlayer::unregisterSoundThread(KviSoundThread * t)
m_pThreadList->removeRef(t);
}
-bool KviSoundPlayer::event(QEvent * e)
+bool KviSoundPlayer::event(TQEvent * e)
{
if(e->type() == KVI_THREAD_EVENT)
{
@@ -167,7 +162,7 @@ bool KviSoundPlayer::event(QEvent * e)
delete (KviSoundThread *)t;
return true;
}
- return QObject::event(e);
+ return TQObject::event(e);
}
@@ -206,11 +201,7 @@ void KviSoundPlayer::detectSoundSystem()
KVI_OPTION_STRING(KviOption_stringSoundSystem) = "oss";
#endif
-#if QT_VERSION >= 0x030100
- if(QSound::isAvailable())
-#else
- if(QSound::available())
-#endif
+ if(TQSound::isAvailable())
{
KVI_OPTION_STRING(KviOption_stringSoundSystem) = "qt";
return;
@@ -221,7 +212,7 @@ void KviSoundPlayer::detectSoundSystem()
}
#ifdef COMPILE_ON_WINDOWS
- bool KviSoundPlayer::playWinmm(const QString &szFileName)
+ bool KviSoundPlayer::playWinmm(const TQString &szFileName)
{
if(isMuted()) return true;
sndPlaySound(szFileName.local8Bit().data(),SND_ASYNC | SND_NODEFAULT);
@@ -230,7 +221,7 @@ void KviSoundPlayer::detectSoundSystem()
#else //!COMPILE_ON_WINDOWS
#ifdef COMPILE_OSS_SUPPORT
#ifdef COMPILE_AUDIOFILE_SUPPORT
- bool KviSoundPlayer::playOssAudiofile(const QString &szFileName)
+ bool KviSoundPlayer::playOssAudiofile(const TQString &szFileName)
{
if(isMuted()) return true;
KviOssAudiofileSoundThread * t = new KviOssAudiofileSoundThread(szFileName);
@@ -242,7 +233,7 @@ void KviSoundPlayer::detectSoundSystem()
return true;
}
#endif //COMPILE_AUDIOFILE_SUPPORT
- bool KviSoundPlayer::playOss(const QString &szFileName)
+ bool KviSoundPlayer::playOss(const TQString &szFileName)
{
if(isMuted()) return true;
KviOssSoundThread * t = new KviOssSoundThread(szFileName);
@@ -255,7 +246,7 @@ void KviSoundPlayer::detectSoundSystem()
}
#endif //COMPILE_OSS_SUPPORT
#ifdef COMPILE_ESD_SUPPORT
- bool KviSoundPlayer::playEsd(const QString &szFileName)
+ bool KviSoundPlayer::playEsd(const TQString &szFileName)
{
if(isMuted()) return true;
KviEsdSoundThread * t = new KviEsdSoundThread(szFileName);
@@ -268,7 +259,7 @@ void KviSoundPlayer::detectSoundSystem()
}
#endif //COMPILE_ESD_SUPPORT
#ifdef COMPILE_ARTS_SUPPORT
- bool KviSoundPlayer::playArts(const QString &szFileName)
+ bool KviSoundPlayer::playArts(const TQString &szFileName)
{
if(isMuted()) return true;
KviArtsSoundThread * t = new KviArtsSoundThread(szFileName);
@@ -282,31 +273,31 @@ void KviSoundPlayer::detectSoundSystem()
#endif //COMPILE_ARTS_SUPPORT
#endif //!COMPILE_ON_WINDOWS
-bool KviSoundPlayer::playQt(const QString &szFileName)
+bool KviSoundPlayer::playTQt(const TQString &szFileName)
{
if(isMuted()) return true;
- QSound::play(szFileName);
+ TQSound::play(szFileName);
return true;
}
-bool KviSoundPlayer::playNull(const QString &szFileName)
+bool KviSoundPlayer::playNull(const TQString &szFileName)
{
// null sound system
return true;
}
-bool KviSoundPlayer::play(const QString &szFileName)
+bool KviSoundPlayer::play(const TQString &szFileName)
{
if(isMuted()) return true;
- SoundSystemRoutine * r = m_pSoundSystemDict->find(KVI_OPTION_STRING(KviOption_stringSoundSystem));
+ SoundSystemRoutine * r = m_pSoundSystemDict->tqfind(KVI_OPTION_STRING(KviOption_stringSoundSystem));
if(!r)
{
- if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringSoundSystem),"unknown"))
+ if(KviTQString::equalCI(KVI_OPTION_STRING(KviOption_stringSoundSystem),"unknown"))
{
detectSoundSystem();
- r = m_pSoundSystemDict->find(KVI_OPTION_STRING(KviOption_stringSoundSystem));
+ r = m_pSoundSystemDict->tqfind(KVI_OPTION_STRING(KviOption_stringSoundSystem));
if(!r)return false;
} else {
return false;
@@ -319,7 +310,7 @@ bool KviSoundPlayer::play(const QString &szFileName)
-KviSoundThread::KviSoundThread(const QString &szFileName)
+KviSoundThread::KviSoundThread(const TQString &szFileName)
: KviThread()
{
g_pSoundPlayer->registerSoundThread(this);
@@ -347,7 +338,7 @@ void KviSoundThread::run()
#ifndef COMPILE_ON_WINDOWS
#ifdef COMPILE_OSS_SUPPORT
#ifdef COMPILE_AUDIOFILE_SUPPORT
- KviOssAudiofileSoundThread::KviOssAudiofileSoundThread(const QString &szFileName)
+ KviOssAudiofileSoundThread::KviOssAudiofileSoundThread(const TQString &szFileName)
: KviSoundThread(szFileName)
{
}
@@ -373,7 +364,7 @@ void KviSoundThread::run()
buffer = kvi_malloc(int(BUFFER_FRAMES * frameSize));
int audiofd_c = open("/dev/dsp", O_WRONLY | O_EXCL | O_NDELAY);
- QFile audiofd;
+ TQFile audiofd;
audiofd.open(IO_WriteOnly,audiofd_c);
if(audiofd_c < 0)
@@ -422,7 +413,7 @@ void KviSoundThread::run()
#endif //COMPILE_AUDIOFILE_SUPPORT
- KviOssSoundThread::KviOssSoundThread(const QString &szFileName)
+ KviOssSoundThread::KviOssSoundThread(const TQString &szFileName)
: KviSoundThread(szFileName)
{
}
@@ -435,7 +426,7 @@ void KviSoundThread::run()
{
#define OSS_BUFFER_SIZE 16384
- QFile f(m_szFileName);
+ TQFile f(m_szFileName);
int fd = -1;
char buf[OSS_BUFFER_SIZE];
int iDataLen = 0;
@@ -515,7 +506,7 @@ void KviSoundThread::run()
#ifdef COMPILE_ESD_SUPPORT
- KviEsdSoundThread::KviEsdSoundThread(const QString &szFileName)
+ KviEsdSoundThread::KviEsdSoundThread(const TQString &szFileName)
: KviSoundThread(szFileName)
{
}
@@ -535,7 +526,7 @@ void KviSoundThread::run()
#ifdef COMPILE_ARTS_SUPPORT
- KviArtsSoundThread::KviArtsSoundThread(const QString &szFileName)
+ KviArtsSoundThread::KviArtsSoundThread(const TQString &szFileName)
: KviSoundThread(szFileName)
{
}
@@ -589,7 +580,7 @@ void KviSoundThread::run()
static bool snd_kvs_cmd_play(KviKvsModuleCommandCall * c)
{
- QString szFile;
+ TQString szFile;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("file name",KVS_PT_STRING,0,szFile)
KVSM_PARAMETERS_END(c)
@@ -610,7 +601,7 @@ static bool snd_kvs_cmd_play(KviKvsModuleCommandCall * c)
static bool snd_kvs_cmd_autodetect(KviKvsModuleCommandCall * c)
{
g_pSoundPlayer->detectSoundSystem();
- if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringSoundSystem),"null"))
+ if(KviTQString::equalCI(KVI_OPTION_STRING(KviOption_stringSoundSystem),"null"))
{
c->window()->outputNoFmt(KVI_OUT_SYSTEMERROR,__tr2qs("Sorry , I can't find a sound system to use on this machine"));
} else {
@@ -715,8 +706,8 @@ static bool snd_module_ctrl(KviModule * m,const char * operation,void * param)
{
if(kvi_strEqualCI(operation,"getAvailableSoundSystems"))
{
- // we expect param to be a pointer to QStringList
- QStringList *l=(QStringList *)param;
+ // we expect param to be a pointer to TQStringList
+ TQStringList *l=(TQStringList *)param;
g_pSoundPlayer->getAvailableSoundSystems(l);
return true;
}
diff --git a/src/modules/snd/libkvisnd.h b/src/modules/snd/libkvisnd.h
index 6becfa3..79f6b47 100644
--- a/src/modules/snd/libkvisnd.h
+++ b/src/modules/snd/libkvisnd.h
@@ -25,7 +25,7 @@
#include "kvi_settings.h"
-#include <qobject.h>
+#include <tqobject.h>
#include "kvi_thread.h"
#include "kvi_string.h"
@@ -37,10 +37,10 @@
//class KviWavSoundFileReader
//{
//public:
-// KviWavSoundFileReader(QFile * f);
+// KviWavSoundFileReader(TQFile * f);
// ~KviWavSoundFileReader();
//protected:
-// QFile * m_pFile;
+// TQFile * m_pFile;
//public:
// static bool recognize(KviFile * f);
// bool readHeader();
@@ -107,10 +107,10 @@
class KviSoundThread : public KviThread
{
public:
- KviSoundThread(const QString &szFileName);
+ KviSoundThread(const TQString &szFileName);
virtual ~KviSoundThread();
protected:
- QString m_szFileName;
+ TQString m_szFileName;
protected:
virtual void play();
virtual void run();
@@ -121,7 +121,7 @@ protected:
class KviOssSoundThread : public KviSoundThread
{
public:
- KviOssSoundThread(const QString &szFileName);
+ KviOssSoundThread(const TQString &szFileName);
virtual ~KviOssSoundThread();
protected:
virtual void play();
@@ -131,7 +131,7 @@ protected:
class KviOssAudiofileSoundThread : public KviSoundThread
{
public:
- KviOssAudiofileSoundThread(const QString &szFileName);
+ KviOssAudiofileSoundThread(const TQString &szFileName);
virtual ~KviOssAudiofileSoundThread();
protected:
virtual void play();
@@ -143,7 +143,7 @@ protected:
class KviEsdSoundThread : public KviSoundThread
{
public:
- KviEsdSoundThread(const QString &szFileName);
+ KviEsdSoundThread(const TQString &szFileName);
virtual ~KviEsdSoundThread();
protected:
virtual void play();
@@ -154,7 +154,7 @@ protected:
class KviArtsSoundThread : public KviSoundThread
{
public:
- KviArtsSoundThread(const QString &szFileName);
+ KviArtsSoundThread(const TQString &szFileName);
virtual ~KviArtsSoundThread();
protected:
virtual void play();
@@ -164,49 +164,50 @@ protected:
class KviSoundPlayer;
-typedef bool (KviSoundPlayer::*SoundSystemRoutine)(const QString &szFileName);
+typedef bool (KviSoundPlayer::*SoundSystemRoutine)(const TQString &szFileName);
-class KviSoundPlayer : public QObject
+class KviSoundPlayer : public TQObject
{
friend class KviSoundThread;
Q_OBJECT
+ TQ_OBJECT
public:
KviSoundPlayer();
virtual ~KviSoundPlayer();
public:
- bool play(const QString &szFileName);
+ bool play(const TQString &szFileName);
void detectSoundSystem();
bool havePlayingSounds();
- //void getAvailableSoundSystems(KviPointerList<QString> * l);
- void getAvailableSoundSystems(QStringList * l);
+ //void getAvailableSoundSystems(KviPointerList<TQString> * l);
+ void getAvailableSoundSystems(TQStringList * l);
bool isMuted() {return KVI_OPTION_BOOL(KviOption_boolMuteAllSounds); };
void setMuted(bool muted) {KVI_OPTION_BOOL(KviOption_boolMuteAllSounds)=muted;};
protected:
KviPointerList<KviSoundThread> * m_pThreadList;
- KviPointerHashTable<QString,SoundSystemRoutine> * m_pSoundSystemDict;
+ KviPointerHashTable<TQString,SoundSystemRoutine> * m_pSoundSystemDict;
protected:
void registerSoundThread(KviSoundThread * t);
void unregisterSoundThread(KviSoundThread * t);
- virtual bool event(QEvent *e);
+ virtual bool event(TQEvent *e);
protected:
#ifdef COMPILE_ON_WINDOWS
- bool playWinmm(const QString &szFileName);
+ bool playWinmm(const TQString &szFileName);
#else //!COMPILE_ON_WINDOWS
#ifdef COMPILE_OSS_SUPPORT
- bool playOss(const QString &szFileName);
+ bool playOss(const TQString &szFileName);
#ifdef COMPILE_AUDIOFILE_SUPPORT
- bool playOssAudiofile(const QString &szFileName);
+ bool playOssAudiofile(const TQString &szFileName);
#endif //COMPILE_AUDIOFILE_SUPPORT
#endif //COMPILE_OSS_SUPPORT
#ifdef COMPILE_ARTS_SUPPORT
- bool playArts(const QString &szFileName);
+ bool playArts(const TQString &szFileName);
#endif //COMPILE_ARTS_SUPPORT
#ifdef COMPILE_ESD_SUPPORT
- bool playEsd(const QString &szFileName);
+ bool playEsd(const TQString &szFileName);
#endif //COMPILE_ESD_SUPPORT
#endif //!COMPILE_ON_WINDOWS
- bool playQt(const QString &szFileName);
- bool playNull(const QString &szFileName);
+ bool playTQt(const TQString &szFileName);
+ bool playNull(const TQString &szFileName);
};