mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 11:05:33 +08:00
Ref T730, code style, adding namespaces
This commit is contained in:
committed by
Mat Sutcliffe
parent
329b1e8c9a
commit
99edc9cb13
@@ -1,22 +1,39 @@
|
||||
/* Copyright (C) 2019
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated,
|
||||
* or distributed except according to the terms contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#include "resourcesound.h"
|
||||
#include "audioutilities.h"
|
||||
|
||||
ResourceSound::ResourceSound(const QString &audioFileName)
|
||||
{
|
||||
m_wavFile = new WavFile;
|
||||
m_wavFile->open(audioFileName);
|
||||
if (m_wavFile->fileFormat().sampleType() == QAudioFormat::Float)
|
||||
{
|
||||
m_samples = convertFloatBytesTo16BitPCM(m_wavFile->audioData());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_samples = convertBytesTo16BitPCM(m_wavFile->audioData());
|
||||
}
|
||||
using namespace BlackSound::Wav;
|
||||
|
||||
}
|
||||
|
||||
const QVector<qint16>& ResourceSound::audioData()
|
||||
namespace BlackSound
|
||||
{
|
||||
return m_samples;
|
||||
namespace SampleProvider
|
||||
{
|
||||
CResourceSound::CResourceSound(const QString &audioFileName)
|
||||
{
|
||||
m_wavFile = new WavFile;
|
||||
m_wavFile->open(audioFileName);
|
||||
if (m_wavFile->fileFormat().sampleType() == QAudioFormat::Float)
|
||||
{
|
||||
m_samples = convertFloatBytesTo16BitPCM(m_wavFile->audioData());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_samples = convertBytesTo16BitPCM(m_wavFile->audioData());
|
||||
}
|
||||
}
|
||||
|
||||
const QVector<qint16> &CResourceSound::audioData()
|
||||
{
|
||||
return m_samples;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user