Improve audio and midi support.

This commit is contained in:
jmsgrogan 2021-05-23 21:02:38 +01:00
parent 9bcc0ae88e
commit 8b5f485d1e
47 changed files with 1446 additions and 634 deletions

View file

@ -31,17 +31,27 @@ std::ofstream* File::GetOutHandle() const
return mOutHandle.get();
}
void File::Open()
void File::Open(bool asBinary)
{
if(mAccessMode == AccessMode::Read)
{
auto flags = std::ifstream::in;
if (asBinary)
{
flags |= std::ifstream::binary;
}
mInHandle = std::make_unique<std::ifstream>();
mInHandle->open(mFullPath, std::ifstream::in);
mInHandle->open(mFullPath, flags);
}
else
{
auto flags = std::ofstream::out;
if (asBinary)
{
flags |= std::ofstream::binary;
}
mOutHandle = std::make_unique<std::ofstream>();
mOutHandle->open(mFullPath, std::ofstream::out);
mOutHandle->open(mFullPath, flags);
}
}