quicky2000 / tartini

A trial to make Tartini (The real time music analysis tool ) to evolve. Original code is located in http://miracle.otago.ac.nz/tartini/download.html
Other
8 stars 4 forks source link

Print view always displays with C Major scale #105

Open mself opened 4 years ago

mself commented 4 years ago

Unlike the on-screen view, the print view does not change which note names and lines are shown when the key, scale, or temperament are changed.

Can FreqWidgetGL::drawReferenceLines and FreqWidgetGL::drawReferenceLinesGL be combined into one method?

I read that Qt5 allows the use of Painter in GL views so that you don't need to write GL-specific code for 2D views in most cases. I'm not clear why FreqWidgetGL is using GL at all?

See https://doc.qt.io/qt-5/qtopengl-2dpainting-example.html

quicky2000 commented 4 years ago

I'm not clear why FreqWidgetGL is using GL at all?

For performance reason I think, with GL you use hardware acceleration of GPU

mself commented 4 years ago

If you read the page I linked to above, it seems like you can get hardware GL acceleration even if you use QPainter for the drawing. It says

Since QGLWidget is a subclass of QWidget, it is possible to reimplement its paintEvent() and use QPainter to draw on the device, just as you would with a QWidget. The only difference is that the painting operations will be accelerated in hardware if it is supported by your system's OpenGL drivers.

In this example, we perform the same painting operations on a QWidget and a QGLWidget.

mself commented 4 years ago

It seems like this would let you get the speed benefit of OpenGL, but without having to write OpenGL-specific code (at least for 2D views -- the 3D Harmonic would still need to be written explicitly in OpenGL).

mself commented 4 years ago

Most of the GL views had earlier non-GL versions. So, it might not be too hard to bring those back but attach them to a QGLWidget instead.

quicky2000 commented 4 years ago

It seems like this would let you get the speed benefit of OpenGL, but without having to write OpenGL-specific code (at least for 2D views -- the 3D Harmonic would still need to be written explicitly in OpenGL).

It was perhaps not the case when Tartini was written with Qt3

Most of the GL views had earlier non-GL versions. So, it might not be too hard to bring those back but attach them to a QGLWidget instead.

But are the non-GL versions aligned with GL versions ? or have the GL version evolved after their creation ?