summaryrefslogtreecommitdiffstats
path: root/kradio3/plugins/alsa-sound/alsa-sound.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-01 03:43:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-01 03:43:07 +0000
commit70b9eea2ba01c3691497f49e4c45cb070c16193c (patch)
tree9a6df61aa247a27275aad9c5245e419e89c2c640 /kradio3/plugins/alsa-sound/alsa-sound.h
parent998c1384ace4ae4655997c181fa33242148cd0a4 (diff)
downloadtderadio-70b9eea2ba01c3691497f49e4c45cb070c16193c.tar.gz
tderadio-70b9eea2ba01c3691497f49e4c45cb070c16193c.zip
TQt4 port kradio
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kradio@1238952 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kradio3/plugins/alsa-sound/alsa-sound.h')
-rw-r--r--kradio3/plugins/alsa-sound/alsa-sound.h77
1 files changed, 39 insertions, 38 deletions
diff --git a/kradio3/plugins/alsa-sound/alsa-sound.h b/kradio3/plugins/alsa-sound/alsa-sound.h
index 93a9fc8..0e4b83a 100644
--- a/kradio3/plugins/alsa-sound/alsa-sound.h
+++ b/kradio3/plugins/alsa-sound/alsa-sound.h
@@ -28,8 +28,8 @@
#include "alsa-config-mixer-setting.h"
-#include <qobject.h>
-#include <qtimer.h>
+#include <tqobject.h>
+#include <tqtimer.h>
#include <alsa/asoundlib.h>
enum DUPLEX_MODE { DUPLEX_UNKNOWN, DUPLEX_FULL, DUPLEX_HALF };
@@ -39,12 +39,12 @@ struct SoundStreamConfig
{
SoundStreamConfig()
: m_ActiveMode(false),
- m_Channel(QString::null),
+ m_Channel(TQString()),
m_Volume(-1),
m_Muted(false)
{}
- SoundStreamConfig(const QString &_channel, bool active_mode = true)
+ SoundStreamConfig(const TQString &_channel, bool active_mode = true)
: m_ActiveMode(active_mode),
m_Channel(_channel),
m_Volume(-1),
@@ -59,7 +59,7 @@ struct SoundStreamConfig
{}
bool m_ActiveMode;
- QString m_Channel;
+ TQString m_Channel;
float m_Volume;
bool m_Muted;
};
@@ -84,14 +84,15 @@ protected:
};
-class AlsaSoundDevice : public QObject,
+class AlsaSoundDevice : public TQObject,
public PluginBase,
public ISoundStreamClient
{
Q_OBJECT
+ TQ_OBJECT
public:
- AlsaSoundDevice (const QString &name);
+ AlsaSoundDevice (const TQString &name);
virtual ~AlsaSoundDevice ();
virtual bool connectI(Interface *i);
@@ -103,10 +104,10 @@ public:
virtual void saveState (KConfig *) const;
virtual void restoreState (KConfig *);
- virtual QString pluginClassName() const { return "AlsaSoundDevice"; }
+ virtual TQString pluginClassName() const { return "AlsaSoundDevice"; }
- virtual const QString &name() const { return PluginBase::name(); }
- virtual QString &name() { return PluginBase::name(); }
+ virtual const TQString &name() const { return PluginBase::name(); }
+ virtual TQString &name() { return PluginBase::name(); }
virtual ConfigPageInfo createConfigurationPage();
virtual AboutPageInfo createAboutPage();
@@ -115,8 +116,8 @@ public:
RECEIVERS:
void noticeConnectedI (ISoundStreamServer *s, bool pointer_valid);
- bool preparePlayback(SoundStreamID id, const QString &channel, bool active_mode, bool start_immediately);
- bool prepareCapture(SoundStreamID id, const QString &channel);
+ bool preparePlayback(SoundStreamID id, const TQString &channel, bool active_mode, bool start_immediately);
+ bool prepareCapture(SoundStreamID id, const TQString &channel);
bool releasePlayback(SoundStreamID id);
bool releaseCapture(SoundStreamID id);
@@ -124,23 +125,23 @@ ANSWERS:
bool supportsPlayback() const;
bool supportsCapture() const;
- QString getSoundStreamClientDescription() const;
+ TQString getSoundStreamClientDescription() const;
// ISoundStreamClient: mixer access
public:
static
void getPlaybackMixerChannels(int card, snd_mixer_t *mixer_handle,
- QStringList &retval, QMap<QString, AlsaMixerElement> &int2id);
+ TQStringList &retval, TQMap<TQString, AlsaMixerElement> &int2id);
static
void getCaptureMixerChannels (int card, snd_mixer_t *mixer_handle,
- QStringList &vol_list, QMap<QString, AlsaMixerElement> &vol_ch2id,
- QStringList &sw_list, QMap<QString, AlsaMixerElement> &sw_ch2id,
- QStringList *all_list = NULL);
+ TQStringList &vol_list, TQMap<TQString, AlsaMixerElement> &vol_ch2id,
+ TQStringList &sw_list, TQMap<TQString, AlsaMixerElement> &sw_ch2id,
+ TQStringList *all_list = NULL);
ANSWERS:
- const QStringList &getPlaybackChannels() const;
- const QStringList &getCaptureChannels() const;
+ const TQStringList &getPlaybackChannels() const;
+ const TQStringList &getCaptureChannels() const;
RECEIVERS:
bool setPlaybackVolume(SoundStreamID id, float volume);
@@ -188,7 +189,7 @@ RECEIVERS:
int getPlaybackDevice() const { return m_PlaybackDevice; }
int getCaptureCard() const { return m_CaptureCard; }
int getCaptureDevice() const { return m_CaptureDevice; }
- const QMap<QString, AlsaConfigMixerSetting> &
+ const TQMap<TQString, AlsaConfigMixerSetting> &
getCaptureMixerSettings() const { return m_CaptureMixerSettings; }
void setHWBufferSize(int s);
@@ -197,7 +198,7 @@ RECEIVERS:
void enableCapture(bool on);
void setPlaybackDevice(int card, int device);
void setCaptureDevice(int card, int device);
- void setCaptureMixerSettings(const QMap<QString, AlsaConfigMixerSetting> &map);
+ void setCaptureMixerSettings(const TQMap<TQString, AlsaConfigMixerSetting> &map);
protected slots:
@@ -209,7 +210,7 @@ signals:
void sigUpdateConfig();
protected:
-// bool event(QEvent *_e);
+// bool event(TQEvent *_e);
bool openAlsaDevice(snd_pcm_t *&alsa_handle, SoundFormat &format, const char *pcm_name, snd_pcm_stream_t stream, int flags, unsigned &latency);
@@ -220,19 +221,19 @@ protected:
bool openPlaybackMixerDevice (bool reopen = false);
bool openCaptureMixerDevice (bool reopen = false);
- static bool openMixerDevice(snd_mixer_t *&mixer_handle, int card, bool reopen, QTimer *timer, int timer_latency);
+ static bool openMixerDevice(snd_mixer_t *&mixer_handle, int card, bool reopen, TQTimer *timer, int timer_latency);
bool closeCaptureMixerDevice (bool force = false);
bool closePlaybackMixerDevice(bool force = false);
- static bool closeMixerDevice(snd_mixer_t *&mixer_handle, int card, SoundStreamID id, snd_pcm_t *pcm_handle, bool force, QTimer *timer);
+ static bool closeMixerDevice(snd_mixer_t *&mixer_handle, int card, SoundStreamID id, snd_pcm_t *pcm_handle, bool force, TQTimer *timer);
void checkMixerVolume(SoundStreamID id);
- float readPlaybackMixerVolume(const QString &channel, bool &muted) const;
- float readCaptureMixerVolume(const QString &channel) const;
- bool writePlaybackMixerVolume(const QString &channel, float &vol, bool muted);
- bool writeCaptureMixerVolume(const QString &channel, float &vol);
- bool writeCaptureMixerSwitch(const QString &channel, bool capture);
+ float readPlaybackMixerVolume(const TQString &channel, bool &muted) const;
+ float readCaptureMixerVolume(const TQString &channel) const;
+ bool writePlaybackMixerVolume(const TQString &channel, float &vol, bool muted);
+ bool writeCaptureMixerVolume(const TQString &channel, float &vol);
+ bool writeCaptureMixerSwitch(const TQString &channel, bool capture);
- void selectCaptureChannel (const QString &channel);
+ void selectCaptureChannel (const TQString &channel);
/* ALSA HANDLES */
snd_pcm_t *m_hPlayback;
@@ -250,19 +251,19 @@ protected:
unsigned m_PlaybackLatency;
unsigned m_CaptureLatency;
- QStringList m_PlaybackChannels,
+ TQStringList m_PlaybackChannels,
m_CaptureChannels,
m_CaptureChannelsSwitch;
- QMap<QString, AlsaMixerElement> m_PlaybackChannels2ID,
+ TQMap<TQString, AlsaMixerElement> m_PlaybackChannels2ID,
m_CaptureChannels2ID,
m_CaptureChannelsSwitch2ID;
- QMap<SoundStreamID, SoundStreamConfig>
+ TQMap<SoundStreamID, SoundStreamConfig>
m_PlaybackStreams,
m_CaptureStreams;
- QValueList<SoundStreamID>
+ TQValueList<SoundStreamID>
m_PassivePlaybackStreams;
SoundStreamID m_PlaybackStreamID,
m_CaptureStreamID;
@@ -273,7 +274,7 @@ protected:
m_CaptureBuffer;
unsigned m_CaptureRequestCounter;
- Q_UINT64 m_CapturePos;
+ TQ_UINT64 m_CapturePos;
time_t m_CaptureStartTime;
size_t //m_PlaybackSkipCount,
@@ -282,12 +283,12 @@ protected:
bool m_EnablePlayback,
m_EnableCapture;
- QTimer m_PlaybackPollingTimer;
- QTimer m_CapturePollingTimer;
+ TQTimer m_PlaybackPollingTimer;
+ TQTimer m_CapturePollingTimer;
// AlsaCaptureThread *m_captureThread;
- QMap<QString, AlsaConfigMixerSetting> m_CaptureMixerSettings;
+ TQMap<TQString, AlsaConfigMixerSetting> m_CaptureMixerSettings;
};