summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/SAE-de-keypad.bindings.in7
-rw-r--r--gtk2_ardour/SAE-de-nokeypad.bindings.in7
-rw-r--r--gtk2_ardour/SAE-us-keypad.bindings.in8
-rw-r--r--gtk2_ardour/SAE-us-nokeypad.bindings.in8
-rw-r--r--gtk2_ardour/SConscript2
-rw-r--r--gtk2_ardour/ardour.menus.in2
-rw-r--r--gtk2_ardour/editor_ops.cc2
-rw-r--r--gtk2_ardour/ergonomic-us.bindings.in30
-rw-r--r--gtk2_ardour/mnemonic-us.bindings.in37
-rw-r--r--gtk2_ardour/plugin_ui.cc12
-rw-r--r--gtk2_ardour/plugin_ui.h3
-rw-r--r--gtk2_ardour/vst_pluginui.cc86
-rw-r--r--libs/ardour/ardour/audio_unit.h34
-rw-r--r--libs/ardour/ardour/audioanalyser.h2
-rw-r--r--libs/ardour/ardour/chan_count.h5
-rw-r--r--libs/ardour/ardour/session.h4
-rw-r--r--libs/ardour/audio_unit.cc783
-rw-r--r--libs/ardour/audioanalyser.cc2
-rw-r--r--libs/ardour/chan_count.cc5
-rw-r--r--libs/ardour/globals.cc3
-rw-r--r--libs/ardour/region.cc1
-rw-r--r--libs/ardour/session.cc6
-rw-r--r--libs/ardour/session_process.cc20
-rw-r--r--libs/ardour/session_vst.cc54
-rw-r--r--libs/ardour/vst_plugin.cc68
-rw-r--r--libs/pbd/SConscript3
-rw-r--r--libs/pbd/pathscanner.cc6
-rw-r--r--libs/pbd/pthread_utils.cc14
-rw-r--r--libs/rubberband/src/vamp/RubberBandVampPlugin.h2
-rw-r--r--libs/surfaces/osc/osc.cc2
-rw-r--r--libs/vamp-plugins/Onset.h2
-rw-r--r--libs/vamp-sdk/src/vamp-hostsdk/PluginBufferingAdapter.cpp2
-rw-r--r--libs/vamp-sdk/src/vamp-hostsdk/PluginChannelAdapter.cpp2
-rw-r--r--libs/vamp-sdk/src/vamp-hostsdk/PluginHostAdapter.cpp2
-rw-r--r--libs/vamp-sdk/src/vamp-hostsdk/PluginInputDomainAdapter.cpp2
-rw-r--r--libs/vamp-sdk/src/vamp-hostsdk/PluginLoader.cpp10
-rw-r--r--libs/vamp-sdk/src/vamp-hostsdk/PluginSummarisingAdapter.cpp2
-rw-r--r--libs/vamp-sdk/src/vamp-hostsdk/PluginWrapper.cpp2
-rw-r--r--libs/vamp-sdk/src/vamp-hostsdk/RealTime.cpp2
-rw-r--r--libs/vamp-sdk/src/vamp-sdk/PluginAdapter.cpp2
-rw-r--r--libs/vamp-sdk/src/vamp-sdk/RealTime.cpp2
-rw-r--r--libs/vamp-sdk/vamp-hostsdk/Plugin.h2
-rw-r--r--libs/vamp-sdk/vamp-hostsdk/PluginBase.h2
-rw-r--r--libs/vamp-sdk/vamp-hostsdk/PluginHostAdapter.h2
-rw-r--r--libs/vamp-sdk/vamp-hostsdk/PluginWrapper.h2
-rw-r--r--libs/vamp-sdk/vamp-hostsdk/RealTime.h2
-rw-r--r--libs/vamp-sdk/vamp-sdk/PluginAdapter.h2
-rwxr-xr-xvst/ardevst2
48 files changed, 1020 insertions, 242 deletions
diff --git a/gtk2_ardour/SAE-de-keypad.bindings.in b/gtk2_ardour/SAE-de-keypad.bindings.in
index e8e3e1b338..dad2ead224 100644
--- a/gtk2_ardour/SAE-de-keypad.bindings.in
+++ b/gtk2_ardour/SAE-de-keypad.bindings.in
@@ -8,8 +8,9 @@
(gtk_accel_path "<Actions>/Transport/ToggleRoll" "space")
(gtk_accel_path "<Actions>/Transport/ToggleRollForgetCapture" "<%PRIMARY%>period")
(gtk_accel_path "<Actions>/Transport/record-roll" "<%PRIMARY%>space")
+(gtk_accel_path "<Actions>/Editor/play-from-edit-point-and-return" "<%LEVEL4%>space")
-(gtk_accel_path "<Actions>/Common/ToggleOptionsEditor" "<%PRIMARY%>,")
+(gtk_accel_path "<Actions>/Common/ToggleOptionsEditor" "<%PRIMARY%>comma")
(gtk_accel_path "<Actions>/Editor/align-regions-end" "<%PRIMARY%><%SECONDARY%>less")
(gtk_accel_path "<Actions>/Editor/align-regions-end-relative" "<%PRIMARY%>less")
@@ -82,7 +83,7 @@
(gtk_accel_path "<Actions>/Editor/duplicate-region" "<%PRIMARY%>d")
(gtk_accel_path "<Actions>/Editor/multi-duplicate-region" "<%PRIMARY%><%TERTIARY%>d")
(gtk_accel_path "<Actions>/Editor/toggle-follow-playhead" "f")
-(gtk_accel_path "<Actions>/Common/toggle-rhythm-ferret" "<%WINDOW%>f")
+(gtk_accel_path "<Actions>/Editor/toggle-rhythm-ferret" "<%WINDOW%>f")
; (gtk_accel_path "<Actions>/Editor/set-edit-point" "g")
; (gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-gain" "g")
(gtk_accel_path "<Actions>/Editor/nudge-backward" "g")
@@ -121,6 +122,7 @@
(gtk_accel_path "<Actions>/Editor/editor-delete" "BackSpace")
(gtk_accel_path "<Actions>/Editor/remove-last-capture" "<%PRIMARY%>Delete")
+(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-boundary-noselection" "<%LEVEL4%>leftarrow")
(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-boundary" "leftarrow")
(gtk_accel_path "<Actions>/Editor/playhead-backward-to-grid" "<%TERTIARY%><%LEVEL4%>leftarrow")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-previous-region-sync" "<%TERTIARY%><%SECONDARY%>leftarrow")
@@ -131,6 +133,7 @@
(gtk_accel_path "<Actions>/Editor/selected-marker-to-previous-region-boundary" "<%PRIMARY%><%TERTIARY%>leftarrow")
+(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-boundary-noselection" "<%LEVEL4%>rightarrow")
(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-boundary" "rightarrow")
(gtk_accel_path "<Actions>/Editor/playhead-forward-to-grid" "<%TERTIARY%><%LEVEL4%>rightarrow")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-next-region-sync" "<%TERTIARY%><%SECONDARY%>leftarrow")
diff --git a/gtk2_ardour/SAE-de-nokeypad.bindings.in b/gtk2_ardour/SAE-de-nokeypad.bindings.in
index 27c824e5dd..bcd7f6d3de 100644
--- a/gtk2_ardour/SAE-de-nokeypad.bindings.in
+++ b/gtk2_ardour/SAE-de-nokeypad.bindings.in
@@ -8,8 +8,9 @@
(gtk_accel_path "<Actions>/Transport/ToggleRoll" "space")
(gtk_accel_path "<Actions>/Transport/ToggleRollForgetCapture" "<%PRIMARY%>period")
(gtk_accel_path "<Actions>/Transport/record-roll" "<%PRIMARY%>space")
+(gtk_accel_path "<Actions>/Editor/play-from-edit-point-and-return" "<%LEVEL4%>space")
-(gtk_accel_path "<Actions>/Common/ToggleOptionsEditor" "<%PRIMARY%>,")
+(gtk_accel_path "<Actions>/Common/ToggleOptionsEditor" "<%PRIMARY%>comma")
(gtk_accel_path "<Actions>/Editor/align-regions-end" "<%PRIMARY%><%SECONDARY%>less")
(gtk_accel_path "<Actions>/Editor/align-regions-end-relative" "<%PRIMARY%>less")
@@ -82,7 +83,7 @@
(gtk_accel_path "<Actions>/Editor/duplicate-region" "<%PRIMARY%>d")
(gtk_accel_path "<Actions>/Editor/multi-duplicate-region" "<%PRIMARY%><%TERTIARY%>d")
(gtk_accel_path "<Actions>/Editor/toggle-follow-playhead" "f")
-(gtk_accel_path "<Actions>/Common/toggle-rhythm-ferret" "<%SECONDARY%>f")
+(gtk_accel_path "<Actions>/Editor/toggle-rhythm-ferret" "<%SECONDARY%>f")
; (gtk_accel_path "<Actions>/Editor/set-edit-point" "g")
; (gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-gain" "g")
(gtk_accel_path "<Actions>/Editor/nudge-backward" "g")
@@ -120,6 +121,7 @@
(gtk_accel_path "<Actions>/Editor/editor-delete" "BackSpace")
(gtk_accel_path "<Actions>/Editor/remove-last-capture" "<%PRIMARY%>BackSpace")
+(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-boundary-noselection" "<%LEVEL4%>leftarrow")
(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-boundary" "leftarrow")
(gtk_accel_path "<Actions>/Editor/playhead-backward-to-grid" "<%TERTIARY%><%LEVEL4%>leftarrow")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-previous-region-sync" "<%TERTIARY%><%SECONDARY%>leftarrow")
@@ -130,6 +132,7 @@
(gtk_accel_path "<Actions>/Editor/selected-marker-to-previous-region-boundary" "<%PRIMARY%><%TERTIARY%>leftarrow")
+(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-boundary-noselection" "<%LEVEL4%>rightarrow")
(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-boundary" "rightarrow")
(gtk_accel_path "<Actions>/Editor/playhead-forward-to-grid" "<%TERTIARY%><%LEVEL4%>rightarrow")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-next-region-sync" "<%TERTIARY%><%SECONDARY%>leftarrow")
diff --git a/gtk2_ardour/SAE-us-keypad.bindings.in b/gtk2_ardour/SAE-us-keypad.bindings.in
index e4d98140fd..88085b0968 100644
--- a/gtk2_ardour/SAE-us-keypad.bindings.in
+++ b/gtk2_ardour/SAE-us-keypad.bindings.in
@@ -8,7 +8,8 @@
(gtk_accel_path "<Actions>/Transport/ToggleRoll" "space")
(gtk_accel_path "<Actions>/Transport/ToggleRollForgetCapture" "<%PRIMARY%>period")
(gtk_accel_path "<Actions>/Transport/record-roll" "<%PRIMARY%>space")
-
+(gtk_accel_path "<Actions>/Editor/play-from-edit-point-and-return" "<%LEVEL4%>space")
+(gtk_accel_path "<Actions>/Common/ToggleOptionsEditor" "<%PRIMARY%>comma")
(gtk_accel_path "<Actions>/Editor/align-regions-end" "<%PRIMARY%><%SECONDARY%>less")
(gtk_accel_path "<Actions>/Editor/align-regions-end-relative" "<%PRIMARY%>less")
(gtk_accel_path "<Actions>/Editor/align-regions-start" "<%LEVEL4%><%SECONDARY%>less")
@@ -61,7 +62,6 @@
(gtk_accel_path "<Actions>/Editor/insert-region" "i")
(gtk_accel_path "<Actions>/Editor/addExistingAudioFiles" "<%PRIMARY%>i")
(gtk_accel_path "<Actions>/Editor/invert-selection" "<%TERTIARY%>i")
-(gtk_accel_path "<Actions>/Common/ToggleOptionsEditor" "<%SECONDARY%>o")
(gtk_accel_path "<Actions>/Main/Open" "<%PRIMARY%>o")
(gtk_accel_path "<Actions>/Main/Recent" "<%PRIMARY%><%TERTIARY%>o")
(gtk_accel_path "<Actions>/Editor/naturalize-region" "<%LEVEL4%>o")
@@ -81,7 +81,7 @@
(gtk_accel_path "<Actions>/Editor/duplicate-region" "<%PRIMARY%>d")
(gtk_accel_path "<Actions>/Editor/multi-duplicate-region" "<%PRIMARY%><%TERTIARY%>d")
(gtk_accel_path "<Actions>/Editor/toggle-follow-playhead" "f")
-(gtk_accel_path "<Actions>/Common/toggle-rhythm-ferret" "<%WINDOW%>f")
+(gtk_accel_path "<Actions>/Editor/toggle-rhythm-ferret" "<%WINDOW%>f")
; (gtk_accel_path "<Actions>/Editor/set-edit-point" "g")
; (gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-gain" "g")
(gtk_accel_path "<Actions>/Editor/nudge-backward" "g")
@@ -120,6 +120,7 @@
(gtk_accel_path "<Actions>/Editor/editor-delete" "BackSpace")
(gtk_accel_path "<Actions>/Editor/remove-last-capture" "<%PRIMARY%>Delete")
+(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-boundary-noselection" "<%LEVEL4%>leftarrow")
(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-boundary" "leftarrow")
(gtk_accel_path "<Actions>/Editor/playhead-backward-to-grid" "<%TERTIARY%><%LEVEL4%>leftarrow")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-previous-region-sync" "<%TERTIARY%><%SECONDARY%>leftarrow")
@@ -130,6 +131,7 @@
(gtk_accel_path "<Actions>/Editor/selected-marker-to-previous-region-boundary" "<%PRIMARY%><%TERTIARY%>leftarrow")
+(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-boundary-noselection" "<%LEVEL4%>rightarrow")
(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-boundary" "rightarrow")
(gtk_accel_path "<Actions>/Editor/playhead-forward-to-grid" "<%TERTIARY%><%LEVEL4%>rightarrow")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-next-region-sync" "<%TERTIARY%><%SECONDARY%>leftarrow")
diff --git a/gtk2_ardour/SAE-us-nokeypad.bindings.in b/gtk2_ardour/SAE-us-nokeypad.bindings.in
index a84ee2bf20..33fe2f0e76 100644
--- a/gtk2_ardour/SAE-us-nokeypad.bindings.in
+++ b/gtk2_ardour/SAE-us-nokeypad.bindings.in
@@ -8,7 +8,8 @@
(gtk_accel_path "<Actions>/Transport/ToggleRoll" "space")
(gtk_accel_path "<Actions>/Transport/ToggleRollForgetCapture" "<%PRIMARY%>period")
(gtk_accel_path "<Actions>/Transport/record-roll" "<%PRIMARY%>space")
-
+(gtk_accel_path "<Actions>/Editor/play-from-edit-point-and-return" "<%LEVEL4%>space")
+(gtk_accel_path "<Actions>/Common/ToggleOptionsEditor" "<%PRIMARY%>comma")
(gtk_accel_path "<Actions>/Editor/align-regions-end" "<%PRIMARY%><%SECONDARY%>less")
(gtk_accel_path "<Actions>/Editor/align-regions-end-relative" "<%PRIMARY%>less")
(gtk_accel_path "<Actions>/Editor/align-regions-start" "<%LEVEL4%><%SECONDARY%>less")
@@ -61,7 +62,6 @@
(gtk_accel_path "<Actions>/Editor/insert-region" "i")
(gtk_accel_path "<Actions>/Editor/addExistingAudioFiles" "<%PRIMARY%>i")
(gtk_accel_path "<Actions>/Editor/invert-selection" "<%TERTIARY%>i")
-(gtk_accel_path "<Actions>/Common/ToggleOptionsEditor" "<%SECONDARY%>o")
(gtk_accel_path "<Actions>/Main/Open" "<%PRIMARY%>o")
(gtk_accel_path "<Actions>/Main/Recent" "<%PRIMARY%><%TERTIARY%>o")
(gtk_accel_path "<Actions>/Editor/naturalize-region" "<%LEVEL4%>o")
@@ -81,7 +81,7 @@
(gtk_accel_path "<Actions>/Editor/duplicate-region" "<%PRIMARY%>d")
(gtk_accel_path "<Actions>/Editor/multi-duplicate-region" "<%PRIMARY%><%TERTIARY%>d")
(gtk_accel_path "<Actions>/Editor/toggle-follow-playhead" "f")
-(gtk_accel_path "<Actions>/Common/toggle-rhythm-ferret" "<%SECONDARY%>f")
+(gtk_accel_path "<Actions>/Editor/toggle-rhythm-ferret" "<%SECONDARY%>f")
; (gtk_accel_path "<Actions>/Editor/set-edit-point" "g")
; (gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-gain" "g")
(gtk_accel_path "<Actions>/Editor/nudge-backward" "g")
@@ -119,6 +119,7 @@
(gtk_accel_path "<Actions>/Editor/editor-delete" "BackSpace")
(gtk_accel_path "<Actions>/Editor/remove-last-capture" "<%PRIMARY%>BackSpace")
+(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-boundary-noselection" "<%LEVEL4%>leftarrow")
(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-boundary" "leftarrow")
(gtk_accel_path "<Actions>/Editor/playhead-backward-to-grid" "<%TERTIARY%><%LEVEL4%>leftarrow")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-previous-region-sync" "<%TERTIARY%><%SECONDARY%>leftarrow")
@@ -129,6 +130,7 @@
(gtk_accel_path "<Actions>/Editor/selected-marker-to-previous-region-boundary" "<%PRIMARY%><%TERTIARY%>leftarrow")
+(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-boundary-noselection" "<%LEVEL4%>rightarrow")
(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-boundary" "rightarrow")
(gtk_accel_path "<Actions>/Editor/playhead-forward-to-grid" "<%TERTIARY%><%LEVEL4%>rightarrow")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-next-region-sync" "<%TERTIARY%><%SECONDARY%>leftarrow")
diff --git a/gtk2_ardour/SConscript b/gtk2_ardour/SConscript
index b625d5863e..e413be6eed 100644
--- a/gtk2_ardour/SConscript
+++ b/gtk2_ardour/SConscript
@@ -56,8 +56,8 @@ gtkardour.Merge ([
libraries['sndfile'],
libraries['taglib'],
libraries['sysmidi'],
- libraries['vamp'],
libraries['vamphost'],
+ libraries['vamp'],
libraries['xml'],
libraries['xslt']
])
diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in
index 7b260138dd..eb0968da4a 100644
--- a/gtk2_ardour/ardour.menus.in
+++ b/gtk2_ardour/ardour.menus.in
@@ -80,6 +80,8 @@
<separator/>
<menuitem action='playhead-to-next-region-boundary'/>
<menuitem action='playhead-to-previous-region-boundary'/>
+ <menuitem action='playhead-to-next-region-boundary-noselection'/>
+ <menuitem action='playhead-to-previous-region-boundary-noselection'/>
<menuitem action='playhead-to-next-region-sync'/>
<menuitem action='playhead-to-previous-region-sync'/>
<separator/>
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 2706a44669..1b5067e2ac 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -3688,7 +3688,7 @@ Editor::freeze_route ()
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, 500000);
- pthread_create (&itt.thread, &attr, _freeze_thread, this);
+ pthread_create_and_store (X_("freezer"), &itt.thread, &attr, _freeze_thread, this);
pthread_attr_destroy(&attr);
diff --git a/gtk2_ardour/ergonomic-us.bindings.in b/gtk2_ardour/ergonomic-us.bindings.in
index a8c3f1fe0e..523878bd3f 100644
--- a/gtk2_ardour/ergonomic-us.bindings.in
+++ b/gtk2_ardour/ergonomic-us.bindings.in
@@ -14,7 +14,7 @@
(gtk_accel_path "<Actions>/Editor/toggle-edit-mode" "1")
(gtk_accel_path "<Actions>/Editor/cycle-snap-mode" "2")
(gtk_accel_path "<Actions>/Editor/cycle-snap-choice" "3")
-; (gtk_accel_path "<Actions>/processormenu/copy" "")
+; (gtk_accel_path "<Actions>/redirectmenu/copy" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffFaster" "")
(gtk_accel_path "<Actions>/Transport/ToggleRollForgetCapture" "<%PRIMARY%>space")
(gtk_accel_path "<Actions>/Transport/record-roll" "<%TERTIARY%>space")
@@ -22,7 +22,7 @@
; (gtk_accel_path "<Actions>/RegionList/SortByRegionLength" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffSlowest" "")
; (gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-sync" "")
-; (gtk_accel_path "<Actions>/processormenu/deactivate_all" "")
+; (gtk_accel_path "<Actions>/redirectmenu/deactivate_all" "")
; (gtk_accel_path "<Actions>/RegionList/SortByRegionPosition" "")
; (gtk_accel_path "<Actions>/Editor/ZoomFocus" "")
(gtk_accel_path "<Actions>/Editor/addExistingAudioFiles" "<%SECONDARY%>i")
@@ -34,7 +34,7 @@
; (gtk_accel_path "<Actions>/Zoom/zoom-focus-playhead" "")
; (gtk_accel_path "<Actions>/Editor/center-edit-cursor" "")
; (gtk_accel_path "<Actions>/Editor/Monitoring" "")
-; (gtk_accel_path "<Actions>/processormenu/deactivate" "")
+; (gtk_accel_path "<Actions>/redirectmenu/deactivate" "")
; (gtk_accel_path "<Actions>/options/LatchedRecordEnable" "")
; (gtk_accel_path "<Actions>/Transport/TogglePunchIn" "")
; (gtk_accel_path "<Actions>/ShuttleActions/SetShuttleUnitsPercentage" "")
@@ -103,8 +103,8 @@
(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-boundary" "leftarrow")
(gtk_accel_path "<Actions>/Editor/selected-marker-to-previous-region-boundary" "<%PRIMARY%><%TERTIARY%>leftarrow")
; (gtk_accel_path "<Actions>/Editor/EditCursorMovementOptions" "")
-; (gtk_accel_path "<Actions>/processormenu/activate_all" "")
-; (gtk_accel_path "<Actions>/processormenu/paste" "")
+; (gtk_accel_path "<Actions>/redirectmenu/activate_all" "")
+; (gtk_accel_path "<Actions>/redirectmenu/paste" "")
; (gtk_accel_path "<Actions>/Editor/Smpte25" "")
; (gtk_accel_path "<Actions>/options/RegionEquivalentsOverlap" "")
; (gtk_accel_path "<Actions>/Main/MeteringFallOffRate" "")
@@ -128,7 +128,7 @@
(gtk_accel_path "<Actions>/Editor/align-regions-sync" "less")
; (gtk_accel_path "<Actions>/Editor/EditSelectRegionOptions" "")
(gtk_accel_path "<Actions>/Editor/crop" "c")
-; (gtk_accel_path "<Actions>/processormenu/newsend" "")
+; (gtk_accel_path "<Actions>/redirectmenu/newsend" "")
; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurfaceSubMenu" "")
; (gtk_accel_path "<Actions>/Editor/MeterFalloff" "")
; (gtk_accel_path "<Actions>/RegionList/rlRemove" "")
@@ -141,7 +141,7 @@
; (gtk_accel_path "<Actions>/Snap/snap-to-minutes" "")
; (gtk_accel_path "<Actions>/Main/Windows" "")
; (gtk_accel_path "<Actions>/Main/CleanupUnused" "")
-; (gtk_accel_path "<Actions>/processormenu/deselectall" "")
+; (gtk_accel_path "<Actions>/redirectmenu/deselectall" "")
; (gtk_accel_path "<Actions>/options/SoloViaBus" "")
; (gtk_accel_path "<Actions>/RegionList/rlAudition" "")
(gtk_accel_path "<Actions>/Editor/set-region-sync-position" "u")
@@ -206,7 +206,7 @@
(gtk_accel_path "<Actions>/Editor/temporal-zoom-in" "t")
; (gtk_accel_path "<Actions>/JACK/Latency" "")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-range-end" "<%TERTIARY%>F2")
-; (gtk_accel_path "<Actions>/processormenu/rename" "")
+; (gtk_accel_path "<Actions>/redirectmenu/rename" "")
; (gtk_accel_path "<Actions>/RegionList/rlShowAuto" "")
(gtk_accel_path "<Actions>/Editor/select-all-before-playhead" "<%PRIMARY%>p")
; (gtk_accel_path "<Actions>/Main/Session" "")
@@ -231,7 +231,7 @@
; (gtk_accel_path "<Actions>/Editor/PullupMinus4" "")
(gtk_accel_path "<Actions>/Common/goto-mixer" "<%WINDOW%>m")
; (gtk_accel_path "<Actions>/RegionList/SortBySourceFileCreationDate" "")
-; (gtk_accel_path "<Actions>/processormenu/activate" "")
+; (gtk_accel_path "<Actions>/redirectmenu/activate" "")
(gtk_accel_path "<Actions>/Editor/extend-range-to-start-of-region" "leftanglebracket")
; (gtk_accel_path "<Actions>/Editor/PullupMinus1" "")
; (gtk_accel_path "<Actions>/Editor/snap-normal" "")
@@ -239,7 +239,7 @@
(gtk_accel_path "<Actions>/Common/ToggleKeyEditor" "<%WINDOW%>k")
; (gtk_accel_path "<Actions>/Snap/snap-to-asixteenthbeat" "")
(gtk_accel_path "<Actions>/Editor/select-all-in-punch-range" "<%PRIMARY%>d")
-; (gtk_accel_path "<Actions>/processormenu/edit" "")
+; (gtk_accel_path "<Actions>/redirectmenu/edit" "")
(gtk_accel_path "<Actions>/Editor/duplicate-region" "d")
(gtk_accel_path "<Actions>/Editor/multi-duplicate-region" "<%SECONDARY%>d")
; (gtk_accel_path "<Actions>/JACK/JACKLatency2048" "")
@@ -249,8 +249,8 @@
; (gtk_accel_path "<Actions>/options/FileHeaderFormatWAVE" "")
(gtk_accel_path "<Actions>/Transport/GotoZero" "KP_0")
(gtk_accel_path "<Actions>/Editor/select-all-after-edit-cursor" "<%TERTIARY%>End")
-; (gtk_accel_path "<Actions>/processormenu/cut" "")
-; (gtk_accel_path "<Actions>/processormenu/newinsert" "")
+; (gtk_accel_path "<Actions>/redirectmenu/cut" "")
+; (gtk_accel_path "<Actions>/redirectmenu/newinsert" "")
; (gtk_accel_path "<Actions>/options/UseMMC" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffOff" "")
;(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-object" "o")
@@ -295,7 +295,7 @@
; (gtk_accel_path "<Actions>/Editor/toggle-xfades-active" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-bar" "")
; (gtk_accel_path "<Actions>/Editor/LayerLaterHigher" "")
-; (gtk_accel_path "<Actions>/processormenu/selectall" "")
+; (gtk_accel_path "<Actions>/redirectmenu/selectall" "")
(gtk_accel_path "<Actions>/Editor/editor-copy" "<%PRIMARY%>c")
; (gtk_accel_path "<Actions>/Snap/snap-to-quarters" "")
(gtk_accel_path "<Actions>/Editor/temporal-zoom-out" "r")
@@ -306,12 +306,12 @@
; (gtk_accel_path "<Actions>/options/OutputAutoConnectManual" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-region-sync" "")
(gtk_accel_path "<Actions>/Editor/edit-cursor-to-previous-region-sync" "apostrophe")
-; (gtk_accel_path "<Actions>/processormenu/clear" "")
+; (gtk_accel_path "<Actions>/redirectmenu/clear" "")
; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurfaceFeedback" "")
; (gtk_accel_path "<Actions>/Editor/PullupPlus4Minus1" "")
; (gtk_accel_path "<Actions>/JACK/JACKLatency512" "")
; (gtk_accel_path "<Actions>/Main/Recent" "")
-; (gtk_accel_path "<Actions>/processormenu/newplugin" "")
+; (gtk_accel_path "<Actions>/redirectmenu/newplugin" "")
; (gtk_accel_path "<Actions>/options/InputAutoConnectManual" "")
; (gtk_accel_path "<Actions>/options/MeterHoldLong" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-seconds" "")
diff --git a/gtk2_ardour/mnemonic-us.bindings.in b/gtk2_ardour/mnemonic-us.bindings.in
index 27e6e9f259..d6df9078cc 100644
--- a/gtk2_ardour/mnemonic-us.bindings.in
+++ b/gtk2_ardour/mnemonic-us.bindings.in
@@ -98,7 +98,6 @@
(gtk_accel_path "<Actions>/Editor/undo" "<%PRIMARY%>z")
(gtk_accel_path "<Actions>/Editor/toggle-zoom" "<%TERTIARY%>z")
(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-zoom" "z")
-(gtk_accel_path "<Actions>/MouseMode/set-mouse-mode-note" "n")
(gtk_accel_path "<Actions>/Editor/editor-cut" "<%PRIMARY%>x")
(gtk_accel_path "<Actions>/Editor/editor-copy" "<%PRIMARY%>c")
(gtk_accel_path "<Actions>/Common/ToggleColorManager" "<%WINDOW%>c")
@@ -106,8 +105,8 @@
(gtk_accel_path "<Actions>/Editor/editor-paste" "<%PRIMARY%>v")
(gtk_accel_path "<Actions>/Editor/brush-at-mouse" "<%PRIMARY%>b")
(gtk_accel_path "<Actions>/Common/ToggleBigClock" "<%WINDOW%>b")
-(gtk_accel_path "<Actions>/Editor/normalize-region" "<%SECONDARY%>n")
-(gtk_accel_path "<Actions>/Editor/mute-unmute-region" "<%SECONDARY%>m")
+(gtk_accel_path "<Actions>/Editor/normalize-region" "n")
+(gtk_accel_path "<Actions>/Editor/mute-unmute-region" "m")
(gtk_accel_path "<Actions>/Common/toggle-editor-mixer-on-top" "<%WINDOW%>m")
;; arrow keys, navigation etc.
@@ -123,12 +122,14 @@
(gtk_accel_path "<Actions>/Editor/move-selected-tracks-down" "<%PRIMARY%>downarrow")
(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-boundary" "leftarrow")
+(gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-boundary-noselection" "<%LEVEL4%>leftarrow")
(gtk_accel_path "<Actions>/Editor/tab-to-transient-backwards" "<%PRIMARY%>leftarrow")
(gtk_accel_path "<Actions>/Editor/nudge-playhead-backward" "<%SECONDARY%>leftarrow")
(gtk_accel_path "<Actions>/Transport/Rewind" "<%TERTIARY%>leftarrow")
(gtk_accel_path "<Actions>/Editor/selected-marker-to-previous-region-boundary" "<%PRIMARY%><%TERTIARY%>leftarrow")
(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-boundary" "rightarrow")
+(gtk_accel_path "<Actions>/Editor/playhead-to-next-region-boundary-noselection" "<%LEVEL4%>rightarrow")
(gtk_accel_path "<Actions>/Editor/tab-to-transient-forwards" "<%PRIMARY%>rightarrow")
(gtk_accel_path "<Actions>/Editor/nudge-playhead-forward" "<%SECONDARY%>rightarrow")
(gtk_accel_path "<Actions>/Transport/Forward" "<%TERTIARY%>rightarrow")
@@ -229,7 +230,7 @@
; (gtk_accel_path "<Actions>/RegionList/RegionListSort" "")
; (gtk_accel_path "<Actions>/Main/Windows" "")
; (gtk_accel_path "<Actions>/Main/CleanupUnused" "")
-; (gtk_accel_path "<Actions>/processormenu/deselectall" "")
+; (gtk_accel_path "<Actions>/redirectmenu/deselectall" "")
; (gtk_accel_path "<Actions>/options/SoloViaBus" "")
; (gtk_accel_path "<Actions>/RegionList/rlAudition" "")
; (gtk_accel_path "<Actions>/Editor/PullupPlus4Plus1" "")
@@ -273,7 +274,7 @@
; (gtk_accel_path "<Actions>/options/InputAutoConnectPhysical" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-edit-cursor" "")
; (gtk_accel_path "<Actions>/JACK/Latency" "")
-; (gtk_accel_path "<Actions>/processormenu/rename" "")
+; (gtk_accel_path "<Actions>/redirectmenu/rename" "")
; (gtk_accel_path "<Actions>/RegionList/rlShowAuto" "")
; (gtk_accel_path "<Actions>/Main/Session" "")
; (gtk_accel_path "<Actions>/Main/AudioFileFormat" "")
@@ -291,17 +292,17 @@
; (gtk_accel_path "<Actions>/Editor/SnapMode" "")
; (gtk_accel_path "<Actions>/Editor/PullupMinus4" "")
; (gtk_accel_path "<Actions>/RegionList/SortBySourceFileCreationDate" "")
-; (gtk_accel_path "<Actions>/processormenu/activate" "")
+; (gtk_accel_path "<Actions>/redirectmenu/activate" "")
; (gtk_accel_path "<Actions>/Editor/PullupMinus1" "")
; (gtk_accel_path "<Actions>/Editor/snap-normal" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-asixteenthbeat" "")
-; (gtk_accel_path "<Actions>/processormenu/edit" "")
+; (gtk_accel_path "<Actions>/redirectmenu/edit" "")
; (gtk_accel_path "<Actions>/JACK/JACKLatency2048" "")
; (gtk_accel_path "<Actions>/Editor/ToggleWaveformsWhileRecording" "")
; (gtk_accel_path "<Actions>/Zoom/zoom-focus-right" "")
; (gtk_accel_path "<Actions>/options/FileHeaderFormatWAVE" "")
-; (gtk_accel_path "<Actions>/processormenu/cut" "")
-; (gtk_accel_path "<Actions>/processormenu/newinsert" "")
+; (gtk_accel_path "<Actions>/redirectmenu/cut" "")
+; (gtk_accel_path "<Actions>/redirectmenu/newinsert" "")
; (gtk_accel_path "<Actions>/options/UseMMC" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffOff" "")
; (gtk_accel_path "<Actions>/Editor/PullupMinus4Plus1" "")
@@ -335,18 +336,18 @@
; (gtk_accel_path "<Actions>/Editor/toggle-xfades-active" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-bar" "")
; (gtk_accel_path "<Actions>/Editor/LayerLaterHigher" "")
-; (gtk_accel_path "<Actions>/processormenu/selectall" "")
+; (gtk_accel_path "<Actions>/redirectmenu/selectall" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-quarters" "")
; (gtk_accel_path "<Actions>/options/UseSoftwareMonitoring" "")
; (gtk_accel_path "<Actions>/Editor/Subframes100" "")
-; (gtk_accel_path "<Actions>/processormenu/clear" "")
+; (gtk_accel_path "<Actions>/redirectmenu/clear" "")
; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurfaceFeedback" "")
; (gtk_accel_path "<Actions>/Editor/PullupPlus4Minus1" "")
; (gtk_accel_path "<Actions>/JACK/JACKLatency512" "")
; (gtk_accel_path "<Actions>/Main/Recent" "")
-; (gtk_accel_path "<Actions>/processormenu/newplugin" "")
+; (gtk_accel_path "<Actions>/redirectmenu/newplugin" "")
; (gtk_accel_path "<Actions>/options/InputAutoConnectManual" "")
; (gtk_accel_path "<Actions>/options/MeterHoldLong" "")
; (gtk_accel_path "<Actions>/Snap/snap-to-seconds" "")
@@ -357,12 +358,12 @@
; (gtk_accel_path "<Actions>/JACK/JACKReconnect" "")
; (gtk_accel_path "<Actions>/Editor/Autoconnect" "")
; (gtk_accel_path "<Actions>/Editor/Edit" "")
-; (gtk_accel_path "<Actions>/processormenu/copy" "")
+; (gtk_accel_path "<Actions>/redirectmenu/copy" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffFaster" "")
; (gtk_accel_path "<Actions>/RegionList/SortByRegionLength" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffSlowest" "")
; (gtk_accel_path "<Actions>/Editor/playhead-to-previous-region-sync" "")
-; (gtk_accel_path "<Actions>/processormenu/deactivate_all" "")
+; (gtk_accel_path "<Actions>/redirectmenu/deactivate_all" "")
; (gtk_accel_path "<Actions>/RegionList/SortByRegionPosition" "")
; (gtk_accel_path "<Actions>/Editor/ZoomFocus" "")
; (gtk_accel_path "<Actions>/options/MeterFalloffSlow" "")
@@ -371,7 +372,7 @@
; (gtk_accel_path "<Actions>/Zoom/zoom-focus-playhead" "")
; (gtk_accel_path "<Actions>/Editor/center-edit-cursor" "")
; (gtk_accel_path "<Actions>/Editor/Monitoring" "")
-; (gtk_accel_path "<Actions>/processormenu/deactivate" "")
+; (gtk_accel_path "<Actions>/redirectmenu/deactivate" "")
; (gtk_accel_path "<Actions>/options/LatchedRecordEnable" "")
; (gtk_accel_path "<Actions>/Transport/TogglePunchIn" "")
; (gtk_accel_path "<Actions>/ShuttleActions/SetShuttleUnitsPercentage" "")
@@ -418,8 +419,8 @@
; (gtk_accel_path "<Actions>/Editor/Smpte30drop" "")
; (gtk_accel_path "<Actions>/Zoom/zoom-focus-edit" "")
; (gtk_accel_path "<Actions>/Editor/EditCursorMovementOptions" "")
-; (gtk_accel_path "<Actions>/processormenu/activate_all" "")
-; (gtk_accel_path "<Actions>/processormenu/paste" "")
+; (gtk_accel_path "<Actions>/redirectmenu/activate_all" "")
+; (gtk_accel_path "<Actions>/redirectmenu/paste" "")
; (gtk_accel_path "<Actions>/Editor/Smpte25" "")
; (gtk_accel_path "<Actions>/options/RegionEquivalentsOverlap" "")
; (gtk_accel_path "<Actions>/Main/MeteringFallOffRate" "")
@@ -437,7 +438,7 @@
; (gtk_accel_path "<Actions>/Editor/snap-magnetic" "")
; (gtk_accel_path "<Actions>/Editor/playhead-to-range-end" "")
; (gtk_accel_path "<Actions>/Editor/EditSelectRegionOptions" "")
-; (gtk_accel_path "<Actions>/processormenu/newsend" "")
+; (gtk_accel_path "<Actions>/redirectmenu/newsend" "")
; (gtk_accel_path "<Actions>/Editor/ToggleGeneric MIDISurfaceSubMenu" "")
; (gtk_accel_path "<Actions>/Editor/MeterFalloff" "")
; (gtk_accel_path "<Actions>/RegionList/rlRemove" "")
diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc
index 36c5001816..e92da7f49a 100644
--- a/gtk2_ardour/plugin_ui.cc
+++ b/gtk2_ardour/plugin_ui.cc
@@ -136,8 +136,8 @@ PluginUIWindow::PluginUIWindow (Gtk::Window* win, boost::shared_ptr<PluginInsert
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window*> (this)), false);
- insert->GoingAway.connect (mem_fun(*this, &PluginUIWindow::plugin_going_away));
-
+ death_connection = insert->GoingAway.connect (mem_fun(*this, &PluginUIWindow::plugin_going_away));
+
gint h = _pluginui->get_preferred_height ();
gint w = _pluginui->get_preferred_width ();
@@ -155,6 +155,7 @@ PluginUIWindow::PluginUIWindow (Gtk::Window* win, boost::shared_ptr<PluginInsert
PluginUIWindow::~PluginUIWindow ()
{
+ delete _pluginui;
}
void
@@ -333,6 +334,9 @@ PluginUIWindow::plugin_going_away ()
if (_pluginui) {
_pluginui->stop_updating(0);
}
+
+ death_connection.disconnect ();
+
delete_when_idle (this);
}
@@ -383,6 +387,10 @@ PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi)
plugin_eq_bin.set_expanded(true);
}
+PlugUIBase::~PlugUIBase()
+{
+}
+
void
PlugUIBase::processor_active_changed (boost::weak_ptr<Processor> weak_p)
{
diff --git a/gtk2_ardour/plugin_ui.h b/gtk2_ardour/plugin_ui.h
index a920bfb07e..e074a9f7b0 100644
--- a/gtk2_ardour/plugin_ui.h
+++ b/gtk2_ardour/plugin_ui.h
@@ -71,7 +71,7 @@ class PlugUIBase : public virtual sigc::trackable
{
public:
PlugUIBase (boost::shared_ptr<ARDOUR::PluginInsert>);
- virtual ~PlugUIBase() {}
+ virtual ~PlugUIBase();
virtual gint get_preferred_height () = 0;
virtual gint get_preferred_width () = 0;
@@ -241,6 +241,7 @@ class PluginUIWindow : public Gtk::Window
private:
PlugUIBase* _pluginui;
+ sigc::connection death_connection;
Gtk::Window* parent;
Gtk::VBox vbox;
bool non_gtk_gui;
diff --git a/gtk2_ardour/vst_pluginui.cc b/gtk2_ardour/vst_pluginui.cc
index 99c7a1b82b..a31187264e 100644
--- a/gtk2_ardour/vst_pluginui.cc
+++ b/gtk2_ardour/vst_pluginui.cc
@@ -20,7 +20,7 @@
#include <fst.h>
#include <gtk/gtk.h>
#include <gtk/gtksocket.h>
-#include "ardour/processor.h"
+#include "ardour/insert.h"
#include "ardour/vst_plugin.h"
#include "plugin_ui.h"
@@ -35,24 +35,36 @@ VSTPluginUI::VSTPluginUI (boost::shared_ptr<PluginInsert> pi, boost::shared_ptr<
: PlugUIBase (pi),
vst (vp)
{
+ create_preset_store ();
+
fst_run_editor (vst->fst());
+ preset_box.set_spacing (6);
+ preset_box.set_border_width (6);
preset_box.pack_end (bypass_button, false, false, 10);
preset_box.pack_end (save_button, false, false);
- preset_box.pack_end (preset_combo, false, false);
- preset_box.pack_end (eqgui_toggle, false, false);
+ preset_box.pack_end (vst_preset_combo, false, false);
+ vst_preset_combo.signal_changed().connect (mem_fun (*this, &VSTPluginUI::preset_chosen));
bypass_button.set_active (!insert->active());
pack_start (preset_box, false, false);
pack_start (socket, true, true);
- pack_start (plugin_eq_bin, true, true);
}
VSTPluginUI::~VSTPluginUI ()
{
- // nothing to do here - plugin destructor destroys the GUI
+ // plugin destructor destroys the custom GUI, via Windows fun-and-games,
+ // and then our PluginUIWindow does the rest
+}
+
+void
+VSTPluginUI::preset_chosen ()
+{
+ // we can't dispatch directly here, too many plugins only expects one GUI thread.
+ vst->fst()->want_program = vst_preset_combo.get_active_row_number ();
+ socket.grab_focus ();
}
int
@@ -124,28 +136,68 @@ VSTPluginUI::configure_handler (GdkEventConfigure* ev, Gtk::Socket *socket)
return false;
}
+void
+VSTPluginUI::create_preset_store ()
+{
+ FST *fst = vst->fst();
+ int vst_version = fst->plugin->dispatcher (fst->plugin, effGetVstVersion, 0, 0, NULL, 0.0f);
+
+ preset_model = ListStore::create (preset_columns);
+
+ for (int i = 0; i < fst->plugin->numPrograms; ++i) {
+ char buf[100];
+ TreeModel::Row row = *(preset_model->append());
+
+ snprintf (buf, 90, "preset %d", i);
+
+ if (vst_version >= 2) {
+ fst->plugin->dispatcher (fst->plugin, 29, i, 0, buf, 0.0);
+ }
+
+ row[preset_columns.name] = buf;
+ row[preset_columns.number] = i;
+ }
+
+ if (fst->plugin->numPrograms > 0) {
+ fst->plugin->dispatcher( fst->plugin, effSetProgram, 0, 0, NULL, 0.0 );
+ }
+
+ vst_preset_combo.set_model (preset_model);
+
+ CellRenderer* renderer = manage (new CellRendererText());
+ vst_preset_combo.pack_start (*renderer, true);
+ vst_preset_combo.add_attribute (*renderer, "text", 0);
+
+ if (vst->fst()->current_program != -1) {
+ vst_preset_combo.set_active (vst->fst()->current_program);
+ } else {
+ vst_preset_combo.set_active (0);
+ }
+}
+
typedef int (*error_handler_t)( Display *, XErrorEvent *);
static Display *the_gtk_display;
static error_handler_t wine_error_handler;
static error_handler_t gtk_error_handler;
-static int
+static int
fst_xerror_handler( Display *disp, XErrorEvent *ev )
{
- if (disp == the_gtk_display) {
- printf ("relaying error to gtk\n");
- return gtk_error_handler (disp, ev);
- } else {
- printf( "relaying error to wine\n" );
- return wine_error_handler (disp, ev);
- }
+ if (disp == the_gtk_display) {
+ printf ("relaying error to gtk\n");
+ return gtk_error_handler (disp, ev);
+ } else {
+ printf( "relaying error to wine\n" );
+ return wine_error_handler (disp, ev);
+ }
}
void
gui_init (int *argc, char **argv[])
{
- wine_error_handler = XSetErrorHandler (NULL);
- gtk_init (argc, argv);
- the_gtk_display = gdk_x11_display_get_xdisplay (gdk_display_get_default());
- gtk_error_handler = XSetErrorHandler( fst_xerror_handler );
+ wine_error_handler = XSetErrorHandler (NULL);
+ gtk_init (argc, argv);
+ the_gtk_display = gdk_x11_display_get_xdisplay (gdk_display_get_default());
+ gtk_error_handler = XSetErrorHandler( fst_xerror_handler );
}
+
diff --git a/libs/ardour/ardour/audio_unit.h b/libs/ardour/ardour/audio_unit.h
index a356da81ca..e023979ed8 100644
--- a/libs/ardour/ardour/audio_unit.h
+++ b/libs/ardour/ardour/audio_unit.h
@@ -28,6 +28,7 @@
#include <set>
#include <string>
#include <vector>
+#include <map>
#include "ardour/plugin.h"
@@ -63,13 +64,13 @@ class AUPlugin : public ARDOUR::Plugin
AUPlugin (const AUPlugin& other);
virtual ~AUPlugin ();
- std::string unique_id () const;
+ std::string unique_id () const;
const char * label () const;
const char * name () const { return _info->name.c_str(); }
const char * maker () const { return _info->creator.c_str(); }
uint32_t parameter_count () const;
float default_value (uint32_t port);
- nframes_t signal_latency () const;
+ nframes_t latency () const;
void set_parameter (uint32_t which, float val);
float get_parameter (uint32_t which) const;
@@ -79,8 +80,7 @@ class AUPlugin : public ARDOUR::Plugin
void deactivate ();
void set_block_size (nframes_t nframes);
- int connect_and_run (BufferSet& bufs, uint32_t& in, uint32_t& out, nframes_t nframes, nframes_t offset);
-
+ int connect_and_run (vector<Sample*>& bufs, uint32_t maxbuf, int32_t& in, int32_t& out, nframes_t nframes, nframes_t offset);
std::set<uint32_t> automatable() const;
string describe_parameter (uint32_t);
string state_node_name () const { return "audiounit"; }
@@ -97,15 +97,14 @@ class AUPlugin : public ARDOUR::Plugin
bool save_preset (string name);
bool load_preset (const string preset_label);
std::vector<std::string> get_presets ();
-
+ std::string current_preset() const;
+
bool has_editor () const;
- bool reconfigurable_io() const { return true; }
- bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
- int32_t count_for_configuration (const ChanCount& in, ChanCount out) const;
- bool configure_io (ChanCount in, ChanCount& out);
- ChanCount output_streams() const;
- ChanCount input_streams() const;
+ int32_t can_do (int32_t in, int32_t& out);
+ uint32_t output_streams() const;
+ uint32_t input_streams() const;
+ int32_t configure_io (int32_t in, int32_t out);
boost::shared_ptr<CAAudioUnit> get_au () { return unit; }
boost::shared_ptr<CAComponent> get_comp () const { return comp; }
@@ -118,13 +117,18 @@ class AUPlugin : public ARDOUR::Plugin
private:
boost::shared_ptr<CAComponent> comp;
boost::shared_ptr<CAAudioUnit> unit;
-
+
bool initialized;
int32_t input_channels;
int32_t output_channels;
std::vector<std::pair<int,int> > io_configs;
AudioBufferList* buffers;
-
+
+ /* XXX this should really be shared across all AUPlugin instances */
+
+ typedef std::map<std::string,std::string> PresetMap;
+ PresetMap preset_map;
+
UInt32 global_elements;
UInt32 output_elements;
UInt32 input_elements;
@@ -144,7 +148,6 @@ class AUPlugin : public ARDOUR::Plugin
std::vector<AUParameterDescriptor> descriptors;
void init ();
-
};
typedef boost::shared_ptr<AUPlugin> AUPluginPtr;
@@ -171,9 +174,10 @@ class AUPluginInfo : public PluginInfo {
private:
boost::shared_ptr<CAComponentDescription> descriptor;
UInt32 version;
-
+
static void discover_music (PluginInfoList&);
static void discover_fx (PluginInfoList&);
+ static void discover_generators (PluginInfoList&);
static void discover_by_description (PluginInfoList&, CAComponentDescription&);
static Glib::ustring au_cache_path ();
diff --git a/libs/ardour/ardour/audioanalyser.h b/libs/ardour/ardour/audioanalyser.h
index fefcd23a0e..824e63d312 100644
--- a/libs/ardour/ardour/audioanalyser.h
+++ b/libs/ardour/ardour/audioanalyser.h
@@ -24,7 +24,7 @@
#include <string>
#include <ostream>
#include <fstream>
-#include <vamp-sdk/Plugin.h>
+#include "vamp-sdk/Plugin.h"
#include <boost/utility.hpp>
#include "ardour/audioregion.h"
diff --git a/libs/ardour/ardour/chan_count.h b/libs/ardour/ardour/chan_count.h
index 38cc04b977..ff70be6bb6 100644
--- a/libs/ardour/ardour/chan_count.h
+++ b/libs/ardour/ardour/chan_count.h
@@ -20,6 +20,8 @@
#ifndef __ardour_chan_count_h__
#define __ardour_chan_count_h__
+#include <ostream>
+
#include "ardour/data_type.h"
#include <cassert>
@@ -109,8 +111,9 @@ private:
uint32_t _counts[DataType::num_types];
};
-
} // namespace ARDOUR
+std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanCount& c);
+
#endif // __ardour_chan_count_h__
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 6114cf8062..dc43e08a2d 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -1054,6 +1054,10 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
void process_export (nframes_t);
int process_export_fw (nframes_t);
+ void block_processing() { g_atomic_int_set (&processing_prohibited, 1); }
+ void unblock_processing() { g_atomic_int_set (&processing_prohibited, 0); }
+ bool processing_blocked() const { return g_atomic_int_get (&processing_prohibited); }
+
/* slave tracking */
static const int delta_accumulator_size = 25;
diff --git a/libs/ardour/audio_unit.cc b/libs/ardour/audio_unit.cc
index f837ff8832..0d069c0c23 100644
--- a/libs/ardour/audio_unit.cc
+++ b/libs/ardour/audio_unit.cc
@@ -18,10 +18,13 @@
*/
#include <sstream>
+#include <errno.h>
+#include <string.h>
#include "pbd/transmitter.h"
#include "pbd/xml++.h"
#include "pbd/whitespace.h"
+#include "pbd/pathscanner.h"
#include <glibmm/thread.h>
#include <glibmm/fileutils.h>
@@ -37,8 +40,8 @@
#include <appleutility/CAAudioUnit.h>
#include <appleutility/CAAUParameter.h>
+#include <CoreFoundation/CoreFoundation.h>
#include <CoreServices/CoreServices.h>
-#include <AudioUnit/AudioUnit.h>
#include "i18n.h"
@@ -46,8 +49,19 @@ using namespace std;
using namespace PBD;
using namespace ARDOUR;
+#ifndef AU_STATE_SUPPORT
+static bool seen_get_state_message = false;
+static bool seen_set_state_message = false;
+static bool seen_loading_message = false;
+static bool seen_saving_message = false;
+#endif
+
AUPluginInfo::CachedInfoMap AUPluginInfo::cached_info;
+static string preset_search_path = "/Library/Audio/Presets:/Network/Library/Audio/Presets";
+static string preset_suffix = ".aupreset";
+static bool preset_search_path_initialized = false;
+
static OSStatus
_render_callback(void *userData,
AudioUnitRenderActionFlags *ioActionFlags,
@@ -59,6 +73,212 @@ _render_callback(void *userData,
return ((AUPlugin*)userData)->render_callback (ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, ioData);
}
+static int
+save_property_list (CFPropertyListRef propertyList, Glib::ustring path)
+
+{
+ CFDataRef xmlData;
+ int fd;
+
+ // Convert the property list into XML data.
+
+ xmlData = CFPropertyListCreateXMLData( kCFAllocatorDefault, propertyList);
+
+ if (!xmlData) {
+ error << _("Could not create XML version of property list") << endmsg;
+ return -1;
+ }
+
+ // Write the XML data to the file.
+
+ fd = open (path.c_str(), O_WRONLY|O_CREAT|O_EXCL, 0664);
+ while (fd < 0) {
+ if (errno == EEXIST) {
+ /* tell any UI's that this file already exists and ask them what to do */
+ bool overwrite = Plugin::PresetFileExists(); // EMIT SIGNAL
+ if (overwrite) {
+ fd = open (path.c_str(), O_WRONLY, 0664);
+ continue;
+ } else {
+ return 0;
+ }
+ }
+ error << string_compose (_("Cannot open preset file %1 (%2)"), path, strerror (errno)) << endmsg;
+ CFRelease (xmlData);
+ return -1;
+ }
+
+ size_t cnt = CFDataGetLength (xmlData);
+
+ if (write (fd, CFDataGetBytePtr (xmlData), cnt) != cnt) {
+ CFRelease (xmlData);
+ close (fd);
+ return -1;
+ }
+
+ close (fd);
+ return 0;
+}
+
+
+static CFPropertyListRef
+load_property_list (Glib::ustring path)
+{
+ int fd;
+ CFPropertyListRef propertyList;
+ CFDataRef xmlData;
+ CFStringRef errorString;
+
+ // Read the XML file.
+
+ if ((fd = open (path.c_str(), O_RDONLY)) < 0) {
+ return propertyList;
+
+ }
+
+ off_t len = lseek (fd, 0, SEEK_END);
+ char* buf = new char[len];
+ lseek (fd, 0, SEEK_SET);
+
+ if (read (fd, buf, len) != len) {
+ delete [] buf;
+ close (fd);
+ return propertyList;
+ }
+
+ close (fd);
+
+ xmlData = CFDataCreateWithBytesNoCopy (kCFAllocatorDefault, (UInt8*) buf, len, kCFAllocatorNull);
+
+ // Reconstitute the dictionary using the XML data.
+
+ propertyList = CFPropertyListCreateFromXMLData( kCFAllocatorDefault,
+ xmlData,
+ kCFPropertyListImmutable,
+ &errorString);
+
+ CFRelease (xmlData);
+ delete [] buf;
+
+ return propertyList;
+}
+
+//-----------------------------------------------------------------------------
+static void
+set_preset_name_in_plist (CFPropertyListRef plist, string preset_name)
+{
+ if (!plist) {
+ return;
+ }
+ CFStringRef pn = CFStringCreateWithCString (kCFAllocatorDefault, preset_name.c_str(), kCFStringEncodingUTF8);
+
+ if (CFGetTypeID (plist) == CFDictionaryGetTypeID()) {
+ CFDictionarySetValue ((CFMutableDictionaryRef)plist, CFSTR(kAUPresetNameKey), pn);
+ }
+
+ CFRelease (pn);
+}
+
+//-----------------------------------------------------------------------------
+static std::string
+get_preset_name_in_plist (CFPropertyListRef plist)
+{
+ std::string ret;
+
+ if (!plist) {
+ return ret;
+ }
+
+ if (CFGetTypeID (plist) == CFDictionaryGetTypeID()) {
+ const void *p = CFDictionaryGetValue ((CFMutableDictionaryRef)plist, CFSTR(kAUPresetNameKey));
+ if (p) {
+ CFStringRef str = (CFStringRef) p;
+ int len = CFStringGetLength(str);
+ len = (len * 2) + 1;
+ char local_buffer[len];
+ if (CFStringGetCString (str, local_buffer, len, kCFStringEncodingUTF8)) {
+ ret = local_buffer;
+ }
+ }
+ }
+ return ret;
+}
+
+//--------------------------------------------------------------------------
+// general implementation for ComponentDescriptionsMatch() and ComponentDescriptionsMatch_Loosely()
+// if inIgnoreType is true, then the type code is ignored in the ComponentDescriptions
+Boolean ComponentDescriptionsMatch_General(const ComponentDescription * inComponentDescription1, const ComponentDescription * inComponentDescription2, Boolean inIgnoreType);
+Boolean ComponentDescriptionsMatch_General(const ComponentDescription * inComponentDescription1, const ComponentDescription * inComponentDescription2, Boolean inIgnoreType)
+{
+ if ( (inComponentDescription1 == NULL) || (inComponentDescription2 == NULL) )
+ return FALSE;
+
+ if ( (inComponentDescription1->componentSubType == inComponentDescription2->componentSubType)
+ && (inComponentDescription1->componentManufacturer == inComponentDescription2->componentManufacturer) )
+ {
+ // only sub-type and manufacturer IDs need to be equal
+ if (inIgnoreType)
+ return TRUE;
+ // type, sub-type, and manufacturer IDs all need to be equal in order to call this a match
+ else if (inComponentDescription1->componentType == inComponentDescription2->componentType)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+//--------------------------------------------------------------------------
+// general implementation for ComponentAndDescriptionMatch() and ComponentAndDescriptionMatch_Loosely()
+// if inIgnoreType is true, then the type code is ignored in the ComponentDescriptions
+Boolean ComponentAndDescriptionMatch_General(Component inComponent, const ComponentDescription * inComponentDescription, Boolean inIgnoreType);
+Boolean ComponentAndDescriptionMatch_General(Component inComponent, const ComponentDescription * inComponentDescription, Boolean inIgnoreType)
+{
+ OSErr status;
+ ComponentDescription desc;
+
+ if ( (inComponent == NULL) || (inComponentDescription == NULL) )
+ return FALSE;
+
+ // get the ComponentDescription of the input Component
+ status = GetComponentInfo(inComponent, &desc, NULL, NULL, NULL);
+ if (status != noErr)
+ return FALSE;
+
+ // check if the Component's ComponentDescription matches the input ComponentDescription
+ return ComponentDescriptionsMatch_General(&desc, inComponentDescription, inIgnoreType);
+}
+
+//--------------------------------------------------------------------------
+// determine if 2 ComponentDescriptions are basically equal
+// (by that, I mean that the important identifying values are compared,
+// but not the ComponentDescription flags)
+Boolean ComponentDescriptionsMatch(const ComponentDescription * inComponentDescription1, const ComponentDescription * inComponentDescription2)
+{
+ return ComponentDescriptionsMatch_General(inComponentDescription1, inComponentDescription2, FALSE);
+}
+
+//--------------------------------------------------------------------------
+// determine if 2 ComponentDescriptions have matching sub-type and manufacturer codes
+Boolean ComponentDescriptionsMatch_Loose(const ComponentDescription * inComponentDescription1, const ComponentDescription * inComponentDescription2)
+{
+ return ComponentDescriptionsMatch_General(inComponentDescription1, inComponentDescription2, TRUE);
+}
+
+//--------------------------------------------------------------------------
+// determine if a ComponentDescription basically matches that of a particular Component
+Boolean ComponentAndDescriptionMatch(Component inComponent, const ComponentDescription * inComponentDescription)
+{
+ return ComponentAndDescriptionMatch_General(inComponent, inComponentDescription, FALSE);
+}
+
+//--------------------------------------------------------------------------
+// determine if a ComponentDescription matches only the sub-type and manufacturer codes of a particular Component
+Boolean ComponentAndDescriptionMatch_Loosely(Component inComponent, const ComponentDescription * inComponentDescription)
+{
+ return ComponentAndDescriptionMatch_General(inComponent, inComponentDescription, TRUE);
+}
+
+
AUPlugin::AUPlugin (AudioEngine& engine, Session& session, boost::shared_ptr<CAComponent> _comp)
: Plugin (engine, session),
comp (_comp),
@@ -70,6 +290,14 @@ AUPlugin::AUPlugin (AudioEngine& engine, Session& session, boost::shared_ptr<CAC
current_buffers (0),
frames_processed (0)
{
+ if (!preset_search_path_initialized) {
+ Glib::ustring p = Glib::get_home_dir();
+ p += "/Library/Audio/Presets:";
+ p += preset_search_path;
+ preset_search_path = p;
+ preset_search_path_initialized = true;
+ }
+
init ();
}
@@ -109,7 +337,6 @@ AUPlugin::init ()
err = CAAudioUnit::Open (*(comp.get()), *unit);
} catch (...) {
error << _("Exception thrown during AudioUnit plugin loading - plugin ignored") << endmsg;
- cerr << _("Exception thrown during AudioUnit plugin loading - plugin ignored") << endl;
throw failed_constructor();
}
@@ -293,12 +520,8 @@ AUPlugin::default_value (uint32_t port)
}
nframes_t
-AUPlugin::signal_latency () const
+AUPlugin::latency () const
{
- if (_user_latency) {
- return _user_latency;
- }
-
return unit->Latency() * _session.frame_rate();
}
@@ -378,6 +601,7 @@ AUPlugin::_set_block_size (nframes_t nframes)
if (initialized) {
unit->Uninitialize ();
+ initialized = false;
}
if ((err = unit->SetProperty (kAudioUnitProperty_MaximumFramesPerSlice, kAudioUnitScope_Global,
@@ -394,7 +618,7 @@ AUPlugin::_set_block_size (nframes_t nframes)
}
int32_t
-AUPlugin::configure_io (ChanCount in, ChanCount out)
+AUPlugin::configure_io (int32_t in, int32_t out)
{
AudioStreamBasicDescription streamFormat;
@@ -417,13 +641,13 @@ AUPlugin::configure_io (ChanCount in, ChanCount out)
streamFormat.mBytesPerPacket = 4;
streamFormat.mBytesPerFrame = 4;
- streamFormat.mChannelsPerFrame = in.n_audio();
+ streamFormat.mChannelsPerFrame = in;
if (set_input_format (streamFormat) != 0) {
return -1;
}
- streamFormat.mChannelsPerFrame = out.n_audio();
+ streamFormat.mChannelsPerFrame = out;
if (set_output_format (streamFormat) != 0) {
return -1;
@@ -432,22 +656,16 @@ AUPlugin::configure_io (ChanCount in, ChanCount out)
return Plugin::configure_io (in, out);
}
-bool
-AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out)
-{
- int32_t ret = count_for_configuration (in, out);
- return ret >= 0;
-}
-
int32_t
-AUPlugin::count_for_configuration(ChanCount cin, ChanCount& out) const
+AUPlugin::can_do (int32_t in, int32_t& out)
{
// XXX as of May 13th 2008, AU plugin support returns a count of either 1 or -1. We never
// attempt to multiply-instantiate plugins to meet io configurations.
int32_t plugcnt = -1;
AUPluginInfoPtr pinfo = boost::dynamic_pointer_cast<AUPluginInfo>(get_info());
- int32_t in = cin.n_audio(); /* XXX handle MIDI one day ??? */
+
+ out = -1;
vector<pair<int,int> >& io_configs = pinfo->cache.io_configs;
@@ -468,19 +686,19 @@ AUPlugin::count_for_configuration(ChanCount cin, ChanCount& out) const
if (possible_out == -1) {
/* out much match in (UNLIKELY!!) */
- out.set (DataType::AUDIO, in);
+ out = in;
plugcnt = 1;
} else if (possible_out == -2) {
/* any configuration possible, pick matching */
- out.set (DataType::AUDIO, in);
+ out = in;
plugcnt = 1;
} else if (possible_out < -2) {
/* explicit variable number of outputs, pick maximum */
- out.set (DataType::AUDIO, -possible_out);
+ out = -possible_out;
plugcnt = 1;
} else {
/* exact number of outputs */
- out.set (DataType::AUDIO, possible_out);
+ out = possible_out;
plugcnt = 1;
}
}
@@ -491,19 +709,19 @@ AUPlugin::count_for_configuration(ChanCount cin, ChanCount& out) const
if (possible_out == -1) {
/* out much match in */
- out.set (DataType::AUDIO, in);
+ out = in;
plugcnt = 1;
} else if (possible_out == -2) {
/* any configuration possible, pick matching */
- out.set (DataType::AUDIO, in);
+ out = in;
plugcnt = 1;
} else if (possible_out < -2) {
/* explicit variable number of outputs, pick maximum */
- out.set (DataType::AUDIO, -possible_out);
+ out = -possible_out;
plugcnt = 1;
} else {
/* exact number of outputs */
- out.set (DataType::AUDIO, possible_out);
+ out = possible_out;
plugcnt = 1;
}
}
@@ -512,7 +730,7 @@ AUPlugin::count_for_configuration(ChanCount cin, ChanCount& out) const
if (possible_out == -1) {
/* any configuration possible, pick matching */
- out.set (DataType::AUDIO, in);
+ out = in;
plugcnt = 1;
} else if (possible_out == -2) {
error << string_compose (_("AU plugin %1 has illegal IO configuration (-2,-2)"), name())
@@ -520,11 +738,11 @@ AUPlugin::count_for_configuration(ChanCount cin, ChanCount& out) const
plugcnt = -1;
} else if (possible_out < -2) {
/* explicit variable number of outputs, pick maximum */
- out.set (DataType::AUDIO, -possible_out);
+ out = -possible_out;
plugcnt = 1;
} else {
/* exact number of outputs */
- out.set (DataType::AUDIO, possible_out);
+ out = possible_out;
plugcnt = 1;
}
}
@@ -540,7 +758,7 @@ AUPlugin::count_for_configuration(ChanCount cin, ChanCount& out) const
if (possible_out == -1) {
/* out must match in */
- out.set (DataType::AUDIO, in);
+ out = in;
plugcnt = 1;
} else if (possible_out == -2) {
error << string_compose (_("AU plugin %1 has illegal IO configuration (-2,-2)"), name())
@@ -548,11 +766,11 @@ AUPlugin::count_for_configuration(ChanCount cin, ChanCount& out) const
plugcnt = -1;
} else if (possible_out < -2) {
/* explicit variable number of outputs, pick maximum */
- out.set (DataType::AUDIO, -possible_out);
+ out = -possible_out;
plugcnt = 1;
} else {
/* exact number of outputs */
- out.set (DataType::AUDIO, possible_out);
+ out = possible_out;
plugcnt = 1;
}
}
@@ -563,19 +781,19 @@ AUPlugin::count_for_configuration(ChanCount cin, ChanCount& out) const
if (possible_out == -1) {
/* out must match in */
- out.set (DataType::AUDIO, in);
+ out = in;
plugcnt = 1;
} else if (possible_out == -2) {
/* any output configuration, pick matching */
- out.set (DataType::AUDIO, in);
+ out = in;
plugcnt = -1;
} else if (possible_out < -2) {
/* explicit variable number of outputs, pick maximum */
- out.set (DataType::AUDIO, -possible_out);
+ out = -possible_out;
plugcnt = 1;
} else {
/* exact number of outputs */
- out.set (DataType::AUDIO, possible_out);
+ out = possible_out;
plugcnt = 1;
}
}
@@ -608,7 +826,7 @@ AUPlugin::set_output_format (AudioStreamBasicDescription& fmt)
fmt.mChannelsPerFrame * sizeof(AudioBuffer));
Glib::Mutex::Lock em (_session.engine().process_lock());
- IO::PortCountChanged (ChanCount (DataType::AUDIO, fmt.mChannelsPerFrame));
+ IO::MoreOutputs (fmt.mChannelsPerFrame);
return 0;
}
@@ -635,36 +853,25 @@ AUPlugin::set_stream_format (int scope, uint32_t cnt, AudioStreamBasicDescriptio
return 0;
}
-
-ChanCount
+uint32_t
AUPlugin::input_streams() const
{
- ChanCount in;
-
if (input_channels < 0) {
warning << string_compose (_("AUPlugin: %1 input_streams() called without any format set!"), name()) << endmsg;
- in.set_audio (1);
- } else {
- in.set_audio (input_channels);
+ return 1;
}
-
- return in;
+ return input_channels;
}
-ChanCount
+uint32_t
AUPlugin::output_streams() const
{
- ChanCount out;
-
if (output_channels < 0) {
warning << string_compose (_("AUPlugin: %1 output_streams() called without any format set!"), name()) << endmsg;
- out.set_audio (1);
- } else {
- out.set_audio (output_channels);
+ return 1;
}
-
- return out;
+ return output_channels;
}
OSStatus
@@ -783,33 +990,406 @@ AUPlugin::parameter_is_output (uint32_t) const
XMLNode&
AUPlugin::get_state()
{
- XMLNode *root = new XMLNode (state_node_name());
LocaleGuard lg (X_("POSIX"));
+ XMLNode *root = new XMLNode (state_node_name());
+
+#ifdef AU_STATE_SUPPORT
+ CFDataRef xmlData;
+ CFPropertyListRef propertyList;
+
+ if (unit->GetAUPreset (propertyList) != noErr) {
+ return *root;
+ }
+
+ // Convert the property list into XML data.
+
+ xmlData = CFPropertyListCreateXMLData( kCFAllocatorDefault, propertyList);
+
+ if (!xmlData) {
+ error << _("Could not create XML version of property list") << endmsg;
+ return *root;
+ }
+
+ /* re-parse XML bytes to create a libxml++ XMLTree that we can merge into
+ our state node. GACK!
+ */
+
+ XMLTree t;
+
+ if (t.read_buffer (string ((const char*) CFDataGetBytePtr (xmlData), CFDataGetLength (xmlData)))) {
+ if (t.root()) {
+ root->add_child_copy (*t.root());
+ }
+ }
+
+ CFRelease (xmlData);
+ CFRelease (propertyList);
+#else
+ if (!seen_get_state_message) {
+ info << _("Saving AudioUnit settings is not supported in this build of Ardour. Consider paying for a newer version")
+ << endmsg;
+ seen_get_state_message = true;
+ }
+#endif
+
return *root;
}
int
AUPlugin::set_state(const XMLNode& node)
{
- return -1;
+#ifdef AU_STATE_SUPPORT
+ int ret = -1;
+ CFPropertyListRef propertyList;
+ LocaleGuard lg (X_("POSIX"));
+
+ if (node.name() != state_node_name()) {
+ error << _("Bad node sent to AUPlugin::set_state") << endmsg;
+ return -1;
+ }
+
+ if (node.children().empty()) {
+ return -1;
+ }
+
+ XMLNode* top = node.children().front();
+ XMLNode* copy = new XMLNode (*top);
+
+ XMLTree t;
+ t.set_root (copy);
+
+ const string& xml = t.write_buffer ();
+ CFDataRef xmlData = CFDataCreateWithBytesNoCopy (kCFAllocatorDefault, (UInt8*) xml.data(), xml.length(), kCFAllocatorNull);
+ CFStringRef errorString;
+
+ propertyList = CFPropertyListCreateFromXMLData( kCFAllocatorDefault,
+ xmlData,
+ kCFPropertyListImmutable,
+ &errorString);
+
+ CFRelease (xmlData);
+
+ if (propertyList) {
+ if (unit->SetAUPreset (propertyList) == noErr) {
+ ret = 0;
+ }
+ CFRelease (propertyList);
+ }
+
+ return ret;
+#else
+ if (!seen_set_state_message) {
+ info << _("Restoring AudioUnit settings is not supported in this build of Ardour. Consider paying for a newer version")
+ << endmsg;
+ }
+ return 0;
+#endif
}
bool
-AUPlugin::save_preset (string name)
+AUPlugin::load_preset (const string preset_label)
{
- return false;
+#ifdef AU_STATE_SUPPORT
+ bool ret = false;
+ CFPropertyListRef propertyList;
+ Glib::ustring path;
+ PresetMap::iterator x = preset_map.find (preset_label);
+
+ if (x == preset_map.end()) {
+ return false;
+ }
+
+ if ((propertyList = load_property_list (x->second)) != 0) {
+ if (unit->SetAUPreset (propertyList) == noErr) {
+ ret = true;
+ }
+ CFRelease(propertyList);
+ }
+
+ return ret;
+#else
+ if (!seen_loading_message) {
+ info << _("Loading AudioUnit presets is not supported in this build of Ardour. Consider paying for a newer version")
+ << endmsg;
+ seen_loading_message = true;
+ }
+ return true;
+#endif
}
bool
-AUPlugin::load_preset (const string preset_label)
+AUPlugin::save_preset (string preset_name)
{
+#ifdef AU_STATE_SUPPORT
+ CFPropertyListRef propertyList;
+ vector<Glib::ustring> v;
+ Glib::ustring user_preset_path;
+ bool ret = true;
+
+ std::string m = maker();
+ std::string n = name();
+
+ strip_whitespace_edges (m);
+ strip_whitespace_edges (n);
+
+ v.push_back (Glib::get_home_dir());
+ v.push_back ("Library");
+ v.push_back ("Audio");
+ v.push_back ("Presets");
+ v.push_back (m);
+ v.push_back (n);
+
+ user_preset_path = Glib::build_filename (v);
+
+ if (g_mkdir_with_parents (user_preset_path.c_str(), 0775) < 0) {
+ error << string_compose (_("Cannot create user plugin presets folder (%1)"), user_preset_path) << endmsg;
+ return false;
+ }
+
+ if (unit->GetAUPreset (propertyList) != noErr) {
+ return false;
+ }
+
+ // add the actual preset name */
+
+ v.push_back (preset_name + preset_suffix);
+
+ // rebuild
+
+ user_preset_path = Glib::build_filename (v);
+
+ set_preset_name_in_plist (propertyList, preset_name);
+
+ if (save_property_list (propertyList, user_preset_path)) {
+ error << string_compose (_("Saving plugin state to %1 failed"), user_preset_path) << endmsg;
+ ret = false;
+ }
+
+ CFRelease(propertyList);
+
+ return ret;
+#else
+ if (!seen_saving_message) {
+ info << _("Saving AudioUnit presets is not supported in this build of Ardour. Consider paying for a newer version")
+ << endmsg;
+ seen_saving_message = true;
+ }
return false;
+#endif
}
-vector<Plugin::PresetRecord>
+//-----------------------------------------------------------------------------
+// this is just a little helper function used by GetAUComponentDescriptionFromPresetFile()
+static SInt32
+GetDictionarySInt32Value(CFDictionaryRef inAUStateDictionary, CFStringRef inDictionaryKey, Boolean * outSuccess)
+{
+ CFNumberRef cfNumber;
+ SInt32 numberValue = 0;
+ Boolean dummySuccess;
+
+ if (outSuccess == NULL)
+ outSuccess = &dummySuccess;
+ if ( (inAUStateDictionary == NULL) || (inDictionaryKey == NULL) )
+ {
+ *outSuccess = FALSE;
+ return 0;
+ }
+
+ cfNumber = (CFNumberRef) CFDictionaryGetValue(inAUStateDictionary, inDictionaryKey);
+ if (cfNumber == NULL)
+ {
+ *outSuccess = FALSE;
+ return 0;
+ }
+ *outSuccess = CFNumberGetValue(cfNumber, kCFNumberSInt32Type, &numberValue);
+ if (*outSuccess)
+ return numberValue;
+ else
+ return 0;
+}
+
+static OSStatus
+GetAUComponentDescriptionFromStateData(CFPropertyListRef inAUStateData, ComponentDescription * outComponentDescription)
+{
+ CFDictionaryRef auStateDictionary;
+ ComponentDescription tempDesc = {0};
+ SInt32 versionValue;
+ Boolean gotValue;
+
+ if ( (inAUStateData == NULL) || (outComponentDescription == NULL) )
+ return paramErr;
+
+ // the property list for AU state data must be of the dictionary type
+ if (CFGetTypeID(inAUStateData) != CFDictionaryGetTypeID()) {
+ return kAudioUnitErr_InvalidPropertyValue;
+ }
+
+ auStateDictionary = (CFDictionaryRef)inAUStateData;
+
+ // first check to make sure that the version of the AU state data is one that we know understand
+ // XXX should I really do this? later versions would probably still hold these ID keys, right?
+ versionValue = GetDictionarySInt32Value(auStateDictionary, CFSTR(kAUPresetVersionKey), &gotValue);
+
+ if (!gotValue) {
+ return kAudioUnitErr_InvalidPropertyValue;
+ }
+#define kCurrentSavedStateVersion 0
+ if (versionValue != kCurrentSavedStateVersion) {
+ return kAudioUnitErr_InvalidPropertyValue;
+ }
+
+ // grab the ComponentDescription values from the AU state data
+ tempDesc.componentType = (OSType) GetDictionarySInt32Value(auStateDictionary, CFSTR(kAUPresetTypeKey), NULL);
+ tempDesc.componentSubType = (OSType) GetDictionarySInt32Value(auStateDictionary, CFSTR(kAUPresetSubtypeKey), NULL);
+ tempDesc.componentManufacturer = (OSType) GetDictionarySInt32Value(auStateDictionary, CFSTR(kAUPresetManufacturerKey), NULL);
+ // zero values are illegit for specific ComponentDescriptions, so zero for any value means that there was an error
+ if ( (tempDesc.componentType == 0) || (tempDesc.componentSubType == 0) || (tempDesc.componentManufacturer == 0) )
+ return kAudioUnitErr_InvalidPropertyValue;
+
+ *outComponentDescription = tempDesc;
+ return noErr;
+}
+
+
+static bool au_preset_filter (const string& str, void* arg)
+{
+ /* Not a dotfile, has a prefix before a period, suffix is aupreset */
+
+ bool ret;
+
+ ret = (str[0] != '.' && str.length() > 9 && str.find (preset_suffix) == (str.length() - preset_suffix.length()));
+
+ if (ret && arg) {
+
+ /* check the preset file path name against this plugin
+ ID. The idea is that all preset files for this plugin
+ include "<manufacturer>/<plugin-name>" in their path.
+ */
+
+ Plugin* p = (Plugin *) arg;
+ string match = p->maker();
+ match += '/';
+ match += p->name();
+
+ ret = str.find (match) != string::npos;
+
+ if (ret == false) {
+ string m = p->maker ();
+ string n = p->name ();
+ strip_whitespace_edges (m);
+ strip_whitespace_edges (n);
+ match = m;
+ match += '/';
+ match += n;
+
+ ret = str.find (match) != string::npos;
+ }
+ }
+
+ return ret;
+}
+
+bool
+check_and_get_preset_name (Component component, const string& pathstr, string& preset_name)
+{
+ OSStatus status;
+ CFPropertyListRef plist;
+ ComponentDescription presetDesc;
+ bool ret = false;
+
+ plist = load_property_list (pathstr);
+
+ if (!plist) {
+ return ret;
+ }
+
+ // get the ComponentDescription from the AU preset file
+
+ status = GetAUComponentDescriptionFromStateData(plist, &presetDesc);
+
+ if (status == noErr) {
+ if (ComponentAndDescriptionMatch_Loosely(component, &presetDesc)) {
+
+ /* try to get the preset name from the property list */
+
+ if (CFGetTypeID(plist) == CFDictionaryGetTypeID()) {
+
+ const void* psk = CFDictionaryGetValue ((CFMutableDictionaryRef)plist, CFSTR(kAUPresetNameKey));
+
+ if (psk) {
+
+ const char* p = CFStringGetCStringPtr ((CFStringRef) psk, kCFStringEncodingUTF8);
+
+ if (!p) {
+ char buf[PATH_MAX+1];
+
+ if (CFStringGetCString ((CFStringRef)psk, buf, sizeof (buf), kCFStringEncodingUTF8)) {
+ preset_name = buf;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ CFRelease (plist);
+
+ return true;
+}
+
+std::string
+AUPlugin::current_preset() const
+{
+ string preset_name;
+
+#ifdef AU_STATE_SUPPORT
+ CFPropertyListRef propertyList;
+
+ if (unit->GetAUPreset (propertyList) == noErr) {
+ preset_name = get_preset_name_in_plist (propertyList);
+ CFRelease(propertyList);
+ }
+#endif
+ return preset_name;
+}
+
+vector<string>
AUPlugin::get_presets ()
{
- vector<PresetRecord> presets;
+ vector<string*>* preset_files;
+ vector<string> presets;
+ PathScanner scanner;
+
+ preset_files = scanner (preset_search_path, au_preset_filter, this, true, true, -1, true);
+
+ if (!preset_files) {
+ return presets;
+ }
+
+ for (vector<string*>::iterator x = preset_files->begin(); x != preset_files->end(); ++x) {
+
+ string path = *(*x);
+ string preset_name;
+
+ /* make an initial guess at the preset name using the path */
+
+ preset_name = Glib::path_get_basename (path);
+ preset_name = preset_name.substr (0, preset_name.find_last_of ('.'));
+
+ /* check that this preset file really matches this plugin
+ and potentially get the "real" preset name from
+ within the file.
+ */
+
+ if (check_and_get_preset_name (get_comp()->Comp(), path, preset_name)) {
+ presets.push_back (preset_name);
+ preset_map[preset_name] = path;
+ }
+
+ delete *x;
+ }
+
+ delete preset_files;
return presets;
}
@@ -874,6 +1454,7 @@ AUPluginInfo::discover ()
discover_fx (plugs);
discover_music (plugs);
+ discover_generators (plugs);
return plugs;
}
@@ -905,6 +1486,19 @@ AUPluginInfo::discover_fx (PluginInfoList& plugs)
}
void
+AUPluginInfo::discover_generators (PluginInfoList& plugs)
+{
+ CAComponentDescription desc;
+ desc.componentFlags = 0;
+ desc.componentFlagsMask = 0;
+ desc.componentSubType = 0;
+ desc.componentManufacturer = 0;
+ desc.componentType = kAudioUnitType_Generator;
+
+ discover_by_description (plugs, desc);
+}
+
+void
AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescription& desc)
{
Component comp = 0;
@@ -926,6 +1520,13 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip
case kAudioUnitType_OfflineEffect:
case kAudioUnitType_FormatConverter:
continue;
+ case kAudioUnitType_Output:
+ case kAudioUnitType_MusicDevice:
+ case kAudioUnitType_MusicEffect:
+ case kAudioUnitType_Effect:
+ case kAudioUnitType_Mixer:
+ case kAudioUnitType_Generator:
+ break;
default:
break;
}
@@ -935,15 +1536,12 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip
case kAudioUnitSubType_SystemOutput:
case kAudioUnitSubType_GenericOutput:
case kAudioUnitSubType_AUConverter:
+ /* we don't want output units here */
continue;
break;
case kAudioUnitSubType_DLSSynth:
- info->category = "DLSSynth";
- break;
-
- case kAudioUnitType_MusicEffect:
- info->category = "MusicEffect";
+ info->category = "DLS Synth";
break;
case kAudioUnitSubType_Varispeed:
@@ -955,55 +1553,59 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip
break;
case kAudioUnitSubType_LowPassFilter:
- info->category = "LowPassFilter";
+ info->category = "Low-pass Filter";
break;
case kAudioUnitSubType_HighPassFilter:
- info->category = "HighPassFilter";
+ info->category = "High-pass Filter";
break;
case kAudioUnitSubType_BandPassFilter:
- info->category = "BandPassFilter";
+ info->category = "Band-pass Filter";
break;
case kAudioUnitSubType_HighShelfFilter:
- info->category = "HighShelfFilter";
+ info->category = "High-shelf Filter";
break;
case kAudioUnitSubType_LowShelfFilter:
- info->category = "LowShelfFilter";
+ info->category = "Low-shelf Filter";
break;
case kAudioUnitSubType_ParametricEQ:
- info->category = "ParametricEQ";
+ info->category = "Parametric EQ";
break;
case kAudioUnitSubType_GraphicEQ:
- info->category = "GraphicEQ";
+ info->category = "Graphic EQ";
break;
case kAudioUnitSubType_PeakLimiter:
- info->category = "PeakLimiter";
+ info->category = "Peak Limiter";
break;
case kAudioUnitSubType_DynamicsProcessor:
- info->category = "DynamicsProcessor";
+ info->category = "Dynamics Processor";
break;
case kAudioUnitSubType_MultiBandCompressor:
- info->category = "MultiBandCompressor";
+ info->category = "Multiband Compressor";
break;
case kAudioUnitSubType_MatrixReverb:
- info->category = "MatrixReverb";
+ info->category = "Matrix Reverb";
break;
- case kAudioUnitType_Mixer:
- info->category = "Mixer";
+ case kAudioUnitSubType_SampleDelay:
+ info->category = "Sample Delay";
break;
- case kAudioUnitSubType_StereoMixer:
- info->category = "StereoMixer";
+ case kAudioUnitSubType_Pitch:
+ info->category = "Pitch";
+ break;
+
+ case kAudioUnitSubType_NetSend:
+ info->category = "Net Sender";
break;
case kAudioUnitSubType_3DMixer:
@@ -1014,6 +1616,19 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip
info->category = "MatrixMixer";
break;
+ case kAudioUnitSubType_ScheduledSoundPlayer:
+ info->category = "Scheduled Sound Player";
+ break;
+
+
+ case kAudioUnitSubType_AudioFilePlayer:
+ info->category = "Audio File Player";
+ break;
+
+ case kAudioUnitSubType_NetReceive:
+ info->category = "Net Receiver";
+ break;
+
default:
info->category = "";
}
@@ -1038,8 +1653,8 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip
of values.
*/
- info->n_inputs = ChanCount (DataType::AUDIO, info->cache.io_configs.front().first);
- info->n_outputs = ChanCount (DataType::AUDIO, info->cache.io_configs.front().second);
+ info->n_inputs = info->cache.io_configs.front().first;
+ info->n_outputs = info->cache.io_configs.front().second;
if (info->cache.io_configs.size() > 1) {
cerr << "ODD: variable IO config for " << info->unique_id << endl;
diff --git a/libs/ardour/audioanalyser.cc b/libs/ardour/audioanalyser.cc
index 53684c835e..53b60f9eaa 100644
--- a/libs/ardour/audioanalyser.cc
+++ b/libs/ardour/audioanalyser.cc
@@ -1,5 +1,7 @@
#include <cstring>
+
#include "vamp-hostsdk/PluginLoader.h"
+
#include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>
#include <glib/gstdio.h> // for g_remove()
diff --git a/libs/ardour/chan_count.cc b/libs/ardour/chan_count.cc
index eb5033bcfc..1c892c1a87 100644
--- a/libs/ardour/chan_count.cc
+++ b/libs/ardour/chan_count.cc
@@ -44,5 +44,8 @@ infinity_factory()
const ChanCount ChanCount::INFINITE = infinity_factory();
const ChanCount ChanCount::ZERO = ChanCount();
-
} // namespace ARDOUR
+
+std::ostream& operator<<(std::ostream& o, const ARDOUR::ChanCount& c) {
+ return o << "AUDIO=" << c.n_audio() << ":MIDI=" << c.n_midi();
+}
diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc
index 594b4fcd48..1c354a5db0 100644
--- a/libs/ardour/globals.cc
+++ b/libs/ardour/globals.cc
@@ -363,6 +363,9 @@ ARDOUR::cleanup ()
delete Library;
lrdf_cleanup ();
delete &ControlProtocolManager::instance();
+#ifdef VST_SUPPORT
+ fst_exit ();
+#endif
return 0;
}
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 0fb2f64fc7..dcca313c79 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -39,6 +39,7 @@
#include "ardour/region_factory.h"
#include "ardour/filter.h"
#include "ardour/profile.h"
+#include "ardour/utils.h"
#include "i18n.h"
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index e62d672984..f2e1b2a730 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -4085,7 +4085,9 @@ Session::write_one_track (AudioTrack& track, nframes_t start, nframes_t end,
// any bigger than this seems to cause stack overflows in called functions
const nframes_t chunk_size = (128 * 1024)/4;
- g_atomic_int_set (&processing_prohibited, 1);
+ // block all process callback handling
+
+ block_processing ();
/* call tree *MUST* hold route_lock */
@@ -4211,7 +4213,7 @@ Session::write_one_track (AudioTrack& track, nframes_t start, nframes_t end,
}
}
- g_atomic_int_set (&processing_prohibited, 0);
+ unblock_processing ();
return result;
}
diff --git a/libs/ardour/session_process.cc b/libs/ardour/session_process.cc
index 0f697806eb..72fe634bb2 100644
--- a/libs/ardour/session_process.cc
+++ b/libs/ardour/session_process.cc
@@ -58,12 +58,17 @@ Session::process (nframes_t nframes)
_silent = false;
+ if (processing_blocked()) {
+ _silent = true;
+ return;
+ }
+
if (non_realtime_work_pending()) {
if (!transport_work_requested ()) {
post_transport ();
}
}
-
+
(this->*process_function) (nframes);
// the ticker is for sending time information like MidiClock
@@ -100,13 +105,6 @@ Session::no_roll (nframes_t nframes, nframes_t offset)
_click_io->silence (nframes, offset);
}
- if (g_atomic_int_get (&processing_prohibited)) {
- for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
- (*i)->silence (nframes, offset);
- }
- return 0;
- }
-
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
if ((*i)->is_hidden()) {
@@ -432,7 +430,7 @@ Session::process_with_events (nframes_t nframes)
/* if an event left our state changing, do the right thing */
- if (non_realtime_work_pending()) {
+ if (nframes && non_realtime_work_pending()) {
no_roll (nframes, offset);
break;
}
@@ -947,9 +945,7 @@ Session::maybe_sync_start (nframes_t& nframes, nframes_t& offset)
with any fancy stuff here, just the minimal silence.
*/
- g_atomic_int_inc (&processing_prohibited);
- no_roll (nframes, 0);
- g_atomic_int_dec_and_test (&processing_prohibited);
+ _silent = true;
if (Config->get_locate_while_waiting_for_sync()) {
if (micro_locate (nframes)) {
diff --git a/libs/ardour/session_vst.cc b/libs/ardour/session_vst.cc
index 99809e41b9..3a158a3e73 100644
--- a/libs/ardour/session_vst.cc
+++ b/libs/ardour/session_vst.cc
@@ -21,16 +21,19 @@
#include <cstdio>
#include <fst.h>
+#include <fst/vestige/aeffectx.h>
#include "ardour/session.h"
+#include "ardour/tempo.h"
#include "ardour/vst_plugin.h"
#include "i18n.h"
-// #define DEBUG_CALLBACKS
+#define DEBUG_CALLBACKS
+static int debug_callbacks = -1;
#ifdef DEBUG_CALLBACKS
-#define SHOW_CALLBACK printf
+#define SHOW_CALLBACK if (debug_callbacks) printf
#else
#define SHOW_CALLBACK(...)
#endif
@@ -48,14 +51,18 @@ long Session::vst_callback (AEffect* effect,
VSTPlugin* plug;
Session* session;
- SHOW_CALLBACK ("am callback, opcode = %d", opcode);
+ if (debug_callbacks < 0) {
+ debug_callbacks = (getenv ("ARDOUR_DEBUG_VST_CALLBACKS") != 0);
+ }
if (effect && effect->user) {
- plug = (VSTPlugin*) (effect->user);
+ plug = (VSTPlugin*) (effect->user);
session = &plug->session();
+ SHOW_CALLBACK ("am callback 0x%x, opcode = %ld, plugin = \"%s\" ", pthread_self(), opcode, plug->name());
} else {
plug = 0;
session = 0;
+ SHOW_CALLBACK ("am callback 0x%x, opcode = %ld", pthread_self(), opcode);
}
switch(opcode){
@@ -112,7 +119,25 @@ long Session::vst_callback (AEffect* effect,
if (session) {
_timeInfo.samplePos = session->transport_frame();
_timeInfo.sampleRate = session->frame_rate();
+ _timeInfo.flags = 0;
+
+ if (value & (kVstTempoValid)) {
+ const Tempo& t (session->tempo_map().tempo_at (session->transport_frame()));
+ _timeInfo.tempo = t.beats_per_minute ();
+ _timeInfo.flags |= (kVstTempoValid);
+ }
+ if (value & (kVstBarsValid)) {
+ const Meter& m (session->tempo_map().meter_at (session->transport_frame()));
+ _timeInfo.timeSigNumerator = m.beats_per_bar ();
+ _timeInfo.timeSigDenominator = m.note_divisor ();
+ _timeInfo.flags |= (kVstBarsValid);
+ }
+
+ if (session->transport_speed() != 0.0f) {
+ _timeInfo.flags |= kVstTransportPlaying;
+ }
}
+
return (long)&_timeInfo;
case audioMasterProcessEvents:
@@ -127,7 +152,13 @@ long Session::vst_callback (AEffect* effect,
case audioMasterTempoAt:
SHOW_CALLBACK ("amc: audioMasterTempoAt\n");
// returns tempo (in bpm * 10000) at sample frame location passed in <value>
- return 0;
+ if (session) {
+ const Tempo& t (session->tempo_map().tempo_at (value));
+ return t.beats_per_minute() * 1000;
+ } else {
+ return 0;
+ }
+ break;
case audioMasterGetNumAutomatableParameters:
SHOW_CALLBACK ("amc: audioMasterGetNumAutomatableParameters\n");
@@ -147,7 +178,10 @@ long Session::vst_callback (AEffect* effect,
case audioMasterNeedIdle:
SHOW_CALLBACK ("amc: audioMasterNeedIdle\n");
- // plug needs idle calls (outside its editor window)
+ // plug needs idle calls (outside its editor window)
+ if (plug) {
+ plug->fst()->wantIdle = 1;
+ }
return 0;
case audioMasterSizeWindow:
@@ -157,10 +191,16 @@ long Session::vst_callback (AEffect* effect,
case audioMasterGetSampleRate:
SHOW_CALLBACK ("amc: audioMasterGetSampleRate\n");
+ if (session) {
+ return session->frame_rate();
+ }
return 0;
case audioMasterGetBlockSize:
SHOW_CALLBACK ("amc: audioMasterGetBlockSize\n");
+ if (session) {
+ return session->get_block_size();
+ }
return 0;
case audioMasterGetInputLatency:
@@ -305,7 +345,7 @@ long Session::vst_callback (AEffect* effect,
return 0;
default:
- SHOW_CALLBACK ("VST master dispatcher: undefed: %d, %d\n", opcode, effKeysRequired);
+ SHOW_CALLBACK ("VST master dispatcher: undefed: %d\n", opcode);
break;
}
diff --git a/libs/ardour/vst_plugin.cc b/libs/ardour/vst_plugin.cc
index d69ef2a50a..2566357f87 100644
--- a/libs/ardour/vst_plugin.cc
+++ b/libs/ardour/vst_plugin.cc
@@ -147,40 +147,31 @@ VSTPlugin::get_state()
XMLNode *root = new XMLNode (state_node_name());
LocaleGuard lg (X_("POSIX"));
+ if (_fst->current_program != -1) {
+ char buf[32];
+ snprintf (buf, sizeof (buf), "%d", _fst->current_program);
+ root->add_property ("current-program", buf);
+ }
+
if (_plugin->flags & 32 /* effFlagsProgramsChunks */) {
/* fetch the current chunk */
- void* data;
+ guchar* data;
long data_size;
if ((data_size = _plugin->dispatcher (_plugin, 23 /* effGetChunk */, 0, 0, &data, false)) == 0) {
return *root;
}
- /* save it to a file */
-
- sys::path user_vst_directory(user_config_directory());
- user_vst_directory /= "vst";
-
- try {
- sys::create_directories (user_vst_directory);
- }
- catch (const sys::filesystem_error& ex)
- {
- error << "Could not create user configuration directory" << endmsg;
- return *root;
- }
-
- sys::path file (user_vst_directory);
-
- file /= "something";
-
/* store information */
XMLNode* chunk_node = new XMLNode (X_("chunk"));
- chunk_node->add_property ("path", file.to_string());
-
+
+ gchar * encoded_data = g_base64_encode (data, data_size);
+ chunk_node->add_content (encoded_data);
+ g_free (encoded_data);
+
root->add_child_nocopy (*chunk_node);
} else {
@@ -211,11 +202,30 @@ VSTPlugin::set_state(const XMLNode& node)
return 0;
}
- XMLNode* child;
+ const XMLProperty* prop;
- if ((child = find_named_node (node, X_("chunks"))) != 0) {
+ if ((prop = node.property ("current-program")) != 0) {
+ _fst->current_program = atoi (prop->value());
+ }
- return 0;
+ XMLNode* child;
+ int ret = -1;
+
+ if ((child = find_named_node (node, X_("chunk"))) != 0) {
+
+ XMLPropertyList::const_iterator i;
+ XMLNodeList::const_iterator n;
+ int ret = -1;
+
+ for (n = child->children ().begin (); n != child->children ().end (); ++n) {
+ if ((*n)->is_content ()) {
+ gsize chunk_size = 0;
+ guchar * data = g_base64_decode ((*n)->content ().c_str (), &chunk_size);
+ //cerr << "Dispatch setChunk for " << name() << endl;
+ ret = _plugin->dispatcher (_plugin, 24 /* effSetChunk */, 0, chunk_size, data, 0);
+ g_free (data);
+ }
+ }
} else if ((child = find_named_node (node, X_("parameters"))) != 0) {
@@ -231,10 +241,15 @@ VSTPlugin::set_state(const XMLNode& node)
_plugin->setParameter (_plugin, param, val);
}
- return 0;
+ /* program number is not knowable */
+
+ _fst->current_program = -1;
+
+ ret = 0;
+
}
- return -1;
+ return ret;
}
int
@@ -244,6 +259,7 @@ VSTPlugin::get_parameter_descriptor (uint32_t which, ParameterDescriptor& desc)
desc.min_unbound = false;
desc.max_unbound = false;
+ prop.flags = 0;
if (_plugin->dispatcher (_plugin, effGetParameterProperties, which, 0, &prop, 0)) {
diff --git a/libs/pbd/SConscript b/libs/pbd/SConscript
index 5a395641ca..51a852fd44 100644
--- a/libs/pbd/SConscript
+++ b/libs/pbd/SConscript
@@ -65,6 +65,9 @@ pbd.Merge ([ libraries['sigc2'],
libraries['glib2'],
libraries['boost'] ])
+if pbd['VST']:
+ pbd.Append(CCFLAGS="-DWINE_THREAD_SUPPORT", CPPPATH="#libs/fst")
+
pbd.VersionBuild(['version.cc','pbd/version.h'], [])
libpbd = pbd.SharedLibrary('pbd', pbd_files)
diff --git a/libs/pbd/pathscanner.cc b/libs/pbd/pathscanner.cc
index 8f37477147..9b41de9544 100644
--- a/libs/pbd/pathscanner.cc
+++ b/libs/pbd/pathscanner.cc
@@ -26,9 +26,9 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include <pbd/error.h>
-#include <pbd/pathscanner.h>
-#include <pbd/stl_delete.h>
+#include "pbd/error.h"
+#include "pbd/pathscanner.h"
+#include "pbd/stl_delete.h"
using namespace PBD;
diff --git a/libs/pbd/pthread_utils.cc b/libs/pbd/pthread_utils.cc
index 8274223487..69270a767b 100644
--- a/libs/pbd/pthread_utils.cc
+++ b/libs/pbd/pthread_utils.cc
@@ -24,6 +24,9 @@
#include <stdint.h>
#include "pbd/pthread_utils.h"
+#ifdef WINE_THREAD_SUPPORT
+#include <fst.h>
+#endif
using namespace std;
@@ -39,6 +42,15 @@ namespace PBD {
using namespace PBD;
+static int thread_creator (pthread_t* thread_id, const pthread_attr_t* attr, void *(*function)(void*), void* arg)
+{
+#ifdef WINE_THREAD_SUPPORT
+ return wine_pthread_create (thread_id, attr, function, arg);
+#else
+ return pthread_create (thread_id, attr, function, arg);
+#endif
+}
+
void
PBD::notify_gui_about_thread_creation (pthread_t thread, std::string str, int request_count)
{
@@ -70,7 +82,7 @@ pthread_create_and_store (string name, pthread_t *thread, pthread_attr_t *attr,
attr = &default_attr;
}
- if ((ret = pthread_create (thread, attr, start_routine, arg)) == 0) {
+ if ((ret = thread_creator (thread, attr, start_routine, arg)) == 0) {
std::pair<string,pthread_t> newpair;
newpair.first = name;
newpair.second = *thread;
diff --git a/libs/rubberband/src/vamp/RubberBandVampPlugin.h b/libs/rubberband/src/vamp/RubberBandVampPlugin.h
index f062e35eea..67cf1dfba4 100644
--- a/libs/rubberband/src/vamp/RubberBandVampPlugin.h
+++ b/libs/rubberband/src/vamp/RubberBandVampPlugin.h
@@ -15,7 +15,7 @@
#ifndef _RUBBERBAND_VAMP_PLUGIN_H_
#define _RUBBERBAND_VAMP_PLUGIN_H_
-#include <vamp-sdk/Plugin.h>
+#include "vamp-sdk/Plugin.h"
#include "RubberBandStretcher.h"
diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc
index d8ff311486..264ce74f49 100644
--- a/libs/surfaces/osc/osc.cc
+++ b/libs/surfaces/osc/osc.cc
@@ -301,7 +301,7 @@ OSC::init_osc_thread ()
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, 500000);
- pthread_create (&_osc_thread, &attr, &OSC::_osc_receiver, this);
+ pthread_create_and_store (X_("OSC"), &_osc_thread, &attr, &OSC::_osc_receiver, this);
if (!_osc_thread) {
return false;
}
diff --git a/libs/vamp-plugins/Onset.h b/libs/vamp-plugins/Onset.h
index 314e107308..c858151b21 100644
--- a/libs/vamp-plugins/Onset.h
+++ b/libs/vamp-plugins/Onset.h
@@ -17,7 +17,7 @@
#ifndef _ONSET_PLUGIN_H_
#define _ONSET_PLUGIN_H_
-#include <vamp-sdk/Plugin.h>
+#include "vamp-sdk/Plugin.h"
#include <aubio/aubio.h>
class Onset : public Vamp::Plugin
diff --git a/libs/vamp-sdk/src/vamp-hostsdk/PluginBufferingAdapter.cpp b/libs/vamp-sdk/src/vamp-hostsdk/PluginBufferingAdapter.cpp
index 0aa92d9efc..797173d7f8 100644
--- a/libs/vamp-sdk/src/vamp-hostsdk/PluginBufferingAdapter.cpp
+++ b/libs/vamp-sdk/src/vamp-hostsdk/PluginBufferingAdapter.cpp
@@ -38,7 +38,7 @@
#include <vector>
#include <map>
-#include <vamp-hostsdk/PluginBufferingAdapter.h>
+#include "vamp-hostsdk/PluginBufferingAdapter.h"
using std::vector;
using std::map;
diff --git a/libs/vamp-sdk/src/vamp-hostsdk/PluginChannelAdapter.cpp b/libs/vamp-sdk/src/vamp-hostsdk/PluginChannelAdapter.cpp
index 92a35bba85..9a5abf5463 100644
--- a/libs/vamp-sdk/src/vamp-hostsdk/PluginChannelAdapter.cpp
+++ b/libs/vamp-sdk/src/vamp-hostsdk/PluginChannelAdapter.cpp
@@ -34,7 +34,7 @@
authorization.
*/
-#include <vamp-hostsdk/PluginChannelAdapter.h>
+#include "vamp-hostsdk/PluginChannelAdapter.h"
_VAMP_SDK_HOSTSPACE_BEGIN(PluginChannelAdapter.cpp)
diff --git a/libs/vamp-sdk/src/vamp-hostsdk/PluginHostAdapter.cpp b/libs/vamp-sdk/src/vamp-hostsdk/PluginHostAdapter.cpp
index 5bf323b1a7..051a9bb905 100644
--- a/libs/vamp-sdk/src/vamp-hostsdk/PluginHostAdapter.cpp
+++ b/libs/vamp-sdk/src/vamp-hostsdk/PluginHostAdapter.cpp
@@ -34,7 +34,7 @@
authorization.
*/
-#include <vamp-hostsdk/PluginHostAdapter.h>
+#include "vamp-hostsdk/PluginHostAdapter.h"
#include <cstdlib>
#if ( VAMP_SDK_MAJOR_VERSION != 2 || VAMP_SDK_MINOR_VERSION != 0 )
diff --git a/libs/vamp-sdk/src/vamp-hostsdk/PluginInputDomainAdapter.cpp b/libs/vamp-sdk/src/vamp-hostsdk/PluginInputDomainAdapter.cpp
index 967d5cfcd9..e5b37b56ab 100644
--- a/libs/vamp-sdk/src/vamp-hostsdk/PluginInputDomainAdapter.cpp
+++ b/libs/vamp-sdk/src/vamp-hostsdk/PluginInputDomainAdapter.cpp
@@ -37,7 +37,7 @@
authorization.
*/
-#include <vamp-hostsdk/PluginInputDomainAdapter.h>
+#include "vamp-hostsdk/PluginInputDomainAdapter.h"
#include <cmath>
diff --git a/libs/vamp-sdk/src/vamp-hostsdk/PluginLoader.cpp b/libs/vamp-sdk/src/vamp-hostsdk/PluginLoader.cpp
index 3bf23bb165..686a77c36c 100644
--- a/libs/vamp-sdk/src/vamp-hostsdk/PluginLoader.cpp
+++ b/libs/vamp-sdk/src/vamp-hostsdk/PluginLoader.cpp
@@ -34,11 +34,11 @@
authorization.
*/
-#include <vamp-hostsdk/PluginHostAdapter.h>
-#include <vamp-hostsdk/PluginLoader.h>
-#include <vamp-hostsdk/PluginInputDomainAdapter.h>
-#include <vamp-hostsdk/PluginChannelAdapter.h>
-#include <vamp-hostsdk/PluginBufferingAdapter.h>
+#include "vamp-hostsdk/PluginHostAdapter.h"
+#include "vamp-hostsdk/PluginLoader.h"
+#include "vamp-hostsdk/PluginInputDomainAdapter.h"
+#include "vamp-hostsdk/PluginChannelAdapter.h"
+#include "vamp-hostsdk/PluginBufferingAdapter.h"
#include <fstream>
#include <cctype> // tolower
diff --git a/libs/vamp-sdk/src/vamp-hostsdk/PluginSummarisingAdapter.cpp b/libs/vamp-sdk/src/vamp-hostsdk/PluginSummarisingAdapter.cpp
index 592190fdf4..4a1a63da73 100644
--- a/libs/vamp-sdk/src/vamp-hostsdk/PluginSummarisingAdapter.cpp
+++ b/libs/vamp-sdk/src/vamp-hostsdk/PluginSummarisingAdapter.cpp
@@ -34,7 +34,7 @@
authorization.
*/
-#include <vamp-hostsdk/PluginSummarisingAdapter.h>
+#include "vamp-hostsdk/PluginSummarisingAdapter.h"
#include <map>
#include <algorithm>
diff --git a/libs/vamp-sdk/src/vamp-hostsdk/PluginWrapper.cpp b/libs/vamp-sdk/src/vamp-hostsdk/PluginWrapper.cpp
index 02bdc280f1..dc076f8b53 100644
--- a/libs/vamp-sdk/src/vamp-hostsdk/PluginWrapper.cpp
+++ b/libs/vamp-sdk/src/vamp-hostsdk/PluginWrapper.cpp
@@ -34,7 +34,7 @@
authorization.
*/
-#include <vamp-hostsdk/PluginWrapper.h>
+#include "vamp-hostsdk/PluginWrapper.h"
_VAMP_SDK_HOSTSPACE_BEGIN(PluginWrapper.cpp)
diff --git a/libs/vamp-sdk/src/vamp-hostsdk/RealTime.cpp b/libs/vamp-sdk/src/vamp-hostsdk/RealTime.cpp
index 537ccbde5d..c7424f041e 100644
--- a/libs/vamp-sdk/src/vamp-hostsdk/RealTime.cpp
+++ b/libs/vamp-sdk/src/vamp-hostsdk/RealTime.cpp
@@ -34,6 +34,6 @@
authorization.
*/
-#include <vamp-hostsdk/RealTime.h>
+#include "vamp-hostsdk/RealTime.h"
#include "../vamp-sdk/RealTime.cpp"
diff --git a/libs/vamp-sdk/src/vamp-sdk/PluginAdapter.cpp b/libs/vamp-sdk/src/vamp-sdk/PluginAdapter.cpp
index fc195d775b..2c91e40d94 100644
--- a/libs/vamp-sdk/src/vamp-sdk/PluginAdapter.cpp
+++ b/libs/vamp-sdk/src/vamp-sdk/PluginAdapter.cpp
@@ -34,7 +34,7 @@
authorization.
*/
-#include <vamp-sdk/PluginAdapter.h>
+#include "vamp-sdk/PluginAdapter.h"
#include <cstring>
#include <cstdlib>
diff --git a/libs/vamp-sdk/src/vamp-sdk/RealTime.cpp b/libs/vamp-sdk/src/vamp-sdk/RealTime.cpp
index d3c4364785..16741dfa23 100644
--- a/libs/vamp-sdk/src/vamp-sdk/RealTime.cpp
+++ b/libs/vamp-sdk/src/vamp-sdk/RealTime.cpp
@@ -57,7 +57,7 @@ using std::endl;
#include <sys/time.h>
#endif
-#include <vamp-sdk/RealTime.h>
+#include "vamp-sdk/RealTime.h"
_VAMP_SDK_PLUGSPACE_BEGIN(RealTime.cpp)
diff --git a/libs/vamp-sdk/vamp-hostsdk/Plugin.h b/libs/vamp-sdk/vamp-hostsdk/Plugin.h
index 72a3b640d5..1e849cb437 100644
--- a/libs/vamp-sdk/vamp-hostsdk/Plugin.h
+++ b/libs/vamp-sdk/vamp-hostsdk/Plugin.h
@@ -42,6 +42,6 @@
#include "hostguard.h"
-#include <vamp-sdk/Plugin.h>
+#include "vamp-sdk/Plugin.h"
#endif
diff --git a/libs/vamp-sdk/vamp-hostsdk/PluginBase.h b/libs/vamp-sdk/vamp-hostsdk/PluginBase.h
index f12c25a715..ed45dc7bb3 100644
--- a/libs/vamp-sdk/vamp-hostsdk/PluginBase.h
+++ b/libs/vamp-sdk/vamp-hostsdk/PluginBase.h
@@ -42,6 +42,6 @@
#include "hostguard.h"
-#include <vamp-sdk/PluginBase.h>
+#include "vamp-sdk/PluginBase.h"
#endif
diff --git a/libs/vamp-sdk/vamp-hostsdk/PluginHostAdapter.h b/libs/vamp-sdk/vamp-hostsdk/PluginHostAdapter.h
index 2ca1d69949..588b9cf8a1 100644
--- a/libs/vamp-sdk/vamp-hostsdk/PluginHostAdapter.h
+++ b/libs/vamp-sdk/vamp-hostsdk/PluginHostAdapter.h
@@ -40,7 +40,7 @@
#include "hostguard.h"
#include "Plugin.h"
-#include <vamp/vamp.h>
+#include "vamp/vamp.h"
#include <vector>
diff --git a/libs/vamp-sdk/vamp-hostsdk/PluginWrapper.h b/libs/vamp-sdk/vamp-hostsdk/PluginWrapper.h
index 357050d2be..6b246e9f69 100644
--- a/libs/vamp-sdk/vamp-hostsdk/PluginWrapper.h
+++ b/libs/vamp-sdk/vamp-hostsdk/PluginWrapper.h
@@ -38,7 +38,7 @@
#define _VAMP_PLUGIN_WRAPPER_H_
#include "hostguard.h"
-#include <vamp-hostsdk/Plugin.h>
+#include "vamp-hostsdk/Plugin.h"
_VAMP_SDK_HOSTSPACE_BEGIN(PluginWrapper.h)
diff --git a/libs/vamp-sdk/vamp-hostsdk/RealTime.h b/libs/vamp-sdk/vamp-hostsdk/RealTime.h
index d789b6a1ac..8992cb5772 100644
--- a/libs/vamp-sdk/vamp-hostsdk/RealTime.h
+++ b/libs/vamp-sdk/vamp-hostsdk/RealTime.h
@@ -41,6 +41,6 @@
// use this header instead.
#include "hostguard.h"
-#include <vamp-sdk/RealTime.h>
+#include "vamp-sdk/RealTime.h"
#endif
diff --git a/libs/vamp-sdk/vamp-sdk/PluginAdapter.h b/libs/vamp-sdk/vamp-sdk/PluginAdapter.h
index dafd532a3b..e27f1638c0 100644
--- a/libs/vamp-sdk/vamp-sdk/PluginAdapter.h
+++ b/libs/vamp-sdk/vamp-sdk/PluginAdapter.h
@@ -38,7 +38,7 @@
#define _VAMP_PLUGIN_ADAPTER_H_
#include <map>
-#include <vamp/vamp.h>
+#include "vamp/vamp.h"
#include "Plugin.h"
diff --git a/vst/ardevst b/vst/ardevst
index ceed75b920..c5f4242023 100755
--- a/vst/ardevst
+++ b/vst/ardevst
@@ -2,5 +2,5 @@
. ../gtk2_ardour/ardev_common.sh
-export LD_LIBRARY_PATH=../gtk2_ardour:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH=$TOP/gtk2_ardour:$LD_LIBRARY_PATH
exec wine $TOP/vst/ardour_vst.exe.so "$@"