(Source List) Recover Regions feature: WIP
This commit is contained in:
parent
fc981d4399
commit
50786b3e5c
|
@ -1239,6 +1239,7 @@ private:
|
|||
void align_regions_relative (ARDOUR::RegionPoint point);
|
||||
void align_region (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, samplepos_t position);
|
||||
void align_region_internal (boost::shared_ptr<ARDOUR::Region>, ARDOUR::RegionPoint point, samplepos_t position);
|
||||
void recover_regions (ARDOUR::RegionList);
|
||||
void remove_selected_regions ();
|
||||
void remove_clicked_region ();
|
||||
void show_region_properties ();
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
#include "ardour/selection.h"
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/session_playlists.h"
|
||||
#include "ardour/source.h"
|
||||
#include "ardour/strip_silence.h"
|
||||
#include "ardour/transient_detector.h"
|
||||
#include "ardour/transport_master_manager.h"
|
||||
|
@ -4478,6 +4479,32 @@ Editor::remove_clicked_region ()
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
Editor::recover_regions (ARDOUR::RegionList regions)
|
||||
{
|
||||
#ifdef RECOVER_REGIONS_IS_WORKING
|
||||
begin_reversible_command (_("recover regions"));
|
||||
|
||||
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
|
||||
boost::shared_ptr<ARDOUR::Source> source = (*i)->source();
|
||||
|
||||
RouteList routes = _session->get_routelist();
|
||||
for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) {
|
||||
boost::shared_ptr<ARDOUR::Track> track = boost::dynamic_pointer_cast<Track>(*it);
|
||||
if (track) {
|
||||
//ToDo
|
||||
if (source->captured_for() == track->) {
|
||||
//_session->add_command(new StatefulDiffCommand (playlist));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
commit_reversible_command ();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/** Remove the selected regions */
|
||||
void
|
||||
Editor::remove_selected_regions ()
|
||||
|
|
|
@ -537,8 +537,10 @@ EditorSources::show_context_menu (int button, int time)
|
|||
using namespace Gtk::Menu_Helpers;
|
||||
Gtk::Menu* menu = ARDOUR_UI_UTILS::shared_popup_menu ();
|
||||
MenuList& items = menu->items();
|
||||
#ifdef RECOVER_REGIONS_IS_WORKING
|
||||
items.push_back(MenuElem(_("Recover the selected Sources to their original Track & Position"),
|
||||
sigc::mem_fun(*this, &EditorSources::recover_selected_sources)));
|
||||
#endif
|
||||
items.push_back(MenuElem(_("Remove the selected Sources"),
|
||||
sigc::mem_fun(*this, &EditorSources::remove_selected_sources)));
|
||||
menu->popup(1, time);
|
||||
|
@ -547,7 +549,7 @@ EditorSources::show_context_menu (int button, int time)
|
|||
void
|
||||
EditorSources::recover_selected_sources ()
|
||||
{
|
||||
std::list<boost::weak_ptr<ARDOUR::Region> > to_be_recovered;
|
||||
ARDOUR::RegionList to_be_recovered;
|
||||
|
||||
if (_display.get_selection()->count_selected_rows() > 0) {
|
||||
|
||||
|
@ -565,7 +567,7 @@ EditorSources::recover_selected_sources ()
|
|||
|
||||
|
||||
/* ToDo */
|
||||
// _editor->recover_regions(); //this operation should be undo-able
|
||||
_editor->recover_regions(to_be_recovered); //this operation should be undo-able
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -64,9 +64,6 @@ class LIBARDOUR_API AudioSource : virtual public Source,
|
|||
|
||||
virtual bool can_truncate_peaks() const { return true; }
|
||||
|
||||
void set_captured_for (std::string str) { _captured_for = str; }
|
||||
std::string captured_for() const { return _captured_for; }
|
||||
|
||||
int read_peaks (PeakData *peaks, samplecnt_t npeaks,
|
||||
samplepos_t start, samplecnt_t cnt, double samples_per_visual_peak) const;
|
||||
|
||||
|
@ -124,7 +121,6 @@ class LIBARDOUR_API AudioSource : virtual public Source,
|
|||
|
||||
samplecnt_t _length;
|
||||
std::string _peakpath;
|
||||
std::string _captured_for;
|
||||
|
||||
int initialize_peakfile (const std::string& path, const bool in_session = false);
|
||||
int build_peaks_from_scratch ();
|
||||
|
|
|
@ -160,9 +160,6 @@ class LIBARDOUR_API MidiSource : virtual public Source
|
|||
|
||||
virtual void session_saved();
|
||||
|
||||
std::string captured_for() const { return _captured_for; }
|
||||
void set_captured_for (std::string str) { _captured_for = str; }
|
||||
|
||||
XMLNode& get_state ();
|
||||
int set_state (const XMLNode&, int version);
|
||||
|
||||
|
@ -227,8 +224,6 @@ class LIBARDOUR_API MidiSource : virtual public Source
|
|||
samplepos_t position,
|
||||
samplecnt_t cnt) = 0;
|
||||
|
||||
std::string _captured_for;
|
||||
|
||||
boost::shared_ptr<MidiModel> _model;
|
||||
bool _writing;
|
||||
|
||||
|
|
|
@ -121,6 +121,9 @@ public:
|
|||
std::string ancestor_name() { return _ancestor_name.empty() ? name() : _ancestor_name; }
|
||||
void set_ancestor_name(const std::string& name) { _ancestor_name = name; }
|
||||
|
||||
void set_captured_for (std::string str) { _captured_for = str; }
|
||||
std::string captured_for() const { return _captured_for; }
|
||||
|
||||
static PBD::Signal1<void,boost::shared_ptr<ARDOUR::Source> > SourcePropertyChanged;
|
||||
|
||||
protected:
|
||||
|
@ -136,6 +139,7 @@ public:
|
|||
gint _use_count; /* atomic */
|
||||
uint32_t _level; /* how deeply nested is this source w.r.t a disk file */
|
||||
std::string _ancestor_name;
|
||||
std::string _captured_for;
|
||||
|
||||
private:
|
||||
void fix_writable_flags ();
|
||||
|
|
Loading…
Reference in New Issue
Block a user