Fixed some valgrind errors from using uninitialized variables in
[ardour.git] / gtk2_ardour / sfdb_ui.h
index 2c43fb1aa744fb9978cfa2ecb76b25a0faf87835..769e4ff02d9e4c587e735570f140b0ff49a4ff45 100644 (file)
@@ -25,8 +25,6 @@
 #include <string>
 #include <vector>
 
-#include <sndfile.h>
-
 #include <sigc++/signal.h>
 
 #include <gtkmm/box.h>
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 #include <gtkmm/filechooserwidget.h>
+#include <gtkmm/comboboxtext.h>
 #include <gtkmm/frame.h>
 #include <gtkmm/label.h>
 #include <gtkmm/liststore.h>
 #include <gtkmm/treeview.h>
 
 #include <ardour/session.h>
+#include <ardour/externalsource.h>
 
 #include "ardour_dialog.h"
+#include "editing.h"
 
 class SoundFileBox : public Gtk::VBox
 {
@@ -50,11 +51,12 @@ class SoundFileBox : public Gtk::VBox
     SoundFileBox ();
     virtual ~SoundFileBox () {};
 
-    bool update (std::string filename);
-       void set_session (ARDOUR::Session* s);
+    void set_session (ARDOUR::Session* s);
+    bool setup_labels (std::string filename);
 
   protected:
        ARDOUR::Session* _session;
+       std::string path;
 
     struct LabelModelColumns : public Gtk::TreeModel::ColumnRecord
     {
@@ -67,13 +69,10 @@ class SoundFileBox : public Gtk::VBox
 
     LabelModelColumns label_columns;
     
-    SF_INFO sf_info;
+       ARDOUR::SoundFileInfo sf_info;
 
     pid_t current_pid;
 
-    Gtk::Label label;
-    Gtk::Label path;
-    Gtk::Entry path_entry;
     Gtk::Label length;
     Gtk::Label format;
     Gtk::Label channels;
@@ -95,14 +94,13 @@ class SoundFileBox : public Gtk::VBox
     Gtk::Button add_field_btn;
     Gtk::Button remove_field_btn;
 
- //   void fields_refiller (Gtk::CList &clist);
-    int setup_labels (std::string filename);
     void setup_fields ();
 
     void play_btn_clicked ();
     void stop_btn_clicked ();
     void add_field_clicked ();
     void remove_field_clicked ();
+       void delete_row (const Gtk::TreeModel::iterator& iter);
 
     void field_selected ();
     void audition_status_changed (bool state);
@@ -111,10 +109,11 @@ class SoundFileBox : public Gtk::VBox
 class SoundFileBrowser : public ArdourDialog
 {
   public:
-    SoundFileBrowser (std::string title);
+    SoundFileBrowser (std::string title, ARDOUR::Session* _s = 0);
     virtual ~SoundFileBrowser () {}; 
 
-       virtual void set_session (ARDOUR::Session*);
+    virtual void set_session (ARDOUR::Session*);
+
   protected:
     Gtk::FileChooserWidget chooser;
     SoundFileBox preview;
@@ -125,7 +124,7 @@ class SoundFileBrowser : public ArdourDialog
 class SoundFileChooser : public SoundFileBrowser
 {
   public:
-    SoundFileChooser (std::string title);
+    SoundFileChooser (std::string title, ARDOUR::Session* _s = 0);
     virtual ~SoundFileChooser () {};
 
     std::string get_filename () {return chooser.get_filename();};
@@ -134,19 +133,30 @@ class SoundFileChooser : public SoundFileBrowser
 class SoundFileOmega : public SoundFileBrowser
 {
   public:
-    SoundFileOmega (std::string title);
+    SoundFileOmega (std::string title, ARDOUR::Session* _s);
     virtual ~SoundFileOmega () {};
 
-    sigc::signal<void, std::vector<std::string>, bool> Embedded;
-    sigc::signal<void, std::vector<std::string>, bool> Imported;
+    /* these are returned by the Dialog::run() method. note
+       that builtin GTK responses are all negative, leaving
+       positive values for application-defined responses.
+    */
+
+    const static int ResponseImport = 1;
+    const static int ResponseEmbed = 2;
+
+    std::vector<Glib::ustring> get_paths ();
+    bool get_split ();
+
+    void set_mode (Editing::ImportMode);
+    Editing::ImportMode get_mode ();
 
   protected:
-    Gtk::Button embed_btn;
-    Gtk::Button import_btn;
-    Gtk::CheckButton split_check;
+    Gtk::CheckButton  split_check;
+    Gtk::ComboBoxText mode_combo;
+
+    void mode_changed ();
 
-    void embed_clicked ();
-    void import_clicked ();
+    static std::vector<std::string> mode_strings;
 };
 
 #endif // __ardour_sfdb_ui_h__