Restructured model track tree, and improved child access
This commit is contained in:
parent
efa4847a61
commit
6cbd4282c1
11 changed files with 62 additions and 61 deletions
|
|
@ -80,14 +80,14 @@ lumigui_SOURCES = \
|
|||
$(lumigui_srcdir)/widgets/timeline/timeline-clip.hpp \
|
||||
$(lumigui_srcdir)/model/project.cpp \
|
||||
$(lumigui_srcdir)/model/project.hpp \
|
||||
$(lumigui_srcdir)/model/track-base.cpp \
|
||||
$(lumigui_srcdir)/model/track-base.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/parent-track.cpp \
|
||||
$(lumigui_srcdir)/model/parent-track.hpp \
|
||||
$(lumigui_srcdir)/model/sequence.cpp \
|
||||
$(lumigui_srcdir)/model/sequence.hpp \
|
||||
$(lumigui_srcdir)/model/group-track.cpp \
|
||||
$(lumigui_srcdir)/model/group-track.hpp \
|
||||
$(lumigui_srcdir)/model/clip.cpp \
|
||||
|
|
|
|||
|
|
@ -28,12 +28,6 @@ namespace model {
|
|||
GroupTrack::GroupTrack()
|
||||
{
|
||||
}
|
||||
|
||||
const std::list< boost::shared_ptr<model::Track> >&
|
||||
GroupTrack::get_child_tracks() const
|
||||
{
|
||||
return children;
|
||||
}
|
||||
|
||||
} // namespace model
|
||||
} // namespace gui
|
||||
|
|
|
|||
|
|
@ -26,22 +26,16 @@
|
|||
#ifndef GROUP_TRACK_HPP
|
||||
#define GROUP_TRACK_HPP
|
||||
|
||||
#include "track.hpp"
|
||||
#include "parent-track.hpp"
|
||||
|
||||
namespace gui {
|
||||
namespace model {
|
||||
|
||||
class GroupTrack : public Track
|
||||
class GroupTrack : public ParentTrack
|
||||
{
|
||||
public:
|
||||
GroupTrack();
|
||||
|
||||
const std::list< boost::shared_ptr<model::Track> >&
|
||||
get_child_tracks() const;
|
||||
|
||||
private:
|
||||
//----- Data -----//
|
||||
std::list< boost::shared_ptr<Track> > children;
|
||||
|
||||
};
|
||||
|
||||
} // namespace model
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
track-base.cpp - Implementation of the TrackBase class
|
||||
parent-track-.cpp - Implementation of the ParentTrack class
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
|
||||
|
|
@ -20,31 +20,35 @@
|
|||
|
||||
* *****************************************************/
|
||||
|
||||
#include "track.hpp"
|
||||
#include "parent-track.hpp"
|
||||
|
||||
namespace gui {
|
||||
namespace model {
|
||||
|
||||
const std::list< boost::shared_ptr<Track> > TrackBase::NoChildren;
|
||||
|
||||
TrackBase::TrackBase()
|
||||
ParentTrack::ParentTrack()
|
||||
{
|
||||
}
|
||||
|
||||
const std::list< boost::shared_ptr<model::Track> >&
|
||||
TrackBase::get_child_tracks() const
|
||||
std::list< boost::shared_ptr<Track> >
|
||||
ParentTrack::get_child_tracks() const
|
||||
{
|
||||
return NoChildren;
|
||||
return tracks.to_list();
|
||||
}
|
||||
|
||||
lumiera::observable_list< boost::shared_ptr<Track> >&
|
||||
ParentTrack::get_child_track_list()
|
||||
{
|
||||
return tracks;
|
||||
}
|
||||
|
||||
const Glib::ustring
|
||||
TrackBase::get_name() const
|
||||
ParentTrack::get_name() const
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
void
|
||||
TrackBase::set_name(const Glib::ustring &name)
|
||||
ParentTrack::set_name(const Glib::ustring &name)
|
||||
{
|
||||
this->name = name;
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
track-track.hpp - Definition of the TrackBase class
|
||||
parent-track.hpp - Definition of the ParentTrack class
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2008, Joel Holdsworth <joel@airwebreathe.org.uk>
|
||||
|
|
@ -19,43 +19,48 @@
|
|||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
*/
|
||||
/** @file track-base.hpp
|
||||
** This file contains the definition of TrackBase, a class which
|
||||
/** @file parent-track.hpp
|
||||
** This file contains the definition of ParentTrack, a class which
|
||||
** represents a base functionality for tracks and sequences which
|
||||
** are also track parents. This class wraps proc layer data
|
||||
*/
|
||||
|
||||
#include "../gtk-lumiera.hpp"
|
||||
#include "track.hpp"
|
||||
#include "../../common/observable-list.hpp"
|
||||
|
||||
#ifndef TRACK_BASE_HPP
|
||||
#define TRACK_BASE_HPP
|
||||
#ifndef PARENT_TRACK_HPP
|
||||
#define PARENT_TRACK_HPP
|
||||
|
||||
namespace gui {
|
||||
namespace model {
|
||||
|
||||
class Track;
|
||||
|
||||
class TrackBase
|
||||
class ParentTrack : public Track
|
||||
{
|
||||
protected:
|
||||
ParentTrack();
|
||||
|
||||
public:
|
||||
TrackBase();
|
||||
|
||||
virtual void add_child_track(Track* child) {};
|
||||
|
||||
virtual const std::list< boost::shared_ptr<Track> >&
|
||||
|
||||
std::list< boost::shared_ptr<Track> >
|
||||
get_child_tracks() const;
|
||||
|
||||
lumiera::observable_list< boost::shared_ptr<Track> >&
|
||||
get_child_track_list();
|
||||
|
||||
const Glib::ustring get_name() const;
|
||||
|
||||
void set_name(const Glib::ustring &name);
|
||||
|
||||
private:
|
||||
//----- Data -----//
|
||||
Glib::ustring name;
|
||||
|
||||
static const std::list< boost::shared_ptr<Track> > NoChildren;
|
||||
protected:
|
||||
lumiera::observable_list< boost::shared_ptr<Track> > tracks;
|
||||
};
|
||||
|
||||
} // namespace model
|
||||
} // namespace gui
|
||||
|
||||
#endif // TRACK_BASE_HPP
|
||||
#endif // PARENT_TRACK_HPP
|
||||
|
|
@ -49,11 +49,5 @@ Sequence::Sequence()
|
|||
// END TEST CODE
|
||||
}
|
||||
|
||||
const std::list< boost::shared_ptr<Track> >&
|
||||
Sequence::get_child_tracks() const
|
||||
{
|
||||
return tracks;
|
||||
}
|
||||
|
||||
} // namespace model
|
||||
} // namespace gui
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
#ifndef SEQUENCE_HPP
|
||||
#define SEQUENCE_HPP
|
||||
|
||||
#include "track-base.hpp"
|
||||
#include "parent-track.hpp"
|
||||
|
||||
// TEST CODE
|
||||
#include "group-track.hpp"
|
||||
|
|
@ -38,17 +38,14 @@ namespace model {
|
|||
|
||||
class Track;
|
||||
|
||||
class Sequence : public TrackBase
|
||||
class Sequence : public ParentTrack
|
||||
{
|
||||
public:
|
||||
Sequence();
|
||||
|
||||
const std::list< boost::shared_ptr<model::Track> >&
|
||||
get_child_tracks() const;
|
||||
|
||||
private:
|
||||
//----- Data -----//
|
||||
std::list< boost::shared_ptr<Track> > tracks;
|
||||
|
||||
};
|
||||
|
||||
} // namespace model
|
||||
|
|
|
|||
|
|
@ -24,11 +24,19 @@
|
|||
|
||||
namespace gui {
|
||||
namespace model {
|
||||
|
||||
const std::list< boost::shared_ptr<Track> > Track::NoChildren;
|
||||
|
||||
Track::Track()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::list< boost::shared_ptr<Track> >
|
||||
Track::get_child_tracks() const
|
||||
{
|
||||
return Track::NoChildren;
|
||||
}
|
||||
|
||||
} // namespace model
|
||||
} // namespace gui
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
** represents a track, and wraps proc layer data
|
||||
*/
|
||||
|
||||
#include "track-base.hpp"
|
||||
#include "../gtk-lumiera.hpp"
|
||||
|
||||
#ifndef TRACK_HPP
|
||||
#define TRACK_HPP
|
||||
|
|
@ -32,12 +32,17 @@
|
|||
namespace gui {
|
||||
namespace model {
|
||||
|
||||
class Track : public TrackBase
|
||||
class Track
|
||||
{
|
||||
public:
|
||||
protected:
|
||||
Track();
|
||||
|
||||
public:
|
||||
virtual std::list< boost::shared_ptr<Track> >
|
||||
get_child_tracks() const;
|
||||
|
||||
protected:
|
||||
static const std::list< boost::shared_ptr<Track> > NoChildren;
|
||||
};
|
||||
|
||||
} // namespace model
|
||||
|
|
|
|||
|
|
@ -497,7 +497,7 @@ TimelineHeaderContainer::lookup_timeline_track(
|
|||
return timeline_track;
|
||||
}
|
||||
|
||||
const std::list< boost::shared_ptr<model::Track> >&
|
||||
const std::list< boost::shared_ptr<model::Track> >
|
||||
TimelineHeaderContainer::get_tracks() const
|
||||
{
|
||||
REQUIRE(timelineWidget != NULL);
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ private:
|
|||
* @return Returns the track found, or returns NULL if no matching
|
||||
* track was found.
|
||||
**/
|
||||
const std::list< boost::shared_ptr<model::Track> >&
|
||||
const std::list< boost::shared_ptr<model::Track> >
|
||||
get_tracks() const;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue