Ardour  9.0-pre0-582-g084a23a80d
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 #pragma once
24 
25 #include <stdint.h>
26 
28 #include "ardour/export_analysis.h"
29 #include "ardour/types.h"
30 
31 #include "pbd/signals.h"
32 
33 namespace ARDOUR
34 {
35 
37  public:
39  void init ();
40 
41  /* Status info */
42 
43  volatile bool stop;
44 
45  void abort (bool error_occurred = false);
46  bool aborted () const { return _aborted; }
47  bool errors () const { return _errors; }
48  bool running () const { return _running; }
49 
50  void set_running (bool r) {
51  assert (!_run_lock.trylock()); // must hold lock
52  _running = r;
53  }
54  Glib::Threads::Mutex& lock () { return _run_lock; }
55 
58 
59  void cleanup ();
60 
61  /* Progress info */
62 
63  volatile enum Progress {
69  Command }
71 
72  volatile uint32_t total_timespans;
73  volatile uint32_t timespan;
74  std::string timespan_name;
75 
78 
81 
82  volatile uint32_t total_postprocessing_cycles;
83  volatile uint32_t current_postprocessing_cycle;
84 
86 
87  private:
88  volatile bool _aborted;
89  volatile bool _errors;
90  volatile bool _running;
91 
92  Glib::Threads::Mutex _run_lock;
93 };
94 
95 } // namespace ARDOUR
96 
void set_running(bool r)
Definition: export_status.h:50
volatile bool _running
Definition: export_status.h:90
PBD::Signal< void(TransportRequestSource)> Finished
Definition: export_status.h:56
AnalysisResults result_map
Definition: export_status.h:85
volatile uint32_t total_timespans
Definition: export_status.h:72
void finish(TransportRequestSource)
volatile uint32_t current_postprocessing_cycle
Definition: export_status.h:83
bool running() const
Definition: export_status.h:48
bool aborted() const
Definition: export_status.h:46
volatile bool _errors
Definition: export_status.h:89
void abort(bool error_occurred=false)
bool errors() const
Definition: export_status.h:47
enum ARDOUR::ExportStatus::Progress active_job
volatile bool _aborted
Definition: export_status.h:88
Glib::Threads::Mutex _run_lock
Definition: export_status.h:92
volatile bool stop
Definition: export_status.h:43
volatile samplecnt_t total_samples_current_timespan
Definition: export_status.h:79
volatile samplecnt_t total_samples
Definition: export_status.h:76
volatile uint32_t timespan
Definition: export_status.h:73
volatile uint32_t total_postprocessing_cycles
Definition: export_status.h:82
volatile samplecnt_t processed_samples_current_timespan
Definition: export_status.h:80
Glib::Threads::Mutex & lock()
Definition: export_status.h:54
std::string timespan_name
Definition: export_status.h:74
volatile samplecnt_t processed_samples
Definition: export_status.h:77
#define LIBARDOUR_API
std::map< std::string, ExportAnalysisPtr > AnalysisResults
Temporal::samplecnt_t samplecnt_t