Commit Graph

8 Commits

Author SHA1 Message Date
Robbert van der Helm eb8d4ae1d8 Fix Win32Thread not capturing by move
std::function does not allow non-movable lambdas, so capturing by move
doesn't work there. And the old solution of course has issues with
dangling pointers (but because this is C++ the compiler still thinks
it's A-Ok).
2020-10-27 22:53:59 +01:00
Robbert van der Helm bafc36614b Properly forward arguments in Win32Thread 2020-10-27 18:28:23 +01:00
Robbert van der Helm 1681ec9767 Add support for lambdas to Win32Thread 2020-10-27 17:04:40 +01:00
Robbert van der Helm ca2b95e7aa Handle dispatch() directly during event handling
When the message loop is active and we get an incoming dispatch() event,
we'll just handle it directly. In practice this would only be needed
when the event is a response to an `audioMaster()` call made during the
event loop, but we can't know that. This allows the `getProgram()`
during `audioMasterUpdateDisplay()` in REAPER and Renoise to work
correctly. Hopefully this doesn't cause random rare breakage.
2020-10-26 20:03:54 +01:00
Robbert van der Helm 957da62137 Add missing type qualifiers 2020-06-06 13:44:23 +02:00
Robbert van der Helm 33777d2876 Use same style for optional and avoid double check
I did not know that `std::optional::value()` did checked access. And I
still prefer a more explicit .has_value() over boolean conversion, but
this seems to be the accepted way to do this.
2020-06-05 22:35:56 +02:00
Robbert van der Helm 00bcdf8fca Add a RAII wrapper around SetTimer() 2020-05-28 15:27:45 +02:00
Robbert van der Helm d0c8d8a2e7 Clean up Win32 thread API usage using RAII 2020-04-24 15:40:44 +02:00