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/audiofilesource.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 field_edited (const Glib::ustring&, const Glib::ustring&);
104 void delete_row (const Gtk::TreeModel::iterator& iter);
106 void field_selected ();
107 void audition_status_changed (bool state);
110 class SoundFileBrowser : public ArdourDialog
113 SoundFileBrowser (std::string title, ARDOUR::Session* _s = 0);
114 virtual ~SoundFileBrowser () {};
116 virtual void set_session (ARDOUR::Session*);
119 Gtk::FileChooserWidget chooser;
120 SoundFileBox preview;
122 void update_preview ();
125 class SoundFileChooser : public SoundFileBrowser
128 SoundFileChooser (std::string title, ARDOUR::Session* _s = 0);
129 virtual ~SoundFileChooser () {};
131 std::string get_filename () {return chooser.get_filename();};
134 class SoundFileOmega : public SoundFileBrowser
137 SoundFileOmega (std::string title, ARDOUR::Session* _s);
138 virtual ~SoundFileOmega () {};
140 /* these are returned by the Dialog::run() method. note
141 that builtin GTK responses are all negative, leaving
142 positive values for application-defined responses.
145 const static int ResponseImport = 1;
146 const static int ResponseEmbed = 2;
148 std::vector<Glib::ustring> get_paths ();
151 void set_mode (Editing::ImportMode);
152 Editing::ImportMode get_mode ();
155 Gtk::CheckButton split_check;
156 Gtk::ComboBoxText mode_combo;
158 void mode_changed ();
160 static std::vector<std::string> mode_strings;
163 #endif // __ardour_sfdb_ui_h__