Ardour  8.7-14-g57a6773833
analysis_graph.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 John Emmas <john@creativepost.co.uk>
3  * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
4  * Copyright (C) 2017 Paul Davis <paul@linuxaudiosystems.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #ifndef __ardour_analysis_graph_h__
22 #define __ardour_analysis_graph_h__
23 
24 #include <map>
25 #include <memory>
26 #include <set>
27 #include <cstring>
28 
29 #include "ardour/audioregion.h"
30 #include "ardour/audioplaylist.h"
31 #include "ardour/export_analysis.h"
33 
34 namespace AudioGrapher {
35  class Analyser;
36  template <typename T> class Chunker;
37  template <typename T> class Interleaver;
38 }
39 
40 namespace PBD {
41  class Progress;
42 }
43 
44 namespace ARDOUR {
45 
47  public:
50 
51  void analyze_region (ARDOUR::AudioRegion const*, bool raw = false, PBD::Progress* = 0);
52  void analyze_region (std::shared_ptr<ARDOUR::AudioRegion>, bool raw = false);
53 
54  void analyze_range (std::shared_ptr<ARDOUR::Route>, std::shared_ptr<ARDOUR::AudioPlaylist>, const std::list<TimelineRange>&);
55 
56  const AnalysisResults& results () const { return _results; }
57 
58  void cancel () { _canceled = true; }
59  bool canceled () const { return _canceled; }
60 
61  void set_total_samples (samplecnt_t p) { _samples_end = p; }
62  PBD::Signal2<void, samplecnt_t, samplecnt_t> Progress;
63 
64  private:
68 
71  float* _gainbuf;
74  bool _canceled;
75 
76  typedef std::shared_ptr<AudioGrapher::Analyser> AnalysisPtr;
77  typedef std::shared_ptr<AudioGrapher::Chunker<float> > ChunkerPtr;
78  typedef std::shared_ptr<AudioGrapher::Interleaver<Sample> > InterleaverPtr;
79 
83 };
84 } // namespace ARDOUR
85 #endif
samplecnt_t _max_chunksize
std::shared_ptr< AudioGrapher::Analyser > AnalysisPtr
samplecnt_t _samples_read
std::shared_ptr< AudioGrapher::Chunker< float > > ChunkerPtr
void set_total_samples(samplecnt_t p)
AnalysisResults _results
samplecnt_t _samples_end
PBD::Signal2< void, samplecnt_t, samplecnt_t > Progress
InterleaverPtr interleaver
void analyze_region(std::shared_ptr< ARDOUR::AudioRegion >, bool raw=false)
void analyze_region(ARDOUR::AudioRegion const *, bool raw=false, PBD::Progress *=0)
ARDOUR::Session * _session
AnalysisGraph(ARDOUR::Session *)
const AnalysisResults & results() const
ARDOUR::Sample * _buf
void analyze_range(std::shared_ptr< ARDOUR::Route >, std::shared_ptr< ARDOUR::AudioPlaylist >, const std::list< TimelineRange > &)
std::shared_ptr< AudioGrapher::Interleaver< Sample > > InterleaverPtr
ARDOUR::Sample * _mixbuf
A class that chunks process cycles into equal sized samples.
Definition: chunker.h:19
Interleaves many streams of non-interleaved data into one interleaved stream.
Definition: interleaver.h:22
#define LIBARDOUR_API
std::map< std::string, ExportAnalysisPtr > AnalysisResults
Temporal::samplecnt_t samplecnt_t
Definition: axis_view.h:42