Expand Audacity
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Re: Expand Audacity
Well done!
Re: Expand Audacity
There is one "bug" I see in my Audacity version: If I open Audacity twice and a second Audycity (and third and so on...) instance should open with parameters, it fails:

It seems as if Audacity tries to open the file "-saveAs", which is my renamed "-output" flag.
I don't see, why a second instance of Audacity does this. Any hints?

It seems as if Audacity tries to open the file "-saveAs", which is my renamed "-output" flag.
I don't see, why a second instance of Audacity does this. Any hints?
Re: Expand Audacity
It may be an OS or shell/CLI problem. I get something similar if I create something like this in a text file:
audacity.exe -doSomething file1.wav
audacity.exe -doSomething file2.wav
audacity.exe -doSomething file3.wav
then select all and copy then paste from the clipboard into a CLI (on Win7 using the built-in shell). However, if I save the text file with a .bat extension (instead of .txt) and execute the resulting file as a batch process it works as planned. The difference is that pasting text into the CLI from the clipboard runs all the commands simultaneously while running as a batch processes the commands on-at-a-time.
If that does not get you going, create and send me a patch (or just send me the changed files) and I will install the code here and see what I can do. I will PM you right now with my @dress so you may send me code which might not be attachable here.
Oh, and as to your point about using wxT(), have you tried it? My personal choice is to use very plain names which would not require this but seeing your pic with (what looks like) German I understand your thought!
audacity.exe -doSomething file1.wav
audacity.exe -doSomething file2.wav
audacity.exe -doSomething file3.wav
then select all and copy then paste from the clipboard into a CLI (on Win7 using the built-in shell). However, if I save the text file with a .bat extension (instead of .txt) and execute the resulting file as a batch process it works as planned. The difference is that pasting text into the CLI from the clipboard runs all the commands simultaneously while running as a batch processes the commands on-at-a-time.
If that does not get you going, create and send me a patch (or just send me the changed files) and I will install the code here and see what I can do. I will PM you right now with my @dress so you may send me code which might not be attachable here.
Oh, and as to your point about using wxT(), have you tried it? My personal choice is to use very plain names which would not require this but seeing your pic with (what looks like) German I understand your thought!
Re: Expand Audacity
To avoid the bug I now just commented out the "DDE connection to an already active Audacity" (ca. line 1683 to line 1700 in AudacityApp.cpp):
Code: Select all
/* //mytry start
wxClient client;
wxConnectionBase *conn;
// We try up to 10 times since there's a small window
// where the DDE server may not have been fully initialized
// yet.
for (int i = 0; i < 10; i++) {
conn = client.MakeConnection(wxEmptyString,
IPC_APPL,
IPC_TOPIC);
if (conn) {
if (conn->Execute(argv[1])) {
// Command was successfully queued so exit quietly
delete mChecker;
return false;
}
}
wxMilliSleep(100);
}
*/ //mytry end
Last edited by klimmbimm on Mon Oct 17, 2011 8:11 am, edited 1 time in total.
Re: Expand Audacity
This is a dangerous solution as most of Audacity's code is NOT re-entrant--it is just not designed for multiple simultaneous instances.klimmbimm wrote:To avoid the bug I now just uncommented the "DDE connection to an already active Audacity" (ca. line 1683 to line 1700 in AudacityApp.cpp)
Re: Expand Audacity
klimmbimm wrote:To avoid the bug I now just uncommented the "DDE connection to an already active Audacity" (ca. line 1683 to line 1700 in AudacityApp.cpp):
Sorry, I chose the wrong english word: I meant "commented out the DDE connection" (it was "uncommented" before). So my Audacity is now less able to be opened more than once.Edgar wrote:...it is just not designed for multiple simultaneous instances.
Trying to open Audacity twice now, gets me a message box with an error and no second project.
This was the quickest solution I could find.
Re: Expand Audacity
I was aware of the (un)comment "typo" but my concern remains about commenting out those lines. There are serious but subtle problems when multiple copies of Audacity run at the same time.klimmbimm wrote: Sorry, I chose the wrong english word: I meant "commented out the DDE connection" (it was "uncommented" before).
There is a race condition bug in the code you comment out, reported here:
http://bugzilla.audacityteam.org/show_bug.cgi?id=219
which can lead to multiple copies of Audacity running at the same time. There is a thread (on -devel I think--the Audacity mailing list) with some discussion with pictures of TaskManager showing two Audacity running.
Re: Expand Audacity
Thank you, Edgar. I'll keep that in mind and perhaps I'll try to fix this later.
Meanwhile I found another bug:
If the -saveAs and -open parameters are the same (which means that the opened file is saved under its own name), the replaced file seems to be empty.
Surprisingly I can avoid emptyness of the saved file by normalizing on load.
For that, I built in another CLI switch. It has to be called after -saveAs and -open:
Any idea?
Meanwhile I found another bug:
If the -saveAs and -open parameters are the same (which means that the opened file is saved under its own name), the replaced file seems to be empty.
Surprisingly I can avoid emptyness of the saved file by normalizing on load.
For that, I built in another CLI switch. It has to be called after -saveAs and -open:
Code: Select all
if (!handled && !wxString(wxT("-normalize")).CmpNoCase(argv[option])) {
if (!project)
project = CreateNewAudacityProject();
project->SelectNone();
project->SelectAllIfNone();
project->OnEffect(ALL_EFFECTS | CONFIGURED_EFFECT,
EffectManager::Get().GetEffectByIdentifier(wxT("Normalize")));
handled = true;
}
Re: Expand Audacity
I thought that problem had been addressed/fixed a couple of months ago. Are you working with a recent SVN HEAD? If not, You should go ahead and grab the most recent and port your changes. I just tested it here on SVN HEAD (but not via your CLI code) and do not experience this. If the problem persists for you let me know and I will try to test it here.klimmbimm wrote: Meanwhile I found another bug:
If the -saveAs and -open parameters are the same (which means that the opened file is saved under its own name), the replaced file seems to be empty.
Surprisingly I can avoid emptyness of the saved file by normalizing on load.
Thanks for pointing out GetEffectByIdentifier! I have been using a hard-coded numeric ID which could change if the Plug-ins folder's content changed. This may help me with some fine tuning I am currently doing on my "Personal Audacity".klimmbimm wrote:Code: Select all
project->OnEffect(ALL_EFFECTS | CONFIGURED_EFFECT, EffectManager::Get().GetEffectByIdentifier(wxT("Normalize")));
Re: Expand Audacity
No, I wasn't working with a recent SVN HEAD, but with the Audacity 1.3 release, I think. I'll try porting our changes next week and report my result.Edgar wrote: I thought that problem had been addressed/fixed a couple of months ago. Are you working with a recent SVN HEAD?
Nice to hear, that I could contribute at last.Edgar wrote: Thanks for pointing out GetEffectByIdentifier! I have been using a hard-coded numeric ID which could change if the Plug-ins folder's content changed. This may help me with some fine tuning I am currently doing on my "Personal Audacity".