Results 1 to 5 of 5

Thread: Replacing "busy wait" with QTimer

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Sep 2011
    Posts
    19
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Replacing "busy wait" with QTimer

    The foreach loop sends the note -on message (// Note On: 144, 64, 90 - message[0] = 144 then I have a singleshot timer which repeatedly calls a routine that turns the notes off one at a time according to the ticks variable in the singleShot timer.


    Added after 1 8 minutes:


    I see what you mean now about the notes starting at the same time with the singleShot. With the SLEEP in place, it buffers the notes so that they play separately. I didn't take that into account. Your help in replacing this SLEEP function is appreciated. I've tried double timers staggered by the ticks variable but the starting problem remains. I found that you can't put a timer into a slot to call a slot, or at least I couldn't make it work. Is that possible? If it were possible to cascade the timers it would work I think.
    Last edited by devdon; 19th January 2012 at 23:28.

Similar Threads

  1. Replies: 1
    Last Post: 7th April 2010, 21:46
  2. Replies: 3
    Last Post: 15th February 2010, 17:27
  3. Replies: 3
    Last Post: 8th July 2008, 19:37
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 15:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.