fix inadvertent breakage in ardev and friends caused by extension to LD_LIBRARY_PATH...
[ardour.git] / gtk2_ardour / sfdb_ui.h
index e4e919ae1e7f73300a7e9e446d548d2e3849da9a..46408ecffc605824912e27daf2749f63de1e15d0 100644 (file)
@@ -36,6 +36,7 @@
 #include <gtkmm/filechooserwidget.h>
 #include <gtkmm/frame.h>
 #include <gtkmm/label.h>
+#include <gtkmm/scale.h>
 #include <gtkmm/textview.h>
 #include <gtkmm/table.h>
 #include <gtkmm/liststore.h>
@@ -57,7 +58,7 @@ namespace ARDOUR {
 class GainMeter;
 class Mootcher;
 
-class SoundFileBox : public Gtk::VBox, public ARDOUR::SessionHandlePtr
+class SoundFileBox : public Gtk::VBox, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList
 {
   public:
        SoundFileBox (bool persistent);
@@ -69,6 +70,7 @@ class SoundFileBox : public Gtk::VBox, public ARDOUR::SessionHandlePtr
        void audition();
        bool audition_oneshot();
        bool autoplay () const;
+       void set_src_quality(ARDOUR::SrcQuality q) { _src_quality = q; }
 
   protected:
        std::string path;
@@ -103,11 +105,20 @@ class SoundFileBox : public Gtk::VBox, public ARDOUR::SessionHandlePtr
        Gtk::Button stop_btn;
        Gtk::CheckButton autoplay_btn;
        Gtk::Button apply_btn;
+       Gtk::HScale seek_slider;
+
+       PBD::ScopedConnectionList auditioner_connections;
+       void audition_active(bool);
+       void audition_progress(ARDOUR::framecnt_t, ARDOUR::framecnt_t);
 
        bool tags_entry_left (GdkEventFocus* event);
        void tags_changed ();
        void save_tags (const std::vector<std::string>&);
        void stop_audition ();
+       bool seek_button_press(GdkEventButton*);
+       bool seek_button_release(GdkEventButton*);
+       bool _seeking;
+       ARDOUR::SrcQuality _src_quality;
 };
 
 class SoundFileBrowser : public ArdourWindow
@@ -131,6 +142,7 @@ class SoundFileBrowser : public ArdourWindow
                Gtk::TreeModelColumn<std::string> filesize;
                Gtk::TreeModelColumn<std::string> smplrate;
                Gtk::TreeModelColumn<std::string> license;
+               Gtk::TreeModelColumn<bool>        started;
 
                FreesoundColumns() {
                        add(id); 
@@ -140,6 +152,7 @@ class SoundFileBrowser : public ArdourWindow
                        add(filesize);
                        add(smplrate);
                        add(license);
+                       add(started);
                }
        };
 
@@ -149,10 +162,12 @@ class SoundFileBrowser : public ArdourWindow
        FreesoundColumns freesound_list_columns;
        Glib::RefPtr<Gtk::ListStore> freesound_list;
 
-       Gtk::Button freesound_stop_btn;
+       Gtk::Button freesound_more_btn;
+       Gtk::Button freesound_similar_btn;
 
+       void handle_freesound_results(std::string theString);
   public:
-       SoundFileBrowser (Gtk::Window& parent, std::string title, ARDOUR::Session* _s, bool persistent);
+       SoundFileBrowser (std::string title, ARDOUR::Session* _s, bool persistent);
        virtual ~SoundFileBrowser ();
 
         int run ();
@@ -173,21 +188,14 @@ class SoundFileBrowser : public ArdourWindow
 
        Gtk::Entry freesound_entry;
        Gtk::ComboBoxText freesound_sort;
-       Gtk::SpinButton freesound_page;
-       
+
        Gtk::Button freesound_search_btn;
        Gtk::TreeView freesound_list_view;
-       Gtk::ProgressBar freesound_progress_bar;
-
-       bool freesound_search_cancel;
-       bool freesound_download_cancel;
+       Gtk::Notebook notebook;
 
        void freesound_search();
+       void refresh_display(std::string ID, std::string file);
        
-#ifdef FREESOUND
-       Mootcher *mootcher;
-#endif
-
   protected:
        bool resetting_ourselves;
        int matches;
@@ -208,7 +216,6 @@ class SoundFileBrowser : public ArdourWindow
 
        static std::string persistent_folder;
 
-       Gtk::Notebook notebook;
 
        GainMeter* gm;
        Gtk::VBox meter_packer;
@@ -228,9 +235,12 @@ class SoundFileBrowser : public ArdourWindow
        void freesound_list_view_selected ();
        void freesound_list_view_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn*);
        void freesound_search_clicked ();
-       void freesound_stop_clicked ();
+       void freesound_more_clicked ();
+       void freesound_similar_clicked ();
+       int freesound_page;
        
        void chooser_file_activated ();
+       std::string freesound_get_audio_file(Gtk::TreeIter iter);
 
        bool on_audio_filter (const Gtk::FileFilter::Info& filter_info);
        bool on_midi_filter (const Gtk::FileFilter::Info& filter_info);
@@ -248,7 +258,7 @@ class SoundFileBrowser : public ArdourWindow
 class SoundFileChooser : public SoundFileBrowser
 {
   public:
-       SoundFileChooser (Gtk::Window& parent, std::string title, ARDOUR::Session* _s = 0);
+       SoundFileChooser (std::string title, ARDOUR::Session* _s = 0);
        virtual ~SoundFileChooser () {};
 
        std::string get_filename ();
@@ -261,7 +271,7 @@ class SoundFileOmega : public SoundFileBrowser
 {
 
   public:
-       SoundFileOmega (Gtk::Window& parent, std::string title, ARDOUR::Session* _s, 
+       SoundFileOmega (std::string title, ARDOUR::Session* _s, 
                        uint32_t selected_audio_tracks, uint32_t selected_midi_tracks,
                        bool persistent,
                        Editing::ImportMode mode_hint = Editing::ImportAsTrack);
@@ -305,6 +315,7 @@ class SoundFileOmega : public SoundFileBrowser
        bool reset_options ();
        void reset_options_noret ();
        bool bad_file_message ();
+       void src_combo_changed ();
 
         void do_something (int action);
 };