2 Copyright (C) 2008 Paul Davis
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __ardour_export_timespan_h__
22 #define __ardour_export_timespan_h__
26 #include <boost/shared_ptr.hpp>
28 #include "ardour/libardour_visibility.h"
29 #include "ardour/types.h"
38 class LIBARDOUR_API ExportTimespan
41 typedef boost::shared_ptr<ExportStatus> ExportStatusPtr;
44 friend class ExportElementFactory;
45 ExportTimespan (ExportStatusPtr status, samplecnt_t sample_rate);
50 std::string name () const { return _name; }
51 void set_name (std::string name) { _name = name; }
53 std::string range_id () const { return _range_id; }
54 void set_range_id (std::string range_id) { _range_id = range_id; }
56 bool realtime () const { return _realtime; }
57 void set_realtime (bool rt) { _realtime = rt; }
59 void set_range (samplepos_t start, samplepos_t end);
60 samplecnt_t get_length () const { return end_sample - start_sample; }
61 samplepos_t get_start () const { return start_sample; }
62 samplepos_t get_end () const { return end_sample; }
64 /// Primarily compare start time, then end time
65 bool operator< (ExportTimespan const & other) {
66 if (start_sample < other.start_sample) { return true; }
67 if (start_sample > other.start_sample) { return false; }
68 return end_sample < other.end_sample;
73 ExportStatusPtr status;
75 samplepos_t start_sample;
76 samplepos_t end_sample;
78 samplecnt_t sample_rate;
81 std::string _range_id;
88 #endif /* __ardour_export_timespan_h__ */