Add FileMonitor support for VolumeDirectory

This commit is contained in:
JosJuice 2014-12-27 20:13:31 +01:00
parent 339383b8dd
commit 7f04a23e23
2 changed files with 6 additions and 2 deletions

View File

@ -92,7 +92,7 @@ void ReadFileSystem(const std::string& filename)
FileAccess = true;
}
// Check if we should play this file
// Logs a file if it passes a few checks
void CheckFile(const std::string& file, u64 size)
{
// Don't do anything if the log is unselected

View File

@ -16,6 +16,7 @@
#include "Common/FileUtil.h"
#include "Common/MathUtil.h"
#include "DiscIO/FileBlob.h"
#include "DiscIO/FileMonitor.h"
#include "DiscIO/Volume.h"
#include "DiscIO/VolumeDirectory.h"
@ -111,13 +112,16 @@ bool CVolumeDirectory::Read(u64 _Offset, u64 _Length, u8* _pBuffer) const
{
_dbg_assert_(DVDINTERFACE, fileIter->first <= _Offset);
u64 fileOffset = _Offset - fileIter->first;
const std::string fileName = fileIter->second;
std::unique_ptr<PlainFileReader> reader(PlainFileReader::Create(fileIter->second));
std::unique_ptr<PlainFileReader> reader(PlainFileReader::Create(fileName));
if (reader == nullptr)
return false;
u64 fileSize = reader->GetDataSize();
FileMon::CheckFile(fileName, fileSize);
if (fileOffset < fileSize)
{
u64 fileBytes = fileSize - fileOffset;