summaryrefslogtreecommitdiffstats
path: root/plugins/audiooutput/alsa
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-27 19:21:21 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-27 19:21:21 +0000
commitd8cc8bdfa7fa624a526d5aa1626974e1444cb799 (patch)
treef295f1c545b319963d5357af79fe08991d8141d9 /plugins/audiooutput/alsa
parent2a39a080579fb52a2599c02b2939795385b89093 (diff)
downloadk3b-d8cc8bdfa7fa624a526d5aa1626974e1444cb799.tar.gz
k3b-d8cc8bdfa7fa624a526d5aa1626974e1444cb799.zip
TQt4 port k3b
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k3b@1233803 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'plugins/audiooutput/alsa')
-rw-r--r--plugins/audiooutput/alsa/k3balsaoutputplugin.cpp46
-rw-r--r--plugins/audiooutput/alsa/k3balsaoutputplugin.h11
2 files changed, 29 insertions, 28 deletions
diff --git a/plugins/audiooutput/alsa/k3balsaoutputplugin.cpp b/plugins/audiooutput/alsa/k3balsaoutputplugin.cpp
index 7351ffc..437f188 100644
--- a/plugins/audiooutput/alsa/k3balsaoutputplugin.cpp
+++ b/plugins/audiooutput/alsa/k3balsaoutputplugin.cpp
@@ -25,8 +25,8 @@
#include <kconfig.h>
#include <kdialog.h>
-#include <qlayout.h>
-#include <qlabel.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
#include <alsa/asoundlib.h>
#include <alsa/pcm.h>
@@ -46,7 +46,7 @@ public:
snd_pcm_t *pcm_playback;
bool error;
- QString lastErrorMessage;
+ TQString lastErrorMessage;
bool swap;
@@ -54,8 +54,8 @@ public:
};
-K3bAlsaOutputPlugin::K3bAlsaOutputPlugin( QObject* parent, const char* name )
- : K3bAudioOutputPlugin( parent, name )
+K3bAlsaOutputPlugin::K3bAlsaOutputPlugin( TQObject* tqparent, const char* name )
+ : K3bAudioOutputPlugin( tqparent, name )
{
d = new Private;
}
@@ -109,7 +109,7 @@ bool K3bAlsaOutputPlugin::recoverFromError( int err )
if( err == -EPIPE ) {
err = snd_pcm_prepare( d->pcm_playback );
if( err < 0 ) {
- d->lastErrorMessage = i18n("Internal Alsa problem: %1").arg(snd_strerror(err));
+ d->lastErrorMessage = i18n("Internal Alsa problem: %1").tqarg(snd_strerror(err));
return false;
}
}
@@ -121,7 +121,7 @@ bool K3bAlsaOutputPlugin::recoverFromError( int err )
// unable to wake up pcm device, restart it
err = snd_pcm_prepare( d->pcm_playback );
if( err < 0 ) {
- d->lastErrorMessage = i18n("Internal Alsa problem: %1").arg(snd_strerror(err));
+ d->lastErrorMessage = i18n("Internal Alsa problem: %1").tqarg(snd_strerror(err));
return false;
}
}
@@ -149,11 +149,11 @@ bool K3bAlsaOutputPlugin::init()
cleanup();
KConfigGroup c( k3bcore->config(), "Alsa Output Plugin" );
- QString alsaDevice = c.readEntry( "output device", "default" );
+ TQString alsaDevice = c.readEntry( "output device", "default" );
int err = snd_pcm_open( &d->pcm_playback, alsaDevice.local8Bit(), SND_PCM_STREAM_PLAYBACK, 0 );
if( err < 0 ) {
- d->lastErrorMessage = i18n("Could not open alsa audio device '%1' (%2).").arg(alsaDevice).arg(snd_strerror(err));
+ d->lastErrorMessage = i18n("Could not open alsa audio device '%1' (%2).").tqarg(alsaDevice).tqarg(snd_strerror(err));
d->error = true;
return false;
}
@@ -174,20 +174,20 @@ bool K3bAlsaOutputPlugin::setupHwParams()
int err = 0;
if( ( err = snd_pcm_hw_params_malloc( &hw_params ) ) < 0 ) {
- d->lastErrorMessage = i18n("Could not allocate hardware parameter structure (%1)").arg(snd_strerror(err));
+ d->lastErrorMessage = i18n("Could not allocate hardware parameter structure (%1)").tqarg(snd_strerror(err));
d->error = true;
return false;
}
if( (err = snd_pcm_hw_params_any( d->pcm_playback, hw_params )) < 0) {
- d->lastErrorMessage = i18n("Could not initialize hardware parameter structure (%1).").arg(snd_strerror(err));
+ d->lastErrorMessage = i18n("Could not initialize hardware parameter structure (%1).").tqarg(snd_strerror(err));
snd_pcm_hw_params_free( hw_params );
d->error = true;
return false;
}
if( (err = snd_pcm_hw_params_set_access( d->pcm_playback, hw_params, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0) {
- d->lastErrorMessage = i18n("Could not set access type (%1).").arg(snd_strerror(err));
+ d->lastErrorMessage = i18n("Could not set access type (%1).").tqarg(snd_strerror(err));
snd_pcm_hw_params_free( hw_params );
d->error = true;
return false;
@@ -195,7 +195,7 @@ bool K3bAlsaOutputPlugin::setupHwParams()
if( (err = snd_pcm_hw_params_set_format( d->pcm_playback, hw_params, SND_PCM_FORMAT_S16_BE)) < 0) {
if( (err = snd_pcm_hw_params_set_format( d->pcm_playback, hw_params, SND_PCM_FORMAT_S16_LE)) < 0) {
- d->lastErrorMessage = i18n("Could not set sample format (%1).").arg(snd_strerror(err));
+ d->lastErrorMessage = i18n("Could not set sample format (%1).").tqarg(snd_strerror(err));
snd_pcm_hw_params_free( hw_params );
d->error = true;
return false;
@@ -208,7 +208,7 @@ bool K3bAlsaOutputPlugin::setupHwParams()
d->sampleRate = 44100;
if( (err = snd_pcm_hw_params_set_rate_near( d->pcm_playback, hw_params, &d->sampleRate, 0)) < 0) {
- d->lastErrorMessage = i18n("Could not set sample rate (%1).").arg(snd_strerror(err));
+ d->lastErrorMessage = i18n("Could not set sample rate (%1).").tqarg(snd_strerror(err));
snd_pcm_hw_params_free( hw_params );
d->error = true;
return false;
@@ -217,14 +217,14 @@ bool K3bAlsaOutputPlugin::setupHwParams()
kdDebug() << "(K3bAlsaOutputPlugin) samplerate set to " << d->sampleRate << endl;
if( (err = snd_pcm_hw_params_set_channels( d->pcm_playback, hw_params, 2)) < 0) {
- d->lastErrorMessage = i18n("Could not set channel count (%1).").arg(snd_strerror(err));
+ d->lastErrorMessage = i18n("Could not set channel count (%1).").tqarg(snd_strerror(err));
snd_pcm_hw_params_free( hw_params );
d->error = true;
return false;
}
if( (err = snd_pcm_hw_params( d->pcm_playback, hw_params )) < 0) {
- d->lastErrorMessage = i18n("Could not set parameters (%1).").arg(snd_strerror(err));
+ d->lastErrorMessage = i18n("Could not set parameters (%1).").tqarg(snd_strerror(err));
snd_pcm_hw_params_free( hw_params );
d->error = true;
return false;
@@ -236,28 +236,28 @@ bool K3bAlsaOutputPlugin::setupHwParams()
}
-QString K3bAlsaOutputPlugin::lastErrorMessage() const
+TQString K3bAlsaOutputPlugin::lastErrorMessage() const
{
return d->lastErrorMessage;
}
-K3bPluginConfigWidget* K3bAlsaOutputPlugin::createConfigWidget( QWidget* parent,
+K3bPluginConfigWidget* K3bAlsaOutputPlugin::createConfigWidget( TQWidget* tqparent,
const char* name ) const
{
- return new K3bAlsaOutputPluginConfigWidget( parent, name );
+ return new K3bAlsaOutputPluginConfigWidget( tqparent, name );
}
-K3bAlsaOutputPluginConfigWidget::K3bAlsaOutputPluginConfigWidget( QWidget* parent, const char* name )
- : K3bPluginConfigWidget( parent, name )
+K3bAlsaOutputPluginConfigWidget::K3bAlsaOutputPluginConfigWidget( TQWidget* tqparent, const char* name )
+ : K3bPluginConfigWidget( tqparent, name )
{
- QHBoxLayout* l = new QHBoxLayout( this );
+ TQHBoxLayout* l = new TQHBoxLayout( this );
l->setSpacing( KDialog::spacingHint() );
l->setAutoAdd( true );
- (void)new QLabel( i18n("Alsa device:"), this );
+ (void)new TQLabel( i18n("Alsa device:"), this );
m_comboDevice = new KComboBox( this );
m_comboDevice->setEditable( true );
diff --git a/plugins/audiooutput/alsa/k3balsaoutputplugin.h b/plugins/audiooutput/alsa/k3balsaoutputplugin.h
index 7e59b1e..b0fce65 100644
--- a/plugins/audiooutput/alsa/k3balsaoutputplugin.h
+++ b/plugins/audiooutput/alsa/k3balsaoutputplugin.h
@@ -25,20 +25,20 @@ class KComboBox;
class K3bAlsaOutputPlugin : public K3bAudioOutputPlugin
{
public:
- K3bAlsaOutputPlugin( QObject* parent = 0, const char* name = 0 );
+ K3bAlsaOutputPlugin( TQObject* tqparent = 0, const char* name = 0 );
~K3bAlsaOutputPlugin();
int pluginSystemVersion() const { return 3; }
- QCString soundSystem() const { return "alsa"; }
+ TQCString soundSystem() const { return "alsa"; }
bool init();
void cleanup();
- QString lastErrorMessage() const;
+ TQString lastErrorMessage() const;
int write( char* data, int len );
- K3bPluginConfigWidget* createConfigWidget( QWidget* parent = 0,
+ K3bPluginConfigWidget* createConfigWidget( TQWidget* tqparent = 0,
const char* name = 0 ) const;
private:
@@ -53,9 +53,10 @@ class K3bAlsaOutputPlugin : public K3bAudioOutputPlugin
class K3bAlsaOutputPluginConfigWidget : public K3bPluginConfigWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- K3bAlsaOutputPluginConfigWidget( QWidget* parent = 0, const char* name = 0 );
+ K3bAlsaOutputPluginConfigWidget( TQWidget* tqparent = 0, const char* name = 0 );
~K3bAlsaOutputPluginConfigWidget();
public slots: