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__
30 #include <sigc++/signal.h>
32 #include <gtkmm/box.h>
33 #include <gtkmm/button.h>
34 #include <gtkmm/checkbutton.h>
35 #include <gtkmm/dialog.h>
36 #include <gtkmm/entry.h>
37 #include <gtkmm/filechooserwidget.h>
38 #include <gtkmm/frame.h>
39 #include <gtkmm/label.h>
40 #include <gtkmm/liststore.h>
41 #include <gtkmm/treeview.h>
43 #include <ardour/session.h>
45 #include "ardour_dialog.h"
47 class SoundFileBox : public Gtk::VBox
51 virtual ~SoundFileBox () {};
53 bool update (std::string filename);
54 void set_session (ARDOUR::Session* s);
57 ARDOUR::Session* _session;
59 struct LabelModelColumns : public Gtk::TreeModel::ColumnRecord
62 Gtk::TreeModelColumn<std::string> field;
63 Gtk::TreeModelColumn<std::string> data;
65 LabelModelColumns() { add(field); add(data); }
68 LabelModelColumns label_columns;
76 Gtk::Entry path_entry;
80 Gtk::Label samplerate;
82 Gtk::TreeView field_view;
83 Glib::RefPtr<Gtk::ListStore> fields;
84 std::string selected_field;
86 Gtk::Frame border_frame;
95 Gtk::Button add_field_btn;
96 Gtk::Button remove_field_btn;
98 // void fields_refiller (Gtk::CList &clist);
99 int setup_labels (std::string filename);
100 void setup_fields ();
102 void play_btn_clicked ();
103 void stop_btn_clicked ();
104 void add_field_clicked ();
105 void remove_field_clicked ();
107 void field_selected ();
108 void audition_status_changed (bool state);
111 class SoundFileBrowser : public ArdourDialog
114 SoundFileBrowser (std::string title);
115 virtual ~SoundFileBrowser () {};
117 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);
129 virtual ~SoundFileChooser () {};
131 std::string get_filename () {return chooser.get_filename();};
134 class SoundFileOmega : public SoundFileBrowser
137 SoundFileOmega (std::string title);
138 virtual ~SoundFileOmega () {};
140 sigc::signal<void, std::vector<std::string>, bool> Embedded;
141 sigc::signal<void, std::vector<std::string>, bool> Imported;
144 Gtk::Button embed_btn;
145 Gtk::Button import_btn;
146 Gtk::CheckButton split_check;
148 void embed_clicked ();
149 void import_clicked ();
152 #endif // __ardour_sfdb_ui_h__