7d231c62d5f84bd39d749e057404541f5f2e3f98
[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         Gtk::FileChooserAction browse_action() const;
34
35   protected:
36         virtual bool is_filepath_valid(string &filepath);
37
38         void export_audio_data();
39
40         bool wants_dir() { return true; }
41   
42   private:
43         // keeps the duration of all range_markers before the current
44         vector<nframes_t>       range_markers_durations_aggregated;
45         vector<nframes_t>       range_markers_durations;
46         // duration of all range markers
47         nframes_t       total_duration;
48         // index of range marker, that get's exported right now
49         unsigned int    current_range_marker_index;
50         
51         // sets value of progress bar
52         virtual gint progress_timeout ();
53   
54         // initializes range_markers_durations_aggregated, range_markers_durations
55         // and total_duration
56         void init_progress_computing(ARDOUR::Locations::LocationList& locations);
57
58         // searches for a filename like "<filename><nr>.<postfix>" in path, that 
59         // does not exist
60     string get_target_filepath(string path, string filename, string postfix);
61
62         void process_range_markers_export(ARDOUR::Locations::LocationList&);
63 };
64
65
66 #endif // __export_range_markers_dialog_h__