diff options
author | Taybin Rutkin <taybin@taybin.com> | 2006-07-31 22:05:28 +0000 |
---|---|---|
committer | Taybin Rutkin <taybin@taybin.com> | 2006-07-31 22:05:28 +0000 |
commit | 2e2e20563ce4bec22a8f5ca158bcc077d3f3e1b2 (patch) | |
tree | decbc8fdf69c9c490cb84debe5406b099cc89658 /gtk2_ardour | |
parent | 4be1ccc43fbc70317f1373370518f2dc0515c516 (diff) |
Start of AudioUnit work. COREAUDIO=y is a little destable for now.
git-svn-id: svn://localhost/ardour2/trunk@724 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/plugin_selector.cc | 93 | ||||
-rw-r--r-- | gtk2_ardour/plugin_selector.h | 26 | ||||
-rw-r--r-- | gtk2_ardour/sfdb_ui.cc | 2 |
3 files changed, 106 insertions, 15 deletions
diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc index a762a0b186..db63c285f1 100644 --- a/gtk2_ardour/plugin_selector.cc +++ b/gtk2_ardour/plugin_selector.cc @@ -196,6 +196,10 @@ PluginSelector::input_refiller () #ifdef VST_SUPPORT vmodel->clear(); #endif + +#ifdef HAVE_COREAUDIO + aumodel->clear(); +#endif // Insert into GTK list for (row = 0, i=plugs.begin(); i != plugs.end(); ++i, ++row) { snprintf (ibuf, sizeof(ibuf)-1, "%d", (*i)->n_inputs); @@ -242,7 +246,40 @@ PluginSelector::vst_refiller () } vmodel->set_sort_column (0, Gtk::SORT_ASCENDING); } -#endif +#endif //VST_SUPPORT + +#ifdef HAVE_COREAUDIO + +void +PluginSelector::_au_refiller (void *arg) +{ + ((PluginSelector *) arg)->au_refiller (); +} + +void +PluginSelector::au_refiller () +{ + guint row; +// list<PluginInfo *> &plugs = manager->au_plugin_info (); + list<PluginInfo *> &plugs; + list<PluginInfo *>::iterator i; + char ibuf[16], obuf[16]; + + // Insert into GTK list + for (row = 0, i=plugs.begin(); i != plugs.end(); ++i, ++row) { + + snprintf (ibuf, sizeof(ibuf)-1, "%d", (*i)->n_inputs); + snprintf (obuf, sizeof(obuf)-1, "%d", (*i)->n_outputs); + + Gtk::TreeModel::Row newrow = *(amodel->append()); + newrow[acols.name] = (*i)->name.c_str(); + newrow[acols.ins] = ibuf; + newrow[acols.outs] = obuf; + newrow[acols.plugin] = *i; + } + amodel->set_sort_column (0, Gtk::SORT_ASCENDING); +} +#endif //HAVE_COREAUDIO void PluginSelector::use_plugin (PluginInfo* pi) @@ -263,29 +300,44 @@ PluginSelector::use_plugin (PluginInfo* pi) void PluginSelector::btn_add_clicked() { - bool vst = notebook.get_current_page(); // 0 = LADSPA, 1 = VST + // 0 = LADSPA, 1 = VST, 2 = AU + unsigned int page = notebook.get_current_page(); std::string name; ARDOUR::PluginInfo *pi; Gtk::TreeModel::Row newrow = *(amodel->append()); - if (vst) { + Gtk::TreeModel::Row row; + + switch (page) { + case 0: + row = *(ladspa_display.get_selection()->get_selected()); + name = row[lcols.name]; + pi = row[lcols.plugin]; + added_plugins.push_back (row[lcols.plugin]); + break; + case 1: #ifdef VST_SUPPORT - Gtk::TreeModel::Row row = *(vst_display.get_selection()->get_selected()); - name = row[vcols.name]; - pi = row[vcols.plugin]; - added_plugins.push_back (row[vcols.plugin]); + row = *(vst_display.get_selection()->get_selected()); + name = row[vcols.name]; + pi = row[vcols.plugin]; + added_plugins.push_back (row[vcols.plugin]); #endif - } else { - Gtk::TreeModel::Row row = *(ladspa_display.get_selection()->get_selected()); - name = row[lcols.name]; - pi = row[lcols.plugin]; - added_plugins.push_back (row[lcols.plugin]); + break; + case 2: +#ifdef HAVE_COREAUDIO + row = *(au_display.get_selection()->get_selected()); + name = row[aucols.name]; + pi = row[aucols.plugin]; + added_plugins.push_back (row[aucols.plugin]); +#endif + break; } + newrow[acols.text] = name; newrow[acols.plugin] = pi; if (!amodel->children().empty()) { - set_response_sensitive (RESPONSE_APPLY, true); + set_response_sensitive (RESPONSE_APPLY, true); } } @@ -313,6 +365,9 @@ PluginSelector::btn_update_clicked() #ifdef VST_SUPPORT vst_refiller (); #endif +#ifdef HAVE_COREAUDIO +// au_refiller (); +#endif } #ifdef VST_SUPPORT @@ -327,6 +382,18 @@ PluginSelector::vst_display_selection_changed() } #endif +#ifdef HAVE_COREAUDIO +void +PluginSelector::vst_display_selection_changed() +{ + if (au_display.get_selection()->count_selected_rows() != 0) { + btn_add->set_sensitive (true); + } else { + btn_add->set_sensitive (false); + } +} +#endif + void PluginSelector::ladspa_display_selection_changed() { diff --git a/gtk2_ardour/plugin_selector.h b/gtk2_ardour/plugin_selector.h index 220de74871..25cba998df 100644 --- a/gtk2_ardour/plugin_selector.h +++ b/gtk2_ardour/plugin_selector.h @@ -104,7 +104,30 @@ class PluginSelector : public ArdourDialog static void _vst_refiller (void *); void vst_refiller (); void vst_display_selection_changed(); -#endif +#endif // VST_SUPPORT + +#ifdef HAVE_COREAUDIO + // page 3 + struct AUColumns : public Gtk::TreeModel::ColumnRecord { + AUColumns () { + add (name); + add (ins); + add (outs); + add (plugin); + } + Gtk::TreeModelColumn<std::string> name; + Gtk::TreeModelColumn<std::string> ins; + Gtk::TreeModelColumn<std::string> outs; + Gtk::TreeModelColumn<ARDOUR::PluginInfo *> plugin; + }; + AUColumns aucols; + Glib::RefPtr<Gtk::ListStore> aumodel; + Glib::RefPtr<Gtk::TreeSelection> auselection; + Gtk::TreeView au_display; + static void _au_refiller (void *); + void au_refiller (); + void au_display_selection_changed(); +#endif //HAVE_COREAUDIO ARDOUR::PluginInfo* i_selected_plug; @@ -130,3 +153,4 @@ class PluginSelector : public ArdourDialog }; #endif // __ardour_plugin_selector_h__ + diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index 4948525b15..d9ded04d2b 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -98,7 +98,7 @@ SoundFileBox::SoundFileBox () remove_field_btn.signal_clicked().connect (mem_fun (*this, &SoundFileBox::remove_field_clicked)); - Gtk::CellRendererText* cell(static_cast<Gtk::CellRendererText*>(field_view.get_column_cell_renderer(1))); + Gtk::CellRendererText* cell(dynamic_cast<Gtk::CellRendererText*>(field_view.get_column_cell_renderer(1))); cell->signal_edited().connect (mem_fun (*this, &SoundFileBox::field_edited)); field_view.get_selection()->signal_changed().connect (mem_fun (*this, &SoundFileBox::field_selected)); |