more upgrades to the import dialog
[ardour.git] / gtk2_ardour / editor.h
index ae7201dbbd9de502eccf472e0863e16541521ab1..715ca04b417fdb611085ae9706fd5fd2737a2b21 100644 (file)
@@ -25,6 +25,9 @@
 #include <set>
 #include <string>
 #include <sys/time.h>
+#include <glibmm/ustring.h>
+
+#include <boost/optional.hpp>
 
 #include <libgnomecanvasmm/canvas.h>
 #include <libgnomecanvasmm/group.h>
@@ -264,6 +267,7 @@ class Editor : public PublicEditor
        TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0);
 
        Width editor_mixer_strip_width;
+       void maybe_add_mixer_strip_width (XMLNode&);
        void show_editor_mixer (bool yn);
        void set_selected_mixer_strip (TimeAxisView&);
        void hide_track_in_display (TimeAxisView& tv);
@@ -348,6 +352,9 @@ class Editor : public PublicEditor
        
        ARDOUR::Session     *session;
        bool                 constructed;
+  
+       // to keep track of the playhead position for control_scroll
+       boost::optional<nframes_t> _control_scroll_target;
 
        PlaylistSelector* _playlist_selector;
 
@@ -955,14 +962,20 @@ class Editor : public PublicEditor
        void insert_region_list_selection (float times);
 
        void add_external_audio_action (Editing::ImportMode);
+       void external_audio_dialog ();
+       bool check_multichannel_status (const std::vector<Glib::ustring>& paths);
+
+       void bring_in_external_audio (Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes64_t& pos);
+       void do_import (vector<Glib::ustring> paths, Editing::ImportChannel, Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes64_t&);
 
-       void bring_in_external_audio (Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes_t& pos, bool prompt);
-       void do_import (vector<Glib::ustring> paths, bool split, Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes_t&, bool);
-       void do_embed (vector<Glib::ustring> paths, bool split, Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes_t&, bool);
-       int  import_sndfile (vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::AudioTrack* track, nframes_t& pos);
-       int  embed_sndfile (vector<Glib::ustring> paths, bool split, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode, 
-                           ARDOUR::AudioTrack* track, nframes_t& pos, bool prompt);
-       int finish_bringing_in_audio (boost::shared_ptr<ARDOUR::AudioRegion> region, uint32_t, uint32_t, ARDOUR::AudioTrack* track, nframes_t& pos, Editing::ImportMode mode);
+       void _do_embed (vector<Glib::ustring> paths, Editing::ImportChannel, Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes64_t&);
+       void do_embed (vector<Glib::ustring> paths, Editing::ImportChannel, Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes64_t&);
+       bool idle_do_embed (vector<Glib::ustring> paths, Editing::ImportChannel, Editing::ImportMode mode, ARDOUR::AudioTrack*, nframes64_t&);
+
+       int  import_sndfile (vector<Glib::ustring> paths, Editing::ImportMode mode, ARDOUR::AudioTrack* track, nframes64_t& pos);
+       int  embed_sndfile (vector<Glib::ustring> paths, Editing::ImportChannel, bool multiple_files, bool& check_sample_rate, Editing::ImportMode mode, 
+                           ARDOUR::AudioTrack* track, nframes64_t& pos);
+       int finish_bringing_in_audio (boost::shared_ptr<ARDOUR::AudioRegion> region, uint32_t, uint32_t, ARDOUR::AudioTrack* track, nframes64_t& pos, Editing::ImportMode mode);
 
        /* generic interthread progress window */
        
@@ -1033,7 +1046,11 @@ class Editor : public PublicEditor
 
        void add_location_from_audio_region ();
        void add_location_from_selection ();
-       void set_route_loop_selection ();
+       void set_loop_from_selection (bool play);
+       void set_punch_from_selection ();
+
+       void set_loop_range (nframes_t start, nframes_t end, std::string cmd);
+       void set_punch_range (nframes_t start, nframes_t end, std::string cmd);
 
        void add_location_from_playhead_cursor ();
 
@@ -1043,6 +1060,10 @@ class Editor : public PublicEditor
        void start_scrolling ();
        void stop_scrolling ();
 
+       bool _scrubbing;
+       nframes64_t last_scrub_frame;
+       uint32_t last_scrub_time;
+
        void keyboard_selection_begin ();
        void keyboard_selection_finish (bool add);
        bool have_pending_keyboard_selection;
@@ -1287,7 +1308,14 @@ class Editor : public PublicEditor
        void tempo_map_changed (ARDOUR::Change);
        void redisplay_tempo (bool immediate_redraw);
        
-       void snap_to (nframes_t& first, int32_t direction = 0, bool for_mark = false);
+       void snap_to (nframes64_t& first, int32_t direction = 0, bool for_mark = false);
+       void snap_to (nframes_t& first, int32_t direction = 0, bool for_mark = false) {
+               /* XXX remove this function when everything moves to 64 bit frame counts */
+               nframes64_t first64 = first;
+               snap_to (first64, direction, for_mark);
+               first = (nframes_t) first64;
+       }
+
        uint32_t bbt_beat_subdivision;
 
        /* toolbar */
@@ -1843,6 +1871,7 @@ class Editor : public PublicEditor
        Glib::RefPtr<Gtk::Action>              redo_action;
 
        void history_changed ();
+       void color_handler ();
 };
 
 #endif /* __ardour_editor_h__ */