2 Copyright (C) 2005 Paul Davis
3 Written by Taybin Rutkin
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.
22 #ifndef __ardour_sfdb_ui_h__
23 #define __ardour_sfdb_ui_h__
28 #include <sigc++/signal.h>
30 #include <gtkmm/box.h>
31 #include <gtkmm/button.h>
32 #include <gtkmm/checkbutton.h>
33 #include <gtkmm/dialog.h>
34 #include <gtkmm/entry.h>
35 #include <gtkmm/filechooserwidget.h>
36 #include <gtkmm/comboboxtext.h>
37 #include <gtkmm/frame.h>
38 #include <gtkmm/label.h>
39 #include <gtkmm/liststore.h>
40 #include <gtkmm/treeview.h>
42 #include <ardour/session.h>
43 #include <ardour/externalsource.h>
45 #include "ardour_dialog.h"
48 class SoundFileBox : public Gtk::VBox
52 virtual ~SoundFileBox () {};
54 void set_session (ARDOUR::Session* s);
55 bool setup_labels (std::string filename);
58 ARDOUR::Session* _session;
61 struct LabelModelColumns : public Gtk::TreeModel::ColumnRecord
64 Gtk::TreeModelColumn<std::string> field;
65 Gtk::TreeModelColumn<std::string> data;
67 LabelModelColumns() { add(field); add(data); }
70 LabelModelColumns label_columns;
72 ARDOUR::SoundFileInfo sf_info;
79 Gtk::Label samplerate;
81 Gtk::TreeView field_view;
82 Glib::RefPtr<Gtk::ListStore> fields;
83 std::string selected_field;
85 Gtk::Frame border_frame;
94 Gtk::Button add_field_btn;
95 Gtk::Button remove_field_btn;
99 void play_btn_clicked ();
100 void stop_btn_clicked ();
101 void add_field_clicked ();
102 void remove_field_clicked ();
103 void delete_row (const Gtk::TreeModel::iterator& iter);
105 void field_selected ();
106 void audition_status_changed (bool state);
109 class SoundFileBrowser : public ArdourDialog
112 SoundFileBrowser (std::string title);
113 virtual ~SoundFileBrowser () {};
115 virtual void set_session (ARDOUR::Session*);
118 Gtk::FileChooserWidget chooser;
119 SoundFileBox preview;
121 void update_preview ();
124 class SoundFileChooser : public SoundFileBrowser
127 SoundFileChooser (std::string title);
128 virtual ~SoundFileChooser () {};
130 std::string get_filename () {return chooser.get_filename();};
133 class SoundFileOmega : public SoundFileBrowser
136 SoundFileOmega (std::string title);
137 virtual ~SoundFileOmega () {};
139 /* these are returned by the Dialog::run() method. note
140 that builtin GTK responses are all negative, leaving
141 positive values for application-defined responses.
144 const static int ResponseImport = 1;
145 const static int ResponseEmbed = 2;
147 std::vector<Glib::ustring> get_paths ();
150 void set_mode (Editing::ImportMode);
151 Editing::ImportMode get_mode ();
154 Gtk::CheckButton split_check;
155 Gtk::ComboBoxText mode_combo;
157 void mode_changed ();
159 static std::vector<std::string> mode_strings;
162 #endif // __ardour_sfdb_ui_h__