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__
26 #include <glibmm/ustring.h>
28 #include <sigc++/signal.h>
30 #include <gtkmm/box.h>
31 #include <gtkmm/button.h>
32 #include <gtkmm/checkbutton.h>
33 #include <gtkmm/comboboxtext.h>
34 #include <gtkmm/dialog.h>
35 #include <gtkmm/entry.h>
36 #include <gtkmm/filechooserwidget.h>
37 #include <gtkmm/frame.h>
38 #include <gtkmm/label.h>
40 #include <ardour/session.h>
41 #include <ardour/audiofilesource.h>
43 #include "ardour_dialog.h"
50 class SoundFileBox : public Gtk::VBox
54 virtual ~SoundFileBox () {};
56 void set_session (ARDOUR::Session* s);
57 bool setup_labels (const Glib::ustring& filename);
62 ARDOUR::Session* _session;
65 ARDOUR::SoundFileInfo sf_info;
74 Gtk::Label samplerate;
77 Gtk::Label channels_value;
78 Gtk::Label samplerate_value;
80 Gtk::TextView format_text;
81 AudioClock length_clock;
82 AudioClock timecode_clock;
84 Gtk::Frame border_frame;
85 Gtk::Label preview_label;
87 Gtk::TextView tags_entry;
95 Gtk::Button apply_btn;
97 bool tags_entry_left (GdkEventFocus* event);
98 void stop_btn_clicked ();
101 void audition_status_changed (bool state);
102 sigc::connection audition_connection;
105 class SoundFileBrowser : public ArdourDialog
108 class FoundTagColumns : public Gtk::TreeModel::ColumnRecord
111 Gtk::TreeModelColumn<Glib::ustring> pathname;
113 FoundTagColumns() { add(pathname); }
116 FoundTagColumns found_list_columns;
117 Glib::RefPtr<Gtk::ListStore> found_list;
120 SoundFileBrowser (Gtk::Window& parent, std::string title, ARDOUR::Session* _s);
121 virtual ~SoundFileBrowser ();
123 virtual void set_session (ARDOUR::Session*);
124 std::vector<Glib::ustring> get_paths ();
126 Gtk::FileChooserWidget chooser;
127 Gtk::TreeView found_list_view;
130 bool resetting_ourselves;
132 Gtk::FileFilter custom_filter;
133 Gtk::FileFilter matchall_filter;
134 SoundFileBox preview;
136 static Glib::ustring persistent_folder;
138 Gtk::Entry found_entry;
139 Gtk::Button found_search_btn;
140 Gtk::Notebook notebook;
142 void update_preview ();
143 void found_list_view_selected ();
144 void found_list_view_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn*);
145 void found_search_clicked ();
147 void chooser_file_activated ();
149 bool on_custom (const Gtk::FileFilter::Info& filter_info);
151 virtual bool reset_options() { return true; }
154 class SoundFileChooser : public SoundFileBrowser
157 SoundFileChooser (Gtk::Window& parent, std::string title, ARDOUR::Session* _s = 0);
158 virtual ~SoundFileChooser () {};
160 Glib::ustring get_filename ();
163 // SoundFileBrowser browser;
166 class SoundFileOmega : public SoundFileBrowser
169 Gtk::RadioButtonGroup rgroup1;
170 Gtk::RadioButtonGroup rgroup2;
173 SoundFileOmega (Gtk::Window& parent, std::string title, ARDOUR::Session* _s, int selected_tracks);
175 void reset (int selected_tracks);
177 Gtk::ComboBoxText action_combo;
178 Gtk::ComboBoxText where_combo;
179 Gtk::ComboBoxText channel_combo;
181 Gtk::RadioButton import;
182 Gtk::RadioButton embed;
184 Editing::ImportMode get_mode() const;
185 Editing::ImportPosition get_position() const;
186 Editing::ImportDisposition get_channel_disposition() const;
189 uint32_t selected_track_cnt;
191 typedef std::map<Glib::ustring,Editing::ImportDisposition> DispositionMap;
192 DispositionMap disposition_map;
196 Gtk::VBox block_three;
197 Gtk::VBox block_four;
199 static bool check_multichannel_status (const std::vector<Glib::ustring>& paths, bool& same_size, bool& err);
200 static bool check_link_status (const ARDOUR::Session&, const std::vector<Glib::ustring>& paths);
202 void file_selection_changed ();
203 bool reset_options ();
204 void reset_options_noret ();
205 bool bad_file_message ();
208 #endif // __ardour_sfdb_ui_h__