diff options
Diffstat (limited to 'kradio3/plugins/v4lradio/v4lradio.cpp')
-rw-r--r-- | kradio3/plugins/v4lradio/v4lradio.cpp | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/kradio3/plugins/v4lradio/v4lradio.cpp b/kradio3/plugins/v4lradio/v4lradio.cpp index fb1ee9f..dbfec2a 100644 --- a/kradio3/plugins/v4lradio/v4lradio.cpp +++ b/kradio3/plugins/v4lradio/v4lradio.cpp @@ -1,7 +1,7 @@ /*************************************************************************** v4lradio.cpp - description ------------------- - begin : Don Mär 8 21:57:17 CET 2001 + begin : Don M�r 8 21:57:17 CET 2001 copyright : (C) 2002-2005 by Ernst Martin Witte email : witte@kawo1.rwth-aachen.de ***************************************************************************/ @@ -31,10 +31,10 @@ #include <string.h> // memcpy needed -#include <qlayout.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qvaluelist.h> +#include <tqlayout.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqvaluelist.h> #include <kconfig.h> #include <kiconloader.h> @@ -57,7 +57,7 @@ PLUGIN_LIBRARY_FUNCTIONS(V4LRadio, "kradio-v4lradio", i18n("Support for V4L(2) R /////////////////////////////////////////////////////////////////////// -V4LRadio::V4LRadio(const QString &name) +V4LRadio::V4LRadio(const TQString &name) : PluginBase(name, i18n("Video For Linux Plugin")), m_treble(0.5), m_bass(0.5), @@ -85,16 +85,16 @@ V4LRadio::V4LRadio(const QString &name) m_blockReadAudio(false), m_SoundStreamID(createNewSoundStream(false)), - m_PlaybackMixerID(QString::null), - m_CaptureMixerID(QString::null), - m_PlaybackMixerChannel(QString::null), - m_CaptureMixerChannel(QString::null), + m_PlaybackMixerID(TQString()), + m_CaptureMixerID(TQString()), + m_PlaybackMixerChannel(TQString()), + m_CaptureMixerChannel(TQString()), m_ActivePlayback(false), m_MuteOnPowerOff(false), m_VolumeZeroOnPowerOff(false), m_restorePowerOn(false) { - QObject::connect (&m_pollTimer, SIGNAL(timeout()), this, SLOT(poll())); + TQObject::connect (&m_pollTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(poll())); m_pollTimer.start(333); m_audio = new video_audio; @@ -212,7 +212,7 @@ void V4LRadio::searchMixers(ISoundStreamClient **playback_mixer, ISoundStreamCli if (playback_mixer) { *playback_mixer = getSoundStreamClientWithID(m_PlaybackMixerID); if (!*playback_mixer) { - QPtrList<ISoundStreamClient> playback_mixers = queryPlaybackMixers(); + TQPtrList<ISoundStreamClient> playback_mixers = queryPlaybackMixers(); if (!playback_mixers.isEmpty()) *playback_mixer = playback_mixers.first(); } @@ -220,7 +220,7 @@ void V4LRadio::searchMixers(ISoundStreamClient **playback_mixer, ISoundStreamCli if (capture_mixer) { *capture_mixer = getSoundStreamClientWithID(m_CaptureMixerID); if (!*capture_mixer) { - QPtrList<ISoundStreamClient> capture_mixers = queryCaptureMixers(); + TQPtrList<ISoundStreamClient> capture_mixers = queryCaptureMixers(); if (!capture_mixers.isEmpty()) *capture_mixer = capture_mixers.first(); } @@ -336,7 +336,7 @@ const RadioStation &V4LRadio::getCurrentStation() const } -const QString &V4LRadio::getDescription() const +const TQString &V4LRadio::getDescription() const { return m_caps.description; } @@ -656,7 +656,7 @@ bool V4LRadio::setFrequency(float freq) if (freq > maxf || freq < minf) { logError("V4LRadio::setFrequency: " + - i18n("invalid frequency %1").arg(QString().setNum(freq))); + i18n("invalid frequency %1").tqarg(TQString().setNum(freq))); if (!oldMute && !m_ActivePlayback) unmute(m_SoundStreamID); return false; @@ -678,14 +678,14 @@ bool V4LRadio::setFrequency(float freq) else { logError("V4LRadio::setFrequency: " + i18n("don't known how to handle V4L-version %1") - .arg(m_caps.version)); + .tqarg(m_caps.version)); } if (r) { logError("V4LRadio::setFrequency: " + i18n("error setting frequency to %1 (%2)") - .arg(QString().setNum(freq)) - .arg(QString().setNum(r))); + .tqarg(TQString().setNum(freq)) + .tqarg(TQString().setNum(r))); // unmute the old radio with the old radio station if (!oldMute && !m_ActivePlayback) unmute(m_SoundStreamID); @@ -788,7 +788,7 @@ float V4LRadio::getScanStep() const // IV4LCfg methods -bool V4LRadio::setRadioDevice(const QString &s) +bool V4LRadio::setRadioDevice(const TQString &s) { if (m_radioDev != s) { bool p = isPowerOn(); @@ -805,7 +805,7 @@ bool V4LRadio::setRadioDevice(const QString &s) } -bool V4LRadio::setPlaybackMixer(const QString &soundStreamClientID, const QString &ch) +bool V4LRadio::setPlaybackMixer(const TQString &soundStreamClientID, const TQString &ch) { bool change = m_PlaybackMixerID != soundStreamClientID || m_PlaybackMixerChannel != ch; m_PlaybackMixerID = soundStreamClientID; @@ -839,7 +839,7 @@ bool V4LRadio::setPlaybackMixer(const QString &soundStreamClientID, const QStri } -bool V4LRadio::setCaptureMixer(const QString &soundStreamClientID, const QString &ch) +bool V4LRadio::setCaptureMixer(const TQString &soundStreamClientID, const TQString &ch) { bool change = m_PlaybackMixerID != soundStreamClientID || m_PlaybackMixerChannel != ch; m_CaptureMixerID = soundStreamClientID; @@ -873,7 +873,7 @@ bool V4LRadio::setCaptureMixer(const QString &soundStreamClientID, const QStrin } -V4LCaps V4LRadio::getCapabilities(QString dev) const +V4LCaps V4LRadio::getCapabilities(TQString dev) const { if (dev.isNull()) { return m_caps; @@ -942,7 +942,7 @@ bool V4LRadio::setVolumeZeroOnPowerOff(bool a) void V4LRadio::saveState (KConfig *config) const { - config->setGroup(QString("v4lradio-") + name()); + config->setGroup(TQString("v4lradio-") + name()); config->writeEntry("RadioDev", m_radioDev); @@ -981,19 +981,19 @@ void V4LRadio::restoreState (KConfig *config) { BlockProfiler p("V4LRadio::restoreState"); - config->setGroup(QString("v4lradio-") + name()); + config->setGroup(TQString("v4lradio-") + name()); - QString base_devname = "/dev/radio"; + TQString base_devname = "/dev/radio"; - QStringList testlist (base_devname ); + TQStringList testlist (base_devname ); for (int i = 0; i < 9; ++i) - testlist.append(base_devname + QString::number(i)); + testlist.append(base_devname + TQString::number(i)); - QString found_devname(QString::null); - for (QValueListConstIterator<QString> it = testlist.begin(); it != testlist.end(); ++it) { - QFile f(*it); + TQString found_devname(TQString::null); + for (TQValueListConstIterator<TQString> it = testlist.begin(); it != testlist.end(); ++it) { + TQFile f(*it); if (f.exists()) { - QFileInfo info(f); + TQFileInfo info(f); if (info.isReadable() && info.isWritable()) { found_devname = *it; break; @@ -1001,14 +1001,14 @@ void V4LRadio::restoreState (KConfig *config) else { if (found_devname.isNull()) found_devname = *it; - logWarning(i18n("Device %1 does exist but is not readable/writable. Please check device permissions.").arg(*it)); + logWarning(i18n("Device %1 does exist but is not readable/writable. Please check device permissions.").tqarg(*it)); } } } - QString default_devname = found_devname.isNull() ? base_devname : found_devname; + TQString default_devname = found_devname.isNull() ? base_devname : found_devname; - QString devname = config->readEntry ("RadioDev", default_devname); + TQString devname = config->readEntry ("RadioDev", default_devname); if (found_devname.isNull() && devname == default_devname) { logError(i18n("Could not find an accessible v4l(2) radio device.")); @@ -1016,11 +1016,11 @@ void V4LRadio::restoreState (KConfig *config) setRadioDevice(devname); - QString PlaybackMixerID = config->readEntry ("PlaybackMixerID", QString::null); - QString PlaybackMixerChannel = config->readEntry ("PlaybackMixerChannel", "Line"); + TQString PlaybackMixerID = config->readEntry ("PlaybackMixerID", TQString()); + TQString PlaybackMixerChannel = config->readEntry ("PlaybackMixerChannel", "Line"); - QString CaptureMixerID = config->readEntry ("CaptureMixerID", QString::null); - QString CaptureMixerChannel = config->readEntry ("CaptureMixerChannel", "Line"); + TQString CaptureMixerID = config->readEntry ("CaptureMixerID", TQString()); + TQString CaptureMixerChannel = config->readEntry ("CaptureMixerChannel", "Line"); m_ActivePlayback = config->readBoolEntry("ActivePlayback", false); m_MuteOnPowerOff = config->readBoolEntry("MuteOnPowerOff", false); @@ -1123,7 +1123,7 @@ void V4LRadio::radio_init() radio_done(); logError("V4LRadio::radio_init: " + - i18n("Cannot open mixer device %1").arg(m_mixerDev)); + i18n("Cannot open mixer device %1").tqarg(m_mixerDev)); return; } */ @@ -1132,7 +1132,7 @@ void V4LRadio::radio_init() radio_done(); logError("V4LRadio::radio_init: " + - i18n("Cannot open radio device %1").arg(m_radioDev)); + i18n("Cannot open radio device %1").tqarg(m_radioDev)); return; } @@ -1170,7 +1170,7 @@ void V4LRadio::radio_done() #define CAPS_NAME_LEN 127 -V4LCaps V4LRadio::readV4LCaps(const QString &device) const +V4LCaps V4LRadio::readV4LCaps(const TQString &device) const { char buffer[CAPS_NAME_LEN+1]; int r; @@ -1183,7 +1183,7 @@ V4LCaps V4LRadio::readV4LCaps(const QString &device) const if (fd < 0) { logError("V4LRadio::readV4LCaps: " + - i18n("cannot open %1").arg(device)); + i18n("cannot open %1").tqarg(device)); return c; } @@ -1207,7 +1207,7 @@ V4LCaps V4LRadio::readV4LCaps(const QString &device) const video_audio audiocaps; if (0 == ioctl(fd, VIDIOCGAUDIO, &audiocaps)) { logDebug("V4LRadio::readV4LCaps: " + - i18n("audio caps = %1").arg(QString().setNum(audiocaps.flags))); + i18n("audio caps = %1").tqarg(TQString().setNum(audiocaps.flags))); if ((audiocaps.flags & VIDEO_AUDIO_MUTABLE) != 0) c.hasMute = true; if ((audiocaps.flags & VIDEO_AUDIO_VOLUME) != 0) @@ -1226,11 +1226,11 @@ V4LCaps V4LRadio::readV4LCaps(const QString &device) const #ifdef HAVE_V4L2 v4l2_capability caps2; - r = ioctl(fd, VIDIOC_QUERYCAP, &caps2); + r = ioctl(fd, VIDIOC_TQUERYCAP, &caps2); if (r == 0) { c.version = 2; - logDebug(i18n("V4L2 - Version: %1").arg(QString().sprintf("%08X", caps2.version))); + logDebug(i18n("V4L2 - Version: %1").tqarg(TQString().sprintf("%08X", caps2.version))); size_t l = sizeof(caps.name); l = l < CAPS_NAME_LEN ? l : CAPS_NAME_LEN; @@ -1247,13 +1247,13 @@ V4LCaps V4LRadio::readV4LCaps(const QString &device) const c.unsetBalance(); ctrl.id = V4L2_CID_AUDIO_MUTE; - if (0 == ioctl(fd, VIDIOC_QUERYCTRL, &ctrl)) + if (0 == ioctl(fd, VIDIOC_TQUERYCTRL, &ctrl)) c.hasMute = !(ctrl.flags & V4L2_CTRL_FLAG_DISABLED); else logError(i18n("V4L2: Querying mute control failed")); ctrl.id = V4L2_CID_AUDIO_VOLUME; - if (0 == ioctl(fd, VIDIOC_QUERYCTRL, &ctrl)) { + if (0 == ioctl(fd, VIDIOC_TQUERYCTRL, &ctrl)) { if (!(ctrl.flags & V4L2_CTRL_FLAG_DISABLED)) c.setVolume(ctrl.minimum, ctrl.maximum); } else { @@ -1261,7 +1261,7 @@ V4LCaps V4LRadio::readV4LCaps(const QString &device) const } ctrl.id = V4L2_CID_AUDIO_TREBLE; - if (0 == ioctl(fd, VIDIOC_QUERYCTRL, &ctrl)) { + if (0 == ioctl(fd, VIDIOC_TQUERYCTRL, &ctrl)) { if (!(ctrl.flags & V4L2_CTRL_FLAG_DISABLED)) c.setTreble(ctrl.minimum, ctrl.maximum); } else { @@ -1269,7 +1269,7 @@ V4LCaps V4LRadio::readV4LCaps(const QString &device) const } ctrl.id = V4L2_CID_AUDIO_BASS; - if (0 == ioctl(fd, VIDIOC_QUERYCTRL, &ctrl)) { + if (0 == ioctl(fd, VIDIOC_TQUERYCTRL, &ctrl)) { if (!(ctrl.flags & V4L2_CTRL_FLAG_DISABLED)) c.setBass(ctrl.minimum, c.maxBass = ctrl.maximum); } else { @@ -1277,7 +1277,7 @@ V4LCaps V4LRadio::readV4LCaps(const QString &device) const } ctrl.id = V4L2_CID_AUDIO_BALANCE; - if (0 == ioctl(fd, VIDIOC_QUERYCTRL, &ctrl)) { + if (0 == ioctl(fd, VIDIOC_TQUERYCTRL, &ctrl)) { if (!(ctrl.flags & V4L2_CTRL_FLAG_DISABLED)) c.setBalance(ctrl.minimum, ctrl.maximum); } else { @@ -1289,7 +1289,7 @@ V4LCaps V4LRadio::readV4LCaps(const QString &device) const } #endif if (c.version > 0) { - logInfo(i18n("V4L %1 detected").arg(c.version)); + logInfo(i18n("V4L %1 detected").tqarg(c.version)); } else { logError(i18n("V4L not detected")); } @@ -1356,13 +1356,13 @@ bool V4LRadio::readTunerInfo() const else { logError("V4LRadio::readTunerInfo: " + i18n("don't known how to handle V4L-version %1") - .arg(QString().setNum(m_caps.version))); + .tqarg(TQString().setNum(m_caps.version))); } if (r != 0) { m_signalQuality = 0; logError("V4LRadio::readTunerInfo: " + - i18n("cannot get tuner info (error %1)").arg(QString().setNum(r))); + i18n("cannot get tuner info (error %1)").tqarg(TQString().setNum(r))); } } else { m_signalQuality = 0; @@ -1406,7 +1406,7 @@ bool V4LRadio::readTunerInfo() const } \ x = x ? x : r; \ if (r) \ - logError(i18n("error setting %1: %2").arg(#what).arg(QString().setNum(r))); \ + logError(i18n("error setting %1: %2").tqarg(#what).tqarg(TQString().setNum(r))); \ } #define V4L2_G_CTRL(what) \ @@ -1414,7 +1414,7 @@ bool V4LRadio::readTunerInfo() const r = ioctl (m_radio_fd, VIDIOC_G_CTRL, &ctl); \ x = x ? x : r; \ if (r) \ - logError(i18n("error reading %1: %2").arg(#what).arg(QString().setNum(r))); \ + logError(i18n("error reading %1: %2").tqarg(#what).tqarg(TQString().setNum(r))); \ } @@ -1505,14 +1505,14 @@ bool V4LRadio::updateAudioInfo(bool write) const else { logError("V4LRadio::updateAudioInfo: " + i18n("don't known how to handle V4L-version %1") - .arg(QString().setNum(m_caps.version))); + .tqarg(TQString().setNum(m_caps.version))); } if (r) { logError("V4LRadio::updateAudioInfo: " + i18n("error updating radio audio info (%1): %2") - .arg(write ? i18n("write") : i18n("read")) - .arg(QString().setNum(r))); + .tqarg(write ? i18n("write") : i18n("read")) + .tqarg(TQString().setNum(r))); return false; } } @@ -1573,7 +1573,7 @@ bool V4LRadio::getPlaybackVolume(SoundStreamID id, float &volume) const -bool V4LRadio::getSoundStreamDescription(SoundStreamID id, QString &descr) const +bool V4LRadio::getSoundStreamDescription(SoundStreamID id, TQString &descr) const { if (id == m_SoundStreamID) { descr = name() + " - " + m_currentStation.name(); @@ -1597,10 +1597,10 @@ bool V4LRadio::getSoundStreamRadioStation(SoundStreamID id, const RadioStation * } -bool V4LRadio::enumerateSoundStreams(QMap<QString, SoundStreamID> &list) const +bool V4LRadio::enumerateSoundStreams(TQMap<TQString, SoundStreamID> &list) const { if (m_SoundStreamID.isValid()) { - QString tmp = QString::null; + TQString tmp = TQString(); getSoundStreamDescription(m_SoundStreamID, tmp); list[tmp] = m_SoundStreamID; return true; |