Clean project structure.
This commit is contained in:
parent
78a4fa99ff
commit
947bf937fd
496 changed files with 206 additions and 137 deletions
|
@ -1,19 +1,7 @@
|
|||
add_subdirectory(core)
|
||||
add_subdirectory(compiler)
|
||||
add_subdirectory(compression)
|
||||
add_subdirectory(database)
|
||||
add_subdirectory(network)
|
||||
add_subdirectory(geometry)
|
||||
add_subdirectory(mesh)
|
||||
add_subdirectory(audio)
|
||||
add_subdirectory(fonts)
|
||||
add_subdirectory(image)
|
||||
add_subdirectory(base)
|
||||
add_subdirectory(console)
|
||||
add_subdirectory(client)
|
||||
add_subdirectory(graphics)
|
||||
add_subdirectory(media)
|
||||
add_subdirectory(publishing)
|
||||
add_subdirectory(video)
|
||||
add_subdirectory(windows)
|
||||
add_subdirectory(rendering)
|
||||
add_subdirectory(ui)
|
||||
add_subdirectory(web)
|
||||
add_subdirectory(ui_elements)
|
||||
add_subdirectory(visual_elements)
|
||||
|
|
|
@ -1,100 +0,0 @@
|
|||
#include "MetaMidiEvent.h"
|
||||
|
||||
MetaMidiEvent::MetaMidiEvent()
|
||||
: MidiEvent(),
|
||||
mType(Type::UNSET),
|
||||
mLabel(),
|
||||
mValue(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::unique_ptr<MetaMidiEvent> MetaMidiEvent::Create()
|
||||
{
|
||||
return std::make_unique<MetaMidiEvent>();
|
||||
}
|
||||
|
||||
void MetaMidiEvent::SetType(char c)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case META_SEQ_NUM:
|
||||
mType = Type::SEQ_NUM;
|
||||
break;
|
||||
case META_TEXT:
|
||||
mType = Type::TEXT;
|
||||
break;
|
||||
case META_COPYRIGHT:
|
||||
mType = Type::COPYRIGHT;
|
||||
break;
|
||||
case META_TRACK_NAME:
|
||||
mType = Type::TRACK_NAME;
|
||||
break;
|
||||
case META_INSTRUMENT_NAME:
|
||||
mType = Type::INSTRUMENT_NAME;
|
||||
break;
|
||||
case META_LYRIC:
|
||||
mType = Type::LYRIC;
|
||||
break;
|
||||
case META_MARKER:
|
||||
mType = Type::MARKER;
|
||||
break;
|
||||
case META_CUE_POINT:
|
||||
mType = Type::CUE_POINT;
|
||||
break;
|
||||
case META_CHANNEL_PREFIX:
|
||||
mType = Type::CHANNEL_PREFIX;
|
||||
break;
|
||||
case META_END_TRACK:
|
||||
mType = Type::END_TRACK;
|
||||
break;
|
||||
case META_SET_TEMPO:
|
||||
mType = Type::SET_TEMPO;
|
||||
break;
|
||||
case META_SMPTE_OFFSET:
|
||||
mType = Type::SMPTE_OFFSET;
|
||||
break;
|
||||
case META_TIME_SIG:
|
||||
mType = Type::TIME_SIG;
|
||||
break;
|
||||
case META_KEY_SIG:
|
||||
mType = Type::KEY_SIG;
|
||||
break;
|
||||
case META_SEQ_CUSTOM:
|
||||
mType = Type::SEQ_CUSTOM;
|
||||
break;
|
||||
default:
|
||||
mType = Type::UNKNOWN;
|
||||
mUnKnownMarker = c;
|
||||
}
|
||||
}
|
||||
|
||||
MetaMidiEvent::Type MetaMidiEvent::GetType() const
|
||||
{
|
||||
return mType;
|
||||
}
|
||||
|
||||
void MetaMidiEvent::SetValue(int value)
|
||||
{
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
void MetaMidiEvent::SetLabel(const std::string& label)
|
||||
{
|
||||
mLabel = label;
|
||||
}
|
||||
|
||||
void MetaMidiEvent::SetTimeSignature(const MidiTimeSignature& timeSig)
|
||||
{
|
||||
mTimeSig = timeSig;
|
||||
}
|
||||
|
||||
void MetaMidiEvent::SetTimeCode(const MidiSmtpeTimecode& timeCode)
|
||||
{
|
||||
mTimecode = timeCode;
|
||||
}
|
||||
|
||||
void MetaMidiEvent::SetKeySignature(const MidiKeySignature& keySig)
|
||||
{
|
||||
mKeySig = keySig;
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "MidiEvent.h"
|
||||
#include "MidiElements.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
class MetaMidiEvent : public MidiEvent
|
||||
{
|
||||
public:
|
||||
enum class Type
|
||||
{
|
||||
UNSET,
|
||||
UNKNOWN,
|
||||
SEQ_NUM,
|
||||
TEXT,
|
||||
COPYRIGHT,
|
||||
TRACK_NAME,
|
||||
INSTRUMENT_NAME,
|
||||
LYRIC,
|
||||
MARKER,
|
||||
CUE_POINT,
|
||||
CHANNEL_PREFIX,
|
||||
END_TRACK,
|
||||
SET_TEMPO,
|
||||
SMPTE_OFFSET,
|
||||
TIME_SIG,
|
||||
KEY_SIG,
|
||||
SEQ_CUSTOM
|
||||
};
|
||||
|
||||
private:
|
||||
static const int META_SEQ_NUM = 0x0;
|
||||
static const int META_TEXT = 0x1;
|
||||
static const int META_COPYRIGHT = 0x2;
|
||||
static const int META_TRACK_NAME = 0x3; // 0000 0011
|
||||
static const int META_INSTRUMENT_NAME = 0x4;
|
||||
static const int META_LYRIC = 0x5;
|
||||
static const int META_MARKER = 0x6;
|
||||
static const int META_CUE_POINT = 0x7;
|
||||
static const int META_CHANNEL_PREFIX = 0x20;
|
||||
static const int META_END_TRACK = 0x2F;
|
||||
|
||||
static const int META_SET_TEMPO = 0x51; // 0101 0001
|
||||
static const int META_SMPTE_OFFSET = 0x54;
|
||||
static const int META_TIME_SIG = 0x58; // 0101 1000
|
||||
static const int META_KEY_SIG = 0x59; // 0101 1001
|
||||
|
||||
static const int META_SEQ_CUSTOM = 0x7F;
|
||||
|
||||
public:
|
||||
|
||||
MetaMidiEvent();
|
||||
static std::unique_ptr<MetaMidiEvent> Create();
|
||||
|
||||
void SetValue(int value);
|
||||
void SetType(char c);
|
||||
Type GetType() const;
|
||||
|
||||
void SetLabel(const std::string& label);
|
||||
void SetTimeSignature(const MidiTimeSignature& timeSig);
|
||||
void SetTimeCode(const MidiSmtpeTimecode& timeCode);
|
||||
void SetKeySignature(const MidiKeySignature& keySig);
|
||||
|
||||
private:
|
||||
Type mType {Type::UNSET};
|
||||
char mUnKnownMarker{0};
|
||||
std::string mLabel;
|
||||
int mValue { 0 };
|
||||
MidiTimeSignature mTimeSig;
|
||||
MidiSmtpeTimecode mTimecode;
|
||||
MidiKeySignature mKeySig;
|
||||
};
|
||||
|
||||
using MetaMidiEventPtr = std::unique_ptr<MetaMidiEvent>;
|
|
@ -1,114 +0,0 @@
|
|||
#include "MidiChannelEvent.h"
|
||||
|
||||
MidiChannelEvent::MidiChannelEvent()
|
||||
: MidiEvent(),
|
||||
mType(Type::NONE),
|
||||
mValue0(0),
|
||||
mValue1(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::unique_ptr<MidiChannelEvent> MidiChannelEvent::Create()
|
||||
{
|
||||
return std::make_unique<MidiChannelEvent>();
|
||||
}
|
||||
|
||||
void MidiChannelEvent::SetType(Type type)
|
||||
{
|
||||
mType = type;
|
||||
}
|
||||
MidiChannelEvent::Type MidiChannelEvent::GetType() const
|
||||
{
|
||||
return mType;
|
||||
}
|
||||
void MidiChannelEvent::SetValues(int value0, int value1)
|
||||
{
|
||||
mValue0 = value0;
|
||||
mValue1 = value1;
|
||||
}
|
||||
int MidiChannelEvent::GetValue0() const
|
||||
{
|
||||
return mValue0;
|
||||
}
|
||||
int MidiChannelEvent::GetValue1() const
|
||||
{
|
||||
return mValue1;
|
||||
}
|
||||
|
||||
void MidiChannelEvent::SetTypeAndChannel(char c)
|
||||
{
|
||||
const int first_four_bits = 0xF0;
|
||||
const int second_four_bits = 0xF;
|
||||
const int event_type = (c & first_four_bits) >> 4;
|
||||
|
||||
const bool isSystemMessage = event_type == 0xF;
|
||||
if(!isSystemMessage)
|
||||
{
|
||||
mChannel = (c & second_four_bits) >> 4;
|
||||
switch(event_type)
|
||||
{
|
||||
case NOTE_OFF:
|
||||
mType = Type::NOTE_OFF;
|
||||
break;
|
||||
case NOTE_ON:
|
||||
mType = Type::NOTE_ON;
|
||||
break;
|
||||
case NOTE_AFTERTOUCH:
|
||||
mType = Type::NOTE_AFTERTOUCH;
|
||||
break;
|
||||
case CONTROLLER:
|
||||
mType = Type::CONTROLLER;
|
||||
break;
|
||||
case PROGRAM:
|
||||
mType = Type::PROGRAM;
|
||||
break;
|
||||
case CHANNEL_AFTERTOUCH:
|
||||
mType = Type::CHANNEL_AFTERTOUCH;
|
||||
break;
|
||||
case PITCH_BEND:
|
||||
mType = Type::PITCH_BEND;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const int subType = (c & second_four_bits) >> 4;
|
||||
switch(subType)
|
||||
{
|
||||
case SYS_EXCLUSIVE:
|
||||
mType = Type::SYS_EXCLUSIVE;
|
||||
break;
|
||||
case SYS_SONG_POS:
|
||||
mType = Type::SYS_SONG_POS;
|
||||
break;
|
||||
case SYS_SONG_SELECT:
|
||||
mType = Type::SYS_SONG_SELECT;
|
||||
break;
|
||||
case SYS_TUNE_REQUEST:
|
||||
mType = Type::SYS_TUNE_REQUEST;
|
||||
break;
|
||||
case SYS_END_EXCLUSIVE:
|
||||
mType = Type::SYS_END_EXCLUSIVE;
|
||||
break;
|
||||
case SYS_TIMING_CLOCK:
|
||||
mType = Type::SYS_TIMING_CLOCK;
|
||||
break;
|
||||
case SYS_START:
|
||||
mType = Type::SYS_START;
|
||||
break;
|
||||
case SYS_CONTINUE:
|
||||
mType = Type::SYS_CONTINUE;
|
||||
break;
|
||||
case SYS_STOP:
|
||||
mType = Type::SYS_STOP;
|
||||
break;
|
||||
case SYS_ACTIVE_SENSING:
|
||||
mType = Type::SYS_ACTIVE_SENSING;
|
||||
break;
|
||||
case SYS_RESET:
|
||||
mType = Type::SYS_RESET;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "MidiEvent.h"
|
||||
#include <string>
|
||||
|
||||
class MidiChannelEvent : public MidiEvent
|
||||
{
|
||||
public:
|
||||
enum class Type{
|
||||
NONE,
|
||||
NOTE_OFF,
|
||||
NOTE_ON,
|
||||
NOTE_AFTERTOUCH,
|
||||
CONTROLLER,
|
||||
PROGRAM,
|
||||
CHANNEL_AFTERTOUCH,
|
||||
PITCH_BEND,
|
||||
CHANNEL_MODE,
|
||||
SYS_EXCLUSIVE,
|
||||
SYS_SONG_POS,
|
||||
SYS_SONG_SELECT,
|
||||
SYS_TUNE_REQUEST,
|
||||
SYS_END_EXCLUSIVE,
|
||||
SYS_TIMING_CLOCK,
|
||||
SYS_START,
|
||||
SYS_CONTINUE,
|
||||
SYS_STOP,
|
||||
SYS_ACTIVE_SENSING,
|
||||
SYS_RESET
|
||||
};
|
||||
|
||||
private:
|
||||
static const int NOTE_OFF = 0x8;
|
||||
static const int NOTE_ON = 0x9;
|
||||
static const int NOTE_AFTERTOUCH = 0xA;
|
||||
static const int CONTROLLER = 0xB;
|
||||
static const int PROGRAM = 0xC;
|
||||
static const int CHANNEL_AFTERTOUCH = 0xD;
|
||||
static const int PITCH_BEND = 0xE;
|
||||
|
||||
static const int SYS_EXCLUSIVE = 0x0;
|
||||
static const int SYS_SONG_POS = 0x2;
|
||||
static const int SYS_SONG_SELECT = 0x3;
|
||||
static const int SYS_TUNE_REQUEST = 0x6;
|
||||
static const int SYS_END_EXCLUSIVE = 0x7;
|
||||
static const int SYS_TIMING_CLOCK = 0x8;
|
||||
static const int SYS_START = 0xA;
|
||||
static const int SYS_CONTINUE = 0xB;
|
||||
static const int SYS_STOP = 0xC;
|
||||
static const int SYS_ACTIVE_SENSING = 0xE;
|
||||
static const int SYS_RESET = 0xF;
|
||||
|
||||
public:
|
||||
MidiChannelEvent();
|
||||
static std::unique_ptr<MidiChannelEvent> Create();
|
||||
|
||||
void SetTypeAndChannel(char c);
|
||||
void SetType(Type type);
|
||||
Type GetType() const;
|
||||
|
||||
void SetValues(int value0, int value1);
|
||||
int GetValue0() const;
|
||||
int GetValue1() const;
|
||||
|
||||
private:
|
||||
Type mType;
|
||||
int mChannel {0};
|
||||
int mValue0 {0};
|
||||
int mValue1 {1};
|
||||
};
|
||||
|
||||
using MidiChannelEventPtr = std::unique_ptr<MidiChannelEvent>;
|
|
@ -1,50 +0,0 @@
|
|||
#include "MidiDocument.h"
|
||||
|
||||
#include "MidiTrack.h"
|
||||
|
||||
MidiDocument::MidiDocument()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::unique_ptr<MidiDocument> MidiDocument::Create()
|
||||
{
|
||||
return std::make_unique<MidiDocument>();
|
||||
}
|
||||
|
||||
void MidiDocument::AddTrack(MidiTrackPtr track)
|
||||
{
|
||||
mTracks.push_back(std::move(track));
|
||||
}
|
||||
|
||||
void MidiDocument::SetFormatType(int format)
|
||||
{
|
||||
mFormatType = format;
|
||||
}
|
||||
|
||||
void MidiDocument::SetExpectedTracks(int expected)
|
||||
{
|
||||
mExpectedTracks = expected;
|
||||
}
|
||||
|
||||
void MidiDocument::SetTimeDivision(const MidiTimeDivision& timeDivision)
|
||||
{
|
||||
mTimeDivision = timeDivision;
|
||||
}
|
||||
|
||||
std::string MidiDocument::Serialize() const
|
||||
{
|
||||
std::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";
|
||||
output += "fps: " + std::to_string(mTimeDivision.mFps) + "\n";
|
||||
output += "Ticks per frame: " + std::to_string(mTimeDivision.mTicks) + "\n";
|
||||
output += "Num tracks: " + std::to_string(mTracks.size()) + "\n";
|
||||
for(const auto& track : mTracks)
|
||||
{
|
||||
output += track->Serialize();
|
||||
output += "------------------------\n";
|
||||
}
|
||||
return output;
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "MidiElements.h"
|
||||
|
||||
class MidiTrack;
|
||||
using MidiTrackPtr = std::unique_ptr<MidiTrack>;
|
||||
|
||||
class MidiDocument
|
||||
{
|
||||
public:
|
||||
MidiDocument();
|
||||
|
||||
static std::unique_ptr<MidiDocument> Create();
|
||||
|
||||
void AddTrack(MidiTrackPtr track);
|
||||
|
||||
void SetFormatType(int format);
|
||||
void SetExpectedTracks(int expected);
|
||||
void SetTimeDivision(const MidiTimeDivision& timeDivision);
|
||||
|
||||
std::string Serialize() const;
|
||||
|
||||
private:
|
||||
int mFormatType = 0;
|
||||
int mExpectedTracks = 0;
|
||||
MidiTimeDivision mTimeDivision;
|
||||
std::vector<MidiTrackPtr> mTracks;
|
||||
};
|
||||
|
||||
using MidiDocumentPtr = std::unique_ptr<MidiDocument>;
|
|
@ -1,31 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
struct MidiTimeSignature
|
||||
{
|
||||
int mNumer {4};
|
||||
int mDenom {4};
|
||||
int mMetro {1};
|
||||
int mF32 {1};
|
||||
};
|
||||
|
||||
struct MidiTimeDivision
|
||||
{
|
||||
bool mUseFps {false};
|
||||
int mFps { 0 };
|
||||
int mTicks { 1 };
|
||||
};
|
||||
|
||||
struct MidiSmtpeTimecode
|
||||
{
|
||||
int mHr{0};
|
||||
int mMin{0};
|
||||
int mSec{0};
|
||||
int mFrame{0};
|
||||
int mFrameFrac{0};
|
||||
};
|
||||
|
||||
struct MidiKeySignature
|
||||
{
|
||||
int mSharpsFlats{0};
|
||||
int mMinor{0};
|
||||
};
|
|
@ -1,37 +0,0 @@
|
|||
#include "MidiEvent.h"
|
||||
|
||||
MidiEvent::MidiEvent()
|
||||
: mTimeDelta(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::unique_ptr<MidiEvent> MidiEvent::Create()
|
||||
{
|
||||
return std::make_unique<MidiEvent>();
|
||||
}
|
||||
|
||||
void MidiEvent::SetTimeDelta(int delta)
|
||||
{
|
||||
mTimeDelta = delta;
|
||||
}
|
||||
|
||||
bool MidiEvent::IsMetaEvent(char c)
|
||||
{
|
||||
return (c & META_EVENT) == META_EVENT;
|
||||
}
|
||||
|
||||
bool MidiEvent::IsSysExEvent(char c)
|
||||
{
|
||||
return IsNormalSysExEvent(c) || IsDividedSysExEvent(c);
|
||||
}
|
||||
|
||||
bool MidiEvent::IsNormalSysExEvent(char c)
|
||||
{
|
||||
return (c & SYSEX_EVENT) == SYSEX_EVENT;
|
||||
}
|
||||
|
||||
bool MidiEvent::IsDividedSysExEvent(char c)
|
||||
{
|
||||
return (c & DIVIDED_SYSEX_EVENT) == DIVIDED_SYSEX_EVENT;
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
class MidiEvent
|
||||
{
|
||||
static const int META_EVENT = 0xFF; // 1111 1111
|
||||
static const int SYSEX_EVENT = 0xF0;
|
||||
static const int DIVIDED_SYSEX_EVENT = 0xF7;
|
||||
|
||||
public:
|
||||
|
||||
MidiEvent();
|
||||
virtual ~MidiEvent() = default;
|
||||
|
||||
static std::unique_ptr<MidiEvent> Create();
|
||||
|
||||
void SetTimeDelta(int delta);
|
||||
|
||||
static bool IsMetaEvent(char c);
|
||||
static bool IsSysExEvent(char c);
|
||||
static bool IsNormalSysExEvent(char c);
|
||||
static bool IsDividedSysExEvent(char c);
|
||||
|
||||
private:
|
||||
int mTimeDelta{0};
|
||||
};
|
||||
|
||||
using MidiEventPtr = std::unique_ptr<MidiEvent>;
|
|
@ -1,35 +0,0 @@
|
|||
#include "MidiTrack.h"
|
||||
|
||||
#include "MidiEvent.h"
|
||||
|
||||
MidiTrack::MidiTrack()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
MidiTrack::~MidiTrack()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MidiTrack::AddEvent(MidiEventPtr event)
|
||||
{
|
||||
mEvents.push_back(std::move(event));
|
||||
}
|
||||
|
||||
MidiEvent* MidiTrack::GetEvent(std::size_t idx) const
|
||||
{
|
||||
return mEvents[idx].get();
|
||||
}
|
||||
|
||||
std::size_t MidiTrack::GetNumEvents()
|
||||
{
|
||||
return mEvents.size();
|
||||
}
|
||||
|
||||
std::string MidiTrack::Serialize() const
|
||||
{
|
||||
std::string output = "MidiTrack\n";
|
||||
output += "Num Events: " + std::to_string(mEvents.size()) + "\n";
|
||||
return output;
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "MidiEvent.h"
|
||||
|
||||
class MidiEvent;
|
||||
using MidiEventPtr = std::unique_ptr<MidiEvent>;
|
||||
|
||||
class MidiTrack
|
||||
{
|
||||
public:
|
||||
|
||||
MidiTrack();
|
||||
|
||||
~MidiTrack();
|
||||
|
||||
void AddEvent(MidiEventPtr event);
|
||||
|
||||
MidiEvent* GetEvent(std::size_t idx) const;
|
||||
|
||||
std::size_t GetNumEvents();
|
||||
|
||||
std::string Serialize() const;
|
||||
|
||||
private:
|
||||
|
||||
std::vector<MidiEventPtr> mEvents;
|
||||
};
|
|
@ -1,72 +0,0 @@
|
|||
#include "MidiChannelEventAdapter.h"
|
||||
|
||||
#include "BinaryStream.h"
|
||||
#include "ByteUtils.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
|
||||
int MidiChannelEventAdapter::readEvent(std::ifstream* file, char firstByte, MidiChannelEvent* event, MidiChannelEvent::Type& lastEventType)
|
||||
{
|
||||
int first_four_bits = 0xF0;
|
||||
int second_four_bits = 0xF;
|
||||
int event_type = (firstByte & first_four_bits) >> 4;
|
||||
int midi_channel = (firstByte & second_four_bits) >> 4;
|
||||
unsigned byteCount = 0;
|
||||
//std::cout << "Channel: " << midi_channel << std::endl;
|
||||
|
||||
const bool isStatusByte = ByteUtils::MostSignificantBitIsOne(firstByte);
|
||||
if(isStatusByte)
|
||||
{
|
||||
event->SetTypeAndChannel(firstByte);
|
||||
lastEventType = event->GetType();
|
||||
}
|
||||
else
|
||||
{
|
||||
event->SetType(lastEventType);
|
||||
}
|
||||
//std::cout << "MC Type " << static_cast<int>(event->GetType()) << std::endl;
|
||||
switch(event->GetType())
|
||||
{
|
||||
case MidiChannelEvent::Type::NOTE_ON:
|
||||
case MidiChannelEvent::Type::NOTE_OFF:
|
||||
case MidiChannelEvent::Type::CONTROLLER:
|
||||
{
|
||||
if (isStatusByte)
|
||||
{
|
||||
byteCount += readEventData(file, event);
|
||||
}
|
||||
else
|
||||
{
|
||||
byteCount += readEventData(file, event, firstByte);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MidiChannelEvent::Type::PROGRAM:
|
||||
{
|
||||
int value0 = *BinaryStream::getNextByteAsInt(file);
|
||||
byteCount ++;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
//std::cout << "Unknown status event: " << std::bitset<8>(firstByte) << "|" << event_type <<std::endl;
|
||||
break;
|
||||
}
|
||||
return byteCount;
|
||||
}
|
||||
|
||||
int MidiChannelEventAdapter::readEventData(std::ifstream* file, MidiChannelEvent* event, char c)
|
||||
{
|
||||
int value0 = int(c);
|
||||
int value1 = *BinaryStream::getNextByteAsInt(file);
|
||||
event->SetValues(value0, value1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int MidiChannelEventAdapter::readEventData(std::ifstream* file, MidiChannelEvent* event)
|
||||
{
|
||||
int value0 = *BinaryStream::getNextByteAsInt(file);
|
||||
int value1 = *BinaryStream::getNextByteAsInt(file);
|
||||
event->SetValues(value0, value1);
|
||||
return 2;
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "MidiChannelEvent.h"
|
||||
|
||||
#include <fstream>
|
||||
|
||||
class MidiChannelEventAdapter
|
||||
{
|
||||
public:
|
||||
static int readEvent(std::ifstream* file, char firstByte, MidiChannelEvent* event, MidiChannelEvent::Type& lastEventType);
|
||||
|
||||
static int readEventData(std::ifstream* file, MidiChannelEvent* event, char c);
|
||||
static int readEventData(std::ifstream* file, MidiChannelEvent* event);
|
||||
};
|
|
@ -1,183 +0,0 @@
|
|||
#include "MidiMetaEventAdapter.h"
|
||||
|
||||
#include "BinaryStream.h"
|
||||
#include "ByteUtils.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
|
||||
int MidiMetaEventAdapter::ReadEvent(std::ifstream* file, MetaMidiEvent* event, int& lastMidiChannel)
|
||||
{
|
||||
unsigned byteCount = 0;
|
||||
char c;
|
||||
file->get(c);
|
||||
byteCount++;
|
||||
|
||||
event->SetType(c);
|
||||
|
||||
//std::cout << "Meta event type: " << std::hex << int(c) << std::dec<<std::endl;
|
||||
|
||||
switch (event->GetType())
|
||||
{
|
||||
case MetaMidiEvent::Type::SEQ_NUM:
|
||||
byteCount += ReadIntEvent(file, event, 2);
|
||||
break;
|
||||
case MetaMidiEvent::Type::TEXT:
|
||||
case MetaMidiEvent::Type::COPYRIGHT:
|
||||
case MetaMidiEvent::Type::TRACK_NAME:
|
||||
case MetaMidiEvent::Type::INSTRUMENT_NAME:
|
||||
case MetaMidiEvent::Type::MARKER:
|
||||
case MetaMidiEvent::Type::CUE_POINT:
|
||||
byteCount += ReadStringEvent(file, event);
|
||||
break;
|
||||
case MetaMidiEvent::Type::CHANNEL_PREFIX:
|
||||
byteCount += ReadChannelPrefixEvent(file, event, lastMidiChannel);
|
||||
break;
|
||||
case MetaMidiEvent::Type::END_TRACK:
|
||||
{
|
||||
int length = *BinaryStream::getNextByteAsInt(file);
|
||||
byteCount ++;
|
||||
break;
|
||||
}
|
||||
case MetaMidiEvent::Type::SMPTE_OFFSET:
|
||||
byteCount += ReadTimeCodeEvent(file, event);
|
||||
break;
|
||||
case MetaMidiEvent::Type::SET_TEMPO:
|
||||
byteCount += ReadIntEvent(file, event);
|
||||
break;
|
||||
case MetaMidiEvent::Type::TIME_SIG:
|
||||
byteCount += ReadTimeSignatureEvent(file, event);
|
||||
break;
|
||||
case MetaMidiEvent::Type::KEY_SIG:
|
||||
byteCount += ReadKeySignatureEvent(file, event);
|
||||
break;
|
||||
case MetaMidiEvent::Type::SEQ_CUSTOM:
|
||||
break;
|
||||
case MetaMidiEvent::Type::UNKNOWN:
|
||||
std::cout << "Unknown meta event " << std::bitset<8>(c) << "|" <<std::endl;
|
||||
byteCount += ReadUnknownEvent(file);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return byteCount;
|
||||
}
|
||||
|
||||
int MidiMetaEventAdapter::ReadUnknownEvent(std::ifstream* file)
|
||||
{
|
||||
int length = *BinaryStream::getNextByteAsInt(file);
|
||||
|
||||
char c;
|
||||
for(int idx=0; idx<length; idx++)
|
||||
{
|
||||
file->get(c);
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
int MidiMetaEventAdapter::ReadStringEvent(std::ifstream* file, MetaMidiEvent* event)
|
||||
{
|
||||
unsigned byteCount = 0;
|
||||
|
||||
int length = *BinaryStream::getNextByteAsInt(file);
|
||||
byteCount++;
|
||||
|
||||
std::string name;
|
||||
BinaryStream::getNextString(file, name, length);
|
||||
byteCount += length;
|
||||
event->SetLabel(name);
|
||||
return byteCount;
|
||||
}
|
||||
|
||||
int MidiMetaEventAdapter::ReadIntEvent(std::ifstream* file, MetaMidiEvent* event, int lengthIn)
|
||||
{
|
||||
unsigned byteCount = 0;
|
||||
int length = 0;
|
||||
if(lengthIn > -1)
|
||||
{
|
||||
length = lengthIn;
|
||||
}
|
||||
else
|
||||
{
|
||||
length = *BinaryStream::getNextByteAsInt(file);
|
||||
byteCount ++;
|
||||
}
|
||||
|
||||
std::string buffer;
|
||||
BinaryStream::getNextNBytes(file, buffer.data(), length);
|
||||
byteCount += length;
|
||||
|
||||
const int value = ByteUtils::ToType<ByteUtils::DWord>(buffer.data(), length);
|
||||
event->SetValue(value);
|
||||
return byteCount;
|
||||
}
|
||||
|
||||
int MidiMetaEventAdapter::ReadChannelPrefixEvent(std::ifstream* file, MetaMidiEvent* event, int& lastMidiChannel)
|
||||
{
|
||||
unsigned byteCount = 0;
|
||||
int length = *BinaryStream::getNextByteAsInt(file);
|
||||
byteCount ++;
|
||||
|
||||
std::string buffer;
|
||||
BinaryStream::getNextNBytes(file, buffer.data(), length);
|
||||
byteCount += length;
|
||||
|
||||
const int value = ByteUtils::ToType<ByteUtils::DWord>(buffer.data(), length);
|
||||
event->SetValue(value);
|
||||
lastMidiChannel = value;
|
||||
return byteCount;
|
||||
}
|
||||
|
||||
int MidiMetaEventAdapter::ReadTimeSignatureEvent(std::ifstream* file, MetaMidiEvent* event)
|
||||
{
|
||||
unsigned byteCount = 0;
|
||||
int length = *BinaryStream::getNextByteAsInt(file);
|
||||
byteCount++;
|
||||
|
||||
MidiTimeSignature timeSig;
|
||||
timeSig.mNumer = *BinaryStream::getNextByteAsInt(file);
|
||||
timeSig.mDenom = *BinaryStream::getNextByteAsInt(file);
|
||||
timeSig.mMetro = *BinaryStream::getNextByteAsInt(file);
|
||||
timeSig.mF32 = *BinaryStream::getNextByteAsInt(file);
|
||||
byteCount +=4;
|
||||
|
||||
if (length > 4)
|
||||
{
|
||||
char c;
|
||||
for(int idx=0; idx<length-4; idx++)
|
||||
{
|
||||
file->get(c);
|
||||
byteCount++;
|
||||
}
|
||||
}
|
||||
return byteCount;
|
||||
}
|
||||
|
||||
int MidiMetaEventAdapter::ReadKeySignatureEvent(std::ifstream* file, MetaMidiEvent* event)
|
||||
{
|
||||
unsigned byteCount = 0;
|
||||
int length = *BinaryStream::getNextByteAsInt(file);
|
||||
byteCount++;
|
||||
|
||||
MidiKeySignature keySig;
|
||||
keySig.mSharpsFlats = *BinaryStream::getNextByteAsInt(file);
|
||||
keySig.mMinor = *BinaryStream::getNextByteAsInt(file);
|
||||
byteCount +=2;
|
||||
return byteCount;
|
||||
}
|
||||
|
||||
int MidiMetaEventAdapter::ReadTimeCodeEvent(std::ifstream* file, MetaMidiEvent* event)
|
||||
{
|
||||
unsigned byteCount = 0;
|
||||
int length = *BinaryStream::getNextByteAsInt(file);
|
||||
byteCount++;
|
||||
|
||||
MidiSmtpeTimecode timeCode;
|
||||
timeCode.mHr = *BinaryStream::getNextByteAsInt(file);
|
||||
timeCode.mMin = *BinaryStream::getNextByteAsInt(file);
|
||||
timeCode.mSec = *BinaryStream::getNextByteAsInt(file);
|
||||
timeCode.mFrame = *BinaryStream::getNextByteAsInt(file);
|
||||
timeCode.mFrameFrac = *BinaryStream::getNextByteAsInt(file);
|
||||
byteCount +=5;
|
||||
return byteCount;
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "MetaMidiEvent.h"
|
||||
#include <fstream>
|
||||
|
||||
class MidiMetaEventAdapter
|
||||
{
|
||||
public:
|
||||
static int ReadEvent(std::ifstream* file, MetaMidiEvent* event, int& lastMidiChannel);
|
||||
|
||||
static int ReadIntEvent(std::ifstream* file, MetaMidiEvent* event, int length=-1);
|
||||
static int ReadStringEvent(std::ifstream* file, MetaMidiEvent* event);
|
||||
|
||||
static int ReadChannelPrefixEvent(std::ifstream* file, MetaMidiEvent* event, int& lastMidiChannel);
|
||||
static int ReadTimeSignatureEvent(std::ifstream* file, MetaMidiEvent* event);
|
||||
static int ReadKeySignatureEvent(std::ifstream* file, MetaMidiEvent* event);
|
||||
static int ReadTimeCodeEvent(std::ifstream* file, MetaMidiEvent* event);
|
||||
static int ReadUnknownEvent(std::ifstream* file);
|
||||
};
|
|
@ -1,153 +0,0 @@
|
|||
#include "MidiReader.h"
|
||||
|
||||
#include "MidiDocument.h"
|
||||
#include "ByteUtils.h"
|
||||
#include "MidiTrack.h"
|
||||
#include "BinaryStream.h"
|
||||
#include "FileLogger.h"
|
||||
#include "MidiElements.h"
|
||||
#include "MidiTimeAdapter.h"
|
||||
#include "MidiMetaEventAdapter.h"
|
||||
#include "MidiChannelEventAdapter.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
#include <bitset>
|
||||
|
||||
MidiReader::MidiReader()
|
||||
: mDocument(MidiDocument::Create()),
|
||||
mLastChannelEventType(MidiChannelEvent::Type::NONE)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
MidiDocument* MidiReader::getDocument() const
|
||||
{
|
||||
return mDocument.get();
|
||||
}
|
||||
|
||||
bool MidiReader::processHeader()
|
||||
{
|
||||
if(!BinaryStream::checkNextDWord(mFile->getInHandle(), HeaderLabel))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto length = BinaryStream::getNextDWord(mFile->getInHandle());
|
||||
if(!length)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto formatType = BinaryStream::getNextWord(mFile->getInHandle());
|
||||
if(!formatType)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
mDocument->SetFormatType(*formatType);
|
||||
|
||||
const auto expectedTracks = BinaryStream::getNextWord(mFile->getInHandle());
|
||||
if(!expectedTracks)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
mDocument->SetExpectedTracks(*expectedTracks);
|
||||
|
||||
MidiTimeDivision timeDivision;
|
||||
MidiTimeAdapter::ReadTimeDivision(mFile->getInHandle(), timeDivision);
|
||||
mDocument->SetTimeDivision(timeDivision);
|
||||
return true;
|
||||
}
|
||||
|
||||
int MidiReader::processEvent(MidiTrack* track)
|
||||
{
|
||||
int timeDelta {0};
|
||||
unsigned byteCount {0};
|
||||
byteCount += MidiTimeAdapter::ReadEventTimeDelta(mFile->getInHandle(), timeDelta);
|
||||
|
||||
char c;
|
||||
mFile->getInHandle()->get(c);
|
||||
//std::cout << "Event check: " << std::bitset<8>(c) << std::endl;
|
||||
byteCount++;
|
||||
if(MidiEvent::IsMetaEvent(c))
|
||||
{
|
||||
auto event = std::make_unique<MetaMidiEvent>();
|
||||
event->SetTimeDelta(timeDelta);
|
||||
//std::cout << "Meta event " <<std::endl;
|
||||
byteCount += MidiMetaEventAdapter::ReadEvent(mFile->getInHandle(), event.get(), mLastMidiChannel);
|
||||
track->AddEvent(std::move(event));
|
||||
}
|
||||
else if(MidiEvent::IsSysExEvent(c))
|
||||
{
|
||||
//std::cout << "Sysex event" << std::endl;
|
||||
}
|
||||
else
|
||||
{ // Midi event
|
||||
auto event = std::make_unique<MidiChannelEvent>();
|
||||
event->SetTimeDelta(timeDelta);
|
||||
//std::cout << "Midi event" << std::endl;
|
||||
byteCount += MidiChannelEventAdapter::readEvent(mFile->getInHandle(), c, event.get(), mLastChannelEventType);
|
||||
track->AddEvent(std::move(event));
|
||||
}
|
||||
return byteCount;
|
||||
}
|
||||
|
||||
bool MidiReader::processTrackChunk(bool debug)
|
||||
{
|
||||
if(!BinaryStream::checkNextDWord(mFile->getInHandle(), TrackChunkLabel))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto chunkSize = BinaryStream::getNextDWord(mFile->getInHandle());
|
||||
if(!chunkSize)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned byteCount = 0;
|
||||
auto track = std::make_unique<MidiTrack>();
|
||||
unsigned iter_count = 0;
|
||||
while(byteCount < static_cast<unsigned>(*chunkSize))
|
||||
{
|
||||
//std::cout << "-------------" << std::endl;
|
||||
byteCount += processEvent(track.get());
|
||||
//std::cout << "Track byte count: " << byteCount << " of " << *chunkSize << std::endl;
|
||||
if(debug && iter_count == 40)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
iter_count ++;
|
||||
}
|
||||
mDocument->AddTrack(std::move(track));
|
||||
return true;
|
||||
}
|
||||
|
||||
void MidiReader::read(const Path& path)
|
||||
{
|
||||
mFile = std::make_unique<File>(path);
|
||||
mFile->open(File::AccessMode::Read);
|
||||
if(!processHeader())
|
||||
{
|
||||
MLOG_ERROR("Problem processing header");
|
||||
return;
|
||||
}
|
||||
|
||||
int trackCount = 0;
|
||||
if(!processTrackChunk(false))
|
||||
{
|
||||
MLOG_ERROR("Problem processing track chunk");
|
||||
return;
|
||||
}
|
||||
trackCount++;
|
||||
|
||||
if(!processTrackChunk(true))
|
||||
{
|
||||
MLOG_ERROR("Problem processing track chunk");
|
||||
return;
|
||||
}
|
||||
trackCount++;
|
||||
|
||||
mFile->close();
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "MidiDocument.h"
|
||||
#include "MetaMidiEvent.h"
|
||||
#include "MidiTrack.h"
|
||||
#include "MidiChannelEvent.h"
|
||||
#include "File.h"
|
||||
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
|
||||
using Path = std::filesystem::path;
|
||||
|
||||
class MidiReader
|
||||
{
|
||||
static constexpr const char TrackChunkLabel[] = "MTrk";
|
||||
static constexpr const char HeaderLabel[] = "MThd";
|
||||
|
||||
public:
|
||||
MidiReader();
|
||||
|
||||
MidiDocument* getDocument() const;
|
||||
|
||||
void read(const Path& path);
|
||||
|
||||
private:
|
||||
bool processHeader();
|
||||
bool processTrackChunk(bool debug=false);
|
||||
int processEvent(MidiTrack* track);
|
||||
|
||||
private:
|
||||
std::unique_ptr<File> mFile;
|
||||
MidiDocumentPtr mDocument;
|
||||
int mLastMidiChannel {0};
|
||||
MidiChannelEvent::Type mLastChannelEventType;
|
||||
};
|
|
@ -1,66 +0,0 @@
|
|||
#include "MidiTimeAdapter.h"
|
||||
|
||||
#include "BinaryStream.h"
|
||||
#include "ByteUtils.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
|
||||
int MidiTimeAdapter::ReadEventTimeDelta(std::ifstream* file, int& delta)
|
||||
{
|
||||
unsigned byteCount = 0;
|
||||
char c;
|
||||
file->get(c);
|
||||
byteCount++;
|
||||
|
||||
if(!ByteUtils::MostSignificantBitIsOne(c))
|
||||
{
|
||||
delta = int(c);
|
||||
//std::cout << "Time delta final: " << delta << std::endl;
|
||||
return byteCount;
|
||||
}
|
||||
|
||||
int working_c = c;
|
||||
int final_c = 0;
|
||||
unsigned count = 0;
|
||||
//std::cout << "Working " << std::bitset<8>(working_c) << std::endl;
|
||||
while(unsigned(working_c >> 7) != 0)
|
||||
{
|
||||
char corrected = (working_c &= ~(1UL << 7));
|
||||
final_c <<= 7;
|
||||
final_c |= (corrected << 7*count);
|
||||
char file_c;
|
||||
file->get(file_c);
|
||||
byteCount++;
|
||||
working_c = int(file_c);
|
||||
//std::cout << "Working " << std::bitset<8>(working_c) << std::endl;
|
||||
count++;
|
||||
}
|
||||
//std::cout << "Time delta start: " << std::bitset<16>(final_c) << std::endl;
|
||||
final_c <<= 7;
|
||||
//std::cout << "Time delta pre: " << std::bitset<16>(final_c) << std::endl;
|
||||
final_c |= (working_c << 7*(count-1));
|
||||
|
||||
delta = int(final_c);
|
||||
//std::cout << "Time delta final: " << delta << "|" << std::bitset<16>(final_c)<< std::endl;
|
||||
return byteCount;
|
||||
}
|
||||
|
||||
int MidiTimeAdapter::ReadTimeDivision(std::ifstream* file, MidiTimeDivision& division)
|
||||
{
|
||||
const auto time_division = BinaryStream::getNextWord(file, false);
|
||||
if(!time_division)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
division.mUseFps = ByteUtils::GetWordFirstBit(*time_division);
|
||||
if (division.mUseFps)
|
||||
{
|
||||
const int TOP_7_BITS = 0x7F00; // 0111 1111 - 0000 0000
|
||||
division.mFps = ((~(*time_division) & TOP_7_BITS) >> 8) - 1; // Reverse 2complement of next 7 bits
|
||||
}
|
||||
|
||||
division.mTicks = ByteUtils::GetWordLastByte(*time_division);
|
||||
return 2; // Bytes advanced
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "MidiElements.h"
|
||||
|
||||
#include <fstream>
|
||||
|
||||
class MidiTimeAdapter
|
||||
{
|
||||
public:
|
||||
static int ReadEventTimeDelta(std::ifstream* file, int& delta);
|
||||
|
||||
static int ReadTimeDivision(std::ifstream* file, MidiTimeDivision& division);
|
||||
};
|
6
src/base/CMakeLists.txt
Normal file
6
src/base/CMakeLists.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
add_subdirectory(compiler)
|
||||
add_subdirectory(compression)
|
||||
add_subdirectory(core)
|
||||
add_subdirectory(database)
|
||||
add_subdirectory(geometry)
|
||||
add_subdirectory(network)
|
|
@ -1,6 +1,6 @@
|
|||
set(MODULE_NAME compiler)
|
||||
|
||||
list(APPEND TARGET_HEADERS
|
||||
list(APPEND HEADERS
|
||||
Lexer.h
|
||||
template_engine/TemplatingEngine.h
|
||||
template_engine/TemplateFile.h
|
||||
|
@ -8,7 +8,7 @@ list(APPEND TARGET_HEADERS
|
|||
template_engine/TemplateElements.h
|
||||
)
|
||||
|
||||
list(APPEND TARGET_SOURCES
|
||||
list(APPEND SOURCES
|
||||
Lexer.cpp
|
||||
template_engine/TemplatingEngine.cpp
|
||||
template_engine/TemplateFile.cpp
|
||||
|
@ -16,7 +16,7 @@ list(APPEND TARGET_SOURCES
|
|||
template_engine/TemplateElements.cpp
|
||||
)
|
||||
|
||||
add_library(${MODULE_NAME} SHARED ${TARGET_SOURCES} ${TARGET_HEADERS})
|
||||
add_library(${MODULE_NAME} SHARED ${HEADERS} ${SOURCES})
|
||||
|
||||
target_include_directories(${MODULE_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
|
@ -25,4 +25,4 @@ target_include_directories(${MODULE_NAME} PUBLIC
|
|||
target_link_libraries( ${MODULE_NAME} PUBLIC core)
|
||||
|
||||
set_target_properties( ${MODULE_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON )
|
||||
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER src)
|
||||
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER src/base)
|
|
@ -1,5 +1,6 @@
|
|||
set(MODULE_NAME compression)
|
||||
|
||||
list(APPEND compression_LIB_INCLUDES
|
||||
list(APPEND SOURCES
|
||||
StreamCompressor.cpp
|
||||
huffman/HuffmanEncoder.cpp
|
||||
huffman/HuffmanStream.cpp
|
||||
|
@ -13,14 +14,14 @@ list(APPEND compression_LIB_INCLUDES
|
|||
CyclicRedundancyChecker.cpp
|
||||
)
|
||||
|
||||
add_library(compression SHARED ${compression_LIB_INCLUDES})
|
||||
add_library(${MODULE_NAME} SHARED ${SOURCES})
|
||||
|
||||
target_include_directories(compression PUBLIC
|
||||
target_include_directories(${MODULE_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/deflate
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/huffman
|
||||
)
|
||||
|
||||
target_link_libraries(compression PUBLIC core)
|
||||
set_property(TARGET compression PROPERTY FOLDER src)
|
||||
set_target_properties( compression PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON )
|
||||
target_link_libraries(${MODULE_NAME} PUBLIC core)
|
||||
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER src/base)
|
||||
set_target_properties( ${MODULE_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON )
|
|
@ -26,7 +26,7 @@ list(APPEND HEADERS
|
|||
Win32BaseIncludes.h
|
||||
)
|
||||
|
||||
list(APPEND LIB_INCLUDES
|
||||
list(APPEND SOURCES
|
||||
Event.cpp
|
||||
Dictionary.cpp
|
||||
Color.cpp
|
||||
|
@ -53,7 +53,7 @@ list(APPEND LIB_INCLUDES
|
|||
http/HttpRequest.cpp
|
||||
serializers/TomlReader.cpp)
|
||||
|
||||
add_library(${MODULE_NAME} SHARED ${LIB_INCLUDES} ${HEADERS})
|
||||
add_library(${MODULE_NAME} SHARED ${SOURCES} ${HEADERS})
|
||||
|
||||
target_include_directories(${MODULE_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
|
@ -67,4 +67,4 @@ target_include_directories(${MODULE_NAME} PUBLIC
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/serializers
|
||||
)
|
||||
set_target_properties( ${MODULE_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON )
|
||||
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER src)
|
||||
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER src/base)
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue