add basic, not terribly glossy MIDI region export
[ardour.git] / gtk2_ardour / midi_export_dialog.cc
1 /*
2     Copyright (C) 2012 Paul Davis
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 #include <gtkmm/stock.h>
21
22 #include "ardour/midi_region.h"
23
24 #include "midi_export_dialog.h"
25
26 using namespace ARDOUR;
27
28 MidiExportDialog::MidiExportDialog (PublicEditor&, boost::shared_ptr<MidiRegion> region)
29         : ArdourDialog (string_compose (_("Export MIDI: %1"), region->name()))
30         , file_chooser (Gtk::FILE_CHOOSER_ACTION_SAVE)
31 {
32         add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
33         add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
34         get_vbox()->pack_start (file_chooser);
35         file_chooser.set_filename (region->name() + ".mid");
36         file_chooser.show ();
37 }
38
39 MidiExportDialog::~MidiExportDialog ()
40 {
41 }
42
43 std::string
44 MidiExportDialog::get_path () const
45 {
46         return file_chooser.get_filename ();
47         
48 }