mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 03:36:32 +01:00
track naming patch from brian; slightly modified F11-bug workaround from brian; undo/redo items in edit menu now show operation to be undone/redone; canvas allocations now handled by an idle handler; region views respond to changes in fade/in/out curves ; undo/redo possible for some fade in/out operations; automation tracks extend to max_frames
git-svn-id: svn://localhost/ardour2/trunk@1134 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
7bbf761321
commit
2bf3ed423f
24 changed files with 254 additions and 205 deletions
|
|
@ -171,8 +171,11 @@ class AudioRegion : public Region
|
|||
void recompute_at_start ();
|
||||
void recompute_at_end ();
|
||||
|
||||
void envelope_changed (Change);
|
||||
void envelope_changed ();
|
||||
void fade_in_changed ();
|
||||
void fade_out_changed ();
|
||||
void source_offset_changed ();
|
||||
void listen_to_my_curves ();
|
||||
|
||||
void source_deleted ();
|
||||
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ class AutomationList : public PBD::StatefulDestructible
|
|||
(obj.*method)(*this);
|
||||
}
|
||||
|
||||
sigc::signal<void,Change> StateChanged;
|
||||
sigc::signal<void> StateChanged;
|
||||
|
||||
XMLNode& get_state(void);
|
||||
int set_state (const XMLNode &s);
|
||||
|
|
|
|||
|
|
@ -742,16 +742,19 @@ class Session : public PBD::StatefulDestructible
|
|||
/* History (for editors, mixers, UIs etc.) */
|
||||
|
||||
void undo (uint32_t n) {
|
||||
history.undo (n);
|
||||
}
|
||||
void redo (uint32_t n) {
|
||||
history.redo (n);
|
||||
_history.undo (n);
|
||||
}
|
||||
|
||||
uint32_t undo_depth() const { return history.undo_depth(); }
|
||||
uint32_t redo_depth() const { return history.redo_depth(); }
|
||||
string next_undo() const { return history.next_undo(); }
|
||||
string next_redo() const { return history.next_redo(); }
|
||||
void redo (uint32_t n) {
|
||||
_history.redo (n);
|
||||
}
|
||||
|
||||
UndoHistory& history() { return _history; }
|
||||
|
||||
uint32_t undo_depth() const { return _history.undo_depth(); }
|
||||
uint32_t redo_depth() const { return _history.redo_depth(); }
|
||||
string next_undo() const { return _history.next_undo(); }
|
||||
string next_redo() const { return _history.next_redo(); }
|
||||
|
||||
void begin_reversible_command (string cmd_name);
|
||||
void commit_reversible_command (Command* cmd = 0);
|
||||
|
|
@ -1568,7 +1571,7 @@ class Session : public PBD::StatefulDestructible
|
|||
|
||||
void reverse_diskstream_buffers ();
|
||||
|
||||
UndoHistory history;
|
||||
UndoHistory _history;
|
||||
UndoTransaction* current_trans;
|
||||
|
||||
GlobalRouteBooleanState get_global_route_boolean (bool (Route::*method)(void) const);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ AudioRegion::AudioRegion (boost::shared_ptr<AudioSource> src, nframes_t start, n
|
|||
set_default_fades ();
|
||||
set_default_envelope ();
|
||||
|
||||
_envelope.StateChanged.connect (mem_fun (*this, &AudioRegion::envelope_changed));
|
||||
listen_to_my_curves ();
|
||||
}
|
||||
|
||||
AudioRegion::AudioRegion (boost::shared_ptr<AudioSource> src, nframes_t start, nframes_t length, const string& name, layer_t layer, Flag flags)
|
||||
|
|
@ -105,7 +105,7 @@ AudioRegion::AudioRegion (boost::shared_ptr<AudioSource> src, nframes_t start, n
|
|||
set_default_fades ();
|
||||
set_default_envelope ();
|
||||
|
||||
_envelope.StateChanged.connect (mem_fun (*this, &AudioRegion::envelope_changed));
|
||||
listen_to_my_curves ();
|
||||
}
|
||||
|
||||
AudioRegion::AudioRegion (SourceList& srcs, nframes_t start, nframes_t length, const string& name, layer_t layer, Flag flags)
|
||||
|
|
@ -132,7 +132,7 @@ AudioRegion::AudioRegion (SourceList& srcs, nframes_t start, nframes_t length, c
|
|||
set_default_fades ();
|
||||
set_default_envelope ();
|
||||
|
||||
_envelope.StateChanged.connect (mem_fun (*this, &AudioRegion::envelope_changed));
|
||||
listen_to_my_curves ();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -196,7 +196,7 @@ AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other, nframes_t
|
|||
|
||||
_scale_amplitude = other->_scale_amplitude;
|
||||
|
||||
_envelope.StateChanged.connect (mem_fun (*this, &AudioRegion::envelope_changed));
|
||||
listen_to_my_curves ();
|
||||
}
|
||||
|
||||
AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other)
|
||||
|
|
@ -237,7 +237,7 @@ AudioRegion::AudioRegion (boost::shared_ptr<const AudioRegion> other)
|
|||
_fade_in_disabled = 0;
|
||||
_fade_out_disabled = 0;
|
||||
|
||||
_envelope.StateChanged.connect (mem_fun (*this, &AudioRegion::envelope_changed));
|
||||
listen_to_my_curves ();
|
||||
}
|
||||
|
||||
AudioRegion::AudioRegion (boost::shared_ptr<AudioSource> src, const XMLNode& node)
|
||||
|
|
@ -261,7 +261,7 @@ AudioRegion::AudioRegion (boost::shared_ptr<AudioSource> src, const XMLNode& nod
|
|||
throw failed_constructor();
|
||||
}
|
||||
|
||||
_envelope.StateChanged.connect (mem_fun (*this, &AudioRegion::envelope_changed));
|
||||
listen_to_my_curves ();
|
||||
}
|
||||
|
||||
AudioRegion::AudioRegion (SourceList& srcs, const XMLNode& node)
|
||||
|
|
@ -301,7 +301,7 @@ AudioRegion::AudioRegion (SourceList& srcs, const XMLNode& node)
|
|||
throw failed_constructor();
|
||||
}
|
||||
|
||||
_envelope.StateChanged.connect (mem_fun (*this, &AudioRegion::envelope_changed));
|
||||
listen_to_my_curves ();
|
||||
}
|
||||
|
||||
AudioRegion::~AudioRegion ()
|
||||
|
|
@ -316,6 +316,14 @@ AudioRegion::~AudioRegion ()
|
|||
GoingAway (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegion::listen_to_my_curves ()
|
||||
{
|
||||
_envelope.StateChanged.connect (mem_fun (*this, &AudioRegion::envelope_changed));
|
||||
_fade_in.StateChanged.connect (mem_fun (*this, &AudioRegion::fade_in_changed));
|
||||
_fade_out.StateChanged.connect (mem_fun (*this, &AudioRegion::fade_out_changed));
|
||||
}
|
||||
|
||||
bool
|
||||
AudioRegion::verify_length (nframes_t len)
|
||||
{
|
||||
|
|
@ -1248,7 +1256,19 @@ AudioRegion::normalize_to (float target_dB)
|
|||
}
|
||||
|
||||
void
|
||||
AudioRegion::envelope_changed (Change ignored)
|
||||
AudioRegion::fade_in_changed ()
|
||||
{
|
||||
send_change (FadeInChanged);
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegion::fade_out_changed ()
|
||||
{
|
||||
send_change (FadeOutChanged);
|
||||
}
|
||||
|
||||
void
|
||||
AudioRegion::envelope_changed ()
|
||||
{
|
||||
send_change (EnvelopeChanged);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ AutomationList::maybe_signal_changed ()
|
|||
if (_frozen) {
|
||||
changed_when_thawed = true;
|
||||
} else {
|
||||
StateChanged (Change (0));
|
||||
StateChanged ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -583,7 +583,7 @@ AutomationList::thaw ()
|
|||
{
|
||||
_frozen = false;
|
||||
if (changed_when_thawed) {
|
||||
StateChanged(Change(0)); /* EMIT SIGNAL */
|
||||
StateChanged(); /* EMIT SIGNAL */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1255,13 +1255,13 @@ AutomationList::set_state (const XMLNode& node)
|
|||
return deserialize_events (node);
|
||||
}
|
||||
|
||||
if (node.name() == X_("Envelope") && (nsos = node.child (X_("AutomationList")))) {
|
||||
/* new school in old school clothing */
|
||||
return set_state (*nsos);
|
||||
}
|
||||
|
||||
if (node.name() == X_("Envelope") || node.name() == X_("FadeOut") || node.name() == X_("FadeIn")) {
|
||||
|
||||
if ((nsos = node.child (X_("AutomationList")))) {
|
||||
/* new school in old school clothing */
|
||||
return set_state (*nsos);
|
||||
}
|
||||
|
||||
/* old school */
|
||||
|
||||
const XMLNodeList& elist = node.children();
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ BaseStereoPanner::load (istream& in, string path, uint32_t& linecnt)
|
|||
|
||||
/* now that we are done loading */
|
||||
|
||||
_automation.StateChanged (Change (0));
|
||||
_automation.StateChanged ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ Session::~Session ()
|
|||
|
||||
/* clear history so that no references to objects are held any more */
|
||||
|
||||
history.clear ();
|
||||
_history.clear ();
|
||||
|
||||
/* clear state tree so that no references to objects are held any more */
|
||||
|
||||
|
|
|
|||
|
|
@ -2097,7 +2097,7 @@ Session::commit_reversible_command (Command *cmd)
|
|||
gettimeofday (&now, 0);
|
||||
current_trans->set_timestamp (now);
|
||||
|
||||
history.add (current_trans);
|
||||
_history.add (current_trans);
|
||||
}
|
||||
|
||||
Session::GlobalRouteBooleanState
|
||||
|
|
@ -2647,7 +2647,7 @@ Session::cleanup_sources (Session::cleanup_report& rep)
|
|||
|
||||
/* dump the history list */
|
||||
|
||||
history.clear ();
|
||||
_history.clear ();
|
||||
|
||||
/* save state so we don't end up a session file
|
||||
referring to non-existent sources.
|
||||
|
|
@ -2798,7 +2798,7 @@ Session::save_history (string snapshot_name)
|
|||
string xml_path;
|
||||
string bak_path;
|
||||
|
||||
tree.set_root (&history.get_state());
|
||||
tree.set_root (&_history.get_state());
|
||||
|
||||
if (snapshot_name.empty()) {
|
||||
snapshot_name = _current_snapshot_name;
|
||||
|
|
@ -2825,14 +2825,13 @@ Session::save_history (string snapshot_name)
|
|||
* possible to fix.
|
||||
*/
|
||||
|
||||
if (unlink (xml_path.c_str()))
|
||||
{
|
||||
error << string_compose (_("could not remove corrupt history file %1"), xml_path) << endmsg;
|
||||
if (unlink (xml_path.c_str())) {
|
||||
error << string_compose (_("could not remove corrupt history file %1"), xml_path) << endmsg;
|
||||
} else {
|
||||
if (rename (bak_path.c_str(), xml_path.c_str()))
|
||||
{
|
||||
error << string_compose (_("could not restore history file from backup %1"), bak_path) << endmsg;
|
||||
}
|
||||
if (rename (bak_path.c_str(), xml_path.c_str()))
|
||||
{
|
||||
error << string_compose (_("could not restore history file from backup %1"), bak_path) << endmsg;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
|
@ -2862,7 +2861,7 @@ Session::restore_history (string snapshot_name)
|
|||
}
|
||||
|
||||
/* replace history */
|
||||
history.clear();
|
||||
_history.clear();
|
||||
|
||||
for (XMLNodeConstIterator it = tree.root()->children().begin(); it != tree.root()->children().end(); it++) {
|
||||
|
||||
|
|
@ -2895,7 +2894,7 @@ Session::restore_history (string snapshot_name)
|
|||
}
|
||||
}
|
||||
|
||||
history.add (ut);
|
||||
_history.add (ut);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class UndoTransaction : public Command
|
|||
friend void command_death (UndoTransaction*, Command *);
|
||||
};
|
||||
|
||||
class UndoHistory
|
||||
class UndoHistory : public sigc::trackable
|
||||
{
|
||||
public:
|
||||
UndoHistory();
|
||||
|
|
@ -97,6 +97,8 @@ class UndoHistory
|
|||
XMLNode &get_state();
|
||||
void save_state();
|
||||
|
||||
sigc::signal<void> Changed;
|
||||
|
||||
private:
|
||||
bool _clearing;
|
||||
std::list<UndoTransaction*> UndoList;
|
||||
|
|
|
|||
|
|
@ -157,6 +157,8 @@ UndoHistory::add (UndoTransaction* const ut)
|
|||
UndoList.push_back (ut);
|
||||
|
||||
/* we are now owners of the transaction */
|
||||
|
||||
Changed (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -168,6 +170,8 @@ UndoHistory::remove (UndoTransaction* const ut)
|
|||
|
||||
UndoList.remove (ut);
|
||||
RedoList.remove (ut);
|
||||
|
||||
Changed (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -182,6 +186,8 @@ UndoHistory::undo (unsigned int n)
|
|||
ut->undo ();
|
||||
RedoList.push_back (ut);
|
||||
}
|
||||
|
||||
Changed (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -196,6 +202,8 @@ UndoHistory::redo (unsigned int n)
|
|||
ut->redo ();
|
||||
UndoList.push_back (ut);
|
||||
}
|
||||
|
||||
Changed (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -204,6 +212,9 @@ UndoHistory::clear_redo ()
|
|||
_clearing = true;
|
||||
RedoList.clear ();
|
||||
_clearing = false;
|
||||
|
||||
Changed (); /* EMIT SIGNAL */
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -212,6 +223,8 @@ UndoHistory::clear_undo ()
|
|||
_clearing = true;
|
||||
UndoList.clear ();
|
||||
_clearing = false;
|
||||
|
||||
Changed (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -219,6 +232,8 @@ UndoHistory::clear ()
|
|||
{
|
||||
clear_undo ();
|
||||
clear_redo ();
|
||||
|
||||
Changed (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
XMLNode & UndoHistory::get_state()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue