diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 20:50:06 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-21 20:50:06 +0200 |
commit | 8d550c174edad68726b8e9c3cd5cd950bf1bf16a (patch) | |
tree | 2c6ed4bd36844e7df4bfc787ea6b23d71902f346 /Libraries/LibAudio/AWavLoader.cpp | |
parent | 31b38ed88f3db123c498379f4615d2dce1ded406 (diff) | |
download | serenity-8d550c174edad68726b8e9c3cd5cd950bf1bf16a.zip |
LibCore: Convert CFile to ObjectPtr
Diffstat (limited to 'Libraries/LibAudio/AWavLoader.cpp')
-rw-r--r-- | Libraries/LibAudio/AWavLoader.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Libraries/LibAudio/AWavLoader.cpp b/Libraries/LibAudio/AWavLoader.cpp index f241cfe134..6315a8c3c2 100644 --- a/Libraries/LibAudio/AWavLoader.cpp +++ b/Libraries/LibAudio/AWavLoader.cpp @@ -6,10 +6,10 @@ #include <limits> AWavLoader::AWavLoader(const StringView& path) - : m_file(path) + : m_file(CFile::construct(path)) { - if (!m_file.open(CIODevice::ReadOnly)) { - m_error_string = String::format("Can't open file: %s", m_file.error_string()); + if (!m_file->open(CIODevice::ReadOnly)) { + m_error_string = String::format("Can't open file: %s", m_file->error_string()); return; } @@ -22,7 +22,7 @@ RefPtr<ABuffer> AWavLoader::get_more_samples(size_t max_bytes_to_read_from_input dbgprintf("Read WAV of format PCM with num_channels %u sample rate %u, bits per sample %u\n", m_num_channels, m_sample_rate, m_bits_per_sample); #endif - auto raw_samples = m_file.read(max_bytes_to_read_from_input); + auto raw_samples = m_file->read(max_bytes_to_read_from_input); if (raw_samples.is_empty()) return nullptr; @@ -33,7 +33,7 @@ RefPtr<ABuffer> AWavLoader::get_more_samples(size_t max_bytes_to_read_from_input bool AWavLoader::parse_header() { - CIODeviceStreamReader stream(m_file); + CIODeviceStreamReader stream(*m_file); #define CHECK_OK(msg) \ do { \ |