mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
track combine ops per-playlist to avoid name collisions for compound regions
git-svn-id: svn://localhost/ardour2/branches/3.0@9529 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
99aa8c6338
commit
c8a27ebdbf
4 changed files with 13 additions and 5 deletions
|
|
@ -588,6 +588,7 @@
|
||||||
<menuitem action='pitch-shift-region'/>
|
<menuitem action='pitch-shift-region'/>
|
||||||
<menuitem action='transpose-region'/>
|
<menuitem action='transpose-region'/>
|
||||||
<menuitem action='naturalize-region'/>
|
<menuitem action='naturalize-region'/>
|
||||||
|
<menuitem action='combine-regions'/>
|
||||||
<menuitem action='split-region'/>
|
<menuitem action='split-region'/>
|
||||||
<menuitem action='split-multichannel-region'/>
|
<menuitem action='split-multichannel-region'/>
|
||||||
<menuitem action='remove-region'/>
|
<menuitem action='remove-region'/>
|
||||||
|
|
|
||||||
|
|
@ -2500,9 +2500,7 @@ RouteTimeAxisView::combine_regions ()
|
||||||
|
|
||||||
_view->foreach_selected_regionview (sigc::bind (sigc::ptr_fun (add_region_to_list), &selected_regions, &max_level));
|
_view->foreach_selected_regionview (sigc::bind (sigc::ptr_fun (add_region_to_list), &selected_regions, &max_level));
|
||||||
|
|
||||||
uint32_t num_joined_regions = playlist->count_joined_regions();
|
string name = string_compose (_("%1 compound-%2 (%3)"), playlist->name(), playlist->combine_ops()+1, max_level+1);
|
||||||
string name = string_compose (_("%1 compound-%2 (%3)"), playlist->name(), num_joined_regions+1, max_level+1);
|
|
||||||
|
|
||||||
|
|
||||||
playlist->clear_changes ();
|
playlist->clear_changes ();
|
||||||
playlist->join (selected_regions, name);
|
playlist->join (selected_regions, name);
|
||||||
|
|
|
||||||
|
|
@ -229,6 +229,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
framepos_t find_next_top_layer_position (framepos_t) const;
|
framepos_t find_next_top_layer_position (framepos_t) const;
|
||||||
|
uint32_t combine_ops() const { return _combine_ops; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class Session;
|
friend class Session;
|
||||||
|
|
@ -295,6 +296,7 @@ public:
|
||||||
uint64_t layer_op_counter;
|
uint64_t layer_op_counter;
|
||||||
framecnt_t freeze_length;
|
framecnt_t freeze_length;
|
||||||
bool auto_partition;
|
bool auto_partition;
|
||||||
|
uint32_t _combine_ops;
|
||||||
|
|
||||||
/** true if relayering should be done using region's current layers and their `pending explicit relayer'
|
/** true if relayering should be done using region's current layers and their `pending explicit relayer'
|
||||||
* flags; otherwise false if relayering should be done using the layer-model (most recently moved etc.)
|
* flags; otherwise false if relayering should be done using the layer-model (most recently moved etc.)
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,10 @@
|
||||||
|
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
|
#include "pbd/convert.h"
|
||||||
#include "pbd/failed_constructor.h"
|
#include "pbd/failed_constructor.h"
|
||||||
#include "pbd/stateful_diff_command.h"
|
#include "pbd/stateful_diff_command.h"
|
||||||
#include "pbd/xml++.h"
|
#include "pbd/xml++.h"
|
||||||
#include "pbd/stacktrace.h"
|
|
||||||
|
|
||||||
#include "ardour/debug.h"
|
#include "ardour/debug.h"
|
||||||
#include "ardour/playlist.h"
|
#include "ardour/playlist.h"
|
||||||
|
|
@ -357,6 +357,7 @@ Playlist::init (bool hide)
|
||||||
layer_op_counter = 0;
|
layer_op_counter = 0;
|
||||||
freeze_length = 0;
|
freeze_length = 0;
|
||||||
_explicit_relayering = false;
|
_explicit_relayering = false;
|
||||||
|
_combine_ops = 0;
|
||||||
|
|
||||||
_session.history().BeginUndoRedo.connect_same_thread (*this, boost::bind (&Playlist::begin_undo, this));
|
_session.history().BeginUndoRedo.connect_same_thread (*this, boost::bind (&Playlist::begin_undo, this));
|
||||||
_session.history().EndUndoRedo.connect_same_thread (*this, boost::bind (&Playlist::end_undo, this));
|
_session.history().EndUndoRedo.connect_same_thread (*this, boost::bind (&Playlist::end_undo, this));
|
||||||
|
|
@ -2277,6 +2278,8 @@ Playlist::set_state (const XMLNode& node, int version)
|
||||||
_orig_diskstream_id = prop->value ();
|
_orig_diskstream_id = prop->value ();
|
||||||
} else if (prop->name() == X_("frozen")) {
|
} else if (prop->name() == X_("frozen")) {
|
||||||
_frozen = string_is_affirmative (prop->value());
|
_frozen = string_is_affirmative (prop->value());
|
||||||
|
} else if (prop->name() == X_("combine-ops")) {
|
||||||
|
_combine_ops = atoi (prop->value());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2369,7 +2372,7 @@ XMLNode&
|
||||||
Playlist::state (bool full_state)
|
Playlist::state (bool full_state)
|
||||||
{
|
{
|
||||||
XMLNode *node = new XMLNode (X_("Playlist"));
|
XMLNode *node = new XMLNode (X_("Playlist"));
|
||||||
char buf[64] = "";
|
char buf[64];
|
||||||
|
|
||||||
node->add_property (X_("id"), id().to_s());
|
node->add_property (X_("id"), id().to_s());
|
||||||
node->add_property (X_("name"), _name);
|
node->add_property (X_("name"), _name);
|
||||||
|
|
@ -2383,6 +2386,9 @@ Playlist::state (bool full_state)
|
||||||
RegionLock rlock (this, false);
|
RegionLock rlock (this, false);
|
||||||
XMLNode* nested_node = 0;
|
XMLNode* nested_node = 0;
|
||||||
|
|
||||||
|
snprintf (buf, sizeof (buf), "%u", _combine_ops);
|
||||||
|
node->add_property ("combine-ops", buf);
|
||||||
|
|
||||||
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
|
for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
|
||||||
if ((*i)->max_source_level() > 0) {
|
if ((*i)->max_source_level() > 0) {
|
||||||
|
|
||||||
|
|
@ -3208,6 +3214,7 @@ Playlist::join (const RegionList& r, const std::string& name)
|
||||||
/* add the new region at the right location */
|
/* add the new region at the right location */
|
||||||
|
|
||||||
add_region (compound_region, earliest_position);
|
add_region (compound_region, earliest_position);
|
||||||
|
_combine_ops++;
|
||||||
|
|
||||||
thaw ();
|
thaw ();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue