Remove over 500 unnecessary includes (including 54 of session.h).
[ardour.git] / libs / ardour / ardour / export_timespan.h
1 /*
2     Copyright (C) 2008 Paul Davis
3     Author: Sakari Bergen
4
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.
9
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.
14
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.
18
19 */
20
21 #ifndef __ardour_export_timespan_h__
22 #define __ardour_export_timespan_h__
23
24 #include <string>
25
26 #include <boost/shared_ptr.hpp>
27
28 #include "ardour/types.h"
29
30 namespace ARDOUR
31 {
32
33 class ExportStatus;
34 class ExportChannel;
35 class ExportTempFile;
36
37 class ExportTimespan
38 {
39   private:
40         typedef boost::shared_ptr<ExportStatus> ExportStatusPtr;
41
42   private:
43         friend class ExportElementFactory;
44         ExportTimespan (ExportStatusPtr status, framecnt_t frame_rate);
45
46   public:
47         ~ExportTimespan ();
48
49         std::string name () const { return _name; }
50         void set_name (std::string name) { _name = name; }
51
52         std::string range_id () const { return _range_id; }
53         void set_range_id (std::string range_id) { _range_id = range_id; }
54
55         void set_range (framepos_t start, framepos_t end);
56         framecnt_t get_length () const { return end_frame - start_frame; }
57         framepos_t get_start () const { return start_frame; }
58         framepos_t get_end () const { return end_frame; }
59
60         /// Primarily compare start time, then end time
61         bool operator< (ExportTimespan const & other) {
62                 if (start_frame < other.start_frame) { return true; }
63                 if (start_frame > other.start_frame) { return false; }
64                 return end_frame < other.end_frame;
65         }
66
67   private:
68
69         ExportStatusPtr status;
70
71         framepos_t      start_frame;
72         framepos_t      end_frame;
73         framepos_t      position;
74         framecnt_t      frame_rate;
75
76         std::string _name;
77         std::string _range_id;
78
79 };
80
81 } // namespace ARDOUR
82
83 #endif /* __ardour_export_timespan_h__ */