move ownership of an RT MIDI buffer from DiskIO to MidiPlaylist
[ardour.git] / libs / ardour / export_status.cc
1 /*
2  * Copyright (C) 2008-2012 Sakari Bergen <sakari.bergen@beatwaves.net>
3  * Copyright (C) 2008-2017 Paul Davis <paul@linuxaudiosystems.com>
4  * Copyright (C) 2009 David Robillard <d@drobilla.net>
5  * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #include <pbd/stacktrace.h>
23
24 #include "ardour/export_status.h"
25
26 namespace ARDOUR
27 {
28
29 ExportStatus::ExportStatus ()
30 {
31         init();
32 }
33
34 void
35 ExportStatus::init ()
36 {
37         Glib::Threads::Mutex::Lock l (_run_lock);
38         stop = false;
39         _running = false;
40         _aborted = false;
41         _errors = false;
42
43         active_job = Exporting;
44
45         total_timespans = 0;
46         timespan = 0;
47
48         total_samples = 0;
49         processed_samples = 0;
50
51         total_samples_current_timespan = 0;
52         processed_samples_current_timespan = 0;
53
54         total_postprocessing_cycles = 0;
55         current_postprocessing_cycle = 0;
56         result_map.clear();
57 }
58
59 void
60 ExportStatus::abort (bool error_occurred)
61 {
62         Glib::Threads::Mutex::Lock l (_run_lock);
63         _aborted = true;
64         _errors = _errors || error_occurred;
65         _running = false;
66 }
67
68 void
69 ExportStatus::finish (TransportRequestSource trs)
70 {
71         Glib::Threads::Mutex::Lock l (_run_lock);
72         set_running (false);
73         Finished (trs); /* EMIT SIGNAL */
74 }
75
76 } // namespace ARDOUR