Skip to content

Commit

Permalink
* move setParameter into the process fd as well (so as to keep param
Browse files Browse the repository at this point in the history
  changes in sync with process)
  • Loading branch information
cannam committed Dec 3, 2004
1 parent f734c4e commit 06ebb5b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
4 changes: 2 additions & 2 deletions dssi-vst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ DSSIVSTPluginInstance::run(unsigned long sampleCount)
if (!m_controlPorts[i]) continue;

if (m_controlPortsSaved[i] != *m_controlPorts[i]) {
std::cout << "Sending new value " << *m_controlPorts[i]
<< " for control port " << i << std::endl;
// std::cout << "Sending new value " << *m_controlPorts[i]
// << " for control port " << i << std::endl;
m_plugin->setParameter(i, *m_controlPorts[i]);
m_controlPortsSaved[i] = *m_controlPorts[i];
if (++modifiedCount > 10) break;
Expand Down
2 changes: 1 addition & 1 deletion remoteplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifndef REMOTE_PLUGIN_H
#define REMOTE_PLUGIN_H

static const float RemotePluginVersion = 0.98;
static const float RemotePluginVersion = 0.985;

enum RemotePluginDebugLevel {
RemotePluginDebugNone,
Expand Down
6 changes: 3 additions & 3 deletions remotepluginclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ RemotePluginClient::getParameterName(int p)
void
RemotePluginClient::setParameter(int p, float v)
{
writeOpcode(m_controlRequestFd, RemotePluginSetParameter);
writeInt(m_controlRequestFd, p);
writeFloat(m_controlRequestFd, v);
writeOpcode(m_processFd, RemotePluginSetParameter);
writeInt(m_processFd, p);
writeFloat(m_processFd, v);
}

float
Expand Down
21 changes: 7 additions & 14 deletions remotepluginserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,13 @@ RemotePluginServer::dispatchProcessEvents()
// std::cerr << "server process: written" << std::endl;
break;
}

case RemotePluginSetParameter:
{
int pn(readInt(m_processFd));
setParameter(pn, readFloat(m_processFd));
break;
}

case RemotePluginSetCurrentProgram:
setCurrentProgram(readInt(m_processFd));
Expand Down Expand Up @@ -330,13 +337,6 @@ RemotePluginServer::dispatchControlEvents()

switch (opcode) {

case RemotePluginProcess:
case RemotePluginSetCurrentProgram:
case RemotePluginSendMIDIData:
std::cerr << "WARNING: RemotePluginServer: got opcode " << opcode
<< " from control fd, should be a process fd opcode" << std::endl;
break;

case RemotePluginGetVersion:
writeFloat(m_controlResponseFd, getVersion());
break;
Expand Down Expand Up @@ -370,13 +370,6 @@ RemotePluginServer::dispatchControlEvents()
case RemotePluginGetParameterName:
writeString(m_controlResponseFd, getParameterName(readInt(m_controlRequestFd)));
break;

case RemotePluginSetParameter:
{
int pn(readInt(m_controlRequestFd));
setParameter(pn, readFloat(m_controlRequestFd));
break;
}

case RemotePluginGetParameter:
writeFloat(m_controlResponseFd, getParameter(readInt(m_controlRequestFd)));
Expand Down

0 comments on commit 06ebb5b

Please sign in to comment.