PDA

View Full Version : How to a waveform in real time in a desktop Application



min-anand
March 9th, 2018, 06:30 AM
Hi All,

I new to ubuntu and not familiar with most of the GUI toolkit which helps me draw a waveform in screen and will keep change based on the update.
I have created a GTK Window with Drawing Area.
Now I Can't think a way to use this show a waveform which will keep updating based on the input. Am I going in a right direction?

I have looked into the following link :
Drawing single pixel (again...) (https://ubuntuforums.org/showthread.php?t=1903258)

But I am not able to access the source that is been shared in this link.
Any help will be great support. Thanks a lot.

--Minakshi

norobro
March 10th, 2018, 02:00 AM
Here's a link to a GTK3 Line Graph widget: https://github.com/skoona/glinegraph-cairo
I have not used this widget except to help the developer solve a problem a couple of years ago. If you can't use the widget maybe the code will give you some idea how to proceed.

In lieu of building and installing the whole package, you can compile and run the example like this:
download and extract the zip file

cd to the src/ directory

gcc $(pkg-config --libs --cflags gtk+-3.0) *.c -o executable

./executable


If you are interested in Qt, Qwt is a lib that I have used: http://qwt.sourceforge.net/ There is an example of a moving plot.
Also, the lead dev answers questions here: http://www.qtcentre.org/forums/23-Qwt

min-anand
March 12th, 2018, 10:31 AM
Hi,

Thanks for response on my query. Actually I don't need to draw a curve or something.
I want to have black surface which I can treat as a collection of pixels.
So when get a notification to update the pixel position, then I simply fetch and update the pixel.

My intention is to use a Application window in place of fb. Any pointer will be a great help.

--Minakshi