mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Merged up to trunk R732
git-svn-id: svn://localhost/ardour2/branches/midi@735 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
79fc27de2e
commit
0565c75ce8
28 changed files with 450 additions and 99 deletions
|
|
@ -451,7 +451,7 @@ libraries['usb'] = conf.Finish ()
|
||||||
libraries['flac'] = LibraryInfo ()
|
libraries['flac'] = LibraryInfo ()
|
||||||
|
|
||||||
conf = Configure (libraries['flac'])
|
conf = Configure (libraries['flac'])
|
||||||
conf.CheckLib ('FLAC', 'FLAC__stream_decoder_new')
|
conf.CheckLib ('FLAC', 'FLAC__stream_decoder_new', language='CXX')
|
||||||
libraries['flac'] = conf.Finish ()
|
libraries['flac'] = conf.Finish ()
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,9 @@ if gtkardour['FFT_ANALYSIS']:
|
||||||
gtkardour.Merge ([libraries['fftw3f']])
|
gtkardour.Merge ([libraries['fftw3f']])
|
||||||
gtkardour.Append(CCFLAGS='-DFFT_ANALYSIS')
|
gtkardour.Append(CCFLAGS='-DFFT_ANALYSIS')
|
||||||
|
|
||||||
|
if gtkardour['COREAUDIO']:
|
||||||
|
gtkardour.Append(CCFLAGS='-DHAVE_COREAUDIO')
|
||||||
|
|
||||||
skipped_files=Split("""
|
skipped_files=Split("""
|
||||||
connection_editor.cc
|
connection_editor.cc
|
||||||
""")
|
""")
|
||||||
|
|
|
||||||
|
|
@ -241,7 +241,7 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
|
||||||
if (!pl || !rui)
|
if (!pl || !rui)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
FFTResult *res = fft_graph.prepareResult(rui->color(), rui->route().name());
|
FFTResult *res = fft_graph.prepareResult(rui->color(), rui->route()->name());
|
||||||
|
|
||||||
// if timeSelection
|
// if timeSelection
|
||||||
if (source_selection_ranges_rb.get_active()) {
|
if (source_selection_ranges_rb.get_active()) {
|
||||||
|
|
@ -322,7 +322,7 @@ AnalysisWindow::analyze_data (Gtk::Button *button)
|
||||||
|
|
||||||
|
|
||||||
Gtk::TreeModel::Row newrow = *(tlmodel)->append();
|
Gtk::TreeModel::Row newrow = *(tlmodel)->append();
|
||||||
newrow[tlcols.trackname] = rui->route().name();
|
newrow[tlcols.trackname] = rui->route()->name();
|
||||||
newrow[tlcols.visible] = true;
|
newrow[tlcols.visible] = true;
|
||||||
newrow[tlcols.color] = rui->color();
|
newrow[tlcols.color] = rui->color();
|
||||||
newrow[tlcols.graph] = res;
|
newrow[tlcols.graph] = res;
|
||||||
|
|
|
||||||
|
|
@ -187,8 +187,8 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
|
||||||
gettimeofday (&last_shuttle_request, 0);
|
gettimeofday (&last_shuttle_request, 0);
|
||||||
|
|
||||||
ARDOUR::AudioDiskstream::DeleteSources.connect (mem_fun(*this, &ARDOUR_UI::delete_sources_in_the_right_thread));
|
ARDOUR::AudioDiskstream::DeleteSources.connect (mem_fun(*this, &ARDOUR_UI::delete_sources_in_the_right_thread));
|
||||||
ARDOUR::AudioDiskstream::DiskOverrun.connect (mem_fun(*this, &ARDOUR_UI::disk_overrun_handler));
|
ARDOUR::Diskstream::DiskOverrun.connect (mem_fun(*this, &ARDOUR_UI::disk_overrun_handler));
|
||||||
ARDOUR::AudioDiskstream::DiskUnderrun.connect (mem_fun(*this, &ARDOUR_UI::disk_underrun_handler));
|
ARDOUR::Diskstream::DiskUnderrun.connect (mem_fun(*this, &ARDOUR_UI::disk_underrun_handler));
|
||||||
|
|
||||||
/* handle pending state with a dialog */
|
/* handle pending state with a dialog */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,12 +57,32 @@ static const int32_t sync_mark_width = 9;
|
||||||
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, AudioRegion& r, double spu,
|
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, AudioRegion& r, double spu,
|
||||||
Gdk::Color& basic_color)
|
Gdk::Color& basic_color)
|
||||||
: RegionView (parent, tv, r, spu, basic_color)
|
: RegionView (parent, tv, r, spu, basic_color)
|
||||||
|
, sync_mark(0)
|
||||||
|
, zero_line(0)
|
||||||
|
, fade_in_shape(0)
|
||||||
|
, fade_out_shape(0)
|
||||||
|
, fade_in_handle(0)
|
||||||
|
, fade_out_handle(0)
|
||||||
|
, gain_line(0)
|
||||||
|
, _amplitude_above_axis(1.0)
|
||||||
|
, _flags(0)
|
||||||
|
, fade_color(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, AudioRegion& r, double spu,
|
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, AudioRegion& r, double spu,
|
||||||
Gdk::Color& basic_color, TimeAxisViewItem::Visibility visibility)
|
Gdk::Color& basic_color, TimeAxisViewItem::Visibility visibility)
|
||||||
: RegionView (parent, tv, r, spu, basic_color, visibility)
|
: RegionView (parent, tv, r, spu, basic_color, visibility)
|
||||||
|
, sync_mark(0)
|
||||||
|
, zero_line(0)
|
||||||
|
, fade_in_shape(0)
|
||||||
|
, fade_out_shape(0)
|
||||||
|
, fade_in_handle(0)
|
||||||
|
, fade_out_handle(0)
|
||||||
|
, gain_line(0)
|
||||||
|
, _amplitude_above_axis(1.0)
|
||||||
|
, _flags(0)
|
||||||
|
, fade_color(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1115,7 +1115,7 @@ class Editor : public PublicEditor
|
||||||
bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
|
bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
|
||||||
bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
|
bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
|
||||||
bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
|
bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
|
||||||
bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
|
bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
|
||||||
bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
|
bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*);
|
||||||
bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
|
bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*);
|
||||||
bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
|
bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*);
|
||||||
|
|
|
||||||
|
|
@ -735,7 +735,7 @@ Editor::canvas_region_view_name_highlight_event (GdkEvent* event, ArdourCanvas::
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Editor::canvas_region_view_name_event (GdkEvent *event, ArdourCanvas::Item* item, AudioRegionView* rv)
|
Editor::canvas_region_view_name_event (GdkEvent *event, ArdourCanvas::Item* item, RegionView* rv)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2000-2002 Paul Davis
|
Copyright (C) 2000-2006 Paul Davis
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -14,8 +14,6 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
$Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2000 Paul Davis
|
Copyright (C) 2000-2006 Paul Davis
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -14,8 +14,6 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
$Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __ardour_mixer_strip__
|
#ifndef __ardour_mixer_strip__
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,6 @@
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
$Id$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,8 @@ PluginSelector::PluginSelector (PluginManager *mgr)
|
||||||
session = 0;
|
session = 0;
|
||||||
o_selected_plug = -1;
|
o_selected_plug = -1;
|
||||||
i_selected_plug = 0;
|
i_selected_plug = 0;
|
||||||
|
|
||||||
|
current_selection = ARDOUR::PluginInfo::LADSPA;
|
||||||
|
|
||||||
lmodel = Gtk::ListStore::create(lcols);
|
lmodel = Gtk::ListStore::create(lcols);
|
||||||
ladspa_display.set_model (lmodel);
|
ladspa_display.set_model (lmodel);
|
||||||
|
|
@ -91,6 +93,25 @@ PluginSelector::PluginSelector (PluginManager *mgr)
|
||||||
column->set_sort_column(i);
|
column->set_sort_column(i);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_COREAUDIO
|
||||||
|
aumodel = ListStore::create(aucols);
|
||||||
|
au_display.set_model (aumodel);
|
||||||
|
au_display.append_column (_("Available plugins"), aucols.name);
|
||||||
|
au_display.append_column (_("# Inputs"), aucols.ins);
|
||||||
|
au_display.append_column (_("# Outputs"), aucols.outs);
|
||||||
|
au_display.set_headers_visible (true);
|
||||||
|
au_display.set_reorderable (false);
|
||||||
|
auscroller.set_border_width(10);
|
||||||
|
auscroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
|
||||||
|
auscroller.add(au_display);
|
||||||
|
|
||||||
|
for (int i = 0; i <=2; i++) {
|
||||||
|
Gtk::TreeView::Column* column = au_display.get_column(i);
|
||||||
|
column->set_sort_column(i);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ascroller.set_border_width(10);
|
ascroller.set_border_width(10);
|
||||||
ascroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
|
ascroller.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
|
||||||
ascroller.add(added_list);
|
ascroller.add(added_list);
|
||||||
|
|
@ -124,35 +145,51 @@ PluginSelector::PluginSelector (PluginManager *mgr)
|
||||||
|
|
||||||
using namespace Gtk::Notebook_Helpers;
|
using namespace Gtk::Notebook_Helpers;
|
||||||
notebook.pages().push_back (TabElem (lscroller, _("LADSPA")));
|
notebook.pages().push_back (TabElem (lscroller, _("LADSPA")));
|
||||||
|
|
||||||
#ifdef VST_SUPPORT
|
#ifdef VST_SUPPORT
|
||||||
if (Config->get_use_vst()) {
|
if (Config->get_use_vst()) {
|
||||||
notebook.pages().push_back (TabElem (vscroller, _("VST")));
|
notebook.pages().push_back (TabElem (vscroller, _("VST")));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_COREAUDIO
|
||||||
|
notebook.pages().push_back (TabElem (auscroller, _("AudioUnit")));
|
||||||
|
#endif
|
||||||
|
|
||||||
table->set_name("PluginSelectorTable");
|
table->set_name("PluginSelectorTable");
|
||||||
ladspa_display.set_name("PluginSelectorDisplay");
|
ladspa_display.set_name("PluginSelectorDisplay");
|
||||||
//ladspa_display.set_name("PluginSelectorList");
|
//ladspa_display.set_name("PluginSelectorList");
|
||||||
added_list.set_name("PluginSelectorList");
|
added_list.set_name("PluginSelectorList");
|
||||||
|
|
||||||
ladspa_display.signal_button_press_event().connect_notify (mem_fun(*this, &PluginSelector::row_clicked));
|
ladspa_display.signal_button_press_event().connect_notify (mem_fun(*this, &PluginSelector::row_clicked));
|
||||||
|
ladspa_display.get_selection()->signal_changed().connect (mem_fun(*this, &PluginSelector::ladspa_display_selection_changed));
|
||||||
|
|
||||||
#ifdef VST_SUPPORT
|
#ifdef VST_SUPPORT
|
||||||
if (Config->get_use_vst()) {
|
if (Config->get_use_vst()) {
|
||||||
vst_display.signal_button_press_event().connect_notify (mem_fun(*this, &PluginSelector::row_clicked));
|
vst_display.signal_button_press_event().connect_notify (mem_fun(*this, &PluginSelector::row_clicked));
|
||||||
vst_display.get_selection()->signal_changed().connect (mem_fun(*this, &PluginSelector::vst_display_selection_changed));
|
vst_display.get_selection()->signal_changed().connect (mem_fun(*this, &PluginSelector::vst_display_selection_changed));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_COREAUDIO
|
||||||
|
au_display.signal_button_press_event().connect_notify (mem_fun(*this, &PluginSelector::row_clicked));
|
||||||
|
au_display.get_selection()->signal_changed().connect (mem_fun(*this, &PluginSelector::au_display_selection_changed));
|
||||||
|
#endif
|
||||||
|
|
||||||
btn_update->signal_clicked().connect (mem_fun(*this, &PluginSelector::btn_update_clicked));
|
btn_update->signal_clicked().connect (mem_fun(*this, &PluginSelector::btn_update_clicked));
|
||||||
btn_add->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_add_clicked));
|
btn_add->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_add_clicked));
|
||||||
btn_remove->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_remove_clicked));
|
btn_remove->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_remove_clicked));
|
||||||
ladspa_display.get_selection()->signal_changed().connect (mem_fun(*this, &PluginSelector::ladspa_display_selection_changed));
|
|
||||||
added_list.get_selection()->signal_changed().connect (mem_fun(*this, &PluginSelector::added_list_selection_changed));
|
added_list.get_selection()->signal_changed().connect (mem_fun(*this, &PluginSelector::added_list_selection_changed));
|
||||||
|
|
||||||
input_refiller ();
|
input_refiller ();
|
||||||
|
|
||||||
#ifdef VST_SUPPORT
|
#ifdef VST_SUPPORT
|
||||||
vst_refiller ();
|
vst_refiller ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_COREAUDIO
|
||||||
|
au_refiller ();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -193,9 +230,7 @@ PluginSelector::input_refiller ()
|
||||||
list<PluginInfo *>::iterator i;
|
list<PluginInfo *>::iterator i;
|
||||||
char ibuf[16], obuf[16];
|
char ibuf[16], obuf[16];
|
||||||
lmodel->clear();
|
lmodel->clear();
|
||||||
#ifdef VST_SUPPORT
|
|
||||||
vmodel->clear();
|
|
||||||
#endif
|
|
||||||
// Insert into GTK list
|
// Insert into GTK list
|
||||||
for (row = 0, i=plugs.begin(); i != plugs.end(); ++i, ++row) {
|
for (row = 0, i=plugs.begin(); i != plugs.end(); ++i, ++row) {
|
||||||
snprintf (ibuf, sizeof(ibuf)-1, "%d", (*i)->n_inputs);
|
snprintf (ibuf, sizeof(ibuf)-1, "%d", (*i)->n_inputs);
|
||||||
|
|
@ -227,6 +262,7 @@ PluginSelector::vst_refiller ()
|
||||||
list<PluginInfo *> &plugs = manager->vst_plugin_info ();
|
list<PluginInfo *> &plugs = manager->vst_plugin_info ();
|
||||||
list<PluginInfo *>::iterator i;
|
list<PluginInfo *>::iterator i;
|
||||||
char ibuf[16], obuf[16];
|
char ibuf[16], obuf[16];
|
||||||
|
vmodel->clear();
|
||||||
|
|
||||||
// Insert into GTK list
|
// Insert into GTK list
|
||||||
for (row = 0, i=plugs.begin(); i != plugs.end(); ++i, ++row) {
|
for (row = 0, i=plugs.begin(); i != plugs.end(); ++i, ++row) {
|
||||||
|
|
@ -242,7 +278,66 @@ PluginSelector::vst_refiller ()
|
||||||
}
|
}
|
||||||
vmodel->set_sort_column (0, Gtk::SORT_ASCENDING);
|
vmodel->set_sort_column (0, Gtk::SORT_ASCENDING);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
void
|
||||||
|
PluginSelector::vst_display_selection_changed()
|
||||||
|
{
|
||||||
|
if (vst_display.get_selection()->count_selected_rows() != 0) {
|
||||||
|
btn_add->set_sensitive (true);
|
||||||
|
} else {
|
||||||
|
btn_add->set_sensitive (false);
|
||||||
|
}
|
||||||
|
|
||||||
|
current_selection = ARDOUR::PluginInfo::VST;
|
||||||
|
}
|
||||||
|
|
||||||
|
#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 *>::iterator i;
|
||||||
|
char ibuf[16], obuf[16];
|
||||||
|
aumodel->clear();
|
||||||
|
|
||||||
|
// 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 = *(aumodel->append());
|
||||||
|
newrow[aucols.name] = (*i)->name.c_str();
|
||||||
|
newrow[aucols.ins] = ibuf;
|
||||||
|
newrow[aucols.outs] = obuf;
|
||||||
|
newrow[aucols.plugin] = *i;
|
||||||
|
}
|
||||||
|
aumodel->set_sort_column (0, Gtk::SORT_ASCENDING);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PluginSelector::au_display_selection_changed()
|
||||||
|
{
|
||||||
|
if (au_display.get_selection()->count_selected_rows() != 0) {
|
||||||
|
btn_add->set_sensitive (true);
|
||||||
|
} else {
|
||||||
|
btn_add->set_sensitive (false);
|
||||||
|
}
|
||||||
|
|
||||||
|
current_selection = ARDOUR::PluginInfo::AudioUnit;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //HAVE_COREAUDIO
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginSelector::use_plugin (PluginInfo* pi)
|
PluginSelector::use_plugin (PluginInfo* pi)
|
||||||
|
|
@ -263,29 +358,45 @@ PluginSelector::use_plugin (PluginInfo* pi)
|
||||||
void
|
void
|
||||||
PluginSelector::btn_add_clicked()
|
PluginSelector::btn_add_clicked()
|
||||||
{
|
{
|
||||||
bool vst = notebook.get_current_page(); // 0 = LADSPA, 1 = VST
|
|
||||||
std::string name;
|
std::string name;
|
||||||
ARDOUR::PluginInfo *pi;
|
ARDOUR::PluginInfo *pi;
|
||||||
Gtk::TreeModel::Row newrow = *(amodel->append());
|
Gtk::TreeModel::Row newrow = *(amodel->append());
|
||||||
|
|
||||||
if (vst) {
|
Gtk::TreeModel::Row row;
|
||||||
|
|
||||||
|
switch (current_selection) {
|
||||||
|
case ARDOUR::PluginInfo::LADSPA:
|
||||||
|
row = *(ladspa_display.get_selection()->get_selected());
|
||||||
|
name = row[lcols.name];
|
||||||
|
pi = row[lcols.plugin];
|
||||||
|
added_plugins.push_back (row[lcols.plugin]);
|
||||||
|
break;
|
||||||
|
case ARDOUR::PluginInfo::VST:
|
||||||
#ifdef VST_SUPPORT
|
#ifdef VST_SUPPORT
|
||||||
Gtk::TreeModel::Row row = *(vst_display.get_selection()->get_selected());
|
row = *(vst_display.get_selection()->get_selected());
|
||||||
name = row[vcols.name];
|
name = row[vcols.name];
|
||||||
pi = row[vcols.plugin];
|
pi = row[vcols.plugin];
|
||||||
added_plugins.push_back (row[vcols.plugin]);
|
added_plugins.push_back (row[vcols.plugin]);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
break;
|
||||||
Gtk::TreeModel::Row row = *(ladspa_display.get_selection()->get_selected());
|
case ARDOUR::PluginInfo::AudioUnit:
|
||||||
name = row[lcols.name];
|
#ifdef HAVE_COREAUDIO
|
||||||
pi = row[lcols.plugin];
|
row = *(au_display.get_selection()->get_selected());
|
||||||
added_plugins.push_back (row[lcols.plugin]);
|
name = row[aucols.name];
|
||||||
|
pi = row[aucols.plugin];
|
||||||
|
added_plugins.push_back (row[aucols.plugin]);
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
error << "Programming error. Unknown plugin selected." << endmsg;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
newrow[acols.text] = name;
|
newrow[acols.text] = name;
|
||||||
newrow[acols.plugin] = pi;
|
newrow[acols.plugin] = pi;
|
||||||
|
|
||||||
if (!amodel->children().empty()) {
|
if (!amodel->children().empty()) {
|
||||||
set_response_sensitive (RESPONSE_APPLY, true);
|
set_response_sensitive (RESPONSE_APPLY, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -313,28 +424,21 @@ PluginSelector::btn_update_clicked()
|
||||||
#ifdef VST_SUPPORT
|
#ifdef VST_SUPPORT
|
||||||
vst_refiller ();
|
vst_refiller ();
|
||||||
#endif
|
#endif
|
||||||
}
|
#ifdef HAVE_COREAUDIO
|
||||||
|
au_refiller ();
|
||||||
#ifdef VST_SUPPORT
|
|
||||||
void
|
|
||||||
PluginSelector::vst_display_selection_changed()
|
|
||||||
{
|
|
||||||
if (vst_display.get_selection()->count_selected_rows() != 0) {
|
|
||||||
btn_add->set_sensitive (true);
|
|
||||||
} else {
|
|
||||||
btn_add->set_sensitive (false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginSelector::ladspa_display_selection_changed()
|
PluginSelector::ladspa_display_selection_changed()
|
||||||
{
|
{
|
||||||
if (ladspa_display.get_selection()->count_selected_rows() != 0) {
|
if (ladspa_display.get_selection()->count_selected_rows() != 0) {
|
||||||
btn_add->set_sensitive (true);
|
btn_add->set_sensitive (true);
|
||||||
} else {
|
} else {
|
||||||
btn_add->set_sensitive (false);
|
btn_add->set_sensitive (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
current_selection = ARDOUR::PluginInfo::LADSPA;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -378,4 +482,3 @@ PluginSelector::cleanup ()
|
||||||
added_plugins.clear();
|
added_plugins.clear();
|
||||||
amodel->clear();
|
amodel->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,11 @@
|
||||||
#include <gtkmm/treeview.h>
|
#include <gtkmm/treeview.h>
|
||||||
#include <gtkmm2ext/selector.h>
|
#include <gtkmm2ext/selector.h>
|
||||||
|
|
||||||
|
#include <ardour/plugin.h>
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR {
|
||||||
class Session;
|
class Session;
|
||||||
class PluginManager;
|
class PluginManager;
|
||||||
class Plugin;
|
|
||||||
class PluginInfo;
|
class PluginInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,9 +46,12 @@ class PluginSelector : public ArdourDialog
|
||||||
private:
|
private:
|
||||||
ARDOUR::Session* session;
|
ARDOUR::Session* session;
|
||||||
Gtk::Notebook notebook;
|
Gtk::Notebook notebook;
|
||||||
Gtk::ScrolledWindow lscroller;
|
Gtk::ScrolledWindow lscroller; // ladspa
|
||||||
Gtk::ScrolledWindow vscroller;
|
Gtk::ScrolledWindow vscroller; // vst
|
||||||
Gtk::ScrolledWindow ascroller;
|
Gtk::ScrolledWindow auscroller; // AudioUnit
|
||||||
|
Gtk::ScrolledWindow ascroller; // Added plugins
|
||||||
|
|
||||||
|
ARDOUR::PluginInfo::Type current_selection;
|
||||||
|
|
||||||
// page 1
|
// page 1
|
||||||
struct LadspaColumns : public Gtk::TreeModel::ColumnRecord {
|
struct LadspaColumns : public Gtk::TreeModel::ColumnRecord {
|
||||||
|
|
@ -105,7 +109,30 @@ class PluginSelector : public ArdourDialog
|
||||||
static void _vst_refiller (void *);
|
static void _vst_refiller (void *);
|
||||||
void vst_refiller ();
|
void vst_refiller ();
|
||||||
void vst_display_selection_changed();
|
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;
|
ARDOUR::PluginInfo* i_selected_plug;
|
||||||
|
|
||||||
|
|
@ -131,3 +158,4 @@ class PluginSelector : public ArdourDialog
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __ardour_plugin_selector_h__
|
#endif // __ardour_plugin_selector_h__
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ class ControlPoint;
|
||||||
class SelectionRect;
|
class SelectionRect;
|
||||||
class CrossfadeView;
|
class CrossfadeView;
|
||||||
class RouteTimeAxisView;
|
class RouteTimeAxisView;
|
||||||
class AudioTimeAxisView;
|
|
||||||
class RegionView;
|
class RegionView;
|
||||||
class AudioRegionView;
|
class AudioRegionView;
|
||||||
class TempoMarker;
|
class TempoMarker;
|
||||||
|
|
@ -149,7 +148,7 @@ class PublicEditor : public Gtk::Window, public Stateful {
|
||||||
virtual bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*) = 0;
|
virtual bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*) = 0;
|
||||||
virtual bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*) = 0;
|
virtual bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*) = 0;
|
||||||
virtual bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*) = 0;
|
virtual bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*) = 0;
|
||||||
virtual bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*) = 0;
|
virtual bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*) = 0;
|
||||||
virtual bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*) = 0;
|
virtual bool canvas_stream_view_event (GdkEvent* event,ArdourCanvas::Item*, RouteTimeAxisView*) = 0;
|
||||||
virtual bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*) = 0;
|
virtual bool canvas_marker_event (GdkEvent* event,ArdourCanvas::Item*, Marker*) = 0;
|
||||||
virtual bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*) = 0;
|
virtual bool canvas_zoom_rect_event (GdkEvent* event,ArdourCanvas::Item*) = 0;
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,15 @@ RegionView::RegionView (ArdourCanvas::Group* parent,
|
||||||
TimeAxisViewItem::ShowNameHighlight|
|
TimeAxisViewItem::ShowNameHighlight|
|
||||||
TimeAxisViewItem::ShowFrame))
|
TimeAxisViewItem::ShowFrame))
|
||||||
, _region (r)
|
, _region (r)
|
||||||
|
, sync_mark(0)
|
||||||
|
, no_wave_msg(0)
|
||||||
|
, editor(0)
|
||||||
|
, current_visible_sync_position(0.0)
|
||||||
|
, valid(false)
|
||||||
|
, _pixel_width(1.0)
|
||||||
|
, _height(1.0)
|
||||||
|
, in_destructor(false)
|
||||||
|
, wait_for_data(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -78,6 +87,15 @@ RegionView::RegionView (ArdourCanvas::Group* parent,
|
||||||
TimeAxisViewItem::Visibility visibility)
|
TimeAxisViewItem::Visibility visibility)
|
||||||
: TimeAxisViewItem (r.name(), *parent, tv, spu, basic_color, r.position(), r.length(), visibility)
|
: TimeAxisViewItem (r.name(), *parent, tv, spu, basic_color, r.position(), r.length(), visibility)
|
||||||
, _region (r)
|
, _region (r)
|
||||||
|
, sync_mark(0)
|
||||||
|
, no_wave_msg(0)
|
||||||
|
, editor(0)
|
||||||
|
, current_visible_sync_position(0.0)
|
||||||
|
, valid(false)
|
||||||
|
, _pixel_width(1.0)
|
||||||
|
, _height(1.0)
|
||||||
|
, in_destructor(false)
|
||||||
|
, wait_for_data(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ class PublicEditor;
|
||||||
class RegionView;
|
class RegionView;
|
||||||
class StreamView;
|
class StreamView;
|
||||||
class Selection;
|
class Selection;
|
||||||
|
class RegionSelection;
|
||||||
class Selectable;
|
class Selectable;
|
||||||
class AutomationTimeAxisView;
|
class AutomationTimeAxisView;
|
||||||
class AutomationLine;
|
class AutomationLine;
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,9 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ardour/region.h>
|
#include <ardour/region.h>
|
||||||
#include <ardour/audioregion.h>
|
|
||||||
|
|
||||||
#include "selection.h"
|
#include "selection.h"
|
||||||
|
#include "region_view.h"
|
||||||
|
|
||||||
inline void
|
inline void
|
||||||
Selection::foreach_region (void (ARDOUR::Region::*method)(void)) {
|
Selection::foreach_region (void (ARDOUR::Region::*method)(void)) {
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ SoundFileBox::SoundFileBox ()
|
||||||
remove_field_btn.signal_clicked().connect
|
remove_field_btn.signal_clicked().connect
|
||||||
(mem_fun (*this, &SoundFileBox::remove_field_clicked));
|
(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));
|
cell->signal_edited().connect (mem_fun (*this, &SoundFileBox::field_edited));
|
||||||
|
|
||||||
field_view.get_selection()->signal_changed().connect (mem_fun (*this, &SoundFileBox::field_selected));
|
field_view.get_selection()->signal_changed().connect (mem_fun (*this, &SoundFileBox::field_selected));
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,7 @@ get_font_for_style (string widgetname)
|
||||||
{
|
{
|
||||||
Gtk::Window window (WINDOW_TOPLEVEL);
|
Gtk::Window window (WINDOW_TOPLEVEL);
|
||||||
Gtk::Label foobar;
|
Gtk::Label foobar;
|
||||||
Glib::RefPtr<Style> style;
|
Glib::RefPtr<Gtk::Style> style;
|
||||||
|
|
||||||
window.add (foobar);
|
window.add (foobar);
|
||||||
foobar.set_name (widgetname);
|
foobar.set_name (widgetname);
|
||||||
|
|
@ -435,12 +435,10 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev)
|
||||||
|
|
||||||
if (!special_handling_of_unmodified_accelerators ||
|
if (!special_handling_of_unmodified_accelerators ||
|
||||||
ev->state & (Gdk::MOD1_MASK|
|
ev->state & (Gdk::MOD1_MASK|
|
||||||
Gdk::MOD2_MASK|
|
|
||||||
Gdk::MOD3_MASK|
|
Gdk::MOD3_MASK|
|
||||||
Gdk::MOD4_MASK|
|
Gdk::MOD4_MASK|
|
||||||
Gdk::MOD5_MASK|
|
Gdk::MOD5_MASK|
|
||||||
Gdk::CONTROL_MASK|
|
Gdk::CONTROL_MASK)) {
|
||||||
Gdk::LOCK_MASK)) {
|
|
||||||
|
|
||||||
/* no special handling or modifiers in effect: accelerate first */
|
/* no special handling or modifiers in effect: accelerate first */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ arch_specific_objects = [ ]
|
||||||
|
|
||||||
osc_files = [ 'osc.cc' ]
|
osc_files = [ 'osc.cc' ]
|
||||||
vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
|
vst_files = [ 'vst_plugin.cc', 'session_vst.cc' ]
|
||||||
coreaudio_files = [ 'coreaudiosource.cc' ]
|
coreaudio_files = [ 'audio_unit.cc', 'coreaudiosource.cc' ]
|
||||||
extra_sources = [ ]
|
extra_sources = [ ]
|
||||||
|
|
||||||
if ardour['VST']:
|
if ardour['VST']:
|
||||||
|
|
|
||||||
35
libs/ardour/ardour/audio_unit.h
Normal file
35
libs/ardour/ardour/audio_unit.h
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
Copyright (C) 2006 Paul Davis
|
||||||
|
Written by Taybin Rutkin
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ardour_audio_unit_h__
|
||||||
|
#define __ardour_audio_unit_h__
|
||||||
|
|
||||||
|
#include <ardour/plugin.h>
|
||||||
|
|
||||||
|
namespace ARDOUR {
|
||||||
|
|
||||||
|
class AudioUnit : public ARDOUR::Plugin
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace ARDOUR
|
||||||
|
|
||||||
|
#endif // __ardour_audio_unit_h__
|
||||||
|
|
@ -23,6 +23,8 @@ class PluginManager {
|
||||||
|
|
||||||
std::list<PluginInfo*> &vst_plugin_info () { return _vst_plugin_info; }
|
std::list<PluginInfo*> &vst_plugin_info () { return _vst_plugin_info; }
|
||||||
std::list<PluginInfo*> &ladspa_plugin_info () { return _ladspa_plugin_info; }
|
std::list<PluginInfo*> &ladspa_plugin_info () { return _ladspa_plugin_info; }
|
||||||
|
std::list<PluginInfo*> &au_plugin_info () { return _au_plugin_info; }
|
||||||
|
|
||||||
void refresh ();
|
void refresh ();
|
||||||
|
|
||||||
int add_ladspa_directory (std::string dirpath);
|
int add_ladspa_directory (std::string dirpath);
|
||||||
|
|
@ -36,6 +38,7 @@ class PluginManager {
|
||||||
ARDOUR::AudioEngine& _engine;
|
ARDOUR::AudioEngine& _engine;
|
||||||
std::list<PluginInfo*> _vst_plugin_info;
|
std::list<PluginInfo*> _vst_plugin_info;
|
||||||
std::list<PluginInfo*> _ladspa_plugin_info;
|
std::list<PluginInfo*> _ladspa_plugin_info;
|
||||||
|
std::list<PluginInfo*> _au_plugin_info;
|
||||||
std::map<uint32_t, std::string> rdf_type;
|
std::map<uint32_t, std::string> rdf_type;
|
||||||
|
|
||||||
std::string ladspa_path;
|
std::string ladspa_path;
|
||||||
|
|
@ -55,6 +58,8 @@ class PluginManager {
|
||||||
int ladspa_discover_from_path (std::string path);
|
int ladspa_discover_from_path (std::string path);
|
||||||
int ladspa_discover (std::string path);
|
int ladspa_discover (std::string path);
|
||||||
|
|
||||||
|
int au_discover ();
|
||||||
|
|
||||||
std::string get_ladspa_category (uint32_t id);
|
std::string get_ladspa_category (uint32_t id);
|
||||||
|
|
||||||
static PluginManager* _manager; // singleton
|
static PluginManager* _manager; // singleton
|
||||||
|
|
@ -63,3 +68,4 @@ class PluginManager {
|
||||||
} /* namespace ARDOUR */
|
} /* namespace ARDOUR */
|
||||||
|
|
||||||
#endif /* __ardour_plugin_manager_h__ */
|
#endif /* __ardour_plugin_manager_h__ */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,10 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
#ifdef HAVE_COREAUDIO
|
||||||
|
#include <CoreFoundation/CoreFoundation.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "ardour.h"
|
#include "ardour.h"
|
||||||
|
|
||||||
class XMLNode;
|
class XMLNode;
|
||||||
|
|
@ -53,4 +57,8 @@ int touch_file(std::string path);
|
||||||
std::string region_name_from_path (std::string path);
|
std::string region_name_from_path (std::string path);
|
||||||
std::string path_expand (std::string);
|
std::string path_expand (std::string);
|
||||||
|
|
||||||
|
#ifdef HAVE_COREAUDIO
|
||||||
|
std::string CFStringRefToStdString(CFStringRef stringRef);
|
||||||
|
#endif // HAVE_COREAUDIO
|
||||||
|
|
||||||
#endif /* __ardour_utils_h__ */
|
#endif /* __ardour_utils_h__ */
|
||||||
|
|
|
||||||
19
libs/ardour/audio_unit.cc
Normal file
19
libs/ardour/audio_unit.cc
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
/*
|
||||||
|
Copyright (C) 2006 Paul Davis
|
||||||
|
Written by Taybin Rutkin
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
@ -238,25 +238,6 @@ AudioFileSource::create (const string& idstr, Flag flags)
|
||||||
|
|
||||||
#endif // HAVE_COREAUDIO
|
#endif // HAVE_COREAUDIO
|
||||||
|
|
||||||
#ifdef HAVE_COREAUDIO
|
|
||||||
std::string
|
|
||||||
CFStringRefToStdString(CFStringRef stringRef)
|
|
||||||
{
|
|
||||||
CFIndex size =
|
|
||||||
CFStringGetMaximumSizeForEncoding(CFStringGetLength(stringRef) ,
|
|
||||||
kCFStringEncodingASCII);
|
|
||||||
char *buf = new char[size];
|
|
||||||
|
|
||||||
std::string result;
|
|
||||||
|
|
||||||
if(CFStringGetCString(stringRef, buf, size, kCFStringEncodingASCII)) {
|
|
||||||
result = buf;
|
|
||||||
}
|
|
||||||
delete [] buf;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
#endif // HAVE_COREAUDIO
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
AudioFileSource::get_soundfile_info (string path, SoundFileInfo& _info, string& error_msg)
|
AudioFileSource::get_soundfile_info (string path, SoundFileInfo& _info, string& error_msg)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -68,13 +68,13 @@ CoreAudioSource::init (const string& idstr)
|
||||||
FSRef fsr;
|
FSRef fsr;
|
||||||
err = FSPathMakeRef ((UInt8*)file.c_str(), &fsr, 0);
|
err = FSPathMakeRef ((UInt8*)file.c_str(), &fsr, 0);
|
||||||
if (err != noErr) {
|
if (err != noErr) {
|
||||||
cerr << "FSPathMakeRef " << err << endl;
|
error << string_compose (_("Could not make reference to file: %1"), name()) << endmsg;
|
||||||
throw failed_constructor();
|
throw failed_constructor();
|
||||||
}
|
}
|
||||||
|
|
||||||
err = ExtAudioFileOpen (&fsr, &af);
|
err = ExtAudioFileOpen (&fsr, &af);
|
||||||
if (err != noErr) {
|
if (err != noErr) {
|
||||||
cerr << "ExtAudioFileOpen " << err << endl;
|
error << string_compose (_("Could not open file: %1"), name()) << endmsg;
|
||||||
ExtAudioFileDispose (af);
|
ExtAudioFileDispose (af);
|
||||||
throw failed_constructor();
|
throw failed_constructor();
|
||||||
}
|
}
|
||||||
|
|
@ -85,7 +85,7 @@ CoreAudioSource::init (const string& idstr)
|
||||||
err = ExtAudioFileGetProperty(af,
|
err = ExtAudioFileGetProperty(af,
|
||||||
kExtAudioFileProperty_FileDataFormat, &asbd_size, &file_asbd);
|
kExtAudioFileProperty_FileDataFormat, &asbd_size, &file_asbd);
|
||||||
if (err != noErr) {
|
if (err != noErr) {
|
||||||
cerr << "ExtAudioFileGetProperty1 " << err << endl;
|
error << string_compose (_("Could not get file data format for file: %1"), name()) << endmsg;
|
||||||
ExtAudioFileDispose (af);
|
ExtAudioFileDispose (af);
|
||||||
throw failed_constructor();
|
throw failed_constructor();
|
||||||
}
|
}
|
||||||
|
|
@ -104,7 +104,7 @@ CoreAudioSource::init (const string& idstr)
|
||||||
|
|
||||||
err = ExtAudioFileGetProperty(af, kExtAudioFileProperty_FileLengthFrames, &prop_size, &ca_frames);
|
err = ExtAudioFileGetProperty(af, kExtAudioFileProperty_FileLengthFrames, &prop_size, &ca_frames);
|
||||||
if (err != noErr) {
|
if (err != noErr) {
|
||||||
cerr << "ExtAudioFileGetProperty2 " << err << endl;
|
error << string_compose (_("Could not get file length for file: %1"), name()) << endmsg;
|
||||||
ExtAudioFileDispose (af);
|
ExtAudioFileDispose (af);
|
||||||
throw failed_constructor();
|
throw failed_constructor();
|
||||||
}
|
}
|
||||||
|
|
@ -125,14 +125,14 @@ CoreAudioSource::init (const string& idstr)
|
||||||
|
|
||||||
err = ExtAudioFileSetProperty (af, kExtAudioFileProperty_ClientDataFormat, asbd_size, &client_asbd);
|
err = ExtAudioFileSetProperty (af, kExtAudioFileProperty_ClientDataFormat, asbd_size, &client_asbd);
|
||||||
if (err != noErr) {
|
if (err != noErr) {
|
||||||
cerr << "ExtAudioFileSetProperty3 " << err << endl;
|
error << string_compose (_("Could not set client data format for file: %1"), name()) << endmsg;
|
||||||
ExtAudioFileDispose (af);
|
ExtAudioFileDispose (af);
|
||||||
throw failed_constructor ();
|
throw failed_constructor ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_build_peakfiles) {
|
if (_build_peakfiles) {
|
||||||
if (initialize_peakfile (false, file)) {
|
if (initialize_peakfile (false, file)) {
|
||||||
error << "initialize peakfile failed" << endmsg;
|
error << string_compose(_("initialize peakfile failed for file %1"), name()) << endmsg;
|
||||||
ExtAudioFileDispose (af);
|
ExtAudioFileDispose (af);
|
||||||
throw failed_constructor ();
|
throw failed_constructor ();
|
||||||
}
|
}
|
||||||
|
|
@ -212,7 +212,24 @@ CoreAudioSource::read_unlocked (Sample *dst, jack_nframes_t start, jack_nframes_
|
||||||
float
|
float
|
||||||
CoreAudioSource::sample_rate() const
|
CoreAudioSource::sample_rate() const
|
||||||
{
|
{
|
||||||
/* XXX taybin fill me in please */
|
AudioStreamBasicDescription client_asbd;
|
||||||
|
memset(&client_asbd, 0, sizeof(AudioStreamBasicDescription));
|
||||||
|
|
||||||
return 44100.0f;
|
OSStatus err = noErr;
|
||||||
|
size_t asbd_size = sizeof(AudioStreamBasicDescription);
|
||||||
|
|
||||||
|
err = ExtAudioFileSetProperty (af, kExtAudioFileProperty_ClientDataFormat, asbd_size, &client_asbd);
|
||||||
|
if (err != noErr) {
|
||||||
|
error << string_compose(_("Could not detect samplerate for: %1"), name()) << endmsg;
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return client_asbd.mSampleRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
CoreAudioSource::update_header (jack_nframes_t when, struct tm&, time_t)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
#include <fst.h>
|
#include <fst.h>
|
||||||
#include <pbd/basename.h>
|
#include <pbd/basename.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#endif
|
#endif // VST_SUPPORT
|
||||||
|
|
||||||
#include <pbd/pathscanner.h>
|
#include <pbd/pathscanner.h>
|
||||||
|
|
||||||
|
|
@ -41,6 +41,11 @@
|
||||||
#include <pbd/error.h>
|
#include <pbd/error.h>
|
||||||
#include <pbd/stl_delete.h>
|
#include <pbd/stl_delete.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_COREAUDIO
|
||||||
|
#include <CoreServices/CoreServices.h>
|
||||||
|
#include <AudioUnit/AudioUnit.h>
|
||||||
|
#endif // HAVE_COREAUDIO
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
|
|
@ -95,7 +100,11 @@ PluginManager::refresh ()
|
||||||
if (Config->get_use_vst()) {
|
if (Config->get_use_vst()) {
|
||||||
vst_refresh ();
|
vst_refresh ();
|
||||||
}
|
}
|
||||||
#endif
|
#endif // VST_SUPPORT
|
||||||
|
|
||||||
|
#ifdef HAVE_COREAUDIO
|
||||||
|
au_discover ();
|
||||||
|
#endif // HAVE_COREAUDIO
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -302,10 +311,10 @@ PluginManager::load (Session& session, PluginInfo *info)
|
||||||
} else {
|
} else {
|
||||||
error << _("You asked ardour to not use any VST plugins") << endmsg;
|
error << _("You asked ardour to not use any VST plugins") << endmsg;
|
||||||
}
|
}
|
||||||
#else
|
#else // !VST_SUPPORT
|
||||||
error << _("This version of ardour has no support for VST plugins") << endmsg;
|
error << _("This version of ardour has no support for VST plugins") << endmsg;
|
||||||
return boost::shared_ptr<Plugin> ((Plugin*) 0);
|
return boost::shared_ptr<Plugin> ((Plugin*) 0);
|
||||||
#endif
|
#endif // !VST_SUPPORT
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
@ -342,12 +351,15 @@ ARDOUR::find_plugin(Session& session, string name, long unique_id, PluginInfo::T
|
||||||
unique_id = 0; // VST plugins don't have a unique id.
|
unique_id = 0; // VST plugins don't have a unique id.
|
||||||
break;
|
break;
|
||||||
case PluginInfo::AudioUnit:
|
case PluginInfo::AudioUnit:
|
||||||
|
plugs = &mgr->au_plugin_info();
|
||||||
|
unique_id = 0;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return boost::shared_ptr<Plugin> ((Plugin *) 0);
|
return boost::shared_ptr<Plugin> ((Plugin *) 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = plugs->begin(); i != plugs->end(); ++i) {
|
for (i = plugs->begin(); i != plugs->end(); ++i) {
|
||||||
if ((name == "" || (*i)->name == name) &&
|
if ((name == "" || (*i)->name == name) &&
|
||||||
(unique_id == 0 || (*i)->unique_id == unique_id)) {
|
(unique_id == 0 || (*i)->unique_id == unique_id)) {
|
||||||
return mgr->load (session, *i);
|
return mgr->load (session, *i);
|
||||||
}
|
}
|
||||||
|
|
@ -489,4 +501,95 @@ PluginManager::vst_discover (string path)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // VST_SUPPORT
|
||||||
|
|
||||||
|
#ifdef HAVE_COREAUDIO
|
||||||
|
|
||||||
|
int
|
||||||
|
PluginManager::au_discover ()
|
||||||
|
{
|
||||||
|
_au_plugin_info.clear ();
|
||||||
|
|
||||||
|
int numTypes = 2; // this magic number was retrieved from the apple AUHost example.
|
||||||
|
|
||||||
|
ComponentDescription desc;
|
||||||
|
desc.componentFlags = 0;
|
||||||
|
desc.componentFlagsMask = 0;
|
||||||
|
desc.componentSubType = 0;
|
||||||
|
desc.componentManufacturer = 0;
|
||||||
|
|
||||||
|
vector<ComponentDescription> vCompDescs;
|
||||||
|
|
||||||
|
for (int i = 0; i < numTypes; ++i) {
|
||||||
|
if (i == 1) {
|
||||||
|
desc.componentType = kAudioUnitType_MusicEffect;
|
||||||
|
} else {
|
||||||
|
desc.componentType = kAudioUnitType_Effect;
|
||||||
|
}
|
||||||
|
|
||||||
|
Component comp = 0;
|
||||||
|
|
||||||
|
comp = FindNextComponent (NULL, &desc);
|
||||||
|
while (comp != NULL) {
|
||||||
|
ComponentDescription temp;
|
||||||
|
GetComponentInfo (comp, &temp, NULL, NULL, NULL);
|
||||||
|
vCompDescs.push_back(temp);
|
||||||
|
comp = FindNextComponent (comp, &desc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PluginInfo* plug;
|
||||||
|
for (unsigned int i = 0; i < vCompDescs.size(); ++i) {
|
||||||
|
|
||||||
|
// the following large block is just for determining the name of the plugin.
|
||||||
|
CFStringRef itemName = NULL;
|
||||||
|
// Marc Poirier -style item name
|
||||||
|
Component auComponent = FindNextComponent (0, &(vCompDescs[i]));
|
||||||
|
if (auComponent != NULL) {
|
||||||
|
ComponentDescription dummydesc;
|
||||||
|
Handle nameHandle = NewHandle(sizeof(void*));
|
||||||
|
if (nameHandle != NULL) {
|
||||||
|
OSErr err = GetComponentInfo(auComponent, &dummydesc, nameHandle, NULL, NULL);
|
||||||
|
if (err == noErr) {
|
||||||
|
ConstStr255Param nameString = (ConstStr255Param) (*nameHandle);
|
||||||
|
if (nameString != NULL) {
|
||||||
|
itemName = CFStringCreateWithPascalString(kCFAllocatorDefault, nameString, CFStringGetSystemEncoding());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DisposeHandle(nameHandle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if Marc-style fails, do the original way
|
||||||
|
if (itemName == NULL) {
|
||||||
|
CFStringRef compTypeString = UTCreateStringForOSType(vCompDescs[i].componentType);
|
||||||
|
CFStringRef compSubTypeString = UTCreateStringForOSType(vCompDescs[i].componentSubType);
|
||||||
|
CFStringRef compManufacturerString = UTCreateStringForOSType(vCompDescs[i].componentManufacturer);
|
||||||
|
|
||||||
|
itemName = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%@ - %@ - %@"),
|
||||||
|
compTypeString, compManufacturerString, compSubTypeString);
|
||||||
|
|
||||||
|
if (compTypeString != NULL)
|
||||||
|
CFRelease(compTypeString);
|
||||||
|
if (compSubTypeString != NULL)
|
||||||
|
CFRelease(compSubTypeString);
|
||||||
|
if (compManufacturerString != NULL)
|
||||||
|
CFRelease(compManufacturerString);
|
||||||
|
}
|
||||||
|
string realname = CFStringRefToStdString(itemName);
|
||||||
|
|
||||||
|
plug = new PluginInfo;
|
||||||
|
plug->name = realname;
|
||||||
|
plug->type = PluginInfo::AudioUnit;
|
||||||
|
plug->n_inputs = 0;
|
||||||
|
plug->n_outputs = 0;
|
||||||
|
plug->category = "AudioUnit";
|
||||||
|
|
||||||
|
_au_plugin_info.push_back(plug);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // HAVE_COREAUDIO
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -253,3 +253,21 @@ path_expand (string path)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_COREAUDIO
|
||||||
|
string
|
||||||
|
CFStringRefToStdString(CFStringRef stringRef)
|
||||||
|
{
|
||||||
|
CFIndex size =
|
||||||
|
CFStringGetMaximumSizeForEncoding(CFStringGetLength(stringRef) ,
|
||||||
|
kCFStringEncodingUTF8);
|
||||||
|
char *buf = new char[size];
|
||||||
|
|
||||||
|
std::string result;
|
||||||
|
|
||||||
|
if(CFStringGetCString(stringRef, buf, size, kCFStringEncodingUTF8)) {
|
||||||
|
result = buf;
|
||||||
|
}
|
||||||
|
delete [] buf;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endif // HAVE_COREAUDIO
|
||||||
|
|
|
||||||
|
|
@ -693,7 +693,7 @@ TranzportControlProtocol::update_state ()
|
||||||
/* per track */
|
/* per track */
|
||||||
|
|
||||||
if (route_table[0]) {
|
if (route_table[0]) {
|
||||||
AudioTrack* at = dynamic_cast<AudioTrack*> (route_table[0]);
|
boost::shared_ptr<AudioTrack> at = boost::dynamic_pointer_cast<AudioTrack> (route_table[0]);
|
||||||
if (at && at->record_enabled()) {
|
if (at && at->record_enabled()) {
|
||||||
pending_lights[LightTrackrec] = true;
|
pending_lights[LightTrackrec] = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue