2 Copyright (C) 2000-2007 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (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., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_export_h__
21 #define __ardour_export_h__
27 #include <sigc++/signal.h>
30 #include <samplerate.h>
32 #include "ardour/ardour.h"
33 #include "ardour/gdither.h"
39 typedef std::pair<Port *, uint32_t> PortChannelPair;
40 typedef std::map<uint32_t, std::vector<PortChannelPair> > ExportPortMap;
42 struct ExportSpecification : public SF_INFO, public sigc::trackable {
44 ExportSpecification();
45 ~ExportSpecification ();
50 int prepare (nframes_t blocksize, nframes_t frame_rate);
52 int process (nframes_t nframes);
57 nframes_t sample_rate;
62 ExportPortMap port_map;
63 nframes_t start_frame;
65 GDitherType dither_type;
68 /* used exclusively during export */
75 nframes_t leftover_frames;
76 nframes_t max_leftover_frames;
78 nframes_t out_samples_max;
79 uint32_t sample_bytes;
82 nframes_t total_frames;
88 sigc::connection freewheel_connection;
90 /* shared between UI thread and audio thread */
92 volatile float progress; /* audio thread sets this */
93 volatile bool stop; /* UI sets this */
94 volatile bool running; /* audio thread sets to false when export is done */
101 #endif /* __ardour_export_h__ */