diff --git a/CHANGES b/CHANGES index adf00670..70f988a1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,1266 +1,1268 @@ + * enabled support for high dpi displays (icon scaling) + 18.03 [2017-11-13] * do not reset undo/redo information when saving blocks or selection only * ask for confirmation (Continue/Cancel) before doing a revert * switched on MP3 support per default * bugfix: crash in pulseaudio playback * fixed some untranslated menu entries of plugins (missing context) * bugfix for sporadic fail of libaudiofile when seeking at EOF * improved C++11 compatibility 17.08.2 [2017-10-08] * new plugin: export to K3b project file * reduced flicker of position widget * bugfix: deleting labels per menu did not work * bugfix: wrong text in file progress dialog when saving * bugfix: compression type lookup did not work when using static functions * bugfix: distinguish ogg/vorbis and ogg/opus by mime type * changed license of audio samples to CC BY-SA 4.0 17.04.0 [2017-03-19] * use KDE versioning scheme * removed kwave.lsm and some now unneeded scripts (filter-pot.pl, get_lsm_entry.pl and set_version.sh) * simplified version number handling * eliminated cmake/FindOggVorbis.cmake * changed licenses of all cmake files to BSD license * bugfix: wrong assert in Stripe.cpp * OggOpus decoder: fixed unwanted data duplication (may lead to out-of-memory) * saveblocks: special handling for slashes in parts of a generated file name, e.g. title or meta data item - replace with similar unicode character * saveblocks: special handling for (multiple) whitespaces in parts of a generated file name - replace with single spaces * saveblocks: do not ask on every file in case that not all file properties are supported by the chosen encoder * saveblocks: use the block title (description of the left side label) as tile of saved block * bugfix: file was left in "modified" state after adding a label and canceling * re-activated the "label" menu * renamed command "add_label" -> "label:add" * renamed command "delete_label" -> "label:delete" * renamed command "edit_label" -> "label:edit" * implemented loading and saving of labels * allow special value -1 as index for label:delete(...) to delete _all_ labels * doc: split off developer sections from handbook into separate file, to reduce load of translators. new make target "html_doc_devel" (included in "apidoc") * label edit: avoid position from snapping too much away when adding a label in the gui while last edit was in percent mode * implemented moving of labels per mouse * show cursor line for orientation during drag&drop 16.12.0 [2016-11-28] * project moved from kdereview to kdemultimedia * added genre types 126..191 * record plugin: fixed crash when restarting record in MDI or tab mode * record plugin: reset did not work when clicking the "New" button shortly after starting the recording * record plugin: selection of default recording method did not work * revised use of signal handler in WorkerThread * WorkerThread: no longer use "bool" for signaling the wish to terminate, use QAtomicInt instead (also applies to Plugin class) * changed order of application object creation and setting up command line parser + about data * got rid of I18N_NOOP in main.cpp * bugfix: untranslated strings in menu * LICENSES file still mentioned Qt-4/KDE-4 libraries * CMakeLists.txt: remove RPATH settings * fixed small memory leak in menu group handling * fixed i18n of application AboutData * bugfix: internal name of "goto" plugin was wrong * bugfix: wrapper script did not work * fixed wrong encoding of error messages received via strerror and libs * bugfix: handling of File/Revert was wrong in case of newly created file 0.9.2 [2016-06-26] * recording via Qt Multimedia * using KDE service API for loading plugins * bugfix: screenshot function sometimes returned 1x1 image only (bug in Qt QWidget::frameGeometry is broken, but QWindow::frameGeometry works) * Gentoo ebuild updated to EAPI=6 * removed unneeded build and runtime dependencies * removed optimized memcpy for PowerPC * record plugin: improved handling of error messages * record plugin: added retry mechanism in case of device busy * added menu entries for recording and record setup * import of Core Audio Format (*.caf), using ALAC, A-LAW, U-LAW and IMA compression * import of Sample Vision Format (*.smp) * import of NIST SPHERE Audio File Format (*.nist) * import of Creative Voice files (*.voc) * import Audio Visual Research File Format (*.avr) * import of Amiga IFF/8SVX Sound File Format (*.8svx) * handbook: description of parameters of the record plugin was missing * handbook: fixed duplicate ":" in header of plugin parameter descriptions * made Kwave::SampleFormat and Kwave::Compression independent from libaudiofile 0.9.1 [2016-02-21] * ported to KDE Frameworks 5 (KF5) / Qt5 * playback via Qt Multimedia * bugfix: saved plugin parameter lists with escaped characters were not unescaped when loading again * compile fix for armv7l * codec_mp3: added missing "help" button to encoder setup dialog * fixed invocation of file dialog, as suggested by EBN * support for cmake > 3.3, fix for policy CMP0063 * cmdline option "--nofork" no longer exists * bugfix: multiple issues in context of switching the GUI type in scripts * bugfix: fixed issues in saveblocks plugin with special characters in filenames and patterns, format strings of second and later invocations of patterns were ignored * saveblocks: allow path separators in filename patterns to make it possible to create subdirectories * saveblocks: added patterns to include file info (file meta data) or the title of the current block * workaround for bug in KDE #345320 (missing translators in help/about dialog) * about plugin: added info about translation team * added screenshot of the edit_label dialog * bugfix: tooltips of the fileinfo dialog were not translated * new make target: "make msgstats" to show the progress of translations * compile fix for armv7l * playback: dropped Phonon support (was broken and no longer supported by KF5) * bugfix: hourglass cursor was not taken back in playback setup dialog * RPM: format of changelog has changed * changed plugin install directory and prefix/suffix * curve widget: use same colors as in frequency response widget, for better readability on bright color themes 0.9.0 [2015-05-25] * first version hosted on KDE (kdereview) and SourceForge * added command line parameter for selecting the GUI type * in MDI mode: new menu entry + function to arrange sub windows vertically * handbook: added text command reference * handbook: added plugin reference * enabled the "Help" buttons of all plugins and let them open the corresponding section in the handbook * make system: new target "update-handbook" (updates command, file info and plugin cross references) * make system: fixed dependency problem in translation * new commands: "window:sendkey", "window:screenshot", "window:close" and "window:resize" * built-in variable ${LANG} for kwave commands * support for delayed command execution * debug plugin: always compiled in, but only visible in debug build * new command sync(): wait for commands scheduled with delayed * bugfix: exporting a mono file as MP3 produced a stereo MP3 file * MP3: emphasis, copyrighted, original got lost during save/load * file info dialog: MPEG settings were not handled properly * bugfix: assert/numeric overflow in selectnextlabels() at end of file * new plugin: stringenter * bugfix: minimized windows were not migrated properly when switching GUI type * new command: window:minimize * bugfix: missing range check in noise generator (when used per script) * bugfix: saveblocks plugin did not work when omitting file extension * saveblocks plugin: use escaped strings for storing settings instead of base64 0.8.99-2 [2015-01-02] * bugfix: wrong sub window mode when switching to tab mode when having only one sub window (workaround for bug in Qt) * bugfix: recording did not work in MDI and Tab mode (wrong file context) * bugfix: fixed passing a text command as first command line parameter * new commands: delayed, window:click, window:sendkey, window:close, window:resize, window:screenshot 0.8.99 [2014-12-28] * GUI: implemented SDI, MDI and Tab GUI modes * bugfix: deadlock in class Track * bugfix: segfault during shutdown of logger * bugfix: segfault when unloading plugins (on some systems) * bugfix: "zoom to selection" was not disabled if nothing was selected * bugfix: toolbar buttons for cut/copy/erase/delete did not properly get enabled/disabled on change of selection * bugfix: overview widget did not properly refresh after deleting all tracks * bugfix: assert in vorbis decoder when opening file with bitrate -1 * menu subsystem: added support for lists within a menu * menu subsystem: show/hide toplevel menu entries * menu subsystem: added support for exclusive selection (radio buttons) * menu subsystem: let KDE chose shortcuts automatically * added menu entry to clear "recently opened files" list * implemented URL scheme for passing text commands from the command line example: kwave --iconic --disable-splashscreen test.wav \ kwave:plugin%3Aexecute?normalize \ kwave:save \ kwave:quit * using perl scripts creating for i18n from menus.config and for getting entries from lsm files, no longer need awk, sort, uniq * creating menu translation template directly per perl script instead of generated dummy cpp file (requires "msgcat") * menu translations: assign a context to each menu entry * bugfix: division through zero on ogg files with invalid bitrate info * manual: added section about GUI types * i18n: translations were missing in kwave.desktop 0.8.12 [2014-06-04] * recording via PulseAudio, by Joerg-Christan Boehme * bugfix: "Close" button of the record dialog did not save settings * bugfix: amplify free plugin: untranslated action names in progress bar * bugfix: sonagram plugin did not honor the windowing function parameter * bugfix: coherency problems in overview cache * bugfix: metadata got lost after cut/undo/redo * bugfix: save/as check against overwriting existing files failed * bugfix: undo/redo did not work after recording * bugfix: signal was "modified" after canceled record (empty) / done * bugfix: wrong calculation of zoom and window geometry at startup * bugfix: wrong scaling of overview in sonagram window * bugfix: playback pointer did not update synchronously across tracks * bugfix: brought back support for optimized memcpy (from xine-lib) * updated memcpy.c + cpu detection, including AVX assembler support * new command line option: "--logfile=" for logging to a file * brought back the horizontal scroll bar * support for swap files to store undo data * speedup: too many copy-on-write operations, use more const data * improved robustness against out of memory situations * memory manager: added statistics for debugging * memory settings: only use up to 25% of process address space * internal cleanups: renamed openSampleReader -> openReader, fixed signature of Signal/SignalManager::openWriter * speedup: use stripe list instead of raw data for saving undo data * debug plugin: added functions "labels_at_stripes", "sawtooth_verify" and "dump_metadata" * automatic defragmentation of stripes * sonagram plugin: use Qt Concurrent framework -> more than factor 40 faster on a quad core cpu * got rid of KDE ThreadWeaver, replaced with Qt Concurrent framework * debug plugin: added function "fm_sweep" * workaround for broken WAV files with zeroed fact chunk * fixed many 32/64 bit issues * new build target "make wrapper": creates a wrapper script to start Kwave for test/debug purpose * new build target "make dep": creates a binary debian package (for personal use and testing purposes) * mouse wheel + Ctrl: zoom in/out aligns signal to mouse position * record plugin: level meter is always enabled, simplified dialog * PulseAudio playback: fixed wrong timeout calculation * requires at least Qt-4.7 + FLAC-1.2.0 0.8.11 [2013-11-24] * added spanish translation, provided by Carlos R. * bugfix: file names were not properly escaped in context of file/open, file/openrecent and drag&drop * bugfix: saveblocks() did not abort properly when pressing cancel * unclean shutdown of the file progress dialog when saving * noise plugin: add noise (mix) instead of overwrite, with adjustable level in percent or dB * pause button: change tooltip to "continue" if paused * new command line option: "--disable-splashscreen" * new command line option: "--iconic" to start minimized * fixed quoting errors in CMakeLists.txt (cmake-2.8.12 complained) * bugfix: ASCII encoder: escape special characters in meta data * implementation of ASCII import * memory settings: raised default memory limits * bugfix: crash in file info dialog / auto generate keywords * MP3 plugin: use ID3 tag TSSE for software version * ASCII codec: implemented support for labels 0.8.10 [2013-02-09] * file name cleanup: removed "Kwave" prefix * bugfix: added range checks for track selection commands * reverted changes in sample writer due to problems in debug mode (commits ee54660d4380d264b7346a904eff9dd8d8d00a93 and 6fba04db879ea7ae1fdf79141dd93d47f9c1d403) * bugfix: unwanted termination if splash screen closed while the first toplevel widget still was starting up * moved code into namespace "Kwave" * cleanup: remove support for outdated FLAC API versions below 1.1.3 * removed unused code: libkwave/FileFormat.* * renamed source files with "Kwave" in the name * added subsystem prefix to inclusion of Qt header files * using bit types from qt (e.g. u_int32_t => quint32) * compile with DQT_NO_CAST_TO_ASCII and QT_NO_CAST_FROM_ASCII * bugfix: recording via OSS did not handle invalid devices properly * improved auto detect of svg-to-png conversion, added support for "rsvg-convert" (SF bug #38) * removed dependency to ImageMagick if "rsvg" is available * replaced libkwave/byteswap.h with generic Qt functions * replaced some Qt classes with their KDE equivalent: KLineEdit, KComboBox, KDialogButtonBox, KPushButton, KTabWidget, KTextEdit * using KDE standard buttons in dialogs * simplified plugin loading mechanism, do load/unload only at start/end of the program * delete plugin settings of old versions when detected * using QLibrary instead of functions from libdl * bugfix: shutdown sequence was incomplete * bugfix: keyboard shortcut for first menu entry did not work * bugfix: ambiguous keyboard shortcut for "File/New Window" * bugfix: undo of "modify label" caused loss of other labels * bugfix: use timeout for phonon playback, to avoid hang on unusable devices * using klocale for formating numbers of samples * added common base class for all codec plugins * reduced quality level of sample rate converter from "best" to "medium", to improve speed * refactored playback handling (controller vs. plugin) * workaround for bug in Phonon: no device names available in first call to Phonon::BackendCapabilities::availableAudioOutputDevices() * moved playback test into worker thread, for better GUI responsiveness * Phonon playback: changed to own mainloop with timeout support to avoid application hang on broken audio devices * bugfix: data loss in sample rate converter when processing streams * vorbis encoder: call to deprecated API (now use OV_ECTL_RATEMANAGE2_SET) * using estimated length for streaming file formats without length info * made sample rate conversion (libsamplerate) mandantory * increased default memory sizes * added toolbar buttons for "File/SaveAs" and "File/Close" * reordered toolbars 0.8.9 [2012-11-06] * new feature: MP3 export via external program "lame", "toolame" and "twolame", with configurable command line options * new feature: allow change of compression type via file info * fix for SF #3528848, removed -Wl,--add-needed from plugin LINK_FLAGS * speedup: improved performance of sample writer * wav import/export: support for some more meta data tags * bugfix: meta data lost when writing wav files that had meta data for product/album or subject/track at the same time * bugfix: broken signal/slot connection in SaveBlocks plugin * workaround for bug in id3lib, SF #3534143: ignore id3lib crc check result for MPEG Layer II files * bugfix: Gentoo ebuild lacked required svg use flag for media-gfx/imagemagick and media-gfx/graphicsmagick * bugfix: File/SaveAs now uses last recently used directory and extension together with the user defined file name * bugfix: PluginManager::sync caused application slowdown or stale GUI 0.8.8 [2012-05-20] * new feature: seek functionality for playback * new feature: added toolbar with record/playback/scroll functions * migration to GIT as source code management * documentation update * allowing zoom and scroll while a plugin is running * allow "close" and "quit" while playback is running * allow track selection change during playback * fix for namespace collision with libaudiofile * bugfix: mouse selection update with negative offset failed * bugfix: wrong focus of progress dialog when repairing damaged wav files * bugfix: missing updates of zoom selection combo box * bugfix: when viewing with full zoom, scroll by 1 sample was possible * bugfix: focus was wrong on program start (zoom combo box) * bugfix: wrong view when moving slider of overview widget to negative value * bugfix: playback pointer did not disappear after play - pause - stop * bugfix: creating a label without text was not possible * bugfix: saving WAV with G.711 and non-16bits/sample produced broken output * bugfix: handling of shortened tracks in encoders 0.8.7 [2011-11-27] * ebuild update for media-gfx/imagemagick <-> media-gfx/graphicsmagick (see gentoo bug #314325) * new feature: "insert at", paste clipboard at given position * fix for API change in libaudiofile v0.3.1 * speedup: loading ogg/mp3 is much faster now (up to factor 2) * bugfix: stream name of pulse audio playback used wrong encoding * update of the Kwave spec file (synced with OpenSuSE build service version) * new build target "distfiles" * updated version of the GPL v2 document (GNU-LICENSE) * support for visualization plugins 0.8.6 [2011-03-07] * bugfix: copy/paste with partial track selection failed * bugfix: labels update after undo of copy&paste failed on multitrack signals * string/i18n update from Panagiotis Papadopoulos * bugfix: invocation of xgettext was wrong, left untranslated strings * plugin API change: support for translateable short description * about plugin: use plugin info from PluginManager * bugfix: last directory of file dialogs sometimes got lost * bugfix: wrong message when canceling Ogg import * replaced sched_yield() with QThread::yieldCurrentThread() * added cmake parameter for disabling optimized memcpy support -D WITH_OPTIMIZED_MEMCPY=OFF, default is ON * integrated patch #3021795 for Qt-4.7 compatibility * bugfix: optimized memcpy for PPC (SF bug #3068664) * doc: upgrade to DocBook XML V4.2 / V1.1 * build fixes for qt-4.7 * no longer using QSplashScreen (has side effects, operates as modal window) * bugfix: startup as unique application did not work correctly * bugfix: potential crash in message loop of progress dialog * bugfix: handling of track selection was wrong in reverse plugin * workaround for bug in libaudiofile: some files have sampe rate zero, falling back to 8000 samples/sec in that case (audio/x-ircam, sun, BE) * bugfix: reverse failed on files smaller than the internal block size * using entities for URLs in handbook, to simplify maintenance * bugfix in cmake files: some invocations of STREQUAL lacked quotes 0.8.5 [2009-12-24] * new feature: playback via PulseAudio * applied kwave-0.8.2-nolinguas.patch (see gentoo bug #267702) * support for the Gentoo build system that steals .po files * no longer default to english language for documentation and gui l10n * fixed use count mismatch of plugins * bugfix: playback control: continuing after pause continued from start * bugfix: G.711 encoded wav files support only 16 bit signed format * new assignment for mouse wheel: - without modifier key: scroll left/right - with Shift: page left/right - with Ctrl: zoom in/out - with Alt: vertical zoom in/out * bugfix: support sysinfo.mem_unit when >= 4GB RAM are installed * bugfix: crash in progress dialog handling (crashed when closing a plugin after finishing it's work) * new ebuild for Gentoo 0.8.4 [2009-09-26] * new feature: support for primitive macros (batch files), playback only * new plugin: change sample rate * using libsamplerate (new dependency) * new feature: sample rate conversion on clipboard data * new feature: ability to set recording start time in advance (feature requested by John David Thompson) * bugfix: drag&drop of files on the main window was broken * workaround for bug in id3lib which crashed in ID3_Tag::GetSize() with some MP3 files (see id3lib upstream bug at SF #2821464) * bugfix: recording via ALSA, crash on snd_pcm_close(), see SF bug #2816544 * bugfix: playback plugin: infinite loop when switching from OSS to ALSA * bugfix: forcing clipboard and drag&drop data to uncompressed mode * bugfix: deadlock in progress bar handling * bugfix: crash when unloading plugins with queued events * help/about dialog: hide "translators" tab if no translator available * help/about dialog: hack to allow web addresses of translators * bugfix: selection was not set after "paste" and undo of other operations * bugfix: label handling in context of "delete" and "undo" was broken * bugfix: invalidation of overview cache after delete was not correct * bugfix: artifacts in track display in min/max overview mode * bugfix: add/delete/modify of labels did not set the state of the current file to "modified" * bugfix: record dialog caused shutdown to hang when closed while recording * bugfix: decoding 32bit/sample was broken * bugfix: recording level meter consumed 100% cpu * new make target: "make apidoc" for internal doxygen documentation * bugfix: some images and icons in non-english documentation were missing * volume plugin: preview was not updated on first use of plugin 0.8.3-2 [2009-07-04] * bugfix: re-enabled detection of optimized memcpy function * bugfix: deadlock in recording plugin and plugin management (see SF bug #2816544) * bugfix: ID3 tag import did not work * taking ID3 tag for "album" as "product" in wav meta data * taking ID3 tag for "track" as "subject" in wav meta data 0.8.3 [2009-06-28] * integrated 05-do-not-install-so-symlinks.diff from Debian (thanks to Aurelien) * cs i18n update from Pavel Fric * new plugin: normalize * progress bar in volume plugin did not work * flattened "Fx" menu, no submenus for amplify and filter * bugfix: workaround for libaudiofile bug produced wrong header in 24bit/sample mode * bugfix: "fade outro" was broken * bugfix: the dialog when playing the test sound in the playback setup dialog did not appear * replaced qreal with double (fixes build problems on arm) * show hourglass / progress bar when undo/redo is running * flattened "Calculate" menu, no submenus for "Frequencies" * wav encoder: auto-switch to unsigned format for <= 8bit and signed format for > 8 bit per sample * volume plugin: show a little "preview" for guessing the level * bugfix: after deleting a track, file info was not updated * about plugin: separate tab for translators * made plugin API version configurable per plugin * recognize mime type "audio/x-vorbis+ogg" (found in KDE-4) * updated czech gui translation and user manual from Pavel Fric * bugfix: crashes when deleting objects that still have event queued with Qt::QueuedConnection -> now using Qt::BlockingQueuedConnection * new plugin: reverse * speedup: limiting the number of progress bar updates per second * memory manager: fixed multithreading issues, improved OOM behavior * bugfix: received SIGBUS in SwapFile when disk was full * improved performance of memory management * require Qt4 v4.5.0 or newer 0.8.2 [2009-04-25] * bugfix: minor off-by-one bug in buffer handling * wav/RIFF parser: be more robust if the file has not been correctly padded * bugfix in wav encoder: padding for info and label chunk was missing * bugfix: if two markers were too close and displayed at the same pixel position they eliminated each other through XOR mode * bugfix: numeric overflow when trying to select labels in high zoom factors * bugfix: not all positions were selectable due to internal rounding errors * silence plugin now supports all modes * use "unsigned" sample format per default when creating new files with <= 8 bits/sample * bugfix: playback position was shown on startup * bugfix: show correct file size in progress dialog * bugfix: crash when deleting label from end of signal * bugfix: overview was wrong when deleted space after signal was visible * bugfix: overview was not always synchronized after delete/insert * bugfix: "modified" state got lost during undo * use ALSA per default for playback/record if nothing has been selected yet * fixed calculation of undo/redo sizes * undo/redo handling for sample range and track selection * processing updates of overview widget in a background thread * memory management: no longer evaluate RLIMIT_RSS, gives more available physical memory * portability fix: swapfile creation/destruction went wrong * feature: memory for undo/redo can now be configured * bugfix: handling of "continue without undo" produced wrong undo/redo states and asked several times * bugfix: file progress did not do GUI updates, cancel button did not work * bugfix: assert in record plugin if no valid sample rate available * speedup for generation of signal overviews in min/max mode * bugfix: MultiTrackWriter produced one extra sample (off by one error) * workaround for bug in libaudiofile: sometimes libaudiofile produces broken files as it uses 'float' for internal calculations (wrong size of 'data' and 'RIFF' chunk) => see ubuntu bug #327018 * implemented "debug" plugin, with internal functions for test and verification (quality improvement) * added czech gui translation from Pavel Fric * bugfix: after creating a new empty file, "revert" was possible * speed optimizations in buffer handling * speedup: limiting the rate of progress updates when loading and saving files * fixed displayed names of actions based on the "amplifyfree" plugin * bugfix: menu entry translation did not work correctly * bugfix: deleteLater on menu nodes did not work, implemented own garbage collector * speedup: use different block sizes for interactive and non-interactive mode * i18n fix: texts in help/about menu were untranslated * about plugin: new tab for translators 0.8.1 [2008-12-23] * replaced application icon, now using a scalable svg image * replaced GSL with FFTW3, which is license compatible with Kwave * use implicit sharing for Label class * new clipboard implementation, using the clipboard of KDE (X11) * fixed enable/disable of copy/paste functions depending on clipboard state * re-enabled function "flush clipboard" * re-enabled function "invert track selection" * re-enabled function "select all tracks" * implemented plugin for "go to position..." * added status bar item for current cursor position * show current playback position in status bar * show selection in overview widget * bugfix: mode switch in time selection widget did not work properly * bugfix: handle situation when adding or moving a label to a location that is already occupied by another label * show labels in overview widget * show current playback position in overview widget * overview widget: dimming parts that are out of view * no longer needing built in copy of libaudiofile, removed 0.8.0 [2008-09-27] * ported to KDE4 / Qt4 * dropped support for FLAC API v1.1.1 and older * support for ALSA lib API v1.0.16 * made MP3 decoder disabled per default due to legal issues * fixed bug in cue list parsing of .wav files * fixed bugs in recording plugin, recorded too much if recording time limit was activated or in prerecording mode * a much nicer splash screen * bugfix in label handling: support labels with zero-length names * re-arranged source files for cleaner library interfaces * re-enabled accelerator keys for 0..9 * using horizontal scrollbar instead of overview widget * implemented vertical zoom (Ctrl + MouseWheelUp/Down) * using more standard KDE keyboard shortcuts * nicer icons for the menus * using more icons from the crystal icon collection (to clearify the license situation) * removed aRts support * now also available through the openSUSE build service for various platforms * respect the LINGUAS environment variable to build only needed languages (defaulting to all) * removed changelog from online manual to simplify the work of translators * no longer dependent from "recode" * recording plugin: show current recording time in status bar * fixed infinite loop on undo/redo of channel selection * usage of GSL can be disabled through cmake parameter -DWITH_GSL=OFF * support for OSS v4 (integrated sf feature request #1870434) 0.7.11 [2007-12-09] * new internal streaming architecture, based on Qt instead of aRts * aRts support is now disabled per default * some minor bugfixes for x86_64 support * band pass plugin 0.7.10 [2007-08-08] * build system: using 'METASOURCES=AUTO' (which simplifies a lot) * ported the build system to cmake * support for newer APIs of FLAC v1.1.3 and v1.1.4 (closes SF bugs #1713655 and #1757716 + debian bugs #427747, #426668 and #431199) * replaced problematic code in libaudiofile with new code under the LGPL, contributed by Bertrand Songis (partially fixes debian bug #419124) * update of the online documentation to reflect the change of the make system 0.7.9 [2007-05-01] * playback via ALSA: offer the "default" device, if no devices found offer the "null" device * implemented import and export of labels, currently only for uncompressed wav files * new plugin for saving blocks between labels as separate files * new function: expand selection to labels * new function: select next/previous range between labels * bugfix: don't change the file name when saving only the selection * new configure option: --enable-doc=yes/no to enable/disable the generation of the online documentation (default=yes) 0.7.8 [2006-12-31] * bugfix: workaround for bug in ALSA, crashed when initializing the dsnoop plugin * bugfix: error in swap file handling, one sample was destroyed when resizing. Affects cut, delete, crop and many other functions. * fixed the incorrect usage of the word "loose" (thanks to J.T. Hundley) * bugfix: went back to old implementation of ThreadsafeX11Guard class in order to fix a deadlock (closes sourceforge bug #1623357) * documentation update: mention Subversion instead of CVS * zero plugin: new mode, support for inserting a range filled with silence * fixed the macro functions "Fade Leadin" and "Fade Leadout", using the new mode of the 'zero' plugin * export of ASCII format files 0.7.7 [2006-09-17] * new feature: implemented a small widget that shows the current selection position and the selection borders * new feature: context menu for the signal widget (right mouse button) * improved file open dialog: show "All Files" and "All Supported Files" * bugfix: error in handling of mouse selection * bugfix: recording only used the first channel (closes sourceforge bug #1551050) * install plugins kde_moduledir/plugins/kwave instead of kde_datadir/kwave/plugins 0.7.6 [2006-06-05] * bugfix: recording setup crashed when called for the first time * bugfix: do no longer crash when recording device is not present or opening failed * bugfix: fixed generation of rpm dependency for libmad * bugfix: update the size of the level meter if the dialog size has changed * record plugin: added a fancy status bar * record plugin: added autodetect/scanning for OSS devices * record plugin: added dsnoop plugin as ALSA source * record plugin: fewer annoying message boxes, instead show a short notice in the status bar for some seconds * record plugin: add logarithmic scale to the level meter and use 3 colors * playback plugin: added autodetect/scanning for OSS devices * playback plugin / ALSA: support for 18 and 20 bits/sample * playback plugin / ALSA: support for big endian 0.7.5 [2005-12-31] * draw signal in a different color set when not selected * bugfix: solved deadlock situation when starting a plugin while another plugin was still running * workaround for deadlock when trying to close the current file while a plugin is still running * bugfix: delete range only in selected tracks * thrown over board the idea of using gstreamer due to serious license issues, we will wait until KDEMM is out (KDE-4) instead. 0.7.4 [2005-10-16] * recording via ALSA * support for the silently changed API of libFLAC++ v1.1.2 (closes sourceforge bug #1243707 + debian bug #289953) * fixed support of MMX / SSE detection on X64_64 architecture (closes sourceforge bug #1244320 and debian bugs #288781 + #327501) * decided to support gstreamer as streaming engine in future versions (will make v0.8 if Kwave is aRts-free) * fixed some German translations (closes debian bug #313790 and bug #314000) 0.7.3 [2005-05-26] * playback via ALSA * completely new playback settings dialog, with support for aRts, ALSA and OSS * playback plugin: play a test sound * record plugin: detect when device is alread open, now no longer blocks. Show an error message. * smoother signal display in overview mode (no gaps) and improved polyline mode * replaced some of Kwave's multithreading classes with classes from Qt * compiles under SuSE-9.3 * ebuild file for Gentoo Linux 0.7.2 [2004-12-31] * big rework of the internal streaming/storage subsystem, support for multiple stripes. Makes a big speedup when handling large files! Creating an empty 512MB file before: over 350 sec, now: about 25 sec (on my system) * optimized versions of memcpy() for ix86 (using MMX, MMXEXT, 3DNOW, SSE, SSE2) and for PowerPC, copied from the xine project * some support for X86_64 * bugfix: in memory setup plugin, set virtual memory limit only if the limit has been enabled (checkbox is clicked) * bugfix: clipping in Ogg import filter was incorrect * speedups: import of Ogg and MP3 files improved * removed code copied from the GSL library, link against the shared library instead * added target "package-messages" to the toplevel Makefile, for translators 0.7.1 [2004-07-10] * FLAC (Free Lossness Audio Codec) import/export plugin * speedups for loading / saving files * removed our own copy of libmad from the source tree, now it should be available in all common distributions * implemented pre-recording * implemented recording time limit * bugfix: minor bug in the recording state machine * bugfix: solved some layout issues in the about- and sonagram plugins * bugfix: cancel while saving to .ogg works now * update of the online documentation, many screenshots * improved Makefile dependencies of the plugins, now parallel builds also work and speed up the creation of plugins 0.7.0 [2003-12-01] * first version with recording functionality (still alpha) * removed workaround for uic invocation * bugfix: handling of persistent and unique plugins was wrong, which caused playback to work only in the first main window instance * added project files for kdevelop-3 0.6.7 [2003-06-28] * new plugin: "pitch_shift" * new plugin: "lowpass" * new plugin: "notch_filter", contrinuted by Dave Flogeras * included a bugfixed version of the synth_pitch_shift aRts plugin * new feature: "pre-listen", first implementation in pitch_shift plugin * ported to work with Qt-3.1 without Qt-2 compatibility, also compiles with -DQT_NO_COMPAT -DQT_CLEAN_NAMESPACE 0.6.6 [2003-03-29] * works with KDE-3.1 * many improvements on the build system. Now compiles under Debian, Mandrake, RedHat, Gentoo and SuSE * starting up with last window size * Xt toolkit option for geometry works again, including workaround for bug in KDE3's geometry management. example: "kwave -geometry 800x600" * bugfix: select to left selected one sample less then needed * volume plugin: simple clipping * volume plugin: mode for "multiply with /divide through factor" * newsignal and selectrange plugin: got rid of KDoubleNumInput and it's weird display and entry behavior * selectrange plugin: also select start position of selection * can use libmad and libaudiofile from the host system if usable * show the fileinfo plugin when saving under a different mime type 0.6.5 [2002-11-09] * MP3 import with ID3 tag support through id3lib and libmad * Ogg/Vorbis import and export (only ABR mode) * new plugin "volume" * show selected range as time (feature requested by Christian Hollaender) * support for saving compressed .wav files * thrown away Qt2/KDE2 compatibility, now only supports Qt3/KDE3 * playback plugin: enabled the "select..." button for choosing other playback devices (feature requested by Len Ovens) * solved problem with name mangling in plugins and different gcc versions * works with gcc-3.2 / solved __dso_handle problem * stricter checks for programs in configure script 0.6.4 [2002-06-30] * support for different file formats / integrated libaudiofile * drag and drop bugfix: dropping into the same signal left from the selection removed wrong range * auto-repair for structurally damaged wav files * bugfix: save selection works again * integrated libkwavemt into libkwave * using time instead of zoom factor, e.g. set zoom to "1 minute" (feature requested by Gilles Caulier) * menu entries for playback control * some more icons in the menus * replaced KFileDialog with subclass KwaveFileDialog (works around some bugs in KDE) * added a little chapter about digital audio basics to online help * added "select range" plugin 0.6.3 [2002-03-01] * simple drag and drop * french translation * handling of "signal modified" * shows error message and aborts if loading failed 0.6.2 [2001-12-24] * new plugin "amplifyfree" * new plugin "noise" * >>> new aRts plugin adapter framework <<< now Kwave is able to use existing aRts plugins in it's own plugins for sound processing * changed documentation to XML / Docbook-4.1 * recovery of damaged files if non-zero file length but data length entry in the wav header is zero (e.g. happens when krecord crashes during recording) * bugfix: freeing virtual memory fixed in MemoryManager * bugfix: problem with TSS in TSS_Object cleanup 0.6.1-1 [2001-09-01] * bugfix: class Track made duplicate entry in stripe list when inserting signals into an empty track * fixed that weird layout behavior in dialogs, seems that Qt has problems with complex nested layouts :( 0.6.1 [2001-08-24] * >>> USE OF VIRTUAL MEMORY <<< * changed Makefiles: html docu stays in distribution due to too much trouble with the KDE documentation tools * when inserting from clipboard into a signal with a different number of tracks, the result will be mixed (still not optimized/slow) * fixed compile problem with gcc-2.96 / gcc-3.0 * fixed missing header file in NewSigDlg.ui * the RPM should be relocatable again * fixed bug in shutdown sequence, now clipboard is flushed before the application closes. 0.6.0 [2001-07-29] * >>> PORTED TO QT-2 AND KDE2 <<< * completely new internal architecture * plugins can be located in a user directory * libkwave is included and no longer supported (at least by me) as a separate package * playback via aRts * many more bugfixes, too many to mention here... 0.5.5-1 [2001-02-23] * bugfix: selection across end of file no longer possible * bugfix: no overflow in wav header when saving large wav files above 268MB (bug reported by Sven-Steffen Arndt, ssa29@gmx.de ) 0.5.5 [2000-12-01] * new playback handling, allows pause/continue * limited the playback buffer to be between 256 and 65536 bytes due to problems (system hang) with small playback buffers with 16..64 bytes (might be a hardware problem) * introduced a toolbar for some standard operations * fixed some bugs concerning selection with the mouse * rework of the overview widget (used in main window and sonagram) * fixed menu command "zoom selection" * sonagram: saving to file, auto-brightness adjust * replaced QFileDialog with KFileDialog * tested with AMD Athlon-optimized compiler (patched pegcs) * some fixes for safer multithreading * checking for much more header files at configure time (due to a problem reported by issiac@evcom.net ) 0.5.4-4 [2000-10-03] * added classes Mutex and MutexGuard * sonagram: set a transparent background for the image * added sizeHint() and minimumSize() to ScaleWidget and OverViewWidget * sonagram: removed (need for) SonagramContainer, using QGridLayout instead * moved SignalProxy to the mt subdirectory * fixed X11 synchronization problem with SignalProxy * added TSS (thread-specific-storage) support to the mt classes * added some multithreading support classes: Thread, AsynchObject, ... * removed the "get" prefix from all member functions. This is the new KDE/QT coding style. * updated the online documentation to point to the new Kwave homepage on http://kwave.sourceforge.net/ * class ImageView: always repaints (maybe image data has changed) * bugfix: selection and playpointer will not be drawn if no signal is loaded 0.5.4-3 [2000-09-09] * the sonagram window updates it's title if the signal's name changed * found a solution for the problem of synchronizing X11 and QT in a multithreaded environment * fixed bug in the "Halt" function (playback) 0.5.4-2 [2000-08-20] * geometry/layout management for the MainWidget * limited the displayed height of a signal. If not all signals fit onto the screen, a scrollbar appears on the right side of the signal. * limited the size of the TopWidget to a reasonable minimum size * automatic dependencies for the plugins work again 0.5.4-1 [2000-07-29] * fixed layout of playback dialog * started to implement a new plugin interface * geometry/layout management for the sonagram settings dialog * formatting of selection and file time (KwavePlugin::ms2string) * plugins can now consist of multiple source files 0.5.4 [2000-07-12] * some more minor changes to the Makefiles * split the documentation output into "de" and "en" part * made symbolic links to the english help directory from the "de" and "default" directory during make install and uninstall and also in the post and postun scripts of the specfile The user should at least get the english help... * alpha version of english documentation done * automatic update of the revision history in the docbook file if this file is modified (only english version) * CVS is up on sourceforge.net * changed some header lines in this file * started on writing a new documentation / online help using docbook 0.5.3 [2000-06-12] * if a file with invalid size (e.g. recorded by "arecord") is loaded, shows a message and truncates the input at the end of the file * found out that we need ALSA support for 24 and 32 bits/sample * >>> playback in stereo <<< * selected channels (x) are mixed to the output device's channels (y) at playback using a x:y translation matrix with linear scaling, all values for x and y except zero are allowed * playback only for selected channels * rework of the settings/playback dialog (plugin) * heavy reword on the playback code * fixed severe bug in SignalManager::readWavChunk(), chrashed if there was data after the wav chunk 0.5.2-12 [2000-06-02] * copied the AsyncSync class into libgui, should be used for threadsafe usage of the qt library * moved handling of the "selected" flag from class SignalManager to class Signal * fixed selection of channels if appended or deleted 0.5.2-11 [2000-05-28] * included config.h in each source file (except the plugins) * export to ASCII for multi-channel signal (multi-channel import has still to be done, currently only mono) * fixed many memory leaks and inconsistent delete operations (e.g. used "delete" instead of "delete[]") * included support for (and tested with) the error detection and memory debugging tool "Insure++ Lite 4.1" (./configure --enable-insure=yes ...) -> thanks to ParaSoft Corporation for making this limited version of the tool available (http://www.parasoft.com) * SignalWidget uses three layers for drawing, speeds up the redraws after mouse selection by about factor 14(!!!) on my system :-)) 0.5.2-10 [2000-05-21] * some minor bugfixes in the Makefiles * save the kwave.spec and include it into the source archive, this lets "rpm -ta kwave-x.x.x-x.tar.gz" work * wrote a new README file, moved Martin's version to README.OLD * RPM_OPT_FLAGS are appended to the compiler options, this lets pentium optimizations work :-) * shows a message box if loading of a file failed 0.5.2-9 [2000-05-19] * list of recent files is synchronized across all toplevel windows * fixed dozens of memory leaks, missing ASSERT constructions, missing variable initializations and possible divisions through zero * Help menu aligned to the right side (MenuRoot now is able to process the special command "#separator") 0.5.2-8 [2000-05-18] * replaced all occurances of sprintf with snprintf, strcpy with strncpy (in 92 places) ! * doesn't show any zoom factor if no signal is loaded * handling of channel add/delete: selection/speakers are shifted * changed some variables/parameters to "unsigned" (simplifies range checks) * beautified this file * beautified the whole source code according to my favorite coding style. -> thanks to the developers of the "Artistic Style" package, astyle-1.11.4-1 made good work :-) * fixed that annoying flicker in the help/about dialog * checking for sizes of char, short and int at configure time * globals.app will not be used (obsolete, should be removed from libkwave) * MessagePort will not be used (obsolete, should be removed from libkwave) * multiple toplevel windows are possible * made X toolkit parameters work (especially "-geometry") * bugfix concerning loading/saving 8 bit .wav-files (always unsigned !) * >>> COMPLETE REWORK OF THE INTERNAL COMMAND STRUCTURE <<< - made use of a combination of signals/slots and string messages - hierarchical processing: commands are are forwarded "upwards" until they reach a TopWidget - the TopWidget (highest level) dispatches the commands and forwards them to the lower levels 0.5.2 [2000-04-24] * rpm package should now be installable without conflicts and compile without any previous installation of kwave * removed the "${KDEDIR}/share/doc/HTML/default" directory from the rpm so that it doesn't conflict with the already existing one * shift+Home/shift+End selects from the current left/right position up to the start/end of the signal * bugfix in display of signal: signal is no longer inverted * selectrange() works now * the zoom factor combo box reflects the current "real" zoom factor * some bugfixes in menu handling / cleanups * complete rework of zoom and offset handling: - simple poly-lines instead of lowpass interpolation if zoom factor has less than 10 pixels per sample - lowpass interpolation if more than 10 pixels per sample * bugfix in KWaveApp: now sets globals.app to this if it was null before, now doesn't crash if it loads a file specified at cmdline 0.5.1-4 [2000-04-16] * >>> now compiles and runs under RedHat 6.1 / Halloween IV <<< >>> as well as under SuSE 6.2 <<< * version info of libkwavegui.so is set to the package's version * bugfix in plugins/template/Makefile.am: will not create .moc files on make distclean and other targets * compiler flags are passed through to plugin compilation * compiling with --no-rtti. This was necessary to compile against the kde libraries of RedHat that seem to contain no rtti. As a side effect all warnings on linking programs/libs disappeared :-) * configure-parameter --enable-debug has effect again * >>> ASCII import and export works now (mono only) <<< * bugfixes in some plugins, all compile now without warnings/errors * plugins are processed in alphabetical order * all plugins are automatically found and compiled * new target "make src.rpm" makes only the source rpm 0.5.1-3 [2000-04-03] * display will be scrolled left or zoomed if something from the end of the signal is deleted * curve parameters of fade in / fade out work again 0.5.1-2 [2000-03-16] * converted many "klocale->translate(...)"s into "i18n(...)" * target "make messages" works again * converter for menus.config, creates a dummy .cpp-file that is handled by i18n 0.5.1-1 [2000-03-13] * new target "make rpm" creates binary and source RPM packages * fixed the shared-library-problem in the build system 0.5.1 [2000-02-28] * menu items can belong to groups * renamed SignalWidget::info to "refresh" * many cleanups in the header-Files in src and libgui * the menu management has completely been rewritten: - Menu, NumberedMenu and MenuCommand classes are deleted - new classes: MenuNode, MenuItem, MenuSub, MenuToplevel and MenuRoot * menu items can have icons * menu nodes can have unique string ids * special menu commands start with a "#" * first attempts for internationalization * list of recent files is sorted by time of last usage 0.5.0-1 [1999-12-27] * moved my modifications from the Makefiles to Makefile.am * included targets "make release", "make patchlevel" and some scripts 1999-12-19 (by Thomas.Eschenbacher@gmx.de) * remade my modifications of some Makefiles and of the configure script that were lost during Martin's changes * changed shortcut for mixpaste from CTRL-SHIFT-X to CTRL-SHIFT-C * added the "crop" command to the edit menu * made the "mixpaste" command work * corrected the call of "delete", now really deletes instead of cutting and copying the selection to the clipboard (saves clipboard content) 1999-12-18 (by Martin Wilz ) * changed filenames to reflect class names * one class per file is now the standard * stripped leading "Kwave" in class names for most classes 1999-12-10 (by Thomas.Eschenbacher@gmx.de) * removed -Werror compiler option (caused trouble with configure script) * fixed a nasty bug in SignalManager::save that caused crashes on several positions in the program and libstdc++ 1999-12-09 (by Thomas.Eschenbacher@gmx.de) * gave the destructor of SignalManager some code, this fixes a huge memory leak ! * added a TODO file * added -Werror to the c++ compiler options when debugging enabled * some include file cleanups in libgui 1999-12-07 (by Thomas.Eschenbacher@gmx.de) * SignalManager::writeWavChunk uses buffers for writing (much faster!) * bugfix: caption of main window changes after "SaveAs" * bugfix: selected resolution takes effect * bugfix: caption of main window changes after "SaveAs" * bugfix: SignalManager::writeWavChunk now doesn't destroy the signal's data while saving * make distclean in the projekt root directory also removes zero-length files, *.orig, *.rej and *~ (just makes cleaner than before) * symbolic links to Makefile, Makefile.in and Makefile.am in the plugins directory are deleted with "make distclean" and rebuilt on "make" (changes in the referenced Makefiles in the template directory will not be reflected thousand times when creating a patch with diff) * cleanups, removed some old backup files * improved support for debugging accessible through * "configure --enable-debug=yes" (-g and -DDEBUG compiler flags) * rewritten big parts of Makefile.in for the plugins * added -O2 compiler optimization 1999-12-03 (by Thomas.Eschenbacher@gmx.de) * merged with Martin Wilz's version 1999-11-12 (by Martin Wilz ) * version numbering script donated by Thomas Eschenbacher * now using KTMainwindow for top level widgets * using timer to check message port -> alternative (threadsafe) message passing instead of signal/slot * labeling code rewritten, now incompatible with old releases * batch loading routines 1999-09-07 (by Martin Wilz ) * deleting channels works again * fixed savelabel dialog * corrected envelope dialog, string handling * connected many functions via the new string-based way of invocation * fixed some dependencies between old code and new classes (there's still more to do !) * saving should now work again * trimmed down Clipboard class * Color class as wrapper to QColor (may become independent later) * reworking Curve Class for creation via string, interpolation now uses curve objects * moved gui functions into a new library (libkwavegui) * new Classes: Parser DynamicLoader Filter (previously was a struct) * moved gui-independent functions into a library (libkwave) * rework of dialogs into single files and single plugins * new calling scheme via string commands. This will allow scripting and macro definitions. Threading is made a whole lot easier, because a only a string has to be passed and gets expanded into the needed set of parameters in each thread * io functions and playback adapted to SignalManager * Introduction of SignalManager class for multiple channel management 0.29.5 [1998-12-25] (by Martin Wilz ) * Just a fix for an annoying bug while zooming out 0.29.4 [1998-12-22] (by Martin Wilz ) * removed a memory leak in playback * triple-checked the missing Accelerators in the Menumanager. It seems to be a bug in qpopmenu, I'll wait for qt to be fixed, or until a workaround is known * recent Files are updated again, while the program is running * kwave now keeps track of last directory saved to; for user convenience * reestablished selection mechanism to match versions before 0.29.3 and corrected some otherwise screwed-up behavior * _now_ all parameters to destructors should have vanished 0.29.3 [1998-12-18] (by Martin Wilz ) * developement has slowed down a bit, this release is not as complete as I wished but since 0.29.2 has a destructor with parameters accidentally left in, and so does not compile on all systems -> here we go again... * reworked selection routines into a new class, code is still rather confusing, but seems to work * added checkmark functionality again * converted file-menus to new menu-scheme * added gui to mix channels together, the needed functions for mixing are still missing * Halt button by Gerhard Zintel 0.29.2 [1998-12-15] (by Martin Wilz ) * moved clipboard functionality to its own class * dynamic allocation of menu entries used by all classes but TopWidget * import of ascii data files 0.29.1 [1998-12-13] (by Martin Wilz ) * Bugfix for multichannel save. Now the saved files should work with other prgs * local snap to peak by Gerhard Zintel 0.29.0 [1998-11-12] (by Martin Wilz ) * changed version numbering and filename as suggested by Version 1.1 of "How To Name Things" from sunsite. The last digit will always mark be 0 for releases uploaded to ftp.kde.org. * added windowing (Hamming Hanning, Blackmann) functions * contribution from Gerhard Zintel displaying notes in fftview * Added pitch display window * implemented cursor and db scale for fft-view * added reselection and cursor change * added possibility of different display modes in Frequency representation * fixed severe quantization bug in saving 16Bit routine, reported by ? * mmaping support contributed by Juhana Kouhia * added as new Possibility to generate Signals: pulse trains * added wrapper for systems with no posixthreads -> still needs handling by configure script (change Makefile for not linking libpthread and doing a define) * First use of multiple threads (pthreads) in some functions * Pitch generation now independent of additive synthesis * added import function for ascii files * Ascii label saving now also by frequency * Label generation according to Period Detection (autocorellation) * Sonagram, FFTView and Distortion-Dialog now use ScaleWidgets * New ScaleWidget gives the user more information * Improved ProgressDialog and Interpolation class to allow multiple threads * fixed some minor bugs 0.28 [1998-07-15] (by Martin Wilz ) * changes in curvewidget (recent point has another pixmap). * sorting of labels now works without overwriting of QGList::compareItems. * bug fix for saving selection. * save Block function added. * signal finding function in markers.cpp: gui improved. * some smaller bug fixes. 0.27 [1998-07-14] (by Martin Wilz ) * first release, but never uploaded, because ftp.kde.org was down. diff --git a/kwave/main.cpp b/kwave/main.cpp index 21053f7d..44cc8544 100644 --- a/kwave/main.cpp +++ b/kwave/main.cpp @@ -1,271 +1,272 @@ /*************************************************************************** main.cpp - Kwave main program ------------------- begin : Wed Jul 15 1998 copyright : (C) 1998 by Martin Wilz email : mwilz@ernie.mi.uni-koeln.de ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "libkwave/String.h" #include "App.h" #include "Splash.h" /** * add data concerning the developers and * contributers to the about data */ static void addDataStrings(KAboutData &aboutdata) { //Developers aboutdata.addAuthor( i18n("Thomas Eschenbacher"), i18n("Project leader since 2000, core development"), _("Thomas.Eschenbacher@gmx.de"), i18n("http://kwave.sourceforge.net") ); aboutdata.addAuthor( i18n("Martin Wilz"), i18n("Creator of the project, development 1998-2000"), _("martin@wilz.de"), i18n("http://www.wilz.de")); aboutdata.addAuthor( i18n("Ralf Waspe"), i18n("Creator of the Help/About dialog"), _("rwaspe@web.de"), QString()); aboutdata.addAuthor( i18n("Caulier Gilles"), i18n("splashscreen, tests and bugfixes"), _("caulier.gilles@free.fr"), i18n("http://caulier.gilles.free.fr")); aboutdata.addAuthor( i18n("Dave Flogeras"), i18n("Notch filter plugin"), _("d.flogeras@unb.ca"), QString()); aboutdata.addAuthor( i18n("Rik Hemsley"), i18n("Level meter"), _("rik@kde.org"), i18n("http://rikkus.info/esoundlevelmeter.html")); aboutdata.addAuthor( i18n("Joerg-Christian Boehme"), i18n("PulseAudio record plugin"), _("joerg@chaosdorf.de"), QString()); // people who helped aboutdata.addCredit( i18n("Stefan Westerfeld"), i18n("Author of aRts"), _("stefan@space.twc.de"), QString()); aboutdata.addCredit( i18n("Sven-Steffen Arndt"), i18n("Kwave homepage and German online help"), _("ssa29@gmx.de"), QString()); aboutdata.addCredit( i18n("Aurelien Jarno"), i18n("Debian packager"), _("aurel32@debian.org"), QString()); aboutdata.addCredit( i18n("Robert M. Stockmann"), i18n("Packaging for Mandrake / X86_64"), _("stock@stokkie.net"), QString()); // aboutdata.addCredit(i18n("Diederick de Vries"), // i18n("Packaging for Crux Linux"), // _("diederick76@gmail.com"), // _("http://crux.nu/portdb/?command=viewport&repo=diederick&name=kwave")); aboutdata.addCredit( i18n("Martin Kuball"), i18n("Tester"), _("makube@user.sourceforge.net"), QString()); aboutdata.addCredit( i18n("Robert Leslie"), i18n("Author of the 'mad' MP3 decoder library"), _("rob@mars.org"), i18n("http://www.mars.org/home/rob/proj/mpeg")); aboutdata.addCredit( i18n("T.H.F. Klok and Cedric Tefft"), i18n("Maintainers of the 'id3lib' library"), QString(), i18n("http://www.id3lib.org/")); aboutdata.addCredit( i18n("Michael Pruett"), i18n("Author of the 'audiofile' library"), _("mpruett@sgi.com"), i18n("http://www.68k.org/~michael/audiofile/")); aboutdata.addCredit( i18n("Carlos R."), i18n("Spanish translation"), _("pureacetone@gmail.com"), QString()); aboutdata.addCredit( i18n("Erik de Castro Lopo"), i18n("Author of the 'sndfile' library"), _("erikd@zip.com.au"), i18n("http://www.mega-nerd.com/libsndfile/")); aboutdata.addCredit( i18n("Pavel Fric"), i18n("Czech translation"), _("pavelfric@seznam.cz"), i18n("http://fripohled.blogspot.com")); aboutdata.addCredit( i18n("Panagiotis Papadopoulos"), i18n("String and i18n updates"), _("pano_90@gmx.net"), QString()); } #ifdef WITH_OPTIMIZED_MEMCPY /* forward declaration to libkwave/memcpy.c */ extern "C" void probe_fast_memcpy(void); #endif /* WITH_OPTIMIZED_MEMCPY */ //*************************************************************************** int main(int argc, char **argv) { int retval = 0; // create the application instance first Kwave::App app(argc, argv); // initialize the crash handler (only if KCrash >= 5.15 is available) #if KCrash_VERSION >= ((5 << 16) | (15 << 8) | (0)) KCrash::initialize(); #endif // manually connect the translation catalog, otherwise i18n will not work KLocalizedString::setApplicationDomain(PROJECT_NAME); QCommandLineParser cmdline; cmdline.addHelpOption(); cmdline.addVersionOption(); cmdline.addOption(QCommandLineOption( _("disable-splashscreen"), i18n("Disable the Splash Screen.") )); cmdline.addOption(QCommandLineOption( _("iconic"), i18n("Start Kwave iconified.") )); cmdline.addOption(QCommandLineOption( _("logfile"), i18nc("description of command line parameter", "Log all commands into a file ."), i18nc("placeholder of command line parameter", "file") )); cmdline.addOption(QCommandLineOption( _("gui"), i18nc("description of command line parameter", "Select a GUI type: SDI, MDI or TAB mode."), i18nc("placeholder of command line parameter", "sdi|mdi|tab") )); cmdline.addPositionalArgument( _("files"), i18nc("description of command line parameter", "List of audio files, Kwave macro files "\ "or Kwave URLs to open (optionally)"), i18nc("placeholder of command line parameter", "[files...]") ); KAboutData about( _(PROJECT_NAME), i18n("Kwave"), _(KWAVE_VERSION), i18n("A sound editor built on KDE Frameworks 5"), KAboutLicense::GPL_V2, i18n("(c) 2016, Thomas Eschenbacher"), QString(), _("http://www.kde.org/applications/multimedia/kwave"), _("Thomas.Eschenbacher@gmx.de") ); addDataStrings(about); about.setOrganizationDomain(QByteArray("kde.org")); about.setDesktopFileName(QStringLiteral("org.kde.kwave")); /* use the about data above for this application */ KAboutData::setApplicationData(about); /* show some version info */ printf("\nThis is %s v%s (compiled with KDE Frameworks %s)\n", about.productName().toLatin1().data(), about.version().toLatin1().data(), KXMLGUI_VERSION_STRING ); app.processCmdline(&cmdline); app.setApplicationName(_("kwave")); app.setApplicationVersion(_(KWAVE_VERSION)); + app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); // enable high dpi support cmdline.process(app); about.setupCommandLine(&cmdline); about.processCommandLine(&cmdline); /* let Kwave be a "unique" application, only one instance */ KDBusService service(KDBusService::Unique); /* check for an optimized version of memcpy() */ #ifdef WITH_OPTIMIZED_MEMCPY probe_fast_memcpy(); printf("\n"); #endif /* WITH_OPTIMIZED_MEMCPY */ // check whether to start up without splash screen or in iconic mode // which implicitly also disables the splash screen Kwave::Splash splash(_("pics/kwave-splash.png")); bool show_splash = !(cmdline.isSet(_("disable-splashscreen")) || cmdline.isSet(_("iconic"))); if (show_splash) splash.show(); // now as the splash screen is in place, we can start a new instance retval = app.newInstance(app.arguments(), QString()); QObject::connect( &service, SIGNAL(activateRequested(QStringList,QString)), &app, SLOT(newInstance(QStringList,QString)) ); if (retval != ECANCELED) retval = app.exec(); splash.done(); splash.close(); return retval; } //*************************************************************************** //*************************************************************************** diff --git a/libgui/CurveWidget.cpp b/libgui/CurveWidget.cpp index 7ba1d349..c19b873d 100644 --- a/libgui/CurveWidget.cpp +++ b/libgui/CurveWidget.cpp @@ -1,494 +1,494 @@ /*************************************************************************** CurveWidget.cpp - widget for editing an interpolated curve ------------------- begin : Sep 16 2001 copyright : (C) 2001 by Thomas Eschenbacher email : Thomas Eschenbacher ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "libkwave/Curve.h" #include "libkwave/Interpolation.h" #include "libkwave/Logger.h" #include "libkwave/String.h" #include "libkwave/Utils.h" #include "libgui/CurveWidget.h" #include "libgui/FileDialog.h" //*************************************************************************** Kwave::CurveWidget::CurveWidget(QWidget *parent) :QWidget(parent), m_width(0), m_height(0), m_curve(), m_menu(Q_NULLPTR), m_preset_menu(Q_NULLPTR), m_current(Kwave::Curve::NoPoint), m_last(Kwave::Curve::NoPoint), m_down(false), m_knob(), m_selected_knob() { KIconLoader icon_loader; // set the default curve m_curve.fromCommand(_("curve(linear,0,0,1,1)")); QPalette pal = palette(); pal.setColor(QPalette::Window, Qt::black); setPalette(pal); // create the pixmaps for the selected and non-selected knob m_knob = icon_loader.loadIcon(_("knob.xpm"), KIconLoader::Small); m_selected_knob = icon_loader.loadIcon(_("selectedknob.xpm"), KIconLoader::Small); // set up the context menu for the right mouse button m_menu = new QMenu(this); Q_ASSERT(m_menu); if (!m_menu) return; QMenu *interpolation = m_menu->addMenu(i18n("Interpolation")); Q_ASSERT(interpolation); if (!interpolation) return; m_menu->addSeparator(); QMenu *transform = m_menu->addMenu(i18n("Transform")); Q_ASSERT(transform); if (!transform) return; transform->addAction(i18n("Flip horizontal"), this, SLOT(HFlip())); transform->addAction(i18n("Flip vertical"), this, SLOT(VFlip())); transform->addSeparator(); transform->addAction(i18n("Into first half"), this, SLOT(firstHalf())); transform->addAction(i18n("Into second half"), this, SLOT(secondHalf())); QMenu *del = m_menu->addMenu(i18n("Delete")); Q_ASSERT(del); if (!del) return; m_menu->addAction(i18n("Fit In"), this, SLOT(scaleFit())); m_menu->addSeparator(); /* list of presets */ m_preset_menu = m_menu->addMenu(i18n("Presets")); Q_ASSERT(m_preset_menu); if (!m_preset_menu) return; loadPresetList(); connect(m_preset_menu, SIGNAL(triggered(QAction*)), this, SLOT(loadPreset(QAction*))); m_menu->addAction( - icon_loader.loadIcon(_("document-export"), KIconLoader::Small), + QIcon::fromTheme(_("document-export")), i18n("Save Preset"), this, SLOT(savePreset())); del->addAction( - icon_loader.loadIcon(_("edit-delete"), KIconLoader::Small), + QIcon::fromTheme(_("edit-delete")), i18n("Currently Selected Point"), this, SLOT(deleteLast()), QKeySequence::Delete); del->addAction(i18n("Every Second Point"), this, SLOT(deleteSecond())); QStringList types = Kwave::Interpolation::descriptions(true); int id = 0; foreach (const QString &text, types) { QAction *action = new QAction(interpolation); action->setText(text); action->setData(id++); interpolation->addAction(action); } connect(interpolation, SIGNAL(triggered(QAction*)), this, SLOT(selectInterpolationType(QAction*))); setMouseTracking(true); QShortcut *delkey = new QShortcut(this); Q_ASSERT(delkey); if (!delkey) return; delkey->setKey(Qt::Key_Delete); connect(delkey, SIGNAL(activated()), this, SLOT (deleteLast())); } //*************************************************************************** Kwave::CurveWidget::~CurveWidget() { if (m_menu) delete m_menu; } //*************************************************************************** QString Kwave::CurveWidget::getCommand() { return m_curve.getCommand(); } //*************************************************************************** void Kwave::CurveWidget::setCurve(const QString &command) { m_curve.fromCommand(command); repaint(); } //*************************************************************************** void Kwave::CurveWidget::selectInterpolationType(QAction *action) { if (!action) return; QVariant data = action->data(); int index = data.toInt(); m_curve.setInterpolationType(Kwave::Interpolation::findByIndex(index)); repaint(); } //*************************************************************************** void Kwave::CurveWidget::savePreset() { QString presetSubDir = _("presets") + QDir::separator() + _("curves"); QString presetPath = QStandardPaths::writableLocation( QStandardPaths::AppDataLocation) + QDir::separator() + presetSubDir; if (!QDir(presetPath).exists()) { Kwave::Logger::log(this, Logger::Info, _("curve preset directory did not exist, creating '%1'").arg( presetPath)); QDir(presetPath).mkpath(presetPath); } QPointer dlg = new (std::nothrow) Kwave::FileDialog( presetPath, Kwave::FileDialog::SaveFile, _("*.curve *.CURVE|") + i18nc("Filter description for Kwave curve presets, " "for use in a FileDialog", "Kwave curve preset (*.curve)"), this, QUrl(), _("*.curve")); if (!dlg) return; dlg->setWindowTitle(i18n("Save Curve Preset")); if (dlg->exec() != QDialog::Accepted) { delete dlg; return; } QString name = dlg->selectedUrl().toLocalFile(); delete dlg; // append the extension if not given if (!name.endsWith(_(".curve"))) name.append(_(".curve")); QFile out(name); out.open(QIODevice::WriteOnly); QString cmd = m_curve.getCommand(); out.write(DBG(cmd), cmd.length()); // reload the list of known presets loadPresetList(); } //*************************************************************************** void Kwave::CurveWidget::loadPresetList() { const QChar s = QDir::separator(); QString presetSubDir = s + _("kwave") + s + _("presets") + s + _("curves"); QStringList files; QStringList presetPaths = QStandardPaths::standardLocations( QStandardPaths::GenericDataLocation); foreach (const QString &path, presetPaths) { QDir d(path + presetSubDir); QStringList f = d.entryList(QDir::Files, QDir::Name); foreach (const QString &file, f) { QString preset = d.path() + s + file; if (!files.contains(preset)) files.append(preset); } } files.sort(); m_preset_menu->clear(); foreach (const QString &file, files) { QFileInfo fi(file); QString name = fi.baseName(); QAction *action = new (std::nothrow) QAction(name, m_preset_menu); Q_ASSERT(action); if (!action) continue; action->setData(file); m_preset_menu->addAction(action); } } //*************************************************************************** void Kwave::CurveWidget::loadPreset(QAction *action) { Q_ASSERT(m_preset_menu); Q_ASSERT(action); if (!m_preset_menu || !action) return; if (!action->data().isValid()) return; // invalidate the current selection m_current = Kwave::Curve::NoPoint; m_last = Kwave::Curve::NoPoint; // get the path of the file and check whether it (still) exists QString filename = action->data().toString(); QFileInfo fi(filename); if (!fi.exists(filename)) return; // load the file QFile file(filename); if (!file.open(QIODevice::ReadOnly)) { qWarning("CurveWidget::loadPreset('%s') - FAILED", DBG(filename)); return; } QTextStream stream(&file); m_curve.fromCommand(stream.readLine()); file.close(); repaint(); } //*************************************************************************** void Kwave::CurveWidget::secondHalf() { m_curve.secondHalf (); m_last = Kwave::Curve::NoPoint; repaint(); } //*************************************************************************** void Kwave::CurveWidget::firstHalf() { m_curve.firstHalf (); m_last = Kwave::Curve::NoPoint; repaint(); } //**************************************************************************** void Kwave::CurveWidget::deleteSecond() { m_curve.deleteSecondPoint(); m_last = Kwave::Curve::NoPoint; repaint (); } //**************************************************************************** void Kwave::CurveWidget::deleteLast() { if (m_last != Kwave::Curve::NoPoint) { m_curve.deletePoint(m_last, true); m_last = Kwave::Curve::NoPoint; repaint(); } } //*************************************************************************** void Kwave::CurveWidget::HFlip() { m_curve.HFlip(); repaint(); } //*************************************************************************** void Kwave::CurveWidget::VFlip() { m_curve.VFlip(); repaint(); } //*************************************************************************** void Kwave::CurveWidget::scaleFit() { m_curve.scaleFit(); repaint(); } //*************************************************************************** void Kwave::CurveWidget::addPoint(double newx, double newy) { m_curve.insert(newx, newy); m_last = Kwave::Curve::NoPoint; repaint(); } //*************************************************************************** Kwave::Curve::Point Kwave::CurveWidget::findPoint(int sx, int sy) // checks, if given coordinates fit to a control point in the list... { Q_ASSERT(m_width > 1); Q_ASSERT(m_height > 1); if ((m_width <= 1) || (m_height <= 1)) return Kwave::Curve::NoPoint; return m_curve.findPoint((static_cast(sx)) / (m_width - 1), (static_cast(m_height) - sy) / (m_height - 1)); } //*************************************************************************** void Kwave::CurveWidget::mousePressEvent(QMouseEvent *e) { Q_ASSERT(e); Q_ASSERT(m_width > 1); Q_ASSERT(m_height > 1); if (!e || (m_width <= 1) || (m_height <= 1)) return; if (e->buttons() == Qt::RightButton) { // right mouse button -> context menu QPoint popup = QCursor::pos(); if (m_menu) m_menu->popup(popup); } else if (e->buttons() == Qt::LeftButton) { // left mouse button -> select existing or create new point m_down = true; m_current = findPoint(e->pos().x(), e->pos().y()); if (m_current == Kwave::Curve::NoPoint) { // no matching point is found -> generate a new one ! addPoint(static_cast(e->pos().x()) / (m_width - 1), static_cast(m_height - e->pos().y()) / (m_height - 1)); m_current = findPoint(e->pos().x(), e->pos().y()); } repaint(); } } //*************************************************************************** void Kwave::CurveWidget::mouseReleaseEvent(QMouseEvent *) { m_last = m_current; m_current = Kwave::Curve::NoPoint; m_down = false; repaint(); } //*************************************************************************** void Kwave::CurveWidget::mouseMoveEvent(QMouseEvent *e ) { Q_ASSERT(e); Q_ASSERT(m_width > 1); Q_ASSERT(m_height > 1); if (!e || (m_width <= 1) || (m_height <= 1)) return; int x = e->pos().x(); int y = e->pos().y(); // if a point is selected... if (m_current != Kwave::Curve::NoPoint) { if (m_current == m_curve.first()) x = 0; if (m_current == m_curve.last()) x = m_width - 1; m_curve.deletePoint(m_current, false); m_current.setX(static_cast(x) / (m_width - 1)); m_current.setY(static_cast(m_height - y) / (m_height - 1)); if (m_current.x() < 0.0) m_current.setX(0.0); if (m_current.y() < 0.0) m_current.setY(0.0); if (m_current.x() > 1.0) m_current.setX(1.0); if (m_current.y() > 1.0) m_current.setY(1.0); double dx = (1.0 / static_cast(m_width - 1)); do { Kwave::Curve::Point nearest = m_curve.findPoint( m_current.x(), m_current.y(), 1.0); if (qFuzzyCompare(nearest.x(), m_current.x())) { if (nearest == m_curve.last()) m_current.setX(m_current.x() - dx); else m_current.setX(m_current.x() + dx); } else break; } while (true); m_curve.insert(m_current.x(), m_current.y()); repaint (); } else { if (findPoint(x, y) != Kwave::Curve::NoPoint) setCursor(Qt::SizeAllCursor); else setCursor(Qt::ArrowCursor); } } //*************************************************************************** void Kwave::CurveWidget::paintEvent(QPaintEvent *) { // qDebug("CurveWidget::paintEvent (QPaintEvent *)"); QPainter p; int ly; m_height = rect().height(); m_width = rect().width(); if (!m_curve.count()) return; // nothing to draw const int kw = m_knob.width(); const int kh = m_knob.height(); QVector y = m_curve.interpolation(m_width); Q_ASSERT(Kwave::toInt(y.count()) == m_width); if (Kwave::toInt(y.count()) < m_width) { qWarning("CurveWidget: unable to get interpolation !"); return; } p.begin(this); p.fillRect(rect(), QBrush(palette().dark())); p.setPen(palette().text().color()); // draw the lines ly = (m_height-1) - Kwave::toInt(y[0] * (m_height - 1)); for (int i = 1; i < m_width; i++) { int ay = (m_height-1) - Kwave::toInt(y[i] * (m_height - 1)); p.drawLine (i - 1, ly, i, ay); ly = ay; } // draw the points (knobs) foreach (const Kwave::Curve::Point &pt, m_curve) { int lx = Kwave::toInt(pt.x() * (m_width - 1)); ly = (m_height - 1) - Kwave::toInt(pt.y() * (m_height - 1)); if ((pt == m_current) || (!m_down && (pt == m_last)) ) p.drawPixmap(lx - (kw >> 1), ly - (kh >> 1), m_selected_knob); else p.drawPixmap(lx - (kw >> 1), ly - (kh >> 1), m_knob); } p.end(); } //*************************************************************************** //*************************************************************************** diff --git a/plugins/sonagram/SonagramWindow.cpp b/plugins/sonagram/SonagramWindow.cpp index d80f841e..73c9e956 100644 --- a/plugins/sonagram/SonagramWindow.cpp +++ b/plugins/sonagram/SonagramWindow.cpp @@ -1,579 +1,576 @@ /*************************************************************************** SonagramWindow.cpp - window for showing a sonagram ------------------- begin : Fri Jul 28 2000 copyright : (C) 2000 by Thomas Eschenbacher email : Thomas.Eschenbacher@gmx.de ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include -#include - #include "libkwave/String.h" #include "libkwave/Utils.h" #include "libkwave/WindowFunction.h" #include "libgui/FileDialog.h" #include "libgui/ImageView.h" #include "libgui/ScaleWidget.h" #include "SonagramWindow.h" /** * delay between two screen updates [ms] */ #define REFRESH_DELAY 100 /** * Color values below this limit are cut off when adjusting the * sonagram image's brightness * I found out by experiments that 0.1% seems to be reasonable */ #define COLOR_CUTOFF_RATIO (0.1/100.0) static const char *background[] = { /* width height num_colors chars_per_pixel */ " 20 20 2 1", /* colors */ "# c #808080", ". c None", /* pixels */ "##########..........", "##########..........", "##########..........", "##########..........", "##########..........", "##########..........", "##########..........", "##########..........", "##########..........", "##########..........", "..........##########", "..........##########", "..........##########", "..........##########", "..........##########", "..........##########", "..........##########", "..........##########", "..........##########", "..........##########" }; //**************************************************************************** Kwave::SonagramWindow::SonagramWindow(QWidget *parent, const QString &name) :KMainWindow(parent), m_status_time(Q_NULLPTR), m_status_freq(Q_NULLPTR), m_status_ampl(Q_NULLPTR), m_image(), m_color_mode(0), m_view(Q_NULLPTR), m_overview(Q_NULLPTR), m_points(0), m_rate(0), m_xscale(Q_NULLPTR), m_yscale(Q_NULLPTR), m_refresh_timer() { - KIconLoader icon_loader; - for (int i = 0; i < 256; ++i) { m_histogram[i] = 0; } + for (unsigned int i = 0; i < 256; ++i) { m_histogram[i] = 0; } QWidget *mainwidget = new(std::nothrow) QWidget(this); Q_ASSERT(mainwidget); if (!mainwidget) return; setCentralWidget(mainwidget); QGridLayout *top_layout = new(std::nothrow) QGridLayout(mainwidget/*, 3, 2*/); Q_ASSERT(top_layout); if (!top_layout) return; QMenuBar *bar = menuBar(); Q_ASSERT(bar); if (!bar) return ; // QMenu *spectral = new QMenu(); // Q_ASSERT(spectral); // if (!spectral) return ; QMenu *file = bar->addMenu(i18n("&Sonagram")); Q_ASSERT(file); if (!file) return ; // bar->addAction(i18n("&Spectral Data"), spectral); // file->addAction(i18n("&Import from Bitmap..."), this, SLOT(load())); file->addAction( - icon_loader.loadIcon(_("document-export"), KIconLoader::Small), + QIcon::fromTheme(_("document-export")), i18n("&Export to Bitmap..."), this, SLOT(save()) ); file->addAction( - icon_loader.loadIcon(_("dialog-close"), KIconLoader::Small), + QIcon::fromTheme(_("dialog-close")), i18n("&Close"), this, SLOT(close()), QKeySequence::Close ); // spectral->addAction (i18n("&Retransform to Signal"), this, SLOT(toSignal())); QStatusBar *status = statusBar(); Q_ASSERT(status); if (!status) return ; m_status_time = new(std::nothrow) QLabel(i18n("Time: ------ ms"), status); m_status_freq = new(std::nothrow) QLabel(i18n("Frequency: ------ Hz"), status); m_status_ampl = new(std::nothrow) QLabel(i18n("Amplitude: --- %"), status); status->addPermanentWidget(m_status_time); status->addPermanentWidget(m_status_freq); status->addPermanentWidget(m_status_ampl); m_view = new(std::nothrow) Kwave::ImageView(mainwidget); Q_ASSERT(m_view); if (!m_view) return; top_layout->addWidget(m_view, 0, 1); QPalette palette; palette.setBrush(m_view->backgroundRole(), QBrush(QImage(background))); m_view->setAutoFillBackground(true); m_view->setPalette(palette); m_xscale = new(std::nothrow) Kwave::ScaleWidget(mainwidget, 0, 100, i18n("ms")); Q_ASSERT(m_xscale); if (!m_xscale) return; m_xscale->setFixedHeight(m_xscale->sizeHint().height()); top_layout->addWidget(m_xscale, 1, 1); m_yscale = new(std::nothrow) Kwave::ScaleWidget(mainwidget, 0, 100, i18n("Hz")); Q_ASSERT(m_yscale); if (!m_yscale) return ; m_yscale->setFixedWidth(m_yscale->sizeHint().width()); m_yscale->setMinimumHeight(9*6*5); top_layout->addWidget(m_yscale, 0, 0); m_overview = new(std::nothrow) Kwave::ImageView(mainwidget); Q_ASSERT(m_overview); if (!m_overview) return; m_overview->setFixedHeight(SONAGRAM_OVERVIEW_HEIGHT); top_layout->addWidget(m_overview, 2, 1); connect(m_view, SIGNAL(sigCursorPos(QPoint)), this, SLOT(cursorPosChanged(QPoint))); connect(&m_refresh_timer, SIGNAL(timeout()), this, SLOT(refresh_view())); setName(name); top_layout->setRowStretch(0, 100); top_layout->setRowStretch(1, 0); top_layout->setRowStretch(2, 0); top_layout->setColumnStretch(0, 0); top_layout->setColumnStretch(1, 100); top_layout->activate(); if (m_status_time) m_status_time->setText(i18n("Time: 0 ms")); if (m_status_freq) m_status_freq->setText(i18n("Frequency: 0 Hz")); if (m_status_ampl) m_status_ampl->setText(i18n("Amplitude: 0 %")); // try to make 5:3 format (looks best) int w = sizeHint().width(); int h = sizeHint().height(); if ((w * 3 / 5) < h) w = (h * 5) / 3; if ((h * 5 / 3) < w) h = (w * 3) / 5; resize(w, h); show(); } //**************************************************************************** void Kwave::SonagramWindow::close() { QWidget::close(); } //**************************************************************************** void Kwave::SonagramWindow::save() { if (m_image.isNull()) return; QPointer dlg = new (std::nothrow) Kwave::FileDialog( _("kfiledialog:///kwave_sonagram"), Kwave::FileDialog::SaveFile, QString(), this, QUrl(), _("*.bmp") ); if (!dlg) return; dlg->setWindowTitle(i18n("Save Sonagram")); if (dlg->exec() == QDialog::Accepted) { QString filename = dlg->selectedUrl().toLocalFile(); if (!filename.isEmpty()) m_image.save(filename, "BMP"); } delete dlg; } //**************************************************************************** void Kwave::SonagramWindow::load() { // if (image) { // QString filename = QFileDialog::getOpenFileName(this, QString(), "", "*.bmp"); // printf ("loading %s\n", filename.local8Bit().data()); // if (!filename.isNull()) { // printf ("loading %s\n", filename.local8Bit().data()); // QImage *newimage = new QImage (filename); // Q_ASSERT(newimage); // if (newimage) { // if ((image->height() == newimage->height()) // && (image->width() == newimage->width())) { // // for (int i = 0; i < x; i++) { // for (int j = 0; j < points / 2; j++) { // if (data[i]) { // // data[i][j].real; // } // // } // } // // delete image; // image = newimage; // view->setImage (image); // } else { // char buf[128]; // delete newimage; // snprintf(buf, sizeof(buf), i18n("Bitmap must be %dx%d"), // image->width(), image->height()); // KMsgBox::message (this, "Info", buf, 2); // } // } else // KMsgBox::message (this, i18n("Error"), // i18n("Could not open Bitmap"), 2); // } // } } //**************************************************************************** void Kwave::SonagramWindow::setImage(QImage image) { Q_ASSERT(m_view); if (!m_view) return; m_image = image; // re-initialize histogram over all pixels for (unsigned int i = 0; i < 256; i++) m_histogram[i] = 0; if (!m_image.isNull()) { for (int x = 0; x < m_image.width(); x++) { for (int y = 0; y < m_image.height(); y++) { quint8 p = static_cast(m_image.pixelIndex(x, y)); m_histogram[p]++; } } } refresh_view(); } //**************************************************************************** void Kwave::SonagramWindow::setOverView(const QImage &overview) { if (m_overview) m_overview->setImage(overview); } //**************************************************************************** void Kwave::SonagramWindow::insertSlice(const unsigned int slice_nr, const QByteArray &slice) { Q_ASSERT(m_view); if (!m_view) return; if (m_image.isNull()) return; unsigned int image_width = m_image.width(); unsigned int image_height = m_image.height(); // slice is out of range ? if (slice_nr >= image_width) return; unsigned int y; unsigned int size = slice.size(); for (y = 0; y < size; y++) { quint8 p; // remove the current pixel from the histogram p = static_cast(m_image.pixelIndex(slice_nr, y)); m_histogram[p]--; // set the new pixel value p = slice[(size - 1) - y]; m_image.setPixel(slice_nr, y, p); // insert the new pixel into the histogram m_histogram[p]++; } while (y < image_height) { // fill the rest with blank m_image.setPixel(slice_nr, y++, 0xFE); m_histogram[0xFE]++; } if (!m_refresh_timer.isActive()) { m_refresh_timer.setSingleShot(true); m_refresh_timer.start(REFRESH_DELAY); } } //**************************************************************************** void Kwave::SonagramWindow::adjustBrightness() { if (m_image.isNull()) return; // get the sum of pixels != 0 unsigned long int sum = 0; for (unsigned int i = 1; i <= 254; i++) sum += m_histogram[i]; // cut off all parts below the cutoff ratio (e.g. 0.1%) unsigned int cutoff = Kwave::toUint(sum * COLOR_CUTOFF_RATIO); // get the last used color from the histogram int last = 254; while ((last >= 0) && (m_histogram[last] <= cutoff)) last--; QColor c; for (int i = 0; i < 255; i++) { int v; if (i >= last) { v = 254; } else { // map [0...last] to [254...0] v = ((last - i) * 254) / last; } if (m_color_mode == 1) { // rainbow effect c.setHsv( (v * 255) / 255, 255, 255, 255); } else { // greyscale palette c.setRgb(v, v, v, 255); } m_image.setColor(i, c.rgba()); // qDebug("color[%3d] = 0x%08X",i, c.rgba()); } // use color 0xFF for transparency ! m_image.setColor(0xFF, QColor(0, 0, 0, 0).rgba()); } //**************************************************************************** void Kwave::SonagramWindow::refresh_view() { Q_ASSERT(m_view); if (!m_view) return; adjustBrightness(); m_view->setImage(m_image); } //**************************************************************************** void Kwave::SonagramWindow::toSignal() { /** @todo needs to be ported to fftw and re-activated */ // gsl_fft_complex_wavetable table; // // gsl_fft_complex_wavetable_alloc (points, &table); // gsl_fft_complex_init (points, &table); // // Kwave::TopWidget *win = new Kwave::TopWidget(...); // // Q_ASSERT(win); // if (win) { // // Kwave::Signal *newsig = new Kwave::Signal(length, rate); // Q_ASSERT(newsig); // // //assure 10 Hz for correction signal, this should not be audible // int slopesize = rate / 10; // // double *slope = new double [slopesize]; // // if (slope && newsig) { // for (int i = 0; i < slopesize; i++) // slope[i] = 0.5 + 0.5 * cos( ((double) i) * M_PI / slopesize); // // win->show(); // // int *output = newsig->getSample(); //sample data // complex *tmp = new complex [points]; //this window holds the data for ifft and after that part of the signal // // if (output && tmp && data) { // for (int i = 0; i < x; i++) { // if (data[i]) memcpy (tmp, data[i], sizeof(complex)*points); // gsl_fft_complex_inverse (tmp, points, &table); // // for (int j = 0; j < points; j++) // output[i*points + j] = (int)(tmp[j].real * ((1 << 23)-1)); // } // int dif ; // int max; // for (int i = 1; i < x; i++) //remove gaps between windows // { // max = slopesize; // if (max > length - i*points) max = length - i * points; // dif = output[i * points] - output[i * points - 1]; // if (dif < 2) // for (int j = 0; j < max; j++) output[i*points + j] += (int) (slope[j] * dif ); // } // // win->setSignal (new SignalManager (newsig)); // // if (tmp) delete[] tmp; // } else { // if (newsig) delete newsig; // if (win) delete win; // KMsgBox::message (this, i18n("Error"), i18n("Out of memory !"), 2); // } // } // if (slope) delete[] slope; // } } //*************************************************************************** void Kwave::SonagramWindow::translatePixels2TF(const QPoint p, double *ms, double *f) { if (ms) { // get the time coordinate [0...(N_samples-1)* (1/f_sample) ] if (!qFuzzyIsNull(m_rate)) { *ms = static_cast(p.x()) * static_cast(m_points) * 1000.0 / m_rate; } else { *ms = 0; } } if (f) { // get the frequency coordinate double py = (m_points >= 2) ? (m_points / 2) - 1 : 0; double y = py - p.y(); if (y < 0) y = 0; *f = y / py * (m_rate / 2.0); } } //*************************************************************************** void Kwave::SonagramWindow::updateScaleWidgets() { double ms; double f; translatePixels2TF(QPoint(m_image.width() - 1, 0), &ms, &f); m_xscale->setMinMax(0, Kwave::toInt(rint(ms))); m_yscale->setMinMax(0, Kwave::toInt(rint(f))); } //*************************************************************************** Kwave::SonagramWindow::~SonagramWindow() { } //*************************************************************************** void Kwave::SonagramWindow::setColorMode(int mode) { Q_ASSERT(mode >= 0); Q_ASSERT(mode <= 1); if (mode != m_color_mode) { m_color_mode = mode; setImage(m_image); } } //*************************************************************************** void Kwave::SonagramWindow::setName(const QString &name) { setWindowTitle((name.length()) ? i18n("Sonagram of %1", name) : i18n("Sonagram") ); } //**************************************************************************** void Kwave::SonagramWindow::cursorPosChanged(const QPoint pos) { QStatusBar *status = statusBar(); Q_ASSERT(status); Q_ASSERT(m_points); Q_ASSERT(!qFuzzyIsNull(m_rate)); if (!status) return; if (m_image.isNull()) return; if (!m_points) return; if (qFuzzyIsNull(m_rate)) return; double ms; double f; double a; translatePixels2TF(pos, &ms, &f); // item 1: time in milliseconds if (m_status_time) m_status_time->setText(i18n("Time: %1", Kwave::ms2string(ms))); // item 2: frequency in Hz if (m_status_freq) m_status_freq->setText(i18n("Frequency: %1 Hz", Kwave::toInt(f))); // item 3: amplitude in % if (m_image.valid(pos.x(), pos.y())) { a = m_image.pixelIndex(pos.x(), pos.y()) * (100.0 / 254.0); } else { a = 0.0; } if (m_status_ampl) m_status_ampl->setText(i18n("Amplitude: %1%", Kwave::toInt(a))); } //**************************************************************************** void Kwave::SonagramWindow::setPoints(unsigned int points) { m_points = points; updateScaleWidgets(); } //**************************************************************************** void Kwave::SonagramWindow::setRate(double rate) { m_rate = rate; updateScaleWidgets(); } //*************************************************************************** //*************************************************************************** diff --git a/plugins/sonagram/SonagramWindow.h b/plugins/sonagram/SonagramWindow.h index dcff59bd..6b71dd70 100644 --- a/plugins/sonagram/SonagramWindow.h +++ b/plugins/sonagram/SonagramWindow.h @@ -1,209 +1,209 @@ /*************************************************************************** SonagramWindow.h - window for showing a sonagram ------------------- begin : Fri Jul 28 2000 copyright : (C) 2000 by Thomas Eschenbacher email : Thomas.Eschenbacher@gmx.de ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef SONAGRAM_WINDOW_H #define SONAGRAM_WINDOW_H #include "config.h" #include #include class QBitmap; class QImage; /** height of the overview widget in a sonagram window [pixels] */ #define SONAGRAM_OVERVIEW_HEIGHT 30 namespace Kwave { class ImageView; class ScaleWidget; /** * Window for displaying a sonagram with scale, status bar and * a small menu. */ class SonagramWindow: public KMainWindow { Q_OBJECT public: /** * Constructor. * @param parent the parent widget * @param name reference to the initial name of the signal (used for * setting the window title, might be an empty string) */ SonagramWindow(QWidget *parent, const QString &name); /** * Destructor. */ virtual ~SonagramWindow(); /** * Sets a new sonagram image to display. * @param image the bitmap with the sonagram */ void setImage(QImage image); /** * Sets a new overview bitmap for the signal space */ void setOverView(const QImage &image); /** * Inserts a slice into the current image. If the slice contains more * data than fits into the image, the remaining rest will be ignored, * if less data is present, it will be filled with 0xFF. The previous * content of the image slice will be cleared or updated in all cases. * @param slice_nr index of the slice (horizontal position) [0..n-1] * @param slice array with the byte data */ void insertSlice(const unsigned int slice_nr, const QByteArray &slice); public slots: /** closes the sonagram window */ void close(); /** not implemented yet */ void save(); /** not implemented yet */ void load(); /** not implemented yet */ void toSignal(); /** * Sets the name of the signal / title of the window * @param name the name of the signal */ void setName(const QString &name); /** * Sets a new color mode. If the mode is different from the current * one, the image will be automatically refreshed. */ void setColorMode(int mode); /** * Used to update the display of the current position of the cursor. * Position is given in coordinates of the QImage. * @param pos current cursor position */ void cursorPosChanged(const QPoint pos); /** * sets information about the number of fft points (needed * for translating cursor coordinates into time) * @param points the number of fft points [1...] */ void setPoints(unsigned int points); /** * sets information about the sample rate (needed for * translating cursor coordinates into time * @param rate sample rate in samples per second */ void setRate(double rate); private slots: /** refreshes the image, connected to m_refresh_timer */ void refresh_view(); protected: /** updates the scale widgets */ void updateScaleWidgets(); /** * adjust the brightness so that the color space is optimally * used and the user doesn't just see a white image */ void adjustBrightness(); /** * Translates pixel coordinates relative to the lower left corner * of the QImage into time and frequency coordinates of the signal. * This requires a valid sample rate to be set, otherwise the * time coordinate will be returned as zero. * @param p a QPoint with the pixel position, upper left is 0/0 * @param ms pointer to a double that receives the time coordinate * in milliseconds (can be 0 to ignore) * @param f pointer to a double that receives the frequency * coordinate (can be 0 to ignore) */ void translatePixels2TF(const QPoint p, double *ms, double *f); private: /** status bar label for time */ QLabel *m_status_time; /** status bar label for frequency */ QLabel *m_status_freq; /** status bar label for amplitude */ QLabel *m_status_ampl; /** the QImage to be displayed */ QImage m_image; /** * the color mode to be used. Currently only 0 (black/white) * and 1 (rainbow colors) are used. */ int m_color_mode; /** an ImageView to display the m_image and fit it into our window */ Kwave::ImageView *m_view; /** short overview over the signal */ Kwave::ImageView *m_overview; /** number of fft points */ unsigned int m_points; /** sample rate, needed for translating pixel coordinates */ double m_rate; /** widget for the scale on the time (x) axis */ Kwave::ScaleWidget *m_xscale; /** widget for the scale on the frequency (y) axis */ Kwave::ScaleWidget *m_yscale; /** timer used for refreshing the view from time to time */ QTimer m_refresh_timer; - /** histogram of color indizes, used for auto-contrast */ + /** histogram of color indices, used for auto-contrast */ unsigned int m_histogram[256]; }; } #endif // _SONOGRAM_WINDOW_H_ //*************************************************************************** //***************************************************************************