Hi,
I'm looking for a common lisp tool to open multiple gui windows on the fly from the repl for realtime musical applications, like synth modules or graphs for displaying waveforms with cursors moving above them.
I haven't found any documentation on this, but my tests seem to indicate that a commonqt application blocks the repl and only one qtapplication can be run at a time.
Is there an easy solution for this? I have used mcclim before and it was possible there as every application-frame has its own repl, but I fear mcclim doesn't have the same performance as qt.
-- Orm
I'm not providing a definitive answer here. On some OSs, it may be an OS limitation in that there is only one thing that on Windows is called a message pump to which the OS delivers events, like mouse events. It may also be a QT limitation, perhaps based upon OS limitations. However, I think you can create as many windows as you want from the one QT application, so I don't think you are as limited as you may think. On Dec 28, 2015 1:45 PM, "Orm Finnendahl" < orm.finnendahl@selma.hfmdk-frankfurt.de> wrote:
Hi,
I'm looking for a common lisp tool to open multiple gui windows on the fly from the repl for realtime musical applications, like synth modules or graphs for displaying waveforms with cursors moving above them.
I haven't found any documentation on this, but my tests seem to indicate that a commonqt application blocks the repl and only one qtapplication can be run at a time.
Is there an easy solution for this? I have used mcclim before and it was possible there as every application-frame has its own repl, but I fear mcclim doesn't have the same performance as qt.
-- Orm
Just use multiple threads.
On Mon, Dec 28, 2015 at 9:45 PM, Orm Finnendahl orm.finnendahl@selma.hfmdk-frankfurt.de wrote:
Hi,
I'm looking for a common lisp tool to open multiple gui windows on the fly from the repl for realtime musical applications, like synth modules or graphs for displaying waveforms with cursors moving above them.
I haven't found any documentation on this, but my tests seem to indicate that a commonqt application blocks the repl and only one qtapplication can be run at a time.
Is there an easy solution for this? I have used mcclim before and it was possible there as every application-frame has its own repl, but I fear mcclim doesn't have the same performance as qt.
-- Orm
From the QT 5 qapplication doc, for any gui app using QT, there is
precisely one qapplication object, no matter whether the application has 0, 1, 2 or more Windows at any given time. Last time I looked, qapplication was a Singleton, iirc. On Dec 28, 2015 2:32 PM, "Stas Boukarev" stassats@gmail.com wrote:
Just use multiple threads.
On Mon, Dec 28, 2015 at 9:45 PM, Orm Finnendahl orm.finnendahl@selma.hfmdk-frankfurt.de wrote:
Hi,
I'm looking for a common lisp tool to open multiple gui windows on the fly from the repl for realtime musical applications, like synth modules or graphs for displaying waveforms with cursors moving above them.
I haven't found any documentation on this, but my tests seem to indicate that a commonqt application blocks the repl and only one qtapplication can be run at a time.
Is there an easy solution for this? I have used mcclim before and it was possible there as every application-frame has its own repl, but I fear mcclim doesn't have the same performance as qt.
-- Orm
-- With best regards, Stas.
On Dec 28, 2015 2:32 PM, "Stas Boukarev" stassats@gmail.com wrote:
Just use multiple threads.
Can you provide an example?
I tried using a thread and it didn't work as expected. Here is what I tried:
CL-USER> (ql:quickload "qt-tutorial") To load "qt-tutorial": Load 1 ASDF system: qt-tutorial ; Loading "qt-tutorial" .... ("qt-tutorial") CL-USER> (defparameter *mythread* (sb-thread:make-thread #'qt-conv::main)) *MYTHREAD* CL-USER>
So far, so good: The window opens and I can evaluate in the repl. After closing the window, the thread finishes, but it is impossible, to open a new window. Reevaluating (qt-conv::main) immediately returns -1 (in contrast to it returning 0 in the first case after window closing).
In addition, I don't know, how to access the window in the thread. Would it be feasible to install a polling queue mechanism (e.g. using Mailbox in sbcl) within the thread which sends to the application and receives from the repl?
-- Orm
All the GUI stuff has to be done from the same thread (and on some OSes it has to be the main thread). To communicate with Qt from a different thread use Qt signals, they are thread-safe.
On Mon, Dec 28, 2015 at 11:19 PM, Orm Finnendahl orm.finnendahl@selma.hfmdk-frankfurt.de wrote:
On Dec 28, 2015 2:32 PM, "Stas Boukarev" stassats@gmail.com wrote:
Just use multiple threads.
Can you provide an example?
I tried using a thread and it didn't work as expected. Here is what I tried:
CL-USER> (ql:quickload "qt-tutorial") To load "qt-tutorial": Load 1 ASDF system: qt-tutorial ; Loading "qt-tutorial" .... ("qt-tutorial") CL-USER> (defparameter *mythread* (sb-thread:make-thread #'qt-conv::main)) *MYTHREAD* CL-USER>
So far, so good: The window opens and I can evaluate in the repl. After closing the window, the thread finishes, but it is impossible, to open a new window. Reevaluating (qt-conv::main) immediately returns -1 (in contrast to it returning 0 in the first case after window closing).
In addition, I don't know, how to access the window in the thread. Would it be feasible to install a polling queue mechanism (e.g. using Mailbox in sbcl) within the thread which sends to the application and receives from the repl?
-- Orm
commonqt-devel@common-lisp.net