2 * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef __ardour_analysis_graph_h__
20 #define __ardour_analysis_graph_h__
25 #include <boost/shared_ptr.hpp>
27 #include "ardour/audioregion.h"
28 #include "ardour/audioplaylist.h"
29 #include "ardour/export_analysis.h"
30 #include "ardour/libardour_visibility.h"
32 namespace AudioGrapher {
34 template <typename T> class Chunker;
35 template <typename T> class Interleaver;
39 class LIBARDOUR_API AnalysisGraph {
41 AnalysisGraph (ARDOUR::Session*);
44 void analyze_region (boost::shared_ptr<ARDOUR::AudioRegion>);
45 void analyze_range (boost::shared_ptr<ARDOUR::Route>, boost::shared_ptr<ARDOUR::AudioPlaylist>, const std::list<AudioRange>&);
46 const AnalysisResults& results () const { return _results; }
48 void cancel () { _canceled = true; }
49 bool canceled () const { return _canceled; }
51 void set_total_samples (samplecnt_t p) { _samples_end = p; }
52 PBD::Signal2<void, samplecnt_t, samplecnt_t> Progress;
55 ARDOUR::Session* _session;
56 AnalysisResults _results;
57 samplecnt_t _max_chunksize;
60 ARDOUR::Sample* _mixbuf;
62 samplecnt_t _samples_read;
63 samplecnt_t _samples_end;
66 typedef boost::shared_ptr<AudioGrapher::Analyser> AnalysisPtr;
67 typedef boost::shared_ptr<AudioGrapher::Chunker<float> > ChunkerPtr;
68 typedef boost::shared_ptr<AudioGrapher::Interleaver<Sample> > InterleaverPtr;
70 InterleaverPtr interleaver;