summaryrefslogtreecommitdiffstats
path: root/demos/spectrum/app/mainwidget.h
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year to 2011.Jason McDonald2011-01-111-1/+1
| | | | | Reviewed-by: Trust Me (cherry picked from commit ac5c099cc3c5b8c7eec7a49fdeb8a21037230350)
* Play whole file in spectrum analyzer demoGareth Stockwell2010-10-291-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change required a significant refactoring of the application, including: * Re-write WavFile class so that it inherits from QFile rather than taking a QIODevice as an argument to its method calls. * Modified Engine class so that its internal QByteArray buffer (m_buffer) need not correspond to the entire clip. This was done by introducing the m_bufferPosition variable, which indicates the offset from the start of the clip to the start of the region of the clip which is currently held in memory. For tone generation and record/playback modes, the buffer does still map directly to the whole clip, so m_bufferPosition is always zero. For file playback, the WavFile instance is the QIODevice which is passed to QAudioOutput; m_buffer is just the part of the file which is currently in memory for spectrum analysis, level calculation and waveform rendering. * For file playback, introduced a second WavFile instance as a member of the Engine class. This is because QFile::seek() is called in order to read the part of the file currently required for analysis. If the QAudioOutput implementation passes its QIODevice across a thread boundary, this seeking causes playback to jump around within the file rather than progressing smoothly forward. * Modified the audioLength utility function so that its return value is always a multiple of the sample size. In the process of making the above changes, a few other minor modifications were made: * Modify all internal APIs concerned with buffer offsets and lengths to deal in bytes. Previously, some calls passed values in microseconds and others in bytes, which was confusing. * Remove write functionality from WavFile class, since it is not used in this application. Task-number: QTBUG-12936
* Do not unnecessarily reset state of spectrum demoGareth Stockwell2010-10-291-0/+1
| | | | | | | | | | | | | | | | | | | This patch ensures that the state of the application is not reset when: - Any of the 'Play generated tone', 'Play file' or settings dialogs are opened - Any of the 'Play generated tone', 'Play file' or settings dialogs are dismissed by pressing the Cancel button - A new input or output device is selected via the settings dialog, and that new device supports the data format which is currently being used within the application - The window function is changed via the settings dialog Note that the application is still reset if a new input or output device is selected via the settings dialog, and this device does not support the current data format. Task-number: QTBUG-12935 Task-number: QTBUG-14810
* Demos: Fix compilation with namespace.ck2010-06-101-1/+0
|
* Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Thiago Macieira2010-05-271-28/+30
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/spectrum/app/engine.h demos/spectrum/app/mainwidget.h demos/spectrum/app/settingsdialog.h demos/spectrum/app/spectrograph.h demos/spectrum/app/spectrumanalyser.h demos/spectrum/app/tonegenerator.h demos/spectrum/app/tonegeneratordialog.h demos/spectrum/app/utils.h demos/spectrum/app/waveform.h tests/auto/qtextcodec/tst_qtextcodec.cpp
| * Build fix for spectrum demo when -qtnamespace is usedGareth Stockwell2010-05-251-5/+6
| | | | | | | | | | Task-number: QTBUG-10881 Reviewed-by: Liang Qi
| * Fixed license headers in spectrum demoGareth Stockwell2010-05-251-22/+25
| | | | | | | | | | Reviewed-by: Jason McDonald Task-number: QTBUG-10887
* | Examples: Fix compilation with namespace.ck2010-05-201-0/+3
|/
* Corrected headers for spectrum analyzer demoGareth Stockwell2010-05-061-0/+2
| | | | | | | | - Added /3rdparty/ to directory path for FFTReal code - Added missing $QT_BEGIN_LICENSE$, $QT_END_LICENSE$ - Fixed incorrect license in app/wavfile.cpp Reviewed-by: trustme
* Add spectrum analyzer demo appGareth Stockwell2010-05-051-0/+136
This application is a demo which uses the QtMultimedia APIs to capture and play back PCM audio. While either recording or playback is ongoing, the application performs real-time level and frequency spectrum analysis. Reviewed-by: Alessandro Portale