mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
Implement insert-region action... now uses the Source List.
This commit is contained in:
parent
8dea1a033d
commit
422e46e9c8
7 changed files with 18 additions and 9 deletions
|
|
@ -166,7 +166,7 @@ This mode provides many different operations on both regions and control points,
|
||||||
@edit|Editor/alternate-redo|<@PRIMARY@>y|redo
|
@edit|Editor/alternate-redo|<@PRIMARY@>y|redo
|
||||||
@select|Editor/select-all-between-cursors|<@PRIMARY@>u|all enclosed by edit range
|
@select|Editor/select-all-between-cursors|<@PRIMARY@>u|all enclosed by edit range
|
||||||
@select|Editor/select-all-within-cursors|u|all present in edit range
|
@select|Editor/select-all-within-cursors|u|all present in edit range
|
||||||
@eep|Region/insert-region-from-region-list|i|insert from region list
|
@eep|Region/insert-region-from-source-list|i|insert from region list
|
||||||
@sess|Common/addExistingAudioFiles|<@PRIMARY@>i|import audio files
|
@sess|Common/addExistingAudioFiles|<@PRIMARY@>i|import audio files
|
||||||
@gselect|Common/invert-selection|<@TERTIARY@>i|invert selection
|
@gselect|Common/invert-selection|<@TERTIARY@>i|invert selection
|
||||||
@edtrk|Editor/toggle-midi-input-active|<@SECONDARY@>i|toggle sel. track MIDI input
|
@edtrk|Editor/toggle-midi-input-active|<@SECONDARY@>i|toggle sel. track MIDI input
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,7 @@
|
||||||
</menu>
|
</menu>
|
||||||
|
|
||||||
<menu name='RegionMenu' action='RegionMenu'>
|
<menu name='RegionMenu' action='RegionMenu'>
|
||||||
<menuitem action='insert-region-from-region-list'/>
|
<menuitem action='insert-region-from-source-list'/>
|
||||||
<menuitem action='play-selected-regions'/>
|
<menuitem action='play-selected-regions'/>
|
||||||
<menuitem action='tag-selected-regions'/>
|
<menuitem action='tag-selected-regions'/>
|
||||||
<menuitem action='loop-region'/>
|
<menuitem action='loop-region'/>
|
||||||
|
|
|
||||||
|
|
@ -2041,7 +2041,7 @@ Editor::add_dstream_context_items (Menu_Helpers::MenuList& edit_items)
|
||||||
/* Adding new material */
|
/* Adding new material */
|
||||||
|
|
||||||
edit_items.push_back (SeparatorElem());
|
edit_items.push_back (SeparatorElem());
|
||||||
edit_items.push_back (MenuElem (_("Insert Selected Region"), sigc::bind (sigc::mem_fun(*this, &Editor::insert_region_list_selection), 1.0f)));
|
edit_items.push_back (MenuElem (_("Insert Selected Region"), sigc::bind (sigc::mem_fun(*this, &Editor::insert_source_list_selection), 1.0f)));
|
||||||
edit_items.push_back (MenuElem (_("Insert Existing Media"), sigc::bind (sigc::mem_fun(*this, &Editor::add_external_audio_action), ImportToTrack)));
|
edit_items.push_back (MenuElem (_("Insert Existing Media"), sigc::bind (sigc::mem_fun(*this, &Editor::add_external_audio_action), ImportToTrack)));
|
||||||
|
|
||||||
/* Nudge track */
|
/* Nudge track */
|
||||||
|
|
|
||||||
|
|
@ -1322,7 +1322,7 @@ private:
|
||||||
void temporal_zoom_by_sample (samplepos_t start, samplepos_t end);
|
void temporal_zoom_by_sample (samplepos_t start, samplepos_t end);
|
||||||
void temporal_zoom_to_sample (bool coarser, samplepos_t sample);
|
void temporal_zoom_to_sample (bool coarser, samplepos_t sample);
|
||||||
|
|
||||||
void insert_region_list_selection (float times);
|
void insert_source_list_selection (float times);
|
||||||
|
|
||||||
/* import & embed */
|
/* import & embed */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1559,7 +1559,7 @@ Editor::register_region_actions ()
|
||||||
|
|
||||||
/* PART 2: actions that are not related to the selection, but for which the edit point type and location is important */
|
/* PART 2: actions that are not related to the selection, but for which the edit point type and location is important */
|
||||||
|
|
||||||
// register_region_action (_region_actions, RegionActionTarget (ListSelection), "insert-region-from-region-list", _("Insert Region from Region List"), sigc::bind (sigc::mem_fun (*this, &Editor::insert_region_list_selection), 1));
|
register_region_action (_region_actions, RegionActionTarget (ListSelection), "insert-region-from-source-list", _("Insert Region from Source List"), sigc::bind (sigc::mem_fun (*this, &Editor::insert_source_list_selection), 1));
|
||||||
|
|
||||||
/* PART 3: actions that operate on the selection and also require the edit point location */
|
/* PART 3: actions that operate on the selection and also require the edit point location */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,7 @@
|
||||||
#include "editor_cursors.h"
|
#include "editor_cursors.h"
|
||||||
#include "editor_drag.h"
|
#include "editor_drag.h"
|
||||||
#include "editor_regions.h"
|
#include "editor_regions.h"
|
||||||
|
#include "editor_sources.h"
|
||||||
#include "editor_routes.h"
|
#include "editor_routes.h"
|
||||||
#include "gui_thread.h"
|
#include "gui_thread.h"
|
||||||
#include "insert_remove_time_dialog.h"
|
#include "insert_remove_time_dialog.h"
|
||||||
|
|
@ -2542,7 +2543,7 @@ Editor::unhide_ranges ()
|
||||||
/* INSERT/REPLACE */
|
/* INSERT/REPLACE */
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::insert_region_list_selection (float times)
|
Editor::insert_source_list_selection (float times)
|
||||||
{
|
{
|
||||||
RouteTimeAxisView *tv = 0;
|
RouteTimeAxisView *tv = 0;
|
||||||
boost::shared_ptr<Playlist> playlist;
|
boost::shared_ptr<Playlist> playlist;
|
||||||
|
|
@ -2565,7 +2566,7 @@ Editor::insert_region_list_selection (float times)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<Region> region = _regions->get_single_selection ();
|
boost::shared_ptr<Region> region = _sources->get_single_selection ();
|
||||||
if (region == 0) {
|
if (region == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
#include "editor.h"
|
#include "editor.h"
|
||||||
#include "editor_drag.h"
|
#include "editor_drag.h"
|
||||||
#include "editor_routes.h"
|
#include "editor_routes.h"
|
||||||
|
#include "editor_sources.h"
|
||||||
#include "actions.h"
|
#include "actions.h"
|
||||||
#include "audio_time_axis.h"
|
#include "audio_time_axis.h"
|
||||||
#include "audio_region_view.h"
|
#include "audio_region_view.h"
|
||||||
|
|
@ -1214,6 +1215,7 @@ Editor::sensitize_the_right_region_actions (bool because_canvas_crossing)
|
||||||
bool have_selection = false;
|
bool have_selection = false;
|
||||||
bool have_entered = false;
|
bool have_entered = false;
|
||||||
bool have_edit_point = false;
|
bool have_edit_point = false;
|
||||||
|
bool have_selected_source = false;
|
||||||
RegionSelection rs;
|
RegionSelection rs;
|
||||||
|
|
||||||
// std::cerr << "STRRA: crossing ? " << because_canvas_crossing << " within ? " << within_track_canvas
|
// std::cerr << "STRRA: crossing ? " << because_canvas_crossing << " within ? " << within_track_canvas
|
||||||
|
|
@ -1229,6 +1231,10 @@ Editor::sensitize_the_right_region_actions (bool because_canvas_crossing)
|
||||||
rs.add (entered_regionview);
|
rs.add (entered_regionview);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( _sources->get_single_selection() ) {
|
||||||
|
have_selected_source = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (rs.empty() && !selection->tracks.empty()) {
|
if (rs.empty() && !selection->tracks.empty()) {
|
||||||
|
|
||||||
/* no selected regions, but some selected tracks.
|
/* no selected regions, but some selected tracks.
|
||||||
|
|
@ -1278,6 +1284,8 @@ Editor::sensitize_the_right_region_actions (bool because_canvas_crossing)
|
||||||
sensitive = true;
|
sensitive = true;
|
||||||
} else if ((tgt & EditPointRegions) && have_edit_point) {
|
} else if ((tgt & EditPointRegions) && have_edit_point) {
|
||||||
sensitive = true;
|
sensitive = true;
|
||||||
|
} else if ((tgt & ListSelection) && have_selected_source ) {
|
||||||
|
sensitive = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
x->second.action->set_sensitive (sensitive);
|
x->second.action->set_sensitive (sensitive);
|
||||||
|
|
@ -1507,9 +1515,9 @@ Editor::sensitize_the_right_region_actions (bool because_canvas_crossing)
|
||||||
/* XXX: should also check that there is a track of the appropriate type for the selected region */
|
/* XXX: should also check that there is a track of the appropriate type for the selected region */
|
||||||
#if 0
|
#if 0
|
||||||
if (_edit_point == EditAtMouse || _regions->get_single_selection() == 0 || selection->tracks.empty()) {
|
if (_edit_point == EditAtMouse || _regions->get_single_selection() == 0 || selection->tracks.empty()) {
|
||||||
_region_actions->get_action("insert-region-from-region-list")->set_sensitive (false);
|
_region_actions->get_action("insert-region-from-source-list")->set_sensitive (false);
|
||||||
} else {
|
} else {
|
||||||
_region_actions->get_action("insert-region-from-region-list")->set_sensitive (true);
|
_region_actions->get_action("insert-region-from-source-list")->set_sensitive (true);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue