mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 08:14:58 +01:00
Mark Sequence as edited when one of its parent ControlSet's ControlLists is changed.
git-svn-id: svn://localhost/ardour2/branches/3.0@7404 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
6f5ee7c429
commit
d1b4599725
12 changed files with 60 additions and 20 deletions
|
|
@ -58,6 +58,7 @@ public:
|
||||||
automation_control (const Evoral::Parameter& id) const;
|
automation_control (const Evoral::Parameter& id) const;
|
||||||
|
|
||||||
virtual void add_control(boost::shared_ptr<Evoral::Control>);
|
virtual void add_control(boost::shared_ptr<Evoral::Control>);
|
||||||
|
void clear_controls ();
|
||||||
|
|
||||||
virtual void automation_snapshot(nframes_t now, bool force);
|
virtual void automation_snapshot(nframes_t now, bool force);
|
||||||
virtual void transport_stopped (sframes_t now);
|
virtual void transport_stopped (sframes_t now);
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@ class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlL
|
||||||
bool operator== (const AutomationList&);
|
bool operator== (const AutomationList&);
|
||||||
|
|
||||||
void thaw ();
|
void thaw ();
|
||||||
void mark_dirty () const;
|
|
||||||
|
|
||||||
void set_automation_state (AutoState);
|
void set_automation_state (AutoState);
|
||||||
AutoState automation_state() const { return _state; }
|
AutoState automation_state() const { return _state; }
|
||||||
|
|
@ -71,7 +70,6 @@ class AutomationList : public PBD::StatefulDestructible, public Evoral::ControlL
|
||||||
PBD::Signal0<void> StateChanged;
|
PBD::Signal0<void> StateChanged;
|
||||||
|
|
||||||
static PBD::Signal1<void,AutomationList*> AutomationListCreated;
|
static PBD::Signal1<void,AutomationList*> AutomationListCreated;
|
||||||
mutable PBD::Signal0<void> Dirty;
|
|
||||||
|
|
||||||
void start_touch ();
|
void start_touch ();
|
||||||
void stop_touch ();
|
void stop_touch ();
|
||||||
|
|
|
||||||
|
|
@ -484,3 +484,11 @@ Automatable::automation_state_changed (Evoral::Parameter const & p)
|
||||||
{
|
{
|
||||||
AutomationStateChanged (p); /* EMIT SIGNAL */
|
AutomationStateChanged (p); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Automatable::clear_controls ()
|
||||||
|
{
|
||||||
|
_control_connections.drop_connections ();
|
||||||
|
ControlSet::clear_controls ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -218,13 +218,6 @@ AutomationList::thaw ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
AutomationList::mark_dirty () const
|
|
||||||
{
|
|
||||||
ControlList::mark_dirty ();
|
|
||||||
Dirty (); /* EMIT SIGNAL */
|
|
||||||
}
|
|
||||||
|
|
||||||
XMLNode&
|
XMLNode&
|
||||||
AutomationList::get_state ()
|
AutomationList::get_state ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
#include "pbd/signals.h"
|
||||||
#include "evoral/types.hpp"
|
#include "evoral/types.hpp"
|
||||||
#include "evoral/Parameter.hpp"
|
#include "evoral/Parameter.hpp"
|
||||||
|
|
||||||
|
|
@ -55,10 +56,17 @@ public:
|
||||||
|
|
||||||
inline const Parameter& parameter() const { return _parameter; }
|
inline const Parameter& parameter() const { return _parameter; }
|
||||||
|
|
||||||
|
/** Emitted when the our ControlList is marked dirty */
|
||||||
|
PBD::Signal0<void> ListMarkedDirty;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Parameter _parameter;
|
Parameter _parameter;
|
||||||
boost::shared_ptr<ControlList> _list;
|
boost::shared_ptr<ControlList> _list;
|
||||||
float _user_value;
|
float _user_value;
|
||||||
|
PBD::ScopedConnection _list_marked_dirty_connection;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void list_marked_dirty ();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Evoral
|
} // namespace Evoral
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
#include <boost/pool/pool.hpp>
|
#include <boost/pool/pool.hpp>
|
||||||
#include <boost/pool/pool_alloc.hpp>
|
#include <boost/pool/pool_alloc.hpp>
|
||||||
#include <glibmm/thread.h>
|
#include <glibmm/thread.h>
|
||||||
|
#include "pbd/signals.h"
|
||||||
#include "evoral/types.hpp"
|
#include "evoral/types.hpp"
|
||||||
#include "evoral/Parameter.hpp"
|
#include "evoral/Parameter.hpp"
|
||||||
|
|
||||||
|
|
@ -224,7 +225,7 @@ public:
|
||||||
Curve& curve() { assert(_curve); return *_curve; }
|
Curve& curve() { assert(_curve); return *_curve; }
|
||||||
const Curve& curve() const { assert(_curve); return *_curve; }
|
const Curve& curve() const { assert(_curve); return *_curve; }
|
||||||
|
|
||||||
virtual void mark_dirty () const;
|
void mark_dirty () const;
|
||||||
|
|
||||||
enum InterpolationStyle {
|
enum InterpolationStyle {
|
||||||
Discrete,
|
Discrete,
|
||||||
|
|
@ -235,6 +236,9 @@ public:
|
||||||
InterpolationStyle interpolation() const { return _interpolation; }
|
InterpolationStyle interpolation() const { return _interpolation; }
|
||||||
void set_interpolation(InterpolationStyle style) { _interpolation = style; }
|
void set_interpolation(InterpolationStyle style) { _interpolation = style; }
|
||||||
|
|
||||||
|
/** Emitted when mark_dirty() is called on this object */
|
||||||
|
mutable PBD::Signal0<void> Dirty;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/** Called by unlocked_eval() to handle cases of 3 or more control points. */
|
/** Called by unlocked_eval() to handle cases of 3 or more control points. */
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
#include <glibmm/thread.h>
|
#include <glibmm/thread.h>
|
||||||
|
#include "pbd/signals.h"
|
||||||
#include "evoral/types.hpp"
|
#include "evoral/types.hpp"
|
||||||
#include "evoral/Parameter.hpp"
|
#include "evoral/Parameter.hpp"
|
||||||
|
|
||||||
|
|
@ -67,8 +68,13 @@ public:
|
||||||
Glib::Mutex& control_lock() const { return _control_lock; }
|
Glib::Mutex& control_lock() const { return _control_lock; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void control_list_marked_dirty () {}
|
||||||
|
|
||||||
mutable Glib::Mutex _control_lock;
|
mutable Glib::Mutex _control_lock;
|
||||||
Controls _controls;
|
Controls _controls;
|
||||||
|
|
||||||
|
private:
|
||||||
|
PBD::ScopedConnectionList _control_connections;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef typename boost::shared_ptr<Evoral::Note<Time> > NotePtr;
|
typedef typename boost::shared_ptr<Evoral::Note<Time> > NotePtr;
|
||||||
typedef typename boost::shared_ptr<const Evoral::Note<Time> > constNotePtr;
|
typedef typename boost::shared_ptr<const Evoral::Note<Time> > constNotePtr;
|
||||||
|
|
||||||
|
|
@ -274,6 +275,8 @@ private:
|
||||||
void get_notes_by_pitch (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const;
|
void get_notes_by_pitch (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const;
|
||||||
void get_notes_by_velocity (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const;
|
void get_notes_by_velocity (Notes&, NoteOperator, uint8_t val, int chan_mask = 0) const;
|
||||||
|
|
||||||
|
void control_list_marked_dirty ();
|
||||||
|
|
||||||
const TypeMap& _type_map;
|
const TypeMap& _type_map;
|
||||||
|
|
||||||
Notes _notes; // notes indexed by time
|
Notes _notes; // notes indexed by time
|
||||||
|
|
@ -283,9 +286,6 @@ private:
|
||||||
typedef std::multiset<NotePtr, EarlierNoteComparator> WriteNotes;
|
typedef std::multiset<NotePtr, EarlierNoteComparator> WriteNotes;
|
||||||
WriteNotes _write_notes[16];
|
WriteNotes _write_notes[16];
|
||||||
|
|
||||||
typedef std::vector< boost::shared_ptr<const ControlList> > ControlLists;
|
|
||||||
ControlLists _dirty_controls;
|
|
||||||
|
|
||||||
const const_iterator _end_iter;
|
const const_iterator _end_iter;
|
||||||
bool _percussive;
|
bool _percussive;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,9 @@ Parameter::TypeMetadata Parameter::_type_metadata;
|
||||||
|
|
||||||
Control::Control(const Parameter& parameter, boost::shared_ptr<ControlList> list)
|
Control::Control(const Parameter& parameter, boost::shared_ptr<ControlList> list)
|
||||||
: _parameter(parameter)
|
: _parameter(parameter)
|
||||||
, _list(list)
|
|
||||||
, _user_value(list ? list->default_value() : parameter.normal())
|
, _user_value(list ? list->default_value() : parameter.normal())
|
||||||
{
|
{
|
||||||
|
set_list (list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -59,7 +59,19 @@ Control::set_float(float value, bool to_list, FrameTime frame)
|
||||||
void
|
void
|
||||||
Control::set_list(boost::shared_ptr<ControlList> list)
|
Control::set_list(boost::shared_ptr<ControlList> list)
|
||||||
{
|
{
|
||||||
|
_list_marked_dirty_connection.disconnect ();
|
||||||
|
|
||||||
_list = list;
|
_list = list;
|
||||||
|
|
||||||
|
if (_list) {
|
||||||
|
_list->Dirty.connect_same_thread (_list_marked_dirty_connection, boost::bind (&Control::list_marked_dirty, this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Control::list_marked_dirty ()
|
||||||
|
{
|
||||||
|
ListMarkedDirty (); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Evoral
|
} // namespace Evoral
|
||||||
|
|
|
||||||
|
|
@ -558,8 +558,12 @@ ControlList::mark_dirty () const
|
||||||
{
|
{
|
||||||
_lookup_cache.left = -1;
|
_lookup_cache.left = -1;
|
||||||
_search_cache.left = -1;
|
_search_cache.left = -1;
|
||||||
if (_curve)
|
|
||||||
|
if (_curve) {
|
||||||
_curve->mark_dirty();
|
_curve->mark_dirty();
|
||||||
|
}
|
||||||
|
|
||||||
|
Dirty (); /* EMIT SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ void
|
||||||
ControlSet::add_control(boost::shared_ptr<Control> ac)
|
ControlSet::add_control(boost::shared_ptr<Control> ac)
|
||||||
{
|
{
|
||||||
_controls[ac->parameter()] = ac;
|
_controls[ac->parameter()] = ac;
|
||||||
|
|
||||||
|
ac->ListMarkedDirty.connect_same_thread (_control_connections, boost::bind (&ControlSet::control_list_marked_dirty, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -108,6 +110,8 @@ ControlSet::clear_controls ()
|
||||||
{
|
{
|
||||||
Glib::Mutex::Lock lm (_control_lock);
|
Glib::Mutex::Lock lm (_control_lock);
|
||||||
|
|
||||||
|
_control_connections.drop_connections ();
|
||||||
|
|
||||||
for (Controls::iterator li = _controls.begin(); li != _controls.end(); ++li)
|
for (Controls::iterator li = _controls.begin(); li != _controls.end(); ++li)
|
||||||
li->second->list()->clear();
|
li->second->list()->clear();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -534,7 +534,6 @@ Sequence<Time>::start_write()
|
||||||
for (int i = 0; i < 16; ++i) {
|
for (int i = 0; i < 16; ++i) {
|
||||||
_write_notes[i].clear();
|
_write_notes[i].clear();
|
||||||
}
|
}
|
||||||
_dirty_controls.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Finish a write of events to the model.
|
/** Finish a write of events to the model.
|
||||||
|
|
@ -576,10 +575,6 @@ Sequence<Time>::end_write (bool delete_stuck)
|
||||||
_write_notes[i].clear();
|
_write_notes[i].clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ControlLists::const_iterator i = _dirty_controls.begin(); i != _dirty_controls.end(); ++i) {
|
|
||||||
(*i)->mark_dirty();
|
|
||||||
}
|
|
||||||
|
|
||||||
_writing = false;
|
_writing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1036,6 +1031,13 @@ Sequence<Time>::set_overlap_pitch_resolution (OverlapPitchResolution opr)
|
||||||
/* XXX todo: clean up existing overlaps in source data? */
|
/* XXX todo: clean up existing overlaps in source data? */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename Time>
|
||||||
|
void
|
||||||
|
Sequence<Time>::control_list_marked_dirty ()
|
||||||
|
{
|
||||||
|
set_edited (true);
|
||||||
|
}
|
||||||
|
|
||||||
template class Sequence<Evoral::MusicalTime>;
|
template class Sequence<Evoral::MusicalTime>;
|
||||||
|
|
||||||
} // namespace Evoral
|
} // namespace Evoral
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue