Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
* Update from personal repository. Expose LADSPA descriptor; catch so…
Browse files Browse the repository at this point in the history
…me more

  things that may be thrown; build with gcc-4.3; use jack_client_open; bump
  version number.
  • Loading branch information
cannam committed May 22, 2008
1 parent bd07b9c commit 5131ee5
Show file tree
Hide file tree
Showing 17 changed files with 100 additions and 29 deletions.
26 changes: 22 additions & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,29 @@ dssi-vst: a DSSI plugin wrapper for VST plugins
This is a DSSI plugin wrapper for VST effects and instruments with GUI
support.

Copyright (c) 2004-2007 Chris Cannam, [email protected].
Copyright (c) 2004-2008 Chris Cannam, [email protected].

This is the 0.6 release of dssi-vst. This release contains a fix for a
crash in the vsthost program. Otherwise (and particularly in regard to
use of the dssi-vst DSSI plugin itself) it is identical to 0.5.
This is the 0.7 release of dssi-vst.

Changes since version 0.6:

* dssi-vst now exposes a LADSPA descriptor as well as a DSSI
descriptor, and the install target now installs dssi-vst to the
system LADSPA directory as well as the DSSI one. This change
permits you to use dssi-vst to load VST effects in LADSPA hosts,
as well as to load VST effects and instruments in DSSI hosts as
before. When used in a LADSPA host, the VST GUI will not be
shown unless the host supports DSSI-style GUIs for LADSPA
plugins as well -- which most do not.

* The vsthost program uses jack_client_open instead of
jack_client_new, for more predictable client names.

* dssi-vst now compiles with gcc 4.3 and is slightly less likely
than previously to crash on startup.

The 0.6 release contained a fix for a crash in the vsthost program.
Otherwise it was identical to 0.5.

The 0.5 release was the first to officially support the VeSTige
VST-compatibility header from Javier Serrano Polo (see
Expand Down
4 changes: 2 additions & 2 deletions dssi-vst-scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#include <iostream>
Expand Down Expand Up @@ -129,7 +129,7 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow)
char *destFile = 0;

cout << "DSSI VST plugin scanner v0.3" << endl;
cout << "Copyright (c) 2004-2007 Chris Cannam" << endl;
cout << "Copyright (c) 2004-2008 Chris Cannam" << endl;

if (cmdline && cmdline[0]) destFile = strdup(cmdline);

Expand Down
11 changes: 6 additions & 5 deletions dssi-vst-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#include <iostream>
Expand Down Expand Up @@ -1095,7 +1095,7 @@ AudioThreadMain(LPVOID parameter)
cerr << "ERROR: Remote VST server instance failed: " << message << endl;
exiting = true;
} catch (RemotePluginClosedException) {
cerr << "ERROR: Remote VST plugin communication failure" << endl;
cerr << "ERROR: Remote VST plugin communication failure in audio thread" << endl;
exiting = true;
}
}
Expand Down Expand Up @@ -1133,7 +1133,7 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow)
bool tryGui = false, haveGui = true;

cout << "DSSI VST plugin server v" << RemotePluginVersion << endl;
cout << "Copyright (c) 2004-2007 Chris Cannam" << endl;
cout << "Copyright (c) 2004-2008 Chris Cannam" << endl;

char *home = getenv("HOME");

Expand Down Expand Up @@ -1306,7 +1306,7 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow)
cerr << "ERROR: Remote VST startup failed: " << message << endl;
return 1;
} catch (RemotePluginClosedException) {
cerr << "ERROR: Remote VST plugin communication failure" << endl;
cerr << "ERROR: Remote VST plugin communication failure in startup" << endl;
return 1;
}

Expand Down Expand Up @@ -1409,6 +1409,7 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow)

if (tryGui && haveGui && !guiVisible) {
// Running in GUI-always-on mode and GUI has exited: follow it
cerr << "dssi-vst-server: Running in GUI mode and GUI has exited: going with it" << endl;
exiting = true;
}

Expand All @@ -1421,7 +1422,7 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmdshow)
remoteVSTServerInstance->dispatchControl(500);
}
} catch (RemotePluginClosedException) {
cerr << "ERROR: Remote VST plugin communication failure" << endl;
cerr << "ERROR: Remote VST plugin communication failure in GUI thread" << endl;
exiting = true;
break;
}
Expand Down
43 changes: 42 additions & 1 deletion dssi-vst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#include "remotevstclient.h"
Expand All @@ -18,6 +18,8 @@
#include <vector>
#include <string>
#include <iostream>
#include <string.h>
#include <stdlib.h>

// Should be divisible by three
#define MIDI_BUFFER_SIZE 1023
Expand Down Expand Up @@ -196,6 +198,17 @@ DSSIVSTPluginInstance::DSSIVSTPluginInstance(std::string dllName,
delete m_controlPortsSaved; m_controlPortsSaved = 0;
delete m_audioIns; m_audioIns = 0;
delete m_audioOuts; m_audioOuts = 0;

} catch (std::string message) {
std::cerr << "DSSIVSTPluginInstance::DSSIVSTPluginInstance("
<< dllName << "): startup failed: " << message << std::endl;

m_ok = false;
delete m_plugin; m_plugin = 0;
delete m_controlPorts; m_controlPorts = 0;
delete m_controlPortsSaved; m_controlPortsSaved = 0;
delete m_audioIns; m_audioIns = 0;
delete m_audioOuts; m_audioOuts = 0;
}

std::cerr << "DSSIVSTPluginInstance::DSSIVSTPluginInstance(" << dllName << ") construction complete" << std::endl;
Expand Down Expand Up @@ -685,10 +698,37 @@ DSSIVSTPlugin::configure(LADSPA_Handle instance, const char *key,


static DSSIVSTPlugin *_plugin = 0;
static std::vector<int> _ladspaDescriptors;

static void
_makeLADSPADescriptorMap()
{
int i = 0;
const DSSI_Descriptor *dssiDescriptor = 0;
while ((dssiDescriptor = dssi_descriptor(i))) {
if (!dssiDescriptor->run_synth &&
!dssiDescriptor->run_synth_adding &&
!dssiDescriptor->run_multiple_synths &&
!dssiDescriptor->run_multiple_synths_adding) {
_ladspaDescriptors.push_back(i);
}
++i;
}
}

const LADSPA_Descriptor *
ladspa_descriptor(unsigned long index)
{
if (!_plugin) {
_plugin = new DSSIVSTPlugin;
_makeLADSPADescriptorMap();
}
if (index < _ladspaDescriptors.size()) {
const DSSI_Descriptor *dssiDescriptor =
dssi_descriptor(_ladspaDescriptors[index]);
if (!dssiDescriptor) return 0;
return dssiDescriptor->LADSPA_Plugin;
}
return 0;
}

Expand All @@ -697,6 +737,7 @@ dssi_descriptor(unsigned long index)
{
if (!_plugin) {
_plugin = new DSSIVSTPlugin;
_makeLADSPADescriptorMap();
}
return _plugin->queryDescriptor(index);
}
Expand Down
5 changes: 3 additions & 2 deletions dssi-vst_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#include <iostream>
Expand All @@ -19,6 +19,7 @@
#include <sys/time.h>
#include <unistd.h>
#include <time.h>
#include <stdlib.h>

#include <lo/lo.h>
#include <lo/lo_lowlevel.h>
Expand Down Expand Up @@ -184,7 +185,7 @@ int
main(int argc, char **argv)
{
cout << "DSSI VST plugin GUI controller v" << RemotePluginVersion << endl;
cout << "Copyright (c) 2004-2007 Chris Cannam" << endl;
cout << "Copyright (c) 2004-2008 Chris Cannam" << endl;

char *pluginlibname = 0;
char *label = 0;
Expand Down
3 changes: 2 additions & 1 deletion paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#include "paths.h"

#include <iostream>
#include <stdlib.h>

std::vector<std::string>
Paths::getPath(std::string envVar, std::string deflt, std::string defltHomeRelPath)
Expand Down
2 changes: 1 addition & 1 deletion paths.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#ifndef _PATHS_H_
Expand Down
4 changes: 2 additions & 2 deletions rdwrops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#include "rdwrops.h"
Expand Down Expand Up @@ -64,7 +64,7 @@ rdwr_tryWrite(int fd, const void *buf, size_t count, const char *file, int line)

if (w < (ssize_t)count) {
fprintf(stderr, "Failed to complete write on fd %d (have %d, put %d) at %s:%d\n",
fd, count, w, file, line);
fd, (int)count, (int)w, file, line);
throw RemotePluginClosedException();
}

Expand Down
2 changes: 1 addition & 1 deletion rdwrops.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#ifndef _RD_WR_OPS_H_
Expand Down
2 changes: 1 addition & 1 deletion remoteplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#ifndef REMOTE_PLUGIN_H
Expand Down
4 changes: 3 additions & 1 deletion remotepluginclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#include "remotepluginclient.h"
Expand All @@ -16,6 +16,8 @@
#include <unistd.h>
#include <iostream>
#include <errno.h>
#include <stdlib.h>
#include <string.h>

#include "rdwrops.h"

Expand Down
2 changes: 1 addition & 1 deletion remotepluginclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#ifndef REMOTE_PLUGIN_CLIENT_H
Expand Down
4 changes: 3 additions & 1 deletion remotepluginserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#include "remotepluginserver.h"
Expand All @@ -17,6 +17,8 @@

#include <time.h>
#include <iostream>
#include <stdlib.h>
#include <string.h>

#include "rdwrops.h"

Expand Down
2 changes: 1 addition & 1 deletion remotepluginserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#ifndef REMOTE_PLUGIN_SERVER_H
Expand Down
7 changes: 6 additions & 1 deletion remotevstclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#include "remotevstclient.h"
Expand All @@ -17,6 +17,7 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <errno.h>
#include <stdlib.h>

#include "rdwrops.h"
#include "paths.h"
Expand Down Expand Up @@ -80,6 +81,8 @@ RemoteVSTClient::RemoteVSTClient(std::string dllName, bool showGUI) :
exit(1);
}
}

break;
}

if (!found) {
Expand Down Expand Up @@ -342,6 +345,8 @@ RemoteVSTClient::queryPlugins(std::vector<PluginRecord> &plugins)
exit(1);
}
}

break;
}

if (!found) {
Expand Down
2 changes: 1 addition & 1 deletion remotevstclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#ifndef REMOTE_VST_CLIENT_H
Expand Down
6 changes: 3 additions & 3 deletions vsthost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
dssi-vst: a DSSI plugin wrapper for VST effects and instruments
Copyright 2004-2007 Chris Cannam
Copyright 2004-2008 Chris Cannam
*/

#include <ctype.h>
Expand Down Expand Up @@ -355,9 +355,9 @@ openJack(const char *pluginName)
}
}
tmpbuf[j] = '\0';
snprintf(jackName, 26, "vst_%s_%u", tmpbuf, getpid());
snprintf(jackName, 26, "vst_%s", tmpbuf);

if ((jackData.client = jack_client_new(jackName)) == 0) {
if ((jackData.client = jack_client_open(jackName, JackNullOption, NULL)) == 0) {
fprintf(stderr, "ERROR: Failed to connect to JACK server -- jackd not running?\n");
return 1;
}
Expand Down

0 comments on commit 5131ee5

Please sign in to comment.