1087f4c4c69073956e3f12aafc91818505d33882
[ardour.git] / gtk2_ardour / export_range_markers_dialog.h
1 /*
2     Copyright (C) 2006 Andre Raue
3
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.
8
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.
13
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.
17
18 */
19
20 #ifndef __export_range_markers_dialog_h__
21 #define __export_range_markers_dialog_h__
22
23 #include <ardour/location.h>
24
25 #include "export_dialog.h"
26
27
28 class ExportRangeMarkersDialog : public ExportDialog 
29 {
30   public:
31         ExportRangeMarkersDialog (PublicEditor&);
32   
33   protected:
34         virtual bool is_filepath_valid(string &filepath);
35
36         void export_audio_data();
37
38         bool wants_dir() { return true; }
39   
40   private:
41         // keeps the duration of all range_markers before the current
42         vector<nframes_t>       range_markers_durations_aggregated;
43         vector<nframes_t>       range_markers_durations;
44         // duration of all range markers
45         nframes_t       total_duration;
46         // index of range marker, that get's exported right now
47         unsigned int    current_range_marker_index;
48         
49         // sets value of progress bar
50         virtual gint progress_timeout ();
51   
52         // initializes range_markers_durations_aggregated, range_markers_durations
53         // and total_duration
54         void init_progress_computing(ARDOUR::Locations::LocationList& locations);
55
56         // searches for a filename like "<filename><nr>.<postfix>" in path, that 
57         // does not exist
58     string get_target_filepath(string path, string filename, string postfix);
59
60         void process_range_markers_export(ARDOUR::Locations::LocationList&);
61 };
62
63
64 #endif // __export_range_markers_dialog_h__