diff --git a/ChangeLog b/ChangeLog index 248cfa0309..2fc04bdcda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,83 @@ +2006-03-13 Tobias Doerffel + + * include/main_window.h: + * src/core/main_window.cpp: + added edit-menu with undo/redo-items + + * src/core/piano_roll.cpp: + * src/core/song_editor.cpp: + * src/core/track_container.cpp: + * src/tracks/channel_track.cpp: + * src/widgets/project_notes.cpp: + use mainWindow::saveWidgetState() and mainWindow::restoreWidgetState() + for saving widget-state in project-file + + * include/piano_roll.h: + * src/core/piano_roll.cpp: + made piano-roll a settings-object + + * include/main_window.h: + * src/core/main_window.cpp: + added static methods for saving and restoring state of a widget + (position, size, visibility etc.) to/from QDomElement + + * include/timeline.h: + * src/core/song_editor.cpp: + * src/core/timeline.cpp: + save loop-point-positions and loop-point-state in project + + * plugins/bit_invader/bit_invader.cpp: + added visual feedback when pressing wave-shape-buttons + + * include/combobox.h: + * include/led_checkbox.h: + * include/pixmap_button.h: + * src/widgets/combobox.cpp: + * src/widgets/led_checkbox.cpp: + * src/widgets/pixmap_button.cpp: + use automatableButton as new base-class + + * include/automatable_button.h: + * src/widgets/automatable_button.cpp: + - added class automatableButton to be the base-class for pixmapButton, + ledCheckBox etc. + - added automatableButtonGroup, a more powerful button-group, designed + to be used in conjunction with automatableButton-derived buttons + +2006-03-12 Tobias Doerffel + + * include/automatable_object.h: + - added setInitValue() to be used by ALL creators of automatable + objects for initializing object-value - otherwise edit-step-history + gets filled with steps to set object's value to init-value + - derive from editableObject and re-implement some methods for + transparent edit-history for all automatable objects (knobs etc.) + + * include/editable_object.h: + * include/edit_history.h: + * src/lib/edit_history.cpp: + added support for recording edit-steps, the base for a generic + undo/redo-system + +2006-03-09 Tobias Doerffel + + * include/settings.h: + * src/core/plugin_browser.cpp: + * src/core/song_editor.cpp: + * src/core/track_container.cpp: + * plugins/midi_import/midi_import.cpp: + * plugins/midi_import/midi_import.h: + made MIDI-file-code an import-filter + + * include/import_filter.h: + * src/core/import_filter.cpp: + support for import-filter-plugins - simply call + + importFilter::import( FILE_NAME, TRACK_CONTAINER ) + + for any file and the rest will be done fully automatically according + to installed import-filter-plugins + 2006-03-08 Zolo * data/themes/blue_scene/: @@ -6,7 +86,7 @@ * data/themes/blue_scene/plugins/: added pixmaps for plugins -2006-03-08 Tobias Doerffel +2006-03-08 Tobias Doerffel * src/core/timeline.cpp: more logical loop-point-handling: @@ -41,7 +121,7 @@ * src/core/config_mgr.cpp: several fixes concerning artwork-path -2006-03-07 Tobias Doerffel +2006-03-07 Tobias Doerffel * src/core/arp_and_chords_tab_widget.cpp: more senseful range for arpeggio time: 25-2000 ms (instead of 10-1000ms) @@ -71,24 +151,24 @@ - use default-theme-path if theme-path from config-file doesn't exist - add "/" to theme-path if missing -2006-03-06 Alexey Kouznetsov +2006-03-06 Alexey Kouznetsov * locale/ru.ts: updated Russian translation -2006-03-05 Tobias Doerffel +2006-03-05 Tobias Doerffel * src/core/main_window.cpp: always set to configured-state before showing setup-dialog on first startup -2006-03-04 Tobias Doerffel +2006-03-04 Tobias Doerffel * src/core/engine.cpp: finalize main-window after having mixer to start its audio-devices - fixes crash on first time LMMS is started -2006-02-28 Tobias Doerffel +2006-02-28 Tobias Doerffel * data/locale/de.ts: updated German translation @@ -118,7 +198,7 @@ * data/themes/blue_scene/: added new theme for LMMS -2006-02-27 Tobias Doerffel +2006-02-27 Tobias Doerffel * src/core/song_editor.cpp: * src/tracks/pattern.cpp: @@ -141,13 +221,13 @@ artwork etc.) and put them into data/ dir to be all installed into $prefix/share/lmms -2006-02-25 Tobias Doerffel +2006-02-25 Tobias Doerffel * src/tracks/channel_track.cpp: apply a very basic envelope at the beginning and the end of a note for avoiding these "typical" clicks which were there before -2006-02-22 Tobias Doerffel +2006-02-22 Tobias Doerffel * configure.in: * Makefile.am: @@ -175,7 +255,7 @@ delete piano-roll after song-editor and bb-editor as patterns being destroyed still depend on it -2006-02-21 Tobias Doerffel +2006-02-21 Tobias Doerffel * src/tracks/channel_track.cpp: do not lock mutex in processOutEvent() as it causes a deadlock when @@ -205,7 +285,7 @@ do not strip executable when installing as it makes even basic debugging impossible -2006-02-20 Tobias Doerffel +2006-02-20 Tobias Doerffel * src/widgets/combobox.cpp: * src/widgets/knob.cpp: @@ -222,7 +302,7 @@ fixed critical bug which made LMMS crash if xruns were detected and notes were discarded by mixer and therefore deleted twice -2006-02-19 Andreas Brandmaier +2006-02-19 Andreas Brandmaier * plugins/organic/organic.cpp: * plugins/organic/organic.h: @@ -232,14 +312,14 @@ changed distortion method from clipping to foldback renamed and added presets for Organic and BitInvader -2006-02-18 Andreas Brandmaier +2006-02-18 Andreas Brandmaier * plugins/organic/organic.cpp: * plugins/organic/organic.h: * presets/Organic: added new plugin synthesizer plugin organic and some presets -2006-02-09 Tobias Doerffel +2006-02-09 Tobias Doerffel * plugins/triple_oscillator/triple_oscillator.cpp: per default set volume of each osc to 33% @@ -254,7 +334,7 @@ possibilities like GUI-data-separation and having several projects open at the same time -2006-02-06 Tobias Doerffel +2006-02-06 Tobias Doerffel * include/mixer.h: * include/song_editor.h: @@ -263,7 +343,7 @@ simple xrun-detection - do not accept new note-play-handles if xruns are detected -2006-02-06 Andreas Brandmaier +2006-02-06 Andreas Brandmaier * plugins/bitinvader/bitinvader.cpp: * plugins/bitinvader/bitinvader.h: @@ -273,7 +353,7 @@ - added drag&drop support to wavegraph - added new BitInvader presets and improved old ones -2006-02-05 Tobias Doerffel +2006-02-05 Tobias Doerffel * include/basic_filters.h: small optimizations: do not divide by 2.0, instead multiply with 0.5 @@ -295,7 +375,7 @@ when checking for VST-SDK-headers, use C++ compiler instead of C-compilers as headers fail to compile with it -2006-02-04 Tobias Doerffel +2006-02-04 Tobias Doerffel * include/types.h: * most files: @@ -313,7 +393,7 @@ calls without ending in deadlock or crash because of mutex being unlocked to early -2006-02-02 Tobias Doerffel +2006-02-02 Tobias Doerffel * configure.in: made 0.1.4 release @@ -324,7 +404,7 @@ * include/track_container.h: fixed bug which caused LMMS not being compilable using GCC 3 -2006-02-01 Tobias Doerffel +2006-02-01 Tobias Doerffel * configure.in: made 0.1.3 release @@ -346,7 +426,7 @@ * src/core/main.cpp: updated copyright-notice in help-text -2006-01-30 Tobias Doerffel +2006-01-30 Tobias Doerffel * plugins/vestige/fstclient.h: * plugins/vestige/fstclient.cpp: @@ -361,7 +441,7 @@ Support Layer) - VST SDK 2.4 compatibility (no need to fix headers with 2.4!) -2006-01-29 Tobias Doerffel +2006-01-29 Tobias Doerffel * plugins/bit_invader/bit_invader.cpp: - call graph::setSamplePointer() after loading settings @@ -384,7 +464,7 @@ - cleanup only every 10th free()-call for decreasing overhead - only start searching for free bufs if there're enough remaining -2006-01-24 Andreas Brandmaier +2006-01-24 Andreas Brandmaier * plugins/bit_invader/bit_invader.cpp: * plugins/bit_invader/bit_invader.h: @@ -392,7 +472,7 @@ - changed sample buffer encoding in presets to base64 - added BitInvader various presets -2006-01-23 Tobias Doerffel +2006-01-23 Tobias Doerffel * include/sample_buffer.h: * src/lib/sample_buffer.cpp: @@ -404,7 +484,7 @@ added methods for encoding/decoding binary data to/from base64-encoded data (wrapper-implementation for Qt4) -2006-01-23 Andreas Brandmaier +2006-01-23 Andreas Brandmaier * plugins/bit_invader/bit_invader.cpp: * plugins/bit_invader/bit_invader.h: @@ -416,7 +496,7 @@ - added user-loadable waveform - code cleanup -2006-01-22 Tobias Doerffel +2006-01-22 Tobias Doerffel * include/timeline.h: * src/core/song_editor.cpp: @@ -456,7 +536,7 @@ - scale pixmap to fit into combobox - place menu below combobox if possible -2006-01-21 Tobias Doerffel +2006-01-21 Tobias Doerffel * include/track.h: * src/core/track.cpp: @@ -496,13 +576,13 @@ fixed all that stuff with annoying scrollbars which partly hid important widgets -2006-01-21 Andreas Brandmaier +2006-01-21 Andreas Brandmaier - * plugins/bit_invader/bit_invader.cpp - * plugins/bit_invader/bit_invader.h + * plugins/bit_invader/bit_invader.cpp: + * plugins/bit_invader/bit_invader.h: added smooth button -2006-01-20 Tobias Doerffel +2006-01-20 Tobias Doerffel * src/tracks/pattern.cpp: also update after clearing all notes @@ -536,7 +616,7 @@ added own cool-looking combobox with menu-extension which basically has the same API as QComboBox -2006-01-19 Andreas M. Brandmaier +2006-01-19 Andreas M. Brandmaier * plugins/bit_invader/bit_invader.h: * plugins/bit_invader/bit_invader.cpp: @@ -544,7 +624,7 @@ * plugins/bit_invader/graph.cpp: added "BitInvader"-plugin, an usereditable wavetable-synthesizer -2006-01-16 Tobias Doerffel +2006-01-16 Tobias Doerffel * src/lib/mmp.cpp: do not add "mmp"-extensions if there's already "mpt" (multimedia- @@ -555,7 +635,7 @@ - added new sync-mode to arpeggiator - arpeggiator-modes are now selectable from combobox -2006-01-15 Tobias Doerffel +2006-01-15 Tobias Doerffel * src/core/file_browser.cpp: use 7.5 instead of 8 as font-size @@ -582,7 +662,7 @@ QMutex - fixes crashes with sort-arpeggio if no preset was previewed before -2006-01-14 Tobias Doerffel +2006-01-14 Tobias Doerffel * src/widgets/kmultitabbar.cpp: made KMultiTabBar working with Qt4 @@ -613,17 +693,17 @@ crashing when applying another preset while key is pressed and released afterwards -2006-01-10 Alexey Kouznetsov +2006-01-10 Alexey Kouznetsov * locale/ru.ts: updated Russian translation -2006-01-10 Tobias Doerffel +2006-01-10 Tobias Doerffel * src/core/piano_roll.cpp: update pattern after changing volume of step-note -2006-01-09 Tobias Doerffel +2006-01-09 Tobias Doerffel * include/setup_dialog.h: * src/core/config_mgr.cpp: @@ -631,7 +711,7 @@ made appearence of two dialogs switchable (question whether to re-run wizard after up-/downgrade and message after accepting setup-dialog) -2006-01-08 Tobias Doerffel +2006-01-08 Tobias Doerffel * include/piano_roll.h: * src/core/piano_roll.cpp: @@ -673,12 +753,12 @@ removed inclusion of paths.h which isn't part of LMMS for quite a long while... - there were no problems because Linux has paths.h too -2006-01-06 dieEasy +2006-01-06 dieEasy * locale/it.ts: added Italian translation -2006-01-02 Tobias Doerffel +2006-01-02 Tobias Doerffel * plugins/vestige/vestige.cpp: set vestige-logo as window-icon of plugin-GUI-window @@ -721,7 +801,7 @@ when invalidating note-play-handle, do some stuff which actually would be done by dtor if m_channelTrack wouldn't be NULL -2006-01-01 Tobias Doerffel +2006-01-01 Tobias Doerffel * src/core/track.cpp: added tooltip to track-op-widget telling the user something about @@ -739,14 +819,14 @@ * src/core/about_dialog.cpp: extended copyright from 2005 to 2006 - Happy New Year! -2005-12-31 Tobias Doerffel +2005-12-31 Tobias Doerffel * include/channel_track.h: * src/tracks/channel_track.cpp: removed surround-area in track-settings-widget and added button with MIDI-connection-menu instead -2005-12-30 Tobias Doerffel +2005-12-30 Tobias Doerffel * include/track.h: * include/track_container.h: @@ -764,13 +844,13 @@ * src/core/midi_tab_widget.cpp: use smaller font for connection-selection-menu -2005-12-29 Tobias Doerffel +2005-12-29 Tobias Doerffel * src/widgets/fade_button.cpp: do not update() directly in nextState(), use QTimer instead for avoiding xlib-threading-errors -2005-12-28 Tobias Doerffel +2005-12-28 Tobias Doerffel * plugins/vestige/communication.h: * plugins/vestige/fstclient.cpp: @@ -798,7 +878,7 @@ * src/tracks/channel_track.cpp: corrected calculation in channelTrack::masterKey() -2005-12-27 Tobias Doerffel +2005-12-27 Tobias Doerffel * include/piano_roll.h: * src/core/piano_roll.cpp: @@ -845,7 +925,7 @@ current buffer, so if rendering of current buffer went faster than in realtime, the song doesn't play at a higher speed -2005-12-26 Tobias Doerffel +2005-12-26 Tobias Doerffel * plugins/vestige/vestige.cpp: determine real key of note using channelTrack::masterKey @@ -881,7 +961,7 @@ do not align position and length of bb-track-objects on tact-boundaries as it offers an interesting new feature (incomplete/start beats etc.!) -2005-12-25 Tobias Doerffel +2005-12-25 Tobias Doerffel * src/widgets/visualization_widget.cpp: enable visualization-widget per default @@ -893,7 +973,7 @@ - added note-off-button for being able to note off hanging notes (which sometimes occurs in combination with arpeggios) -2005-12-24 Tobias Doerffel +2005-12-24 Tobias Doerffel * plugins/vestige/vestige.cpp: use new parameter-saving/loading-feature when saving/loading settings @@ -913,7 +993,7 @@ pass unused wheel-events to trackContentObect for being able to scroll within song-editor -2005-12-23 Tobias Doerffel +2005-12-23 Tobias Doerffel * plugins/vestige/fstcore.c: a lot of clean-ups and other bug-fixes making VeSTige almost usable @@ -950,12 +1030,12 @@ added type-information, so every derived class has to pass a type-constant to playHandle-constructor -2005-12-22 Tobias Doerffel +2005-12-22 Tobias Doerffel * configure.in: made 0.1.2 release -2005-12-21 Tobias Doerffel +2005-12-21 Tobias Doerffel * src/lib/sample_buffer.cpp: - first try to use libsndfile instead of SDL_sound for decoding sample @@ -973,7 +1053,7 @@ hide all other tabs when changing active tab - neccessary for working with Qt 4.1 -2005-12-20 Danny McRae +2005-12-20 Danny McRae * resources/step_btn_on_100.png: * resources/step_btn_yellow.png: @@ -982,7 +1062,7 @@ make it possible to change volume of steps in bb-editor using mouse wheel and which changes color of step-button accordingly -2005-12-20 Tobias Doerffel +2005-12-20 Tobias Doerffel * src/lib/sample_buffer.cpp: first implementation of FLAC-encoding/decoding for compressing buffers @@ -993,7 +1073,7 @@ in cleanup-method use list instead of vector for pool of buffers to be removed - fixes crash with Qt4 -2005-12-19 Tobias Doerffel +2005-12-19 Tobias Doerffel * src/widgets/knob.cpp: made knob ready for drag'n'drop of values @@ -1002,7 +1082,7 @@ load and save/load sample-data which doesn't come from sample in/from XML-node (base64-encoded) -2005-12-18 Tobias Doerffel +2005-12-18 Tobias Doerffel * src/tracks/pattern.cpp: use Sint32 instead of Sint16 for determining central key, otherwise we @@ -1048,7 +1128,7 @@ made up all that drag'n'drop-stuff, you're now able to drag samples and presets directly to according channel, sample etc. -2005-12-17 Tobias Doerffel +2005-12-17 Tobias Doerffel * include/bb_editor.h: * include/pattern.h: @@ -1088,7 +1168,7 @@ everytime it changes - other widgets can use this for querying whether one of these modifier-keys is pressed -2005-12-16 Tobias Doerffel +2005-12-16 Tobias Doerffel * configure.in: added better LADSPA-check and fixed some other small things @@ -1102,12 +1182,12 @@ * src/lib/ladspa_manager.cpp: load plugins using QLibrary instead of platform-dependent dl-functions -2005-12-15 Tobias Doerffel +2005-12-15 Tobias Doerffel * include/audio_alsa.h: do not include alsa-headers if they do not exist... -2005-12-14 Tobias Doerffel +2005-12-14 Tobias Doerffel * src/core/file_browser.cpp: display text-float while loading sample for preview @@ -1142,13 +1222,13 @@ * most files: continued improving Qt4-support -2005-12-13 Tobias Doerffel +2005-12-13 Tobias Doerffel * most files: made LMMS compatible with Qt4 again after heavy development under Qt3 led to incompatibility with Qt4 -2005-12-11 Tobias Doerffel +2005-12-11 Tobias Doerffel * src/core/lmms_main_win.cpp: * src/lib/mmp.cpp: @@ -1189,7 +1269,7 @@ * plugins/audio_file_processor/audio_file_processor.cpp: update start- and end-frames of sample-buffer when loading settings -2005-12-10 Tobias Doerffel +2005-12-10 Tobias Doerffel * include/lmms_main_win.h: * include/song_editor.h: @@ -1209,7 +1289,7 @@ - added highlighting during mouse-over - do not connect clicked()-signal if receiver and/or slot are NULL -2005-12-09 Tobias Doerffel +2005-12-09 Tobias Doerffel * include/channel_track.h: * src/core/midi_tab_widget.cpp: @@ -1227,7 +1307,7 @@ * src/midi/midi_port.cpp: do not process MIDI-out-event if channel = -1 -2005-12-08 Tobias Doerffel +2005-12-08 Tobias Doerffel * src/core/midi_tab_widget.cpp: - always un-check items in port-menus when disabling receceiving or @@ -1238,7 +1318,7 @@ * resources/midi_out.png: added icons for MIDI-input- and MIDI-output-port-selection -2005-12-07 Tobias Doerffel +2005-12-07 Tobias Doerffel * include/midi_alsa_seq.h: * include/midi_client.h: @@ -1250,7 +1330,7 @@ selecting according source-/destination-port from a menu in MIDI-setup-tab in each channel-window -2005-12-06 Tobias Doerffel +2005-12-06 Tobias Doerffel * src/core/note_play_handle.cpp: * src/core/piano_roll.cpp: @@ -1263,7 +1343,7 @@ of a small bug) - will drop MIDI-out-plugin very soon as it isn't needed anymore -2005-12-05 Tobias Doerffel +2005-12-05 Tobias Doerffel * include/piano_roll.h: * src/core/piano_roll.cpp: @@ -1276,7 +1356,7 @@ * src/core/piano_roll.cpp: added small zoom-icon to zoom-combobox -2005-12-04 Tobias Doerffel +2005-12-04 Tobias Doerffel * include/midi_alsa_raw.h: * include/midi_client.h: @@ -1319,7 +1399,7 @@ * src/widgets/tab_widget.cpp: reversed scroll-wheel-direction for changing tab -2005-12-03 Tobias Doerffel +2005-12-03 Tobias Doerffel * src/core/main.cpp: - better handling of command-line options @@ -1360,7 +1440,7 @@ easier and also results in a better performance (especially when using JACK) - additionally LMMS doesn't take 100% CPU anymore -2005-12-02 Tobias Doerffel +2005-12-02 Tobias Doerffel * src/core/config_mgr.cpp: do not try to re-run wizard in case of version mismatches @@ -1371,7 +1451,7 @@ dropped ladspa_sine_1063-plugin as it is only for experimental purposes -2005-11-29 Tobias Doerffel +2005-11-29 Tobias Doerffel * plugins/vestige/vestige.h: * plugins/vestige/vestige.cpp: @@ -1389,13 +1469,13 @@ * src/widgets/qxembed.cpp: added QXEmbed-widget which is neccessary for embedding VST-plugin -2005-11-27 Tobias Doerffel +2005-11-27 Tobias Doerffel * src/core/mixer.cpp: added usleep()-call for realizing usable threading and solve problems with 100%-CPU-usage -2005-11-08 Tobias Doerffel +2005-11-08 Tobias Doerffel * include/channel_track.h: * include/sample_play_handle.h: @@ -1434,19 +1514,19 @@ use memset() for clearing buffers - obsoletes usage of silence-buffers in mixer -2005-11-07 Tobias Doerffel +2005-11-07 Tobias Doerffel * src/midi/midi_alsa_seq.cpp: use relative instead of absolute scheduling for events which makes MIDI-out working -2005-10-31 Tobias Doerffel +2005-10-31 Tobias Doerffel * include/midi_alsa_seq.h: * src/midi/midi_alsa_seq.cpp: several bug-fixes -2005-10-30 Tobias Doerffel +2005-10-30 Tobias Doerffel * include/midi_alsa_seq.h: * src/midi/midi_alsa_seq.cpp: @@ -1470,7 +1550,7 @@ when reading/saving device-name via config-mgr, use "midialsaraw" instead of "midialsa" as context-name -2005-10-28 Tobias Doerffel +2005-10-28 Tobias Doerffel * src/widgets/project_notes.cpp: set initial text to bright gray, since black text on a very dark back- @@ -1490,7 +1570,7 @@ reorder some code in constructor for not crashing if window is shown while constructor is still running -2005-10-23 Tobias Doerffel +2005-10-23 Tobias Doerffel * src/widgets/led_checkbox.cpp: also emit toggled()-signal if state actually wasn't changed @@ -1527,7 +1607,7 @@ * src/midi/midi_device.cpp: removed -2005-10-21 Tobias Doerffel +2005-10-21 Tobias Doerffel * src/widgets/tempo_sync_knob.cpp: do not implement the same code as knob does in mouseMoveEvent() - call @@ -1537,7 +1617,7 @@ * src/widgets/knob.cpp: cleaned up a lot and fixed some bugs -2005-10-20 Tobias Doerffel +2005-10-20 Tobias Doerffel * include/song_editor.h: decreased MAX_BPM to 999 since BPM-LCD-spinbox is intended to have @@ -1552,7 +1632,7 @@ * configure.in: check for libfst and present VST-SDK header-files -2005-10-19 Tobias Doerffel +2005-10-19 Tobias Doerffel * plugins/vestige/vestige.h: * plugins/vestige/vestige.cpp: @@ -1592,7 +1672,7 @@ * resources/: improved icons such as project_*.png and sample-track-related icons -2005-10-18 Tobias Doerffel +2005-10-18 Tobias Doerffel * include/channel_track.h: * src/tracks/channel_track.cpp: @@ -1627,7 +1707,7 @@ added setParameter() and getParameter()-methods for making LMMS able to set parameters of a specific plugin without knowing anything about it -2005-10-17 Tobias Doerffel +2005-10-17 Tobias Doerffel * buildtools/bin2res.cpp: * include/embed.h: @@ -1647,7 +1727,7 @@ removed Moog-2-filter as it is only very CPU-intensive without any significant difference to sound of normal Moog-filter -2005-10-16 Tobias Doerffel +2005-10-16 Tobias Doerffel * src/lib/ladspa_manager.cpp: skip not existing/unreadable directories when searching for plugins @@ -1686,14 +1766,14 @@ * src/core/instrument.cpp: renamed files soundgenerator.* to instrument.* as well as class-name -2005-10-15 Tobias Doerffel +2005-10-15 Tobias Doerffel * include/vestige.h: * src/soundgenerators/vestige.cpp: new plugin "VeSTige" for handling VST-plugins - VERY experimental, but at least, we get some sound out of these strange dll-files ;-) -2005-10-13 Tobias Doerffel +2005-10-13 Tobias Doerffel * src/audio/audio_jack.cpp: do not fill up buffers if JACK-transport is not rolling but at the same @@ -1712,7 +1792,7 @@ * src/soundgenerators/*.cpp: removed obsolete defaultSettings()-method from each soundgenerator -2005-10-13 Danny McRae +2005-10-13 Danny McRae * include/ladspa_manager.h * include/ladspa_sine_1063.h @@ -1720,7 +1800,7 @@ * src/soundgenerators/ladspa_sine_1063.cpp: added LADSPA-support and a simple soundgenerator for testing-purposes -2005-10-12 Danny McRae +2005-10-12 Danny McRae * Makefile.am: * include/led_checkbox.h: @@ -1729,7 +1809,7 @@ inherit ledCheckBox from QWidget instead of QCheckBox since it sometimes caused graphic-errors when running on KDE with Baghira-style... -2005-10-05 Danny McRae +2005-10-05 Danny McRae * resources/note_double_whole.png: * resources/note_eighth.png: @@ -1761,20 +1841,20 @@ added tempo-sync-knob which automatically converts fixed note-length's to a fixed time in ms everytime BPM is changed -2005-10-03 Tobias Doerffel +2005-10-03 Tobias Doerffel * include/basic_filters.h: - added another moog-filter which sounds a bit better but needs MUCH more CPU-time... - cleaned up different filter-code-branches -2005-10-02 Tobias Doerffel +2005-10-02 Tobias Doerffel * include/oscillator.h: cast to int instead of floor()ing value in oscillator::phase() which makes the whole thing faster again... -2005-09-29 Tobias Doerffel +2005-09-29 Tobias Doerffel * src/widgets/tab_widget.cpp: fixed bugs when adding widget with already existing index @@ -1813,7 +1893,7 @@ * inlude/empty_sg_plugin.h: added empty sound-generator plugin -2005-09-28 Tobias Doerffel +2005-09-28 Tobias Doerffel * include/song_editor.h: * src/core/song_editor.cpp: @@ -1846,7 +1926,7 @@ - different painting if no caption was defined - switch tabs if wheel-events occurs -2005-09-27 Tobias Doerffel +2005-09-27 Tobias Doerffel * src/tracks/channel_track.cpp: began improving GUI of channel-track-window @@ -1861,12 +1941,12 @@ define macro ALSA_PCM_NEW_HW_PARAMS_API for working with older ALSA- versions which offer old and new HW-param-API - we're using the new one -2005-09-26 Tobias Doerffel +2005-09-26 Tobias Doerffel * many files: make LMMS compile with Qt 3.0 and GCC 2.95 -2005-09-25 Tobias Doerffel +2005-09-25 Tobias Doerffel * src/audio/audio_jack.cpp: - decreased wait-time from 0.5 ms to 0.2 ms in writeBufferToDev(...) @@ -1888,7 +1968,7 @@ do not save play-pos from previous play-mode when beginning to play in different play-mode - fixes bug in timeline behaviour "back to start" -2005-09-24 Tobias Doerffel +2005-09-24 Tobias Doerffel * configure.in: * include/audio_oss.h: @@ -1917,12 +1997,12 @@ * src/core/track_container.cpp: set modified-state for song when removing track -2005-09-21 Tobias Doerffel +2005-09-21 Tobias Doerffel * configure.in: made 0.1.1 release -2005-09-20 Tobias Doerffel +2005-09-20 Tobias Doerffel * include/about_dialog.h: * src/core/about_dialog.cpp: @@ -1957,12 +2037,12 @@ up everything - fixes bug with empty browsers after fresh personal installation of LMMS -2005-09-19 Tobias Doerffel +2005-09-19 Tobias Doerffel * configure.in: made 0.1.0 release -2005-09-18 Tobias Doerffel +2005-09-18 Tobias Doerffel * src/tracks/bb_track.cpp: revised paintEvent()-method -> bb-TCO's are now painted with a gradient! @@ -2017,7 +2097,7 @@ for determining path to localization files - this call created all wizard-widgets before actual localization was loaded... -2005-09-17 Tobias Doerffel +2005-09-17 Tobias Doerffel * src/core/setup_dialog.cpp: added switches for disabling tooltips and turning on classical knob- @@ -2027,7 +2107,7 @@ * src/widget/led_checkbox.cpp: added LED-check-box -2005-09-16 Tobias Doerffel +2005-09-16 Tobias Doerffel * src/core/mixer.cpp: clear output-buffers in ctor before using them -> avoids awful noises @@ -2064,7 +2144,7 @@ usage of tooltips, so there's no difference to code using tooltips whether it is compiled with Qt 3 or Qt 4 -2005-09-14 Tobias Doerffel +2005-09-14 Tobias Doerffel * include/mixer.h: * include/note_play_handle.h: @@ -2113,7 +2193,7 @@ * locale/fr.ts: added French translation -2005-09-13 Tobias Doerffel +2005-09-13 Tobias Doerffel * src/core/lmms_main_win.cpp: - show setup-dialog if LMMS is started first time or mixer uses dummy- @@ -2148,7 +2228,7 @@ added probeDevice()-method which eases determining device-name in either actual audio-class as well as in it's setup-widget -2005-09-11 Tobias Doerffel +2005-09-11 Tobias Doerffel * src/core/mixer.cpp: use new audio-settings-technology for opening audio-device @@ -2193,7 +2273,7 @@ * src/lib/embed.cpp: do not return null-pixmap if pixmap not found -2005-09-10 Tobias Doerffel +2005-09-10 Tobias Doerffel * resources/setup_audio.png: * resources/setup_general.png: @@ -2226,12 +2306,12 @@ - use macro AS_HELP_STRING for formatting help-strings - removed --with-latency option as it is not needed anymore -2005-09-06 Alireza +2005-09-06 Alireza * resources/ir.ts: added Persian translation -2005-09-04 Tobias Doerffel +2005-09-04 Tobias Doerffel * src/audio/audio_oss.cpp: - read device-name from config-file before evaluating environment- @@ -2274,13 +2354,13 @@ added value() and setValue()-method which offers all components of LMMS an easy way for loading/saving their settings at startup/exit -2005-09-02 Mario Izquierdo -2005-09-02 Johnny Saenz +2005-09-02 Mario Izquierdo +2005-09-02 Johnny Saenz * resources/es.ts: added Spanish translation -2005-09-02 Tobias Doerffel +2005-09-02 Tobias Doerffel * most files: finished changes began on 2005-08-29 @@ -2293,7 +2373,7 @@ * resources/de.ts: completed German translation -2005-08-29 Tobias Doerffel +2005-08-29 Tobias Doerffel * most files: begin to use new bufferAllocator instead of old buffer-types and @@ -2305,7 +2385,7 @@ as the constant FRAMES_PER_AUDIO_BUFFER - use mixer::inst()->framesPerAudioBuffer() instead -2005-08-28 Tobias Doerffel +2005-08-28 Tobias Doerffel * include/song_editor.h: * src/core/song_editor.cpp: @@ -2338,7 +2418,7 @@ * src/core/arp_and_chords_tab_widget.cpp: set m_arpDirection correct when loading older settings -2005-08-27 Tobias Doerffel +2005-08-27 Tobias Doerffel * include/channel_track.h: * src/tracks/channel_track.cpp: @@ -2359,7 +2439,7 @@ of LMMS and JACK are different - also free buffers in destructor and not just throw them out of list -2005-08-26 Tobias Doerffel +2005-08-26 Tobias Doerffel * include/audio_jack.h: * src/audio/audio_jack.cpp: @@ -2372,7 +2452,7 @@ * src/lib/buffer_allocator.cpp: added bufferAllocator which is an optimized internal memory-manager -2005-08-24 Tobias Doerffel +2005-08-24 Tobias Doerffel * include/audio_jack.h: * src/audio/audio_jack.cpp: @@ -2385,7 +2465,7 @@ completed usage of switchable groupboxes by saving groupbox-states and evaluating them in processNote() -2005-08-22 Tobias Doerffel +2005-08-22 Tobias Doerffel * resources/afp_artwork.png: small improvements for better usability and internationalization @@ -2449,7 +2529,7 @@ text -2005-08-21 Tobias Doerffel +2005-08-21 Tobias Doerffel * src/widgets/side_bar_widget.cpp: * src/tracks/channel_track.cpp: @@ -2497,14 +2577,14 @@ * src/core/main.cpp: added --version command-line-switch -2005-08-20 Tobias Doerffel +2005-08-20 Tobias Doerffel * src/core/lmms_main_win.cpp: - extended filter for sample-browser - added home- and root-browser for being able to load songs, presets, samples etc. from somewhere else than within lmms-working-directory -2005-07-27 Tobias Doerffel +2005-07-27 Tobias Doerffel * src/core/lmms_main_win.cpp: * src/core/track_container.cpp: @@ -2526,7 +2606,7 @@ * src/core/track.cpp: removed unsused method setTrackWidgetHeight( int ) -2005-07-26 Pedro Lopez-Cabanillas +2005-07-26 Pedro Lopez-Cabanillas * src/core/browser.cpp: * src/core/config_mgr.cpp: @@ -2543,7 +2623,7 @@ added MIDIDEV-environment variable for being able to choose a MIDI device different from the default one -2005-07-24 Tobias Doerffel +2005-07-24 Tobias Doerffel * include/midi_mapper.h: * src/midi/midi_mapper.cpp: @@ -2568,13 +2648,13 @@ - fixed bug which caused horizontal scrollbar to have an undefined max-value after starting up LMMS - go to start of pattern when pressing home-key - -2005-07-23 Alexey Kouznetsov + +2005-07-23 Alexey Kouznetsov * resources/ru.ts: added Russian translation -2005-07-23 Tobias Doerffel +2005-07-23 Tobias Doerffel * src/core/piano_roll.cpp: scroll back when stopping and play-position changes to invisible area @@ -2588,7 +2668,7 @@ * src/midi/midi_device.cpp: limit volume between 0 and 127 when sending out note-on-event -2005-07-21 Tobias Doerffel +2005-07-21 Tobias Doerffel * include/nstate_button.h: * src/widgets/nstate_button.cpp: @@ -2607,7 +2687,7 @@ * lmms-0.1.0rc1.tar.bz2: release of Release Candidate 1 of LMMS 0.1.0 -2005-07-20 Tobias Doerffel +2005-07-20 Tobias Doerffel * src/midi/midi_file.cpp: - proper handling of note-on-events which velocity 0 -> treat like @@ -2628,14 +2708,14 @@ * src/widgets/knob.cpp: fixed bugs caused by changes made before for scroll-wheel-support -2005-07-19 Tobias Doerffel +2005-07-19 Tobias Doerffel * include/knob.h: * src/widgets/knob.cpp: added better scroll-wheel support which increases/decreases knob-value by 20th of range (e.g 0.05 if knob is ranged between 0 and 1) -2005-07-17 Tobias Doerffel +2005-07-17 Tobias Doerffel * projects/: added "covers"-dir and added "Preludium and Fuge A-Minor" by J.S.Bach @@ -2656,7 +2736,7 @@ new plugin midiOut which sends all notes on this channel out to external midi-device this is especially cool for playing arpeggio for key pressed on external midi-device!! - + * src/soundgenerators/plucked_string_synth.cpp: removed unneccesary inclusion of qpainter-header @@ -2674,12 +2754,12 @@ added missing arg()-call to QMessageBox::critical()-call in audioFileDevice-ctor -2005-07-16 Tobias Doerffel +2005-07-16 Tobias Doerffel * src/core/config_mgr.cpp: added shortcuts to navigation-buttons -2005-07-14 Tobias Doerffel +2005-07-14 Tobias Doerffel * src/core/piano_roll.cpp: only play notes while editing if we're not in play-mode @@ -2689,7 +2769,7 @@ when exporting always render one additional tact at the end so that we don't cut off notes with delay etc. -2005-07-12 Tobias Doerffel +2005-07-12 Tobias Doerffel - successful compilation with GCC 4.0.1 ;-) @@ -2697,7 +2777,7 @@ fixed bug responsible for playing base-notes of chords all time if any arpeggio selected was selected -2005-07-11 Tobias Doerffel +2005-07-11 Tobias Doerffel * resources/source/wizard_files.xcf: * resources/wizard_files.png: @@ -2716,7 +2796,7 @@ * lmms-0.1.0beta.tar.bz2: made beta-release of 0.1.0 and announced it on kde-apps.org -2005-07-10 Tobias Doerffel +2005-07-10 Tobias Doerffel * presets/TripleOscillator/: added cool Church Organ preset and improved Xylophon preset @@ -2751,7 +2831,7 @@ * src/core/export_project_dialog.cpp: renamed from export_song_dialog.ext to export_project_dialog.ext -2005-07-09 Tobias Doerffel +2005-07-09 Tobias Doerffel * all files: now all source-code-files but some single exceptions do not have more @@ -2802,7 +2882,7 @@ which makes it all a bit smaller and faster since we do not always have to access the current element using the []-operator -2005-07-08 Tobias Doerffel +2005-07-08 Tobias Doerffel * src/core/envelope_tab_widget.cpp: * src/lib/sample_buffer.cpp: @@ -2813,7 +2893,7 @@ * projects/: added directories "tutorials" and "recorded_loops" -2005-07-07 Tobias Doerffel +2005-07-07 Tobias Doerffel * include/bb_track.h: added FASTCALL to moveLocation(...) and changeLength(...) which fixes @@ -2825,7 +2905,7 @@ * samples/: added a lot of new samples from wikisource and others -2005-07-06 Tobias Doerffel +2005-07-06 Tobias Doerffel * include/project_notes.h: * src/core/song_editor.cpp: @@ -2857,7 +2937,7 @@ added setKey()- and key()-member which setting/getting absolute key of note -2005-07-05 Tobias Doerffel +2005-07-05 Tobias Doerffel * configure.in: * projects/: @@ -2887,7 +2967,7 @@ check whether compiler knows floorf and powf and if not, define them to floor/pow -2005-07-04 Tobias Doerffel +2005-07-04 Tobias Doerffel * most files: made LMMS compiling (and working) with Qt 3.0, GCC 2.95 and other old @@ -2902,7 +2982,7 @@ added support for versions of libsndfile < 1.0.11 since API has changed in libsndfile 1.0.11 -2005-07-03 Tobias Doerffel +2005-07-03 Tobias Doerffel * resources/control_env_amount_active.png: * resources/control_env_amount_inactive.png: @@ -2940,7 +3020,7 @@ * src/audio/audio_alsa.cpp: added support for 48 KHz soundcards -2005-07-02 Tobias Doerffel +2005-07-02 Tobias Doerffel * configure.in: * src/lib/sample_buffer.cpp: @@ -2966,7 +3046,7 @@ led to crash when having piano-roll open while deleting pattern (e.g. creating new file, opening file etc.) -2005-07-01 Tobias Doerffel +2005-07-01 Tobias Doerffel * all files: replaced "location" in names of functions/variables by "position" @@ -2979,7 +3059,7 @@ added support for autoscroll in piano-roll when playing/recording pattern -2005-06-30 Tobias Doerffel +2005-06-30 Tobias Doerffel * include/channel_track.h: * include/midi_device.h @@ -3018,7 +3098,7 @@ added missing #include "debug.h" for solving problems with undeclared assert() because of not included assert.h -2005-06-29 Tobias Doerffel +2005-06-29 Tobias Doerffel * configure.in: * include/audio_sdl.h: @@ -3029,15 +3109,14 @@ * README: updated everything a bit... -2005-06-28 Tobias Doerffel +2005-06-28 Tobias Doerffel * include/envelope_tab_widget.h: * src/core/envelope_tab_widget.cpp: use button instead of knob for turning filter on/off -2005-06-27 Tobias Doerffel +2005-06-27 Tobias Doerffel * samples/effects/Makefile.am: don't install effect-samples into directory of basses-samples - diff --git a/Makefile.am b/Makefile.am index 73f73f256c..b2bbaf5386 100644 --- a/Makefile.am +++ b/Makefile.am @@ -47,6 +47,7 @@ man1_MANS = lmms.1 lmms_MOC = \ ./about_dialog.moc \ ./arp_and_chords_tab_widget.moc \ + ./automatable_button.moc \ ./bb_editor.moc \ ./bb_track.moc \ ./channel_track.moc \ @@ -127,6 +128,7 @@ lmms_SOURCES = \ $(srcdir)/src/core/envelope_tab_widget.cpp \ $(srcdir)/src/core/export_project_dialog.cpp \ $(srcdir)/src/core/file_browser.cpp \ + $(srcdir)/src/core/import_filter.cpp \ $(srcdir)/src/core/instrument.cpp \ $(srcdir)/src/core/main_window.cpp \ $(srcdir)/src/core/main.cpp \ @@ -150,6 +152,7 @@ lmms_SOURCES = \ $(srcdir)/src/lib/base64.cpp \ $(srcdir)/src/lib/buffer_allocator.cpp \ $(srcdir)/src/lib/clipboard.cpp \ + $(srcdir)/src/lib/edit_history.cpp \ $(srcdir)/src/lib/embed.cpp \ $(srcdir)/src/lib/ladspa_manager.cpp \ $(srcdir)/src/lib/mmp.cpp \ @@ -159,7 +162,6 @@ lmms_SOURCES = \ $(srcdir)/src/midi/midi_alsa_raw.cpp \ $(srcdir)/src/midi/midi_alsa_seq.cpp \ $(srcdir)/src/midi/midi_client.cpp \ - $(srcdir)/src/midi/midi_file.cpp \ $(srcdir)/src/midi/midi_mapper.cpp \ $(srcdir)/src/midi/midi_oss.cpp \ $(srcdir)/src/midi/midi_port.cpp \ @@ -167,6 +169,7 @@ lmms_SOURCES = \ $(srcdir)/src/tracks/channel_track.cpp \ $(srcdir)/src/tracks/pattern.cpp \ $(srcdir)/src/tracks/sample_track.cpp \ + $(srcdir)/src/widgets/automatable_button.cpp \ $(srcdir)/src/widgets/combobox.cpp \ $(srcdir)/src/widgets/cpuload_widget.cpp \ $(srcdir)/src/widgets/fade_button.cpp \ @@ -253,7 +256,6 @@ lmms_SOURCES = \ $(srcdir)/include/midi_alsa_raw.h \ $(srcdir)/include/midi_client.h \ $(srcdir)/include/midi_event_processor.h \ - $(srcdir)/include/midi_file.h \ $(srcdir)/include/midi_oss.h \ $(srcdir)/include/midi_port.h \ $(srcdir)/include/midi_time.h \ @@ -277,6 +279,7 @@ lmms_SOURCES = \ $(srcdir)/include/buffer_allocator.h \ $(srcdir)/include/lcd_spinbox.h \ $(srcdir)/include/tooltip.h \ + $(srcdir)/include/automatable_button.h \ $(srcdir)/include/led_checkbox.h \ $(srcdir)/include/text_float.h \ $(srcdir)/include/tempo_sync_knob.h \ @@ -297,6 +300,9 @@ lmms_SOURCES = \ $(srcdir)/include/rubberband.h \ $(srcdir)/include/base64.h \ $(srcdir)/include/automatable_object.h \ + $(srcdir)/include/editable_object.h \ + $(srcdir)/include/edit_history.h \ + $(srcdir)/include/import_filter.h \ $(srcdir)/include/engine.h \ $(srcdir)/include/qxembed.h diff --git a/README b/README index fcffbdf397..a860014924 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Linux MultiMedia Studio 0.1.2 +Linux MultiMedia Studio 0.1.4 ============================== Copyright (c) 2004-2006 by Tobias Doerffel and others. diff --git a/TODO b/TODO index b925f0e2d6..7386239a15 100644 --- a/TODO +++ b/TODO @@ -1,16 +1,20 @@ +- add edit-history to project for making it possible to undo things even if you did them in a previous session +- make edit-history qobject and undo/redo slots -> direct connection to GUI +- restore stacking-order of windows when loading project +- fix MIDI-import-filter +- bristol-bindings +- resample sample-track-tcos when using hq-mode - add support for panes-interface (like blender) (instead of MDI etc.) - message when importing unsupported MIDI-file (track-count = 0) - volume-knobs for each sample-track -- AMS-bindings +- AMS/OMS-bindings - remove binary-embed-system - recording-functionality - show loading-vst-hint when cloning vestige-track - do not hang when saving while loading VST-plugin - tempo-recogn. and sync of beat-samples - do not quantize when importing from MIDI-file -- KNOB-setValue!!! - separate GUI and data/sound-processing-code -- fix qtimer-problem /channel-activity-LEDs - make color-scheme switchable: LMMS / user - autosave every 30s (configurable!) and offer recovery at startup after crash - make piano-roll use rubberband instead of implementing a simple one on it's own @@ -25,7 +29,6 @@ - pre-listen when opening sample with QFileDialog - panning-editing in piano-roll - speed up painting of sampleTCO -- save window-positions, -states and -sizes in files - solve problems with different keyboard-layouts when playing channel-track with pc-keyboard -> use tr() - panning env+lfo - plucked-string-synth: knob for metallic -> use noise as wave-shape @@ -41,7 +44,6 @@ - effect-board -> live-fx from input -- event/automation-system - chord-editor? - WAVE/OGG/MP3-Import -> FFT-analysis -> write notes - FLP-Import diff --git a/configure.in b/configure.in index b0c44fcb8a..f35f320eec 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) -AC_INIT(lmms, 0.1.4-cvs20060308, tobydox/at/users/dot/sourceforge/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.1.4-cvs20060308) +AC_INIT(lmms, 0.1.4-cvs20060313, tobydox/at/users/dot/sourceforge/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.1.4-cvs20060313) AM_CONFIG_HEADER(config.h) @@ -465,6 +465,7 @@ AC_CONFIG_FILES([Makefile plugins/Makefile plugins/audio_file_processor/Makefile plugins/bit_invader/Makefile + plugins/midi_import/Makefile plugins/organic/Makefile plugins/plucked_string_synth/Makefile plugins/triple_oscillator/Makefile @@ -679,7 +680,7 @@ else with_warnings="true" else if test ! -z "$HAVE_VST_AEFFECTX_H" ; then - PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* it's own VST-server for hosting VST-plugins" + PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* LMMS VST Support Layer (LVSL) for integrated VST-plugin usage" else echo " ========================" echo " === LMMS - WARNING =======================================================" diff --git a/data/locale/de.ts b/data/locale/de.ts index 70871b3b06..549a898231 100755 --- a/data/locale/de.ts +++ b/data/locale/de.ts @@ -32,18 +32,6 @@ If you're interested in translating LMMS in another language or want to imp Deutsche Übersetzung von Tobias Doerffel Wenn Sie an der Übersetzung von LMMS in eine andere Sprache interessiert sind oder existierende Übersetzungen verbessern wollen, sind Sie herzlich willkommen, uns zu helfen! Kontaktieren Sie einfach den Maintainer! - - - LMMS - A powerful synthesizer-studio - -Copyright (c) 2004-2005 LMMS-Developers - -http://lmms.sourceforge.net - LMMS - Ein leistungsfähiges Synthesizer-Studio - -Copyright (c) 2004-2005 LMMS-Entwickler - -http://lmms.sourceforge.net Linux MultiMedia Studio %1 @@ -516,22 +504,10 @@ http://lmms.sourceforge.net GATE GATE - - DIRECTION: - RICHTUNG: - - - SORT-MODE - SORT-MODUS - Direction: Richtung: - - Sort-mode - Sort-Modus - Mode: Modus: @@ -669,10 +645,6 @@ http://lmms.sourceforge.net Click here, if you want to stop playing of current beat/bassline. Klicken Sie hier, wenn Sie das Abspielen des aktuellen Beats/Bassline stoppen wollen. - - Beat+Bassline Editor - Beat+Bassline Editor - Beat+Baseline Editor Beat+Baseline Editor @@ -692,10 +664,6 @@ http://lmms.sourceforge.net Change color Farbe ändern - - Open in Beat+Bassline-Editor - Im Beat+Bassline-Editor öffnen - Open in Beat+Baseline-Editor Im Beat+Baseline-Editor öffnen @@ -704,9 +672,6 @@ http://lmms.sourceforge.net bbTrack - Beat/Bassline %1 - Beat/Bassline %1 - Beat/Baseline %1 Beat/Baseline %1 @@ -913,10 +878,6 @@ Kopierte Dateien können Sie ändern, aber gleichzeitig belegen diese auch zusä Copy or link files Dateien kopieren oder verknüpfen - - Choose LMMS-working-directory - LMMS-Arbeitsverzeichnis wählen - Directory not existing Verzeichnis existiert nicht @@ -1424,191 +1385,6 @@ Stellen Sie sicher, dass Sie Schreibzugriff auf die gewählte Datei/Gerät haben Bitte warten, Sample wird für Vorschau geladen.... - - lmmsMainWin - - Setting up main-window and workspace... - Initialisiere Hauptfenster und Arbeitsbereich... - - - Creating new song... - Erstelle neuen Song... - - - Creating GUI... - Erstelle Oberfläche... - - - &New - &Neu - - - &Open... - Ö&ffnen... - - - &Save - &Speichern - - - Save &As... - Speichern &als... - - - E&xport - E&xportieren - - - &Quit - &Beenden - - - Help - Hilfe - - - About - Über - - - &Help - &Hilfe - - - What's this? - Was ist das? - - - By pressing this button, you can show or hide the Beat+Bassline Editor. The Beat+Bassline Editor is needed for setting beats, opening, adding and removing channels, cutting, copying and pasting beat- and bassline-patterns and other things like that. - Durch das Drücken dieses Knopfes wird der Beat+Bassline Editor ein- oder ausgeblendet. Der Beat+Bassline Editor ist nötig, um Beats zu setzen, um Kanale zu öffnen, hinzuzufügen und zu entfernen, um Bassline-Patterns auszuschneiden, zu kopieren und einzufügen usw. - - - My samples - Meine Samples - - - My presets - Meine Presets - - - My projects - Meine Projekte - - - Loading song... - Lade Song... - - - &Settings - Ein&stellungen - - - Show setup wizard - Einrichtungsassistent zeigen - - - By pressing this button, you can show or hide the project notes window. In this window you can put down your project notes. - Durch das Drücken dieses Knopfes können Sie das Projektnotizen-Fenster ein- oder ausblenden. In diesem Fenster können Sie Ihre Projektnotizen aufschreiben. - - - By pressing this button, you can show or hide the EffectBoard. The EffectBoard is a very powerful tool for managing effects for your song. You can insert effects into different effect-channels. - Durch das Drücken dieses Knopfes wird das EffectBoard ein- oder ausgeblendet. Das EffectBoard ist ein äußerst leistungsfähiges Werkzeug, um Effekte für Ihren Song zu verwalten. Sie können Effekte in unterschiedliche Effekt-Kanäle einfügen. - - - LMMS %1 - LMMS %1 - - - Create new project - Neues Projekt erstellen - - - Open existing project - Existierendes Projekt öffnen - - - Save current project - Aktuelles Projekt speichern - - - Export current project - Aktuelles Projekt exportieren - - - By pressing this button, you can show or hide the Piano-Roll. With the help of the Piano-Roll you can edit melody-patterns in an easy way. - Durch das Drücken dieses Knopfes können Sie das Piano-Roll ein- oder ausblenden. Mit Hilfe des Piano-Rolls können Sie Melodie-Patterns auf eine bequeme Art bearbeiten. - - - &Project - &Projekt - - - Open project - Projekt öffnen - - - Save project - Projekt speichern - - - Import file - Datei importieren - - - My home - Persönlicher Ordner - - - Root directory - Wurzelverzeichnis - - - Show settings dialog - Einstellungsdialog anzeigen - - - Help not available - Hilfe nicht verfügbar - - - Show/hide Beat+Bassline Editor - Zeige/verstecke Beat+Bassline Editor - - - Show/hide Piano-Roll - Zeige/verstecke Piano-Roll - - - Show/hide Song-Editor - Zeige/verstecke Song-Editor - - - By pressing this button, you can show or hide the Song-Editor. With the help of the Song-Editor you can edit song-playlist and specify when which track should be played. You can also insert and move samples (e.g. rap-samples) directly into the playlist. - Durch das Drücken dieses Knopfes können Sie den Song-Editor ein- oder ausblenden. Mit Hilfe des Song-Editors können Sie den Song bearbeiten und einstellen, wann welche Spur gespielt werden soll. Sie können auch Samples (z.B. Rap-Samples) direkt in die Playliste einfügen und verschieben. - - - Show/hide EffectBoard - Zeige/verstecke EffectBoard - - - Show/hide project notes - Zeige/verstecke Projekt-Notizen - - - MultiMedia Project (*.mmp *.xml) - MultiMedia-Projekt (*.mmp *.xml) - - - MultiMedia Project (*.mmp);;MultiMedia Project Template (*.mpt) - MultiMedia-Projekt (*.mmp);;MultiMedia-Projekt-Vorlage (*.mpt) - - - Currently there's no help available in LMMS. -Please visit http://wiki.mindrules.net for documentation on LMMS. - Derzeit ist in LMMS keine Hilfe verfügbar. -Bitte besuchen Sie http://wiki.mindrules.net für Dokumentationen über LMMS. - - mainWindow @@ -1659,14 +1435,6 @@ Bitte besuchen Sie http://wiki.mindrules.net für Dokumentationen über LMMS.Export current project Aktuelles Projekt exportieren - - Show/hide Beat+Bassline Editor - Zeige/verstecke Beat+Bassline Editor - - - By pressing this button, you can show or hide the Beat+Bassline Editor. The Beat+Bassline Editor is needed for setting beats, opening, adding and removing channels, cutting, copying and pasting beat- and bassline-patterns and other things like that. - Durch das Drücken dieses Knopfes wird der Beat+Bassline Editor ein- oder ausgeblendet. Der Beat+Bassline Editor ist nötig, um Beats zu setzen, um Kanale zu öffnen, hinzuzufügen und zu entfernen, um Bassline-Patterns auszuschneiden, zu kopieren und einzufügen usw. - Show/hide Piano-Roll Zeige/verstecke Piano-Roll @@ -1789,10 +1557,6 @@ Bitte besuchen Sie http://wiki.mindrules.net für Dokumentationen über LMMS.Show/hide Beat+Baseline Editor Zeige/verstecke Beat+Baseline Editor - - By pressing this button, you can show or hide the Beat+Baseline Editor. The Beat+Baesline Editor is needed for setting beats, opening, adding and removing channels, cutting, copying and pasting beat- and baseline-patterns and other things like that. - Durch das Drücken dieses Knopfes wird der Beat+Baseline Editor ein- oder ausgeblendet. Der Beat+Bassline Editor ist nötig, um Beats zu setzen, um Kanale zu öffnen, hinzuzufügen und zu entfernen, um Bassline-Patterns auszuschneiden, zu kopieren und einzufügen usw. - By pressing this button, you can show or hide the Beat+Baseline Editor. The Beat+Baseline Editor is needed for creating beats, opening, adding and removing channels, cutting, copying and pasting beat- and baseline-patterns and other things like that. Durch das Drücken dieses Knopfes wird der Beat+Baseline Editor ein- oder ausgeblendet. Der Beat+Baseline Editor ist nötig, um Beats zu erstellen, Kanale zu öffnen, hinzuzufügen und zu entfernen sowie um Baseline-Patterns auszuschneiden, zu kopieren und einzufügen usw. @@ -1822,14 +1586,6 @@ Bitte besuchen Sie http://wiki.mindrules.net für Dokumentationen über LMMS.CHANNEL KANAL - - RECEIVE MIDI-EVENTS - MIDI-EREIGNISSE EMPFANGEN - - - SEND MIDI-EVENTS - MIDI-EREIGNISSE SENDEN - MIDI-devices to receive MIDI-events from MIDI-Geräte, von denen MIDI-Events empfangen werden sollen @@ -1950,10 +1706,6 @@ Bitte besuchen Sie http://wiki.mindrules.net für Dokumentationen über LMMS.The pattern currently cannot be freezed because you're in play-mode. Please stop and try again! Der Pattern kann derzeit nicht eingefroren werden, da Sie sich im Abspiel-Modus befinden. Bitte stoppen Sie und versuchen es erneut! - - double-click to open this pattern in piano-roll - Doppelklick, um diesen Pattern im Piano-Roll zu öffnen - Open in piano-roll Im Piano-Roll öffnen @@ -2140,10 +1892,6 @@ Lautstärke eines Steps kann mit Mausrad geändert werden Plugin browser Plugin-Browser - - You can drag an instrument-plugin into either the Song-Editor, the Beat+Bassline Editor or just into a channel-window or on the corresponding channel-button. - Sie können ein Instrument-Plugin entweder in den Song-Editor, den Beat+Bassline-Editor oder einfach in ein Kanal-Fenster oder auf den zugehörigen Kanal-Button ziehen. - cheap synthesis of guitar/harp-like sounds Einfache Synthese gitarren-/harfenähnlicher Klänge @@ -2152,10 +1900,6 @@ Lautstärke eines Steps kann mit Mausrad geändert werden three powerful oscillators you can modulate in several ways Drei leistungsfähige Oszillatoren, die Sie auf verschiedene Art und Weise modulieren können - - experimental VST-hoster for using VST-plugins within LMMS - Experimenteller VST-Hoster zum Benutzen von VST-Plugins innerhalb von LMMS - simple sampler with various settings for using samples (e.g. drums) in a channel Einfacher Sampler mit verschiedenen Einstellungen zum Benutzen von Samples (z.B. Drums) in einem Kanal @@ -2309,10 +2053,6 @@ Lautstärke eines Steps kann mit Mausrad geändert werden sampleBuffer - - All Audio-Files (*.wav *.ogg *.voc *.aif *.aiff *.au *.raw) - Alle Audio-Dateien (*.wav *.ogg *.voc *.aif *.aiff *.au *.raw) - Wave-Files (*.wav) Wave-Dateien (*.wav) @@ -2414,12 +2154,6 @@ Lautstärke eines Steps kann mit Mausrad geändert werden Cancel Abbrechen - - FRAMES: %1 -LATENCY: %2 ms - FRAMES: %1 -LATENZ: %2 ms - Here you can setup the internal buffer-size used by LMMS. Smaller values result in a lower latency but also may cause unusable sound or bad performance, especially on older computers or systems with a non-realtime kernel. Hier können Sie die interne Puffergröße einstellen, die von LMMS genutzt wird. Kleinere Werte machen sich in einer geringeren Latenz bemerkbar, können aber auch zu unbrauchbarem Sound oder schlechter Performance führen, vor allem auf älteren Computern oder Systemen mit einem Nicht-Echtzeit-Kernel. @@ -2517,10 +2251,6 @@ Latenz: %2 ms Dummy (no sound output) Dummy (keine Sound-Ausgabe) - - JACK (Jack Audio Connection Kit) - JACK (Jack Audio Connection Kit) - OSS (Open Sound System) OSS (Open Sound System) @@ -2590,7 +2320,7 @@ Latenz: %2 ms Click here, if you want to play your whole song. Playing will be started at the song-position-marker (green). You can also move it while playing. - Klicken Sie hier, wenn Sie Ihren ganzen Song abspielen wollen. Das Abspielen wird am Song-Positions-Marker (grün) gestartet. Sie können diesen auch während des Bewegens verschieben. + Klicken Sie hier, wenn Sie Ihren ganzen Song abspielen wollen. Das Abspielen wird am Song-Positions-Marker (grün) gestartet. Sie können diesen auch während des Abspielens verschieben. Play song (Space) @@ -2664,22 +2394,6 @@ Bitte stellen Sie sicher, dass Sie wenigstens Leserechte auf die Datei besitzen High quality mode High-Quality-Modus - - Insert bar (Shift+Insert) - Spalte einfügen (Umschalt+Einfügen) - - - Remove bar (Shift+Delete) - Spalte löschen (Umschalt+Entfernen) - - - If you click here, a bar will be inserted at the current bar. - Wenn Sie hier klicken, wird eine Spalte an der aktuellen Spalte eingefügt. - - - If you click here, the current bar will be removed. - Wenn Sie hier klicken, wird die aktuelle Spalte gelöscht. - Project saved Projekt gespeichert @@ -2688,10 +2402,6 @@ Bitte stellen Sie sicher, dass Sie wenigstens Leserechte auf die Datei besitzen The project %1 is now saved. Das Projekt %1 ist nun gespeichert. - - The project %1 could not be saved! - Das Projekt %1 konnte nicht gespeichert werden! - Could not write file %1. You probably are not permitted to write to this file. Please make sure you have write-access to the file and try again. @@ -2718,10 +2428,6 @@ Bitte stellen Sie sicher, dass Sie Schreibrechte auf diese Datei besitzen und ve Master pitch Master-Tonhöhe - - The project %1 is not saved! - Das Projekt %1 ist nicht gespeichert! - The project %1 was not saved! Das Projekt %1 wurde nicht gespeichert! @@ -2947,10 +2653,6 @@ Bitte stellen Sie sicher, dass Sie Schreibrechte auf diese Datei und das Verzeic trackOperationsWidget - - Press <Ctrl> while clicking on move-grip to begin a new drag'n'drop-action - Drücken Sie <Strg> während des Klicks auf den Verschiebe-Griff, um eine neue Drag'n'Drop-Aktion zu beginnen - Clone this track Diese Spur klonen @@ -2959,10 +2661,6 @@ Bitte stellen Sie sicher, dass Sie Schreibrechte auf diese Datei und das Verzeic Remove this track Diese Spur entfernen - - Operations for this track - Aktionen für diese Spur - With this switch you can either mute this track or mute all other tracks. By clicking left, this track is muted. This is useful, if you only want to listen to the other tracks without changing this track and loosing information. @@ -2986,39 +2684,6 @@ Klick rechts = alle anderen Spuren stummschalten (Solo) Aktionen für dise Spur - - trackWidget - - Clone this track - Diese Spur klonen - - - Move this track up - Diese Spur nach oben verschieben - - - Move this track down - Diese Spur nach unten verschieben - - - With this switch you can either mute this track or mute all other tracks. -By clicking left, this track is muted. This is useful, if you only want to listen to the other tracks without changing this track and loosing information. -When you click right on this switch, all other tracks will be muted. This is useful, if you only want to listen to this track. - Mit diesem Schalter können SIe entweder diese Spur stummschalten oder alle andern Spuren stummschalten. -Wenn Sie links klicken, wird diese Spur stummgeschaltet. Das ist nützlich, wenn Sie nur die anderen Spuren hören wollen, ohne diese Spur zu ändern und Informationen zu verlieren. -Wenn Sie rechts klicken, werden alle anderen Spuren stumm geschaltet. Das ist nützlich, wenn Sie nur diese Spur hören wollen. - - - left click = mute this track -right click = mute all other tracks (solo) - Klick links = diese Spur stummschalten -Klick rechts = alle anderen Spuren stummschalten (Solo) - - - Remove this track - Diese Spur entfernen - - tripleOscillator diff --git a/data/locale/ru.ts b/data/locale/ru.ts index 82cd71a2cc..b60bb3aaf1 100755 --- a/data/locale/ru.ts +++ b/data/locale/ru.ts @@ -44,19 +44,6 @@ If you're interested in translating LMMS in another language or want to imp LMMS - A powerful synthesizer-studio -Copyright (c) 2004-2005 LMMS-Developers - -http://lmms.sourceforge.net - LMMS - программа-синтезатор для компьютера - -Права на программу LMMS (c) 2004-2005 принадлежат её разработчикам - -Наша страница в интернете: -http://lmms.sourceforge.net - - - LMMS - A powerful synthesizer-studio - Copyright (c) 2004-2006 LMMS-Developers http://lmms.sourceforge.net @@ -338,10 +325,6 @@ http://lmms.sourceforge.net m-Maj13 - - Chords - Аккорды - Chord range: Диапазон аккорда: @@ -354,14 +337,6 @@ http://lmms.sourceforge.net Use this knob for setting the chord range in octaves. The selected chord will be played within specified amount of octaves. Этот регулятор изменяет частотный диапазон акорда: аккорд будет содержать указанное число октав. - - Range - Диапазон - - - Arpeggio - Арпеджио - An arpeggio is a type of playing (especially plucked) instruments, which makes the music much livelier. The strings of such instruments (e.g. harps) are plucked like chords, the only difference is, that this is done in a sequential order, so the notes are not played at the same time. Typical arpeggios are major or minor triads. But there're a lot of other possible chords, you can select. Из БСЭ: АРПЕДЖИО, правильнее арпеджо (итал. arpeggio, от arpeggiare - играть на арфе), исполнение звуков аккорда вразбивку, б. ч. начиная с нижнего тона. А. применяют при игре на арфе, а также на фортепиано и др. муз. инструментах. @@ -400,22 +375,10 @@ http://lmms.sourceforge.net Use this knob for setting the arpeggio gate. The arpeggio gate specifies the percent of a whole arpeggio-tone that should be played. With this you can make cool staccato-arpeggios. Регулировка заполнения для арпеджио. Коэффициент заполнения показывает, какая часть каждого тона будет проиграна. Простой способ создавать стаккато-орпеджио. - - Time - Период - - - Gate - Заполнение - Direction: Направление: - - arpeggio direction = none = no arpeggio - Отключить арпеджио - arpeggio direction = up Поднимать частоту @@ -552,14 +515,6 @@ http://lmms.sourceforge.net GATE ЗАПОЛНЕНИЕ - - DIRECTION: - НАПРАВЛЕНИЕ: - - - SORT-MODE - СОРТИРОВАТЬ - Mode: Режим: @@ -693,10 +648,6 @@ http://lmms.sourceforge.net Click here, if you want to stop playing of current beat/bassline. Нажмите чтобы остановить воспроизведение. - - Beat+Bassline Editor - Редактор ритма/басов - Beat+Baseline Editor Редактор ритма/лейтмотива @@ -716,10 +667,6 @@ http://lmms.sourceforge.net Change color Изменить цвет - - Open in Beat+Bassline-Editor - Открыть в редакторе ритма/басов - Open in Beat+Baseline-Editor Открыть в редакторе ритма/лейтмотива @@ -727,10 +674,6 @@ http://lmms.sourceforge.net bbTrack - - Beat/Bassline %1 - Ритм/басы %1 - Beat/Baseline %1 Лейтмотив %1 @@ -779,33 +722,6 @@ http://lmms.sourceforge.net Здесь вы можете рисовать собственный сигнал - - browser - - Files - Файлы - - - Browser - Просмотрщик - - - Reload (F5) - Обновить (F5) - - - Send to active channel - В активный канал - - - Open in new channel/B+B Editor - В новый канал и открыть в редакторе ритма/басов - - - Open in new channel/Song-Editor - В новый канал и открыть в редакторе - - channelTrack @@ -899,25 +815,6 @@ http://lmms.sourceforge.net Setup LMMS Настройка LMMS - - LMMS needs to be setup in order to run properly. This wizard will help you to setup your personal LMMS-installation. -If you're unsure what to do at a step, just click on 'Next'. LMMS will automatically select the best options for you. - -Now click on 'Next' to get to the next page. - Перед началом работы нужно настроить LMMS. Этот мастер поможет вам создать собственные настройки. -Если вы не знаете точно, что следует делать, просто нажимайте "Дальше". Как правило, настройки по умолчанию являются лучшим выбором. - -А теперь - самое время нажать "Дальше". - - - When working with LMMS there needs to be a working-directory. -This directory is used for storing your projects, presets, samples etc. - -Please select a directory: - При работе с LMMS вам потребуется рабочий каталог, где вы сможете хранить проекты, настройки, образцы звуков и т. д. - -Выберите каталог: - For using the ready presets and samples of LMMS and enjoying the demo-songs the according files have to be copied or linked into your LMMS-working-directory. When copying files, you can modify them, but they need additional space in your working-directory. If you link files, you cannot modify them, but they need no extra space. So it's recommended to copy presets and demo-projects and link samples, which are bigger in size. @@ -958,10 +855,6 @@ When copying files, you can modify them, but they need additional space in your Copy or link files Копировать файлы или создавать ссылки - - Choose LMMS-working-directory - Выбор рабочего каталога LMMS - Directory not existing Каталог не существует @@ -980,18 +873,10 @@ The setup-wizard will be shown for reconfiguring LMMS. The directory you specified does not exist. Create it? Указанный каталог не существует. Создать его? - - Cancel - Отменить - < &Back < &Назад - - Next > - Дальше > - &Finish &Завершить @@ -1221,38 +1106,10 @@ LMMS-working-directory. Run the setup-wizard now? control envelope-amount by this LFO Разрешить этому LFO задавать глубину модуляции обложки - - DELAY - DELAY - - - ATTACK - ATTACK - HOLD HOLD - - DECAY - DECAY - - - SUSTAIN - SUSTAIN - - - RELEASE - RELEASE - - - AMOUNT - AMOUNT - - - SPEED - SPEED - DEL ЗДРЖ @@ -1308,14 +1165,6 @@ LMMS-working-directory. Run the setup-wizard now? envelopeTabWidget - - Cut - Срез - - - Filter - Фильтр - LowPass ФНЧ @@ -1479,10 +1328,6 @@ Make sure, you have write access to the selected file/device! Browser Просмотрщик - - Files - Файлы - Reload (F5) Обновить (F5) @@ -1542,239 +1387,6 @@ Make sure, you have write access to the selected file/device! Подождите пожалуйста, образец загружается для прослушивания... - - lmmsMainWin - - Windows - Окна - - - Setting up main-window and workspace... - Создаю рабочее пространство... - - - Creating new song... - Создаю композицию... - - - Creating GUI... - Создаю GUI... - - - Show/Hide EffectBoard - Показать/скрыть панель эффектов - - - &New - &Новый - - - &Open... - &Открыть... - - - &Save - &Сохранить - - - Save &As... - Сохранить &как... - - - E&xport - &Экспорт - - - &Quit - &Выйти - - - Help - Справка - - - About - О программе - - - &Help - &О программе - - - Show/Hide Piano-Roll - Показать/скрыть синтезатор - - - What's this? - Что это? - - - Show/Hide Beat+Bassline Editor - Показать/скрыть редактор ритма/басов - - - By pressing this button, you can show or hide the Beat+Bassline Editor. The Beat+Bassline Editor is needed for setting beats, opening, adding and removing channels, cutting, copying and pasting beat- and bassline-patterns and other things like that. - По нажатию этой кнопки запускается редактор ритма/басов. Он необходим для установки ритма, добавления и удаления каналов, вырезания, копирования и вставки шаблонов ритма и басов и т. п. - - - Show/Hide Song-Editor - Показать/скрыть редактор мелодии - - - By pressing this button, you can show or hide the Song-Editor. With the Song-Editor you can edit the song and set when and which track should be played. You can also insert and move samples (e.g. rap-samples) directly in the playlist. - По нажатию этой кнопки запускается редактор мелодии. С его помощью вы можеет редактировать композицию, устанавливать время воспроизведения для всех дорожек. Также вы можете вставлять и передвигать образцы непосредственно в списке воспроизведения. - - - My samples - Мои образцы - - - My presets - Мои предустановки - - - My projects - Мои проекты - - - Loading song... - Загружаю композицию... - - - &Settings - &Настройка - - - Show setup wizard - Запустить мастер настройки - - - MultiMedia Project (*.xml) - Мультимедийный проект (*.xml) - - - Show/Hide Project notes - Показать/скрыть комментарий - - - By pressing this button, you can show or hide the project notes window. In this window you can put down your project notes. - Эта кнопка показывает/прячет окно с заметками. В этом окне вы можете помещать любые комментарии к своей композиции. - - - By pressing this button, you can show or hide the EffectBoard. The EffectBoard is a very powerful tool for managing effects for your song. You can insert effects into different effect-channels. - Эта кнопка показывает/прячет панель эффектов. Эта панель является мощным инструментом управления эффектами, которые Вы можете вставлять в особый канал (канал эффектов). - - - Create new project - Создать новый проект - - - Ctrl+N - Ctrl+N - - - Open existing project - Открыть существующий проект - - - Ctrl+O - Ctrl+O - - - Save current project - Сохранить текущий проект - - - Export current project - Экспортировать проект в звуковой файл - - - By pressing this button, you can show or hide the Piano-Roll. With the help of the Piano-Roll you can edit melody-patterns in an easy way. - По нажатию этой кнопки запускается синтезатор LMMS. С его помощью вы можете легко редактировать шблоны мелодии. - - - &Project - &Проект - - - Open project - Открыть проект - - - Save project - Сохранить проект - - - Song management - Управление композициями - - - Import file - Импорт файла - - - My home - Домашний каталог - - - Root directory - Корневой каталог - - - Show settings dialog - Показать окно настройки - - - Help not available - Справка недоступна - - - Currently there's no help available in LMMS. -Please visit http://lmms.sourceforge.net and click on "Documentation". -There hopefully you'll find the stuff you want to know... - Пока что справка для LMMS не написана. -Зайдите на сайт http://lmms.sourceforge.net и пройдите по ссылке "Documentation". -Надеемся, Вы найдёте там нужные материалы... - - - Show/hide Beat+Bassline Editor - Показать/скрыть редактор ритма/басов - - - Show/hide Piano-Roll - Показать/скрыть синтезатор - - - Show/hide Song-Editor - Показать/скрыть редактор мелодии - - - By pressing this button, you can show or hide the Song-Editor. With the help of the Song-Editor you can edit song-playlist and specify when which track should be played. You can also insert and move samples (e.g. rap-samples) directly into the playlist. - По нажатию этой кнопки запускается редактор мелодии. С его помощью вы можеет редактировать композицию, устанавливать время воспроизведения для всех дорожек. Также вы можете вставлять и передвигать образцы непосредственно в списке воспроизведения. - - - Show/hide EffectBoard - Показать/скрыть панель эффектов - - - Show/hide project notes - Показать/скрыть заметки к проекту - - - MultiMedia Project (*.mmp *.xml) - Мультимедийный проект (*.mmp *.xml) - - - MultiMedia Project (*.mmp);;MultiMedia Project Template (*.mpt) - Мультимедийный проект (*.mmp);;Шаблон мультимедийного проекта (*.mpt) - - - Currently there's no help available in LMMS. -Please visit http://wiki.mindrules.net for documentation on LMMS. - Пока что справка для LMMS не написана. -Вероятно, Вы сможете найти нужные материалы на http://wiki.mindrules.net. - - mainWindow @@ -1825,14 +1437,6 @@ Please visit http://wiki.mindrules.net for documentation on LMMS. Export current project Экспортировать проект в звуковой файл - - Show/hide Beat+Bassline Editor - Показать/скрыть редактор ритма/басов - - - By pressing this button, you can show or hide the Beat+Bassline Editor. The Beat+Bassline Editor is needed for setting beats, opening, adding and removing channels, cutting, copying and pasting beat- and bassline-patterns and other things like that. - По нажатию этой кнопки запускается редактор ритма/басов. Он необходим для установки ритма, добавления и удаления каналов, вырезания, копирования и вставки шаблонов ритма и басов и т. п. - Show/hide Piano-Roll Показать/скрыть синтезатор @@ -1974,20 +1578,6 @@ Please visit http://wiki.mindrules.net for documentation on LMMS. УСТРОЙСТВО - - midiDevice - - DEVICE - УСТРОЙСТВО - - - - midiRawClient - - DEVICE - УСТРОЙСТВО - - midiTabWidget @@ -1998,18 +1588,6 @@ Please visit http://wiki.mindrules.net for documentation on LMMS. CHANNEL КАНАЛ - - RECEIVE MIDI-EVENTS - ПРИНИМАТЬ СОБЫТИЯ MIDI - - - SEND MIDI-EVENTS - ОТПРАВЛЯТЬ СОБЫТИЯ MIDI - - - SEND RECEIVED MIDI-EVENTS - ОТПРАВЛЯТЬ ПОЛУЧЕНЫЕ СОБЫТИЯ MIDI - MIDI-devices to receive MIDI-events from Устройства MIDI, с которых нужно принимать события @@ -2130,10 +1708,6 @@ Please visit http://wiki.mindrules.net for documentation on LMMS. The pattern currently cannot be freezed because you're in play-mode. Please stop and try again! Шаблон не может быть заморожен, так как он проигрывается в данный момент. Остановите воспроизведение и попробуйте снова! - - double-click to open this pattern in piano-roll - Чтобы открыть шаблон в синтезаторе, дважды щёлкните мышью - Open in piano-roll Открыть в синтезаторе @@ -2146,10 +1720,6 @@ Please visit http://wiki.mindrules.net for documentation on LMMS. Channel muted Канал заглушён - - The channel this pattern belongs to is currently muted, so freezing makes no sense! Do you still want to continue? - Канал, к которому относится этот шаблон, заглушён, так что заморозка не имеет смысла! Тем не менее, заморозить? - 1 step 1 шаг @@ -2190,22 +1760,6 @@ use mouse wheel to set volume of a step pianoRoll - - Click if you want to draw, resize or move single notes (= key 'D') - Инструмент рисования, изменения размера и перемещения одиночных нот (клавиша 'D') - - - Click if you want to erase single notes (= key 'E') - Инструмент стирания одиночных нот (клавиша 'E') - - - Click if you want to select notes (= key 'S') - Инструмент выделения нот (клавиша 'S') - - - Click if you want to move selected notes (= key 'M') - Инструмент перемещения выбранных нот (клавиша 'M') - If you click here, erase-mode will be activated. In this mode you can erase single notes. You can also press 'E' on your keyboard to activate this mode. Эта кнопка включает режим стирания нот по одной. Режим активируется также клавишей 'E'. @@ -2262,14 +1816,6 @@ use mouse wheel to set volume of a step If you click here, draw-mode will be activated. In this mode you can add, resize and move single notes. This is the default-mode which is used most of the time. You can also press 'D' on your keyboard to activate this mode. Эта кнопка включает режим рисования. При этом вы можете добавлять, перемещать и изменять размер одиночных нот. Этот режим используется чаще всего, и он является режимом по умолчанию.. Режим активируется также клавишей 'D'. - - Record notes from MIDI-device to current pattern - Записать ноты с цифрового музыкального инструмента (MIDI) - - - Click here, if you want to record notes from a MIDI-device or the virtual test-piano of the according channel-window to the current pattern. When recording all notes you play will be written to this pattern and you can edit, play etc. them afterwards. - Нажмите эту кнопку, если вы хотите записать ноты с устройства MIDI или виртуального пианино соответствующего канала. Позже вы сможете отредактировать записанный шаблон. - Piano-Roll - no pattern Синтезатор - без шаблона @@ -2348,26 +1894,14 @@ use mouse wheel to set volume of a step Plugin browser Просмотр модулей - - You can drag an instrument-plugin into either the Song-Editor, the Beat+Bassline Editor or just into a channel-window or on the corresponding channel-button. - Вы можете переносить нужные вам инструменты из этой панели в редактор мелодии или в редактор ритма/басов. Отпускайте кнопку мыши прямо в окне, чтобы создать новый канал, или на кнопке нужного канала для замены типа канала на выбранный инструмент. - cheap synthesis of guitar/harp-like sounds Простая эмуляция струнных вроде гитары или арфы - - send all note-events to an external MIDI-device, e.g. a keyboard - Отсылать все ноты на внешний цифровой музыкальный инструмент (MIDI), например, клавиатуру - three powerful oscillators you can modulate in several ways Три генератора, которые Вы можете настраивать по вкусу - - experimental VST-hoster for using VST-plugins within LMMS - Экспериментальная поддержка модулей VST - simple sampler with various settings for using samples (e.g. drums) in a channel Подключение произвольного звукового образца с некоторой возможностью настройки @@ -2521,10 +2055,6 @@ use mouse wheel to set volume of a step sampleBuffer - - All Audio-Files (*.wav *.ogg *.voc *.aif *.aiff *.au *.raw) - Все звуковые файлы (*.wav *.ogg *.voc *.aif *.aiff *.au *.raw) - Wave-Files (*.wav) Файлы Wave (*.wav) @@ -2638,12 +2168,6 @@ use mouse wheel to set volume of a step Please note that most changes won't take effect until you restart LMMS! Учтите, что большинство настроек не вступят в силу до перезапуска программы! - - FRAMES: %1 -LATENCY: %2 ms - ФРАГМЕНТОВ: %1 -ОТКЛИК: %2 мс - Here you can setup the internal buffer-size used by LMMS. Smaller values result in a lower latency but also may cause unusable sound or bad performance, especially on older computers or systems with a non-realtime kernel. Здесь вы можете настроить размер внутреннего звукового буфера LMMS. Меньшие значения дают меньшее время отклика программы, но повышают потребление ресурсов - это особенно заметно на старых машинах и системах, ядро которых не поддерживает приоритета реального времени. Если наблюдается прерывистый звук, попробуйте увеличить размер буфера. @@ -2745,10 +2269,6 @@ Latency: %2 ms Dummy (no MIDI support) - - JACK (Jack Audio Connection Kit) - JACK (Звуковой инстументарий Jack) - SDL (Simple DirectMedia Layer) @@ -2764,30 +2284,10 @@ Latency: %2 ms songEditor - - Play/pause song (Space) - Воспроизведение/пауза (Пробел) - - - Stop playing song (Space) - Остановить воспроизведение (Пробел) - - - Insert bar at current tact (Shift+Insert) - Вставить такт под курсор (Shift+Insert) - - - Remove bar at current tact (Shift+Delete) - Удалить такт из-под курсора (Shift+Delete) - Click here, if you want to stop playing of your song. The song-position-marker will be set to the start of your song. Нажмите сюда, если вы хотите остановить воспроизведение мелодии. Курсор при этом будет установлен на начало композиции. - - The current song was modified since last saving. Do you want to save it now? - Der aktuelle Song wurde seit dem letzten Speichern geändert. Wollen Sie ihn jetzt speichern? - untitled Неназванное @@ -2800,10 +2300,6 @@ Latency: %2 ms Could not open file Не могу открыть файл - - Could not open file %1. You probably have no rights to read this file. Please make sure you have at least read-access to the file and try again. - Не огу открыть файл %1; вероятно, у вас нет прав на его чтение. Пожалуйста, проверьте это. - Error in multimedia-project Ошибка в мультимедийном проекте @@ -2816,11 +2312,6 @@ Latency: %2 ms Could not write file Не могу записать файл - - Could not write file %1. You probably are not permitted to write to this file. Please make sure you have write-access to the file and try again. - Не могу записать файл %1. Вероятно, у вас нет прав на его запись. -Проверьте, обладаете ли вы правами на запись выбранного файла и попробуйте снова. - Song-Editor Редактор мелодии @@ -2829,10 +2320,6 @@ Latency: %2 ms Click here, if you want to play your whole song. Playing will be started at the song-position-marker (green). You can also move it while playing. Нажмите, чтобы прослушать созданную мелодию. Воспроизведение начнётся с позиции курсора (зелёный треугольник); вы можете двигать его во время проигрывания. - - Song control - Управление мелодией - Play song (Space) Начать воспроизведение (Пробел) @@ -2845,46 +2332,14 @@ Latency: %2 ms The tempo of a song is specified in beats per minute (BPM). If you want to change the tempo of your song, change this value. Every tact has four beats, so the tempo in BPM specifies, how many tacts / 4 should be played within a minute (or how many tacts should be played within four minutes). Это значение задаёт темп мелодии в ударах в минуту (англ. аббр. BPM). На каждый такт приходится четыре удара, так что темп в ударах в минуту фактически указывает, сколько четвертей такта проигрывается за минуту (или, что то же, количество тактов, проигрываемых за четыре минуты). - - master output volume - Общая громкость - master pitch Общая высота тона - - Edit - Правка - - - If you click here, a tact will be inserted at the current tact. - Если вы нажмёте эту кнопку, под курсором вставится один такт. - - - If you click here, the tact at the current tact will be removed. - Если вы нажмёте эту кнопку, такт под курсором будет удалён. - - - Insert tact at current tact (Shift+Insert) - Вставить такт в текущей позиции (Shift+Insert) - - - Remove tact at current tact (Shift+Delete) - Удалить такт в текущей позиции (Shift+Delete) - - - semitones - полутон[а,ов] - tempo of song Темп мелодии - - Add channel-track - Добавить канал инструмента - Add beat/bassline Добавить ритм/басы @@ -2893,10 +2348,6 @@ Latency: %2 ms Add sample-track Добавить файл - - %1 saved. - %1 сохранён. - Project NOT saved. Проект НЕ СОХРАНЁН. @@ -2928,14 +2379,6 @@ Please make sure you have at least read-access to the file and try again.Не могу открыть файл %1 для чтения. Вероятно, у вас нет прав на его чтение. Проверьте, обладаете ли вы правами на чтение выбранного файла и попробуйте снова. - - Master output volume: - Выходная громкость: - - - Master output pitch: - Выходная высота тона: - Import file Импорт файла @@ -2953,22 +2396,6 @@ Please make sure you have at least read-access to the file and try again.High quality mode Высокое качество - - Insert bar (Shift+Insert) - Вставить такт (Shift + Insert) - - - Remove bar (Shift+Delete) - Удалить такт (Shift + Delete) - - - If you click here, a bar will be inserted at the current bar. - При нажатии на эту кнопку, в начало композиции вставится один такт. - - - If you click here, the current bar will be removed. - При нажатии на эту кнопку, из начала композиции удалится один такт. - master volume Общая громкость @@ -2997,10 +2424,6 @@ Please make sure you have at least read-access to the file and try again.The project %1 is now saved. Проект %1 сохранён. - - The project %1 could not be saved! - Не смог сохранить проект %1! - Could not write file %1. You probably are not permitted to write to this file. Please make sure you have write-access to the file and try again. @@ -3020,31 +2443,6 @@ Please make sure you have write-access to the file and try again. Правка (выделение/перемещение) - - soundGenerator - - Error while loading plugin - Ошибка загрузки модуля - - - The %1-plugin wasn't found! Using AudioFileProcessor with default settings instead. - - Модуль %1 не найден! Вместо него будет использован AudioFileProcessor с настройками по умолчанию. - - - - Plugin not found - Модуль не найден - - - The %1-plugin wasn't found! - Модуль %1 не найден! - - - Failed loading plugin "%1"! - Ошибка загрузки модуля "%1"! - - surroundArea @@ -3214,10 +2612,6 @@ Please make sure you have write-permission to the file and the directory contain trackContentObject - - Delete - Удалить - Cut Вырезать @@ -3261,10 +2655,6 @@ Please make sure you have write-permission to the file and the directory contain trackOperationsWidget - - Press <Ctrl> while clicking on move-grip to begin a new drag'n'drop-action - Для перетаскивания в другое окно нажмите <Ctrl> при нажатии на эту полоску - Clone this track Копировать дорожку @@ -3273,10 +2663,6 @@ Please make sure you have write-permission to the file and the directory contain Remove this track Удалить дорожку - - Operations for this track - Действия для этой дорожки - With this switch you can either mute this track or mute all other tracks. By clicking left, this track is muted. This is useful, if you only want to listen to the other tracks without changing this track and loosing information. @@ -3300,43 +2686,6 @@ right click = mute all other tracks (solo) Действия для этой дорожки - - trackWidget - - Clone this track - Копировать дорожку - - - Delete this track - Удалить дорожку - - - Move this track up - Сдвинуть дорожку вверх - - - Move this track down - Сдвинуть дорожку вниз - - - With this switch you can either mute this track or mute all other tracks. -By clicking left, this track is muted. This is useful, if you only want to listen to the other tracks without changing this track and loosing information. -When you click right on this switch, all other tracks will be muted. This is useful, if you only want to listen to this track. - Вы можете заглушать эту дорожку или все дорожки кроме этой. -Если вы нажмёте на выключателе левой кнопкой мыши, то дорожка не будет воспроизводиться. Это может пригодиться, если вам нужно прослушать другие дорожки без удаления текущей, т. е. без потери информации. -Правая кнопка мыши, наоборот, оставляет звучать только текущую дорожку. - - - left click = mute this track -right click = mute all other tracks (solo) - Левая кнопка мыши отключает эту дорожку; -Правая отключает все дорожки, кроме этой - - - Remove this track - Удалить дорожку - - tripleOscillator diff --git a/data/samples/beats/909beat01.ogg b/data/samples/beats/909beat01.ogg new file mode 100644 index 0000000000..900b5ed97a Binary files /dev/null and b/data/samples/beats/909beat01.ogg differ diff --git a/data/samples/effects/start02.ogg b/data/samples/effects/start02.ogg new file mode 100644 index 0000000000..986009e5a1 Binary files /dev/null and b/data/samples/effects/start02.ogg differ diff --git a/include/arp_and_chords_tab_widget.h b/include/arp_and_chords_tab_widget.h index 85061978cf..51e3ea5313 100644 --- a/include/arp_and_chords_tab_widget.h +++ b/include/arp_and_chords_tab_widget.h @@ -50,13 +50,12 @@ class QPixmap; +class automatableButtonGroup; class channelTrack; class comboBox; class groupBox; class knob; -class ledCheckBox; class notePlayHandle; -class pixmapButton; class tempoSyncKnob; @@ -98,14 +97,6 @@ public: } - -protected slots: - void arpUpToggled( bool ); - void arpDownToggled( bool ); - void arpUpAndDownToggled( bool ); - void arpRandomToggled( bool ); - - private: enum arpDirections @@ -115,7 +106,7 @@ private: DOWN, UP_AND_DOWN, RANDOM - } m_arpDirection; + } ; enum arpModes { @@ -137,10 +128,7 @@ private: knob * m_arpGateKnob; QLabel * m_arpDirectionLbl; - pixmapButton * m_arpUpBtn; - pixmapButton * m_arpDownBtn; - pixmapButton * m_arpUpAndDownBtn; - pixmapButton * m_arpRandomBtn; + automatableButtonGroup * m_arpDirectionBtnGrp; comboBox * m_arpModeComboBox; diff --git a/include/automatable_button.h b/include/automatable_button.h new file mode 100755 index 0000000000..def1d6d21b --- /dev/null +++ b/include/automatable_button.h @@ -0,0 +1,120 @@ +/* + * automatable_button.h - class automatableButton, the base for all buttons + * + * Copyright (c) 2006 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + + +#ifndef _AUTOMATABLE_BUTTON_H +#define _AUTOMATABLE_BUTTON_H + +#include "qt3support.h" + +#ifdef QT4 + +#include + +#else + +#include + +#endif + + +#include "automatable_object.h" + + +class automatableButtonGroup; + + +class automatableButton : public QWidget, public automatableObject +{ + Q_OBJECT +public: + automatableButton( QWidget * _parent, engine * _engine ); + virtual ~automatableButton(); + + + inline virtual bool isChecked( void ) const + { + return( value() ); + } + + inline void setToggleButton( bool _on ) + { + m_toggleButton = _on; + setStepRecording( m_toggleButton ); + } + + +public slots: + virtual void toggle( void ); + virtual void setChecked( bool _on ); + + +protected: + virtual void mousePressEvent( QMouseEvent * _me ); + virtual void mouseReleaseEvent( QMouseEvent * _me ); + + +private: + automatableButtonGroup * m_group; + bool m_toggleButton; + + + friend class automatableButtonGroup; + + +signals: + void clicked( void ); + void toggled( bool ); + +} ; + + + +class automatableButtonGroup : public QObject, public automatableObject +{ + Q_OBJECT +public: + automatableButtonGroup( QObject * _parent, engine * _engine ); + virtual ~automatableButtonGroup(); + + void addButton( automatableButton * _btn ); + void removeButton( automatableButton * _btn ); + + void activateButton( automatableButton * _btn ); + + virtual void setValue( const int _value ); + + +private: + vlist m_buttons; + + +signals: + void valueChanged( int ); + +} ; + + + +#endif diff --git a/include/automatable_object.h b/include/automatable_object.h index 4f96a9740f..703b1f17f8 100755 --- a/include/automatable_object.h +++ b/include/automatable_object.h @@ -28,14 +28,19 @@ #include +#include "editable_object.h" #include "templates.h" + template -class automatableObject +class automatableObject : public editableObject { public: - automatableObject( const T _val = 0, const T _min = 0, - const T _max = 0, const T _step = 1 ) : + automatableObject( engine * _engine, const T _val = 0, const T _min = 0, + const T _max = 0, + const T _step = defaultRelStep() ) : + editableObject( _engine ), + m_oldValue( _val ), m_value( _val ), m_minValue( _min ), m_maxValue( _max ), @@ -45,6 +50,11 @@ public: virtual ~automatableObject() { + while( m_linkedObjects.empty() == FALSE ) + { + m_linkedObjects.last()->unlinkObject( this ); + m_linkedObjects.erase( m_linkedObjects.end() - 1 ); + } } static inline T minRelStep( void ) @@ -83,31 +93,71 @@ public: return( m_step ); } - - inline virtual void setValue( const T _value ) + inline T fittedValue( T _value ) { - m_value = tLimit( _value, minValue(), maxValue() ); + _value = tLimit( _value, minValue(), maxValue() ); + if( m_step != 0 ) { - m_value = static_cast( floorf( m_value / m_step ) * - m_step ); + _value = static_cast( floorf( _value / step() ) * + step() ); } else { - m_value = m_minValue; + _value = minValue(); } // correct rounding error at the border - if( tAbs( m_value - m_maxValue ) < minEps() * - tAbs( m_step ) ) + if( tAbs( _value - maxValue() ) < minEps() * + tAbs( step() ) ) { - m_value = m_maxValue; + _value = maxValue(); } // correct rounding error if value = 0 - if( tAbs( m_value ) < minEps() * tAbs( m_step ) ) + if( tAbs( _value ) < minEps() * tAbs( step() ) ) { - m_value = 0; + _value = 0; + } + + return( _value ); + } + + inline virtual void setInitValue( const T _value ) + { + const bool sr = isRecordingSteps(); + setStepRecording( FALSE ); + setValue( _value ); + setStepRecording( sr ); + } + + inline virtual void setValue( const T _value ) + { + const T old_val = m_value; + + m_value = fittedValue( _value ); + if( old_val != m_value ) + { + // add changes to history so user can undo it + addStep( editStep( 0, m_value - old_val ) ); + + // notify linked objects + + // doesn't work because of implicit typename T + // for( autoObjVector::iterator it = m_linkedObjects.begin(); + // it != m_linkedObjects.end(); ++it ) + for( csize i = 0; i < m_linkedObjects.size(); ++i ) + { + automatableObject * it = m_linkedObjects[i]; + if( value() != it->value() && + it->fittedValue( value() ) != it->value() ) + { + const bool sr = it->isRecordingSteps(); + it->setStepRecording( isRecordingSteps() ); + it->setValue( value() ); + it->setStepRecording( sr ); + } + } } } @@ -117,7 +167,7 @@ public: } inline virtual void setRange( const T _min, const T _max, - const T _step = 0 ) + const T _step = defaultRelStep() ) { m_minValue = _min; m_maxValue = _max; @@ -127,7 +177,7 @@ public: qSwap( m_minValue, m_maxValue ); } // re-adjust value - setValue( value() ); + automatableObject::setInitValue( value() ); } inline virtual void setStep( const T _step ) @@ -159,6 +209,63 @@ public: m_step = _step; } + inline void linkObject( automatableObject * _object ) + { + if( qFind( m_linkedObjects.begin(), m_linkedObjects.end(), + _object ) == m_linkedObjects.end() ) + { + m_linkedObjects.push_back( _object ); + } + } + + inline void unlinkObject( automatableObject * _object ) + { + m_linkedObjects.erase( qFind( m_linkedObjects.begin(), + m_linkedObjects.end(), + _object ) ); + } + + static inline void linkObjects( automatableObject * _object1, + automatableObject * _object2 ) + { + _object1->linkObject( _object2 ); + _object2->linkObject( _object1 ); + } + + +protected: + virtual void redoStep( const editStep & _edit_step ) + { + const bool sr = isRecordingSteps(); + setStepRecording( FALSE ); +#ifndef QT3 + setValue( value() + _edit_step.data().value() ); +#else + setValue( value() + static_cast( + _edit_step.data().toDouble() ) ); +#endif + setStepRecording( sr ); + } + + virtual void undoStep( const editStep & _edit_step ) + { +#ifndef QT3 + redoStep( editStep( _edit_step.actionID(), + -_edit_step.data().value() ) ); +#else + redoStep( editStep( _edit_step.actionID(), + static_cast( -_edit_step.data().toDouble() ) ) ); +#endif + } + + // most objects will need this temporarily + T m_oldValue; + + inline void addStepFromOldToCurVal( void ) + { + addStep( editStep( 0, value() - m_oldValue ) ); + } + private: T m_value; @@ -166,6 +273,9 @@ private: T m_maxValue; T m_step; + typedef vvector *> autoObjVector; + autoObjVector m_linkedObjects; + } ; diff --git a/include/combobox.h b/include/combobox.h index 2366411dec..b35173db17 100644 --- a/include/combobox.h +++ b/include/combobox.h @@ -46,14 +46,17 @@ #endif +#include "automatable_object.h" + + class QAction; -class comboBox : public QWidget +class comboBox : public QWidget, public automatableObject { Q_OBJECT public: - comboBox( QWidget * _parent ); + comboBox( QWidget * _parent, engine * _engine ); virtual ~comboBox(); void addItem( const QString & _item, const QPixmap & _pixmap = @@ -61,26 +64,19 @@ public: inline void clear( void ) { - m_currentIndex = 0; + setRange( 0, 0 ); m_items.clear(); update(); } int findText( const QString & _txt ) const; - int currentIndex( void ) const - { - return( m_currentIndex ); - } - QString currentText( void ) const { - return( m_items[m_currentIndex].first ); + return( m_items[value()].first ); } - -public slots: - void setCurrentIndex( int _idx ); + void setValue( const int _idx ); protected: @@ -98,7 +94,6 @@ private: typedef QPair item; vvector m_items; - int m_currentIndex; bool m_pressed; @@ -110,7 +105,7 @@ private slots: signals: void activated( const QString & ); - void currentIndexChanged( int ); + void valueChanged( int ); } ; diff --git a/include/engine.h b/include/engine.h index 4d9ed94ff0..6794fe22bd 100644 --- a/include/engine.h +++ b/include/engine.h @@ -26,10 +26,8 @@ #ifndef _ENGINE_H #define _ENGINE_H -#include "qt3support.h" - - class bbEditor; +class editHistory; class mainWindow; class mixer; class pianoRoll; @@ -40,7 +38,7 @@ class songEditor; class engine { public: - engine( const bool _has_gui = TRUE ); + engine( const bool _has_gui = true ); engine( const engine & _engine ); ~engine(); @@ -94,6 +92,11 @@ public: return( m_projectNotes ); } + inline editHistory * getEditHistory( void ) + { + return( m_editHistory ); + } + private: bool m_hasGUI; @@ -104,6 +107,7 @@ private: bbEditor * m_bbEditor; pianoRoll * m_pianoRoll; projectNotes * m_projectNotes; + editHistory * m_editHistory; } ; diff --git a/include/envelope_and_lfo_widget.h b/include/envelope_and_lfo_widget.h index 815e117c52..9a2c284a78 100644 --- a/include/envelope_and_lfo_widget.h +++ b/include/envelope_and_lfo_widget.h @@ -58,6 +58,7 @@ class QPaintEvent; class QPixmap; +class automatableButtonGroup; class envelopeTabWidget; class knob; class ledCheckBox; @@ -119,10 +120,7 @@ protected: protected slots: void updateAfterKnobChange( float ); - void lfoSinWaveCh( bool ); - void lfoTriangleWaveCh( bool ); - void lfoSawWaveCh( bool ); - void lfoSquareWaveCh( bool ); + void lfoWaveCh( int ); void lfoUserWaveCh( bool ); void x100Toggled( bool ); @@ -159,11 +157,8 @@ private: knob * m_lfoAttackKnob; tempoSyncKnob * m_lfoSpeedKnob; knob * m_lfoAmountKnob; - pixmapButton * m_sinLfoBtn; - pixmapButton * m_triangleLfoBtn; - pixmapButton * m_sawLfoBtn; - pixmapButton * m_sqrLfoBtn; - pixmapButton * m_usrLfoBtn; + pixmapButton * m_userLfoBtn; + automatableButtonGroup * m_lfoWaveBtnGrp; ledCheckBox * m_x100Cb; ledCheckBox * m_controlEnvAmountCb; diff --git a/include/group_box.h b/include/group_box.h index af14dcab14..14fb716231 100644 --- a/include/group_box.h +++ b/include/group_box.h @@ -40,23 +40,21 @@ #include "pixmap_button.h" + class QPixmap; -class groupBox : public QWidget +class groupBox : public QWidget, public engineObject { Q_OBJECT public: - groupBox( const QString & _caption, QWidget * _parent ); + groupBox( const QString & _caption, QWidget * _parent, + engine * _engine ); virtual ~groupBox(); bool isActive( void ) const { -#ifdef QT4 return( m_led->isChecked() ); -#else - return( m_led->isOn() ); -#endif } diff --git a/include/import_filter.h b/include/import_filter.h new file mode 100755 index 0000000000..4009ba4be8 --- /dev/null +++ b/include/import_filter.h @@ -0,0 +1,127 @@ +/* + * import_filter.h - declaration of class importFilter, the base-class for all + * file import filters + * + * Copyright (c) 2006 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + + +#ifndef _IMPORT_FILTER_H +#define _IMPORT_FILTER_H + +#ifdef HAVE_CONFIG_H +#include +#endif + + +#include "qt3support.h" + +#ifdef QT4 + +#include + +#else + +#include + +#endif + + +#include "plugin.h" + + +class trackContainer; + + +class importFilter : public plugin +{ +public: + importFilter( const QString & _file_name, + const descriptor * _descriptor, engine * _eng ); + virtual ~importFilter(); + + + // tries to import given file to given track-container by having all + // available import-filters to try to import the file + static void FASTCALL import( const QString & _file_to_import, + trackContainer * _tc ); + + +protected: + virtual bool tryImport( trackContainer * _tc ) = 0; + + const QFile & file( void ) const + { + return( m_file ); + } + + bool openFile( void ); + + inline void closeFile( void ) + { + m_file.close(); + } + + inline int readByte( void ) + { +#ifdef QT4 + char c; + if( m_file.getChar( &c ) ) + { + return( static_cast( c ) ); + } + return( -1 ); +#else + return( m_file.getch() ); +#endif + } + + inline void ungetChar( int _ch ) + { +#ifndef QT3 + m_file.ungetChar( _ch ); +#else + m_file.ungetch( _ch ); +#endif + } + + virtual void FASTCALL saveSettings( QDomDocument &, + QDomElement & ) + { + } + + virtual void FASTCALL loadSettings( const QDomElement & ) + { + } + + virtual QString nodeName( void ) const + { + return( "import_filter" ); + } + + +private: + QFile m_file; + +} ; + + +#endif diff --git a/include/knob.h b/include/knob.h index f1596faff3..837aa72281 100644 --- a/include/knob.h +++ b/include/knob.h @@ -59,8 +59,7 @@ enum knobTypes -class knob : public QWidget, public engineObject, - public automatableObject +class knob : public QWidget, public automatableObject { Q_OBJECT public: @@ -75,10 +74,10 @@ public: void setTotalAngle( float _angle ); - inline void setInitValue( const float _val ) + inline virtual void setInitValue( const float _val ) { m_initValue = _val; - setValue( _val ); + automatableObject::setInitValue( _val ); } virtual void setValue( const float _x ); @@ -86,33 +85,8 @@ public: virtual void setRange( const float _min, const float _max, const float _step = 0.0 ); -/* inline float value( void ) const - { - return( m_value ); - } - - void setStep( float ); - - inline float maxValue( void ) const - { - return( m_maxValue ); - } - inline float minValue( void ) const - { - return( m_minValue ); - }*/ - -/* inline void incPages( int _n_pages ) - { - setNewValue( value() + float( _n_pages ) * m_pageSize, 1 ); - }*/ - - public slots: -/* void setValue( float _val, bool _is_init_value = FALSE ); - void fitValue( float _val ); - void incValue( int _steps );*/ void reset( void ); void copyValue( void ); void pasteValue( void ); @@ -173,6 +147,7 @@ protected: float m_angle; float m_totalAngle; + QPixmap * m_knobPixmap; int m_knobNum; QString m_hintTextBeforeValue; diff --git a/include/lcd_spinbox.h b/include/lcd_spinbox.h index 97ea2c16f5..6b14e9a765 100644 --- a/include/lcd_spinbox.h +++ b/include/lcd_spinbox.h @@ -51,16 +51,12 @@ class lcdSpinBox : public QWidget, public automatableObject { Q_OBJECT public: - lcdSpinBox( int _min, int _max, int _num_digits, QWidget * _parent ); + lcdSpinBox( int _min, int _max, int _num_digits, QWidget * _parent, + engine * _engine ); virtual ~lcdSpinBox(); virtual void setStep( const int _step ); -/* inline int value( void ) const - { - return( m_number->intValue() ); - }*/ - void setLabel( const QString & _txt ); inline void addTextForValue( int _val, const QString & _text ) @@ -84,11 +80,6 @@ protected: private: QMap m_textForValue; -/* int m_value; - int m_minValue; - int m_maxValue; - int m_step;*/ - QLCDNumber * m_number; QLabel * m_label; diff --git a/include/led_checkbox.h b/include/led_checkbox.h index 07d1670b74..cefefac5b7 100644 --- a/include/led_checkbox.h +++ b/include/led_checkbox.h @@ -26,26 +26,13 @@ #ifndef _LED_CHECKBOX_H #define _LED_CHECKBOX_H -#include "qt3support.h" - -#ifdef QT4 - -#include - -#else - -#include - -#endif - - -#include "automatable_object.h" +#include "automatable_button.h" class QPixmap; -class ledCheckBox : public QWidget, public automatableObject +class ledCheckBox : public automatableButton { Q_OBJECT public: @@ -54,30 +41,19 @@ public: YELLOW, GREEN, TOTAL_COLORS } ; - ledCheckBox( const QString & _txt, QWidget * _parent, + ledCheckBox( const QString & _txt, QWidget * _parent, engine * _engine, ledColors _color = YELLOW ); virtual ~ledCheckBox(); - inline bool isChecked( void ) const - { - return( value() ); - } - inline const QString & text( void ) { return( m_text ); } -public slots: - void toggle( void ); - void setChecked( bool _on ); - - protected: virtual void paintEvent( QPaintEvent * _pe ); - virtual void mousePressEvent( QMouseEvent * _me ); private: @@ -85,9 +61,6 @@ private: QPixmap * m_ledOffPixmap; QString m_text; - -signals: - void toggled( bool ); } ; diff --git a/include/main_window.h b/include/main_window.h index 9e4243efb2..98aeff1f6c 100644 --- a/include/main_window.h +++ b/include/main_window.h @@ -52,6 +52,7 @@ #include "engine.h" +class QDomElement; class QGridLayout; class QSplashScreen; @@ -59,7 +60,6 @@ class configManager; class toolButton; - class mainWindow : public QMainWindow, public engineObject { Q_OBJECT @@ -98,6 +98,9 @@ public: static QSplashScreen * s_splashScreen; + static void saveWidgetState( QWidget * _w, QDomElement & _de ); + static void restoreWidgetState( QWidget * _w, const QDomElement & _de ); + public slots: inline void emptySlot( void ) @@ -120,6 +123,9 @@ public slots: void toggleProjectNotesWin( void ); void togglePianoRollWin( void ); + void undo( void ); + void redo( void ); + protected: virtual void closeEvent( QCloseEvent * _ce ); diff --git a/include/piano_roll.h b/include/piano_roll.h index 2c23465faa..ae138d1e89 100644 --- a/include/piano_roll.h +++ b/include/piano_roll.h @@ -46,6 +46,7 @@ #include "types.h" #include "note.h" #include "engine.h" +#include "settings.h" class QPainter; @@ -59,7 +60,7 @@ class timeLine; class toolButton; -class pianoRoll : public QWidget, public engineObject +class pianoRoll : public QWidget, public engineObject, public settings { Q_OBJECT public: @@ -83,6 +84,15 @@ public: int quantization( void ) const; + virtual void FASTCALL saveSettings( QDomDocument & _doc, + QDomElement & _parent ); + virtual void FASTCALL loadSettings( const QDomElement & _this ); + inline virtual QString nodeName( void ) const + { + return( "pianoroll" ); + } + + public slots: virtual void update( void ); diff --git a/include/pixmap_button.h b/include/pixmap_button.h index e1bfc5edc1..8580551d9e 100644 --- a/include/pixmap_button.h +++ b/include/pixmap_button.h @@ -26,48 +26,32 @@ #ifndef _PIXMAP_BUTTON_H #define _PIXMAP_BUTTON_H -#ifdef HAVE_CONFIG_H -#include -#endif - #include "qt3support.h" #ifdef QT4 -#include #include #else -#include #include #endif +#include "automatable_button.h" -class pixmapButton : public QPushButton + +class pixmapButton : public automatableButton { Q_OBJECT public: - pixmapButton( QWidget * _parent ); + pixmapButton( QWidget * _parent, engine * _engine ); virtual ~pixmapButton(); - void FASTCALL setActiveGraphic( const QPixmap & _pm ); - void FASTCALL setInactiveGraphic( const QPixmap & _pm, - bool _update = TRUE ); - void FASTCALL setBgGraphic( const QPixmap & _pm ); -#ifdef QT3 - inline void setChecked( bool _on ) - { - setOn( _on ); - } - - inline bool isChecked( void ) const - { - return( isOn() ); - } -#endif + void setActiveGraphic( const QPixmap & _pm ); + void setInactiveGraphic( const QPixmap & _pm, bool _update = TRUE ); + void setBgGraphic( const QPixmap & _pm ); signals: @@ -82,9 +66,9 @@ protected: private: - QPixmap * m_activePixmap; - QPixmap * m_inactivePixmap; - QPixmap * m_bgPixmap; + QPixmap m_activePixmap; + QPixmap m_inactivePixmap; + QPixmap m_bgPixmap; } ; diff --git a/include/qt3support.h b/include/qt3support.h index 8761b2b62d..5d07011100 100644 --- a/include/qt3support.h +++ b/include/qt3support.h @@ -135,10 +135,6 @@ inline QString baseName( const QString & _file ) #define modifiers state -// QButtonGroup -#define addButton insert - - // QProgressBar #define setTextVisible setPercentageVisible diff --git a/include/timeline.h b/include/timeline.h index 8c42091f25..353ed144fc 100644 --- a/include/timeline.h +++ b/include/timeline.h @@ -47,7 +47,7 @@ class nStateButton; class textFloat; -class timeLine : public QWidget, public engineObject +class timeLine : public QWidget, public engineObject, public settings { Q_OBJECT public: @@ -116,6 +116,15 @@ public: void addToolButtons( QWidget * _tool_bar ); + virtual void FASTCALL saveSettings( QDomDocument & _doc, + QDomElement & _parent ); + virtual void FASTCALL loadSettings( const QDomElement & _this ); + inline virtual QString nodeName( void ) const + { + return( "timeline" ); + } + + public slots: void updatePosition( const midiTime & ); void updatePosition( void ) diff --git a/plugins/Makefile.am b/plugins/Makefile.am index 33e6ecfd2b..38b13efb83 100644 --- a/plugins/Makefile.am +++ b/plugins/Makefile.am @@ -2,5 +2,5 @@ if VST_SUPPORT VESTIGE_SUBDIR=vestige endif -SUBDIRS = audio_file_processor bit_invader organic plucked_string_synth triple_oscillator $(VESTIGE_SUBDIR) +SUBDIRS = audio_file_processor bit_invader midi_import organic plucked_string_synth triple_oscillator $(VESTIGE_SUBDIR) diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 34ef6e7869..593159da04 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -28,7 +28,6 @@ #ifdef QT4 #include -#include #include #include #include @@ -37,7 +36,6 @@ #else #include -#include #include #include #include @@ -104,7 +102,7 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) : } - m_openAudioFileButton = new pixmapButton( this ); + m_openAudioFileButton = new pixmapButton( this, eng() ); m_openAudioFileButton->setCheckable( FALSE ); m_openAudioFileButton->setCursor( QCursor( Qt::PointingHandCursor ) ); m_openAudioFileButton->move( 200, 90 ); @@ -130,7 +128,7 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) : "are not reset, so please don't wonder if your sample " "doesn't sound like the original one..." ) ); - m_reverseButton = new pixmapButton( this ); + m_reverseButton = new pixmapButton( this, eng() ); m_reverseButton->move( 160, 124 ); m_reverseButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "reverse_on" ) ); @@ -149,7 +147,7 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) : "This is useful for cool effects, e.g. a reversed " "crash." ) ); - m_loopButton = new pixmapButton( this ); + m_loopButton = new pixmapButton( this, eng() ); m_loopButton->move( 180, 124 ); m_loopButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "loop_on" ) ); @@ -226,16 +224,12 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) : "AudioFileProcessor returns if a note is longer than " "the sample between start- and end-point." ) ); - m_viewLinesPB = new pixmapButton( this ); + m_viewLinesPB = new pixmapButton( this, eng() ); m_viewLinesPB->move( 154, 158 ); m_viewLinesPB->setBgGraphic( getBackground( m_viewLinesPB ) ); if( m_drawMethod == sampleBuffer::LINE_CONNECT ) { -#ifdef QT4 m_viewLinesPB->setChecked( TRUE ); -#else - m_viewLinesPB->setOn( TRUE ); -#endif } connect( m_viewLinesPB, SIGNAL( toggled( bool ) ), this, SLOT( lineDrawBtnToggled( bool ) ) ); @@ -249,16 +243,12 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) : "sound itself. It just gives you another view to your " "sample." ) ); - m_viewDotsPB = new pixmapButton( this ); + m_viewDotsPB = new pixmapButton( this, eng() ); m_viewDotsPB->move( 204, 158 ); m_viewDotsPB->setBgGraphic( getBackground( m_viewDotsPB ) ); if( m_drawMethod == sampleBuffer::DOTS ) { -#ifdef QT4 m_viewDotsPB->setChecked( TRUE ); -#else - m_viewDotsPB->setOn( TRUE ); -#endif } connect( m_viewDotsPB, SIGNAL( toggled( bool ) ), this, SLOT( dotDrawBtnToggled( bool ) ) ); @@ -271,13 +261,12 @@ audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) : "with dots. This doesn't change the sound itself. " "It just gives you another view to your sample." ) ); - QButtonGroup * view_group = new QButtonGroup( this ); + automatableButtonGroup * view_group = new automatableButtonGroup( this, + eng() ); view_group->addButton( m_viewLinesPB ); view_group->addButton( m_viewDotsPB ); - view_group->setExclusive( TRUE ); -#ifndef QT4 - view_group->hide(); +#ifndef QT4 setBackgroundMode( Qt::NoBackground ); #endif setAcceptDrops( TRUE ); diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index 148d2b0c96..b5645baa76 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -202,13 +202,13 @@ bitInvader::bitInvader( channelTrack * _channel_track ) : this, SLOT ( sampleSizeChanged( float ) ) ); - m_interpolationToggle = new ledCheckBox( "Interpolation", this ); + m_interpolationToggle = new ledCheckBox( "Interpolation", this, eng() ); m_interpolationToggle->move( 55,80 ); connect( m_interpolationToggle, SIGNAL( toggled( bool ) ), this, SLOT ( interpolationToggle( bool ) ) ); - m_normalizeToggle = new ledCheckBox( "Normalize", this ); + m_normalizeToggle = new ledCheckBox( "Normalize", this, eng() ); m_normalizeToggle->move( 55, 100 ); connect( m_normalizeToggle, SIGNAL( toggled( bool ) ), @@ -233,58 +233,57 @@ bitInvader::bitInvader( channelTrack * _channel_track ) : connect( m_graph, SIGNAL ( sampleChanged( void ) ), this, SLOT ( sampleChanged( void ) ) ); - sinWaveBtn = new pixmapButton( this ); + sinWaveBtn = new pixmapButton( this, eng() ); sinWaveBtn->move( 188, 120 ); sinWaveBtn->setActiveGraphic( embed::getIconPixmap( - "sin_wave_inactive" ) ); + "sin_wave_active" ) ); sinWaveBtn->setInactiveGraphic( embed::getIconPixmap( "sin_wave_inactive" ) ); - sinWaveBtn->setChecked( TRUE ); toolTip::add( sinWaveBtn, tr( "Click here if you want a sine-wave for " "current oscillator." ) ); - triangleWaveBtn = new pixmapButton( this ); + triangleWaveBtn = new pixmapButton( this, eng() ); triangleWaveBtn->move( 188, 136 ); triangleWaveBtn->setActiveGraphic( - embed::getIconPixmap( "triangle_wave_inactive" ) ); + embed::getIconPixmap( "triangle_wave_active" ) ); triangleWaveBtn->setInactiveGraphic( embed::getIconPixmap( "triangle_wave_inactive" ) ); toolTip::add( triangleWaveBtn, tr( "Click here if you want a triangle-wave " "for current oscillator." ) ); - sawWaveBtn = new pixmapButton( this ); + sawWaveBtn = new pixmapButton( this, eng() ); sawWaveBtn->move( 188, 152 ); sawWaveBtn->setActiveGraphic( embed::getIconPixmap( - "saw_wave_inactive" ) ); + "saw_wave_active" ) ); sawWaveBtn->setInactiveGraphic( embed::getIconPixmap( "saw_wave_inactive" ) ); toolTip::add( sawWaveBtn, tr( "Click here if you want a saw-wave for " "current oscillator." ) ); - sqrWaveBtn = new pixmapButton( this ); + sqrWaveBtn = new pixmapButton( this, eng() ); sqrWaveBtn->move( 188, 168 ); sqrWaveBtn->setActiveGraphic( embed::getIconPixmap( - "square_wave_inactive" ) ); + "square_wave_active" ) ); sqrWaveBtn->setInactiveGraphic( embed::getIconPixmap( "square_wave_inactive" ) ); toolTip::add( sqrWaveBtn, tr( "Click here if you want a square-wave for " "current oscillator." ) ); - whiteNoiseWaveBtn = new pixmapButton( this ); + whiteNoiseWaveBtn = new pixmapButton( this, eng() ); whiteNoiseWaveBtn->move( 188, 184 ); whiteNoiseWaveBtn->setActiveGraphic( - embed::getIconPixmap( "white_noise_wave_inactive" ) ); + embed::getIconPixmap( "white_noise_wave_active" ) ); whiteNoiseWaveBtn->setInactiveGraphic( embed::getIconPixmap( "white_noise_wave_inactive" ) ); toolTip::add( whiteNoiseWaveBtn, tr( "Click here if you want a white-noise for " "current oscillator." ) ); - usrWaveBtn = new pixmapButton( this ); + usrWaveBtn = new pixmapButton( this, eng() ); usrWaveBtn->move( 188, 200 ); usrWaveBtn->setActiveGraphic( embed::getIconPixmap( "usr_wave_active" ) ); @@ -310,7 +309,7 @@ bitInvader::bitInvader( channelTrack * _channel_track ) : - smoothBtn = new pixmapButton( this ); + smoothBtn = new pixmapButton( this, eng() ); smoothBtn->move( 55, 225 ); smoothBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "smooth" ) ); diff --git a/plugins/midi_import/Makefile.am b/plugins/midi_import/Makefile.am new file mode 100644 index 0000000000..b55bef0f10 --- /dev/null +++ b/plugins/midi_import/Makefile.am @@ -0,0 +1,12 @@ +AUTOMAKE_OPTIONS = foreign 1.4 + + +INCLUDES = -I$(top_srcdir)/include -I. + + +AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS) -DPLUGIN_NAME="midiimport" + + +pkglib_LTLIBRARIES= libmidiimport.la + +libmidiimport_la_SOURCES = midi_import.cpp midi_import.h diff --git a/plugins/midi_import/midi_import.cpp b/plugins/midi_import/midi_import.cpp new file mode 100644 index 0000000000..6fafb48d0c --- /dev/null +++ b/plugins/midi_import/midi_import.cpp @@ -0,0 +1,546 @@ +/* + * midi_import.cpp - support for importing MIDI-files + * + * Copyright (c) 2005 Tobias Doerffel + * This file partly contains code from Fluidsynth, Peter Hanappe + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + + +#include "midi_import.h" +#include "track_container.h" +#include "channel_track.h" +#include "pattern.h" + + +#ifdef QT4 + +#include +#include +#include + +#else + +#include +#include +#include + +#define pos at +#define setValue setProgress + +#endif + +#define makeID(_c0, _c1, _c2, _c3) \ + ( ( _c0 ) | ( ( _c1 ) << 8 ) | ( ( _c2 ) << 16 ) | ( ( _c3 ) << 24 ) ) + + + +extern "C" +{ + +plugin::descriptor midiimport_plugin_descriptor = +{ + STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ), + "MIDI Import", + QT_TRANSLATE_NOOP( "pluginBrowser", + "Filter for importing MIDI-files into LMMS" ), + "Tobias Doerffel ", + 0x0100, + plugin::IMPORT_FILTER, + new QPixmap() +} ; + +} + + +midiImport::midiImport( const QString & _file ) : + importFilter( _file, &midiimport_plugin_descriptor, NULL ) +{ +} + + + + +midiImport::~midiImport() +{ +} + + + + +bool FASTCALL midiImport::tryImport( trackContainer * _tc ) +{ + if( openFile() == FALSE ) + { + return( FALSE ); + } + + switch( readID() ) + { + case makeID( 'M', 'T', 'h', 'd' ): + return( readSMF( _tc ) ); + + case makeID( 'R', 'I', 'F', 'F' ): + return( readRIFF( _tc ) ); + + default: + printf( "midiImport::importToTrackContainer(): not a " + "Standard MIDI file\n" ); + return( FALSE ); + } +} + + + + +bool FASTCALL midiImport::readSMF( trackContainer * _tc ) +{ + // the curren position is immediately after the "MThd" id + int header_len = readInt( 4 ); + if( header_len < 6 ) + { +invalid_format: + printf( "midiImport::readSMF(): invalid file format\n" ); + return( FALSE ); + } + + int type = readInt( 2 ); + if( type != 0 && type != 1 ) + { + printf( "midiImport::readSMF(): type %d format is not " + "supported\n", type ); + return( FALSE ); + } + + int num_tracks = readInt( 2 ); + if( num_tracks < 1 || num_tracks > 1000 ) + { + printf( "midiImport::readSMF(): invalid number of tracks (%d)\n", + num_tracks ); + num_tracks = 0; + return( FALSE ); + } +#ifdef LMMS_DEBUG + printf( "tracks: %d\n", num_tracks ); +#endif + + int time_division = readInt( 2 ); + if( time_division < 0 ) + { + goto invalid_format; + } +#ifdef LMMS_DEBUG + printf( "time-division: %d\n", time_division ); +#endif + m_smpteTiming = !!( time_division & 0x8000 ); + +#ifdef QT4 + QProgressDialog pd( trackContainer::tr( "Importing MIDI-file..." ), + trackContainer::tr( "Cancel" ), 0, num_tracks ); +#else + QProgressDialog pd( trackContainer::tr( "Importing MIDI-file..." ), + trackContainer::tr( "Cancel" ), num_tracks, + 0, 0, TRUE ); +#endif + pd.setWindowTitle( trackContainer::tr( "Please wait..." ) ); + pd.show(); + + // read tracks + for( int i = 0; i < num_tracks; ++i ) + { + pd.setValue( i ); +#ifdef QT4 + qApp->processEvents( QEventLoop::AllEvents, 100 ); +#else + qApp->processEvents( 100 ); +#endif + + if( pd.wasCanceled() ) + { + return( FALSE ); + } + + int len; + + // search for MTrk chunk + while( 1 ) + { + Sint32 id = readID(); + len = readInt( 4 ); + if( file().atEnd() ) + { + printf( "midiImport::readSMF(): unexpected end " + "of file\n" ); + return( FALSE ); + } + if( len < 0 || len >= 0x10000000 ) + { + printf( "midiImport::readSMF(): invalid chunk " + "length %d\n", len ); + return( FALSE ); + } + if( id == makeID( 'M', 'T', 'r', 'k' ) ) + { + break; + } + skip( len ); + } + if( len <= 0 ) + { + continue; + } + + if( !readTrack( file().pos() + len ) ) + { + return( FALSE ); + } + if( i == 0 ) + { + continue; + } + + // now create new channel-track for reading track + channelTrack * ct = dynamic_cast( + track::create( + track::CHANNEL_TRACK, + _tc ) ); +#ifdef LMMS_DEBUG + assert( ct != NULL ); +#endif + // TODO: setup program, channel etc. + ct->loadInstrument( "tripleoscillator" ); + ct->toggledChannelButton( FALSE ); + + // now create pattern to store notes in + pattern * p = dynamic_cast( ct->createTCO( 0 ) ); +#ifdef LMMS_DEBUG + assert( p != NULL ); +#endif + ct->addTCO( p ); + + // init keys + int keys[NOTES_PER_OCTAVE * OCTAVES][2]; + for( int j = 0; j < NOTES_PER_OCTAVE * OCTAVES; ++j ) + { + keys[j][0] = -1; + } + + // now process every event + for( eventVector::const_iterator it = m_events.begin(); + it != m_events.end(); ++it ) + { + const int tick = it->first; + const midiEvent & ev = it->second; + switch( ev.m_type ) + { + case NOTE_ON: + if( ev.key() >= + NOTES_PER_OCTAVE * OCTAVES ) + { + continue; + } + if( ev.velocity() > 0 ) + { + keys[ev.key()][0] = tick; + keys[ev.key()][1] = + ev.velocity(); + break; + } + + case NOTE_OFF: + if( ev.key() < + NOTES_PER_OCTAVE * OCTAVES && + keys[ev.key()][0] >= 0 ) + { + note n( midiTime( ( tick - keys[ev.key()][0] ) / 10 ), + midiTime( keys[ev.key()][0] / 10 ), + (tones)( ev.key() % NOTES_PER_OCTAVE ), + (octaves)( ev.key() / NOTES_PER_OCTAVE ), + keys[ev.key()][1] * 100 / 128 ); + p->addNote( n ); + keys[ev.key()][0] = -1; + } + break; + + default: +/* printf( "Unhandled event: %#x\n", + ev.m_type );*/ + break; + } + } + } + return( TRUE ); +} + + + + +bool FASTCALL midiImport::readRIFF( trackContainer * _tc ) +{ + // skip file length + skip( 4 ); + + // check file type ("RMID" = RIFF MIDI) + if( readID() != makeID( 'R', 'M', 'I', 'D' ) ) + { +invalid_format: + printf( "midiImport::readRIFF(): invalid file format\n" ); + return( FALSE ); + } + // search for "data" chunk + while( 1 ) + { + int id = readID(); + int len = read32LE(); + if( file().atEnd() ) + { +data_not_found: + printf( "midiImport::readRIFF(): data chunk not " + "found\n" ); + return( FALSE ); + } + if( id == makeID( 'd', 'a', 't', 'a' ) ) + { + break; + } + if( len < 0 ) + { + goto data_not_found; + } + skip( ( len + 1 ) & ~1 ); + } + // the "data" chunk must contain data in SMF format + if( readID() != makeID( 'M', 'T', 'h', 'd' ) ) + { + goto invalid_format; + } + return( readSMF( _tc ) ); +} + + + + +bool FASTCALL midiImport::readTrack( int _track_end ) +{ + int tick = 0; + unsigned char last_cmd = 0; +// unsigned char port = 0; + + m_events.clear(); + // the current file position is after the track ID and length + while( (int) file().pos() < _track_end ) + { + unsigned char cmd; + int len; + + int delta_ticks = readVar(); + if( delta_ticks < 0 ) + { + break; + } + tick += delta_ticks; + + int c = readByte(); + if( c < 0 ) + { + break; + } + if( c & 0x80 ) + { + // have command + cmd = c; + if( cmd < 0xf0 ) + { + last_cmd = cmd; + } + } + else + { + // running status + ungetChar( c ); + cmd = last_cmd; + if( !cmd ) + { + error(); + return( FALSE ); + } + } + switch( cmd & 0xF0 ) + { + // channel msg with 2 parameter bytes + case NOTE_OFF: + case NOTE_ON: + case KEY_PRESSURE: + case CONTROL_CHANGE: + case PITCH_BEND: + { + int data1 = readByte() & 0x7F; + int data2 = readByte() & 0x7F; + m_events.push_back( qMakePair( tick, + midiEvent( static_cast( + cmd & 0xF0 ), + cmd & 0x0F, + data1, + data2 ) ) ); + break; + } + // channel msg with 1 parameter byte + case PROGRAM_CHANGE: + case CHANNEL_PRESSURE: + m_events.push_back( qMakePair( tick, + midiEvent( static_cast( + cmd & 0xF0 ), + cmd & 0x0F, + readByte() & 0x7F ) ) ); + break; + + case MIDI_SYSEX: + switch( cmd ) + { + case MIDI_SYSEX: + case MIDI_EOX: + { + len = readVar(); + if( len < 0 ) + { + error(); + return( FALSE ); + } + if( cmd == MIDI_SYSEX ) + { + ++len; + } + char * data = new char[len]; + if( cmd == MIDI_SYSEX ) + { + data[0] = MIDI_SYSEX; + } + for( ; c < len; ++c ) + { + data[c] = readByte(); + } + m_events.push_back( + qMakePair( tick, + midiEvent( MIDI_SYSEX, data, len ) ) ); + break; + } + + case MIDI_META_EVENT: + c = readByte(); + len = readVar(); +/* if( len < 0 ) + { + error(); + return( FALSE ); + }*/ + switch( c ) + { + case 0x21: // port number + if( len < 1 ) + { + error(); + return( FALSE ); + } +/* port = readByte() % + port_count; + skip( len - 1 );*/ + skip( len ); + break; + + case 0x2F: // end of track + //track->end_tick = tick; + skip( _track_end - + file().pos() ); + return( TRUE ); + + case 0x51: // tempo + if( len < 3 ) + { + error(); + return( FALSE ); + } + if( m_smpteTiming ) + { + // SMPTE timing + // doesnt change + skip( len ); + } + else + { +/* event = new_event(track, 0); + event->type = SND_SEQ_EVENT_TEMPO; + event->port = port; + event->tick = tick; + event->data.tempo = read_byte() << 16; + event->data.tempo |= read_byte() << 8; + event->data.tempo |= read_byte(); + skip( len -3 );*/ + skip( len ); + } + break; + + default:// ignore all other + // meta events + skip( len ); + break; + } + break; + + default: // invalid Fx command + error(); + return( FALSE ); + } + break; + + default: // cannot happen + error(); + return( FALSE ); + } + } + error(); + return( FALSE ); +} + + + + +void midiImport::error( void ) +{ + printf( "midiImport::readTrack(): invalid MIDI data (offset %#x)\n", + (unsigned int) file().pos() ); +} + + + +extern "C" +{ + +// neccessary for getting instance out of shared lib +plugin * lmms_plugin_main( void * _data ) +{ + return( new midiImport( static_cast( _data ) ) ); +} + + +} + + +#undef pos +#undef setValue diff --git a/plugins/midi_import/midi_import.h b/plugins/midi_import/midi_import.h new file mode 100755 index 0000000000..ce7cb55fdd --- /dev/null +++ b/plugins/midi_import/midi_import.h @@ -0,0 +1,141 @@ +/* + * midi_import_filter.h - support for importing MIDI-files + * + * Copyright (c) 2005-2006 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + + +#ifndef _MIDI_IMPORT_H +#define _MIDI_IMPORT_H + +#ifdef HAVE_CONFIG_H +#include +#endif + + +#include "qt3support.h" + +#ifdef QT4 + +#include +#include +#include + +#else + +#include +#include +#include + +#endif + + +#include "midi.h" +#include "import_filter.h" + + +class midiImport : public importFilter +{ +public: + midiImport( const QString & _file ); + virtual ~midiImport(); + + +private: + virtual bool tryImport( trackContainer * _tc ); + + bool FASTCALL readSMF( trackContainer * _tc ); + bool FASTCALL readRIFF( trackContainer * _tc ); + bool FASTCALL readTrack( int _track_end ); + + void error( void ); + + + inline int readInt( int _bytes ) + { + int c, value = 0; + do + { + c = readByte(); + if( c == -1 ) + { + return( -1 ); + } + value = ( value << 8 ) | c; + } while( --_bytes ); + return( value ); + } + inline Sint32 read32LE( void ) + { + int value = readByte(); + value |= readByte() << 8; + value |= readByte() << 16; + value |= readByte() << 24; + return( value ); + } + inline int readVar( void ) + { + int c = readByte(); + int value = c & 0x7f; + if( c & 0x80 ) + { + c = readByte(); + value = ( value << 7 ) | ( c & 0x7f ); + if( c & 0x80 ) + { + c = readByte(); + value = ( value << 7 ) | ( c & 0x7f ); + if( c & 0x80 ) + { + c = readByte(); + value = ( value << 7 ) | c; + if( c & 0x80 ) + { + return -1; + } + } + } + } + return( !file().atEnd() ? value : -1 ); + } + + inline Sint32 readID( void ) + { + return( read32LE() ); + } + inline void skip( int _bytes ) + { + while( _bytes > 0 ) + { + readByte(); + --_bytes; + } + } + + + typedef vvector > eventVector; + eventVector m_events; + bool m_smpteTiming; + +} ; + + +#endif diff --git a/plugins/triple_oscillator/triple_oscillator.cpp b/plugins/triple_oscillator/triple_oscillator.cpp index 18070183ad..e4e818f313 100644 --- a/plugins/triple_oscillator/triple_oscillator.cpp +++ b/plugins/triple_oscillator/triple_oscillator.cpp @@ -28,13 +28,11 @@ #ifdef QT4 #include -#include #include #include #else -#include #include #include #include @@ -50,11 +48,13 @@ #include "channel_track.h" #include "note_play_handle.h" #include "knob.h" -#include "pixmap_button.h" #include "buffer_allocator.h" #include "debug.h" #include "tooltip.h" #include "sample_buffer.h" +#include "automatable_button.h" +#include "pixmap_button.h" + #undef SINGLE_SOURCE_COMPILE #include "embed.cpp" @@ -98,165 +98,116 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) : setErasePixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) ); #endif - m_fm1OscBtn = new pixmapButton( this ); - m_fm1OscBtn->move( 80, 50 ); - m_fm1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( + pixmapButton * fm_osc1_btn = new pixmapButton( this, eng() ); + fm_osc1_btn->move( 80, 50 ); + fm_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_active" ) ); - m_fm1OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( + fm_osc1_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_inactive" ) ); - m_fm1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ). + fm_osc1_btn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ). createHeuristicMask() ) ); - connect( m_fm1OscBtn, SIGNAL( toggled( bool ) ), this, - SLOT( fm1BtnToggled( bool ) ) ); - toolTip::add( m_fm1OscBtn, tr( "use frequency modulation for " + toolTip::add( fm_osc1_btn, tr( "use frequency modulation for " "modulating oscillator 2 with " "oscillator 1" ) ); - m_am1OscBtn = new pixmapButton( this ); - m_am1OscBtn->move( 120, 50 ); - m_am1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( + pixmapButton * am_osc1_btn = new pixmapButton( this, eng() ); + am_osc1_btn->move( 120, 50 ); + am_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "am_active" ) ); - m_am1OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( + am_osc1_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "am_inactive" ) ); - m_am1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ). + am_osc1_btn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ). createHeuristicMask() ) ); - connect( m_am1OscBtn, SIGNAL( toggled( bool ) ), this, - SLOT( am1BtnToggled( bool ) ) ); - toolTip::add( m_am1OscBtn, tr( "use amplitude modulation for " + toolTip::add( am_osc1_btn, tr( "use amplitude modulation for " "modulating oscillator 2 with " "oscillator 1" ) ); - m_mix1OscBtn = new pixmapButton( this ); - m_mix1OscBtn->move( 160, 50 ); - m_mix1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( + pixmapButton * mix_osc1_btn = new pixmapButton( this, eng() ); + mix_osc1_btn->move( 160, 50 ); + mix_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_active" ) ); - m_mix1OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( + mix_osc1_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_inactive" ) ); - m_mix1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( + mix_osc1_btn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).createHeuristicMask() ) ); - connect( m_mix1OscBtn, SIGNAL( toggled( bool ) ), this, - SLOT( mix1BtnToggled( bool ) ) ); - toolTip::add( m_mix1OscBtn, tr( "mix output of oscillator 1 & 2" ) ); + toolTip::add( mix_osc1_btn, tr( "mix output of oscillator 1 & 2" ) ); - m_sync1OscBtn = new pixmapButton( this ); - m_sync1OscBtn->move( 200, 50 ); - m_sync1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( + pixmapButton * sync_osc1_btn = new pixmapButton( this, eng() ); + sync_osc1_btn->move( 200, 50 ); + sync_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "sync_active" ) ); - m_sync1OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( + sync_osc1_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "sync_inactive" ) ); - m_sync1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( + sync_osc1_btn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).createHeuristicMask() ) ); - connect( m_sync1OscBtn, SIGNAL( toggled( bool ) ), this, SLOT( - sync1BtnToggled( bool ) ) ); - toolTip::add( m_sync1OscBtn, tr( "synchronize oscillator 1 with " + toolTip::add( sync_osc1_btn, tr( "synchronize oscillator 1 with " "oscillator 2" ) ); - if( m_modulationAlgo1 == oscillator::FREQ_MODULATION ) - { - m_fm1OscBtn->setChecked( TRUE ); - } - else if( m_modulationAlgo1 == oscillator::AMP_MODULATION ) - { - m_am1OscBtn->setChecked( TRUE ); - } - else if( m_modulationAlgo1 == oscillator::MIX ) - { - m_mix1OscBtn->setChecked( TRUE ); - } - else if( m_modulationAlgo1 == oscillator::SYNC ) - { - m_sync1OscBtn->setChecked( TRUE ); - } + m_mod1BtnGrp = new automatableButtonGroup( this, eng() ); + m_mod1BtnGrp->addButton( fm_osc1_btn ); + m_mod1BtnGrp->addButton( am_osc1_btn ); + m_mod1BtnGrp->addButton( mix_osc1_btn ); + m_mod1BtnGrp->addButton( sync_osc1_btn ); + m_mod1BtnGrp->setInitValue( m_modulationAlgo1 ); - QButtonGroup * modulation_algo_group1 = new QButtonGroup( this ); - modulation_algo_group1->addButton( m_fm1OscBtn ); - modulation_algo_group1->addButton( m_am1OscBtn ); - modulation_algo_group1->addButton( m_mix1OscBtn ); - modulation_algo_group1->addButton( m_sync1OscBtn ); - modulation_algo_group1->setExclusive( TRUE ); -#ifndef QT4 - modulation_algo_group1->hide(); -#endif + connect( m_mod1BtnGrp, SIGNAL( valueChanged( int ) ), + this, SLOT( mod1Ch( int ) ) ); - m_fm2OscBtn = new pixmapButton( this ); - m_fm2OscBtn->move( 80, 70 ); - m_fm2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( + + pixmapButton * fm_osc2_btn = new pixmapButton( this, eng() ); + fm_osc2_btn->move( 80, 70 ); + fm_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_active" ) ); - m_fm2OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( + fm_osc2_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_inactive" ) ); - m_fm2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ). + fm_osc2_btn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ). createHeuristicMask() ) ); - connect( m_fm2OscBtn, SIGNAL( toggled( bool ) ), this, SLOT( - fm2BtnToggled( bool ) ) ); - toolTip::add( m_fm2OscBtn, tr( "use frequency modulation for " + toolTip::add( fm_osc2_btn, tr( "use frequency modulation for " "modulating oscillator 3 with " "oscillator 2" ) ); - m_am2OscBtn = new pixmapButton( this ); - m_am2OscBtn->move( 120, 70 ); - m_am2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( + pixmapButton * am_osc2_btn = new pixmapButton( this, eng() ); + am_osc2_btn->move( 120, 70 ); + am_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "am_active" ) ); - m_am2OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( + am_osc2_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "am_inactive" ) ); - m_am2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ). + am_osc2_btn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ). createHeuristicMask() ) ); - connect( m_am2OscBtn, SIGNAL( toggled( bool ) ), this, - SLOT( am2BtnToggled( bool ) ) ); - toolTip::add( m_am2OscBtn, tr( "use amplitude modulation for " + toolTip::add( am_osc2_btn, tr( "use amplitude modulation for " "modulating oscillator 3 with " "oscillator 2" ) ); - m_mix2OscBtn = new pixmapButton( this ); - m_mix2OscBtn->move( 160, 70 ); - m_mix2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( + pixmapButton * mix_osc2_btn = new pixmapButton( this, eng() ); + mix_osc2_btn->move( 160, 70 ); + mix_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_active" ) ); - m_mix2OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( + mix_osc2_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_inactive" ) ); - m_mix2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( + mix_osc2_btn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).createHeuristicMask() ) ); - connect( m_mix2OscBtn, SIGNAL( toggled( bool ) ), this, - SLOT( mix2BtnToggled( bool ) ) ); - toolTip::add( m_mix2OscBtn, tr("mix output of oscillator 2 & 3" ) ); + toolTip::add( mix_osc2_btn, tr("mix output of oscillator 2 & 3" ) ); - m_sync2OscBtn = new pixmapButton( this ); - m_sync2OscBtn->move( 200, 70 ); - m_sync2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( + pixmapButton * sync_osc2_btn = new pixmapButton( this, eng() ); + sync_osc2_btn->move( 200, 70 ); + sync_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "sync_active" ) ); - m_sync2OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( + sync_osc2_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "sync_inactive" ) ); - m_sync2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( + sync_osc2_btn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).createHeuristicMask() ) ); - connect( m_sync2OscBtn, SIGNAL( toggled( bool ) ), this, - SLOT( sync2BtnToggled( bool ) ) ); - toolTip::add( m_sync2OscBtn, tr( "synchronize oscillator 2 with " + toolTip::add( sync_osc2_btn, tr( "synchronize oscillator 2 with " "oscillator 3" ) ); - if( m_modulationAlgo2 == oscillator::FREQ_MODULATION ) - { - m_fm2OscBtn->setChecked( TRUE ); - } - else if( m_modulationAlgo2 == oscillator::AMP_MODULATION ) - { - m_am2OscBtn->setChecked( TRUE ); - } - else if( m_modulationAlgo2 == oscillator::MIX ) - { - m_mix2OscBtn->setChecked( TRUE ); - } - else if( m_modulationAlgo2 == oscillator::SYNC ) - { - m_sync2OscBtn->setChecked( TRUE ); - } + m_mod2BtnGrp = new automatableButtonGroup( this, eng() ); + m_mod2BtnGrp->addButton( fm_osc2_btn ); + m_mod2BtnGrp->addButton( am_osc2_btn ); + m_mod2BtnGrp->addButton( mix_osc2_btn ); + m_mod2BtnGrp->addButton( sync_osc2_btn ); + m_mod2BtnGrp->setInitValue( m_modulationAlgo2 ); - QButtonGroup * modulation_algo_group2 = new QButtonGroup( this ); - modulation_algo_group2->addButton( m_fm2OscBtn ); - modulation_algo_group2->addButton( m_am2OscBtn ); - modulation_algo_group2->addButton( m_mix2OscBtn ); - modulation_algo_group2->addButton( m_sync2OscBtn ); - modulation_algo_group2->setExclusive( TRUE ); -#ifndef QT4 - modulation_algo_group2->hide(); -#endif + connect( m_mod2BtnGrp, SIGNAL( valueChanged( int ) ), + this, SLOT( mod2Ch( int ) ) ); for( int i = 0; i < NUM_OF_OSCILLATORS; ++i ) @@ -419,78 +370,78 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) : "channel. This is very good for creating wide " "stereo-sounds." ).arg( i+1 ) ); - m_osc[i].sinWaveBtn = new pixmapButton( this ); - m_osc[i].sinWaveBtn->move( 188, 105 + i * 50 ); - m_osc[i].sinWaveBtn->setActiveGraphic( embed::getIconPixmap( + pixmapButton * sin_wave_btn = new pixmapButton( this, eng() ); + sin_wave_btn->move( 188, 105 + i * 50 ); + sin_wave_btn->setActiveGraphic( embed::getIconPixmap( "sin_wave_active" ) ); - m_osc[i].sinWaveBtn->setInactiveGraphic( embed::getIconPixmap( + sin_wave_btn->setInactiveGraphic( embed::getIconPixmap( "sin_wave_inactive" ) ); - m_osc[i].sinWaveBtn->setChecked( TRUE ); - toolTip::add( m_osc[i].sinWaveBtn, + sin_wave_btn->setChecked( TRUE ); + toolTip::add( sin_wave_btn, tr( "Click here if you want a sine-wave for " "current oscillator." ) ); - m_osc[i].triangleWaveBtn = new pixmapButton( this ); - m_osc[i].triangleWaveBtn->move( 203, 105 + i * 50 ); - m_osc[i].triangleWaveBtn->setActiveGraphic( + pixmapButton * triangle_wave_btn = new pixmapButton( this, eng() ); + triangle_wave_btn->move( 203, 105 + i * 50 ); + triangle_wave_btn->setActiveGraphic( embed::getIconPixmap( "triangle_wave_active" ) ); - m_osc[i].triangleWaveBtn->setInactiveGraphic( + triangle_wave_btn->setInactiveGraphic( embed::getIconPixmap( "triangle_wave_inactive" ) ); - toolTip::add( m_osc[i].triangleWaveBtn, + toolTip::add( triangle_wave_btn, tr( "Click here if you want a triangle-wave " "for current oscillator." ) ); - m_osc[i].sawWaveBtn = new pixmapButton( this ); - m_osc[i].sawWaveBtn->move( 218, 105 + i * 50 ); - m_osc[i].sawWaveBtn->setActiveGraphic( embed::getIconPixmap( + pixmapButton * saw_wave_btn = new pixmapButton( this, eng() ); + saw_wave_btn->move( 218, 105 + i * 50 ); + saw_wave_btn->setActiveGraphic( embed::getIconPixmap( "saw_wave_active" ) ); - m_osc[i].sawWaveBtn->setInactiveGraphic( embed::getIconPixmap( + saw_wave_btn->setInactiveGraphic( embed::getIconPixmap( "saw_wave_inactive" ) ); - toolTip::add( m_osc[i].sawWaveBtn, + toolTip::add( saw_wave_btn, tr( "Click here if you want a saw-wave for " "current oscillator." ) ); - m_osc[i].sqrWaveBtn = new pixmapButton( this ); - m_osc[i].sqrWaveBtn->move( 233, 105 + i * 50 ); - m_osc[i].sqrWaveBtn->setActiveGraphic( embed::getIconPixmap( + pixmapButton * sqr_wave_btn = new pixmapButton( this, eng() ); + sqr_wave_btn->move( 233, 105 + i * 50 ); + sqr_wave_btn->setActiveGraphic( embed::getIconPixmap( "square_wave_active" ) ); - m_osc[i].sqrWaveBtn->setInactiveGraphic( embed::getIconPixmap( + sqr_wave_btn->setInactiveGraphic( embed::getIconPixmap( "square_wave_inactive" ) ); - toolTip::add( m_osc[i].sqrWaveBtn, + toolTip::add( sqr_wave_btn, tr( "Click here if you want a square-wave for " "current oscillator." ) ); - m_osc[i].moogSawWaveBtn = new pixmapButton( this ); - m_osc[i].moogSawWaveBtn->move( 188, 120+i*50 ); - m_osc[i].moogSawWaveBtn->setActiveGraphic( + pixmapButton * moog_saw_wave_btn = new pixmapButton( this, eng() ); + moog_saw_wave_btn->move( 188, 120+i*50 ); + moog_saw_wave_btn->setActiveGraphic( embed::getIconPixmap( "moog_saw_wave_active" ) ); - m_osc[i].moogSawWaveBtn->setInactiveGraphic( + moog_saw_wave_btn->setInactiveGraphic( embed::getIconPixmap( "moog_saw_wave_inactive" ) ); - toolTip::add( m_osc[i].moogSawWaveBtn, + toolTip::add( moog_saw_wave_btn, tr( "Click here if you want a moog-saw-wave " "for current oscillator." ) ); - m_osc[i].expWaveBtn = new pixmapButton( this ); - m_osc[i].expWaveBtn->move( 203, 120+i*50 ); - m_osc[i].expWaveBtn->setActiveGraphic( embed::getIconPixmap( + pixmapButton * exp_wave_btn = new pixmapButton( this, eng() ); + exp_wave_btn->move( 203, 120+i*50 ); + exp_wave_btn->setActiveGraphic( embed::getIconPixmap( "exp_wave_active" ) ); - m_osc[i].expWaveBtn->setInactiveGraphic( embed::getIconPixmap( + exp_wave_btn->setInactiveGraphic( embed::getIconPixmap( "exp_wave_inactive" ) ); - toolTip::add( m_osc[i].expWaveBtn, + toolTip::add( exp_wave_btn, tr( "Click here if you want an exponential " "wave for current oscillator." ) ); - m_osc[i].whiteNoiseWaveBtn = new pixmapButton( this ); - m_osc[i].whiteNoiseWaveBtn->move( 218, 120+i*50 ); - m_osc[i].whiteNoiseWaveBtn->setActiveGraphic( + pixmapButton * white_noise_btn = new pixmapButton( this, eng() ); + white_noise_btn->move( 218, 120+i*50 ); + white_noise_btn->setActiveGraphic( embed::getIconPixmap( "white_noise_wave_active" ) ); - m_osc[i].whiteNoiseWaveBtn->setInactiveGraphic( + white_noise_btn->setInactiveGraphic( embed::getIconPixmap( "white_noise_wave_inactive" ) ); - toolTip::add( m_osc[i].whiteNoiseWaveBtn, + toolTip::add( white_noise_btn, tr( "Click here if you want a white-noise for " "current oscillator." ) ); - m_osc[i].usrWaveBtn = new pixmapButton( this ); + m_osc[i].usrWaveBtn = new pixmapButton( this, eng() ); m_osc[i].usrWaveBtn->move( 233, 120+i*50 ); m_osc[i].usrWaveBtn->setActiveGraphic( embed::getIconPixmap( "usr_wave_active" ) ); @@ -500,109 +451,42 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) : tr( "Click here if you want a user-defined " "wave-shape for current oscillator." ) ); - QButtonGroup * wave_btn_group = new QButtonGroup( this ); - wave_btn_group->addButton( m_osc[i].sinWaveBtn ); - wave_btn_group->addButton( m_osc[i].triangleWaveBtn ); - wave_btn_group->addButton( m_osc[i].sawWaveBtn ); - wave_btn_group->addButton( m_osc[i].sqrWaveBtn ); - wave_btn_group->addButton( m_osc[i].moogSawWaveBtn ); - wave_btn_group->addButton( m_osc[i].expWaveBtn ); - wave_btn_group->addButton( m_osc[i].whiteNoiseWaveBtn ); - wave_btn_group->addButton( m_osc[i].usrWaveBtn ); - wave_btn_group->setExclusive( TRUE ); -#ifndef QT4 - wave_btn_group->hide(); -#endif + m_osc[i].waveBtnGrp = new automatableButtonGroup( this, eng() ); + m_osc[i].waveBtnGrp->addButton( sin_wave_btn ); + m_osc[i].waveBtnGrp->addButton( triangle_wave_btn ); + m_osc[i].waveBtnGrp->addButton( saw_wave_btn ); + m_osc[i].waveBtnGrp->addButton( sqr_wave_btn ); + m_osc[i].waveBtnGrp->addButton( moog_saw_wave_btn ); + m_osc[i].waveBtnGrp->addButton( exp_wave_btn ); + m_osc[i].waveBtnGrp->addButton( white_noise_btn ); + m_osc[i].waveBtnGrp->addButton( m_osc[i].usrWaveBtn ); if( i == 0 ) - { // Osc 1 - connect( m_osc[i].sinWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc01SinWaveCh( bool ) ) ); - connect( m_osc[i].triangleWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc01TriangleWaveCh( bool ) ) ); - connect( m_osc[i].sawWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc01SawWaveCh( bool ) ) ); - connect( m_osc[i].sqrWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc01SquareWaveCh( bool ) ) ); - connect( m_osc[i].moogSawWaveBtn, - SIGNAL(toggled( bool ) ), this, - SLOT( osc01MoogSawWaveCh( bool ) ) ); - connect( m_osc[i].expWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc01ExpWaveCh( bool ) ) ); - connect( m_osc[i].whiteNoiseWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc01WhiteNoiseCh( bool ) ) ); - connect( m_osc[i].usrWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc01UserDefWaveCh( bool ) ) ); + { + connect( m_osc[i].waveBtnGrp, + SIGNAL( valueChanged( int ) ), + this, SLOT( osc0WaveCh( int ) ) ); connect( m_osc[i].usrWaveBtn, SIGNAL( doubleClicked() ), this, - SLOT( osc01UserDefWaveDblClick() ) ); + SLOT( osc0UserDefWaveDblClick() ) ); } else if( i == 1 ) - { // Osc 2 - connect( m_osc[i].sinWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc02SinWaveCh( bool ) ) ); - connect( m_osc[i].triangleWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc02TriangleWaveCh( bool ) ) ); - connect( m_osc[i].sawWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc02SawWaveCh( bool ) ) ); - connect( m_osc[i].sqrWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc02SquareWaveCh( bool ) ) ); - connect( m_osc[i].moogSawWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc02MoogSawWaveCh( bool ) ) ); - connect( m_osc[i].expWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc02ExpWaveCh( bool ) ) ); - connect( m_osc[i].whiteNoiseWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc02WhiteNoiseCh( bool ) ) ); - connect( m_osc[i].usrWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc02UserDefWaveCh( bool ) ) ); + { + connect( m_osc[i].waveBtnGrp, + SIGNAL( valueChanged( int ) ), + this, SLOT( osc1WaveCh( int ) ) ); connect( m_osc[i].usrWaveBtn, SIGNAL( doubleClicked() ), this, - SLOT( osc02UserDefWaveDblClick() ) ); + SLOT( osc1UserDefWaveDblClick() ) ); } else if( i == 2 ) - { // Osc 3 - connect( m_osc[i].sinWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc03SinWaveCh( bool ) ) ); - connect( m_osc[i].triangleWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc03TriangleWaveCh( bool ) ) ); - connect( m_osc[i].sawWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc03SawWaveCh( bool ) ) ); - connect( m_osc[i].sqrWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc03SquareWaveCh( bool ) ) ); - connect( m_osc[i].moogSawWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc03MoogSawWaveCh( bool ) ) ); - connect( m_osc[i].expWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc03ExpWaveCh( bool ) ) ); - connect( m_osc[i].whiteNoiseWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc03WhiteNoiseCh( bool ) ) ); - connect( m_osc[i].usrWaveBtn, - SIGNAL( toggled( bool ) ), this, - SLOT( osc03UserDefWaveCh( bool ) ) ); + { + connect( m_osc[i].waveBtnGrp, + SIGNAL( valueChanged( int ) ), + this, SLOT( osc2WaveCh( int ) ) ); connect( m_osc[i].usrWaveBtn, SIGNAL( doubleClicked() ), this, - SLOT( osc03UserDefWaveDblClick() ) ); + SLOT( osc2UserDefWaveDblClick() ) ); } } } @@ -664,8 +548,8 @@ void tripleOscillator::loadSettings( const QDomElement & _this ) m_modulationAlgo2 = static_cast( _this.attribute( "modalgo2" ).toInt() ); - getModulationButton( m_modulationAlgo1, 1 )->setChecked( TRUE ); - getModulationButton( m_modulationAlgo2, 2 )->setChecked( TRUE ); + m_mod1BtnGrp->setInitValue( m_modulationAlgo1 ); + m_mod2BtnGrp->setInitValue( m_modulationAlgo2 ); for( int i = 0; i < NUM_OF_OSCILLATORS; ++i ) { @@ -686,36 +570,8 @@ void tripleOscillator::loadSettings( const QDomElement & _this ) "stphdetun" + is ).toFloat() ); m_osc[i].m_sampleBuffer->setAudioFile( _this.attribute( "userwavefile" + is ) ); - switch( _this.attribute( "wavetype" + is ).toInt() ) - { - case oscillator::TRIANGLE_WAVE: - m_osc[i].triangleWaveBtn->setChecked( TRUE ); - break; - case oscillator::SAW_WAVE: - m_osc[i].sawWaveBtn->setChecked( TRUE ); - break; - case oscillator::SQUARE_WAVE: - m_osc[i].sqrWaveBtn->setChecked( TRUE ); - break; - case oscillator::MOOG_SAW_WAVE: - m_osc[i].moogSawWaveBtn->setChecked( TRUE ); - break; - case oscillator::EXP_WAVE: - m_osc[i].expWaveBtn->setChecked( TRUE ); - break; - case oscillator::WHITE_NOISE_WAVE: - m_osc[i].whiteNoiseWaveBtn->setChecked( TRUE ); - break; - case oscillator::USER_DEF_WAVE: - toolTip::add( m_osc[i].usrWaveBtn, - m_osc[i].m_sampleBuffer->audioFile() ); - m_osc[i].usrWaveBtn->setChecked( TRUE ); - break; - case oscillator::SIN_WAVE: - default: - m_osc[i].sinWaveBtn->setChecked( TRUE ); - break; - } + m_osc[i].waveBtnGrp->setValue( _this.attribute( "wavetype" + + is ).toInt() ); } } @@ -863,26 +719,85 @@ void tripleOscillator::deleteNotePluginData( notePlayHandle * _n ) -// now follows all the stupid UI-Code... - -void tripleOscillator::setModulationAlgo( - oscillator::modulationAlgos _new_modulation_algo, int _n ) +void tripleOscillator::osc0WaveCh( int _n ) { - if( _n == 1 ) - { - m_modulationAlgo1 = _new_modulation_algo; - } - else - { - m_modulationAlgo2 = _new_modulation_algo; - } - - eng()->getSongEditor()->setModified(); + m_osc[0].waveShape = static_cast( _n ); } +void tripleOscillator::osc1WaveCh( int _n ) +{ + m_osc[1].waveShape = static_cast( _n ); +} + + + + +void tripleOscillator::osc2WaveCh( int _n ) +{ + m_osc[2].waveShape = static_cast( _n ); +} + + + + +void tripleOscillator::mod1Ch( int _n ) +{ + m_modulationAlgo1 = static_cast( _n ); +} + + + + +void tripleOscillator::mod2Ch( int _n ) +{ + m_modulationAlgo2 = static_cast( _n ); +} + + + + +void tripleOscillator::osc0UserDefWaveDblClick( void ) +{ + QString af = m_osc[0].m_sampleBuffer->openAudioFile(); + if( af != "" ) + { + m_osc[0].m_sampleBuffer->setAudioFile( af ); + toolTip::add( m_osc[0].usrWaveBtn, + m_osc[0].m_sampleBuffer->audioFile() ); + } +} + + + +void tripleOscillator::osc1UserDefWaveDblClick( void ) +{ + QString af = m_osc[1].m_sampleBuffer->openAudioFile(); + if( af != "" ) + { + m_osc[1].m_sampleBuffer->setAudioFile( af ); + toolTip::add( m_osc[1].usrWaveBtn, + m_osc[1].m_sampleBuffer->audioFile() ); + } +} + + + +void tripleOscillator::osc2UserDefWaveDblClick( void ) +{ + QString af = m_osc[2].m_sampleBuffer->openAudioFile(); + if( af != "" ) + { + m_osc[2].m_sampleBuffer->setAudioFile( af ); + toolTip::add( m_osc[2].usrWaveBtn, + m_osc[2].m_sampleBuffer->audioFile() ); + } +} + + + oscillator::modulationAlgos tripleOscillator::getModulationAlgo( int _n ) { if( _n == 1 ) @@ -898,337 +813,6 @@ oscillator::modulationAlgos tripleOscillator::getModulationAlgo( int _n ) -void tripleOscillator::doSinWaveBtn( oscillatorData * _osc ) -{ - _osc->waveShape = oscillator::SIN_WAVE; - eng()->getSongEditor()->setModified(); -} - - - - -void tripleOscillator::doTriangleWaveBtn( oscillatorData * _osc ) -{ - _osc->waveShape = oscillator::TRIANGLE_WAVE; - eng()->getSongEditor()->setModified(); -} - - - - -void tripleOscillator::doSawWaveBtn( oscillatorData * _osc ) -{ - _osc->waveShape = oscillator::SAW_WAVE; - eng()->getSongEditor()->setModified(); -} - - - - -void tripleOscillator::doSqrWaveBtn( oscillatorData * _osc ) -{ - _osc->waveShape = oscillator::SQUARE_WAVE; - eng()->getSongEditor()->setModified(); -} - - - - -void tripleOscillator::doMoogSawWaveBtn( oscillatorData * _osc ) -{ - _osc->waveShape = oscillator::MOOG_SAW_WAVE; - eng()->getSongEditor()->setModified(); -} - - - - -void tripleOscillator::doExpWaveBtn( oscillatorData * _osc ) -{ - _osc->waveShape = oscillator::EXP_WAVE; - eng()->getSongEditor()->setModified(); -} - - - - -void tripleOscillator::doWhiteNoiseWaveBtn( oscillatorData * _osc ) -{ - _osc->waveShape = oscillator::WHITE_NOISE_WAVE; - eng()->getSongEditor()->setModified(); -} - - - - -void tripleOscillator::doUsrWaveBtn( oscillatorData * _osc ) -{ - _osc->waveShape = oscillator::USER_DEF_WAVE; - eng()->getSongEditor()->setModified(); -} - - - -// Slots for Osc 1 -void tripleOscillator::osc01SinWaveCh( bool _on ) -{ - if( _on ) doSinWaveBtn( &m_osc[0] ); -} - -void tripleOscillator::osc01TriangleWaveCh( bool _on ) -{ - if( _on ) doTriangleWaveBtn( &m_osc[0] ); -} - -void tripleOscillator::osc01SawWaveCh( bool _on ) -{ - if( _on ) doSawWaveBtn( &m_osc[0] ); -} - -void tripleOscillator::osc01SquareWaveCh( bool _on ) -{ - if( _on ) doSqrWaveBtn( &m_osc[0] ); -} - -void tripleOscillator::osc01MoogSawWaveCh( bool _on ) -{ - if( _on ) doMoogSawWaveBtn( &m_osc[0] ); -} - -void tripleOscillator::osc01ExpWaveCh( bool _on ) -{ - if( _on ) doExpWaveBtn( &m_osc[0] ); -} - -void tripleOscillator::osc01WhiteNoiseCh( bool _on ) -{ - if( _on ) doWhiteNoiseWaveBtn( &m_osc[0] ); -} - -void tripleOscillator::osc01UserDefWaveCh( bool _on ) -{ - if( _on ) doUsrWaveBtn( &m_osc[0] ); -} - -void tripleOscillator::osc01UserDefWaveDblClick( void ) -{ - QString af = m_osc[0].m_sampleBuffer->openAudioFile(); - if( af != "" ) - { - m_osc[0].m_sampleBuffer->setAudioFile( af ); -/*#ifndef QT4 - toolTip::remove( m_osc[0].usrWaveBtn ); -#endif*/ - toolTip::add( m_osc[0].usrWaveBtn, - m_osc[0].m_sampleBuffer->audioFile() ); - } -} - - - -// Slots for Osc 2 -void tripleOscillator::osc02SinWaveCh( bool _on ) -{ - if( _on ) doSinWaveBtn( &m_osc[1] ); -} - -void tripleOscillator::osc02TriangleWaveCh( bool _on ) -{ - if( _on ) doTriangleWaveBtn( &m_osc[1] ); -} - -void tripleOscillator::osc02SawWaveCh( bool _on ) -{ - if( _on ) doSawWaveBtn( &m_osc[1] ); -} - -void tripleOscillator::osc02SquareWaveCh( bool _on ) -{ - if( _on ) doSqrWaveBtn( &m_osc[1] ); -} - -void tripleOscillator::osc02MoogSawWaveCh( bool _on ) -{ - if( _on ) doMoogSawWaveBtn( &m_osc[1] ); -} - -void tripleOscillator::osc02ExpWaveCh( bool _on ) -{ - if( _on ) doExpWaveBtn( &m_osc[1] ); -} - -void tripleOscillator::osc02WhiteNoiseCh( bool _on ) -{ - if( _on ) doWhiteNoiseWaveBtn( &m_osc[1] ); -} - -void tripleOscillator::osc02UserDefWaveCh( bool _on ) -{ - if( _on ) doUsrWaveBtn( &m_osc[1] ); -} - -void tripleOscillator::osc02UserDefWaveDblClick( void ) -{ - QString af = m_osc[1].m_sampleBuffer->openAudioFile(); - if( af != "" ) - { - m_osc[1].m_sampleBuffer->setAudioFile( af ); -/*#ifndef QT4 - toolTip::remove( m_osc[1].usrWaveBtn ); -#endif*/ - toolTip::add( m_osc[1].usrWaveBtn, - m_osc[1].m_sampleBuffer->audioFile() ); - } -} - - -// Slots for Osc 3 -void tripleOscillator::osc03SinWaveCh( bool _on ) -{ - if( _on ) doSinWaveBtn( &m_osc[2] ); -} - -void tripleOscillator::osc03TriangleWaveCh( bool _on ) -{ - if( _on ) doTriangleWaveBtn( &m_osc[2] ); -} - -void tripleOscillator::osc03SawWaveCh( bool _on ) -{ - if( _on ) doSawWaveBtn( &m_osc[2] ); -} - -void tripleOscillator::osc03SquareWaveCh( bool _on ) -{ - if( _on ) doSqrWaveBtn( &m_osc[2] ); -} - -void tripleOscillator::osc03MoogSawWaveCh( bool _on ) -{ - if( _on ) doMoogSawWaveBtn( &m_osc[2] ); -} - -void tripleOscillator::osc03ExpWaveCh( bool _on ) -{ - if( _on ) doExpWaveBtn( &m_osc[2] ); -} - -void tripleOscillator::osc03WhiteNoiseCh( bool _on ) -{ - if( _on ) doWhiteNoiseWaveBtn( &m_osc[2] ); -} - -void tripleOscillator::osc03UserDefWaveCh( bool _on ) -{ - if( _on ) doUsrWaveBtn( &m_osc[2] ); -} - -void tripleOscillator::osc03UserDefWaveDblClick( void ) -{ - QString af = m_osc[2].m_sampleBuffer->openAudioFile(); - if( af != "" ) - { - m_osc[2].m_sampleBuffer->setAudioFile( af ); -/*#ifndef QT4 - toolTip::remove( m_osc[2].usrWaveBtn ); -#endif*/ - toolTip::add( m_osc[2].usrWaveBtn, - m_osc[2].m_sampleBuffer->audioFile() ); - } -} - - - - -void tripleOscillator::fm1BtnToggled( bool _on ) -{ - if( _on ) setModulationAlgo( oscillator::FREQ_MODULATION, 1 ); -} - - - -void tripleOscillator::am1BtnToggled( bool _on ) -{ - if( _on ) setModulationAlgo( oscillator::AMP_MODULATION, 1 ); -} - - - -void tripleOscillator::mix1BtnToggled( bool _on ) -{ - if( _on ) setModulationAlgo( oscillator::MIX, 1 ); -} - - - -void tripleOscillator::sync1BtnToggled( bool _on ) -{ - if( _on ) setModulationAlgo( oscillator::SYNC, 1 ); -} - - - -void tripleOscillator::fm2BtnToggled( bool _on ) -{ - if( _on ) setModulationAlgo( oscillator::FREQ_MODULATION, 2 ); -} - - - -void tripleOscillator::am2BtnToggled( bool _on ) -{ - if( _on ) setModulationAlgo( oscillator::AMP_MODULATION, 2 ); -} - - - -void tripleOscillator::mix2BtnToggled( bool _on ) -{ - if( _on ) setModulationAlgo( oscillator::MIX, 2 ); -} - - - -void tripleOscillator::sync2BtnToggled( bool _on ) -{ - if( _on ) setModulationAlgo( oscillator::SYNC, 2 ); -} - - - - -pixmapButton * tripleOscillator::getModulationButton( - oscillator::modulationAlgos _modulation_algo, int _n ) -{ - if( _n == 1 ) - { - switch( _modulation_algo ) - { - case oscillator::FREQ_MODULATION: return( m_fm1OscBtn ); - case oscillator::AMP_MODULATION: return( m_am1OscBtn ); - case oscillator::MIX: return( m_mix1OscBtn ); - case oscillator::SYNC: return( m_sync1OscBtn ); - } - } - else - { - switch( _modulation_algo ) - { - case oscillator::FREQ_MODULATION: return( m_fm2OscBtn ); - case oscillator::AMP_MODULATION: return( m_am2OscBtn ); - case oscillator::MIX: return( m_mix2OscBtn ); - case oscillator::SYNC: return( m_sync2OscBtn ); - } - } -#ifdef LMMS_DEBUG - // there's something really not ok, if this case occurs, so let's exit - assert( 1 != 1 ); -#endif - return( NULL ); -} - - - extern "C" { diff --git a/plugins/triple_oscillator/triple_oscillator.h b/plugins/triple_oscillator/triple_oscillator.h index 7218c9bc7a..03dfe7bd2e 100644 --- a/plugins/triple_oscillator/triple_oscillator.h +++ b/plugins/triple_oscillator/triple_oscillator.h @@ -31,9 +31,10 @@ #include "oscillator.h" +class automatableButtonGroup; class knob; -class pixmapButton; class notePlayHandle; +class pixmapButton; class sampleBuffer; @@ -44,7 +45,7 @@ class tripleOscillator : public instrument { Q_OBJECT public: - tripleOscillator( channelTrack * _channel ) FASTCALL; + tripleOscillator( channelTrack * _channel ); virtual ~tripleOscillator(); virtual void FASTCALL playNote( notePlayHandle * _n ); @@ -59,49 +60,15 @@ public: protected slots: - // Slots for Osc 1 - void osc01SinWaveCh( bool _on ); - void osc01TriangleWaveCh( bool _on ); - void osc01SawWaveCh( bool _on ); - void osc01SquareWaveCh( bool _on ); - void osc01MoogSawWaveCh( bool _on ); - void osc01ExpWaveCh( bool _on ); - void osc01WhiteNoiseCh( bool _on ); - void osc01UserDefWaveCh( bool _on ); - void osc01UserDefWaveDblClick( void ); + void osc0WaveCh( int _n ); + void osc1WaveCh( int _n ); + void osc2WaveCh( int _n ); + void osc0UserDefWaveDblClick( void ); + void osc1UserDefWaveDblClick( void ); + void osc2UserDefWaveDblClick( void ); - // Slots for Osc 2 - void osc02SinWaveCh( bool _on ); - void osc02TriangleWaveCh( bool _on ); - void osc02SawWaveCh( bool _on ); - void osc02SquareWaveCh( bool _on ); - void osc02MoogSawWaveCh( bool _on ); - void osc02ExpWaveCh( bool _on ); - void osc02WhiteNoiseCh( bool _on ); - void osc02UserDefWaveCh( bool _on ); - void osc02UserDefWaveDblClick( void ); - - // Slots for Osc 3 - void osc03SinWaveCh( bool _on ); - void osc03TriangleWaveCh( bool _on ); - void osc03SawWaveCh( bool _on ); - void osc03SquareWaveCh( bool _on ); - void osc03MoogSawWaveCh( bool _on ); - void osc03ExpWaveCh( bool _on ); - void osc03WhiteNoiseCh( bool _on ); - void osc03UserDefWaveCh( bool _on ); - void osc03UserDefWaveDblClick( void ); - - // modulation-type-button slots - void fm1BtnToggled( bool _on ); - void am1BtnToggled( bool _on ); - void mix1BtnToggled( bool _on ); - void sync1BtnToggled( bool _on ); - - void fm2BtnToggled( bool _on ); - void am2BtnToggled( bool _on ); - void mix2BtnToggled( bool _on ); - void sync2BtnToggled( bool _on ); + void mod1Ch( int _n ); + void mod2Ch( int _n ); private: @@ -117,13 +84,7 @@ private: knob * fineRKnob; knob * phaseOffsetKnob; knob * stereoPhaseDetuningKnob; - pixmapButton * sinWaveBtn; - pixmapButton * triangleWaveBtn; - pixmapButton * sawWaveBtn; - pixmapButton * sqrWaveBtn; - pixmapButton * moogSawWaveBtn; - pixmapButton * expWaveBtn; - pixmapButton * whiteNoiseWaveBtn; + automatableButtonGroup * waveBtnGrp; pixmapButton * usrWaveBtn; sampleBuffer * m_sampleBuffer; } m_osc[NUM_OF_OSCILLATORS]; @@ -135,33 +96,18 @@ private: } ; - void FASTCALL doSinWaveBtn( oscillatorData * _osc ); - void FASTCALL doTriangleWaveBtn( oscillatorData * _osc ); - void FASTCALL doSawWaveBtn( oscillatorData * _osc ); - void FASTCALL doSqrWaveBtn( oscillatorData * _osc ); - void FASTCALL doMoogSawWaveBtn( oscillatorData * _osc ); - void FASTCALL doExpWaveBtn( oscillatorData * _osc ); - void FASTCALL doWhiteNoiseWaveBtn( oscillatorData * _osc ); - void FASTCALL doUsrWaveBtn( oscillatorData * _osc ); - pixmapButton * FASTCALL getModulationButton( - oscillator::modulationAlgos _modulation_algo, int _n ); - void FASTCALL setModulationAlgo( - oscillator::modulationAlgos _new_modulation_algo, int _n ); +/* pixmapButton * FASTCALL getModulationButton( + oscillator::modulationAlgos _modulation_algo, int _n );*/ +/* void FASTCALL setModulationAlgo( + oscillator::modulationAlgos _new_modulation_algo, int _n );*/ oscillator::modulationAlgos FASTCALL getModulationAlgo( int _n ); - - pixmapButton * m_fm1OscBtn; - pixmapButton * m_am1OscBtn; - pixmapButton * m_mix1OscBtn; - pixmapButton * m_sync1OscBtn; - pixmapButton * m_fm2OscBtn; - pixmapButton * m_am2OscBtn; - pixmapButton * m_mix2OscBtn; - pixmapButton * m_sync2OscBtn; - oscillator::modulationAlgos m_modulationAlgo1; oscillator::modulationAlgos m_modulationAlgo2; + automatableButtonGroup * m_mod1BtnGrp; + automatableButtonGroup * m_mod2BtnGrp; + } ; diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index e852f46116..dc068d2102 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -110,7 +110,7 @@ vestigeInstrument::vestigeInstrument( channelTrack * _channel_track ) : connect( eng()->getSongEditor(), SIGNAL( tempoChanged( bpm_t ) ), this, SLOT( changeTempo( bpm_t ) ) ); - m_openPluginButton = new pixmapButton( this ); + m_openPluginButton = new pixmapButton( this, eng() ); m_openPluginButton->setCheckable( FALSE ); m_openPluginButton->setCursor( Qt::PointingHandCursor ); m_openPluginButton->move( 200, 70 ); diff --git a/src/audio/audio_alsa.cpp b/src/audio/audio_alsa.cpp index c1c7ef6ca7..d7f3b2fcd1 100644 --- a/src/audio/audio_alsa.cpp +++ b/src/audio/audio_alsa.cpp @@ -459,7 +459,7 @@ audioALSA::setupWidget::setupWidget( QWidget * _parent ) : dev_lbl->setGeometry( 10, 40, 160, 10 ); m_channels = new lcdSpinBox( DEFAULT_CHANNELS, SURROUND_CHANNELS, 1, - this ); + this, NULL ); m_channels->setStep( 2 ); m_channels->setLabel( tr( "CHANNELS" ) ); m_channels->setValue( configManager::inst()->value( "audioalsa", diff --git a/src/audio/audio_jack.cpp b/src/audio/audio_jack.cpp index 143d874ecd..c97d1d5f8e 100644 --- a/src/audio/audio_jack.cpp +++ b/src/audio/audio_jack.cpp @@ -450,7 +450,7 @@ audioJACK::setupWidget::setupWidget( QWidget * _parent ) : cn_lbl->setGeometry( 10, 40, 160, 10 ); m_channels = new lcdSpinBox( DEFAULT_CHANNELS, SURROUND_CHANNELS, 1, - this ); + this, NULL ); m_channels->setStep( 2 ); m_channels->setLabel( tr( "CHANNELS" ) ); m_channels->setValue( configManager::inst()->value( "audiojack", diff --git a/src/audio/audio_oss.cpp b/src/audio/audio_oss.cpp index 4589f462fd..824fc9c108 100644 --- a/src/audio/audio_oss.cpp +++ b/src/audio/audio_oss.cpp @@ -354,7 +354,7 @@ audioOSS::setupWidget::setupWidget( QWidget * _parent ) : dev_lbl->setGeometry( 10, 40, 160, 10 ); m_channels = new lcdSpinBox( DEFAULT_CHANNELS, SURROUND_CHANNELS, 1, - this ); + this, NULL ); m_channels->setStep( 2 ); m_channels->setLabel( tr( "CHANNELS" ) ); m_channels->setValue( configManager::inst()->value( "audiooss", diff --git a/src/core/arp_and_chords_tab_widget.cpp b/src/core/arp_and_chords_tab_widget.cpp index 5200ae4632..95c7dbcf1f 100644 --- a/src/core/arp_and_chords_tab_widget.cpp +++ b/src/core/arp_and_chords_tab_widget.cpp @@ -31,12 +31,10 @@ #ifdef QT4 #include -#include #include #else -#include #include #include #include @@ -199,15 +197,14 @@ const int ARP_GROUPBOX_HEIGHT = 240 - ARP_GROUPBOX_Y; arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) : QWidget( _channel_track->tabWidgetParent() ), settings(), - engineObject( _channel_track->eng() ), - m_arpDirection( UP ) + engineObject( _channel_track->eng() ) { - m_chordsGroupBox = new groupBox( tr( "CHORDS" ), this ); + m_chordsGroupBox = new groupBox( tr( "CHORDS" ), this, eng() ); m_chordsGroupBox->setGeometry( CHORDS_GROUPBOX_X, CHORDS_GROUPBOX_Y, CHORDS_GROUPBOX_WIDTH, CHORDS_GROUPBOX_HEIGHT ); - m_chordsComboBox = new comboBox( m_chordsGroupBox ); + m_chordsComboBox = new comboBox( m_chordsGroupBox, eng() ); m_chordsComboBox->setFont( pointSize<8>( m_chordsComboBox->font() ) ); m_chordsComboBox->setGeometry( 10, 25, 140, 22 ); @@ -240,7 +237,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) : - m_arpGroupBox = new groupBox( tr( "ARPEGGIO" ), this ); + m_arpGroupBox = new groupBox( tr( "ARPEGGIO" ), this, eng() ); m_arpGroupBox->setGeometry( ARP_GROUPBOX_X, ARP_GROUPBOX_Y, ARP_GROUPBOX_WIDTH, ARP_GROUPBOX_HEIGHT ); @@ -258,7 +255,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) : "not played at the same time. Typical arpeggios are " "major or minor triads. But there're a lot of other " "possible chords, you can select." ) ); - m_arpComboBox = new comboBox( m_arpGroupBox ); + m_arpComboBox = new comboBox( m_arpGroupBox, eng() ); m_arpComboBox->setFont( pointSize<8>( m_arpComboBox->font() ) ); m_arpComboBox->setGeometry( 10, 25, 140, 22 ); @@ -329,72 +326,67 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) : - m_arpUpBtn = new pixmapButton( m_arpGroupBox ); - m_arpUpBtn->move( 10, 74 ); - m_arpUpBtn->setActiveGraphic( embed::getIconPixmap( "arp_up_on" ) ); - m_arpUpBtn->setInactiveGraphic( embed::getIconPixmap( "arp_up_off" ) ); - m_arpUpBtn->setChecked( TRUE ); + pixmapButton * arp_up_btn = new pixmapButton( m_arpGroupBox, eng() ); + arp_up_btn->move( 10, 74 ); + arp_up_btn->setActiveGraphic( embed::getIconPixmap( "arp_up_on" ) ); + arp_up_btn->setInactiveGraphic( embed::getIconPixmap( "arp_up_off" ) ); #ifdef QT3 - m_arpUpBtn->setBackgroundMode( Qt::PaletteBackground ); + arp_up_btn->setBackgroundMode( Qt::PaletteBackground ); #endif - toolTip::add( m_arpUpBtn, tr( "arpeggio direction = up" ) ); - connect( m_arpUpBtn, SIGNAL( toggled( bool ) ), this, - SLOT( arpUpToggled( bool ) ) ); + toolTip::add( arp_up_btn, tr( "arpeggio direction = up" ) ); - m_arpDownBtn = new pixmapButton( m_arpGroupBox ); - m_arpDownBtn->move( 30, 74 ); - m_arpDownBtn->setActiveGraphic( embed::getIconPixmap( "arp_down_on" ) ); - m_arpDownBtn->setInactiveGraphic( embed::getIconPixmap( + + pixmapButton * arp_down_btn = new pixmapButton( m_arpGroupBox, eng() ); + arp_down_btn->move( 30, 74 ); + arp_down_btn->setActiveGraphic( embed::getIconPixmap( "arp_down_on" ) ); + arp_down_btn->setInactiveGraphic( embed::getIconPixmap( "arp_down_off" ) ); #ifdef QT3 - m_arpDownBtn->setBackgroundMode( Qt::PaletteBackground ); + arp_down_btn->setBackgroundMode( Qt::PaletteBackground ); #endif - toolTip::add( m_arpDownBtn, tr( "arpeggio direction = down" ) ); - connect( m_arpDownBtn, SIGNAL( toggled( bool ) ), this, - SLOT( arpDownToggled( bool ) ) ); + toolTip::add( arp_down_btn, tr( "arpeggio direction = down" ) ); - m_arpUpAndDownBtn = new pixmapButton( m_arpGroupBox ); - m_arpUpAndDownBtn->move( 50, 74 ); - m_arpUpAndDownBtn->setActiveGraphic( embed::getIconPixmap( + + pixmapButton * arp_up_and_down_btn = new pixmapButton( m_arpGroupBox, + eng() ); + arp_up_and_down_btn->move( 50, 74 ); + arp_up_and_down_btn->setActiveGraphic( embed::getIconPixmap( "arp_up_and_down_on" ) ); - m_arpUpAndDownBtn->setInactiveGraphic( embed::getIconPixmap( + arp_up_and_down_btn->setInactiveGraphic( embed::getIconPixmap( "arp_up_and_down_off" ) ); #ifdef QT3 - m_arpUpAndDownBtn->setBackgroundMode( Qt::PaletteBackground ); + arp_up_and_down_btn->setBackgroundMode( Qt::PaletteBackground ); #endif - toolTip::add( m_arpUpAndDownBtn, + toolTip::add( arp_up_and_down_btn, tr( "arpeggio direction = up and down" ) ); - connect( m_arpUpAndDownBtn, SIGNAL( toggled( bool ) ), this, - SLOT( arpUpAndDownToggled( bool ) ) ); - m_arpRandomBtn = new pixmapButton( m_arpGroupBox ); - m_arpRandomBtn->move( 70, 74 ); - m_arpRandomBtn->setActiveGraphic( embed::getIconPixmap( + + pixmapButton * arp_random_btn = new pixmapButton( m_arpGroupBox, + eng() ); + arp_random_btn->move( 70, 74 ); + arp_random_btn->setActiveGraphic( embed::getIconPixmap( "arp_random_on" ) ); - m_arpRandomBtn->setInactiveGraphic( embed::getIconPixmap( + arp_random_btn->setInactiveGraphic( embed::getIconPixmap( "arp_random_off" ) ); #ifdef QT3 - m_arpRandomBtn->setBackgroundMode( Qt::PaletteBackground ); + arp_random_btn->setBackgroundMode( Qt::PaletteBackground ); #endif - toolTip::add( m_arpRandomBtn, tr( "arpeggio direction = random" ) ); - connect( m_arpRandomBtn, SIGNAL( toggled( bool ) ), this, - SLOT( arpRandomToggled( bool ) ) ); + toolTip::add( arp_random_btn, tr( "arpeggio direction = random" ) ); + + m_arpDirectionBtnGrp = new automatableButtonGroup( this, eng() ); + m_arpDirectionBtnGrp->addButton( arp_up_btn ); + m_arpDirectionBtnGrp->addButton( arp_down_btn ); + m_arpDirectionBtnGrp->addButton( arp_up_and_down_btn ); + m_arpDirectionBtnGrp->addButton( arp_random_btn ); + + m_arpDirectionBtnGrp->setInitValue( UP - 1 ); - QButtonGroup * m_arpDirections_group = new QButtonGroup( this ); - m_arpDirections_group->addButton( m_arpUpBtn ); - m_arpDirections_group->addButton( m_arpDownBtn ); - m_arpDirections_group->addButton( m_arpUpAndDownBtn ); - m_arpDirections_group->addButton( m_arpRandomBtn ); - m_arpDirections_group->setExclusive( TRUE ); -#ifdef QT3 - m_arpDirections_group->hide(); -#endif QLabel * mode_lbl = new QLabel( tr( "Mode:" ), m_arpGroupBox ); mode_lbl->setGeometry( 10, 104, 64, 10 ); mode_lbl->setFont( pointSize<7>( mode_lbl->font() ) ); - m_arpModeComboBox = new comboBox( m_arpGroupBox ); + m_arpModeComboBox = new comboBox( m_arpGroupBox, eng() ); m_arpModeComboBox->setFont( pointSize<8>( m_arpModeComboBox->font() ) ); m_arpModeComboBox->setGeometry( 10, 118, 128, 22 ); @@ -404,7 +396,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) : embed::getIconPixmap( "arp_sort" ) ); m_arpModeComboBox->addItem( tr( "Sync" ), embed::getIconPixmap( "arp_sync" ) ); - m_arpModeComboBox->setCurrentIndex( 0 ); + //m_arpModeComboBox->setValue( 0 ); } @@ -431,7 +423,7 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) m_chordsGroupBox->isActive() == TRUE ) { // then insert sub-notes for chord - const int selected_chord = m_chordsComboBox->currentIndex(); + const int selected_chord = m_chordsComboBox->value(); for( int octave_cnt = 0; octave_cnt < m_chordRangeKnob->value(); ++octave_cnt ) @@ -480,7 +472,7 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) // now follows code for arpeggio - if( _n->baseNote() == FALSE || m_arpDirection == OFF || + if( _n->baseNote() == FALSE || m_arpDirectionBtnGrp->value() == OFF || !m_arpGroupBox->isActive() || ( _n->released() && _n->releaseFramesDone() >= _n->actualReleaseFramesToDo() ) ) @@ -489,11 +481,11 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) } - const int selected_arp = m_arpComboBox->currentIndex(); + const int selected_arp = m_arpComboBox->value(); constNotePlayHandleVector cnphv = notePlayHandle::nphsOfChannelTrack( _n->getChannelTrack() ); - if( m_arpModeComboBox->currentIndex() != FREE && cnphv.size() == 0 ) + if( m_arpModeComboBox->value() != FREE && cnphv.size() == 0 ) { // maybe we're playing only a preset-preview-note? cnphv = presetPreviewPlayHandle::nphsOfChannelTrack( @@ -519,7 +511,7 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) // used for calculating remaining frames for arp-note, we have to add // arp_frames-1, otherwise the first arp-note will not be setup // correctly... -> arp_frames frames silence at the start of every note! - int cur_frame = ( ( m_arpModeComboBox->currentIndex() != FREE ) ? + int cur_frame = ( ( m_arpModeComboBox->value() != FREE ) ? cnphv.first()->totalFramesPlayed() : _n->totalFramesPlayed() ) + arp_frames - 1; @@ -543,7 +535,7 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) // init with zero int cur_arp_idx = 0; - if( m_arpModeComboBox->currentIndex() == SORT && + if( m_arpModeComboBox->value() == SORT && ( ( cur_frame / arp_frames ) % total_range ) / range != (Uint32) _n->index() ) { @@ -553,17 +545,19 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) continue; } + arpDirections dir = static_cast( + m_arpDirectionBtnGrp->value() + 1 ); // process according to arpeggio-direction... - if( m_arpDirection == UP ) + if( dir == UP ) { cur_arp_idx = ( cur_frame / arp_frames ) % range; } - else if( m_arpDirection == DOWN ) + else if( dir == DOWN ) { cur_arp_idx = range - ( cur_frame / arp_frames ) % range - 1; } - else if( m_arpDirection == UP_AND_DOWN && range > 1 ) + else if( dir == UP_AND_DOWN && range > 1 ) { // imagine, we had to play the arp once up and then // once down -> makes 2 * range possible notes... @@ -579,7 +573,7 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) ( range - 1 ) - 1; } } - else if( m_arpDirection == RANDOM ) + else if( dir == RANDOM ) { // just pick a random chord-index cur_arp_idx = (int)( range * ( (float) rand() / @@ -619,7 +613,7 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) // and is_arp_note=TRUE notePlayHandle * note_play_handle = new notePlayHandle( _n->getChannelTrack(), - ( ( m_arpModeComboBox->currentIndex() != + ( ( m_arpModeComboBox->value() != FREE ) ? cnphv.first()->framesAhead() : _n->framesAhead() ) + @@ -639,7 +633,7 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) // make sure, note is handled as arp-base-note, even if we didn't add a // sub-note so far - if( m_arpModeComboBox->currentIndex() != FREE ) + if( m_arpModeComboBox->value() != FREE ) { _n->setArpNote( TRUE ); } @@ -653,19 +647,19 @@ void arpAndChordsTabWidget::saveSettings( QDomDocument & _doc, { QDomElement act_de = _doc.createElement( nodeName() ); act_de.setAttribute( "chorddisabled", !m_chordsGroupBox->isActive() ); - act_de.setAttribute( "chord", m_chordsComboBox->currentIndex() ); + act_de.setAttribute( "chord", m_chordsComboBox->value() ); act_de.setAttribute( "chordrange", m_chordRangeKnob->value() ); act_de.setAttribute( "arpdisabled", !m_arpGroupBox->isActive() ); - act_de.setAttribute( "arp", m_arpComboBox->currentIndex() ); + act_de.setAttribute( "arp", m_arpComboBox->value() ); act_de.setAttribute( "arprange", m_arpRangeKnob->value() ); act_de.setAttribute( "arptime", m_arpTimeKnob->value() ); act_de.setAttribute( "arpgate", m_arpGateKnob->value() ); - act_de.setAttribute( "arpdir", m_arpDirection ); + act_de.setAttribute( "arpdir", m_arpDirectionBtnGrp->value() ); act_de.setAttribute( "arpsyncmode", ( int ) m_arpTimeKnob->getSyncMode() ); - act_de.setAttribute( "arpmode", m_arpModeComboBox->currentIndex() ); + act_de.setAttribute( "arpmode", m_arpModeComboBox->value() ); _parent.appendChild( act_de ); } @@ -676,91 +670,27 @@ void arpAndChordsTabWidget::loadSettings( const QDomElement & _this ) { m_chordsGroupBox->setState( !_this.attribute ( "chorddisabled" ).toInt() ); - m_chordsComboBox->setCurrentIndex( _this.attribute( "chord" ).toInt() ); + m_chordsComboBox->setValue( _this.attribute( "chord" ).toInt() ); m_chordRangeKnob->setValue( _this.attribute( "chordrange" ).toFloat() ); - m_arpComboBox->setCurrentIndex( _this.attribute( "arp" ).toInt() ); + m_arpComboBox->setValue( _this.attribute( "arp" ).toInt() ); m_arpRangeKnob->setValue( _this.attribute( "arprange" ).toFloat() ); m_arpTimeKnob->setValue( _this.attribute( "arptime" ).toFloat() ); m_arpGateKnob->setValue( _this.attribute( "arpgate" ).toFloat() ); - m_arpDirection = static_cast( + m_arpDirectionBtnGrp->setInitValue( _this.attribute( "arpdir" ).toInt() ); m_arpTimeKnob->setSyncMode( ( tempoSyncKnob::tempoSyncMode ) _this.attribute( "arpsyncmode" ).toInt() ); - m_arpModeComboBox->setCurrentIndex( _this.attribute( "arpmode" - ).toInt() ); + m_arpModeComboBox->setValue( _this.attribute( "arpmode" ).toInt() ); - m_arpGroupBox->setState( m_arpDirection != OFF && + m_arpGroupBox->setState( m_arpDirectionBtnGrp->value() != OFF && !_this.attribute( "arpdisabled" ).toInt() ); - switch( m_arpDirection ) - { - case DOWN: - m_arpDownBtn->setChecked( TRUE ); - break; - case UP_AND_DOWN: - m_arpUpAndDownBtn->setChecked( TRUE ); - break; - case RANDOM: - m_arpRandomBtn->setChecked( TRUE ); - break; - case UP: - default: - m_arpUpBtn->setChecked( TRUE ); - m_arpDirection = UP; - break; - } } -void arpAndChordsTabWidget::arpUpToggled( bool _on ) -{ - if( _on ) - { - m_arpDirection = UP; - } - eng()->getSongEditor()->setModified(); -} - - - - -void arpAndChordsTabWidget::arpDownToggled( bool _on ) -{ - if( _on ) - { - m_arpDirection = DOWN; - } - eng()->getSongEditor()->setModified(); -} - - - - -void arpAndChordsTabWidget::arpUpAndDownToggled( bool _on ) -{ - if( _on ) - { - m_arpDirection = UP_AND_DOWN; - } - eng()->getSongEditor()->setModified(); -} - - - - -void arpAndChordsTabWidget::arpRandomToggled( bool _on ) -{ - if( _on ) - { - m_arpDirection = RANDOM; - } - eng()->getSongEditor()->setModified(); -} - - #include "arp_and_chords_tab_widget.moc" diff --git a/src/core/bb_editor.cpp b/src/core/bb_editor.cpp index b87b70dd53..33b7280bd0 100644 --- a/src/core/bb_editor.cpp +++ b/src/core/bb_editor.cpp @@ -129,9 +129,9 @@ bbEditor::bbEditor( engine * _engine ) : QLabel * l = new QLabel( m_toolBar ); l->setPixmap( embed::getIconPixmap( "drum" ) ); - m_bbComboBox = new comboBox( m_toolBar ); + m_bbComboBox = new comboBox( m_toolBar, eng() ); m_bbComboBox->setFixedSize( 200, 22 ); - connect( m_bbComboBox, SIGNAL( currentIndexChanged( int ) ), + connect( m_bbComboBox, SIGNAL( valueChanged( int ) ), this, SLOT( setCurrentBB( int ) ) ); tb_layout->addSpacing( 5 ); @@ -166,9 +166,9 @@ csize bbEditor::currentBB( void ) const void bbEditor::setCurrentBB( int _bb ) { - if( m_bbComboBox->currentIndex() != _bb ) + if( m_bbComboBox->value() != _bb ) { - m_bbComboBox->setCurrentIndex( _bb ); + m_bbComboBox->setValue( _bb ); } // first make sure, all channels have a TCO at current BB @@ -295,7 +295,7 @@ void bbEditor::updateComboBox( void ) m_bbComboBox->addItem( bbt->trackLabel()->text(), bbt->trackLabel()->pixmap() ); } - m_bbComboBox->setCurrentIndex( currentBB() ); + m_bbComboBox->setValue( currentBB() ); } diff --git a/src/core/config_mgr.cpp b/src/core/config_mgr.cpp index 79a4406845..10427cc2ec 100644 --- a/src/core/config_mgr.cpp +++ b/src/core/config_mgr.cpp @@ -62,6 +62,7 @@ #include #define absolutePath absPath +#define addButton insert #ifndef __USE_XOPEN_EXTENDED #define __USE_XOPEN_EXTENDED @@ -955,6 +956,7 @@ void configManager::processFilesRecursively( const QString & _src_dir, #include "config_mgr.moc" - +#undef absolutePath +#undef addButton #endif diff --git a/src/core/engine.cpp b/src/core/engine.cpp index 4dec3ca9c8..b0fd6155fe 100644 --- a/src/core/engine.cpp +++ b/src/core/engine.cpp @@ -26,6 +26,7 @@ #include "bb_editor.h" +#include "edit_history.h" #include "engine.h" #include "main_window.h" #include "mixer.h" @@ -41,8 +42,10 @@ engine::engine( const bool _has_gui ) : m_mainWindow( NULL ), m_songEditor( NULL ), m_bbEditor( NULL ), - m_pianoRoll( NULL ) + m_pianoRoll( NULL ), + m_editHistory( NULL ) { + m_editHistory = new editHistory( this ); m_mainWindow = new mainWindow( this ); m_mixer = new mixer( this ); m_songEditor = new songEditor( this ); @@ -63,6 +66,7 @@ engine::engine( const bool _has_gui ) : engine::~engine() { m_mixer->stopProcessing(); + delete m_projectNotes; delete m_songEditor; delete m_bbEditor; diff --git a/src/core/envelope_and_lfo_widget.cpp b/src/core/envelope_and_lfo_widget.cpp index 27f0a8a258..34fc7b04a4 100644 --- a/src/core/envelope_and_lfo_widget.cpp +++ b/src/core/envelope_and_lfo_widget.cpp @@ -32,14 +32,12 @@ #include #include -#include #include #include #include #else -#include #include #include #include @@ -353,101 +351,90 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, SLOT( updateAfterKnobChange( float ) ) ); - m_sinLfoBtn = new pixmapButton( this ); - m_sinLfoBtn->move( LFO_SHAPES_X, LFO_SHAPES_Y ); - m_sinLfoBtn->setActiveGraphic( embed::getIconPixmap( + pixmapButton * sin_lfo_btn = new pixmapButton( this, eng() ); + sin_lfo_btn->move( LFO_SHAPES_X, LFO_SHAPES_Y ); + sin_lfo_btn->setActiveGraphic( embed::getIconPixmap( "sin_wave_active" ) ); - m_sinLfoBtn->setInactiveGraphic( embed::getIconPixmap( + sin_lfo_btn->setInactiveGraphic( embed::getIconPixmap( "sin_wave_inactive" ) ); - m_sinLfoBtn->setChecked( TRUE ); #ifdef QT4 - m_sinLfoBtn->setWhatsThis( + sin_lfo_btn->setWhatsThis( #else - QWhatsThis::add( m_sinLfoBtn, + QWhatsThis::add( sin_lfo_btn, #endif tr( "Click here if you want a sine-wave for current " "oscillator." ) ); - m_triangleLfoBtn = new pixmapButton( this ); - m_triangleLfoBtn->move( LFO_SHAPES_X+15, LFO_SHAPES_Y ); - m_triangleLfoBtn->setActiveGraphic( embed::getIconPixmap( + pixmapButton * triangle_lfo_btn = new pixmapButton( this, eng() ); + triangle_lfo_btn->move( LFO_SHAPES_X+15, LFO_SHAPES_Y ); + triangle_lfo_btn->setActiveGraphic( embed::getIconPixmap( "triangle_wave_active" ) ); - m_triangleLfoBtn->setInactiveGraphic( embed::getIconPixmap( + triangle_lfo_btn->setInactiveGraphic( embed::getIconPixmap( "triangle_wave_inactive" ) ); #ifdef QT4 - m_triangleLfoBtn->setWhatsThis( + triangle_lfo_btn->setWhatsThis( #else - QWhatsThis::add( m_triangleLfoBtn, + QWhatsThis::add( triangle_lfo_btn, #endif tr( "Click here if you want a triangle-wave for current " "oscillator." ) ); - m_sawLfoBtn = new pixmapButton( this ); - m_sawLfoBtn->move( LFO_SHAPES_X+30, LFO_SHAPES_Y ); - m_sawLfoBtn->setActiveGraphic( embed::getIconPixmap( + pixmapButton * saw_lfo_btn = new pixmapButton( this, eng() ); + saw_lfo_btn->move( LFO_SHAPES_X+30, LFO_SHAPES_Y ); + saw_lfo_btn->setActiveGraphic( embed::getIconPixmap( "saw_wave_active" ) ); - m_sawLfoBtn->setInactiveGraphic( embed::getIconPixmap( + saw_lfo_btn->setInactiveGraphic( embed::getIconPixmap( "saw_wave_inactive" ) ); #ifdef QT4 - m_sawLfoBtn->setWhatsThis( + saw_lfo_btn->setWhatsThis( #else - QWhatsThis::add( m_sawLfoBtn, + QWhatsThis::add( saw_lfo_btn, #endif tr( "Click here if you want a saw-wave for current " "oscillator." ) ); - m_sqrLfoBtn = new pixmapButton( this ); - m_sqrLfoBtn->move( LFO_SHAPES_X+45, LFO_SHAPES_Y ); - m_sqrLfoBtn->setActiveGraphic( embed::getIconPixmap( + pixmapButton * sqr_lfo_btn = new pixmapButton( this, eng() ); + sqr_lfo_btn->move( LFO_SHAPES_X+45, LFO_SHAPES_Y ); + sqr_lfo_btn->setActiveGraphic( embed::getIconPixmap( "square_wave_active" ) ); - m_sqrLfoBtn->setInactiveGraphic( embed::getIconPixmap( + sqr_lfo_btn->setInactiveGraphic( embed::getIconPixmap( "square_wave_inactive" ) ); #ifdef QT4 - m_sqrLfoBtn->setWhatsThis( + sqr_lfo_btn->setWhatsThis( #else - QWhatsThis::add( m_sqrLfoBtn, + QWhatsThis::add( sqr_lfo_btn, #endif tr( "Click here if you want a square-wave for current " "oscillator." ) ); - m_usrLfoBtn = new pixmapButton( this ); - m_usrLfoBtn->move( LFO_SHAPES_X+60, LFO_SHAPES_Y ); - m_usrLfoBtn->setActiveGraphic( embed::getIconPixmap( + m_userLfoBtn = new pixmapButton( this, eng() ); + m_userLfoBtn->move( LFO_SHAPES_X+60, LFO_SHAPES_Y ); + m_userLfoBtn->setActiveGraphic( embed::getIconPixmap( "usr_wave_active" ) ); - m_usrLfoBtn->setInactiveGraphic( embed::getIconPixmap( + m_userLfoBtn->setInactiveGraphic( embed::getIconPixmap( "usr_wave_inactive" ) ); #ifdef QT4 - m_usrLfoBtn->setWhatsThis( + m_userLfoBtn->setWhatsThis( #else - QWhatsThis::add( m_usrLfoBtn, + QWhatsThis::add( m_userLfoBtn, #endif tr( "Click here if you want a user-defined wave for current " "oscillator. Afterwards drag an according sample-" "file into LFO-graph." ) ); - connect( m_sinLfoBtn, SIGNAL( toggled( bool ) ), this, - SLOT( lfoSinWaveCh( bool ) ) ); - connect( m_triangleLfoBtn, SIGNAL( toggled( bool ) ), this, - SLOT( lfoTriangleWaveCh( bool ) ) ); - connect( m_sawLfoBtn, SIGNAL( toggled( bool ) ), this, - SLOT( lfoSawWaveCh( bool ) ) ); - connect( m_sqrLfoBtn, SIGNAL( toggled( bool ) ), this, - SLOT( lfoSquareWaveCh( bool ) ) ); - connect( m_usrLfoBtn, SIGNAL( toggled( bool ) ), this, + connect( m_userLfoBtn, SIGNAL( toggled( bool ) ), this, SLOT( lfoUserWaveCh( bool ) ) ); - QButtonGroup * lfo_shapes_algo_group = new QButtonGroup( this ); - lfo_shapes_algo_group->addButton( m_sinLfoBtn ); - lfo_shapes_algo_group->addButton( m_triangleLfoBtn ); - lfo_shapes_algo_group->addButton( m_sawLfoBtn ); - lfo_shapes_algo_group->addButton( m_sqrLfoBtn ); - lfo_shapes_algo_group->addButton( m_usrLfoBtn ); - lfo_shapes_algo_group->setExclusive( TRUE ); -#ifndef QT4 - lfo_shapes_algo_group->hide(); -#endif + m_lfoWaveBtnGrp = new automatableButtonGroup( this, eng() ); + m_lfoWaveBtnGrp->addButton( sin_lfo_btn ); + m_lfoWaveBtnGrp->addButton( triangle_lfo_btn ); + m_lfoWaveBtnGrp->addButton( saw_lfo_btn ); + m_lfoWaveBtnGrp->addButton( sqr_lfo_btn ); + m_lfoWaveBtnGrp->addButton( m_userLfoBtn ); + m_lfoWaveBtnGrp->setInitValue( SIN ); - m_x100Cb = new ledCheckBox( tr( "FREQ x 100" ), this ); + + m_x100Cb = new ledCheckBox( tr( "FREQ x 100" ), this, eng() ); m_x100Cb->setFont( pointSize<6>( m_x100Cb->font() ) ); m_x100Cb->move( LFO_PREDELAY_KNOB_X, LFO_GRAPH_Y + 36 ); #ifdef QT4 @@ -463,7 +450,7 @@ envelopeAndLFOWidget::envelopeAndLFOWidget( float _value_for_zero_amount, m_controlEnvAmountCb = new ledCheckBox( tr( "MODULATE ENV-AMOUNT" ), - this ); + this, eng() ); m_controlEnvAmountCb->move( LFO_PREDELAY_KNOB_X, LFO_GRAPH_Y + 54 ); m_controlEnvAmountCb->setFont( pointSize<6>( m_controlEnvAmountCb->font() ) ); @@ -649,8 +636,11 @@ void envelopeAndLFOWidget::loadSettings( const QDomElement & _this ) m_sustainKnob->setValue( _this.attribute( "sus" ).toFloat() ); m_releaseKnob->setValue( _this.attribute( "rel" ).toFloat() ); m_amountKnob->setValue( _this.attribute( "amt" ).toFloat() ); + m_lfoShape = static_cast( _this.attribute( "lshp" ).toInt() ); + m_lfoWaveBtnGrp->setValue( m_lfoShape ); + m_lfoPredelayKnob->setValue( _this.attribute( "lpdel" ).toFloat() ); m_lfoAttackKnob->setValue( _this.attribute( "latt" ).toFloat() ); m_lfoSpeedKnob->setValue( _this.attribute( "lspd" ).toFloat() ); @@ -663,29 +653,6 @@ void envelopeAndLFOWidget::loadSettings( const QDomElement & _this ) "lfosyncmode" ).toInt() ); m_userWave.setAudioFile( _this.attribute( "userwavefile" ) ); - switch( m_lfoShape ) - { - case SIN: - m_sinLfoBtn->setChecked( TRUE ); - break; - - case TRIANGLE: - m_triangleLfoBtn->setChecked( TRUE ); - break; - - case SAW: - m_sawLfoBtn->setChecked( TRUE ); - break; - - case SQUARE: - m_sqrLfoBtn->setChecked( TRUE ); - break; - - case USER: - m_usrLfoBtn->setChecked( TRUE ); - break; - } - m_busy = FALSE; updateSampleVars(); @@ -750,7 +717,7 @@ void envelopeAndLFOWidget::dropEvent( QDropEvent * _de ) if( type == "samplefile" ) { m_userWave.setAudioFile( stringPairDrag::decodeValue( _de ) ); - m_usrLfoBtn->setChecked( TRUE ); + m_userLfoBtn->setChecked( TRUE ); lfoUserWaveCh( TRUE ); _de->accept(); } @@ -759,7 +726,7 @@ void envelopeAndLFOWidget::dropEvent( QDropEvent * _de ) multimediaProject mmp( value, FALSE ); m_userWave.setAudioFile( mmp.content().firstChild().toElement(). attribute( "src" ) ); - m_usrLfoBtn->setChecked( TRUE ); + m_userLfoBtn->setChecked( TRUE ); lfoUserWaveCh( TRUE ); _de->accept(); } @@ -1140,56 +1107,9 @@ void envelopeAndLFOWidget::updateAfterKnobChange( float ) -void envelopeAndLFOWidget::lfoSinWaveCh( bool _on ) +void envelopeAndLFOWidget::lfoWaveCh( int _val ) { - if( _on ) - { - m_lfoShape = SIN; - } - eng()->getSongEditor()->setModified(); - - update(); -} - - - - -void envelopeAndLFOWidget::lfoTriangleWaveCh( bool _on ) -{ - if( _on ) - { - m_lfoShape = TRIANGLE; - } - eng()->getSongEditor()->setModified(); - - update(); -} - - - - -void envelopeAndLFOWidget::lfoSawWaveCh( bool _on ) -{ - if( _on ) - { - m_lfoShape = SAW; - } - eng()->getSongEditor()->setModified(); - - update(); -} - - - - -void envelopeAndLFOWidget::lfoSquareWaveCh( bool _on ) -{ - if( _on ) - { - m_lfoShape = SQUARE; - } - eng()->getSongEditor()->setModified(); - + m_lfoShape = static_cast( _val ); update(); } diff --git a/src/core/envelope_tab_widget.cpp b/src/core/envelope_tab_widget.cpp index 337e043b51..05cc2835c8 100644 --- a/src/core/envelope_tab_widget.cpp +++ b/src/core/envelope_tab_widget.cpp @@ -138,12 +138,12 @@ envelopeTabWidget::envelopeTabWidget( channelTrack * _channel_track ) : } - m_filterGroupBox = new groupBox( tr( "FILTER" ), this ); + m_filterGroupBox = new groupBox( tr( "FILTER" ), this, eng() ); m_filterGroupBox->setGeometry( FILTER_GROUPBOX_X, FILTER_GROUPBOX_Y, FILTER_GROUPBOX_WIDTH, FILTER_GROUPBOX_HEIGHT ); - m_filterComboBox = new comboBox( m_filterGroupBox ); + m_filterComboBox = new comboBox( m_filterGroupBox, eng() ); m_filterComboBox->setGeometry( 14, 22, 120, 22 ); m_filterComboBox->setFont( pointSize<8>( m_filterComboBox->font() ) ); @@ -281,7 +281,7 @@ void envelopeTabWidget::processAudioBuffer( sampleFrame * _ab, basicFilters<>::filterTypes filter = basicFilters<>::getFilterType( - m_filterComboBox->currentIndex() ); + m_filterComboBox->value() ); if( m_envLFOWidgets[VOLUME]->used() && m_envLFOWidgets[CUT]->used() && @@ -498,7 +498,7 @@ void envelopeTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _parent ) { QDomElement etw_de = _doc.createElement( nodeName() ); - etw_de.setAttribute( "ftype", m_filterComboBox->currentIndex() ); + etw_de.setAttribute( "ftype", m_filterComboBox->value() ); etw_de.setAttribute( "fcut", m_filterCutKnob->value() ); etw_de.setAttribute( "fres", m_filterResKnob->value() ); etw_de.setAttribute( "fwet", m_filterGroupBox->isActive() ); @@ -520,7 +520,7 @@ void envelopeTabWidget::saveSettings( QDomDocument & _doc, void envelopeTabWidget::loadSettings( const QDomElement & _this ) { - m_filterComboBox->setCurrentIndex( _this.attribute( "ftype" ).toInt() ); + m_filterComboBox->setValue( _this.attribute( "ftype" ).toInt() ); m_filterCutKnob->setValue( _this.attribute( "fcut" ).toFloat() ); m_filterResKnob->setValue( _this.attribute( "fres" ).toFloat() ); /* m_filterState->setChecked( _this.attribute( "fwet" ).toInt() );*/ diff --git a/src/core/export_project_dialog.cpp b/src/core/export_project_dialog.cpp index 18adc227f4..505a2d8712 100644 --- a/src/core/export_project_dialog.cpp +++ b/src/core/export_project_dialog.cpp @@ -153,7 +153,7 @@ exportProjectDialog::exportProjectDialog( const QString & _file_name, m_typeLbl->setGeometry( LABEL_X, TYPE_STUFF_Y, LABEL_WIDTH, TYPE_HEIGHT ); - m_typeCombo = new comboBox( this ); + m_typeCombo = new comboBox( this, eng() ); m_typeCombo->setGeometry( LABEL_X + LABEL_WIDTH+LABEL_MARGIN, TYPE_STUFF_Y, TYPE_COMBO_WIDTH, TYPE_HEIGHT ); @@ -167,7 +167,7 @@ exportProjectDialog::exportProjectDialog( const QString & _file_name, tr( fileEncodeDevices[idx].m_description ) ); ++idx; } - m_typeCombo->setCurrentIndex( m_typeCombo->findText( tr( + m_typeCombo->setValue( m_typeCombo->findText( tr( fileEncodeDevices[m_fileType].m_description ) ) ); @@ -176,7 +176,7 @@ exportProjectDialog::exportProjectDialog( const QString & _file_name, m_kbpsLbl->setGeometry( LABEL_X, KBPS_STUFF_Y, LABEL_WIDTH, KBPS_HEIGHT ); - m_kbpsCombo = new comboBox( this ); + m_kbpsCombo = new comboBox( this, eng() ); m_kbpsCombo->setGeometry( LABEL_X + LABEL_WIDTH + LABEL_MARGIN, KBPS_STUFF_Y, KBPS_COMBO_WIDTH, KBPS_HEIGHT ); @@ -188,18 +188,18 @@ exportProjectDialog::exportProjectDialog( const QString & _file_name, s_availableBitrates[idx] ) ); ++idx; } - m_typeCombo->setCurrentIndex( m_typeCombo->findText( + m_typeCombo->setValue( m_typeCombo->findText( QString::number( 128 ) ) ); - m_vbrCb = new ledCheckBox( tr( "variable bitrate" ), this ); + m_vbrCb = new ledCheckBox( tr( "variable bitrate" ), this, eng() ); m_vbrCb->setGeometry( LABEL_X + LABEL_WIDTH + 3 * LABEL_MARGIN + KBPS_COMBO_WIDTH, KBPS_STUFF_Y + 3, 190, 20 ); m_vbrCb->setChecked( TRUE ); m_hqmCb = new ledCheckBox( tr( "use high-quality-mode (recommened)" ), - this ); + this, eng() ); m_hqmCb->setGeometry( LABEL_X, HQ_MODE_CB_Y + 3, HQ_MODE_CB_WIDTH, HQ_MODE_CB_HEIGHT ); m_hqmCb->setChecked( TRUE ); diff --git a/src/core/import_filter.cpp b/src/core/import_filter.cpp new file mode 100644 index 0000000000..e72bab62bc --- /dev/null +++ b/src/core/import_filter.cpp @@ -0,0 +1,144 @@ +#ifndef SINGLE_SOURCE_COMPILE + +/* + * import_filter.cpp - base-class for all import-filters (MIDI, FLP etc) + * + * Copyright (c) 2006 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + + +#include "import_filter.h" +#include "track_container.h" + +#ifdef QT4 + +#include + +#else + +#include + +#define fileName name + +#endif + + +importFilter::importFilter( const QString & _file_name, + const descriptor * _descriptor, + engine * _eng ) : + plugin( _descriptor, _eng ), + m_file( _file_name ) +{ +} + + + + +importFilter::~importFilter() +{ +} + + + + +void importFilter::import( const QString & _file_to_import, + trackContainer * _tc ) +{ + vvector d; + plugin::getDescriptorsOfAvailPlugins( d ); + + bool successful = FALSE; + + char * s = qstrdup( _file_to_import. +#ifndef QT3 + toAscii().constData() +#else + ascii() +#endif + ); + + for( vvector::iterator it = d.begin(); + it != d.end(); ++it ) + { + if( it->type == plugin::IMPORT_FILTER ) + { + plugin * p = plugin::instantiate( it->name, s ); + if( dynamic_cast( p ) != NULL && + dynamic_cast( p )->tryImport( + _tc ) == TRUE ) + { + delete p; + successful = TRUE; + break; + } + delete p; + } + } + + delete[] s; + + if( successful == FALSE ) + { + QMessageBox::information( NULL, + trackContainer::tr( "Couldn't import file" ), + trackContainer::tr( "Couldn't find a filter for " + "importing file %1.\n" + "You should convert this file " + "into a format supported by " + "LMMS using another software. " + ).arg( _file_to_import ), + QMessageBox::Ok, + QMessageBox::NoButton ); + } +} + + + + +bool importFilter::openFile( void ) +{ +#ifdef QT4 + if( m_file.open( QFile::ReadOnly ) == FALSE ) +#else + if( m_file.open( IO_ReadOnly ) == FALSE ) +#endif + { + QMessageBox::critical( NULL, + trackContainer::tr( "Couldn't open file" ), + trackContainer::tr( "Couldn't open file %1 " + "for reading.\nPlease make " + "sure you have read-" + "permission to the file and " + "the directory containing the " + "file and try again!" ).arg( + m_file.fileName() ), + QMessageBox::Ok, + QMessageBox::NoButton ); + return( FALSE ); + } + return( TRUE ); +} + + +#undef fileName + + +#endif diff --git a/src/core/main_window.cpp b/src/core/main_window.cpp index fb7c682f14..f8726a97ab 100644 --- a/src/core/main_window.cpp +++ b/src/core/main_window.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #else @@ -46,6 +47,7 @@ #include #include #include +#include #if QT_VERSION >= 0x030200 #include @@ -74,6 +76,7 @@ #include "setup_dialog.h" #include "audio_dummy.h" #include "tool_button.h" +#include "edit_history.h" #if QT_VERSION >= 0x030100 @@ -464,9 +467,25 @@ void mainWindow::finalize( void ) #endif project_menu->addAction( embed::getIconPixmap( "exit" ), tr( "&Quit" ), qApp, SLOT( closeAllWindows() ), - Qt::CTRL+Qt::Key_Q ); + Qt::CTRL + Qt::Key_Q ); + QMenu * edit_menu = new QMenu( this ); +#ifdef QT4 + menuBar()->addMenu( edit_menu )->setText( tr( "&Edit" ) ); +#else + menuBar()->insertItem( tr( "&Edit" ), edit_menu ); +#endif + edit_menu->addAction( embed::getIconPixmap( "edit_undo" ), + tr( "Undo" ), + this, SLOT( undo() ), + Qt::CTRL + Qt::Key_Z ); + edit_menu->addAction( embed::getIconPixmap( "edit_redo" ), + tr( "Redo" ), + this, SLOT( redo() ), + Qt::CTRL + Qt::Key_R ); + + QMenu * settings_menu = new QMenu( this ); #ifdef QT4 menuBar()->addMenu( settings_menu )->setText( tr( "&Settings" ) ); @@ -583,6 +602,34 @@ void mainWindow::clearKeyModifiers( void ) +void mainWindow::saveWidgetState( QWidget * _w, QDomElement & _de ) +{ + _de.setAttribute( "x", _w->parentWidget()->x() ); + _de.setAttribute( "y", _w->parentWidget()->y() ); + _de.setAttribute( "width", _w->width() ); + _de.setAttribute( "height", _w->height() ); + _de.setAttribute( "visible", _w->isVisible() ); +} + + + + +void mainWindow::restoreWidgetState( QWidget * _w, const QDomElement & _de ) +{ + QRect r( _de.attribute( "x" ).toInt(), _de.attribute( "y" ).toInt(), + _de.attribute( "width" ).toInt(), + _de.attribute( "height" ).toInt() ); + if( !r.isNull() ) + { + _w->setShown( _de.attribute( "visible" ).toInt() ); + _w->parentWidget()->move( r.topLeft() ); + _w->resize( r.size() ); + } +} + + + + void mainWindow::createNewProject( void ) { if( eng()->getSongEditor()->mayChangeProject() == TRUE ) @@ -808,6 +855,22 @@ void mainWindow::togglePianoRollWin( void ) +void mainWindow::undo( void ) +{ + eng()->getEditHistory()->undo(); +} + + + + +void mainWindow::redo( void ) +{ + eng()->getEditHistory()->redo(); +} + + + + void mainWindow::closeEvent( QCloseEvent * _ce ) { if( eng()->getSongEditor()->mayChangeProject() == TRUE ) diff --git a/src/core/midi_tab_widget.cpp b/src/core/midi_tab_widget.cpp index 4fc010e3cb..410e61b42c 100644 --- a/src/core/midi_tab_widget.cpp +++ b/src/core/midi_tab_widget.cpp @@ -76,7 +76,7 @@ midiTabWidget::midiTabWidget( channelTrack * _channel_track, m_inputChannelSpinBox = new lcdSpinBox( 0, MIDI_CHANNEL_COUNT, 3, - m_setupTabWidget ); + m_setupTabWidget, eng() ); m_inputChannelSpinBox->addTextForValue( 0, "---" ); m_inputChannelSpinBox->setValue( m_midiPort->inputChannel() + 1 ); m_inputChannelSpinBox->setLabel( tr( "CHANNEL" ) ); @@ -86,7 +86,7 @@ midiTabWidget::midiTabWidget( channelTrack * _channel_track, inputChannelChanged( m_inputChannelSpinBox->value() ); m_outputChannelSpinBox = new lcdSpinBox( 1, MIDI_CHANNEL_COUNT, 3, - m_setupTabWidget ); + m_setupTabWidget, eng() ); m_outputChannelSpinBox->setValue( m_midiPort->outputChannel() + 1 ); //m_outputChannelSpinBox->addTextForValue( 0, "---" ); m_outputChannelSpinBox->setLabel( tr( "CHANNEL" ) ); @@ -97,7 +97,7 @@ midiTabWidget::midiTabWidget( channelTrack * _channel_track, m_receiveCheckBox = new ledCheckBox( tr( "Receive MIDI-events" ), - m_setupTabWidget ); + m_setupTabWidget, eng() ); m_receiveCheckBox->move( 10, 34 ); connect( m_receiveCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( midiPortModeToggled( bool ) ) ); @@ -106,7 +106,7 @@ midiTabWidget::midiTabWidget( channelTrack * _channel_track, m_sendCheckBox = new ledCheckBox( tr( "Send MIDI-events" ), - m_setupTabWidget ); + m_setupTabWidget, eng() ); m_sendCheckBox->move( 10, 94 ); connect( m_sendCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( midiPortModeToggled( bool ) ) ); diff --git a/src/core/piano_roll.cpp b/src/core/piano_roll.cpp index 22f6de0c3b..4074a41439 100644 --- a/src/core/piano_roll.cpp +++ b/src/core/piano_roll.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #else @@ -45,6 +46,9 @@ #include #include #include +#include + +#define addButton insert #endif @@ -391,7 +395,7 @@ pianoRoll::pianoRoll( engine * _engine ) : zoom_lbl->setPixmap( embed::getIconPixmap( "zoom" ) ); // setup zooming-stuff - m_zoomingComboBox = new comboBox( m_toolBar ); + m_zoomingComboBox = new comboBox( m_toolBar, eng() ); m_zoomingComboBox->setFixedSize( 80, 22 ); for( int i = 0; i < 6; ++i ) { @@ -399,7 +403,7 @@ pianoRoll::pianoRoll( engine * _engine ) : static_cast( powf( 2.0f, i ) ) ) + "%" ); } - m_zoomingComboBox->setCurrentIndex( m_zoomingComboBox->findText( + m_zoomingComboBox->setValue( m_zoomingComboBox->findText( "100%" ) ); connect( m_zoomingComboBox, SIGNAL( activated( const QString & ) ), this, SLOT( zoomingChanged( const QString & ) ) ); @@ -409,21 +413,21 @@ pianoRoll::pianoRoll( engine * _engine ) : QLabel * quantize_lbl = new QLabel( m_toolBar ); quantize_lbl->setPixmap( embed::getIconPixmap( "quantize" ) ); - m_quantizeComboBox = new comboBox( m_toolBar ); + m_quantizeComboBox = new comboBox( m_toolBar, eng() ); m_quantizeComboBox->setFixedSize( 60, 22 ); for( int i = 0; i < 7; ++i ) { m_quantizeComboBox->addItem( "1/" + QString::number( static_cast( powf( 2.0f, i ) ) ) ); } - m_quantizeComboBox->setCurrentIndex( m_quantizeComboBox->findText( + m_quantizeComboBox->setValue( m_quantizeComboBox->findText( "1/16" ) ); // setup note-len-stuff QLabel * note_len_lbl = new QLabel( m_toolBar ); note_len_lbl->setPixmap( embed::getIconPixmap( "note" ) ); - m_noteLenComboBox = new comboBox( m_toolBar ); + m_noteLenComboBox = new comboBox( m_toolBar, eng() ); m_noteLenComboBox->setFixedSize( 120, 22 ); m_noteLenComboBox->addItem( tr( "Last note" ), embed::getIconPixmap( "edit_draw" ) ); @@ -435,7 +439,7 @@ pianoRoll::pianoRoll( engine * _engine ) : static_cast( powf( 2.0f, i ) ) ), embed::getIconPixmap( "note_" + pixmaps[i] ) ); } - m_noteLenComboBox->setCurrentIndex( 0 ); + m_noteLenComboBox->setValue( 0 ); tb_layout->addSpacing( 5 ); @@ -553,6 +557,24 @@ void pianoRoll::setCurrentPattern( pattern * _new_pattern ) +void pianoRoll::saveSettings( QDomDocument & _doc, QDomElement & _parent ) +{ + QDomElement pr_de = _doc.createElement( nodeName() ); + mainWindow::saveWidgetState( this, pr_de ); + _parent.appendChild( pr_de ); +} + + + + +void pianoRoll::loadSettings( const QDomElement & _this ) +{ + mainWindow::restoreWidgetState( this, _this ); +} + + + + inline void pianoRoll::drawNoteRect( QPainter & _p, Uint16 _x, Uint16 _y, Sint16 _width, const bool _is_selected, const bool _is_step_note ) @@ -1996,7 +2018,7 @@ void pianoRoll::wheelEvent( QWheelEvent * _we ) m_ppt /= 2; } // update combobox with zooming-factor - m_zoomingComboBox->setCurrentIndex( + m_zoomingComboBox->setValue( m_zoomingComboBox->findText( QString::number( static_cast( m_ppt * 100 / DEFAULT_PR_PPT ) ) +"%" ) ); @@ -2486,7 +2508,7 @@ int pianoRoll::quantization( void ) const midiTime pianoRoll::newNoteLen( void ) const { - if( m_noteLenComboBox->currentIndex() == 0 ) + if( m_noteLenComboBox->value() == 0 ) { return( m_lenOfNewNotes ); } @@ -2500,4 +2522,9 @@ midiTime pianoRoll::newNoteLen( void ) const #include "piano_roll.moc" +#ifdef QT3 +#undef addButton +#endif + + #endif diff --git a/src/core/plugin_browser.cpp b/src/core/plugin_browser.cpp index 0afbe56625..c8ee5db502 100644 --- a/src/core/plugin_browser.cpp +++ b/src/core/plugin_browser.cpp @@ -87,10 +87,13 @@ pluginBrowser::pluginBrowser( QWidget * _parent, engine * _engine ) : m_pluginDescriptors.begin(); it != m_pluginDescriptors.end(); ++it ) { - pluginDescWidget * p = new pluginDescWidget( *it, m_view, - eng() ); - p->show(); - view_layout->addWidget( p ); + if( it->type == plugin::INSTRUMENT ) + { + pluginDescWidget * p = new pluginDescWidget( *it, + m_view, eng() ); + p->show(); + view_layout->addWidget( p ); + } } view_layout->addStretch(); show(); diff --git a/src/core/setup_dialog.cpp b/src/core/setup_dialog.cpp index 786118ab6c..aae6ec7993 100644 --- a/src/core/setup_dialog.cpp +++ b/src/core/setup_dialog.cpp @@ -191,7 +191,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) : ledCheckBox * disable_tooltips = new ledCheckBox( tr( "Disable tooltips (no spurious " "interrupts while playing)" ), - misc_tw ); + misc_tw, eng() ); disable_tooltips->move( 10, 18 ); disable_tooltips->setChecked( m_disableToolTips ); connect( disable_tooltips, SIGNAL( toggled( bool ) ), @@ -202,7 +202,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) : tr( "Classical knob usability (move " "cursor around knob to change " "value)" ), - misc_tw ); + misc_tw, eng() ); classical_knob_usability->move( 10, 36 ); classical_knob_usability->setChecked( m_classicalKnobUsability ); connect( classical_knob_usability, SIGNAL( toggled( bool ) ), @@ -211,7 +211,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) : ledCheckBox * gimp_like_windows = new ledCheckBox( tr( "GIMP-like windows (no MDI)" ), - misc_tw ); + misc_tw, eng() ); gimp_like_windows->move( 10, 54 ); gimp_like_windows->setChecked( m_gimpLikeWindows ); connect( gimp_like_windows, SIGNAL( toggled( bool ) ), @@ -219,8 +219,8 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) : ledCheckBox * no_wizard = new ledCheckBox( - tr( "Do not show wizard after " - "up-/downgrade" ), misc_tw ); + tr( "Do not show wizard after " + "up-/downgrade" ), misc_tw, eng() ); no_wizard->move( 10, 72 ); no_wizard->setChecked( m_noWizard ); connect( no_wizard, SIGNAL( toggled( bool ) ), @@ -230,7 +230,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) : ledCheckBox * no_msg = new ledCheckBox( tr( "Do not show message after " "closing this dialog" ), - misc_tw ); + misc_tw, eng() ); no_msg->move( 10, 90 ); no_msg->setChecked( m_noMsgAfterSetup ); connect( no_msg, SIGNAL( toggled( bool ) ), @@ -336,7 +336,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) : ledCheckBox * disable_ch_act_ind = new ledCheckBox( tr( "Disable channel activity indicators" ), - ui_fx_tw ); + ui_fx_tw, eng() ); disable_ch_act_ind->move( 10, 20 ); disable_ch_act_ind->setChecked( m_disableChActInd ); connect( disable_ch_act_ind, SIGNAL( toggled( bool ) ), @@ -345,7 +345,7 @@ setupDialog::setupDialog( engine * _engine, configTabs _tab_to_open ) : ledCheckBox * manual_ch_piano = new ledCheckBox( tr( "Only press keys on channel-piano manually" ), - ui_fx_tw ); + ui_fx_tw, eng() ); manual_ch_piano->move( 10, 40 ); manual_ch_piano->setChecked( m_manualChPiano ); connect( manual_ch_piano, SIGNAL( toggled( bool ) ), diff --git a/src/core/song_editor.cpp b/src/core/song_editor.cpp index b0a75f7700..f57ed3a8c3 100644 --- a/src/core/song_editor.cpp +++ b/src/core/song_editor.cpp @@ -64,6 +64,8 @@ #include #include +#define addButton insert + #endif @@ -84,7 +86,6 @@ #include "visualization_widget.h" #include "project_notes.h" #include "config_mgr.h" -#include "midi_file.h" #include "lcd_spinbox.h" #include "tooltip.h" #include "tool_button.h" @@ -92,6 +93,8 @@ #include "text_float.h" #include "combobox.h" #include "main_window.h" +#include "import_filter.h" +#include "edit_history.h" #include "debug.h" @@ -151,7 +154,7 @@ songEditor::songEditor( engine * _engine ) : eng()->getMainWindow()->addSpacingToToolBar( 10 ); - m_bpmSpinBox = new lcdSpinBox( MIN_BPM, MAX_BPM, 3, tb ); + m_bpmSpinBox = new lcdSpinBox( MIN_BPM, MAX_BPM, 3, tb, eng() ); m_bpmSpinBox->setLabel( tr( "TEMPO/BPM" ) ); connect( m_bpmSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( setTempo( int ) ) ); @@ -370,7 +373,7 @@ songEditor::songEditor( engine * _engine ) : zoom_lbl->setPixmap( embed::getIconPixmap( "zoom" ) ); // setup zooming-stuff - m_zoomingComboBox = new comboBox( m_toolBar ); + m_zoomingComboBox = new comboBox( m_toolBar, eng() ); m_zoomingComboBox->setFixedSize( 80, 22 ); m_zoomingComboBox->move( 580, 4 ); for( int i = 0; i < 7; ++i ) @@ -379,7 +382,7 @@ songEditor::songEditor( engine * _engine ) : static_cast( powf( 2.0f, i ) ) ) + "%" ); } - m_zoomingComboBox->setCurrentIndex( m_zoomingComboBox->findText( + m_zoomingComboBox->setValue( m_zoomingComboBox->findText( "100%" ) ); connect( m_zoomingComboBox, SIGNAL( activated( const QString & ) ), this, SLOT( zoomingChanged( const QString & ) ) ); @@ -566,7 +569,7 @@ void songEditor::wheelEvent( QWheelEvent * _we ) setPixelsPerTact( (int) pixelsPerTact() / 2 ); } // update combobox with zooming-factor - m_zoomingComboBox->setCurrentIndex( + m_zoomingComboBox->setValue( m_zoomingComboBox->findText( QString::number( static_cast( pixelsPerTact() * 100 / DEFAULT_PIXELS_PER_TACT ) ) + "%" ) ); @@ -1336,6 +1339,8 @@ bool songEditor::mayChangeProject( void ) void songEditor::clearProject( void ) { + eng()->getEditHistory()->setGlobalStepRecording( FALSE ); + if( m_playing ) { // stop play, because it's dangerous that play-routines try to @@ -1360,6 +1365,8 @@ void songEditor::clearProject( void ) eng()->getBBEditor()->clearAllTracks(); eng()->getProjectNotes()->clear(); + + eng()->getEditHistory()->setGlobalStepRecording( TRUE ); } @@ -1371,6 +1378,8 @@ void songEditor::createNewProject( void ) { clearProject(); + eng()->getEditHistory()->setGlobalStepRecording( FALSE ); + track * t; t = track::create( track::CHANNEL_TRACK, this ); dynamic_cast< channelTrack * >( t )->loadInstrument( @@ -1392,6 +1401,9 @@ void songEditor::createNewProject( void ) m_modified = FALSE; eng()->getMainWindow()->resetWindowTitle( "" ); + + eng()->getEditHistory()->setGlobalStepRecording( TRUE ); + } @@ -1414,6 +1426,8 @@ void FASTCALL songEditor::loadProject( const QString & _file_name ) { clearProject(); + eng()->getEditHistory()->setGlobalStepRecording( FALSE ); + m_fileName = _file_name; m_oldFileName = _file_name; @@ -1473,12 +1487,24 @@ void FASTCALL songEditor::loadProject( const QString & _file_name ) { loadSettings( node.toElement() ); } + else if( node.nodeName() == + eng()->getPianoRoll()->nodeName() ) + { + eng()->getPianoRoll()->loadSettings( + node.toElement() ); + } else if( node.nodeName() == eng()->getProjectNotes()->nodeName() ) { eng()->getProjectNotes()->loadSettings( node.toElement() ); } + else if( node.nodeName() == + m_playPos[PLAY_SONG].m_timeLine->nodeName() ) + { + m_playPos[PLAY_SONG].m_timeLine->loadSettings( + node.toElement() ); + } } node = node.nextSibling(); } @@ -1489,6 +1515,8 @@ void FASTCALL songEditor::loadProject( const QString & _file_name ) m_loadingProject = FALSE; eng()->getMainWindow()->resetWindowTitle( "" ); + + eng()->getEditHistory()->setGlobalStepRecording( TRUE ); } @@ -1513,7 +1541,10 @@ bool songEditor::saveProject( void ) saveSettings( mmp, mmp.content() ); + + eng()->getPianoRoll()->saveSettings( mmp, mmp.content() ); eng()->getProjectNotes()->saveSettings( mmp, mmp.content() ); + m_playPos[PLAY_SONG].m_timeLine->saveSettings( mmp, mmp.content() ); if( mmp.writeFile( m_fileName, m_oldFileName == "" || m_fileName != m_oldFileName ) == TRUE ) @@ -1574,8 +1605,7 @@ void songEditor::importProject( void ) ofd.setFileMode( QFileDialog::ExistingFiles ); if( ofd.exec () == QDialog::Accepted && !ofd.selectedFiles().isEmpty() ) { - midiFile mf( ofd.selectedFiles()[0] ); - mf.importToTrackContainer( this ); + importFilter::import( ofd.selectedFiles()[0], this ); } } @@ -1676,4 +1706,9 @@ void songEditor::loadSettings( const QDomElement & _this ) #include "song_editor.moc" +#ifdef QT3 +#undef addButton +#endif + + #endif diff --git a/src/core/timeline.cpp b/src/core/timeline.cpp index 2e7e53c5dc..f5761f7dcb 100644 --- a/src/core/timeline.cpp +++ b/src/core/timeline.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #else @@ -41,6 +42,7 @@ #include #include #include +#include #endif @@ -174,6 +176,30 @@ void timeLine::addToolButtons( QWidget * _tool_bar ) +void timeLine::saveSettings( QDomDocument & _doc, QDomElement & _parent ) +{ + QDomElement tl_de = _doc.createElement( nodeName() ); + tl_de.setAttribute( "lp0pos", (int) loopBegin() ); + tl_de.setAttribute( "lp1pos", (int) loopEnd() ); + tl_de.setAttribute( "lpstate", m_loopPoints ); + _parent.appendChild( tl_de ); +} + + + + +void timeLine::loadSettings( const QDomElement & _this ) +{ + m_loopPos[0] = _this.attribute( "lp0pos" ).toInt(); + m_loopPos[1] = _this.attribute( "lp1pos" ).toInt(); + m_loopPoints = static_cast( + _this.attribute( "lpstate" ).toInt() ); + update(); +} + + + + void timeLine::updatePosition( const midiTime & ) { const int new_x = markerX( m_pos ); @@ -295,8 +321,6 @@ void timeLine::mousePressEvent( QMouseEvent * _me ) { const midiTime t = m_begin + static_cast( _me->x() * 64 / m_ppt ); - Uint8 pmin = 0; - Uint8 pmax = 1; m_action = MOVE_LOOP_BEGIN; if( m_loopPos[0] > m_loopPos[1] ) { diff --git a/src/core/track.cpp b/src/core/track.cpp index 53b7690bf9..fb4d0de6d8 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -863,7 +863,7 @@ trackOperationsWidget::trackOperationsWidget( trackWidget * _parent ) : toolTip::add( m_trackOps, tr( "Actions for this track" ) ); - m_muteBtn = new pixmapButton( this ); + m_muteBtn = new pixmapButton( this, m_trackWidget->getTrack()->eng() ); m_muteBtn->setActiveGraphic( embed::getIconPixmap( "mute_on" ) ); m_muteBtn->setInactiveGraphic( embed::getIconPixmap( "mute_off" ) ); m_muteBtn->move( 44, 4 ); diff --git a/src/core/track_container.cpp b/src/core/track_container.cpp index f661913faf..ca54c6e315 100644 --- a/src/core/track_container.cpp +++ b/src/core/track_container.cpp @@ -58,7 +58,7 @@ #include "channel_track.h" #include "mmp.h" #include "config_mgr.h" -#include "midi_file.h" +#include "import_filter.h" #include "instrument.h" #include "rubberband.h" @@ -109,6 +109,7 @@ void trackContainer::saveSettings( QDomDocument & _doc, QDomElement & _parent ) { QDomElement tc_de = _doc.createElement( "trackcontainer" ); tc_de.setAttribute( "type", nodeName() ); + mainWindow::saveWidgetState( this, tc_de ); _parent.appendChild( tc_de ); // save settings of each track @@ -176,6 +177,8 @@ void trackContainer::loadSettings( const QDomElement & _this ) node = node.nextSibling(); } + mainWindow::restoreWidgetState( this, _this ); + pd->setValue( start_val + _this.childNodes().count() ); if( was_null ) @@ -463,8 +466,7 @@ void trackContainer::dropEvent( QDropEvent * _de ) } else if( type == "midifile" ) { - midiFile mf( value ); - mf.importToTrackContainer( this ); + importFilter::import( value, this ); _de->accept(); } else if( type.left( 6 ) == "track_" ) diff --git a/src/lmms_single_source.cpp b/src/lmms_single_source.cpp index 22e4196649..f634e39954 100644 --- a/src/lmms_single_source.cpp +++ b/src/lmms_single_source.cpp @@ -2,6 +2,7 @@ #undef SINGLE_SOURCE_COMPILE #include "src/lib/string_pair_drag.cpp" #include "src/lib/buffer_allocator.cpp" +#include "src/lib/edit_history.cpp" #include "src/lib/embed.cpp" #include "src/lib/base64.cpp" #include "src/lib/mmp.cpp" @@ -9,6 +10,7 @@ #include "src/lib/oscillator.cpp" #include "src/lib/clipboard.cpp" #include "src/lib/sample_buffer.cpp" +#include "src/core/import_filter.cpp" #include "src/core/config_mgr.cpp" #include "src/core/envelope_and_lfo_widget.cpp" #include "src/core/song_editor.cpp" @@ -40,7 +42,6 @@ #include "src/core/midi_tab_widget.cpp" #include "src/midi/midi_alsa_seq.cpp" #include "src/midi/midi_oss.cpp" -#include "src/midi/midi_file.cpp" #include "src/midi/midi_port.cpp" #include "src/midi/midi_client.cpp" #include "src/midi/midi_mapper.cpp" @@ -82,4 +83,5 @@ #include "src/widgets/tooltip.cpp" #include "src/widgets/nstate_button.cpp" #include "src/widgets/lcd_spinbox.cpp" +#include "src/widgets/automatable_button.cpp" #endif diff --git a/src/widgets/automatable_button.cpp b/src/widgets/automatable_button.cpp new file mode 100644 index 0000000000..76b092f8ae --- /dev/null +++ b/src/widgets/automatable_button.cpp @@ -0,0 +1,205 @@ +#ifndef SINGLE_SOURCE_COMPILE + +/* + * automatable_button.cpp - implementation of class automatableButton and + * automatableButtonGroup + * + * Copyright (c) 2006 Tobias Doerffel + * + * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + + +#include "automatable_button.h" + + +automatableButton::automatableButton( QWidget * _parent, engine * _engine ) : + QWidget( _parent ), + automatableObject( _engine, FALSE, TRUE, FALSE ), + m_group( NULL ), + m_toggleButton( FALSE ) +{ +} + + + + +automatableButton::~automatableButton() +{ + if( m_group != NULL ) + { + m_group->removeButton( this ); + } +} + + + + +void automatableButton::mousePressEvent( QMouseEvent * _me ) +{ + if( _me->button() == Qt::LeftButton ) + { + if( m_toggleButton == FALSE ) + { + setChecked( TRUE ); + } + else + { + toggle(); + } + _me->accept(); + } + else + { + QWidget::mousePressEvent( _me ); + } +} + + + + +void automatableButton::mouseReleaseEvent( QMouseEvent * _me ) +{ + if( m_toggleButton == FALSE ) + { + setChecked( FALSE ); + } + emit clicked(); +} + + + + +void automatableButton::toggle( void ) +{ + if( m_toggleButton == TRUE && m_group != NULL ) + { + if( value() == FALSE ) + { + m_group->activateButton( this ); + } + } + else + { + setValue( !value() ); + update(); + emit( toggled( value() ) ); + } +} + + + + +void automatableButton::setChecked( bool _on ) +{ + if( _on != isChecked() ) + { + setValue( _on ); + update(); + emit( toggled( value() ) ); + } +} + + + + + + + + +automatableButtonGroup::automatableButtonGroup( QObject * _parent, + engine * _engine ) : + QObject( _parent ), + automatableObject( _engine ) +{ +} + + + + +automatableButtonGroup::~automatableButtonGroup() +{ + while( m_buttons.empty() == FALSE ) + { + removeButton( m_buttons.front() ); + } +} + + + + +void automatableButtonGroup::addButton( automatableButton * _btn ) +{ + _btn->m_group = this; + _btn->setToggleButton( TRUE ); + _btn->setChecked( FALSE ); + // disable step-recording as we're recording changes of states of + // button-group members on our own + _btn->setStepRecording( FALSE ); + + m_buttons.push_back( _btn ); + setRange( 0, m_buttons.size() - 1 ); +} + + + + +void automatableButtonGroup::removeButton( automatableButton * _btn ) +{ + m_buttons.erase( qFind( m_buttons.begin(), m_buttons.end(), _btn ) ); + _btn->m_group = NULL; + + setRange( 0, m_buttons.size() - 1 ); +} + + + + +void automatableButtonGroup::activateButton( automatableButton * _btn ) +{ + if( _btn != m_buttons[value()] && m_buttons.findIndex( _btn ) != -1 ) + { + setValue( m_buttons.findIndex( _btn ) ); + } +} + + + + +void automatableButtonGroup::setValue( const int _value ) +{ + if( m_buttons.empty() == FALSE ) + { + // range not updated yet? + if( value() == fittedValue( value() ) ) + { + m_buttons[value()]->setChecked( FALSE ); + } + automatableObject::setValue( _value ); + m_buttons[value()]->setChecked( TRUE ); + } + + emit valueChanged( value() ); +} + + + +#include "automatable_button.moc" + +#endif diff --git a/src/widgets/combobox.cpp b/src/widgets/combobox.cpp index 1b15999b6e..115110f352 100644 --- a/src/widgets/combobox.cpp +++ b/src/widgets/combobox.cpp @@ -54,10 +54,10 @@ QPixmap * comboBox::s_arrow = NULL; const int CB_ARROW_BTN_WIDTH = 20; -comboBox::comboBox( QWidget * _parent ) : +comboBox::comboBox( QWidget * _parent, engine * _engine ) : QWidget( _parent ), + automatableObject( _engine ), m_menu( this ), - m_currentIndex( 0 ), m_pressed( FALSE ) { if( s_background == NULL ) @@ -124,6 +124,7 @@ void comboBox::addItem( const QString & _item, const QPixmap & _pixmap ) #endif ); } + setRange( 0, m_items.size() - 1 ); } @@ -145,13 +146,14 @@ int comboBox::findText( const QString & _txt ) const -void comboBox::setCurrentIndex( int _idx ) +void comboBox::setValue( const int _idx ) { - m_currentIndex = tLimit( _idx, 0, ( m_items.size() > 0 ) ? - m_items.size() - 1 : 0 ); - emit( currentIndexChanged( m_currentIndex ) ); + automatableObject::setValue( _idx ); +/* m_value = tLimit( _idx, 0, ( m_items.size() > 0 ) ? + m_items.size() - 1 : 0 );*/ + emit( valueChanged( value() ) ); emit( activated( ( m_items.size() > 0 ) ? - m_items[m_currentIndex].first : "" ) ); + m_items[value()].first : "" ) ); update(); } @@ -180,11 +182,11 @@ void comboBox::mousePressEvent( QMouseEvent * _me ) } else if( _me->button() == Qt::LeftButton ) { - setCurrentIndex( currentIndex() + 1 ); + setValue( value() + 1 ); } else if( _me->button() == Qt::RightButton ) { - setCurrentIndex( currentIndex() - 1 ); + setValue( value() - 1 ); } } @@ -235,7 +237,7 @@ void comboBox::paintEvent( QPaintEvent * _pe ) p.setFont( font() ); p.setClipRect( QRect( 5, 2, width() - CB_ARROW_BTN_WIDTH - 8, height() - 2 ) ); - const QPixmap & item_pm = m_items[currentIndex()].second; + const QPixmap & item_pm = m_items[value()].second; int tx = 4; if( item_pm.isNull() == FALSE ) { @@ -244,10 +246,10 @@ void comboBox::paintEvent( QPaintEvent * _pe ) } p.setPen( QColor( 64, 64, 64 ) ); p.drawText( tx+1, p.fontMetrics().height()+1, - m_items[currentIndex()].first ); + m_items[value()].first ); p.setPen( QColor( 224, 224, 224 ) ); p.drawText( tx, p.fontMetrics().height(), - m_items[currentIndex()].first ); + m_items[value()].first ); } #ifdef QT3 @@ -261,7 +263,7 @@ void comboBox::paintEvent( QPaintEvent * _pe ) void comboBox::wheelEvent( QWheelEvent * _we ) { - setCurrentIndex( currentIndex() + ( ( _we->delta() < 0 ) ? 1 : -1 ) ); + setValue( value() + ( ( _we->delta() < 0 ) ? 1 : -1 ) ); _we->accept(); } @@ -271,7 +273,7 @@ void comboBox::wheelEvent( QWheelEvent * _we ) void comboBox::setItem( QAction * _item ) { - setCurrentIndex( findText( _item->text() ) ); + setValue( findText( _item->text() ) ); } @@ -288,7 +290,7 @@ void comboBox::setItem( QAction * ) void comboBox::setItem( int _item ) { - setCurrentIndex( _item ); + setValue( _item ); } diff --git a/src/widgets/group_box.cpp b/src/widgets/group_box.cpp index 2d5ed2041b..73d4ba8fde 100644 --- a/src/widgets/group_box.cpp +++ b/src/widgets/group_box.cpp @@ -39,8 +39,6 @@ #include #include -#define setChecked setOn - #endif #ifndef __USE_XOPEN @@ -59,8 +57,10 @@ QPixmap * groupBox::s_ledBg = NULL; -groupBox::groupBox( const QString & _caption, QWidget * _parent ) : +groupBox::groupBox( const QString & _caption, QWidget * _parent, + engine * _engine ) : QWidget( _parent ), + engineObject( _engine ), m_caption( _caption ), m_origHeight( height() ), m_animating( FALSE ) @@ -73,7 +73,7 @@ groupBox::groupBox( const QString & _caption, QWidget * _parent ) : updatePixmap(); - m_led = new pixmapButton( this ); + m_led = new pixmapButton( this, eng() ); m_led->move( 2, 3 ); m_led->setActiveGraphic( embed::getIconPixmap( "led_green" ) ); m_led->setInactiveGraphic( embed::getIconPixmap( "led_off" ) ); @@ -238,8 +238,6 @@ void groupBox::updatePixmap( void ) -#undef setChecked - #include "group_box.moc" diff --git a/src/widgets/knob.cpp b/src/widgets/knob.cpp index 5e2db4c402..c62c37b549 100644 --- a/src/widgets/knob.cpp +++ b/src/widgets/knob.cpp @@ -68,7 +68,6 @@ #include #include "knob.h" -#include "song_editor.h" /*#include "midi_client.h"*/ #include "embed.h" #include "spc_bg_hndl_widget.h" @@ -95,8 +94,7 @@ knob::knob( int _knob_num, QWidget * _parent, const QString & _name, , _name.ascii() #endif ), - engineObject( _engine ), - automatableObject(), + automatableObject( _engine ), m_mouseOffset( 0.0f ), m_buttonPressed( FALSE ), m_angle( 0.0f ), @@ -413,6 +411,9 @@ void knob::mousePressEvent( QMouseEvent * _me ) if( _me->button() == Qt::LeftButton && eng()->getMainWindow()->isCtrlPressed() == FALSE ) { + setStepRecording( FALSE ); + m_oldValue = value(); + const QPoint & p = _me->pos(); m_origMousePos = p; @@ -464,7 +465,6 @@ void knob::mouseMoveEvent( QMouseEvent * _me ) { QCursor::setPos( mapToGlobal( m_origMousePos ) ); } - eng()->getSongEditor()->setModified(); } s_textFloat->setText( m_hintTextBeforeValue + @@ -478,6 +478,9 @@ void knob::mouseMoveEvent( QMouseEvent * _me ) //! Mouse Release Event handler void knob::mouseReleaseEvent( QMouseEvent * /* _me*/ ) { + setStepRecording( TRUE ); + addStepFromOldToCurVal(); + if( m_buttonPressed ) { m_buttonPressed = TRUE; @@ -560,7 +563,6 @@ void knob::wheelEvent( QWheelEvent * _we ) _we->accept(); const int inc = ( _we->delta() > 0 ) ? 1 : -1; incValue( inc ); - eng()->getSongEditor()->setModified(); s_textFloat->reparent( this ); @@ -730,7 +732,6 @@ void knob::setStep( float _vstep ) void knob::reset( void ) { setValue( m_initValue ); - eng()->getSongEditor()->setModified(); s_textFloat->reparent( this ); s_textFloat->setText( m_hintTextBeforeValue + QString::number( value() ) + @@ -754,7 +755,6 @@ void knob::copyValue( void ) void knob::pasteValue( void ) { setValue( s_copiedValue ); - eng()->getSongEditor()->setModified(); s_textFloat->reparent( this ); s_textFloat->setText( m_hintTextBeforeValue + QString::number( value() ) + diff --git a/src/widgets/lcd_spinbox.cpp b/src/widgets/lcd_spinbox.cpp index 1424edcecb..3691149c84 100644 --- a/src/widgets/lcd_spinbox.cpp +++ b/src/widgets/lcd_spinbox.cpp @@ -49,9 +49,9 @@ lcdSpinBox::lcdSpinBox( int _min, int _max, int _num_digits, - QWidget * _parent ) : + QWidget * _parent, engine * _engine ) : QWidget( _parent ), - automatableObject( 0, _min, _max ), + automatableObject( _engine, 0, _min, _max ), m_label( NULL ), m_origMousePos() { @@ -62,7 +62,7 @@ lcdSpinBox::lcdSpinBox( int _min, int _max, int _num_digits, setEnabled( TRUE ); // value is automatically limited to given range - setValue( 0 ); + setInitValue( 0 ); m_number->setFixedSize( m_number->sizeHint() * 0.9 ); setFixedSize( m_number->size() ); @@ -152,6 +152,7 @@ void lcdSpinBox::mousePressEvent( QMouseEvent * _me ) { m_origMousePos = _me->globalPos(); QApplication::setOverrideCursor( Qt::BlankCursor ); + m_oldValue = value(); } } @@ -169,8 +170,10 @@ void lcdSpinBox::mouseMoveEvent( QMouseEvent * _me ) int dy = _me->globalY() - m_origMousePos.y(); if( dy > 1 || dy < -1 ) { - setValue( value() - dy / 2 * step() ); + setStepRecording( FALSE );// why is this neccessary?! + setInitValue( value() - dy / 2 * step() ); emit valueChanged( value() ); + setStepRecording( TRUE ); QCursor::setPos( m_origMousePos ); } } @@ -181,6 +184,8 @@ void lcdSpinBox::mouseMoveEvent( QMouseEvent * _me ) void lcdSpinBox::mouseReleaseEvent( QMouseEvent * _me ) { + addStepFromOldToCurVal(); + QCursor::setPos( m_origMousePos ); QApplication::restoreOverrideCursor(); } diff --git a/src/widgets/led_checkbox.cpp b/src/widgets/led_checkbox.cpp index d59c4965fb..4400ba4e67 100644 --- a/src/widgets/led_checkbox.cpp +++ b/src/widgets/led_checkbox.cpp @@ -55,11 +55,12 @@ static const QString names[ledCheckBox::TOTAL_COLORS] = ledCheckBox::ledCheckBox( const QString & _text, QWidget * _parent, - ledColors _color ) : - QWidget( _parent ), - automatableObject( FALSE, TRUE, FALSE ), + engine * _engine, ledColors _color ) : + automatableButton( _parent, _engine ), m_text( _text ) { + setToggleButton( TRUE ); + if( _color >= TOTAL_COLORS || _color < YELLOW ) { _color = YELLOW; @@ -93,42 +94,6 @@ ledCheckBox::~ledCheckBox() -void ledCheckBox::mousePressEvent( QMouseEvent * _me ) -{ - if( _me->button() == Qt::LeftButton ) - { - toggle(); - } -} - - - - -void ledCheckBox::toggle( void ) -{ - setValue( !value() ); - update(); - emit( toggled( value() ) ); -} - - - - -void ledCheckBox::setChecked( bool _on ) -{ - if( _on != isChecked() ) - { - toggle(); - } - else - { - emit( toggled( value() ) ); - } -} - - - - void ledCheckBox::paintEvent( QPaintEvent * ) { #ifdef QT4 diff --git a/src/widgets/pixmap_button.cpp b/src/widgets/pixmap_button.cpp index 2e7ffbad7c..a8450d6d17 100644 --- a/src/widgets/pixmap_button.cpp +++ b/src/widgets/pixmap_button.cpp @@ -45,11 +45,11 @@ -pixmapButton::pixmapButton( QWidget * _parent ) : - QPushButton( _parent ), - m_activePixmap( NULL ), - m_inactivePixmap( NULL ), - m_bgPixmap( NULL ) +pixmapButton::pixmapButton( QWidget * _parent, engine * _engine ) : + automatableButton( _parent, _engine ), + m_activePixmap(), + m_inactivePixmap(), + m_bgPixmap() { setActiveGraphic( embed::getIconPixmap( "led_yellow" ) ); setInactiveGraphic( embed::getIconPixmap( "led_off" ), FALSE ); @@ -58,7 +58,7 @@ pixmapButton::pixmapButton( QWidget * _parent ) : setBackgroundMode( Qt::NoBackground ); #endif - setCheckable( TRUE ); + //setCheckable( TRUE ); } @@ -66,9 +66,6 @@ pixmapButton::pixmapButton( QWidget * _parent ) : pixmapButton::~pixmapButton() { - delete m_activePixmap; - delete m_inactivePixmap; - delete m_bgPixmap; } @@ -85,25 +82,23 @@ void pixmapButton::paintEvent( QPaintEvent * ) QPainter p( &draw_pm, this ); #endif - if( m_bgPixmap != NULL ) + if( !m_bgPixmap.isNull() ) { - p.drawPixmap( 0, 0, *m_bgPixmap ); + p.drawPixmap( 0, 0, m_bgPixmap ); } - if( isChecked() || isDown() ) + if( isChecked() ) { - if( m_activePixmap != NULL ) + if( !m_activePixmap.isNull() ) { - p.drawPixmap( 0, 0, *m_activePixmap ); + p.drawPixmap( 0, 0, m_activePixmap ); } } - else + else if( !m_inactivePixmap.isNull() ) { - if( m_inactivePixmap != NULL ) - { - p.drawPixmap( 0, 0, *m_inactivePixmap ); - } + p.drawPixmap( 0, 0, m_inactivePixmap ); } + #ifndef QT4 // and blit all the drawn stuff on the screen... bitBlt( this, rect().topLeft(), &draw_pm ); @@ -114,24 +109,26 @@ void pixmapButton::paintEvent( QPaintEvent * ) -void pixmapButton::mousePressEvent( QMouseEvent * _me) +void pixmapButton::mousePressEvent( QMouseEvent * _me ) { if( _me->button() == Qt::RightButton ) { emit( clickedRight() ); + _me->accept(); } else { - QPushButton::mousePressEvent( _me ); + automatableButton::mousePressEvent( _me ); } } -void pixmapButton::mouseDoubleClickEvent( QMouseEvent * ) +void pixmapButton::mouseDoubleClickEvent( QMouseEvent * _me ) { emit doubleClicked(); + _me->accept(); } @@ -139,10 +136,8 @@ void pixmapButton::mouseDoubleClickEvent( QMouseEvent * ) void pixmapButton::setActiveGraphic( const QPixmap & _pm ) { - delete m_activePixmap; - - m_activePixmap = new QPixmap( _pm ); - resize( m_activePixmap->width(), m_activePixmap->height() ); + m_activePixmap = _pm; + resize( m_activePixmap.width(), m_activePixmap.height() ); } @@ -150,9 +145,7 @@ void pixmapButton::setActiveGraphic( const QPixmap & _pm ) void pixmapButton::setInactiveGraphic( const QPixmap & _pm, bool _update ) { - delete m_inactivePixmap; - - m_inactivePixmap = new QPixmap( _pm ); + m_inactivePixmap = _pm; if( _update ) { update(); @@ -164,9 +157,7 @@ void pixmapButton::setInactiveGraphic( const QPixmap & _pm, bool _update ) void pixmapButton::setBgGraphic( const QPixmap & _pm ) { - delete m_bgPixmap; - - m_bgPixmap = new QPixmap( _pm ); + m_bgPixmap = _pm; } diff --git a/src/widgets/project_notes.cpp b/src/widgets/project_notes.cpp index 1595755a98..c7bc24e7c5 100644 --- a/src/widgets/project_notes.cpp +++ b/src/widgets/project_notes.cpp @@ -573,8 +573,11 @@ void projectNotes::alignmentChanged( int _a ) void projectNotes::saveSettings( QDomDocument & _doc, QDomElement & _parent ) { QDomElement pn_de = _doc.createElement( nodeName() ); + mainWindow::saveWidgetState( this, pn_de ); + QDomCDATASection ds = _doc.createCDATASection( m_edit->toHtml() ); pn_de.appendChild( ds ); + _parent.appendChild( pn_de ); } @@ -583,6 +586,7 @@ void projectNotes::saveSettings( QDomDocument & _doc, QDomElement & _parent ) void projectNotes::loadSettings( const QDomElement & _this ) { + mainWindow::restoreWidgetState( this, _this ); m_edit->setHtml( _this.text() ); }