mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
rework processor box: handle n/a plugins
This commit is contained in:
parent
eddf50185b
commit
9f3bf09a7c
5 changed files with 63 additions and 22 deletions
|
|
@ -49,7 +49,6 @@ using namespace ARDOUR;
|
||||||
vector<RefPtr<Gtk::Action> > ActionManager::session_sensitive_actions;
|
vector<RefPtr<Gtk::Action> > ActionManager::session_sensitive_actions;
|
||||||
vector<RefPtr<Gtk::Action> > ActionManager::write_sensitive_actions;
|
vector<RefPtr<Gtk::Action> > ActionManager::write_sensitive_actions;
|
||||||
vector<RefPtr<Gtk::Action> > ActionManager::region_list_selection_sensitive_actions;
|
vector<RefPtr<Gtk::Action> > ActionManager::region_list_selection_sensitive_actions;
|
||||||
vector<RefPtr<Gtk::Action> > ActionManager::plugin_selection_sensitive_actions;
|
|
||||||
vector<RefPtr<Gtk::Action> > ActionManager::track_selection_sensitive_actions;
|
vector<RefPtr<Gtk::Action> > ActionManager::track_selection_sensitive_actions;
|
||||||
vector<RefPtr<Gtk::Action> > ActionManager::point_selection_sensitive_actions;
|
vector<RefPtr<Gtk::Action> > ActionManager::point_selection_sensitive_actions;
|
||||||
vector<RefPtr<Gtk::Action> > ActionManager::time_selection_sensitive_actions;
|
vector<RefPtr<Gtk::Action> > ActionManager::time_selection_sensitive_actions;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ namespace ActionManager {
|
||||||
extern std::vector<Glib::RefPtr<Gtk::Action> > session_sensitive_actions;
|
extern std::vector<Glib::RefPtr<Gtk::Action> > session_sensitive_actions;
|
||||||
extern std::vector<Glib::RefPtr<Gtk::Action> > write_sensitive_actions;
|
extern std::vector<Glib::RefPtr<Gtk::Action> > write_sensitive_actions;
|
||||||
extern std::vector<Glib::RefPtr<Gtk::Action> > region_list_selection_sensitive_actions;
|
extern std::vector<Glib::RefPtr<Gtk::Action> > region_list_selection_sensitive_actions;
|
||||||
extern std::vector<Glib::RefPtr<Gtk::Action> > plugin_selection_sensitive_actions;
|
|
||||||
|
|
||||||
extern std::vector<Glib::RefPtr<Gtk::Action> > track_selection_sensitive_actions;
|
extern std::vector<Glib::RefPtr<Gtk::Action> > track_selection_sensitive_actions;
|
||||||
extern std::vector<Glib::RefPtr<Gtk::Action> > point_selection_sensitive_actions;
|
extern std::vector<Glib::RefPtr<Gtk::Action> > point_selection_sensitive_actions;
|
||||||
|
|
|
||||||
|
|
@ -351,6 +351,8 @@
|
||||||
<ColorAlias name="processor prefader: fill" alias="color 40"/>
|
<ColorAlias name="processor prefader: fill" alias="color 40"/>
|
||||||
<ColorAlias name="processor prefader: fill active" alias="color 80"/>
|
<ColorAlias name="processor prefader: fill active" alias="color 80"/>
|
||||||
<ColorAlias name="processor prefader: led active" alias="color 37"/>
|
<ColorAlias name="processor prefader: led active" alias="color 37"/>
|
||||||
|
<ColorAlias name="processor stub: fill" alias="color 46"/>
|
||||||
|
<ColorAlias name="processor stub: fill active" alias="color 46"/>
|
||||||
<ColorAlias name="punch button: fill" alias="color 20"/>
|
<ColorAlias name="punch button: fill" alias="color 20"/>
|
||||||
<ColorAlias name="punch button: fill active" alias="color 9"/>
|
<ColorAlias name="punch button: fill active" alias="color 9"/>
|
||||||
<ColorAlias name="punch button: led active" alias="color 4"/>
|
<ColorAlias name="punch button: led active" alias="color 4"/>
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,9 @@ using namespace Gtkmm2ext;
|
||||||
ProcessorBox* ProcessorBox::_current_processor_box = 0;
|
ProcessorBox* ProcessorBox::_current_processor_box = 0;
|
||||||
RefPtr<Action> ProcessorBox::paste_action;
|
RefPtr<Action> ProcessorBox::paste_action;
|
||||||
RefPtr<Action> ProcessorBox::cut_action;
|
RefPtr<Action> ProcessorBox::cut_action;
|
||||||
|
RefPtr<Action> ProcessorBox::copy_action;
|
||||||
RefPtr<Action> ProcessorBox::rename_action;
|
RefPtr<Action> ProcessorBox::rename_action;
|
||||||
|
RefPtr<Action> ProcessorBox::delete_action;
|
||||||
RefPtr<Action> ProcessorBox::edit_action;
|
RefPtr<Action> ProcessorBox::edit_action;
|
||||||
RefPtr<Action> ProcessorBox::edit_generic_action;
|
RefPtr<Action> ProcessorBox::edit_generic_action;
|
||||||
|
|
||||||
|
|
@ -103,6 +105,7 @@ ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr<Processo
|
||||||
, _position (PreFader)
|
, _position (PreFader)
|
||||||
, _position_num(0)
|
, _position_num(0)
|
||||||
, _selectable(true)
|
, _selectable(true)
|
||||||
|
, _unknown_processor(false)
|
||||||
, _parent (parent)
|
, _parent (parent)
|
||||||
, _processor (p)
|
, _processor (p)
|
||||||
, _width (w)
|
, _width (w)
|
||||||
|
|
@ -122,6 +125,7 @@ ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr<Processo
|
||||||
}
|
}
|
||||||
if (boost::dynamic_pointer_cast<UnknownProcessor> (_processor)) {
|
if (boost::dynamic_pointer_cast<UnknownProcessor> (_processor)) {
|
||||||
_button.set_elements(ArdourButton::Element(_button.elements() & ~ArdourButton::Indicator));
|
_button.set_elements(ArdourButton::Element(_button.elements() & ~ArdourButton::Indicator));
|
||||||
|
_unknown_processor = true;
|
||||||
}
|
}
|
||||||
if (_processor) {
|
if (_processor) {
|
||||||
|
|
||||||
|
|
@ -231,6 +235,11 @@ ProcessorEntry::set_visual_state (Gtkmm2ext::VisualState s, bool yn)
|
||||||
void
|
void
|
||||||
ProcessorEntry::setup_visuals ()
|
ProcessorEntry::setup_visuals ()
|
||||||
{
|
{
|
||||||
|
if (_unknown_processor) {
|
||||||
|
_button.set_name ("processor stub");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (_position) {
|
switch (_position) {
|
||||||
case PreFader:
|
case PreFader:
|
||||||
_button.set_name ("processor prefader");
|
_button.set_name ("processor prefader");
|
||||||
|
|
@ -321,6 +330,11 @@ ProcessorEntry::setup_tooltip ()
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(boost::dynamic_pointer_cast<UnknownProcessor> (_processor)) {
|
||||||
|
ARDOUR_UI::instance()->set_tip (_button,
|
||||||
|
string_compose (_("<b>%1</b>\nThe Plugin is not available on this system\nand has been replaced by a stub."), name (Wide)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ARDOUR_UI::instance()->set_tip (_button, string_compose ("<b>%1</b>", name (Wide)));
|
ARDOUR_UI::instance()->set_tip (_button, string_compose ("<b>%1</b>", name (Wide)));
|
||||||
}
|
}
|
||||||
|
|
@ -1096,6 +1110,9 @@ ProcessorBox::object_drop(DnDVBox<ProcessorEntry>* source, ProcessorEntry* posit
|
||||||
list<boost::shared_ptr<Processor> > procs;
|
list<boost::shared_ptr<Processor> > procs;
|
||||||
for (list<ProcessorEntry*>::const_iterator i = children.begin(); i != children.end(); ++i) {
|
for (list<ProcessorEntry*>::const_iterator i = children.begin(); i != children.end(); ++i) {
|
||||||
if ((*i)->processor ()) {
|
if ((*i)->processor ()) {
|
||||||
|
if (boost::dynamic_pointer_cast<UnknownProcessor> ((*i)->processor())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
procs.push_back ((*i)->processor ());
|
procs.push_back ((*i)->processor ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1234,11 +1251,14 @@ ProcessorBox::show_processor_menu (int arg)
|
||||||
|
|
||||||
/* Sensitise actions as approprioate */
|
/* Sensitise actions as approprioate */
|
||||||
|
|
||||||
cut_action->set_sensitive (can_cut());
|
|
||||||
paste_action->set_sensitive (!_rr_selection.processors.empty());
|
|
||||||
|
|
||||||
const bool sensitive = !processor_display.selection().empty();
|
const bool sensitive = !processor_display.selection().empty() && ! stub_processor_selected ();
|
||||||
ActionManager::set_sensitive (ActionManager::plugin_selection_sensitive_actions, sensitive);
|
|
||||||
|
paste_action->set_sensitive (!_rr_selection.processors.empty());
|
||||||
|
cut_action->set_sensitive (sensitive && can_cut ());
|
||||||
|
copy_action->set_sensitive (sensitive);
|
||||||
|
delete_action->set_sensitive (sensitive || stub_processor_selected ());
|
||||||
|
|
||||||
edit_action->set_sensitive (one_processor_can_be_edited ());
|
edit_action->set_sensitive (one_processor_can_be_edited ());
|
||||||
edit_generic_action->set_sensitive (one_processor_can_be_edited ());
|
edit_generic_action->set_sensitive (one_processor_can_be_edited ());
|
||||||
|
|
||||||
|
|
@ -1251,7 +1271,10 @@ ProcessorBox::show_processor_menu (int arg)
|
||||||
edit_action->set_sensitive (pi && pi->plugin()->has_editor ());
|
edit_action->set_sensitive (pi && pi->plugin()->has_editor ());
|
||||||
|
|
||||||
/* disallow rename for multiple selections, for plugin inserts and for the fader */
|
/* disallow rename for multiple selections, for plugin inserts and for the fader */
|
||||||
rename_action->set_sensitive (single_selection && !pi && !boost::dynamic_pointer_cast<Amp> (single_selection->processor ()));
|
rename_action->set_sensitive (single_selection
|
||||||
|
&& !pi
|
||||||
|
&& !boost::dynamic_pointer_cast<Amp> (single_selection->processor ())
|
||||||
|
&& !boost::dynamic_pointer_cast<UnknownProcessor> (single_selection->processor ()));
|
||||||
|
|
||||||
processor_menu->popup (1, arg);
|
processor_menu->popup (1, arg);
|
||||||
|
|
||||||
|
|
@ -1781,9 +1804,10 @@ ProcessorBox::add_processor_to_display (boost::weak_ptr<Processor> p)
|
||||||
|
|
||||||
boost::shared_ptr<Send> send = boost::dynamic_pointer_cast<Send> (processor);
|
boost::shared_ptr<Send> send = boost::dynamic_pointer_cast<Send> (processor);
|
||||||
boost::shared_ptr<PortInsert> ext = boost::dynamic_pointer_cast<PortInsert> (processor);
|
boost::shared_ptr<PortInsert> ext = boost::dynamic_pointer_cast<PortInsert> (processor);
|
||||||
|
boost::shared_ptr<UnknownProcessor> stub = boost::dynamic_pointer_cast<UnknownProcessor> (processor);
|
||||||
|
|
||||||
//faders and meters are not deletable, copy/paste-able, so they shouldn't be selectable
|
//faders and meters are not deletable, copy/paste-able, so they shouldn't be selectable
|
||||||
if (!send && !plugin_insert && !ext)
|
if (!send && !plugin_insert && !ext && !stub)
|
||||||
e->set_selectable(false);
|
e->set_selectable(false);
|
||||||
|
|
||||||
bool mark_send_visible = false;
|
bool mark_send_visible = false;
|
||||||
|
|
@ -1908,22 +1932,38 @@ ProcessorBox::rename_processors ()
|
||||||
bool
|
bool
|
||||||
ProcessorBox::can_cut () const
|
ProcessorBox::can_cut () const
|
||||||
{
|
{
|
||||||
vector<boost::shared_ptr<Processor> > sel;
|
vector<boost::shared_ptr<Processor> > sel;
|
||||||
|
|
||||||
get_selected_processors (sel);
|
get_selected_processors (sel);
|
||||||
|
|
||||||
/* cut_processors () does not cut inserts */
|
/* cut_processors () does not cut inserts */
|
||||||
|
|
||||||
for (vector<boost::shared_ptr<Processor> >::const_iterator i = sel.begin (); i != sel.end (); ++i) {
|
for (vector<boost::shared_ptr<Processor> >::const_iterator i = sel.begin (); i != sel.end (); ++i) {
|
||||||
|
|
||||||
if (boost::dynamic_pointer_cast<PluginInsert>((*i)) != 0 ||
|
if (boost::dynamic_pointer_cast<PluginInsert>((*i)) != 0 ||
|
||||||
(boost::dynamic_pointer_cast<Send>((*i)) != 0) ||
|
(boost::dynamic_pointer_cast<Send>((*i)) != 0) ||
|
||||||
(boost::dynamic_pointer_cast<Return>((*i)) != 0)) {
|
(boost::dynamic_pointer_cast<Return>((*i)) != 0)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ProcessorBox::stub_processor_selected () const
|
||||||
|
{
|
||||||
|
vector<boost::shared_ptr<Processor> > sel;
|
||||||
|
|
||||||
|
get_selected_processors (sel);
|
||||||
|
|
||||||
|
for (vector<boost::shared_ptr<Processor> >::const_iterator i = sel.begin (); i != sel.end (); ++i) {
|
||||||
|
if (boost::dynamic_pointer_cast<UnknownProcessor>((*i)) != 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -2520,14 +2560,10 @@ ProcessorBox::register_actions ()
|
||||||
/* standard editing stuff */
|
/* standard editing stuff */
|
||||||
cut_action = ActionManager::register_action (popup_act_grp, X_("cut"), _("Cut"),
|
cut_action = ActionManager::register_action (popup_act_grp, X_("cut"), _("Cut"),
|
||||||
sigc::ptr_fun (ProcessorBox::rb_cut));
|
sigc::ptr_fun (ProcessorBox::rb_cut));
|
||||||
ActionManager::plugin_selection_sensitive_actions.push_back(cut_action);
|
copy_action = ActionManager::register_action (popup_act_grp, X_("copy"), _("Copy"),
|
||||||
act = ActionManager::register_action (popup_act_grp, X_("copy"), _("Copy"),
|
|
||||||
sigc::ptr_fun (ProcessorBox::rb_copy));
|
sigc::ptr_fun (ProcessorBox::rb_copy));
|
||||||
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
delete_action = ActionManager::register_action (popup_act_grp, X_("delete"), _("Delete"),
|
||||||
|
|
||||||
act = ActionManager::register_action (popup_act_grp, X_("delete"), _("Delete"),
|
|
||||||
sigc::ptr_fun (ProcessorBox::rb_delete));
|
sigc::ptr_fun (ProcessorBox::rb_delete));
|
||||||
ActionManager::plugin_selection_sensitive_actions.push_back(act); // ??
|
|
||||||
|
|
||||||
paste_action = ActionManager::register_action (popup_act_grp, X_("paste"), _("Paste"),
|
paste_action = ActionManager::register_action (popup_act_grp, X_("paste"), _("Paste"),
|
||||||
sigc::ptr_fun (ProcessorBox::rb_paste));
|
sigc::ptr_fun (ProcessorBox::rb_paste));
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
void set_position (Position, uint32_t);
|
void set_position (Position, uint32_t);
|
||||||
|
bool unknown_processor () const { return _unknown_processor; } ;
|
||||||
boost::shared_ptr<ARDOUR::Processor> processor () const;
|
boost::shared_ptr<ARDOUR::Processor> processor () const;
|
||||||
void set_enum_width (Width);
|
void set_enum_width (Width);
|
||||||
|
|
||||||
|
|
@ -150,6 +151,7 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _selectable;
|
bool _selectable;
|
||||||
|
bool _unknown_processor;
|
||||||
void led_clicked();
|
void led_clicked();
|
||||||
void processor_active_changed ();
|
void processor_active_changed ();
|
||||||
void processor_property_changed (const PBD::PropertyChange&);
|
void processor_property_changed (const PBD::PropertyChange&);
|
||||||
|
|
@ -394,10 +396,13 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
|
||||||
void get_selected_processors (ProcSelection&) const;
|
void get_selected_processors (ProcSelection&) const;
|
||||||
|
|
||||||
bool can_cut() const;
|
bool can_cut() const;
|
||||||
|
bool stub_processor_selected() const;
|
||||||
|
|
||||||
static Glib::RefPtr<Gtk::Action> cut_action;
|
static Glib::RefPtr<Gtk::Action> cut_action;
|
||||||
|
static Glib::RefPtr<Gtk::Action> copy_action;
|
||||||
static Glib::RefPtr<Gtk::Action> paste_action;
|
static Glib::RefPtr<Gtk::Action> paste_action;
|
||||||
static Glib::RefPtr<Gtk::Action> rename_action;
|
static Glib::RefPtr<Gtk::Action> rename_action;
|
||||||
|
static Glib::RefPtr<Gtk::Action> delete_action;
|
||||||
static Glib::RefPtr<Gtk::Action> edit_action;
|
static Glib::RefPtr<Gtk::Action> edit_action;
|
||||||
static Glib::RefPtr<Gtk::Action> edit_generic_action;
|
static Glib::RefPtr<Gtk::Action> edit_generic_action;
|
||||||
void paste_processor_state (const XMLNodeList&, boost::shared_ptr<ARDOUR::Processor>);
|
void paste_processor_state (const XMLNodeList&, boost::shared_ptr<ARDOUR::Processor>);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue