Remove Cruft -- AutomationStyle never did anything.

Trim automation is planned via SlavableAC as normal AutomationMode.
Some of this code have a revival (a special "Trim+Preview" state
before merging Automation but that has to be more general than Pan & Gain.
This commit is contained in:
Robin Gareus 2017-06-19 17:40:32 +02:00
parent 31c6f66d9b
commit 7c94499aec
20 changed files with 0 additions and 335 deletions

View file

@ -91,9 +91,6 @@ public:
AutoState get_parameter_automation_state (Evoral::Parameter param);
virtual void set_parameter_automation_state (Evoral::Parameter param, AutoState);
AutoStyle get_parameter_automation_style (Evoral::Parameter param);
void set_parameter_automation_style (Evoral::Parameter param, AutoStyle);
void protect_automation ();
const std::set<Evoral::Parameter>& what_can_be_automated() const { return _can_automate_list; }

View file

@ -82,12 +82,7 @@ public:
return alist() ? alist()->automation_state() : Off;
}
inline AutoStyle automation_style() const {
return alist() ? alist()->automation_style() : Absolute;
}
void set_automation_state(AutoState as);
void set_automation_style(AutoStyle as);
void start_touch(double when);
void stop_touch(bool mark, double when);

View file

@ -88,10 +88,6 @@ class LIBARDOUR_API AutomationList : public Evoral::ControlList, public PBD::Sta
AutoState automation_state() const { return _state; }
PBD::Signal1<void, AutoState> automation_state_changed;
void set_automation_style (AutoStyle m);
AutoStyle automation_style() const { return _style; }
PBD::Signal0<void> automation_style_changed;
bool automation_playback() const {
return (_state & Play) || ((_state & Touch) && !touching());
}
@ -130,7 +126,6 @@ class LIBARDOUR_API AutomationList : public Evoral::ControlList, public PBD::Sta
void maybe_signal_changed ();
AutoState _state;
AutoStyle _style;
gint _touching;
bool operator== (const AutomationList&) const { /* not called */ abort(); return false; }

View file

@ -57,10 +57,6 @@ class LIBARDOUR_API Pannable : public PBD::Stateful, public Automatable, public
AutoState automation_state() const { return _auto_state; }
PBD::Signal1<void, AutoState> automation_state_changed;
void set_automation_style (AutoStyle m);
AutoStyle automation_style() const { return _auto_style; }
PBD::Signal0<void> automation_style_changed;
bool automation_playback() const {
return (_auto_state & Play) || ((_auto_state & Touch) && !touching());
}
@ -85,7 +81,6 @@ class LIBARDOUR_API Pannable : public PBD::Stateful, public Automatable, public
protected:
boost::weak_ptr<Panner> _panner;
AutoState _auto_state;
AutoStyle _auto_style;
gint _touching;
bool _has_state;
uint32_t _responding_to_control_auto_state_change;

View file

@ -105,8 +105,6 @@ public:
void set_automation_state (AutoState);
AutoState automation_state() const;
void set_automation_style (AutoStyle);
AutoStyle automation_style() const;
virtual std::set<Evoral::Parameter> what_can_be_automated() const;
virtual std::string describe_parameter (Evoral::Parameter);

View file

@ -184,14 +184,6 @@ namespace ARDOUR {
std::string auto_state_to_string (AutoState);
AutoState string_to_auto_state (std::string);
enum AutoStyle {
Absolute = 0x1,
Trim = 0x2
};
std::string auto_style_to_string (AutoStyle);
AutoStyle string_to_auto_style (std::string);
enum AlignStyle {
CaptureTime,
ExistingMaterial

View file

@ -88,20 +88,6 @@ inline bool string_to (const std::string& str, ARDOUR::AutoState& as)
return true;
}
template <>
inline bool to_string (ARDOUR::AutoStyle val, std::string& str)
{
str = ARDOUR::auto_style_to_string (val);
return true;
}
template <>
inline bool string_to (const std::string& str, ARDOUR::AutoStyle& as)
{
as = ARDOUR::string_to_auto_style (str);
return true;
}
template <>
inline bool to_string (ARDOUR::DataType val, std::string& str)
{

View file

@ -313,34 +313,6 @@ Automatable::get_parameter_automation_state (Evoral::Parameter param)
return result;
}
void
Automatable::set_parameter_automation_style (Evoral::Parameter param, AutoStyle s)
{
Glib::Threads::Mutex::Lock lm (control_lock());
boost::shared_ptr<AutomationControl> c = automation_control(param, true);
if (c && (s != c->automation_style())) {
c->set_automation_style (s);
_a_session.set_dirty ();
}
}
AutoStyle
Automatable::get_parameter_automation_style (Evoral::Parameter param)
{
Glib::Threads::Mutex::Lock lm (control_lock());
boost::shared_ptr<Evoral::Control> c = control(param);
boost::shared_ptr<AutomationList> l = boost::dynamic_pointer_cast<AutomationList>(c->list());
if (c) {
return l->automation_style();
} else {
return Absolute; // whatever
}
}
void
Automatable::protect_automation ()
{

View file

@ -242,13 +242,6 @@ AutomationControl::set_automation_state (AutoState as)
}
}
void
AutomationControl::set_automation_style (AutoStyle as)
{
if (!_list) return;
alist()->set_automation_style (as);
}
void
AutomationControl::start_touch(double when)
{

View file

@ -59,7 +59,6 @@ AutomationList::AutomationList (const Evoral::Parameter& id, const Evoral::Param
, _before (0)
{
_state = Off;
_style = Absolute;
g_atomic_int_set (&_touching, 0);
create_curve_if_necessary();
@ -73,7 +72,6 @@ AutomationList::AutomationList (const Evoral::Parameter& id)
, _before (0)
{
_state = Off;
_style = Absolute;
g_atomic_int_set (&_touching, 0);
create_curve_if_necessary();
@ -87,7 +85,6 @@ AutomationList::AutomationList (const AutomationList& other)
, StatefulDestructible()
, _before (0)
{
_style = other._style;
_state = other._state;
g_atomic_int_set (&_touching, other.touching());
@ -101,7 +98,6 @@ AutomationList::AutomationList (const AutomationList& other, double start, doubl
: ControlList(other, start, end)
, _before (0)
{
_style = other._style;
_state = other._state;
g_atomic_int_set (&_touching, other.touching());
@ -120,7 +116,6 @@ AutomationList::AutomationList (const XMLNode& node, Evoral::Parameter id)
{
g_atomic_int_set (&_touching, 0);
_state = Off;
_style = Absolute;
set_state (node, Stateful::loading_state_version);
@ -173,7 +168,6 @@ AutomationList::operator= (const AutomationList& other)
ControlList::operator= (other);
_state = other._state;
_style = other._style;
_touching = other._touching;
mark_dirty ();
@ -208,15 +202,6 @@ AutomationList::set_automation_state (AutoState s)
}
}
void
AutomationList::set_automation_style (AutoStyle s)
{
if (s != _style) {
_style = s;
automation_style_changed (); /* EMIT SIGNAL */
}
}
void
AutomationList::start_write_pass (double when)
{
@ -359,8 +344,6 @@ AutomationList::state (bool full)
root->set_property ("state", Off);
}
root->set_property ("style", _style);
if (!_events.empty()) {
root->add_child_nocopy (serialize_events());
}
@ -516,10 +499,6 @@ AutomationList::set_state (const XMLNode& node, int version)
_default_value = 0.0;
}
if (!node.get_property (X_("style"), _style)) {
_style = Absolute;
}
if (node.get_property (X_("state"), _state)) {
if (_state == Write) {
_state = Off;
@ -564,7 +543,6 @@ AutomationList::operator!= (AutomationList const & other) const
return (
static_cast<ControlList const &> (*this) != static_cast<ControlList const &> (other) ||
_state != other._state ||
_style != other._style ||
_touching != other._touching
);
}

View file

@ -96,7 +96,6 @@ setup_enum_writer ()
IOChange _IOChange;
AutomationType _AutomationType;
AutoState _AutoState;
AutoStyle _AutoStyle;
AutoConnectOption _AutoConnectOption;
TracksAutoNamingRule _TracksAutoNamingRule;
Session::StateOfTheState _Session_StateOfTheState;
@ -192,10 +191,6 @@ setup_enum_writer ()
REGISTER_ENUM (Play);
REGISTER_BITS (_AutoState);
REGISTER_ENUM (Absolute);
REGISTER_ENUM (Trim);
REGISTER_BITS (_AutoStyle);
REGISTER_ENUM (CaptureTime);
REGISTER_ENUM (ExistingMaterial);
REGISTER (_AlignStyle);

View file

@ -1378,9 +1378,7 @@ LuaBindings::common (lua_State* L)
.addCast<Evoral::Control> ("to_ctrl")
.addCast<SlavableAutomationControl> ("to_slavable")
.addFunction ("automation_state", &AutomationControl::automation_state)
.addFunction ("automation_style", &AutomationControl::automation_style)
.addFunction ("set_automation_state", &AutomationControl::set_automation_state)
.addFunction ("set_automation_style", &AutomationControl::set_automation_style)
.addFunction ("start_touch", &AutomationControl::start_touch)
.addFunction ("stop_touch", &AutomationControl::stop_touch)
.addFunction ("get_value", &AutomationControl::get_value)
@ -1671,11 +1669,6 @@ LuaBindings::common (lua_State* L)
.endNamespace ()
.endNamespace ()
.beginNamespace ("AutoStyle")
.addConst ("Absolute", ARDOUR::AutoStyle(Absolute))
.addConst ("Trim", ARDOUR::AutoStyle(Trim))
.endNamespace ()
.beginNamespace ("AutoState")
.addConst ("Off", ARDOUR::AutoState(Off))
.addConst ("Write", ARDOUR::AutoState(Write))

View file

@ -45,7 +45,6 @@ Pannable::Pannable (Session& s)
, pan_frontback_control (new PanControllable (s, "", this, PanFrontBackAutomation))
, pan_lfe_control (new PanControllable (s, "", this, PanLFEAutomation))
, _auto_state (Off)
, _auto_style (Absolute)
, _has_state (false)
, _responding_to_control_auto_state_change (0)
{
@ -136,26 +135,6 @@ Pannable::set_automation_state (AutoState state)
}
}
void
Pannable::set_automation_style (AutoStyle style)
{
if (style != _auto_style) {
_auto_style = style;
const Controls& c (controls());
for (Controls::const_iterator ci = c.begin(); ci != c.end(); ++ci) {
boost::shared_ptr<AutomationControl> ac = boost::dynamic_pointer_cast<AutomationControl>(ci->second);
if (ac) {
ac->alist()->set_automation_style (style);
}
}
session().set_dirty ();
automation_style_changed ();
}
}
void
Pannable::start_touch (double when)
{

View file

@ -66,12 +66,6 @@ Panner::distribute_automated (BufferSet& ibufs, BufferSet& obufs,
}
}
void
Panner::set_automation_style (AutoStyle style)
{
_pannable->set_automation_style (style);
}
void
Panner::set_automation_state (AutoState state)
{
@ -84,12 +78,6 @@ Panner::automation_state () const
return _pannable->automation_state();
}
AutoStyle
Panner::automation_style () const
{
return _pannable->automation_style ();
}
bool
Panner::touching () const
{

View file

@ -590,39 +590,6 @@ ARDOUR::auto_state_to_string (AutoState as)
return "";
}
AutoStyle
ARDOUR::string_to_auto_style (std::string str)
{
if (str == X_("Absolute")) {
return Absolute;
} else if (str == X_("Trim")) {
return Trim;
}
fatal << string_compose (_("programming error: %1 %2"), "illegal AutoStyle string: ", str) << endmsg;
abort(); /*NOTREACHED*/
return Trim;
}
string
ARDOUR::auto_style_to_string (AutoStyle as)
{
/* to be used only for XML serialization, no i18n done */
switch (as) {
case Absolute:
return X_("Absolute");
break;
case Trim:
return X_("Trim");
break;
}
fatal << string_compose (_("programming error: %1 %2"), "illegal AutoStyle type: ", as) << endmsg;
abort(); /*NOTREACHED*/
return "";
}
std::string
bool_as_string (bool yn)
{