Closed leanne63 closed 7 years ago
Thanks a ton Leanne! This is great. A couple of comments-
if you export once, select something besides or in addition to WAV, and then export a second time, the file path shows ".wav" again instead of .*
.
I'll make those changes and post an update, Spencer.
- if you export once, select something besides or in addition to WAV, and then export a second time, the file path shows ".wav" again instead of .*
The filename now displays the correct extension upon first export and all successive exports.
.<error>
is a little confusing to me, I think its better to just display nothing (no extension, just the basename) and maybe disable the export button if possible
If no selections exist, the filename (or the default "untitled") is present without any extension. The panel also displays a message noting that format(s) must be selected. The Export
button is disabled until at least one selection is made.
Note: An attributed string can't be used for the message text, so the text color and appearance is just plain black. However, the way the message pops up makes it apparent to the user that something must be done, with the text explaining what that is (select formats).
Ah, also note: I noticed the previous code was using spaces, while my code had tabs. To make everything consistent, I switched the tabs to spaces in Xcode for those files I edited.
Awesome thanks again! This is great. I fixed a couple of things before merging-
NSPanel+ButtonTag.m
to the makefile.osx
(makefile-based build is technically the "official" build)allowedFileTypes
property to nil if none of file types are selected. This causes the panel to show the last extension used instead of no extension, but avoids a seeming bug in AppKit where the Panel adds extra periods after the first one(?) At least thats what Im seeing on Mac OS X 10.11.5- if theres a better solution happy to use that instead, but this seems better for the time being.
Added
IBAction
for themAExportAs.xib
buttons. When clicked, the extension on thesavePanel
filename is changed as follows:.<error>
.*
.wav
,.ogg
,.m4a
,.mp3
)mADocumentExporter
is using theexportAs...
values, rather than the actual filename extension, to determine the export file extension. Therefore, upon saving, the filename extension is changed back to.wav
(as expected bymADocumentExporter
).Also upon saving, if no other formats have been selected,
exportAsWAV
is set toYES
. If other formats have been selected, this is left as is. Again, this is becausemADocumentExporter
is using theexportAs...
values, rather than the actual filename extension, to determine the export file extension.Added property for
mAExportAsViewController
connection tominiAudicleDocument
savePanel
so can retrieve the save panel'ssetAllowedFileTypes
method.