Add XOSC Viewer, use this as destination for xform

This commit is contained in:
2019-09-15 15:41:30 +02:00
parent c975ac947c
commit 134e1ce8f4
4 changed files with 191 additions and 14 deletions

View File

@ -103,6 +103,9 @@
((:menu
(("OSN File"
:callback 'application-interface-new-osn
:callback-type :interface)
("XOSC File"
:callback 'application-interface-new-xosc
:callback-type :interface))
:title "New")
("Open ..."
@ -184,15 +187,8 @@
(defmethod export-osn-to-xosc ((viewer osn-viewer))
(let ((osn (first (capi:graph-pane-roots (slot-value viewer 'osn-graph-pane)))))
(when osn
(multiple-value-bind (pathname ok)
(capi:prompt-for-file "Export OSN To XOSC"
:operation :save
:filters '("XOSC Files" "*.XOSC")
:filter "*.XOSC")
(when ok
(capi:with-busy-interface (viewer)
(with-open-file (stream pathname #+(or) (ensure-pathname-type pathname "xosc")
:external-format :utf-8
:element-type :default
:direction :output :if-exists :supersede)
(osn-os10:write-os10-stream osn stream))))))))
(application-interface-new-xosc
viewer
:content
(with-output-to-string (stream)
(osn-os10:write-os10-stream osn stream))))))