Previous: Qt4 example, Up: Writing Qt4 applications


9.3.6 Other Qt4 issues

TODO: beautify

Question and answer:

     I'd like to analyze sound file to extract pitches and amplitudes.  I
     have working code without using MarSystemQtWrapper, but for GUI display
     reasons, I'd like to do this analysis in a separate thread.  (ie a
     MarSystemQtWrapper)
     
     Is there any way to do this kind of thing inside a MarSystemQtWrapper?
     
             while (allNet->getctrl("mrs_bool/hasData")->toBool())
                     allNet->tick();

add the control you are interested to the monitored controls by calling trackctrl (or something like that) in MarSystemQtWrapper. The MarSystemQtWrapper will emit a signal either any time the control is changed or at period intervals depending on the withTimer settting. Either way you can connect the signal ctrlChanged(MarControlPtr cname);

to a slot in your GUI and then call allnet->pause() when that happens.

—— this is working on Meaws, but I'll need to read my code again to figure out how it works. Fortunately, I write nice clean readable code. :) -gp

UPDATE: look at src/qt4apps/regressionChecks instead.

Converting between QString and mrs_string

     QString qs = "Hello world!";
     mrs_string mrs_s = qs.toStdString();
     mrs_string mrs_s = "foo.wav";
     QString qs = QString( mrs_s.c_str() );