commit 5829c4f1d41d8adc813152ac1aaf14965b134a45
parent fa3bcec57709af0cb8c741eebb73137981e573a7
Author: fundamental <mark.d.mccurry@gmail.com>
Date: Sun, 13 Dec 2009 12:28:56 -0500
Nio: Deprecation of old Output system
Cleanup: main, Recorder, src/CMakeLists.txt
Addition: Introduction of CMake configurations for Nio
Move: Output/Recorder -> Misc/Recorder
Diffstat:
12 files changed, 256 insertions(+), 399 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -977,3 +977,7 @@
the Wextra flag
- Minor change to Filter_ and FormantFilter to reduce unwanted warnings
+13 Dec 2009 (Mark McCurry)
+ - Deprecating Output system for the Nio system
+ - General Code Cleanup
+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
@@ -9,7 +9,7 @@ find_package(PortAudio)
find_package(FLTK)
######### Settings ###########
-# NOTE: These cache variables should normallly not be changed in this
+# NOTE: These cache variables should normally not be changed in this
# file, but either in in CMakeCache.txt before compile, or by passing
# parameters directly into cmake using the -D flag.
SET (FFTW_VERSION 3 CACHE STRING "Version number of FFTW")
@@ -17,6 +17,14 @@ SET (OutputModule alsa CACHE STRING "Output module, either alsa, nio, jack or po
SET (GuiModule fltk CACHE STRING "GUI module, either fltk, qt or off")
SET (CompileTests OFF CACHE BOOL "whether tests should be compiled in or not")
+#change this to have defaults set by results of find_package
+SET (AlsaEnable OFF CACHE BOOL
+ "Enable support for Advanced Linux Sound Architecture")
+SET (JackEnable OFF CACHE BOOL
+ "Enable support for JACK Audio Connection toolKit")
+SET (OssEnable OFF CACHE BOOL
+ "Enable support for Open Sound System")
+
# Now, handle the incoming settings and set define flags/variables based
# on this
@@ -83,6 +91,17 @@ add_definitions(-DFFTW_VERSION_${FFTW_VERSION}
-Wextra
)
+if(FLTK_FOUND)
+ mark_as_advanced(FORCE FLTK_BASE_LIBRARY)
+ mark_as_advanced(FORCE FLTK_CONFIG_SCRIPT)
+ mark_as_advanced(FORCE FLTK_DIR)
+ mark_as_advanced(FORCE FLTK_FLUID_EXECUTABLE)
+ mark_as_advanced(FORCE FLTK_FORMS_LIBRARY)
+ mark_as_advanced(FORCE FLTK_GL_LIBRARY)
+ mark_as_advanced(FORCE FLTK_IMAGES_LIBRARY)
+ mark_as_advanced(FORCE FLTK_INCLUDE_DIR)
+ mark_as_advanced(FORCE FLTK_MATH_LIBRARY)
+endif(FLTK_FOUND)
if(FltkGui)
#message(STATUS "FLTK_LIBRARIES: ${FLTK_LIBRARIES}")
@@ -94,15 +113,6 @@ if(FltkGui)
execute_process (COMMAND ${MYFLTK_CONFIG} --ldflags OUTPUT_VARIABLE MYFLTK_LDFLAGS)
string(STRIP ${MYFLTK_LDFLAGS} MYFLTK_LIBRARIES)
endif()
- mark_as_advanced(FORCE FLTK_BASE_LIBRARY)
- mark_as_advanced(FORCE FLTK_CONFIG_SCRIPT)
- mark_as_advanced(FORCE FLTK_DIR)
- mark_as_advanced(FORCE FLTK_FLUID_EXECUTABLE)
- mark_as_advanced(FORCE FLTK_FORMS_LIBRARY)
- mark_as_advanced(FORCE FLTK_GL_LIBRARY)
- mark_as_advanced(FORCE FLTK_IMAGES_LIBRARY)
- mark_as_advanced(FORCE FLTK_INCLUDE_DIR)
- mark_as_advanced(FORCE FLTK_MATH_LIBRARY)
set(GUI_LIBRARIES ${FLTK_LIBRARIES} ${MYFLTK_LIBRARIES} zynaddsubfx_gui)
@@ -191,7 +201,7 @@ set(zynaddsubfx_SRCS
main.cpp
)
-add_executable(zynaddsubfx
+add_executable(zynaddsubfx
${zynaddsubfx_SRCS}
)
diff --git a/src/Misc/CMakeLists.txt b/src/Misc/CMakeLists.txt
@@ -9,10 +9,11 @@ set(zynaddsubfx_misc_SRCS
Part.cpp
Util.cpp
XMLwrapper.cpp
+ Recorder.cpp
)
add_library(zynaddsubfx_misc STATIC
${zynaddsubfx_misc_SRCS}
)
-target_link_libraries(zynaddsubfx_misc zynaddsubfx_output)
+target_link_libraries(zynaddsubfx_misc zynaddsubfx_nio zynaddsubfx_output)
diff --git a/src/Misc/Master.cpp b/src/Misc/Master.cpp
@@ -499,10 +499,6 @@ void Master::AudioOut(REALTYPE *outl, REALTYPE *outr)
//update the LFO's time
LFOParams::time++;
-#ifndef NEW_IO
- if(HDDRecorder.recording())
- HDDRecorder.recordbuffer(outl, outr);
-#endif
dump.inctick();
}
diff --git a/src/Misc/Master.h b/src/Misc/Master.h
@@ -28,7 +28,7 @@
#include "Microtonal.h"
#include "Bank.h"
-#include "../Output/Recorder.h"
+#include "Recorder.h"
#include "Part.h"
#include "Dump.h"
#include "../Seq/Sequencer.h"
diff --git a/src/Misc/Recorder.cpp b/src/Misc/Recorder.cpp
@@ -0,0 +1,102 @@
+/*
+ ZynAddSubFX - a software synthesizer
+
+ Recorder.C - Records sound to a file
+ Copyright (C) 2002-2005 Nasca Octavian Paul
+ Author: Nasca Octavian Paul
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of version 2 of the GNU General Public License
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License (version 2 or later) for more details.
+
+ You should have received a copy of the GNU General Public License (version 2)
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+#include <sys/stat.h>
+#include "Recorder.h"
+#ifdef NEW_IO
+#include "../Nio/OutMgr.h"
+#include "../Nio/WavEngine.h"
+#endif
+
+Recorder::Recorder()
+ :status(0), notetrigger(0), wave(NULL)
+{}
+
+Recorder::~Recorder()
+{
+ if(recording() == 1)
+ stop();
+}
+
+int Recorder::preparefile(std::string filename_, int overwrite)
+{
+ if(!overwrite) {
+ struct stat fileinfo;
+ int statr;
+ statr = stat(filename_.c_str(), &fileinfo);
+ if(statr == 0) //file exists
+ return 1;
+ }
+
+ if(!(wave=new WavEngine(sysOut, filename_, SAMPLE_RATE, 2)))
+ return 2;
+
+ status = 1; //ready
+
+ return 0;
+}
+
+void Recorder::start()
+{
+ notetrigger = 0;
+ status = 2; //recording
+}
+
+void Recorder::stop()
+{
+ if(wave)
+ {
+ sysOut->remove(wave);
+ wave->Close();
+ delete wave;
+ wave = NULL; //is this even needed?
+ }
+ status = 0;
+}
+
+void Recorder::pause()
+{
+ status = 0;
+// wave->Stop();
+ sysOut->remove(wave);
+}
+
+int Recorder::recording()
+{
+ if((status == 2) && (notetrigger != 0))
+ return 1;
+ else
+ return 0;
+}
+
+void Recorder::triggernow()
+{
+ if(status == 2) {
+ if(notetrigger!=1) {
+ wave->openAudio();
+ //wave->Start();
+ sysOut->add(wave);
+ }
+ notetrigger = 1;
+ }
+}
+
diff --git a/src/Misc/Recorder.h b/src/Misc/Recorder.h
@@ -0,0 +1,57 @@
+/*
+ ZynAddSubFX - a software synthesizer
+
+ Recorder.h - Records sound to a file
+ Copyright (C) 2002-2005 Nasca Octavian Paul
+ Author: Nasca Octavian Paul
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of version 2 of the GNU General Public License
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License (version 2 or later) for more details.
+
+ You should have received a copy of the GNU General Public License (version 2)
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+*/
+
+#ifndef RECORDER_H
+#define RECORDER_H
+#include <string>
+#include "../globals.h"
+#include "../Nio/WavEngine.h"
+
+/**Records sound to a file*/
+class Recorder
+{
+ public:
+
+ Recorder();
+ ~Recorder();
+ /**Prepare the given file.
+ * @returns 1 if the file exists */
+ int preparefile(std::string filename_, int overwrite);
+ void start();
+ void stop();
+ void pause();
+ int recording();
+ void triggernow();
+
+ /** Status:
+ * 0 - not ready(no file selected),
+ * 1 - ready
+ * 2 - recording */
+ int status;
+
+ private:
+ WavEngine *wave;
+ int notetrigger;
+};
+
+#endif
+
diff --git a/src/Nio/CMakeLists.txt b/src/Nio/CMakeLists.txt
@@ -1,14 +1,43 @@
+#Defaults:
+# - Wave Output (enabled with the record function)
+# - Null Output
+# - Null Output Running by default
+# - Managed with OutMgr
set(zynaddsubfx_nio_SRCS
- OssEngine.cpp
- NulEngine.cpp
- WavEngine.cpp
- AlsaEngine.cpp
- AudioOut.cpp
- OutMgr.cpp
-)
+ WavEngine.cpp
+ NulEngine.cpp
+ AudioOut.cpp
+ OutMgr.cpp
+ )
+
+set(zynaddsubfx_nio_lib )
+
+#Uncomment when Jack is integrated
+#if(JackEnable)
+# include_directories(${JACK_INCLUDE_DIR})
+# list(APPEND zynaddsubfx_nio_SRCS JackEngine.cpp)
+# set(zynaddsubfx_nio_lib ${JACK_LIBRARIES})
+#endif(JackEnable)
+
+#Uncomment when Port Audio is integrated
+#if(PortAudioOutput)
+# include_directories(${PORTAUDIO_INCLUDE_DIR})
+# list(APPEND zynaddsubfx_nio_SRCS PaEngine.cpp)
+# list(zynaddsubfx_nio_lib ${PORTAUDIO_LIBRARIES})
+#endif(PortAudioOutput)
+
+if(AlsaEnable)
+ list(APPEND zynaddsubfx_nio_SRCS AlsaEngine.cpp)
+ list(APPEND zynaddsubfx_nio_lib ${ASOUND_LIBRARY})
+endif(AlsaEnable)
+
+if(OssEnable)
+ list(APPEND zynaddsubfx_nio_SRCS OssEngine.cpp)
+endif(OssEnable)
+
add_library(zynaddsubfx_nio STATIC
- ${zynaddsubfx_nio_SRCS}
- )
+ ${zynaddsubfx_nio_SRCS}
+ )
target_link_libraries(zynaddsubfx_nio)
diff --git a/src/Output/CMakeLists.txt b/src/Output/CMakeLists.txt
@@ -1,31 +1,31 @@
set(zynaddsubfx_output_SRCS
- Recorder.cpp
+# Recorder.cpp
WAVaudiooutput.cpp
)
-
-if(AlsaMidiOutput)
- set(zynaddsubfx_output_SRCS
- ${zynaddsubfx_output_SRCS}
- OSSaudiooutput.cpp)
- set(zynaddsubfx_output_lib ${ASOUND_LIBRARY})
-endif(AlsaMidiOutput)
-
-if(JackOutput)
- include_directories(${JACK_INCLUDE_DIR})
- set(zynaddsubfx_output_SRCS
- ${zynaddsubfx_output_SRCS}
- JACKaudiooutput.cpp)
- set(zynaddsubfx_output_lib ${JACK_LIBRARIES})
-endif(JackOutput)
-
-if(PortAudioOutput)
- include_directories(${PORTAUDIO_INCLUDE_DIR})
- set(zynaddsubfx_output_SRCS
- ${zynaddsubfx_output_SRCS}
- PAaudiooutput.cpp)
- set(zynaddsubfx_output_lib ${PORTAUDIO_LIBRARIES})
-endif(PortAudioOutput)
-
+#
+#if(AlsaMidiOutput)
+# set(zynaddsubfx_output_SRCS
+# ${zynaddsubfx_output_SRCS}
+# OSSaudiooutput.cpp)
+# set(zynaddsubfx_output_lib ${ASOUND_LIBRARY})
+#endif(AlsaMidiOutput)
+#
+#if(JackOutput)
+# include_directories(${JACK_INCLUDE_DIR})
+# set(zynaddsubfx_output_SRCS
+# ${zynaddsubfx_output_SRCS}
+# JACKaudiooutput.cpp)
+# set(zynaddsubfx_output_lib ${JACK_LIBRARIES})
+#endif(JackOutput)
+#
+#if(PortAudioOutput)
+# include_directories(${PORTAUDIO_INCLUDE_DIR})
+# set(zynaddsubfx_output_SRCS
+# ${zynaddsubfx_output_SRCS}
+# PAaudiooutput.cpp)
+# set(zynaddsubfx_output_lib ${PORTAUDIO_LIBRARIES})
+#endif(PortAudioOutput)
+#
add_library(zynaddsubfx_output STATIC
${zynaddsubfx_output_SRCS}
)
diff --git a/src/Output/Recorder.cpp b/src/Output/Recorder.cpp
@@ -1,151 +0,0 @@
-/*
- ZynAddSubFX - a software synthesizer
-
- Recorder.C - Records sound to a file
- Copyright (C) 2002-2005 Nasca Octavian Paul
- Author: Nasca Octavian Paul
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of version 2 of the GNU General Public License
- as published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License (version 2 or later) for more details.
-
- You should have received a copy of the GNU General Public License (version 2)
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-#include <sys/stat.h>
-#include "Recorder.h"
-#ifdef NEW_IO
-#include "../Nio/OutMgr.h"
-#include "../Nio/WavEngine.h"
-#endif
-
-Recorder::Recorder()
- :status(0), notetrigger(0)
-{
-#ifndef NEW_IO
- recordbuf_16bit = new short int [SOUND_BUFFER_SIZE * 2];
- for(int i = 0; i < SOUND_BUFFER_SIZE * 2; i++)
- recordbuf_16bit[i] = 0;
-#else
- wave=NULL;
-#endif
-}
-
-Recorder::~Recorder()
-{
- if(recording() == 1)
- stop();
-#ifndef NEW_IO
- delete [] recordbuf_16bit;
-#endif
-}
-
-int Recorder::preparefile(std::string filename_, int overwrite)
-{
- if(!overwrite) {
- struct stat fileinfo;
- int statr;
- statr = stat(filename_.c_str(), &fileinfo);
- if(statr == 0) //file exists
- return 1;
- }
-
-#ifndef NEW_IO
- if(!wav.newfile(filename_, SAMPLE_RATE, 2))
- return 2;
-#else
- if(!(wave=new WavEngine(sysOut, filename_, SAMPLE_RATE, 2)))
- return 2;
-#endif
-
- status = 1; //ready
-
- return 0;
-}
-
-void Recorder::start()
-{
- notetrigger = 0;
- status = 2; //recording
-}
-
-void Recorder::stop()
-{
-#ifndef NEW_IO
- wav.close();
-#else
- if(wave)
- {
- sysOut->remove(wave);
- wave->Close();
- delete wave;
- wave = NULL; //is this even needed?
- }
-#endif
- status = 0;
-}
-
-void Recorder::pause()
-{
- status = 0;
-#ifdef NEW_IO
-// wave->Stop();
- sysOut->remove(wave);
-#endif
-}
-
-int Recorder::recording()
-{
- if((status == 2) && (notetrigger != 0))
- return 1;
- else
- return 0;
-}
-
-#ifndef NEW_IO
-void Recorder::recordbuffer(REALTYPE *outl, REALTYPE *outr)
-{
- int tmp;
- if(status != 2)
- return;
- for(int i = 0; i < SOUND_BUFFER_SIZE; i++) {
- tmp = (int)(outl[i] * 32767.0);
- if(tmp < -32768)
- tmp = -32768;
- if(tmp > 32767)
- tmp = 32767;
- recordbuf_16bit[i * 2] = tmp;
-
- tmp = (int)(outr[i] * 32767.0);
- if(tmp < -32768)
- tmp = -32768;
- if(tmp > 32767)
- tmp = 32767;
- recordbuf_16bit[i * 2 + 1] = tmp;
- }
- wav.write_stereo_samples(SOUND_BUFFER_SIZE, recordbuf_16bit);
-}
-#endif
-
-void Recorder::triggernow()
-{
- if(status == 2) {
-#ifdef NEW_IO
- if(notetrigger!=1) {
- wave->openAudio();
- //wave->Start();
- sysOut->add(wave);
- }
-#endif
- notetrigger = 1;
- }
-}
-
diff --git a/src/Output/Recorder.h b/src/Output/Recorder.h
@@ -1,67 +0,0 @@
-/*
- ZynAddSubFX - a software synthesizer
-
- Recorder.h - Records sound to a file
- Copyright (C) 2002-2005 Nasca Octavian Paul
- Author: Nasca Octavian Paul
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of version 2 of the GNU General Public License
- as published by the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License (version 2 or later) for more details.
-
- You should have received a copy of the GNU General Public License (version 2)
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-*/
-
-#ifndef RECORDER_H
-#define RECORDER_H
-#include <string>
-#include "../globals.h"
-#include "WAVaudiooutput.h"
-#include "../Nio/WavEngine.h"
-
-//class WavEngine;
-/**Records sound to a file*/
-class Recorder
-{
- public:
-
- Recorder();
- ~Recorder();
- /**Prepare the given file.
- * @returns 1 if the file exists */
- int preparefile(std::string filename_, int overwrite);
- void start();
- void stop();
- void pause();
- int recording();
- void triggernow();
-#ifndef NEW_IO
- void recordbuffer(REALTYPE *outl, REALTYPE *outr);
-#endif
-
- /** Status:
- * 0 - not ready(no file selected),
- * 1 - ready
- * 2 - recording */
- int status;
-
- private:
-#ifndef NEW_IO
- WAVaudiooutput wav;
- short int *recordbuf_16bit;
-#else
- WavEngine *wave;
-#endif
- int notetrigger;
-};
-
-#endif
-
diff --git a/src/main.cpp b/src/main.cpp
@@ -22,6 +22,7 @@
#include <stdio.h> //remove once iostream is used
#include <iostream>
+#include <cmath>
#include <unistd.h>
#include <pthread.h>
@@ -38,9 +39,7 @@
#include "Misc/Dump.h"
extern Dump dump;
-//#ifdef NEW_IO
#include "Nio/OutMgr.h"
-//#endif
#ifdef ALSAMIDIIN
#include "Input/ALSAMidiIn.h"
@@ -81,29 +80,10 @@ Master *master;
int swaplr = 0; //1 for left-right swapping
bool usejackit = false;
-#ifdef NEW_IO
-#include "Nio/AudioOut.h"//temporary include
-#include "Nio/AlsaEngine.h"//temporary include
-#include "Nio/OssEngine.h"//temporary include
#include "Nio/OutMgr.h"
-#endif
-
-#ifdef JACKAUDIOOUT
-#include "Output/JACKaudiooutput.h"
-#endif
-
-#ifdef JACK_RTAUDIOOUT
-#include "Output/JACKaudiooutput.h"
-#endif
-
-#ifdef PAAUDIOOUT
-#include "Output/PAaudiooutput.h"
-#endif
+//temporary include (remove once the OutMgr can bootstrap itself)
+#include "Nio/NulEngine.h"
-#ifdef OSSAUDIOOUT
-#include "Output/OSSaudiooutput.h"
-OSSaudiooutput *audioout;
-#endif
#ifdef USE_LASH
#include "Misc/LASHClient.h"
@@ -131,71 +111,22 @@ void *thread1(void *arg)
note = cmdparams[0];
vel = cmdparams[1];
- // pthread_mutex_lock(&master->mutex);
-
if((cmdtype == MidiNoteON) && (note != 0))
master->NoteOn(cmdchan, note, vel);
if((cmdtype == MidiNoteOFF) && (note != 0))
master->NoteOff(cmdchan, note);
if(cmdtype == MidiController)
master->SetController(cmdchan, cmdparams[0], cmdparams[1]);
-
- //pthread_mutex_unlock(&master->mutex);
}
return 0;
}
#endif
-/*
- * Wave output thread (for OSS AUDIO out)
- */
-#if defined(OSSAUDIOOUT)
-//!(defined(JACKAUDIOOUT)||defined(JACK_RTAUDIOOUT)||defined(PAAUDIOOUT)||defined(VSTAUDIOOUT))
-
-void *thread2(void *arg)
-{
- REALTYPE outputl[SOUND_BUFFER_SIZE];
- REALTYPE outputr[SOUND_BUFFER_SIZE];
-
- set_realtime();
- while(Pexitprogram == 0) {
- pthread_mutex_lock(&master->mutex);
- master->AudioOut(outputl, outputr);
- pthread_mutex_unlock(&master->mutex);
-
-#ifndef NONEAUDIOOUT
- audioout->OSSout(outputl, outputr);
-#endif
-
- /** / int i,x,x2;
- REALTYPE xx,xx2;
-
- short int xsmps[SOUND_BUFFER_SIZE*2];
- for (i=0;i<SOUND_BUFFER_SIZE;i++){//output to stdout
- xx=-outputl[i]*32767;
- xx2=-outputr[i]*32767;
- if (xx<-32768) xx=-32768;
- if (xx>32767) xx=32767;
- if (xx2<-32768) xx2=-32768;
- if (xx2>32767) xx2=32767;
- x=(short int) xx;
- x2=(short int) xx2;
- xsmps[i*2]=x;xsmps[i*2+1]=x2;
- };
- write(1,&xsmps,SOUND_BUFFER_SIZE*2*2);
-
- / * */
- }
- return 0;
-}
-#endif
/*
* User Interface thread
*/
-
-
void *thread3(void *arg)
{
#ifndef DISABLE_GUI
@@ -310,32 +241,6 @@ void initprogram()
master = new Master();
master->swaplr = swaplr;
-//#if defined(JACKAUDIOOUT)
-// if(usejackit) {
-// bool tmp = JACKaudiooutputinit(master);
-//#if defined(OSSAUDIOOUT)
-// if(!tmp)
-// cout << "\nUsing OSS instead." << endl;
-//#else
-// if(!tmp)
-// exit(1);
-//#endif
-// usejackit = tmp;
-// }
-//#endif
-//#if defined(OSSAUDIOOUT)
-// if(!usejackit)
-// audioout = new OSSaudiooutput();
-// else
-// audioout = NULL;
-//#endif
-
-//#ifdef JACK_RTAUDIOOUT
-// JACKaudiooutputinit(master);
-//#endif
-//#ifdef PAAUDIOOUT
-// PAaudiooutputinit(master);
-//#endif
#ifdef ALSAMIDIIN
Midi = new ALSAMidiIn();
@@ -357,19 +262,6 @@ void initprogram()
void exitprogram()
{
pthread_mutex_lock(&master->mutex);
-//#ifdef OSSAUDIOOUT
-// delete (audioout);
-//#endif
-//#ifdef JACKAUDIOOUT
-// if(usejackit)
-// JACKfinish();
-//#endif
-//#ifdef JACK_RTAUDIOOUT
-// JACKfinish();
-//#endif
-//#ifdef PAAUDIOOUT
-// PAfinish();
-//#endif
#ifndef DISABLE_GUI
delete (ui);
@@ -677,35 +569,19 @@ int main(int argc, char *argv[])
pthread_create(&thr1, NULL, thread1, NULL);
#endif
-#ifdef OSSAUDIOOUT
-//!(defined(JACKAUDIOOUT)||defined(JACK_RTAUDIOOUT)||defined(PAAUDIOOUT)||defined(VSTAUDIOOUT))
- if(!usejackit)
- pthread_create(&thr2, NULL, thread2, NULL);
-#endif
-
-#ifdef NEW_IO
+ //Output Bootstrapping
sysOut=NULL;
sysOut = new OutMgr(master);
if(sysOut);
- AudioOut *tmp = new AlsaEngine(sysOut);
- tmp->openAudio();
+ AudioOut *tmp = new NulEngine(sysOut);
+ //tmp->openAudio();
//tmp->openAudio();
//AudioOut *tmp = new OssEngine(sysOut);
if(tmp)
sysOut->add(tmp);
sysOut->run();
-#endif
- /*It is not working and I don't know why
- //drop the suid-root permisions
- #if !(defined(JACKAUDIOOUT)||defined(PAAUDIOOUT)||defined(VSTAUDIOOUT)|| (defined (WINMIDIIN)) )
- setuid(getuid());
- seteuid(getuid());
- // setreuid(getuid(),getuid());
- // setregid(getuid(),getuid());
- #endif
- */
if(noui == 0)
pthread_create(&thr3, NULL, thread3, NULL);