Set sensitvity of "Insert Selected Region"
This commit is contained in:
parent
c362a5af8f
commit
91c0f143ec
@ -2056,6 +2056,9 @@ Editor::add_dstream_context_items (Menu_Helpers::MenuList& edit_items)
|
|||||||
|
|
||||||
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_source_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)));
|
||||||
|
if (!current_playlist () || !_sources->get_single_selection ()) {
|
||||||
|
edit_items.back ().set_sensitive (false);
|
||||||
|
}
|
||||||
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 */
|
||||||
|
@ -1438,6 +1438,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);
|
||||||
|
|
||||||
|
std::shared_ptr<ARDOUR::Playlist> current_playlist () const;
|
||||||
void insert_source_list_selection (float times);
|
void insert_source_list_selection (float times);
|
||||||
|
|
||||||
/* import & embed */
|
/* import & embed */
|
||||||
|
@ -2656,28 +2656,35 @@ Editor::unhide_ranges ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* INSERT/REPLACE */
|
/* INSERT/REPLACE */
|
||||||
|
std::shared_ptr<Playlist>
|
||||||
void
|
Editor::current_playlist () const
|
||||||
Editor::insert_source_list_selection (float times)
|
|
||||||
{
|
{
|
||||||
RouteTimeAxisView *tv = 0;
|
|
||||||
std::shared_ptr<Playlist> playlist;
|
std::shared_ptr<Playlist> playlist;
|
||||||
|
RouteTimeAxisView *tv = 0;
|
||||||
|
|
||||||
if (clicked_routeview != 0) {
|
if (clicked_routeview != 0) {
|
||||||
tv = clicked_routeview;
|
tv = clicked_routeview;
|
||||||
} else if (!selection->tracks.empty()) {
|
} else if (!selection->tracks.empty()) {
|
||||||
if ((tv = dynamic_cast<RouteTimeAxisView*>(selection->tracks.front())) == 0) {
|
if ((tv = dynamic_cast<RouteTimeAxisView*>(selection->tracks.front())) == 0) {
|
||||||
return;
|
return playlist;
|
||||||
}
|
}
|
||||||
} else if (entered_track != 0) {
|
} else if (entered_track != 0) {
|
||||||
if ((tv = dynamic_cast<RouteTimeAxisView*>(entered_track)) == 0) {
|
if ((tv = dynamic_cast<RouteTimeAxisView*>(entered_track)) == 0) {
|
||||||
return;
|
return playlist;;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return;
|
return playlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((playlist = tv->playlist()) == 0) {
|
return tv->playlist ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::insert_source_list_selection (float times)
|
||||||
|
{
|
||||||
|
std::shared_ptr<Playlist> playlist = current_playlist ();
|
||||||
|
|
||||||
|
if (!playlist) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user