Commit graph

129 commits

Author SHA1 Message Date
Tim Mayberry
23a490c906 Add two utility methods to abstract PortAudioBackend state
These may change as support for callback API is added
2015-09-02 12:07:58 +10:00
Tim Mayberry
f143d76523 Extract MIDI input/output processing in PortAudioBackend into new methods 2015-09-02 12:07:58 +10:00
Tim Mayberry
a65b1ddedc Add a DSPLoadCalculator class to the PortAudioBackend for DSP load calculation
The class uses the same algorithm as in the coreaudio and alsa backends and
should probably go into libardour at some point
2015-09-02 12:07:58 +10:00
Tim Mayberry
cb7bac5599 Fix include style of system header 2015-09-02 12:07:58 +10:00
Tim Mayberry
5448c229d9 Extract main processing section of PortAudioBackend into new method 2015-09-02 12:07:58 +10:00
Tim Mayberry
f27d8e1e23 Extract freewheel processing in PortAudioBackend into new method 2015-09-02 12:07:58 +10:00
Tim Mayberry
cf81caa798 Don't update unused dsp timer variable in freewheel process in PortaudioBackend 2015-09-02 12:07:58 +10:00
Tim Mayberry
7b23f80b03 Refactor port change handling part of PA Backend process function into new method 2015-09-02 12:07:58 +10:00
Tim Mayberry
684701427e Rename variables in PortaudioBackend in preparation for using PA callback API 2015-09-02 12:07:58 +10:00
Tim Mayberry
56b5e04c3b Fix copy and paste error in debug output message in WINMME Midi Output 2015-09-02 12:07:58 +10:00
Tim Mayberry
ac5eac471d Signal WinMME Midi output thread so the thread wakes up and terminates properly 2015-09-02 12:07:15 +10:00
Tim Mayberry
d520b9c878 Stop WINMME midi driver/devices when PortAudio backend is stopped 2015-09-02 12:07:15 +10:00
Tim Mayberry
2dbdaaa8f5 Refactor part of PortAudioBackend::_start/stop into new methods 2015-09-02 12:07:15 +10:00
Tim Mayberry
f58282844d Don't add "None" devices for ASIO driver in PortaudioBackend 2015-09-02 12:07:15 +10:00
Tim Mayberry
0396df963f Implement new AudioBackend API for force updating devices in PortaudioBackend 2015-09-02 12:07:15 +10:00
Tim Mayberry
585930f058 Update devices in PortaudioBackend when setting the driver
Reinitialize portaudio to pick up changes in devices and ASIO buffer settings
2015-09-02 12:07:15 +10:00
Tim Mayberry
8c2b9dac59 Rename several methods in PortAudioIO class
return ErrorCode's and handle them where necessary
2015-09-02 12:07:15 +10:00
Tim Mayberry
82f84d6203 Refactor part of PortAudioIO::pcm_setup into new method 2015-09-02 12:07:15 +10:00
Tim Mayberry
1cb36108bb Change the functions related to initializing the Portaudio library 2015-09-02 12:07:15 +10:00
Tim Mayberry
3b71674eee Remove unused and cryptic _state member from PortAudioIO 2015-09-02 12:07:15 +10:00
Tim Mayberry
fd0b54f459 Use PortAudioIO::ErrorCode as return value from PortAudioIO::pcm_setup 2015-09-02 12:07:15 +10:00
Tim Mayberry
4e75220661 Define some error codes in PortAudioIO class 2015-09-02 12:07:15 +10:00
Tim Mayberry
e42f9d649b Refactor parts of PortAudioIO class into new method 2015-09-02 12:07:15 +10:00
Tim Mayberry
c857008b93 Refactor part of PortAudioIO::pcm_setup into 2 new methods 2015-09-02 12:07:14 +10:00
Tim Mayberry
41211c984c Make two private methods in PortAudioIO const 2015-09-02 12:07:14 +10:00
Tim Mayberry
8e0e3fcdee Refactor part of PortAudioIO::pcm_setup into new method 2015-09-02 12:07:14 +10:00
Tim Mayberry
58cfd00e5a Add utility method to PortAudioIO class to remove goto from pcm_setup 2015-09-02 12:07:14 +10:00
Tim Mayberry
d6f7066e80 Remove apple specific fixes from PortaudioBackend now that it is windows only 2015-09-02 12:07:14 +10:00
Tim Mayberry
dd93aec029 Don't query supported sample rates for ASIO devices in PortaudioBackend
There has been reports this can take several minutes on some devices so just
return the default rates(and fail to open the device when a SR is specified
that isn't supported)
2015-09-02 12:07:14 +10:00
Tim Mayberry
519f97b91d Use two private utility functions in PortaudioIO class for default SR's and buffer sizes 2015-09-02 12:07:14 +10:00
Tim Mayberry
cc7e97f296 Reindent and reformat switch statements in PortaudioBackend
This is more readable and consistent with the rest of the source files
2015-09-02 12:07:14 +10:00
Tim Mayberry
71a1e9e90d Use translated error messages in PortaudioBackend when SR or i/o channel counts don't match requested
These errors are probably preventable but currently they do occur so at least
tell the user about them(and hope they check the error log window)
2015-09-02 12:07:14 +10:00
Tim Mayberry
ba4f685d2d Use a translated error message in PortaudioBackend when unable to open audio device 2015-09-02 12:07:14 +10:00
Tim Mayberry
432e0073f6 Convert some error output to debug output in PortaudioBackend 2015-09-02 12:07:14 +10:00
Tim Mayberry
9185978d2f Use translated error message in PortaudioBackend with failing to aquire RT perms 2015-09-02 12:07:14 +10:00
Tim Mayberry
9d67d22e70 Use debug output rather than sending errors for developer relevant port errors
Most of these are not errors that are intended for the user, they are only
intended for developers so don't send them to PBD::error. The errors that may
be relevant to users should be handled in libardour or the GUI in response to
return values
2015-09-02 12:07:14 +10:00
Tim Mayberry
a272c50597 Move AudioBackend related debug bits into libardour
I put these in libpbd as that is where the debug bits are for the Waves backend
but I think it makes more sense for them to be in libardour as that is where
the AudioBackend class is defined

I left the Waves debug bits in libpbd for now.
2015-09-02 12:07:14 +10:00
Tim Mayberry
201d91aedd Use PortaudioIO::get_current_host_api_type utility function in PortaudioIO class 2015-09-02 12:07:14 +10:00
Tim Mayberry
c6c0654b5a Add Utility function to get host API type in PortaudioIO class 2015-09-02 12:07:14 +10:00
Tim Mayberry
08d6dd153e Add "None" devices to PortaudioBackend
This allows for disabling either input or output, but not both
2015-09-02 12:07:14 +10:00
Tim Mayberry
440e6cd591 Use AudioBackend standard device names for "Default" in PortaudioBackend 2015-09-02 12:07:14 +10:00
Tim Mayberry
3a3d811e82 Use StandardDevices enum in PortaudioIO for default devices
This just makes it a bit easier to read through the code rather than using
magic numbers.
2015-09-02 12:07:14 +10:00
Tim Mayberry
5a5226dded Add StandardDevice enum to portaudio_io.h header 2015-09-02 12:07:14 +10:00
Tim Mayberry
7537a992b3 Use translated error message in PortaudioBackend for audio device I/O error 2015-09-02 12:07:14 +10:00
Tim Mayberry
07f3dae936 Use translated error message for failing to set thread priorities in PortaudioBackend 2015-09-02 12:07:14 +10:00
Tim Mayberry
ee77a7a883 Use AudioBackend::get_standard_device_name for "None" midi device in PortaudioBackend 2015-09-02 12:07:14 +10:00
Tim Mayberry
451e35002c Use pretty name infrastructure to display MIDI device name 2015-09-02 12:07:14 +10:00
Tim Mayberry
71e7b2fbd6 Set the default host api in PortaudioBackend when initializing portaudio
Not setting a default driver causes issues with the EngineControl dialog
2015-08-07 01:25:14 +10:00
Tim Mayberry
529a625c39 Remove "Default" devices from the PortaudioBackend
These are not really necessary now that input and output devices can be
selected separately.
2015-08-05 23:37:50 +10:00
Tim Mayberry
66cafd10d5 Use ASIO specific device channel names for port properties/pretty names 2015-08-05 13:21:30 +10:00