diff options
author | Daniil Cherednik <dan.cherednik@gmail.com> | 2024-12-20 22:31:20 +0100 |
---|---|---|
committer | Daniil Cherednik <dan.cherednik@gmail.com> | 2024-12-21 16:30:07 +0100 |
commit | 74d6e04c21bddd435bd74c34dbe027b883772a76 (patch) | |
tree | 4221df9da5a17897296e5f7f841f01b1f6428c74 /src/platform/win/pcm_io/mf/pcm_io_mf.cpp | |
parent | 78649b2f5941e0649db960cafb2997b5ca432be1 (diff) | |
download | atracdenc-74d6e04c21bddd435bd74c34dbe027b883772a76.tar.gz |
[refactoring] Get rid of TFloat parameter. Use float.
Diffstat (limited to 'src/platform/win/pcm_io/mf/pcm_io_mf.cpp')
-rw-r--r-- | src/platform/win/pcm_io/mf/pcm_io_mf.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/platform/win/pcm_io/mf/pcm_io_mf.cpp b/src/platform/win/pcm_io/mf/pcm_io_mf.cpp index 3f9ff3a..a4e550b 100644 --- a/src/platform/win/pcm_io/mf/pcm_io_mf.cpp +++ b/src/platform/win/pcm_io/mf/pcm_io_mf.cpp @@ -69,8 +69,8 @@ static std::wstring Utf8ToMultiByte(const std::string& in) { } // TODO: add dither, noise shape? -static inline int16_t FloatToInt16(TFloat in) { - return std::min((int)INT16_MAX, std::max((int)INT16_MIN, (int)lrint(in * (TFloat)INT16_MAX))); +static inline int16_t FloatToInt16(float in) { + return std::min((int)INT16_MAX, std::max((int)INT16_MIN, (int)lrint(in * (float)INT16_MAX))); } static HRESULT WriteToFile(HANDLE hFile, void* p, DWORD cb) { @@ -350,7 +350,7 @@ public: return static_cast<size_t>(totalSamples); } - size_t Read(TPCMBuffer<TFloat>& buf, size_t sz) override { + size_t Read(TPCMBuffer& buf, size_t sz) override { HRESULT hr = S_OK; const size_t sizeBytes = sz * BytesPerSample_; @@ -447,7 +447,7 @@ public: return curPos; } - size_t Write(const TPCMBuffer<TFloat>& buf, size_t sz) override { + size_t Write(const TPCMBuffer& buf, size_t sz) override { const size_t samples = ChannelsNum_ * sz; Buf_.resize(samples * 2); for (size_t i = 0; i < samples; i++) { @@ -480,4 +480,4 @@ IPCMProviderImpl* CreatePCMIOMFReadImpl(const std::string& path) { IPCMProviderImpl* CreatePCMIOMFWriteImpl(const std::string& path, int channels, int sampleRate) { return new TPCMIOMediaFoundationFile(path, channels, sampleRate); -}
\ No newline at end of file +} |