Audacity Progress Bar

Building and customizing Audacity from the source code.

If you require help using Audacity, please post on the forum board relevant to your operating system:
Mac OS X
GNU/Linux and Unix-like

Audacity Progress Bar

Permanent link to this post Posted by toadybarker » Wed Jan 13, 2016 6:11 pm

Dear All,
First off = I am using Audacity 2.1.2 in a Windows 10 environment which I compiled from source.

This is a question about the progress bar and if anyone could explain how I could implement one like it (either using the existing Audacity version or creating my own method).
I have a C function library which is Exporting or Importing files into/out of Audacity. Since this process is in a library outside of Audacity, and it only returns when it is finished input/out of said file, I want to have some sort of visual representation for the user.
Maybe someone here knows a quick solution to create a Please wait - working dialog. I need it to be something that is visually moving - and is stateless, because once you start it you cannot stop it until it is finished.
For example - currently if I say Import into Audacity from my database - I have to wait (on large files) for the process to return (let's say a minute for an hour long file) - and then the code will hit the Project->OpenFile method, which automatically puts up the Audacity Progress bar with Time Elapsed etc informational Progress Bar - and the track appears after the file is completely transferred.
Since I wont get any feedback from my outside C function call - would like some sort of window - preferably similar to the current audacity progress bar, that would let the users know to not freak out - something IS happening here....

Am hoping somebody here who understands the inner workings of the progress bar method(s)/ window could explain how to do this.
I apologize if I am posting this in the wrong place.

Thanks in advance,
Todd Baker
Posts: 18
Joined: Wed Oct 21, 2009 5:36 pm
Operating System: Please select

Re: Audacity Progress Bar

Permanent link to this post Posted by steve » Thu Jan 14, 2016 9:29 am

The basic scheme that Audacity uses to calculate the progress bar is that it knows what the total length of processed data will be, and it counts the number of data blocks as they are processed and calculates that count as a proportion of the total length. For example, when exporting a project, Audacity knows the total number of blockfiles in the project, and counts the blocks as they are passed in sequence to the exporter.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Site Admin
Posts: 46824
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Return to Compiling Audacity

Who is online

Users browsing this forum: No registered users and 1 guest