public AudioMaster( int samplingRate, int blockSize, ILoggerFactory loggerFactory, ElapsedTimeCounter counter, IDllManager dllManager ) { _loggerFactory = loggerFactory; _logger = _loggerFactory.CreateLogger <AudioMaster <T> >(); _counter = counter; DllManager = dllManager; _param = new("vstTimeInfo", 1, _loggerFactory); var p = _param.AsSpan(0, 1); p[0].vstTimeInfo.samplePos = 0.0; p[0].vstTimeInfo.sampleRate = samplingRate; p[0].vstTimeInfo.nanoSeconds = 0.0; p[0].vstTimeInfo.ppqPos = 0.0; p[0].vstTimeInfo.tempo = 240.0; p[0].vstTimeInfo.barStartPos = 0.0; p[0].vstTimeInfo.cycleStartPos = 0.0; p[0].vstTimeInfo.cycleEndPos = 0.0; p[0].vstTimeInfo.timeSigNumerator = 4; p[0].vstTimeInfo.timeSigDenominator = 4; p[0].vstTimeInfo.smpteOffset = 0; p[0].vstTimeInfo.smpteFrameRate = VstTimeInfo.VstSmpteFrameRate.kVstSmpte24fps; p[0].vstTimeInfo.samplesToNextClock = 0; p[0].vstTimeInfo.flags = VstTimeInfo.VstTimeInfoFlags.kVstTempoValid | VstTimeInfo.VstTimeInfoFlags.kVstNanosValid; p[0].vstProcessLevels = VstProcessLevels.kVstProcessLevelRealtime; p[0].samplingRate = samplingRate; p[0].blockSize = blockSize; }
public Logic1( IConfiguration configuration, ILoggerFactory loggerFactory, IDllManager dllManager, Param param, BufferBlock <MIDIMessageEvent2> midiEventInput, BufferBlock <MIDIMessageEvent2> midiEventOutput, CancellationTokenSource processCancel ) { Configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); LoggerFactory = loggerFactory; Logger = LoggerFactory.CreateLogger <Runner>(); DllManager = dllManager; Param = param; ProcessCancel = processCancel; MidiEventInput = midiEventInput; MidiEventOutput = midiEventOutput; StreamKey = Configuration["MIXER_STREAM_KEY"]; IngestHostname = Configuration["MIXER_INGEST_HOSTNAME"]; var assembly = Assembly.GetExecutingAssembly(); var directoryName = Path.GetDirectoryName(assembly.Location); if (directoryName == default) { throw new InvalidOperationException($"GetDirectoryName({assembly.Location}) failed."); } CaInfoPath = Path.Combine( directoryName, "lib", "cacert.pem" ); }