split sfdb_v3 into 3 classes.
authorTaybin Rutkin <taybin@taybin.com>
Wed, 12 Oct 2005 21:59:45 +0000 (21:59 +0000)
committerTaybin Rutkin <taybin@taybin.com>
Wed, 12 Oct 2005 21:59:45 +0000 (21:59 +0000)
git-svn-id: svn://localhost/trunk/ardour2@59 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour_ui_dialogs.cc
gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/editor_ops.cc
gtk2_ardour/option_editor.cc
gtk2_ardour/sfdb_ui.cc
gtk2_ardour/sfdb_ui.h

index 9dc11eaa1475e964974aac2993f41d6d6c8e344d..0babbec25bb9f23e9a7fa97f7c297e95fdcda634 100644 (file)
@@ -33,7 +33,6 @@
 #include "option_editor.h"
 #include "location_ui.h"
 #include "route_params_ui.h"
-#include "library_ui.h"
 
 #include "i18n.h"
 
index e77e29414afdaa150c62f4aba7703c244fdd4a88..6df5895c90f6b120b4ab5b36f6cce3c2d4aa0267 100644 (file)
@@ -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"
index 11fefa96c9f3783a03bd37509350ce6382f7489f..6095f561af3a5a83a3209c5bf0a427139ccc5dc7 100644 (file)
@@ -97,7 +97,6 @@ class TimeSelection;
 class TrackSelection;
 class AutomationSelection;
 class MixerStrip;
-class SoundFileSelector;
 class StreamView;
 class ControlPoint;
 
index 4bda1f83677bbe6ac1c823af57a6d41dce69d8cc..30b25c55edcf7644ff339f0c7320fd3335fbb1b3 100644 (file)
@@ -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
index 63e7024b6a961a8a80d5f3210d08fdcb81383c1f..92719b9803c3238dd2c3e4856799c02d8745d3f8 100644 (file)
@@ -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 ();
 
index da69242914cf05976cb7de295103c6a97ba30fda..fcb6d3d8e4703a4b0b9599aaf74bfe50d79c4307 100644 (file)
@@ -2,15 +2,3 @@
 
 #include "i18n.h"
 
-SoundFileChooser::SoundFileChooser (std::string title,
-               bool split_makes_sense)
-       :
-       Gtk::FileChooserDialog(title)
-{
-       
-}
-
-SoundFileChooser::~SoundFileChooser ()
-{
-
-}
index b4538598210cec5065f248b3c24f0716ea89aa5b..fda3c1d94e1ba2940d0fa10573747afcebf152bc 100644 (file)
@@ -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__