Audio Signal Processing GUI developement using Qt, How to? - c++

I have some basic effect algorithms (i.e chrous, LP filtering..) which I would like to build a GUI application to be able to use these algorithms.
For example I want to be able to open an audio file, process the audio file in some way with my algorithms and playback the processed file.
Later on I would like to, if possible be able to see the waveforms of the original file and the processed file in the GUI application. This is my objective now.
In the future I want to be able to create a user interface through which users can be able to use my own audio processing algorithms on files of their own.
Is it possible to design such a GUI with the Qt programming framework? If so, could someone point me in the right direction to get started? Right now I have the Qt SDK 1.1 beta running on Windows 7 OS and also using Qt creator. I would really appreciate some guidance.

Qt is a very powerful application framework, but do not expect any extra help with DSP tasks from it. It contains API for some basic and common tasks, like playing an audio/video file, working with audio devices, creating audio effects (search QAudio and Phonon in the Qt's help) etc. You can use some ready-to-use widgets and create your own multimedia player in a few moments.
But in the DSP you are -mostly, on your own. There is, for instance, only a limited audio file format support, so if you want to work with more formats than .wav and .aiff, use some specialized library. I recommend libsndfile (http://www.mega-nerd.com/libsndfile/) which is most powerful free audio file library available. And if you plan your effects to be more universal, use rather VST technology by Steinberg - today's audio plug-in standard, but it is relatively complicated, not suitable for beginners.
There is no built-in widget which can show a waveform, you have to create it yourself, but it is not much complicated. Qt has a really cool drawing functions, brushes, texts, gradients, transformations, antialiasing, even OpenGL wrapper - everything ready and very simple to use.
So the answer is definitely yes. I use Qt in my multimedia applications for three years and now I can't see how I could live without it (using VST GUI and Windows APIs before).

Sure its possible, QT is a framework for writing applications, you can write any application you want using it, you'll probably end up needing to write some custom controls. As an example, here's an Open source QT based application that does pretty much everything you are talking about and much more:
http://qtractor.sourceforge.net/qtractor-index.html

Related

Develope an application for windows and Mac OS

I need to develop an application that can be run on both Windows and Mac OS X, is a application "monitor" that needs to display data in real time, connection over ethernet. I'm interested in the performance and graphics. I know very well the c++. can you help me in choosing a development tool?thank you
JUCE is not just about for Music industry. Its for all. I have used it in Music softwares, Image processing and only GUI applications too.
Its a well built library which supports all platform.
you need not to create different project files for the application. JUCE creates it for you.
And its pure C++.
I would say your two choices are Juce or Qt. Juce is geared toward audio and graphics, letting you get your hands on creating fast and powerful DSP algorithms. Although Juce's largest following is with developers making music software, it's fully capable of making general purpose applications with the same ease as Qt. Qt does have advantages resulting from it's greater adoption; you will find plenty of tutorials, books and courses on Qt but hardly much on Juce at the moment.
Hopefully that will change soon as Juce was bought out by ROLI and will likely have more resources soon.

Cross-platform real-time MP3 recorder

I have an SDL app, that works under Linux, Mac and Windows. It's something like a media player, and can play audio just fine. I'd like to add audio recording feature to it, but I'd like to encode it in real time to MP3. Can anyone point me to an example how can I use LibLame, LibSoX, or possibly some other library to achieve this?
-- OR --
I'm also willing to rewrite the whole thing into something easier to manage than C++. I've looked at Kivy and Love2d which uses Lua, but audio recording it's still an issue there. If you know ANY toolkit that:
is cross platform
helps you build GUI using your own graphics
can play AND record mp3 files
ideally can operate under framebuffer (no X Window server under Linux)
Please let me know. I'm looking at Python + Pygame + Pyaudio, it can do graphics and output sound, but still can't record MP3's, only WAV's. Any way to integrate LAME into this to make it work?
FMOD can play practically anything, and handle audio input as well, although I don't know if integrating an entire audio engine is a bit overkill for your project.
It's free for non-commercial usage.
As for encoding, LAME is definitely the de-facto choice for MP3.
There's a very simple library called lame_enc.dll which wraps LAME's capabilities in a simple API. It's Windows only, but you could look at it's source for a good reference on how to use LAME.

Skinning WinAPI Controls

If you've ever seen an application in the Adobe Creative Suite 5 (CS5), you may have noticed that it doesn't look like the native Windows GUI.. They have modified it to have a different look to it.
Where would someone begin to make an application that has a custom skin? CS5 uses the Adobe Source library for it's widget/control management, so I tried downloading and compiling the Adobe Source Library to see if I could make a nice skinned app like Photoshop CS5, but after finally getting it to compile and tested it, I realized the library was only for managing widgets and not skinning the GUI, like CS5 has.
Where would I begin to make a nice skinned program like Adobe Cs5 applications? Can anyone point me in the right direction?
Do I simply use the WM_PAINT Message from WinAPI and render my own widgets using openGL or something?
Use QT and QML. It doesn't have a steep learning curve. You define your GUI with JavaScript and add lots of effects and enjoy using PNGs in every single thing you can imagine. Then you do your application logic with C++. In fact you can do some fairly advanced things other than UI with QML but it's better to seperate concerns as always.
I use it at work for a product to be released. Overriding WM_PAINT is not the only way in Windows but I strongly recommend QT instead of Win32 API when it comes to custom drawn UI. At least to my experience, it is way easier than my adventures with Win32 API.
If you want to implement custom controls by yourself, you need to implement own WM_PAINT and draw with using GDI/GDI+. For toplevel windows and popups you can use Layered windows. But I think you can find a lot of professional custom controls over internet for reasonable price if you don't want to implement by yourself.
I think your choices re creating a modern skinned app are: QT or WPF (via C++/CLI).
If you have an existing Win32 API application and you do not want to rewrite it using a library that supports skinning you might want to have a look at Stardock DirectSkin.
If you decide to rewrite your application I would also recommend Qt. Guitar Pro 6 was rewritten using Qt, read more about their experience here.

C++ UI framework from scratch?

I want to create a C++ UI framework (something like QT or like ubuntu unity Desktop)
How is programmed , is it using OpenGL or lets take plasma ui of QT (how is this programmed )?
Direct answers , reference links anything will be helpful.
Some interesting opengl based UI I founf on the web
LiquidEngine
http://www.youtube.com/watch?v=k0saaAIjIEY
Libnui
en.wikipedia.org/wiki/Libnui
Some UI frameworks render everything themselves, and work based on some kind of clipping-window-within-the-host-systems-screen. Non-display aspects (such as input event handling) have to be translated to/from the host systems underlying APIs.
Some UI frameworks translate as much as possible to some underlying framework.
wxWidgets can do both. You can choose a native version (e.g. wxMSW if you're on Windows) and most wxWidgets controls will be implemented using native Windows controls. Equally, you can choose the wxUniversal version, where all controls are implemented by the wxWidgets library itself.
The trouble is that typical GUI frameworks are huge. If you want a more manageable example to imitate, you might look at FLTK. I haven't got around to studying it myself, but it has a reputation for being consise.
There are also some GUI toolkits that are specifically aimed at games programming, such as Crazy Eddies GUI. My guess - these are probably as idependent of the underlying API as possible, so that particular applications can implement the mapping to whichever underlying API they happen to target (OpenGL, DirectX, SDL, whatever) and can be the boss of the GUI rather than visa versa.
http://www.wxwidgets.org/
http://www.fltk.org/
http://www.cegui.org.uk/wiki/index.php/Main_Page
"no really, don't write your own wm or toolkit"
The #Xorg-devel guys on irc.freenode.org
doing one anyway means that you have to test against a wide range of more or less buggy WMs and X implementations, and that you have to frequently update to be compatible with the latest Xorg server and X protocol features (like Xinput 2.1)
understandably, the Xorg people are tired to support old, unmaintained toolkits and applications. They already have enough bugs.
The GUI frameworks are very dependant on a windows system, which dictates what is allowed and how windows are created and rendered. For example, pass a specific option to create a borderless or full-screen window.
Since you mentioned opengl and ubuntu, I guess you want to start on a linux platform. You should study xlib, for which you can find reference here.
Since the qt library is open source, you can download it and peek into it's sources.
A UI library isn't developed from scratch. It relies on the OS' windowing system, which relies on the driver from your graphics adapter, which relies on the OS kernel, which relies on... and so on.
To develop any software "from scratch", you can start by writing your own BIOS. Once you're done with that, move on to writing an OS, and then you should be just about ready to write the software you wanted. Good luck.
And this is assuming you're willing to cheat, of course, and use a compiler you didn't write from scratch.
Before you do that, it's worth that you spend one week on thinking:
1, Do you really know how to do it? I doubt that.
2, Do you really need to do it? I doubt that too.

Application GUI development platform

Coming from C++ & MFC background, is there any better (maintainability/customization) platform in developing application GUI ?
We are developing industrial applications (machine vision), where :
-Performance-critical (mostly image processing in CPU atm, but GPU is up next)
-Low level hardware interfacing (inhouse PCI device, frame grabber, motion card)
-Real-time data visualization (images / statistical graph)
-Future roadmap includes networkability for distributed processing and remote access.
Cross-platform will not be important for us since the system runs in controlled-environment (customer only cares whether the system runs and they got their output).
There are also concerns on migration cost (3rd party dependencies, training cost for developers and service personnel)
Edit
Clarification on the "image processing" mentioned above:
I'm referring to "picture" (2D information in matrix format) rather than graphic (commonly 3D vectorized). Currently we uses 3rd party imaging library (for spatial domain processing like segmentation, OCR/OCV, morphology, pattern match) and incorporate our result logic.
If you need performance-critical graphics processing, then C++/DirectX or C++/OpenGL are your best bets, hands down. C++/DirectX is arguably the more maintainable of the two.
That said... depending on the actual processing you're doing, you might consider moving portions of your UI to a more maintainable platform. The .NET framework / WPF can do some pretty amazing things, and with good implementation of patterns like MVVM and can be amazingly maintainable. Ditto the networking side; WCF abstracts a lot of common protocols away from the code, making for cleaner, more maintainable networking code. You can even write your translation layer between your unmanaged processing and your managed layer in C++/CLI.
That said, it's all very subjective. I can't tell enough from your bullet points to make a good judgement on whether or not you can offload some or even all of your processing to .NET/C#. It's worth considering, but my gut tells me that it's probably not your best bet.
As a fan of Qt I would be remiss not to mention it.
Although cross-platform is not one of your criteria, it is a nice bonus.
Qt also has good video hardware support through OpenGL (I'm not sure that it will help with capture hardware though).
It is open-source so you can get your hands as dirty as you like.
It is highly customizable.
It is actively developed and has a large community.
MFC programmers should not have much trouble coming up to speed.
You should also read through some of these questions and answers:
Good C++ GUI library for Windows
https://stackoverflow.com/questions/610/gui-programming-apis
What I had did before when developing a C++ scientific application is that, it will develop it completely under console based application. The console based application will able accept various type of command from user keyboard, and perform action accordingly. For example :
image_processor > load input.png
image_processor > save out.png
The good thing on this is, I can 100% in concentrating my algorithm design, without worry much on how to fit into the GUI framework. Either they are MFC or QT.
At the end of day, instead of taking input from keyboard input stream, I will just simply hook my console based application's STDIN, to the GUI application communication channel. My GUI application will then string based command, to talk and receive feedback from the console application.
Guess what I use to develop the GUI? Java Swing :)
I guess I am taking Unix people approach. See what Joel says :
Suppose you take a Unix programmer and a Windows programmer and give them each the task of creating the same end-user application. The Unix programmer will create a command-line or text-driven core and occasionally, as an afterthought, build a GUI which drives that core. This way the main operations of the application will be available to other programmers who can invoke the program on the command line and read the results as text. The Windows programmer will tend to start with a GUI, and occasionally, as an afterthought, add a scripting language which can automate the operation of the GUI interface.
I realize by taking Windows approach, you will end up with a more user friendly application. However, if your main concern is to get the sophisticated algorithm written well and GUI is the secondary, I would suggest that you go for Unix approach.