summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kioslave/audiocd/configure.in.in2
-rw-r--r--kioslave/audiocd/plugins/flac/encoderflac.cpp19
-rw-r--r--kmix/kmix.cpp4
-rw-r--r--kmix/kmix.desktop3
-rw-r--r--kmix/kmix.h1
-rw-r--r--kmix/kmixprefdlg.cpp4
-rw-r--r--kmix/kmixprefdlg.h1
7 files changed, 32 insertions, 2 deletions
diff --git a/kioslave/audiocd/configure.in.in b/kioslave/audiocd/configure.in.in
index 073d0f96..99bacf59 100644
--- a/kioslave/audiocd/configure.in.in
+++ b/kioslave/audiocd/configure.in.in
@@ -5,7 +5,7 @@ AC_DEFUN([AC_CHECK_LIBFLAC],
have_libFLAC=no
KDE_CHECK_HEADER(FLAC/metadata.h,
[
- KDE_CHECK_LIB(FLAC,FLAC__seekable_stream_decoder_process_single,
+ KDE_CHECK_LIB(FLAC,FLAC__stream_decoder_process_single,
have_libFLAC=yes)
])
diff --git a/kioslave/audiocd/plugins/flac/encoderflac.cpp b/kioslave/audiocd/plugins/flac/encoderflac.cpp
index 86d30a89..4be1aeb3 100644
--- a/kioslave/audiocd/plugins/flac/encoderflac.cpp
+++ b/kioslave/audiocd/plugins/flac/encoderflac.cpp
@@ -29,6 +29,11 @@
#include <kconfig.h>
#include <kdebug.h>
+#if !defined FLAC_API_VERSION_CURRENT || FLAC_API_VERSION_CURRENT < 8
+#define LEGACY_FLAC
+#else
+#undef LEGACY_FLAC
+#endif
extern "C"
{
@@ -47,7 +52,11 @@ public:
unsigned long data;
};
+#ifdef LEGACY_FLAC
static FLAC__StreamEncoderWriteStatus WriteCallback(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], unsigned bytes, unsigned samples, unsigned current_frame, void *client_data)
+#else
+static FLAC__StreamEncoderWriteStatus WriteCallback(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data)
+#endif
{
EncoderFLAC::Private *d = (EncoderFLAC::Private*)client_data;
@@ -109,9 +118,11 @@ unsigned long EncoderFLAC::size(long time_secs) const {
long EncoderFLAC::readInit(long size) {
kdDebug(7117) << "EncoderFLAC::readInit() called"<< endl;
d->data = 0;
+#ifdef LEGACY_FLAC
FLAC__stream_encoder_set_write_callback(d->encoder, WriteCallback);
FLAC__stream_encoder_set_metadata_callback(d->encoder, MetadataCallback);
FLAC__stream_encoder_set_client_data(d->encoder, d);
+#endif
// The options match approximely those of flac compression-level-3
FLAC__stream_encoder_set_do_mid_side_stereo(d->encoder, true);
@@ -124,7 +135,13 @@ long EncoderFLAC::readInit(long size) {
if (size > 0)
FLAC__stream_encoder_set_total_samples_estimate(d->encoder, size/4);
- FLAC__stream_encoder_init(d->encoder);
+#ifdef LEGACY_FLAC
+ if(FLAC__stream_encoder_init(d->encoder) != FLAC__STREAM_ENCODER_OK)
+ ; // really should handle an init failure
+#else
+ if(FLAC__stream_encoder_init_stream(d->encoder, WriteCallback, NULL, NULL, MetadataCallback, d) != FLAC__STREAM_ENCODER_INIT_STATUS_OK)
+ ; // really should handle an init failure
+#endif
return d->data;
}
diff --git a/kmix/kmix.cpp b/kmix/kmix.cpp
index 85a3d39e..ce4ab910 100644
--- a/kmix/kmix.cpp
+++ b/kmix/kmix.cpp
@@ -270,6 +270,7 @@ KMixWindow::saveConfig()
config->writeEntry( "Orientation","Vertical" );
else
config->writeEntry( "Orientation","Horizontal" );
+ config->writeEntry( "Autostart", m_autoStart );
// save mixer widgets
for ( KMixerWidget *mw = m_mixerWidgets.first(); mw != 0; mw = m_mixerWidgets.next() )
@@ -321,6 +322,7 @@ KMixWindow::loadConfig()
m_toplevelOrientation = Qt::Vertical;
else
m_toplevelOrientation = Qt::Horizontal;
+ m_autoStart = config->readBoolEntry("Autostart", true);
// show/hide menu bar
m_showMenubar = config->readBoolEntry("Menubar", true);
@@ -436,6 +438,7 @@ KMixWindow::showSettings()
m_prefDlg->_rbNone->setChecked( m_valueStyle == MixDeviceWidget::NNONE );
m_prefDlg->_rbAbsolute->setChecked( m_valueStyle == MixDeviceWidget::NABSOLUTE );
m_prefDlg->_rbRelative->setChecked( m_valueStyle == MixDeviceWidget::NRELATIVE );
+ m_prefDlg->m_autoStartChk->setChecked( m_autoStart );
m_prefDlg->show();
}
@@ -526,6 +529,7 @@ KMixWindow::applyPrefs( KMixPrefDlg *prefDlg )
//kdDebug(67100) << "KMix should change to Horizontal layout\n";
m_toplevelOrientation = Qt::Horizontal;
}
+ m_autoStart = prefDlg->m_autoStartChk->isChecked();
this->setUpdatesEnabled(false);
diff --git a/kmix/kmix.desktop b/kmix/kmix.desktop
index 4cb25f7a..6635ba42 100644
--- a/kmix/kmix.desktop
+++ b/kmix/kmix.desktop
@@ -89,4 +89,7 @@ Name[ven]=U tanganisa ha K
Name[zh_TW]=KMix 混音器
X-KDE-StartupNotify=true
X-DCOP-ServiceType=Unique
+X-KDE-autostart-phase=2
+X-KDE-autostart-after=panel
+X-KDE-autostart-condition=kmixrc::Autostart:true
Categories=Qt;KDE;AudioVideo;Audio;Mixer;
diff --git a/kmix/kmix.h b/kmix/kmix.h
index 76f3f32c..398c88d8 100644
--- a/kmix/kmix.h
+++ b/kmix/kmix.h
@@ -96,6 +96,7 @@ KMixWindow : public KMainWindow
TQPopupMenu *m_viewMenu;
TQPopupMenu *m_helpMenu;
+ bool m_autoStart;
bool m_showDockWidget;
bool m_volumeWidget;
bool m_hideOnClose;
diff --git a/kmix/kmixprefdlg.cpp b/kmix/kmixprefdlg.cpp
index 6e25cb63..dbf2ae93 100644
--- a/kmix/kmixprefdlg.cpp
+++ b/kmix/kmixprefdlg.cpp
@@ -90,6 +90,10 @@ KMixPrefDlg::KMixPrefDlg( TQWidget *parent )
numbersLayout->add(_rbRelative);
numbersLayout->addStretch();
+ m_autoStartChk = new TQCheckBox( i18n("&Autostart"), m_generalTab );
+ layout->addWidget( m_autoStartChk );
+ TQWhatsThis::add(m_autoStartChk, i18n("Automatically start mixer when you login"));
+
TQBoxLayout *orientationLayout = new TQHBoxLayout( layout );
TQButtonGroup* orientationGroup = new TQButtonGroup( 2, Qt::Horizontal, i18n("Orientation"), m_generalTab );
//orientationLayout->add(orientationGroup);
diff --git a/kmix/kmixprefdlg.h b/kmix/kmixprefdlg.h
index b2e294ab..2c299515 100644
--- a/kmix/kmixprefdlg.h
+++ b/kmix/kmixprefdlg.h
@@ -51,6 +51,7 @@ KMixPrefDlg : public KDialogBase
KMixApp *m_mixApp;
KMixPrefWidget *m_mixPrefTab;
+ TQCheckBox *m_autoStartChk;
TQCheckBox *m_dockingChk;
TQCheckBox *m_volumeChk;
TQCheckBox *m_hideOnCloseChk;