sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[SM-Commit] GIT changes to master grimoire by Juuso Alasuutari (e0285ff8d14eff1be12ece29786be0dc93e7ebe2)
- From: Juuso Alasuutari <scm AT mail.sourcemage.org>
- To: sm-commit AT lists.ibiblio.org
- Subject: [SM-Commit] GIT changes to master grimoire by Juuso Alasuutari (e0285ff8d14eff1be12ece29786be0dc93e7ebe2)
- Date: Mon, 28 Aug 2006 07:34:33 -0500
GIT changes to master grimoire by Juuso Alasuutari <iuso AT sourcemage.org>:
ChangeLog | 3
audio-creation/zynaddsubfx/BUILD | 13
audio-creation/zynaddsubfx/CONFIGURE | 17 +
audio-creation/zynaddsubfx/DEPENDS | 26 +
audio-creation/zynaddsubfx/DETAILS | 17 +
audio-creation/zynaddsubfx/HISTORY | 4
audio-creation/zynaddsubfx/INSTALL | 14
audio-creation/zynaddsubfx/PRE_BUILD | 36 ++
audio-creation/zynaddsubfx/zyn_debian.diff | 192 +++++++++++
audio-creation/zynaddsubfx/zyn_lash.diff | 428
++++++++++++++++++++++++++
audio-creation/zynaddsubfx/zyn_unzombify.diff | 20 +
11 files changed, 770 insertions(+)
New commits:
commit e0285ff8d14eff1be12ece29786be0dc93e7ebe2
Author: Juuso Alasuutari <iuso AT sourcemage.org>
Commit: Juuso Alasuutari <iuso AT sourcemage.org>
zynaddsubfx: New spell, software synthesizer.
diff --git a/ChangeLog b/ChangeLog
index 33345a7..2be4326 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2006-08-28 Juuso Alasuutari <iuso AT sourcemage.org>
+ * audio-creation/zynaddsubfx: New spell, software synthesizer.
+
2006-08-27 Flavien Bridault <vlaaad AT sourcemage.org>
* disk/video-dvdrip: deprecated in favour of dvdrip (bug #11545)
diff --git a/audio-creation/zynaddsubfx/BUILD
b/audio-creation/zynaddsubfx/BUILD
new file mode 100755
index 0000000..b700e16
--- /dev/null
+++ b/audio-creation/zynaddsubfx/BUILD
@@ -0,0 +1,13 @@
+# Build standalone synth
+if [[ "$BUILD_MODE" != "DSSI plugin" ]]; then
+ cd src &&
+ make &&
+ cd ..
+fi &&
+
+# Build DSSI plugin
+if [[ "$BUILD_MODE" != "Standalone synth" ]]; then
+ cd src_dssi &&
+ make &&
+ cd ..
+fi
diff --git a/audio-creation/zynaddsubfx/CONFIGURE
b/audio-creation/zynaddsubfx/CONFIGURE
new file mode 100755
index 0000000..b429da5
--- /dev/null
+++ b/audio-creation/zynaddsubfx/CONFIGURE
@@ -0,0 +1,17 @@
+config_query_list BUILD_MODE "Select build mode:" \
+ "Standalone synth" "DSSI plugin" Both &&
+
+if [[ "$BUILD_MODE" == "DSSI plugin" ]]; then
+ message "${MESSAGE_COLOR}Building DSSI plugin only, MIDI In and" \
+ "Audio Out are set automatically to DSSI.${DEFAULT_COLOR}"
+else
+ config_query_list LINUX_MIDIIN "Select MIDI input driver:" \
+ ALSA OSS NONE &&
+ config_query_list LINUX_AUDIOOUT "Select audio output driver:" \
+ OSS OSS_AND_JACK JACK PA NONE
+fi &&
+
+config_query ZYN_EXAMPLES "Install example banks and presets?" y &&
+
+config_query_option ASM_F2I "Use assembler FLOAT to INT conversions?" y \
+ YES NO
diff --git a/audio-creation/zynaddsubfx/DEPENDS
b/audio-creation/zynaddsubfx/DEPENDS
new file mode 100755
index 0000000..3f53b6c
--- /dev/null
+++ b/audio-creation/zynaddsubfx/DEPENDS
@@ -0,0 +1,26 @@
+depends g++ &&
+depends fftw &&
+depends mxml &&
+
+if [[ "$BUILD_MODE" != "Standalone synth" ]]; then
+ depends dssi
+fi &&
+
+if [[ "$BUILD_MODE" != "DSSI plugin" ]]; then
+ if [[ "$LINUX_MIDIIN" == ALSA ]]; then
+ depends alsa-lib
+ fi &&
+ case "$LINUX_AUDIOOUT" in
+ *JACK* ) depends jack;;
+ PA ) depends portaudio;;
+ esac
+fi &&
+
+if [[ "$LINUX_MIDIIN" == ALSA ]]; then
+ if [[ "$LINUX_AUDIOOUT" == JACK ]] ||
+ [[ "$LINUX_AUDIOOUT" == OSS_AND_JACK ]]; then
+ optional_depends lash "" "" "for Linux Audio Session Handler support"
+ fi
+fi &&
+
+optional_depends fltk "" "" "to enable Graphical User Interface"
diff --git a/audio-creation/zynaddsubfx/DETAILS
b/audio-creation/zynaddsubfx/DETAILS
new file mode 100755
index 0000000..236455a
--- /dev/null
+++ b/audio-creation/zynaddsubfx/DETAILS
@@ -0,0 +1,17 @@
+ SPELL=zynaddsubfx
+ VERSION=2.2.1
+ SOURCE=ZynAddSubFX-$VERSION.tar.bz2
+ SOURCE_URL[0]=$SOURCEFORGE_URL/$SPELL/$SOURCE
+
SOURCE_HASH=sha512:defc1c0a29a7184ad8fad410dbf615df4f0c746f51682ed14847e70e422850a4146fbca753901b9fc3e8108ad5700304ef1ac9986d240e44f31bfc0c293c5d0a
+SOURCE_DIRECTORY=$BUILD_DIRECTORY/ZynAddSubFX-$VERSION
+ WEB_SITE=http://zynaddsubfx.sourceforge.net/
+ LICENSE[0]=GPL
+ ENTERED=20060828
+ KEYWORDS="editors audio"
+ SHORT="An opensource software synthesizer."
+cat << EOF
+ZynAddSubFX is a opensource software synthesizer capable of making a
+countless number of instruments, from some common heared from expensive
+hardware to interesting sounds that you'll boost to an amazing universe
+of sounds.
+EOF
diff --git a/audio-creation/zynaddsubfx/HISTORY
b/audio-creation/zynaddsubfx/HISTORY
new file mode 100644
index 0000000..4f2edf2
--- /dev/null
+++ b/audio-creation/zynaddsubfx/HISTORY
@@ -0,0 +1,4 @@
+2006-08-28 Juuso Alasuutari <iuso AT sourcemage.org>
+ * DETAILS, CONFIGURE, DEPENDS, PRE_BUILD, BUILD,
+ INSTALL, HISTORY, zyn_debian.diff, zyn_unzombify.diff,
+ zyn_lash.diff: created spell
diff --git a/audio-creation/zynaddsubfx/INSTALL
b/audio-creation/zynaddsubfx/INSTALL
new file mode 100755
index 0000000..5e7683b
--- /dev/null
+++ b/audio-creation/zynaddsubfx/INSTALL
@@ -0,0 +1,14 @@
+if [[ "$BUILD_MODE" != "DSSI plugin" ]]; then
+ cp src/zynaddsubfx $INSTALL_ROOT/usr/bin/
+fi &&
+
+if [[ "$BUILD_MODE" != "Standalone synth" ]]; then
+ mkdir -p $INSTALL_ROOT/usr/lib/dssi/ &&
+ cp src_dssi/zynaddsubfx.so $INSTALL_ROOT/usr/lib/dssi/
+fi &&
+
+if [[ "$ZYN_EXAMPLES" == y ]]; then
+ mkdir -p $INSTALL_ROOT/usr/share/$SPELL/ &&
+ cp -r banks/ $INSTALL_ROOT/usr/share/$SPELL/ &&
+ cp -r presets/ $INSTALL_ROOT/usr/share/$SPELL/
+fi
diff --git a/audio-creation/zynaddsubfx/PRE_BUILD
b/audio-creation/zynaddsubfx/PRE_BUILD
new file mode 100755
index 0000000..42a62ae
--- /dev/null
+++ b/audio-creation/zynaddsubfx/PRE_BUILD
@@ -0,0 +1,36 @@
+default_pre_build &&
+cd $SOURCE_DIRECTORY &&
+
+# Apply bugfixes from Debian
+patch -p1 < $SCRIPT_DIRECTORY/zyn_debian.diff &&
+
+# Apply config options shared by standalone & DSSI builds
+sedit "s/^ASM_F2I=.*/ASM_F2I=$ASM_F2I/" src/Makefile.inc &&
+if ! is_depends_enabled $SPELL fltk; then
+ sedit "s/^DISABLE_GUI=.*/DISABLE_GUI=YES/" src/Makefile.inc
+fi &&
+
+# Make a copy of the build dir for DSSI build (if only DSSI is selected
+# we can simply rename the existing dir)
+if [[ "$BUILD_MODE" != "Standalone synth" ]]; then
+ if [[ "$BUILD_MODE" == "DSSI plugin" ]]; then
+ mv src/ src_dssi/
+ else
+ mkdir src_dssi/ &&
+ cp -r src/* src_dssi/
+ fi &&
+ sedit "s/^LINUX_DSSI=.*/LINUX_DSSI=YES/" src_dssi/Makefile.inc
+fi &&
+
+# Apply JACK unzombify + LASH support patches (do this after the DSSI
+# stuff above, borks compile otherwise)
+patch -p1 < $SCRIPT_DIRECTORY/zyn_unzombify.diff &&
+if is_depends_enabled $SPELL lash; then
+ patch -p1 < $SCRIPT_DIRECTORY/zyn_lash.diff
+fi &&
+
+# If standalone is enabled apply midi & audio configs
+if [[ "$BUILD_MODE" != "DSSI plugin" ]]; then
+ sedit "s/^LINUX_MIDIIN=.*/LINUX_MIDIIN=$LINUX_MIDIIN/" src/Makefile.inc
&&
+ sedit "s/^LINUX_AUDIOOUT=.*/LINUX_AUDIOOUT=$LINUX_AUDIOOUT/"
src/Makefile.inc
+fi
diff --git a/audio-creation/zynaddsubfx/zyn_debian.diff
b/audio-creation/zynaddsubfx/zyn_debian.diff
new file mode 100644
index 0000000..3adcbf7
--- /dev/null
+++ b/audio-creation/zynaddsubfx/zyn_debian.diff
@@ -0,0 +1,192 @@
+--- zynaddsubfx-2.2.1.orig/src/Synth/LFO.C
++++ zynaddsubfx-2.2.1/src/Synth/LFO.C
+@@ -108,7 +108,12 @@
+ else out*=lfointensity*amp2;
+ if (lfodelay<0.00001) {
+ if (freqrndenabled==0) x+=incx;
+- else x+=incx*(incrnd*(1.0-x)+nextincrnd*x);
++ else {
++ float tmp=(incrnd*(1.0-x)+nextincrnd*x);
++ if (tmp>1.0) tmp=1.0;
++ else if (tmp<0.0) tmp=0.0;
++ x+=incx*tmp;
++ };
+ if (x>=1) {
+ x=fmod(x,1.0);
+ amp1=amp2;
+@@ -136,6 +141,5 @@
+ if (freqrndenabled==0) return;
+ incrnd=nextincrnd;
+ nextincrnd=pow(0.5,lfofreqrnd)+RND*(pow(2.0,lfofreqrnd)-1.0);
+- if (nextincrnd*incx>=0.49999999) nextincrnd=1.0;
+ };
+
+--- zynaddsubfx-2.2.1.orig/src/Params/EnvelopeParams.C
++++ zynaddsubfx-2.2.1/src/Params/EnvelopeParams.C
+@@ -51,7 +51,7 @@
+ };
+
+ REALTYPE EnvelopeParams::getdt(char i){
+- REALTYPE result=(pow(2.0,Penvdt[i]/127.0*12.0)-1.0)*10.0;//miliseconds
++ REALTYPE
result=(pow(2.0,Penvdt[(int)i]/127.0*12.0)-1.0)*10.0;//miliseconds
+ return(result);
+ };
+
+--- zynaddsubfx-2.2.1.orig/src/Output/JACKaudiooutput.C
++++ zynaddsubfx-2.2.1/src/Output/JACKaudiooutput.C
+@@ -35,6 +35,7 @@
+ jackmaster=master_;
+ jackclient=0;
+ char tmpstr[100];
++ const char **ports;
+
+ for (int i=0;i<15;i++){
+ if (i!=0) snprintf(tmpstr,100,"ZynAddSubFX_%d",i);
+@@ -50,7 +51,7 @@
+
+ fprintf(stderr,"Internal SampleRate = %d\nJack Output SampleRate=
%d\n",SAMPLE_RATE,jack_get_sample_rate(jackclient));
+ if ((unsigned int)jack_get_sample_rate(jackclient)!=(unsigned int)
SAMPLE_RATE)
+- fprintf(stderr,"It is recomanded that the both samplerates to be
equal.\n");
++ fprintf(stderr,"It is recommended that the both samplerates to be
equal.\n");
+
+ jack_set_process_callback(jackclient,jackprocess,0);
+ jack_set_sample_rate_callback(jackclient,jacksrate,0);
+@@ -66,10 +67,20 @@
+ return(false);
+ };
+
+- /*
++
++ /*
+ jack_connect(jackclient,jack_port_name(outport_left),"alsa_pcm:out_1");
+ jack_connect(jackclient,jack_port_name(outport_right),"alsa_pcm:out_2");
+- */
++ */
++
++ if ((ports = jack_get_ports (jackclient, NULL, NULL,
JackPortIsPhysical|JackPortIsInput)) == NULL)
++ fprintf(stderr,"Cannot connect to jack output, you may hear no
sound\n"); else {
++ if (jack_connect(jackclient,jack_port_name(outport_left),ports[0]))
++ fprintf(stderr,"Cannot connect to left output port\n");
++ if (jack_connect(jackclient,jack_port_name(outport_right),ports[1]))
++ fprintf(stderr,"Cannot connect to right output port\n");
++ }
++
+ return(true);
+ };
+
+--- zynaddsubfx-2.2.1.orig/src/Output/OSSaudiooutput.C
++++ zynaddsubfx-2.2.1/src/Output/OSSaudiooutput.C
+@@ -31,6 +31,19 @@
+ #include "OSSaudiooutput.h"
+ #include "../Misc/Util.h"
+
++#if __BYTE_ORDER == __BIG_ENDIAN
++/* borrowed from glib2 */
++#define SHORT_SWAP_LE_BE(val) ((short) ( \
++ (short) ((short) (val) >> 8) | \
++ (short) ((short) (val) << 8)))
++
++void swap_endian(short *data, int length)
++{
++ int i;
++ for (i = 0; i < length; i += 1, data++)
++ *data = SHORT_SWAP_LE_BE(*data);
++}
++#endif
+ OSSaudiooutput::OSSaudiooutput(){
+ int i;
+ int snd_bitsize=16;
+@@ -76,6 +89,9 @@
+ smps[i*2]=(short int) (l*32767.0);
+ smps[i*2+1]=(short int) (r*32767.0);
+ };
++#if __BYTE_ORDER == __BIG_ENDIAN
++ swap_endian(smps, SOUND_BUFFER_SIZE*4);
++#endif
+ write(snd_handle,smps,SOUND_BUFFER_SIZE*4);// *2 because is 16 bit,
again * 2 because is stereo
+ };
+
+--- zynaddsubfx-2.2.1.orig/src/UI/BankUI.fl
++++ zynaddsubfx-2.2.1/src/UI/BankUI.fl
+@@ -35,6 +35,8 @@
+ } {}
+ decl {Bank *bank;} {public
+ }
++ Function {~BankProcess_()} {return_type virtual
++ } {code {} {}}
+ }
+
+ class BankSlot {: {public Fl_Button,BankProcess_}
+--- zynaddsubfx-2.2.1.orig/src/UI/PartUI.fl
++++ zynaddsubfx-2.2.1/src/UI/PartUI.fl
+@@ -86,6 +86,8 @@
+ class PartUI_ {} {
+ Function {showparameters(int kititem,int engine)} {return_type virtual
+ } {}
++ Function {~PartUI_()} {return_type virtual} { code {} {}
++ }
+ }
+
+ class PartKitItem {: {public Fl_Group}
+--- zynaddsubfx-2.2.1.orig/src/UI/VirKeyboard.fl
++++ zynaddsubfx-2.2.1/src/UI/VirKeyboard.fl
+@@ -168,7 +168,8 @@
+ }
+ Function {presskey(int nk,int exclusive,int type)} {} {
+ code {if (nk>=N_OCT*12) return;
+-if ((nk<0)&&(exclusive==0)) {
++if ((nk<0)) {
++ if(exclusive==0)
+ relaseallkeys(type);
+ return;
+ };
+--- zynaddsubfx-2.2.1.orig/src/main.C
++++ zynaddsubfx-2.2.1/src/main.C
+@@ -90,7 +90,7 @@
+ * Try to get the realtime priority
+ */
+ void set_realtime(){
+-#ifdef OS_LINUX
++#if 0
+ sched_param sc;
+
+ sc.sched_priority=50;
+@@ -230,7 +230,7 @@
+ */
+
+
+-void initprogram(){
++void initprogram(int noui){
+ #ifndef JACKAUDIOOUT
+ #ifndef JACK_RTAUDIOOUT
+ fprintf(stderr,"\nSample Rate = \t\t%d\n",SAMPLE_RATE);
+@@ -284,7 +284,8 @@
+ Midi=new NULLMidiIn();
+ #endif
+ #ifndef DISABLE_GUI
+- ui=new MasterUI(master,&Pexitprogram);
++ if (noui==0)
++ ui=new MasterUI(master,&Pexitprogram);
+ #endif
+ };
+
+@@ -475,8 +476,10 @@
+ fprintf(stderr,"%s"," -D , --dump\t\t\t\t Dumps midi note ON/OFF
commands\n");
+ fprintf(stderr,"%s"," -U , --no-gui\t\t\t\t Run ZynAddSubFX without
user interface\n");
+ #ifdef JACKAUDIOOUT
++#ifdef OSSAUDIOOUT
+ fprintf(stderr,"%s"," -A , --not-use-jack\t\t\t Use OSS/ALSA instead
of JACK\n");
+ #endif
++#endif
+ #ifdef OS_WINDOWS
+ fprintf(stderr,"%s","\nWARNING: On Windows systems, only short
comandline parameters works.\n");
+ fprintf(stderr,"%s"," eg. instead '--buffer-size=512' use '-b
512'\n");
+@@ -487,7 +490,7 @@
+
+ //---------
+
+- initprogram();
++ initprogram(noui);
+
+ if (strlen(loadfile)>1){
+ int tmp=master->loadXML(loadfile);
diff --git a/audio-creation/zynaddsubfx/zyn_lash.diff
b/audio-creation/zynaddsubfx/zyn_lash.diff
new file mode 100644
index 0000000..6937c60
--- /dev/null
+++ b/audio-creation/zynaddsubfx/zyn_lash.diff
@@ -0,0 +1,428 @@
+--- a/src/Input/ALSAMidiIn.C 2005-03-14 21:54:28.000000000 +0200
++++ b/src/Input/ALSAMidiIn.C 2006-08-26 12:32:53.000000000 +0300
+@@ -94,3 +94,14 @@
+ };
+
+
++int ALSAMidiIn::getalsaid() {
++ if (midi_handle) {
++ snd_seq_client_info_t* seq_info;
++ snd_seq_client_info_malloc(&seq_info);
++ snd_seq_get_client_info(midi_handle, seq_info);
++ int id = snd_seq_client_info_get_client(seq_info);
++ snd_seq_client_info_free(seq_info);
++ return id;
++ }
++ return -1;
++}
+--- a/src/Input/ALSAMidiIn.h 2005-03-14 21:54:19.000000000 +0200
++++ b/src/Input/ALSAMidiIn.h 2006-08-26 12:32:53.000000000 +0300
+@@ -32,6 +32,7 @@
+ ALSAMidiIn();
+ ~ALSAMidiIn();
+ void getmidicmd(MidiCmdType &cmdtype,unsigned char &cmdchan,int
*cmdparams);
++ int getalsaid();
+
+ private:
+ snd_seq_t *midi_handle;
+--- a/src/main.C 2006-08-26 12:31:33.000000000 +0300
++++ b/src/main.C 2006-08-26 12:32:53.000000000 +0300
+@@ -83,6 +83,10 @@
+ OSSaudiooutput *audioout;
+ #endif
+
++#include "Misc/LASHClient.h"
++LASHClient *lash;
++
++
+ MidiIn *Midi;
+ int Pexitprogram=0;//if the UI set this to 1, the program will exit
+
+@@ -180,7 +184,20 @@
+ void *thread3(void *arg){
+ #ifndef DISABLE_GUI
+ ui->showUI();
+- while (Pexitprogram==0) Fl::wait();
++ while (Pexitprogram==0) {
++ std::string filename;
++ switch (lash->checkevents(filename)) {
++ case LASHClient::Save:
++ ui->do_save_master(const_cast<char*>(filename.c_str()));
++ lash->confirmevent(LASHClient::Save);
++ break;
++ case LASHClient::Restore:
++ ui->do_load_master(filename.c_str());
++ lash->confirmevent(LASHClient::Restore);
++ break;
++ }
++ Fl::wait();
++ }
+ #endif
+ return(0);
+ };
+@@ -313,6 +330,8 @@
+ delete(Midi);
+ delete(master);
+
++ delete(lash);
++
+ // pthread_mutex_unlock(&master->mutex);
+ delete(denormalkillbuf);
+ delete(OscilGen::tmpsmps);
+@@ -346,6 +365,9 @@
+
+ #ifndef VSTAUDIOOUT
+ int main(int argc, char *argv[]){
++
++ lash = new LASHClient(&argc, &argv, &Pexitprogram);
++
+ config.init();
+ int noui=0;
+ #ifdef JACKAUDIOOUT
+@@ -491,7 +513,13 @@
+ //---------
+
+ initprogram(noui);
+-
++
++ ALSAMidiIn* alsamidi = dynamic_cast<ALSAMidiIn*>(Midi);
++ if (alsamidi) {
++ lash->setalsaid(alsamidi->getalsaid());
++ lash->setjackname(JACKgetname());
++ }
++
+ if (strlen(loadfile)>1){
+ int tmp=master->loadXML(loadfile);
+ if (tmp<0) {
+--- a/src/Makefile 2005-04-28 02:45:52.000000000 +0300
++++ b/src/Makefile 2006-08-26 12:32:53.000000000 +0300
+@@ -70,6 +70,9 @@
+ LIBS+= `pkg-config --libs jack`
+ endif
+
++CXXFLAGS += `pkg-config --cflags lash-1.0`
++LIBS += `pkg-config --libs lash-1.0`
++
+ objects=main.o
+ SUBDIRS=DSP Effects Input Misc Output Params Synth Seq
+
+--- a/src/Misc/lash/lash.h 1970-01-01 02:00:00.000000000 +0200
++++ b/src/Misc/lash/lash.h 2006-08-26 12:32:53.000000000 +0300
+@@ -0,0 +1 @@
++dummy
+--- a/src/Misc/LASHClient.C 1970-01-01 02:00:00.000000000 +0200
++++ b/src/Misc/LASHClient.C 2006-08-26 12:32:53.000000000 +0300
+@@ -0,0 +1,75 @@
++#include <unistd.h>
++#include <iostream>
++#include <string>
++
++#include "LASHClient.h"
++
++
++LASHClient::LASHClient(int* argc, char*** argv, int* exitflag) {
++ this->exitflag = exitflag;
++ client = lash_init(lash_extract_args(argc, argv), "ZynAddSubFX",
++ LASH_Config_File, LASH_PROTOCOL(2, 0));
++}
++
++
++void LASHClient::setalsaid(int id) {
++ if (lash_enabled(client)) {
++ if (id != -1)
++ lash_alsa_client_id(client, id);
++ }
++}
++
++
++void LASHClient::setjackname(const char* name) {
++ if (lash_enabled(client)) {
++ if (name != NULL)
++ lash_jack_client_name(client, name);
++ }
++}
++
++
++LASHClient::Event LASHClient::checkevents(std::string& filename) {
++
++ if (!lash_enabled(client))
++ return NoEvent;
++
++ Event received = NoEvent;
++ lash_event_t* event;
++ while (event = lash_get_event(client)) {
++
++ // save
++ if (lash_event_get_type(event) == LASH_Save_File) {
++ std::cerr<<"LASH event: LASH_Save_File"<<std::endl;
++ filename = std::string(lash_event_get_string(event)) + "/master.xmz";
++ received = Save;
++ break;
++ }
++
++ // restore
++ else if (lash_event_get_type(event) == LASH_Restore_File) {
++ std::cerr<<"LASH event: LASH_Restore_File"<<std::endl;
++ filename = std::string(lash_event_get_string(event)) + "/master.xmz";
++ received = Restore;
++ break;
++ }
++
++ // quit
++ else if (lash_event_get_type(event) == LASH_Quit) {
++ std::cerr<<"LASH event: LASH_Quit"<<std::endl;
++ *(exitflag) = 1;
++ received = Quit;
++ break;
++ }
++
++ lash_event_destroy(event);
++ }
++ return received;
++}
++
++
++void LASHClient::confirmevent(Event event) {
++ if (event == Save)
++ lash_send_event(client, lash_event_new_with_type(LASH_Save_File));
++ else if (event == Restore)
++ lash_send_event(client, lash_event_new_with_type(LASH_Restore_File));
++}
+--- a/src/Misc/LASHClient.h 1970-01-01 02:00:00.000000000 +0200
++++ b/src/Misc/LASHClient.h 2006-08-26 12:32:53.000000000 +0300
+@@ -0,0 +1,35 @@
++#ifndef LASHClient_h
++#define LASHClient_h
++
++#include <string>
++#include <pthread.h>
++#include <lash/lash.h>
++
++
++class LASHClient {
++ public:
++
++ enum Event {
++ Save,
++ Restore,
++ Quit,
++ NoEvent
++ };
++
++ LASHClient(int* argc, char*** argv, int* exitflag);
++
++ void setalsaid(int id);
++ void setjackname(const char* name);
++ Event checkevents(std::string& filename);
++ void confirmevent(Event event);
++
++ private:
++
++ lash_client_t* client;
++ pthread_t thread;
++ int* exitflag;
++};
++
++
++#endif
++
+--- a/src/Misc/Makefile 2005-03-12 20:16:26.000000000 +0200
++++ b/src/Misc/Makefile 2006-08-26 12:32:53.000000000 +0300
+@@ -1,6 +1,6 @@
+ include ../Makefile.inc
+
+-objects=Bank.o Master.o Microtonal.o Part.o Util.o Config.o Dump.o
XMLwrapper.o
++objects=Bank.o Master.o Microtonal.o Part.o Util.o Config.o Dump.o
XMLwrapper.o LASHClient.o
+
+
+ all: $(objects)
+--- a/src/Misc/Master.C 2005-03-14 21:57:26.000000000 +0200
++++ b/src/Misc/Master.C 2006-08-26 12:32:53.000000000 +0300
+@@ -640,7 +640,7 @@
+ delete(xml);
+ };
+
+-int Master::saveXML(char *filename){
++int Master::saveXML(const char *filename){
+ XMLwrapper *xml=new XMLwrapper();
+
+ xml->beginbranch("MASTER");
+@@ -654,7 +654,7 @@
+
+
+
+-int Master::loadXML(char *filename){
++int Master::loadXML(const char *filename){
+ XMLwrapper *xml=new XMLwrapper();
+ if (xml->loadXMLfile(filename)<0) {
+ delete(xml);
+--- a/src/Misc/Master.h 2005-03-14 21:57:29.000000000 +0200
++++ b/src/Misc/Master.h 2006-08-26 12:32:53.000000000 +0300
+@@ -43,7 +43,7 @@
+
+ //saves all settings to a XML file
+ //returns 0 for ok or <0 if there is an error
+- int saveXML(char *filename);
++ int saveXML(const char *filename);
+
+ //this adds the parameters to the XML data
+ void add2XML(XMLwrapper *xml);
+@@ -53,7 +53,7 @@
+
+ //loads all settings from a XML file
+ //returns 0 for ok or -1 if there is an error
+- int loadXML(char *filename);
++ int loadXML(const char *filename);
+ void applyparameters();
+
+ void getfromXML(XMLwrapper *xml);
+--- a/src/Misc/XMLwrapper.C 2005-04-13 01:09:34.000000000 +0300
++++ b/src/Misc/XMLwrapper.C 2006-08-26 12:32:53.000000000 +0300
+@@ -162,7 +162,7 @@
+
+ /* SAVE XML members */
+
+-int XMLwrapper::saveXMLfile(char *filename){
++int XMLwrapper::saveXMLfile(const char *filename){
+ char *xmldata=getXMLdata();
+ if (xmldata==NULL) return(-2);
+
+--- a/src/Misc/XMLwrapper.h 2005-03-14 21:57:17.000000000 +0200
++++ b/src/Misc/XMLwrapper.h 2006-08-26 12:32:53.000000000 +0300
+@@ -43,7 +43,7 @@
+ /********************************/
+
+ //returns 0 if ok or -1 if the file cannot be saved
+- int saveXMLfile(char *filename);
++ int saveXMLfile(const char *filename);
+
+ //returns the new allocated string that contains the XML data (used
for clipboard)
+ //the string is NULL terminated
+--- a/src/Output/JACKaudiooutput.C 2006-08-26 12:31:39.000000000 +0300
++++ b/src/Output/JACKaudiooutput.C 2006-08-26 13:09:07.000000000 +0300
+@@ -25,6 +25,7 @@
+
+ Master *jackmaster;
+ jack_client_t *jackclient;
++char jackname[100];
+ jack_port_t *outport_left,*outport_right;
+
+ int jackprocess(jack_nframes_t nframes,void *arg);
+@@ -34,13 +35,12 @@
+ bool JACKaudiooutputinit(Master *master_){
+ jackmaster=master_;
+ jackclient=0;
+- char tmpstr[100];
+ const char **ports;
+
+ for (int i=0;i<15;i++){
+- if (i!=0) snprintf(tmpstr,100,"ZynAddSubFX_%d",i);
+- else snprintf(tmpstr,100,"ZynAddSubFX");
+- jackclient=jack_client_new(tmpstr);
++ if (i!=0) snprintf(jackname,100,"ZynAddSubFX_%d",i);
++ else snprintf(jackname,100,"ZynAddSubFX");
++ jackclient=jack_client_new(jackname);
+ if (jackclient!=0) break;
+ };
+
+@@ -113,4 +113,8 @@
+ };
+
+
+-
++const char* JACKgetname() {
++ if (jackclient != NULL)
++ return jackname;
++ return NULL;
++}
+--- a/src/Output/JACKaudiooutput.h 2005-03-12 20:16:26.000000000 +0200
++++ b/src/Output/JACKaudiooutput.h 2006-08-26 12:32:53.000000000 +0300
+@@ -40,6 +40,8 @@
+
+ bool JACKaudiooutputinit(Master *master_);
+ void JACKfinish();
++const char* JACKgetname();
++
+
+ #endif
+
+--- a/src/UI/MasterUI.fl 2005-04-08 22:50:53.000000000 +0300
++++ b/src/UI/MasterUI.fl 2006-08-26 12:32:53.000000000 +0300
+@@ -413,7 +413,8 @@
+ decl {BankUI *bankui;} {}
+ }
+
+-class MasterUI {} {
++class MasterUI {open
++} {
+ Function {make_window()} {} {
+ Fl_Window masterwindow {
+ label zynaddsubfx
+@@ -424,7 +425,7 @@
+ config.save();
+ *exitprogram=1;
+ };
+-\#endif} selected
++\#endif}
+ xywh {353 127 390 465} type Double hide
+ } {
+ Fl_Menu_Bar mastermenu {
+@@ -1701,11 +1702,16 @@
+
+ updatepanel();} {}
+ }
+- Function {do_load_master()} {} {
+- code {char *filename;
+-filename=fl_file_chooser("Open:","({*.xmz})",NULL,0);
+-if (filename==NULL) return;
+-
++ Function {do_load_master(const char* file = NULL)} {selected
++ } {
++ code {const char *filename;
++ if (file == NULL) {
++ filename=fl_file_chooser("Open:","({*.xmz})",NULL,0);
++ if (filename==NULL) return;
++ }
++ else {
++ filename = file;
++ }
+
+ pthread_mutex_lock(&master->mutex);
+ //clear all parameters
+@@ -1725,20 +1731,23 @@
+ if (result==-10) fl_alert("Error: Could not load the file\\nbecause it is
not a zynaddsubfx parameters file.");
+ else if (result<0) fl_alert("Error: Could not load the file.");} {}
+ }
+- Function {do_save_master()} {} {
++ Function {do_save_master(char* file = NULL)} {} {
+ code {char *filename;
+-int result=0;
+-
+-filename=fl_file_chooser("Save:","({*.xmz})",NULL,0);
+-if (filename==NULL) return;
+-filename=fl_filename_setext(filename,".xmz");
+-
+-result=fileexists(filename);
+-if (result) {
+- result=0;
+- if (!fl_ask("The file exists. \\nOverwrite it?")) return;
+-
+-};
++ int result=0;
++ if (file == NULL) {
++ filename=fl_file_chooser("Save:","({*.xmz})",NULL,0);
++ if (filename==NULL) return;
++ filename=fl_filename_setext(filename,".xmz");
++ result=fileexists(filename);
++ if (result) {
++ result=0;
++ if (!fl_ask("The file exists. Overwrite it?")) return;
++
++ }
++ }
++ else {
++ filename = file;
++ }
+
+
+ pthread_mutex_lock(&master->mutex);
diff --git a/audio-creation/zynaddsubfx/zyn_unzombify.diff
b/audio-creation/zynaddsubfx/zyn_unzombify.diff
new file mode 100644
index 0000000..0a2cfe1
--- /dev/null
+++ b/audio-creation/zynaddsubfx/zyn_unzombify.diff
@@ -0,0 +1,20 @@
+--- a/src/Output/JACKaudiooutput.C 2006-08-26 13:18:19.000000000 +0300
++++ b/src/Output/JACKaudiooutput.C 2006-08-26 13:19:15.000000000 +0300
+@@ -88,9 +88,14 @@
+ jack_default_audio_sample_t *outl=(jack_default_audio_sample_t *)
jack_port_get_buffer (outport_left, nframes);
+ jack_default_audio_sample_t *outr=(jack_default_audio_sample_t *)
jack_port_get_buffer (outport_right, nframes);
+
+- pthread_mutex_lock(&jackmaster->mutex);
+-
jackmaster->GetAudioOutSamples(nframes,jack_get_sample_rate(jackclient),outl,outr);
+- pthread_mutex_unlock(&jackmaster->mutex);
++ if (!pthread_mutex_trylock(&jackmaster->mutex)) {
++
jackmaster->GetAudioOutSamples(nframes,jack_get_sample_rate(jackclient),outl,outr);
++ pthread_mutex_unlock(&jackmaster->mutex);
++ }
++ else {
++ memset(outl, 0, sizeof(jack_default_audio_sample_t) * nframes);
++ memset(outr, 0, sizeof(jack_default_audio_sample_t) * nframes);
++ }
+
+ return(0);
+ };
- [SM-Commit] GIT changes to master grimoire by Juuso Alasuutari (e0285ff8d14eff1be12ece29786be0dc93e7ebe2), Juuso Alasuutari, 08/28/2006
Archive powered by MHonArc 2.6.24.