fix keyboard event handling for host-provided plugin GUIs
[ardour2.git] / gtk2_ardour / export_region_dialog.cc
blobc2dc984d0423237520ea66ef07d5d8eb3ccb1dc1
1 /*
2 Copyright (C) 2006 Paul Davis
3 Author: Andre Raue
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include <cassert>
23 #include <pbd/pthread_utils.h>
24 #include <ardour/audioregion.h>
26 #include "export_region_dialog.h"
28 #include "i18n.h"
31 ExportRegionDialog::ExportRegionDialog (PublicEditor& editor, boost::shared_ptr<ARDOUR::Region> region)
32 : ExportDialog(editor)
34 set_title (_("Export Region"));
35 file_frame.set_label (_("Export to File")),
37 audio_region = boost::dynamic_pointer_cast<ARDOUR::AudioRegion>(region);
38 assert(audio_region);
40 do_not_allow_track_and_master_selection();
41 do_not_allow_channel_count_selection();
45 void
46 ExportRegionDialog::export_audio_data()
48 pthread_t thr;
49 pthread_create_and_store ("region export", &thr, 0, ExportRegionDialog::_export_region_thread, this);
51 gtk_main_iteration ();
52 while (spec.running) {
53 if (gtk_events_pending()) {
54 gtk_main_iteration ();
55 } else {
56 usleep (10000);
62 void*
63 ExportRegionDialog::_export_region_thread (void *arg)
65 PBD::notify_gui_about_thread_creation (pthread_self(), X_("Export Region"));
67 static_cast<ExportRegionDialog*>(arg)->export_region ();
68 return 0;
71 void
72 ExportRegionDialog::export_region ()
74 audio_region->exportme (getSession(), spec);