<gh_stars>1-10
//----------------------------------------------------------------------------------------------------------------------
//	CMediaTrack.cpp			©2020 <NAME>	All rights reserved.
//----------------------------------------------------------------------------------------------------------------------

#include "CMediaTrack.h"

#include "TReferenceTracking.h"

//----------------------------------------------------------------------------------------------------------------------
// MARK: CMediaTrackInternals

class CMediaTrackInternals : public TReferenceCountable<CMediaTrackInternals> {
	public:
		CMediaTrackInternals(const CMediaTrack::Info& info) :
			TReferenceCountable(),
					mInfo(info)
			{}

		CMediaTrack::Info	mInfo;
};

//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
// MARK: - CMediaTrack

// MARK: Lifecycle methods

//----------------------------------------------------------------------------------------------------------------------
CMediaTrack::CMediaTrack(const Info& info)
//----------------------------------------------------------------------------------------------------------------------
{
	// Setup
	mInternals = new CMediaTrackInternals(info);
}

//----------------------------------------------------------------------------------------------------------------------
CMediaTrack::CMediaTrack(const CMediaTrack& other)
//----------------------------------------------------------------------------------------------------------------------
{
	mInternals = other.mInternals->addReference();
}

//----------------------------------------------------------------------------------------------------------------------
CMediaTrack::~CMediaTrack()
//----------------------------------------------------------------------------------------------------------------------
{
	mInternals->removeReference();
}

// MARK: Instance methods

//----------------------------------------------------------------------------------------------------------------------
const CMediaTrack::Info& CMediaTrack::getInfo() const
//----------------------------------------------------------------------------------------------------------------------
{
	return mInternals->mInfo;
}
