mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Add option to copy bounced regions/range to clip library
This commit is contained in:
parent
ac6835c7d8
commit
0b055ad66e
2 changed files with 31 additions and 2 deletions
|
|
@ -40,6 +40,7 @@
|
||||||
#include "ardour/audioplaylist.h"
|
#include "ardour/audioplaylist.h"
|
||||||
#include "ardour/audioregion.h"
|
#include "ardour/audioregion.h"
|
||||||
#include "ardour/chan_count.h"
|
#include "ardour/chan_count.h"
|
||||||
|
#include "ardour/clip_library.h"
|
||||||
#include "ardour/midi_region.h"
|
#include "ardour/midi_region.h"
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
#include "ardour/session_directory.h"
|
#include "ardour/session_directory.h"
|
||||||
|
|
@ -280,6 +281,7 @@ Editor::bounce_region_selection (bool with_processing)
|
||||||
|
|
||||||
/*prompt the user for a new name*/
|
/*prompt the user for a new name*/
|
||||||
string bounce_name;
|
string bounce_name;
|
||||||
|
bool copy_to_clip_library = false;
|
||||||
{
|
{
|
||||||
ArdourWidgets::Prompter dialog (true);
|
ArdourWidgets::Prompter dialog (true);
|
||||||
|
|
||||||
|
|
@ -289,9 +291,13 @@ Editor::bounce_region_selection (bool with_processing)
|
||||||
dialog.set_size_request (400, -1);
|
dialog.set_size_request (400, -1);
|
||||||
dialog.set_position (Gtk::WIN_POS_MOUSE);
|
dialog.set_position (Gtk::WIN_POS_MOUSE);
|
||||||
|
|
||||||
dialog.add_button (_("Rename"), RESPONSE_ACCEPT);
|
dialog.add_button (_("Bounce"), RESPONSE_ACCEPT);
|
||||||
dialog.set_initial_text (bounce_name);
|
dialog.set_initial_text (bounce_name);
|
||||||
|
|
||||||
|
Gtk::CheckButton cliplib (_("Copy to Clip Libary"));
|
||||||
|
dialog.get_vbox()->pack_start (cliplib);
|
||||||
|
cliplib.show ();
|
||||||
|
|
||||||
Label label;
|
Label label;
|
||||||
label.set_text (_("Bounced Region will appear in the Source list."));
|
label.set_text (_("Bounced Region will appear in the Source list."));
|
||||||
dialog.get_vbox()->set_spacing (8);
|
dialog.get_vbox()->set_spacing (8);
|
||||||
|
|
@ -307,6 +313,7 @@ Editor::bounce_region_selection (bool with_processing)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dialog.get_result(bounce_name);
|
dialog.get_result(bounce_name);
|
||||||
|
copy_to_clip_library = cliplib.get_active ();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
for (RegionSelection::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
|
||||||
|
|
@ -324,6 +331,10 @@ Editor::bounce_region_selection (bool with_processing)
|
||||||
} else {
|
} else {
|
||||||
r = track->bounce_range (region->position_sample(), region->position_sample() + region->length_samples(), itt, boost::shared_ptr<Processor>(), false, bounce_name);
|
r = track->bounce_range (region->position_sample(), region->position_sample() + region->length_samples(), itt, boost::shared_ptr<Processor>(), false, bounce_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (copy_to_clip_library) {
|
||||||
|
export_to_clip_library (r);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@
|
||||||
#include "ardour/audio_track.h"
|
#include "ardour/audio_track.h"
|
||||||
#include "ardour/audioregion.h"
|
#include "ardour/audioregion.h"
|
||||||
#include "ardour/boost_debug.h"
|
#include "ardour/boost_debug.h"
|
||||||
|
#include "ardour/clip_library.h"
|
||||||
#include "ardour/dB.h"
|
#include "ardour/dB.h"
|
||||||
#include "ardour/location.h"
|
#include "ardour/location.h"
|
||||||
#include "ardour/midi_region.h"
|
#include "ardour/midi_region.h"
|
||||||
|
|
@ -4115,7 +4116,9 @@ Editor::bounce_range_selection (BounceTarget target, bool enable_processing)
|
||||||
|
|
||||||
assert (!(enable_processing && (target == NewTrigger)));
|
assert (!(enable_processing && (target == NewTrigger)));
|
||||||
|
|
||||||
uint32_t trigger_slot = 0;
|
bool copy_to_clip_library = false;
|
||||||
|
uint32_t trigger_slot = 0;
|
||||||
|
|
||||||
string bounce_name;
|
string bounce_name;
|
||||||
switch (target) {
|
switch (target) {
|
||||||
case NewSource:
|
case NewSource:
|
||||||
|
|
@ -4154,6 +4157,7 @@ Editor::bounce_range_selection (BounceTarget target, bool enable_processing)
|
||||||
{
|
{
|
||||||
Prompter dialog (true);
|
Prompter dialog (true);
|
||||||
ArdourDropdown* tslot = 0;
|
ArdourDropdown* tslot = 0;
|
||||||
|
Gtk::CheckButton* cliplib = 0;
|
||||||
|
|
||||||
switch (target) {
|
switch (target) {
|
||||||
case NewSource:
|
case NewSource:
|
||||||
|
|
@ -4176,6 +4180,12 @@ Editor::bounce_range_selection (BounceTarget target, bool enable_processing)
|
||||||
|
|
||||||
dialog.set_initial_text (bounce_name);
|
dialog.set_initial_text (bounce_name);
|
||||||
|
|
||||||
|
if (target != ReplaceRange) {
|
||||||
|
cliplib = manage (new Gtk::CheckButton (_("Copy to Clip Libary")));
|
||||||
|
dialog.get_vbox()->pack_start (*cliplib);
|
||||||
|
cliplib->show ();
|
||||||
|
}
|
||||||
|
|
||||||
if (target == NewSource) {
|
if (target == NewSource) {
|
||||||
Label* label = manage (new Label (_("Bounced Range will appear in the Source list.")));
|
Label* label = manage (new Label (_("Bounced Range will appear in the Source list.")));
|
||||||
dialog.get_vbox()->set_spacing (8);
|
dialog.get_vbox()->set_spacing (8);
|
||||||
|
|
@ -4211,6 +4221,10 @@ Editor::bounce_range_selection (BounceTarget target, bool enable_processing)
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.get_result (bounce_name);
|
dialog.get_result (bounce_name);
|
||||||
|
|
||||||
|
if (cliplib && cliplib->get_active ()) {
|
||||||
|
copy_to_clip_library = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
timepos_t start = selection->time[clicked_selection].start();
|
timepos_t start = selection->time[clicked_selection].start();
|
||||||
|
|
@ -4256,6 +4270,10 @@ Editor::bounce_range_selection (BounceTarget target, bool enable_processing)
|
||||||
in_command = true;
|
in_command = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (copy_to_clip_library) {
|
||||||
|
export_to_clip_library (r);
|
||||||
|
}
|
||||||
|
|
||||||
if (target == ReplaceRange) {
|
if (target == ReplaceRange) {
|
||||||
/*remove the edxisting regions under the edit range*/
|
/*remove the edxisting regions under the edit range*/
|
||||||
list<TimelineRange> ranges;
|
list<TimelineRange> ranges;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue