Merge branch 'stable-1.2'
# Conflicts: # .travis.yml # .travis/linux..script.sh # .travis/linux.win.download.sh # .travis/linux.win32.script.sh # .travis/linux.win64.script.sh # .travis/osx..script.sh # include/VstSyncController.h # plugins/audio_file_processor/audio_file_processor.cpp # plugins/zynaddsubfx/zynaddsubfx # plugins/zynaddsubfx/zynaddsubfx/src/Misc/Bank.cpp # plugins/zynaddsubfx/zynaddsubfx/src/Misc/Bank.h # src/gui/SetupDialog.cpp # src/gui/editors/SongEditor.cpp
This commit is contained in:
@@ -511,8 +511,9 @@ void ConfigManager::loadConfigFile( const QString & configFile )
|
||||
cfg_file.close();
|
||||
}
|
||||
|
||||
|
||||
// Plugins are searched recursively, blacklist problematic locations
|
||||
if( m_vstDir.isEmpty() || m_vstDir == QDir::separator() || m_vstDir == "/" ||
|
||||
m_vstDir == ensureTrailingSlash( QDir::homePath() ) ||
|
||||
!QDir( m_vstDir ).exists() )
|
||||
{
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
|
||||
@@ -124,7 +124,10 @@ void DrumSynth::GetEnv(int env, const char *sec, const char *key, QString ini)
|
||||
char en[256], s[8];
|
||||
int i=0, o=0, ep=0;
|
||||
GetPrivateProfileString(sec, key, "0,0 100,0", en, sizeof(en), ini);
|
||||
en[255]=0; //be safe!
|
||||
|
||||
//be safe!
|
||||
en[255]=0;
|
||||
s[0]=0;
|
||||
|
||||
while(en[i]!=0)
|
||||
{
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
*/
|
||||
|
||||
#include "MixHelpers.h"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "lmms_math.h"
|
||||
#include "ValueBuffer.h"
|
||||
|
||||
|
||||
@@ -186,8 +186,8 @@ Mixer::~Mixer()
|
||||
}
|
||||
delete m_fifo;
|
||||
|
||||
delete m_audioDev;
|
||||
delete m_midiClient;
|
||||
delete m_audioDev;
|
||||
|
||||
for( int i = 0; i < 3; i++ )
|
||||
{
|
||||
|
||||
@@ -525,7 +525,7 @@ void TrackContentObjectView::dragEnterEvent( QDragEnterEvent * dee )
|
||||
{
|
||||
TrackContentWidget * tcw = getTrackView()->getTrackContentWidget();
|
||||
MidiTime tcoPos = MidiTime( m_tco->startPosition().getTact(), 0 );
|
||||
if( tcw->canPasteSelection( tcoPos, dee->mimeData() ) == false )
|
||||
if( tcw->canPasteSelection( tcoPos, dee ) == false )
|
||||
{
|
||||
dee->ignore();
|
||||
}
|
||||
@@ -630,9 +630,12 @@ DataFile TrackContentObjectView::createTCODataFiles(
|
||||
it != tcoViews.end(); ++it )
|
||||
{
|
||||
// Insert into the dom under the "tcos" element
|
||||
int trackIndex = tc->tracks().indexOf( ( *it )->m_trackView->getTrack() );
|
||||
Track* tcoTrack = ( *it )->m_trackView->getTrack();
|
||||
int trackIndex = tc->tracks().indexOf( tcoTrack );
|
||||
QDomElement tcoElement = dataFile.createElement( "tco" );
|
||||
tcoElement.setAttribute( "trackIndex", trackIndex );
|
||||
tcoElement.setAttribute( "trackType", tcoTrack->type() );
|
||||
tcoElement.setAttribute( "trackName", tcoTrack->name() );
|
||||
( *it )->m_tco->saveState( dataFile, tcoElement );
|
||||
tcoParent.appendChild( tcoElement );
|
||||
}
|
||||
@@ -649,6 +652,7 @@ DataFile TrackContentObjectView::createTCODataFiles(
|
||||
QDomElement metadata = dataFile.createElement( "copyMetadata" );
|
||||
// initialTrackIndex is the index of the track that was touched
|
||||
metadata.setAttribute( "initialTrackIndex", initialTrackIndex );
|
||||
metadata.setAttribute( "trackContainerId", tc->id() );
|
||||
// grabbedTCOPos is the pos of the tact containing the TCO we grabbed
|
||||
metadata.setAttribute( "grabbedTCOPos", m_tco->startPosition() );
|
||||
|
||||
@@ -1387,7 +1391,7 @@ MidiTime TrackContentWidget::getPosition( int mouseX )
|
||||
void TrackContentWidget::dragEnterEvent( QDragEnterEvent * dee )
|
||||
{
|
||||
MidiTime tcoPos = MidiTime( getPosition( dee->pos().x() ).getTact(), 0 );
|
||||
if( canPasteSelection( tcoPos, dee->mimeData() ) == false )
|
||||
if( canPasteSelection( tcoPos, dee ) == false )
|
||||
{
|
||||
dee->ignore();
|
||||
}
|
||||
@@ -1406,8 +1410,10 @@ void TrackContentWidget::dragEnterEvent( QDragEnterEvent * dee )
|
||||
* \param tcoPos the position of the TCO slot being pasted on
|
||||
* \param de the DropEvent generated
|
||||
*/
|
||||
bool TrackContentWidget::canPasteSelection( MidiTime tcoPos, const QMimeData * mimeData )
|
||||
bool TrackContentWidget::canPasteSelection( MidiTime tcoPos, const QDropEvent* de )
|
||||
{
|
||||
const QMimeData * mimeData = de->mimeData();
|
||||
|
||||
Track * t = getTrack();
|
||||
QString type = StringPairDrag::decodeMimeKey( mimeData );
|
||||
QString value = StringPairDrag::decodeMimeValue( mimeData );
|
||||
@@ -1437,7 +1443,9 @@ bool TrackContentWidget::canPasteSelection( MidiTime tcoPos, const QMimeData * m
|
||||
const int currentTrackIndex = tracks.indexOf( t );
|
||||
|
||||
// Don't paste if we're on the same tact
|
||||
if( tcoPos == grabbedTCOTact && currentTrackIndex == initialTrackIndex )
|
||||
auto sourceTrackContainerId = metadata.attributeNode( "trackContainerId" ).value().toUInt();
|
||||
if( de->source() && sourceTrackContainerId == t->trackContainer()->id() &&
|
||||
tcoPos == grabbedTCOTact && currentTrackIndex == initialTrackIndex )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -1460,9 +1468,9 @@ bool TrackContentWidget::canPasteSelection( MidiTime tcoPos, const QMimeData * m
|
||||
}
|
||||
|
||||
// Track must be of the same type
|
||||
Track * startTrack = tracks.at( trackIndex );
|
||||
auto startTrackType = tcoElement.attributeNode("trackType").value().toInt();
|
||||
Track * endTrack = tracks.at( finalTrackIndex );
|
||||
if( startTrack->type() != endTrack->type() )
|
||||
if( startTrackType != endTrack->type() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -1478,7 +1486,7 @@ bool TrackContentWidget::canPasteSelection( MidiTime tcoPos, const QMimeData * m
|
||||
*/
|
||||
bool TrackContentWidget::pasteSelection( MidiTime tcoPos, QDropEvent * de )
|
||||
{
|
||||
if( canPasteSelection( tcoPos, de->mimeData() ) == false )
|
||||
if( canPasteSelection( tcoPos, de ) == false )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -1548,7 +1556,8 @@ bool TrackContentWidget::pasteSelection( MidiTime tcoPos, QDropEvent * de )
|
||||
}
|
||||
|
||||
//check tco name, if the same as source track name dont copy
|
||||
if( tco->name() == tracks[trackIndex]->name() )
|
||||
QString sourceTrackName = outerTCOElement.attributeNode( "trackName" ).value();
|
||||
if( tco->name() == sourceTrackName )
|
||||
{
|
||||
tco->setName( "" );
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ static void JackMidiShutdown(void *arg)
|
||||
|
||||
MidiJack::MidiJack() :
|
||||
MidiClientRaw(),
|
||||
m_jackClient( nullptr ),
|
||||
m_input_port( NULL ),
|
||||
m_output_port( NULL ),
|
||||
m_quit( false )
|
||||
|
||||
@@ -139,7 +139,9 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
|
||||
"displaywaveform").toInt() ),
|
||||
m_disableAutoQuit(ConfigManager::inst()->value( "ui",
|
||||
"disableautoquit", "1" ).toInt() ),
|
||||
m_vstEmbedMethod( ConfigManager::inst()->vstEmbedMethod() )
|
||||
m_vstEmbedMethod( ConfigManager::inst()->vstEmbedMethod() ),
|
||||
m_vstAlwaysOnTop( ConfigManager::inst()->value( "ui",
|
||||
"vstalwaysontop" ).toInt() )
|
||||
{
|
||||
setWindowIcon( embed::getIconPixmap( "setup_general" ) );
|
||||
setWindowTitle( tr( "Setup LMMS" ) );
|
||||
@@ -259,7 +261,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
|
||||
}
|
||||
|
||||
TabWidget* embed_tw = new TabWidget( tr( "PLUGIN EMBEDDING" ), general);
|
||||
embed_tw->setFixedHeight( 48 );
|
||||
embed_tw->setFixedHeight( 66 );
|
||||
m_vstEmbedComboBox = new QComboBox( embed_tw );
|
||||
m_vstEmbedComboBox->move( XDelta, YDelta );
|
||||
|
||||
@@ -278,6 +280,17 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
|
||||
m_vstEmbedComboBox->addItem( tr( "Embed using XEmbed protocol" ), "xembed" );
|
||||
}
|
||||
m_vstEmbedComboBox->setCurrentIndex( m_vstEmbedComboBox->findData( m_vstEmbedMethod ) );
|
||||
connect( m_vstEmbedComboBox, SIGNAL( currentIndexChanged( int ) ),
|
||||
this, SLOT( vstEmbedMethodChanged() ) );
|
||||
|
||||
m_vstAlwaysOnTopCheckBox = new LedCheckBox(
|
||||
tr( "Keep plugin windows on top when not embedded" ),
|
||||
embed_tw );
|
||||
m_vstAlwaysOnTopCheckBox->move( 20, 44 );
|
||||
m_vstAlwaysOnTopCheckBox->setChecked( m_vstAlwaysOnTop );
|
||||
m_vstAlwaysOnTopCheckBox->setVisible( m_vstEmbedMethod == "none" );
|
||||
connect( m_vstAlwaysOnTopCheckBox, SIGNAL( toggled( bool ) ),
|
||||
this, SLOT( toggleVSTAlwaysOnTop( bool ) ) );
|
||||
|
||||
TabWidget * lang_tw = new TabWidget( tr( "LANGUAGE" ), general );
|
||||
lang_tw->setFixedHeight( 48 );
|
||||
@@ -854,7 +867,9 @@ void SetupDialog::accept()
|
||||
QString::number( m_disableAutoQuit ) );
|
||||
ConfigManager::inst()->setValue( "app", "language", m_lang );
|
||||
ConfigManager::inst()->setValue( "ui", "vstembedmethod",
|
||||
m_vstEmbedComboBox->currentData().toString() );
|
||||
m_vstEmbedMethod );
|
||||
ConfigManager::inst()->setValue( "ui", "vstalwaysontop",
|
||||
QString::number( m_vstAlwaysOnTop ) );
|
||||
|
||||
|
||||
ConfigManager::inst()->setWorkingDir(QDir::fromNativeSeparators(m_workingDir));
|
||||
@@ -1057,6 +1072,25 @@ void SetupDialog::toggleOneInstrumentTrackWindow( bool _enabled )
|
||||
m_oneInstrumentTrackWindow = _enabled;
|
||||
}
|
||||
|
||||
|
||||
void SetupDialog::vstEmbedMethodChanged()
|
||||
{
|
||||
#if QT_VERSION >= 0x050000
|
||||
m_vstEmbedMethod = m_vstEmbedComboBox->currentData().toString();
|
||||
#else
|
||||
m_vstEmbedMethod = m_vstEmbedComboBox->itemData(
|
||||
m_vstEmbedComboBox->currentIndex()).toString();
|
||||
#endif
|
||||
m_vstAlwaysOnTopCheckBox->setVisible( m_vstEmbedMethod == "none" );
|
||||
}
|
||||
|
||||
|
||||
void SetupDialog::toggleVSTAlwaysOnTop( bool en )
|
||||
{
|
||||
m_vstAlwaysOnTop = en;
|
||||
}
|
||||
|
||||
|
||||
void SetupDialog::setLanguage( int lang )
|
||||
{
|
||||
m_lang = m_languages[lang];
|
||||
|
||||
@@ -405,6 +405,7 @@ void AutomationEditor::keyPressEvent(QKeyEvent * ke )
|
||||
}
|
||||
break;
|
||||
|
||||
case Qt::Key_Backspace:
|
||||
case Qt::Key_Delete:
|
||||
deleteSelectedValues();
|
||||
ke->accept();
|
||||
@@ -2487,6 +2488,9 @@ void AutomationEditorWindow::dropEvent( QDropEvent *_de )
|
||||
|
||||
void AutomationEditorWindow::dragEnterEvent( QDragEnterEvent *_dee )
|
||||
{
|
||||
if (! m_editor->validPattern() ) {
|
||||
return;
|
||||
}
|
||||
StringPairDrag::processDragEnterEvent( _dee, "automatable_model" );
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <QAction>
|
||||
#include <QMdiArea>
|
||||
#include <QShortcut>
|
||||
#include <QCloseEvent>
|
||||
|
||||
|
||||
void Editor::setPauseIcon(bool displayPauseIcon)
|
||||
@@ -128,8 +129,18 @@ QAction *Editor::playAction() const
|
||||
return m_playAction;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Editor::closeEvent( QCloseEvent * _ce )
|
||||
{
|
||||
if( parentWidget() )
|
||||
{
|
||||
parentWidget()->hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
hide();
|
||||
}
|
||||
_ce->ignore();
|
||||
}
|
||||
|
||||
DropToolBar::DropToolBar(QWidget* parent) : QToolBar(parent)
|
||||
{
|
||||
@@ -145,3 +156,6 @@ void DropToolBar::dropEvent(QDropEvent* event)
|
||||
{
|
||||
dropped(event);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1319,6 +1319,7 @@ void PianoRoll::keyPressEvent(QKeyEvent* ke)
|
||||
clearSelectedNotes();
|
||||
break;
|
||||
|
||||
case Qt::Key_Backspace:
|
||||
case Qt::Key_Delete:
|
||||
deleteSelectedNotes();
|
||||
ke->accept();
|
||||
|
||||
@@ -304,12 +304,12 @@ void SongEditor::setEditModeSelect()
|
||||
void SongEditor::keyPressEvent( QKeyEvent * ke )
|
||||
{
|
||||
if( ke->modifiers() & Qt::ShiftModifier &&
|
||||
ke->key() == Qt::Key_Insert )
|
||||
( ke->key() == Qt::Key_Insert || ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) )
|
||||
{
|
||||
m_song->insertBar();
|
||||
}
|
||||
else if( ke->modifiers() & Qt::ShiftModifier &&
|
||||
ke->key() == Qt::Key_Delete )
|
||||
( ke->key() == Qt::Key_Delete || ke->key() == Qt::Key_Backspace ) )
|
||||
{
|
||||
m_song->removeBar();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user