Worked around an ice, again
This commit is contained in:
@@ -43,8 +43,11 @@
|
||||
#include <taglib/shortenfile.h>
|
||||
#endif
|
||||
|
||||
#include "audio/AudioTypes.hpp"
|
||||
#include "audio/IAudioFileInfo.hpp"
|
||||
|
||||
#include "ImageReader.hpp"
|
||||
#include "TagReader.hpp"
|
||||
#include "Utils.hpp"
|
||||
|
||||
namespace lms::audio::taglib
|
||||
@@ -219,25 +222,27 @@ namespace lms::audio::taglib
|
||||
AudioFileInfo::AudioFileInfo(const std::filesystem::path& filePath, ParserOptions::AudioPropertiesReadStyle readStyle, bool enableExtraDebugLogs)
|
||||
: _filePath{ filePath }
|
||||
, _file{ utils::parseFile(filePath, readStyle) }
|
||||
, _audioProperties{ computeAudioProperties(*_file) }
|
||||
, _tagReader{ *_file, enableExtraDebugLogs }
|
||||
, _imageReader{ *_file }
|
||||
, _audioProperties{ std::make_unique<AudioProperties>(computeAudioProperties(*_file)) }
|
||||
, _tagReader{ std::make_unique<TagReader>(*_file, enableExtraDebugLogs) }
|
||||
, _imageReader{ std::make_unique<ImageReader>(*_file) }
|
||||
{
|
||||
}
|
||||
|
||||
AudioFileInfo::~AudioFileInfo() = default;
|
||||
|
||||
const AudioProperties& AudioFileInfo::getAudioProperties() const
|
||||
{
|
||||
return _audioProperties;
|
||||
return *_audioProperties;
|
||||
}
|
||||
|
||||
const IImageReader& AudioFileInfo::getImageReader() const
|
||||
{
|
||||
return _imageReader;
|
||||
return *_imageReader;
|
||||
}
|
||||
|
||||
const ITagReader& AudioFileInfo::getTagReader() const
|
||||
{
|
||||
return _tagReader;
|
||||
return *_tagReader;
|
||||
}
|
||||
|
||||
} // namespace lms::audio::taglib
|
||||
|
||||
@@ -19,22 +19,29 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <taglib/tfile.h>
|
||||
|
||||
#include "audio/AudioTypes.hpp"
|
||||
#include "audio/IAudioFileInfo.hpp"
|
||||
#include "audio/IImageReader.hpp"
|
||||
#include "audio/ITagReader.hpp"
|
||||
|
||||
#include "ImageReader.hpp"
|
||||
#include "TagReader.hpp"
|
||||
namespace TagLib
|
||||
{
|
||||
class File;
|
||||
}
|
||||
|
||||
namespace lms::audio::taglib
|
||||
{
|
||||
class ImageReader;
|
||||
class TagReader;
|
||||
|
||||
class AudioFileInfo final : public IAudioFileInfo
|
||||
{
|
||||
public:
|
||||
AudioFileInfo(const std::filesystem::path& filePath, ParserOptions::AudioPropertiesReadStyle readStyle, bool enableExtraDebugLogs);
|
||||
~AudioFileInfo() override;
|
||||
|
||||
AudioFileInfo(const AudioFileInfo&) = delete;
|
||||
AudioFileInfo& operator=(const AudioFileInfo&) = delete;
|
||||
|
||||
private:
|
||||
const AudioProperties& getAudioProperties() const override;
|
||||
@@ -43,8 +50,8 @@ namespace lms::audio::taglib
|
||||
|
||||
const std::filesystem::path _filePath;
|
||||
std::unique_ptr<::TagLib::File> _file;
|
||||
const AudioProperties _audioProperties;
|
||||
const TagReader _tagReader;
|
||||
const ImageReader _imageReader;
|
||||
std::unique_ptr<AudioProperties> _audioProperties;
|
||||
std::unique_ptr<TagReader> _tagReader;
|
||||
std::unique_ptr<ImageReader> _imageReader;
|
||||
};
|
||||
} // namespace lms::audio::taglib
|
||||
|
||||
Reference in New Issue
Block a user