diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cf4cffda6..ff6138ce9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,7 +6,7 @@ add_subdirectory(blackcore) add_subdirectory(blackmisc) add_subdirectory(blackgui) add_subdirectory(input) -add_subdirectory(blacksound) +add_subdirectory(sound) add_subdirectory(swiftguistandard) add_subdirectory(swiftdata) diff --git a/src/blackcore/afv/audio/callsignsampleprovider.cpp b/src/blackcore/afv/audio/callsignsampleprovider.cpp index 772c82398..2e2e8c588 100644 --- a/src/blackcore/afv/audio/callsignsampleprovider.cpp +++ b/src/blackcore/afv/audio/callsignsampleprovider.cpp @@ -5,8 +5,8 @@ #include "blackcore/afv/audio/callsigndelaycache.h" #include "blackcore/afv/audio/receiversampleprovider.h" -#include "blacksound/sampleprovider/samples.h" -#include "blacksound/audioutilities.h" +#include "sound/sampleprovider/samples.h" +#include "sound/audioutilities.h" #include "blackmisc/logmessage.h" #include "blackmisc/metadatautils.h" #include "config/buildconfig.h" @@ -17,7 +17,7 @@ #include using namespace BlackMisc; -using namespace BlackSound::SampleProvider; +using namespace swift::sound::sample_provider; using namespace swift::config; namespace BlackCore::Afv::Audio @@ -136,7 +136,7 @@ namespace BlackCore::Afv::Audio setEffects(); const QVector audio = decodeOpus(audioDto.audio); - m_audioInput->addSamples(BlackSound::convertFromShortToFloat(audio)); + m_audioInput->addSamples(swift::sound::convertFromShortToFloat(audio)); m_lastPacketLatch = audioDto.lastPacket; if (audioDto.lastPacket && !m_underflow) { CallsignDelayCache::instance().success(m_callsign); } m_lastSamplesAddedUtc = QDateTime::currentDateTimeUtc(); diff --git a/src/blackcore/afv/audio/callsignsampleprovider.h b/src/blackcore/afv/audio/callsignsampleprovider.h index 076e0f642..048bfdf6a 100644 --- a/src/blackcore/afv/audio/callsignsampleprovider.h +++ b/src/blackcore/afv/audio/callsignsampleprovider.h @@ -7,14 +7,14 @@ #define BLACKCORE_AFV_AUDIO_CALLSIGNSAMPLEPROVIDER_H #include "blackcore/afv/dto.h" -#include "blacksound/sampleprovider/pinknoisegenerator.h" -#include "blacksound/sampleprovider/bufferedwaveprovider.h" -#include "blacksound/sampleprovider/mixingsampleprovider.h" -#include "blacksound/sampleprovider/equalizersampleprovider.h" -#include "blacksound/sampleprovider/sawtoothgenerator.h" -#include "blacksound/sampleprovider/simplecompressoreffect.h" -#include "blacksound/sampleprovider/resourcesoundsampleprovider.h" -#include "blacksound/codecs/opusdecoder.h" +#include "sound/sampleprovider/pinknoisegenerator.h" +#include "sound/sampleprovider/bufferedwaveprovider.h" +#include "sound/sampleprovider/mixingsampleprovider.h" +#include "sound/sampleprovider/equalizersampleprovider.h" +#include "sound/sampleprovider/sawtoothgenerator.h" +#include "sound/sampleprovider/simplecompressoreffect.h" +#include "sound/sampleprovider/resourcesoundsampleprovider.h" +#include "sound/codecs/opusdecoder.h" #include #include @@ -27,7 +27,7 @@ namespace BlackCore::Afv::Audio class CReceiverSampleProvider; //! Callsign provider - class CCallsignSampleProvider : public BlackSound::SampleProvider::ISampleProvider + class CCallsignSampleProvider : public swift::sound::sample_provider::ISampleProvider { Q_OBJECT @@ -89,17 +89,17 @@ namespace BlackCore::Afv::Audio bool m_bypassEffects = false; float m_distanceRatio = 1.0; const CReceiverSampleProvider *m_receiver = nullptr; - BlackSound::SampleProvider::CMixingSampleProvider *m_mixer = nullptr; - BlackSound::SampleProvider::CResourceSoundSampleProvider *m_crackleSoundProvider = nullptr; - BlackSound::SampleProvider::CResourceSoundSampleProvider *m_whiteNoise = nullptr; - BlackSound::SampleProvider::CResourceSoundSampleProvider *m_hfWhiteNoise = nullptr; - BlackSound::SampleProvider::CSawToothGenerator *m_acBusNoise = nullptr; - BlackSound::SampleProvider::CSimpleCompressorEffect *m_simpleCompressorEffect = nullptr; - BlackSound::SampleProvider::CEqualizerSampleProvider *m_voiceEqualizer = nullptr; - BlackSound::SampleProvider::CBufferedWaveProvider *m_audioInput = nullptr; + swift::sound::sample_provider::CMixingSampleProvider *m_mixer = nullptr; + swift::sound::sample_provider::CResourceSoundSampleProvider *m_crackleSoundProvider = nullptr; + swift::sound::sample_provider::CResourceSoundSampleProvider *m_whiteNoise = nullptr; + swift::sound::sample_provider::CResourceSoundSampleProvider *m_hfWhiteNoise = nullptr; + swift::sound::sample_provider::CSawToothGenerator *m_acBusNoise = nullptr; + swift::sound::sample_provider::CSimpleCompressorEffect *m_simpleCompressorEffect = nullptr; + swift::sound::sample_provider::CEqualizerSampleProvider *m_voiceEqualizer = nullptr; + swift::sound::sample_provider::CBufferedWaveProvider *m_audioInput = nullptr; QTimer *m_timer = nullptr; - BlackSound::Codecs::COpusDecoder m_decoder; + swift::sound::codecs::COpusDecoder m_decoder; bool m_lastPacketLatch = false; QDateTime m_lastSamplesAddedUtc; bool m_underflow = false; diff --git a/src/blackcore/afv/audio/input.cpp b/src/blackcore/afv/audio/input.cpp index b2c22f57b..8960bb78b 100644 --- a/src/blackcore/afv/audio/input.cpp +++ b/src/blackcore/afv/audio/input.cpp @@ -4,7 +4,7 @@ //! \file #include "blackcore/afv/audio/input.h" -#include "blacksound/audioutilities.h" +#include "sound/audioutilities.h" #include "blackmisc/logmessage.h" #include "blackmisc/verify.h" @@ -16,7 +16,7 @@ using namespace BlackMisc; using namespace BlackMisc::Audio; -using namespace BlackSound; +using namespace swift::sound; namespace BlackCore::Afv::Audio { diff --git a/src/blackcore/afv/audio/input.h b/src/blackcore/afv/audio/input.h index 325cd8479..895e1fd33 100644 --- a/src/blackcore/afv/audio/input.h +++ b/src/blackcore/afv/audio/input.h @@ -6,8 +6,8 @@ #ifndef BLACKCORE_AFV_AUDIO_AUDIO_INPUT_H #define BLACKCORE_AFV_AUDIO_AUDIO_INPUT_H -#include "blacksound/sampleprovider/bufferedwaveprovider.h" -#include "blacksound/codecs/opusencoder.h" +#include "sound/sampleprovider/bufferedwaveprovider.h" +#include "sound/codecs/opusencoder.h" #include "blackmisc/audio/audiodeviceinfo.h" #ifdef Q_OS_MAC @@ -137,7 +137,7 @@ namespace BlackCore::Afv::Audio static constexpr qint64 c_frameSize = 960; int m_sampleRate = 0; - BlackSound::Codecs::COpusEncoder m_encoder; + swift::sound::codecs::COpusEncoder m_encoder; QScopedPointer m_audioInput; BlackMisc::Audio::CAudioDeviceInfo m_device; QAudioFormat m_inputFormat; diff --git a/src/blackcore/afv/audio/output.cpp b/src/blackcore/afv/audio/output.cpp index 6801889ef..1ab23d529 100644 --- a/src/blackcore/afv/audio/output.cpp +++ b/src/blackcore/afv/audio/output.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 #include "blackcore/afv/audio/output.h" -#include "blacksound/audioutilities.h" +#include "sound/audioutilities.h" #include "blackmisc/metadatautils.h" #include "blackmisc/logmessage.h" #include "blackmisc/verify.h" @@ -13,8 +13,8 @@ using namespace BlackMisc; using namespace BlackMisc::Audio; -using namespace BlackSound; -using namespace BlackSound::SampleProvider; +using namespace swift::sound; +using namespace swift::sound::sample_provider; namespace BlackCore::Afv::Audio { diff --git a/src/blackcore/afv/audio/output.h b/src/blackcore/afv/audio/output.h index bd3923461..eac1891a2 100644 --- a/src/blackcore/afv/audio/output.h +++ b/src/blackcore/afv/audio/output.h @@ -6,7 +6,7 @@ #ifndef BLACKCORE_AFV_AUDIO_OUTPUT_H #define BLACKCORE_AFV_AUDIO_OUTPUT_H -#include "blacksound/sampleprovider/sampleprovider.h" +#include "sound/sampleprovider/sampleprovider.h" #include "blackmisc/audio/audiodeviceinfo.h" #include @@ -29,7 +29,7 @@ namespace BlackCore::Afv::Audio public: //! Ctor - CAudioOutputBuffer(BlackSound::SampleProvider::ISampleProvider *sampleProvider, QObject *parent); + CAudioOutputBuffer(swift::sound::sample_provider::ISampleProvider *sampleProvider, QObject *parent); //! Set the format void setAudioFormat(const QAudioFormat &format) { m_outputFormat = format; } @@ -51,7 +51,7 @@ namespace BlackCore::Afv::Audio virtual qint64 writeData(const char *data, qint64 len) override; private: - BlackSound::SampleProvider::ISampleProvider *m_sampleProvider = nullptr; //!< related provider + swift::sound::sample_provider::ISampleProvider *m_sampleProvider = nullptr; //!< related provider static constexpr int SampleCountPerEvent = 4800; QAudioFormat m_outputFormat; @@ -77,7 +77,7 @@ namespace BlackCore::Afv::Audio } //! Start output - void start(const BlackMisc::Audio::CAudioDeviceInfo &outputDevice, BlackSound::SampleProvider::ISampleProvider *sampleProvider); + void start(const BlackMisc::Audio::CAudioDeviceInfo &outputDevice, swift::sound::sample_provider::ISampleProvider *sampleProvider); //! Stop output void stop(); diff --git a/src/blackcore/afv/audio/receiversampleprovider.cpp b/src/blackcore/afv/audio/receiversampleprovider.cpp index 6869cf213..bd895fa5b 100644 --- a/src/blackcore/afv/audio/receiversampleprovider.cpp +++ b/src/blackcore/afv/audio/receiversampleprovider.cpp @@ -6,8 +6,8 @@ #include "blackcore/afv/audio/receiversampleprovider.h" #include "blackmisc/logmessage.h" #include "blackmisc/metadatautils.h" -#include "blacksound/sampleprovider/resourcesoundsampleprovider.h" -#include "blacksound/sampleprovider/samples.h" +#include "sound/sampleprovider/resourcesoundsampleprovider.h" +#include "sound/sampleprovider/samples.h" #include #include @@ -15,7 +15,7 @@ using namespace BlackMisc; using namespace BlackMisc::Audio; using namespace BlackMisc::Aviation; -using namespace BlackSound::SampleProvider; +using namespace swift::sound::sample_provider; namespace BlackCore::Afv::Audio { diff --git a/src/blackcore/afv/audio/receiversampleprovider.h b/src/blackcore/afv/audio/receiversampleprovider.h index 4c6d9af31..f2c4e1b2f 100644 --- a/src/blackcore/afv/audio/receiversampleprovider.h +++ b/src/blackcore/afv/audio/receiversampleprovider.h @@ -7,10 +7,10 @@ #define BLACKCORE_AFV_AUDIO_RECEIVERSAMPLEPROVIDER_H #include "blackcore/afv/audio/callsignsampleprovider.h" -#include "blacksound/sampleprovider/sampleprovider.h" -#include "blacksound/sampleprovider/mixingsampleprovider.h" -#include "blacksound/sampleprovider/sinusgenerator.h" -#include "blacksound/sampleprovider/volumesampleprovider.h" +#include "sound/sampleprovider/sampleprovider.h" +#include "sound/sampleprovider/mixingsampleprovider.h" +#include "sound/sampleprovider/sinusgenerator.h" +#include "sound/sampleprovider/volumesampleprovider.h" #include "blackmisc/logcategories.h" #include "blackmisc/aviation/callsignset.h" @@ -28,7 +28,7 @@ namespace BlackCore::Afv::Audio }; //! A sample provider - class CReceiverSampleProvider : public BlackSound::SampleProvider::ISampleProvider + class CReceiverSampleProvider : public swift::sound::sample_provider::ISampleProvider { Q_OBJECT @@ -57,7 +57,7 @@ namespace BlackCore::Afv::Audio void setMute(bool value); //! @} - //! \copydoc BlackSound::SampleProvider::ISampleProvider::readSamples + //! \copydoc swift::sound::sample_provider::ISampleProvider::readSamples virtual int readSamples(QVector &samples, qint64 count) override; //! @{ @@ -100,9 +100,9 @@ namespace BlackCore::Afv::Audio quint16 m_id; BlackMisc::CSettingReadOnly m_audioSettings { this }; - BlackSound::SampleProvider::CVolumeSampleProvider *m_volume = nullptr; - BlackSound::SampleProvider::CMixingSampleProvider *m_mixer = nullptr; - BlackSound::SampleProvider::CSinusGenerator *m_blockTone = nullptr; + swift::sound::sample_provider::CVolumeSampleProvider *m_volume = nullptr; + swift::sound::sample_provider::CMixingSampleProvider *m_mixer = nullptr; + swift::sound::sample_provider::CSinusGenerator *m_blockTone = nullptr; QVector m_voiceInputs; qint64 m_lastLogMessage = -1; diff --git a/src/blackcore/afv/audio/soundcardsampleprovider.cpp b/src/blackcore/afv/audio/soundcardsampleprovider.cpp index 6d04636dd..7f0c2dea4 100644 --- a/src/blackcore/afv/audio/soundcardsampleprovider.cpp +++ b/src/blackcore/afv/audio/soundcardsampleprovider.cpp @@ -7,7 +7,7 @@ using namespace swift::config; using namespace BlackMisc; -using namespace BlackSound::SampleProvider; +using namespace swift::sound::sample_provider; namespace BlackCore::Afv::Audio { diff --git a/src/blackcore/afv/audio/soundcardsampleprovider.h b/src/blackcore/afv/audio/soundcardsampleprovider.h index 9febd85b0..1a1e181b5 100644 --- a/src/blackcore/afv/audio/soundcardsampleprovider.h +++ b/src/blackcore/afv/audio/soundcardsampleprovider.h @@ -6,8 +6,8 @@ #ifndef BLACKCORE_AFV_AUDIO_SOUNDCARDSAMPLEPROVIDER_H #define BLACKCORE_AFV_AUDIO_SOUNDCARDSAMPLEPROVIDER_H -#include "blacksound/sampleprovider/sampleprovider.h" -#include "blacksound/sampleprovider/mixingsampleprovider.h" +#include "sound/sampleprovider/sampleprovider.h" +#include "sound/sampleprovider/mixingsampleprovider.h" #include "blackcore/afv/audio/receiversampleprovider.h" #include "blackmisc/aviation/callsignset.h" @@ -17,7 +17,7 @@ namespace BlackCore::Afv::Audio { //! Soundcard sample - class CSoundcardSampleProvider : public BlackSound::SampleProvider::ISampleProvider + class CSoundcardSampleProvider : public swift::sound::sample_provider::ISampleProvider { Q_OBJECT @@ -34,7 +34,7 @@ namespace BlackCore::Afv::Audio //! Update PTT void pttUpdate(bool active, const QVector &txTransceivers); - //! \copydoc BlackSound::SampleProvider::ISampleProvider::readSamples + //! \copydoc swift::sound::sample_provider::ISampleProvider::readSamples virtual int readSamples(QVector &samples, qint64 count) override; //! Add OPUS samples @@ -58,7 +58,7 @@ namespace BlackCore::Afv::Audio private: QAudioFormat m_waveFormat; - BlackSound::SampleProvider::CMixingSampleProvider *m_mixer = nullptr; + swift::sound::sample_provider::CMixingSampleProvider *m_mixer = nullptr; QVector m_receiverInputs; QVector m_receiverIDs; }; diff --git a/src/blackcore/afv/clients/afvclient.cpp b/src/blackcore/afv/clients/afvclient.cpp index 97cc6630c..c29b9b7e6 100644 --- a/src/blackcore/afv/clients/afvclient.cpp +++ b/src/blackcore/afv/clients/afvclient.cpp @@ -6,7 +6,7 @@ #include "blackcore/context/contextnetwork.h" #include "blackcore/context/contextsimulator.h" #include "blackcore/application.h" -#include "blacksound/audioutilities.h" +#include "sound/audioutilities.h" #include "blackmisc/audio/audiodeviceinfolist.h" #include "blackmisc/aviation/comsystem.h" #include "blackmisc/threadutils.h" @@ -27,8 +27,8 @@ using namespace BlackMisc::Audio; using namespace BlackMisc::PhysicalQuantities; using namespace BlackMisc::Simulation; using namespace BlackMisc::Aviation; -using namespace BlackSound; -using namespace BlackSound::SampleProvider; +using namespace swift::sound; +using namespace swift::sound::sample_provider; namespace BlackCore::Afv::Clients { diff --git a/src/blackcore/afv/clients/afvclient.h b/src/blackcore/afv/clients/afvclient.h index 569e71c0a..94609fd88 100644 --- a/src/blackcore/afv/clients/afvclient.h +++ b/src/blackcore/afv/clients/afvclient.h @@ -14,7 +14,7 @@ #include "blackcore/afv/dto.h" #include "blackcore/blackcoreexport.h" -#include "blacksound/sampleprovider/volumesampleprovider.h" +#include "sound/sampleprovider/volumesampleprovider.h" #include "blackmisc/aviation/comsystem.h" #include "blackmisc/audio/audiosettings.h" #include "blackmisc/audio/audiodeviceinfo.h" @@ -384,7 +384,7 @@ namespace BlackCore::Afv::Clients Audio::COutput *m_output = nullptr; Audio::CSoundcardSampleProvider *m_soundcardSampleProvider = nullptr; - BlackSound::SampleProvider::CVolumeSampleProvider *m_outputSampleProvider = nullptr; + swift::sound::sample_provider::CVolumeSampleProvider *m_outputSampleProvider = nullptr; std::atomic_bool m_transmit { false }; std::atomic_bool m_transmitHistory { false }; diff --git a/src/blackcore/context/contextaudio.cpp b/src/blackcore/context/contextaudio.cpp index 067dbf521..11dfadd0e 100644 --- a/src/blackcore/context/contextaudio.cpp +++ b/src/blackcore/context/contextaudio.cpp @@ -25,7 +25,7 @@ using namespace BlackMisc::Audio; using namespace BlackMisc::Network; using namespace BlackMisc::PhysicalQuantities; using namespace BlackMisc::Simulation; -using namespace BlackSound; +using namespace swift::sound; using namespace BlackCore::Afv::Clients; //! \cond diff --git a/src/blackcore/context/contextaudio.h b/src/blackcore/context/contextaudio.h index 084373b49..c94381956 100644 --- a/src/blackcore/context/contextaudio.h +++ b/src/blackcore/context/contextaudio.h @@ -13,8 +13,8 @@ #include "blackcore/corefacadeconfig.h" #include "blackcore/blackcoreexport.h" #include "blackcore/afv/audio/receiversampleprovider.h" -#include "blacksound/selcalplayer.h" -#include "blacksound/notificationplayer.h" +#include "sound/selcalplayer.h" +#include "sound/notificationplayer.h" #include "blackmisc/macos/microphoneaccess.h" #include "blackmisc/audio/audiodeviceinfolist.h" #include "blackmisc/audio/notificationsounds.h" @@ -355,8 +355,8 @@ namespace BlackCore BlackMisc::Audio::CAudioDeviceInfoList m_activeLocalDevices; // Players - BlackSound::CSelcalPlayer *m_selcalPlayer = nullptr; - BlackSound::CNotificationPlayer m_notificationPlayer; + swift::sound::CSelcalPlayer *m_selcalPlayer = nullptr; + swift::sound::CNotificationPlayer m_notificationPlayer; }; } // ns } // ns diff --git a/src/blackmisc/audio/notificationsounds.h b/src/blackmisc/audio/notificationsounds.h index adc52a4cd..918f73e6a 100644 --- a/src/blackmisc/audio/notificationsounds.h +++ b/src/blackmisc/audio/notificationsounds.h @@ -13,7 +13,7 @@ namespace BlackMisc::Audio { /*! * Simplified enums to play sounds. - * \remarks Currently located in project BlackMisc (i.e. outside project BlackSound) + * \remarks Currently located in project BlackMisc (i.e. outside project swift::sound) * as this allows to trigger sounds without using Multimedia libraries. */ struct BLACKMISC_EXPORT CNotificationSounds @@ -38,7 +38,7 @@ namespace BlackMisc::Audio // 1 << 9 previously used for PTTBlocked // AFVClicked and AFVBlocked are not played back from the notification player itself (except for preview playback). - // Instead, they are provided from BlackSound::SampleProvider::Samples. + // Instead, they are provided from swift::sound::sample_provider::Samples. // They are included here to allow to disable playing them. AFVClicked = 1 << 14, AFVBlocked = 1 << 15 diff --git a/src/blacksound/audioutilities.h b/src/blacksound/audioutilities.h deleted file mode 100644 index 77e3eead7..000000000 --- a/src/blacksound/audioutilities.h +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors -// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 - -//! \file - -#ifndef BLACKSOUND_AUDIOUTILITIES_H -#define BLACKSOUND_AUDIOUTILITIES_H - -#include "blacksound/blacksoundexport.h" -#include "blackmisc/audio/audiodeviceinfo.h" - -#include -#include -#include - -namespace BlackSound -{ - //! @{ - //! Conversion functions - BLACKSOUND_EXPORT QVector convertBytesTo32BitFloatPCM(const QByteArray &input); - BLACKSOUND_EXPORT QVector convertBytesTo16BitPCM(const QByteArray &input); - BLACKSOUND_EXPORT QVector convertFromMonoToStereo(const QVector &mono); - BLACKSOUND_EXPORT QVector convertFromStereoToMono(const QVector &stereo); - BLACKSOUND_EXPORT QVector convertFromShortToFloat(const QVector &input); - - BLACKSOUND_EXPORT QAudioDevice getLowestLatencyDevice(const BlackMisc::Audio::CAudioDeviceInfo &device, QAudioFormat &format); - BLACKSOUND_EXPORT QAudioDevice getHighestCompatibleOutputDevice(const BlackMisc::Audio::CAudioDeviceInfo &device, QAudioFormat &format); - - BLACKSOUND_EXPORT QString toQString(const QAudioFormat &format); - BLACKSOUND_EXPORT const QString &toQString(QSysInfo::Endian e); - BLACKSOUND_EXPORT const QString &toQString(QAudioFormat::SampleFormat s); - //! @} - - //! @{ - //! Normalize audio volume to 0..100 - BLACKSOUND_EXPORT double normalize0to100(double in); - BLACKSOUND_EXPORT qreal normalize0to100qr(double in); - //! @} - - //! Open a input device - BLACKSOUND_EXPORT void occupyAudioInputDevice(); -} // ns - -#endif // guard diff --git a/src/blacksound/CMakeLists.txt b/src/sound/CMakeLists.txt similarity index 96% rename from src/blacksound/CMakeLists.txt rename to src/sound/CMakeLists.txt index 1dfab7825..537df3563 100644 --- a/src/blacksound/CMakeLists.txt +++ b/src/sound/CMakeLists.txt @@ -49,7 +49,7 @@ add_library(sound SHARED threadedtonepairplayer.cpp notificationplayer.cpp tonepair.cpp - blacksoundexport.h + swiftsoundexport.h audioutilities.h threadedtonepairplayer.h audioutilities.cpp @@ -65,7 +65,7 @@ add_custom_command(TARGET sound COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different share ${PROJECT_BINARY_DIR}/out/share WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) -target_compile_definitions(sound PRIVATE BUILD_BLACKSOUND_LIB) +target_compile_definitions(sound PRIVATE BUILD_SWIFT_SOUND_LIB) target_include_directories(sound PUBLIC ${PROJECT_SOURCE_DIR}/src) diff --git a/src/blacksound/audioutilities.cpp b/src/sound/audioutilities.cpp similarity index 99% rename from src/blacksound/audioutilities.cpp rename to src/sound/audioutilities.cpp index e795ee929..618a6e9b2 100644 --- a/src/blacksound/audioutilities.cpp +++ b/src/sound/audioutilities.cpp @@ -14,7 +14,7 @@ using namespace swift::config; using namespace BlackMisc::Audio; -namespace BlackSound +namespace swift::sound { QVector convertBytesTo32BitFloatPCM(const QByteArray &input) { diff --git a/src/sound/audioutilities.h b/src/sound/audioutilities.h new file mode 100644 index 000000000..56afe074a --- /dev/null +++ b/src/sound/audioutilities.h @@ -0,0 +1,44 @@ +// SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors +// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 + +//! \file + +#ifndef BLACKSOUND_AUDIOUTILITIES_H +#define BLACKSOUND_AUDIOUTILITIES_H + +#include "sound/swiftsoundexport.h" +#include "blackmisc/audio/audiodeviceinfo.h" + +#include +#include +#include + +namespace swift::sound +{ + //! @{ + //! Conversion functions + SWIFT_SOUND_EXPORT QVector convertBytesTo32BitFloatPCM(const QByteArray &input); + SWIFT_SOUND_EXPORT QVector convertBytesTo16BitPCM(const QByteArray &input); + SWIFT_SOUND_EXPORT QVector convertFromMonoToStereo(const QVector &mono); + SWIFT_SOUND_EXPORT QVector convertFromStereoToMono(const QVector &stereo); + SWIFT_SOUND_EXPORT QVector convertFromShortToFloat(const QVector &input); + + SWIFT_SOUND_EXPORT QAudioDevice getLowestLatencyDevice(const BlackMisc::Audio::CAudioDeviceInfo &device, QAudioFormat &format); + SWIFT_SOUND_EXPORT QAudioDevice getHighestCompatibleOutputDevice(const BlackMisc::Audio::CAudioDeviceInfo &device, QAudioFormat &format); + + SWIFT_SOUND_EXPORT QString toQString(const QAudioFormat &format); + SWIFT_SOUND_EXPORT const QString &toQString(QSysInfo::Endian e); + SWIFT_SOUND_EXPORT const QString &toQString(QAudioFormat::SampleFormat s); + //! @} + + //! @{ + //! Normalize audio volume to 0..100 + SWIFT_SOUND_EXPORT double normalize0to100(double in); + SWIFT_SOUND_EXPORT qreal normalize0to100qr(double in); + //! @} + + //! Open a input device + SWIFT_SOUND_EXPORT void occupyAudioInputDevice(); +} // ns + +#endif diff --git a/src/blacksound/codecs/opusdecoder.cpp b/src/sound/codecs/opusdecoder.cpp similarity index 97% rename from src/blacksound/codecs/opusdecoder.cpp rename to src/sound/codecs/opusdecoder.cpp index c82682c7f..83d7c2dec 100644 --- a/src/blacksound/codecs/opusdecoder.cpp +++ b/src/sound/codecs/opusdecoder.cpp @@ -3,7 +3,7 @@ #include "opusdecoder.h" -namespace BlackSound::Codecs +namespace swift::sound::codecs { COpusDecoder::COpusDecoder(int sampleRate, int channels) : m_channels(channels) { diff --git a/src/blacksound/codecs/opusdecoder.h b/src/sound/codecs/opusdecoder.h similarity index 90% rename from src/blacksound/codecs/opusdecoder.h rename to src/sound/codecs/opusdecoder.h index d59ff2859..ffe86a120 100644 --- a/src/blacksound/codecs/opusdecoder.h +++ b/src/sound/codecs/opusdecoder.h @@ -6,15 +6,15 @@ #ifndef BLACKSOUND_CODECS_OPUSDECODER_H #define BLACKSOUND_CODECS_OPUSDECODER_H -#include "blacksound/blacksoundexport.h" +#include "sound/swiftsoundexport.h" #include "opus/opus.h" #include -namespace BlackSound::Codecs +namespace swift::sound::codecs { //! OPUS decoder - class BLACKSOUND_EXPORT COpusDecoder + class SWIFT_SOUND_EXPORT COpusDecoder { public: //! Ctor diff --git a/src/blacksound/codecs/opusencoder.cpp b/src/sound/codecs/opusencoder.cpp similarity index 97% rename from src/blacksound/codecs/opusencoder.cpp rename to src/sound/codecs/opusencoder.cpp index a54a246d4..63768fdc0 100644 --- a/src/blacksound/codecs/opusencoder.cpp +++ b/src/sound/codecs/opusencoder.cpp @@ -3,7 +3,7 @@ #include "opusencoder.h" -namespace BlackSound::Codecs +namespace swift::sound::codecs { COpusEncoder::COpusEncoder(int sampleRate, int channels, int application) { diff --git a/src/blacksound/codecs/opusencoder.h b/src/sound/codecs/opusencoder.h similarity index 90% rename from src/blacksound/codecs/opusencoder.h rename to src/sound/codecs/opusencoder.h index 63c1eb254..d94b26698 100644 --- a/src/blacksound/codecs/opusencoder.h +++ b/src/sound/codecs/opusencoder.h @@ -7,15 +7,15 @@ #define BLACKSOUND_CODECS_OPUSENCODER_H #include "opus/opus.h" -#include "blacksound/blacksoundexport.h" +#include "sound/swiftsoundexport.h" #include #include -namespace BlackSound::Codecs +namespace swift::sound::codecs { //! OPUS encoder - class BLACKSOUND_EXPORT COpusEncoder + class SWIFT_SOUND_EXPORT COpusEncoder { public: //! Ctor diff --git a/src/blacksound/dsp/SimpleComp.cpp b/src/sound/dsp/SimpleComp.cpp similarity index 100% rename from src/blacksound/dsp/SimpleComp.cpp rename to src/sound/dsp/SimpleComp.cpp diff --git a/src/blacksound/dsp/SimpleComp.cpp.license b/src/sound/dsp/SimpleComp.cpp.license similarity index 100% rename from src/blacksound/dsp/SimpleComp.cpp.license rename to src/sound/dsp/SimpleComp.cpp.license diff --git a/src/blacksound/dsp/SimpleComp.h b/src/sound/dsp/SimpleComp.h similarity index 100% rename from src/blacksound/dsp/SimpleComp.h rename to src/sound/dsp/SimpleComp.h diff --git a/src/blacksound/dsp/SimpleComp.h.license b/src/sound/dsp/SimpleComp.h.license similarity index 100% rename from src/blacksound/dsp/SimpleComp.h.license rename to src/sound/dsp/SimpleComp.h.license diff --git a/src/blacksound/dsp/SimpleCompProcess.inl b/src/sound/dsp/SimpleCompProcess.inl similarity index 100% rename from src/blacksound/dsp/SimpleCompProcess.inl rename to src/sound/dsp/SimpleCompProcess.inl diff --git a/src/blacksound/dsp/SimpleCompProcess.inl.license b/src/sound/dsp/SimpleCompProcess.inl.license similarity index 100% rename from src/blacksound/dsp/SimpleCompProcess.inl.license rename to src/sound/dsp/SimpleCompProcess.inl.license diff --git a/src/blacksound/dsp/SimpleEnvelope.cpp b/src/sound/dsp/SimpleEnvelope.cpp similarity index 100% rename from src/blacksound/dsp/SimpleEnvelope.cpp rename to src/sound/dsp/SimpleEnvelope.cpp diff --git a/src/blacksound/dsp/SimpleEnvelope.cpp.license b/src/sound/dsp/SimpleEnvelope.cpp.license similarity index 100% rename from src/blacksound/dsp/SimpleEnvelope.cpp.license rename to src/sound/dsp/SimpleEnvelope.cpp.license diff --git a/src/blacksound/dsp/SimpleEnvelope.h b/src/sound/dsp/SimpleEnvelope.h similarity index 100% rename from src/blacksound/dsp/SimpleEnvelope.h rename to src/sound/dsp/SimpleEnvelope.h diff --git a/src/blacksound/dsp/SimpleEnvelope.h.license b/src/sound/dsp/SimpleEnvelope.h.license similarity index 100% rename from src/blacksound/dsp/SimpleEnvelope.h.license rename to src/sound/dsp/SimpleEnvelope.h.license diff --git a/src/blacksound/dsp/SimpleGain.h b/src/sound/dsp/SimpleGain.h similarity index 100% rename from src/blacksound/dsp/SimpleGain.h rename to src/sound/dsp/SimpleGain.h diff --git a/src/blacksound/dsp/SimpleGain.h.license b/src/sound/dsp/SimpleGain.h.license similarity index 100% rename from src/blacksound/dsp/SimpleGain.h.license rename to src/sound/dsp/SimpleGain.h.license diff --git a/src/blacksound/dsp/SimpleGate.cpp b/src/sound/dsp/SimpleGate.cpp similarity index 100% rename from src/blacksound/dsp/SimpleGate.cpp rename to src/sound/dsp/SimpleGate.cpp diff --git a/src/blacksound/dsp/SimpleGate.cpp.license b/src/sound/dsp/SimpleGate.cpp.license similarity index 100% rename from src/blacksound/dsp/SimpleGate.cpp.license rename to src/sound/dsp/SimpleGate.cpp.license diff --git a/src/blacksound/dsp/SimpleGate.h b/src/sound/dsp/SimpleGate.h similarity index 100% rename from src/blacksound/dsp/SimpleGate.h rename to src/sound/dsp/SimpleGate.h diff --git a/src/blacksound/dsp/SimpleGate.h.license b/src/sound/dsp/SimpleGate.h.license similarity index 100% rename from src/blacksound/dsp/SimpleGate.h.license rename to src/sound/dsp/SimpleGate.h.license diff --git a/src/blacksound/dsp/SimpleGateProcess.inl b/src/sound/dsp/SimpleGateProcess.inl similarity index 100% rename from src/blacksound/dsp/SimpleGateProcess.inl rename to src/sound/dsp/SimpleGateProcess.inl diff --git a/src/blacksound/dsp/SimpleGateProcess.inl.license b/src/sound/dsp/SimpleGateProcess.inl.license similarity index 100% rename from src/blacksound/dsp/SimpleGateProcess.inl.license rename to src/sound/dsp/SimpleGateProcess.inl.license diff --git a/src/blacksound/dsp/SimpleHeader.h b/src/sound/dsp/SimpleHeader.h similarity index 100% rename from src/blacksound/dsp/SimpleHeader.h rename to src/sound/dsp/SimpleHeader.h diff --git a/src/blacksound/dsp/SimpleHeader.h.license b/src/sound/dsp/SimpleHeader.h.license similarity index 100% rename from src/blacksound/dsp/SimpleHeader.h.license rename to src/sound/dsp/SimpleHeader.h.license diff --git a/src/blacksound/dsp/SimpleLimit.cpp b/src/sound/dsp/SimpleLimit.cpp similarity index 100% rename from src/blacksound/dsp/SimpleLimit.cpp rename to src/sound/dsp/SimpleLimit.cpp diff --git a/src/blacksound/dsp/SimpleLimit.cpp.license b/src/sound/dsp/SimpleLimit.cpp.license similarity index 100% rename from src/blacksound/dsp/SimpleLimit.cpp.license rename to src/sound/dsp/SimpleLimit.cpp.license diff --git a/src/blacksound/dsp/SimpleLimit.h b/src/sound/dsp/SimpleLimit.h similarity index 100% rename from src/blacksound/dsp/SimpleLimit.h rename to src/sound/dsp/SimpleLimit.h diff --git a/src/blacksound/dsp/SimpleLimit.h.license b/src/sound/dsp/SimpleLimit.h.license similarity index 100% rename from src/blacksound/dsp/SimpleLimit.h.license rename to src/sound/dsp/SimpleLimit.h.license diff --git a/src/blacksound/dsp/SimpleLimitProcess.inl b/src/sound/dsp/SimpleLimitProcess.inl similarity index 100% rename from src/blacksound/dsp/SimpleLimitProcess.inl rename to src/sound/dsp/SimpleLimitProcess.inl diff --git a/src/blacksound/dsp/SimpleLimitProcess.inl.license b/src/sound/dsp/SimpleLimitProcess.inl.license similarity index 100% rename from src/blacksound/dsp/SimpleLimitProcess.inl.license rename to src/sound/dsp/SimpleLimitProcess.inl.license diff --git a/src/blacksound/dsp/biquadfilter.cpp b/src/sound/dsp/biquadfilter.cpp similarity index 99% rename from src/blacksound/dsp/biquadfilter.cpp rename to src/sound/dsp/biquadfilter.cpp index 6026537a0..e315fac3b 100644 --- a/src/blacksound/dsp/biquadfilter.cpp +++ b/src/sound/dsp/biquadfilter.cpp @@ -11,7 +11,7 @@ using namespace BlackMisc; using namespace swift::config; -namespace BlackSound::Dsp +namespace swift::sound::dsp { float BiQuadFilter::transform(float inSample) { diff --git a/src/blacksound/dsp/biquadfilter.h b/src/sound/dsp/biquadfilter.h similarity index 95% rename from src/blacksound/dsp/biquadfilter.h rename to src/sound/dsp/biquadfilter.h index 8e70cde8b..9115c52b4 100644 --- a/src/blacksound/dsp/biquadfilter.h +++ b/src/sound/dsp/biquadfilter.h @@ -6,9 +6,9 @@ #ifndef BLACKSOUND_DSP_BIQUADFILTER_H #define BLACKSOUND_DSP_BIQUADFILTER_H -#include "blacksound/blacksoundexport.h" +#include "sound/swiftsoundexport.h" -namespace BlackSound::Dsp +namespace swift::sound::dsp { //! Digital biquad filter class BiQuadFilter diff --git a/src/blacksound/notificationplayer.cpp b/src/sound/notificationplayer.cpp similarity index 97% rename from src/blacksound/notificationplayer.cpp rename to src/sound/notificationplayer.cpp index fa2b85205..fae2ef9f1 100644 --- a/src/blacksound/notificationplayer.cpp +++ b/src/sound/notificationplayer.cpp @@ -4,14 +4,14 @@ #include "notificationplayer.h" #include "blackmisc/logmessage.h" #include "blackmisc/swiftdirectories.h" -#include "blacksound/sampleprovider/samples.h" +#include "sound/sampleprovider/samples.h" #include using namespace BlackMisc; using namespace BlackMisc::Audio; -using namespace BlackSound::SampleProvider; +using namespace swift::sound::sample_provider; -namespace BlackSound +namespace swift::sound { CNotificationPlayer::CNotificationPlayer(QObject *parent) : QObject(parent) { diff --git a/src/blacksound/notificationplayer.h b/src/sound/notificationplayer.h similarity index 91% rename from src/blacksound/notificationplayer.h rename to src/sound/notificationplayer.h index e29d4d096..b3daa12e8 100644 --- a/src/blacksound/notificationplayer.h +++ b/src/sound/notificationplayer.h @@ -6,7 +6,7 @@ #ifndef BLACKSOUND_NOTIFICATIONPLAYER_H #define BLACKSOUND_NOTIFICATIONPLAYER_H -#include "blacksound/blacksoundexport.h" +#include "sound/swiftsoundexport.h" #include "blackmisc/audio/notificationsounds.h" #include @@ -14,10 +14,10 @@ #include #include -namespace BlackSound +namespace swift::sound { //! Player for notification sounds - class BLACKSOUND_EXPORT CNotificationPlayer : public QObject + class SWIFT_SOUND_EXPORT CNotificationPlayer : public QObject { Q_OBJECT diff --git a/src/blacksound/sampleprovider/bufferedwaveprovider.cpp b/src/sound/sampleprovider/bufferedwaveprovider.cpp similarity index 90% rename from src/blacksound/sampleprovider/bufferedwaveprovider.cpp rename to src/sound/sampleprovider/bufferedwaveprovider.cpp index 7d13b5b5b..a39a5ce30 100644 --- a/src/blacksound/sampleprovider/bufferedwaveprovider.cpp +++ b/src/sound/sampleprovider/bufferedwaveprovider.cpp @@ -2,15 +2,15 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 #include "bufferedwaveprovider.h" -#include "blacksound/audioutilities.h" +#include "sound/audioutilities.h" #include -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { CBufferedWaveProvider::CBufferedWaveProvider(const QAudioFormat &format, QObject *parent) : ISampleProvider(parent) { - const QString on = QStringLiteral("%1 format: '%2'").arg(this->metaObject()->className(), BlackSound::toQString(format)); + const QString on = QStringLiteral("%1 format: '%2'").arg(this->metaObject()->className(), swift::sound::toQString(format)); this->setObjectName(on); // Set buffer size to 10 secs diff --git a/src/blacksound/sampleprovider/bufferedwaveprovider.h b/src/sound/sampleprovider/bufferedwaveprovider.h similarity index 82% rename from src/blacksound/sampleprovider/bufferedwaveprovider.h rename to src/sound/sampleprovider/bufferedwaveprovider.h index 6ce3eb98c..258f7fa3e 100644 --- a/src/blacksound/sampleprovider/bufferedwaveprovider.h +++ b/src/sound/sampleprovider/bufferedwaveprovider.h @@ -6,17 +6,17 @@ #ifndef BLACKSOUND_BUFFEREDWAVEPROVIDER_H #define BLACKSOUND_BUFFEREDWAVEPROVIDER_H -#include "blacksound/blacksoundexport.h" -#include "blacksound/sampleprovider/sampleprovider.h" +#include "sound/swiftsoundexport.h" +#include "sound/sampleprovider/sampleprovider.h" #include #include #include -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { //! Buffered wave generator - class BLACKSOUND_EXPORT CBufferedWaveProvider : public ISampleProvider + class SWIFT_SOUND_EXPORT CBufferedWaveProvider : public ISampleProvider { Q_OBJECT diff --git a/src/blacksound/sampleprovider/equalizersampleprovider.cpp b/src/sound/sampleprovider/equalizersampleprovider.cpp similarity index 94% rename from src/blacksound/sampleprovider/equalizersampleprovider.cpp rename to src/sound/sampleprovider/equalizersampleprovider.cpp index fe4b4065d..e12f76eed 100644 --- a/src/blacksound/sampleprovider/equalizersampleprovider.cpp +++ b/src/sound/sampleprovider/equalizersampleprovider.cpp @@ -2,12 +2,12 @@ // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1 #include "equalizersampleprovider.h" -#include "blacksound/audioutilities.h" +#include "sound/audioutilities.h" #include -using namespace BlackSound::Dsp; +using namespace swift::sound::dsp; -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { CEqualizerSampleProvider::CEqualizerSampleProvider(ISampleProvider *sourceProvider, EqualizerPresets preset, QObject *parent) : ISampleProvider(parent) { diff --git a/src/blacksound/sampleprovider/equalizersampleprovider.h b/src/sound/sampleprovider/equalizersampleprovider.h similarity index 80% rename from src/blacksound/sampleprovider/equalizersampleprovider.h rename to src/sound/sampleprovider/equalizersampleprovider.h index 39261160c..a4777e2e3 100644 --- a/src/blacksound/sampleprovider/equalizersampleprovider.h +++ b/src/sound/sampleprovider/equalizersampleprovider.h @@ -6,14 +6,14 @@ #ifndef BLACKSOUND_SAMPLEPROVIDER_EQUALIZERSAMPLEPROVIDER_H #define BLACKSOUND_SAMPLEPROVIDER_EQUALIZERSAMPLEPROVIDER_H -#include "blacksound/blacksoundexport.h" -#include "blacksound/sampleprovider/sampleprovider.h" -#include "blacksound/dsp/biquadfilter.h" +#include "sound/swiftsoundexport.h" +#include "sound/sampleprovider/sampleprovider.h" +#include "sound/dsp/biquadfilter.h" #include #include -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { //! Equalizer enum EqualizerPresets @@ -22,7 +22,7 @@ namespace BlackSound::SampleProvider }; //! Equalizer - class BLACKSOUND_EXPORT CEqualizerSampleProvider : public ISampleProvider + class SWIFT_SOUND_EXPORT CEqualizerSampleProvider : public ISampleProvider { Q_OBJECT @@ -49,7 +49,7 @@ namespace BlackSound::SampleProvider int m_channels = 1; bool m_bypass = false; double m_outputGain = 1.0; - QVector m_filters; + QVector m_filters; }; } // ns diff --git a/src/blacksound/sampleprovider/mixingsampleprovider.cpp b/src/sound/sampleprovider/mixingsampleprovider.cpp similarity index 97% rename from src/blacksound/sampleprovider/mixingsampleprovider.cpp rename to src/sound/sampleprovider/mixingsampleprovider.cpp index 63b4a46bf..34112cc59 100644 --- a/src/blacksound/sampleprovider/mixingsampleprovider.cpp +++ b/src/sound/sampleprovider/mixingsampleprovider.cpp @@ -6,7 +6,7 @@ using namespace BlackMisc; -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { CMixingSampleProvider::CMixingSampleProvider(QObject *parent) : ISampleProvider(parent) { diff --git a/src/blacksound/sampleprovider/mixingsampleprovider.h b/src/sound/sampleprovider/mixingsampleprovider.h similarity index 77% rename from src/blacksound/sampleprovider/mixingsampleprovider.h rename to src/sound/sampleprovider/mixingsampleprovider.h index 8e0c57104..987f62910 100644 --- a/src/blacksound/sampleprovider/mixingsampleprovider.h +++ b/src/sound/sampleprovider/mixingsampleprovider.h @@ -6,15 +6,15 @@ #ifndef MIXINGSAMPLEPROVIDER_H #define MIXINGSAMPLEPROVIDER_H -#include "blacksound/blacksoundexport.h" -#include "blacksound/sampleprovider/sampleprovider.h" +#include "sound/swiftsoundexport.h" +#include "sound/sampleprovider/sampleprovider.h" #include #include -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { //! Mixer - class BLACKSOUND_EXPORT CMixingSampleProvider : public ISampleProvider + class SWIFT_SOUND_EXPORT CMixingSampleProvider : public ISampleProvider { public: //! Ctor mixing provider diff --git a/src/blacksound/sampleprovider/pinknoisegenerator.cpp b/src/sound/sampleprovider/pinknoisegenerator.cpp similarity index 97% rename from src/blacksound/sampleprovider/pinknoisegenerator.cpp rename to src/sound/sampleprovider/pinknoisegenerator.cpp index 8199b71d0..41f23f54b 100644 --- a/src/blacksound/sampleprovider/pinknoisegenerator.cpp +++ b/src/sound/sampleprovider/pinknoisegenerator.cpp @@ -5,7 +5,7 @@ #include "pinknoisegenerator.h" -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { int CPinkNoiseGenerator::readSamples(QVector &samples, qint64 count) { diff --git a/src/blacksound/sampleprovider/pinknoisegenerator.h b/src/sound/sampleprovider/pinknoisegenerator.h similarity index 80% rename from src/blacksound/sampleprovider/pinknoisegenerator.h rename to src/sound/sampleprovider/pinknoisegenerator.h index d952e1f4a..5ecb797a8 100644 --- a/src/blacksound/sampleprovider/pinknoisegenerator.h +++ b/src/sound/sampleprovider/pinknoisegenerator.h @@ -6,18 +6,18 @@ #ifndef PINKNOISEGENERATOR_H #define PINKNOISEGENERATOR_H -#include "blacksound/blacksoundexport.h" -#include "blacksound/sampleprovider/sampleprovider.h" +#include "sound/swiftsoundexport.h" +#include "sound/sampleprovider/sampleprovider.h" #include #include #include -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { //! Pink noise generator - class BLACKSOUND_EXPORT CPinkNoiseGenerator : public ISampleProvider + class SWIFT_SOUND_EXPORT CPinkNoiseGenerator : public ISampleProvider { Q_OBJECT diff --git a/src/blacksound/sampleprovider/resourcesound.cpp b/src/sound/sampleprovider/resourcesound.cpp similarity index 93% rename from src/blacksound/sampleprovider/resourcesound.cpp rename to src/sound/sampleprovider/resourcesound.cpp index 8d093f9d4..6ba6faa79 100644 --- a/src/blacksound/sampleprovider/resourcesound.cpp +++ b/src/sound/sampleprovider/resourcesound.cpp @@ -4,15 +4,15 @@ //! \file #include "resourcesound.h" -#include "blacksound/audioutilities.h" +#include "sound/audioutilities.h" #include "blackmisc/fileutils.h" #include "blackmisc/stringutils.h" #include using namespace BlackMisc; -using namespace BlackSound::Wav; +using namespace swift::sound::wav; -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { CResourceSound::CResourceSound() : m_data(new CResourceSoundData) { diff --git a/src/blacksound/sampleprovider/resourcesound.h b/src/sound/sampleprovider/resourcesound.h similarity index 92% rename from src/blacksound/sampleprovider/resourcesound.h rename to src/sound/sampleprovider/resourcesound.h index dfcd441f7..41de6a56b 100644 --- a/src/blacksound/sampleprovider/resourcesound.h +++ b/src/sound/sampleprovider/resourcesound.h @@ -6,8 +6,8 @@ #ifndef BLACKSOUND_SAMPLEPROVIDER_RESOURCESOUND_H #define BLACKSOUND_SAMPLEPROVIDER_RESOURCESOUND_H -#include "blacksound/blacksoundexport.h" -#include "blacksound/wav/wavfile.h" +#include "sound/swiftsoundexport.h" +#include "sound/wav/wavfile.h" #include "blackmisc/worker.h" #include @@ -15,7 +15,7 @@ #include #include -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { //! CResourceSound shared data struct CResourceSoundData : public QSharedData diff --git a/src/blacksound/sampleprovider/resourcesoundsampleprovider.cpp b/src/sound/sampleprovider/resourcesoundsampleprovider.cpp similarity index 98% rename from src/blacksound/sampleprovider/resourcesoundsampleprovider.cpp rename to src/sound/sampleprovider/resourcesoundsampleprovider.cpp index ab9e14715..d7b6dee3b 100644 --- a/src/blacksound/sampleprovider/resourcesoundsampleprovider.cpp +++ b/src/sound/sampleprovider/resourcesoundsampleprovider.cpp @@ -8,7 +8,7 @@ using namespace BlackMisc; -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { CResourceSoundSampleProvider::CResourceSoundSampleProvider(const CResourceSound &resourceSound, QObject *parent) : ISampleProvider(parent), m_resourceSound(resourceSound) diff --git a/src/blacksound/sampleprovider/resourcesoundsampleprovider.h b/src/sound/sampleprovider/resourcesoundsampleprovider.h similarity index 84% rename from src/blacksound/sampleprovider/resourcesoundsampleprovider.h rename to src/sound/sampleprovider/resourcesoundsampleprovider.h index 0181588bc..9c0446785 100644 --- a/src/blacksound/sampleprovider/resourcesoundsampleprovider.h +++ b/src/sound/sampleprovider/resourcesoundsampleprovider.h @@ -4,14 +4,14 @@ #ifndef BLACKSOUND_SAMPLEPROVIDER_RESOURCESOUNDSAMPLEPROVIDER_H #define BLACKSOUND_SAMPLEPROVIDER_RESOURCESOUNDSAMPLEPROVIDER_H -#include "blacksound/blacksoundexport.h" -#include "blacksound/sampleprovider/sampleprovider.h" -#include "blacksound/sampleprovider/resourcesound.h" +#include "sound/swiftsoundexport.h" +#include "sound/sampleprovider/sampleprovider.h" +#include "sound/sampleprovider/resourcesound.h" -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { //! A sample provider - class BLACKSOUND_EXPORT CResourceSoundSampleProvider : public ISampleProvider + class SWIFT_SOUND_EXPORT CResourceSoundSampleProvider : public ISampleProvider { Q_OBJECT diff --git a/src/blacksound/sampleprovider/sampleprovider.h b/src/sound/sampleprovider/sampleprovider.h similarity index 86% rename from src/blacksound/sampleprovider/sampleprovider.h rename to src/sound/sampleprovider/sampleprovider.h index fa3e033de..d3d60e781 100644 --- a/src/blacksound/sampleprovider/sampleprovider.h +++ b/src/sound/sampleprovider/sampleprovider.h @@ -7,14 +7,14 @@ #define BLACKSOUND_SAMPLEPROVIDER_H #include "config/buildconfig.h" -#include "blacksound/blacksoundexport.h" +#include "sound/swiftsoundexport.h" #include #include -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { //! Sample provider interface - class BLACKSOUND_EXPORT ISampleProvider : public QObject + class SWIFT_SOUND_EXPORT ISampleProvider : public QObject { Q_OBJECT diff --git a/src/blacksound/sampleprovider/samples.cpp b/src/sound/sampleprovider/samples.cpp similarity index 97% rename from src/blacksound/sampleprovider/samples.cpp rename to src/sound/sampleprovider/samples.cpp index dba9f022c..47bd6a109 100644 --- a/src/blacksound/sampleprovider/samples.cpp +++ b/src/sound/sampleprovider/samples.cpp @@ -8,7 +8,7 @@ using namespace BlackMisc; using namespace BlackMisc::Audio; -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { const Samples &Samples::instance() { diff --git a/src/blacksound/sampleprovider/samples.h b/src/sound/sampleprovider/samples.h similarity index 92% rename from src/blacksound/sampleprovider/samples.h rename to src/sound/sampleprovider/samples.h index 18f653325..d2a2dd6e8 100644 --- a/src/blacksound/sampleprovider/samples.h +++ b/src/sound/sampleprovider/samples.h @@ -8,15 +8,15 @@ #include "blackmisc/audio/audiosettings.h" #include "blackmisc/settingscache.h" -#include "blacksound/blacksoundexport.h" -#include "blacksound/sampleprovider/resourcesound.h" +#include "sound/swiftsoundexport.h" +#include "sound/sampleprovider/resourcesound.h" #include -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { //! Sound samples from resources (wav files) - class BLACKSOUND_EXPORT Samples : public QObject + class SWIFT_SOUND_EXPORT Samples : public QObject { public: //! Singleton diff --git a/src/blacksound/sampleprovider/sawtoothgenerator.cpp b/src/sound/sampleprovider/sawtoothgenerator.cpp similarity index 96% rename from src/blacksound/sampleprovider/sawtoothgenerator.cpp rename to src/sound/sampleprovider/sawtoothgenerator.cpp index 5c621058b..9094b1e7f 100644 --- a/src/blacksound/sampleprovider/sawtoothgenerator.cpp +++ b/src/sound/sampleprovider/sawtoothgenerator.cpp @@ -4,7 +4,7 @@ #include "sawtoothgenerator.h" #include -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { CSawToothGenerator::CSawToothGenerator(double frequency, QObject *parent) : ISampleProvider(parent), m_frequency(frequency) diff --git a/src/blacksound/sampleprovider/sawtoothgenerator.h b/src/sound/sampleprovider/sawtoothgenerator.h similarity index 81% rename from src/blacksound/sampleprovider/sawtoothgenerator.h rename to src/sound/sampleprovider/sawtoothgenerator.h index a9a8d9d5c..8ed5e4c25 100644 --- a/src/blacksound/sampleprovider/sawtoothgenerator.h +++ b/src/sound/sampleprovider/sawtoothgenerator.h @@ -6,16 +6,16 @@ #ifndef BLACKSOUND_SAMPLEPROVIDER_SAWTOOTHGENERATOR_H #define BLACKSOUND_SAMPLEPROVIDER_SAWTOOTHGENERATOR_H -#include "blacksound/blacksoundexport.h" -#include "blacksound/sampleprovider/sampleprovider.h" +#include "sound/swiftsoundexport.h" +#include "sound/sampleprovider/sampleprovider.h" #include #include #include -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { //! Saw tooth generator - class BLACKSOUND_EXPORT CSawToothGenerator : public ISampleProvider + class SWIFT_SOUND_EXPORT CSawToothGenerator : public ISampleProvider { Q_OBJECT diff --git a/src/blacksound/sampleprovider/simplecompressoreffect.cpp b/src/sound/sampleprovider/simplecompressoreffect.cpp similarity index 98% rename from src/blacksound/sampleprovider/simplecompressoreffect.cpp rename to src/sound/sampleprovider/simplecompressoreffect.cpp index 95b5bd53d..fedaece04 100644 --- a/src/blacksound/sampleprovider/simplecompressoreffect.cpp +++ b/src/sound/sampleprovider/simplecompressoreffect.cpp @@ -4,7 +4,7 @@ #include "simplecompressoreffect.h" #include -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { CSimpleCompressorEffect::CSimpleCompressorEffect(ISampleProvider *source, QObject *parent) : ISampleProvider(parent), m_sourceStream(source) diff --git a/src/blacksound/sampleprovider/simplecompressoreffect.h b/src/sound/sampleprovider/simplecompressoreffect.h similarity index 81% rename from src/blacksound/sampleprovider/simplecompressoreffect.h rename to src/sound/sampleprovider/simplecompressoreffect.h index 0f0f25b61..de450e8ad 100644 --- a/src/blacksound/sampleprovider/simplecompressoreffect.h +++ b/src/sound/sampleprovider/simplecompressoreffect.h @@ -6,17 +6,17 @@ #ifndef BLACKSOUND_SAMPLEPROVIDER_SIMPLECOMPRESSOREFFECT_H #define BLACKSOUND_SAMPLEPROVIDER_SIMPLECOMPRESSOREFFECT_H -#include "blacksound/blacksoundexport.h" -#include "blacksound/sampleprovider/sampleprovider.h" -#include "blacksound/dsp/SimpleComp.h" +#include "sound/swiftsoundexport.h" +#include "sound/sampleprovider/sampleprovider.h" +#include "sound/dsp/SimpleComp.h" #include #include -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { //! Compressor effect - class BLACKSOUND_EXPORT CSimpleCompressorEffect : public ISampleProvider + class SWIFT_SOUND_EXPORT CSimpleCompressorEffect : public ISampleProvider { Q_OBJECT diff --git a/src/blacksound/sampleprovider/sinusgenerator.cpp b/src/sound/sampleprovider/sinusgenerator.cpp similarity index 96% rename from src/blacksound/sampleprovider/sinusgenerator.cpp rename to src/sound/sampleprovider/sinusgenerator.cpp index 943367606..c2341eee1 100644 --- a/src/blacksound/sampleprovider/sinusgenerator.cpp +++ b/src/sound/sampleprovider/sinusgenerator.cpp @@ -7,7 +7,7 @@ using namespace BlackMisc; -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { CSinusGenerator::CSinusGenerator(double frequencyHz, QObject *parent) : ISampleProvider(parent), m_frequencyHz(frequencyHz) diff --git a/src/blacksound/sampleprovider/sinusgenerator.h b/src/sound/sampleprovider/sinusgenerator.h similarity index 82% rename from src/blacksound/sampleprovider/sinusgenerator.h rename to src/sound/sampleprovider/sinusgenerator.h index 1fe5e1acb..9779d5922 100644 --- a/src/blacksound/sampleprovider/sinusgenerator.h +++ b/src/sound/sampleprovider/sinusgenerator.h @@ -6,15 +6,15 @@ #ifndef BLACKSOUND_SAMPLEPROVIDER_SINUSGENERATOR_H #define BLACKSOUND_SAMPLEPROVIDER_SINUSGENERATOR_H -#include "blacksound/blacksoundexport.h" -#include "blacksound/sampleprovider/sampleprovider.h" +#include "sound/swiftsoundexport.h" +#include "sound/sampleprovider/sampleprovider.h" #include -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { //! Saw tooth generator - class BLACKSOUND_EXPORT CSinusGenerator : public ISampleProvider + class SWIFT_SOUND_EXPORT CSinusGenerator : public ISampleProvider { Q_OBJECT diff --git a/src/blacksound/sampleprovider/volumesampleprovider.cpp b/src/sound/sampleprovider/volumesampleprovider.cpp similarity index 97% rename from src/blacksound/sampleprovider/volumesampleprovider.cpp rename to src/sound/sampleprovider/volumesampleprovider.cpp index 32f52347e..3c62dac5b 100644 --- a/src/blacksound/sampleprovider/volumesampleprovider.cpp +++ b/src/sound/sampleprovider/volumesampleprovider.cpp @@ -8,7 +8,7 @@ using namespace BlackMisc; -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { CVolumeSampleProvider::CVolumeSampleProvider(ISampleProvider *sourceProvider, QObject *parent) : ISampleProvider(parent), m_sourceProvider(sourceProvider) diff --git a/src/blacksound/sampleprovider/volumesampleprovider.h b/src/sound/sampleprovider/volumesampleprovider.h similarity index 86% rename from src/blacksound/sampleprovider/volumesampleprovider.h rename to src/sound/sampleprovider/volumesampleprovider.h index ba1026cdc..7feac5e7f 100644 --- a/src/blacksound/sampleprovider/volumesampleprovider.h +++ b/src/sound/sampleprovider/volumesampleprovider.h @@ -6,13 +6,13 @@ #ifndef BLACKSOUND_SAMPLEPROVIDER_VOLUMESAMPLEPROVIDER_H #define BLACKSOUND_SAMPLEPROVIDER_VOLUMESAMPLEPROVIDER_H -#include "blacksound/blacksoundexport.h" -#include "blacksound/sampleprovider/sampleprovider.h" +#include "sound/swiftsoundexport.h" +#include "sound/sampleprovider/sampleprovider.h" -namespace BlackSound::SampleProvider +namespace swift::sound::sample_provider { //! Pink noise generator - class BLACKSOUND_EXPORT CVolumeSampleProvider : public ISampleProvider + class SWIFT_SOUND_EXPORT CVolumeSampleProvider : public ISampleProvider { Q_OBJECT diff --git a/src/blacksound/selcalplayer.cpp b/src/sound/selcalplayer.cpp similarity index 98% rename from src/blacksound/selcalplayer.cpp rename to src/sound/selcalplayer.cpp index af0ef6789..ed6c5653e 100644 --- a/src/blacksound/selcalplayer.cpp +++ b/src/sound/selcalplayer.cpp @@ -9,7 +9,7 @@ using namespace BlackMisc::Audio; using namespace BlackMisc::Aviation; using namespace BlackMisc::PhysicalQuantities; -namespace BlackSound +namespace swift::sound { CSelcalPlayer::CSelcalPlayer(const CAudioDeviceInfo &device, QObject *parent) : QObject(parent), diff --git a/src/blacksound/selcalplayer.h b/src/sound/selcalplayer.h similarity index 82% rename from src/blacksound/selcalplayer.h rename to src/sound/selcalplayer.h index 87f300844..5ff66a9ca 100644 --- a/src/blacksound/selcalplayer.h +++ b/src/sound/selcalplayer.h @@ -6,17 +6,17 @@ #ifndef BLACKSOUND_SELCALPLAYER_H #define BLACKSOUND_SELCALPLAYER_H -#include "blacksound/threadedtonepairplayer.h" -#include "blacksound/tonepair.h" -#include "blacksound/blacksoundexport.h" +#include "sound/threadedtonepairplayer.h" +#include "sound/tonepair.h" +#include "sound/swiftsoundexport.h" #include "blackmisc/audio/audiodeviceinfo.h" #include "blackmisc/aviation/selcal.h" #include "blackmisc/worker.h" -namespace BlackSound +namespace swift::sound { //! SELCAL player - class BLACKSOUND_EXPORT CSelcalPlayer : public QObject + class SWIFT_SOUND_EXPORT CSelcalPlayer : public QObject { Q_OBJECT diff --git a/src/blacksound/share/sounds/afv_click_f32.wav b/src/sound/share/sounds/afv_click_f32.wav similarity index 100% rename from src/blacksound/share/sounds/afv_click_f32.wav rename to src/sound/share/sounds/afv_click_f32.wav diff --git a/src/blacksound/share/sounds/afv_crackle_f32.wav b/src/sound/share/sounds/afv_crackle_f32.wav similarity index 100% rename from src/blacksound/share/sounds/afv_crackle_f32.wav rename to src/sound/share/sounds/afv_crackle_f32.wav diff --git a/src/blacksound/share/sounds/afv_hf_whiteNoise_f32.wav b/src/sound/share/sounds/afv_hf_whiteNoise_f32.wav similarity index 100% rename from src/blacksound/share/sounds/afv_hf_whiteNoise_f32.wav rename to src/sound/share/sounds/afv_hf_whiteNoise_f32.wav diff --git a/src/blacksound/share/sounds/afv_whitenoise_f32.wav b/src/sound/share/sounds/afv_whitenoise_f32.wav similarity index 100% rename from src/blacksound/share/sounds/afv_whitenoise_f32.wav rename to src/sound/share/sounds/afv_whitenoise_f32.wav diff --git a/src/blacksound/share/sounds/callsignmentioned.wav b/src/sound/share/sounds/callsignmentioned.wav similarity index 100% rename from src/blacksound/share/sounds/callsignmentioned.wav rename to src/sound/share/sounds/callsignmentioned.wav diff --git a/src/blacksound/share/sounds/error.wav b/src/sound/share/sounds/error.wav similarity index 100% rename from src/blacksound/share/sounds/error.wav rename to src/sound/share/sounds/error.wav diff --git a/src/blacksound/share/sounds/frequencymessage.wav b/src/sound/share/sounds/frequencymessage.wav similarity index 100% rename from src/blacksound/share/sounds/frequencymessage.wav rename to src/sound/share/sounds/frequencymessage.wav diff --git a/src/blacksound/share/sounds/login.wav b/src/sound/share/sounds/login.wav similarity index 100% rename from src/blacksound/share/sounds/login.wav rename to src/sound/share/sounds/login.wav diff --git a/src/blacksound/share/sounds/logoff.wav b/src/sound/share/sounds/logoff.wav similarity index 100% rename from src/blacksound/share/sounds/logoff.wav rename to src/sound/share/sounds/logoff.wav diff --git a/src/blacksound/share/sounds/privatemessage.wav b/src/sound/share/sounds/privatemessage.wav similarity index 100% rename from src/blacksound/share/sounds/privatemessage.wav rename to src/sound/share/sounds/privatemessage.wav diff --git a/src/blacksound/share/sounds/pttclick.wav b/src/sound/share/sounds/pttclick.wav similarity index 100% rename from src/blacksound/share/sounds/pttclick.wav rename to src/sound/share/sounds/pttclick.wav diff --git a/src/blacksound/share/sounds/readme.txt b/src/sound/share/sounds/readme.txt similarity index 100% rename from src/blacksound/share/sounds/readme.txt rename to src/sound/share/sounds/readme.txt diff --git a/src/blacksound/share/sounds/supervisormessage.wav b/src/sound/share/sounds/supervisormessage.wav similarity index 100% rename from src/blacksound/share/sounds/supervisormessage.wav rename to src/sound/share/sounds/supervisormessage.wav diff --git a/src/blacksound/blacksoundexport.h b/src/sound/swiftsoundexport.h similarity index 67% rename from src/blacksound/blacksoundexport.h rename to src/sound/swiftsoundexport.h index ee1da7550..204a1b4aa 100644 --- a/src/blacksound/blacksoundexport.h +++ b/src/sound/swiftsoundexport.h @@ -9,18 +9,18 @@ #include /*! - * \def BLACKSOUND_EXPORT + * \def SWIFT_SOUND_EXPORT * Export a class or function from the library */ #ifndef WITH_STATIC -# if defined(BUILD_BLACKSOUND_LIB) -# define BLACKSOUND_EXPORT Q_DECL_EXPORT +# if defined(BUILD_SWIFT_SOUND_LIB) +# define SWIFT_SOUND_EXPORT Q_DECL_EXPORT # else -# define BLACKSOUND_EXPORT Q_DECL_IMPORT +# define SWIFT_SOUND_EXPORT Q_DECL_IMPORT # endif #else -# define BLACKSOUND_EXPORT +# define SWIFT_SOUND_EXPORT #endif #endif // guard diff --git a/src/blacksound/threadedtonepairplayer.cpp b/src/sound/threadedtonepairplayer.cpp similarity index 98% rename from src/blacksound/threadedtonepairplayer.cpp rename to src/sound/threadedtonepairplayer.cpp index a0410d628..8c6785118 100644 --- a/src/blacksound/threadedtonepairplayer.cpp +++ b/src/sound/threadedtonepairplayer.cpp @@ -3,15 +3,15 @@ #include "threadedtonepairplayer.h" #include "blackmisc/logmessage.h" -#include "blacksound/audioutilities.h" +#include "sound/audioutilities.h" #include using namespace BlackMisc; using namespace BlackMisc::Audio; -using namespace BlackSound; +using namespace swift::sound; -namespace BlackSound +namespace swift::sound { CThreadedTonePairPlayer::CThreadedTonePairPlayer(QObject *owner, const QString &name, const CAudioDeviceInfo &device) : CContinuousWorker(owner, name), diff --git a/src/blacksound/threadedtonepairplayer.h b/src/sound/threadedtonepairplayer.h similarity index 89% rename from src/blacksound/threadedtonepairplayer.h rename to src/sound/threadedtonepairplayer.h index cb17df4e2..e8c6d9500 100644 --- a/src/blacksound/threadedtonepairplayer.h +++ b/src/sound/threadedtonepairplayer.h @@ -6,8 +6,8 @@ #ifndef BLACKSOUND_THREADEDTONEPAIRPLAYER_H #define BLACKSOUND_THREADEDTONEPAIRPLAYER_H -#include "blacksound/blacksoundexport.h" -#include "blacksound/tonepair.h" +#include "sound/swiftsoundexport.h" +#include "sound/tonepair.h" #include "blackmisc/audio/audiodeviceinfo.h" #include "blackmisc/worker.h" @@ -21,10 +21,10 @@ class QTimer; -namespace BlackSound +namespace swift::sound { //! Threaded tone player. Don't use it directly but use \sa CSelcalPlayer instead. - class BLACKSOUND_EXPORT CThreadedTonePairPlayer : public BlackMisc::CContinuousWorker + class SWIFT_SOUND_EXPORT CThreadedTonePairPlayer : public BlackMisc::CContinuousWorker { Q_OBJECT @@ -37,7 +37,7 @@ namespace BlackSound //! Play the list of tones. //! If the player is currently active, this call will be ignored. - void play(int volume, const QList &tonePairs); + void play(int volume, const QList &tonePairs); //! Reinitialize audio bool reinitializeAudio(const BlackMisc::Audio::CAudioDeviceInfo &device); diff --git a/src/blacksound/tonepair.cpp b/src/sound/tonepair.cpp similarity index 97% rename from src/blacksound/tonepair.cpp rename to src/sound/tonepair.cpp index b0d4806eb..40b68e0a8 100644 --- a/src/blacksound/tonepair.cpp +++ b/src/sound/tonepair.cpp @@ -3,7 +3,7 @@ #include "tonepair.h" -namespace BlackSound +namespace swift::sound { CTonePair::CTonePair(const BlackMisc::PhysicalQuantities::CFrequency &frequency, const BlackMisc::PhysicalQuantities::CFrequency &secondaryFrequency, diff --git a/src/blacksound/tonepair.h b/src/sound/tonepair.h similarity index 93% rename from src/blacksound/tonepair.h rename to src/sound/tonepair.h index e9e5ed223..27ecc7b14 100644 --- a/src/blacksound/tonepair.h +++ b/src/sound/tonepair.h @@ -6,16 +6,16 @@ #ifndef BLACKSOUND_TONEPAIR_H #define BLACKSOUND_TONEPAIR_H -#include "blacksound/blacksoundexport.h" +#include "sound/swiftsoundexport.h" #include "blackmisc/pq/frequency.h" #include "blackmisc/pq/time.h" #include -namespace BlackSound +namespace swift::sound { //! Tone pair to be played - class BLACKSOUND_EXPORT CTonePair + class SWIFT_SOUND_EXPORT CTonePair { public: //! Play two tones with frequencies f for t milliseconds diff --git a/src/blacksound/wav/wavfile.cpp b/src/sound/wav/wavfile.cpp similarity index 99% rename from src/blacksound/wav/wavfile.cpp rename to src/sound/wav/wavfile.cpp index a8dba5e64..fe95a41ce 100644 --- a/src/blacksound/wav/wavfile.cpp +++ b/src/sound/wav/wavfile.cpp @@ -9,7 +9,7 @@ #include "wavfile.h" // #include "utils.h" -namespace BlackSound::Wav +namespace swift::sound::wav { //! WAV chunk struct chunk diff --git a/src/blacksound/wav/wavfile.h b/src/sound/wav/wavfile.h similarity index 97% rename from src/blacksound/wav/wavfile.h rename to src/sound/wav/wavfile.h index 38e0c7913..173d5c5ba 100644 --- a/src/blacksound/wav/wavfile.h +++ b/src/sound/wav/wavfile.h @@ -10,7 +10,7 @@ #include #include -namespace BlackSound::Wav +namespace swift::sound::wav { //! * WAV file class CWavFile : public QFile diff --git a/src/swiftguistandard/swiftguistdinit.cpp b/src/swiftguistandard/swiftguistdinit.cpp index e8a3898dd..4c509309a 100644 --- a/src/swiftguistandard/swiftguistdinit.cpp +++ b/src/swiftguistandard/swiftguistdinit.cpp @@ -26,7 +26,7 @@ #include "blackcore/context/contextnetwork.h" #include "blackcore/context/contextsimulator.h" #include "blackcore/context/contextaudio.h" -#include "blacksound/audioutilities.h" +#include "sound/audioutilities.h" #include "blackmisc/network/networkutils.h" #include "blackmisc/sharedstate/datalinkdbus.h" #include "blackmisc/loghandler.h" diff --git a/src/swiftlauncher/swiftlauncher.cpp b/src/swiftlauncher/swiftlauncher.cpp index 41b963f1b..4fe9b44e7 100644 --- a/src/swiftlauncher/swiftlauncher.cpp +++ b/src/swiftlauncher/swiftlauncher.cpp @@ -10,7 +10,7 @@ #include "blackgui/stylesheetutility.h" #include "blackcore/context/contextapplicationproxy.h" #include "blackcore/setupreader.h" -#include "blacksound/audioutilities.h" +#include "sound/audioutilities.h" #include "blackmisc/simulation/fscommon/fsdirectories.h" #include "blackcore/context/contextnetwork.h" #include "blackmisc/network/networkutils.h" @@ -42,7 +42,7 @@ using namespace BlackCore; using namespace BlackCore::Context; using namespace BlackCore::Data; using namespace BlackCore::Vatsim; -using namespace BlackSound; +using namespace swift::sound; using namespace BlackMisc; using namespace BlackMisc::Db; using namespace BlackMisc::Network;