mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 19:56:31 +01:00
Fix sketchy casts.
git-svn-id: svn://localhost/ardour2/branches/3.0@5893 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
8340dcdd57
commit
c3a2f704c9
2 changed files with 25 additions and 7 deletions
|
|
@ -90,8 +90,8 @@ public:
|
||||||
|
|
||||||
typedef Evoral::ControlSet::Controls Controls;
|
typedef Evoral::ControlSet::Controls Controls;
|
||||||
|
|
||||||
Evoral::ControlSet& data() { return *this; }
|
Evoral::ControlSet& data() { return *dynamic_cast<Evoral::ControlSet*>(this); }
|
||||||
const Evoral::ControlSet& data() const { return *this; }
|
const Evoral::ControlSet& data() const { return *dynamic_cast<const Evoral::ControlSet*>(this); }
|
||||||
|
|
||||||
int set_automation_state (const XMLNode&, Evoral::Parameter default_param);
|
int set_automation_state (const XMLNode&, Evoral::Parameter default_param);
|
||||||
XMLNode& get_automation_state();
|
XMLNode& get_automation_state();
|
||||||
|
|
|
||||||
|
|
@ -408,21 +408,39 @@ Automatable::control_factory(const Evoral::Parameter& param)
|
||||||
boost::shared_ptr<AutomationList> list(new AutomationList(param));
|
boost::shared_ptr<AutomationList> list(new AutomationList(param));
|
||||||
Evoral::Control* control = NULL;
|
Evoral::Control* control = NULL;
|
||||||
if (param.type() >= MidiCCAutomation && param.type() <= MidiChannelPressureAutomation) {
|
if (param.type() >= MidiCCAutomation && param.type() <= MidiChannelPressureAutomation) {
|
||||||
control = new MidiTrack::MidiControl((MidiTrack*)this, param);
|
MidiTrack* mt = dynamic_cast<MidiTrack*>(this);
|
||||||
|
if (mt) {
|
||||||
|
control = new MidiTrack::MidiControl(mt, param);
|
||||||
|
} else {
|
||||||
|
warning << "MidiCCAutomation for non-MidiTrack" << endl;
|
||||||
|
}
|
||||||
} else if (param.type() == PluginAutomation) {
|
} else if (param.type() == PluginAutomation) {
|
||||||
control = new PluginInsert::PluginControl((PluginInsert*)this, param);
|
PluginInsert* pi = dynamic_cast<PluginInsert*>(this);
|
||||||
|
if (pi) {
|
||||||
|
control = new PluginInsert::PluginControl(pi, param);
|
||||||
|
} else {
|
||||||
|
warning << "PluginAutomation for non-Plugin" << endl;
|
||||||
|
}
|
||||||
} else if (param.type() == GainAutomation) {
|
} else if (param.type() == GainAutomation) {
|
||||||
control = new Amp::GainControl( X_("gaincontrol"), _a_session, (Amp*)this, param);
|
Amp* amp = dynamic_cast<Amp*>(this);
|
||||||
|
if (amp) {
|
||||||
|
control = new Amp::GainControl(X_("gaincontrol"), _a_session, amp, param);
|
||||||
|
} else {
|
||||||
|
warning << "GainAutomation for non-Amp" << endl;
|
||||||
|
}
|
||||||
} else if (param.type() == PanAutomation) {
|
} else if (param.type() == PanAutomation) {
|
||||||
Panner* me = dynamic_cast<Panner*>(this);
|
Panner* me = dynamic_cast<Panner*>(this);
|
||||||
if (me) {
|
if (me) {
|
||||||
control = new Panner::PanControllable(me->session(), X_("panner"), *me, param);
|
control = new Panner::PanControllable(me->session(), X_("panner"), *me, param);
|
||||||
} else {
|
} else {
|
||||||
cerr << "ERROR: PanAutomation for non-Panner" << endl;
|
warning << "PanAutomation for non-Panner" << endl;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if (!control) {
|
||||||
control = new AutomationControl(_a_session, param);
|
control = new AutomationControl(_a_session, param);
|
||||||
}
|
}
|
||||||
|
|
||||||
control->set_list(list);
|
control->set_list(list);
|
||||||
return boost::shared_ptr<Evoral::Control>(control);
|
return boost::shared_ptr<Evoral::Control>(control);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue