Merge branch 'stable-1.2'

# Conflicts:
#	.travis/linux..before_install.sh
#	.travis/linux..install.sh
#	.travis/linux..script.sh
#	cmake/linux/package_linux.sh.in
#	include/AudioWeakJack.def
#	plugins/vst_base/CMakeLists.txt
#	plugins/zynaddsubfx/zynaddsubfx
This commit is contained in:
Hyunin Song
2017-12-20 14:08:07 +09:00
42 changed files with 847 additions and 580 deletions

View File

@@ -1,5 +1,10 @@
set(CMAKE_C_FLAGS "")
set(CMAKE_CXX_FLAGS "")
IF(QT5 AND LMMS_BUILD_LINUX)
set(BUILD_SHARED_LIBS OFF)
add_subdirectory(qt5-x11embed)
ENDIF()
ADD_SUBDIRECTORY(rpmalloc)
ADD_SUBDIRECTORY(weakjack)

1
src/3rdparty/qt5-x11embed vendored Submodule

View File

@@ -16,8 +16,15 @@ if (NOT LMMS_BUILD_WIN32)
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
# rpmalloc uses GCC builtin "__builtin_umull_overflow" with ENABLE_VALIDATE_ARGS,
# which is only available starting with GCC 5
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_LESS 5)
set(ENABLE_VALIDATE_ARGS OFF)
else ()
set(ENABLE_VALIDATE_ARGS ON)
endif()
target_compile_definitions(rpmalloc
PRIVATE -DENABLE_ASSERTS=1 -DENABLE_VALIDATE_ARGS=1
PRIVATE -DENABLE_ASSERTS=1 -DENABLE_VALIDATE_ARGS=${ENABLE_VALIDATE_ARGS}
)
endif()

View File

@@ -129,7 +129,7 @@ IF(LMMS_BUILD_HAIKU)
SET(EXTRA_LIBRARIES "-lnetwork")
ENDIF()
SET(LMMS_REQUIRED_LIBS
SET(LMMS_REQUIRED_LIBS ${LMMS_REQUIRED_LIBS}
${CMAKE_THREAD_LIBS_INIT}
${QT_LIBRARIES}
${ASOUND_LIBRARY}

View File

@@ -186,6 +186,39 @@ QString ConfigManager::defaultVersion() const
return LMMS_VERSION;
}
QStringList ConfigManager::availabeVstEmbedMethods()
{
QStringList methods;
methods.append("none");
#if QT_VERSION >= 0x050100
methods.append("qt");
#endif
#ifdef LMMS_BUILD_WIN32
methods.append("win32");
#endif
#ifdef LMMS_BUILD_LINUX
#if QT_VERSION >= 0x050000
if (static_cast<QGuiApplication*>(QApplication::instance())->
platformName() == "xcb")
#else
if (qgetenv("QT_QPA_PLATFORM").isNull()
|| qgetenv("QT_QPA_PLATFORM") == "xcb")
#endif
{
methods.append("xembed");
}
#endif
return methods;
}
QString ConfigManager::vstEmbedMethod() const
{
QStringList methods = availabeVstEmbedMethods();
QString defaultMethod = *(methods.end() - 1);
QString currentMethod = value( "ui", "vstembedmethod", defaultMethod );
return methods.contains(currentMethod) ? currentMethod : defaultMethod;
}
bool ConfigManager::hasWorkingDir() const
{
return QDir( m_workingDir ).exists();
@@ -336,12 +369,15 @@ void ConfigManager::setValue( const QString & cls,
{
if( m_settings.contains( cls ) )
{
for( stringPairVector::iterator it = m_settings[cls].begin();
it != m_settings[cls].end(); ++it )
for( QPair<QString, QString>& pair : m_settings[cls])
{
if( ( *it ).first == attribute )
if( pair.first == attribute )
{
( *it ).second = value;
if ( pair.second != value )
{
pair.second = value;
emit valueChanged( cls, attribute, value );
}
return;
}
}

View File

@@ -164,8 +164,8 @@ RemotePlugin::~RemotePlugin()
bool RemotePlugin::init( const QString &pluginExecutable,
bool waitForInitDoneMsg )
bool RemotePlugin::init(const QString &pluginExecutable,
bool waitForInitDoneMsg , QStringList extraArgs)
{
lock();
if( m_failed )
@@ -209,6 +209,7 @@ bool RemotePlugin::init( const QString &pluginExecutable,
#else
args << m_socketFile;
#endif
args << extraArgs;
#ifndef DEBUG_REMOTE_PLUGIN
m_process.setProcessChannelMode( QProcess::ForwardedChannels );
m_process.setWorkingDirectory( QCoreApplication::applicationDirPath() );
@@ -393,6 +394,20 @@ void RemotePlugin::processMidiEvent( const MidiEvent & _e,
unlock();
}
void RemotePlugin::showUI()
{
lock();
sendMessage( IdShowUI );
unlock();
}
void RemotePlugin::hideUI()
{
lock();
sendMessage( IdHideUI );
unlock();
}

View File

@@ -296,6 +296,9 @@ AutomatedValueMap TrackContainer::automatedValuesFromTracks(const TrackList &tra
continue;
}
MidiTime relTime = time - p->startPosition();
if (! p->getAutoResize()) {
relTime = qMin(relTime, p->length());
}
float value = p->valueAt(relTime);
for (AutomatableModel* model : p->objects())

View File

@@ -71,6 +71,7 @@ AudioJack::AudioJack( bool & _success_ful, Mixer* _mixer ) :
AudioJack::~AudioJack()
{
stopProcessing();
#ifdef AUDIO_PORT_SUPPORT
while( m_portMap.size() )
{
@@ -200,6 +201,7 @@ bool AudioJack::initJackClient()
void AudioJack::startProcessing()
{
QMutexLocker m( &m_processingMutex );
m_stopped = false;
if( m_active || m_client == NULL )
@@ -252,6 +254,8 @@ void AudioJack::startProcessing()
void AudioJack::stopProcessing()
{
QMutexLocker m( &m_processingMutex );
m_stopped = true;
}
@@ -338,6 +342,8 @@ void AudioJack::renamePort( AudioPort * _port )
int AudioJack::processCallback( jack_nframes_t _nframes, void * _udata )
{
QMutexLocker m( &m_processingMutex );
// do midi processing first so that midi input can
// add to the following sound processing
if( m_midiClient && _nframes > 0 )
@@ -397,15 +403,15 @@ int AudioJack::processCallback( jack_nframes_t _nframes, void * _udata )
if( m_framesDoneInCurBuf == m_framesToDoInCurBuf )
{
m_framesToDoInCurBuf = getNextBuffer( m_outBuf );
m_framesDoneInCurBuf = 0;
if( !m_framesToDoInCurBuf )
{
m_stopped = true;
break;
}
m_framesDoneInCurBuf = 0;
}
}
if( m_stopped == true )
if( _nframes != done )
{
for( int c = 0; c < channels(); ++c )
{

View File

@@ -65,7 +65,7 @@
#include "lmmsversion.h"
#if !defined(LMMS_BUILD_WIN32) && !defined(LMMS_BULID_APPLE) && !defined(LMMS_BUILD_HAIKU)
#if !defined(LMMS_BUILD_WIN32) && !defined(LMMS_BUILD_APPLE) && !defined(LMMS_BUILD_HAIKU) && QT_VERSION >= 0x050000
//Work around an issue on KDE5 as per https://bugs.kde.org/show_bug.cgi?id=337491#c21
void disableAutoKeyAccelerators(QWidget* mainWindow)
{
@@ -92,7 +92,7 @@ MainWindow::MainWindow() :
m_metronomeToggle( 0 ),
m_session( Normal )
{
#if !defined(LMMS_BUILD_WIN32) && !defined(LMMS_BULID_APPLE) && !defined(LMMS_BUILD_HAIKU)
#if !defined(LMMS_BUILD_WIN32) && !defined(LMMS_BUILD_APPLE) && !defined(LMMS_BUILD_HAIKU) && QT_VERSION >= 0x050000
disableAutoKeyAccelerators(this);
#endif
setAttribute( Qt::WA_DeleteOnClose );

View File

@@ -67,8 +67,6 @@
#include "MidiApple.h"
#include "MidiDummy.h"
inline void labelWidget( QWidget * _w, const QString & _txt )
{
QLabel * title = new QLabel( _txt, _w );
@@ -137,12 +135,13 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
m_displayWaveform(ConfigManager::inst()->value( "ui",
"displaywaveform").toInt() ),
m_disableAutoQuit(ConfigManager::inst()->value( "ui",
"disableautoquit").toInt() )
"disableautoquit").toInt() ),
m_vstEmbedMethod( ConfigManager::inst()->vstEmbedMethod() )
{
setWindowIcon( embed::getIconPixmap( "setup_general" ) );
setWindowTitle( tr( "Setup LMMS" ) );
setModal( true );
setFixedSize( 452, 520 );
setFixedSize( 452, 570 );
Engine::projectJournal()->setJournalling( false );
@@ -159,7 +158,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
m_tabBar->setFixedWidth( 72 );
QWidget * ws = new QWidget( settings );
int wsHeight = 370;
int wsHeight = 420;
#ifdef LMMS_HAVE_STK
wsHeight += 50;
#endif
@@ -168,7 +167,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
#endif
ws->setFixedSize( 360, wsHeight );
QWidget * general = new QWidget( ws );
general->setFixedSize( 360, 240 );
general->setFixedSize( 360, 290 );
QVBoxLayout * gen_layout = new QVBoxLayout( general );
gen_layout->setSpacing( 0 );
gen_layout->setMargin( 0 );
@@ -335,6 +334,27 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
misc_tw->setFixedHeight( YDelta*labelNumber + HeaderSize );
TabWidget* embed_tw = new TabWidget( tr( "PLUGIN EMBEDDING" ), general);
embed_tw->setFixedHeight( 48 );
m_vstEmbedComboBox = new QComboBox( embed_tw );
m_vstEmbedComboBox->move( XDelta, YDelta );
QStringList embedMethods = ConfigManager::availabeVstEmbedMethods();
m_vstEmbedComboBox->addItem( tr( "No embedding" ), "none" );
if( embedMethods.contains("qt") )
{
m_vstEmbedComboBox->addItem( tr( "Embed using Qt API" ), "qt" );
}
if( embedMethods.contains("win32") )
{
m_vstEmbedComboBox->addItem( tr( "Embed using native Win32 API" ), "win32" );
}
if( embedMethods.contains("xembed") )
{
m_vstEmbedComboBox->addItem( tr( "Embed using XEmbed protocol" ), "xembed" );
}
m_vstEmbedComboBox->setCurrentIndex( m_vstEmbedComboBox->findData( m_vstEmbedMethod ) );
TabWidget * lang_tw = new TabWidget( tr( "LANGUAGE" ), general );
lang_tw->setFixedHeight( 48 );
QComboBox * changeLang = new QComboBox( lang_tw );
@@ -380,13 +400,15 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) :
gen_layout->addSpacing( 10 );
gen_layout->addWidget( misc_tw );
gen_layout->addSpacing( 10 );
gen_layout->addWidget( embed_tw );
gen_layout->addSpacing( 10 );
gen_layout->addWidget( lang_tw );
gen_layout->addStretch();
QWidget * paths = new QWidget( ws );
int pathsHeight = 370;
int pathsHeight = 420;
#ifdef LMMS_HAVE_STK
pathsHeight += 55;
#endif
@@ -1001,6 +1023,20 @@ SetupDialog::~SetupDialog()
void SetupDialog::accept()
{
if( m_warnAfterSetup )
{
QMessageBox::information( NULL, tr( "Restart LMMS" ),
tr( "Please note that most changes "
"won't take effect until "
"you restart LMMS!" ),
QMessageBox::Ok );
}
// Hide dialog before setting values. This prevents an obscure bug
// where non-embedded VST windows would steal focus and prevent LMMS
// from taking mouse input, rendering the application unusable.
QDialog::accept();
ConfigManager::inst()->setValue( "mixer", "framesperaudiobuffer",
QString::number( m_bufferSize ) );
ConfigManager::inst()->setValue( "mixer", "audiodev",
@@ -1044,6 +1080,12 @@ void SetupDialog::accept()
ConfigManager::inst()->setValue( "ui", "disableautoquit",
QString::number( m_disableAutoQuit ) );
ConfigManager::inst()->setValue( "app", "language", m_lang );
ConfigManager::inst()->setValue( "ui", "vstembedmethod",
#if QT_VERSION >= 0x050000
m_vstEmbedComboBox->currentData().toString() );
#else
m_vstEmbedComboBox->itemData(m_vstEmbedComboBox->currentIndex()).toString() );
#endif
ConfigManager::inst()->setWorkingDir(QDir::fromNativeSeparators(m_workingDir));
@@ -1074,16 +1116,6 @@ void SetupDialog::accept()
}
ConfigManager::inst()->saveConfigFile();
QDialog::accept();
if( m_warnAfterSetup )
{
QMessageBox::information( NULL, tr( "Restart LMMS" ),
tr( "Please note that most changes "
"won't take effect until "
"you restart LMMS!" ),
QMessageBox::Ok );
}
}

View File

@@ -107,7 +107,10 @@ void SubWindow::paintEvent( QPaintEvent * )
{
QPainter p( this );
QRect rect( 0, 0, width(), m_titleBarHeight );
bool isActive = SubWindow::mdiArea()->activeSubWindow() == this;
bool isActive = mdiArea()
? mdiArea()->activeSubWindow() == this
: false;
p.fillRect( rect, isActive ? activeColor() : p.pen().brush() );

View File

@@ -435,9 +435,11 @@ void AutomationEditor::leaveEvent(QEvent * e )
}
void AutomationEditor::drawLine( int x0, float y0, int x1, float y1 )
void AutomationEditor::drawLine( int x0In, float y0, int x1In, float y1 )
{
int deltax = qRound( qAbs<float>( x1 - x0 ) );
int x0 = Note::quantized( x0In, AutomationPattern::quantization() );
int x1 = Note::quantized( x1In, AutomationPattern::quantization() );
int deltax = qAbs( x1 - x0 );
float deltay = qAbs<float>( y1 - y0 );
int x = x0;
float y = y0;
@@ -453,7 +455,7 @@ void AutomationEditor::drawLine( int x0, float y0, int x1, float y1 )
float yscale = deltay / ( deltax );
if( x0 < x1)
if( x0 < x1 )
{
xstep = AutomationPattern::quantization();
}
@@ -462,19 +464,22 @@ void AutomationEditor::drawLine( int x0, float y0, int x1, float y1 )
xstep = -( AutomationPattern::quantization() );
}
float lineAdjust;
if( y0 < y1 )
{
ystep = 1;
lineAdjust = yscale;
}
else
{
ystep = -1;
lineAdjust = -( yscale );
}
int i = 0;
while( i < deltax )
{
y = y0 + ( ystep * yscale * i );
y = y0 + ( ystep * yscale * i ) + lineAdjust;
x += xstep;
i += 1;
@@ -524,7 +529,7 @@ void AutomationEditor::mousePressEvent( QMouseEvent* mouseEvent )
( it+1==time_map.end() ||
pos_ticks <= (it+1).key() ) &&
( pos_ticks<= it.key() + MidiTime::ticksPerTact() *4 / m_ppt ) &&
level == it.value() )
( level == it.value() || mouseEvent->button() == Qt::RightButton ) )
{
break;
}
@@ -2374,8 +2379,9 @@ AutomationEditorWindow::AutomationEditorWindow() :
// copyPasteActionsToolBar->addAction( pasteAction );
DropToolBar *timeLineToolBar = addDropToolBarToTop(tr("Timeline controls"));
m_editor->m_timeLine->addToolButtons(timeLineToolBar);
// Not implemented.
//DropToolBar *timeLineToolBar = addDropToolBarToTop(tr("Timeline controls"));
//m_editor->m_timeLine->addToolButtons(timeLineToolBar);
addToolBarBreak();

View File

@@ -3762,7 +3762,7 @@ void PianoRoll::pasteNotes()
cur_note.setSelected( true );
// add to pattern
m_pattern->addNote( cur_note );
m_pattern->addNote( cur_note, false );
}
// we only have to do the following lines if we pasted at
@@ -3925,6 +3925,8 @@ void PianoRoll::quantizeNotes()
return;
}
m_pattern->addJournalCheckPoint();
NoteVector notes = getSelectedNotes();
if( notes.empty() )
@@ -3950,6 +3952,7 @@ void PianoRoll::quantizeNotes()
update();
gui->songEditor()->update();
Engine::getSong()->setModified();
}