├── .cirrus.yml ├── .flake8 ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── build.yml │ ├── irc.yml │ └── lint.yml ├── .gitignore ├── .wafupdaterc ├── AUTHORS.rst ├── COPYING ├── ChangeLog.rst ├── README.rst ├── README_NETJACK2 ├── android ├── Android.mk ├── AndroidShm.cpp ├── AndroidShm.h ├── AndroidShmServer │ ├── main_androidshmservice.cpp │ ├── readme.txt │ └── test │ │ ├── shmservicedump.cpp │ │ └── shmservicetest.cpp ├── BnAndroidShm.cpp ├── BnAndroidShm.h ├── BpAndroidShm.cpp ├── BpAndroidShm.h ├── CleanSpec.mk ├── IAndroidShm.cpp ├── IAndroidShm.h ├── JackAndroidSemaphore.cpp ├── JackAndroidSemaphore.h ├── JackAndroidThread.cpp ├── JackAndroidThread.h ├── JackCompilerDeps_os.h ├── JackControlAPIAndroid.cpp ├── JackControlAPIAndroid.h ├── JackError.cpp ├── JackGoldfishDriver.cpp ├── JackGoldfishDriver.h ├── JackOpenSLESDriver.cpp ├── JackOpenSLESDriver.h ├── JackPlatformPlug_os.h ├── JackSapaProxy.cpp ├── JackSapaProxy.h ├── JackSapaProxyIn.cpp ├── JackSapaProxyOut.cpp ├── JackShmMem_os.h ├── JackSystemDeps_os.h ├── NOTICE ├── Shm.cpp ├── Shm.h ├── config.h ├── cxx-stl │ └── gnu-libstdc++ │ │ └── libs │ │ └── armeabi-v7a │ │ └── include │ │ └── bits │ │ └── ctype_base.h ├── opensl_io.c └── opensl_io.h ├── autooptions ├── README └── __init__.py ├── common ├── JackAC3Encoder.cpp ├── JackAC3Encoder.h ├── JackAPI.cpp ├── JackActivationCount.cpp ├── JackActivationCount.h ├── JackArgParser.cpp ├── JackArgParser.h ├── JackAtomic.h ├── JackAtomicArrayState.h ├── JackAtomicState.h ├── JackAudioAdapter.cpp ├── JackAudioAdapter.h ├── JackAudioAdapterFactory.cpp ├── JackAudioAdapterInterface.cpp ├── JackAudioAdapterInterface.h ├── JackAudioDriver.cpp ├── JackAudioDriver.h ├── JackAudioPort.cpp ├── JackChannel.h ├── JackClient.cpp ├── JackClient.h ├── JackClientControl.h ├── JackClientInterface.h ├── JackCompilerDeps.h ├── JackConnectionManager.cpp ├── JackConnectionManager.h ├── JackConstants.h ├── JackControlAPI.cpp ├── JackControlAPI.h ├── JackDebugClient.cpp ├── JackDebugClient.h ├── JackDriver.cpp ├── JackDriver.h ├── JackDriverInfo.h ├── JackDriverLoader.cpp ├── JackDriverLoader.h ├── JackDummyDriver.cpp ├── JackDummyDriver.h ├── JackEngine.cpp ├── JackEngine.h ├── JackEngineControl.cpp ├── JackEngineControl.h ├── JackEngineProfiling.cpp ├── JackEngineProfiling.h ├── JackError.cpp ├── JackError.h ├── JackException.cpp ├── JackException.h ├── JackExternalClient.cpp ├── JackExternalClient.h ├── JackFilters.h ├── JackFrameTimer.cpp ├── JackFrameTimer.h ├── JackFreewheelDriver.cpp ├── JackFreewheelDriver.h ├── JackGenericClientChannel.cpp ├── JackGenericClientChannel.h ├── JackGlobals.cpp ├── JackGlobals.h ├── JackGraphManager.cpp ├── JackGraphManager.h ├── JackInternalClient.cpp ├── JackInternalClient.h ├── JackInternalClientChannel.h ├── JackInternalSessionLoader.cpp ├── JackInternalSessionLoader.h ├── JackLibAPI.cpp ├── JackLibClient.cpp ├── JackLibClient.h ├── JackLibGlobals.h ├── JackLibSampleRateResampler.cpp ├── JackLibSampleRateResampler.h ├── JackLockedEngine.h ├── JackLoopbackDriver.cpp ├── JackLoopbackDriver.h ├── JackMessageBuffer.cpp ├── JackMessageBuffer.h ├── JackMetadata.cpp ├── JackMetadata.h ├── JackMidiAPI.cpp ├── JackMidiAsyncQueue.cpp ├── JackMidiAsyncQueue.h ├── JackMidiAsyncWaitQueue.cpp ├── JackMidiAsyncWaitQueue.h ├── JackMidiBufferReadQueue.cpp ├── JackMidiBufferReadQueue.h ├── JackMidiBufferWriteQueue.cpp ├── JackMidiBufferWriteQueue.h ├── JackMidiDriver.cpp ├── JackMidiDriver.h ├── JackMidiPort.cpp ├── JackMidiPort.h ├── JackMidiRawInputWriteQueue.cpp ├── JackMidiRawInputWriteQueue.h ├── JackMidiRawOutputWriteQueue.cpp ├── JackMidiRawOutputWriteQueue.h ├── JackMidiReadQueue.cpp ├── JackMidiReadQueue.h ├── JackMidiReceiveQueue.cpp ├── JackMidiReceiveQueue.h ├── JackMidiSendQueue.cpp ├── JackMidiSendQueue.h ├── JackMidiUtil.cpp ├── JackMidiUtil.h ├── JackMidiWriteQueue.cpp ├── JackMidiWriteQueue.h ├── JackMutex.h ├── JackNetAPI.cpp ├── JackNetAdapter.cpp ├── JackNetAdapter.h ├── JackNetDriver.cpp ├── JackNetDriver.h ├── JackNetInterface.cpp ├── JackNetInterface.h ├── JackNetManager.cpp ├── JackNetManager.h ├── JackNetOneDriver.cpp ├── JackNetOneDriver.h ├── JackNetSocket.h ├── JackNetTool.cpp ├── JackNetTool.h ├── JackNotification.h ├── JackPlatformPlug.h ├── JackPort.cpp ├── JackPort.h ├── JackPortType.cpp ├── JackPortType.h ├── JackProfiler.cpp ├── JackProfiler.h ├── JackProxyDriver.cpp ├── JackProxyDriver.h ├── JackRequest.h ├── JackRequestDecoder.cpp ├── JackRequestDecoder.h ├── JackResampler.cpp ├── JackResampler.h ├── JackRestartThreadedDriver.cpp ├── JackRestartThreadedDriver.h ├── JackServer.cpp ├── JackServer.h ├── JackServerAPI.cpp ├── JackServerGlobals.cpp ├── JackServerGlobals.h ├── JackServerLaunch.h ├── JackSession.h ├── JackShmMem.cpp ├── JackShmMem.h ├── JackSynchro.h ├── JackSystemDeps.h ├── JackThread.h ├── JackThreadedDriver.cpp ├── JackThreadedDriver.h ├── JackTime.h ├── JackTimedDriver.cpp ├── JackTimedDriver.h ├── JackTools.cpp ├── JackTools.h ├── JackTransportEngine.cpp ├── JackTransportEngine.h ├── JackTypes.h ├── JackWaitCallbackDriver.cpp ├── JackWaitCallbackDriver.h ├── JackWaitThreadedDriver.cpp ├── JackWaitThreadedDriver.h ├── JackWeakAPI.c ├── Jackdmp.cpp ├── driver_interface.h ├── jack │ ├── control.h │ ├── intclient.h │ ├── jack.h │ ├── jslist.h │ ├── metadata.h │ ├── midiport.h │ ├── net.h │ ├── ringbuffer.h │ ├── session.h │ ├── statistics.h │ ├── systemdeps.h │ ├── thread.h │ ├── transport.h │ ├── types.h │ ├── uuid.h │ ├── weakjack.h │ └── weakmacros.h ├── memops.c ├── memops.h ├── netjack.c ├── netjack.h ├── netjack_packet.c ├── netjack_packet.h ├── promiscuous.c ├── promiscuous.h ├── ringbuffer.c ├── shm.c ├── shm.h ├── timestamps.c ├── timestamps.h ├── varargs.h └── wscript ├── compat ├── README.md ├── alloca │ ├── README.md │ ├── alloca.h │ └── wscript └── wscript ├── dbus ├── audio_reserve.c ├── audio_reserve.h ├── controller.c ├── controller.h ├── controller_iface_configure.c ├── controller_iface_control.c ├── controller_iface_introspectable.c ├── controller_iface_patchbay.c ├── controller_iface_session_manager.c ├── controller_iface_transport.c ├── controller_internal.h ├── jack_control ├── jackdbus.c ├── jackdbus.h ├── list.h ├── org.jackaudio.service.in ├── params.c ├── params.h ├── reserve.c ├── reserve.h ├── sigsegv.c ├── sigsegv.h ├── wscript ├── xml.c ├── xml.h ├── xml_expat.c ├── xml_nop.c └── xml_write_raw.c ├── doxyfile.in ├── freebsd ├── JackAtomic_os.h ├── JackPlatformPlug_os.h ├── driver.h ├── oss │ ├── JackOSSDriver.cpp │ └── JackOSSDriver.h └── uptime.h ├── jack.pc.in ├── linux ├── JackAtomic_os.h ├── JackLinuxFutex.cpp ├── JackLinuxFutex.h ├── JackLinuxTime.c ├── JackPlatformPlug_os.h ├── alsa │ ├── JackAlsaAdapter.cpp │ ├── JackAlsaAdapter.h │ ├── JackAlsaDriver.cpp │ ├── JackAlsaDriver.h │ ├── alsa_driver.c │ ├── alsa_driver.h │ ├── alsa_midi.h │ ├── alsa_midi_impl.h │ ├── alsa_midi_jackmp.cpp │ ├── alsa_rawmidi.c │ ├── alsa_seqmidi.c │ ├── bitset.h │ ├── generic.h │ ├── generic_hw.c │ ├── hammerfall.c │ ├── hammerfall.h │ ├── hardware.h │ ├── hdsp.c │ ├── hdsp.h │ ├── ice1712.c │ ├── ice1712.h │ ├── jslist.h │ ├── midi_pack.h │ ├── midi_unpack.h │ ├── usx2y.c │ └── usx2y.h ├── alsarawmidi │ ├── JackALSARawMidiDriver.cpp │ ├── JackALSARawMidiDriver.h │ ├── JackALSARawMidiInputPort.cpp │ ├── JackALSARawMidiInputPort.h │ ├── JackALSARawMidiOutputPort.cpp │ ├── JackALSARawMidiOutputPort.h │ ├── JackALSARawMidiPort.cpp │ ├── JackALSARawMidiPort.h │ ├── JackALSARawMidiReceiveQueue.cpp │ ├── JackALSARawMidiReceiveQueue.h │ ├── JackALSARawMidiSendQueue.cpp │ ├── JackALSARawMidiSendQueue.h │ ├── JackALSARawMidiUtil.cpp │ └── JackALSARawMidiUtil.h ├── driver.h ├── firewire │ ├── JackFFADODriver.cpp │ ├── JackFFADODriver.h │ ├── JackFFADOMidiInputPort.cpp │ ├── JackFFADOMidiInputPort.h │ ├── JackFFADOMidiOutputPort.cpp │ ├── JackFFADOMidiOutputPort.h │ ├── JackFFADOMidiReceiveQueue.cpp │ ├── JackFFADOMidiReceiveQueue.h │ ├── JackFFADOMidiSendQueue.cpp │ ├── JackFFADOMidiSendQueue.h │ └── ffado_driver.h ├── iio │ ├── JackIIODriver.cpp │ └── JackIIODriver.h ├── uptime.c └── uptime.h ├── macosx ├── JackAtomic_os.h ├── JackCompilerDeps_os.h ├── JackMachFutex.cpp ├── JackMachFutex.h ├── JackMachSemaphore.h ├── JackMachSemaphore.mm ├── JackMachSemaphoreServer.h ├── JackMachSemaphoreServer.mm ├── JackMachThread.h ├── JackMachThread.mm ├── JackMachTime.c ├── JackMachUtils.h ├── JackPlatformPlug_os.h ├── coreaudio │ ├── JackCoreAudioAdapter.h │ ├── JackCoreAudioAdapter.mm │ ├── JackCoreAudioDriver.h │ ├── JackCoreAudioDriver.mm │ ├── TiPhoneCoreAudioRenderer.h │ └── TiPhoneCoreAudioRenderer.mm ├── coremidi │ ├── JackCoreMidiDriver.h │ ├── JackCoreMidiDriver.mm │ ├── JackCoreMidiInputPort.h │ ├── JackCoreMidiInputPort.mm │ ├── JackCoreMidiOutputPort.h │ ├── JackCoreMidiOutputPort.mm │ ├── JackCoreMidiPhysicalInputPort.h │ ├── JackCoreMidiPhysicalInputPort.mm │ ├── JackCoreMidiPhysicalOutputPort.h │ ├── JackCoreMidiPhysicalOutputPort.mm │ ├── JackCoreMidiPort.h │ ├── JackCoreMidiPort.mm │ ├── JackCoreMidiUtil.h │ ├── JackCoreMidiUtil.mm │ ├── JackCoreMidiVirtualInputPort.h │ ├── JackCoreMidiVirtualInputPort.mm │ ├── JackCoreMidiVirtualOutputPort.h │ └── JackCoreMidiVirtualOutputPort.mm ├── generate-pkg.sh ├── package-welcome.txt.in ├── package.xml.in ├── uptime.c └── uptime.h ├── man ├── alsa_in.0 ├── alsa_out.0 ├── fill_template ├── jack_bufsize.0 ├── jack_connect.0 ├── jack_disconnect.0 ├── jack_freewheel.0 ├── jack_impulse_grabber.0 ├── jack_iodelay.0 ├── jack_load.0 ├── jack_lsp.0 ├── jack_metro.0 ├── jack_monitor_client.0 ├── jack_netsource.0 ├── jack_property.0 ├── jack_samplerate.0 ├── jack_showtime.0 ├── jack_simple_client.0 ├── jack_transport.0 ├── jack_unload.0 ├── jack_wait.0 ├── jackd.0 ├── jackrec.0 └── wscript ├── posix ├── JackCompilerDeps_os.h ├── JackFifo.cpp ├── JackFifo.h ├── JackNetUnixSocket.cpp ├── JackNetUnixSocket.h ├── JackPosixMutex.cpp ├── JackPosixMutex.h ├── JackPosixProcessSync.cpp ├── JackPosixProcessSync.h ├── JackPosixSemaphore.cpp ├── JackPosixSemaphore.h ├── JackPosixServerLaunch.cpp ├── JackPosixThread.cpp ├── JackPosixThread.h ├── JackPosixTime.c ├── JackShmMem_os.h ├── JackSocket.cpp ├── JackSocket.h ├── JackSocketClientChannel.cpp ├── JackSocketClientChannel.h ├── JackSocketNotifyChannel.cpp ├── JackSocketNotifyChannel.h ├── JackSocketServerChannel.cpp ├── JackSocketServerChannel.h ├── JackSocketServerNotifyChannel.cpp ├── JackSocketServerNotifyChannel.h ├── JackSystemDeps_os.h └── JackTypes_os.h ├── solaris ├── JackAtomic_os.h ├── JackPlatformPlug_os.h ├── JackSolarisTime.c └── oss │ ├── JackBoomerDriver.cpp │ ├── JackBoomerDriver.h │ ├── JackOSSAdapter.cpp │ ├── JackOSSAdapter.h │ ├── JackOSSDriver.cpp │ └── JackOSSDriver.h ├── systemd ├── example.conf ├── jack@.service.in └── wscript ├── tests ├── cpu.c ├── external_metro.cpp ├── external_metro.h ├── iodelay.cpp ├── jack_property_test.sh ├── test.cpp ├── testAtomic.cpp ├── testMutex.cpp ├── testSem.cpp ├── testSynchroClient.cpp ├── testSynchroServer.cpp ├── testSynchroServerClient.cpp ├── testThread.cpp └── wscript ├── waf ├── waflib-macos-mods.patch ├── waflib ├── Build.py ├── ConfigSet.py ├── Configure.py ├── Context.py ├── Errors.py ├── Logs.py ├── Node.py ├── Options.py ├── Runner.py ├── Scripting.py ├── Task.py ├── TaskGen.py ├── Tools │ ├── __init__.py │ ├── ar.py │ ├── c.py │ ├── c_aliases.py │ ├── c_config.py │ ├── c_osx.py │ ├── c_preproc.py │ ├── c_tests.py │ ├── ccroot.py │ ├── clang.py │ ├── clangxx.py │ ├── compiler_c.py │ ├── compiler_cxx.py │ ├── cxx.py │ ├── errcheck.py │ ├── gcc.py │ ├── gxx.py │ ├── icc.py │ ├── icpc.py │ ├── irixcc.py │ ├── msvc.py │ ├── suncc.py │ ├── suncxx.py │ ├── waf_unit_test.py │ ├── xlc.py │ └── xlcxx.py ├── Utils.py ├── __init__.py ├── ansiterm.py ├── extras │ ├── __init__.py │ ├── batched_cc.py │ ├── build_file_tracker.py │ ├── build_logs.py │ ├── c_bgxlc.py │ ├── c_nec.py │ ├── clang_cross.py │ ├── clang_cross_common.py │ ├── clangxx_cross.py │ ├── classic_runner.py │ ├── color_msvc.py │ ├── fc_fujitsu.py │ ├── fc_nfort.py │ ├── genpybind.py │ ├── haxe.py │ ├── msvc_pdb.py │ ├── sphinx.py │ ├── wafcache.py │ └── xcode6.py ├── fixpy2.py └── processor.py ├── windows ├── JackAtomic_os.h ├── JackCompilerDeps_os.h ├── JackMMCSS.cpp ├── JackMMCSS.h ├── JackNetWinSocket.cpp ├── JackNetWinSocket.h ├── JackPlatformPlug_os.h ├── JackShmMem_os.h ├── JackSystemDeps_os.h ├── JackTypes_os.h ├── JackWinEvent.cpp ├── JackWinEvent.h ├── JackWinMutex.cpp ├── JackWinMutex.h ├── JackWinNamedPipe.cpp ├── JackWinNamedPipe.h ├── JackWinNamedPipeClientChannel.cpp ├── JackWinNamedPipeClientChannel.h ├── JackWinNamedPipeNotifyChannel.cpp ├── JackWinNamedPipeNotifyChannel.h ├── JackWinNamedPipeServerChannel.cpp ├── JackWinNamedPipeServerChannel.h ├── JackWinNamedPipeServerNotifyChannel.cpp ├── JackWinNamedPipeServerNotifyChannel.h ├── JackWinProcessSync.cpp ├── JackWinProcessSync.h ├── JackWinSemaphore.cpp ├── JackWinSemaphore.h ├── JackWinServerLaunch.cpp ├── JackWinThread.cpp ├── JackWinThread.h ├── JackWinTime.c ├── Psapi.Lib ├── README ├── README_MINGW ├── getopt.c ├── getopt.h ├── getopt1.c ├── inno │ ├── jack.ico │ ├── win32-mini.iss │ ├── win32.iss │ ├── win64-mini.iss │ └── win64.iss ├── jackaudioadapter.rc ├── jackd.rc ├── jackdummydriver.rc ├── jackloopbackdriver.rc ├── jacknetadapter.rc ├── jacknetdriver.rc ├── jacknetmanager.rc ├── jacknetonedriver.rc ├── jackportaudio.rc ├── jackwinmme.rc ├── libjack.rc ├── libjacknet.rc ├── libjackserver.rc ├── portaudio │ ├── JackPortAudioAdapter.cpp │ ├── JackPortAudioAdapter.h │ ├── JackPortAudioDevices.cpp │ ├── JackPortAudioDevices.h │ ├── JackPortAudioDriver.cpp │ └── JackPortAudioDriver.h ├── resource.h ├── resource_vc.h └── winmme │ ├── JackWinMMEDriver.cpp │ ├── JackWinMMEDriver.h │ ├── JackWinMMEInputPort.cpp │ ├── JackWinMMEInputPort.h │ ├── JackWinMMEOutputPort.cpp │ ├── JackWinMMEOutputPort.h │ ├── JackWinMMEPort.cpp │ └── JackWinMMEPort.h └── wscript /.cirrus.yml: -------------------------------------------------------------------------------- 1 | task: 2 | freebsd_instance: 3 | matrix: 4 | - image_family: freebsd-13-3 5 | - image_family: freebsd-14-1 6 | 7 | environment: 8 | CFLAGS: -O2 -pipe -fPIC -fstack-protector-strong -fno-strict-aliasing -I/usr/local/include 9 | CPPFLAGS: -O2 -pipe -fPIC -fstack-protector-strong -fno-strict-aliasing -I/usr/local/include 10 | LDFLAGS: -L/usr/local/lib -fstack-protector-strong 11 | prepare_script: 12 | - mkdir /Install 13 | 14 | matrix: 15 | - name: FreeBSD Minimal Build 16 | dependencies_script: 17 | - pkg install -y pkgconf python3 libsamplerate libsysinfo expat 18 | config_script: 19 | - python3 ./waf configure --celt=no --samplerate=yes --alsa=no --classic --opus=no --prefix /Install --pkgconfigdir libdata/pkgconfig 20 | - name: FreeBSD All Options 21 | dependencies_script: 22 | - pkg install -y pkgconf python3 libsamplerate libsysinfo alsa-lib dbus expat opus 23 | config_script: 24 | - python3 ./waf configure --celt=no --samplerate=yes --alsa=yes --dbus --classic --autostart=dbus --opus=yes --prefix /Install --pkgconfigdir libdata/pkgconfig 25 | 26 | build_script: 27 | - python3 ./waf 28 | install_script: 29 | - python3 ./waf install 30 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 120 3 | output-file = flake8.txt 4 | exclude = .git,waflib,autooptions 5 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 🐞 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | --- 8 | 9 | 10 | 11 | ## Describe the bug 12 | 13 | A clear and concise description of what the bug is. 14 | 15 | ## Environment 16 | 17 | * **JACK Version:** Which version of jack2 are you using? (e.g. the output of `jackd --version` or a git commit checksum) 18 | * **Operating System:** What operating system or distribution in which version are you using? (e.g. Linux, macOS, Windows) 19 | * **Installation:** How did you install jack2? (e.g. package manager, from source) 20 | 21 | ## Steps To Reproduce 22 | 23 | ```bash 24 | # Paste a minimal code example here (e.g. about how you started JACK) 25 | ``` 26 | 27 | ### Expected vs. actual behavior 28 | 29 | A clear and concise description of what you expected to happen vs. what happened. 30 | 31 | 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 💡 3 | about: Suggest a new idea for the project. 4 | labels: enhancement 5 | --- 6 | 7 | 8 | 9 | ## Summary 10 | 11 | Brief explanation of the feature. 12 | 13 | ### Basic example 14 | 15 | If the proposal involves a new feature or change in behavior, include a basic code example. Omit this section if it's not applicable. 16 | 17 | ### Motivation 18 | 19 | Why are we doing this? What use cases does it support? What is the expected outcome? 20 | 21 | 22 | -------------------------------------------------------------------------------- /.github/workflows/irc.yml: -------------------------------------------------------------------------------- 1 | name: irc 2 | 3 | on: [push] 4 | 5 | jobs: 6 | notification: 7 | runs-on: ubuntu-latest 8 | name: IRC notification 9 | steps: 10 | - name: Format message 11 | id: message 12 | run: | 13 | message="${{ github.actor }} pushed $(echo '${{ github.event.commits[0].message }}' | head -n 1) ${{ github.event.commits[0].url }}" 14 | echo ::set-output name=message::"${message}" 15 | - name: IRC notification 16 | uses: Gottox/irc-message-action@v2 17 | with: 18 | channel: '#jack' 19 | nickname: jackaudio-bot 20 | message: ${{ steps.message.outputs.message }} 21 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | name: Test wscript files 4 | 5 | on: 6 | push: 7 | branches: [master, develop] 8 | pull_request: 9 | branches: [master, develop] 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v4 16 | - name: Install dependencies 17 | run: | 18 | sudo apt-get update -qq 19 | sudo apt-get install -qqy flake8 findutils 20 | - name: Lint with flake8 21 | run: find . -type f \( -iname wscript -or -iname jack_control \) -exec flake8 {} \; 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .lock* 2 | .stamp_* 3 | .DS_Store 4 | __pycache__ 5 | *.dll 6 | *.pyc 7 | *.pkg 8 | flake8.txt 9 | codeBlocks 10 | /android/.server/ 11 | /android/.client/ 12 | /build/ 13 | /man/*.1 14 | 15 | # common release files 16 | /destdir/ 17 | 18 | # macos release files 19 | /macos/package.xml 20 | /macos/package-welcome.txt 21 | 22 | # windows release files 23 | /innosetup/ 24 | /is.exe 25 | /windows/inno/version.iss 26 | /windows/inno/win32 27 | /windows/inno/win64 28 | -------------------------------------------------------------------------------- /android/AndroidShm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/android/AndroidShm.cpp -------------------------------------------------------------------------------- /android/AndroidShm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/android/AndroidShm.h -------------------------------------------------------------------------------- /android/AndroidShmServer/main_androidshmservice.cpp: -------------------------------------------------------------------------------- 1 | #define LOG_TAG "main_androidshmservice" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "../../common/shm.h" 9 | #include "../Shm.h" //android extension of shm.h 10 | 11 | using namespace android; 12 | 13 | int main(int argc, char *argv[]) { 14 | jack_instantiate(); 15 | ProcessState::self()->startThreadPool(); 16 | ALOGI("AndroidShmService is starting now"); 17 | IPCThreadState::self()->joinThreadPool(); 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /android/AndroidShmServer/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/android/AndroidShmServer/readme.txt -------------------------------------------------------------------------------- /android/BnAndroidShm.h: -------------------------------------------------------------------------------- 1 | #ifndef BNANDROIDSHM 2 | #define BNANDROIDSHM 3 | 4 | #include 5 | #include "IAndroidShm.h" 6 | 7 | namespace android { 8 | class BnAndroidShm : public BnInterface { 9 | public: 10 | virtual status_t onTransact( uint32_t code, 11 | const Parcel& data, 12 | Parcel* reply, 13 | uint32_t flags = 0); 14 | }; 15 | }; 16 | #endif 17 | -------------------------------------------------------------------------------- /android/BpAndroidShm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/android/BpAndroidShm.cpp -------------------------------------------------------------------------------- /android/BpAndroidShm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/android/BpAndroidShm.h -------------------------------------------------------------------------------- /android/IAndroidShm.cpp: -------------------------------------------------------------------------------- 1 | #include "IAndroidShm.h" 2 | #include "BpAndroidShm.h" 3 | 4 | namespace android{ 5 | IMPLEMENT_META_INTERFACE(AndroidShm, "com.samsung.android.jam.IAndroidShm"); 6 | }; 7 | -------------------------------------------------------------------------------- /android/IAndroidShm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/android/IAndroidShm.h -------------------------------------------------------------------------------- /android/JackCompilerDeps_os.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2008 Grame 3 | Copyright (C) 2013 Samsung Electronics 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU Lesser General Public License as published by 7 | the Free Software Foundation; either version 2.1 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef __JackCompilerDeps_android__ 22 | #define __JackCompilerDeps_android__ 23 | 24 | #include "JackConstants.h" 25 | 26 | #if __GNUC__ 27 | 28 | #define MEM_ALIGN(x,y) x __attribute__((aligned(y))) 29 | #define LIB_EXPORT __attribute__((visibility("default"))) 30 | #ifdef SERVER_SIDE 31 | #if (__GNUC__< 4) 32 | #define SERVER_EXPORT 33 | #else 34 | #define SERVER_EXPORT __attribute__((visibility("default"))) 35 | #endif 36 | #else 37 | #define SERVER_EXPORT __attribute__((visibility("hidden"))) 38 | #endif 39 | 40 | #else 41 | #define MEM_ALIGN(x,y) x 42 | #define LIB_EXPORT 43 | #define SERVER_EXPORT 44 | 45 | /* Add other things here for non-gcc platforms */ 46 | #endif 47 | 48 | #endif /* __JackCompilerDeps_android__ */ 49 | -------------------------------------------------------------------------------- /android/JackControlAPIAndroid.h: -------------------------------------------------------------------------------- 1 | /* 2 | JACK control API 3 | 4 | Copyright (C) 2008 Nedko Arnaudov 5 | Copyright (C) 2008 Grame 6 | Copyright (C) 2013 Samsung Electronics 7 | 8 | This program is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; version 2 of the License. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program; if not, write to the Free Software 19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 | 21 | */ 22 | 23 | #ifndef __JackControlAPIAndroid__ 24 | #define __JackControlAPIAndroid__ 25 | 26 | #include "JackCompilerDeps.h" 27 | 28 | /** opaque type for sigmask object */ 29 | typedef struct jackctl_sigmask jackctl_sigmask_t; 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | SERVER_EXPORT int 36 | jackctl_wait_signals_and_return( 37 | jackctl_sigmask_t * signals); 38 | 39 | #ifdef __cplusplus 40 | } /* extern "C" */ 41 | #endif 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /android/JackSapaProxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 Samsung Electronics 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackSapaProxy__ 21 | #define __JackSapaProxy__ 22 | 23 | #include "JackConstants.h" 24 | #include "JackPlatformPlug.h" 25 | #include "jack.h" 26 | #include "jslist.h" 27 | #include 28 | #include 29 | 30 | #define SAPAPROXY_PORT_NUM_FOR_CLIENT 16 31 | 32 | namespace Jack 33 | { 34 | 35 | class JackSapaProxy 36 | { 37 | 38 | private: 39 | 40 | jack_client_t* fClient; 41 | jack_port_t *fInputPorts[SAPAPROXY_PORT_NUM_FOR_CLIENT]; 42 | jack_port_t *fOutputPorts[SAPAPROXY_PORT_NUM_FOR_CLIENT]; 43 | 44 | public: 45 | 46 | unsigned int fCapturePorts; 47 | unsigned int fPlaybackPorts; 48 | 49 | JackSapaProxy(jack_client_t* jack_client, const JSList* params); 50 | ~JackSapaProxy(); 51 | 52 | int Setup(jack_client_t* jack_client); 53 | static int Process(jack_nframes_t nframes, void* arg); 54 | 55 | }; 56 | 57 | } 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /android/JackShmMem_os.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2008 Grame 3 | Copyright (C) 2013 Samsung Electronics 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU Lesser General Public License as published by 7 | the Free Software Foundation; either version 2.1 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef __JackShmMem__android__ 22 | #define __JackShmMem__android__ 23 | 24 | #include 25 | #include 26 | 27 | #define CHECK_MLOCK(ptr, size) (mlock((ptr), (size)) == 0) 28 | #define CHECK_MUNLOCK(ptr, size) (munlock((ptr), (size)) == 0) 29 | #define CHECK_MLOCKALL() (false) 30 | #define CHECK_MUNLOCKALL() (false) 31 | 32 | /* fix for crash jack server issue: 33 | * case 1) jack_destroy_shm() in JackShmReadWritePtr1::Init() causes crash 34 | * because server lost shared memory by destroying client side ahead. 35 | */ 36 | #ifndef SERVER_SIDE 37 | #define jack_destroy_shm(x) (0) 38 | #endif 39 | 40 | #endif /* __JackShmMem__android__ */ 41 | -------------------------------------------------------------------------------- /android/JackSystemDeps_os.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2008 Grame 3 | Copyright (C) 2013 Samsung Electronics 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU Lesser General Public License as published by 7 | the Free Software Foundation; either version 2.1 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef __JackSystemDeps_android__ 22 | #define __JackSystemDeps_android__ 23 | 24 | 25 | #include "../posix/JackSystemDeps_os.h" 26 | 27 | /** 28 | * bionic c dependent functions 29 | */ 30 | #define pthread_setcanceltype(x,y) (0) 31 | 32 | #endif /* __JackSystemDeps_android__ */ 33 | -------------------------------------------------------------------------------- /android/config.h: -------------------------------------------------------------------------------- 1 | /* Configuration header created by Waf - do not edit */ 2 | #ifndef _CONFIG_H_WAF 3 | #define _CONFIG_H_WAF 4 | 5 | /* #define HAVE_SAMPLERATE 0 */ 6 | /* #define HAVE_PPOLL 0 */ 7 | /* #define HAVE_SNDFILE */ 8 | /* #define HAVE_NCURSES 0 */ 9 | /* #define HAVE_CELT 0 */ 10 | /* #define HAVE_CELT_API_0_11 0 */ 11 | /* #define HAVE_CELT_API_0_8 0 */ 12 | /* #define HAVE_CELT_API_0_7 0 */ 13 | /* #define HAVE_CELT_API_0_5 0 */ 14 | /* #define HAVE_READLINE 0 */ 15 | #define CLIENT_NUM 32 16 | #define PORT_NUM_FOR_CLIENT 24 17 | #define PORT_NUM 256 18 | #define PORT_NUM_MAX 512 19 | #define ADDON_DIR "/system/lib/jack" 20 | #define JACK_LOCATION "/system/bin" 21 | #define JACKMP 1 22 | /* #define USE_POSIX_SHM 0 */ 23 | /* #define __CLIENTDEBUG__ 1 */ 24 | 25 | #endif /* _CONFIG_H_WAF */ 26 | -------------------------------------------------------------------------------- /android/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include/bits/ctype_base.h: -------------------------------------------------------------------------------- 1 | 2 | //fix build error in KitKat 3 | 4 | #define _U _CTYPE_U 5 | #define _L _CTYPE_L 6 | #define _N _CTYPE_N 7 | #define _S _CTYPE_S 8 | #define _P _CTYPE_P 9 | #define _C _CTYPE_C 10 | #define _X _CTYPE_X 11 | #define _B _CTYPE_B 12 | 13 | #include <../../../../../../../../../../../prebuilts/ndk/current/sources/cxx-stl/gnu-libstdc++/libs/armeabi-v7a/include/bits/ctype_base.h> 14 | 15 | -------------------------------------------------------------------------------- /autooptions/README: -------------------------------------------------------------------------------- 1 | Do not modify the code in this directory. It has been copied from its upstream 2 | git repo [1]. When submodules are introduced this directory can be made a 3 | submodule, but until then a verbatim copy is better than inlining the code in 4 | the toplevel wscript. 5 | 6 | [1] https://gitlab.com/karllinden/waf-autooptions 7 | -------------------------------------------------------------------------------- /common/JackActivationCount.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2008 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #include "JackAtomic.h" 21 | #include "JackActivationCount.h" 22 | #include "JackConstants.h" 23 | #include "JackClientControl.h" 24 | #include "JackError.h" 25 | 26 | namespace Jack 27 | { 28 | 29 | bool JackActivationCount::Signal(JackSynchro* synchro, JackClientControl* control) 30 | { 31 | if (fValue == 0) { 32 | // Transfer activation to next clients 33 | jack_log("JackActivationCount::Signal value = 0 ref = %ld", control->fRefNum); 34 | return synchro->Signal(); 35 | } else if (DEC_ATOMIC(&fValue) == 1) { 36 | return synchro->Signal(); 37 | } else { 38 | return true; 39 | } 40 | } 41 | 42 | } // end of namespace 43 | 44 | -------------------------------------------------------------------------------- /common/JackArgParser.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006-2008 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackArgParser__ 21 | #define __JackArgParser__ 22 | 23 | #include "jslist.h" 24 | #include "driver_interface.h" 25 | #include "JackCompilerDeps.h" 26 | #include "JackError.h" 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | namespace Jack 35 | { 36 | 37 | class SERVER_EXPORT JackArgParser 38 | { 39 | private: 40 | 41 | std::string fArgString; 42 | int fArgc; 43 | std::vector fArgv; 44 | 45 | public: 46 | 47 | JackArgParser ( const char* arg ); 48 | ~JackArgParser(); 49 | std::string GetArgString(); 50 | int GetNumArgv(); 51 | int GetArgc(); 52 | int GetArgv ( std::vector& argv ); 53 | int GetArgv ( char** argv ); 54 | void DeleteArgv ( const char** argv ); 55 | bool ParseParams ( jack_driver_desc_t* desc, JSList** param_list ); 56 | void FreeParams ( JSList* param_list ); 57 | }; 58 | 59 | } 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /common/JackAtomic.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2008 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackAtomic__ 21 | #define __JackAtomic__ 22 | 23 | #include "JackTypes.h" 24 | #include "JackAtomic_os.h" 25 | 26 | static inline long INC_ATOMIC(volatile SInt32* val) 27 | { 28 | SInt32 actual; 29 | do { 30 | actual = *val; 31 | } while (!CAS(actual, actual + 1, val)); 32 | return actual; 33 | } 34 | 35 | static inline long DEC_ATOMIC(volatile SInt32* val) 36 | { 37 | SInt32 actual; 38 | do { 39 | actual = *val; 40 | } while (!CAS(actual, actual - 1, val)); 41 | return actual; 42 | } 43 | 44 | #endif 45 | 46 | 47 | -------------------------------------------------------------------------------- /common/JackClientInterface.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 Paul Davis 3 | Copyright (C) 2004-2008 Grame 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU Lesser General Public License as published by 7 | the Free Software Foundation; either version 2.1 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef __JackClientInterface__ 22 | #define __JackClientInterface__ 23 | 24 | #include "JackCompilerDeps.h" 25 | 26 | namespace Jack 27 | { 28 | 29 | struct JackClientControl; 30 | 31 | /*! 32 | \brief Client interface. 33 | */ 34 | 35 | class SERVER_EXPORT JackClientInterface 36 | { 37 | 38 | public: 39 | 40 | JackClientInterface() 41 | {} 42 | virtual ~JackClientInterface() 43 | {} 44 | 45 | virtual int Close() = 0; 46 | 47 | virtual int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2) = 0; 48 | 49 | virtual JackClientControl* GetClientControl() const = 0; 50 | }; 51 | 52 | 53 | } // end of namespace 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /common/JackCompilerDeps.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2005 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackCompilerDeps__ 21 | #define __JackCompilerDeps__ 22 | 23 | #include "JackCompilerDeps_os.h" 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /common/JackDriverInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001-2005 Paul Davis 3 | Copyright (C) 2004-2008 Grame 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | */ 20 | 21 | #ifndef __JackDriverInfo__ 22 | #define __JackDriverInfo__ 23 | 24 | #include "driver_interface.h" 25 | #include "JackDriver.h" 26 | #include "JackSystemDeps.h" 27 | 28 | typedef Jack::JackDriverClientInterface* (*driverInitialize) (Jack::JackLockedEngine*, Jack::JackSynchro*, const JSList*); 29 | 30 | class SERVER_EXPORT JackDriverInfo 31 | { 32 | 33 | private: 34 | 35 | driverInitialize fInitialize; 36 | DRIVER_HANDLE fHandle; 37 | Jack::JackDriverClientInterface* fBackend; 38 | 39 | public: 40 | 41 | JackDriverInfo():fInitialize(NULL),fHandle(NULL),fBackend(NULL) 42 | {} 43 | ~JackDriverInfo(); 44 | 45 | Jack::JackDriverClientInterface* Open(jack_driver_desc_t* driver_desc, Jack::JackLockedEngine*, Jack::JackSynchro*, const JSList*); 46 | 47 | Jack::JackDriverClientInterface* GetBackend() 48 | { 49 | return fBackend; 50 | } 51 | 52 | }; 53 | 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /common/JackDriverLoader.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001-2005 Paul Davis 3 | Copyright (C) 2004-2008 Grame 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU Lesser General Public License as published by 7 | the Free Software Foundation; either version 2.1 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef __JackDriverLoader__ 22 | #define __JackDriverLoader__ 23 | 24 | #include "driver_interface.h" 25 | #include "JackControlAPI.h" 26 | #include "JackPlatformPlug.h" 27 | 28 | jack_driver_desc_t* jack_find_driver_descriptor(JSList* drivers, const char* name); 29 | JSList* jack_drivers_load(JSList* drivers); 30 | JSList* jack_internals_load(JSList* internals); 31 | void jack_free_driver_params(JSList * param_ptr); 32 | void jack_print_driver_options(jack_driver_desc_t* desc, FILE* file); 33 | 34 | // External control.h API 35 | extern "C" SERVER_EXPORT int jackctl_driver_params_parse(jackctl_driver * driver, int argc, char* argv[]); 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /common/JackDummyDriver.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 Paul Davis 3 | Copyright (C) 2004-2008 Grame 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | */ 20 | 21 | #ifndef __JackDummyDriver__ 22 | #define __JackDummyDriver__ 23 | 24 | #include "JackTimedDriver.h" 25 | 26 | namespace Jack 27 | { 28 | 29 | /*! 30 | \brief The dummy driver. 31 | */ 32 | 33 | class JackDummyDriver : public JackTimedDriver 34 | { 35 | 36 | public: 37 | 38 | JackDummyDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table) 39 | : JackTimedDriver(name, alias, engine, table) 40 | {} 41 | virtual ~JackDummyDriver() 42 | {} 43 | 44 | virtual int Process() 45 | { 46 | JackDriver::CycleTakeBeginTime(); 47 | 48 | if (JackAudioDriver::Process() < 0) { 49 | return -1; 50 | } else { 51 | ProcessWait(); 52 | return 0; 53 | } 54 | } 55 | 56 | }; 57 | 58 | } // end of namespace 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /common/JackException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #include "JackException.h" 21 | #include "JackError.h" 22 | 23 | namespace Jack 24 | { 25 | 26 | void JackException::PrintMessage() 27 | { 28 | std::string str = what(); 29 | if (str != "") { 30 | jack_info(str.c_str()); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /common/JackExternalClient.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 Paul Davis 3 | Copyright (C) 2004-2008 Grame 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | */ 20 | 21 | #ifndef __JackExternalClient__ 22 | #define __JackExternalClient__ 23 | 24 | #include "JackClientInterface.h" 25 | #include "JackPlatformPlug.h" 26 | 27 | namespace Jack 28 | { 29 | 30 | struct JackClientControl; 31 | 32 | /*! 33 | \brief Server side implementation of library clients. 34 | */ 35 | 36 | class JackExternalClient : public JackClientInterface 37 | { 38 | 39 | private: 40 | 41 | JackNotifyChannel fChannel; /*! Server/client communication channel */ 42 | JackClientControl* fClientControl; /*! Client control in shared memory */ 43 | 44 | public: 45 | 46 | JackExternalClient(); 47 | virtual ~JackExternalClient(); 48 | 49 | int Open(const char* name, int pid, int refnum, jack_uuid_t uuid, int* shared_client); 50 | int Close(); 51 | 52 | int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2); 53 | 54 | JackClientControl* GetClientControl() const; 55 | }; 56 | 57 | 58 | } // end of namespace 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /common/JackFreewheelDriver.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 Paul Davis 3 | Copyright (C) 2004-2008 Grame 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | */ 20 | 21 | #ifndef __JackFreewheelDriver__ 22 | #define __JackFreewheelDriver__ 23 | 24 | #include "JackDriver.h" 25 | 26 | namespace Jack 27 | { 28 | 29 | /*! 30 | \brief The FreeWheel driver : run Jack engine at full speed. 31 | */ 32 | 33 | class JackFreewheelDriver : public JackDriver 34 | { 35 | protected: 36 | 37 | int SuspendRefNum(); 38 | 39 | public: 40 | 41 | JackFreewheelDriver(JackLockedEngine* engine, JackSynchro* table): JackDriver("freewheel", "", engine, table) 42 | {} 43 | virtual ~JackFreewheelDriver() 44 | {} 45 | 46 | bool IsRealTime() const 47 | { 48 | return false; 49 | } 50 | 51 | int Process(); 52 | 53 | int ProcessReadSync(); 54 | int ProcessWriteSync(); 55 | 56 | int ProcessReadAsync(); 57 | int ProcessWriteAsync(); 58 | 59 | }; 60 | 61 | } // end of namespace 62 | 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /common/JackInternalSessionLoader.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2017 Timo Wischer 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackInternalSessionLoader__ 21 | #define __JackInternalSessionLoader__ 22 | 23 | #include 24 | #include 25 | #include "JackServer.h" 26 | 27 | 28 | namespace Jack 29 | { 30 | 31 | class JackInternalSessionLoader 32 | { 33 | public: 34 | JackInternalSessionLoader(JackServer* const server); 35 | int Load(const char* file); 36 | 37 | private: 38 | void LoadClient(std::istringstream& iss, const int linenr); 39 | void ConnectPorts(std::istringstream& iss, const int linenr); 40 | 41 | JackServer* const fServer; 42 | }; 43 | 44 | } // end of namespace 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /common/JackLibClient.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2008 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackLibClient__ 21 | #define __JackLibClient__ 22 | 23 | #include "JackClient.h" 24 | #include "JackShmMem.h" 25 | #include "JackClientControl.h" 26 | #include "JackEngineControl.h" 27 | 28 | namespace Jack 29 | { 30 | 31 | /*! 32 | \brief Client on the library side. 33 | */ 34 | 35 | class JackLibClient : public JackClient 36 | { 37 | 38 | private: 39 | 40 | JackShmReadWritePtr1 fClientControl; /*! Shared client control */ 41 | 42 | public: 43 | 44 | JackLibClient(JackSynchro* table); 45 | virtual ~JackLibClient(); 46 | 47 | int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status); 48 | void ShutDown(jack_status_t code, const char* message); 49 | 50 | int ClientNotifyImp(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2); 51 | 52 | JackGraphManager* GetGraphManager() const; 53 | JackEngineControl* GetEngineControl() const; 54 | JackClientControl* GetClientControl() const; 55 | JackMetadata* GetMetadata() const; 56 | }; 57 | 58 | } // end of namespace 59 | 60 | #endif 61 | 62 | -------------------------------------------------------------------------------- /common/JackLibSampleRateResampler.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackLibSampleRateResampler__ 21 | #define __JackLibSampleRateResampler__ 22 | 23 | #include "JackResampler.h" 24 | #include 25 | 26 | namespace Jack 27 | { 28 | 29 | /*! 30 | \brief Resampler using "libsamplerate" (http://www.mega-nerd.com/SRC/). 31 | */ 32 | 33 | class JackLibSampleRateResampler : public JackResampler 34 | { 35 | 36 | private: 37 | 38 | SRC_STATE* fResampler; 39 | 40 | public: 41 | 42 | JackLibSampleRateResampler(); 43 | JackLibSampleRateResampler(unsigned int quality); 44 | virtual ~JackLibSampleRateResampler(); 45 | 46 | unsigned int ReadResample(jack_default_audio_sample_t* buffer, unsigned int frames); 47 | unsigned int WriteResample(jack_default_audio_sample_t* buffer, unsigned int frames); 48 | 49 | void Reset(unsigned int new_size); 50 | 51 | }; 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /common/JackLoopbackDriver.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 Paul Davis 3 | Copyright (C) 2004-2008 Grame 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | */ 20 | 21 | #ifndef __JackLoopbackDriver__ 22 | #define __JackLoopbackDriver__ 23 | 24 | #include "JackAudioDriver.h" 25 | 26 | namespace Jack 27 | { 28 | 29 | /*! 30 | \brief The loopback driver : to be used to "pipeline" applications connected in sequence. 31 | */ 32 | 33 | class JackLoopbackDriver : public JackAudioDriver 34 | { 35 | 36 | private: 37 | 38 | virtual int ProcessReadSync(); 39 | virtual int ProcessWriteSync(); 40 | 41 | virtual int ProcessReadAsync(); 42 | virtual int ProcessWriteAsync(); 43 | 44 | public: 45 | 46 | JackLoopbackDriver(JackLockedEngine* engine, JackSynchro* table) 47 | : JackAudioDriver("loopback", "loopback", engine, table) 48 | {} 49 | virtual ~JackLoopbackDriver() 50 | {} 51 | }; 52 | 53 | } // end of namespace 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /common/JackMidiBufferReadQueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackMidiBufferReadQueue__ 21 | #define __JackMidiBufferReadQueue__ 22 | 23 | #include "JackMidiReadQueue.h" 24 | 25 | namespace Jack { 26 | 27 | /** 28 | * Wrapper class to present a JackMidiBuffer in a read queue interface. 29 | */ 30 | 31 | class SERVER_EXPORT JackMidiBufferReadQueue: public JackMidiReadQueue { 32 | 33 | private: 34 | 35 | JackMidiBuffer *buffer; 36 | jack_nframes_t event_count; 37 | jack_nframes_t index; 38 | jack_nframes_t last_frame_time; 39 | jack_midi_event_t midi_event; 40 | 41 | public: 42 | 43 | JackMidiBufferReadQueue(); 44 | 45 | jack_midi_event_t * 46 | DequeueEvent(); 47 | 48 | /** 49 | * This method must be called each period to reset the MIDI buffer for 50 | * processing. 51 | */ 52 | 53 | void 54 | ResetMidiBuffer(JackMidiBuffer *buffer); 55 | 56 | }; 57 | 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /common/JackMidiBufferWriteQueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackMidiBufferWriteQueue__ 21 | #define __JackMidiBufferWriteQueue__ 22 | 23 | #include "JackMidiWriteQueue.h" 24 | 25 | namespace Jack { 26 | 27 | /** 28 | * Wrapper class to present a JackMidiBuffer in a write queue interface. 29 | */ 30 | 31 | class SERVER_EXPORT JackMidiBufferWriteQueue: public JackMidiWriteQueue { 32 | 33 | private: 34 | 35 | JackMidiBuffer *buffer; 36 | jack_nframes_t last_frame_time; 37 | size_t max_bytes; 38 | jack_nframes_t next_frame_time; 39 | 40 | public: 41 | 42 | using JackMidiWriteQueue::EnqueueEvent; 43 | 44 | JackMidiBufferWriteQueue(); 45 | 46 | EnqueueResult 47 | EnqueueEvent(jack_nframes_t time, size_t size, 48 | jack_midi_data_t *buffer); 49 | 50 | /** 51 | * This method must be called each period to reset the MIDI buffer for 52 | * processing. 53 | */ 54 | 55 | void 56 | ResetMidiBuffer(JackMidiBuffer *buffer, jack_nframes_t frames); 57 | 58 | }; 59 | 60 | } 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /common/JackMidiReadQueue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #include "JackMidiReadQueue.h" 21 | 22 | using Jack::JackMidiReadQueue; 23 | 24 | JackMidiReadQueue::~JackMidiReadQueue() 25 | { 26 | // Empty 27 | } 28 | -------------------------------------------------------------------------------- /common/JackMidiReadQueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackMidiReadQueue__ 21 | #define __JackMidiReadQueue__ 22 | 23 | #include "JackMidiPort.h" 24 | 25 | namespace Jack { 26 | 27 | /** 28 | * Interface for objects that MIDI events can be read from. 29 | */ 30 | 31 | class SERVER_EXPORT JackMidiReadQueue { 32 | 33 | public: 34 | 35 | virtual 36 | ~JackMidiReadQueue(); 37 | 38 | /** 39 | * Dequeues an event from the queue. Returns the event, or 0 if no 40 | * events are available for reading. 41 | * 42 | * An event dequeued from the read queue is guaranteed to be valid up 43 | * until another event is dequeued, at which all bets are off. Make 44 | * sure that you handle each event you dequeue before dequeueing the 45 | * next event. 46 | */ 47 | 48 | virtual jack_midi_event_t * 49 | DequeueEvent() = 0; 50 | 51 | }; 52 | 53 | } 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /common/JackMidiReceiveQueue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #include "JackMidiReceiveQueue.h" 21 | 22 | using Jack::JackMidiReceiveQueue; 23 | 24 | JackMidiReceiveQueue::~JackMidiReceiveQueue() 25 | { 26 | // Empty 27 | } 28 | -------------------------------------------------------------------------------- /common/JackMidiReceiveQueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackMidiReceiveQueue__ 21 | #define __JackMidiReceiveQueue__ 22 | 23 | #include "JackMidiReadQueue.h" 24 | 25 | namespace Jack { 26 | 27 | /** 28 | * Implemented by MIDI input connections. 29 | */ 30 | 31 | class SERVER_EXPORT JackMidiReceiveQueue: public JackMidiReadQueue { 32 | 33 | public: 34 | 35 | virtual 36 | ~JackMidiReceiveQueue(); 37 | 38 | }; 39 | 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /common/JackMidiSendQueue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #include "JackMidiSendQueue.h" 21 | #include "JackMidiUtil.h" 22 | 23 | using Jack::JackMidiSendQueue; 24 | 25 | JackMidiSendQueue::~JackMidiSendQueue() 26 | { 27 | // Empty 28 | } 29 | 30 | jack_nframes_t 31 | JackMidiSendQueue::GetNextScheduleFrame() 32 | { 33 | return GetCurrentFrame(); 34 | } 35 | -------------------------------------------------------------------------------- /common/JackMidiSendQueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackMidiSendQueue__ 21 | #define __JackMidiSendQueue__ 22 | 23 | #include "JackMidiWriteQueue.h" 24 | 25 | namespace Jack { 26 | 27 | /** 28 | * Implemented by MIDI output connections. 29 | */ 30 | 31 | class SERVER_EXPORT JackMidiSendQueue: public JackMidiWriteQueue { 32 | 33 | public: 34 | 35 | using JackMidiWriteQueue::EnqueueEvent; 36 | 37 | virtual 38 | ~JackMidiSendQueue(); 39 | 40 | /** 41 | * Returns the next frame that a MIDI message can be sent at. The 42 | * default method returns the current frame. 43 | */ 44 | 45 | virtual jack_nframes_t 46 | GetNextScheduleFrame(); 47 | 48 | }; 49 | 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /common/JackMidiWriteQueue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #include "JackMidiWriteQueue.h" 21 | 22 | using Jack::JackMidiWriteQueue; 23 | 24 | JackMidiWriteQueue::~JackMidiWriteQueue() 25 | { 26 | // Empty 27 | } 28 | -------------------------------------------------------------------------------- /common/JackNetSocket.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008-2011 Romain Moret at Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackNetSocket__ 21 | #define __JackNetSocket__ 22 | 23 | #include "JackCompilerDeps.h" 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | namespace Jack 31 | { 32 | //get host name********************************* 33 | SERVER_EXPORT int GetHostName(char * name, int size); 34 | 35 | //net errors *********************************** 36 | enum _net_error 37 | { 38 | NET_CONN_ERROR = 10000, 39 | NET_OP_ERROR, 40 | NET_NO_DATA, 41 | NET_NO_NETWORK, 42 | NET_NO_ERROR 43 | }; 44 | 45 | typedef enum _net_error net_error_t; 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /common/JackNotification.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackNotification__ 21 | #define __JackNotification__ 22 | 23 | namespace Jack 24 | { 25 | 26 | /*! 27 | \brief Notifications sent by the server for clients. 28 | */ 29 | 30 | enum NotificationType { 31 | kAddClient = 0, 32 | kRemoveClient = 1, 33 | kActivateClient = 2, 34 | kXRunCallback = 3, 35 | kGraphOrderCallback = 4, 36 | kBufferSizeCallback = 5, 37 | kSampleRateCallback = 6, 38 | kStartFreewheelCallback = 7, 39 | kStopFreewheelCallback = 8, 40 | kPortRegistrationOnCallback = 9, 41 | kPortRegistrationOffCallback = 10, 42 | kPortConnectCallback = 11, 43 | kPortDisconnectCallback = 12, 44 | kPortRenameCallback = 13, 45 | kRealTimeCallback = 14, 46 | kShutDownCallback = 15, 47 | kQUIT = 16, 48 | kSessionCallback = 17, 49 | kLatencyCallback = 18, 50 | kPropertyChangeCallback = 19, 51 | kMaxNotification = 64 // To keep some room in JackClientControl fCallback table 52 | }; 53 | 54 | } // end of namespace 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /common/JackPlatformPlug.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2008 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackPlatformPlug__ 21 | #define __JackPlatformPlug__ 22 | 23 | #include "JackPlatformPlug_os.h" 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /common/JackPortType.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 Dmitry Baikov 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #include "JackPortType.h" 21 | #include 22 | #include 23 | 24 | namespace Jack 25 | { 26 | 27 | static const JackPortType* gPortTypes[] = 28 | { 29 | &gAudioPortType, 30 | &gMidiPortType, 31 | }; 32 | 33 | const jack_port_type_id_t PORT_TYPES_MAX = sizeof(gPortTypes) / sizeof(gPortTypes[0]); 34 | 35 | jack_port_type_id_t GetPortTypeId(const char* port_type) 36 | { 37 | for (jack_port_type_id_t i = 0; i < PORT_TYPES_MAX; ++i) { 38 | const JackPortType* type = gPortTypes[i]; 39 | assert(type != NULL); 40 | if (strcmp(port_type, type->fName) == 0) { 41 | return i; 42 | } 43 | } 44 | return PORT_TYPES_MAX; 45 | } 46 | 47 | const JackPortType* GetPortType(jack_port_type_id_t type_id) 48 | { 49 | if (type_id >= PORT_TYPES_MAX) 50 | return NULL; 51 | const JackPortType* type = gPortTypes[type_id]; 52 | assert(type != NULL); 53 | return type; 54 | } 55 | 56 | } // namespace Jack 57 | -------------------------------------------------------------------------------- /common/JackPortType.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 Dmitry Baikov 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackPortType__ 21 | #define __JackPortType__ 22 | 23 | #include "types.h" 24 | #include "JackConstants.h" 25 | #include 26 | 27 | namespace Jack 28 | { 29 | 30 | extern const jack_port_type_id_t PORT_TYPES_MAX; 31 | 32 | struct JackPortType 33 | { 34 | const char* fName; 35 | size_t (*size)(); 36 | void (*init)(void* buffer, size_t buffer_size, jack_nframes_t nframes); 37 | void (*mixdown)(void *mixbuffer, void** src_buffers, int src_count, jack_nframes_t nframes); 38 | }; 39 | 40 | extern jack_port_type_id_t GetPortTypeId(const char* port_type); 41 | extern const struct JackPortType* GetPortType(jack_port_type_id_t port_type_id); 42 | 43 | extern const struct JackPortType gAudioPortType; 44 | extern const struct JackPortType gMidiPortType; 45 | 46 | } // namespace Jack 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /common/JackRequestDecoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackRequestDecoder__ 21 | #define __JackRequestDecoder__ 22 | 23 | #include "JackChannel.h" 24 | 25 | namespace Jack 26 | { 27 | 28 | class JackServer; 29 | struct JackClientOpenRequest; 30 | struct JackClientOpenResult; 31 | 32 | struct JackClientHandlerInterface { 33 | 34 | virtual void ClientAdd(detail::JackChannelTransactionInterface* socket, JackClientOpenRequest* req, JackClientOpenResult* res) = 0; 35 | virtual void ClientRemove(detail::JackChannelTransactionInterface* socket, int refnum) = 0; 36 | 37 | virtual ~JackClientHandlerInterface() 38 | {} 39 | 40 | }; 41 | 42 | /*! 43 | \brief Request decoder 44 | */ 45 | 46 | class JackRequestDecoder 47 | { 48 | private: 49 | 50 | JackServer* fServer; 51 | JackClientHandlerInterface* fHandler; 52 | 53 | public: 54 | 55 | JackRequestDecoder(JackServer* server, JackClientHandlerInterface* handler); 56 | virtual ~JackRequestDecoder(); 57 | 58 | int HandleRequest(detail::JackChannelTransactionInterface* socket, int type); 59 | }; 60 | 61 | } // end of namespace 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /common/JackRestartThreadedDriver.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 Paul Davis 3 | Copyright (C) 2004-2008 Grame 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | */ 20 | 21 | #include "JackSystemDeps.h" 22 | #include "JackRestartThreadedDriver.h" 23 | #include "JackException.h" 24 | 25 | namespace Jack 26 | { 27 | 28 | bool JackRestartThreadedDriver::Execute() 29 | { 30 | try { 31 | // Keep running even in case of error 32 | while (fThread.GetStatus() == JackThread::kRunning) { 33 | Process(); 34 | } 35 | return false; 36 | } catch (JackNetException& e) { 37 | e.PrintMessage(); 38 | jack_info("Driver is restarted"); 39 | fThread.DropSelfRealTime(); 40 | // Thread in kIniting status again... 41 | fThread.SetStatus(JackThread::kIniting); 42 | if (Init()) { 43 | // Thread in kRunning status again... 44 | fThread.SetStatus(JackThread::kRunning); 45 | return true; 46 | } else { 47 | return false; 48 | } 49 | } 50 | } 51 | 52 | } // end of namespace 53 | -------------------------------------------------------------------------------- /common/JackRestartThreadedDriver.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 Paul Davis 3 | Copyright (C) 2004-2008 Grame 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | */ 20 | 21 | #ifndef __JackRestartThreadedDriver__ 22 | #define __JackRestartThreadedDriver__ 23 | 24 | #include "JackThreadedDriver.h" 25 | 26 | namespace Jack 27 | { 28 | 29 | /*! 30 | \brief Restart a driver after an exception is thrown. 31 | */ 32 | 33 | class SERVER_EXPORT JackRestartThreadedDriver : public JackThreadedDriver 34 | { 35 | public: 36 | 37 | JackRestartThreadedDriver(JackDriver* driver) 38 | :JackThreadedDriver(driver) 39 | {} 40 | virtual ~JackRestartThreadedDriver() 41 | {} 42 | 43 | // JackRunnableInterface interface 44 | virtual bool Execute(); 45 | }; 46 | 47 | } // end of namespace 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /common/JackServerLaunch.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001-2003 Paul Davis 3 | Copyright (C) 2004-2006 Grame 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU Lesser General Public License as published by 7 | the Free Software Foundation; either version 2.1 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef __JackServerLaunch__ 22 | #define __JackServerLaunch__ 23 | 24 | #include "varargs.h" 25 | #include "types.h" 26 | 27 | int try_start_server(jack_varargs_t* va, jack_options_t options, jack_status_t* status); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /common/JackSystemDeps.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2006 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackSystemDeps__ 21 | #define __JackSystemDeps__ 22 | 23 | #include "systemdeps.h" 24 | #include "JackSystemDeps_os.h" 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /common/JackTime.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001-2003 Paul Davis 3 | Copyright (C) 2004-2008 Grame 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU Lesser General Public License as published by 7 | the Free Software Foundation; either version 2.1 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef __JackTime__ 22 | #define __JackTime__ 23 | 24 | #include "JackCompilerDeps.h" 25 | #include "JackTypes.h" 26 | 27 | #ifdef __cplusplus 28 | extern "C" 29 | { 30 | #endif 31 | 32 | SERVER_EXPORT void InitTime(); 33 | SERVER_EXPORT void EndTime(); 34 | SERVER_EXPORT jack_time_t GetMicroSeconds(void); 35 | SERVER_EXPORT void JackSleep(long usec); 36 | 37 | void SetClockSource(jack_timer_type_t source); 38 | const char* ClockSourceName(jack_timer_type_t source); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /common/JackTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 Paul Davis 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | $Id: JackTypes.h,v 1.2.2.1 2006/06/20 14:44:00 letz Exp $ 19 | */ 20 | 21 | #ifndef __JackTypes__ 22 | #define __JackTypes__ 23 | 24 | #include "types.h" 25 | #include "JackCompilerDeps.h" 26 | 27 | typedef unsigned short UInt16; 28 | #if __LP64__ 29 | typedef unsigned int UInt32; 30 | typedef signed int SInt32; 31 | #else 32 | typedef unsigned long UInt32; 33 | typedef signed long SInt32; 34 | #endif 35 | 36 | #include "JackTypes_os.h" 37 | 38 | typedef uint16_t jack_int_t; // Internal type for ports and refnum 39 | 40 | typedef enum { 41 | JACK_TIMER_SYSTEM_CLOCK, 42 | JACK_TIMER_HPET, 43 | } jack_timer_type_t; 44 | 45 | typedef enum { 46 | NotTriggered, 47 | Triggered, 48 | Running, 49 | Finished, 50 | } jack_client_state_t; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /common/JackWaitCallbackDriver.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 Cédric Schieli 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | */ 19 | 20 | #include "JackWaitCallbackDriver.h" 21 | 22 | namespace Jack 23 | { 24 | 25 | JackWaitCallbackDriver::JackWaitCallbackDriver(JackRestarterDriver* driver) 26 | : JackWaitThreadedDriver(driver) 27 | { 28 | // Self register with the decorated driver so it can restart us 29 | assert(driver); 30 | driver->SetRestartDriver((JackDriver*)this); 31 | } 32 | 33 | bool JackWaitCallbackDriver::ExecuteReal() 34 | { 35 | // End the thread and let the callback driver do its job 36 | return false; 37 | } 38 | 39 | } // end of namespace 40 | -------------------------------------------------------------------------------- /common/JackWaitCallbackDriver.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 Cédric Schieli 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackWaitCallbackDriver__ 21 | #define __JackWaitCallbackDriver__ 22 | 23 | #include "JackWaitThreadedDriver.h" 24 | 25 | namespace Jack 26 | { 27 | 28 | /*! 29 | \brief Wrapper for a restartable non-threaded driver (e.g. JackProxyDriver). 30 | 31 | Simply ends its thread when the decorated driver Initialize method returns. 32 | Self register with the supplied JackRestarterDriver so it can restart the thread. 33 | */ 34 | 35 | class SERVER_EXPORT JackWaitCallbackDriver : public JackWaitThreadedDriver 36 | { 37 | public: 38 | 39 | JackWaitCallbackDriver(JackRestarterDriver* driver); 40 | 41 | protected: 42 | 43 | bool ExecuteReal(); 44 | }; 45 | 46 | 47 | } // end of namespace 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /common/jack/uuid.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2013 Paul Davis 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __jack_uuid_h__ 21 | #define __jack_uuid_h__ 22 | 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #define JACK_UUID_SIZE 36 30 | #define JACK_UUID_STRING_SIZE (JACK_UUID_SIZE+1) /* includes trailing null */ 31 | #define JACK_UUID_EMPTY_INITIALIZER 0 32 | 33 | extern jack_uuid_t jack_client_uuid_generate (); 34 | extern jack_uuid_t jack_port_uuid_generate (uint32_t port_id); 35 | 36 | extern uint32_t jack_uuid_to_index (jack_uuid_t); 37 | 38 | extern int jack_uuid_compare (jack_uuid_t, jack_uuid_t); 39 | extern void jack_uuid_copy (jack_uuid_t* dst, jack_uuid_t src); 40 | extern void jack_uuid_clear (jack_uuid_t*); 41 | extern int jack_uuid_parse (const char *buf, jack_uuid_t*); 42 | extern void jack_uuid_unparse (jack_uuid_t, char buf[JACK_UUID_STRING_SIZE]); 43 | extern int jack_uuid_empty (jack_uuid_t); 44 | 45 | #ifdef __cplusplus 46 | } /* namespace */ 47 | #endif 48 | 49 | #endif /* __jack_uuid_h__ */ 50 | 51 | -------------------------------------------------------------------------------- /common/promiscuous.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014-2017 Cédric Schieli 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public License 6 | as published by the Free Software Foundation; either version 2.1 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __jack_gid_h__ 21 | #define __jack_gid_h__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" 25 | { 26 | #endif 27 | 28 | int jack_group2gid (const char *group); /*!< Lookup gid for a UNIX group in a thread-safe way */ 29 | #ifndef WIN32 30 | int jack_promiscuous_perms (int fd, const char *path, gid_t gid); /*!< Set promiscuous permissions on object referenced by fd and/or path */ 31 | #endif 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* __jack_gid_h__ */ 38 | 39 | 40 | -------------------------------------------------------------------------------- /common/timestamps.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2002 Paul Davis 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __jack_timestamps_h__ 21 | #define __jack_timestamps_h__ 22 | 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" 27 | { 28 | #endif 29 | 30 | void jack_init_timestamps (unsigned long howmany); 31 | void jack_timestamp (const char *what); 32 | void jack_dump_timestamps (FILE *out); 33 | void jack_reset_timestamps (); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif /* __jack_timestamps_h__ */ 40 | 41 | 42 | -------------------------------------------------------------------------------- /compat/README.md: -------------------------------------------------------------------------------- 1 | # Operating System Compatibility Modules for WAF 2 | 3 | This directory contains waf modules that aid compatibility across 4 | different operating systems. Here a module is a pluggable and reusable 5 | piece of code for the waf build system along with necessary 6 | replacements. 7 | 8 | To create a new compatibility module simply create a new subdirectory 9 | containing a `wscript` file and any necessary replacement files. The 10 | `wscript` must define the `options`, `configure` and `build` functions. 11 | 12 | To use the modules you need to call `recurse` in your `options`, 13 | `configure` and `build` commands. For example 14 | ```python 15 | def options(opt): 16 | # Do stuff... 17 | opt.recurse('compat') 18 | # Do other stuff... 19 | 20 | def configure(conf): 21 | # Do stuff... 22 | conf.recurse('compat') 23 | # Do other stuff... 24 | 25 | def build(bld): 26 | # Do stuff... 27 | bld.recurse('compat') 28 | # Do other stuff... 29 | ``` 30 | assuming this directory is called `compat`. After doing this you need to 31 | take any necessary actions described in the modules you want to use. 32 | 33 | The code in this directory is intended to be generic and reusable. When 34 | writing new modules, please keep this in mind. Whenever necessary it 35 | should be possible to make this directory a git submodule and all the 36 | subdirectories other submodules, to aid reuse. 37 | 38 | If you would like to use these modules in another project, please file 39 | an issue so that we can join forces and maintain the compatabilitiy 40 | modules in a separate repository. 41 | -------------------------------------------------------------------------------- /compat/alloca/README.md: -------------------------------------------------------------------------------- 1 | # Compatibility Module for alloca 2 | 3 | This module contains a replacement header for alloca. To use this module 4 | simply make sure to `#include ` in the file where alloca 5 | should be used. If the header is missing the path to the replacement 6 | header is added to the global include paths, so nothing more needs to be 7 | done. 8 | -------------------------------------------------------------------------------- /compat/alloca/alloca.h: -------------------------------------------------------------------------------- 1 | /* 2 | * alloca.h 3 | * 4 | * Replacement header for systems lacking the alloca.h header required 5 | * to use the alloca function. 6 | * 7 | * Copyright (C) 2018 Karl Linden 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as 11 | * published by the Free Software Foundation; either version 2.1 of the 12 | * License, or (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, but 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 22 | * USA. 23 | * 24 | */ 25 | 26 | #ifndef ALLOCA_H 27 | # define ALLOCA_H 28 | 29 | # if _MSC_VER 30 | # include 31 | # define alloca _alloca 32 | # endif /* _MSC_VER */ 33 | 34 | #endif /* !ALLOCA_H */ 35 | -------------------------------------------------------------------------------- /compat/alloca/wscript: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # encoding: utf-8 3 | # 4 | # Copyright (C) 2018 Karl Linden 5 | # 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 2 of the License. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | # 19 | 20 | from waflib import Errors 21 | 22 | 23 | def options(opt): 24 | pass 25 | 26 | 27 | def configure(conf): 28 | try: 29 | conf.check(header_name='alloca.h') 30 | except Errors.ConfigurationError: 31 | conf.env.append_unique('INCLUDES', conf.path.abspath()) 32 | 33 | 34 | def build(bld): 35 | pass 36 | -------------------------------------------------------------------------------- /compat/wscript: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # encoding: utf-8 3 | # 4 | # Copyright (C) 2018 Karl Linden 5 | # 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 2 of the License. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | # 19 | 20 | import os 21 | 22 | 23 | def get_subdirs(ctx): 24 | """ 25 | Get the compatibility module subirectories. 26 | 27 | The compat modules are found dynamically so that this script does 28 | not have to be modified if more modules are added. 29 | 30 | :param ctx: the waf context 31 | :type ctx: waflib.Context.Context 32 | :returns: list of str -- the subdirectories 33 | """ 34 | subdirs = [] 35 | for entry in ctx.path.listdir(): 36 | path = os.path.join(ctx.path.abspath(), entry) 37 | if os.path.isdir(path) and not entry.startswith('.'): 38 | subdirs.append(entry) 39 | return subdirs 40 | 41 | 42 | def recurse_into_subdirs(ctx): 43 | """ 44 | Recurse into compatibility module subdirectories. 45 | 46 | :param ctx: the waf context 47 | :type ctx: waflib.Context.Context 48 | """ 49 | for x in get_subdirs(ctx): 50 | ctx.recurse(x) 51 | 52 | 53 | def options(opt): 54 | recurse_into_subdirs(opt) 55 | 56 | 57 | def configure(conf): 58 | recurse_into_subdirs(conf) 59 | 60 | 61 | def build(bld): 62 | recurse_into_subdirs(bld) 63 | -------------------------------------------------------------------------------- /dbus/audio_reserve.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 16 | 17 | */ 18 | 19 | #ifndef __audio_reserve__ 20 | #define __audio_reserve__ 21 | 22 | #include "JackCompilerDeps.h" 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | SERVER_EXPORT int audio_reservation_init(); 30 | SERVER_EXPORT int audio_reservation_finish(); 31 | 32 | SERVER_EXPORT bool audio_acquire(const char * device_name); 33 | SERVER_EXPORT void audio_release(const char * device_name); 34 | SERVER_EXPORT void audio_reserve_loop(); 35 | 36 | #ifdef __cplusplus 37 | } /* extern "C" */ 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /dbus/controller.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C ; c-basic-offset: 4 -*- */ 2 | /* 3 | Copyright (C) 2007 Nedko Arnaudov 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #ifndef CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED 21 | #define CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED 22 | 23 | void * 24 | jack_controller_create( 25 | DBusConnection *connection); 26 | 27 | void 28 | jack_controller_run( 29 | void *controller_ptr); 30 | 31 | void 32 | jack_controller_destroy( 33 | void *controller_ptr); 34 | 35 | #endif /* #ifndef CONTROLLER_H__2CC80B1E_8D5D_45E3_A9D8_9086DDF68BB5__INCLUDED */ 36 | -------------------------------------------------------------------------------- /dbus/controller_iface_transport.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C ; c-basic-offset: 4 -*- */ 2 | /* 3 | Copyright (C) 2008 Nedko Arnaudov 4 | Copyright (C) 2008 Juuso Alasuutari 5 | 6 | This program is free software; you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation; either version 2 of the License. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | */ 20 | 21 | #if defined(HAVE_CONFIG_H) 22 | #include "config.h" 23 | #endif 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include "jackdbus.h" 32 | 33 | JACK_DBUS_METHODS_BEGIN 34 | JACK_DBUS_METHODS_END 35 | 36 | JACK_DBUS_IFACE_BEGIN(g_jack_controller_iface_transport, "org.jackaudio.JackTransport") 37 | JACK_DBUS_IFACE_EXPOSE_METHODS 38 | JACK_DBUS_IFACE_END 39 | -------------------------------------------------------------------------------- /dbus/org.jackaudio.service.in: -------------------------------------------------------------------------------- 1 | [D-BUS Service] 2 | Name=org.jackaudio.service 3 | Exec=@BINDIR@/jackdbus auto 4 | -------------------------------------------------------------------------------- /dbus/sigsegv.h: -------------------------------------------------------------------------------- 1 | #ifndef __SIGSEGV_H__ 2 | #define __SIGSEGV_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | #endif 7 | int setup_sigsegv(); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /dbus/xml.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C ; c-basic-offset: 4 -*- */ 2 | /* 3 | Copyright (C) 2007,2008 Nedko Arnaudov 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #ifndef XML_H__4F102BD2_3354_41C9_B842_DC00E1557A0F__INCLUDED 21 | #define XML_H__4F102BD2_3354_41C9_B842_DC00E1557A0F__INCLUDED 22 | 23 | bool 24 | jack_controller_settings_save( 25 | struct jack_controller * controller_ptr, 26 | void *dbus_call_context_ptr); 27 | 28 | void 29 | jack_controller_settings_load( 30 | struct jack_controller * controller_ptr); 31 | 32 | void 33 | jack_controller_settings_save_auto( 34 | struct jack_controller * controller_ptr); 35 | 36 | #endif /* #ifndef XML_H__4F102BD2_3354_41C9_B842_DC00E1557A0F__INCLUDED */ 37 | -------------------------------------------------------------------------------- /dbus/xml_nop.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C ; c-basic-offset: 4 -*- */ 2 | /* 3 | Copyright (C) 2007,2008 Nedko Arnaudov 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #if defined(HAVE_CONFIG_H) 21 | #include "config.h" 22 | #endif 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include "dbus.h" 30 | #include "controller_internal.h" 31 | 32 | bool 33 | jack_controller_settings_init() 34 | { 35 | return true; 36 | } 37 | 38 | void 39 | jack_controller_settings_uninit() 40 | { 41 | } 42 | 43 | bool 44 | jack_controller_settings_save( 45 | struct jack_controller * controller_ptr, 46 | void *dbus_call_context_ptr) 47 | { 48 | jack_dbus_error(dbus_call_context_ptr, JACK_DBUS_ERROR_GENERIC, "jackdbus compiled without settings persistence"); 49 | return true; 50 | } 51 | 52 | void 53 | jack_controller_settings_load( 54 | struct jack_controller * controller_ptr) 55 | { 56 | } 57 | 58 | void 59 | jack_controller_settings_save_auto( 60 | struct jack_controller * controller_ptr) 61 | { 62 | } 63 | -------------------------------------------------------------------------------- /freebsd/JackAtomic_os.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2008 Grame 3 | Copyright (C) 2018 Greg V 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU Lesser General Public License as published by 7 | the Free Software Foundation; either version 2.1 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef __JackAtomic_freebsd__ 22 | #define __JackAtomic_freebsd__ 23 | 24 | #include "JackTypes.h" 25 | #include 26 | #include 27 | 28 | static inline char CAS(volatile UInt32 value, UInt32 newvalue, volatile void* addr) 29 | { 30 | return atomic_cmpset_32((uint32_t*)addr, value, newvalue); 31 | } 32 | 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /freebsd/driver.h: -------------------------------------------------------------------------------- 1 | #include "../linux/driver.h" 2 | -------------------------------------------------------------------------------- /freebsd/uptime.h: -------------------------------------------------------------------------------- 1 | #include "../linux/uptime.h" 2 | -------------------------------------------------------------------------------- /jack.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@PREFIX@ 2 | exec_prefix=@PREFIX@ 3 | libdir=@LIBDIR@ 4 | includedir=@INCLUDEDIR@ 5 | server_libs=-L@LIBDIR@ -l@SERVERLIB@ 6 | jack_implementation=jack2 7 | 8 | Name: jack 9 | Description: the Jack Audio Connection Kit: a low-latency synchronous callback-based media server 10 | Version: @JACK_VERSION@ 11 | Libs: -L${libdir} -l@CLIENTLIB@ 12 | Cflags: -I${includedir} 13 | -------------------------------------------------------------------------------- /linux/alsa/alsa_midi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 Dmitry S. Baikov 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #ifndef __jack_alsa_midi_h__ 20 | #define __jack_alsa_midi_h__ 21 | 22 | #ifdef __cplusplus 23 | extern "C" 24 | { 25 | #else 26 | #include 27 | #endif 28 | 29 | typedef struct alsa_midi_t alsa_midi_t; 30 | struct alsa_midi_t { 31 | void (*destroy)(alsa_midi_t *amidi); 32 | int (*attach)(alsa_midi_t *amidi); 33 | int (*detach)(alsa_midi_t *amidi); 34 | int (*start)(alsa_midi_t *amidi); 35 | int (*stop)(alsa_midi_t *amidi); 36 | void (*read)(alsa_midi_t *amidi, jack_nframes_t nframes); 37 | void (*write)(alsa_midi_t *amidi, jack_nframes_t nframes); 38 | }; 39 | 40 | alsa_midi_t* alsa_rawmidi_new(jack_client_t *jack); 41 | alsa_midi_t* alsa_seqmidi_new(jack_client_t *jack, const char* alsa_name); 42 | 43 | #ifdef __cplusplus 44 | } // extern "C" 45 | #endif 46 | 47 | #endif /* __jack_alsa_midi_h__ */ 48 | -------------------------------------------------------------------------------- /linux/alsa/generic.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 Paul Davis 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | $Id: generic.h,v 1.3 2005/11/23 11:24:29 letz Exp $ 19 | */ 20 | 21 | #ifndef __jack_generic_h__ 22 | #define __jack_generic_h__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" 26 | { 27 | #endif 28 | 29 | jack_hardware_t * 30 | jack_alsa_generic_hw_new (alsa_driver_t *driver); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | 37 | #endif /* __jack_generic_h__*/ 38 | -------------------------------------------------------------------------------- /linux/alsa/generic_hw.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 Paul Davis 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | $Id: generic_hw.c,v 1.2 2005/08/29 10:36:28 letz Exp $ 19 | */ 20 | 21 | #include "hardware.h" 22 | #include "alsa_driver.h" 23 | 24 | static int generic_set_input_monitor_mask (jack_hardware_t *hw, unsigned long mask) 25 | { 26 | return -1; 27 | } 28 | 29 | static int generic_change_sample_clock (jack_hardware_t *hw, SampleClockMode mode) 30 | { 31 | return -1; 32 | } 33 | 34 | static void 35 | generic_release (jack_hardware_t *hw) 36 | { 37 | return; 38 | } 39 | 40 | jack_hardware_t * 41 | jack_alsa_generic_hw_new (alsa_driver_t *driver) 42 | 43 | { 44 | jack_hardware_t *hw; 45 | 46 | hw = (jack_hardware_t *) malloc (sizeof (jack_hardware_t)); 47 | 48 | hw->capabilities = 0; 49 | hw->input_monitor_mask = 0; 50 | 51 | hw->set_input_monitor_mask = generic_set_input_monitor_mask; 52 | hw->change_sample_clock = generic_change_sample_clock; 53 | hw->release = generic_release; 54 | 55 | return hw; 56 | } 57 | -------------------------------------------------------------------------------- /linux/alsa/hammerfall.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 Paul Davis 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | $Id: hammerfall.h,v 1.3 2005/11/23 11:24:29 letz Exp $ 19 | */ 20 | 21 | #ifndef __jack_hammerfall_h__ 22 | #define __jack_hammerfall_h__ 23 | 24 | #include 25 | 26 | typedef struct 27 | { 28 | int lock_status[3]; 29 | int sync_status[3]; 30 | int said_that_spdif_is_fine; 31 | pthread_t monitor_thread; 32 | alsa_driver_t *driver; 33 | struct timespec monitor_interval; 34 | } 35 | hammerfall_t; 36 | 37 | #ifdef __cplusplus 38 | extern "C" 39 | { 40 | #endif 41 | 42 | jack_hardware_t *jack_alsa_hammerfall_hw_new (alsa_driver_t *driver); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif /* __jack_hammerfall_h__*/ 49 | -------------------------------------------------------------------------------- /linux/alsa/hdsp.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 Paul Davis 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | $Id: hdsp.h,v 1.3 2005/11/23 11:24:29 letz Exp $ 19 | */ 20 | 21 | #ifndef __jack_hdsp_h__ 22 | #define __jack_hdsp_h__ 23 | 24 | #include 25 | 26 | typedef struct 27 | { 28 | alsa_driver_t *driver; 29 | } 30 | hdsp_t; 31 | 32 | #ifdef __cplusplus 33 | extern "C" 34 | { 35 | #endif 36 | 37 | jack_hardware_t * 38 | jack_alsa_hdsp_hw_new (alsa_driver_t *driver); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | 45 | #endif /* __jack_hdsp_h__*/ 46 | -------------------------------------------------------------------------------- /linux/alsa/midi_pack.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006,2007 Dmitry S. Baikov 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | */ 18 | 19 | #ifndef __jack_midi_pack_h__ 20 | #define __jack_midi_pack_h__ 21 | 22 | typedef struct 23 | { 24 | int running_status; 25 | } 26 | midi_pack_t; 27 | 28 | static inline 29 | void midi_pack_reset(midi_pack_t *p) 30 | { 31 | p->running_status = 0; 32 | } 33 | 34 | static 35 | void midi_pack_event(midi_pack_t *p, jack_midi_event_t *e) 36 | { 37 | if (e->buffer[0] >= 0x80 && e->buffer[0] < 0xF0) { // Voice Message 38 | if (e->buffer[0] == p->running_status) { 39 | e->buffer++; 40 | e->size--; 41 | } else 42 | p->running_status = e->buffer[0]; 43 | } else if (e->buffer[0] < 0xF8) { // not System Realtime 44 | p->running_status = 0; 45 | } 46 | } 47 | 48 | #endif /* __jack_midi_pack_h__ */ 49 | -------------------------------------------------------------------------------- /linux/alsarawmidi/JackALSARawMidiReceiveQueue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #include "JackALSARawMidiReceiveQueue.h" 21 | #include "JackError.h" 22 | #include "JackMidiUtil.h" 23 | 24 | using Jack::JackALSARawMidiReceiveQueue; 25 | 26 | JackALSARawMidiReceiveQueue:: 27 | JackALSARawMidiReceiveQueue(snd_rawmidi_t *rawmidi, size_t buffer_size) 28 | { 29 | buffer = new jack_midi_data_t[buffer_size]; 30 | this->buffer_size = buffer_size; 31 | this->rawmidi = rawmidi; 32 | } 33 | 34 | JackALSARawMidiReceiveQueue::~JackALSARawMidiReceiveQueue() 35 | { 36 | delete[] buffer; 37 | } 38 | 39 | jack_midi_event_t * 40 | JackALSARawMidiReceiveQueue::DequeueEvent() 41 | { 42 | ssize_t result = snd_rawmidi_read(rawmidi, buffer, buffer_size); 43 | if (result > 0) { 44 | event.buffer = buffer; 45 | event.size = (size_t) result; 46 | event.time = GetCurrentFrame(); 47 | return &event; 48 | } 49 | if (result && (result != -EWOULDBLOCK)) { 50 | jack_error("JackALSARawMidiReceiveQueue::DequeueEvent - " 51 | "snd_rawmidi_read: %s", snd_strerror(result)); 52 | } 53 | return 0; 54 | } 55 | -------------------------------------------------------------------------------- /linux/alsarawmidi/JackALSARawMidiReceiveQueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackALSARawMidiReceiveQueue__ 21 | #define __JackALSARawMidiReceiveQueue__ 22 | 23 | #include 24 | 25 | #include "JackMidiReceiveQueue.h" 26 | 27 | namespace Jack { 28 | 29 | class JackALSARawMidiReceiveQueue: public JackMidiReceiveQueue { 30 | 31 | private: 32 | 33 | jack_midi_data_t *buffer; 34 | size_t buffer_size; 35 | jack_midi_event_t event; 36 | snd_rawmidi_t *rawmidi; 37 | 38 | public: 39 | 40 | JackALSARawMidiReceiveQueue(snd_rawmidi_t *rawmidi, 41 | size_t buffer_size=4096); 42 | ~JackALSARawMidiReceiveQueue(); 43 | 44 | jack_midi_event_t * 45 | DequeueEvent(); 46 | 47 | }; 48 | 49 | } 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /linux/alsarawmidi/JackALSARawMidiSendQueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackALSARawMidiSendQueue__ 21 | #define __JackALSARawMidiSendQueue__ 22 | 23 | #include 24 | 25 | #include "JackMidiSendQueue.h" 26 | 27 | namespace Jack { 28 | 29 | class JackALSARawMidiSendQueue: public JackMidiSendQueue { 30 | 31 | private: 32 | 33 | bool blocked; 34 | size_t bytes_available; 35 | size_t bytes_per_poll; 36 | snd_rawmidi_t *rawmidi; 37 | 38 | public: 39 | 40 | JackALSARawMidiSendQueue(snd_rawmidi_t *rawmidi, 41 | size_t bytes_per_poll=0); 42 | 43 | JackMidiWriteQueue::EnqueueResult 44 | EnqueueEvent(jack_nframes_t time, size_t size, 45 | jack_midi_data_t *buffer); 46 | 47 | bool 48 | IsBlocked(); 49 | 50 | void 51 | ResetPollByteCount(); 52 | 53 | }; 54 | 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /linux/alsarawmidi/JackALSARawMidiUtil.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | #include "JackALSARawMidiUtil.h" 9 | 10 | void 11 | Jack::CreateNonBlockingPipe(int *fds) 12 | { 13 | if (pipe(fds) == -1) { 14 | throw std::runtime_error(strerror(errno)); 15 | } 16 | try { 17 | SetNonBlocking(fds[0]); 18 | SetNonBlocking(fds[1]); 19 | } catch (...) { 20 | close(fds[1]); 21 | close(fds[0]); 22 | throw; 23 | } 24 | } 25 | 26 | void 27 | Jack::DestroyNonBlockingPipe(int *fds) 28 | { 29 | close(fds[1]); 30 | close(fds[0]); 31 | } 32 | 33 | void 34 | Jack::SetNonBlocking(int fd) 35 | { 36 | int flags = fcntl(fd, F_GETFL); 37 | if (flags == -1) { 38 | throw std::runtime_error(strerror(errno)); 39 | } 40 | if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) == -1) { 41 | throw std::runtime_error(strerror(errno)); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /linux/alsarawmidi/JackALSARawMidiUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackALSARawMidiUtil__ 21 | #define __JackALSARawMidiUtil__ 22 | 23 | namespace Jack { 24 | 25 | void 26 | CreateNonBlockingPipe(int *fds); 27 | 28 | void 29 | DestroyNonBlockingPipe(int *fds); 30 | 31 | void 32 | SetNonBlocking(int fd); 33 | 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /linux/firewire/JackFFADOMidiInputPort.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackFFADOMidiInputPort__ 21 | #define __JackFFADOMidiInputPort__ 22 | 23 | #include "JackFFADOMidiReceiveQueue.h" 24 | #include "JackMidiBufferWriteQueue.h" 25 | #include "JackMidiRawInputWriteQueue.h" 26 | 27 | namespace Jack { 28 | 29 | class JackFFADOMidiInputPort { 30 | 31 | private: 32 | 33 | jack_midi_event_t *event; 34 | JackMidiRawInputWriteQueue *raw_queue; 35 | JackFFADOMidiReceiveQueue *receive_queue; 36 | JackMidiBufferWriteQueue *write_queue; 37 | 38 | public: 39 | 40 | JackFFADOMidiInputPort(size_t max_bytes=4096); 41 | ~JackFFADOMidiInputPort(); 42 | 43 | void 44 | Process(JackMidiBuffer *port_buffer, uint32_t *input_buffer, 45 | jack_nframes_t frames); 46 | 47 | }; 48 | 49 | } 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /linux/firewire/JackFFADOMidiOutputPort.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackFFADOMidiOutputPort__ 21 | #define __JackFFADOMidiOutputPort__ 22 | 23 | #include "JackFFADOMidiSendQueue.h" 24 | #include "JackMidiBufferReadQueue.h" 25 | #include "JackMidiRawOutputWriteQueue.h" 26 | 27 | namespace Jack { 28 | 29 | class JackFFADOMidiOutputPort { 30 | 31 | private: 32 | 33 | jack_midi_event_t *event; 34 | JackMidiRawOutputWriteQueue *raw_queue; 35 | JackMidiBufferReadQueue *read_queue; 36 | JackFFADOMidiSendQueue *send_queue; 37 | 38 | public: 39 | 40 | JackFFADOMidiOutputPort(size_t non_rt_size=4096, 41 | size_t max_non_rt_messages=1024, 42 | size_t max_rt_messages=128); 43 | ~JackFFADOMidiOutputPort(); 44 | 45 | void 46 | Process(JackMidiBuffer *port_buffer, uint32_t *output_buffer, 47 | jack_nframes_t frames); 48 | 49 | }; 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /linux/firewire/JackFFADOMidiReceiveQueue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #include "JackFFADOMidiReceiveQueue.h" 21 | #include "JackMidiUtil.h" 22 | 23 | using Jack::JackFFADOMidiReceiveQueue; 24 | 25 | JackFFADOMidiReceiveQueue::JackFFADOMidiReceiveQueue() 26 | { 27 | // Empty 28 | } 29 | 30 | jack_midi_event_t * 31 | JackFFADOMidiReceiveQueue::DequeueEvent() 32 | { 33 | for (; index < length; index += 8) { 34 | uint32_t data = input_buffer[index]; 35 | if (data & 0xff000000) { 36 | byte = (jack_midi_data_t) (data & 0xff); 37 | event.buffer = &byte; 38 | event.size = 1; 39 | event.time = last_frame + index; 40 | index += 8; 41 | return &event; 42 | } 43 | } 44 | return 0; 45 | } 46 | 47 | void 48 | JackFFADOMidiReceiveQueue::ResetInputBuffer(uint32_t *input_buffer, 49 | jack_nframes_t length) 50 | { 51 | this->input_buffer = input_buffer; 52 | index = 0; 53 | last_frame = GetLastFrame(); 54 | this->length = length; 55 | } 56 | -------------------------------------------------------------------------------- /linux/firewire/JackFFADOMidiReceiveQueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackFFADOMidiReceiveQueue__ 21 | #define __JackFFADOMidiReceiveQueue__ 22 | 23 | #include "JackMidiReceiveQueue.h" 24 | 25 | namespace Jack { 26 | 27 | class JackFFADOMidiReceiveQueue: public JackMidiReceiveQueue { 28 | 29 | private: 30 | 31 | jack_midi_data_t byte; 32 | jack_midi_event_t event; 33 | jack_nframes_t index; 34 | uint32_t *input_buffer; 35 | jack_nframes_t last_frame; 36 | jack_nframes_t length; 37 | 38 | public: 39 | 40 | JackFFADOMidiReceiveQueue(); 41 | 42 | jack_midi_event_t * 43 | DequeueEvent(); 44 | 45 | void 46 | ResetInputBuffer(uint32_t *input_buffer, jack_nframes_t length); 47 | 48 | }; 49 | 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /linux/firewire/JackFFADOMidiSendQueue.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2010 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackFFADOMidiSendQueue__ 21 | #define __JackFFADOMidiSendQueue__ 22 | 23 | #include "JackMidiSendQueue.h" 24 | 25 | namespace Jack { 26 | 27 | class JackFFADOMidiSendQueue: public JackMidiSendQueue { 28 | 29 | private: 30 | 31 | jack_nframes_t index; 32 | jack_nframes_t last_frame; 33 | jack_nframes_t length; 34 | uint32_t *output_buffer; 35 | 36 | public: 37 | 38 | JackFFADOMidiSendQueue(); 39 | 40 | EnqueueResult 41 | EnqueueEvent(jack_nframes_t time, size_t size, 42 | jack_midi_data_t *buffer); 43 | 44 | jack_nframes_t 45 | GetNextScheduleFrame(); 46 | 47 | void 48 | ResetOutputBuffer(uint32_t *output_buffer, jack_nframes_t length); 49 | 50 | }; 51 | 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /linux/uptime.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | long uptime(void) { 4 | struct sysinfo si; 5 | 6 | if (sysinfo(&si) != 0) 7 | { 8 | return -1; 9 | } 10 | 11 | return si.uptime; 12 | } 13 | -------------------------------------------------------------------------------- /linux/uptime.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2005 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #ifndef __uptime_LINUX__ 21 | #define __uptime_LINUX__ 22 | 23 | #define UPTIME_FUNCTION_NAME "sysinfo" 24 | 25 | long uptime(void); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /macosx/JackCompilerDeps_os.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2005 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackCompilerDeps_APPLE__ 21 | #define __JackCompilerDeps_APPLE__ 22 | 23 | #include "JackConstants.h" 24 | 25 | #if __GNUC__ 26 | 27 | #define MEM_ALIGN(x,y) x __attribute__((aligned(y))) 28 | #define LIB_EXPORT __attribute__((visibility("default"))) 29 | #ifdef SERVER_SIDE 30 | #define SERVER_EXPORT __attribute__((visibility("default"))) 31 | #else 32 | #define SERVER_EXPORT 33 | #endif 34 | #else 35 | #define MEM_ALIGN(x,y) x 36 | #define LIB_EXPORT 37 | #define SERVER_EXPORT 38 | /* Add other things here for non-gcc platforms */ 39 | #endif 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /macosx/JackMachTime.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001-2003 Paul Davis 3 | Copyright (C) 2004-2008 Grame 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU Lesser General Public License as published by 7 | the Free Software Foundation; either version 2.1 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include "JackTime.h" 22 | #include "JackError.h" 23 | #include "JackTypes.h" 24 | #include 25 | #include 26 | 27 | static double __jack_time_ratio; 28 | 29 | SERVER_EXPORT void JackSleep(long usec) 30 | { 31 | usleep(usec); 32 | } 33 | 34 | /* This should only be called ONCE per process. */ 35 | SERVER_EXPORT void InitTime() 36 | { 37 | mach_timebase_info_data_t info; 38 | mach_timebase_info(&info); 39 | __jack_time_ratio = ((double)info.numer / (double)info.denom) / 1000; 40 | } 41 | 42 | SERVER_EXPORT void EndTime() 43 | {} 44 | 45 | SERVER_EXPORT jack_time_t GetMicroSeconds(void) 46 | { 47 | return (jack_time_t) (mach_absolute_time() * __jack_time_ratio); 48 | } 49 | 50 | void SetClockSource(jack_timer_type_t source) 51 | {} 52 | 53 | const char* ClockSourceName(jack_timer_type_t source) 54 | { 55 | return ""; 56 | } 57 | -------------------------------------------------------------------------------- /macosx/JackMachUtils.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2021 Peter Bridgman 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackMachUtils__ 21 | #define __JackMachUtils__ 22 | 23 | #define jack_mach_error_uncurried(type_name, kern_return, message) \ 24 | jack_error(type_name "::%s: " message " - %i:%s", \ 25 | __FUNCTION__, \ 26 | kern_return, \ 27 | mach_error_string(kern_return)) 28 | 29 | #define jack_mach_bootstrap_err_uncurried(type_name, kern_return, message, service_name) \ 30 | jack_error(type_name "::%s: " message " [%s] - %i:%s", \ 31 | __FUNCTION__, \ 32 | service_name, \ 33 | kern_return, \ 34 | bootstrap_strerror(kern_return)) 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /macosx/coremidi/JackCoreMidiPhysicalInputPort.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackCoreMidiPhysicalInputPort__ 21 | #define __JackCoreMidiPhysicalInputPort__ 22 | 23 | #include "JackCoreMidiInputPort.h" 24 | 25 | namespace Jack { 26 | 27 | class JackCoreMidiPhysicalInputPort: public JackCoreMidiInputPort { 28 | 29 | public: 30 | 31 | JackCoreMidiPhysicalInputPort(const char *alias_name, 32 | const char *client_name, 33 | const char *driver_name, int index, 34 | MIDIClientRef client, 35 | MIDIPortRef internal_input, 36 | double time_ratio, size_t max_bytes=4096, 37 | size_t max_messages=1024); 38 | 39 | ~JackCoreMidiPhysicalInputPort(); 40 | 41 | }; 42 | 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /macosx/coremidi/JackCoreMidiPhysicalOutputPort.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackCoreMidiPhysicalOutputPort__ 21 | #define __JackCoreMidiPhysicalOutputPort__ 22 | 23 | #include "JackCoreMidiOutputPort.h" 24 | 25 | namespace Jack { 26 | 27 | class JackCoreMidiPhysicalOutputPort: public JackCoreMidiOutputPort { 28 | 29 | private: 30 | 31 | MIDIPortRef internal_output; 32 | 33 | protected: 34 | 35 | bool 36 | SendPacketList(MIDIPacketList *packet_list); 37 | 38 | public: 39 | 40 | JackCoreMidiPhysicalOutputPort(const char *alias_name, 41 | const char *client_name, 42 | const char *driver_name, int index, 43 | MIDIClientRef client, 44 | MIDIPortRef internal_output, 45 | double time_ratio, 46 | size_t max_bytes=4096, 47 | size_t max_messages=1024); 48 | 49 | ~JackCoreMidiPhysicalOutputPort(); 50 | 51 | }; 52 | 53 | } 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /macosx/coremidi/JackCoreMidiUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackCoreMidiUtil__ 21 | #define __JackCoreMidiUtil__ 22 | 23 | #include 24 | 25 | #include 26 | 27 | namespace Jack { 28 | 29 | std::string 30 | GetMacOSErrorString(OSStatus status); 31 | 32 | void 33 | WriteMacOSError(const char *jack_function, const char *mac_function, 34 | OSStatus status); 35 | 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /macosx/coremidi/JackCoreMidiUtil.mm: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include "JackError.h" 24 | #include "JackCoreMidiUtil.h" 25 | 26 | std::string 27 | Jack::GetMacOSErrorString(OSStatus status) 28 | { 29 | NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:status userInfo:nil]; 30 | NSString *errorString = [error localizedDescription]; 31 | std::string returnString; 32 | if (errorString){ 33 | returnString = std::string([errorString UTF8String]); 34 | } else { 35 | returnString = std::string("No error"); 36 | } 37 | return returnString; 38 | } 39 | 40 | void 41 | Jack::WriteMacOSError(const char *jack_function, const char *mac_function, 42 | OSStatus status) 43 | { 44 | jack_error("%s - %s: %s", jack_function, mac_function, 45 | GetMacOSErrorString(status).c_str()); 46 | } 47 | -------------------------------------------------------------------------------- /macosx/coremidi/JackCoreMidiVirtualInputPort.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackCoreMidiVirtualInputPort__ 21 | #define __JackCoreMidiVirtualInputPort__ 22 | 23 | #include "JackCoreMidiInputPort.h" 24 | 25 | namespace Jack { 26 | 27 | class JackCoreMidiVirtualInputPort: public JackCoreMidiInputPort { 28 | 29 | private: 30 | 31 | static void 32 | HandleInputEvent(const MIDIPacketList *packet_list, void *port, 33 | void *src_ref); 34 | 35 | public: 36 | 37 | JackCoreMidiVirtualInputPort(const char *alias_name, 38 | const char *client_name, 39 | const char *driver_name, int base_index, int index, 40 | MIDIClientRef client, double time_ratio, 41 | size_t max_bytes=4096, 42 | size_t max_messages=1024); 43 | 44 | ~JackCoreMidiVirtualInputPort(); 45 | 46 | }; 47 | 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /macosx/coremidi/JackCoreMidiVirtualOutputPort.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackCoreMidiVirtualOutputPort__ 21 | #define __JackCoreMidiVirtualOutputPort__ 22 | 23 | #include "JackCoreMidiOutputPort.h" 24 | 25 | namespace Jack { 26 | 27 | class JackCoreMidiVirtualOutputPort: public JackCoreMidiOutputPort { 28 | 29 | protected: 30 | 31 | bool 32 | SendPacketList(MIDIPacketList *packet_list); 33 | 34 | public: 35 | 36 | JackCoreMidiVirtualOutputPort(const char *alias_name, 37 | const char *client_name, 38 | const char *driver_name, int base_index, int index, 39 | MIDIClientRef client, double time_ratio, 40 | size_t max_bytes=4096, 41 | size_t max_messages=1024); 42 | 43 | ~JackCoreMidiVirtualOutputPort(); 44 | 45 | }; 46 | 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /macosx/package-welcome.txt.in: -------------------------------------------------------------------------------- 1 | JACK2 is a low-latency audio server for multi-processor machines. 2 | It provides a basic infrastructure for audio applications to communicate with each other and with audio hardware. 3 | Through JACK, users are enabled to build powerful systems for signal processing and music production. 4 | 5 | This package installs jackd and the command-line tools for JACK2. 6 | It also includes the necessary files for developers to build with JACK support. 7 | 8 | All files will be installed under /usr/local/. 9 | 10 | 11 | Please note that this package will not delete previously installed jackosx contents. 12 | If you used that before, please run its own uninstaller before installing this package! 13 | 14 | Also, the previously packaged JackRouter plugin is not available at this point. 15 | 16 | 17 | For advanced/curious users, here is the full file list that this package provides: 18 | 19 | -------------------------------------------------------------------------------- /macosx/package.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | JACK2 4 | 8 | 9 | jack2-osx-root.pkg 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /macosx/uptime.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | long uptime(void) 6 | { 7 | struct timeval boottime; 8 | size_t len = sizeof(boottime); 9 | int mib[2] = { CTL_KERN, KERN_BOOTTIME }; 10 | if (sysctl(mib, 2, &boottime, &len, NULL, 0) < 0) 11 | { 12 | return -1L; 13 | } 14 | time_t bsec = boottime.tv_sec, csec = time(NULL); 15 | 16 | return (long) difftime(csec, bsec); 17 | } 18 | -------------------------------------------------------------------------------- /macosx/uptime.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2005 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #ifndef __uptime_APPLE__ 21 | #define __uptime_APPLE__ 22 | 23 | #define UPTIME_FUNCTION_NAME "sysctl" 24 | 25 | long uptime(void); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /man/alsa_out.0: -------------------------------------------------------------------------------- 1 | .so man1/alsa_in.1 2 | -------------------------------------------------------------------------------- /man/fill_template: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | d="" 3 | [ -z "$SOURCE_DATE_EPOCH" ] || d=--date=@$SOURCE_DATE_EPOCH 4 | 5 | if [ -n "$2" ] && [ "$2" = "True" ]; then 6 | for i in *.0 ; do 7 | sed -e "s/!VERSION!/${1}/g" -e "s/!DATE!/`date $d '+%B %Y'`/g" < ${i} > ${i%%0}1 8 | done 9 | else 10 | sed -e "s/!VERSION!/${1}/g" -e "s/!DATE!/`date $d '+%B %Y'`/g" < jackd.0 > jackd.1 11 | fi 12 | -------------------------------------------------------------------------------- /man/jack_bufsize.0: -------------------------------------------------------------------------------- 1 | .TH JACK_BUFSIZE "1" "!DATE!" "!VERSION!" 2 | .SH NAME 3 | jack_bufsize \- JACK toolkit client to change the JACK buffer size 4 | .SH SYNOPSIS 5 | .B jack_bufsize bufsize 6 | .SH DESCRIPTION 7 | .B jack_bufsize 8 | jack_bufsize sets the size of the buffer (frames per period) used in JACK. 9 | This change happens on-line (the JACK server and its clients do not need to be 10 | restarted). 11 | .br 12 | When invoked without arguments, it prints the current bufsize, and exits. 13 | 14 | 15 | -------------------------------------------------------------------------------- /man/jack_connect.0: -------------------------------------------------------------------------------- 1 | .TH JACK_CONNECT "1" "!DATE!" "!VERSION!" 2 | .SH NAME 3 | \fBjack_connect\fR, \fBjack_disconnect\fR \- JACK toolkit clients for connecting & disconnecting ports 4 | .SH SYNOPSIS 5 | \fB jack_connect\fR [ \fI-s\fR | \fI--server servername\fR ] [\fI-h\fR | \fI--help\fR ] port1 port2 6 | \fB jack_disconnect\fR [ \fI-s\fR | \fI--server servername\fR ] [\fI-h\fR | \fI--help\fR ] port1 port2 7 | .SH DESCRIPTION 8 | \fBjack_connect\fR connects the two named ports. \fBjack_disconnect\fR disconnects the two named ports. 9 | .SH RETURNS 10 | The exit status is zero if successful, 1 otherwise 11 | 12 | -------------------------------------------------------------------------------- /man/jack_disconnect.0: -------------------------------------------------------------------------------- 1 | .so man1/jack_connect.1 2 | -------------------------------------------------------------------------------- /man/jack_freewheel.0: -------------------------------------------------------------------------------- 1 | .TH JACK_FREEWHEEL "1" "!DATE!" "!VERSION!" 2 | .SH NAME 3 | jack_freewheel \- JACK toolkit client to control freewheeling mode 4 | .SH SYNOPSIS 5 | .B jack_freewheel [y|n] 6 | .SH DESCRIPTION 7 | .B jack_freewheel 8 | Turns freewheeling mode on (y) or off (n). While in freewheeling mode, 9 | the JACK server does not wait in between process() calls, and does not 10 | read or write data from/to any audio interface. That results in the JACK graph 11 | processing data as fast as possible. Freewheeling makes fast exports to 12 | files possible. 13 | .PP 14 | There is no useful reason to use this tool other than testing. JACK 15 | clients that use freewheeling will turn it on and off themselves. 16 | 17 | -------------------------------------------------------------------------------- /man/jack_impulse_grabber.0: -------------------------------------------------------------------------------- 1 | .TH JACK_IMPULSE_GRABBER "1" "!DATE!" "!VERSION!" 2 | .SH NAME 3 | jack_impulse_grabber \- JACK toolkit client to grab an impulse (response) 4 | .SH SYNOPSIS 5 | \fBjack_impulse_grabber\fR \fB-d\fR \fIduration\fR [\fI-f\fR (C|gnuplot)] 6 | .SH DESCRIPTION 7 | \fBjack_impulse_grabber\fR is a JACK example client for collecting 8 | impulses recordings from JACK ports. 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /man/jack_load.0: -------------------------------------------------------------------------------- 1 | .TH JACK_LOAD "1" "!DATE!" "!VERSION!" 2 | .SH NAME 3 | jack_load \- JACK toolkit client for loading in-process clients 4 | .SH SYNOPSIS 5 | \fBjack_load\fR [ \fI-i\fR initstring ] [ \fI-s\fR servername ] [\fI-w\fR ] client-name so-name [ initstring ] 6 | .SH DESCRIPTION 7 | \fBjack_load\fR is a JACK toolkit client. It loads the specified plugin and creates an in-process client. 8 | .SH ARGUMENTS 9 | .PP 10 | The client-name must be a currently unused client name. 11 | .PP 12 | The so-name is the name of file that client code is stored in (typically, \fIclientname.so\fR) 13 | .SH OPTIONS 14 | .TP 15 | \fB-i\fR, \fB--init\fR init-string 16 | .br 17 | initialization string passed to the in-process client. Note that this can also be specified as the last argument on the command line. 18 | .TP 19 | \fB-s\fR, \fB--server\fR servername 20 | .br 21 | Name of JACK server to connect to 22 | .TP 23 | \fB-w\fR, \fB--wait\fR 24 | Wait for a signal (eg. from Ctrl-c) and then unload the client. 25 | .SH AUTHOR 26 | Jeremy Hall 27 | 28 | 29 | -------------------------------------------------------------------------------- /man/jack_lsp.0: -------------------------------------------------------------------------------- 1 | .TH JACK_LSP "1" "!DATE!" "!VERSION!" 2 | .SH NAME 3 | jack_lsp \- JACK toolkit client to list information on ports 4 | .SH SYNOPSIS 5 | \fBjack_lsp\fR [ \fI-s\fR | \fI--server\fR servername ] [ \fI-AclLptvh\fR ] 6 | .SH DESCRIPTION 7 | \fBjack_lsp\fR lists all known ports associated with a JACK 8 | server. It can also optionally list various kinds of information about each port. 9 | .SH OPTIONS 10 | .TP 11 | \fB-s\fR, \fB--server\fR \fIservername\fR 12 | .br 13 | Connect to the jack server named \fIservername\fR 14 | .TP 15 | \fB-A\fR, \fB--aliases\fR 16 | .br 17 | List aliases for each port 18 | .TP 19 | \fB-c\fR, \fB--connections\fR 20 | .br 21 | List connections to/from each port 22 | .TP 23 | \fB-l\fR, \fB--latency\fR 24 | .br 25 | Display per-port latency in frames at each port 26 | .TP 27 | \fB-L\fR, \fI--latency\fR 28 | .br 29 | Display total latency in frames at each port 30 | .TP 31 | \fB-p\fR, \fB--properties\fR 32 | .br 33 | Display port properties. Output may include input|output, can-monitor, physical, terminal 34 | .TP 35 | \fB-t\fR, \fB--type\fR 36 | .br 37 | Display port type 38 | .TP 39 | \fB-h\fR, \fB--help\fR 40 | .br 41 | Display help/usage message 42 | .TP 43 | \fB-v\fR, \fB--version\fR 44 | .br 45 | Output version information and exit 46 | 47 | 48 | -------------------------------------------------------------------------------- /man/jack_metro.0: -------------------------------------------------------------------------------- 1 | .TH JACK_METRO "1" "!DATE!" "!VERSION!" 2 | .SH NAME 3 | jack_metro \- JACK toolkit metronome 4 | .SH SYNOPSIS 5 | \fBjack_metro\fR [ \fI-n\fR name ] [ \fI-f\fR hz ] [ \fI-D\fR msecs ] [\fI-a\fR % ] [ \fI-d\fR % ] \fI-b\fR bpm 6 | .SH DESCRIPTION 7 | \fBjack_metro\fR is a simple metronome for JACK. It generates a 8 | synthetic "tick" sound for every beat. Note that is does \fBnot\fR 9 | connect its output port by default - to hear the sound it makes you must 10 | connect them using some other tool. 11 | .SH OPTIONS 12 | .TP 13 | \fB-n\fR, \fB--name\fR 14 | .br 15 | Specify a name for this instance of the metronome. 16 | .TP 17 | \fB-f\fR, \fB--frequency\fR Hz 18 | .br 19 | Define the frequency of the "tick" in Hz. 20 | .TP 21 | \fB-D\fR, \fB--duration\fR msecs 22 | .br 23 | Define the duration of the "tick" in milliseconds. 24 | .TP 25 | \fB-a\fR, \fB--attack\fR %-age 26 | .br 27 | Define the duration of the attack phase of the "tick" as a percentage 28 | of the duration. 29 | .TP 30 | \fB-d\fR, \fB--decay\fR %-age 31 | .br 32 | Define the duration of the decay phase of the "tick" as a percentage 33 | of the duration. 34 | .TP 35 | \fB--b\fR, \fB--bpm\fR bpm 36 | .br 37 | Define the number of beats per minute. 38 | .SH AUTHOR 39 | Anthony Van Groningen 40 | 41 | -------------------------------------------------------------------------------- /man/jack_monitor_client.0: -------------------------------------------------------------------------------- 1 | .TH JACK_CONNECT "1" "!DATE!" "!VERSION!" 2 | .SH NAME 3 | jack_monitor_client \- The JACK Audio Connection Kit example client 4 | .SH SYNOPSIS 5 | .B jack_monitor_client 6 | client-name 7 | .PP 8 | The client-name must be the name of a existing client that monitoring is 9 | to be enabled for. 10 | .SH DESCRIPTION 11 | .B jack_monitor_client 12 | is an example client for the JACK Audio Connection Kit. It enables 13 | monitoring for the specified client. 14 | .SH AUTHOR 15 | Jeremy Hall 16 | .PP 17 | This manpage was written by Robert Jordens for Debian. 18 | 19 | -------------------------------------------------------------------------------- /man/jack_samplerate.0: -------------------------------------------------------------------------------- 1 | .TH JACK_SAMPLERATE "1" "!DATE!" "!VERSION!" 2 | .SH NAME 3 | jack_samplerate \- JACK toolkit client to print current samplerate 4 | .SH SYNOPSIS 5 | .B jack_samplerate 6 | .SH DESCRIPTION 7 | .B jack_samplerate prints the current samplerate, and exits. 8 | 9 | 10 | -------------------------------------------------------------------------------- /man/jack_showtime.0: -------------------------------------------------------------------------------- 1 | .TH JACK_SHOWTIME "1" "!DATE!" "!VERSION!" 2 | .SH NAME 3 | jack_showtime \- The JACK Audio Connection Kit example client 4 | .SH SYNOPSIS 5 | .B jack_showtime 6 | .SH DESCRIPTION 7 | .B jack_showtime 8 | prints the current timebase information to stdout 9 | .SH AUTHOR 10 | Paul Davis 11 | .PP 12 | This manpage was written by Stefan Schwandter 13 | 14 | -------------------------------------------------------------------------------- /man/jack_simple_client.0: -------------------------------------------------------------------------------- 1 | .TH JACK_CONNECT "1" "!DATE!" "!VERSION!" 2 | .SH NAME 3 | jack_simple_client \- The JACK Audio Connection Kit example client 4 | .SH SYNOPSIS 5 | .B jack_simple_client 6 | client-name 7 | .PP 8 | The client-name must be a yet unused client name. 9 | .SH DESCRIPTION 10 | .B jack_simple_client 11 | is an example client for the JACK Audio Connection Kit. It creates two 12 | ports (client-name:input and client-name:output) that pass the data 13 | unmodified. 14 | .SH EXAMPLE 15 | jack_simple_client in_process_test 16 | .SH AUTHOR 17 | Jeremy Hall 18 | .PP 19 | This manpage was written by Robert Jordens for Debian. 20 | 21 | -------------------------------------------------------------------------------- /man/jack_transport.0: -------------------------------------------------------------------------------- 1 | .TH JACK_TRANSPORT "1" "!DATE!" "!VERSION!" 2 | .SH NAME 3 | jack_transport \- JACK toolkit client for transport control 4 | .SH SYNOPSIS 5 | .B jack_transport 6 | .SH DESCRIPTION 7 | .B jack_transport 8 | is a toolkit client for the JACK Audio Connection Kit. It provides command-line 9 | control over the JACK transport system. Type help at jack_transport's 10 | command prompt to see the available commands. 11 | .SH AUTHOR 12 | Jeremy Hall 13 | 14 | -------------------------------------------------------------------------------- /man/jack_unload.0: -------------------------------------------------------------------------------- 1 | .TH JACK_UNLOAD "1" "!DATE!" "!VERSION!" 2 | .SH NAME 3 | jack_unload \- The JACK Audio Connection Kit example client 4 | .SH SYNOPSIS 5 | .B jack_unload 6 | client-name 7 | .PP 8 | The client-name must be the name of a loaded client that can be unloaded. 9 | .SH DESCRIPTION 10 | .B jack_unload 11 | is the counterpart to 12 | .B jack_load 13 | and unloads the specified client. 14 | .SH EXAMPLE 15 | .B jack_unload in_process_test 16 | .SH AUTHOR 17 | Jeremy Hall 18 | .PP 19 | This manpage was written by Robert Jordens for Debian. 20 | -------------------------------------------------------------------------------- /man/jack_wait.0: -------------------------------------------------------------------------------- 1 | .TH JACK_WAIT "1" "!DATE!" "!VERSION!" 2 | .SH NAME 3 | jack_wait \- JACK toolkit client to check and wait for existence/exit of jackd. 4 | .SH SYNOPSIS 5 | \fBjack_wait\fR [ \fI-s\fR | \fI--server\fR servername ] [ \fI-t\fR | \fI--timeout\fR timeout_seconds [ \fI-cqwhv\fR ] 6 | .SH DESCRIPTION 7 | \fBjack_wait\fR When invoked with \fI-c\fR it only checks for the existence of a jack server. When invoked with \fI-w\fR the 8 | program will wait for a jackd to be available. 9 | The \fI-q\fR makes it wait for the jackd to exit. 10 | 11 | .SH OPTIONS 12 | .TP 13 | \fB-w\fR, \fB--wait\fR 14 | .br 15 | Wait for jackd to be available. 16 | .TP 17 | \fB-q\fR, \fB--quit\fR 18 | .br 19 | Wait for jackd quit. 20 | .TP 21 | \fB-c\fR, \fB--check\fR 22 | .br 23 | Only check for existence of jackd, and exit. 24 | .TP 25 | \fB-s\fR, \fB--server\fR \fIservername\fR 26 | .br 27 | Connect to the jack server named \fIservername\fR 28 | .TP 29 | \fB-t\fR, \fB--timeout\fR \fItimeout_seconds\fR 30 | .br 31 | Only wait \fItimeout_seconds\fR. 32 | .TP 33 | \fB-h\fR, \fB--help\fR 34 | .br 35 | Display help/usage message 36 | .TP 37 | \fB-v\fR, \fB--version\fR 38 | .br 39 | Output version information and exit 40 | 41 | 42 | -------------------------------------------------------------------------------- /man/jackrec.0: -------------------------------------------------------------------------------- 1 | .TH JACKREC "1" "!DATE!" "!VERSION!" 2 | .SH NAME 3 | jackrec \- JACK toolkit client for recording audio 4 | .SH SYNOPSIS 5 | .B jackrec 6 | \-f filename \-d seconds [ \-b bitdepth ] port1 [ port2 ... ] 7 | .SH DESCRIPTION 8 | .B jackrec is a basic, but useful, audio recorder that will record 9 | audio from 1 or more JACK ports to a file on disk. The file format is 10 | always RIFF/WAV, with samples stored as signed integers. The sample 11 | bit depth can be selected using the \fI-b\fR option. The file will 12 | have as many channels as there are ports specified on the command line 13 | - each channel will contain the data recorded from one port. The user 14 | should generally specify the duration (in seconds) using the \fI-d\fR 15 | option. If not specified, jackrec will record until terminated by a 16 | signal (eg. from Ctrl-c). 17 | .PP 18 | This application is not intended to be a heavy duty audio recorder, 19 | and originated as an example client to show how to handle threading 20 | and disk I/O in a JACK client. However, it is a useful, simple 21 | recorder and is included in the JACK toolkit as a result. 22 | 23 | 24 | -------------------------------------------------------------------------------- /man/wscript: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python3 2 | # encoding: utf-8 3 | 4 | 5 | def build(bld): 6 | bld.exec_command('cd man ; sh fill_template {} {}'.format( 7 | bld.env['JACK_VERSION'], 8 | bld.env['BUILD_JACK_EXAMPLE_TOOLS']) 9 | ) 10 | bld.install_files(bld.env['MANDIR'], bld.path.ant_glob('*.1')) 11 | -------------------------------------------------------------------------------- /posix/JackCompilerDeps_os.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2005 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackCompilerDeps_POSIX__ 21 | #define __JackCompilerDeps_POSIX__ 22 | 23 | #include "JackConstants.h" 24 | 25 | #if __GNUC__ 26 | 27 | #define MEM_ALIGN(x,y) x __attribute__((aligned(y))) 28 | #define LIB_EXPORT __attribute__((visibility("default"))) 29 | #ifdef SERVER_SIDE 30 | #if (__GNUC__< 4) 31 | #define SERVER_EXPORT 32 | #else 33 | #define SERVER_EXPORT __attribute__((visibility("default"))) 34 | #endif 35 | #else 36 | #define SERVER_EXPORT __attribute__((visibility("hidden"))) 37 | #endif 38 | 39 | #else 40 | #define MEM_ALIGN(x,y) x 41 | #define LIB_EXPORT 42 | #define SERVER_EXPORT 43 | 44 | /* Add other things here for non-gcc platforms */ 45 | #endif 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /posix/JackPosixMutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 Grame 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 | 18 | Grame Research Laboratory, 9 rue du Garet, 69001 Lyon - France 19 | grame@grame.fr 20 | */ 21 | 22 | #ifndef __JackPosixMutex__ 23 | #define __JackPosixMutex__ 24 | 25 | #include "JackException.h" 26 | #include "JackCompilerDeps.h" 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | namespace Jack 33 | { 34 | /*! 35 | \brief Mutex abstraction. 36 | */ 37 | 38 | class SERVER_EXPORT JackBasePosixMutex 39 | { 40 | 41 | protected: 42 | 43 | pthread_mutex_t fMutex; 44 | pthread_t fOwner; 45 | 46 | public: 47 | 48 | JackBasePosixMutex(const char* name = NULL); 49 | virtual ~JackBasePosixMutex(); 50 | 51 | bool Lock(); 52 | bool Trylock(); 53 | bool Unlock(); 54 | 55 | }; 56 | 57 | class SERVER_EXPORT JackPosixMutex 58 | { 59 | protected: 60 | 61 | pthread_mutex_t fMutex; 62 | 63 | public: 64 | 65 | JackPosixMutex(const char* name = NULL); 66 | virtual ~JackPosixMutex(); 67 | 68 | bool Lock(); 69 | bool Trylock(); 70 | bool Unlock(); 71 | }; 72 | 73 | } // namespace 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /posix/JackShmMem_os.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 Paul Davis 3 | Copyright (C) 2004-2008 Grame 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU Lesser General Public License as published by 7 | the Free Software Foundation; either version 2.1 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef __JackShmMem_POSIX__ 22 | #define __JackShmMem_POSIX__ 23 | 24 | #include 25 | #include 26 | 27 | #define CHECK_MLOCK(ptr, size) (mlock((ptr), (size)) == 0) 28 | #define CHECK_MUNLOCK(ptr, size) (munlock((ptr), (size)) == 0) 29 | #define CHECK_MLOCKALL() (mlockall(MCL_CURRENT | MCL_FUTURE) == 0) 30 | #define CHECK_MUNLOCKALL() (munlockall() == 0) 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /posix/JackSocketNotifyChannel.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2008 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackSocketNotifyChannel__ 21 | #define __JackSocketNotifyChannel__ 22 | 23 | #include "JackChannel.h" 24 | #include "JackSocket.h" 25 | 26 | namespace Jack 27 | { 28 | 29 | /*! 30 | \brief JackNotifyChannel using sockets. 31 | */ 32 | 33 | class JackSocketNotifyChannel 34 | { 35 | 36 | private: 37 | 38 | JackClientSocket fNotifySocket; // Socket to communicate with the server : from server to client 39 | 40 | public: 41 | 42 | JackSocketNotifyChannel() 43 | {} 44 | 45 | int Open(const char* name); // Open the Server/Client connection 46 | void Close(); // Close the Server/Client connection 47 | 48 | void ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2, int* result); 49 | }; 50 | 51 | } // end of namespace 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /posix/JackSocketServerNotifyChannel.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2008 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackSocketServerNotifyChannel__ 21 | #define __JackSocketServerNotifyChannel__ 22 | 23 | #include "JackSocket.h" 24 | 25 | namespace Jack 26 | { 27 | 28 | /*! 29 | \brief JackServerNotifyChannel using sockets. 30 | */ 31 | 32 | class JackSocketServerNotifyChannel 33 | { 34 | private: 35 | 36 | JackClientSocket fRequestSocket; 37 | 38 | public: 39 | 40 | JackSocketServerNotifyChannel() 41 | {} 42 | 43 | int Open(const char* server_name); 44 | void Close(); 45 | 46 | void Notify(int refnum, int notify, int value); 47 | void NotifyQuit(); 48 | }; 49 | 50 | } // end of namespace 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /posix/JackSystemDeps_os.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2006 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackSystemDeps_POSIX__ 21 | #define __JackSystemDeps_POSIX__ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #ifndef UINT32_MAX 29 | #define UINT32_MAX 4294967295U 30 | #endif 31 | 32 | #define DRIVER_HANDLE void* 33 | #define LoadDriverModule(name) dlopen((name), RTLD_NOW | RTLD_GLOBAL) 34 | #define UnloadDriverModule(handle) dlclose((handle)) 35 | #define GetDriverProc(handle, name) dlsym((handle), (name)) 36 | 37 | #define JACK_HANDLE void* 38 | #define LoadJackModule(name) dlopen((name), RTLD_NOW | RTLD_LOCAL); 39 | #define UnloadJackModule(handle) dlclose((handle)); 40 | #define GetJackProc(handle, name) dlsym((handle), (name)); 41 | 42 | #define JACK_DEBUG (getenv("JACK_CLIENT_DEBUG") && strcmp(getenv("JACK_CLIENT_DEBUG"), "on") == 0) 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /posix/JackTypes_os.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 Paul Davis 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackTypes_POSIX__ 21 | #define __JackTypes_POSIX__ 22 | 23 | #include 24 | #include 25 | 26 | typedef unsigned long long UInt64; 27 | typedef pthread_key_t jack_tls_key; 28 | 29 | typedef int (*jack_thread_creator_t)(pthread_t*, const pthread_attr_t*, void* (*function)(void*), void* arg); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /solaris/JackAtomic_os.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2008 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackAtomic_sun__ 21 | #define __JackAtomic_sun__ 22 | 23 | #include "JackTypes.h" 24 | #include 25 | 26 | static inline char CAS(volatile UInt32 value, UInt32 newvalue, volatile void* addr) 27 | { 28 | return (atomic_cas_32((uint32_t*)addr, value, newvalue) == value); 29 | } 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /solaris/JackSolarisTime.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001-2003 Paul Davis 3 | Copyright (C) 2004-2008 Grame 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU Lesser General Public License as published by 7 | the Free Software Foundation; either version 2.1 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include "JackTime.h" 22 | #include "JackTypes.h" 23 | #include 24 | #include 25 | 26 | SERVER_EXPORT void JackSleep(long usec) 27 | { 28 | usleep(usec); 29 | } 30 | 31 | SERVER_EXPORT void InitTime() 32 | {} 33 | 34 | SERVER_EXPORT void EndTime() 35 | {} 36 | 37 | SERVER_EXPORT jack_time_t GetMicroSeconds(void) 38 | { 39 | return (jack_time_t)(gethrtime() / 1000); 40 | } 41 | 42 | void SetClockSource(jack_timer_type_t source) 43 | {} 44 | 45 | const char* ClockSourceName(jack_timer_type_t source) 46 | { 47 | return ""; 48 | } 49 | -------------------------------------------------------------------------------- /systemd/example.conf: -------------------------------------------------------------------------------- 1 | # Configuration profile for the templated systemd user unit jack@.service 2 | # A (modified) copy of this configuration can be used to start jackd statically 3 | # for a user, which has the upside, that other systemd user units can depend on 4 | # it. 5 | # 6 | # The systemd user service expects the configuration profiles to be located 7 | # below /etc/jack or the user's $XDG_CONFIG_HOME and can then be started using 8 | # systemctl (i.e. `systemctl --user start jack@example`). 9 | # 10 | # Please note, that setups can be very diverse and therefore this approach 11 | # might or might not suit your requirements. However, it attempts to be as 12 | # versatile as possible. 13 | # 14 | # For further details regarding the various options and drivers used by JACK, 15 | # see `man 1 jackd` and for information on systemd's unit configuration see 16 | # `man 5 systemd.unit`, `man 5 systemd.service` and `man 5 systemd.exec`. 17 | # 18 | 19 | # The name of the JACK server 20 | JACK_DEFAULT_SERVER="default" 21 | # Options to JACK (e.g. -m, -n, -p, -r, -P, -t, -C, -u, -v) 22 | JACK_OPTIONS="" 23 | # Audio backend (e.g. alsa, dummy, firewire, netone, oss, portaudio) 24 | DRIVER="alsa" 25 | # Device name (used by the audio backend) 26 | DEVICE="hw:PCH,0" 27 | # Specific settings for the audio backend in use 28 | DRIVER_SETTINGS="" 29 | -------------------------------------------------------------------------------- /systemd/jack@.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=JACK server using %i.conf profile 3 | Documentation=man:jackd(1) 4 | After=sound.target local-fs.target 5 | 6 | [Service] 7 | Type=notify 8 | EnvironmentFile=-/etc/jack/%i.conf 9 | EnvironmentFile=-%h/.config/jack/%i.conf 10 | ExecStart=@PREFIX@/bin/jackd $JACK_OPTIONS -d $DRIVER -d $DEVICE $DRIVER_SETTINGS 11 | LimitRTPRIO=95 12 | LimitRTTIME=infinity 13 | LimitMEMLOCK=infinity 14 | # Caution: use on memory-limited devices only 15 | # OOMScoreAdjust=-1000 16 | 17 | [Install] 18 | WantedBy=default.target 19 | -------------------------------------------------------------------------------- /systemd/wscript: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python3 2 | # encoding: utf-8 3 | 4 | 5 | def set_systemd_user_unit_dir(conf): 6 | """ 7 | Adding systemd's user unit dir (by using pkg-config) to the configuration. 8 | """ 9 | systemd_user_unit_dir = conf.check_cfg( 10 | package='systemd', 11 | args='--variable=systemduserunitdir', 12 | okmsg='Successfully detected systemd user unit dir.', 13 | errormsg='Could not detect systemd user unit dir. Skipping...') 14 | if not systemd_user_unit_dir: 15 | conf.env['SYSTEMD_USER_UNIT_DIR'] = None 16 | else: 17 | conf.env['SYSTEMD_USER_UNIT_DIR'] = \ 18 | systemd_user_unit_dir.replace("\n", "") 19 | 20 | 21 | def configure(conf): 22 | set_systemd_user_unit_dir(conf) 23 | conf.env['JACK_USER_UNIT_CONFIG_DIR'] = '/etc/jack' 24 | 25 | 26 | def build(bld): 27 | if bld.env['SYSTEMD_USER_UNIT_DIR']: 28 | bld.install_files( 29 | bld.env['JACK_USER_UNIT_CONFIG_DIR'], 30 | bld.path.ant_glob('*.conf')) 31 | bld( 32 | features='subst', 33 | source='jack@.service.in', 34 | target='jack@.service', 35 | install_path=bld.env.SYSTEMD_USER_UNIT_DIR, 36 | PREFIX=bld.env.PREFIX) 37 | -------------------------------------------------------------------------------- /tests/wscript: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python3 2 | # encoding: utf-8 3 | 4 | test_programs = { 5 | # For testing purposes 6 | # 'synchroClient': ['testSynchroClient.cpp'], 7 | # 'synchroServer': ['testSynchroServer.cpp'], 8 | # 'synchroServerClient': ['testSynchroServerClient.cpp'], 9 | # 'testSem': ['testSem.cpp'], 10 | 'jack_test': ['test.cpp'], 11 | 'jack_cpu': ['cpu.c'], 12 | 'jack_iodelay': ['iodelay.cpp'], 13 | 'jack_multiple_metro': ['external_metro.cpp'], 14 | } 15 | 16 | 17 | def build(bld): 18 | for test_program, test_program_sources in list(test_programs.items()): 19 | prog = bld(features='cxx cxxprogram') 20 | if bld.env['IS_MACOSX']: 21 | prog.includes = ['..', '../macosx', '../posix', '../common/jack', '../common'] 22 | if bld.env['IS_LINUX']: 23 | prog.includes = ['..', '../linux', '../posix', '../common/jack', '../common'] 24 | if bld.env['IS_FREEBSD']: 25 | prog.includes = ['..', '../freebsd', '../posix', '../common/jack', '../common'] 26 | if bld.env['IS_SUN']: 27 | prog.includes = ['..', '../solaris', '../posix', '../common/jack', '../common'] 28 | prog.source = test_program_sources 29 | if bld.env['IS_LINUX']: 30 | prog.uselib = 'RT' 31 | prog.use = 'clientlib' 32 | prog.target = test_program 33 | -------------------------------------------------------------------------------- /waflib-macos-mods.patch: -------------------------------------------------------------------------------- 1 | diff --git a/waflib/Tools/ccroot.py b/waflib/Tools/ccroot.py 2 | index cfef8bf5..484846f5 100644 3 | --- a/waflib/Tools/ccroot.py 4 | +++ b/waflib/Tools/ccroot.py 5 | @@ -575,12 +575,10 @@ def apply_vnum(self): 6 | 7 | cnum = getattr(self, 'cnum', str(nums[0])) 8 | cnums = cnum.split('.') 9 | - if len(cnums)>len(nums) or nums[0:len(cnums)] != cnums: 10 | - raise Errors.WafError('invalid compatibility version %s' % cnum) 11 | 12 | libname = node.name 13 | if libname.endswith('.dylib'): 14 | - name3 = libname.replace('.dylib', '.%s.dylib' % self.vnum) 15 | + name3 = libname.replace('.dylib', '.%s.dylib' % cnums[0]) 16 | name2 = libname.replace('.dylib', '.%s.dylib' % cnum) 17 | else: 18 | name3 = libname + '.' + self.vnum 19 | -------------------------------------------------------------------------------- /waflib/Errors.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy, 2010-2018 (ita) 4 | 5 | """ 6 | Exceptions used in the Waf code 7 | """ 8 | 9 | import traceback, sys 10 | 11 | class WafError(Exception): 12 | """Base class for all Waf errors""" 13 | def __init__(self, msg='', ex=None): 14 | """ 15 | :param msg: error message 16 | :type msg: string 17 | :param ex: exception causing this error (optional) 18 | :type ex: exception 19 | """ 20 | Exception.__init__(self) 21 | self.msg = msg 22 | assert not isinstance(msg, Exception) 23 | 24 | self.stack = [] 25 | if ex: 26 | if not msg: 27 | self.msg = str(ex) 28 | if isinstance(ex, WafError): 29 | self.stack = ex.stack 30 | else: 31 | self.stack = traceback.extract_tb(sys.exc_info()[2]) 32 | self.stack += traceback.extract_stack()[:-1] 33 | self.verbose_msg = ''.join(traceback.format_list(self.stack)) 34 | 35 | def __str__(self): 36 | return str(self.msg) 37 | 38 | class BuildError(WafError): 39 | """Error raised during the build and install phases""" 40 | def __init__(self, error_tasks=[]): 41 | """ 42 | :param error_tasks: tasks that could not complete normally 43 | :type error_tasks: list of task objects 44 | """ 45 | self.tasks = error_tasks 46 | WafError.__init__(self, self.format_error()) 47 | 48 | def format_error(self): 49 | """Formats the error messages from the tasks that failed""" 50 | lst = ['Build failed'] 51 | for tsk in self.tasks: 52 | txt = tsk.format_error() 53 | if txt: 54 | lst.append(txt) 55 | return '\n'.join(lst) 56 | 57 | class ConfigurationError(WafError): 58 | """Configuration exception raised in particular by :py:meth:`waflib.Context.Context.fatal`""" 59 | pass 60 | 61 | class TaskRescan(WafError): 62 | """Task-specific exception type signalling required signature recalculations""" 63 | pass 64 | 65 | class TaskNotReady(WafError): 66 | """Task-specific exception type signalling that task signatures cannot be computed""" 67 | pass 68 | 69 | -------------------------------------------------------------------------------- /waflib/Tools/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy, 2005-2018 (ita) 4 | -------------------------------------------------------------------------------- /waflib/Tools/ar.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy, 2006-2018 (ita) 4 | # Ralf Habacker, 2006 (rh) 5 | 6 | """ 7 | The **ar** program creates static libraries. This tool is almost always loaded 8 | from others (C, C++, D, etc) for static library support. 9 | """ 10 | 11 | from waflib.Configure import conf 12 | 13 | @conf 14 | def find_ar(conf): 15 | """Configuration helper used by C/C++ tools to enable the support for static libraries""" 16 | conf.load('ar') 17 | 18 | def configure(conf): 19 | """Finds the ar program and sets the default flags in ``conf.env.ARFLAGS``""" 20 | conf.find_program('ar', var='AR') 21 | conf.add_os_flags('ARFLAGS') 22 | if not conf.env.ARFLAGS: 23 | conf.env.ARFLAGS = ['rcs'] 24 | 25 | -------------------------------------------------------------------------------- /waflib/Tools/c.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy, 2006-2018 (ita) 4 | 5 | "Base for c programs/libraries" 6 | 7 | from waflib import TaskGen, Task 8 | from waflib.Tools import c_preproc 9 | from waflib.Tools.ccroot import link_task, stlink_task 10 | 11 | @TaskGen.extension('.c') 12 | def c_hook(self, node): 13 | "Binds the c file extensions create :py:class:`waflib.Tools.c.c` instances" 14 | if not self.env.CC and self.env.CXX: 15 | return self.create_compiled_task('cxx', node) 16 | return self.create_compiled_task('c', node) 17 | 18 | class c(Task.Task): 19 | "Compiles C files into object files" 20 | run_str = '${CC} ${ARCH_ST:ARCH} ${CFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CC_SRC_F}${SRC} ${CC_TGT_F}${TGT[0].abspath()} ${CPPFLAGS}' 21 | vars = ['CCDEPS'] # unused variable to depend on, just in case 22 | ext_in = ['.h'] # set the build order easily by using ext_out=['.h'] 23 | scan = c_preproc.scan 24 | 25 | class cprogram(link_task): 26 | "Links object files into c programs" 27 | run_str = '${LINK_CC} ${LINKFLAGS} ${CCLNK_SRC_F}${SRC} ${CCLNK_TGT_F}${TGT[0].abspath()} ${RPATH_ST:RPATH} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${FRAMEWORK_ST:FRAMEWORK} ${ARCH_ST:ARCH} ${STLIB_MARKER} ${STLIBPATH_ST:STLIBPATH} ${STLIB_ST:STLIB} ${SHLIB_MARKER} ${LIBPATH_ST:LIBPATH} ${LIB_ST:LIB} ${LDFLAGS}' 28 | ext_out = ['.bin'] 29 | vars = ['LINKDEPS'] 30 | inst_to = '${BINDIR}' 31 | 32 | class cshlib(cprogram): 33 | "Links object files into c shared libraries" 34 | inst_to = '${LIBDIR}' 35 | 36 | class cstlib(stlink_task): 37 | "Links object files into a c static libraries" 38 | pass # do not remove 39 | 40 | -------------------------------------------------------------------------------- /waflib/Tools/clang.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Krzysztof Kosiński 2014 4 | 5 | """ 6 | Detect the Clang C compiler 7 | """ 8 | 9 | from waflib.Tools import ccroot, ar, gcc 10 | from waflib.Configure import conf 11 | 12 | @conf 13 | def find_clang(conf): 14 | """ 15 | Finds the program clang and executes it to ensure it really is clang 16 | """ 17 | cc = conf.find_program('clang', var='CC') 18 | conf.get_cc_version(cc, clang=True) 19 | conf.env.CC_NAME = 'clang' 20 | 21 | def configure(conf): 22 | conf.find_clang() 23 | conf.find_program(['llvm-ar', 'ar'], var='AR') 24 | conf.find_ar() 25 | conf.gcc_common_flags() 26 | conf.gcc_modifier_platform() 27 | conf.cc_load_tools() 28 | conf.cc_add_flags() 29 | conf.link_add_flags() 30 | -------------------------------------------------------------------------------- /waflib/Tools/clangxx.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy 2009-2018 (ita) 4 | 5 | """ 6 | Detect the Clang++ C++ compiler 7 | """ 8 | 9 | from waflib.Tools import ccroot, ar, gxx 10 | from waflib.Configure import conf 11 | 12 | @conf 13 | def find_clangxx(conf): 14 | """ 15 | Finds the program clang++, and executes it to ensure it really is clang++ 16 | """ 17 | cxx = conf.find_program('clang++', var='CXX') 18 | conf.get_cc_version(cxx, clang=True) 19 | conf.env.CXX_NAME = 'clang' 20 | 21 | def configure(conf): 22 | conf.find_clangxx() 23 | conf.find_program(['llvm-ar', 'ar'], var='AR') 24 | conf.find_ar() 25 | conf.gxx_common_flags() 26 | conf.gxx_modifier_platform() 27 | conf.cxx_load_tools() 28 | conf.cxx_add_flags() 29 | conf.link_add_flags() 30 | 31 | -------------------------------------------------------------------------------- /waflib/Tools/cxx.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy, 2005-2018 (ita) 4 | 5 | "Base for c++ programs and libraries" 6 | 7 | from waflib import TaskGen, Task 8 | from waflib.Tools import c_preproc 9 | from waflib.Tools.ccroot import link_task, stlink_task 10 | 11 | @TaskGen.extension('.cpp','.cc','.cxx','.C','.c++') 12 | def cxx_hook(self, node): 13 | "Binds c++ file extensions to create :py:class:`waflib.Tools.cxx.cxx` instances" 14 | return self.create_compiled_task('cxx', node) 15 | 16 | if not '.c' in TaskGen.task_gen.mappings: 17 | TaskGen.task_gen.mappings['.c'] = TaskGen.task_gen.mappings['.cpp'] 18 | 19 | class cxx(Task.Task): 20 | "Compiles C++ files into object files" 21 | run_str = '${CXX} ${ARCH_ST:ARCH} ${CXXFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CXX_SRC_F}${SRC} ${CXX_TGT_F}${TGT[0].abspath()} ${CPPFLAGS}' 22 | vars = ['CXXDEPS'] # unused variable to depend on, just in case 23 | ext_in = ['.h'] # set the build order easily by using ext_out=['.h'] 24 | scan = c_preproc.scan 25 | 26 | class cxxprogram(link_task): 27 | "Links object files into c++ programs" 28 | run_str = '${LINK_CXX} ${LINKFLAGS} ${CXXLNK_SRC_F}${SRC} ${CXXLNK_TGT_F}${TGT[0].abspath()} ${RPATH_ST:RPATH} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${FRAMEWORK_ST:FRAMEWORK} ${ARCH_ST:ARCH} ${STLIB_MARKER} ${STLIBPATH_ST:STLIBPATH} ${STLIB_ST:STLIB} ${SHLIB_MARKER} ${LIBPATH_ST:LIBPATH} ${LIB_ST:LIB} ${LDFLAGS}' 29 | vars = ['LINKDEPS'] 30 | ext_out = ['.bin'] 31 | inst_to = '${BINDIR}' 32 | 33 | class cxxshlib(cxxprogram): 34 | "Links object files into c++ shared libraries" 35 | inst_to = '${LIBDIR}' 36 | 37 | class cxxstlib(stlink_task): 38 | "Links object files into c++ static libraries" 39 | pass # do not remove 40 | 41 | -------------------------------------------------------------------------------- /waflib/Tools/icc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Stian Selnes 2008 4 | # Thomas Nagy 2009-2018 (ita) 5 | 6 | """ 7 | Detects the Intel C compiler 8 | """ 9 | 10 | import sys 11 | from waflib.Tools import ccroot, ar, gcc 12 | from waflib.Configure import conf 13 | 14 | @conf 15 | def find_icc(conf): 16 | """ 17 | Finds the program icc and execute it to ensure it really is icc 18 | """ 19 | cc = conf.find_program(['icc', 'ICL'], var='CC') 20 | conf.get_cc_version(cc, icc=True) 21 | conf.env.CC_NAME = 'icc' 22 | 23 | def configure(conf): 24 | conf.find_icc() 25 | conf.find_ar() 26 | conf.gcc_common_flags() 27 | conf.gcc_modifier_platform() 28 | conf.cc_load_tools() 29 | conf.cc_add_flags() 30 | conf.link_add_flags() 31 | -------------------------------------------------------------------------------- /waflib/Tools/icpc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy 2009-2018 (ita) 4 | 5 | """ 6 | Detects the Intel C++ compiler 7 | """ 8 | 9 | import sys 10 | from waflib.Tools import ccroot, ar, gxx 11 | from waflib.Configure import conf 12 | 13 | @conf 14 | def find_icpc(conf): 15 | """ 16 | Finds the program icpc, and execute it to ensure it really is icpc 17 | """ 18 | cxx = conf.find_program('icpc', var='CXX') 19 | conf.get_cc_version(cxx, icc=True) 20 | conf.env.CXX_NAME = 'icc' 21 | 22 | def configure(conf): 23 | conf.find_icpc() 24 | conf.find_ar() 25 | conf.gxx_common_flags() 26 | conf.gxx_modifier_platform() 27 | conf.cxx_load_tools() 28 | conf.cxx_add_flags() 29 | conf.link_add_flags() 30 | 31 | -------------------------------------------------------------------------------- /waflib/Tools/irixcc.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # encoding: utf-8 3 | # imported from samba 4 | 5 | """ 6 | Compiler definition for irix/MIPSpro cc compiler 7 | """ 8 | 9 | from waflib import Errors 10 | from waflib.Tools import ccroot, ar 11 | from waflib.Configure import conf 12 | 13 | @conf 14 | def find_irixcc(conf): 15 | v = conf.env 16 | cc = conf.find_program('cc', var='CC') 17 | try: 18 | conf.cmd_and_log(cc + ['-version']) 19 | except Errors.WafError: 20 | conf.fatal('%r -version could not be executed' % cc) 21 | v.CC_NAME = 'irix' 22 | 23 | @conf 24 | def irixcc_common_flags(conf): 25 | v = conf.env 26 | 27 | v.CC_SRC_F = '' 28 | v.CC_TGT_F = ['-c', '-o'] 29 | v.CPPPATH_ST = '-I%s' 30 | v.DEFINES_ST = '-D%s' 31 | 32 | if not v.LINK_CC: 33 | v.LINK_CC = v.CC 34 | 35 | v.CCLNK_SRC_F = '' 36 | v.CCLNK_TGT_F = ['-o'] 37 | 38 | v.LIB_ST = '-l%s' # template for adding libs 39 | v.LIBPATH_ST = '-L%s' # template for adding libpaths 40 | v.STLIB_ST = '-l%s' 41 | v.STLIBPATH_ST = '-L%s' 42 | 43 | v.cprogram_PATTERN = '%s' 44 | v.cshlib_PATTERN = 'lib%s.so' 45 | v.cstlib_PATTERN = 'lib%s.a' 46 | 47 | def configure(conf): 48 | conf.find_irixcc() 49 | conf.find_ar() 50 | conf.irixcc_common_flags() 51 | conf.cc_load_tools() 52 | conf.cc_add_flags() 53 | conf.link_add_flags() 54 | 55 | -------------------------------------------------------------------------------- /waflib/Tools/suncc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy, 2006-2018 (ita) 4 | # Ralf Habacker, 2006 (rh) 5 | 6 | from waflib import Errors 7 | from waflib.Tools import ccroot, ar 8 | from waflib.Configure import conf 9 | 10 | @conf 11 | def find_scc(conf): 12 | """ 13 | Detects the Sun C compiler 14 | """ 15 | v = conf.env 16 | cc = conf.find_program('cc', var='CC') 17 | try: 18 | conf.cmd_and_log(cc + ['-flags']) 19 | except Errors.WafError: 20 | conf.fatal('%r is not a Sun compiler' % cc) 21 | v.CC_NAME = 'sun' 22 | conf.get_suncc_version(cc) 23 | 24 | @conf 25 | def scc_common_flags(conf): 26 | """ 27 | Flags required for executing the sun C compiler 28 | """ 29 | v = conf.env 30 | 31 | v.CC_SRC_F = [] 32 | v.CC_TGT_F = ['-c', '-o', ''] 33 | 34 | if not v.LINK_CC: 35 | v.LINK_CC = v.CC 36 | 37 | v.CCLNK_SRC_F = '' 38 | v.CCLNK_TGT_F = ['-o', ''] 39 | v.CPPPATH_ST = '-I%s' 40 | v.DEFINES_ST = '-D%s' 41 | 42 | v.LIB_ST = '-l%s' # template for adding libs 43 | v.LIBPATH_ST = '-L%s' # template for adding libpaths 44 | v.STLIB_ST = '-l%s' 45 | v.STLIBPATH_ST = '-L%s' 46 | 47 | v.SONAME_ST = '-Wl,-h,%s' 48 | v.SHLIB_MARKER = '-Bdynamic' 49 | v.STLIB_MARKER = '-Bstatic' 50 | 51 | v.cprogram_PATTERN = '%s' 52 | 53 | v.CFLAGS_cshlib = ['-xcode=pic32', '-DPIC'] 54 | v.LINKFLAGS_cshlib = ['-G'] 55 | v.cshlib_PATTERN = 'lib%s.so' 56 | 57 | v.LINKFLAGS_cstlib = ['-Bstatic'] 58 | v.cstlib_PATTERN = 'lib%s.a' 59 | 60 | def configure(conf): 61 | conf.find_scc() 62 | conf.find_ar() 63 | conf.scc_common_flags() 64 | conf.cc_load_tools() 65 | conf.cc_add_flags() 66 | conf.link_add_flags() 67 | 68 | -------------------------------------------------------------------------------- /waflib/Tools/suncxx.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy, 2006-2018 (ita) 4 | # Ralf Habacker, 2006 (rh) 5 | 6 | from waflib import Errors 7 | from waflib.Tools import ccroot, ar 8 | from waflib.Configure import conf 9 | 10 | @conf 11 | def find_sxx(conf): 12 | """ 13 | Detects the sun C++ compiler 14 | """ 15 | v = conf.env 16 | cc = conf.find_program(['CC', 'c++'], var='CXX') 17 | try: 18 | conf.cmd_and_log(cc + ['-flags']) 19 | except Errors.WafError: 20 | conf.fatal('%r is not a Sun compiler' % cc) 21 | v.CXX_NAME = 'sun' 22 | conf.get_suncc_version(cc) 23 | 24 | @conf 25 | def sxx_common_flags(conf): 26 | """ 27 | Flags required for executing the sun C++ compiler 28 | """ 29 | v = conf.env 30 | 31 | v.CXX_SRC_F = [] 32 | v.CXX_TGT_F = ['-c', '-o', ''] 33 | 34 | if not v.LINK_CXX: 35 | v.LINK_CXX = v.CXX 36 | 37 | v.CXXLNK_SRC_F = [] 38 | v.CXXLNK_TGT_F = ['-o', ''] 39 | v.CPPPATH_ST = '-I%s' 40 | v.DEFINES_ST = '-D%s' 41 | 42 | v.LIB_ST = '-l%s' # template for adding libs 43 | v.LIBPATH_ST = '-L%s' # template for adding libpaths 44 | v.STLIB_ST = '-l%s' 45 | v.STLIBPATH_ST = '-L%s' 46 | 47 | v.SONAME_ST = '-Wl,-h,%s' 48 | v.SHLIB_MARKER = '-Bdynamic' 49 | v.STLIB_MARKER = '-Bstatic' 50 | 51 | v.cxxprogram_PATTERN = '%s' 52 | 53 | v.CXXFLAGS_cxxshlib = ['-xcode=pic32', '-DPIC'] 54 | v.LINKFLAGS_cxxshlib = ['-G'] 55 | v.cxxshlib_PATTERN = 'lib%s.so' 56 | 57 | v.LINKFLAGS_cxxstlib = ['-Bstatic'] 58 | v.cxxstlib_PATTERN = 'lib%s.a' 59 | 60 | def configure(conf): 61 | conf.find_sxx() 62 | conf.find_ar() 63 | conf.sxx_common_flags() 64 | conf.cxx_load_tools() 65 | conf.cxx_add_flags() 66 | conf.link_add_flags() 67 | 68 | -------------------------------------------------------------------------------- /waflib/Tools/xlc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy, 2006-2018 (ita) 4 | # Ralf Habacker, 2006 (rh) 5 | # Yinon Ehrlich, 2009 6 | # Michael Kuhn, 2009 7 | 8 | from waflib.Tools import ccroot, ar 9 | from waflib.Configure import conf 10 | 11 | @conf 12 | def find_xlc(conf): 13 | """ 14 | Detects the Aix C compiler 15 | """ 16 | cc = conf.find_program(['xlc_r', 'xlc'], var='CC') 17 | conf.get_xlc_version(cc) 18 | conf.env.CC_NAME = 'xlc' 19 | 20 | @conf 21 | def xlc_common_flags(conf): 22 | """ 23 | Flags required for executing the Aix C compiler 24 | """ 25 | v = conf.env 26 | 27 | v.CC_SRC_F = [] 28 | v.CC_TGT_F = ['-c', '-o'] 29 | 30 | if not v.LINK_CC: 31 | v.LINK_CC = v.CC 32 | 33 | v.CCLNK_SRC_F = [] 34 | v.CCLNK_TGT_F = ['-o'] 35 | v.CPPPATH_ST = '-I%s' 36 | v.DEFINES_ST = '-D%s' 37 | 38 | v.LIB_ST = '-l%s' # template for adding libs 39 | v.LIBPATH_ST = '-L%s' # template for adding libpaths 40 | v.STLIB_ST = '-l%s' 41 | v.STLIBPATH_ST = '-L%s' 42 | v.RPATH_ST = '-Wl,-rpath,%s' 43 | 44 | v.SONAME_ST = [] 45 | v.SHLIB_MARKER = [] 46 | v.STLIB_MARKER = [] 47 | 48 | v.LINKFLAGS_cprogram = ['-Wl,-brtl'] 49 | v.cprogram_PATTERN = '%s' 50 | 51 | v.CFLAGS_cshlib = ['-fPIC'] 52 | v.LINKFLAGS_cshlib = ['-G', '-Wl,-brtl,-bexpfull'] 53 | v.cshlib_PATTERN = 'lib%s.so' 54 | 55 | v.LINKFLAGS_cstlib = [] 56 | v.cstlib_PATTERN = 'lib%s.a' 57 | 58 | def configure(conf): 59 | conf.find_xlc() 60 | conf.find_ar() 61 | conf.xlc_common_flags() 62 | conf.cc_load_tools() 63 | conf.cc_add_flags() 64 | conf.link_add_flags() 65 | 66 | -------------------------------------------------------------------------------- /waflib/Tools/xlcxx.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy, 2006-2018 (ita) 4 | # Ralf Habacker, 2006 (rh) 5 | # Yinon Ehrlich, 2009 6 | # Michael Kuhn, 2009 7 | 8 | from waflib.Tools import ccroot, ar 9 | from waflib.Configure import conf 10 | 11 | @conf 12 | def find_xlcxx(conf): 13 | """ 14 | Detects the Aix C++ compiler 15 | """ 16 | cxx = conf.find_program(['xlc++_r', 'xlc++'], var='CXX') 17 | conf.get_xlc_version(cxx) 18 | conf.env.CXX_NAME = 'xlc++' 19 | 20 | @conf 21 | def xlcxx_common_flags(conf): 22 | """ 23 | Flags required for executing the Aix C++ compiler 24 | """ 25 | v = conf.env 26 | 27 | v.CXX_SRC_F = [] 28 | v.CXX_TGT_F = ['-c', '-o'] 29 | 30 | if not v.LINK_CXX: 31 | v.LINK_CXX = v.CXX 32 | 33 | v.CXXLNK_SRC_F = [] 34 | v.CXXLNK_TGT_F = ['-o'] 35 | v.CPPPATH_ST = '-I%s' 36 | v.DEFINES_ST = '-D%s' 37 | 38 | v.LIB_ST = '-l%s' # template for adding libs 39 | v.LIBPATH_ST = '-L%s' # template for adding libpaths 40 | v.STLIB_ST = '-l%s' 41 | v.STLIBPATH_ST = '-L%s' 42 | v.RPATH_ST = '-Wl,-rpath,%s' 43 | 44 | v.SONAME_ST = [] 45 | v.SHLIB_MARKER = [] 46 | v.STLIB_MARKER = [] 47 | 48 | v.LINKFLAGS_cxxprogram= ['-Wl,-brtl'] 49 | v.cxxprogram_PATTERN = '%s' 50 | 51 | v.CXXFLAGS_cxxshlib = ['-fPIC'] 52 | v.LINKFLAGS_cxxshlib = ['-G', '-Wl,-brtl,-bexpfull'] 53 | v.cxxshlib_PATTERN = 'lib%s.so' 54 | 55 | v.LINKFLAGS_cxxstlib = [] 56 | v.cxxstlib_PATTERN = 'lib%s.a' 57 | 58 | def configure(conf): 59 | conf.find_xlcxx() 60 | conf.find_ar() 61 | conf.xlcxx_common_flags() 62 | conf.cxx_load_tools() 63 | conf.cxx_add_flags() 64 | conf.link_add_flags() 65 | 66 | -------------------------------------------------------------------------------- /waflib/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy, 2005-2018 (ita) 4 | -------------------------------------------------------------------------------- /waflib/extras/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy, 2005-2010 (ita) 4 | -------------------------------------------------------------------------------- /waflib/extras/build_file_tracker.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy, 2015 4 | 5 | """ 6 | Force files to depend on the timestamps of those located in the build directory. You may 7 | want to use this to force partial rebuilds, see playground/track_output_files/ for a working example. 8 | 9 | Note that there is a variety of ways to implement this, one may want use timestamps on source files too for example, 10 | or one may want to hash the files in the source directory only under certain conditions (md5_tstamp tool) 11 | or to hash the file in the build directory with its timestamp 12 | """ 13 | 14 | import os 15 | from waflib import Node, Utils 16 | 17 | def get_bld_sig(self): 18 | if not self.is_bld() or self.ctx.bldnode is self.ctx.srcnode: 19 | return Utils.h_file(self.abspath()) 20 | 21 | try: 22 | # add the creation time to the signature 23 | return self.sig + str(os.stat(self.abspath()).st_mtime) 24 | except AttributeError: 25 | return None 26 | 27 | Node.Node.get_bld_sig = get_bld_sig 28 | 29 | -------------------------------------------------------------------------------- /waflib/extras/c_bgxlc.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # encoding: utf-8 3 | # harald at klimachs.de 4 | 5 | """ 6 | IBM XL Compiler for Blue Gene 7 | """ 8 | 9 | from waflib.Tools import ccroot,ar 10 | from waflib.Configure import conf 11 | 12 | from waflib.Tools import xlc # method xlc_common_flags 13 | from waflib.Tools.compiler_c import c_compiler 14 | c_compiler['linux'].append('c_bgxlc') 15 | 16 | @conf 17 | def find_bgxlc(conf): 18 | cc = conf.find_program(['bgxlc_r','bgxlc'], var='CC') 19 | conf.get_xlc_version(cc) 20 | conf.env.CC = cc 21 | conf.env.CC_NAME = 'bgxlc' 22 | 23 | def configure(conf): 24 | conf.find_bgxlc() 25 | conf.find_ar() 26 | conf.xlc_common_flags() 27 | conf.env.LINKFLAGS_cshlib = ['-G','-Wl,-bexpfull'] 28 | conf.env.LINKFLAGS_cprogram = [] 29 | conf.cc_load_tools() 30 | conf.cc_add_flags() 31 | conf.link_add_flags() 32 | 33 | -------------------------------------------------------------------------------- /waflib/extras/classic_runner.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy, 2021 (ita) 4 | 5 | from waflib import Utils, Runner 6 | 7 | """ 8 | Re-enable the classic threading system from waf 1.x 9 | 10 | def configure(conf): 11 | conf.load('classic_runner') 12 | """ 13 | 14 | class TaskConsumer(Utils.threading.Thread): 15 | """ 16 | Task consumers belong to a pool of workers 17 | 18 | They wait for tasks in the queue and then use ``task.process(...)`` 19 | """ 20 | def __init__(self, spawner): 21 | Utils.threading.Thread.__init__(self) 22 | """ 23 | Obtain :py:class:`waflib.Task.TaskBase` instances from this queue. 24 | """ 25 | self.spawner = spawner 26 | self.daemon = True 27 | self.start() 28 | 29 | def run(self): 30 | """ 31 | Loop over the tasks to execute 32 | """ 33 | try: 34 | self.loop() 35 | except Exception: 36 | pass 37 | 38 | def loop(self): 39 | """ 40 | Obtain tasks from :py:attr:`waflib.Runner.TaskConsumer.ready` and call 41 | :py:meth:`waflib.Task.TaskBase.process`. If the object is a function, execute it. 42 | """ 43 | master = self.spawner.master 44 | while 1: 45 | if not master.stop: 46 | try: 47 | tsk = master.ready.get() 48 | if tsk: 49 | tsk.log_display(tsk.generator.bld) 50 | master.process_task(tsk) 51 | else: 52 | break 53 | finally: 54 | master.out.put(tsk) 55 | 56 | class Spawner(object): 57 | """ 58 | Daemon thread that consumes tasks from :py:class:`waflib.Runner.Parallel` producer and 59 | spawns a consuming thread :py:class:`waflib.Runner.Consumer` for each 60 | :py:class:`waflib.Task.Task` instance. 61 | """ 62 | def __init__(self, master): 63 | self.master = master 64 | """:py:class:`waflib.Runner.Parallel` producer instance""" 65 | 66 | self.pool = [TaskConsumer(self) for i in range(master.numjobs)] 67 | 68 | Runner.Spawner = Spawner 69 | -------------------------------------------------------------------------------- /waflib/extras/fc_fujitsu.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # encoding: utf-8 3 | # Detection of the Fujitsu Fortran compiler for ARM64FX 4 | 5 | import re 6 | from waflib.Tools import fc,fc_config,fc_scan 7 | from waflib.Configure import conf 8 | from waflib.Tools.compiler_fc import fc_compiler 9 | fc_compiler['linux'].append('fc_fujitsu') 10 | 11 | @conf 12 | def find_fujitsu(conf): 13 | fc=conf.find_program(['frtpx'],var='FC') 14 | conf.get_fujitsu_version(fc) 15 | conf.env.FC_NAME='FUJITSU' 16 | conf.env.FC_MOD_CAPITALIZATION='lower' 17 | 18 | @conf 19 | def fujitsu_flags(conf): 20 | v=conf.env 21 | v['_FCMODOUTFLAGS']=[] 22 | v['FCFLAGS_DEBUG']=[] 23 | v['FCFLAGS_fcshlib']=[] 24 | v['LINKFLAGS_fcshlib']=[] 25 | v['FCSTLIB_MARKER']='' 26 | v['FCSHLIB_MARKER']='' 27 | 28 | @conf 29 | def get_fujitsu_version(conf,fc): 30 | version_re=re.compile(r"frtpx\s*\(FRT\)\s*(?P\d+)\.(?P\d+)\.",re.I).search 31 | cmd=fc+['--version'] 32 | out,err=fc_config.getoutput(conf,cmd,stdin=False) 33 | if out: 34 | match=version_re(out) 35 | else: 36 | match=version_re(err) 37 | if not match: 38 | return(False) 39 | conf.fatal('Could not determine the Fujitsu FRT Fortran compiler version.') 40 | else: 41 | k=match.groupdict() 42 | conf.env['FC_VERSION']=(k['major'],k['minor']) 43 | 44 | def configure(conf): 45 | conf.find_fujitsu() 46 | conf.find_program('ar',var='AR') 47 | conf.add_os_flags('ARFLAGS') 48 | if not conf.env.ARFLAGS: 49 | conf.env.ARFLAGS=['rcs'] 50 | conf.fc_flags() 51 | conf.fc_add_flags() 52 | conf.fujitsu_flags() 53 | -------------------------------------------------------------------------------- /waflib/extras/fc_nfort.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # encoding: utf-8 3 | # Detection of the NEC Fortran compiler for Aurora Tsubasa 4 | 5 | import re 6 | from waflib.Tools import fc,fc_config,fc_scan 7 | from waflib.Configure import conf 8 | from waflib.Tools.compiler_fc import fc_compiler 9 | fc_compiler['linux'].append('fc_nfort') 10 | 11 | @conf 12 | def find_nfort(conf): 13 | fc=conf.find_program(['nfort'],var='FC') 14 | conf.get_nfort_version(fc) 15 | conf.env.FC_NAME='NFORT' 16 | conf.env.FC_MOD_CAPITALIZATION='lower' 17 | 18 | @conf 19 | def nfort_flags(conf): 20 | v=conf.env 21 | v['_FCMODOUTFLAGS']=[] 22 | v['FCFLAGS_DEBUG']=[] 23 | v['FCFLAGS_fcshlib']=[] 24 | v['LINKFLAGS_fcshlib']=[] 25 | v['FCSTLIB_MARKER']='' 26 | v['FCSHLIB_MARKER']='' 27 | 28 | @conf 29 | def get_nfort_version(conf,fc): 30 | version_re=re.compile(r"nfort\s*\(NFORT\)\s*(?P\d+)\.(?P\d+)\.",re.I).search 31 | cmd=fc+['--version'] 32 | out,err=fc_config.getoutput(conf,cmd,stdin=False) 33 | if out: 34 | match=version_re(out) 35 | else: 36 | match=version_re(err) 37 | if not match: 38 | return(False) 39 | conf.fatal('Could not determine the NEC NFORT Fortran compiler version.') 40 | else: 41 | k=match.groupdict() 42 | conf.env['FC_VERSION']=(k['major'],k['minor']) 43 | 44 | def configure(conf): 45 | conf.find_nfort() 46 | conf.find_program('nar',var='AR') 47 | conf.add_os_flags('ARFLAGS') 48 | if not conf.env.ARFLAGS: 49 | conf.env.ARFLAGS=['rcs'] 50 | conf.fc_flags() 51 | conf.fc_add_flags() 52 | conf.nfort_flags() 53 | -------------------------------------------------------------------------------- /waflib/extras/msvc_pdb.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Rafaël Kooi 2019 4 | 5 | from waflib import TaskGen 6 | 7 | @TaskGen.feature('c', 'cxx', 'fc') 8 | @TaskGen.after_method('propagate_uselib_vars') 9 | def add_pdb_per_object(self): 10 | """For msvc/fortran, specify a unique compile pdb per object, to work 11 | around LNK4099. Flags are updated with a unique /Fd flag based on the 12 | task output name. This is separate from the link pdb. 13 | """ 14 | if not hasattr(self, 'compiled_tasks'): 15 | return 16 | 17 | link_task = getattr(self, 'link_task', None) 18 | 19 | for task in self.compiled_tasks: 20 | if task.inputs and task.inputs[0].name.lower().endswith('.rc'): 21 | continue 22 | 23 | add_pdb = False 24 | for flagname in ('CFLAGS', 'CXXFLAGS', 'FCFLAGS'): 25 | # several languages may be used at once 26 | for flag in task.env[flagname]: 27 | if flag[1:].lower() == 'zi': 28 | add_pdb = True 29 | break 30 | 31 | if add_pdb: 32 | node = task.outputs[0].change_ext('.pdb') 33 | pdb_flag = '/Fd:' + node.abspath() 34 | 35 | for flagname in ('CFLAGS', 'CXXFLAGS', 'FCFLAGS'): 36 | buf = [pdb_flag] 37 | for flag in task.env[flagname]: 38 | if flag[1:3] == 'Fd' or flag[1:].lower() == 'fs' or flag[1:].lower() == 'mp': 39 | continue 40 | buf.append(flag) 41 | task.env[flagname] = buf 42 | 43 | if link_task and not node in link_task.dep_nodes: 44 | link_task.dep_nodes.append(node) 45 | if not node in task.outputs: 46 | task.outputs.append(node) 47 | -------------------------------------------------------------------------------- /waflib/fixpy2.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy, 2010-2018 (ita) 4 | 5 | from __future__ import with_statement 6 | 7 | import os 8 | 9 | all_modifs = {} 10 | 11 | def fixdir(dir): 12 | """Call all substitution functions on Waf folders""" 13 | for k in all_modifs: 14 | for v in all_modifs[k]: 15 | modif(os.path.join(dir, 'waflib'), k, v) 16 | 17 | def modif(dir, name, fun): 18 | """Call a substitution function""" 19 | if name == '*': 20 | lst = [] 21 | for y in '. Tools extras'.split(): 22 | for x in os.listdir(os.path.join(dir, y)): 23 | if x.endswith('.py'): 24 | lst.append(y + os.sep + x) 25 | for x in lst: 26 | modif(dir, x, fun) 27 | return 28 | 29 | filename = os.path.join(dir, name) 30 | with open(filename, 'r') as f: 31 | txt = f.read() 32 | 33 | txt = fun(txt) 34 | 35 | with open(filename, 'w') as f: 36 | f.write(txt) 37 | 38 | def subst(*k): 39 | """register a substitution function""" 40 | def do_subst(fun): 41 | for x in k: 42 | try: 43 | all_modifs[x].append(fun) 44 | except KeyError: 45 | all_modifs[x] = [fun] 46 | return fun 47 | return do_subst 48 | 49 | @subst('*') 50 | def r1(code): 51 | "utf-8 fixes for python < 2.6" 52 | code = code.replace('as e:', ',e:') 53 | code = code.replace(".decode(sys.stdout.encoding or'latin-1',errors='replace')", '') 54 | return code.replace('.encode()', '') 55 | 56 | @subst('Runner.py') 57 | def r4(code): 58 | "generator syntax" 59 | return code.replace('next(self.biter)', 'self.biter.next()').replace('self.daemon = True', 'self.setDaemon(1)') 60 | 61 | @subst('Context.py') 62 | def r5(code): 63 | return code.replace("('Execution failure: %s'%str(e),ex=e)", "('Execution failure: %s'%str(e),ex=e),None,sys.exc_info()[2]") 64 | 65 | -------------------------------------------------------------------------------- /waflib/processor.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # encoding: utf-8 3 | # Thomas Nagy, 2016-2018 (ita) 4 | 5 | import os, sys, traceback, base64, signal 6 | try: 7 | import cPickle 8 | except ImportError: 9 | import pickle as cPickle 10 | 11 | try: 12 | import subprocess32 as subprocess 13 | except ImportError: 14 | import subprocess 15 | 16 | try: 17 | TimeoutExpired = subprocess.TimeoutExpired 18 | except AttributeError: 19 | class TimeoutExpired(Exception): 20 | pass 21 | 22 | def run(): 23 | txt = sys.stdin.readline().strip() 24 | if not txt: 25 | # parent process probably ended 26 | sys.exit(1) 27 | [cmd, kwargs, cargs] = cPickle.loads(base64.b64decode(txt)) 28 | cargs = cargs or {} 29 | 30 | if not 'close_fds' in kwargs: 31 | # workers have no fds 32 | kwargs['close_fds'] = False 33 | 34 | ret = 1 35 | out, err, ex, trace = (None, None, None, None) 36 | try: 37 | proc = subprocess.Popen(cmd, **kwargs) 38 | try: 39 | out, err = proc.communicate(**cargs) 40 | except TimeoutExpired: 41 | if kwargs.get('start_new_session') and hasattr(os, 'killpg'): 42 | os.killpg(proc.pid, signal.SIGKILL) 43 | else: 44 | proc.kill() 45 | out, err = proc.communicate() 46 | exc = TimeoutExpired(proc.args, timeout=cargs['timeout'], output=out) 47 | exc.stderr = err 48 | raise exc 49 | ret = proc.returncode 50 | except Exception as e: 51 | exc_type, exc_value, tb = sys.exc_info() 52 | exc_lines = traceback.format_exception(exc_type, exc_value, tb) 53 | trace = str(cmd) + '\n' + ''.join(exc_lines) 54 | ex = e.__class__.__name__ 55 | 56 | # it is just text so maybe we do not need to pickle() 57 | tmp = [ret, out, err, ex, trace] 58 | obj = base64.b64encode(cPickle.dumps(tmp)) 59 | sys.stdout.write(obj.decode()) 60 | sys.stdout.write('\n') 61 | sys.stdout.flush() 62 | 63 | while 1: 64 | try: 65 | run() 66 | except KeyboardInterrupt: 67 | break 68 | 69 | -------------------------------------------------------------------------------- /windows/JackTypes_os.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2008 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef __JackTypes_WIN32__ 22 | #define __JackTypes_WIN32__ 23 | 24 | #ifdef __MINGW32__ 25 | #include 26 | #endif 27 | #include 28 | 29 | typedef ULONGLONG UInt64; 30 | typedef UInt64 uint64_t; 31 | typedef unsigned short uint16_t; 32 | typedef DWORD jack_tls_key; 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /windows/JackWinNamedPipeNotifyChannel.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2008 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef __JackWinNamedPipeNotifyChannel__ 22 | #define __JackWinNamedPipeNotifyChannel__ 23 | 24 | #include "JackWinNamedPipe.h" 25 | 26 | namespace Jack 27 | { 28 | 29 | /*! 30 | \brief JackNotifyChannel using named pipe. 31 | */ 32 | 33 | class JackWinNamedPipeNotifyChannel 34 | { 35 | 36 | private: 37 | 38 | JackWinNamedPipeClient fNotifyPipe; // Pipe to communicate with the server : from server to client 39 | 40 | public: 41 | 42 | JackWinNamedPipeNotifyChannel() 43 | {} 44 | 45 | int Open(const char* name); // Open the Server/Client connection 46 | void Close(); // Close the Server/Client connection 47 | 48 | void ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2, int* result); 49 | }; 50 | 51 | } // end of namespace 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /windows/JackWinNamedPipeServerNotifyChannel.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2004-2008 Grame 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU Lesser General Public License as published by 6 | the Free Software Foundation; either version 2.1 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef __JackWinNamedPipeServerNotifyChannel__ 22 | #define __JackWinNamedPipeServerNotifyChannel__ 23 | 24 | #include "JackChannel.h" 25 | #include "JackWinNamedPipe.h" 26 | 27 | namespace Jack 28 | { 29 | 30 | /*! 31 | \brief JackServerNotifyChannel using pipes. 32 | */ 33 | 34 | class JackWinNamedPipeServerNotifyChannel 35 | { 36 | private: 37 | 38 | JackWinNamedPipeClient fRequestPipe; 39 | 40 | public: 41 | 42 | JackWinNamedPipeServerNotifyChannel() 43 | {} 44 | 45 | int Open(const char* server_name); 46 | void Close(); 47 | 48 | void Notify(int refnum, int notify, int value); 49 | void NotifyQuit(); 50 | }; 51 | 52 | } // end of namespace 53 | 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /windows/Psapi.Lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/windows/Psapi.Lib -------------------------------------------------------------------------------- /windows/inno/jack.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/windows/inno/jack.ico -------------------------------------------------------------------------------- /windows/jackaudioadapter.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/windows/jackaudioadapter.rc -------------------------------------------------------------------------------- /windows/jackd.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/windows/jackd.rc -------------------------------------------------------------------------------- /windows/jackdummydriver.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/windows/jackdummydriver.rc -------------------------------------------------------------------------------- /windows/jackloopbackdriver.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/windows/jackloopbackdriver.rc -------------------------------------------------------------------------------- /windows/jacknetadapter.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/windows/jacknetadapter.rc -------------------------------------------------------------------------------- /windows/jacknetdriver.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/windows/jacknetdriver.rc -------------------------------------------------------------------------------- /windows/jacknetmanager.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/windows/jacknetmanager.rc -------------------------------------------------------------------------------- /windows/jacknetonedriver.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/windows/jacknetonedriver.rc -------------------------------------------------------------------------------- /windows/jackportaudio.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/windows/jackportaudio.rc -------------------------------------------------------------------------------- /windows/jackwinmme.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/windows/jackwinmme.rc -------------------------------------------------------------------------------- /windows/libjack.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/windows/libjack.rc -------------------------------------------------------------------------------- /windows/libjacknet.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackaudio/jack2/43e1173e3060b2ebc9b6c54058464d5145afbf6e/windows/libjacknet.rc -------------------------------------------------------------------------------- /windows/libjackserver.rc: -------------------------------------------------------------------------------- 1 | // Generated by ResEdit 1.4.3 2 | // Copyright (C) 2006-2008 3 | // http://www.resedit.net 4 | 5 | #include "resource.h" 6 | #include "afxres.h" 7 | 8 | 9 | // 10 | // Version Information resources 11 | // 12 | LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT 13 | 1 VERSIONINFO 14 | FILEVERSION 1,9,11,0 15 | PRODUCTVERSION 1,9,11,0 16 | FILEOS VOS_UNKNOWN 17 | FILETYPE VFT_DLL 18 | BEGIN 19 | BLOCK "StringFileInfo" 20 | BEGIN 21 | BLOCK "040c04b0" 22 | BEGIN 23 | VALUE "Comments", "\0" 24 | VALUE "CompanyName", "Grame\0" 25 | VALUE "FileDescription", "Jack server library for Windows\0" 26 | VALUE "FileVersion", "1, 9, 11\0" 27 | VALUE "InternalName", "libjackserver\0" 28 | VALUE "LegalCopyright", "Copyright Grame © 2006-2014\0" 29 | VALUE "LegalTrademarks", "\0" 30 | VALUE "OriginalFilename", "libjackserver.dll\0" 31 | VALUE "PrivateBuild", "\0" 32 | VALUE "ProductName", "libjackserver\0" 33 | VALUE "ProductVersion", "1, 9, 11\0" 34 | VALUE "SpecialBuild", "\0" 35 | END 36 | END 37 | BLOCK "VarFileInfo" 38 | BEGIN 39 | VALUE "Translation", 1036, 1200 40 | END 41 | END 42 | -------------------------------------------------------------------------------- /windows/resource.h: -------------------------------------------------------------------------------- 1 | #ifndef IDC_STATIC 2 | #define IDC_STATIC (-1) 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /windows/resource_vc.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by resource.rc 4 | // 5 | 6 | // Next default values for new objects 7 | // 8 | #ifdef APSTUDIO_INVOKED 9 | #ifndef APSTUDIO_READONLY_SYMBOLS 10 | #define _APS_NEXT_RESOURCE_VALUE 102 11 | #define _APS_NEXT_COMMAND_VALUE 40001 12 | #define _APS_NEXT_CONTROL_VALUE 1000 13 | #define _APS_NEXT_SYMED_VALUE 101 14 | #endif 15 | #endif 16 | -------------------------------------------------------------------------------- /windows/winmme/JackWinMMEPort.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Devin Anderson 3 | 4 | This program is free software; you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation; either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | 18 | */ 19 | 20 | #ifndef __JackWinMMEPort__ 21 | #define __JackWinMMEPort__ 22 | 23 | #ifdef __MINGW32__ 24 | #include 25 | #endif 26 | #include 27 | #include 28 | 29 | #include "JackConstants.h" 30 | 31 | namespace Jack { 32 | 33 | class JackWinMMEPort { 34 | 35 | protected: 36 | 37 | char alias[REAL_JACK_PORT_NAME_SIZE+1]; 38 | char name[REAL_JACK_PORT_NAME_SIZE+1]; 39 | char device_name[REAL_JACK_PORT_NAME_SIZE+1]; 40 | 41 | public: 42 | 43 | JackWinMMEPort(); 44 | 45 | ~JackWinMMEPort(); 46 | 47 | const char * 48 | GetAlias(); 49 | 50 | const char * 51 | GetName(); 52 | 53 | const char * 54 | GetDeviceName(); 55 | 56 | void 57 | GetOSErrorString(LPTSTR text); 58 | 59 | void 60 | WriteOSError(const char *jack_func, const char *os_func); 61 | 62 | }; 63 | 64 | } 65 | 66 | #endif 67 | --------------------------------------------------------------------------------