1 #ifndef LIBR2C2_TRACKCHAIN_H_
2 #define LIBR2C2_TRACKCHAIN_H_
6 #include <sigc++/trackable.h>
7 #include <msp/datafile/statement.h>
15 class bad_chain: public std::logic_error
18 bad_chain(const std::string &w): std::logic_error(w) { }
19 virtual ~bad_chain() throw() { }
23 class TrackChain: public sigc::trackable
26 typedef std::set<Track *> TrackSet;
38 sigc::signal<void, const std::string &> signal_name_changed;
39 sigc::signal<void, Track &> signal_track_added;
40 sigc::signal<void, Track &> signal_track_removed;
50 virtual ~TrackChain() { }
52 virtual void set_name(const std::string &);
53 const std::string &get_name() const { return name; }
55 void add_track(Track &);
56 void add_tracks(const TrackSet &);
58 virtual void on_track_added(Track &) { }
59 virtual Validity check_validity(Track &) const;
60 static void throw_bad_chain(Validity);
62 void update_ends(Track &);
64 const TrackSet &get_tracks() const { return tracks; }
65 bool has_track(Track &) const;
69 void object_removed(Object &);
72 virtual Msp::DataFile::Statement save_reference() const = 0;