diff options
Diffstat (limited to 'src/plugins/Output/alsa')
| -rw-r--r-- | src/plugins/Output/alsa/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/plugins/Output/alsa/outputalsa.cpp | 9 | ||||
| -rw-r--r-- | src/plugins/Output/alsa/outputalsa.h | 4 | ||||
| -rw-r--r-- | src/plugins/Output/alsa/settingsdialog.cpp | 5 |
4 files changed, 6 insertions, 14 deletions
diff --git a/src/plugins/Output/alsa/CMakeLists.txt b/src/plugins/Output/alsa/CMakeLists.txt index 754cecd12..c87ed020d 100644 --- a/src/plugins/Output/alsa/CMakeLists.txt +++ b/src/plugins/Output/alsa/CMakeLists.txt @@ -7,7 +7,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../) link_directories(${CMAKE_CURRENT_BINARY_DIR}/../../../qmmp) # alsa -pkg_search_module(ALSA alsa) +pkg_search_module(ALSA alsa >= 1.0.22) include_directories(${ALSA_INCLUDE_DIRS}) link_directories(${ALSA_LIBRARY_DIRS}) ADD_DEFINITIONS(${ALSA_CFLAGS}) diff --git a/src/plugins/Output/alsa/outputalsa.cpp b/src/plugins/Output/alsa/outputalsa.cpp index 4ee817d1c..92f3ede32 100644 --- a/src/plugins/Output/alsa/outputalsa.cpp +++ b/src/plugins/Output/alsa/outputalsa.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006-2017 by Ilya Kotov * + * Copyright (C) 2006-2018 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -45,8 +45,7 @@ OutputALSA::OutputALSA() : m_inited(false) m_prebuf_fill = 0; m_can_pause = false; m_chunk_size = 0; -#if (SND_LIB_VERSION >= 0x01001B) - m_alsa_channels[SND_CHMAP_NA] = Qmmp::CHAN_NULL; + m_alsa_channels[SND_CHMAP_NA] = Qmmp::CHAN_NULL; m_alsa_channels[SND_CHMAP_MONO] = Qmmp::CHAN_FRONT_CENTER; m_alsa_channels[SND_CHMAP_FL] = Qmmp::CHAN_FRONT_LEFT; m_alsa_channels[SND_CHMAP_FR] = Qmmp::CHAN_FRONT_RIGHT; @@ -57,7 +56,6 @@ OutputALSA::OutputALSA() : m_inited(false) m_alsa_channels[SND_CHMAP_SL] = Qmmp::CHAN_SIDE_LEFT; m_alsa_channels[SND_CHMAP_SR] = Qmmp::CHAN_SIDE_RIGHT; m_alsa_channels[SND_CHMAP_RC] = Qmmp::CHAN_REAR_CENTER; -#endif } OutputALSA::~OutputALSA() @@ -211,7 +209,6 @@ bool OutputALSA::initialize(quint32 freq, ChannelMap map, Qmmp::AudioFormat form qDebug("OutputALSA: can pause: %d", m_can_pause); ChannelMap out_map = map; -#if (SND_LIB_VERSION >= 0x01001B) //channel map configuration snd_pcm_chmap_t *chmap = snd_pcm_get_chmap(pcm_handle); if(chmap) @@ -233,7 +230,7 @@ bool OutputALSA::initialize(quint32 freq, ChannelMap map, Qmmp::AudioFormat form } else qWarning("OutputALSA: Unable to receive current channel map"); -#endif + configure(exact_rate, out_map, format); //apply configuration //create alsa prebuffer; m_prebuf_size = 2 * snd_pcm_frames_to_bytes(pcm_handle, m_chunk_size); //buffer for two periods diff --git a/src/plugins/Output/alsa/outputalsa.h b/src/plugins/Output/alsa/outputalsa.h index 3a2ad42f1..0a3a68118 100644 --- a/src/plugins/Output/alsa/outputalsa.h +++ b/src/plugins/Output/alsa/outputalsa.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006-2014 by Ilya Kotov * + * Copyright (C) 2006-2018 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -64,9 +64,7 @@ private: qint64 m_prebuf_fill; bool m_can_pause; //channel conversions -#if (SND_LIB_VERSION >= 0x01001B) QHash <quint16, Qmmp::ChannelPosition> m_alsa_channels; -#endif }; class VolumeALSA : public Volume diff --git a/src/plugins/Output/alsa/settingsdialog.cpp b/src/plugins/Output/alsa/settingsdialog.cpp index e60715b3d..df46925f3 100644 --- a/src/plugins/Output/alsa/settingsdialog.cpp +++ b/src/plugins/Output/alsa/settingsdialog.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006-2017 by Ilya Kotov * + * Copyright (C) 2006-2018 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -18,7 +18,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include <QSettings> - #include <qmmp/qmmp.h> extern "C" @@ -91,7 +90,6 @@ void SettingsDialog::getCards() void SettingsDialog::getSoftDevices() { -#if SND_LIB_VERSION >= 0x010016 //1.0.22 void **hints = 0; int i = 0; @@ -120,7 +118,6 @@ void SettingsDialog::getSoftDevices() if (hints) snd_device_name_free_hint (hints); -#endif } void SettingsDialog::getCardDevices(int card) |
