Commit 231c0617 authored by Nicolas Carion's avatar Nicolas Carion

[Timeline2][Model] Slight change in the construction of a timeline object

parent 2d810289
......@@ -33,6 +33,12 @@ TimelineModel::TimelineModel() :
{
}
std::shared_ptr<TimelineModel> TimelineModel::construct()
{
std::shared_ptr<TimelineModel> ptr(new TimelineModel());
return ptr;
}
TimelineModel::~TimelineModel()
{
for(auto tracks : m_iteratorTable) {
......
......@@ -34,8 +34,16 @@ class ClipModel;
class TimelineModel
{
public:
/* @brief construct a timeline object and returns a pointer to the created object
*/
static std::shared_ptr<TimelineModel> construct();
protected:
/* @brief this constructor should not be called. Call the static construct instead
*/
TimelineModel();
public:
friend class TrackModel;
friend class ClipModel;
......
......@@ -15,7 +15,7 @@ std::default_random_engine g(42);
TEST_CASE("Basic creation/deletion of a track", "[TrackModel]")
{
std::shared_ptr<TimelineModel> timeline = std::make_shared<TimelineModel>();
std::shared_ptr<TimelineModel> timeline = TimelineModel::construct();
int id1 = TrackModel::construct(timeline);
REQUIRE(timeline->getTracksCount() == 1);
......@@ -41,7 +41,7 @@ TEST_CASE("Basic creation/deletion of a track", "[TrackModel]")
TEST_CASE("Basic creation/deletion of a clip", "[ClipModel]")
{
std::shared_ptr<TimelineModel> timeline = std::make_shared<TimelineModel>();
std::shared_ptr<TimelineModel> timeline = TimelineModel::construct();
Mlt::Factory::init( NULL );
Mlt::Profile profile;
......@@ -70,7 +70,7 @@ TEST_CASE("Basic creation/deletion of a clip", "[ClipModel]")
TEST_CASE("Insert a clip in a track and change track", "[ClipModel]")
{
std::shared_ptr<TimelineModel> timeline = std::make_shared<TimelineModel>();
std::shared_ptr<TimelineModel> timeline = TimelineModel::construct();
Mlt::Factory::init( NULL );
Mlt::Profile profile;
......@@ -104,7 +104,7 @@ TEST_CASE("Insert a clip in a track and change track", "[ClipModel]")
TEST_CASE("Check id unicity", "[ClipModel]")
{
std::shared_ptr<TimelineModel> timeline = std::make_shared<TimelineModel>();
std::shared_ptr<TimelineModel> timeline = TimelineModel::construct();
Mlt::Factory::init( NULL );
Mlt::Profile profile;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment