45 |
#include "qsamplerDeviceForm.h" |
#include "qsamplerDeviceForm.h" |
46 |
#include "qsamplerOptionsForm.h" |
#include "qsamplerOptionsForm.h" |
47 |
|
|
|
#include "config.h" |
|
|
|
|
48 |
#ifdef HAVE_SIGNAL_H |
#ifdef HAVE_SIGNAL_H |
49 |
#include <signal.h> |
#include <signal.h> |
50 |
#endif |
#endif |
51 |
|
|
52 |
#if CONFIG_LIBGIG |
#ifdef CONFIG_LIBGIG |
53 |
# include <gig.h> |
#include <gig.h> |
54 |
#endif |
#endif |
55 |
|
|
56 |
// Timer constant stuff. |
// Timer constant stuff. |
385 |
// For the time being, just pump it to messages. |
// For the time being, just pump it to messages. |
386 |
if (pCustomEvent->type() == QSAMPLER_CUSTOM_EVENT) { |
if (pCustomEvent->type() == QSAMPLER_CUSTOM_EVENT) { |
387 |
qsamplerCustomEvent *pEvent = (qsamplerCustomEvent *) pCustomEvent; |
qsamplerCustomEvent *pEvent = (qsamplerCustomEvent *) pCustomEvent; |
388 |
appendMessagesColor(tr("Notify event: %1 data: %2") |
if (pEvent->event() == LSCP_EVENT_CHANNEL_INFO) { |
389 |
.arg(::lscp_event_to_text(pEvent->event())) |
int iChannelID = pEvent->data().toInt(); |
390 |
.arg(pEvent->data()), "#996699"); |
qsamplerChannelStrip *pChannelStrip = channelStrip(iChannelID); |
391 |
|
if (pChannelStrip) |
392 |
|
channelStripChanged(pChannelStrip); |
393 |
|
} else { |
394 |
|
appendMessagesColor(tr("Notify event: %1 data: %2") |
395 |
|
.arg(::lscp_event_to_text(pEvent->event())) |
396 |
|
.arg(pEvent->data()), "#996699"); |
397 |
|
} |
398 |
} |
} |
399 |
} |
} |
400 |
|
|
786 |
ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannel << endl; |
ts << "LOAD ENGINE " << pChannel->engineName() << " " << iChannel << endl; |
787 |
ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannel << endl; |
ts << "LOAD INSTRUMENT NON_MODAL '" << pChannel->instrumentFile() << "' " << pChannel->instrumentNr() << " " << iChannel << endl; |
788 |
ts << "SET CHANNEL VOLUME " << iChannel << " " << pChannel->volume() << endl; |
ts << "SET CHANNEL VOLUME " << iChannel << " " << pChannel->volume() << endl; |
789 |
|
if (pChannel->channelMute()) |
790 |
|
ts << "SET CHANNEL MUTE " << iChannel << " 1" << endl; |
791 |
|
if (pChannel->channelSolo()) |
792 |
|
ts << "SET CHANNEL SOLO " << iChannel << " 1" << endl; |
793 |
ts << endl; |
ts << endl; |
794 |
} |
} |
795 |
} |
} |
1303 |
sText += tr("LSCP (liblscp) instrument_name support disabled."); |
sText += tr("LSCP (liblscp) instrument_name support disabled."); |
1304 |
sText += "</font></small><br />"; |
sText += "</font></small><br />"; |
1305 |
#endif |
#endif |
1306 |
|
#ifndef CONFIG_MUTE_SOLO |
1307 |
|
sText += "<small><font color=\"red\">"; |
1308 |
|
sText += tr("Sampler channel Mute/Solo support disabled."); |
1309 |
|
sText += "</font></small><br />"; |
1310 |
|
#endif |
1311 |
sText += "<br />\n"; |
sText += "<br />\n"; |
1312 |
sText += tr("Using") + ": "; |
sText += tr("Using") + ": "; |
1313 |
sText += ::lscp_client_package(); |
sText += ::lscp_client_package(); |
1314 |
sText += " "; |
sText += " "; |
1315 |
sText += ::lscp_client_version(); |
sText += ::lscp_client_version(); |
1316 |
#if CONFIG_LIBGIG |
#ifdef CONFIG_LIBGIG |
1317 |
sText += ", "; |
sText += ", "; |
1318 |
sText += gig::libraryName(); |
sText += gig::libraryName().c_str(); |
1319 |
sText += " "; |
sText += " "; |
1320 |
sText += gig::libraryVersion(); |
sText += gig::libraryVersion().c_str(); |
1321 |
#endif |
#endif |
1322 |
sText += "<br />\n"; |
sText += "<br />\n"; |
1323 |
sText += "<br />\n"; |
sText += "<br />\n"; |
1647 |
if (m_pOptions->bMessagesLimit) |
if (m_pOptions->bMessagesLimit) |
1648 |
m_pMessages->setMessagesLimit(m_pOptions->iMessagesLimitLines); |
m_pMessages->setMessagesLimit(m_pOptions->iMessagesLimitLines); |
1649 |
else |
else |
1650 |
m_pMessages->setMessagesLimit(0); |
m_pMessages->setMessagesLimit(-1); |
1651 |
} |
} |
1652 |
} |
} |
1653 |
|
|
1831 |
} |
} |
1832 |
} |
} |
1833 |
|
|
1834 |
// Refresh each channel usage, on each period... |
if (m_pClient) { |
1835 |
if (m_pClient && (m_changedStrips.count() > 0 || m_pOptions->bAutoRefresh)) { |
// Update the channel information for each pending strip... |
1836 |
m_iTimerSlot += QSAMPLER_TIMER_MSECS; |
if (m_changedStrips.count() > 0) { |
|
if (m_iTimerSlot >= m_pOptions->iAutoRefreshTime && m_pWorkspace->isUpdatesEnabled()) { |
|
|
m_iTimerSlot = 0; |
|
|
// Update the channel information for each pending strip... |
|
1837 |
for (qsamplerChannelStrip *pChannelStrip = m_changedStrips.first(); |
for (qsamplerChannelStrip *pChannelStrip = m_changedStrips.first(); |
1838 |
pChannelStrip; |
pChannelStrip; pChannelStrip = m_changedStrips.next()) { |
|
pChannelStrip = m_changedStrips.next()) { |
|
1839 |
// If successfull, remove from pending list... |
// If successfull, remove from pending list... |
1840 |
if (pChannelStrip->updateChannelInfo()) |
if (pChannelStrip->updateChannelInfo()) |
1841 |
m_changedStrips.remove(pChannelStrip); |
m_changedStrips.remove(pChannelStrip); |
1842 |
} |
} |
1843 |
// Update the channel stream usage for each strip... |
} |
1844 |
QWidgetList wlist = m_pWorkspace->windowList(); |
// Refresh each channel usage, on each period... |
1845 |
for (int iChannel = 0; iChannel < (int) wlist.count(); iChannel++) { |
if (m_pOptions->bAutoRefresh) { |
1846 |
qsamplerChannelStrip *pChannelStrip = (qsamplerChannelStrip *) wlist.at(iChannel); |
m_iTimerSlot += QSAMPLER_TIMER_MSECS; |
1847 |
if (pChannelStrip && pChannelStrip->isVisible()) |
if (m_iTimerSlot >= m_pOptions->iAutoRefreshTime) { |
1848 |
pChannelStrip->updateChannelUsage(); |
m_iTimerSlot = 0; |
1849 |
|
// Update the channel stream usage for each strip... |
1850 |
|
QWidgetList wlist = m_pWorkspace->windowList(); |
1851 |
|
for (int iChannel = 0; |
1852 |
|
iChannel < (int) wlist.count(); iChannel++) { |
1853 |
|
qsamplerChannelStrip *pChannelStrip |
1854 |
|
= (qsamplerChannelStrip *) wlist.at(iChannel); |
1855 |
|
if (pChannelStrip && pChannelStrip->isVisible()) |
1856 |
|
pChannelStrip->updateChannelUsage(); |
1857 |
|
} |
1858 |
} |
} |
1859 |
} |
} |
1860 |
} |
} |
2038 |
::lscp_client_set_timeout(m_pClient, m_pOptions->iServerTimeout); |
::lscp_client_set_timeout(m_pClient, m_pOptions->iServerTimeout); |
2039 |
appendMessages(tr("Client receive timeout is set to %1 msec.").arg(::lscp_client_get_timeout(m_pClient))); |
appendMessages(tr("Client receive timeout is set to %1 msec.").arg(::lscp_client_get_timeout(m_pClient))); |
2040 |
|
|
2041 |
|
// Subscribe to channel info change notifications... |
2042 |
|
if (::lscp_client_subscribe(m_pClient, LSCP_EVENT_CHANNEL_INFO) != LSCP_OK) |
2043 |
|
appendMessagesClient("lscp_client_subscribe"); |
2044 |
|
|
2045 |
// We may stop scheduling around. |
// We may stop scheduling around. |
2046 |
stopSchedule(); |
stopSchedule(); |
2047 |
|
|
2055 |
// if visible, that we're ready... |
// if visible, that we're ready... |
2056 |
if (m_pDeviceForm && m_pDeviceForm->isVisible()) |
if (m_pDeviceForm && m_pDeviceForm->isVisible()) |
2057 |
m_pDeviceForm->setClient(m_pClient); |
m_pDeviceForm->setClient(m_pClient); |
2058 |
|
|
2059 |
// Is any session pending to be loaded? |
// Is any session pending to be loaded? |
2060 |
if (!m_pOptions->sSessionFile.isEmpty()) { |
if (!m_pOptions->sSessionFile.isEmpty()) { |
2061 |
// Just load the prabably startup session... |
// Just load the prabably startup session... |
2097 |
closeSession(false); |
closeSession(false); |
2098 |
|
|
2099 |
// Close us as a client... |
// Close us as a client... |
2100 |
lscp_client_destroy(m_pClient); |
::lscp_client_unsubscribe(m_pClient, LSCP_EVENT_CHANNEL_INFO); |
2101 |
|
::lscp_client_destroy(m_pClient); |
2102 |
m_pClient = NULL; |
m_pClient = NULL; |
2103 |
|
|
2104 |
// Log final here. |
// Log final here. |