|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/Input/ALSAMidiIn.C ZynAddSubFX-2.2.1_lash/src/Input/ALSAMidiIn.C
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/Input/ALSAMidiIn.C 2005-03-14 20:54:28.000000000 +0100
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/Input/ALSAMidiIn.C 2005-09-07 10:49:26.397827208 +0200
|
|
|
df75d63 |
@@ -94,3 +94,14 @@
|
|
|
df75d63 |
};
|
|
|
df75d63 |
|
|
|
df75d63 |
|
|
|
df75d63 |
+int ALSAMidiIn::getalsaid() {
|
|
|
df75d63 |
+ if (midi_handle) {
|
|
|
df75d63 |
+ snd_seq_client_info_t* seq_info;
|
|
|
df75d63 |
+ snd_seq_client_info_malloc(&seq_info);
|
|
|
df75d63 |
+ snd_seq_get_client_info(midi_handle, seq_info);
|
|
|
df75d63 |
+ int id = snd_seq_client_info_get_client(seq_info);
|
|
|
df75d63 |
+ snd_seq_client_info_free(seq_info);
|
|
|
df75d63 |
+ return id;
|
|
|
df75d63 |
+ }
|
|
|
df75d63 |
+ return -1;
|
|
|
df75d63 |
+}
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/Input/ALSAMidiIn.h ZynAddSubFX-2.2.1_lash/src/Input/ALSAMidiIn.h
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/Input/ALSAMidiIn.h 2005-03-14 20:54:19.000000000 +0100
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/Input/ALSAMidiIn.h 2005-09-07 10:49:26.398827014 +0200
|
|
|
df75d63 |
@@ -32,6 +32,7 @@
|
|
|
df75d63 |
ALSAMidiIn();
|
|
|
df75d63 |
~ALSAMidiIn();
|
|
|
df75d63 |
void getmidicmd(MidiCmdType &cmdtype,unsigned char &cmdchan,int *cmdparams);
|
|
|
df75d63 |
+ int getalsaid();
|
|
|
df75d63 |
|
|
|
df75d63 |
private:
|
|
|
df75d63 |
snd_seq_t *midi_handle;
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/main.C ZynAddSubFX-2.2.1_lash/src/main.C
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/main.C 2005-04-28 02:15:28.000000000 +0200
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/main.C 2005-09-07 10:49:26.398827014 +0200
|
|
|
df75d63 |
@@ -83,6 +83,10 @@
|
|
|
df75d63 |
OSSaudiooutput *audioout;
|
|
|
df75d63 |
#endif
|
|
|
df75d63 |
|
|
|
df75d63 |
+#include "Misc/LASHClient.h"
|
|
|
df75d63 |
+LASHClient *lash;
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+
|
|
|
df75d63 |
MidiIn *Midi;
|
|
|
df75d63 |
int Pexitprogram=0;//if the UI set this to 1, the program will exit
|
|
|
df75d63 |
|
|
|
df75d63 |
@@ -180,7 +184,20 @@
|
|
|
df75d63 |
void *thread3(void *arg){
|
|
|
df75d63 |
#ifndef DISABLE_GUI
|
|
|
df75d63 |
ui->showUI();
|
|
|
df75d63 |
- while (Pexitprogram==0) Fl::wait();
|
|
|
df75d63 |
+ while (Pexitprogram==0) {
|
|
|
df75d63 |
+ std::string filename;
|
|
|
df75d63 |
+ switch (lash->checkevents(filename)) {
|
|
|
df75d63 |
+ case LASHClient::Save:
|
|
|
df75d63 |
+ ui->do_save_master(const_cast<char*>(filename.c_str()));
|
|
|
df75d63 |
+ lash->confirmevent(LASHClient::Save);
|
|
|
df75d63 |
+ break;
|
|
|
df75d63 |
+ case LASHClient::Restore:
|
|
|
df75d63 |
+ ui->do_load_master(filename.c_str());
|
|
|
df75d63 |
+ lash->confirmevent(LASHClient::Restore);
|
|
|
df75d63 |
+ break;
|
|
|
df75d63 |
+ }
|
|
|
df75d63 |
+ Fl::wait();
|
|
|
df75d63 |
+ }
|
|
|
df75d63 |
#endif
|
|
|
df75d63 |
return(0);
|
|
|
df75d63 |
};
|
|
|
df75d63 |
@@ -312,6 +329,8 @@
|
|
|
df75d63 |
delete(Midi);
|
|
|
df75d63 |
delete(master);
|
|
|
df75d63 |
|
|
|
df75d63 |
+ delete(lash);
|
|
|
df75d63 |
+
|
|
|
df75d63 |
// pthread_mutex_unlock(&master->mutex);
|
|
|
df75d63 |
delete(denormalkillbuf);
|
|
|
df75d63 |
delete(OscilGen::tmpsmps);
|
|
|
df75d63 |
@@ -345,6 +364,9 @@
|
|
|
df75d63 |
|
|
|
df75d63 |
#ifndef VSTAUDIOOUT
|
|
|
df75d63 |
int main(int argc, char *argv[]){
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+ lash = new LASHClient(&argc, &argv, &Pexitprogram);
|
|
|
df75d63 |
+
|
|
|
df75d63 |
config.init();
|
|
|
df75d63 |
int noui=0;
|
|
|
df75d63 |
#ifdef JACKAUDIOOUT
|
|
|
df75d63 |
@@ -488,7 +510,13 @@
|
|
|
df75d63 |
//---------
|
|
|
df75d63 |
|
|
|
df75d63 |
initprogram();
|
|
|
df75d63 |
-
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+ ALSAMidiIn* alsamidi = dynamic_cast<ALSAMidiIn*>(Midi);
|
|
|
df75d63 |
+ if (alsamidi) {
|
|
|
df75d63 |
+ lash->setalsaid(alsamidi->getalsaid());
|
|
|
df75d63 |
+ lash->setjackname(JACKgetname());
|
|
|
df75d63 |
+ }
|
|
|
df75d63 |
+
|
|
|
df75d63 |
if (strlen(loadfile)>1){
|
|
|
df75d63 |
int tmp=master->loadXML(loadfile);
|
|
|
df75d63 |
if (tmp<0) {
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/Makefile ZynAddSubFX-2.2.1_lash/src/Makefile
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/Makefile 2005-04-28 01:45:52.000000000 +0200
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/Makefile 2005-09-07 10:49:26.399826821 +0200
|
|
|
df75d63 |
@@ -70,6 +70,9 @@
|
|
|
df75d63 |
LIBS+= `pkg-config --libs jack`
|
|
|
df75d63 |
endif
|
|
|
df75d63 |
|
|
|
df75d63 |
+CXXFLAGS += `pkg-config --cflags lash-1.0`
|
|
|
df75d63 |
+LIBS += `pkg-config --libs lash-1.0`
|
|
|
df75d63 |
+
|
|
|
df75d63 |
objects=main.o
|
|
|
df75d63 |
SUBDIRS=DSP Effects Input Misc Output Params Synth Seq
|
|
|
df75d63 |
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/Makefile.inc ZynAddSubFX-2.2.1_lash/src/Makefile.inc
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/Makefile.inc 2005-04-28 02:21:35.000000000 +0200
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/Makefile.inc 2005-09-07 10:49:57.647780729 +0200
|
|
|
df75d63 |
@@ -29,9 +29,9 @@
|
|
|
df75d63 |
#parameters (run 'zynaddsubfx --help' for help)
|
|
|
df75d63 |
|
|
|
df75d63 |
#LINUX_AUDIOOUT=OSS_AND_JACK
|
|
|
df75d63 |
-LINUX_AUDIOOUT=OSS
|
|
|
df75d63 |
+#LINUX_AUDIOOUT=OSS
|
|
|
df75d63 |
#LINUX_AUDIOOUT=NONE
|
|
|
df75d63 |
-#LINUX_AUDIOOUT=JACK
|
|
|
df75d63 |
+LINUX_AUDIOOUT=JACK
|
|
|
df75d63 |
#LINUX_AUDIOOUT=JACK_RT JACK_RT support is broken
|
|
|
df75d63 |
#for PortAudio (PA)
|
|
|
df75d63 |
#LINUX_AUDIOOUT=PA
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/Makefile.inc~ ZynAddSubFX-2.2.1_lash/src/Makefile.inc~
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/Makefile.inc~ 1970-01-01 01:00:00.000000000 +0100
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/Makefile.inc~ 2005-04-28 02:21:35.000000000 +0200
|
|
|
df75d63 |
@@ -0,0 +1,80 @@
|
|
|
df75d63 |
+CXX=g++
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+#You can set the on what OS is compiling (Linux/Windows)
|
|
|
df75d63 |
+OS_PORT=LINUX
|
|
|
df75d63 |
+#OS_PORT=WINDOWS
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+#The version of the FFTW which is used (2 or 3)
|
|
|
df75d63 |
+#FFTW_VERSION=2
|
|
|
df75d63 |
+FFTW_VERSION=3
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+#Assembler FLOAT to INT conversions
|
|
|
df75d63 |
+ASM_F2I=YES
|
|
|
df75d63 |
+#ASM_F2I=NO
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+#Graphic user interface disable option (ZynAddSubFX will run only in text-mode)
|
|
|
df75d63 |
+#DISABLE_GUI=YES
|
|
|
df75d63 |
+DISABLE_GUI=NO
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+# L I N U X C O N F I G U R A T I O N
|
|
|
df75d63 |
+#Next line sets the midi input. It can be "ALSA", "OSS" or "NONE".
|
|
|
df75d63 |
+LINUX_MIDIIN=ALSA
|
|
|
df75d63 |
+#LINUX_MIDIIN=OSS
|
|
|
df75d63 |
+#LINUX_MIDIIN=NONE
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+#Next lines sets the audio output (OSS/JACK/PA)
|
|
|
df75d63 |
+#You may use only one at the time
|
|
|
df75d63 |
+#If you use "OSS_AND_JACK",,at runtime, zynaddsubfx will run by the default with jack support and
|
|
|
df75d63 |
+#it will try OSS if JACK fails. At runtime you can set the OSS by default by command-line
|
|
|
df75d63 |
+#parameters (run 'zynaddsubfx --help' for help)
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+#LINUX_AUDIOOUT=OSS_AND_JACK
|
|
|
df75d63 |
+LINUX_AUDIOOUT=OSS
|
|
|
df75d63 |
+#LINUX_AUDIOOUT=NONE
|
|
|
df75d63 |
+#LINUX_AUDIOOUT=JACK
|
|
|
df75d63 |
+#LINUX_AUDIOOUT=JACK_RT JACK_RT support is broken
|
|
|
df75d63 |
+#for PortAudio (PA)
|
|
|
df75d63 |
+#LINUX_AUDIOOUT=PA
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+#Next line sets if the synth is compiled for DSSI plugin (as .so file)
|
|
|
df75d63 |
+#If this setting is "YES", MIDI in and AUDIOOUT are set automatically to DSSI
|
|
|
df75d63 |
+LINUX_DSSI=NO
|
|
|
df75d63 |
+#LINUX_DSSI=YES
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+# W I N D O W S C O N F I G U R A T I O N
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+#Next line sets the midi input
|
|
|
df75d63 |
+#WINDOWS_MIDIIN=NONE
|
|
|
df75d63 |
+WINDOWS_MIDIIN=WIN
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+#Next line sets the audio output
|
|
|
df75d63 |
+#WINDOWS_AUDIOOUT=NONE
|
|
|
df75d63 |
+WINDOWS_AUDIOOUT=PA
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+#Next line sets if the synth is compiled for VST (as .dll file)
|
|
|
df75d63 |
+#If this setting is "YES", MIDI in and AUDIOOUT are set automatically to VST
|
|
|
df75d63 |
+WINDOWS_VST=NO
|
|
|
df75d63 |
+#WINDOWS_VST=YES
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+#configuration end
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+ifeq ($(OS_PORT),LINUX)
|
|
|
df75d63 |
+ MIDIIN=$(LINUX_MIDIIN)
|
|
|
df75d63 |
+ AUDIOOUT=$(LINUX_AUDIOOUT)
|
|
|
df75d63 |
+ WINDOWS_VST=NO
|
|
|
df75d63 |
+ ifeq ($(LINUX_DSSI),YES)
|
|
|
df75d63 |
+ MIDIIN=DSSI
|
|
|
df75d63 |
+ AUDIOOUT=DSSI
|
|
|
df75d63 |
+ endif
|
|
|
df75d63 |
+else
|
|
|
df75d63 |
+ MIDIIN=$(WINDOWS_MIDIIN)
|
|
|
df75d63 |
+ AUDIOOUT=$(WINDOWS_AUDIOOUT)
|
|
|
df75d63 |
+ LINUX_DSSI=NO
|
|
|
df75d63 |
+ ifeq ($(WINDOWS_VST),YES)
|
|
|
df75d63 |
+ MIDIIN=VST
|
|
|
df75d63 |
+ AUDIOOUT=VST
|
|
|
df75d63 |
+ endif
|
|
|
df75d63 |
+endif
|
|
|
df75d63 |
+
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/Misc/lash/lash.h ZynAddSubFX-2.2.1_lash/src/Misc/lash/lash.h
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/Misc/lash/lash.h 1970-01-01 01:00:00.000000000 +0100
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/Misc/lash/lash.h 2005-09-07 10:52:49.060614466 +0200
|
|
|
df75d63 |
@@ -0,0 +1 @@
|
|
|
df75d63 |
+dummy
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/Misc/LASHClient.C ZynAddSubFX-2.2.1_lash/src/Misc/LASHClient.C
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/Misc/LASHClient.C 1970-01-01 01:00:00.000000000 +0100
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/Misc/LASHClient.C 2005-09-07 10:49:26.399826821 +0200
|
|
|
df75d63 |
@@ -0,0 +1,75 @@
|
|
|
df75d63 |
+#include <unistd.h>
|
|
|
df75d63 |
+#include <iostream>
|
|
|
df75d63 |
+#include <string>
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+#include "LASHClient.h"
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+LASHClient::LASHClient(int* argc, char*** argv, int* exitflag) {
|
|
|
df75d63 |
+ this->exitflag = exitflag;
|
|
|
df75d63 |
+ client = lash_init(lash_extract_args(argc, argv), "ZynAddSubFX",
|
|
|
df75d63 |
+ LASH_Config_File, LASH_PROTOCOL(2, 0));
|
|
|
df75d63 |
+}
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+void LASHClient::setalsaid(int id) {
|
|
|
df75d63 |
+ if (lash_enabled(client)) {
|
|
|
df75d63 |
+ if (id != -1)
|
|
|
df75d63 |
+ lash_alsa_client_id(client, id);
|
|
|
df75d63 |
+ }
|
|
|
df75d63 |
+}
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+void LASHClient::setjackname(const char* name) {
|
|
|
df75d63 |
+ if (lash_enabled(client)) {
|
|
|
df75d63 |
+ if (name != NULL)
|
|
|
df75d63 |
+ lash_jack_client_name(client, name);
|
|
|
df75d63 |
+ }
|
|
|
df75d63 |
+}
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+LASHClient::Event LASHClient::checkevents(std::string& filename) {
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+ if (!lash_enabled(client))
|
|
|
df75d63 |
+ return NoEvent;
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+ Event received = NoEvent;
|
|
|
df75d63 |
+ lash_event_t* event;
|
|
|
df75d63 |
+ while (event = lash_get_event(client)) {
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+ // save
|
|
|
df75d63 |
+ if (lash_event_get_type(event) == LASH_Save_File) {
|
|
|
df75d63 |
+ std::cerr<<"LASH event: LASH_Save_File"<
|
|
|
df75d63 |
+ filename = std::string(lash_event_get_string(event)) + "/master.xmz";
|
|
|
df75d63 |
+ received = Save;
|
|
|
df75d63 |
+ break;
|
|
|
df75d63 |
+ }
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+ // restore
|
|
|
df75d63 |
+ else if (lash_event_get_type(event) == LASH_Restore_File) {
|
|
|
df75d63 |
+ std::cerr<<"LASH event: LASH_Restore_File"<
|
|
|
df75d63 |
+ filename = std::string(lash_event_get_string(event)) + "/master.xmz";
|
|
|
df75d63 |
+ received = Restore;
|
|
|
df75d63 |
+ break;
|
|
|
df75d63 |
+ }
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+ // quit
|
|
|
df75d63 |
+ else if (lash_event_get_type(event) == LASH_Quit) {
|
|
|
df75d63 |
+ std::cerr<<"LASH event: LASH_Quit"<
|
|
|
df75d63 |
+ *(exitflag) = 1;
|
|
|
df75d63 |
+ received = Quit;
|
|
|
df75d63 |
+ break;
|
|
|
df75d63 |
+ }
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+ lash_event_destroy(event);
|
|
|
df75d63 |
+ }
|
|
|
df75d63 |
+ return received;
|
|
|
df75d63 |
+}
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+void LASHClient::confirmevent(Event event) {
|
|
|
df75d63 |
+ if (event == Save)
|
|
|
df75d63 |
+ lash_send_event(client, lash_event_new_with_type(LASH_Save_File));
|
|
|
df75d63 |
+ else if (event == Restore)
|
|
|
df75d63 |
+ lash_send_event(client, lash_event_new_with_type(LASH_Restore_File));
|
|
|
df75d63 |
+}
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/Misc/LASHClient.h ZynAddSubFX-2.2.1_lash/src/Misc/LASHClient.h
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/Misc/LASHClient.h 1970-01-01 01:00:00.000000000 +0100
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/Misc/LASHClient.h 2005-09-07 10:49:26.399826821 +0200
|
|
|
df75d63 |
@@ -0,0 +1,35 @@
|
|
|
df75d63 |
+#ifndef LASHClient_h
|
|
|
df75d63 |
+#define LASHClient_h
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+#include <string>
|
|
|
df75d63 |
+#include <pthread.h>
|
|
|
df75d63 |
+#include <lash/lash.h>
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+class LASHClient {
|
|
|
df75d63 |
+ public:
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+ enum Event {
|
|
|
df75d63 |
+ Save,
|
|
|
df75d63 |
+ Restore,
|
|
|
df75d63 |
+ Quit,
|
|
|
df75d63 |
+ NoEvent
|
|
|
df75d63 |
+ };
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+ LASHClient(int* argc, char*** argv, int* exitflag);
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+ void setalsaid(int id);
|
|
|
df75d63 |
+ void setjackname(const char* name);
|
|
|
df75d63 |
+ Event checkevents(std::string& filename);
|
|
|
df75d63 |
+ void confirmevent(Event event);
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+ private:
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+ lash_client_t* client;
|
|
|
df75d63 |
+ pthread_t thread;
|
|
|
df75d63 |
+ int* exitflag;
|
|
|
df75d63 |
+};
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+#endif
|
|
|
df75d63 |
+
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/Misc/Makefile ZynAddSubFX-2.2.1_lash/src/Misc/Makefile
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/Misc/Makefile 2005-03-12 19:16:26.000000000 +0100
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/Misc/Makefile 2005-09-07 10:49:26.400826628 +0200
|
|
|
df75d63 |
@@ -1,6 +1,6 @@
|
|
|
df75d63 |
include ../Makefile.inc
|
|
|
df75d63 |
|
|
|
df75d63 |
-objects=Bank.o Master.o Microtonal.o Part.o Util.o Config.o Dump.o XMLwrapper.o
|
|
|
df75d63 |
+objects=Bank.o Master.o Microtonal.o Part.o Util.o Config.o Dump.o XMLwrapper.o LASHClient.o
|
|
|
df75d63 |
|
|
|
df75d63 |
|
|
|
df75d63 |
all: $(objects)
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/Misc/Master.C ZynAddSubFX-2.2.1_lash/src/Misc/Master.C
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/Misc/Master.C 2005-03-14 20:57:26.000000000 +0100
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/Misc/Master.C 2005-09-07 10:49:26.400826628 +0200
|
|
|
df75d63 |
@@ -640,7 +640,7 @@
|
|
|
df75d63 |
delete(xml);
|
|
|
df75d63 |
};
|
|
|
df75d63 |
|
|
|
df75d63 |
-int Master::saveXML(char *filename){
|
|
|
df75d63 |
+int Master::saveXML(const char *filename){
|
|
|
df75d63 |
XMLwrapper *xml=new XMLwrapper();
|
|
|
df75d63 |
|
|
|
df75d63 |
xml->beginbranch("MASTER");
|
|
|
df75d63 |
@@ -654,7 +654,7 @@
|
|
|
df75d63 |
|
|
|
df75d63 |
|
|
|
df75d63 |
|
|
|
df75d63 |
-int Master::loadXML(char *filename){
|
|
|
df75d63 |
+int Master::loadXML(const char *filename){
|
|
|
df75d63 |
XMLwrapper *xml=new XMLwrapper();
|
|
|
df75d63 |
if (xml->loadXMLfile(filename)<0) {
|
|
|
df75d63 |
delete(xml);
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/Misc/Master.h ZynAddSubFX-2.2.1_lash/src/Misc/Master.h
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/Misc/Master.h 2005-03-14 20:57:29.000000000 +0100
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/Misc/Master.h 2005-09-07 10:49:26.401826434 +0200
|
|
|
df75d63 |
@@ -43,7 +43,7 @@
|
|
|
df75d63 |
|
|
|
df75d63 |
//saves all settings to a XML file
|
|
|
df75d63 |
//returns 0 for ok or <0 if there is an error
|
|
|
df75d63 |
- int saveXML(char *filename);
|
|
|
df75d63 |
+ int saveXML(const char *filename);
|
|
|
df75d63 |
|
|
|
df75d63 |
//this adds the parameters to the XML data
|
|
|
df75d63 |
void add2XML(XMLwrapper *xml);
|
|
|
df75d63 |
@@ -53,7 +53,7 @@
|
|
|
df75d63 |
|
|
|
df75d63 |
//loads all settings from a XML file
|
|
|
df75d63 |
//returns 0 for ok or -1 if there is an error
|
|
|
df75d63 |
- int loadXML(char *filename);
|
|
|
df75d63 |
+ int loadXML(const char *filename);
|
|
|
df75d63 |
void applyparameters();
|
|
|
df75d63 |
|
|
|
df75d63 |
void getfromXML(XMLwrapper *xml);
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/Misc/XMLwrapper.C ZynAddSubFX-2.2.1_lash/src/Misc/XMLwrapper.C
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/Misc/XMLwrapper.C 2005-04-13 00:09:34.000000000 +0200
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/Misc/XMLwrapper.C 2005-09-07 10:49:26.401826434 +0200
|
|
|
df75d63 |
@@ -162,7 +162,7 @@
|
|
|
df75d63 |
|
|
|
df75d63 |
/* SAVE XML members */
|
|
|
df75d63 |
|
|
|
df75d63 |
-int XMLwrapper::saveXMLfile(char *filename){
|
|
|
df75d63 |
+int XMLwrapper::saveXMLfile(const char *filename){
|
|
|
df75d63 |
char *xmldata=getXMLdata();
|
|
|
df75d63 |
if (xmldata==NULL) return(-2);
|
|
|
df75d63 |
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/Misc/XMLwrapper.h ZynAddSubFX-2.2.1_lash/src/Misc/XMLwrapper.h
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/Misc/XMLwrapper.h 2005-03-14 20:57:17.000000000 +0100
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/Misc/XMLwrapper.h 2005-09-07 10:49:26.402826241 +0200
|
|
|
df75d63 |
@@ -43,7 +43,7 @@
|
|
|
df75d63 |
/********************************/
|
|
|
df75d63 |
|
|
|
df75d63 |
//returns 0 if ok or -1 if the file cannot be saved
|
|
|
df75d63 |
- int saveXMLfile(char *filename);
|
|
|
df75d63 |
+ int saveXMLfile(const char *filename);
|
|
|
df75d63 |
|
|
|
df75d63 |
//returns the new allocated string that contains the XML data (used for clipboard)
|
|
|
df75d63 |
//the string is NULL terminated
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/Output/JACKaudiooutput.C ZynAddSubFX-2.2.1_lash/src/Output/JACKaudiooutput.C
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/Output/JACKaudiooutput.C 2005-03-12 19:16:26.000000000 +0100
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/Output/JACKaudiooutput.C 2005-09-07 10:49:26.402826241 +0200
|
|
|
df75d63 |
@@ -25,6 +25,7 @@
|
|
|
df75d63 |
|
|
|
df75d63 |
Master *jackmaster;
|
|
|
df75d63 |
jack_client_t *jackclient;
|
|
|
df75d63 |
+char jackname[100];
|
|
|
df75d63 |
jack_port_t *outport_left,*outport_right;
|
|
|
df75d63 |
|
|
|
df75d63 |
int jackprocess(jack_nframes_t nframes,void *arg);
|
|
|
df75d63 |
@@ -34,12 +35,11 @@
|
|
|
df75d63 |
bool JACKaudiooutputinit(Master *master_){
|
|
|
df75d63 |
jackmaster=master_;
|
|
|
df75d63 |
jackclient=0;
|
|
|
df75d63 |
- char tmpstr[100];
|
|
|
df75d63 |
|
|
|
df75d63 |
for (int i=0;i<15;i++){
|
|
|
df75d63 |
- if (i!=0) snprintf(tmpstr,100,"ZynAddSubFX_%d",i);
|
|
|
df75d63 |
- else snprintf(tmpstr,100,"ZynAddSubFX");
|
|
|
df75d63 |
- jackclient=jack_client_new(tmpstr);
|
|
|
df75d63 |
+ if (i!=0) snprintf(jackname,100,"ZynAddSubFX_%d",i);
|
|
|
df75d63 |
+ else snprintf(jackname,100,"ZynAddSubFX");
|
|
|
df75d63 |
+ jackclient=jack_client_new(jackname);
|
|
|
df75d63 |
if (jackclient!=0) break;
|
|
|
df75d63 |
};
|
|
|
df75d63 |
|
|
|
df75d63 |
@@ -97,4 +97,8 @@
|
|
|
df75d63 |
};
|
|
|
df75d63 |
|
|
|
df75d63 |
|
|
|
df75d63 |
-
|
|
|
df75d63 |
+const char* JACKgetname() {
|
|
|
df75d63 |
+ if (jackclient != NULL)
|
|
|
df75d63 |
+ return jackname;
|
|
|
df75d63 |
+ return NULL;
|
|
|
df75d63 |
+}
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/Output/JACKaudiooutput.h ZynAddSubFX-2.2.1_lash/src/Output/JACKaudiooutput.h
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/Output/JACKaudiooutput.h 2005-03-12 19:16:26.000000000 +0100
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/Output/JACKaudiooutput.h 2005-09-07 10:49:26.402826241 +0200
|
|
|
df75d63 |
@@ -40,6 +40,8 @@
|
|
|
df75d63 |
|
|
|
df75d63 |
bool JACKaudiooutputinit(Master *master_);
|
|
|
df75d63 |
void JACKfinish();
|
|
|
df75d63 |
+const char* JACKgetname();
|
|
|
df75d63 |
+
|
|
|
df75d63 |
|
|
|
df75d63 |
#endif
|
|
|
df75d63 |
|
|
|
df75d63 |
diff -ruN ZynAddSubFX-2.2.1/src/UI/MasterUI.fl ZynAddSubFX-2.2.1_lash/src/UI/MasterUI.fl
|
|
|
df75d63 |
--- ZynAddSubFX-2.2.1/src/UI/MasterUI.fl 2005-04-08 21:50:53.000000000 +0200
|
|
|
df75d63 |
+++ ZynAddSubFX-2.2.1_lash/src/UI/MasterUI.fl 2005-09-07 10:49:26.404825854 +0200
|
|
|
df75d63 |
@@ -413,7 +413,8 @@
|
|
|
df75d63 |
decl {BankUI *bankui;} {}
|
|
|
df75d63 |
}
|
|
|
df75d63 |
|
|
|
df75d63 |
-class MasterUI {} {
|
|
|
df75d63 |
+class MasterUI {open
|
|
|
df75d63 |
+} {
|
|
|
df75d63 |
Function {make_window()} {} {
|
|
|
df75d63 |
Fl_Window masterwindow {
|
|
|
df75d63 |
label zynaddsubfx
|
|
|
df75d63 |
@@ -424,7 +425,7 @@
|
|
|
df75d63 |
config.save();
|
|
|
df75d63 |
*exitprogram=1;
|
|
|
df75d63 |
};
|
|
|
df75d63 |
-\#endif} selected
|
|
|
df75d63 |
+\#endif}
|
|
|
df75d63 |
xywh {353 127 390 465} type Double hide
|
|
|
df75d63 |
} {
|
|
|
df75d63 |
Fl_Menu_Bar mastermenu {
|
|
|
df75d63 |
@@ -1701,11 +1702,16 @@
|
|
|
df75d63 |
|
|
|
df75d63 |
updatepanel();} {}
|
|
|
df75d63 |
}
|
|
|
df75d63 |
- Function {do_load_master()} {} {
|
|
|
df75d63 |
- code {char *filename;
|
|
|
df75d63 |
-filename=fl_file_chooser("Open:","({*.xmz})",NULL,0);
|
|
|
df75d63 |
-if (filename==NULL) return;
|
|
|
df75d63 |
-
|
|
|
df75d63 |
+ Function {do_load_master(const char* file = NULL)} {selected
|
|
|
df75d63 |
+ } {
|
|
|
df75d63 |
+ code {const char *filename;
|
|
|
df75d63 |
+ if (file == NULL) {
|
|
|
df75d63 |
+ filename=fl_file_chooser("Open:","({*.xmz})",NULL,0);
|
|
|
df75d63 |
+ if (filename==NULL) return;
|
|
|
df75d63 |
+ }
|
|
|
df75d63 |
+ else {
|
|
|
df75d63 |
+ filename = file;
|
|
|
df75d63 |
+ }
|
|
|
df75d63 |
|
|
|
df75d63 |
pthread_mutex_lock(&master->mutex);
|
|
|
df75d63 |
//clear all parameters
|
|
|
df75d63 |
@@ -1725,20 +1731,23 @@
|
|
|
df75d63 |
if (result==-10) fl_alert("Error: Could not load the file\\nbecause it is not a zynaddsubfx parameters file.");
|
|
|
df75d63 |
else if (result<0) fl_alert("Error: Could not load the file.");} {}
|
|
|
df75d63 |
}
|
|
|
df75d63 |
- Function {do_save_master()} {} {
|
|
|
df75d63 |
+ Function {do_save_master(char* file = NULL)} {} {
|
|
|
df75d63 |
code {char *filename;
|
|
|
df75d63 |
-int result=0;
|
|
|
df75d63 |
-
|
|
|
df75d63 |
-filename=fl_file_chooser("Save:","({*.xmz})",NULL,0);
|
|
|
df75d63 |
-if (filename==NULL) return;
|
|
|
df75d63 |
-filename=fl_filename_setext(filename,".xmz");
|
|
|
df75d63 |
-
|
|
|
df75d63 |
-result=fileexists(filename);
|
|
|
df75d63 |
-if (result) {
|
|
|
df75d63 |
- result=0;
|
|
|
df75d63 |
- if (!fl_ask("The file exists. \\nOverwrite it?")) return;
|
|
|
df75d63 |
-
|
|
|
df75d63 |
-};
|
|
|
df75d63 |
+ int result=0;
|
|
|
df75d63 |
+ if (file == NULL) {
|
|
|
df75d63 |
+ filename=fl_file_chooser("Save:","({*.xmz})",NULL,0);
|
|
|
df75d63 |
+ if (filename==NULL) return;
|
|
|
df75d63 |
+ filename=fl_filename_setext(filename,".xmz");
|
|
|
df75d63 |
+ result=fileexists(filename);
|
|
|
df75d63 |
+ if (result) {
|
|
|
df75d63 |
+ result=0;
|
|
|
df75d63 |
+ if (!fl_ask("The file exists. Overwrite it?")) return;
|
|
|
df75d63 |
+
|
|
|
df75d63 |
+ }
|
|
|
df75d63 |
+ }
|
|
|
df75d63 |
+ else {
|
|
|
df75d63 |
+ filename = file;
|
|
|
df75d63 |
+ }
|
|
|
df75d63 |
|
|
|
df75d63 |
|
|
|
df75d63 |
pthread_mutex_lock(&master->mutex);
|