diff options
-rw-r--r-- | SConstruct | 1 | ||||
-rw-r--r-- | gtk2_ardour/SConscript | 4 | ||||
-rw-r--r-- | gtk2_ardour/editor.cc | 13 | ||||
-rw-r--r-- | gtk2_ardour/editor.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/editor_ops.cc | 38 | ||||
-rw-r--r-- | gtk2_ardour/editor_selection.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/keyboard.cc | 5 | ||||
-rw-r--r-- | gtk2_ardour/keyboard.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/plugin_selector.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/plugin_selector.h | 1 | ||||
-rw-r--r-- | libs/ardour/audioengine.cc | 15 | ||||
-rw-r--r-- | libs/ardour/crossfade.cc | 2 | ||||
-rw-r--r-- | libs/ardour/io.cc | 5 | ||||
-rw-r--r-- | libs/ardour/playlist.cc | 21 |
14 files changed, 90 insertions, 33 deletions
diff --git a/SConstruct b/SConstruct index 95f166b232..2b311e93e1 100644 --- a/SConstruct +++ b/SConstruct @@ -27,6 +27,7 @@ subst_dict = { } opts = Options('scache.conf') opts.AddOptions( ('ARCH', 'Set architecture-specific compilation flags by hand (all flags as 1 argument)',''), + ('WINDOWS_KEY', 'Set X Modifier (Mod1,Mod2,Mod3,Mod4,Mod5) for "Windows" key', 'Mod4'), BoolOption('AUDIOUNITS', 'Compile with Apple\'s AudioUnit library. (experimental)', 0), BoolOption('COREAUDIO', 'Compile with Apple\'s CoreAudio library', 0), BoolOption('GTKOSX', 'Compile for use with GTK-OSX, not GTK-X11', 0), diff --git a/gtk2_ardour/SConscript b/gtk2_ardour/SConscript index cfeff7a1aa..53eb217062 100644 --- a/gtk2_ardour/SConscript +++ b/gtk2_ardour/SConscript @@ -409,12 +409,12 @@ if gtkardour['GTKOSX'] and gtkardour['NATIVE_OSX_KEYS']: keybindings_dict['%WINDOW%'] = 'Mod1' else: # - # Ctrl, Alt, Shift, Mod3(Meta) + # Ctrl, Alt, Shift, Mod4(Super/Windows/Hyper) # keybindings_dict['%PRIMARY%'] = 'Ctrl' keybindings_dict['%SECONDARY%'] = 'Alt' keybindings_dict['%TERTIARY%'] = 'Shift' - keybindings_dict['%LEVEL4%'] = 'Mod2' + keybindings_dict['%LEVEL4%'] = env['WINDOWS_KEY'] keybindings_dict['%WINDOW%'] = 'Alt' for b in [ 'SAE-de', 'mnemonic-us', 'ergonomic-us' ]: diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index de6c6e4ae8..1a70f6b754 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -4403,15 +4403,20 @@ Editor::get_regions_for_action (RegionSelection& rs, bool allow_entered) if (selection->tracks.empty()) { - /* no regions or tracks selected, but entered regionview is valid - and we're in object mode - just use entered regionview + /* no regions or tracks selected */ - if (entered_regionview && (mouse_mode == Editing::MouseObject)) { + if (entered_regionview && mouse_mode == Editing::MouseObject) { + + /* entered regionview is valid and we're in object mode - + just use entered regionview + */ + rs.add (entered_regionview); - return; } + return; + } else { /* no regions selected, so get all regions at the edit point across diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 597719ce4b..762b4900bd 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -963,7 +963,7 @@ class Editor : public PublicEditor void cut_copy (Editing::CutCopyOp); void cut_copy_points (Editing::CutCopyOp); - void cut_copy_regions (Editing::CutCopyOp); + void cut_copy_regions (Editing::CutCopyOp, RegionSelection&); void cut_copy_ranges (Editing::CutCopyOp); void mouse_paste (); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 2843a9d794..951c40cd3c 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -2273,14 +2273,20 @@ Editor::play_from_edit_point_and_return () nframes64_t start_frame; nframes64_t return_frame; + start_frame = get_preferred_edit_position (true); + + if (session->transport_rolling()) { + /* go to edit point and stop */ + session->request_locate (start_frame, false); + return; + } + /* don't reset the return frame if its already set */ if ((return_frame = session->requested_return_frame()) < 0) { return_frame = session->audible_frame(); } - start_frame = get_preferred_edit_position (true); - if (start_frame >= 0) { session->request_roll_at_and_return (start_frame, return_frame); } @@ -2675,8 +2681,8 @@ Editor::separate_regions_between (const TimeSelection& ts) } if (tmptracks.empty()) { - /* no regions selected: use all tracks */ - tmptracks = track_views; + /* no regions selected: do nothing */ + return; } } else { @@ -3084,7 +3090,7 @@ Editor::align (RegionPoint what) { RegionSelection rs; - get_regions_for_action (rs, false); + get_regions_for_action (rs); nframes64_t where = get_preferred_edit_position(); if (!rs.empty()) { @@ -3103,7 +3109,7 @@ Editor::align_relative (RegionPoint what) nframes64_t where = get_preferred_edit_position(); RegionSelection rs; - get_regions_for_action (rs, false); + get_regions_for_action (rs); if (!rs.empty()) { align_selection_relative (what, where, rs); @@ -3588,7 +3594,11 @@ Editor::cut_copy (CutCopyOp op) RegionSelection rs; - get_regions_for_action (rs); + /* we only want to cut regions if some are selected */ + + if (!selection->regions.empty()) { + get_regions_for_action (rs); + } switch (current_mouse_mode()) { case MouseObject: @@ -3597,7 +3607,7 @@ Editor::cut_copy (CutCopyOp op) begin_reversible_command (opname + _(" objects")); if (!rs.empty()) { - cut_copy_regions (op); + cut_copy_regions (op, rs); if (op == Cut) { selection->clear_regions (); @@ -3677,7 +3687,7 @@ struct PlaylistMapping { }; void -Editor::cut_copy_regions (CutCopyOp op) +Editor::cut_copy_regions (CutCopyOp op, RegionSelection& rs) { /* we can't use a std::map here because the ordering is important, and we can't trivially sort a map when we want ordered access to both elements. i think. @@ -3692,9 +3702,6 @@ Editor::cut_copy_regions (CutCopyOp op) /* get ordering correct before we cut/copy */ - RegionSelection rs; - - get_regions_for_action (rs); rs.sort_by_position_and_track (); for (RegionSelection::iterator x = rs.begin(); x != rs.end(); ++x) { @@ -3817,9 +3824,14 @@ void Editor::cut_copy_ranges (CutCopyOp op) { TrackSelection* ts; + TrackSelection entered; if (selection->tracks.empty()) { - ts = &track_views; + if (!entered_track) { + return; + } + entered.push_back (entered_track); + ts = &entered; } else { ts = &selection->tracks; } diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 86ab115536..1c22668d99 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -1347,6 +1347,12 @@ Editor::get_edit_op_range (nframes64_t& start, nframes64_t& end) const swap (start, end); } + /* turn range into one delimited by start...end, + not start...end-1 + */ + + end++; + return true; } diff --git a/gtk2_ardour/keyboard.cc b/gtk2_ardour/keyboard.cc index e416839474..0899e1f354 100644 --- a/gtk2_ardour/keyboard.cc +++ b/gtk2_ardour/keyboard.cc @@ -54,12 +54,14 @@ guint Keyboard::snap_mod = GDK_MOD3_MASK; guint Keyboard::PrimaryModifier = GDK_META_MASK; // Command guint Keyboard::SecondaryModifier = GDK_MOD1_MASK; // Alt/Option guint Keyboard::TertiaryModifier = GDK_SHIFT_MASK; // Shift +guint Keyboard::Level4Modifier = GDK_CONTROL_MASK; // Control guint Keyboard::CopyModifier = GDK_MOD1_MASK; // Alt/Option guint Keyboard::RangeSelectModifier = GDK_SHIFT_MASK; #else guint Keyboard::PrimaryModifier = GDK_CONTROL_MASK; // Control guint Keyboard::SecondaryModifier = GDK_MOD1_MASK; // Alt/Option guint Keyboard::TertiaryModifier = GDK_SHIFT_MASK; // Shift +guint Keyboard::Level4Modifier = GDK_MOD4_MASK; // Mod4/Windows guint Keyboard::CopyModifier = GDK_CONTROL_MASK; guint Keyboard::RangeSelectModifier = GDK_SHIFT_MASK; #endif @@ -106,9 +108,12 @@ Keyboard::Keyboard () RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | PrimaryModifier); RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | SecondaryModifier); RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | TertiaryModifier); + RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | Level4Modifier); RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | CopyModifier); RelevantModifierKeyMask = GdkModifierType (RelevantModifierKeyMask | RangeSelectModifier); + gtk_accelerator_set_default_mod_mask (RelevantModifierKeyMask); + snooper_id = gtk_key_snooper_install (_snooper, (gpointer) this); XMLNode* node = ARDOUR_UI::instance()->keyboard_settings(); diff --git a/gtk2_ardour/keyboard.h b/gtk2_ardour/keyboard.h index 39e8e4f78e..25955935f3 100644 --- a/gtk2_ardour/keyboard.h +++ b/gtk2_ardour/keyboard.h @@ -50,6 +50,7 @@ class Keyboard : public sigc::trackable, Stateful static uint32_t PrimaryModifier; static uint32_t SecondaryModifier; static uint32_t TertiaryModifier; + static uint32_t Level4Modifier; static uint32_t CopyModifier; static uint32_t RangeSelectModifier; @@ -62,6 +63,9 @@ class Keyboard : public sigc::trackable, Stateful static void set_tertiary_modifier (uint32_t newval) { set_modifier (newval, TertiaryModifier); } + static void set_level4_modifier (uint32_t newval) { + set_modifier (newval, Level4Modifier); + } static void set_copy_modifier (uint32_t newval) { set_modifier (newval, CopyModifier); } diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc index 7a5d76e8ad..c7d456cc4d 100644 --- a/gtk2_ardour/plugin_selector.cc +++ b/gtk2_ardour/plugin_selector.cc @@ -427,3 +427,9 @@ PluginSelector::filter_mode_changed () refill (); } +void +PluginSelector::on_show () +{ + ArdourDialog::on_show (); + filter_entry.grab_focus (); +} diff --git a/gtk2_ardour/plugin_selector.h b/gtk2_ardour/plugin_selector.h index ea258d3be0..70c9ba3c3e 100644 --- a/gtk2_ardour/plugin_selector.h +++ b/gtk2_ardour/plugin_selector.h @@ -41,6 +41,7 @@ class PluginSelector : public ArdourDialog int run (); // XXX should we try not to overload the non-virtual Gtk::Dialog::run() ? void set_session (ARDOUR::Session*); + void on_show (); private: ARDOUR::Session* session; diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index dfa456cdcc..d057a31cea 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -77,9 +77,6 @@ AudioEngine::AudioEngine (string client_name) if (connect_to_jack (client_name)) { throw NoBackendAvailable (); } - - start_metering_thread(); - } AudioEngine::~AudioEngine () @@ -157,6 +154,8 @@ AudioEngine::start () } else { // error << _("cannot activate JACK client") << endmsg; } + + start_metering_thread(); } return _running ? 0 : -1; @@ -167,11 +166,11 @@ AudioEngine::stop (bool forever) { if (_running) { _running = false; + stop_metering_thread (); if (forever) { jack_client_t* foo = _jack; _jack = 0; jack_client_close (foo); - stop_metering_thread (); } else { jack_deactivate (_jack); } @@ -421,8 +420,9 @@ void AudioEngine::start_metering_thread () { if (m_meter_thread == 0) { + g_atomic_int_set (&m_meter_exit, 0); m_meter_thread = Glib::Thread::create (sigc::mem_fun(this, &AudioEngine::meter_thread), - 500000, true, true, Glib::THREAD_PRIORITY_NORMAL); + 500000, true, true, Glib::THREAD_PRIORITY_NORMAL); } } @@ -801,6 +801,8 @@ AudioEngine::halted (void *arg) AudioEngine* ae = static_cast<AudioEngine *> (arg); bool was_running = ae->_running; + ae->stop_metering_thread (); + ae->_running = false; ae->_buffer_size = 0; ae->_frame_rate = 0; @@ -1110,6 +1112,7 @@ AudioEngine::disconnect_from_jack () _frame_rate = 0; if (_running) { + stop_metering_thread (); _running = false; Stopped(); /* EMIT SIGNAL */ } @@ -1214,6 +1217,8 @@ AudioEngine::reconnect_to_jack () Running (); /* EMIT SIGNAL*/ + start_metering_thread (); + return 0; } diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc index e1df8228ce..f2641a43e2 100644 --- a/libs/ardour/crossfade.cc +++ b/libs/ardour/crossfade.cc @@ -81,7 +81,7 @@ Crossfade::Crossfade (boost::shared_ptr<AudioRegion> in, boost::shared_ptr<Audio { _in = in; _out = out; - + _length = length; _position = position; _anchor_point = ap; diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 7b2838d8fe..3f9a8b29e3 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -2446,9 +2446,8 @@ IO::setup_peak_meters () void IO::update_meters() { - Glib::Mutex::Lock guard (m_meter_signal_lock); - - Meter(); + Glib::Mutex::Lock guard (m_meter_signal_lock); + Meter(); } void diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 55b30b6c70..3bee54babb 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -694,18 +694,27 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi ++tmp; current = *i; - - if (current->first_frame() == start && current->last_frame() == end) { + + if (current->first_frame() >= start && current->last_frame() < end) { if (cutting) { remove_region_internal (current); } continue; } - + + /* coverage will return OverlapStart if the start coincides + with the end point. we do not partition such a region, + so catch this special case. + */ + + if (current->first_frame() >= end) { + continue; + } + if ((overlap = current->coverage (start, end)) == OverlapNone) { continue; } - + pos1 = current->position(); pos2 = start; pos3 = end; @@ -841,6 +850,10 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi new_regions.push_back (current); } } + + if (current->first_frame() >= current->last_frame()) { + PBD::stacktrace (cerr); + } in_partition = false; } |