af144746f71c0ed01ae36349209a5188ea009930
[ardour.git] / libs / ardour / export_status.cc
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 #include <ardour/export_status.h>
22
23 namespace ARDOUR
24 {
25
26 ExportStatus::ExportStatus ()
27 {
28         init();
29 }
30
31 void
32 ExportStatus::init ()
33 {
34         stop = false;
35         running = false;
36         _aborted = false;
37         _finished = false;
38         _errors = false;
39         
40         stage = export_None;
41         progress = 0.0;
42         
43         total_timespans = 0;
44         timespan = 0;
45         
46         total_channel_configs = 0;
47         channel_config = 0;
48         
49         total_formats = 0;
50         format = 0;
51 }
52
53 void
54 ExportStatus::abort (bool error_occurred)
55 {
56         _aborted = true;
57         _finished = true;
58         _errors = _errors || error_occurred;
59         running = false;
60         Aborting ();
61 }
62
63 void
64 ExportStatus::finish ()
65 {
66         _finished = true;
67         running = false;
68         Finished();
69 }
70
71 } // namespace ARDOUR