1 |
// qsamplerMainForm.cpp |
// qsamplerMainForm.cpp |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2004-2020, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2021, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
Copyright (C) 2007-2019 Christian Schoenebeck |
Copyright (C) 2007-2019 Christian Schoenebeck |
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
46 |
#include <QProcess> |
#include <QProcess> |
47 |
#include <QMessageBox> |
#include <QMessageBox> |
48 |
|
|
|
#include <QRegExp> |
|
49 |
#include <QTextStream> |
#include <QTextStream> |
50 |
#include <QFileDialog> |
#include <QFileDialog> |
51 |
#include <QFileInfo> |
#include <QFileInfo> |
74 |
#endif |
#endif |
75 |
|
|
76 |
#ifdef CONFIG_LIBGIG |
#ifdef CONFIG_LIBGIG |
77 |
|
#pragma GCC diagnostic push |
78 |
|
#pragma GCC diagnostic ignored "-Wunused-parameter" |
79 |
#include <gig.h> |
#include <gig.h> |
80 |
|
#pragma GCC diagnostic pop |
81 |
#endif |
#endif |
82 |
|
|
83 |
// Deprecated QTextStreamFunctions/Qt namespaces workaround. |
// Deprecated QTextStreamFunctions/Qt namespaces workaround. |
86 |
#endif |
#endif |
87 |
|
|
88 |
// Needed for lroundf() |
// Needed for lroundf() |
89 |
#include <math.h> |
#ifdef CONFIG_ROUND |
90 |
|
#include <cmath> |
91 |
#ifndef CONFIG_ROUND |
#else |
92 |
static inline long lroundf ( float x ) |
static inline long lroundf ( float x ) |
93 |
{ |
{ |
94 |
if (x >= 0.0f) |
if (x >= 0.0f) |
754 |
default: |
default: |
755 |
appendMessagesColor(tr("LSCP Event: %1 data: %2") |
appendMessagesColor(tr("LSCP Event: %1 data: %2") |
756 |
.arg(::lscp_event_to_text(pLscpEvent->event())) |
.arg(::lscp_event_to_text(pLscpEvent->event())) |
757 |
.arg(pLscpEvent->data()), Qt::darkMagenta); |
.arg(pLscpEvent->data()), "#996699"); |
758 |
} |
} |
759 |
} |
} |
760 |
} |
} |
1034 |
!= LSCP_OK) { |
!= LSCP_OK) { |
1035 |
appendMessagesColor(QString("%1(%2): %3") |
appendMessagesColor(QString("%1(%2): %3") |
1036 |
.arg(QFileInfo(sFilename).fileName()).arg(iLine) |
.arg(QFileInfo(sFilename).fileName()).arg(iLine) |
1037 |
.arg(sCommand.simplified()), Qt::darkYellow); |
.arg(sCommand.simplified()), "#996633"); |
1038 |
appendMessagesClient("lscp_client_query"); |
appendMessagesClient("lscp_client_query"); |
1039 |
iErrors++; |
iErrors++; |
1040 |
} |
} |
2103 |
sText += "</font></small>"; |
sText += "</font></small>"; |
2104 |
} |
} |
2105 |
sText += "<br />\n"; |
sText += "<br />\n"; |
2106 |
sText += tr("Using") + ": "; |
sText += tr("Using: Qt %1").arg(qVersion()); |
2107 |
|
#if defined(QT_STATIC) |
2108 |
|
sText += "-static"; |
2109 |
|
#endif |
2110 |
|
sText += ", "; |
2111 |
sText += ::lscp_client_package(); |
sText += ::lscp_client_package(); |
2112 |
sText += " "; |
sText += " "; |
2113 |
sText += ::lscp_client_version(); |
sText += ::lscp_client_version(); |
2561 |
|
|
2562 |
appendMessagesColor(s + QString(": %1 (errno=%2)") |
appendMessagesColor(s + QString(": %1 (errno=%2)") |
2563 |
.arg(::lscp_client_get_result(m_pClient)) |
.arg(::lscp_client_get_result(m_pClient)) |
2564 |
.arg(::lscp_client_get_errno(m_pClient)), Qt::darkRed); |
.arg(::lscp_client_get_errno(m_pClient)), "#996666"); |
2565 |
|
|
2566 |
// Make it look responsive...:) |
// Make it look responsive...:) |
2567 |
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); |
QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); |
2913 |
args.removeAt(0); |
args.removeAt(0); |
2914 |
|
|
2915 |
appendMessages(tr("Server is starting...")); |
appendMessages(tr("Server is starting...")); |
2916 |
appendMessagesColor(m_pOptions->sServerCmdLine, Qt::darkMagenta); |
appendMessagesColor(m_pOptions->sServerCmdLine, "#990099"); |
2917 |
|
|
2918 |
// Go linuxsampler, go... |
// Go linuxsampler, go... |
2919 |
m_pServer->start(sCommand, args); |
m_pServer->start(sCommand, args); |
2925 |
|
|
2926 |
// Show startup results... |
// Show startup results... |
2927 |
appendMessages( |
appendMessages( |
2928 |
tr("Server was started with PID=%1.").arg((long) m_pServer->pid())); |
tr("Server was started with PID=%1.") |
2929 |
|
#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0) |
2930 |
|
.arg(quint64(m_pServer->pid()))); |
2931 |
|
#else |
2932 |
|
.arg(quint64(m_pServer->processId()))); |
2933 |
|
#endif |
2934 |
|
|
2935 |
// Reset (yet again) the timer counters, |
// Reset (yet again) the timer counters, |
2936 |
// but this time is deferred as the user opted. |
// but this time is deferred as the user opted. |