From 82b1c2f88282ee61d1251245035ab1dab3b48976 Mon Sep 17 00:00:00 2001 From: Vesa Date: Sat, 1 Mar 2014 15:53:34 +0200 Subject: [PATCH 1/6] Zyn fix: export now fully works with GUI either open/closed --- plugins/zynaddsubfx/RemoteZynAddSubFx.h | 4 ++-- plugins/zynaddsubfx/ZynAddSubFx.cpp | 4 ++++ plugins/zynaddsubfx/ZynAddSubFx.h | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/plugins/zynaddsubfx/RemoteZynAddSubFx.h b/plugins/zynaddsubfx/RemoteZynAddSubFx.h index a5eb91a38..3abd0c494 100644 --- a/plugins/zynaddsubfx/RemoteZynAddSubFx.h +++ b/plugins/zynaddsubfx/RemoteZynAddSubFx.h @@ -22,8 +22,8 @@ * */ -#ifndef _REMOTE_ZYNADDSUBFX_H -#define _REMOTE_ZYNADDSUBFX_H +#ifndef REMOTE_ZYNADDSUBFX_H +#define REMOTE_ZYNADDSUBFX_H #include "RemotePlugin.h" diff --git a/plugins/zynaddsubfx/ZynAddSubFx.cpp b/plugins/zynaddsubfx/ZynAddSubFx.cpp index 02808a63b..57f65b82a 100644 --- a/plugins/zynaddsubfx/ZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/ZynAddSubFx.cpp @@ -423,6 +423,9 @@ void ZynAddSubFxInstrument::initPlugin() QSTR_TO_STDSTR( QString( configManager::inst()->factoryPresetsDir() + QDir::separator() + "ZynAddSubFX" ) ) ) ); + + m_remotePlugin->updateSampleRate( engine::mixer()->processingSampleRate() ); + m_remotePlugin->showUI(); m_remotePlugin->unlock(); } @@ -432,6 +435,7 @@ void ZynAddSubFxInstrument::initPlugin() m_plugin->setSampleRate( engine::mixer()->processingSampleRate() ); m_plugin->setBufferSize( engine::mixer()->framesPerPeriod() ); } + m_pluginMutex.unlock(); } diff --git a/plugins/zynaddsubfx/ZynAddSubFx.h b/plugins/zynaddsubfx/ZynAddSubFx.h index ed65d24f5..27154cff1 100644 --- a/plugins/zynaddsubfx/ZynAddSubFx.h +++ b/plugins/zynaddsubfx/ZynAddSubFx.h @@ -2,7 +2,7 @@ * ZynAddSubFx.h - ZynAddSubFX-embedding plugin * * Copyright (c) 2008-2010 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 @@ -22,8 +22,8 @@ * */ -#ifndef _ZYNADDSUBFX_H -#define _ZYNADDSUBFX_H +#ifndef ZYNADDSUBFX_H +#define ZYNADDSUBFX_H #include #include From de77ae38da9e87757b56f019a897643267d07bc9 Mon Sep 17 00:00:00 2001 From: Vesa Date: Sat, 1 Mar 2014 19:28:55 +0200 Subject: [PATCH 2/6] Fix #397 (presets with input velocity = 1) --- data/presets/TripleOscillator/Erazzor.xpf | 2 +- data/presets/TripleOscillator/SEGuitar.xpf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/presets/TripleOscillator/Erazzor.xpf b/data/presets/TripleOscillator/Erazzor.xpf index 4a5c174bc..95e7d1a89 100644 --- a/data/presets/TripleOscillator/Erazzor.xpf +++ b/data/presets/TripleOscillator/Erazzor.xpf @@ -14,7 +14,7 @@ - + diff --git a/data/presets/TripleOscillator/SEGuitar.xpf b/data/presets/TripleOscillator/SEGuitar.xpf index bd6ec8df8..9fe6f8ded 100644 --- a/data/presets/TripleOscillator/SEGuitar.xpf +++ b/data/presets/TripleOscillator/SEGuitar.xpf @@ -14,7 +14,7 @@ - + From 9b8d396d82062e03bad9d794a4114c14068fa3e5 Mon Sep 17 00:00:00 2001 From: Vesa Date: Sat, 1 Mar 2014 22:59:48 +0200 Subject: [PATCH 3/6] Make sfxr use noteplayhandle, to enable velocity and env/lfo tab --- plugins/sfxr/sfxr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/sfxr/sfxr.cpp b/plugins/sfxr/sfxr.cpp index a64f19b5a..27cd287da 100644 --- a/plugins/sfxr/sfxr.cpp +++ b/plugins/sfxr/sfxr.cpp @@ -481,7 +481,10 @@ void sfxrInstrument::playNote( NotePlayHandle * _n, sampleFrame * _working_buffe delete[] pitchedBuffer; - instrumentTrack()->processAudioBuffer( _working_buffer, frameNum, NULL ); + applyRelease( _working_buffer, _n ); + + instrumentTrack()->processAudioBuffer( _working_buffer, frameNum, _n ); + } From 5586141bf54cb65ca9cd491ad1d8e42c22f7f1ed Mon Sep 17 00:00:00 2001 From: Vesa Date: Sat, 1 Mar 2014 23:17:13 +0200 Subject: [PATCH 4/6] Small tweak to the knob code, make the acceleration curve smoother and less "sudden" --- src/gui/widgets/knob.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widgets/knob.cpp b/src/gui/widgets/knob.cpp index ec83a21ba..074f32813 100644 --- a/src/gui/widgets/knob.cpp +++ b/src/gui/widgets/knob.cpp @@ -392,7 +392,7 @@ float knob::getValue( const QPoint & _p ) float value; // arcane mathemagicks for calculating knob movement - value = ( ( _p.y() + _p.y() * qMin( qAbs( _p.y() / 2 ), 6 ) ) ) / 10.0f; + value = ( ( _p.y() + _p.y() * qMin( qAbs( _p.y() / 2.5f ), 6.0f ) ) ) / 12.0f; // if shift pressed we want slower movement if( engine::mainWindow()->isShiftPressed() ) From dd8fa5d80ceb0900eca32f0a057afde38b423776 Mon Sep 17 00:00:00 2001 From: Vesa Date: Sat, 1 Mar 2014 23:44:58 +0200 Subject: [PATCH 5/6] Make LcdSpinBox double-clickable to enter value --- include/LcdSpinBox.h | 7 ++++--- src/gui/widgets/LcdSpinBox.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/include/LcdSpinBox.h b/include/LcdSpinBox.h index a827b17cb..c95bad443 100644 --- a/include/LcdSpinBox.h +++ b/include/LcdSpinBox.h @@ -23,8 +23,8 @@ */ -#ifndef _LCD_SPINBOX_H -#define _LCD_SPINBOX_H +#ifndef LCD_SPINBOX_H +#define LCD_SPINBOX_H #include "LcdWidget.h" #include "AutomatableModelView.h" @@ -70,12 +70,13 @@ protected: virtual void mouseMoveEvent( QMouseEvent * _me ); virtual void mouseReleaseEvent( QMouseEvent * _me ); virtual void wheelEvent( QWheelEvent * _we ); + virtual void mouseDoubleClickEvent( QMouseEvent * _me ); private: bool m_mouseMoving; QPoint m_origMousePos; int m_displayOffset; - + void enterValue(); signals: void manualChange(); diff --git a/src/gui/widgets/LcdSpinBox.cpp b/src/gui/widgets/LcdSpinBox.cpp index a94c86435..3c638c5d5 100644 --- a/src/gui/widgets/LcdSpinBox.cpp +++ b/src/gui/widgets/LcdSpinBox.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include "LcdSpinBox.h" #include "caption_menu.h" @@ -119,6 +120,8 @@ void LcdSpinBox::mouseMoveEvent( QMouseEvent* event ) if( m_mouseMoving ) { int dy = event->globalY() - m_origMousePos.y(); + if( engine::mainWindow()->isShiftPressed() ) + dy = qBound( -4, dy/4, 4 ); if( dy > 1 || dy < -1 ) { model()->setInitValue( model()->value() - @@ -156,7 +159,30 @@ void LcdSpinBox::wheelEvent( QWheelEvent * _we ) emit manualChange(); } +void LcdSpinBox::mouseDoubleClickEvent( QMouseEvent * ) +{ + enterValue(); +} +void LcdSpinBox::enterValue() +{ + bool ok; + int new_val; + + new_val = QInputDialog::getInt( + this, windowTitle(), + tr( "Please enter a new value between %1 and %2:" ). + arg( model()->minValue() ). + arg( model()->maxValue() ), + model()->value(), + model()->minValue(), + model()->maxValue(), 4, &ok ); + + if( ok ) + { + model()->setValue( new_val ); + } +} #include "moc_LcdSpinBox.cxx" From 1c5106ee3b9539b75ac37bd817bb8d54cd978dfe Mon Sep 17 00:00:00 2001 From: Vesa Date: Mon, 3 Mar 2014 10:26:08 +0200 Subject: [PATCH 6/6] When saving new version of a project, skip already existing version numbers --- src/gui/MainWindow.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index c3aec5ff9..0be67f8b9 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -42,7 +42,7 @@ #include "piano_roll.h" #include "embed.h" #include "engine.h" -#include "FxMixerView.h" +#include "FxMixerView.h" #include "InstrumentTrack.h" #include "PianoView.h" #include "about_dialog.h" @@ -143,7 +143,7 @@ MainWindow::MainWindow( void ) : // Load background QString bgArtwork = configManager::inst()->backgroundArtwork(); - QImage bgImage; + QImage bgImage; if( !bgArtwork.isEmpty() ) { bgImage = QImage( bgArtwork ); @@ -228,7 +228,7 @@ void MainWindow::finalize( void ) project_menu->addAction( embed::getIconPixmap( "project_open" ), tr( "&Open..." ), this, SLOT( openProject() ), - Qt::CTRL + Qt::Key_O ); + Qt::CTRL + Qt::Key_O ); m_recentlyOpenedProjectsMenu = project_menu->addMenu( embed::getIconPixmap( "project_open_recent" ), @@ -356,28 +356,28 @@ void MainWindow::finalize( void ) project_new_from_template->setMenu( m_templatesMenu ); project_new_from_template->setPopupMode( toolButton::InstantPopup ); - toolButton * project_open = new toolButton( + toolButton * project_open = new toolButton( embed::getIconPixmap( "project_open" ), tr( "Open existing project" ), this, SLOT( openProject() ), m_toolBar ); - toolButton * project_open_recent = new toolButton( + toolButton * project_open_recent = new toolButton( embed::getIconPixmap( "project_open_recent" ), tr( "Recently opened project" ), this, SLOT( emptySlot() ), m_toolBar ); project_open_recent->setMenu( m_recentlyOpenedProjectsMenu ); project_open_recent->setPopupMode( toolButton::InstantPopup ); - toolButton * project_save = new toolButton( + toolButton * project_save = new toolButton( embed::getIconPixmap( "project_save" ), tr( "Save current project" ), this, SLOT( saveProject() ), m_toolBar ); - toolButton * project_export = new toolButton( + toolButton * project_export = new toolButton( embed::getIconPixmap( "project_export" ), tr( "Export current project" ), engine::getSong(), @@ -461,7 +461,7 @@ void MainWindow::finalize( void ) this, SLOT( toggleFxMixerWin() ), m_toolBar ); fx_mixer_window->setShortcut( Qt::Key_F9 ); - fx_mixer_window->setWhatsThis( + fx_mixer_window->setWhatsThis( tr( "Click here to show or hide the " "FX Mixer. The FX Mixer is a very powerful tool " "for managing effects for your song. You can insert " @@ -616,7 +616,7 @@ void MainWindow::saveWidgetState( QWidget * _w, QDomElement & _de ) { _w = _w->parentWidget(); } - + _de.setAttribute( "x", _w->x() ); _de.setAttribute( "y", _w->y() ); _de.setAttribute( "visible", _w->isVisible() ); @@ -788,7 +788,9 @@ bool MainWindow::saveProjectAsNewVersion( void ) } else { - VersionedSaveDialog::changeFileNameVersion( fileName, true ); + do VersionedSaveDialog::changeFileNameVersion( fileName, true ); + while ( QFile( fileName ).exists() ); + engine::getSong()->guiSaveProjectAs( fileName ); return true; }