Created a model for tracks

This commit is contained in:
Joel Holdsworth 2008-11-25 22:11:58 +00:00
parent cf4898e70f
commit 14df5bbb8d
9 changed files with 303 additions and 0 deletions

View file

@ -82,6 +82,12 @@ lumigui_SOURCES = \
$(lumigui_srcdir)/model/project.hpp \
$(lumigui_srcdir)/model/sequence.cpp \
$(lumigui_srcdir)/model/sequence.hpp \
$(lumigui_srcdir)/model/track.cpp \
$(lumigui_srcdir)/model/track.hpp \
$(lumigui_srcdir)/model/clip-track.cpp \
$(lumigui_srcdir)/model/clip-track.hpp \
$(lumigui_srcdir)/model/group-track.cpp \
$(lumigui_srcdir)/model/group-track.hpp \
$(lumigui_srcdir)/output/displayer.cpp \
$(lumigui_srcdir)/output/displayer.hpp \
$(lumigui_srcdir)/output/gdkdisplayer.cpp \

View file

@ -0,0 +1,33 @@
/*
clip-track.cpp - Implementation of a clip containing track object
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *****************************************************/
#include "clip-track.hpp"
namespace gui {
namespace model {
ClipTrack::ClipTrack()
{
}
} // namespace model
} // namespace gui

View file

@ -0,0 +1,52 @@
/*
clip-track.hpp - Declaration of a clip containing track object
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/**
* @file widgets/timeline/clip-track.hpp
* This file contains the definition of timeline track objects which
* contain clips.
*/
#ifndef CLIP_TRACK_HPP
#define CLIP_TRACK_HPP
#include "track.hpp"
namespace gui {
namespace model {
class ClipTrack : public Track
{
public:
ClipTrack();
private:
//std::vector<Clip*> clips;
};
} // namespace timeline
} // namespace gui
#endif // CLIP_TRACK_HPP

View file

@ -0,0 +1,46 @@
/*
group-track.cpp - Implementation of the timeline group track object
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *****************************************************/
#include "group-track.hpp"
namespace gui {
namespace model {
GroupTrack::GroupTrack()
{
}
void
GroupTrack::add_child_track(Track* child)
{
REQUIRE(child != NULL);
children.push_back(child);
}
const std::vector<Track*>&
GroupTrack::get_child_tracks() const
{
return children;
}
} // namespace model
} // namespace gui

View file

@ -0,0 +1,51 @@
/*
group-track.hpp - Declaration of the timeline group track object
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/** @file widgets/timeline/group-track.hpp
** This file contains the definition of group track timeline objects
*/
#ifndef GROUP_TRACK_HPP
#define GROUP_TRACK_HPP
#include "track.hpp"
namespace gui {
namespace model {
class GroupTrack : public Track
{
public:
GroupTrack();
void add_child_track(Track* child);
const std::vector<Track*>& get_child_tracks() const;
private:
//----- Data -----//
std::vector<Track*> children;
};
} // namespace model
} // namespace gui
#endif // GROUP_TRACK_HPP

View file

@ -42,5 +42,11 @@ Sequence::set_name(const Glib::ustring &name)
this->name = name;
}
const std::list<Track*>&
Sequence::get_tracks() const
{
return tracks;
}
} // namespace model
} // namespace gui

View file

@ -31,6 +31,8 @@
namespace gui {
namespace model {
class Track;
class Sequence
{
@ -41,8 +43,12 @@ public:
void set_name(const Glib::ustring &name);
const std::list<Track*>& get_tracks() const;
private:
Glib::ustring name;
std::list<Track*> tracks;
};
} // namespace model

50
src/gui/model/track.cpp Normal file
View file

@ -0,0 +1,50 @@
/*
track.cpp - Implementation of the Track class
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *****************************************************/
#include <boost/foreach.hpp>
#include "track.hpp"
namespace gui {
namespace model {
const std::vector<Track*> Track::NoChildren;
Track::Track()
{
}
const std::vector<Track*>&
Track::get_child_tracks() const
{
return NoChildren;
}
Glib::ustring
Track::get_title()
{
return "Hello";
}
} // namespace model
} // namespace gui

53
src/gui/model/track.hpp Normal file
View file

@ -0,0 +1,53 @@
/*
track.hpp - Definition of the Track class
Copyright (C) Lumiera.org
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/** @file track.hpp
** This file contains the definition of Track, a class which
** represents a track, and wraps proc layer data
*/
#include "../gtk-lumiera.hpp"
#ifndef TRACK_HPP
#define TRACK_HPP
namespace gui {
namespace model {
class Track
{
public:
Track();
void add_child_track(Track* child);
virtual const std::vector<Track*>& get_child_tracks() const;
Glib::ustring get_title();
private:
static const std::vector<Track*> NoChildren;
};
} // namespace model
} // namespace gui
#endif // TRACK_HPP