1 |
// qsamplerMainForm.cpp |
// qsamplerMainForm.cpp |
2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2004-2020, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2023, 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 |
74 |
#endif |
#endif |
75 |
|
|
76 |
#ifdef CONFIG_LIBGIG |
#ifdef CONFIG_LIBGIG |
77 |
|
#if defined(Q_CC_GNU) || defined(Q_CC_MINGW) |
78 |
|
#pragma GCC diagnostic push |
79 |
|
#pragma GCC diagnostic ignored "-Wunused-parameter" |
80 |
|
#endif |
81 |
#include <gig.h> |
#include <gig.h> |
82 |
|
#if defined(Q_CC_GNU) || defined(Q_CC_MINGW) |
83 |
|
#pragma GCC diagnostic pop |
84 |
|
#endif |
85 |
#endif |
#endif |
86 |
|
|
87 |
// Deprecated QTextStreamFunctions/Qt namespaces workaround. |
// Deprecated QTextStreamFunctions/Qt namespaces workaround. |
90 |
#endif |
#endif |
91 |
|
|
92 |
// Needed for lroundf() |
// Needed for lroundf() |
93 |
#include <math.h> |
#ifdef CONFIG_ROUND |
94 |
|
#include <cmath> |
95 |
#ifndef CONFIG_ROUND |
#else |
96 |
static inline long lroundf ( float x ) |
static inline long lroundf ( float x ) |
97 |
{ |
{ |
98 |
if (x >= 0.0f) |
if (x >= 0.0f) |
130 |
{ |
{ |
131 |
char c = 1; |
char c = 1; |
132 |
|
|
133 |
(::write(g_fdSigusr1[0], &c, sizeof(c)) > 0); |
(void) (::write(g_fdSigusr1[0], &c, sizeof(c)) > 0); |
134 |
} |
} |
135 |
|
|
136 |
// File descriptor for SIGTERM notifier. |
// File descriptor for SIGTERM notifier. |
141 |
{ |
{ |
142 |
char c = 1; |
char c = 1; |
143 |
|
|
144 |
(::write(g_fdSigterm[0], &c, sizeof(c)) > 0); |
(void) (::write(g_fdSigterm[0], &c, sizeof(c)) > 0); |
145 |
} |
} |
146 |
|
|
147 |
#endif // HAVE_SIGNAL_H |
#endif // HAVE_SIGNAL_H |
225 |
: QMainWindow(pParent) |
: QMainWindow(pParent) |
226 |
{ |
{ |
227 |
m_ui.setupUi(this); |
m_ui.setupUi(this); |
228 |
|
#if QT_VERSION < QT_VERSION_CHECK(6, 1, 0) |
229 |
|
QMainWindow::setWindowIcon(QIcon(":/images/qsampler.png")); |
230 |
|
#endif |
231 |
// Pseudo-singleton reference setup. |
// Pseudo-singleton reference setup. |
232 |
g_pMainForm = this; |
g_pMainForm = this; |
233 |
|
|
2098 |
#endif |
#endif |
2099 |
|
|
2100 |
// Stuff the about box text... |
// Stuff the about box text... |
2101 |
QString sText = "<p>\n"; |
QString sText = "<h1>" QSAMPLER_TITLE "</h1>\n"; |
2102 |
sText += "<b>" QSAMPLER_TITLE " - " + tr(QSAMPLER_SUBTITLE) + "</b><br />\n"; |
sText += "<p>" + tr(QSAMPLER_SUBTITLE) + "<br />\n"; |
2103 |
sText += "<br />\n"; |
sText += "<br />\n"; |
2104 |
sText += tr("Version") + ": <b>" CONFIG_BUILD_VERSION "</b><br />\n"; |
sText += tr("Version") + ": <b>" CONFIG_BUILD_VERSION "</b><br />\n"; |
2105 |
// sText += "<small>" + tr("Build") + ": " CONFIG_BUILD_DATE "</small><br />\n"; |
// sText += "<small>" + tr("Build") + ": " CONFIG_BUILD_DATE "</small><br />\n"; |
2109 |
sText += "</font></small>"; |
sText += "</font></small>"; |
2110 |
} |
} |
2111 |
sText += "<br />\n"; |
sText += "<br />\n"; |
2112 |
sText += tr("Using") + ": "; |
sText += tr("Using: Qt %1").arg(qVersion()); |
2113 |
|
#if defined(QT_STATIC) |
2114 |
|
sText += "-static"; |
2115 |
|
#endif |
2116 |
|
sText += ", "; |
2117 |
sText += ::lscp_client_package(); |
sText += ::lscp_client_package(); |
2118 |
sText += " "; |
sText += " "; |
2119 |
sText += ::lscp_client_version(); |
sText += ::lscp_client_version(); |
3148 |
m_pDeviceForm->refreshDevices(); |
m_pDeviceForm->refreshDevices(); |
3149 |
|
|
3150 |
// Is any session pending to be loaded? |
// Is any session pending to be loaded? |
3151 |
if (!m_pOptions->sSessionFile.isEmpty()) { |
if (!m_pOptions->sessionFiles.isEmpty()) { |
3152 |
// Just load the prabably startup session... |
// Just load the prabably startup session... |
3153 |
if (loadSessionFile(m_pOptions->sSessionFile)) { |
if (loadSessionFile(m_pOptions->sessionFiles.first())) { |
3154 |
m_pOptions->sSessionFile = QString(); |
m_pOptions->sessionFiles.clear(); |
3155 |
return true; |
return true; |
3156 |
} |
} |
3157 |
} |
} |