@@ -1002,7 +1002,7 @@ protected: | |||||
CARLA_SAFE_ASSERT_RETURN(fIsRunning,); | CARLA_SAFE_ASSERT_RETURN(fIsRunning,); | ||||
CARLA_SAFE_ASSERT_RETURN(fUiServer.isOk(),); | CARLA_SAFE_ASSERT_RETURN(fUiServer.isOk(),); | ||||
const EngineOptions& options(getOptions()); | |||||
const EngineOptions& options(pData->options); | |||||
const CarlaMutexLocker cml(fUiServer.getWriteLock()); | const CarlaMutexLocker cml(fUiServer.getWriteLock()); | ||||
std::sprintf(fTmpBuf, "ENGINE_OPTION_%i\n", ENGINE_OPTION_PROCESS_MODE); | std::sprintf(fTmpBuf, "ENGINE_OPTION_%i\n", ENGINE_OPTION_PROCESS_MODE); | ||||
@@ -1270,13 +1270,6 @@ protected: | |||||
{ | { | ||||
const PendingRtEventsRunner prt(this); | const PendingRtEventsRunner prt(this); | ||||
if (pData->curPluginCount == 0 && ! kIsPatchbay) | |||||
{ | |||||
FloatVectorOperations::copy(outBuffer[0], inBuffer[0], static_cast<int>(frames)); | |||||
FloatVectorOperations::copy(outBuffer[1], inBuffer[1], static_cast<int>(frames)); | |||||
return; | |||||
} | |||||
// --------------------------------------------------------------- | // --------------------------------------------------------------- | ||||
// Time Info | // Time Info | ||||
@@ -1303,6 +1296,16 @@ protected: | |||||
pData->timeInfo.bbt.beatsPerMinute = timeInfo->bbt.beatsPerMinute; | pData->timeInfo.bbt.beatsPerMinute = timeInfo->bbt.beatsPerMinute; | ||||
} | } | ||||
// --------------------------------------------------------------- | |||||
// Do nothing if no plugins and rack mode | |||||
if (pData->curPluginCount == 0 && ! kIsPatchbay) | |||||
{ | |||||
FloatVectorOperations::copy(outBuffer[0], inBuffer[0], static_cast<int>(frames)); | |||||
FloatVectorOperations::copy(outBuffer[1], inBuffer[1], static_cast<int>(frames)); | |||||
return; | |||||
} | |||||
// --------------------------------------------------------------- | // --------------------------------------------------------------- | ||||
// initialize events | // initialize events | ||||
@@ -1451,9 +1454,29 @@ protected: | |||||
return; | return; | ||||
{ | { | ||||
const EngineTimeInfo& timeInfo(pData->timeInfo); | |||||
const CarlaMutexLocker cml(fUiServer.getWriteLock()); | const CarlaMutexLocker cml(fUiServer.getWriteLock()); | ||||
const ScopedLocale csl; | const ScopedLocale csl; | ||||
// send transport | |||||
fUiServer.writeAndFixMsg("transport"); | |||||
fUiServer.writeAndFixMsg(bool2str(timeInfo.playing)); | |||||
if (timeInfo.valid & EngineTimeInfo::kValidBBT) | |||||
{ | |||||
std::sprintf(fTmpBuf, P_UINT64 ":%i:%i:%i\n", timeInfo.frame, timeInfo.bbt.bar, timeInfo.bbt.beat, timeInfo.bbt.tick); | |||||
fUiServer.writeMsg(fTmpBuf); | |||||
std::sprintf(fTmpBuf, "%f\n", timeInfo.bbt.beatsPerMinute); | |||||
fUiServer.writeMsg(fTmpBuf); | |||||
} | |||||
else | |||||
{ | |||||
std::sprintf(fTmpBuf, P_UINT64 ":0:0:0\n", timeInfo.frame); | |||||
fUiServer.writeMsg(fTmpBuf); | |||||
fUiServer.writeMsg("0.0\n"); | |||||
} | |||||
// send peaks and param outputs for all plugins | |||||
for (uint i=0; i < pData->curPluginCount; ++i) | for (uint i=0; i < pData->curPluginCount; ++i) | ||||
{ | { | ||||
const EnginePluginData& plugData(pData->plugins[i]); | const EnginePluginData& plugData(pData->plugins[i]); | ||||
@@ -3204,6 +3204,16 @@ class CarlaHostPlugin(CarlaHostMeta): | |||||
self.fSupportedFileExts = fileexts | self.fSupportedFileExts = fileexts | ||||
self.fMaxPluginNumber = maxnum | self.fMaxPluginNumber = maxnum | ||||
def _set_transport(self, playing, frame, bar, beat, tick, bpm): | |||||
self.fTransportInfo = { | |||||
"playing": playing, | |||||
"frame": frame, | |||||
"bar": bar, | |||||
"beat": beat, | |||||
"tick": tick, | |||||
"bpm": bpm | |||||
} | |||||
def _add(self, pluginId): | def _add(self, pluginId): | ||||
if len(self.fPluginsInfo) != pluginId: | if len(self.fPluginsInfo) != pluginId: | ||||
return | return | ||||
@@ -58,7 +58,7 @@ class CarlaPanelTime(QDialog): | |||||
self.fLastTransportFrame = 0 | self.fLastTransportFrame = 0 | ||||
self.fLastTransportState = False | self.fLastTransportState = False | ||||
self.fSampleRate = host.get_sample_rate() if host.is_engine_running() else 0.0 | |||||
self.fSampleRate = 0.0 | |||||
#if view == TRANSPORT_VIEW_HMS: | #if view == TRANSPORT_VIEW_HMS: | ||||
#self.fCurTransportView = TRANSPORT_VIEW_HMS | #self.fCurTransportView = TRANSPORT_VIEW_HMS | ||||
@@ -90,17 +90,12 @@ class CarlaPanelTime(QDialog): | |||||
host.EngineStartedCallback.connect(self.slot_handleEngineStartedCallback) | host.EngineStartedCallback.connect(self.slot_handleEngineStartedCallback) | ||||
host.SampleRateChangedCallback.connect(self.slot_handleSampleRateChangedCallback) | host.SampleRateChangedCallback.connect(self.slot_handleSampleRateChangedCallback) | ||||
# ---------------------------------------------------------------------------------------------------- | |||||
# Final setup | |||||
self.refreshTransport(True) | |||||
# -------------------------------------------------------------------------------------------------------- | # -------------------------------------------------------------------------------------------------------- | ||||
# Button actions | # Button actions | ||||
@pyqtSlot(bool) | @pyqtSlot(bool) | ||||
def slot_transportPlayPause(self, toggled): | def slot_transportPlayPause(self, toggled): | ||||
if not self.host.is_engine_running(): | |||||
if self.host.isPlugin or not self.host.is_engine_running(): | |||||
return | return | ||||
if toggled: | if toggled: | ||||
@@ -112,7 +107,7 @@ class CarlaPanelTime(QDialog): | |||||
@pyqtSlot() | @pyqtSlot() | ||||
def slot_transportStop(self): | def slot_transportStop(self): | ||||
if not self.host.is_engine_running(): | |||||
if self.host.isPlugin or not self.host.is_engine_running(): | |||||
return | return | ||||
self.host.transport_pause() | self.host.transport_pause() | ||||
@@ -122,7 +117,7 @@ class CarlaPanelTime(QDialog): | |||||
@pyqtSlot() | @pyqtSlot() | ||||
def slot_transportBackwards(self): | def slot_transportBackwards(self): | ||||
if not self.host.is_engine_running(): | |||||
if self.host.isPlugin or not self.host.is_engine_running(): | |||||
return | return | ||||
newFrame = self.host.get_current_transport_frame() - 100000 | newFrame = self.host.get_current_transport_frame() - 100000 | ||||
@@ -134,7 +129,7 @@ class CarlaPanelTime(QDialog): | |||||
@pyqtSlot() | @pyqtSlot() | ||||
def slot_transportForwards(self): | def slot_transportForwards(self): | ||||
if self.fSampleRate == 0.0 or not self.host.is_engine_running(): | |||||
if self.fSampleRate == 0.0 or self.host.isPlugin or not self.host.is_engine_running(): | |||||
return | return | ||||
newFrame = self.host.get_current_transport_frame() + int(self.fSampleRate*2.5) | newFrame = self.host.get_current_transport_frame() + int(self.fSampleRate*2.5) | ||||
@@ -331,6 +331,12 @@ class CarlaMiniW(ExternalUI, HostWindow): | |||||
srate = float(self.readlineblock()) | srate = float(self.readlineblock()) | ||||
self.host.fSampleRate = srate | self.host.fSampleRate = srate | ||||
elif msg == "transport": | |||||
playing = bool(self.readlineblock() == "true") | |||||
frame, bar, beat, tick = [int(i) for i in self.readlineblock().split(":")] | |||||
bpm = float(self.readlineblock()) | |||||
self.host._set_transport(playing, frame, bar, beat, tick, bpm) | |||||
elif msg == "error": | elif msg == "error": | ||||
error = self.readlineblock().replace("\r", "\n") | error = self.readlineblock().replace("\r", "\n") | ||||
engineCallback(self.host, ENGINE_CALLBACK_ERROR, 0, 0, 0, 0.0, error) | engineCallback(self.host, ENGINE_CALLBACK_ERROR, 0, 0, 0, 0.0, error) | ||||