diff options
author | Vitaly Novichkov <admin@wohlnet.ru> | 2017-12-16 20:36:41 +0300 |
---|---|---|
committer | Vitaly Novichkov <admin@wohlnet.ru> | 2017-12-16 20:36:41 +0300 |
commit | cfb96e9ef563e4cf39350b5b8721f4b5b70585d2 (patch) | |
tree | fd92556eb497c14ad9f7eed01e853a7d1ecca049 /src/adlmidi.cpp | |
parent | 93b8726a3db33023f2c5a0cc5efba58583b87fb4 (diff) | |
download | libADLMIDI-cfb96e9ef563e4cf39350b5b8721f4b5b70585d2.tar.gz libADLMIDI-cfb96e9ef563e4cf39350b5b8721f4b5b70585d2.tar.bz2 libADLMIDI-cfb96e9ef563e4cf39350b5b8721f4b5b70585d2.zip |
Added experimental VLC plugin
Plugin is made for VLC 2.2.2 Weatherwax (pre-installed in Linux Mint 18.3)
Existing issues:
- No ability to change codec properties yet, this thing is WIP
- By unknown reason, resulted sound has different (RANDOM) sample rate which is different from 44100 Hz
Diffstat (limited to 'src/adlmidi.cpp')
-rw-r--r-- | src/adlmidi.cpp | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/src/adlmidi.cpp b/src/adlmidi.cpp index dd4a3e1..b9e67cb 100644 --- a/src/adlmidi.cpp +++ b/src/adlmidi.cpp @@ -653,34 +653,21 @@ ADLMIDI_EXPORT int adl_generate(struct ADL_MIDIPlayer *device, int sampleCount, ssize_t n_periodCountStereo = 512; int left = sampleCount; - bool hasSkipped = setup.tick_skip_samples_delay > 0; - double delay = double(sampleCount) / double(setup.PCM_RATE); while(left > 0) { {//... const double eat_delay = delay < setup.maxdelay ? delay : setup.maxdelay; - if(hasSkipped) - { - size_t samples = setup.tick_skip_samples_delay > sampleCount ? sampleCount : setup.tick_skip_samples_delay; - n_periodCountStereo = samples / 2; - } - else - { - delay -= eat_delay; - setup.carry += setup.PCM_RATE * eat_delay; - n_periodCountStereo = static_cast<ssize_t>(setup.carry); - setup.carry -= n_periodCountStereo; - } + delay -= eat_delay; + setup.carry += setup.PCM_RATE * eat_delay; + n_periodCountStereo = static_cast<ssize_t>(setup.carry); + setup.carry -= n_periodCountStereo; { ssize_t leftSamples = left / 2; if(n_periodCountStereo > leftSamples) - { - setup.tick_skip_samples_delay = (n_periodCountStereo - leftSamples) * 2; n_periodCountStereo = leftSamples; - } //! Count of stereo samples ssize_t in_generatedStereo = (n_periodCountStereo > 512) ? 512 : n_periodCountStereo; //! Total count of samples @@ -719,13 +706,7 @@ ADLMIDI_EXPORT int adl_generate(struct ADL_MIDIPlayer *device, int sampleCount, gotten_len += (in_generatedPhys) /* - setup.stored_samples*/; } - if(hasSkipped) - { - setup.tick_skip_samples_delay -= n_periodCountStereo * 2; - hasSkipped = setup.tick_skip_samples_delay > 0; - } - else - player->TickIteratos(eat_delay); + player->TickIteratos(eat_delay); }//... } @@ -833,7 +814,7 @@ void adl_rt_patchChange(struct ADL_MIDIPlayer *device, ADL_UInt8 channel, ADL_UI player->realTime_PatchChange(channel, patch); } -void adl_rt_pitchBend(struct ADL_MIDIPlayer *device, ADL_UInt8 channel, ADL_UInt8 pitch) +void adl_rt_pitchBend(struct ADL_MIDIPlayer *device, ADL_UInt8 channel, ADL_UInt16 pitch) { if(!device) return; |