diff options
author | Taybin Rutkin <taybin@taybin.com> | 2005-10-12 21:59:45 +0000 |
---|---|---|
committer | Taybin Rutkin <taybin@taybin.com> | 2005-10-12 21:59:45 +0000 |
commit | 3b91a592be371e25c6c135664ba0af2f484431ab (patch) | |
tree | 51d97a89212d52b019a079827520d34078e942da | |
parent | abb086738cdd0f862b1600e0780bbbf0f0967713 (diff) |
split sfdb_v3 into 3 classes.
git-svn-id: svn://localhost/trunk/ardour2@59 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/ardour_ui_dialogs.cc | 1 | ||||
-rw-r--r-- | gtk2_ardour/editor.cc | 1 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 1 | ||||
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 22 | ||||
-rw-r--r-- | gtk2_ardour/option_editor.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/sfdb_ui.cc | 12 | ||||
-rw-r--r-- | gtk2_ardour/sfdb_ui.h | 40 |
7 files changed, 48 insertions, 33 deletions
diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index 9dc11eaa14..0babbec25b 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -33,7 +33,6 @@ #include "option_editor.h" #include "location_ui.h" #include "route_params_ui.h" -#include "library_ui.h" #include "i18n.h" diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index e77e29414a..6df5895c90 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -53,7 +53,6 @@ #include "editor.h" #include "grouped_buttons.h" #include "keyboard.h" -#include "library_ui.h" #include "marker.h" #include "playlist_selector.h" #include "regionview.h" diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 11fefa96c9..6095f561af 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -97,7 +97,6 @@ class TimeSelection; class TrackSelection; class AutomationSelection; class MixerStrip; -class SoundFileSelector; class StreamView; class ControlPoint; diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 4bda1f8367..30b25c55ed 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -59,7 +59,7 @@ #include "rgb_macros.h" #include "selection_templates.h" #include "selection.h" -#include "library_ui.h" +#include "sfdb_ui.h" #include "editing.h" #include "gtk-custom-hruler.h" @@ -1891,20 +1891,21 @@ Editor::import_audio (bool as_tracks) return; } - SoundFileSelector& sfdb (ARDOUR_UI::instance()->get_sfdb_window()); - sigc::connection c; string str; if (as_tracks) { - c = sfdb.Action.connect (bind (mem_fun(*this, &Editor::do_import), true)); str =_("Import selected as tracks"); } else { - c = sfdb.Action.connect (bind (mem_fun(*this, &Editor::do_import), false)); str = _("Import selected to region list"); } - sfdb.run (str, true); - c.disconnect (); + SoundFileChooser sfdb (str, true, true); + + int result = sfdb.run(); + + if (result == Gtk::RESULT_ACCEPTED) { + do_import(sfdb.get_filenames, sfdb.get_split(), as_tracks); + } } void @@ -2032,12 +2033,9 @@ Editor::embed_audio () return; } - SoundFileSelector& sfdb (ARDOUR_UI::instance()->get_sfdb_window()); - sigc::connection c = sfdb.Action.connect (mem_fun(*this, &Editor::do_embed_sndfiles)); - - sfdb.run (_("Add to External Region list"), true); + SoundFileSelector sfdb (_("Add to External Region list"), true, true); - c.disconnect (); + int result = sfdb.run (); } void diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc index 63e7024b6a..92719b9803 100644 --- a/gtk2_ardour/option_editor.cc +++ b/gtk2_ardour/option_editor.cc @@ -1291,7 +1291,7 @@ OptionEditor::raid_path_changed () void OptionEditor::click_browse_clicked () { - SoundFileChooser sfdb (_("Choose Click"), false); + SoundFileChooser sfdb (_("Choose Click"), false, false); int result = sfdb.run (); @@ -1312,7 +1312,7 @@ OptionEditor::click_chosen (string path) void OptionEditor::click_emphasis_browse_clicked () { - SoundFileChooser sfdb (_("Click Emphasis"), false); + SoundFileChooser sfdb (_("Click Emphasis"), false, false); int result = sfdb.run (); diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index da69242914..fcb6d3d8e4 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -2,15 +2,3 @@ #include "i18n.h" -SoundFileChooser::SoundFileChooser (std::string title, - bool split_makes_sense) - : - Gtk::FileChooserDialog(title) -{ - -} - -SoundFileChooser::~SoundFileChooser () -{ - -} diff --git a/gtk2_ardour/sfdb_ui.h b/gtk2_ardour/sfdb_ui.h index b453859821..fda3c1d94e 100644 --- a/gtk2_ardour/sfdb_ui.h +++ b/gtk2_ardour/sfdb_ui.h @@ -2,16 +2,48 @@ #define __ardour_sfdb_ui_h__ #include <string> +#include <vector> -#include <gtkmm/filechooserdialog.h> +#include <gtkmm/button.h> +#include <gtkmm/dialog.h> +#include <gtkmm/filechooserwidget.h> -#include <ardour/audio_library.h> +class SoundFileBrowser : public Gtk::Dialog +{ + public: + SoundFileBrowser (std::string title); + virtual ~SoundFileBrowser (); + + protected: + Gtk::FileChooserWidget* chooser; -class SoundFileChooser : public Gtk::FileChooserDialog + Gtk::Button* ok_btn; +}; + +class SoundFileChooser : public SoundFileBrowser { public: - SoundFileChooser (std::string title, bool split_makes_sense); + SoundFileChooser (std::string title); virtual ~SoundFileChooser (); + + std::string get_filename (); + + protected: + Gtk::Button* open_btn; }; +class SoundFileOmega : public SoundFileChooser +{ + public: + SoundFileOmega (std::string title); + virtual ~SoundFileOmega (); + + std::vector<std::string> get_filenames(); + bool get_split(); + + protected: + Gtk::Button* insert_btn; + Gtk::Button* import_btn; +} + #endif // __ardour_sfdb_ui_h__ |