Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Audio recorder with Qt 4.5. How to tell the recording loop to stop recording using pushbutton?

$
0
0
The example was the first thing I tried. Both approaches have the same problem that, the ui is not responding unless all the functions in process() are performed. It means the button is always being pressed and I won’t be able to release it until loop end. For example: void process() {      for(int i =0; i<60000; i++)       {          if (this->stop)  break;                      //record to file     }     cleanup(); } //==MainWindow== void on_pushButton_release() {       recorder->stop = true;      recorder->quit(); } The pushbutton won’t be released unitl i=59999 and finish cleanup(). Is there any method I can stop tell the loop to stop anytime before i=59999?

Viewing all articles
Browse latest Browse all 4972

Trending Articles