2 Copyright (C) 2005-2006 Paul Davis
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.
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.
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.
20 #ifndef __ardour_sfdb_ui_h__
21 #define __ardour_sfdb_ui_h__
25 #include <glibmm/ustring.h>
27 #include <sigc++/signal.h>
29 #include <gtkmm/box.h>
30 #include <gtkmm/button.h>
31 #include <gtkmm/checkbutton.h>
32 #include <gtkmm/comboboxtext.h>
33 #include <gtkmm/dialog.h>
34 #include <gtkmm/entry.h>
35 #include <gtkmm/filechooserwidget.h>
36 #include <gtkmm/frame.h>
37 #include <gtkmm/label.h>
39 #include <ardour/session.h>
40 #include <ardour/audiofilesource.h>
42 #include "ardour_dialog.h"
49 class SoundFileBox : public Gtk::VBox
53 virtual ~SoundFileBox () {};
55 void set_session (ARDOUR::Session* s);
56 bool setup_labels (const Glib::ustring& filename);
61 ARDOUR::Session* _session;
64 ARDOUR::SoundFileInfo sf_info;
71 Gtk::Label samplerate;
74 Gtk::Frame border_frame;
76 Gtk::TextView tags_entry;
84 Gtk::Button apply_btn;
86 bool tags_entry_left (GdkEventFocus* event);
87 void stop_btn_clicked ();
90 void audition_status_changed (bool state);
93 class SoundFileBrowser : public ArdourDialog
96 class FoundTagColumns : public Gtk::TreeModel::ColumnRecord
99 Gtk::TreeModelColumn<Glib::ustring> pathname;
101 FoundTagColumns() { add(pathname); }
104 FoundTagColumns found_list_columns;
105 Glib::RefPtr<Gtk::ListStore> found_list;
107 Gtk::RadioButtonGroup rgroup1;
108 Gtk::RadioButtonGroup rgroup2;
111 SoundFileBrowser (Gtk::Window& parent, std::string title, ARDOUR::Session* _s, int selected_tracks);
112 virtual ~SoundFileBrowser ();
114 virtual void set_session (ARDOUR::Session*);
115 std::vector<Glib::ustring> get_paths ();
117 Gtk::FileChooserWidget chooser;
118 Gtk::TreeView found_list_view;
120 Gtk::CheckButton split_files;
121 Gtk::CheckButton merge_stereo;
123 Gtk::ComboBoxText action_combo;
124 Gtk::ComboBoxText where_combo;
126 Gtk::RadioButton import;
127 Gtk::RadioButton embed;
129 Editing::ImportMode get_mode() const;
132 Editing::ImportMode mode;
133 Gtk::FileFilter custom_filter;
134 Gtk::FileFilter matchall_filter;
135 SoundFileBox preview;
137 static Glib::ustring persistent_folder;
139 Gtk::Entry found_entry;
140 Gtk::Button found_search_btn;
141 Gtk::Notebook notebook;
143 void update_preview ();
144 void found_list_view_selected ();
145 void found_list_view_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn*);
146 void found_search_clicked ();
148 void chooser_file_activated ();
150 bool on_custom (const Gtk::FileFilter::Info& filter_info);
152 int selected_track_cnt;
156 Gtk::VBox block_three;
157 Gtk::VBox block_four;
159 static bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
160 static bool check_link_status (const ARDOUR::Session&, const std::vector<Glib::ustring>& paths);
162 void reset_options ();
165 class SoundFileChooser : public SoundFileBrowser
168 SoundFileChooser (Gtk::Window& parent, std::string title, ARDOUR::Session* _s = 0);
169 virtual ~SoundFileChooser () {};
171 Glib::ustring get_filename ();
174 // SoundFileBrowser browser;
177 #endif // __ardour_sfdb_ui_h__