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