├── .gitignore
├── Builds
├── LinuxMakefile
│ └── Makefile
├── MacOSX
│ ├── ConsoleApp.entitlements
│ ├── RecentFilesMenuTemplate.nib
│ └── sendmidi.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcshareddata
│ │ └── xcschemes
│ │ └── sendmidi - ConsoleApp.xcscheme
└── VisualStudio2017
│ ├── resources.rc
│ ├── sendmidi.sln
│ ├── sendmidi_ConsoleApp.vcxproj
│ └── sendmidi_ConsoleApp.vcxproj.filters
├── COPYING.md
├── JuceLibraryCode
├── AppConfig.h
├── JuceHeader.h
├── ReadMe.txt
├── include_juce_audio_basics.cpp
├── include_juce_audio_basics.mm
├── include_juce_audio_devices.cpp
├── include_juce_audio_devices.mm
├── include_juce_core.cpp
├── include_juce_core.mm
├── include_juce_data_structures.cpp
├── include_juce_data_structures.mm
├── include_juce_events.cpp
├── include_juce_events.mm
├── include_juce_midi_ci.cpp
└── modules
│ ├── juce_audio_basics
│ ├── audio_play_head
│ │ ├── juce_AudioPlayHead.cpp
│ │ └── juce_AudioPlayHead.h
│ ├── buffers
│ │ ├── juce_AudioChannelSet.cpp
│ │ ├── juce_AudioChannelSet.h
│ │ ├── juce_AudioDataConverters.cpp
│ │ ├── juce_AudioDataConverters.h
│ │ ├── juce_AudioProcessLoadMeasurer.cpp
│ │ ├── juce_AudioProcessLoadMeasurer.h
│ │ ├── juce_AudioSampleBuffer.h
│ │ ├── juce_FloatVectorOperations.cpp
│ │ └── juce_FloatVectorOperations.h
│ ├── juce_audio_basics.cpp
│ ├── juce_audio_basics.h
│ ├── juce_audio_basics.mm
│ ├── midi
│ │ ├── juce_MidiBuffer.cpp
│ │ ├── juce_MidiBuffer.h
│ │ ├── juce_MidiDataConcatenator.h
│ │ ├── juce_MidiFile.cpp
│ │ ├── juce_MidiFile.h
│ │ ├── juce_MidiKeyboardState.cpp
│ │ ├── juce_MidiKeyboardState.h
│ │ ├── juce_MidiMessage.cpp
│ │ ├── juce_MidiMessage.h
│ │ ├── juce_MidiMessageSequence.cpp
│ │ ├── juce_MidiMessageSequence.h
│ │ ├── juce_MidiRPN.cpp
│ │ ├── juce_MidiRPN.h
│ │ └── ump
│ │ │ ├── juce_UMP.h
│ │ │ ├── juce_UMPBytesOnGroup.h
│ │ │ ├── juce_UMPConversion.h
│ │ │ ├── juce_UMPConverters.h
│ │ │ ├── juce_UMPDeviceInfo.h
│ │ │ ├── juce_UMPDispatcher.h
│ │ │ ├── juce_UMPFactory.h
│ │ │ ├── juce_UMPIterator.cpp
│ │ │ ├── juce_UMPIterator.h
│ │ │ ├── juce_UMPMidi1ToBytestreamTranslator.h
│ │ │ ├── juce_UMPMidi1ToMidi2DefaultTranslator.cpp
│ │ │ ├── juce_UMPMidi1ToMidi2DefaultTranslator.h
│ │ │ ├── juce_UMPProtocols.h
│ │ │ ├── juce_UMPReceiver.h
│ │ │ ├── juce_UMPSysEx7.cpp
│ │ │ ├── juce_UMPSysEx7.h
│ │ │ ├── juce_UMPUtils.cpp
│ │ │ ├── juce_UMPUtils.h
│ │ │ ├── juce_UMPView.cpp
│ │ │ ├── juce_UMPView.h
│ │ │ ├── juce_UMP_test.cpp
│ │ │ ├── juce_UMPacket.h
│ │ │ └── juce_UMPackets.h
│ ├── mpe
│ │ ├── juce_MPEInstrument.cpp
│ │ ├── juce_MPEInstrument.h
│ │ ├── juce_MPEMessages.cpp
│ │ ├── juce_MPEMessages.h
│ │ ├── juce_MPENote.cpp
│ │ ├── juce_MPENote.h
│ │ ├── juce_MPESynthesiser.cpp
│ │ ├── juce_MPESynthesiser.h
│ │ ├── juce_MPESynthesiserBase.cpp
│ │ ├── juce_MPESynthesiserBase.h
│ │ ├── juce_MPESynthesiserVoice.cpp
│ │ ├── juce_MPESynthesiserVoice.h
│ │ ├── juce_MPEUtils.cpp
│ │ ├── juce_MPEUtils.h
│ │ ├── juce_MPEValue.cpp
│ │ ├── juce_MPEValue.h
│ │ ├── juce_MPEZoneLayout.cpp
│ │ └── juce_MPEZoneLayout.h
│ ├── native
│ │ ├── juce_AudioWorkgroup_mac.h
│ │ ├── juce_CoreAudioLayouts_mac.h
│ │ └── juce_CoreAudioTimeConversions_mac.h
│ ├── sources
│ │ ├── juce_AudioSource.h
│ │ ├── juce_BufferingAudioSource.cpp
│ │ ├── juce_BufferingAudioSource.h
│ │ ├── juce_ChannelRemappingAudioSource.cpp
│ │ ├── juce_ChannelRemappingAudioSource.h
│ │ ├── juce_IIRFilterAudioSource.cpp
│ │ ├── juce_IIRFilterAudioSource.h
│ │ ├── juce_MemoryAudioSource.cpp
│ │ ├── juce_MemoryAudioSource.h
│ │ ├── juce_MixerAudioSource.cpp
│ │ ├── juce_MixerAudioSource.h
│ │ ├── juce_PositionableAudioSource.cpp
│ │ ├── juce_PositionableAudioSource.h
│ │ ├── juce_ResamplingAudioSource.cpp
│ │ ├── juce_ResamplingAudioSource.h
│ │ ├── juce_ReverbAudioSource.cpp
│ │ ├── juce_ReverbAudioSource.h
│ │ ├── juce_ToneGeneratorAudioSource.cpp
│ │ └── juce_ToneGeneratorAudioSource.h
│ ├── synthesisers
│ │ ├── juce_Synthesiser.cpp
│ │ └── juce_Synthesiser.h
│ └── utilities
│ │ ├── juce_ADSR.h
│ │ ├── juce_ADSR_test.cpp
│ │ ├── juce_AudioWorkgroup.cpp
│ │ ├── juce_AudioWorkgroup.h
│ │ ├── juce_Decibels.h
│ │ ├── juce_GenericInterpolator.h
│ │ ├── juce_IIRFilter.cpp
│ │ ├── juce_IIRFilter.h
│ │ ├── juce_Interpolators.cpp
│ │ ├── juce_Interpolators.h
│ │ ├── juce_LagrangeInterpolator.cpp
│ │ ├── juce_Reverb.h
│ │ ├── juce_SmoothedValue.cpp
│ │ ├── juce_SmoothedValue.h
│ │ └── juce_WindowedSincInterpolator.cpp
│ ├── juce_audio_devices
│ ├── audio_io
│ │ ├── juce_AudioDeviceManager.cpp
│ │ ├── juce_AudioDeviceManager.h
│ │ ├── juce_AudioIODevice.cpp
│ │ ├── juce_AudioIODevice.h
│ │ ├── juce_AudioIODeviceType.cpp
│ │ ├── juce_AudioIODeviceType.h
│ │ ├── juce_SampleRateHelpers.cpp
│ │ └── juce_SystemAudioVolume.h
│ ├── juce_audio_devices.cpp
│ ├── juce_audio_devices.h
│ ├── juce_audio_devices.mm
│ ├── midi_io
│ │ ├── juce_MidiDevices.cpp
│ │ ├── juce_MidiDevices.h
│ │ ├── juce_MidiMessageCollector.cpp
│ │ ├── juce_MidiMessageCollector.h
│ │ └── ump
│ │ │ ├── juce_UMPBytestreamInputHandler.h
│ │ │ └── juce_UMPU32InputHandler.h
│ ├── native
│ │ ├── java
│ │ │ └── app
│ │ │ │ └── com
│ │ │ │ └── rmsl
│ │ │ │ └── juce
│ │ │ │ └── JuceMidiSupport.java
│ │ ├── juce_ALSA_linux.cpp
│ │ ├── juce_ASIO_windows.cpp
│ │ ├── juce_Audio_android.cpp
│ │ ├── juce_Audio_ios.cpp
│ │ ├── juce_Audio_ios.h
│ │ ├── juce_Bela_linux.cpp
│ │ ├── juce_CoreAudio_mac.cpp
│ │ ├── juce_CoreMidi_mac.mm
│ │ ├── juce_DirectSound_windows.cpp
│ │ ├── juce_HighPerformanceAudioHelpers_android.h
│ │ ├── juce_JackAudio_linux.cpp
│ │ ├── juce_Midi_android.cpp
│ │ ├── juce_Midi_linux.cpp
│ │ ├── juce_Midi_windows.cpp
│ │ ├── juce_Oboe_android.cpp
│ │ ├── juce_OpenSL_android.cpp
│ │ ├── juce_WASAPI_windows.cpp
│ │ └── oboe
│ │ │ ├── .clang-tidy
│ │ │ ├── CMakeLists.txt
│ │ │ ├── LICENSE
│ │ │ ├── include
│ │ │ └── oboe
│ │ │ │ ├── AudioStream.h
│ │ │ │ ├── AudioStreamBase.h
│ │ │ │ ├── AudioStreamBuilder.h
│ │ │ │ ├── AudioStreamCallback.h
│ │ │ │ ├── Definitions.h
│ │ │ │ ├── FifoBuffer.h
│ │ │ │ ├── FifoControllerBase.h
│ │ │ │ ├── FullDuplexStream.h
│ │ │ │ ├── LatencyTuner.h
│ │ │ │ ├── Oboe.h
│ │ │ │ ├── OboeExtensions.h
│ │ │ │ ├── ResultWithValue.h
│ │ │ │ ├── StabilizedCallback.h
│ │ │ │ ├── Utilities.h
│ │ │ │ └── Version.h
│ │ │ ├── readme.md
│ │ │ └── src
│ │ │ ├── aaudio
│ │ │ ├── AAudioExtensions.h
│ │ │ ├── AAudioLoader.cpp
│ │ │ ├── AAudioLoader.h
│ │ │ ├── AudioStreamAAudio.cpp
│ │ │ └── AudioStreamAAudio.h
│ │ │ ├── common
│ │ │ ├── AdpfWrapper.cpp
│ │ │ ├── AdpfWrapper.h
│ │ │ ├── AudioClock.h
│ │ │ ├── AudioSourceCaller.cpp
│ │ │ ├── AudioSourceCaller.h
│ │ │ ├── AudioStream.cpp
│ │ │ ├── AudioStreamBuilder.cpp
│ │ │ ├── DataConversionFlowGraph.cpp
│ │ │ ├── DataConversionFlowGraph.h
│ │ │ ├── FilterAudioStream.cpp
│ │ │ ├── FilterAudioStream.h
│ │ │ ├── FixedBlockAdapter.cpp
│ │ │ ├── FixedBlockAdapter.h
│ │ │ ├── FixedBlockReader.cpp
│ │ │ ├── FixedBlockReader.h
│ │ │ ├── FixedBlockWriter.cpp
│ │ │ ├── FixedBlockWriter.h
│ │ │ ├── LatencyTuner.cpp
│ │ │ ├── MonotonicCounter.h
│ │ │ ├── OboeDebug.h
│ │ │ ├── OboeExtensions.cpp
│ │ │ ├── QuirksManager.cpp
│ │ │ ├── QuirksManager.h
│ │ │ ├── README.md
│ │ │ ├── SourceFloatCaller.cpp
│ │ │ ├── SourceFloatCaller.h
│ │ │ ├── SourceI16Caller.cpp
│ │ │ ├── SourceI16Caller.h
│ │ │ ├── SourceI24Caller.cpp
│ │ │ ├── SourceI24Caller.h
│ │ │ ├── SourceI32Caller.cpp
│ │ │ ├── SourceI32Caller.h
│ │ │ ├── StabilizedCallback.cpp
│ │ │ ├── Trace.cpp
│ │ │ ├── Trace.h
│ │ │ ├── Utilities.cpp
│ │ │ └── Version.cpp
│ │ │ ├── fifo
│ │ │ ├── FifoBuffer.cpp
│ │ │ ├── FifoController.cpp
│ │ │ ├── FifoController.h
│ │ │ ├── FifoControllerBase.cpp
│ │ │ ├── FifoControllerIndirect.cpp
│ │ │ └── FifoControllerIndirect.h
│ │ │ ├── flowgraph
│ │ │ ├── ChannelCountConverter.cpp
│ │ │ ├── ChannelCountConverter.h
│ │ │ ├── ClipToRange.cpp
│ │ │ ├── ClipToRange.h
│ │ │ ├── FlowGraphNode.cpp
│ │ │ ├── FlowGraphNode.h
│ │ │ ├── FlowgraphUtilities.h
│ │ │ ├── Limiter.cpp
│ │ │ ├── Limiter.h
│ │ │ ├── ManyToMultiConverter.cpp
│ │ │ ├── ManyToMultiConverter.h
│ │ │ ├── MonoBlend.cpp
│ │ │ ├── MonoBlend.h
│ │ │ ├── MonoToMultiConverter.cpp
│ │ │ ├── MonoToMultiConverter.h
│ │ │ ├── MultiToManyConverter.cpp
│ │ │ ├── MultiToManyConverter.h
│ │ │ ├── MultiToMonoConverter.cpp
│ │ │ ├── MultiToMonoConverter.h
│ │ │ ├── RampLinear.cpp
│ │ │ ├── RampLinear.h
│ │ │ ├── SampleRateConverter.cpp
│ │ │ ├── SampleRateConverter.h
│ │ │ ├── SinkFloat.cpp
│ │ │ ├── SinkFloat.h
│ │ │ ├── SinkI16.cpp
│ │ │ ├── SinkI16.h
│ │ │ ├── SinkI24.cpp
│ │ │ ├── SinkI24.h
│ │ │ ├── SinkI32.cpp
│ │ │ ├── SinkI32.h
│ │ │ ├── SourceFloat.cpp
│ │ │ ├── SourceFloat.h
│ │ │ ├── SourceI16.cpp
│ │ │ ├── SourceI16.h
│ │ │ ├── SourceI24.cpp
│ │ │ ├── SourceI24.h
│ │ │ ├── SourceI32.cpp
│ │ │ ├── SourceI32.h
│ │ │ └── resampler
│ │ │ │ ├── HyperbolicCosineWindow.h
│ │ │ │ ├── IntegerRatio.cpp
│ │ │ │ ├── IntegerRatio.h
│ │ │ │ ├── KaiserWindow.h
│ │ │ │ ├── LinearResampler.cpp
│ │ │ │ ├── LinearResampler.h
│ │ │ │ ├── MultiChannelResampler.cpp
│ │ │ │ ├── MultiChannelResampler.h
│ │ │ │ ├── PolyphaseResampler.cpp
│ │ │ │ ├── PolyphaseResampler.h
│ │ │ │ ├── PolyphaseResamplerMono.cpp
│ │ │ │ ├── PolyphaseResamplerMono.h
│ │ │ │ ├── PolyphaseResamplerStereo.cpp
│ │ │ │ ├── PolyphaseResamplerStereo.h
│ │ │ │ ├── README.md
│ │ │ │ ├── ResamplerDefinitions.h
│ │ │ │ ├── SincResampler.cpp
│ │ │ │ ├── SincResampler.h
│ │ │ │ ├── SincResamplerStereo.cpp
│ │ │ │ └── SincResamplerStereo.h
│ │ │ └── opensles
│ │ │ ├── AudioInputStreamOpenSLES.cpp
│ │ │ ├── AudioInputStreamOpenSLES.h
│ │ │ ├── AudioOutputStreamOpenSLES.cpp
│ │ │ ├── AudioOutputStreamOpenSLES.h
│ │ │ ├── AudioStreamBuffered.cpp
│ │ │ ├── AudioStreamBuffered.h
│ │ │ ├── AudioStreamOpenSLES.cpp
│ │ │ ├── AudioStreamOpenSLES.h
│ │ │ ├── EngineOpenSLES.cpp
│ │ │ ├── EngineOpenSLES.h
│ │ │ ├── OpenSLESUtilities.cpp
│ │ │ ├── OpenSLESUtilities.h
│ │ │ ├── OutputMixerOpenSLES.cpp
│ │ │ └── OutputMixerOpenSLES.h
│ └── sources
│ │ ├── juce_AudioSourcePlayer.cpp
│ │ ├── juce_AudioSourcePlayer.h
│ │ ├── juce_AudioTransportSource.cpp
│ │ └── juce_AudioTransportSource.h
│ ├── juce_core
│ ├── containers
│ │ ├── juce_AbstractFifo.cpp
│ │ ├── juce_AbstractFifo.h
│ │ ├── juce_Array.h
│ │ ├── juce_ArrayAllocationBase.h
│ │ ├── juce_ArrayBase.cpp
│ │ ├── juce_ArrayBase.h
│ │ ├── juce_DynamicObject.cpp
│ │ ├── juce_DynamicObject.h
│ │ ├── juce_ElementComparator.h
│ │ ├── juce_Enumerate.h
│ │ ├── juce_Enumerate_test.cpp
│ │ ├── juce_FixedSizeFunction.h
│ │ ├── juce_FixedSizeFunction_test.cpp
│ │ ├── juce_HashMap.h
│ │ ├── juce_HashMap_test.cpp
│ │ ├── juce_LinkedListPointer.h
│ │ ├── juce_ListenerList.cpp
│ │ ├── juce_ListenerList.h
│ │ ├── juce_NamedValueSet.cpp
│ │ ├── juce_NamedValueSet.h
│ │ ├── juce_Optional.h
│ │ ├── juce_Optional_test.cpp
│ │ ├── juce_OwnedArray.cpp
│ │ ├── juce_OwnedArray.h
│ │ ├── juce_PropertySet.cpp
│ │ ├── juce_PropertySet.h
│ │ ├── juce_ReferenceCountedArray.cpp
│ │ ├── juce_ReferenceCountedArray.h
│ │ ├── juce_ScopedValueSetter.h
│ │ ├── juce_SingleThreadedAbstractFifo.h
│ │ ├── juce_SortedSet.h
│ │ ├── juce_Span.h
│ │ ├── juce_SparseSet.cpp
│ │ ├── juce_SparseSet.h
│ │ ├── juce_Variant.cpp
│ │ └── juce_Variant.h
│ ├── detail
│ │ └── juce_CallbackListenerList.h
│ ├── files
│ │ ├── juce_AndroidDocument.h
│ │ ├── juce_DirectoryIterator.cpp
│ │ ├── juce_DirectoryIterator.h
│ │ ├── juce_File.cpp
│ │ ├── juce_File.h
│ │ ├── juce_FileFilter.cpp
│ │ ├── juce_FileFilter.h
│ │ ├── juce_FileInputStream.cpp
│ │ ├── juce_FileInputStream.h
│ │ ├── juce_FileOutputStream.cpp
│ │ ├── juce_FileOutputStream.h
│ │ ├── juce_FileSearchPath.cpp
│ │ ├── juce_FileSearchPath.h
│ │ ├── juce_MemoryMappedFile.h
│ │ ├── juce_RangedDirectoryIterator.cpp
│ │ ├── juce_RangedDirectoryIterator.h
│ │ ├── juce_TemporaryFile.cpp
│ │ ├── juce_TemporaryFile.h
│ │ ├── juce_WildcardFileFilter.cpp
│ │ ├── juce_WildcardFileFilter.h
│ │ ├── juce_common_MimeTypes.cpp
│ │ └── juce_common_MimeTypes.h
│ ├── javascript
│ │ ├── juce_JSON.cpp
│ │ ├── juce_JSON.h
│ │ ├── juce_JSONSerialisation.h
│ │ ├── juce_JSONSerialisation_test.cpp
│ │ ├── juce_JSONUtils.cpp
│ │ ├── juce_JSONUtils.h
│ │ ├── juce_Javascript.cpp
│ │ └── juce_Javascript.h
│ ├── juce_core.cpp
│ ├── juce_core.h
│ ├── juce_core.mm
│ ├── logging
│ │ ├── juce_FileLogger.cpp
│ │ ├── juce_FileLogger.h
│ │ ├── juce_Logger.cpp
│ │ └── juce_Logger.h
│ ├── maths
│ │ ├── juce_BigInteger.cpp
│ │ ├── juce_BigInteger.h
│ │ ├── juce_Expression.cpp
│ │ ├── juce_Expression.h
│ │ ├── juce_MathsFunctions.h
│ │ ├── juce_MathsFunctions_test.cpp
│ │ ├── juce_NormalisableRange.h
│ │ ├── juce_Random.cpp
│ │ ├── juce_Random.h
│ │ ├── juce_Range.h
│ │ └── juce_StatisticsAccumulator.h
│ ├── memory
│ │ ├── juce_AllocationHooks.cpp
│ │ ├── juce_AllocationHooks.h
│ │ ├── juce_Atomic.h
│ │ ├── juce_ByteOrder.h
│ │ ├── juce_ContainerDeletePolicy.h
│ │ ├── juce_HeapBlock.h
│ │ ├── juce_HeavyweightLeakedObjectDetector.h
│ │ ├── juce_LeakedObjectDetector.h
│ │ ├── juce_Memory.h
│ │ ├── juce_MemoryBlock.cpp
│ │ ├── juce_MemoryBlock.h
│ │ ├── juce_OptionalScopedPointer.h
│ │ ├── juce_ReferenceCountedObject.h
│ │ ├── juce_Reservoir.h
│ │ ├── juce_ScopedPointer.h
│ │ ├── juce_SharedResourcePointer.h
│ │ ├── juce_SharedResourcePointer_test.cpp
│ │ ├── juce_Singleton.h
│ │ └── juce_WeakReference.h
│ ├── misc
│ │ ├── juce_ConsoleApplication.cpp
│ │ ├── juce_ConsoleApplication.h
│ │ ├── juce_EnumHelpers.h
│ │ ├── juce_EnumHelpers_test.cpp
│ │ ├── juce_Functional.h
│ │ ├── juce_Result.cpp
│ │ ├── juce_Result.h
│ │ ├── juce_RuntimePermissions.cpp
│ │ ├── juce_RuntimePermissions.h
│ │ ├── juce_ScopeGuard.cpp
│ │ ├── juce_ScopeGuard.h
│ │ ├── juce_Uuid.cpp
│ │ ├── juce_Uuid.h
│ │ └── juce_WindowsRegistry.h
│ ├── native
│ │ ├── java
│ │ │ ├── README.txt
│ │ │ └── app
│ │ │ │ └── com
│ │ │ │ └── rmsl
│ │ │ │ └── juce
│ │ │ │ ├── FragmentOverlay.java
│ │ │ │ ├── JuceHTTPStream.java
│ │ │ │ └── JuceInvocationHandler.java
│ │ ├── javacore
│ │ │ ├── app
│ │ │ │ └── com
│ │ │ │ │ └── rmsl
│ │ │ │ │ └── juce
│ │ │ │ │ └── JuceApp.java
│ │ │ └── init
│ │ │ │ └── com
│ │ │ │ └── rmsl
│ │ │ │ └── juce
│ │ │ │ └── Java.java
│ │ ├── juce_AndroidDocument_android.cpp
│ │ ├── juce_BasicNativeHeaders.h
│ │ ├── juce_CFHelpers_mac.h
│ │ ├── juce_ComSmartPtr_windows.h
│ │ ├── juce_CommonFile_linux.cpp
│ │ ├── juce_Files_android.cpp
│ │ ├── juce_Files_linux.cpp
│ │ ├── juce_Files_mac.mm
│ │ ├── juce_Files_windows.cpp
│ │ ├── juce_IPAddress_posix.h
│ │ ├── juce_JNIHelpers_android.cpp
│ │ ├── juce_JNIHelpers_android.h
│ │ ├── juce_Misc_android.cpp
│ │ ├── juce_NamedPipe_posix.cpp
│ │ ├── juce_Network_android.cpp
│ │ ├── juce_Network_curl.cpp
│ │ ├── juce_Network_linux.cpp
│ │ ├── juce_Network_mac.mm
│ │ ├── juce_Network_windows.cpp
│ │ ├── juce_ObjCHelpers_mac.h
│ │ ├── juce_ObjCHelpers_mac_test.mm
│ │ ├── juce_PlatformTimerListener.h
│ │ ├── juce_PlatformTimer_generic.cpp
│ │ ├── juce_PlatformTimer_windows.cpp
│ │ ├── juce_Process_mac.mm
│ │ ├── juce_Registry_windows.cpp
│ │ ├── juce_RuntimePermissions_android.cpp
│ │ ├── juce_SharedCode_intel.h
│ │ ├── juce_SharedCode_posix.h
│ │ ├── juce_Strings_mac.mm
│ │ ├── juce_SystemStats_android.cpp
│ │ ├── juce_SystemStats_linux.cpp
│ │ ├── juce_SystemStats_mac.mm
│ │ ├── juce_SystemStats_wasm.cpp
│ │ ├── juce_SystemStats_windows.cpp
│ │ ├── juce_ThreadPriorities_native.h
│ │ ├── juce_Threads_android.cpp
│ │ ├── juce_Threads_linux.cpp
│ │ ├── juce_Threads_mac.mm
│ │ └── juce_Threads_windows.cpp
│ ├── network
│ │ ├── juce_IPAddress.cpp
│ │ ├── juce_IPAddress.h
│ │ ├── juce_MACAddress.cpp
│ │ ├── juce_MACAddress.h
│ │ ├── juce_NamedPipe.cpp
│ │ ├── juce_NamedPipe.h
│ │ ├── juce_Socket.cpp
│ │ ├── juce_Socket.h
│ │ ├── juce_URL.cpp
│ │ ├── juce_URL.h
│ │ ├── juce_WebInputStream.cpp
│ │ └── juce_WebInputStream.h
│ ├── serialisation
│ │ └── juce_Serialisation.h
│ ├── streams
│ │ ├── juce_AndroidDocumentInputSource.h
│ │ ├── juce_BufferedInputStream.cpp
│ │ ├── juce_BufferedInputStream.h
│ │ ├── juce_FileInputSource.cpp
│ │ ├── juce_FileInputSource.h
│ │ ├── juce_InputSource.h
│ │ ├── juce_InputStream.cpp
│ │ ├── juce_InputStream.h
│ │ ├── juce_MemoryInputStream.cpp
│ │ ├── juce_MemoryInputStream.h
│ │ ├── juce_MemoryOutputStream.cpp
│ │ ├── juce_MemoryOutputStream.h
│ │ ├── juce_OutputStream.cpp
│ │ ├── juce_OutputStream.h
│ │ ├── juce_SubregionStream.cpp
│ │ ├── juce_SubregionStream.h
│ │ ├── juce_URLInputSource.cpp
│ │ └── juce_URLInputSource.h
│ ├── system
│ │ ├── juce_CompilerSupport.h
│ │ ├── juce_CompilerWarnings.h
│ │ ├── juce_PlatformDefs.h
│ │ ├── juce_StandardHeader.h
│ │ ├── juce_SystemStats.cpp
│ │ ├── juce_SystemStats.h
│ │ └── juce_TargetPlatform.h
│ ├── text
│ │ ├── juce_Base64.cpp
│ │ ├── juce_Base64.h
│ │ ├── juce_CharPointer_ASCII.h
│ │ ├── juce_CharPointer_UTF16.h
│ │ ├── juce_CharPointer_UTF32.h
│ │ ├── juce_CharPointer_UTF8.h
│ │ ├── juce_CharacterFunctions.cpp
│ │ ├── juce_CharacterFunctions.h
│ │ ├── juce_Identifier.cpp
│ │ ├── juce_Identifier.h
│ │ ├── juce_LocalisedStrings.cpp
│ │ ├── juce_LocalisedStrings.h
│ │ ├── juce_NewLine.h
│ │ ├── juce_String.cpp
│ │ ├── juce_String.h
│ │ ├── juce_StringArray.cpp
│ │ ├── juce_StringArray.h
│ │ ├── juce_StringPairArray.cpp
│ │ ├── juce_StringPairArray.h
│ │ ├── juce_StringPool.cpp
│ │ ├── juce_StringPool.h
│ │ ├── juce_StringRef.h
│ │ ├── juce_TextDiff.cpp
│ │ └── juce_TextDiff.h
│ ├── threads
│ │ ├── juce_ChildProcess.cpp
│ │ ├── juce_ChildProcess.h
│ │ ├── juce_CriticalSection.h
│ │ ├── juce_DynamicLibrary.h
│ │ ├── juce_HighResolutionTimer.cpp
│ │ ├── juce_HighResolutionTimer.h
│ │ ├── juce_InterProcessLock.h
│ │ ├── juce_Process.h
│ │ ├── juce_ReadWriteLock.cpp
│ │ ├── juce_ReadWriteLock.h
│ │ ├── juce_ScopedLock.h
│ │ ├── juce_ScopedReadLock.h
│ │ ├── juce_ScopedWriteLock.h
│ │ ├── juce_SpinLock.h
│ │ ├── juce_Thread.cpp
│ │ ├── juce_Thread.h
│ │ ├── juce_ThreadLocalValue.h
│ │ ├── juce_ThreadPool.cpp
│ │ ├── juce_ThreadPool.h
│ │ ├── juce_TimeSliceThread.cpp
│ │ ├── juce_TimeSliceThread.h
│ │ ├── juce_WaitableEvent.cpp
│ │ └── juce_WaitableEvent.h
│ ├── time
│ │ ├── juce_PerformanceCounter.cpp
│ │ ├── juce_PerformanceCounter.h
│ │ ├── juce_RelativeTime.cpp
│ │ ├── juce_RelativeTime.h
│ │ ├── juce_Time.cpp
│ │ └── juce_Time.h
│ ├── unit_tests
│ │ ├── juce_UnitTest.cpp
│ │ ├── juce_UnitTest.h
│ │ └── juce_UnitTestCategories.h
│ ├── xml
│ │ ├── juce_XmlDocument.cpp
│ │ ├── juce_XmlDocument.h
│ │ ├── juce_XmlElement.cpp
│ │ └── juce_XmlElement.h
│ └── zip
│ │ ├── juce_GZIPCompressorOutputStream.cpp
│ │ ├── juce_GZIPCompressorOutputStream.h
│ │ ├── juce_GZIPDecompressorInputStream.cpp
│ │ ├── juce_GZIPDecompressorInputStream.h
│ │ ├── juce_ZipFile.cpp
│ │ ├── juce_ZipFile.h
│ │ └── zlib
│ │ ├── README
│ │ ├── adler32.c
│ │ ├── compress.c
│ │ ├── crc32.c
│ │ ├── crc32.h
│ │ ├── deflate.c
│ │ ├── deflate.h
│ │ ├── infback.c
│ │ ├── inffast.c
│ │ ├── inffast.h
│ │ ├── inffixed.h
│ │ ├── inflate.c
│ │ ├── inflate.h
│ │ ├── inftrees.c
│ │ ├── inftrees.h
│ │ ├── trees.c
│ │ ├── trees.h
│ │ ├── uncompr.c
│ │ ├── zconf.h
│ │ ├── zconf.in.h
│ │ ├── zlib.h
│ │ ├── zutil.c
│ │ └── zutil.h
│ ├── juce_data_structures
│ ├── app_properties
│ │ ├── juce_ApplicationProperties.cpp
│ │ ├── juce_ApplicationProperties.h
│ │ ├── juce_PropertiesFile.cpp
│ │ └── juce_PropertiesFile.h
│ ├── juce_data_structures.cpp
│ ├── juce_data_structures.h
│ ├── juce_data_structures.mm
│ ├── undomanager
│ │ ├── juce_UndoManager.cpp
│ │ ├── juce_UndoManager.h
│ │ ├── juce_UndoableAction.cpp
│ │ └── juce_UndoableAction.h
│ └── values
│ │ ├── juce_CachedValue.cpp
│ │ ├── juce_CachedValue.h
│ │ ├── juce_Value.cpp
│ │ ├── juce_Value.h
│ │ ├── juce_ValueTree.cpp
│ │ ├── juce_ValueTree.h
│ │ ├── juce_ValueTreePropertyWithDefault.h
│ │ ├── juce_ValueTreePropertyWithDefault_test.cpp
│ │ ├── juce_ValueTreeSynchroniser.cpp
│ │ └── juce_ValueTreeSynchroniser.h
│ ├── juce_events
│ ├── broadcasters
│ │ ├── juce_ActionBroadcaster.cpp
│ │ ├── juce_ActionBroadcaster.h
│ │ ├── juce_ActionListener.h
│ │ ├── juce_AsyncUpdater.cpp
│ │ ├── juce_AsyncUpdater.h
│ │ ├── juce_ChangeBroadcaster.cpp
│ │ ├── juce_ChangeBroadcaster.h
│ │ ├── juce_ChangeListener.h
│ │ ├── juce_LockingAsyncUpdater.cpp
│ │ └── juce_LockingAsyncUpdater.h
│ ├── interprocess
│ │ ├── juce_ChildProcessManager.cpp
│ │ ├── juce_ChildProcessManager.h
│ │ ├── juce_ConnectedChildProcess.cpp
│ │ ├── juce_ConnectedChildProcess.h
│ │ ├── juce_InterprocessConnection.cpp
│ │ ├── juce_InterprocessConnection.h
│ │ ├── juce_InterprocessConnectionServer.cpp
│ │ ├── juce_InterprocessConnectionServer.h
│ │ ├── juce_NetworkServiceDiscovery.cpp
│ │ └── juce_NetworkServiceDiscovery.h
│ ├── juce_events.cpp
│ ├── juce_events.h
│ ├── juce_events.mm
│ ├── messages
│ │ ├── juce_ApplicationBase.cpp
│ │ ├── juce_ApplicationBase.h
│ │ ├── juce_CallbackMessage.h
│ │ ├── juce_DeletedAtShutdown.cpp
│ │ ├── juce_DeletedAtShutdown.h
│ │ ├── juce_Initialisation.h
│ │ ├── juce_Message.h
│ │ ├── juce_MessageListener.cpp
│ │ ├── juce_MessageListener.h
│ │ ├── juce_MessageManager.cpp
│ │ ├── juce_MessageManager.h
│ │ ├── juce_MountedVolumeListChangeDetector.h
│ │ └── juce_NotificationType.h
│ ├── native
│ │ ├── juce_EventLoopInternal_linux.h
│ │ ├── juce_EventLoop_linux.h
│ │ ├── juce_HiddenMessageWindow_windows.h
│ │ ├── juce_MessageManager_ios.mm
│ │ ├── juce_MessageManager_mac.mm
│ │ ├── juce_MessageQueue_mac.h
│ │ ├── juce_Messaging_android.cpp
│ │ ├── juce_Messaging_linux.cpp
│ │ ├── juce_Messaging_windows.cpp
│ │ ├── juce_RunningInUnity.h
│ │ ├── juce_ScopedLowPowerModeDisabler.cpp
│ │ ├── juce_ScopedLowPowerModeDisabler.h
│ │ ├── juce_WinRTWrapper_windows.cpp
│ │ └── juce_WinRTWrapper_windows.h
│ └── timers
│ │ ├── juce_MultiTimer.cpp
│ │ ├── juce_MultiTimer.h
│ │ ├── juce_TimedCallback.h
│ │ ├── juce_Timer.cpp
│ │ └── juce_Timer.h
│ └── juce_midi_ci
│ ├── ci
│ ├── juce_CIChannelAddress.h
│ ├── juce_CIDevice.cpp
│ ├── juce_CIDevice.h
│ ├── juce_CIDeviceFeatures.h
│ ├── juce_CIDeviceListener.h
│ ├── juce_CIDeviceMessageHandler.h
│ ├── juce_CIDeviceOptions.h
│ ├── juce_CIEncoding.h
│ ├── juce_CIEncodings.cpp
│ ├── juce_CIEncodings.h
│ ├── juce_CIFunctionBlock.h
│ ├── juce_CIMessages.h
│ ├── juce_CIMuid.h
│ ├── juce_CIParser.cpp
│ ├── juce_CIParser.h
│ ├── juce_CIProfileAtAddress.h
│ ├── juce_CIProfileDelegate.h
│ ├── juce_CIProfileHost.cpp
│ ├── juce_CIProfileHost.h
│ ├── juce_CIProfileStates.cpp
│ ├── juce_CIProfileStates.h
│ ├── juce_CIPropertyDelegate.cpp
│ ├── juce_CIPropertyDelegate.h
│ ├── juce_CIPropertyExchangeCache.cpp
│ ├── juce_CIPropertyExchangeCache.h
│ ├── juce_CIPropertyExchangeResult.h
│ ├── juce_CIPropertyHost.cpp
│ ├── juce_CIPropertyHost.h
│ ├── juce_CIResponderDelegate.h
│ ├── juce_CIResponderOutput.cpp
│ ├── juce_CIResponderOutput.h
│ ├── juce_CISubscription.h
│ ├── juce_CISubscriptionManager.cpp
│ ├── juce_CISubscriptionManager.h
│ └── juce_CISupportedAndActive.h
│ ├── detail
│ ├── juce_CIMarshalling.h
│ ├── juce_CIMessageMeta.h
│ ├── juce_CIMessageTypeUtils.h
│ ├── juce_CIPropertyDataMessageChunker.cpp
│ ├── juce_CIPropertyDataMessageChunker.h
│ ├── juce_CIPropertyHostUtils.h
│ ├── juce_CIResponder.cpp
│ └── juce_CIResponder.h
│ ├── juce_midi_ci.cpp
│ └── juce_midi_ci.h
├── README.md
├── Scripts
├── build-macos.sh
└── build-windows.ps1
├── Source
├── ApplicationCommand.cpp
├── ApplicationCommand.h
├── ApplicationState.cpp
├── ApplicationState.h
├── Main.cpp
├── MpeProfileNegotation.cpp
├── MpeProfileNegotiation.h
├── MpeTestScenario.cpp
└── MpeTestScenario.h
└── sendmidi.jucer
/.gitignore:
--------------------------------------------------------------------------------
1 | Builds/*/build
2 | Builds/MacOSX/sendmidi.xcodeproj/xcuserdata
3 | Builds/MacOSX/sendmidi.xcodeproj/project.xcworkspace/xcuserdata
4 | /.vs
5 | /Builds/VisualStudio2017/.vs
6 | /Builds/VisualStudio2017/x64
7 | /Builds/VisualStudio2017/sendmidi_ConsoleApp.vcxproj.user
8 | Installers
9 |
--------------------------------------------------------------------------------
/Builds/MacOSX/ConsoleApp.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Builds/MacOSX/RecentFilesMenuTemplate.nib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gbevin/SendMIDI/f893dc7e5380f218e3d1c0e83715e136a5fe3139/Builds/MacOSX/RecentFilesMenuTemplate.nib
--------------------------------------------------------------------------------
/Builds/MacOSX/sendmidi.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Builds/MacOSX/sendmidi.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Builds/VisualStudio2017/resources.rc:
--------------------------------------------------------------------------------
1 | #pragma code_page(65001)
2 |
3 | #ifdef JUCE_USER_DEFINED_RC_FILE
4 | #include JUCE_USER_DEFINED_RC_FILE
5 | #else
6 |
7 | #undef WIN32_LEAN_AND_MEAN
8 | #define WIN32_LEAN_AND_MEAN
9 | #include
10 |
11 | VS_VERSION_INFO VERSIONINFO
12 | FILEVERSION 1,3,1,0
13 | BEGIN
14 | BLOCK "StringFileInfo"
15 | BEGIN
16 | BLOCK "040904E4"
17 | BEGIN
18 | VALUE "CompanyName", "Uwyn\0"
19 | VALUE "FileDescription", "sendmidi\0"
20 | VALUE "FileVersion", "1.3.1\0"
21 | VALUE "ProductName", "sendmidi\0"
22 | VALUE "ProductVersion", "1.3.1\0"
23 | END
24 | END
25 |
26 | BLOCK "VarFileInfo"
27 | BEGIN
28 | VALUE "Translation", 0x409, 1252
29 | END
30 | END
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/Builds/VisualStudio2017/sendmidi.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 15
4 |
5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sendmidi - ConsoleApp", "sendmidi_ConsoleApp.vcxproj", "{EC07A94C-C6F1-D5CC-D12F-CB5B41909707}"
6 | EndProject
7 | Global
8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
9 | Debug|x64 = Debug|x64
10 | Release|x64 = Release|x64
11 | EndGlobalSection
12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
13 | {EC07A94C-C6F1-D5CC-D12F-CB5B41909707}.Debug|x64.ActiveCfg = Debug|x64
14 | {EC07A94C-C6F1-D5CC-D12F-CB5B41909707}.Debug|x64.Build.0 = Debug|x64
15 | {EC07A94C-C6F1-D5CC-D12F-CB5B41909707}.Release|x64.ActiveCfg = Release|x64
16 | {EC07A94C-C6F1-D5CC-D12F-CB5B41909707}.Release|x64.Build.0 = Release|x64
17 | EndGlobalSection
18 | GlobalSection(SolutionProperties) = preSolution
19 | HideSolutionNode = FALSE
20 | EndGlobalSection
21 | EndGlobal
22 |
--------------------------------------------------------------------------------
/JuceLibraryCode/JuceHeader.h:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | IMPORTANT! This file is auto-generated each time you save your
4 | project - if you alter its contents, your changes may be overwritten!
5 |
6 | This is the header file that your files should include in order to get all the
7 | JUCE library headers. You should avoid including the JUCE headers directly in
8 | your own source files, because that wouldn't pick up the correct configuration
9 | options for your app.
10 |
11 | */
12 |
13 | #pragma once
14 |
15 | #include "AppConfig.h"
16 |
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 |
24 |
25 | #if defined (JUCE_PROJUCER_VERSION) && JUCE_PROJUCER_VERSION < JUCE_VERSION
26 | /** If you've hit this error then the version of the Projucer that was used to generate this project is
27 | older than the version of the JUCE modules being included. To fix this error, re-save your project
28 | using the latest version of the Projucer or, if you aren't using the Projucer to manage your project,
29 | remove the JUCE_PROJUCER_VERSION define.
30 | */
31 | #error "This project was last saved using an outdated version of the Projucer! Re-save this project with the latest version to fix this error."
32 | #endif
33 |
34 | #if ! DONT_SET_USING_JUCE_NAMESPACE
35 | // If your code uses a lot of JUCE classes, then this will obviously save you
36 | // a lot of typing, but can be disabled by setting DONT_SET_USING_JUCE_NAMESPACE.
37 | using namespace juce;
38 | #endif
39 |
40 | #if ! JUCE_DONT_DECLARE_PROJECTINFO
41 | namespace ProjectInfo
42 | {
43 | const char* const projectName = "sendmidi";
44 | const char* const companyName = "Uwyn";
45 | const char* const versionString = "1.3.1";
46 | const int versionNumber = 0x10301;
47 | }
48 | #endif
49 |
--------------------------------------------------------------------------------
/JuceLibraryCode/ReadMe.txt:
--------------------------------------------------------------------------------
1 |
2 | Important Note!!
3 | ================
4 |
5 | The purpose of this folder is to contain files that are auto-generated by the Projucer,
6 | and ALL files in this folder will be mercilessly DELETED and completely re-written whenever
7 | the Projucer saves your project.
8 |
9 | Therefore, it's a bad idea to make any manual changes to the files in here, or to
10 | put any of your own files in here if you don't want to lose them. (Of course you may choose
11 | to add the folder's contents to your version-control system so that you can re-merge your own
12 | modifications after the Projucer has saved its changes).
13 |
--------------------------------------------------------------------------------
/JuceLibraryCode/include_juce_audio_basics.cpp:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | IMPORTANT! This file is auto-generated each time you save your
4 | project - if you alter its contents, your changes may be overwritten!
5 |
6 | */
7 |
8 | #include "AppConfig.h"
9 | #include
10 |
--------------------------------------------------------------------------------
/JuceLibraryCode/include_juce_audio_basics.mm:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | IMPORTANT! This file is auto-generated each time you save your
4 | project - if you alter its contents, your changes may be overwritten!
5 |
6 | */
7 |
8 | #include "AppConfig.h"
9 | #include
10 |
--------------------------------------------------------------------------------
/JuceLibraryCode/include_juce_audio_devices.cpp:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | IMPORTANT! This file is auto-generated each time you save your
4 | project - if you alter its contents, your changes may be overwritten!
5 |
6 | */
7 |
8 | #include "AppConfig.h"
9 | #include
10 |
--------------------------------------------------------------------------------
/JuceLibraryCode/include_juce_audio_devices.mm:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | IMPORTANT! This file is auto-generated each time you save your
4 | project - if you alter its contents, your changes may be overwritten!
5 |
6 | */
7 |
8 | #include "AppConfig.h"
9 | #include
10 |
--------------------------------------------------------------------------------
/JuceLibraryCode/include_juce_core.cpp:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | IMPORTANT! This file is auto-generated each time you save your
4 | project - if you alter its contents, your changes may be overwritten!
5 |
6 | */
7 |
8 | #include "AppConfig.h"
9 | #include
10 |
--------------------------------------------------------------------------------
/JuceLibraryCode/include_juce_core.mm:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | IMPORTANT! This file is auto-generated each time you save your
4 | project - if you alter its contents, your changes may be overwritten!
5 |
6 | */
7 |
8 | #include "AppConfig.h"
9 | #include
10 |
--------------------------------------------------------------------------------
/JuceLibraryCode/include_juce_data_structures.cpp:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | IMPORTANT! This file is auto-generated each time you save your
4 | project - if you alter its contents, your changes may be overwritten!
5 |
6 | */
7 |
8 | #include "AppConfig.h"
9 | #include
10 |
--------------------------------------------------------------------------------
/JuceLibraryCode/include_juce_data_structures.mm:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | IMPORTANT! This file is auto-generated each time you save your
4 | project - if you alter its contents, your changes may be overwritten!
5 |
6 | */
7 |
8 | #include "AppConfig.h"
9 | #include
10 |
--------------------------------------------------------------------------------
/JuceLibraryCode/include_juce_events.cpp:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | IMPORTANT! This file is auto-generated each time you save your
4 | project - if you alter its contents, your changes may be overwritten!
5 |
6 | */
7 |
8 | #include "AppConfig.h"
9 | #include
10 |
--------------------------------------------------------------------------------
/JuceLibraryCode/include_juce_events.mm:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | IMPORTANT! This file is auto-generated each time you save your
4 | project - if you alter its contents, your changes may be overwritten!
5 |
6 | */
7 |
8 | #include "AppConfig.h"
9 | #include
10 |
--------------------------------------------------------------------------------
/JuceLibraryCode/include_juce_midi_ci.cpp:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | IMPORTANT! This file is auto-generated each time you save your
4 | project - if you alter its contents, your changes may be overwritten!
5 |
6 | */
7 |
8 | #include "AppConfig.h"
9 | #include
10 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_basics/audio_play_head/juce_AudioPlayHead.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | bool AudioPlayHead::canControlTransport() { return false; }
27 | void AudioPlayHead::transportPlay ([[maybe_unused]] bool shouldStartPlaying) {}
28 | void AudioPlayHead::transportRecord ([[maybe_unused]] bool shouldStartRecording) {}
29 | void AudioPlayHead::transportRewind() {}
30 |
31 | } // namespace juce
32 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_basics/juce_audio_basics.mm:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | #include "juce_audio_basics.cpp"
24 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMP.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | #include "juce_UMPProtocols.h"
24 | #include "juce_UMPUtils.h"
25 | #include "juce_UMPacket.h"
26 | #include "juce_UMPSysEx7.h"
27 | #include "juce_UMPView.h"
28 | #include "juce_UMPIterator.h"
29 | #include "juce_UMPackets.h"
30 | #include "juce_UMPFactory.h"
31 | #include "juce_UMPConversion.h"
32 | #include "juce_UMPMidi1ToBytestreamTranslator.h"
33 | #include "juce_UMPMidi1ToMidi2DefaultTranslator.h"
34 | #include "juce_UMPConverters.h"
35 | #include "juce_UMPDispatcher.h"
36 | #include "juce_UMPReceiver.h"
37 |
38 | #ifndef DOXYGEN
39 |
40 | namespace juce
41 | {
42 | namespace ump = universal_midi_packets;
43 | }
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMPBytesOnGroup.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce::universal_midi_packets
24 | {
25 |
26 | /**
27 | Holds a UMP group, and a span of bytes that were received or are to be
28 | sent on that group. Helpful when working with sysex messages.
29 |
30 | @tags{Audio}
31 | */
32 | struct BytesOnGroup
33 | {
34 | uint8_t group{};
35 | Span bytes;
36 | };
37 |
38 | } // namespace juce::universal_midi_packets
39 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMPIterator.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce::universal_midi_packets
24 | {
25 |
26 | Iterator::Iterator (const uint32_t* ptr, [[maybe_unused]] size_t bytes) noexcept
27 | : view (ptr)
28 | #if JUCE_DEBUG
29 | , bytesRemaining (bytes)
30 | #endif
31 | {
32 | }
33 |
34 | } // namespace juce::universal_midi_packets
35 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMPProtocols.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | #ifndef DOXYGEN
24 |
25 | namespace juce::universal_midi_packets
26 | {
27 |
28 | /** The kinds of MIDI protocol that can be formatted into Universal MIDI Packets. */
29 | enum class PacketProtocol
30 | {
31 | MIDI_1_0,
32 | MIDI_2_0,
33 | };
34 |
35 | /** All kinds of MIDI protocol understood by JUCE. */
36 | enum class MidiProtocol
37 | {
38 | bytestream,
39 | UMP_MIDI_1_0,
40 | UMP_MIDI_2_0,
41 | };
42 |
43 | } // namespace juce::universal_midi_packets
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMPReceiver.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | #ifndef DOXYGEN
24 |
25 | namespace juce::universal_midi_packets
26 | {
27 |
28 | /**
29 | A base class for classes which receive Universal MIDI Packets from an input.
30 |
31 | @tags{Audio}
32 | */
33 | struct Receiver
34 | {
35 | virtual ~Receiver() noexcept = default;
36 |
37 | /** This will be called each time a new packet is ready for processing. */
38 | virtual void packetReceived (const View& packet, double time) = 0;
39 | };
40 |
41 | } // namespace juce::universal_midi_packets
42 |
43 | #endif
44 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMPSysEx7.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce::universal_midi_packets
24 | {
25 |
26 | uint32_t SysEx7::getNumPacketsRequiredForDataSize (uint32_t size)
27 | {
28 | constexpr auto denom = 6;
29 | return (size / denom) + ((size % denom) != 0);
30 | }
31 |
32 | SysEx7::PacketBytes SysEx7::getDataBytes (const PacketX2& packet)
33 | {
34 | const auto numBytes = Utils::getChannel (packet[0]);
35 | constexpr uint8_t maxBytes = 6;
36 | jassert (numBytes <= maxBytes);
37 |
38 | return
39 | {
40 | { { std::byte { packet.getU8<2>() },
41 | std::byte { packet.getU8<3>() },
42 | std::byte { packet.getU8<4>() },
43 | std::byte { packet.getU8<5>() },
44 | std::byte { packet.getU8<6>() },
45 | std::byte { packet.getU8<7>() } } },
46 | jmin (numBytes, maxBytes)
47 | };
48 | }
49 |
50 | } // namespace juce::universal_midi_packets
51 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMPUtils.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce::universal_midi_packets
24 | {
25 |
26 | uint32_t Utils::getNumWordsForMessageType (uint32_t mt)
27 | {
28 | switch (Utils::getMessageType (mt))
29 | {
30 | case 0x0:
31 | case 0x1:
32 | case 0x2:
33 | case 0x6:
34 | case 0x7:
35 | return 1;
36 | case 0x3:
37 | case 0x4:
38 | case 0x8:
39 | case 0x9:
40 | case 0xa:
41 | return 2;
42 | case 0xb:
43 | case 0xc:
44 | return 3;
45 | case 0x5:
46 | case 0xd:
47 | case 0xe:
48 | case 0xf:
49 | return 4;
50 | }
51 |
52 | jassertfalse;
53 | return 1;
54 | }
55 |
56 | } // namespace juce::universal_midi_packets
57 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_basics/midi/ump/juce_UMPView.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce::universal_midi_packets
24 | {
25 |
26 | uint32_t View::size() const noexcept
27 | {
28 | jassert (ptr != nullptr);
29 | return Utils::getNumWordsForMessageType (*ptr);
30 | }
31 |
32 | } // namespace juce::universal_midi_packets
33 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_basics/mpe/juce_MPESynthesiserVoice.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | MPESynthesiserVoice::MPESynthesiserVoice()
27 | {
28 | }
29 |
30 | MPESynthesiserVoice::~MPESynthesiserVoice()
31 | {
32 | }
33 |
34 | //==============================================================================
35 | bool MPESynthesiserVoice::isCurrentlyPlayingNote (MPENote note) const noexcept
36 | {
37 | return isActive() && currentlyPlayingNote.noteID == note.noteID;
38 | }
39 |
40 | bool MPESynthesiserVoice::isPlayingButReleased() const noexcept
41 | {
42 | return isActive() && currentlyPlayingNote.keyState == MPENote::off;
43 | }
44 |
45 | void MPESynthesiserVoice::clearCurrentNote() noexcept
46 | {
47 | currentlyPlayingNote = MPENote();
48 | }
49 |
50 | } // namespace juce
51 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_basics/native/juce_AudioWorkgroup_mac.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 | #if (defined (MAC_OS_VERSION_11_0) || defined (__IPHONE_14_0))
26 | #define JUCE_AUDIOWORKGROUP_TYPES_AVAILABLE 1
27 | #else
28 | #define JUCE_AUDIOWORKGROUP_TYPES_AVAILABLE 0
29 | #endif
30 |
31 | #if JUCE_AUDIOWORKGROUP_TYPES_AVAILABLE
32 | AudioWorkgroup makeRealAudioWorkgroup (os_workgroup_t handle);
33 | #endif
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_basics/sources/juce_PositionableAudioSource.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | void PositionableAudioSource::setLooping ([[maybe_unused]] bool shouldLoop) {}
27 |
28 | } // namespace juce
29 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/audio_io/juce_SampleRateHelpers.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce::SampleRateHelpers
24 | {
25 |
26 | static inline const std::vector& getAllSampleRates()
27 | {
28 | static auto sampleRates = []
29 | {
30 | std::vector result;
31 | constexpr double baseRates[] = { 8000.0, 11025.0, 12000.0 };
32 | constexpr double maxRate = 768000.0;
33 |
34 | for (auto rate : baseRates)
35 | for (; rate <= maxRate; rate *= 2)
36 | result.insert (std::upper_bound (result.begin(), result.end(), rate),
37 | rate);
38 |
39 | return result;
40 | }();
41 |
42 | return sampleRates;
43 | }
44 |
45 | } // namespace juce::SampleRateHelpers
46 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/juce_audio_devices.mm:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | #include "juce_audio_devices.cpp"
24 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/.clang-tidy:
--------------------------------------------------------------------------------
1 | # We want to ignore this directory, but we need to enable at least a single
2 | # check to avoid an error
3 | Checks: -*,darwin-dispatch-once-nonstatic
4 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/include/oboe/Oboe.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef OBOE_OBOE_H
18 | #define OBOE_OBOE_H
19 |
20 | /**
21 | * \mainpage API reference
22 | *
23 | * All documentation is found in the oboe namespace section
24 | *
25 | */
26 |
27 | #include "oboe/Definitions.h"
28 | #include "oboe/ResultWithValue.h"
29 | #include "oboe/LatencyTuner.h"
30 | #include "oboe/AudioStream.h"
31 | #include "oboe/AudioStreamBase.h"
32 | #include "oboe/AudioStreamBuilder.h"
33 | #include "oboe/Utilities.h"
34 | #include "oboe/Version.h"
35 | #include "oboe/StabilizedCallback.h"
36 | #include "oboe/FifoBuffer.h"
37 | #include "oboe/OboeExtensions.h"
38 | #include "oboe/FullDuplexStream.h"
39 |
40 | #endif //OBOE_OBOE_H
41 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/include/oboe/OboeExtensions.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef OBOE_EXTENSIONS_
18 | #define OBOE_EXTENSIONS_
19 |
20 | #include
21 |
22 | #include "oboe/Definitions.h"
23 | #include "oboe/AudioStream.h"
24 |
25 | namespace oboe {
26 |
27 | /**
28 | * The definitions below are only for testing.
29 | * They are not recommended for use in an application.
30 | * They may change or be removed at any time.
31 | */
32 | class OboeExtensions {
33 | public:
34 |
35 | /**
36 | * @returns true if the device supports AAudio MMAP
37 | */
38 | static bool isMMapSupported();
39 |
40 | /**
41 | * @returns true if the AAudio MMAP data path can be selected
42 | */
43 | static bool isMMapEnabled();
44 |
45 | /**
46 | * Controls whether the AAudio MMAP data path can be selected when opening a stream.
47 | * It has no effect after the stream has been opened.
48 | * It only affects the application that calls it. Other apps are not affected.
49 | *
50 | * @param enabled
51 | * @return 0 or a negative error code
52 | */
53 | static int32_t setMMapEnabled(bool enabled);
54 |
55 | /**
56 | * @param oboeStream
57 | * @return true if the AAudio MMAP data path is used on the stream
58 | */
59 | static bool isMMapUsed(oboe::AudioStream *oboeStream);
60 | };
61 |
62 | } // namespace oboe
63 |
64 | #endif // OBOE_LATENCY_TUNER_
65 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/readme.md:
--------------------------------------------------------------------------------
1 | The files in this directory are reproduced from the official Oboe repository, which can be found at
2 | github.com/google/oboe.
3 |
4 | These files are from tag 1.8.0 (987538b).
5 |
6 | We've included only those parts of the original repository which are required to build the Oboe
7 | library. Documentation, samples, tests, and other non-library items have been omitted.
8 |
9 | Files in this directory and below are licensed under the terms of the license in the LICENSE file
10 | which you can find in the same directory as this readme.
11 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/AudioSourceCaller.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include "AudioSourceCaller.h"
18 |
19 | using namespace oboe;
20 | using namespace flowgraph;
21 |
22 | int32_t AudioSourceCaller::onProcessFixedBlock(uint8_t *buffer, int32_t numBytes) {
23 | AudioStreamDataCallback *callback = mStream->getDataCallback();
24 | int32_t result = 0;
25 | int32_t numFrames = numBytes / mStream->getBytesPerFrame();
26 | if (callback != nullptr) {
27 | DataCallbackResult callbackResult = callback->onAudioReady(mStream, buffer, numFrames);
28 | // onAudioReady() does not return the number of bytes processed so we have to assume all.
29 | result = (callbackResult == DataCallbackResult::Continue)
30 | ? numBytes
31 | : -1;
32 | } else {
33 | auto readResult = mStream->read(buffer, numFrames, mTimeoutNanos);
34 | if (!readResult) return (int32_t) readResult.error();
35 | result = readResult.value() * mStream->getBytesPerFrame();
36 | }
37 | return result;
38 | }
39 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/FixedBlockAdapter.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 |
19 | #include "FixedBlockAdapter.h"
20 |
21 | FixedBlockAdapter::~FixedBlockAdapter() {
22 | }
23 |
24 | int32_t FixedBlockAdapter::open(int32_t bytesPerFixedBlock)
25 | {
26 | mSize = bytesPerFixedBlock;
27 | mStorage = std::make_unique(bytesPerFixedBlock);
28 | mPosition = 0;
29 | return 0;
30 | }
31 |
32 | int32_t FixedBlockAdapter::close()
33 | {
34 | mStorage.reset(nullptr);
35 | mSize = 0;
36 | mPosition = 0;
37 | return 0;
38 | }
39 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/FixedBlockReader.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef AAUDIO_FIXED_BLOCK_READER_H
18 | #define AAUDIO_FIXED_BLOCK_READER_H
19 |
20 | #include
21 |
22 | #include "FixedBlockAdapter.h"
23 |
24 | /**
25 | * Read from a fixed-size block to a variable sized block.
26 | *
27 | * This can be used to convert a pull data flow from fixed sized buffers to variable sized buffers.
28 | * An example would be an audio output callback that reads from the app.
29 | */
30 | class FixedBlockReader : public FixedBlockAdapter
31 | {
32 | public:
33 | FixedBlockReader(FixedBlockProcessor &fixedBlockProcessor);
34 |
35 | virtual ~FixedBlockReader() = default;
36 |
37 | int32_t open(int32_t bytesPerFixedBlock) override;
38 |
39 | /**
40 | * Read into a variable sized block.
41 | *
42 | * Note that if the fixed-sized blocks must be aligned, then the variable-sized blocks
43 | * must have the same alignment.
44 | * For example, if the fixed-size blocks must be a multiple of 8, then the variable-sized
45 | * blocks must also be a multiple of 8.
46 | *
47 | * @param buffer
48 | * @param numBytes
49 | * @return Number of bytes read or a negative error code.
50 | */
51 | int32_t read(uint8_t *buffer, int32_t numBytes);
52 |
53 | private:
54 | int32_t readFromStorage(uint8_t *buffer, int32_t numBytes);
55 |
56 | int32_t mValid = 0; // Number of valid bytes in mStorage.
57 | };
58 |
59 |
60 | #endif /* AAUDIO_FIXED_BLOCK_READER_H */
61 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/FixedBlockWriter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef AAUDIO_FIXED_BLOCK_WRITER_H
18 | #define AAUDIO_FIXED_BLOCK_WRITER_H
19 |
20 | #include
21 |
22 | #include "FixedBlockAdapter.h"
23 |
24 | /**
25 | * This can be used to convert a push data flow from variable sized buffers to fixed sized buffers.
26 | * An example would be an audio input callback.
27 | */
28 | class FixedBlockWriter : public FixedBlockAdapter
29 | {
30 | public:
31 | FixedBlockWriter(FixedBlockProcessor &fixedBlockProcessor);
32 |
33 | virtual ~FixedBlockWriter() = default;
34 |
35 | /**
36 | * Write from a variable sized block.
37 | *
38 | * Note that if the fixed-sized blocks must be aligned, then the variable-sized blocks
39 | * must have the same alignment.
40 | * For example, if the fixed-size blocks must be a multiple of 8, then the variable-sized
41 | * blocks must also be a multiple of 8.
42 | *
43 | * @param buffer
44 | * @param numBytes
45 | * @return Number of bytes written or a negative error code.
46 | */
47 | int32_t write(uint8_t *buffer, int32_t numBytes);
48 |
49 | private:
50 |
51 | int32_t writeToStorage(uint8_t *buffer, int32_t numBytes);
52 | };
53 |
54 | #endif /* AAUDIO_FIXED_BLOCK_WRITER_H */
55 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/OboeDebug.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | *
16 | */
17 |
18 | #ifndef OBOE_DEBUG_H
19 | #define OBOE_DEBUG_H
20 |
21 | #include
22 |
23 | #ifndef MODULE_NAME
24 | #define MODULE_NAME "OboeAudio"
25 | #endif
26 |
27 | // Always log INFO and errors.
28 | #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, MODULE_NAME, __VA_ARGS__)
29 | #define LOGW(...) __android_log_print(ANDROID_LOG_WARN, MODULE_NAME, __VA_ARGS__)
30 | #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, MODULE_NAME, __VA_ARGS__)
31 | #define LOGF(...) __android_log_print(ANDROID_LOG_FATAL, MODULE_NAME, __VA_ARGS__)
32 |
33 | #if OBOE_ENABLE_LOGGING
34 | #define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, MODULE_NAME, __VA_ARGS__)
35 | #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, MODULE_NAME, __VA_ARGS__)
36 | #else
37 | #define LOGV(...)
38 | #define LOGD(...)
39 | #endif
40 |
41 | #endif //OBOE_DEBUG_H
42 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/OboeExtensions.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2022 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include "oboe/OboeExtensions.h"
18 | #include "aaudio/AAudioExtensions.h"
19 |
20 | using namespace oboe;
21 |
22 | bool OboeExtensions::isMMapSupported(){
23 | return AAudioExtensions::getInstance().isMMapSupported();
24 | }
25 |
26 | bool OboeExtensions::isMMapEnabled(){
27 | return AAudioExtensions::getInstance().isMMapEnabled();
28 | }
29 |
30 | int32_t OboeExtensions::setMMapEnabled(bool enabled){
31 | return AAudioExtensions::getInstance().setMMapEnabled(enabled);
32 | }
33 |
34 | bool OboeExtensions::isMMapUsed(oboe::AudioStream *oboeStream){
35 | return AAudioExtensions::getInstance().isMMapUsed(oboeStream);
36 | }
37 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/README.md:
--------------------------------------------------------------------------------
1 | # Notes on Implementation
2 |
3 | ## Latency from Resampling
4 |
5 | There are two components of the latency. The resampler itself, and a buffer that
6 | is used to adapt the block sizes.
7 |
8 | 1) The resampler is an FIR running at the target sample rate. So its latency is the number of taps.
9 | From MultiChannelResampler.cpp, numTaps is
10 |
11 | Fastest: 2
12 | Low: 4
13 | Medium: 8
14 | High: 16
15 | Best: 32
16 |
17 | For output, the device sampling rate is used, which is typically 48000.For input, the app sampling rate is used.
18 |
19 | 2) There is a block size adapter that collects odd sized blocks into larger blocks of the correct size.
20 |
21 | The adapter contains one burst of frames, from getFramesPerBurst(). But if the app specifies a
22 | particular size using setFramesPerCallback() then that size will be used.
23 | Here is some pseudo-code to calculate the latency.
24 |
25 | latencyMillis = 0
26 | targetRate = isOutput ? deviceRate : applicationRate
27 | // Add latency from FIR
28 | latencyMillis += numTaps * 1000.0 / targetRate
29 | // Add latency from block size adaptation
30 | adapterSize = (callbackSize > 0) ? callbackSize : burstSize
31 | if (isOutput && isCallbackUsed) latencyMillis += adapterSize * 1000.0 / deviceRate
32 | else if (isInput && isCallbackUsed) latencyMillis += adapterSize * 1000.0 / applicationRate
33 | else if (isInput && !isCallbackUsed) latencyMillis += adapterSize * 1000.0 / deviceRate
34 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceFloatCaller.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 | #include "flowgraph/FlowGraphNode.h"
20 | #include "SourceFloatCaller.h"
21 |
22 | using namespace oboe;
23 | using namespace flowgraph;
24 |
25 | int32_t SourceFloatCaller::onProcess(int32_t numFrames) {
26 | int32_t numBytes = mStream->getBytesPerFrame() * numFrames;
27 | int32_t bytesRead = mBlockReader.read((uint8_t *) output.getBuffer(), numBytes);
28 | int32_t framesRead = bytesRead / mStream->getBytesPerFrame();
29 | return framesRead;
30 | }
31 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceFloatCaller.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef OBOE_SOURCE_FLOAT_CALLER_H
18 | #define OBOE_SOURCE_FLOAT_CALLER_H
19 |
20 | #include
21 | #include
22 |
23 | #include "flowgraph/FlowGraphNode.h"
24 | #include "AudioSourceCaller.h"
25 | #include "FixedBlockReader.h"
26 |
27 | namespace oboe {
28 | /**
29 | * AudioSource that uses callback to get more float data.
30 | */
31 | class SourceFloatCaller : public AudioSourceCaller {
32 | public:
33 | SourceFloatCaller(int32_t channelCount, int32_t framesPerCallback)
34 | : AudioSourceCaller(channelCount, framesPerCallback, (int32_t)sizeof(float)) {}
35 |
36 | int32_t onProcess(int32_t numFrames) override;
37 |
38 | const char *getName() override {
39 | return "SourceFloatCaller";
40 | }
41 | };
42 |
43 | }
44 | #endif //OBOE_SOURCE_FLOAT_CALLER_H
45 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceI16Caller.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 | #include "flowgraph/FlowGraphNode.h"
20 | #include "SourceI16Caller.h"
21 |
22 | #if FLOWGRAPH_ANDROID_INTERNAL
23 | #include
24 | #endif
25 |
26 | using namespace oboe;
27 | using namespace flowgraph;
28 |
29 | int32_t SourceI16Caller::onProcess(int32_t numFrames) {
30 | int32_t numBytes = mStream->getBytesPerFrame() * numFrames;
31 | int32_t bytesRead = mBlockReader.read((uint8_t *) mConversionBuffer.get(), numBytes);
32 | int32_t framesRead = bytesRead / mStream->getBytesPerFrame();
33 |
34 | float *floatData = output.getBuffer();
35 | const int16_t *shortData = mConversionBuffer.get();
36 | int32_t numSamples = framesRead * output.getSamplesPerFrame();
37 |
38 | #if FLOWGRAPH_ANDROID_INTERNAL
39 | memcpy_to_float_from_i16(floatData, shortData, numSamples);
40 | #else
41 | for (int i = 0; i < numSamples; i++) {
42 | *floatData++ = *shortData++ * (1.0f / 32768);
43 | }
44 | #endif
45 |
46 | return framesRead;
47 | }
48 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceI16Caller.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef OBOE_SOURCE_I16_CALLER_H
18 | #define OBOE_SOURCE_I16_CALLER_H
19 |
20 | #include
21 | #include
22 |
23 | #include "flowgraph/FlowGraphNode.h"
24 | #include "AudioSourceCaller.h"
25 | #include "FixedBlockReader.h"
26 |
27 | namespace oboe {
28 | /**
29 | * AudioSource that uses callback to get more data.
30 | */
31 | class SourceI16Caller : public AudioSourceCaller {
32 | public:
33 | SourceI16Caller(int32_t channelCount, int32_t framesPerCallback)
34 | : AudioSourceCaller(channelCount, framesPerCallback, sizeof(int16_t)) {
35 | mConversionBuffer = std::make_unique(static_cast(channelCount)
36 | * static_cast(output.getFramesPerBuffer()));
37 | }
38 |
39 | int32_t onProcess(int32_t numFrames) override;
40 |
41 | const char *getName() override {
42 | return "SourceI16Caller";
43 | }
44 | private:
45 | std::unique_ptr mConversionBuffer;
46 | };
47 |
48 | }
49 | #endif //OBOE_SOURCE_I16_CALLER_H
50 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceI24Caller.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 | #include "flowgraph/FlowGraphNode.h"
20 | #include "SourceI24Caller.h"
21 |
22 | #if FLOWGRAPH_ANDROID_INTERNAL
23 | #include
24 | #endif
25 |
26 | using namespace oboe;
27 | using namespace flowgraph;
28 |
29 | int32_t SourceI24Caller::onProcess(int32_t numFrames) {
30 | int32_t numBytes = mStream->getBytesPerFrame() * numFrames;
31 | int32_t bytesRead = mBlockReader.read((uint8_t *) mConversionBuffer.get(), numBytes);
32 | int32_t framesRead = bytesRead / mStream->getBytesPerFrame();
33 |
34 | float *floatData = output.getBuffer();
35 | const uint8_t *byteData = mConversionBuffer.get();
36 | int32_t numSamples = framesRead * output.getSamplesPerFrame();
37 |
38 | #if FLOWGRAPH_ANDROID_INTERNAL
39 | memcpy_to_float_from_p24(floatData, byteData, numSamples);
40 | #else
41 | static const float scale = 1. / (float)(1UL << 31);
42 | for (int i = 0; i < numSamples; i++) {
43 | // Assemble the data assuming Little Endian format.
44 | int32_t pad = byteData[2];
45 | pad <<= 8;
46 | pad |= byteData[1];
47 | pad <<= 8;
48 | pad |= byteData[0];
49 | pad <<= 8; // Shift to 32 bit data so the sign is correct.
50 | byteData += kBytesPerI24Packed;
51 | *floatData++ = pad * scale; // scale to range -1.0 to 1.0
52 | }
53 | #endif
54 |
55 | return framesRead;
56 | }
57 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceI24Caller.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef OBOE_SOURCE_I24_CALLER_H
18 | #define OBOE_SOURCE_I24_CALLER_H
19 |
20 | #include
21 | #include
22 |
23 | #include "flowgraph/FlowGraphNode.h"
24 | #include "AudioSourceCaller.h"
25 | #include "FixedBlockReader.h"
26 |
27 | namespace oboe {
28 |
29 | /**
30 | * AudioSource that uses callback to get more data.
31 | */
32 | class SourceI24Caller : public AudioSourceCaller {
33 | public:
34 | SourceI24Caller(int32_t channelCount, int32_t framesPerCallback)
35 | : AudioSourceCaller(channelCount, framesPerCallback, kBytesPerI24Packed) {
36 | mConversionBuffer = std::make_unique(static_cast(kBytesPerI24Packed)
37 | * static_cast(channelCount)
38 | * static_cast(output.getFramesPerBuffer()));
39 | }
40 |
41 | int32_t onProcess(int32_t numFrames) override;
42 |
43 | const char *getName() override {
44 | return "SourceI24Caller";
45 | }
46 |
47 | private:
48 | std::unique_ptr mConversionBuffer;
49 | static constexpr int kBytesPerI24Packed = 3;
50 | };
51 |
52 | }
53 | #endif //OBOE_SOURCE_I16_CALLER_H
54 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceI32Caller.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 | #include "flowgraph/FlowGraphNode.h"
20 | #include "SourceI32Caller.h"
21 |
22 | #if FLOWGRAPH_ANDROID_INTERNAL
23 | #include
24 | #endif
25 |
26 | using namespace oboe;
27 | using namespace flowgraph;
28 |
29 | int32_t SourceI32Caller::onProcess(int32_t numFrames) {
30 | int32_t numBytes = mStream->getBytesPerFrame() * numFrames;
31 | int32_t bytesRead = mBlockReader.read((uint8_t *) mConversionBuffer.get(), numBytes);
32 | int32_t framesRead = bytesRead / mStream->getBytesPerFrame();
33 |
34 | float *floatData = output.getBuffer();
35 | const int32_t *intData = mConversionBuffer.get();
36 | int32_t numSamples = framesRead * output.getSamplesPerFrame();
37 |
38 | #if FLOWGRAPH_ANDROID_INTERNAL
39 | memcpy_to_float_from_i32(floatData, shortData, numSamples);
40 | #else
41 | for (int i = 0; i < numSamples; i++) {
42 | *floatData++ = *intData++ * kScale;
43 | }
44 | #endif
45 |
46 | return framesRead;
47 | }
48 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/SourceI32Caller.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef OBOE_SOURCE_I32_CALLER_H
18 | #define OBOE_SOURCE_I32_CALLER_H
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | #include "flowgraph/FlowGraphNode.h"
25 | #include "AudioSourceCaller.h"
26 | #include "FixedBlockReader.h"
27 |
28 | namespace oboe {
29 |
30 | /**
31 | * AudioSource that uses callback to get more data.
32 | */
33 | class SourceI32Caller : public AudioSourceCaller {
34 | public:
35 | SourceI32Caller(int32_t channelCount, int32_t framesPerCallback)
36 | : AudioSourceCaller(channelCount, framesPerCallback, sizeof(int32_t)) {
37 | mConversionBuffer = std::make_unique(static_cast(channelCount)
38 | * static_cast(output.getFramesPerBuffer()));
39 | }
40 |
41 | int32_t onProcess(int32_t numFrames) override;
42 |
43 | const char *getName() override {
44 | return "SourceI32Caller";
45 | }
46 |
47 | private:
48 | std::unique_ptr mConversionBuffer;
49 | static constexpr float kScale = 1.0 / (1UL << 31);
50 | };
51 |
52 | }
53 | #endif //OBOE_SOURCE_I32_CALLER_H
54 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/Trace.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef OBOE_TRACE_H
18 | #define OBOE_TRACE_H
19 |
20 | class Trace {
21 |
22 | public:
23 | static void beginSection(const char *format, ...);
24 | static void endSection();
25 | static void initialize();
26 |
27 | private:
28 | static bool mIsTracingSupported;
29 | };
30 |
31 | #endif //OBOE_TRACE_H
32 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/common/Version.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | #include "oboe/Version.h"
17 |
18 | namespace oboe {
19 |
20 | // This variable enables the version information to be read from the resulting binary e.g.
21 | // by running `objdump -s --section=.data `
22 | // Please do not optimize or change in any way.
23 | char kVersionText[] = "OboeVersion" OBOE_VERSION_TEXT;
24 |
25 | const char * getVersionText(){
26 | return kVersionText;
27 | }
28 | } // namespace oboe
29 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/fifo/FifoController.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 |
19 | #include "FifoController.h"
20 |
21 | namespace oboe {
22 |
23 | FifoController::FifoController(uint32_t numFrames)
24 | : FifoControllerBase(numFrames)
25 | {
26 | setReadCounter(0);
27 | setWriteCounter(0);
28 | }
29 |
30 | } // namespace oboe
31 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/fifo/FifoController.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef NATIVEOBOE_FIFOCONTROLLER_H
18 | #define NATIVEOBOE_FIFOCONTROLLER_H
19 |
20 | #include
21 | #include
22 |
23 | #include "oboe/FifoControllerBase.h"
24 |
25 | namespace oboe {
26 |
27 | /**
28 | * A FifoControllerBase with counters contained in the class.
29 | */
30 | class FifoController : public FifoControllerBase
31 | {
32 | public:
33 | FifoController(uint32_t bufferSize);
34 | virtual ~FifoController() = default;
35 |
36 | virtual uint64_t getReadCounter() const override {
37 | return mReadCounter.load(std::memory_order_acquire);
38 | }
39 | virtual void setReadCounter(uint64_t n) override {
40 | mReadCounter.store(n, std::memory_order_release);
41 | }
42 | virtual void incrementReadCounter(uint64_t n) override {
43 | mReadCounter.fetch_add(n, std::memory_order_acq_rel);
44 | }
45 | virtual uint64_t getWriteCounter() const override {
46 | return mWriteCounter.load(std::memory_order_acquire);
47 | }
48 | virtual void setWriteCounter(uint64_t n) override {
49 | mWriteCounter.store(n, std::memory_order_release);
50 | }
51 | virtual void incrementWriteCounter(uint64_t n) override {
52 | mWriteCounter.fetch_add(n, std::memory_order_acq_rel);
53 | }
54 |
55 | private:
56 | std::atomic mReadCounter{};
57 | std::atomic mWriteCounter{};
58 | };
59 |
60 | } // namespace oboe
61 |
62 | #endif //NATIVEOBOE_FIFOCONTROLLER_H
63 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/fifo/FifoControllerIndirect.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 |
19 | #include "FifoControllerIndirect.h"
20 |
21 | namespace oboe {
22 |
23 | FifoControllerIndirect::FifoControllerIndirect(uint32_t numFrames,
24 | std::atomic *readCounterAddress,
25 | std::atomic *writeCounterAddress)
26 | : FifoControllerBase(numFrames)
27 | , mReadCounterAddress(readCounterAddress)
28 | , mWriteCounterAddress(writeCounterAddress)
29 | {
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/ChannelCountConverter.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include "FlowGraphNode.h"
19 | #include "ChannelCountConverter.h"
20 |
21 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph;
22 |
23 | ChannelCountConverter::ChannelCountConverter(
24 | int32_t inputChannelCount,
25 | int32_t outputChannelCount)
26 | : input(*this, inputChannelCount)
27 | , output(*this, outputChannelCount) {
28 | }
29 |
30 | ChannelCountConverter::~ChannelCountConverter() = default;
31 |
32 | int32_t ChannelCountConverter::onProcess(int32_t numFrames) {
33 | const float *inputBuffer = input.getBuffer();
34 | float *outputBuffer = output.getBuffer();
35 | int32_t inputChannelCount = input.getSamplesPerFrame();
36 | int32_t outputChannelCount = output.getSamplesPerFrame();
37 | for (int i = 0; i < numFrames; i++) {
38 | int inputChannel = 0;
39 | for (int outputChannel = 0; outputChannel < outputChannelCount; outputChannel++) {
40 | // Copy input channels to output channels.
41 | // Wrap if we run out of inputs.
42 | // Discard if we run out of outputs.
43 | outputBuffer[outputChannel] = inputBuffer[inputChannel];
44 | inputChannel = (inputChannel == inputChannelCount)
45 | ? 0 : inputChannel + 1;
46 | }
47 | inputBuffer += inputChannelCount;
48 | outputBuffer += outputChannelCount;
49 | }
50 | return numFrames;
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/ChannelCountConverter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef FLOWGRAPH_CHANNEL_COUNT_CONVERTER_H
18 | #define FLOWGRAPH_CHANNEL_COUNT_CONVERTER_H
19 |
20 | #include
21 | #include
22 |
23 | #include "FlowGraphNode.h"
24 |
25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph {
26 |
27 | /**
28 | * Change the number of number of channels without mixing.
29 | * When increasing the channel count, duplicate input channels.
30 | * When decreasing the channel count, drop input channels.
31 | */
32 | class ChannelCountConverter : public FlowGraphNode {
33 | public:
34 | explicit ChannelCountConverter(
35 | int32_t inputChannelCount,
36 | int32_t outputChannelCount);
37 |
38 | virtual ~ChannelCountConverter();
39 |
40 | int32_t onProcess(int32_t numFrames) override;
41 |
42 | const char *getName() override {
43 | return "ChannelCountConverter";
44 | }
45 |
46 | FlowGraphPortFloatInput input;
47 | FlowGraphPortFloatOutput output;
48 | };
49 |
50 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */
51 |
52 | #endif //FLOWGRAPH_CHANNEL_COUNT_CONVERTER_H
53 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/ClipToRange.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 | #include "FlowGraphNode.h"
20 | #include "ClipToRange.h"
21 |
22 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph;
23 |
24 | ClipToRange::ClipToRange(int32_t channelCount)
25 | : FlowGraphFilter(channelCount) {
26 | }
27 |
28 | int32_t ClipToRange::onProcess(int32_t numFrames) {
29 | const float *inputBuffer = input.getBuffer();
30 | float *outputBuffer = output.getBuffer();
31 |
32 | int32_t numSamples = numFrames * output.getSamplesPerFrame();
33 | for (int32_t i = 0; i < numSamples; i++) {
34 | *outputBuffer++ = std::min(mMaximum, std::max(mMinimum, *inputBuffer++));
35 | }
36 |
37 | return numFrames;
38 | }
39 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/ClipToRange.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef FLOWGRAPH_CLIP_TO_RANGE_H
18 | #define FLOWGRAPH_CLIP_TO_RANGE_H
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | #include "FlowGraphNode.h"
25 |
26 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph {
27 |
28 | // This is 3 dB, (10^(3/20)), to match the maximum headroom in AudioTrack for float data.
29 | // It is designed to allow occasional transient peaks.
30 | constexpr float kDefaultMaxHeadroom = 1.41253754f;
31 | constexpr float kDefaultMinHeadroom = -kDefaultMaxHeadroom;
32 |
33 | class ClipToRange : public FlowGraphFilter {
34 | public:
35 | explicit ClipToRange(int32_t channelCount);
36 |
37 | virtual ~ClipToRange() = default;
38 |
39 | int32_t onProcess(int32_t numFrames) override;
40 |
41 | void setMinimum(float min) {
42 | mMinimum = min;
43 | }
44 |
45 | float getMinimum() const {
46 | return mMinimum;
47 | }
48 |
49 | void setMaximum(float min) {
50 | mMaximum = min;
51 | }
52 |
53 | float getMaximum() const {
54 | return mMaximum;
55 | }
56 |
57 | const char *getName() override {
58 | return "ClipToRange";
59 | }
60 |
61 | private:
62 | float mMinimum = kDefaultMinHeadroom;
63 | float mMaximum = kDefaultMaxHeadroom;
64 | };
65 |
66 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */
67 |
68 | #endif //FLOWGRAPH_CLIP_TO_RANGE_H
69 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/FlowgraphUtilities.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef FLOWGRAPH_UTILITIES_H
18 | #define FLOWGRAPH_UTILITIES_H
19 |
20 | #include
21 |
22 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph;
23 |
24 | class FlowgraphUtilities {
25 | public:
26 | // This was copied from audio_utils/primitives.h
27 | /**
28 | * Convert a single-precision floating point value to a Q0.31 integer value.
29 | * Rounds to nearest, ties away from 0.
30 | *
31 | * Values outside the range [-1.0, 1.0) are properly clamped to -2147483648 and 2147483647,
32 | * including -Inf and +Inf. NaN values are considered undefined, and behavior may change
33 | * depending on hardware and future implementation of this function.
34 | */
35 | static int32_t clamp32FromFloat(float f)
36 | {
37 | static const float scale = (float)(1UL << 31);
38 | static const float limpos = 1.;
39 | static const float limneg = -1.;
40 |
41 | if (f <= limneg) {
42 | return INT32_MIN;
43 | } else if (f >= limpos) {
44 | return INT32_MAX;
45 | }
46 | f *= scale;
47 | /* integer conversion is through truncation (though int to float is not).
48 | * ensure that we round to nearest, ties away from 0.
49 | */
50 | return f > 0 ? f + 0.5 : f - 0.5;
51 | }
52 |
53 | };
54 |
55 | #endif // FLOWGRAPH_UTILITIES_H
56 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/Limiter.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 | #include
20 | #include "FlowGraphNode.h"
21 | #include "Limiter.h"
22 |
23 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph;
24 |
25 | Limiter::Limiter(int32_t channelCount)
26 | : FlowGraphFilter(channelCount) {
27 | }
28 |
29 | int32_t Limiter::onProcess(int32_t numFrames) {
30 | const float *inputBuffer = input.getBuffer();
31 | float *outputBuffer = output.getBuffer();
32 |
33 | int32_t numSamples = numFrames * output.getSamplesPerFrame();
34 |
35 | // Cache the last valid output to reduce memory read/write
36 | float lastValidOutput = mLastValidOutput;
37 |
38 | for (int32_t i = 0; i < numSamples; i++) {
39 | // Use the previous output if the input is NaN
40 | if (!isnan(*inputBuffer)) {
41 | lastValidOutput = processFloat(*inputBuffer);
42 | }
43 | inputBuffer++;
44 | *outputBuffer++ = lastValidOutput;
45 | }
46 | mLastValidOutput = lastValidOutput;
47 |
48 | return numFrames;
49 | }
50 |
51 | float Limiter::processFloat(float in)
52 | {
53 | float in_abs = fabsf(in);
54 | if (in_abs <= 1) {
55 | return in;
56 | }
57 | float out;
58 | if (in_abs < kXWhenYis3Decibels) {
59 | out = (kPolynomialSplineA * in_abs + kPolynomialSplineB) * in_abs + kPolynomialSplineC;
60 | } else {
61 | out = M_SQRT2;
62 | }
63 | if (in < 0) {
64 | out = -out;
65 | }
66 | return out;
67 | }
68 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/ManyToMultiConverter.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 |
19 | #include "ManyToMultiConverter.h"
20 |
21 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph;
22 |
23 | ManyToMultiConverter::ManyToMultiConverter(int32_t channelCount)
24 | : inputs(channelCount)
25 | , output(*this, channelCount) {
26 | for (int i = 0; i < channelCount; i++) {
27 | inputs[i] = std::make_unique(*this, 1);
28 | }
29 | }
30 |
31 | int32_t ManyToMultiConverter::onProcess(int32_t numFrames) {
32 | int32_t channelCount = output.getSamplesPerFrame();
33 |
34 | for (int ch = 0; ch < channelCount; ch++) {
35 | const float *inputBuffer = inputs[ch]->getBuffer();
36 | float *outputBuffer = output.getBuffer() + ch;
37 |
38 | for (int i = 0; i < numFrames; i++) {
39 | // read one, write into the proper interleaved output channel
40 | float sample = *inputBuffer++;
41 | *outputBuffer = sample;
42 | outputBuffer += channelCount; // advance to next multichannel frame
43 | }
44 | }
45 | return numFrames;
46 | }
47 |
48 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/ManyToMultiConverter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef FLOWGRAPH_MANY_TO_MULTI_CONVERTER_H
18 | #define FLOWGRAPH_MANY_TO_MULTI_CONVERTER_H
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | #include "FlowGraphNode.h"
25 |
26 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph {
27 |
28 | /**
29 | * Combine multiple mono inputs into one interleaved multi-channel output.
30 | */
31 | class ManyToMultiConverter : public flowgraph::FlowGraphNode {
32 | public:
33 | explicit ManyToMultiConverter(int32_t channelCount);
34 |
35 | virtual ~ManyToMultiConverter() = default;
36 |
37 | int32_t onProcess(int numFrames) override;
38 |
39 | void setEnabled(bool /*enabled*/) {}
40 |
41 | std::vector> inputs;
42 | flowgraph::FlowGraphPortFloatOutput output;
43 |
44 | const char *getName() override {
45 | return "ManyToMultiConverter";
46 | }
47 |
48 | private:
49 | };
50 |
51 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */
52 |
53 | #endif //FLOWGRAPH_MANY_TO_MULTI_CONVERTER_H
54 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MonoBlend.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 |
19 | #include "MonoBlend.h"
20 |
21 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph;
22 |
23 | MonoBlend::MonoBlend(int32_t channelCount)
24 | : FlowGraphFilter(channelCount)
25 | , mInvChannelCount(1. / channelCount)
26 | {
27 | }
28 |
29 | int32_t MonoBlend::onProcess(int32_t numFrames) {
30 | int32_t channelCount = output.getSamplesPerFrame();
31 | const float *inputBuffer = input.getBuffer();
32 | float *outputBuffer = output.getBuffer();
33 |
34 | for (size_t i = 0; i < numFrames; ++i) {
35 | float accum = 0;
36 | for (size_t j = 0; j < channelCount; ++j) {
37 | accum += *inputBuffer++;
38 | }
39 | accum *= mInvChannelCount;
40 | for (size_t j = 0; j < channelCount; ++j) {
41 | *outputBuffer++ = accum;
42 | }
43 | }
44 |
45 | return numFrames;
46 | }
47 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MonoBlend.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef FLOWGRAPH_MONO_BLEND_H
18 | #define FLOWGRAPH_MONO_BLEND_H
19 |
20 | #include
21 | #include
22 |
23 | #include "FlowGraphNode.h"
24 |
25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph {
26 |
27 | /**
28 | * Combine data between multiple channels so each channel is an average
29 | * of all channels.
30 | */
31 | class MonoBlend : public FlowGraphFilter {
32 | public:
33 | explicit MonoBlend(int32_t channelCount);
34 |
35 | virtual ~MonoBlend() = default;
36 |
37 | int32_t onProcess(int32_t numFrames) override;
38 |
39 | const char *getName() override {
40 | return "MonoBlend";
41 | }
42 | private:
43 | const float mInvChannelCount;
44 | };
45 |
46 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */
47 |
48 | #endif //FLOWGRAPH_MONO_BLEND
49 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MonoToMultiConverter.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include "FlowGraphNode.h"
19 | #include "MonoToMultiConverter.h"
20 |
21 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph;
22 |
23 | MonoToMultiConverter::MonoToMultiConverter(int32_t outputChannelCount)
24 | : input(*this, 1)
25 | , output(*this, outputChannelCount) {
26 | }
27 |
28 | int32_t MonoToMultiConverter::onProcess(int32_t numFrames) {
29 | const float *inputBuffer = input.getBuffer();
30 | float *outputBuffer = output.getBuffer();
31 | int32_t channelCount = output.getSamplesPerFrame();
32 | for (int i = 0; i < numFrames; i++) {
33 | // read one, write many
34 | float sample = *inputBuffer++;
35 | for (int channel = 0; channel < channelCount; channel++) {
36 | *outputBuffer++ = sample;
37 | }
38 | }
39 | return numFrames;
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MonoToMultiConverter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef FLOWGRAPH_MONO_TO_MULTI_CONVERTER_H
18 | #define FLOWGRAPH_MONO_TO_MULTI_CONVERTER_H
19 |
20 | #include
21 | #include
22 |
23 | #include "FlowGraphNode.h"
24 |
25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph {
26 |
27 | /**
28 | * Convert a monophonic stream to a multi-channel interleaved stream
29 | * with the same signal on each channel.
30 | */
31 | class MonoToMultiConverter : public FlowGraphNode {
32 | public:
33 | explicit MonoToMultiConverter(int32_t outputChannelCount);
34 |
35 | virtual ~MonoToMultiConverter() = default;
36 |
37 | int32_t onProcess(int32_t numFrames) override;
38 |
39 | const char *getName() override {
40 | return "MonoToMultiConverter";
41 | }
42 |
43 | FlowGraphPortFloatInput input;
44 | FlowGraphPortFloatOutput output;
45 | };
46 |
47 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */
48 |
49 | #endif //FLOWGRAPH_MONO_TO_MULTI_CONVERTER_H
50 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MultiToManyConverter.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include "FlowGraphNode.h"
19 | #include "MultiToManyConverter.h"
20 |
21 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph;
22 |
23 | MultiToManyConverter::MultiToManyConverter(int32_t channelCount)
24 | : outputs(channelCount)
25 | , input(*this, channelCount) {
26 | for (int i = 0; i < channelCount; i++) {
27 | outputs[i] = std::make_unique(*this, 1);
28 | }
29 | }
30 |
31 | MultiToManyConverter::~MultiToManyConverter() = default;
32 |
33 | int32_t MultiToManyConverter::onProcess(int32_t numFrames) {
34 | int32_t channelCount = input.getSamplesPerFrame();
35 |
36 | for (int ch = 0; ch < channelCount; ch++) {
37 | const float *inputBuffer = input.getBuffer() + ch;
38 | float *outputBuffer = outputs[ch]->getBuffer();
39 |
40 | for (int i = 0; i < numFrames; i++) {
41 | *outputBuffer++ = *inputBuffer;
42 | inputBuffer += channelCount;
43 | }
44 | }
45 |
46 | return numFrames;
47 | }
48 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MultiToManyConverter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2021 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef FLOWGRAPH_MULTI_TO_MANY_CONVERTER_H
18 | #define FLOWGRAPH_MULTI_TO_MANY_CONVERTER_H
19 |
20 | #include
21 | #include
22 |
23 | #include "FlowGraphNode.h"
24 |
25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph {
26 |
27 | /**
28 | * Convert a multi-channel interleaved stream to multiple mono-channel
29 | * outputs
30 | */
31 | class MultiToManyConverter : public FlowGraphNode {
32 | public:
33 | explicit MultiToManyConverter(int32_t channelCount);
34 |
35 | virtual ~MultiToManyConverter();
36 |
37 | int32_t onProcess(int32_t numFrames) override;
38 |
39 | const char *getName() override {
40 | return "MultiToManyConverter";
41 | }
42 |
43 | std::vector> outputs;
44 | flowgraph::FlowGraphPortFloatInput input;
45 | };
46 |
47 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */
48 |
49 | #endif //FLOWGRAPH_MULTI_TO_MANY_CONVERTER_H
50 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MultiToMonoConverter.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include "FlowGraphNode.h"
19 | #include "MultiToMonoConverter.h"
20 |
21 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph;
22 |
23 | MultiToMonoConverter::MultiToMonoConverter(int32_t inputChannelCount)
24 | : input(*this, inputChannelCount)
25 | , output(*this, 1) {
26 | }
27 |
28 | MultiToMonoConverter::~MultiToMonoConverter() = default;
29 |
30 | int32_t MultiToMonoConverter::onProcess(int32_t numFrames) {
31 | const float *inputBuffer = input.getBuffer();
32 | float *outputBuffer = output.getBuffer();
33 | int32_t channelCount = input.getSamplesPerFrame();
34 | for (int i = 0; i < numFrames; i++) {
35 | // read first channel of multi stream, write many
36 | *outputBuffer++ = *inputBuffer;
37 | inputBuffer += channelCount;
38 | }
39 | return numFrames;
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/MultiToMonoConverter.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2015 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef FLOWGRAPH_MULTI_TO_MONO_CONVERTER_H
18 | #define FLOWGRAPH_MULTI_TO_MONO_CONVERTER_H
19 |
20 | #include
21 | #include
22 |
23 | #include "FlowGraphNode.h"
24 |
25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph {
26 |
27 | /**
28 | * Convert a multi-channel interleaved stream to a monophonic stream
29 | * by extracting channel[0].
30 | */
31 | class MultiToMonoConverter : public FlowGraphNode {
32 | public:
33 | explicit MultiToMonoConverter(int32_t inputChannelCount);
34 |
35 | virtual ~MultiToMonoConverter();
36 |
37 | int32_t onProcess(int32_t numFrames) override;
38 |
39 | const char *getName() override {
40 | return "MultiToMonoConverter";
41 | }
42 |
43 | FlowGraphPortFloatInput input;
44 | FlowGraphPortFloatOutput output;
45 | };
46 |
47 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */
48 |
49 | #endif //FLOWGRAPH_MULTI_TO_MONO_CONVERTER_H
50 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SinkFloat.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 | #include "FlowGraphNode.h"
20 | #include "SinkFloat.h"
21 |
22 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph;
23 |
24 | SinkFloat::SinkFloat(int32_t channelCount)
25 | : FlowGraphSink(channelCount) {
26 | }
27 |
28 | int32_t SinkFloat::read(void *data, int32_t numFrames) {
29 | float *floatData = (float *) data;
30 | const int32_t channelCount = input.getSamplesPerFrame();
31 |
32 | int32_t framesLeft = numFrames;
33 | while (framesLeft > 0) {
34 | // Run the graph and pull data through the input port.
35 | int32_t framesPulled = pullData(framesLeft);
36 | if (framesPulled <= 0) {
37 | break;
38 | }
39 | const float *signal = input.getBuffer();
40 | int32_t numSamples = framesPulled * channelCount;
41 | memcpy(floatData, signal, numSamples * sizeof(float));
42 | floatData += numSamples;
43 | framesLeft -= framesPulled;
44 | }
45 | return numFrames - framesLeft;
46 | }
47 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SinkFloat.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 |
18 | #ifndef FLOWGRAPH_SINK_FLOAT_H
19 | #define FLOWGRAPH_SINK_FLOAT_H
20 |
21 | #include
22 | #include
23 |
24 | #include "FlowGraphNode.h"
25 |
26 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph {
27 |
28 | /**
29 | * AudioSink that lets you read data as 32-bit floats.
30 | */
31 | class SinkFloat : public FlowGraphSink {
32 | public:
33 | explicit SinkFloat(int32_t channelCount);
34 | ~SinkFloat() override = default;
35 |
36 | int32_t read(void *data, int32_t numFrames) override;
37 |
38 | const char *getName() override {
39 | return "SinkFloat";
40 | }
41 | };
42 |
43 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */
44 |
45 | #endif //FLOWGRAPH_SINK_FLOAT_H
46 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SinkI16.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 |
20 | #include "SinkI16.h"
21 |
22 | #if FLOWGRAPH_ANDROID_INTERNAL
23 | #include
24 | #endif
25 |
26 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph;
27 |
28 | SinkI16::SinkI16(int32_t channelCount)
29 | : FlowGraphSink(channelCount) {}
30 |
31 | int32_t SinkI16::read(void *data, int32_t numFrames) {
32 | int16_t *shortData = (int16_t *) data;
33 | const int32_t channelCount = input.getSamplesPerFrame();
34 |
35 | int32_t framesLeft = numFrames;
36 | while (framesLeft > 0) {
37 | // Run the graph and pull data through the input port.
38 | int32_t framesRead = pullData(framesLeft);
39 | if (framesRead <= 0) {
40 | break;
41 | }
42 | const float *signal = input.getBuffer();
43 | int32_t numSamples = framesRead * channelCount;
44 | #if FLOWGRAPH_ANDROID_INTERNAL
45 | memcpy_to_i16_from_float(shortData, signal, numSamples);
46 | shortData += numSamples;
47 | signal += numSamples;
48 | #else
49 | for (int i = 0; i < numSamples; i++) {
50 | int32_t n = (int32_t) (*signal++ * 32768.0f);
51 | *shortData++ = std::min(INT16_MAX, std::max(INT16_MIN, n)); // clip
52 | }
53 | #endif
54 | framesLeft -= framesRead;
55 | }
56 | return numFrames - framesLeft;
57 | }
58 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SinkI16.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef FLOWGRAPH_SINK_I16_H
18 | #define FLOWGRAPH_SINK_I16_H
19 |
20 | #include
21 | #include
22 |
23 | #include "FlowGraphNode.h"
24 |
25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph {
26 |
27 | /**
28 | * AudioSink that lets you read data as 16-bit signed integers.
29 | */
30 | class SinkI16 : public FlowGraphSink {
31 | public:
32 | explicit SinkI16(int32_t channelCount);
33 |
34 | int32_t read(void *data, int32_t numFrames) override;
35 |
36 | const char *getName() override {
37 | return "SinkI16";
38 | }
39 | };
40 |
41 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */
42 |
43 | #endif //FLOWGRAPH_SINK_I16_H
44 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SinkI24.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef FLOWGRAPH_SINK_I24_H
18 | #define FLOWGRAPH_SINK_I24_H
19 |
20 | #include
21 | #include
22 |
23 | #include "FlowGraphNode.h"
24 |
25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph {
26 |
27 | /**
28 | * AudioSink that lets you read data as packed 24-bit signed integers.
29 | * The sample size is 3 bytes.
30 | */
31 | class SinkI24 : public FlowGraphSink {
32 | public:
33 | explicit SinkI24(int32_t channelCount);
34 |
35 | int32_t read(void *data, int32_t numFrames) override;
36 |
37 | const char *getName() override {
38 | return "SinkI24";
39 | }
40 | };
41 |
42 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */
43 |
44 | #endif //FLOWGRAPH_SINK_I24_H
45 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SinkI32.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include "FlowGraphNode.h"
18 | #include "FlowgraphUtilities.h"
19 | #include "SinkI32.h"
20 |
21 | #if FLOWGRAPH_ANDROID_INTERNAL
22 | #include
23 | #endif
24 |
25 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph;
26 |
27 | SinkI32::SinkI32(int32_t channelCount)
28 | : FlowGraphSink(channelCount) {}
29 |
30 | int32_t SinkI32::read(void *data, int32_t numFrames) {
31 | int32_t *intData = (int32_t *) data;
32 | const int32_t channelCount = input.getSamplesPerFrame();
33 |
34 | int32_t framesLeft = numFrames;
35 | while (framesLeft > 0) {
36 | // Run the graph and pull data through the input port.
37 | int32_t framesRead = pullData(framesLeft);
38 | if (framesRead <= 0) {
39 | break;
40 | }
41 | const float *signal = input.getBuffer();
42 | int32_t numSamples = framesRead * channelCount;
43 | #if FLOWGRAPH_ANDROID_INTERNAL
44 | memcpy_to_i32_from_float(intData, signal, numSamples);
45 | intData += numSamples;
46 | signal += numSamples;
47 | #else
48 | for (int i = 0; i < numSamples; i++) {
49 | *intData++ = FlowgraphUtilities::clamp32FromFloat(*signal++);
50 | }
51 | #endif
52 | framesLeft -= framesRead;
53 | }
54 | return numFrames - framesLeft;
55 | }
56 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SinkI32.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef FLOWGRAPH_SINK_I32_H
18 | #define FLOWGRAPH_SINK_I32_H
19 |
20 | #include
21 |
22 | #include "FlowGraphNode.h"
23 |
24 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph {
25 |
26 | class SinkI32 : public FlowGraphSink {
27 | public:
28 | explicit SinkI32(int32_t channelCount);
29 | ~SinkI32() override = default;
30 |
31 | int32_t read(void *data, int32_t numFrames) override;
32 |
33 | const char *getName() override {
34 | return "SinkI32";
35 | }
36 | };
37 |
38 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */
39 |
40 | #endif //FLOWGRAPH_SINK_I32_H
41 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SourceFloat.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 | #include "FlowGraphNode.h"
20 | #include "SourceFloat.h"
21 |
22 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph;
23 |
24 | SourceFloat::SourceFloat(int32_t channelCount)
25 | : FlowGraphSourceBuffered(channelCount) {
26 | }
27 |
28 | int32_t SourceFloat::onProcess(int32_t numFrames) {
29 | float *outputBuffer = output.getBuffer();
30 | const int32_t channelCount = output.getSamplesPerFrame();
31 |
32 | const int32_t framesLeft = mSizeInFrames - mFrameIndex;
33 | const int32_t framesToProcess = std::min(numFrames, framesLeft);
34 | const int32_t numSamples = framesToProcess * channelCount;
35 |
36 | const float *floatBase = (float *) mData;
37 | const float *floatData = &floatBase[mFrameIndex * channelCount];
38 | memcpy(outputBuffer, floatData, numSamples * sizeof(float));
39 | mFrameIndex += framesToProcess;
40 | return framesToProcess;
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SourceFloat.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef FLOWGRAPH_SOURCE_FLOAT_H
18 | #define FLOWGRAPH_SOURCE_FLOAT_H
19 |
20 | #include
21 | #include
22 |
23 | #include "FlowGraphNode.h"
24 |
25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph {
26 |
27 | /**
28 | * AudioSource that reads a block of pre-defined float data.
29 | */
30 | class SourceFloat : public FlowGraphSourceBuffered {
31 | public:
32 | explicit SourceFloat(int32_t channelCount);
33 | ~SourceFloat() override = default;
34 |
35 | int32_t onProcess(int32_t numFrames) override;
36 |
37 | const char *getName() override {
38 | return "SourceFloat";
39 | }
40 | };
41 |
42 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */
43 |
44 | #endif //FLOWGRAPH_SOURCE_FLOAT_H
45 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SourceI16.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 |
20 | #include "FlowGraphNode.h"
21 | #include "SourceI16.h"
22 |
23 | #if FLOWGRAPH_ANDROID_INTERNAL
24 | #include
25 | #endif
26 |
27 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph;
28 |
29 | SourceI16::SourceI16(int32_t channelCount)
30 | : FlowGraphSourceBuffered(channelCount) {
31 | }
32 |
33 | int32_t SourceI16::onProcess(int32_t numFrames) {
34 | float *floatData = output.getBuffer();
35 | int32_t channelCount = output.getSamplesPerFrame();
36 |
37 | int32_t framesLeft = mSizeInFrames - mFrameIndex;
38 | int32_t framesToProcess = std::min(numFrames, framesLeft);
39 | int32_t numSamples = framesToProcess * channelCount;
40 |
41 | const int16_t *shortBase = static_cast(mData);
42 | const int16_t *shortData = &shortBase[mFrameIndex * channelCount];
43 |
44 | #if FLOWGRAPH_ANDROID_INTERNAL
45 | memcpy_to_float_from_i16(floatData, shortData, numSamples);
46 | #else
47 | for (int i = 0; i < numSamples; i++) {
48 | *floatData++ = *shortData++ * (1.0f / 32768);
49 | }
50 | #endif
51 |
52 | mFrameIndex += framesToProcess;
53 | return framesToProcess;
54 | }
55 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SourceI16.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef FLOWGRAPH_SOURCE_I16_H
18 | #define FLOWGRAPH_SOURCE_I16_H
19 |
20 | #include
21 | #include
22 |
23 | #include "FlowGraphNode.h"
24 |
25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph {
26 | /**
27 | * AudioSource that reads a block of pre-defined 16-bit integer data.
28 | */
29 | class SourceI16 : public FlowGraphSourceBuffered {
30 | public:
31 | explicit SourceI16(int32_t channelCount);
32 |
33 | int32_t onProcess(int32_t numFrames) override;
34 |
35 | const char *getName() override {
36 | return "SourceI16";
37 | }
38 | };
39 |
40 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */
41 |
42 | #endif //FLOWGRAPH_SOURCE_I16_H
43 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SourceI24.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef FLOWGRAPH_SOURCE_I24_H
18 | #define FLOWGRAPH_SOURCE_I24_H
19 |
20 | #include
21 | #include
22 |
23 | #include "FlowGraphNode.h"
24 |
25 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph {
26 |
27 | /**
28 | * AudioSource that reads a block of pre-defined 24-bit packed integer data.
29 | */
30 | class SourceI24 : public FlowGraphSourceBuffered {
31 | public:
32 | explicit SourceI24(int32_t channelCount);
33 |
34 | int32_t onProcess(int32_t numFrames) override;
35 |
36 | const char *getName() override {
37 | return "SourceI24";
38 | }
39 | };
40 |
41 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */
42 |
43 | #endif //FLOWGRAPH_SOURCE_I24_H
44 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SourceI32.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include
18 | #include
19 |
20 | #include "FlowGraphNode.h"
21 | #include "SourceI32.h"
22 |
23 | #if FLOWGRAPH_ANDROID_INTERNAL
24 | #include
25 | #endif
26 |
27 | using namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph;
28 |
29 | SourceI32::SourceI32(int32_t channelCount)
30 | : FlowGraphSourceBuffered(channelCount) {
31 | }
32 |
33 | int32_t SourceI32::onProcess(int32_t numFrames) {
34 | float *floatData = output.getBuffer();
35 | const int32_t channelCount = output.getSamplesPerFrame();
36 |
37 | const int32_t framesLeft = mSizeInFrames - mFrameIndex;
38 | const int32_t framesToProcess = std::min(numFrames, framesLeft);
39 | const int32_t numSamples = framesToProcess * channelCount;
40 |
41 | const int32_t *intBase = static_cast(mData);
42 | const int32_t *intData = &intBase[mFrameIndex * channelCount];
43 |
44 | #if FLOWGRAPH_ANDROID_INTERNAL
45 | memcpy_to_float_from_i32(floatData, intData, numSamples);
46 | #else
47 | for (int i = 0; i < numSamples; i++) {
48 | *floatData++ = *intData++ * kScale;
49 | }
50 | #endif
51 |
52 | mFrameIndex += framesToProcess;
53 | return framesToProcess;
54 | }
55 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/SourceI32.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef FLOWGRAPH_SOURCE_I32_H
18 | #define FLOWGRAPH_SOURCE_I32_H
19 |
20 | #include
21 |
22 | #include "FlowGraphNode.h"
23 |
24 | namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph {
25 |
26 | class SourceI32 : public FlowGraphSourceBuffered {
27 | public:
28 | explicit SourceI32(int32_t channelCount);
29 | ~SourceI32() override = default;
30 |
31 | int32_t onProcess(int32_t numFrames) override;
32 |
33 | const char *getName() override {
34 | return "SourceI32";
35 | }
36 | private:
37 | static constexpr float kScale = 1.0 / (1UL << 31);
38 | };
39 |
40 | } /* namespace FLOWGRAPH_OUTER_NAMESPACE::flowgraph */
41 |
42 | #endif //FLOWGRAPH_SOURCE_I32_H
43 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/IntegerRatio.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include "IntegerRatio.h"
18 |
19 | using namespace RESAMPLER_OUTER_NAMESPACE::resampler;
20 |
21 | // Enough primes to cover the common sample rates.
22 | static const int kPrimes[] = {
23 | 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41,
24 | 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97,
25 | 101, 103, 107, 109, 113, 127, 131, 137, 139, 149,
26 | 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199};
27 |
28 | void IntegerRatio::reduce() {
29 | for (int prime : kPrimes) {
30 | if (mNumerator < prime || mDenominator < prime) {
31 | break;
32 | }
33 |
34 | // Find biggest prime factor for numerator.
35 | while (true) {
36 | int top = mNumerator / prime;
37 | int bottom = mDenominator / prime;
38 | if ((top >= 1)
39 | && (bottom >= 1)
40 | && (top * prime == mNumerator) // divided evenly?
41 | && (bottom * prime == mDenominator)) {
42 | mNumerator = top;
43 | mDenominator = bottom;
44 | } else {
45 | break;
46 | }
47 | }
48 |
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/IntegerRatio.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef RESAMPLER_INTEGER_RATIO_H
18 | #define RESAMPLER_INTEGER_RATIO_H
19 |
20 | #include
21 |
22 | #include "ResamplerDefinitions.h"
23 |
24 | namespace RESAMPLER_OUTER_NAMESPACE::resampler {
25 |
26 | /**
27 | * Represent the ratio of two integers.
28 | */
29 | class IntegerRatio {
30 | public:
31 | IntegerRatio(int32_t numerator, int32_t denominator)
32 | : mNumerator(numerator), mDenominator(denominator) {}
33 |
34 | /**
35 | * Reduce by removing common prime factors.
36 | */
37 | void reduce();
38 |
39 | int32_t getNumerator() {
40 | return mNumerator;
41 | }
42 |
43 | int32_t getDenominator() {
44 | return mDenominator;
45 | }
46 |
47 | private:
48 | int32_t mNumerator;
49 | int32_t mDenominator;
50 | };
51 |
52 | } /* namespace RESAMPLER_OUTER_NAMESPACE::resampler */
53 |
54 | #endif //RESAMPLER_INTEGER_RATIO_H
55 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/LinearResampler.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #include "LinearResampler.h"
18 |
19 | using namespace RESAMPLER_OUTER_NAMESPACE::resampler;
20 |
21 | LinearResampler::LinearResampler(const MultiChannelResampler::Builder &builder)
22 | : MultiChannelResampler(builder) {
23 | mPreviousFrame = std::make_unique(getChannelCount());
24 | mCurrentFrame = std::make_unique(getChannelCount());
25 | }
26 |
27 | void LinearResampler::writeFrame(const float *frame) {
28 | memcpy(mPreviousFrame.get(), mCurrentFrame.get(), sizeof(float) * getChannelCount());
29 | memcpy(mCurrentFrame.get(), frame, sizeof(float) * getChannelCount());
30 | }
31 |
32 | void LinearResampler::readFrame(float *frame) {
33 | float *previous = mPreviousFrame.get();
34 | float *current = mCurrentFrame.get();
35 | float phase = (float) getIntegerPhase() / mDenominator;
36 | // iterate across samples in the frame
37 | for (int channel = 0; channel < getChannelCount(); channel++) {
38 | float f0 = *previous++;
39 | float f1 = *current++;
40 | *frame++ = f0 + (phase * (f1 - f0));
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/LinearResampler.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef RESAMPLER_LINEAR_RESAMPLER_H
18 | #define RESAMPLER_LINEAR_RESAMPLER_H
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | #include "MultiChannelResampler.h"
25 | #include "ResamplerDefinitions.h"
26 |
27 | namespace RESAMPLER_OUTER_NAMESPACE::resampler {
28 |
29 | /**
30 | * Simple resampler that uses bi-linear interpolation.
31 | */
32 | class LinearResampler : public MultiChannelResampler {
33 | public:
34 | explicit LinearResampler(const MultiChannelResampler::Builder &builder);
35 |
36 | void writeFrame(const float *frame) override;
37 |
38 | void readFrame(float *frame) override;
39 |
40 | private:
41 | std::unique_ptr mPreviousFrame;
42 | std::unique_ptr mCurrentFrame;
43 | };
44 |
45 | } /* namespace RESAMPLER_OUTER_NAMESPACE::resampler */
46 |
47 | #endif //RESAMPLER_LINEAR_RESAMPLER_H
48 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/PolyphaseResampler.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef RESAMPLER_POLYPHASE_RESAMPLER_H
18 | #define RESAMPLER_POLYPHASE_RESAMPLER_H
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | #include "MultiChannelResampler.h"
26 | #include "ResamplerDefinitions.h"
27 |
28 | namespace RESAMPLER_OUTER_NAMESPACE::resampler {
29 | /**
30 | * Resampler that is optimized for a reduced ratio of sample rates.
31 | * All of the coefficients for each possible phase value are pre-calculated.
32 | */
33 | class PolyphaseResampler : public MultiChannelResampler {
34 | public:
35 | /**
36 | *
37 | * @param builder containing lots of parameters
38 | */
39 | explicit PolyphaseResampler(const MultiChannelResampler::Builder &builder);
40 |
41 | virtual ~PolyphaseResampler() = default;
42 |
43 | void readFrame(float *frame) override;
44 |
45 | protected:
46 |
47 | int32_t mCoefficientCursor = 0;
48 |
49 | };
50 |
51 | } /* namespace RESAMPLER_OUTER_NAMESPACE::resampler */
52 |
53 | #endif //RESAMPLER_POLYPHASE_RESAMPLER_H
54 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/PolyphaseResamplerMono.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef RESAMPLER_POLYPHASE_RESAMPLER_MONO_H
18 | #define RESAMPLER_POLYPHASE_RESAMPLER_MONO_H
19 |
20 | #include
21 | #include
22 |
23 | #include "PolyphaseResampler.h"
24 | #include "ResamplerDefinitions.h"
25 |
26 | namespace RESAMPLER_OUTER_NAMESPACE::resampler {
27 |
28 | class PolyphaseResamplerMono : public PolyphaseResampler {
29 | public:
30 | explicit PolyphaseResamplerMono(const MultiChannelResampler::Builder &builder);
31 |
32 | virtual ~PolyphaseResamplerMono() = default;
33 |
34 | void writeFrame(const float *frame) override;
35 |
36 | void readFrame(float *frame) override;
37 | };
38 |
39 | } /* namespace RESAMPLER_OUTER_NAMESPACE::resampler */
40 |
41 | #endif //RESAMPLER_POLYPHASE_RESAMPLER_MONO_H
42 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/PolyphaseResamplerStereo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef RESAMPLER_POLYPHASE_RESAMPLER_STEREO_H
18 | #define RESAMPLER_POLYPHASE_RESAMPLER_STEREO_H
19 |
20 | #include
21 | #include
22 |
23 | #include "PolyphaseResampler.h"
24 | #include "ResamplerDefinitions.h"
25 |
26 | namespace RESAMPLER_OUTER_NAMESPACE::resampler {
27 |
28 | class PolyphaseResamplerStereo : public PolyphaseResampler {
29 | public:
30 | explicit PolyphaseResamplerStereo(const MultiChannelResampler::Builder &builder);
31 |
32 | virtual ~PolyphaseResamplerStereo() = default;
33 |
34 | void writeFrame(const float *frame) override;
35 |
36 | void readFrame(float *frame) override;
37 | };
38 |
39 | } /* namespace RESAMPLER_OUTER_NAMESPACE::resampler */
40 |
41 | #endif //RESAMPLER_POLYPHASE_RESAMPLER_STEREO_H
42 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/ResamplerDefinitions.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2022 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | // Set flag RESAMPLER_OUTER_NAMESPACE based on whether compiler flag
18 | // __ANDROID_NDK__ is defined. __ANDROID_NDK__ should be defined in oboe
19 | // but not in android.
20 |
21 | #ifndef RESAMPLER_OUTER_NAMESPACE
22 | #ifdef __ANDROID_NDK__
23 | #define RESAMPLER_OUTER_NAMESPACE oboe
24 | #else
25 | #define RESAMPLER_OUTER_NAMESPACE aaudio
26 | #endif // __ANDROID_NDK__
27 | #endif // RESAMPLER_OUTER_NAMESPACE
28 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/SincResampler.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef RESAMPLER_SINC_RESAMPLER_H
18 | #define RESAMPLER_SINC_RESAMPLER_H
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | #include "MultiChannelResampler.h"
25 | #include "ResamplerDefinitions.h"
26 |
27 | namespace RESAMPLER_OUTER_NAMESPACE::resampler {
28 |
29 | /**
30 | * Resampler that can interpolate between coefficients.
31 | * This can be used to support arbitrary ratios.
32 | */
33 | class SincResampler : public MultiChannelResampler {
34 | public:
35 | explicit SincResampler(const MultiChannelResampler::Builder &builder);
36 |
37 | virtual ~SincResampler() = default;
38 |
39 | void readFrame(float *frame) override;
40 |
41 | protected:
42 |
43 | std::vector mSingleFrame2; // for interpolation
44 | int32_t mNumRows = 0;
45 | double mPhaseScaler = 1.0;
46 | };
47 |
48 | } /* namespace RESAMPLER_OUTER_NAMESPACE::resampler */
49 |
50 | #endif //RESAMPLER_SINC_RESAMPLER_H
51 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/flowgraph/resampler/SincResamplerStereo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef RESAMPLER_SINC_RESAMPLER_STEREO_H
18 | #define RESAMPLER_SINC_RESAMPLER_STEREO_H
19 |
20 | #include
21 | #include
22 |
23 | #include "SincResampler.h"
24 | #include "ResamplerDefinitions.h"
25 |
26 | namespace RESAMPLER_OUTER_NAMESPACE::resampler {
27 |
28 | class SincResamplerStereo : public SincResampler {
29 | public:
30 | explicit SincResamplerStereo(const MultiChannelResampler::Builder &builder);
31 |
32 | virtual ~SincResamplerStereo() = default;
33 |
34 | void writeFrame(const float *frame) override;
35 |
36 | void readFrame(float *frame) override;
37 |
38 | };
39 |
40 | } /* namespace RESAMPLER_OUTER_NAMESPACE::resampler */
41 |
42 | #endif //RESAMPLER_SINC_RESAMPLER_STEREO_H
43 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/opensles/AudioInputStreamOpenSLES.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef AUDIO_INPUT_STREAM_OPENSL_ES_H_
18 | #define AUDIO_INPUT_STREAM_OPENSL_ES_H_
19 |
20 |
21 | #include
22 | #include
23 |
24 | #include "oboe/Oboe.h"
25 | #include "AudioStreamOpenSLES.h"
26 |
27 | namespace oboe {
28 |
29 | /**
30 | * INTERNAL USE ONLY
31 | */
32 |
33 | class AudioInputStreamOpenSLES : public AudioStreamOpenSLES {
34 | public:
35 | AudioInputStreamOpenSLES();
36 | explicit AudioInputStreamOpenSLES(const AudioStreamBuilder &builder);
37 |
38 | virtual ~AudioInputStreamOpenSLES();
39 |
40 | Result open() override;
41 | Result close() override;
42 |
43 | Result requestStart() override;
44 | Result requestPause() override;
45 | Result requestFlush() override;
46 | Result requestStop() override;
47 |
48 | protected:
49 | Result requestStop_l();
50 |
51 | Result updateServiceFrameCounter() override;
52 |
53 | void updateFramesWritten() override;
54 |
55 | private:
56 |
57 | SLuint32 channelCountToChannelMask(int chanCount) const;
58 |
59 | Result setRecordState_l(SLuint32 newState);
60 |
61 | SLRecordItf mRecordInterface = nullptr;
62 | };
63 |
64 | } // namespace oboe
65 |
66 | #endif //AUDIO_INPUT_STREAM_OPENSL_ES_H_
67 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/opensles/EngineOpenSLES.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef OBOE_ENGINE_OPENSLES_H
18 | #define OBOE_ENGINE_OPENSLES_H
19 |
20 | #include
21 | #include
22 |
23 | #include
24 | #include
25 |
26 | namespace oboe {
27 |
28 | /**
29 | * INTERNAL USE ONLY
30 | */
31 | class EngineOpenSLES {
32 | public:
33 | static EngineOpenSLES &getInstance();
34 |
35 | SLresult open();
36 |
37 | void close();
38 |
39 | SLresult createOutputMix(SLObjectItf *objectItf);
40 |
41 | SLresult createAudioPlayer(SLObjectItf *objectItf,
42 | SLDataSource *audioSource,
43 | SLDataSink *audioSink);
44 | SLresult createAudioRecorder(SLObjectItf *objectItf,
45 | SLDataSource *audioSource,
46 | SLDataSink *audioSink);
47 |
48 | private:
49 | // Make this a safe Singleton
50 | EngineOpenSLES()= default;
51 | ~EngineOpenSLES()= default;
52 | EngineOpenSLES(const EngineOpenSLES&)= delete;
53 | EngineOpenSLES& operator=(const EngineOpenSLES&)= delete;
54 |
55 | std::mutex mLock;
56 | int32_t mOpenCount = 0;
57 |
58 | SLObjectItf mEngineObject = nullptr;
59 | SLEngineItf mEngineInterface = nullptr;
60 | };
61 |
62 | } // namespace oboe
63 |
64 |
65 | #endif //OBOE_ENGINE_OPENSLES_H
66 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/opensles/OpenSLESUtilities.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef OBOE_OPENSLES_OPENSLESUTILITIES_H
18 | #define OBOE_OPENSLES_OPENSLESUTILITIES_H
19 |
20 | #include
21 | #include "oboe/Oboe.h"
22 |
23 | namespace oboe {
24 |
25 | const char *getSLErrStr(SLresult code);
26 |
27 | /**
28 | * Creates an extended PCM format from the supplied format and data representation. This method
29 | * should only be called on Android devices with API level 21+. API 21 introduced the
30 | * SLAndroidDataFormat_PCM_EX object which allows audio samples to be represented using
31 | * single precision floating-point.
32 | *
33 | * @param format
34 | * @param representation
35 | * @return the extended PCM format
36 | */
37 | SLAndroidDataFormat_PCM_EX OpenSLES_createExtendedFormat(SLDataFormat_PCM format,
38 | SLuint32 representation);
39 |
40 | SLuint32 OpenSLES_ConvertFormatToRepresentation(AudioFormat format);
41 |
42 | } // namespace oboe
43 |
44 | #endif //OBOE_OPENSLES_OPENSLESUTILITIES_H
45 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_audio_devices/native/oboe/src/opensles/OutputMixerOpenSLES.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2017 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | #ifndef OBOE_OUTPUT_MIXER_OPENSLES_H
18 | #define OBOE_OUTPUT_MIXER_OPENSLES_H
19 |
20 | #include
21 | #include
22 |
23 | #include
24 | #include
25 |
26 | namespace oboe {
27 |
28 | /**
29 | * INTERNAL USE ONLY
30 | */
31 |
32 | class OutputMixerOpenSL {
33 | public:
34 | static OutputMixerOpenSL &getInstance();
35 |
36 | SLresult open();
37 |
38 | void close();
39 |
40 | SLresult createAudioPlayer(SLObjectItf *objectItf,
41 | SLDataSource *audioSource);
42 |
43 | private:
44 | // Make this a safe Singleton
45 | OutputMixerOpenSL()= default;
46 | ~OutputMixerOpenSL()= default;
47 | OutputMixerOpenSL(const OutputMixerOpenSL&)= delete;
48 | OutputMixerOpenSL& operator=(const OutputMixerOpenSL&)= delete;
49 |
50 | std::mutex mLock;
51 | int32_t mOpenCount = 0;
52 |
53 | SLObjectItf mOutputMixObject = nullptr;
54 | };
55 |
56 | } // namespace oboe
57 |
58 | #endif //OBOE_OUTPUT_MIXER_OPENSLES_H
59 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_core/files/juce_FileFilter.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | FileFilter::FileFilter (const String& filterDescription)
27 | : description (filterDescription)
28 | {
29 | }
30 |
31 | FileFilter::~FileFilter()
32 | {
33 | }
34 |
35 | const String& FileFilter::getDescription() const noexcept
36 | {
37 | return description;
38 | }
39 |
40 | } // namespace juce
41 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_core/files/juce_common_MimeTypes.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | #pragma once
24 |
25 | namespace juce::detail
26 | {
27 |
28 | struct MimeTypeTable
29 | {
30 | static void registerCustomMimeTypeForFileExtension (const String& mimeType, const String& fileExtension);
31 |
32 | static StringArray getMimeTypesForFileExtension (const String& fileExtension);
33 |
34 | static StringArray getFileExtensionsForMimeType (const String& mimeType);
35 | };
36 |
37 | } // namespace juce::detail
38 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_core/juce_core.mm:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | #include "juce_core.cpp"
24 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_core/misc/juce_RuntimePermissions.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | #if ! JUCE_ANDROID // We currently don't request runtime permissions on any other platform
27 | // than Android, so this file contains a dummy implementation for those.
28 | // This may change in the future.
29 |
30 | void RuntimePermissions::request (PermissionID, Callback callback) { callback (true); }
31 | bool RuntimePermissions::isRequired (PermissionID) { return false; }
32 | bool RuntimePermissions::isGranted (PermissionID) { return true; }
33 |
34 | #endif
35 |
36 | } // namespace juce
37 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_core/misc/juce_ScopeGuard.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | ErasedScopeGuard::ErasedScopeGuard (std::function d)
27 | : detach (std::move (d)) {}
28 |
29 | ErasedScopeGuard::ErasedScopeGuard (ErasedScopeGuard&& other) noexcept
30 | : detach (std::exchange (other.detach, nullptr)) {}
31 |
32 | ErasedScopeGuard& ErasedScopeGuard::operator= (ErasedScopeGuard&& other) noexcept
33 | {
34 | ErasedScopeGuard token { std::move (other) };
35 | std::swap (token.detach, detach);
36 | return *this;
37 | }
38 |
39 | ErasedScopeGuard::~ErasedScopeGuard() noexcept
40 | {
41 | reset();
42 | }
43 |
44 | void ErasedScopeGuard::reset()
45 | {
46 | if (auto d = std::exchange (detach, nullptr))
47 | d();
48 | }
49 |
50 | void ErasedScopeGuard::release()
51 | {
52 | detach = nullptr;
53 | }
54 |
55 | } // namespace juce
56 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_core/native/javacore/app/com/rmsl/juce/JuceApp.java:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | package com.rmsl.juce;
24 |
25 | import com.rmsl.juce.Java;
26 |
27 | import android.app.Application;
28 |
29 | public class JuceApp extends Application
30 | {
31 | @Override
32 | public void onCreate()
33 | {
34 | super.onCreate();
35 | Java.initialiseJUCE (this);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_core/native/javacore/init/com/rmsl/juce/Java.java:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | package com.rmsl.juce;
24 |
25 | import android.content.Context;
26 |
27 | public class Java
28 | {
29 | static
30 | {
31 | System.loadLibrary ("juce_jni");
32 | }
33 |
34 | public native static void initialiseJUCE (Context appContext);
35 | }
36 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_core/native/juce_Misc_android.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | void Logger::outputDebugString (const String& text)
27 | {
28 | char* data = text.toUTF8().getAddress();
29 | const size_t length = CharPointer_UTF8::getBytesRequiredFor (text.getCharPointer());
30 | const size_t chunkSize = 1023;
31 |
32 | size_t position = 0;
33 | size_t numToRead = jmin (chunkSize, length);
34 |
35 | while (numToRead > 0)
36 | {
37 | __android_log_print (ANDROID_LOG_INFO, "JUCE", "%s", data + position);
38 |
39 | position += numToRead;
40 | numToRead = jmin (chunkSize, length - position);
41 | }
42 | }
43 |
44 | } // namespace juce
45 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_core/native/juce_PlatformTimerListener.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | struct PlatformTimerListener
27 | {
28 | virtual ~PlatformTimerListener() = default;
29 | virtual void onTimerExpired() = 0;
30 | };
31 |
32 | } // namespace juce
33 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_core/native/juce_Process_mac.mm:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 | namespace juce
23 | {
24 |
25 | #if JUCE_MAC
26 | void Process::setDockIconVisible (bool isVisible)
27 | {
28 | ProcessSerialNumber psn { 0, kCurrentProcess };
29 |
30 | [[maybe_unused]] OSStatus err = TransformProcessType (&psn, isVisible ? kProcessTransformToForegroundApplication
31 | : kProcessTransformToUIElementApplication);
32 | jassert (err == 0);
33 | }
34 | #endif
35 |
36 | } // namespace juce
37 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_core/streams/juce_FileInputSource.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | FileInputSource::FileInputSource (const File& f, bool useFileTimeInHash)
27 | : file (f), useFileTimeInHashGeneration (useFileTimeInHash)
28 | {
29 | }
30 |
31 | FileInputSource::~FileInputSource()
32 | {
33 | }
34 |
35 | InputStream* FileInputSource::createInputStream()
36 | {
37 | return file.createInputStream().release();
38 | }
39 |
40 | InputStream* FileInputSource::createInputStreamFor (const String& relatedItemPath)
41 | {
42 | return file.getSiblingFile (relatedItemPath).createInputStream().release();
43 | }
44 |
45 | int64 FileInputSource::hashCode() const
46 | {
47 | int64 h = file.hashCode();
48 |
49 | if (useFileTimeInHashGeneration)
50 | h ^= file.getLastModificationTime().toMilliseconds();
51 |
52 | return h;
53 | }
54 |
55 | } // namespace juce
56 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_core/streams/juce_URLInputSource.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | URLInputSource::URLInputSource (const URL& url)
27 | : u (url)
28 | {
29 | }
30 |
31 | URLInputSource::URLInputSource (URL&& url)
32 | : u (std::move (url))
33 | {
34 | }
35 |
36 | URLInputSource::~URLInputSource()
37 | {
38 | }
39 |
40 | InputStream* URLInputSource::createInputStream()
41 | {
42 | return u.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress)).release();
43 | }
44 |
45 | InputStream* URLInputSource::createInputStreamFor (const String& relatedItemPath)
46 | {
47 | auto sub = u.getSubPath();
48 | auto parent = sub.containsChar (L'/') ? sub.upToLastOccurrenceOf ("/", false, false)
49 | : String();
50 |
51 | return u.withNewSubPath (parent)
52 | .getChildURL (relatedItemPath)
53 | .createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress))
54 | .release();
55 | }
56 |
57 | int64 URLInputSource::hashCode() const
58 | {
59 | return u.toString (true).hashCode64();
60 | }
61 |
62 | } // namespace juce
63 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_core/streams/juce_URLInputSource.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | //==============================================================================
27 | /**
28 | A type of InputSource that represents a URL.
29 |
30 | @see InputSource
31 |
32 | @tags{Core}
33 | */
34 | class JUCE_API URLInputSource : public InputSource
35 | {
36 | public:
37 | //==============================================================================
38 | /** Creates a URLInputSource for a url. */
39 | URLInputSource (const URL& url);
40 |
41 | /** Move constructor which will move the URL into the InputSource.
42 |
43 | This is useful when the url carries any security credentials.
44 | */
45 | URLInputSource (URL&& url);
46 |
47 | /** Destructor. */
48 | ~URLInputSource() override;
49 |
50 | InputStream* createInputStream() override;
51 | InputStream* createInputStreamFor (const String& relatedItemPath) override;
52 | int64 hashCode() const override;
53 |
54 | private:
55 | //==============================================================================
56 | const URL u;
57 |
58 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (URLInputSource)
59 | };
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_core/threads/juce_WaitableEvent.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | WaitableEvent::WaitableEvent (bool manualReset) noexcept
27 | : useManualReset (manualReset)
28 | {
29 | }
30 |
31 | bool WaitableEvent::wait (double timeOutMilliseconds) const
32 | {
33 | std::unique_lock lock (mutex);
34 |
35 | if (! triggered)
36 | {
37 | if (timeOutMilliseconds < 0.0)
38 | {
39 | condition.wait (lock, [this] { return triggered == true; });
40 | }
41 | else
42 | {
43 | if (! condition.wait_for (lock, std::chrono::duration { timeOutMilliseconds },
44 | [this] { return triggered == true; }))
45 | {
46 | return false;
47 | }
48 | }
49 | }
50 |
51 | if (! useManualReset)
52 | reset();
53 |
54 | return true;
55 | }
56 |
57 | void WaitableEvent::signal() const
58 | {
59 | std::lock_guard lock (mutex);
60 |
61 | triggered = true;
62 | condition.notify_all();
63 | }
64 |
65 | void WaitableEvent::reset() const
66 | {
67 | triggered = false;
68 | }
69 |
70 | } // namespace juce
71 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_core/zip/zlib/inffast.h:
--------------------------------------------------------------------------------
1 | /* inffast.h -- header to use inffast.c
2 | * Copyright (C) 1995-2003 Mark Adler
3 | * For conditions of distribution and use, see copyright notice in zlib.h
4 | */
5 |
6 | /* WARNING: this file should *not* be used by applications. It is
7 | part of the implementation of the compression library and is
8 | subject to change. Applications should only use zlib.h.
9 | */
10 |
11 | void inflate_fast OF((z_streamp strm, unsigned start));
12 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_data_structures/juce_data_structures.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 | Agreement and JUCE Privacy Policy.
12 |
13 | End User License Agreement: www.juce.com/juce-7-licence
14 | Privacy Policy: www.juce.com/juce-privacy-policy
15 |
16 | Or: You may also use this code under the terms of the GPL v3 (see
17 | www.gnu.org/licenses).
18 |
19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 | DISCLAIMED.
22 |
23 | ==============================================================================
24 | */
25 |
26 | #ifdef JUCE_DATA_STRUCTURES_H_INCLUDED
27 | /* When you add this cpp file to your project, you mustn't include it in a file where you've
28 | already included any other headers - just put it inside a file on its own, possibly with your config
29 | flags preceding it, but don't include anything else. That also includes avoiding any automatic prefix
30 | header files that the compiler may be using.
31 | */
32 | #error "Incorrect use of JUCE cpp file"
33 | #endif
34 |
35 | #include "juce_data_structures.h"
36 |
37 | #include "values/juce_Value.cpp"
38 | #include "values/juce_ValueTree.cpp"
39 | #include "values/juce_ValueTreeSynchroniser.cpp"
40 | #include "values/juce_CachedValue.cpp"
41 | #include "undomanager/juce_UndoManager.cpp"
42 | #include "undomanager/juce_UndoableAction.cpp"
43 | #include "app_properties/juce_ApplicationProperties.cpp"
44 | #include "app_properties/juce_PropertiesFile.cpp"
45 |
46 | #if JUCE_UNIT_TESTS
47 | #include "values/juce_ValueTreePropertyWithDefault_test.cpp"
48 | #endif
49 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_data_structures/juce_data_structures.mm:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 | Agreement and JUCE Privacy Policy.
12 |
13 | End User License Agreement: www.juce.com/juce-7-licence
14 | Privacy Policy: www.juce.com/juce-privacy-policy
15 |
16 | Or: You may also use this code under the terms of the GPL v3 (see
17 | www.gnu.org/licenses).
18 |
19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 | DISCLAIMED.
22 |
23 | ==============================================================================
24 | */
25 |
26 | #include "juce_data_structures.cpp"
27 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_data_structures/undomanager/juce_UndoableAction.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 | Agreement and JUCE Privacy Policy.
12 |
13 | End User License Agreement: www.juce.com/juce-7-licence
14 | Privacy Policy: www.juce.com/juce-privacy-policy
15 |
16 | Or: You may also use this code under the terms of the GPL v3 (see
17 | www.gnu.org/licenses).
18 |
19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 | DISCLAIMED.
22 |
23 | ==============================================================================
24 | */
25 |
26 | namespace juce
27 | {
28 |
29 | UndoableAction* UndoableAction::createCoalescedAction ([[maybe_unused]] UndoableAction* nextAction) { return nullptr; }
30 |
31 | } // namespace juce
32 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_events/broadcasters/juce_ActionListener.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | //==============================================================================
27 | /**
28 | Interface class for delivery of events that are sent by an ActionBroadcaster.
29 |
30 | @see ActionBroadcaster, ChangeListener
31 |
32 | @tags{Events}
33 | */
34 | class JUCE_API ActionListener
35 | {
36 | public:
37 | /** Destructor. */
38 | virtual ~ActionListener() = default;
39 |
40 | /** Overridden by your subclass to receive the callback.
41 |
42 | @param message the string that was specified when the event was triggered
43 | by a call to ActionBroadcaster::sendActionMessage()
44 | */
45 | virtual void actionListenerCallback (const String& message) = 0;
46 | };
47 |
48 | } // namespace juce
49 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_events/interprocess/juce_ChildProcessManager.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 | namespace juce
23 | {
24 |
25 | void ChildProcessManager::checkProcesses()
26 | {
27 | for (auto it = processes.begin(); it != processes.end();)
28 | {
29 | auto processPtr = *it;
30 |
31 | if (! processPtr->isRunning())
32 | {
33 | listeners.call (processPtr.get());
34 | it = processes.erase (it);
35 | }
36 | else
37 | {
38 | ++it;
39 | }
40 | }
41 |
42 | if (processes.empty())
43 | timer.stopTimer();
44 | }
45 |
46 | JUCE_IMPLEMENT_SINGLETON (ChildProcessManager)
47 |
48 | } // namespace juce
49 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_events/juce_events.mm:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | #include "juce_events.cpp"
24 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_events/messages/juce_MessageListener.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | Message::Message() noexcept {}
27 | Message::~Message() {}
28 |
29 | void Message::messageCallback()
30 | {
31 | if (auto* r = recipient.get())
32 | r->handleMessage (*this);
33 | }
34 |
35 | MessageListener::MessageListener() noexcept
36 | {
37 | // Are you trying to create a messagelistener before or after juce has been initialised??
38 | JUCE_ASSERT_MESSAGE_MANAGER_EXISTS
39 | }
40 |
41 | MessageListener::~MessageListener()
42 | {
43 | masterReference.clear();
44 | }
45 |
46 | void MessageListener::postMessage (Message* const message) const
47 | {
48 | message->recipient = const_cast (this);
49 | message->post();
50 | }
51 |
52 | } // namespace juce
53 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_events/messages/juce_MountedVolumeListChangeDetector.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | #if JUCE_MAC || JUCE_WINDOWS || DOXYGEN
27 |
28 | //==============================================================================
29 | /**
30 | An instance of this class will provide callbacks when drives are
31 | mounted or unmounted on the system.
32 |
33 | Just inherit from this class and implement the pure virtual method
34 | to get the callbacks, there's no need to do anything else.
35 |
36 | @see File::findFileSystemRoots()
37 |
38 | @tags{Events}
39 | */
40 | class JUCE_API MountedVolumeListChangeDetector
41 | {
42 | public:
43 | MountedVolumeListChangeDetector();
44 | virtual ~MountedVolumeListChangeDetector();
45 |
46 | /** This method is called when a volume is mounted or unmounted. */
47 | virtual void mountedVolumeListChanged() = 0;
48 |
49 | private:
50 | JUCE_PUBLIC_IN_DLL_BUILD (struct Pimpl)
51 | std::unique_ptr pimpl;
52 |
53 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MountedVolumeListChangeDetector)
54 | };
55 |
56 | #endif
57 |
58 | } // namespace juce
59 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_events/messages/juce_NotificationType.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | //==============================================================================
27 | /**
28 | These enums are used in various classes to indicate whether a notification
29 | event should be sent out.
30 | */
31 | enum NotificationType
32 | {
33 | dontSendNotification = 0, /**< No notification message should be sent. */
34 | sendNotification = 1, /**< Requests a notification message, either synchronous or not. */
35 | sendNotificationSync, /**< Requests a synchronous notification. */
36 | sendNotificationAsync, /**< Requests an asynchronous notification. */
37 | };
38 |
39 | } // namespace juce
40 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_events/native/juce_EventLoopInternal_linux.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | struct LinuxEventLoopInternal
27 | {
28 | /**
29 | @internal
30 |
31 | Receives notifications when a fd callback is added or removed.
32 |
33 | This is useful for VST3 plugins that host other VST3 plugins. In this scenario, the 'inner'
34 | plugin may want to register additional file descriptors on top of those registered by the
35 | 'outer' plugin. In order for this to work, the outer plugin must in turn pass this request
36 | on to the host, to indicate that the outer plugin wants to receive FD callbacks for both the
37 | inner and outer plugin.
38 | */
39 | struct Listener
40 | {
41 | virtual ~Listener() = default;
42 | virtual void fdCallbacksChanged() = 0;
43 | };
44 |
45 | /** @internal */
46 | static void registerLinuxEventLoopListener (Listener&);
47 | /** @internal */
48 | static void deregisterLinuxEventLoopListener (Listener&);
49 | /** @internal */
50 | static void invokeEventLoopCallbackForFd (int);
51 | /** @internal */
52 | static std::vector getRegisteredFds();
53 | };
54 |
55 | } // namespace juce
56 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_events/native/juce_EventLoop_linux.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce::LinuxEventLoop
24 | {
25 |
26 | /** Registers a callback that will be called when a file descriptor is ready for I/O.
27 |
28 | This will add the given file descriptor to the internal set of file descriptors
29 | that will be passed to the poll() call. When this file descriptor has data to read
30 | the readCallback will be called.
31 |
32 | @param fd the file descriptor to be monitored
33 | @param readCallback a callback that will be called when the file descriptor has
34 | data to read. The file descriptor will be passed as an argument
35 | @param eventMask a bit mask specifying the events you are interested in for the
36 | file descriptor. The possible values for this are defined in
37 |
38 | */
39 | void registerFdCallback (int fd, std::function readCallback, short eventMask = 1 /*POLLIN*/);
40 |
41 | /** Unregisters a previously registered file descriptor.
42 |
43 | @see registerFdCallback
44 | */
45 | void unregisterFdCallback (int fd);
46 |
47 | } // namespace juce::LinuxEventLoop
48 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_events/native/juce_RunningInUnity.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | #pragma once
24 |
25 | namespace juce::detail
26 | {
27 |
28 | class RunningInUnity
29 | {
30 | public:
31 | /* @internal */
32 | static inline bool state = false;
33 | };
34 |
35 | } // namespace juce::detail
36 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_events/native/juce_ScopedLowPowerModeDisabler.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | #if JUCE_MAC
27 |
28 | class ScopedLowPowerModeDisabler::Pimpl
29 | {
30 | public:
31 | Pimpl()
32 | {
33 | if (@available (macOS 10.9, *))
34 | activity = [[NSProcessInfo processInfo] beginActivityWithOptions: NSActivityUserInitiatedAllowingIdleSystemSleep
35 | reason: @"App must remain in high-power mode"];
36 | }
37 |
38 | ~Pimpl()
39 | {
40 | if (@available (macOS 10.9, *))
41 | [[NSProcessInfo processInfo] endActivity: activity];
42 | }
43 |
44 | private:
45 | id activity;
46 |
47 | JUCE_DECLARE_NON_COPYABLE (Pimpl)
48 | JUCE_DECLARE_NON_MOVEABLE (Pimpl)
49 | };
50 |
51 | #else
52 |
53 | class ScopedLowPowerModeDisabler::Pimpl {};
54 |
55 | #endif
56 |
57 | //==============================================================================
58 | ScopedLowPowerModeDisabler::ScopedLowPowerModeDisabler()
59 | : pimpl (std::make_unique()) {}
60 |
61 | ScopedLowPowerModeDisabler::~ScopedLowPowerModeDisabler() = default;
62 |
63 | } // namespace juce
64 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_events/native/juce_ScopedLowPowerModeDisabler.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 |
23 | namespace juce
24 | {
25 |
26 | //==============================================================================
27 | /**
28 | Disables low-power-mode for the duration of an instance's lifetime.
29 |
30 | Currently this is only implemented on macOS, where it will disable the
31 | "App Nap" power-saving feature.
32 |
33 | @tags{Events}
34 | */
35 | class ScopedLowPowerModeDisabler
36 | {
37 | public:
38 | ScopedLowPowerModeDisabler();
39 | ~ScopedLowPowerModeDisabler();
40 |
41 | private:
42 | class Pimpl;
43 | std::unique_ptr pimpl;
44 |
45 | JUCE_DECLARE_NON_COPYABLE (ScopedLowPowerModeDisabler)
46 | JUCE_DECLARE_NON_MOVEABLE (ScopedLowPowerModeDisabler)
47 | };
48 |
49 | } // namespace juce
50 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_events/timers/juce_TimedCallback.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | The code included in this file is provided under the terms of the ISC license
11 | http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 | To use, copy, modify, and/or distribute this software for any purpose with or
13 | without fee is hereby granted provided that the above copyright notice and
14 | this permission notice appear in all copies.
15 |
16 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 | DISCLAIMED.
19 |
20 | ==============================================================================
21 | */
22 | namespace juce
23 | {
24 |
25 | /** Utility class wrapping a single non-null callback called by a Timer.
26 |
27 | You can use the usual Timer functions to start and stop the TimedCallback. Deleting the
28 | TimedCallback will automatically stop the underlying Timer.
29 |
30 | With this class you can use the Timer facility without inheritance.
31 |
32 | @see Timer
33 | @tags{Events}
34 | */
35 | class TimedCallback final : private Timer
36 | {
37 | public:
38 | /** Constructor. The passed in callback must be non-null. */
39 | explicit TimedCallback (std::function callbackIn)
40 | : callback (std::move (callbackIn))
41 | {
42 | jassert (callback);
43 | }
44 |
45 | /** Destructor. */
46 | ~TimedCallback() noexcept override { stopTimer(); }
47 |
48 | using Timer::startTimer;
49 | using Timer::startTimerHz;
50 | using Timer::stopTimer;
51 | using Timer::isTimerRunning;
52 | using Timer::getTimerInterval;
53 |
54 | private:
55 | void timerCallback() override { callback(); }
56 |
57 | std::function callback;
58 | };
59 |
60 | } // namespace juce
61 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_midi_ci/ci/juce_CIDeviceMessageHandler.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 | Agreement and JUCE Privacy Policy.
12 |
13 | End User License Agreement: www.juce.com/juce-7-licence
14 | Privacy Policy: www.juce.com/juce-privacy-policy
15 |
16 | Or: You may also use this code under the terms of the GPL v3 (see
17 | www.gnu.org/licenses).
18 |
19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 | DISCLAIMED.
22 |
23 | ==============================================================================
24 | */
25 |
26 | namespace juce::midi_ci
27 | {
28 |
29 | //==============================================================================
30 | /**
31 | An interface that will receive a callback every time a Device wishes to send a new MIDI-CI
32 | message.
33 |
34 | @tags{Audio}
35 | */
36 | struct DeviceMessageHandler
37 | {
38 | DeviceMessageHandler() = default;
39 | virtual ~DeviceMessageHandler() = default;
40 | DeviceMessageHandler (const DeviceMessageHandler&) = default;
41 | DeviceMessageHandler (DeviceMessageHandler&&) = default;
42 | DeviceMessageHandler& operator= (const DeviceMessageHandler&) = default;
43 | DeviceMessageHandler& operator= (DeviceMessageHandler&&) = default;
44 |
45 | /** Called with the bytes of a MIDI-CI message, along with the message's group.
46 |
47 | To send the message on, format the message appropriately (either into bytestream sysex
48 | or into multiple UMP sysex packets).
49 | */
50 | virtual void processMessage (ump::BytesOnGroup) = 0;
51 | };
52 |
53 | } // namespace juce::midi_ci
54 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_midi_ci/ci/juce_CIFunctionBlock.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 | Agreement and JUCE Privacy Policy.
12 |
13 | End User License Agreement: www.juce.com/juce-7-licence
14 | Privacy Policy: www.juce.com/juce-privacy-policy
15 |
16 | Or: You may also use this code under the terms of the GPL v3 (see
17 | www.gnu.org/licenses).
18 |
19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 | DISCLAIMED.
22 |
23 | ==============================================================================
24 | */
25 |
26 | namespace juce::midi_ci
27 | {
28 |
29 | /**
30 | Contains information about a MIDI 2.0 function block.
31 |
32 | @tags{Audio}
33 | */
34 | struct FunctionBlock
35 | {
36 | std::byte identifier { 0x7f }; ///< 0x7f == no function block
37 | uint8_t firstGroup = 0; ///< The first group that is part of the block, 0-based
38 | uint8_t numGroups = 1; ///< The number of groups contained in the block
39 |
40 | bool operator== (const FunctionBlock& other) const
41 | {
42 | const auto tie = [] (auto& x) { return std::tie (x.identifier, x.firstGroup, x.numGroups); };
43 | return tie (*this) == tie (other);
44 | }
45 |
46 | bool operator!= (const FunctionBlock& other) const { return ! operator== (other); }
47 | };
48 |
49 | } // namespace juce::midi_ci
50 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_midi_ci/ci/juce_CIProfileAtAddress.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 | Agreement and JUCE Privacy Policy.
12 |
13 | End User License Agreement: www.juce.com/juce-7-licence
14 | Privacy Policy: www.juce.com/juce-privacy-policy
15 |
16 | Or: You may also use this code under the terms of the GPL v3 (see
17 | www.gnu.org/licenses).
18 |
19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 | DISCLAIMED.
22 |
23 | ==============================================================================
24 | */
25 |
26 | namespace juce::midi_ci
27 | {
28 |
29 | /**
30 | Holds a profile ID, and the address of a group/channel.
31 |
32 | @tags{Audio}
33 | */
34 | class ProfileAtAddress
35 | {
36 | auto tie() const { return std::tie (profile, address); }
37 |
38 | public:
39 | Profile profile; ///< The id of a MIDI-CI profile
40 | ChannelAddress address; ///< A group and channel
41 |
42 | bool operator== (const ProfileAtAddress& x) const { return tie() == x.tie(); }
43 | bool operator!= (const ProfileAtAddress& x) const { return tie() != x.tie(); }
44 |
45 | bool operator< (const ProfileAtAddress& x) const { return tie() < x.tie(); }
46 | bool operator<= (const ProfileAtAddress& x) const { return tie() <= x.tie(); }
47 | bool operator> (const ProfileAtAddress& x) const { return tie() > x.tie(); }
48 | bool operator>= (const ProfileAtAddress& x) const { return tie() >= x.tie(); }
49 | };
50 |
51 | } // namespace juce::midi_ci
52 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_midi_ci/ci/juce_CIResponderDelegate.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 | Agreement and JUCE Privacy Policy.
12 |
13 | End User License Agreement: www.juce.com/juce-7-licence
14 | Privacy Policy: www.juce.com/juce-privacy-policy
15 |
16 | Or: You may also use this code under the terms of the GPL v3 (see
17 | www.gnu.org/licenses).
18 |
19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 | DISCLAIMED.
22 |
23 | ==============================================================================
24 | */
25 |
26 | namespace juce::midi_ci
27 | {
28 |
29 | /**
30 | An interface for types that implement responses for certain message types.
31 |
32 | @tags{Audio}
33 | */
34 | class ResponderDelegate
35 | {
36 | public:
37 | ResponderDelegate() = default;
38 | virtual ~ResponderDelegate() = default;
39 |
40 | /** If the message is processed successfully, and a response sent, then
41 | this returns true. Otherwise, returns false, allowing other ResponderDelegates
42 | to attempt to handle the message if necessary.
43 | */
44 | virtual bool tryRespond (ResponderOutput& output, const Message::Parsed& message) = 0;
45 |
46 | JUCE_DECLARE_NON_COPYABLE (ResponderDelegate)
47 | JUCE_DECLARE_NON_MOVEABLE (ResponderDelegate)
48 | };
49 |
50 | } // namespace juce::midi_ci
51 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_midi_ci/ci/juce_CIResponderOutput.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 | Agreement and JUCE Privacy Policy.
12 |
13 | End User License Agreement: www.juce.com/juce-7-licence
14 | Privacy Policy: www.juce.com/juce-privacy-policy
15 |
16 | Or: You may also use this code under the terms of the GPL v3 (see
17 | www.gnu.org/licenses).
18 |
19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 | DISCLAIMED.
22 |
23 | ==============================================================================
24 | */
25 |
26 | namespace juce::midi_ci
27 | {
28 |
29 | ChannelAddress ResponderOutput::getChannelAddress() const
30 | {
31 | return ChannelAddress{}.withGroup (getIncomingGroup())
32 | .withChannel (getIncomingHeader().deviceID);
33 | }
34 |
35 | Message::Header ResponderOutput::getReplyHeader (std::byte replySubID) const
36 | {
37 | return { getIncomingHeader().deviceID,
38 | replySubID,
39 | detail::MessageMeta::implementationVersion,
40 | getMuid(),
41 | getIncomingHeader().source };
42 | }
43 |
44 | } // namespace juce::midi_ci
45 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_midi_ci/ci/juce_CISubscription.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 | Agreement and JUCE Privacy Policy.
12 |
13 | End User License Agreement: www.juce.com/juce-7-licence
14 | Privacy Policy: www.juce.com/juce-privacy-policy
15 |
16 | Or: You may also use this code under the terms of the GPL v3 (see
17 | www.gnu.org/licenses).
18 |
19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 | DISCLAIMED.
22 |
23 | ==============================================================================
24 | */
25 |
26 | namespace juce::midi_ci
27 | {
28 |
29 | //==============================================================================
30 | /**
31 | Matches a subscription ID to a resource name.
32 |
33 | @tags{Audio}
34 | */
35 | struct Subscription
36 | {
37 | String subscribeId;
38 | String resource;
39 |
40 | bool operator< (const Subscription& other) const { return subscribeId < other.subscribeId; }
41 | bool operator<= (const Subscription& other) const { return subscribeId <= other.subscribeId; }
42 | bool operator> (const Subscription& other) const { return subscribeId > other.subscribeId; }
43 | bool operator>= (const Subscription& other) const { return subscribeId >= other.subscribeId; }
44 |
45 | bool operator== (const Subscription& other) const
46 | {
47 | const auto tie = [] (const auto& x) { return std::tie (x.subscribeId, x.resource); };
48 | return tie (*this) == tie (other);
49 | }
50 |
51 | bool operator!= (const Subscription& other) const { return ! operator== (other); }
52 | };
53 |
54 | } // namespace juce::midi_ci
55 |
--------------------------------------------------------------------------------
/JuceLibraryCode/modules/juce_midi_ci/detail/juce_CIResponder.h:
--------------------------------------------------------------------------------
1 | /*
2 | ==============================================================================
3 |
4 | This file is part of the JUCE library.
5 | Copyright (c) 2022 - Raw Material Software Limited
6 |
7 | JUCE is an open source library subject to commercial or open-source
8 | licensing.
9 |
10 | By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 | Agreement and JUCE Privacy Policy.
12 |
13 | End User License Agreement: www.juce.com/juce-7-licence
14 | Privacy Policy: www.juce.com/juce-privacy-policy
15 |
16 | Or: You may also use this code under the terms of the GPL v3 (see
17 | www.gnu.org/licenses).
18 |
19 | JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 | EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 | DISCLAIMED.
22 |
23 | ==============================================================================
24 | */
25 |
26 | namespace juce::midi_ci::detail
27 | {
28 |
29 | /*
30 | Parses individual messages, and additionally gives ResponderDelegates a chance to formulate
31 | a response to any message that would normally necessitate a reply.
32 | */
33 | struct Responder
34 | {
35 | Responder() = delete;
36 |
37 | /* Parses the message, then calls tryParse on each ResponderDelegate in
38 | turn until one returns true, indicating that the message has been
39 | handled. Most 'inquiry' messages should emit one or more reply messages.
40 | These replies will be written to the provided BufferOutput.
41 | If none of the provided delegates are able to handle the message, then
42 | a generic NAK will be written to the BufferOutput.
43 | */
44 | static Parser::Status processCompleteMessage (BufferOutput& output,
45 | ump::BytesOnGroup message,
46 | Span delegates);
47 | };
48 |
49 | } // namespace juce::midi_ci
50 |
--------------------------------------------------------------------------------
/Scripts/build-macos.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [ $# -eq 0 ]; then
4 | echo "The release version is required as an argument"
5 | exit 1
6 | fi
7 |
8 | PROJECT_DIR=$PWD
9 |
10 | export RELEASE_VERSION="$1"
11 | export PATH_TO_JUCE="$PROJECT_DIR/JUCE"
12 |
13 | SIGN_ID="Developer ID Application: Uwyn, LLC (AGZT8GVS7G)"
14 | BUILD_DIR="$PWD/Builds/MacOSX/build"
15 | INSTALLERS_DIR="$PROJECT_DIR/Installers"
16 | PKG_FILE="sendmidi-macos-${RELEASE_VERSION}.pkg"
17 | ARCHIVE_FILE="$INSTALLERS_DIR/sendmidi-macOS-${RELEASE_VERSION}.zip"
18 |
19 | rm -rfv "$BUILD_DIR"
20 | mkdir -v "$INSTALLERS_DIR"
21 |
22 | # build release artifacts
23 | echo "Building all ProJucer artifacts"
24 | xcodebuild -project ./Builds/MacOSX/sendmidi.xcodeproj -destination "generic/platform=macOS,name=Any Mac" -config Release SYMROOT=build -scheme "sendmidi - ConsoleApp"
25 |
26 | # sign each individual artifact
27 | echo "Codesigning all artifacts"
28 | codesign -f -s "$SIGN_ID" "${BUILD_DIR}/Release/sendmidi" --deep --strict --timestamp --options=runtime
29 |
30 | # build the installer package in the build directory
31 | echo "Building installer package"
32 | pkgbuild --root "${BUILD_DIR}/Release" --identifier com.uwyn.sendmidi --version ${RELEASE_VERSION} --install-location /usr/local/bin --sign "Developer ID Installer: Uwyn, LLC (AGZT8GVS7G)" "${BUILD_DIR}/${PKG_FILE}"
33 |
34 | # Notarization
35 | echo "Notarizating installer"
36 | xcrun notarytool submit "${BUILD_DIR}/${PKG_FILE}" --keychain-profile "notary-uwyn.com" --wait
37 | xcrun stapler staple "${BUILD_DIR}/${PKG_FILE}"
38 | spctl --assess -vv --type install "${BUILD_DIR}/${PKG_FILE}"
39 |
40 | echo "Creating zip archive of installer"
41 | pushd "${BUILD_DIR}"
42 | zip -r "${ARCHIVE_FILE}" "${PKG_FILE}"
43 | popd
44 |
45 | echo "Finished building `realpath $ARCHIVE_FILE`"
46 |
--------------------------------------------------------------------------------
/Scripts/build-windows.ps1:
--------------------------------------------------------------------------------
1 | param (
2 | [Parameter(Mandatory=$true)][string]$version
3 | )
4 |
5 | $curDir = Get-Location
6 |
7 | Write-Output "Setting up development environment with Visuals Studio 2022"
8 | Import-Module "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
9 | Enter-VsDevShell -VsInstallPath "C:\Program Files\Microsoft Visual Studio\2022\Community\"
10 |
11 | $Env:RELEASE_VERSION = "$version"
12 | $Env:PATH_TO_JUCE = "$curDir\JUCE"
13 |
14 | Write-Output "Changing location to $curDir"
15 | Set-Location $curDir
16 |
17 | $signId = "Open Source Developer, Geert Bevin"
18 | $buildLocation = "Builds\VisualStudio2017\x64"
19 |
20 | Write-Output "Deleting previous build from $buildLocation"
21 | Remove-Item -LiteralPath $buildLocation -Force -Recurse
22 |
23 | Write-Output "Building project"
24 | MSBuild.exe .\Builds\VisualStudio2017\sendmidi.sln /p:Configuration=Release /p:PreferredToolArchitecture=x64 /p:Platform=x64 /clp:ErrorsOnly
25 |
26 | Write-Output "Codesigning all artifacts"
27 |
28 | & signtool sign /n "$signId" /t http://time.certum.pl/ /fd sha1 /v "$buildLocation\Release\ConsoleApp\sendmidi.exe"
29 |
--------------------------------------------------------------------------------
/Source/ApplicationCommand.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of SendMIDI.
3 | * Copyright (command) 2017-2024 Uwyn LLC. https://www.uwyn.com
4 | *
5 | * SendMIDI 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 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * SendMIDI 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, see .
17 | */
18 |
19 | #pragma once
20 |
21 | #include "JuceHeader.h"
22 |
23 | enum CommandIndex
24 | {
25 | NONE,
26 | LIST,
27 | PANIC,
28 | DEVICE,
29 | VIRTUAL,
30 | TXTFILE,
31 | DECIMAL,
32 | HEXADECIMAL,
33 | CHANNEL,
34 | OCTAVE_MIDDLE_C,
35 | NOTE_ON,
36 | NOTE_OFF,
37 | POLY_PRESSURE,
38 | CONTROL_CHANGE,
39 | CONTROL_CHANGE_14BIT,
40 | PROGRAM_CHANGE,
41 | CHANNEL_PRESSURE,
42 | PITCH_BEND,
43 | RPN,
44 | NRPN,
45 | CLOCK,
46 | MIDI_CLOCK,
47 | START,
48 | STOP,
49 | CONTINUE,
50 | ACTIVE_SENSING,
51 | RESET,
52 | SYSTEM_EXCLUSIVE,
53 | SYSTEM_EXCLUSIVE_FILE,
54 | TIME_CODE,
55 | SONG_POSITION,
56 | SONG_SELECT,
57 | TUNE_REQUEST,
58 | MPE_CONFIGURATION,
59 | MPE_PROFILE,
60 | MPE_TEST,
61 | RAW_MIDI
62 | };
63 |
64 | class ApplicationState;
65 |
66 | struct ApplicationCommand
67 | {
68 | static ApplicationCommand Dummy();
69 |
70 | void clear();
71 | void execute(ApplicationState& state);
72 |
73 | String param_;
74 | String altParam_;
75 | CommandIndex command_;
76 | int expectedOptions_;
77 | StringArray optionsDescriptions_;
78 | StringArray commandDescriptions_;
79 | StringArray opts_;
80 | };
81 |
--------------------------------------------------------------------------------
/Source/Main.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of SendMIDI.
3 | * Copyright (command) 2017-2024 Uwyn LLC. https://www.uwyn.com
4 | *
5 | * SendMIDI 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 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * SendMIDI 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, see .
17 | */
18 | #include "JuceHeader.h"
19 |
20 | #include "ApplicationState.h"
21 |
22 | class sendMidiApplication : public JUCEApplicationBase
23 | {
24 | public:
25 | const String getApplicationName() override { return ProjectInfo::projectName; }
26 | const String getApplicationVersion() override { return ProjectInfo::versionString; }
27 | bool moreThanOneInstanceAllowed() override { return true; }
28 | void systemRequestedQuit() override { quit(); }
29 |
30 | void initialise(const String&) override
31 | {
32 | state.initialise(*this);
33 | }
34 |
35 | void shutdown() override {}
36 | void suspended() override {}
37 | void resumed() override {}
38 | void anotherInstanceStarted(const String&) override {}
39 | void unhandledException(const std::exception*, const String&, int) override { jassertfalse; }
40 |
41 | ApplicationState state;
42 | };
43 |
44 | START_JUCE_APPLICATION (sendMidiApplication)
45 |
--------------------------------------------------------------------------------
/Source/MpeTestScenario.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of SendMIDI.
3 | * Copyright (command) 2017-2024 Uwyn LLC. https://www.uwyn.com
4 | *
5 | * SendMIDI 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 3 of the License, or
8 | * (at your option) any later version.
9 | *
10 | * SendMIDI 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, see .
17 | */
18 |
19 | #pragma once
20 |
21 | #include "JuceHeader.h"
22 |
23 | #include "ApplicationState.h"
24 |
25 | class MpeTestScenario
26 | {
27 | public:
28 | void send(ApplicationState& state);
29 |
30 | private:
31 | void step(const String& message);
32 | };
33 |
--------------------------------------------------------------------------------