Do bulk replace of stl types.
This commit is contained in:
parent
521486be62
commit
c25a56ee19
531 changed files with 2274 additions and 2181 deletions
|
@ -9,7 +9,7 @@ MetaMidiEvent::MetaMidiEvent()
|
|||
|
||||
}
|
||||
|
||||
std::unique_ptr<MetaMidiEvent> MetaMidiEvent::Create()
|
||||
Ptr<MetaMidiEvent> MetaMidiEvent::Create()
|
||||
{
|
||||
return std::make_unique<MetaMidiEvent>();
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ void MetaMidiEvent::SetValue(int value)
|
|||
mValue = value;
|
||||
}
|
||||
|
||||
void MetaMidiEvent::SetLabel(const std::string& label)
|
||||
void MetaMidiEvent::SetLabel(const String& label)
|
||||
{
|
||||
mLabel = label;
|
||||
}
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
#include "MidiEvent.h"
|
||||
#include "MidiElements.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "Memory.h"
|
||||
#include "String.h"
|
||||
|
||||
class MetaMidiEvent : public MidiEvent
|
||||
{
|
||||
|
@ -51,13 +51,13 @@ private:
|
|||
public:
|
||||
|
||||
MetaMidiEvent();
|
||||
static std::unique_ptr<MetaMidiEvent> Create();
|
||||
static Ptr<MetaMidiEvent> Create();
|
||||
|
||||
void SetValue(int value);
|
||||
void SetType(char c);
|
||||
Type GetType() const;
|
||||
|
||||
void SetLabel(const std::string& label);
|
||||
void SetLabel(const String& label);
|
||||
void SetTimeSignature(const MidiTimeSignature& timeSig);
|
||||
void SetTimeCode(const MidiSmtpeTimecode& timeCode);
|
||||
void SetKeySignature(const MidiKeySignature& keySig);
|
||||
|
@ -65,11 +65,11 @@ public:
|
|||
private:
|
||||
Type mType {Type::UNSET};
|
||||
char mUnKnownMarker{0};
|
||||
std::string mLabel;
|
||||
String mLabel;
|
||||
int mValue { 0 };
|
||||
MidiTimeSignature mTimeSig;
|
||||
MidiSmtpeTimecode mTimecode;
|
||||
MidiKeySignature mKeySig;
|
||||
};
|
||||
|
||||
using MetaMidiEventPtr = std::unique_ptr<MetaMidiEvent>;
|
||||
using MetaMidiEventPtr = Ptr<MetaMidiEvent>;
|
||||
|
|
|
@ -9,7 +9,7 @@ MidiChannelEvent::MidiChannelEvent()
|
|||
|
||||
}
|
||||
|
||||
std::unique_ptr<MidiChannelEvent> MidiChannelEvent::Create()
|
||||
Ptr<MidiChannelEvent> MidiChannelEvent::Create()
|
||||
{
|
||||
return std::make_unique<MidiChannelEvent>();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "MidiEvent.h"
|
||||
#include <string>
|
||||
#include "String.h"
|
||||
|
||||
class MidiChannelEvent : public MidiEvent
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ private:
|
|||
|
||||
public:
|
||||
MidiChannelEvent();
|
||||
static std::unique_ptr<MidiChannelEvent> Create();
|
||||
static Ptr<MidiChannelEvent> Create();
|
||||
|
||||
void SetTypeAndChannel(char c);
|
||||
void SetType(Type type);
|
||||
|
@ -69,4 +69,4 @@ private:
|
|||
int mValue1 {1};
|
||||
};
|
||||
|
||||
using MidiChannelEventPtr = std::unique_ptr<MidiChannelEvent>;
|
||||
using MidiChannelEventPtr = Ptr<MidiChannelEvent>;
|
||||
|
|
|
@ -7,7 +7,7 @@ MidiDocument::MidiDocument()
|
|||
|
||||
}
|
||||
|
||||
std::unique_ptr<MidiDocument> MidiDocument::Create()
|
||||
Ptr<MidiDocument> MidiDocument::Create()
|
||||
{
|
||||
return std::make_unique<MidiDocument>();
|
||||
}
|
||||
|
@ -32,9 +32,9 @@ void MidiDocument::SetTimeDivision(const MidiTimeDivision& timeDivision)
|
|||
mTimeDivision = timeDivision;
|
||||
}
|
||||
|
||||
std::string MidiDocument::Serialize() const
|
||||
String MidiDocument::Serialize() const
|
||||
{
|
||||
std::string output = "MidiDocument\n";
|
||||
String output = "MidiDocument\n";
|
||||
output += "Format type: " + std::to_string(mFormatType) + "\n";
|
||||
output += "Expected Tracks: " + std::to_string(mExpectedTracks) + "\n";
|
||||
output += "Use fps: " + std::to_string(mTimeDivision.mUseFps) + "\n";
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "Vector.h"
|
||||
#include "Memory.h"
|
||||
#include "String.h"
|
||||
|
||||
#include "MidiElements.h"
|
||||
|
||||
class MidiTrack;
|
||||
using MidiTrackPtr = std::unique_ptr<MidiTrack>;
|
||||
using MidiTrackPtr = Ptr<MidiTrack>;
|
||||
|
||||
class MidiDocument
|
||||
{
|
||||
public:
|
||||
MidiDocument();
|
||||
|
||||
static std::unique_ptr<MidiDocument> Create();
|
||||
static Ptr<MidiDocument> Create();
|
||||
|
||||
void AddTrack(MidiTrackPtr track);
|
||||
|
||||
|
@ -22,13 +22,13 @@ public:
|
|||
void SetExpectedTracks(int expected);
|
||||
void SetTimeDivision(const MidiTimeDivision& timeDivision);
|
||||
|
||||
std::string Serialize() const;
|
||||
String Serialize() const;
|
||||
|
||||
private:
|
||||
int mFormatType = 0;
|
||||
int mExpectedTracks = 0;
|
||||
MidiTimeDivision mTimeDivision;
|
||||
std::vector<MidiTrackPtr> mTracks;
|
||||
Vector<MidiTrackPtr> mTracks;
|
||||
};
|
||||
|
||||
using MidiDocumentPtr = std::unique_ptr<MidiDocument>;
|
||||
using MidiDocumentPtr = Ptr<MidiDocument>;
|
||||
|
|
|
@ -6,7 +6,7 @@ MidiEvent::MidiEvent()
|
|||
|
||||
}
|
||||
|
||||
std::unique_ptr<MidiEvent> MidiEvent::Create()
|
||||
Ptr<MidiEvent> MidiEvent::Create()
|
||||
{
|
||||
return std::make_unique<MidiEvent>();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include "Memory.h"
|
||||
|
||||
class MidiEvent
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ public:
|
|||
MidiEvent();
|
||||
virtual ~MidiEvent() = default;
|
||||
|
||||
static std::unique_ptr<MidiEvent> Create();
|
||||
static Ptr<MidiEvent> Create();
|
||||
|
||||
void SetTimeDelta(int delta);
|
||||
|
||||
|
@ -26,4 +26,4 @@ private:
|
|||
int mTimeDelta{0};
|
||||
};
|
||||
|
||||
using MidiEventPtr = std::unique_ptr<MidiEvent>;
|
||||
using MidiEventPtr = Ptr<MidiEvent>;
|
||||
|
|
|
@ -27,9 +27,9 @@ std::size_t MidiTrack::GetNumEvents()
|
|||
return mEvents.size();
|
||||
}
|
||||
|
||||
std::string MidiTrack::Serialize() const
|
||||
String MidiTrack::Serialize() const
|
||||
{
|
||||
std::string output = "MidiTrack\n";
|
||||
String output = "MidiTrack\n";
|
||||
output += "Num Events: " + std::to_string(mEvents.size()) + "\n";
|
||||
return output;
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "Vector.h"
|
||||
#include "Memory.h"
|
||||
#include "String.h"
|
||||
#include "MidiEvent.h"
|
||||
|
||||
class MidiEvent;
|
||||
using MidiEventPtr = std::unique_ptr<MidiEvent>;
|
||||
using MidiEventPtr = Ptr<MidiEvent>;
|
||||
|
||||
class MidiTrack
|
||||
{
|
||||
|
@ -22,9 +22,9 @@ public:
|
|||
|
||||
std::size_t GetNumEvents();
|
||||
|
||||
std::string Serialize() const;
|
||||
String Serialize() const;
|
||||
|
||||
private:
|
||||
|
||||
std::vector<MidiEventPtr> mEvents;
|
||||
Vector<MidiEventPtr> mEvents;
|
||||
};
|
||||
|
|
|
@ -83,7 +83,7 @@ int MidiMetaEventAdapter::ReadStringEvent(std::ifstream* file, MetaMidiEvent* ev
|
|||
int length = *BinaryStream::getNextByteAsInt(file);
|
||||
byteCount++;
|
||||
|
||||
std::string name;
|
||||
String name;
|
||||
BinaryStream::getNextString(file, name, length);
|
||||
byteCount += length;
|
||||
event->SetLabel(name);
|
||||
|
@ -104,7 +104,7 @@ int MidiMetaEventAdapter::ReadIntEvent(std::ifstream* file, MetaMidiEvent* event
|
|||
byteCount ++;
|
||||
}
|
||||
|
||||
std::string buffer;
|
||||
String buffer;
|
||||
BinaryStream::getNextNBytes(file, buffer.data(), length);
|
||||
byteCount += length;
|
||||
|
||||
|
@ -119,7 +119,7 @@ int MidiMetaEventAdapter::ReadChannelPrefixEvent(std::ifstream* file, MetaMidiEv
|
|||
int length = *BinaryStream::getNextByteAsInt(file);
|
||||
byteCount ++;
|
||||
|
||||
std::string buffer;
|
||||
String buffer;
|
||||
BinaryStream::getNextNBytes(file, buffer.data(), length);
|
||||
byteCount += length;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "File.h"
|
||||
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
#include "String.h"
|
||||
|
||||
using Path = std::filesystem::path;
|
||||
|
||||
|
@ -29,7 +29,7 @@ private:
|
|||
int processEvent(MidiTrack* track);
|
||||
|
||||
private:
|
||||
std::unique_ptr<File> mFile;
|
||||
Ptr<File> mFile;
|
||||
MidiDocumentPtr mDocument;
|
||||
int mLastMidiChannel {0};
|
||||
MidiChannelEvent::Type mLastChannelEventType;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue