From 4804108a1dbb6242f8e5a675a9a413f3bd710284 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Mon, 9 Jan 2006 10:31:28 +0000 Subject: [PATCH] bugfixes and some small new features git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@45 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 326 +++++++++++++++++++++++++ configure.in | 5 + include/arp_and_chords_tab_widget.h | 5 +- include/audio_device.h | 4 +- include/config_mgr.h | 77 +++--- include/midi_client.h | 4 +- include/mixer.h | 7 +- include/note.h | 13 +- include/note_play_handle.h | 17 ++ include/piano_roll.h | 8 +- include/piano_widget.h | 10 +- include/play_handle.h | 3 +- include/qt3support.h | 1 + include/setup_dialog.h | 16 ++ include/tempo_sync_knob.h | 2 +- plugins/vestige/vestige.cpp | 2 +- resources/setup_directories.png | Bin 0 -> 2143 bytes src/core/arp_and_chords_tab_widget.cpp | 135 +++++++--- src/core/config_mgr.cpp | 69 +++--- src/core/note_play_handle.cpp | 72 ++++++ src/core/piano_roll.cpp | 88 ++++++- src/core/piano_widget.cpp | 4 +- src/core/setup_dialog.cpp | 133 +++++++++- src/tracks/pattern.cpp | 18 +- src/widgets/led_checkbox.cpp | 4 +- src/widgets/tempo_sync_knob.cpp | 16 +- 26 files changed, 896 insertions(+), 143 deletions(-) create mode 100644 resources/setup_directories.png diff --git a/ChangeLog b/ChangeLog index a27a61a2a..5054910e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,50 @@ +2006-01-08 Tobias Doerffel + + * include/piano_roll.h: + * src/core/piano_roll.cpp: + * src/tracks/pattern.cpp: + simple support for editing (existing) steps in piano-roll, e.g. for + changing key of a step + + * plugins/vestige/vestige.cpp: + per default switch to users VST-plugin-directory when opening plugin + + * include/config_mgr.h: + * include/setup_dialog.h: + * src/core/config_mgr.cpp: + * src/core/setup_dialog.cpp: + added possibility to setup working-directory and location of VST-plugins + + * src/widgets/tempo_sync_knob.cpp: + removed a lot of obsolete #include's + + * include/piano_widget.h: + * src/core/note_play_handle.cpp: + * src/core/piano_widget.cpp: + display played keys as if they were pressed + + * include/arp_and_chords_tab_widget.h: + * include/note_play_handle.h: + * src/core/arp_and_chords_tab_widget.cpp: + * src/core/note_play_handle.cpp: + added sort-mode for more powerful arpeggios + + * src/core/arp_and_chords_tab_widget.cpp: + fixed bug which made the arpeggiator skipping notes sometimes at + certain arpeggio-times + + * src/core/lmms_main_win.cpp: + commented out code for creating effect-board-window + + * src/core/channel_track.cpp: + 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 + + * locale/it.ts: + added Italian translation + 2006-01-02 Tobias Doerffel * plugins/vestige/vestige.cpp: @@ -275,6 +322,285 @@ * configure.in: made 0.1.2 release +======= +2006-01-02 Tobias Doerffel + + * plugins/vestige/vestige.cpp: + set vestige-logo as window-icon of plugin-GUI-window + + * src/core/instrument.cpp: + set logo of plugin as window-icon of channel-track + + * include/dummy_instrument.h: + * include/dummy_plugin.h: + * include/instrument.h: + * include/plugin.h: + * src/core/instrument.cpp: + * src/core/plugin.cpp: + small changes in plugin-API: plugin now always has to pass pointer to + plugin-descriptor to plugin-dtor to make the latter one able to + provide several information + + * src/core/plugin.cpp: + search for plugin-libs in configManager::pluginDir() which is + $prefix/lib/lmms - hopefully solves problems with finding plugins on + some systems + + * include/channel_track.h: + * include/midi_tab_widget.h: + * src/core/midi_tab_widget.cpp: + * src/tracks/channel_track.cpp: + when using Raw-MIDI-client, make items "MIDI input/output" checkable + and enable/disable MIDI-input/output accordingly if user + checked/unchecked it and update check-state if user changed MIDI-mode + in midi-tab-widget in channel-track + + * src/core/midi_tab_widget.cpp: + set MIDI-output-channel to 1 per default + + * src/lib/sample_buffer.cpp: + added flac-files to filter of file-selection-dialog + + * include/note_play_handle.h: + * src/core/note_play_handle.cpp: + 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 + + * src/core/track.cpp: + added tooltip to track-op-widget telling the user something about + drag'n'drop-functionality... + + * include/lmms_main_win.h: + * src/core/lmms_main_win.cpp: + * src/lib/string_pair_drag.cpp: + if main-window looses focus or a drag is completed, clear + key-modifiers of LMMS-main-window, because we might have lost + key-release-events in these cases and therefore our modifier-state-map + could be incorrect - fixes several bugs concerning drag'n'drop + + * README: + * src/core/about_dialog.cpp: + extended copyright from 2005 to 2006 - Happy New Year! + +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 + + * include/track.h: + * include/track_container.h: + * src/core/track.cpp: + * src/core/track_container.cpp: + revised all the things around track-operations: + - tracks are now directly movable via the grip at the beginning of a + track - replaces "move up/down"-buttons and is much more usable + - actions (clone/delete track) are now part of a popup-menu + + * src/core/lmms_main_win.cpp: + - corrected file-description at the beginning + - add space at left side before adding tool-buttons + + * src/core/midi_tab_widget.cpp: + use smaller font for connection-selection-menu + +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 + + * plugins/vestige/communication.h: + * plugins/vestige/fstclient.cpp: + * plugins/vestige/fstclient.h: + * plugins/vestige/fstserver.cpp: + * plugins/vestige/vestige.cpp: + * plugins/vestige/vestige.h: + - support for telling plugin current BPM, also catches BPM-changes + - handle plugins without GUI correctly + + * include/tool_button.h: + * src/widgets/tool_button.cpp: + catch toggle-signals to emit clicked()-signal which is neccessary if a + button is checked using setChecked()-method and not by the user - + fixes some bugs with piano-roll + + * include/piano_roll.h: + * src/core/piano_roll.cpp: + - show text-float after user copied notes + - do not play note when just moving selection + - when update()ing paint everything in a pixmap which is painted in + paintEvent() - saves all the repaints everytime mouse-cursor is moved + and makes painting tool-cursor possible again + + * src/tracks/channel_track.cpp: + corrected calculation in channelTrack::masterKey() + +2005-12-27 Tobias Doerffel + + * include/piano_roll.h: + * src/core/piano_roll.cpp: + always reset cursor when receiving leave-event + + * include/channel_track.h: + * src/tracks/channel_track.cpp: + use new fade-button as MIDI-event-indicator as well as simple + play-default-tone-button + + * include/fade_button.h: + * src/widgets/fade_button.cpp: + added fade-button which can be activated and fades back to + default-color afterwards + + * src/core/arp_and_chords_tab_widget.cpp: + * src/core/envelope_and_lfo_widget.cpp: + * src/core/envelope_tab_widget.cpp: + * src/core/midi_tab_widget.cpp: + * src/core/note.cpp: + * src/core/song_editor.cpp: + * src/core/track.cpp: + * src/tracks/bb_track.cpp: + * src/tracks/channel_track.cpp: + * src/tracks/sample_track.cpp: + do not use QString::number() for saving scalar value with + setAttribute() as it is obsolete + + * src/audio/audio_alsa.cpp: + * src/audio/audio_oss.cpp: + start audio-thread with QThread::HightestPriority for having less xruns + + * src/tracks/pattern.cpp: + save m_steps-property, otherwise restoring it in loadSettings() makes + no sense... - fixes bug which caused LMMS to always reset number of + steps to 16 when loading files, even if the user created patterns + containing more than 16 steps + + * include/audio_dummy.h: + - fixed missing implementation of thread running the whole time and + calling audioDevice::processNextBuffer() -> fixes bugs & lockups when + using audio-dummy-driver + - thread now always waits the amount of time that is left for the + 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 + + * plugins/vestige/vestige.cpp: + determine real key of note using channelTrack::masterKey + + * include/micro_timer.h: + moved micro-timer-class from mixer.cpp in separate header for being + available to all modules of LMMS + + * src/core/mixer.cpp: + added metronome-sounds when recording in piano-roll + + * src/lib/sample_buffer.cpp: + - added resample()-method for resampling whole sample-buffer + - after libsndfile try to load sample with libvorbis instead of + SDL_sound as the latter one seems to be buggy on few systems and + leads to unexpected crashes + - if sample-decoder doesn't resample sample automatically, do it + afterwards using resample() + + * src/core/track_container.cpp: + accept drops of type samplefile and sampledata too and create new + channel-track with AudioFileProcessor + + * plugins/audio_file_processor/audio_file_processor.cpp: + save/load sample-data which was dragged on plugin in settings + + * src/core/track.cpp: + display correct length and now additionally start- and end-position of + track-content-object + + * include/bb_track.h: + * src/tracks/bb_track.cpp: + 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 + + * src/widgets/visualization_widget.cpp: + enable visualization-widget per default + + * plugins/vestige/vestige.cpp: + - do not crash when loading settings with empty plugin-attribute (e.g. + older projects/presets) + - set channel-name according to plugin-name + - added note-off-button for being able to note off hanging notes + (which sometimes occurs in combination with arpeggios) + +2005-12-24 Tobias Doerffel + + * plugins/vestige/vestige.cpp: + use new parameter-saving/loading-feature when saving/loading settings + + * plugins/vestige/communication.h: + * plugins/vestige/fstclient.cpp: + * plugins/vestige/fstclient.h: + * plugins/vestige/fstserver.cpp: + * plugins/vestige/fstserver.h: + * plugins/vestige/fstcore.c: + - added support for saving/loading parameters which almost completes + LMMS's rudimentary VST-support + - support for querying parameter-properties + - some changes in initialization of plugin + + * src/tracks/pattern.cpp: + pass unused wheel-events to trackContentObect for being able to scroll + within song-editor + +2005-12-23 Tobias Doerffel + + * plugins/vestige/fstcore.c: + a lot of clean-ups and other bug-fixes making VeSTige almost usable + and stable + + * plugins/vestige/fstclient.h: + * plugins/vestige/fstclient.cpp: + save PID of children when fork()ing XFST-server which is used for + sending SIGTERM when destroying everything + + * plugins/vestige/communication.h: + * plugins/vestige/fstclient.cpp: + * plugins/vestige/fstserver.cpp: + * plugins/vestige/fstcore.c: + do not show editor until client created x11-embed-widget - solves + problems with not-embedded plugins under KDE + + * plugins/vestige/fstserver.cpp: + rewrote MIDI-enqueueing-code as the old one was very buggy and + unreliable + + * plugins/vestige/vestige.h: + * plugins/vestige/vestige.cpp: + added mutex for plugin which solves some problems + + * include/mixer.h: + * src/core/mixer.cpp: + per default clear all play-handles but instrument-play-handles in + mixer::clear() as instrument-playhandles normally exist during the + whole life-time of a certain plugin and must not be deleted when just + stopping song etc. + + * include/play_handle.h: + added type-information, so every derived class has to pass a + type-constant to playHandle-constructor + +2005-12-22 Tobias Doerffel + + * configure.in: + made 0.1.2 release + +>>>>>>> 1.27 2005-12-21 Tobias Doerffel * src/lib/sample_buffer.cpp: diff --git a/configure.in b/configure.in index 3d56e0004..9b3006b33 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,13 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) +<<<<<<< configure.in +AC_INIT(lmms, 0.1.2-cvs20060108, tobydox/at/users.sourceforge.net) +AM_INIT_AUTOMAKE(lmms, 0.1.2-cvs20060108) +======= AC_INIT(lmms, 0.1.2-cvs20060102, tobydox/at/users.sourceforge.net) AM_INIT_AUTOMAKE(lmms, 0.1.2-cvs20060102) +>>>>>>> 1.26 AM_CONFIG_HEADER(config.h) diff --git a/include/arp_and_chords_tab_widget.h b/include/arp_and_chords_tab_widget.h index 317c2eb12..21c55bf8e 100644 --- a/include/arp_and_chords_tab_widget.h +++ b/include/arp_and_chords_tab_widget.h @@ -2,7 +2,7 @@ * arp_and_chords_tab_widget.h - declaration of class arpAndChordWidget which * provides code for using arpeggio and chords * - * Copyright (c) 2004-2005 Tobias Doerffel + * Copyright (c) 2004-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -53,6 +53,7 @@ class QPixmap; class channelTrack; class groupBox; class knob; +class ledCheckBox; class notePlayHandle; class pixmapButton; class tempoSyncKnob; @@ -132,6 +133,8 @@ private: pixmapButton * m_arpUpAndDownBtn; pixmapButton * m_arpRandomBtn; + ledCheckBox * m_sortMode; + } ; diff --git a/include/audio_device.h b/include/audio_device.h index 4713a903e..2b05967b1 100644 --- a/include/audio_device.h +++ b/include/audio_device.h @@ -1,7 +1,7 @@ /* * audio_device.h - base-class for audio-devices, used by LMMS-mixer * - * Copyright (c) 2004-2005 Tobias Doerffel + * Copyright (c) 2004-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -112,7 +112,7 @@ public: public: setupWidget( const QString & _caption, QWidget * _parent ) : tabWidget( tabWidget::tr( "Settings for %1" ).arg( - _caption ), _parent ) + _caption ).toUpper(), _parent ) { } diff --git a/include/config_mgr.h b/include/config_mgr.h index c3ec92666..86f71c788 100644 --- a/include/config_mgr.h +++ b/include/config_mgr.h @@ -1,7 +1,7 @@ /* * config_mgr.h - class configManager, a class for managing LMMS-configuration * - * Copyright (c) 2005 Tobias Doerffel + * Copyright (c) 2005-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -82,35 +82,45 @@ public: return( s_instanceOfMe ); } - const QString & lmmsWorkingDir( void ) const + const QString & workingDir( void ) const { - return( m_lmmsWorkingDir ); - } - QString projectsDir( void ) const - { - return( m_lmmsWorkingDir + PROJECTS_PATH ); - } - QString presetsDir( void ) const - { - return( m_lmmsWorkingDir + PRESETS_PATH ); - } - QString samplesDir( void ) const - { - return( m_lmmsWorkingDir + SAMPLES_PATH ); - } - QString artworkDir( void ) const - { - return( m_lmmsDataDir + ARTWORK_PATH ); - } - QString localeDir( void ) const - { - return( m_lmmsDataDir + LOCALE_PATH ); - } - const QString & pluginDir( void ) const - { - return( m_lmmsPluginDir ); + return( m_workingDir ); } + QString projectsDir( void ) const + { + return( m_workingDir + PROJECTS_PATH ); + } + + QString presetsDir( void ) const + { + return( m_workingDir + PRESETS_PATH ); + } + + QString samplesDir( void ) const + { + return( m_workingDir + SAMPLES_PATH ); + } + + QString artworkDir( void ) const + { + return( m_dataDir + ARTWORK_PATH ); + } + + QString localeDir( void ) const + { + return( m_dataDir + LOCALE_PATH ); + } + + const QString & pluginDir( void ) const + { + return( m_pluginDir ); + } + + const QString & vstDir( void ) const + { + return( m_vstDir ); + } const QString & value( const QString & _class, const QString & _attribute ) const; @@ -121,9 +131,13 @@ public: void saveConfigFile( void ); +public slots: + void setWorkingDir( const QString & _wd ); + void setVSTDir( const QString & _wd ); + + protected slots: void openWorkingDir( void ); - void setWorkingDir( const QString & _wd ); virtual void accept( void ); @@ -152,9 +166,10 @@ private: const QString m_lmmsRcFile; - QString m_lmmsWorkingDir; - QString m_lmmsDataDir; - QString m_lmmsPluginDir; + QString m_workingDir; + QString m_dataDir; + QString m_pluginDir; + QString m_vstDir; typedef vvector > stringPairVector; typedef QMap settingsMap; diff --git a/include/midi_client.h b/include/midi_client.h index 2a5f670ad..fbd3d9c64 100644 --- a/include/midi_client.h +++ b/include/midi_client.h @@ -1,7 +1,7 @@ /* * midi_client.h - base-class for MIDI-clients like ALSA-sequencer-client * - * Copyright (c) 2005 Tobias Doerffel + * Copyright (c) 2005-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -116,7 +116,7 @@ public: public: setupWidget( const QString & _caption, QWidget * _parent ) : tabWidget( tabWidget::tr( "Settings for %1" ).arg( - _caption ), _parent ) + _caption ).toUpper(), _parent ) { } diff --git a/include/mixer.h b/include/mixer.h index 89ad76ee5..f43796595 100644 --- a/include/mixer.h +++ b/include/mixer.h @@ -1,7 +1,7 @@ /* * mixer.h - audio-device-independent mixer for LMMS * - * Copyright (c) 2004-2005 Tobias Doerffel + * Copyright (c) 2004-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -196,6 +196,11 @@ public: m_playHandlesToRemove.push_back( _ph ); } + inline const playHandleVector & playHandles( void ) const + { + return( m_playHandles ); + } + void checkValidityOfPlayHandles( void ); diff --git a/include/note.h b/include/note.h index 1ef6bab8c..a236716d7 100644 --- a/include/note.h +++ b/include/note.h @@ -2,7 +2,7 @@ * note.h - declaration of class note which contains all informations about a * note + definitions of several constants and enums * - * Copyright (c) 2004-2005 Tobias Doerffel + * Copyright (c) 2004-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -96,7 +96,9 @@ public: tones _tone = A, octaves _octave = DEFAULT_OCTAVE, volume _volume = DEFAULT_VOLUME, panning _panning = DEFAULT_PANNING ) FASTCALL; + ~note(); + void FASTCALL setLength( const midiTime & _length ); void FASTCALL setPos( const midiTime & _pos ); void FASTCALL setTone( tones _tone = C ); @@ -104,38 +106,47 @@ public: void FASTCALL setKey( int _key ); void FASTCALL setVolume( volume _volume = DEFAULT_VOLUME ); void FASTCALL setPanning( panning _panning = DEFAULT_PANNING ); + inline midiTime endPos( void ) const { return( m_pos + m_length); } + inline const midiTime & length( void ) const { return( m_length ); } + inline const midiTime & pos( void ) const { return( m_pos ); } + inline midiTime pos( midiTime _base_pos ) const { return( m_pos - _base_pos ); } + inline tones tone( void ) const { return( m_tone ); } + inline octaves octave( void ) const { return( m_octave ); } + inline int key( void ) const { return( m_octave * NOTES_PER_OCTAVE + m_tone ); } + inline volume getVolume( void ) const { return( m_volume ); } + inline panning getPanning( void ) const { return( m_panning ); diff --git a/include/note_play_handle.h b/include/note_play_handle.h index 5f45f44cc..b4802161f 100644 --- a/include/note_play_handle.h +++ b/include/note_play_handle.h @@ -38,6 +38,7 @@ class channelTrack; class notePlayHandle; typedef vvector notePlayHandleVector; +typedef vvector constNotePlayHandleVector; class notePlayHandle : public playHandle, public note @@ -138,6 +139,11 @@ public: return( m_arpNote ); } + inline void setArpNote( bool _on ) + { + m_arpNote = _on; + } + // returns whether note is base-note for arpeggio inline bool arpBaseNote( void ) const { @@ -151,6 +157,17 @@ public: void mute( void ); + // returns index of note-play-handle in vector of note-play-handles + // belonging to this channel + int index( void ) const; + + // note-play-handles belonging to given channel + static constNotePlayHandleVector nphsOfChannelTrack( + const channelTrack * _ct ); + + // return whether given note-play-handle is equal to *this + bool operator==( const notePlayHandle & _nph ) const; + private: channelTrack * m_channelTrack; // needed for calling diff --git a/include/piano_roll.h b/include/piano_roll.h index 88c2feda9..a9d253cc3 100644 --- a/include/piano_roll.h +++ b/include/piano_roll.h @@ -2,7 +2,7 @@ * piano_roll.h - declaration of class pianoRoll which is a window where you * can set and edit notes in an easy way * - * Copyright (c) 2004-2005 Tobias Doerffel + * Copyright (c) 2004-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -108,8 +108,10 @@ protected: virtual void wheelEvent( QWheelEvent * _we ); int FASTCALL getKey( int _y ); - inline void drawNoteRect( QPainter & _p, Uint16 _x, Uint16 _y, - Sint16 _width, bool _is_selected ); + static inline void drawNoteRect( QPainter & _p, Uint16 _x, Uint16 _y, + Sint16 _width, + const bool _is_selected, + const bool _is_step_note ); void removeSelection( void ); void selectAll( void ); void FASTCALL getSelectedNotes( noteVector & _selected_notes ); diff --git a/include/piano_widget.h b/include/piano_widget.h index b69376944..4acdb0188 100644 --- a/include/piano_widget.h +++ b/include/piano_widget.h @@ -2,7 +2,7 @@ * piano_widget.h - declaration of class pianoWidget, a widget which provides * an interactive piano/keyboard-widget * - * Copyright (c) 2004-2005 Tobias Doerffel + * Copyright (c) 2004-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -45,6 +45,7 @@ #include "note.h" +#include "templates.h" class channelTrack; @@ -65,6 +66,13 @@ public: pianoWidget( channelTrack * _channel_track ); virtual ~pianoWidget(); + inline void setKeyState( int _key, bool _on = FALSE ) + { + m_pressedKeys[tLimit( _key, 0, NOTES_PER_OCTAVE * + OCTAVES -1 )] = _on; + update(); + } + protected: virtual void paintEvent( QPaintEvent * ); diff --git a/include/play_handle.h b/include/play_handle.h index 8a6b05f44..230e40123 100644 --- a/include/play_handle.h +++ b/include/play_handle.h @@ -2,7 +2,7 @@ * play_handle.h - base-class playHandle which is needed by * LMMS-Player-Engine * - * Copyright (c) 2004-2005 Tobias Doerffel + * Copyright (c) 2004-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -87,6 +87,7 @@ private: typedef vvector playHandleVector; +typedef vvector constPlayHandleVector; #endif diff --git a/include/qt3support.h b/include/qt3support.h index 2d61d3f04..1b5267450 100644 --- a/include/qt3support.h +++ b/include/qt3support.h @@ -139,6 +139,7 @@ inline QString baseName( const QString & _file ) // QString #define toLower lower +#define toUpper upper // QTextEdit diff --git a/include/setup_dialog.h b/include/setup_dialog.h index e607db9d4..4bb554f04 100644 --- a/include/setup_dialog.h +++ b/include/setup_dialog.h @@ -47,6 +47,7 @@ class QComboBox; class QLabel; +class QLineEdit; class QSlider; class tabBar; @@ -75,6 +76,10 @@ private slots: void resetBufSize( void ); void displayBufSizeHelp( void ); + // directory settings widget + void setWorkingDir( const QString & _wd ); + void setVSTDir( const QString & _vd ); + // audio settings widget void audioInterfaceChanged( const QString & _driver ); void displayAudioHelp( void ); @@ -89,6 +94,10 @@ private slots: void toggleGIMPLikeWindows( bool _enabled ); + void openWorkingDir( void ); + void openVSTDir( void ); + + private: tabBar * m_tabBar; @@ -101,6 +110,13 @@ private: bool m_gimpLikeWindows; + QLineEdit * m_wdLineEdit; + QLineEdit * m_vdLineEdit; + + QString m_workingDir; + QString m_vstDir; + + typedef QMap aswMap; typedef QMap mswMap; diff --git a/include/tempo_sync_knob.h b/include/tempo_sync_knob.h index 66229ce40..45c36970e 100644 --- a/include/tempo_sync_knob.h +++ b/include/tempo_sync_knob.h @@ -1,7 +1,7 @@ /* * tempo_sync_knob.h - adds bpm to ms conversion for knob class * - * Copyright (c) 2005 Danny McRae + * Copyright (c) 2005 Danny McRae * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 2f6708c56..1004b35b1 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -388,7 +388,7 @@ void vestigeInstrument::openPlugin( void ) } else { - dir = QDir::home().path(); + dir = configManager::inst()->vstDir(); } // change dir to position of previously opened file ofd.setDirectory( dir ); diff --git a/resources/setup_directories.png b/resources/setup_directories.png new file mode 100644 index 0000000000000000000000000000000000000000..1a9dfee764cfed6aaec6ca2b978833cc7e3d4fb5 GIT binary patch literal 2143 zcmV-l2%z_gP)y?rIZp7 zRH3B`;*YWh6rgEABm`(f777t0A|zmNh_ivWIQDoO+q1uA?(HA*JehHv&G$-A^WHq2 z@7{CH_nmW}&LqcebqiLXcV4Vz#60zT`sB?2Dp>NyjZ0b^-92rs$Wy(kO~(9B3a6~Q zZsE=?p-+lexJyp`?j!(ySyaAm@m0;+b{tF|QI(f0Ikgwg8sIi};BQyn)U{*te%(Mu zJ}dc+UOXv)jiu`^p6x-5f9`*1!3wqKjb=S56ePP;aKU0+CkGHG`(xYl)ptg^hBimv zJMiga;Y=WJ)@oKZK2`O_nh#Z6Dv88KtMM&txiNI?ECJqboV9nJTasWPJrElHc;ubX z&P}}+{Pf)C=YIRlw#2BVBnq1}mMC79_~-7YG0y_vxq^m&U%GsXbEil!M1Q#DtC5A@ zA9-@4Ibui)i6l)L8(ChwxP5tNE9#7S@Y}`ptE#l)Yj9IS+PklQnWwEdP+M4JS+S&2 z5`{!!C6v#<=-B&MX9%#)TfKJ9jQqIuv4N$;DHNq8mFHAnP;-9CRB5FQD=kT53>IGN z>l!>f5#=Uu(bn7Nyf7mVc$9x}6^bM#78YqNl0;PBP^hEp(2;i2)~mf&bT10Eo#>_$ z0ABT-ci_Tlx$8Gs$7K`|$Hc_K#zq1PNrF)Zlif#lePA`p@VCECj-G}GzY{ep>!#(q zXFul=E;8SKvMhz!i06E6W`-V>3n-29iur$DZQ+h6L@0 z;}Kz)+Y44!e|LOT^8tkap_vr|Ic_FUPR5MQvE2al8ZFJ52_l@{KIPf+Ir(nS1K7H# z@|NPfbt)7Ej=%HQKjx}9huTLHLIG%9wEO?=t2`Ni@cntZPhgK*zsqq@E=1-|pcv%K z17eKDO8-JHEqfgAggn^3WX7rr(xmgerr1vj9!zY~&QwkUDiXBNIYXhs!T=ERJIQlz z3LA+%(jEt}(O2>E>{<#dFO?MsImja7jx3~|wSz)K5u%4;w|A!5X!+ErNX-haxoNq7 z&-Wso5vS5+1G3}xhL>uDHIDBc?BIG#42J_27B&jd5Tt0K6AG{xBxJb0SsR>N4jtSv zbm-^3+mYEFyjvc8tv&!oUU<9tgr(RHxiT&q+kp${qa7O^g+?J2uKOw%6@g$X3yMCz z*8E?*59I_oaChxY9WyU~I@!t6ob*&VDXIZBeHiF~!o=oB{J?RmVjio5eo9Gh#vqX+Vk?3ISAcH@+PC zP;~Qv-THL@OY|c_^Q|f^016)grs8$7LNSjPN22ppNFb0zG0=bjcj3=7KfuH4>sR}q zqbK7Mec9Y-xfMVZprPZ&iw7NvhD`_4Njc=oT+?VMk_?anJlx6jEaw3dJkHklk3Fo~ z8Iy|FKYa1^*nfv3Lo-Z2=(x}*z)KN9b}$p^@OP||3DOKRjKswqH01H#=1JcAsJlrX zI-W5)Hu2`8@3oHhx)x8<1_)!JqoL!Wf-N+X%eQd}3du1MKRn>H4ZJ9IOyt zq$A1FS(}?0wr~;sj1VDCDNAu@(-L$Bxz}v@>%dz2C+bc!^+0~PuWwW2aBKZYS%v1! zLS&|fpPgJvKNf}DKw*w^T$ntN{_N$@Gh@U$S#K(bqx)MrHpJRn>SGl(xbsSXAu-xG zpA^^N&*>;M1dp(FL+A^^kDPe^;XB;X^CL1@L*-du9PFVxY{v~Q z&6^)}H_2}&?yM*3t|iGMUkYs+INVYnFPo-$Fp;EDRPixo)Hq$KLc_rBoEG7@cT>De&U{&~G!F$aNxL{Y^i8YppuxrDcP>PYW>$-Vi+I@5!=Ohh}I53G;& z@0y{PH3*#)Ize7#5ndDlwy-L6^sdA%Vv|4VOOi)Fk8J8Z`uRCpV73ql%6N@S39^?z z3UxI_w-Y_xvG;VJ64J3q&))Fc9X-1nJc0Rmaq%WIX-c&HarkY9Cq9==W)!%BbMC+7 zz$0>-dQi + * Copyright (c) 2004-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -41,8 +41,6 @@ #include #include -#define setChecked setOn - #endif @@ -62,6 +60,7 @@ #include "gui_templates.h" #include "tempo_sync_knob.h" #include "channel_track.h" +#include "led_checkbox.h" @@ -153,9 +152,9 @@ arpAndChordsTabWidget::chord arpAndChordsTabWidget::s_chords[] = { arpAndChordsTabWidget::tr( "Diminished" ), { 0, 2, 3, 5, 6, 8, 9, 11, -1 } }, { arpAndChordsTabWidget::tr( "Major pentatonic" ), { 0, 2, 4, 7, 10, - -1 } }, + -1 } }, { arpAndChordsTabWidget::tr( "Minor pentatonic" ), { 0, 3, 5, 7, 10, - -1 } }, + -1 } }, { arpAndChordsTabWidget::tr( "Jap in sen" ), { 0, 1, 5, 7, 10, -1 } }, { arpAndChordsTabWidget::tr( "Major bebop" ), { 0, 2, 4, 5, 7, 8, 9, 11, -1 } }, @@ -164,7 +163,7 @@ arpAndChordsTabWidget::chord arpAndChordsTabWidget::s_chords[] = { arpAndChordsTabWidget::tr( "Blues" ), { 0, 3, 5, 6, 7, 10, -1 } }, { arpAndChordsTabWidget::tr( "Arabic" ), { 0, 1, 4, 5, 7, 8, 11, -1 } }, { arpAndChordsTabWidget::tr( "Enigmatic" ), { 0, 1, 4, 6, 8, 10, 11, - -1 } }, + -1 } }, { arpAndChordsTabWidget::tr( "Neopolitan" ), { 0, 1, 3, 5, 7, 9, 11, -1 } }, { arpAndChordsTabWidget::tr( "Neopolitan minor" ), { 0, 1, 3, 5, 7, 9, @@ -173,14 +172,14 @@ arpAndChordsTabWidget::chord arpAndChordsTabWidget::s_chords[] = 11, -1 } }, { arpAndChordsTabWidget::tr( "Dorian" ), { 0, 2, 3, 5, 7, 9, 10, -1 } }, { arpAndChordsTabWidget::tr( "Phrygolydian" ), { 0, 1, 3, 5, 7, 8, 10, - -1 } }, + -1 } }, { arpAndChordsTabWidget::tr( "Lydian" ), { 0, 2, 4, 6, 7, 9, 11, -1 } }, { arpAndChordsTabWidget::tr( "Mixolydian" ), { 0, 2, 4, 5, 7, 9, 10, - -1 } }, + -1 } }, { arpAndChordsTabWidget::tr( "Aeolian" ), { 0, 2, 3, 5, 7, 8, 10, - -1 } }, + -1 } }, { arpAndChordsTabWidget::tr( "Locrian" ), { 0, 1, 3, 5, 6, 8, 10, - -1 } }, + -1 } }, { "", { -1, -1 } } @@ -323,13 +322,13 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) : "can make cool staccato-arpeggios." ) ); m_arpDirectionLbl = new QLabel( tr( "DIRECTION:" ), m_arpGroupBox ); - m_arpDirectionLbl->setGeometry( 10, 70, 64, 8 ); - m_arpDirectionLbl->setFont( pointSize<6>( m_arpDirectionLbl->font() ) ); + m_arpDirectionLbl->setGeometry( 10, 60, 64, 8 ); + m_arpDirectionLbl->setFont( pointSize<7>( m_arpDirectionLbl->font() ) ); m_arpUpBtn = new pixmapButton( m_arpGroupBox ); - m_arpUpBtn->move( 70, 70 ); + m_arpUpBtn->move( 70, 60 ); m_arpUpBtn->setActiveGraphic( embed::getIconPixmap( "arp_up_on" ) ); m_arpUpBtn->setInactiveGraphic( embed::getIconPixmap( "arp_up_off" ) ); #ifdef QT4 @@ -345,7 +344,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) : SLOT( arpUpToggled( bool ) ) ); m_arpDownBtn = new pixmapButton( m_arpGroupBox ); - m_arpDownBtn->move( 90, 70 ); + m_arpDownBtn->move( 90, 60 ); m_arpDownBtn->setActiveGraphic( embed::getIconPixmap( "arp_down_on" ) ); m_arpDownBtn->setInactiveGraphic( embed::getIconPixmap( "arp_down_off" ) ); @@ -357,7 +356,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) : SLOT( arpDownToggled( bool ) ) ); m_arpUpAndDownBtn = new pixmapButton( m_arpGroupBox ); - m_arpUpAndDownBtn->move( 110, 70 ); + m_arpUpAndDownBtn->move( 110, 60 ); m_arpUpAndDownBtn->setActiveGraphic( embed::getIconPixmap( "arp_up_and_down_on" ) ); m_arpUpAndDownBtn->setInactiveGraphic( embed::getIconPixmap( @@ -371,7 +370,7 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) : SLOT( arpUpAndDownToggled( bool ) ) ); m_arpRandomBtn = new pixmapButton( m_arpGroupBox ); - m_arpRandomBtn->move( 130, 70 ); + m_arpRandomBtn->move( 130, 60 ); m_arpRandomBtn->setActiveGraphic( embed::getIconPixmap( "arp_random_on" ) ); m_arpRandomBtn->setInactiveGraphic( embed::getIconPixmap( @@ -392,6 +391,10 @@ arpAndChordsTabWidget::arpAndChordsTabWidget( channelTrack * _channel_track ) : #ifndef QT4 m_arpDirections_group->hide(); #endif + + m_sortMode = new ledCheckBox( tr( "SORT-MODE" ), m_arpGroupBox ); + m_sortMode->move( 10, 90 ); + } @@ -485,28 +488,40 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) const int selected_arp = m_arpComboBox->currentItem(); #endif + constNotePlayHandleVector cnphv = notePlayHandle::nphsOfChannelTrack( + _n->getChannelTrack() ); + // VERY unlikely, but better check this before ending in a crash + if( cnphv.size() == 0 ) + { + return; + } + const int cur_chord_size = getChordSize( s_chords[selected_arp] ); - const int total_range = (int)( cur_chord_size * - m_arpRangeKnob->value() ); + const int range = (int)( cur_chord_size * m_arpRangeKnob->value() ); + const int total_range = range * cnphv.size(); + // number of frames that every note should be played const Uint32 arp_frames = (Uint32)( m_arpTimeKnob->value() / 1000.0f * mixer::inst()->sampleRate() ); const Uint32 gated_frames = (Uint32)( m_arpGateKnob->value() * arp_frames / 100.0f ); + // 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 = _n->totalFramesPlayed() + arp_frames - 1; + int cur_frame = ( ( m_sortMode->isChecked() == TRUE ) ? + cnphv.first()->totalFramesPlayed() : + _n->totalFramesPlayed() ) + + arp_frames - 1; // used for loop Uint32 frames_processed = 0; - // len for all arp-notes (depending on arp-time) while( frames_processed < mixer::inst()->framesPerAudioBuffer() ) { const Uint32 remaining_frames_for_cur_arp = arp_frames - ( cur_frame % arp_frames ); // does current arp-note fill whole audio-buffer? - if( remaining_frames_for_cur_arp >= + if( remaining_frames_for_cur_arp > mixer::inst()->framesPerAudioBuffer() ) { // then we don't have to do something! @@ -518,36 +533,46 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) // init with zero int cur_arp_idx = 0; + if( m_sortMode->isChecked() == TRUE && + ( ( cur_frame / arp_frames ) % total_range ) / + range != (csize) _n->index() ) + { + // update counters + frames_processed += arp_frames; + cur_frame += arp_frames; + break; + } + // process according to arpeggio-direction... if( m_arpDirection == UP ) { - cur_arp_idx = ( cur_frame / arp_frames ) % total_range; + cur_arp_idx = ( cur_frame / arp_frames ) % range; } else if( m_arpDirection == DOWN ) { - cur_arp_idx = total_range - ( cur_frame / arp_frames ) % - total_range - 1; + cur_arp_idx = range - ( cur_frame / arp_frames ) % + range - 1; } - else if( m_arpDirection == UP_AND_DOWN && total_range > 1 ) + else if( m_arpDirection == UP_AND_DOWN && range > 1 ) { // imagine, we had to play the arp once up and then - // once down -> makes 2 * total_range possible notes... + // once down -> makes 2 * range possible notes... // because we don't play the lower and upper notes // twice, we have to subtract 2 cur_arp_idx = ( cur_frame / arp_frames ) % - ( total_range * 2 - 2 ); - // if greater than total_range, we have to play down... + ( range * 2 - 2 ); + // if greater than range, we have to play down... // looks like the code for arp_dir==DOWN... :) - if( cur_arp_idx >= total_range ) + if( cur_arp_idx >= range ) { - cur_arp_idx = total_range - cur_arp_idx % - ( total_range - 1 ) - 1; + cur_arp_idx = range - cur_arp_idx % + ( range - 1 ) - 1; } } else if( m_arpDirection == RANDOM ) { // just pick a random chord-index - cur_arp_idx = (int)( total_range * ( (float) rand() / + cur_arp_idx = (int)( range * ( (float) rand() / (float) RAND_MAX ) ); } @@ -584,20 +609,27 @@ void arpAndChordsTabWidget::processNote( notePlayHandle * _n ) // and is_arp_note=TRUE notePlayHandle * note_play_handle = new notePlayHandle( _n->getChannelTrack(), - _n->framesAhead() + + ( ( m_sortMode->isChecked() == TRUE ) ? + cnphv.first()->framesAhead() : + _n->framesAhead() ) + frames_processed, gated_frames, &new_note, TRUE ); - // add sub-note to base-note, now all stuff is done by - // notePlayHandle::play_note() + // add sub-note to base-note - now all stuff is done by + // notePlayHandle::playNote() _n->addSubNote( note_play_handle ); // update counters frames_processed += arp_frames; cur_frame += arp_frames; } + + // make sure, note is handled as arp-base-note, even if we didn't add a + // sub-note so far + _n->setArpNote( TRUE ); + } @@ -607,6 +639,9 @@ void arpAndChordsTabWidget::saveSettings( QDomDocument & _doc, QDomElement & _parent ) { QDomElement act_de = _doc.createElement( nodeName() ); +<<<<<<< arp_and_chords_tab_widget.cpp + act_de.setAttribute( "chorddisabled", !m_chordsGroupBox->isActive() ); +======= act_de.setAttribute( "chorddisabled", !m_chordsGroupBox->isActive() ); #ifdef QT4 act_de.setAttribute( "chord", m_chordsComboBox->currentIndex() ); @@ -615,6 +650,32 @@ void arpAndChordsTabWidget::saveSettings( QDomDocument & _doc, #endif act_de.setAttribute( "chordrange", m_chordRangeKnob->value() ); + act_de.setAttribute( "arpdisabled", !m_arpGroupBox->isActive() ); +>>>>>>> 1.11 +#ifdef QT4 +<<<<<<< arp_and_chords_tab_widget.cpp + act_de.setAttribute( "chord", m_chordsComboBox->currentIndex() ); +======= + act_de.setAttribute( "arp", m_arpComboBox->currentIndex() ); +>>>>>>> 1.11 +#else +<<<<<<< arp_and_chords_tab_widget.cpp + act_de.setAttribute( "chord", m_chordsComboBox->currentItem() ); +======= + act_de.setAttribute( "arp", m_arpComboBox->currentItem() ); +>>>>>>> 1.11 +#endif +<<<<<<< arp_and_chords_tab_widget.cpp + act_de.setAttribute( "chordrange", m_chordRangeKnob->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( "arpsyncmode", + ( int ) m_arpTimeKnob->getSyncMode() ); +>>>>>>> 1.11 + act_de.setAttribute( "arpdisabled", !m_arpGroupBox->isActive() ); #ifdef QT4 act_de.setAttribute( "arp", m_arpComboBox->currentIndex() ); @@ -628,7 +689,7 @@ void arpAndChordsTabWidget::saveSettings( QDomDocument & _doc, act_de.setAttribute( "arpsyncmode", ( int ) m_arpTimeKnob->getSyncMode() ); - + act_de.setAttribute( "sortmode", m_sortMode->isChecked() ); _parent.appendChild( act_de ); } @@ -659,6 +720,8 @@ void arpAndChordsTabWidget::loadSettings( const QDomElement & _this ) ( tempoSyncKnob::tempoSyncMode ) _this.attribute( "arpsyncmode" ).toInt() ); + m_sortMode->setChecked( _this.attribute( "sortmode" ).toInt() ); + m_arpGroupBox->setState( m_arpDirection != OFF && !_this.attribute( "arpdisabled" ).toInt() ); switch( m_arpDirection ) diff --git a/src/core/config_mgr.cpp b/src/core/config_mgr.cpp index 1562b016b..ef1fb8c3c 100644 --- a/src/core/config_mgr.cpp +++ b/src/core/config_mgr.cpp @@ -1,7 +1,7 @@ /* * config_mgr.cpp - implementation of class configManager * - * Copyright (c) 2005 Tobias Doerffel + * Copyright (c) 2005-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -59,6 +59,8 @@ #include #include +#define absolutePath absPath + #ifndef __USE_XOPEN_EXTENDED #define __USE_XOPEN_EXTENDED #endif @@ -153,31 +155,27 @@ configManager * configManager::s_instanceOfMe = NULL; configManager::configManager( void ) : QDialog(), -#ifdef QT4 m_lmmsRcFile( QDir::home().absolutePath() + "/.lmmsrc.xml" ), - m_lmmsWorkingDir( QDir::home().absolutePath() + "/lmms" ), -#else - m_lmmsRcFile( QDir::home().absPath() + "/.lmmsrc.xml" ), - m_lmmsWorkingDir( QDir::home().absPath() + "/lmms" ), -#endif + m_workingDir( QDir::home().absolutePath() + "/lmms" ), #if QT_VERSION >= 0x030200 - m_lmmsDataDir( qApp->applicationDirPath().section( '/', 0, -2 ) + + m_dataDir( qApp->applicationDirPath().section( '/', 0, -2 ) + "/share/lmms/" ), #else // hardcode since qt < 3.2 doesn't know something like // applicationDirPath and implementing own function would be senseless // since real support for qt < 3.2 is senseless too ;-) - m_lmmsDataDir( "/usr/share/lmms" ), + m_dataDir( "/usr/share/lmms" ), #endif #if QT_VERSION >= 0x030200 - m_lmmsPluginDir( qApp->applicationDirPath().section( '/', 0, -2 ) + + m_pluginDir( qApp->applicationDirPath().section( '/', 0, -2 ) + "/lib/lmms/" ), #else // hardcode since qt < 3.2 doesn't know something like // applicationDirPath and implementing own function would be senseless // since real support for qt < 3.2 is senseless too ;-) - m_lmmsPluginDir( "/usr/lib/lmms" ), + m_pluginDir( "/usr/lib/lmms" ), #endif + m_vstDir( QDir::home().absolutePath() ), m_currentPage( 0 ) { } @@ -335,8 +333,7 @@ void configManager::createWidgets( void ) workingdir_input_fields_layout->setSpacing( 10 ); workingdir_input_fields_layout->setMargin( 0 ); - m_wdLineEdit = new QLineEdit( m_lmmsWorkingDir, - workingdir_input_fields ); + m_wdLineEdit = new QLineEdit( m_workingDir, workingdir_input_fields ); connect( m_wdLineEdit, SIGNAL( textChanged( const QString & ) ), this, SLOT( setWorkingDir( const QString & ) ) ); @@ -516,12 +513,11 @@ void configManager::openWorkingDir( void ) { #ifdef QT4 QString new_dir = QFileDialog::getExistingDirectory( this, - tr( "Choose LMMS-working-directory" ), - m_lmmsWorkingDir ); + tr( "Choose LMMS working directory" ), + m_workingDir ); #else - QString new_dir = QFileDialog::getExistingDirectory( m_lmmsWorkingDir, - 0, 0, - tr( "Choose LMMS-working-directory" ), + QString new_dir = QFileDialog::getExistingDirectory( m_workingDir, 0, 0, + tr( "Choose LMMS working directory" ), TRUE ); #endif if( new_dir != QString::null ) @@ -535,7 +531,15 @@ void configManager::openWorkingDir( void ) void configManager::setWorkingDir( const QString & _wd ) { - m_lmmsWorkingDir = _wd; + m_workingDir = _wd; +} + + + + +void configManager::setVSTDir( const QString & _vd ) +{ + m_vstDir = _vd; } @@ -543,11 +547,11 @@ void configManager::setWorkingDir( const QString & _wd ) void configManager::accept( void ) { - if( m_lmmsWorkingDir.right( 1 ) != "/" ) + if( m_workingDir.right( 1 ) != "/" ) { - m_lmmsWorkingDir += '/'; + m_workingDir += '/'; } - if( !QDir( m_lmmsWorkingDir ).exists() ) + if( !QDir( m_workingDir ).exists() ) { if( QMessageBox:: #if QT_VERSION >= 0x030200 @@ -562,7 +566,7 @@ void configManager::accept( void ) QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { - mkPath( m_lmmsWorkingDir ); + mkPath( m_workingDir ); } else { @@ -570,23 +574,21 @@ void configManager::accept( void ) return; } } - processFilesRecursively( m_lmmsDataDir + "samples/", m_lmmsWorkingDir + + processFilesRecursively( m_dataDir + "samples/", m_workingDir + "samples/", m_samplesCopyRB->isChecked() ? ©File : &linkFile ); - processFilesRecursively( m_lmmsDataDir + "presets/", m_lmmsWorkingDir + + processFilesRecursively( m_dataDir + "presets/", m_workingDir + "presets/", m_presetsCopyRB->isChecked() ? ©File : &linkFile ); - processFilesRecursively( m_lmmsDataDir + "projects/", m_lmmsWorkingDir + + processFilesRecursively( m_dataDir + "projects/", m_workingDir + "projects/", m_projectsCopyRB->isChecked() ? ©File : &linkFile ); - setValue( "paths", "workingdir", m_lmmsWorkingDir ); - saveConfigFile(); QDialog::accept(); @@ -825,7 +827,13 @@ bool configManager::loadConfigFile( void ) node = node.nextSibling(); } - m_lmmsWorkingDir = value( "paths", "workingdir" ); + m_workingDir = value( "paths", "workingdir" ); + m_vstDir = value( "paths", "vstdir" ); + + if( m_vstDir == "" ) + { + m_vstDir = QDir::home().absolutePath(); + } return( TRUE ); } @@ -835,6 +843,9 @@ bool configManager::loadConfigFile( void ) void configManager::saveConfigFile( void ) { + setValue( "paths", "workingdir", m_workingDir ); + setValue( "paths", "vstdir", m_vstDir ); + QDomDocument doc( "lmms-config-file" ); QDomElement lmms_config = doc.createElement( "lmms" ); diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index 7390c6657..a74cb1546 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -32,6 +32,7 @@ #include "midi.h" #include "midi_port.h" #include "song_editor.h" +#include "piano_widget.h" @@ -57,6 +58,7 @@ notePlayHandle::notePlayHandle( channelTrack * _chnl_trk, m_muted( FALSE ) { setFrames( _frames ); + m_channelTrack->m_pianoWidget->setKeyState( key(), TRUE ); // send MIDI-note-on-event m_channelTrack->processOutEvent( midiEvent( NOTE_ON, m_channelTrack->m_midiPort->outputChannel(), @@ -241,6 +243,7 @@ void notePlayHandle::noteOff( Uint32 _s ) { m_releaseFramesToDo = m_channelTrack->m_envWidget->releaseFrames(); + m_channelTrack->m_pianoWidget->setKeyState( key(), FALSE ); // send MIDI-note-off-event m_channelTrack->processOutEvent( midiEvent( NOTE_OFF, m_channelTrack->m_midiPort->outputChannel(), @@ -301,3 +304,72 @@ void notePlayHandle::mute( void ) m_muted = TRUE; } + + + +int notePlayHandle::index( void ) const +{ + const playHandleVector & phv = mixer::inst()->playHandles(); + int idx = 0; + for( constPlayHandleVector::const_iterator it = phv.begin(); + it != phv.end(); ++it ) + { + const notePlayHandle * nph = + dynamic_cast( *it ); + if( nph == NULL || nph->m_channelTrack != m_channelTrack || + nph->released() == TRUE ) + { + continue; + } + if( nph == this ) + { + break; + } + ++idx; + } + return( idx ); +} + + + + +constNotePlayHandleVector notePlayHandle::nphsOfChannelTrack( + const channelTrack * _ct ) +{ + const playHandleVector & phv = mixer::inst()->playHandles(); + constNotePlayHandleVector cnphv; + + for( constPlayHandleVector::const_iterator it = phv.begin(); + it != phv.end(); ++it ) + { + const notePlayHandle * nph = + dynamic_cast( *it ); + if( nph != NULL && nph->m_channelTrack == _ct && + nph->released() == FALSE ) + { + cnphv.push_back( nph ); + } + } + return( cnphv ); +} + + + +bool notePlayHandle::operator==( const notePlayHandle & _nph ) const +{ + return( length() == _nph.length() && + pos() == _nph.pos() && + key() == _nph.key() && + getVolume() == _nph.getVolume() && + getPanning() == _nph.getPanning() && + m_channelTrack == _nph.m_channelTrack && + m_frames == _nph.m_frames && + m_framesAhead == _nph.m_framesAhead && + m_totalFramesPlayed == _nph.m_totalFramesPlayed && + m_released == _nph.m_released && + m_baseNote == _nph.m_baseNote && + m_arpNote == _nph.m_arpNote && + m_muted == _nph.m_muted ); +} + + diff --git a/src/core/piano_roll.cpp b/src/core/piano_roll.cpp index a78b4bbbb..eb353f3a3 100644 --- a/src/core/piano_roll.cpp +++ b/src/core/piano_roll.cpp @@ -524,7 +524,12 @@ void pianoRoll::setCurrentPattern( pattern * _new_pattern ) inline void pianoRoll::drawNoteRect( QPainter & _p, Uint16 _x, Uint16 _y, +<<<<<<< piano_roll.cpp + Sint16 _width, const bool _is_selected, + const bool _is_step_note ) +======= Sint16 _width, const bool _is_selected ) +>>>>>>> 1.14 { ++_x; ++_y; @@ -536,7 +541,11 @@ inline void pianoRoll::drawNoteRect( QPainter & _p, Uint16 _x, Uint16 _y, } QColor current_color( 0xFF, 0xB0, 0x00 ); - if( _is_selected ) + if( _is_step_note == TRUE ) + { + current_color.setRgb( 0, 255, 0 ); + } + else if( _is_selected == TRUE ) { current_color.setRgb( 0x00, 0x40, 0xC0 ); } @@ -815,10 +824,15 @@ void pianoRoll::update( void ) { Sint32 len_tact_64th = ( *it )->length(); - if( len_tact_64th <= 0 ) + if( len_tact_64th == 0 ) { continue; } + else if( len_tact_64th < 0 ) + { + len_tact_64th = 4; + } + const int key = ( *it )->key() - m_startKey + 1; Sint32 pos_tact_64th = ( *it )->pos(); @@ -865,7 +879,8 @@ void pianoRoll::update( void ) drawNoteRect( p, x + WHITE_KEY_WIDTH, y_base - key * KEY_LINE_HEIGHT, note_width, - is_selected ); + is_selected, + ( *it )->length() < 0 ); } // draw volume-line of note p.setPen( QPen( QColor( 0, 255, 0 ), NE_LINE_WIDTH ) ); @@ -919,6 +934,7 @@ void pianoRoll::update( void ) void pianoRoll::removeSelection( void ) { +<<<<<<< piano_roll.cpp m_selectStartTact64th = 0; m_selectedTact64th = 0; m_selectStartKey = 0; @@ -926,8 +942,29 @@ void pianoRoll::removeSelection( void ) } +======= + m_selectStartTact64th = 0; + m_selectedTact64th = 0; + m_selectStartKey = 0; + m_selectedKeys = 0; +} + +>>>>>>> 1.14 +<<<<<<< piano_roll.cpp +void pianoRoll::closeEvent( QCloseEvent * _ce ) +{ + QApplication::restoreOverrideCursor(); + hide(); + _ce->ignore (); +} + +======= +>>>>>>> 1.14 + +<<<<<<< piano_roll.cpp +======= void pianoRoll::closeEvent( QCloseEvent * _ce ) { QApplication::restoreOverrideCursor(); @@ -936,6 +973,7 @@ void pianoRoll::closeEvent( QCloseEvent * _ce ) } +>>>>>>> 1.14 void pianoRoll::enterEvent( QEvent * _e ) @@ -1065,14 +1103,27 @@ void pianoRoll::keyPressEvent( QKeyEvent * _ke ) _ke->ignore(); break; } +<<<<<<< piano_roll.cpp } +======= +} + +>>>>>>> 1.14 + +<<<<<<< piano_roll.cpp + +void pianoRoll::leaveEvent( QEvent * _e ) +{ + while( QApplication::overrideCursor() != NULL ) +======= void pianoRoll::leaveEvent( QEvent * _e ) { while( QApplication::overrideCursor() != NULL ) +>>>>>>> 1.14 { QApplication::restoreOverrideCursor(); } @@ -1122,14 +1173,18 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me ) // loop through whole note-vector... while( it != notes.end() ) { + midiTime len = ( *it )->length(); + if( len < 0 ) + { + len = 4; + } // and check whether the user clicked on an // existing note or an edit-line if( pos_tact_64th >= ( *it )->pos() && - ( *it )->length() > 0 && + len > 0 && ( ( edit_note == FALSE && - pos_tact_64th <= ( *it )->pos() + - ( *it )->length() && + pos_tact_64th <= ( *it )->pos() + len && ( *it )->key() == key_num ) || ( edit_note == TRUE && @@ -1202,7 +1257,8 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me ) // clicked at the "tail" of the note? if( pos_tact_64th > m_currentNote->pos() + m_currentNote->length() - - RESIZE_AREA_WIDTH ) + RESIZE_AREA_WIDTH && + m_currentNote->length() > 0 ) { // then resize the note m_action = RESIZE_NOTE; @@ -1237,10 +1293,17 @@ void pianoRoll::mousePressEvent( QMouseEvent * _me ) play_note = FALSE; if( it != notes.end() ) { - m_pattern->removeNote( *it ); + if( ( *it )->length() > 0 ) + { + m_pattern->removeNote( *it ); + } + else + { + ( *it )->setLength( 0 ); + m_pattern->update(); + } + songEditor::inst()->setModified(); } - - songEditor::inst()->setModified(); } else if( _me->button() == Qt::LeftButton && m_editMode == SELECT ) @@ -1497,7 +1560,7 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) pos_tact_64th <= ( *it )->pos() + ( *it )->length() && ( *it )->key() == key_num && - (*it )->length() > 0 ) + ( *it )->length() > 0 ) { break; } @@ -1509,7 +1572,8 @@ void pianoRoll::mouseMoveEvent( QMouseEvent * _me ) if( it != notes.end() ) { // cursor at the "tail" of the note? - if( pos_tact_64th > ( *it )->pos() + + if( ( *it )->length() > 0 && + pos_tact_64th > ( *it )->pos() + ( *it )->length() - RESIZE_AREA_WIDTH ) { diff --git a/src/core/piano_widget.cpp b/src/core/piano_widget.cpp index e72c1fa1b..599a3048d 100644 --- a/src/core/piano_widget.cpp +++ b/src/core/piano_widget.cpp @@ -2,7 +2,7 @@ * piano_widget.cpp - implementation of piano-widget used in channel-window * for testing channel * - * Copyright (c) 2004-2005 Tobias Doerffel + * Copyright (c) 2004-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -119,7 +119,7 @@ pianoWidget::pianoWidget (channelTrack * _parent ) : 4 ); m_pianoScroll->setSingleStep( 1 ); m_pianoScroll->setPageStep( 20 ); - m_pianoScroll->setValue( OCTAVE_3*WHITE_KEYS_PER_OCTAVE ); + m_pianoScroll->setValue( OCTAVE_3 * WHITE_KEYS_PER_OCTAVE ); #else // create scrollbar below piano-widget... m_pianoScroll = new QScrollBar( 0, WHITE_KEYS_PER_OCTAVE * diff --git a/src/core/setup_dialog.cpp b/src/core/setup_dialog.cpp index e40be0c57..4dee53cc7 100644 --- a/src/core/setup_dialog.cpp +++ b/src/core/setup_dialog.cpp @@ -1,7 +1,7 @@ /* * setup_dialog.cpp - dialog for setting up LMMS * - * Copyright (c) 2005 Tobias Doerffel + * Copyright (c) 2005-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -33,6 +33,8 @@ #include #include #include +#include +#include #else @@ -42,6 +44,8 @@ #include #include #include +#include +#include #endif @@ -100,10 +104,13 @@ setupDialog::setupDialog( configTabs _tab_to_open ) : m_classicalKnobUsability( configManager::inst()->value( "knobs", "classicalusability" ).toInt() ), m_gimpLikeWindows( configManager::inst()->value( "app", - "gimplikewindows" ).toInt() ) + "gimplikewindows" ).toInt() ), + m_workingDir( configManager::inst()->workingDir() ), + m_vstDir( configManager::inst()->vstDir() ) { setWindowIcon( embed::getIconPixmap( "setup_general" ) ); setWindowTitle( tr( "Setup LMMS" ) ); + setModal( TRUE ); QVBoxLayout * vlayout = new QVBoxLayout( this ); vlayout->setSpacing( 0 ); @@ -206,6 +213,59 @@ setupDialog::setupDialog( configTabs _tab_to_open ) : + QWidget * directories = new QWidget( ws ); + directories->setFixedSize( 360, 200 ); + QVBoxLayout * dir_layout = new QVBoxLayout( directories ); + dir_layout->setSpacing( 0 ); + dir_layout->setMargin( 0 ); + labelWidget( directories, tr( "Directories" ) ); + + // working-dir + tabWidget * lmms_wd_tw = new tabWidget( tr( + "LMMS working directory" ).toUpper(), + directories ); + lmms_wd_tw->setFixedHeight( 56 ); + + m_wdLineEdit = new QLineEdit( m_workingDir, lmms_wd_tw ); + m_wdLineEdit->setGeometry( 10, 20, 300, 16 ); + connect( m_wdLineEdit, SIGNAL( textChanged( const QString & ) ), this, + SLOT( setWorkingDir( const QString & ) ) ); + + QPushButton * workingdir_select_btn = new QPushButton( + embed::getIconPixmap( "project_open", 16, 16 ), + "", lmms_wd_tw ); + workingdir_select_btn->setFixedSize( 24, 24 ); + workingdir_select_btn->move( 320, 20 ); + connect( workingdir_select_btn, SIGNAL( clicked() ), this, + SLOT( openWorkingDir() ) ); + + // vst-dir + tabWidget * vst_tw = new tabWidget( tr( + "VST-plugin directory" ).toUpper(), + directories ); + vst_tw->setFixedHeight( 56 ); + + m_vdLineEdit = new QLineEdit( m_vstDir, vst_tw ); + m_vdLineEdit->setGeometry( 10, 20, 300, 16 ); + connect( m_vdLineEdit, SIGNAL( textChanged( const QString & ) ), this, + SLOT( setVSTDir( const QString & ) ) ); + + QPushButton * vstdir_select_btn = new QPushButton( + embed::getIconPixmap( "project_open", 16, 16 ), + "", vst_tw ); + vstdir_select_btn->setFixedSize( 24, 24 ); + vstdir_select_btn->move( 320, 20 ); + connect( vstdir_select_btn, SIGNAL( clicked() ), this, + SLOT( openVSTDir() ) ); + + dir_layout->addWidget( lmms_wd_tw ); + dir_layout->addSpacing( 10 ); + dir_layout->addWidget( vst_tw ); + dir_layout->addStretch(); + + + + QWidget * audio = new QWidget( ws ); audio->setFixedSize( 360, 200 ); @@ -381,9 +441,12 @@ setupDialog::setupDialog( configTabs _tab_to_open ) : m_tabBar->addTab( general, tr( "General settings" ), 0, FALSE, TRUE )->setIcon( embed::getIconPixmap( "setup_general" ) ); - m_tabBar->addTab( audio, tr( "Audio settings" ), 1, FALSE, TRUE + m_tabBar->addTab( directories, tr( "Directories" ), 1, FALSE, TRUE + )->setIcon( embed::getIconPixmap( + "setup_directories" ) ); + m_tabBar->addTab( audio, tr( "Audio settings" ), 2, FALSE, TRUE )->setIcon( embed::getIconPixmap( "setup_audio" ) ); - m_tabBar->addTab( midi, tr( "MIDI settings" ), 2, TRUE, TRUE + m_tabBar->addTab( midi, tr( "MIDI settings" ), 3, TRUE, TRUE )->setIcon( embed::getIconPixmap( "setup_midi" ) ); #undef setIcon @@ -452,6 +515,10 @@ void setupDialog::accept( void ) QString::number( m_classicalKnobUsability ) ); configManager::inst()->setValue( "app", "gimplikewindows", QString::number( m_gimpLikeWindows ) ); + + configManager::inst()->setWorkingDir( m_workingDir ); + configManager::inst()->setVSTDir( m_vstDir ); + // tell all audio-settings-widget to save their settings for( aswMap::iterator it = m_audioIfaceSetupWidgets.begin(); it != m_audioIfaceSetupWidgets.end(); ++it ) @@ -531,6 +598,64 @@ void setupDialog::displayBufSizeHelp( void ) +void setupDialog::openWorkingDir( void ) +{ +#ifdef QT4 + QString new_dir = QFileDialog::getExistingDirectory( this, + tr( "Choose LMMS working directory" ), + m_workingDir ); +#else + QString new_dir = QFileDialog::getExistingDirectory( m_workingDir, + 0, 0, + tr( "Choose LMMS working directory" ), + TRUE ); +#endif + if( new_dir != QString::null ) + { + m_wdLineEdit->setText( new_dir ); + } +} + + + + +void setupDialog::setWorkingDir( const QString & _wd ) +{ + m_workingDir = _wd; +} + + + + +void setupDialog::openVSTDir( void ) +{ +#ifdef QT4 + QString new_dir = QFileDialog::getExistingDirectory( this, + tr( "Choose your VST-plugin directory" ), + m_vstDir ); +#else + QString new_dir = QFileDialog::getExistingDirectory( m_vstDir, + 0, 0, + tr( "Choose your VST-plugin directory" ), + TRUE ); +#endif + if( new_dir != QString::null ) + { + m_vdLineEdit->setText( new_dir ); + } +} + + + + +void setupDialog::setVSTDir( const QString & _vd ) +{ + m_vstDir = _vd; +} + + + + void setupDialog::audioInterfaceChanged( const QString & _iface ) { for( aswMap::iterator it = m_audioIfaceSetupWidgets.begin(); diff --git a/src/tracks/pattern.cpp b/src/tracks/pattern.cpp index 8ec9e5c30..9dc9ca3d4 100644 --- a/src/tracks/pattern.cpp +++ b/src/tracks/pattern.cpp @@ -1,7 +1,7 @@ /* * pattern.cpp - implementation of class pattern which holds notes * - * Copyright (c) 2004-2005 Tobias Doerffel + * Copyright (c) 2004-2006 Tobias Doerffel * Copyright (c) 2005 Danny McRae * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net @@ -790,6 +790,10 @@ void pattern::mousePressEvent( QMouseEvent * _me ) } songEditor::inst()->setModified(); update(); + if( pianoRoll::inst()->currentPattern() == this ) + { + pianoRoll::inst()->update(); + } } else if( m_frozenPattern != NULL && _me->button() == Qt::LeftButton && lmmsMainWin::isShiftPressed() == TRUE ) @@ -849,11 +853,23 @@ void pattern::wheelEvent( QWheelEvent * _we ) } songEditor::inst()->setModified(); update(); +<<<<<<< pattern.cpp + if( pianoRoll::inst()->currentPattern() == this ) + { + pianoRoll::inst()->update(); + } _we->accept(); } else { trackContentObject::wheelEvent( _we ); +======= + _we->accept(); + } + else + { + trackContentObject::wheelEvent( _we ); +>>>>>>> 1.12 } } diff --git a/src/widgets/led_checkbox.cpp b/src/widgets/led_checkbox.cpp index 27192396e..cb6442074 100644 --- a/src/widgets/led_checkbox.cpp +++ b/src/widgets/led_checkbox.cpp @@ -1,7 +1,7 @@ /* * led_checkbox.cpp - class ledCheckBox, an improved QCheckBox * - * Copyright (c) 2005 Tobias Doerffel + * Copyright (c) 2005-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -148,7 +148,7 @@ void ledCheckBox::paintEvent( QPaintEvent * ) p.drawPixmap( 0, 0, *m_ledOffPixmap ); } - p.drawText( m_ledOffPixmap->width() + 2, 10, text() ); + p.drawText( m_ledOffPixmap->width() + 2, 8, text() ); #ifndef QT4 // and blit all the drawn stuff on the screen... diff --git a/src/widgets/tempo_sync_knob.cpp b/src/widgets/tempo_sync_knob.cpp index 7609f74e6..a4e7ced9f 100644 --- a/src/widgets/tempo_sync_knob.cpp +++ b/src/widgets/tempo_sync_knob.cpp @@ -1,7 +1,8 @@ /* - * tempo_sync_knob.h - adds bpm to ms conversion for knob class + * tempo_sync_knob.cpp - adds bpm to ms conversion for knob class * - * Copyright (c) 2005 Danny McRae + * Copyright (c) 2005 Danny McRae + * Copyright (c) 2005-2006 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -27,21 +28,15 @@ #ifdef QT4 -#include -#include -#include #include -#include #include #include -#include -#include -#include #else #include #include +#include #define addSeparator insertSeparator #define addMenu insertItem @@ -52,9 +47,6 @@ #include "tempo_sync_knob.h" #include "song_editor.h" #include "embed.h" -#include "tooltip.h" -#include "config_mgr.h" -#include "text_float.h"