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 <sigc++/signal.h>
28 #include <gtkmm/box.h>
29 #include <gtkmm/button.h>
30 #include <gtkmm/checkbutton.h>
31 #include <gtkmm/dialog.h>
32 #include <gtkmm/entry.h>
33 #include <gtkmm/filechooserwidget.h>
34 #include <gtkmm/comboboxtext.h>
35 #include <gtkmm/frame.h>
36 #include <gtkmm/label.h>
38 #include <ardour/session.h>
39 #include <ardour/audiofilesource.h>
41 #include "ardour_dialog.h"
44 class SoundFileBox : public Gtk::VBox
48 virtual ~SoundFileBox () {};
50 void set_session (ARDOUR::Session* s);
51 bool setup_labels (std::string filename);
54 ARDOUR::Session* _session;
57 ARDOUR::SoundFileInfo sf_info;
64 Gtk::Label samplerate;
67 Gtk::Frame border_frame;
69 Gtk::Entry tags_entry;
78 Gtk::Button apply_btn;
80 bool tags_entry_left (GdkEventFocus* event);
81 void play_btn_clicked ();
82 void stop_btn_clicked ();
83 void apply_btn_clicked ();
85 void audition_status_changed (bool state);
88 class SoundFileBrowser : public ArdourDialog
91 SoundFileBrowser (std::string title, ARDOUR::Session* _s = 0);
92 virtual ~SoundFileBrowser () {};
94 virtual void set_session (ARDOUR::Session*);
97 Gtk::FileChooserWidget chooser;
100 void update_preview ();
103 class SoundFileChooser : public SoundFileBrowser
106 SoundFileChooser (std::string title, ARDOUR::Session* _s = 0);
107 virtual ~SoundFileChooser () {};
109 std::string get_filename () {return chooser.get_filename();};
112 class SoundFileOmega : public SoundFileBrowser
115 SoundFileOmega (std::string title, ARDOUR::Session* _s);
116 virtual ~SoundFileOmega () {};
118 /* these are returned by the Dialog::run() method. note
119 that builtin GTK responses are all negative, leaving
120 positive values for application-defined responses.
123 const static int ResponseImport = 1;
124 const static int ResponseEmbed = 2;
126 std::vector<Glib::ustring> get_paths ();
129 void set_mode (Editing::ImportMode);
130 Editing::ImportMode get_mode ();
133 Gtk::CheckButton split_check;
134 Gtk::ComboBoxText mode_combo;
136 void mode_changed ();
138 static std::vector<std::string> mode_strings;
141 #endif // __ardour_sfdb_ui_h__