Replaces the glib event loop with something simple that wraps pulseaudio stuff to qt stuff (timers etc.).
Makes it work better with QT_NO_GLIB set, and one less dependency, and integrates better with qt in general (prioritization of events etc.).
Replaces the glib event loop with something simple that wraps pulseaudio stuff to qt stuff (timers etc.).
Makes it work better with QT_NO_GLIB set, and one less dependency, and integrates better with qt in general (prioritization of events etc.).
Been testing qtpamainloop.h here for a while, and it seems to work well: https://github.com/sandsmark/pavucontrol-qt/
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Apologies for taking a long time to review this. Great work, good idea to try to reduce external dependencies as much as possible (especially any starting with 'g').
One observation: would it be possible to allocate the m_mainloop in the Mixer_PULSE constructor, so that there can be just a pointer to it in mixer_pulse.h? Then there would be no need to include qtpamainloop.h in mixer_pulse.h. See inline comments.
backends/mixer_pulse.cpp | ||
---|---|---|
1029 | m_mainloop = new QtPaMainLoop; | |
1068 | delete m_mainloop | |
backends/mixer_pulse.h | ||
30 | forward declare QtPaMainLoop, move include to cpp file | |
82 | pointer |
Replaced it with a pointer, but as explained in the reply to the comment about deleting and recreating I don't think it makes sense to delete and recreate the fake "mainloop"/event loop since it only wraps the Qt event loop (and can't delete and recreate the Qt event loop obviously).
I thought a bit about it, and ended up not seeing why it should be done at least (everything should work fine as is). But I might be missing something.
backends/mixer_pulse.cpp | ||
---|---|---|
1068 | I thought about doing it initially, but it isn't really necessary. Since our "mainloop" isn't a real mainloop but just a wrapper around Qt's mainloop, deleting and creating it doesn't really do anything. |
Appreciate that using a pointer doesn't change anything at runtime, it was just for the purpose of eliminating an include in the mixer_pulse.h header file.