Ardour  8.12
export_status.h
Go to the documentation of this file.
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) 2008 Nick Mainsbridge <mainsbridge@gmail.com>
5  * Copyright (C) 2009-2012 David Robillard <d@drobilla.net>
6  * Copyright (C) 2016-2019 Robin Gareus <robin@gareus.org>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License along
19  * with this program; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22 
23 #ifndef __ardour_export_status_h__
24 #define __ardour_export_status_h__
25 
26 #include <stdint.h>
27 
29 #include "ardour/export_analysis.h"
30 #include "ardour/types.h"
31 
32 #include "pbd/signals.h"
33 
34 namespace ARDOUR
35 {
36 
38  public:
40  void init ();
41 
42  /* Status info */
43 
44  volatile bool stop;
45 
46  void abort (bool error_occurred = false);
47  bool aborted () const { return _aborted; }
48  bool errors () const { return _errors; }
49  bool running () const { return _running; }
50 
51  void set_running (bool r) {
52  assert (!_run_lock.trylock()); // must hold lock
53  _running = r;
54  }
55  Glib::Threads::Mutex& lock () { return _run_lock; }
56 
57  PBD::Signal1<void,TransportRequestSource> Finished;
59 
60  void cleanup ();
61 
62  /* Progress info */
63 
64  volatile enum Progress {
70  Command }
72 
73  volatile uint32_t total_timespans;
74  volatile uint32_t timespan;
75  std::string timespan_name;
76 
79 
82 
83  volatile uint32_t total_postprocessing_cycles;
84  volatile uint32_t current_postprocessing_cycle;
85 
87 
88  private:
89  volatile bool _aborted;
90  volatile bool _errors;
91  volatile bool _running;
92 
93  Glib::Threads::Mutex _run_lock;
94 };
95 
96 } // namespace ARDOUR
97 
98 #endif /* __ardour_export_status_h__ */
void set_running(bool r)
Definition: export_status.h:51
volatile bool _running
Definition: export_status.h:91
AnalysisResults result_map
Definition: export_status.h:86
volatile uint32_t total_timespans
Definition: export_status.h:73
void finish(TransportRequestSource)
volatile uint32_t current_postprocessing_cycle
Definition: export_status.h:84
bool running() const
Definition: export_status.h:49
bool aborted() const
Definition: export_status.h:47
volatile bool _errors
Definition: export_status.h:90
void abort(bool error_occurred=false)
bool errors() const
Definition: export_status.h:48
enum ARDOUR::ExportStatus::Progress active_job
volatile bool _aborted
Definition: export_status.h:89
Glib::Threads::Mutex _run_lock
Definition: export_status.h:93
volatile bool stop
Definition: export_status.h:44
volatile samplecnt_t total_samples_current_timespan
Definition: export_status.h:80
volatile samplecnt_t total_samples
Definition: export_status.h:77
volatile uint32_t timespan
Definition: export_status.h:74
volatile uint32_t total_postprocessing_cycles
Definition: export_status.h:83
PBD::Signal1< void, TransportRequestSource > Finished
Definition: export_status.h:57
volatile samplecnt_t processed_samples_current_timespan
Definition: export_status.h:81
Glib::Threads::Mutex & lock()
Definition: export_status.h:55
std::string timespan_name
Definition: export_status.h:75
volatile samplecnt_t processed_samples
Definition: export_status.h:78
#define LIBARDOUR_API
std::map< std::string, ExportAnalysisPtr > AnalysisResults
Temporal::samplecnt_t samplecnt_t