un-triple-buffer fastmeter (not finished), fix mixer strip name button, comment edito...
[ardour.git] / gtk2_ardour / sfdb_ui.cc
1 /*
2     Copyright (C) 2005 Paul Davis 
3     Written by Taybin Rutkin
4
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.
9
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.
14
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.
18
19
20 */
21
22 #include <gtkmm/box.h>
23 #include <gtkmm/stock.h>
24
25 #include <ardour/audio_library.h>
26
27 #include "sfdb_ui.h"
28
29 #include "i18n.h"
30
31 SoundFileBrowser::SoundFileBrowser (std::string title)
32         :
33         ArdourDialog(title),
34         chooser(Gtk::FILE_CHOOSER_ACTION_OPEN)
35 {
36         get_vbox()->pack_start(chooser);
37
38         show_all();
39 }
40
41 SoundFileChooser::SoundFileChooser (std::string title)
42         :
43         SoundFileBrowser(title)
44 {
45         add_button (Gtk::Stock::OPEN, Gtk::RESPONSE_OK);
46         add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
47
48         show_all();
49 }
50
51 SoundFileOmega::SoundFileOmega (std::string title)
52         :
53         SoundFileBrowser(title),
54         embed_btn (_("Embed")),
55         import_btn (_("Import")),
56         split_check (_("Split Channels"))
57 {
58         get_action_area()->pack_start(embed_btn);
59         get_action_area()->pack_start(import_btn);
60         add_button (Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE);
61
62         chooser.set_extra_widget(split_check);
63
64         embed_btn.signal_clicked().connect (mem_fun (*this, &SoundFileOmega::embed_clicked));
65         import_btn.signal_clicked().connect (mem_fun (*this, &SoundFileOmega::import_clicked));
66
67         show_all();
68 }
69
70 void
71 SoundFileOmega::embed_clicked ()
72 {
73         Embedded (chooser.get_filenames(), split_check.get_active());
74 }
75
76 void
77 SoundFileOmega::import_clicked ()
78 {
79         Imported (chooser.get_filenames(), split_check.get_active());
80 }
81