#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>;
