diff options
author | Taybin Rutkin <taybin@taybin.com> | 2005-12-07 22:57:47 +0000 |
---|---|---|
committer | Taybin Rutkin <taybin@taybin.com> | 2005-12-07 22:57:47 +0000 |
commit | 6039331bea9afb0ce8888659832a04b39ff6be7a (patch) | |
tree | cf22ad447eb565085d09849f8f4fed44973fad3b /gtk2_ardour/sfdb_ui.cc | |
parent | 03872f0916498ccaab0b9b2c73fdba5d21952b63 (diff) |
Part one of the sfdb reworking.
git-svn-id: svn://localhost/trunk/ardour2@180 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/sfdb_ui.cc')
-rw-r--r-- | gtk2_ardour/sfdb_ui.cc | 115 |
1 files changed, 114 insertions, 1 deletions
diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index 5b71a62cb5..574e94ca27 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -28,16 +28,129 @@ #include "i18n.h" +SoundFileBox::SoundFileBox (ARDOUR::Session* session) + : + current_pid(0), + fields(Gtk::ListStore::create(label_columns)), + main_box (false, 3), + top_box (true, 4), + bottom_box (true, 4), + play_btn(_("Play")), + stop_btn(_("Stop")), + add_field_btn(_("Add Field...")), + remove_field_btn(_("Remove Field")) +{ + set_name (X_("SoundFileBox")); + border_frame.set_label (_("Soundfile Info")); + border_frame.add (main_box); + + pack_start (border_frame); + set_border_width (4); + + path_box.set_spacing (4); + path_box.pack_start (path, false, false); + path_box.pack_start (path_entry, true, true); + + main_box.set_border_width (4); + + main_box.pack_start(label, false, false); + main_box.pack_start(path_box, false, false); + main_box.pack_start(length, false, false); + main_box.pack_start(format, false, false); + main_box.pack_start(channels, false, false); + main_box.pack_start(samplerate, false, false); + main_box.pack_start(field_view, true, true); + main_box.pack_start(top_box, false, false); + main_box.pack_start(bottom_box, false, false); + + field_view.set_size_request(200, 150); + top_box.set_homogeneous(true); + top_box.pack_start(add_field_btn); + top_box.pack_start(remove_field_btn); + + remove_field_btn.set_sensitive(false); + + bottom_box.set_homogeneous(true); + bottom_box.pack_start(play_btn); + bottom_box.pack_start(stop_btn); + + play_btn.signal_clicked().connect (mem_fun (*this, &SoundFileBox::play_btn_clicked)); + stop_btn.signal_clicked().connect (mem_fun (*this, &SoundFileBox::stop_btn_clicked)); + + if (!session) { + play_btn.set_sensitive(false); + } else { + session->AuditionActive.connect(mem_fun (*this, &SoundFileBox::audition_status_changed)); + } + + add_field_btn.signal_clicked().connect + (mem_fun (*this, &SoundFileBox::add_field_clicked)); + remove_field_btn.signal_clicked().connect + (mem_fun (*this, &SoundFileBox::remove_field_clicked)); + + field_view.get_selection()->signal_changed().connect (mem_fun (*this, &SoundFileBox::field_selected)); + ARDOUR::Library->fields_changed.connect (mem_fun (*this, &SoundFileBox::setup_fields)); + + show_all(); + stop_btn.hide(); +} + +int +SoundFileBox::setup_labels (string filename) +{return 0;} + +void +SoundFileBox::setup_fields () +{} + +void +SoundFileBox::play_btn_clicked () +{} + +void +SoundFileBox::stop_btn_clicked () +{} + +void +SoundFileBox::add_field_clicked () +{} + +void +SoundFileBox::remove_field_clicked () +{} + +void +SoundFileBox::audition_status_changed (bool state) +{} + +void +SoundFileBox::field_selected () +{} + +bool +SoundFileBox::update (std::string filename) +{return true;} + SoundFileBrowser::SoundFileBrowser (std::string title) : ArdourDialog(title), - chooser(Gtk::FILE_CHOOSER_ACTION_OPEN) + chooser(Gtk::FILE_CHOOSER_ACTION_OPEN), + preview(session) { get_vbox()->pack_start(chooser); + chooser.set_preview_widget(preview); + + chooser.signal_update_preview().connect(mem_fun(*this, &SoundFileBrowser::update_preview)); show_all(); } +void +SoundFileBrowser::update_preview () +{ + chooser.set_preview_widget_active(preview.update(chooser.get_filename())); +} + SoundFileChooser::SoundFileChooser (std::string title) : SoundFileBrowser(title) |