From fe891d581dfece13b42414ba1d8fec6063290a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20M=C3=BCller?= Date: Sun, 3 May 2020 15:25:52 +0200 Subject: Audaspace: update from upstream - Changing API for time values from float to double for better precision. - Fixing minor mistakes in the documentation. - Fixing minor unnecessary large memory allocation. --- extern/audaspace/bindings/C/AUD_Device.cpp | 4 ++-- extern/audaspace/bindings/C/AUD_Device.h | 4 ++-- extern/audaspace/bindings/C/AUD_DynamicMusic.cpp | 6 +++--- extern/audaspace/bindings/C/AUD_DynamicMusic.h | 6 +++--- extern/audaspace/bindings/C/AUD_Handle.cpp | 4 ++-- extern/audaspace/bindings/C/AUD_Handle.h | 4 ++-- extern/audaspace/bindings/C/AUD_Sequence.cpp | 4 ++-- extern/audaspace/bindings/C/AUD_Sequence.h | 4 ++-- extern/audaspace/bindings/C/AUD_Special.cpp | 4 ++-- extern/audaspace/bindings/C/AUD_Special.h | 4 ++-- extern/audaspace/bindings/doc/device.rst | 1 + extern/audaspace/bindings/doc/handle.rst | 1 + extern/audaspace/bindings/doc/index.rst | 3 ++- extern/audaspace/bindings/doc/sequence.rst | 1 + extern/audaspace/bindings/doc/sequence_entry.rst | 1 + extern/audaspace/bindings/doc/sound.rst | 1 + extern/audaspace/bindings/doc/tutorials.rst | 2 +- extern/audaspace/bindings/python/PyDynamicMusic.cpp | 6 +++--- extern/audaspace/bindings/python/PyHandle.cpp | 6 +++--- extern/audaspace/bindings/python/PySequence.cpp | 14 +++++++------- extern/audaspace/bindings/python/PySequenceEntry.cpp | 10 +++++----- extern/audaspace/bindings/python/PySound.cpp | 9 +++++---- extern/audaspace/include/devices/DefaultSynchronizer.h | 4 ++-- extern/audaspace/include/devices/IDeviceFactory.h | 3 +++ extern/audaspace/include/devices/IHandle.h | 4 ++-- extern/audaspace/include/devices/ISynchronizer.h | 4 ++-- extern/audaspace/include/devices/NULLDevice.h | 4 ++-- extern/audaspace/include/devices/SoftwareDevice.h | 4 ++-- extern/audaspace/include/file/IFileInput.h | 5 ++++- extern/audaspace/include/fx/Delay.h | 6 +++--- extern/audaspace/include/fx/DelayReader.h | 2 +- extern/audaspace/include/fx/DynamicMusic.h | 10 +++++----- extern/audaspace/include/fx/Fader.h | 10 +++++----- extern/audaspace/include/fx/FaderReader.h | 6 +++--- extern/audaspace/include/fx/Limiter.h | 10 +++++----- extern/audaspace/include/fx/LimiterReader.h | 6 +++--- extern/audaspace/include/sequence/Sequence.h | 2 +- extern/audaspace/include/sequence/SequenceData.h | 2 +- extern/audaspace/include/sequence/SequenceEntry.h | 10 +++++----- extern/audaspace/plugins/jack/JackDevice.cpp | 6 +++--- extern/audaspace/plugins/jack/JackDevice.h | 4 ++-- extern/audaspace/plugins/jack/JackSynchronizer.cpp | 4 ++-- extern/audaspace/plugins/jack/JackSynchronizer.h | 4 ++-- extern/audaspace/plugins/openal/OpenALDevice.cpp | 4 ++-- extern/audaspace/plugins/openal/OpenALDevice.h | 4 ++-- extern/audaspace/src/devices/DefaultSynchronizer.cpp | 4 ++-- extern/audaspace/src/devices/NULLDevice.cpp | 4 ++-- extern/audaspace/src/devices/SoftwareDevice.cpp | 6 +++--- extern/audaspace/src/fx/Delay.cpp | 4 ++-- extern/audaspace/src/fx/DelayReader.cpp | 2 +- extern/audaspace/src/fx/DynamicMusic.cpp | 10 +++++----- extern/audaspace/src/fx/Fader.cpp | 6 +++--- extern/audaspace/src/fx/FaderReader.cpp | 8 ++++---- extern/audaspace/src/fx/Limiter.cpp | 6 +++--- extern/audaspace/src/fx/LimiterReader.cpp | 2 +- extern/audaspace/src/respec/ChannelMapperReader.cpp | 2 +- extern/audaspace/src/respec/Mixer.cpp | 4 ++-- extern/audaspace/src/sequence/Sequence.cpp | 2 +- extern/audaspace/src/sequence/SequenceData.cpp | 2 +- extern/audaspace/src/sequence/SequenceEntry.cpp | 4 ++-- extern/audaspace/src/sequence/SequenceHandle.cpp | 8 ++++---- extern/audaspace/src/sequence/SequenceHandle.h | 6 +++--- extern/audaspace/src/sequence/SequenceReader.cpp | 7 +++---- source/blender/blenkernel/BKE_sound.h | 6 +++--- source/blender/blenkernel/intern/sound.c | 16 ++++++++-------- source/blender/editors/screen/screen_ops.c | 4 ++-- source/blender/windowmanager/intern/wm_event_system.c | 4 ++-- source/blender/windowmanager/intern/wm_init_exit.c | 2 +- 68 files changed, 174 insertions(+), 162 deletions(-) diff --git a/extern/audaspace/bindings/C/AUD_Device.cpp b/extern/audaspace/bindings/C/AUD_Device.cpp index 441f228deac..d4643094bc2 100644 --- a/extern/audaspace/bindings/C/AUD_Device.cpp +++ b/extern/audaspace/bindings/C/AUD_Device.cpp @@ -290,14 +290,14 @@ AUD_API AUD_Device* AUD_Device_getCurrent() return new AUD_Device(device); } -AUD_API void AUD_seekSynchronizer(AUD_Handle* handle, float time) +AUD_API void AUD_seekSynchronizer(AUD_Handle* handle, double time) { auto synchronizer = DeviceManager::getDevice()->getSynchronizer(); if(synchronizer) synchronizer->seek(*reinterpret_cast*>(handle), time); } -AUD_API float AUD_getSynchronizerPosition(AUD_Handle* handle) +AUD_API double AUD_getSynchronizerPosition(AUD_Handle* handle) { auto synchronizer = DeviceManager::getDevice()->getSynchronizer(); if(synchronizer) diff --git a/extern/audaspace/bindings/C/AUD_Device.h b/extern/audaspace/bindings/C/AUD_Device.h index 0dfa21f0660..05e004a17db 100644 --- a/extern/audaspace/bindings/C/AUD_Device.h +++ b/extern/audaspace/bindings/C/AUD_Device.h @@ -221,14 +221,14 @@ extern AUD_API AUD_Device* AUD_Device_getCurrent(); * \param handle Playback handle. * \param time Time in seconds to seek to. */ -extern AUD_API void AUD_seekSynchronizer(AUD_Handle* handle, float time); +extern AUD_API void AUD_seekSynchronizer(AUD_Handle* handle, double time); /** * Returns the current sound scene playback time. * \param handle Playback handle. * \return The playback time in seconds. */ -extern AUD_API float AUD_getSynchronizerPosition(AUD_Handle* handle); +extern AUD_API double AUD_getSynchronizerPosition(AUD_Handle* handle); /** * Starts the playback of jack transport if possible. diff --git a/extern/audaspace/bindings/C/AUD_DynamicMusic.cpp b/extern/audaspace/bindings/C/AUD_DynamicMusic.cpp index bb7a129dde3..62e626cdc6c 100644 --- a/extern/audaspace/bindings/C/AUD_DynamicMusic.cpp +++ b/extern/audaspace/bindings/C/AUD_DynamicMusic.cpp @@ -101,14 +101,14 @@ AUD_API int AUD_DynamicMusic_pause(AUD_DynamicMusic* player) return (*player)->pause(); } -AUD_API int AUD_DynamicMusic_seek(AUD_DynamicMusic* player, float position) +AUD_API int AUD_DynamicMusic_seek(AUD_DynamicMusic* player, double position) { assert(player); return (*player)->seek(position); } -AUD_API float AUD_DynamicMusic_getPosition(AUD_DynamicMusic* player) +AUD_API double AUD_DynamicMusic_getPosition(AUD_DynamicMusic* player) { assert(player); @@ -141,4 +141,4 @@ AUD_API int AUD_DynamicMusic_stop(AUD_DynamicMusic* player) assert(player); return (*player)->stop(); -} \ No newline at end of file +} diff --git a/extern/audaspace/bindings/C/AUD_DynamicMusic.h b/extern/audaspace/bindings/C/AUD_DynamicMusic.h index c362479591e..b8b78e57b55 100644 --- a/extern/audaspace/bindings/C/AUD_DynamicMusic.h +++ b/extern/audaspace/bindings/C/AUD_DynamicMusic.h @@ -103,14 +103,14 @@ extern AUD_API int AUD_DynamicMusic_pause(AUD_DynamicMusic* player); * \param position The new position from which to play back, in seconds. * \return 0 if the seeking wasn't possible. */ -extern AUD_API int AUD_DynamicMusic_seek(AUD_DynamicMusic* player, float position); +extern AUD_API int AUD_DynamicMusic_seek(AUD_DynamicMusic* player, double position); /** * Retrieves the position of the current scene of a dynamic music player. * \param player The DynamicMusic object. * \return The position of the current playing scene. */ -extern AUD_API float AUD_DynamicMusic_getPosition(AUD_DynamicMusic* player); +extern AUD_API double AUD_DynamicMusic_getPosition(AUD_DynamicMusic* player); /** * Retrieves the volume of the current scene of a dynamic music player. @@ -142,4 +142,4 @@ extern AUD_API int AUD_DynamicMusic_stop(AUD_DynamicMusic* player); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/extern/audaspace/bindings/C/AUD_Handle.cpp b/extern/audaspace/bindings/C/AUD_Handle.cpp index 265c7bf08d2..88d46d635e3 100644 --- a/extern/audaspace/bindings/C/AUD_Handle.cpp +++ b/extern/audaspace/bindings/C/AUD_Handle.cpp @@ -259,13 +259,13 @@ AUD_API int AUD_Handle_setPitch(AUD_Handle* handle, float value) return (*handle)->setPitch(value); } -AUD_API float AUD_Handle_getPosition(AUD_Handle* handle) +AUD_API double AUD_Handle_getPosition(AUD_Handle* handle) { assert(handle); return (*handle)->getPosition(); } -AUD_API int AUD_Handle_setPosition(AUD_Handle* handle, float value) +AUD_API int AUD_Handle_setPosition(AUD_Handle* handle, double value) { assert(handle); return (*handle)->seek(value); diff --git a/extern/audaspace/bindings/C/AUD_Handle.h b/extern/audaspace/bindings/C/AUD_Handle.h index 27cbd251de5..2182346c451 100644 --- a/extern/audaspace/bindings/C/AUD_Handle.h +++ b/extern/audaspace/bindings/C/AUD_Handle.h @@ -211,14 +211,14 @@ extern AUD_API int AUD_Handle_setPitch(AUD_Handle* handle, float value); * param handle The handle to get the position from. * return The position of the handle. */ -extern AUD_API float AUD_Handle_getPosition(AUD_Handle* handle); +extern AUD_API double AUD_Handle_getPosition(AUD_Handle* handle); /** * Sets the position of a handle. * param handle The handle to set the position from. * param value The new position to set. */ -extern AUD_API int AUD_Handle_setPosition(AUD_Handle* handle, float value); +extern AUD_API int AUD_Handle_setPosition(AUD_Handle* handle, double value); /** * Retrieves the relative of a handle. diff --git a/extern/audaspace/bindings/C/AUD_Sequence.cpp b/extern/audaspace/bindings/C/AUD_Sequence.cpp index d278cb148a1..e3f88629657 100644 --- a/extern/audaspace/bindings/C/AUD_Sequence.cpp +++ b/extern/audaspace/bindings/C/AUD_Sequence.cpp @@ -41,7 +41,7 @@ AUD_API void AUD_Sequence_free(AUD_Sound* sequence) delete sequence; } -AUD_API AUD_SequenceEntry* AUD_Sequence_add(AUD_Sound* sequence, AUD_Sound* sound, float begin, float end, float skip) +AUD_API AUD_SequenceEntry* AUD_Sequence_add(AUD_Sound* sequence, AUD_Sound* sound, double begin, double end, double skip) { if(!sound) return new AUD_SequenceEntry(((Sequence *)sequence->get())->add(AUD_Sound(), begin, end, skip)); @@ -160,7 +160,7 @@ AUD_API void AUD_Sequence_setSpeedOfSound(AUD_Sound* sequence, float value) -AUD_API void AUD_SequenceEntry_move(AUD_SequenceEntry* entry, float begin, float end, float skip) +AUD_API void AUD_SequenceEntry_move(AUD_SequenceEntry* entry, double begin, double end, double skip) { (*entry)->move(begin, end, skip); } diff --git a/extern/audaspace/bindings/C/AUD_Sequence.h b/extern/audaspace/bindings/C/AUD_Sequence.h index 668960c7d50..bdf1a61a2de 100644 --- a/extern/audaspace/bindings/C/AUD_Sequence.h +++ b/extern/audaspace/bindings/C/AUD_Sequence.h @@ -55,7 +55,7 @@ extern AUD_API void AUD_Sequence_free(AUD_Sound* sequence); * \param skip How much seconds should be skipped at the beginning. * \return The entry added. */ -extern AUD_API AUD_SequenceEntry* AUD_Sequence_add(AUD_Sound* sequence, AUD_Sound* sound, float begin, float end, float skip); +extern AUD_API AUD_SequenceEntry* AUD_Sequence_add(AUD_Sound* sequence, AUD_Sound* sound, double begin, double end, double skip); /** * Removes an entry from the scene. @@ -167,7 +167,7 @@ extern AUD_API void AUD_Sequence_setSpeedOfSound(AUD_Sound* sequence, float valu * \param end The new end time or a negative value if unknown. * \param skip How many seconds to skip at the beginning. */ -extern AUD_API void AUD_SequenceEntry_move(AUD_SequenceEntry* entry, float begin, float end, float skip); +extern AUD_API void AUD_SequenceEntry_move(AUD_SequenceEntry* entry, double begin, double end, double skip); /** * Writes animation data to a sequenced entry. diff --git a/extern/audaspace/bindings/C/AUD_Special.cpp b/extern/audaspace/bindings/C/AUD_Special.cpp index 30148fa1487..c7155276a30 100644 --- a/extern/audaspace/bindings/C/AUD_Special.cpp +++ b/extern/audaspace/bindings/C/AUD_Special.cpp @@ -175,7 +175,7 @@ static void pauseSound(AUD_Handle* handle) (*handle)->pause(); } -AUD_API AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, float seconds) +AUD_API AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, double seconds) { auto device = DeviceManager::getDevice(); @@ -336,7 +336,7 @@ AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned int start } } -AUD_API AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* sequencer, float volume, float start) +AUD_API AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* sequencer, float volume, double start) { try { diff --git a/extern/audaspace/bindings/C/AUD_Special.h b/extern/audaspace/bindings/C/AUD_Special.h index ab79ae915a2..9faf9e4ee74 100644 --- a/extern/audaspace/bindings/C/AUD_Special.h +++ b/extern/audaspace/bindings/C/AUD_Special.h @@ -45,7 +45,7 @@ extern AUD_API float* AUD_readSoundBuffer(const char* filename, float low, float * \param seconds The time in seconds. * \return The silence handle. */ -extern AUD_API AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, float seconds); +extern AUD_API AUD_Handle* AUD_pauseAfter(AUD_Handle* handle, double seconds); /** * Reads a sound into a buffer for drawing at a specific sampling rate. @@ -101,7 +101,7 @@ extern AUD_API const char* AUD_mixdown_per_channel(AUD_Sound* sound, unsigned in * \param start The start time of the mixdown in the sound scene. * \return The read device for the mixdown. */ -extern AUD_API AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* sequencer, float volume, float start); +extern AUD_API AUD_Device* AUD_openMixdownDevice(AUD_DeviceSpecs specs, AUD_Sound* sequencer, float volume, double start); /** * Initializes audio routines (FFMPEG/JACK if it is enabled). diff --git a/extern/audaspace/bindings/doc/device.rst b/extern/audaspace/bindings/doc/device.rst index fd6b334022c..d6f49bd7407 100644 --- a/extern/audaspace/bindings/doc/device.rst +++ b/extern/audaspace/bindings/doc/device.rst @@ -4,4 +4,5 @@ Device .. currentmodule:: aud .. autoclass:: Device :members: + :noindex: diff --git a/extern/audaspace/bindings/doc/handle.rst b/extern/audaspace/bindings/doc/handle.rst index aceedbca3a6..1d118e1ef62 100644 --- a/extern/audaspace/bindings/doc/handle.rst +++ b/extern/audaspace/bindings/doc/handle.rst @@ -4,4 +4,5 @@ Handle .. currentmodule:: aud .. autoclass:: Handle :members: + :noindex: diff --git a/extern/audaspace/bindings/doc/index.rst b/extern/audaspace/bindings/doc/index.rst index b8a26822949..cc6a543067d 100644 --- a/extern/audaspace/bindings/doc/index.rst +++ b/extern/audaspace/bindings/doc/index.rst @@ -7,6 +7,7 @@ Welcome to audaspace's documentation! ===================================== .. automodule:: aud + :no-members: This documentation is valid for both the Python and C bindings of audaspace. If you are looking for installation instructions check the `C++ API documentation <../index.html>`_. As C is not an object oriented language everything is accessible via functions where the first paramter is always the object. For methods these are named as ``AUD_ClassName_method()`` and properties are accessed via ``AUD_ClassName_property_get/set()``. Python users simply ``import aud`` to access the library. @@ -18,7 +19,7 @@ This documentation is valid for both the Python and C bindings of audaspace. If Classes: .. toctree:: - :maxdepth: 2 + :maxdepth: 1 device sound diff --git a/extern/audaspace/bindings/doc/sequence.rst b/extern/audaspace/bindings/doc/sequence.rst index 16fcb00f4dc..51aef1a1d37 100644 --- a/extern/audaspace/bindings/doc/sequence.rst +++ b/extern/audaspace/bindings/doc/sequence.rst @@ -4,4 +4,5 @@ Sequence .. currentmodule:: aud .. autoclass:: Sequence :members: + :noindex: diff --git a/extern/audaspace/bindings/doc/sequence_entry.rst b/extern/audaspace/bindings/doc/sequence_entry.rst index 0a3d83388e9..797b950dcdd 100644 --- a/extern/audaspace/bindings/doc/sequence_entry.rst +++ b/extern/audaspace/bindings/doc/sequence_entry.rst @@ -4,4 +4,5 @@ Sequence Entry .. currentmodule:: aud .. autoclass:: SequenceEntry :members: + :noindex: diff --git a/extern/audaspace/bindings/doc/sound.rst b/extern/audaspace/bindings/doc/sound.rst index 2f14721cf3a..d88c113eead 100644 --- a/extern/audaspace/bindings/doc/sound.rst +++ b/extern/audaspace/bindings/doc/sound.rst @@ -4,4 +4,5 @@ Sound .. currentmodule:: aud .. autoclass:: Sound :members: + :noindex: diff --git a/extern/audaspace/bindings/doc/tutorials.rst b/extern/audaspace/bindings/doc/tutorials.rst index 2a0e7541861..919c9083fc8 100644 --- a/extern/audaspace/bindings/doc/tutorials.rst +++ b/extern/audaspace/bindings/doc/tutorials.rst @@ -40,7 +40,7 @@ and create a :func:`aud.Sound.sine` signal with a frequency of 440 Hz. sine = aud.Sound.sine(440) .. note:: At this point nothing is playing back yet, -:class:`aud.Sound` objects are just descriptions of sounds. + :class:`aud.Sound` objects are just descriptions of sounds. However instead of a sine wave, we would like to have a square wave to produce a more retro gaming sound. We could of course use the diff --git a/extern/audaspace/bindings/python/PyDynamicMusic.cpp b/extern/audaspace/bindings/python/PyDynamicMusic.cpp index cab856359e0..8a7d8265bf4 100644 --- a/extern/audaspace/bindings/python/PyDynamicMusic.cpp +++ b/extern/audaspace/bindings/python/PyDynamicMusic.cpp @@ -228,9 +228,9 @@ PyDoc_STRVAR(M_aud_DynamicMusic_position_doc, static int DynamicMusic_set_position(DynamicMusicP* self, PyObject* args, void* nothing) { - float position; + double position; - if(!PyArg_Parse(args, "f:position", &position)) + if(!PyArg_Parse(args, "d:position", &position)) return -1; try @@ -252,7 +252,7 @@ DynamicMusic_get_position(DynamicMusicP* self, void* nothing) { try { - return Py_BuildValue("f", (*reinterpret_cast*>(self->dynamicMusic))->getPosition()); + return Py_BuildValue("d", (*reinterpret_cast*>(self->dynamicMusic))->getPosition()); } catch(aud::Exception& e) { diff --git a/extern/audaspace/bindings/python/PyHandle.cpp b/extern/audaspace/bindings/python/PyHandle.cpp index 828c1b1afef..4ecf2ffd210 100644 --- a/extern/audaspace/bindings/python/PyHandle.cpp +++ b/extern/audaspace/bindings/python/PyHandle.cpp @@ -696,7 +696,7 @@ Handle_get_position(Handle* self, void* nothing) { try { - return Py_BuildValue("f", (*reinterpret_cast*>(self->handle))->getPosition()); + return Py_BuildValue("d", (*reinterpret_cast*>(self->handle))->getPosition()); } catch(Exception& e) { @@ -708,9 +708,9 @@ Handle_get_position(Handle* self, void* nothing) static int Handle_set_position(Handle* self, PyObject* args, void* nothing) { - float position; + double position; - if(!PyArg_Parse(args, "f:position", &position)) + if(!PyArg_Parse(args, "d:position", &position)) return -1; try diff --git a/extern/audaspace/bindings/python/PySequence.cpp b/extern/audaspace/bindings/python/PySequence.cpp index 2e08059cefb..26f0c9e566f 100644 --- a/extern/audaspace/bindings/python/PySequence.cpp +++ b/extern/audaspace/bindings/python/PySequence.cpp @@ -104,11 +104,11 @@ PyDoc_STRVAR(M_aud_Sequence_add_doc, " :arg sound: The sound this entry should play.\n" " :type sound: :class:`Sound`\n" " :arg begin: The start time.\n" - " :type begin: float\n" + " :type begin: double\n" " :arg end: The end time or a negative value if determined by the sound.\n" - " :type end: float\n" + " :type end: double\n" " :arg skip: How much seconds should be skipped at the beginning.\n" - " :type skip: float\n" + " :type skip: double\n" " :return: The entry added.\n" " :rtype: :class:`SequenceEntry`"); @@ -116,13 +116,13 @@ static PyObject * Sequence_add(Sequence* self, PyObject* args, PyObject* kwds) { PyObject* object; - float begin; - float end = -1.0f; - float skip = 0.0f; + double begin; + double end = -1.0; + double skip = 0.0; static const char* kwlist[] = {"sound", "begin", "end", "skip", nullptr}; - if(!PyArg_ParseTupleAndKeywords(args, kwds, "Of|ff:add", const_cast(kwlist), &object, &begin, &end, &skip)) + if(!PyArg_ParseTupleAndKeywords(args, kwds, "Od|dd:add", const_cast(kwlist), &object, &begin, &end, &skip)) return nullptr; Sound* sound = checkSound(object); diff --git a/extern/audaspace/bindings/python/PySequenceEntry.cpp b/extern/audaspace/bindings/python/PySequenceEntry.cpp index a1bf3db21d2..74c038de0b0 100644 --- a/extern/audaspace/bindings/python/PySequenceEntry.cpp +++ b/extern/audaspace/bindings/python/PySequenceEntry.cpp @@ -46,18 +46,18 @@ PyDoc_STRVAR(M_aud_SequenceEntry_move_doc, ".. classmethod:: move()\n\n" " Moves the entry.\n\n" " :arg begin: The new start time.\n" - " :type begin: float\n" + " :type begin: double\n" " :arg end: The new end time or a negative value if unknown.\n" - " :type end: float\n" + " :type end: double\n" " :arg skip: How many seconds to skip at the beginning.\n" - " :type skip: float\n"); + " :type skip: double\n"); static PyObject * SequenceEntry_move(SequenceEntry* self, PyObject* args) { - float begin, end, skip; + double begin, end, skip; - if(!PyArg_ParseTuple(args, "fff:move", &begin, &end, &skip)) + if(!PyArg_ParseTuple(args, "ddd:move", &begin, &end, &skip)) return nullptr; try diff --git a/extern/audaspace/bindings/python/PySound.cpp b/extern/audaspace/bindings/python/PySound.cpp index c37e3f7fa52..62ee3435e82 100644 --- a/extern/audaspace/bindings/python/PySound.cpp +++ b/extern/audaspace/bindings/python/PySound.cpp @@ -1394,7 +1394,7 @@ PyDoc_STRVAR(M_aud_Sound_threshold_doc, " with a amplitude >= threshold to 1, all <= -threshold to -1 and\n" " all between to 0.\n\n" " :arg threshold: Threshold value over which an amplitude counts\n" - " non-zero.\n" + " non-zero.\n\n" ":type threshold: float\n" ":return: The created :class:`Sound` object.\n" ":rtype: :class:`Sound`"); @@ -1434,7 +1434,8 @@ PyDoc_STRVAR(M_aud_Sound_volume_doc, " :type volume: float\n" " :return: The created :class:`Sound` object.\n" " :rtype: :class:`Sound`\n\n" - " .. note:: Should be in the range [0, 1] to avoid clipping.\n\n" + " .. note::\n\n" + " Should be in the range [0, 1] to avoid clipping.\n\n" " .. note::\n\n" " This is a filter function, you might consider using\n" " :attr:`Handle.volume` instead."); @@ -1475,8 +1476,8 @@ PyDoc_STRVAR(M_aud_Sound_join_doc, " :return: The created :class:`Sound` object.\n" " :rtype: :class:`Sound`\n\n" " .. note::\n\n" - " The two factories have to have the same specifications\n" - " (channels and samplerate)."); + " The two factories have to have the same specifications\n" + " (channels and samplerate)."); static PyObject * Sound_join(Sound* self, PyObject* object) diff --git a/extern/audaspace/include/devices/DefaultSynchronizer.h b/extern/audaspace/include/devices/DefaultSynchronizer.h index 31f6c65219c..e818306603c 100644 --- a/extern/audaspace/include/devices/DefaultSynchronizer.h +++ b/extern/audaspace/include/devices/DefaultSynchronizer.h @@ -33,8 +33,8 @@ AUD_NAMESPACE_BEGIN class AUD_API DefaultSynchronizer : public ISynchronizer { public: - virtual void seek(std::shared_ptr handle, float time); - virtual float getPosition(std::shared_ptr handle); + virtual void seek(std::shared_ptr handle, double time); + virtual double getPosition(std::shared_ptr handle); virtual void play(); virtual void stop(); virtual void setSyncCallback(syncFunction function, void* data); diff --git a/extern/audaspace/include/devices/IDeviceFactory.h b/extern/audaspace/include/devices/IDeviceFactory.h index 7023cc058c5..c0769fa8015 100644 --- a/extern/audaspace/include/devices/IDeviceFactory.h +++ b/extern/audaspace/include/devices/IDeviceFactory.h @@ -35,6 +35,9 @@ AUD_NAMESPACE_BEGIN class AUD_API IDeviceFactory { public: + /** + * Destroys the device factory. + */ virtual ~IDeviceFactory() {} /** diff --git a/extern/audaspace/include/devices/IHandle.h b/extern/audaspace/include/devices/IHandle.h index 3f42fc33c3a..a10ef3d71e4 100644 --- a/extern/audaspace/include/devices/IHandle.h +++ b/extern/audaspace/include/devices/IHandle.h @@ -105,14 +105,14 @@ public: * - false if the handle is invalid. * \warning Whether the seek works or not depends on the sound source. */ - virtual bool seek(float position)=0; + virtual bool seek(double position)=0; /** * Retrieves the current playback position of a sound. * \return The playback position in seconds, or 0.0 if the handle is * invalid. */ - virtual float getPosition()=0; + virtual double getPosition()=0; /** * Returns the status of a played back sound. diff --git a/extern/audaspace/include/devices/ISynchronizer.h b/extern/audaspace/include/devices/ISynchronizer.h index 6f14de59565..430230fbcb3 100644 --- a/extern/audaspace/include/devices/ISynchronizer.h +++ b/extern/audaspace/include/devices/ISynchronizer.h @@ -56,14 +56,14 @@ public: * @param handle The handle that should be synchronized/seeked. * @param time The absolute time to synchronize to. */ - virtual void seek(std::shared_ptr handle, float time) = 0; + virtual void seek(std::shared_ptr handle, double time) = 0; /** * Retrieves the position of the synchronizer. * @param handle The handle which is synchronized. * @return The position in seconds. */ - virtual float getPosition(std::shared_ptr handle) = 0; + virtual double getPosition(std::shared_ptr handle) = 0; /** * Starts the synchronizer playback. diff --git a/extern/audaspace/include/devices/NULLDevice.h b/extern/audaspace/include/devices/NULLDevice.h index 76211a799b9..9af78919f88 100644 --- a/extern/audaspace/include/devices/NULLDevice.h +++ b/extern/audaspace/include/devices/NULLDevice.h @@ -53,8 +53,8 @@ private: virtual bool stop(); virtual bool getKeep(); virtual bool setKeep(bool keep); - virtual bool seek(float position); - virtual float getPosition(); + virtual bool seek(double position); + virtual double getPosition(); virtual Status getStatus(); virtual float getVolume(); virtual bool setVolume(float volume); diff --git a/extern/audaspace/include/devices/SoftwareDevice.h b/extern/audaspace/include/devices/SoftwareDevice.h index 8f3846394c6..e92a35e5402 100644 --- a/extern/audaspace/include/devices/SoftwareDevice.h +++ b/extern/audaspace/include/devices/SoftwareDevice.h @@ -180,8 +180,8 @@ protected: virtual bool stop(); virtual bool getKeep(); virtual bool setKeep(bool keep); - virtual bool seek(float position); - virtual float getPosition(); + virtual bool seek(double position); + virtual double getPosition(); virtual Status getStatus(); virtual float getVolume(); virtual bool setVolume(float volume); diff --git a/extern/audaspace/include/file/IFileInput.h b/extern/audaspace/include/file/IFileInput.h index aec929e7639..64074910d13 100644 --- a/extern/audaspace/include/file/IFileInput.h +++ b/extern/audaspace/include/file/IFileInput.h @@ -40,7 +40,10 @@ class Buffer; class AUD_API IFileInput { public: - virtual ~IFileInput() {}; + /** + * Destroys the file input. + */ + virtual ~IFileInput() {} /** * Creates a reader for a file to be read. diff --git a/extern/audaspace/include/fx/Delay.h b/extern/audaspace/include/fx/Delay.h index d6ab93ca351..d8730802c6f 100644 --- a/extern/audaspace/include/fx/Delay.h +++ b/extern/audaspace/include/fx/Delay.h @@ -35,7 +35,7 @@ private: /** * The delay in samples. */ - const float m_delay; + const double m_delay; // delete copy constructor and operator= Delay(const Delay&) = delete; @@ -47,12 +47,12 @@ public: * \param sound The input sound. * \param delay The desired delay in seconds. */ - Delay(std::shared_ptr sound, float delay = 0); + Delay(std::shared_ptr sound, double delay = 0); /** * Returns the delay in seconds. */ - float getDelay() const; + double getDelay() const; virtual std::shared_ptr createReader(); }; diff --git a/extern/audaspace/include/fx/DelayReader.h b/extern/audaspace/include/fx/DelayReader.h index fe37e56d83e..38106082020 100644 --- a/extern/audaspace/include/fx/DelayReader.h +++ b/extern/audaspace/include/fx/DelayReader.h @@ -52,7 +52,7 @@ public: * \param reader The reader to read from. * \param delay The delay in seconds. */ - DelayReader(std::shared_ptr reader, float delay); + DelayReader(std::shared_ptr reader, double delay); virtual void seek(int position); virtual int getLength() const; diff --git a/extern/audaspace/include/fx/DynamicMusic.h b/extern/audaspace/include/fx/DynamicMusic.h index 5d59f77401a..c2a1c75b47e 100644 --- a/extern/audaspace/include/fx/DynamicMusic.h +++ b/extern/audaspace/include/fx/DynamicMusic.h @@ -55,7 +55,7 @@ private: /** * Length of the crossfade transition in seconds, used when no custom transition has been set. */ - float m_fadeTime; + double m_fadeTime; /** * Handle to the playback of the current scene. @@ -145,13 +145,13 @@ public: * Sets the length of the crossfade transition (default 1 second). * \param seconds The time in seconds. */ - void setFadeTime(float seconds); + void setFadeTime(double seconds); /** * Gets the length of the crossfade transition (default 1 second). * \return The length of the cressfade transition in seconds. */ - float getFadeTime(); + double getFadeTime(); /** * Resumes a paused sound. @@ -177,14 +177,14 @@ public: * - false if the handle is invalid. * \warning Whether the seek works or not depends on the sound source. */ - bool seek(float position); + bool seek(double position); /** * Retrieves the current playback position of a sound. * \return The playback position in seconds, or 0.0 if the handle is * invalid. */ - float getPosition(); + double getPosition(); /** * Retrieves the volume of the scenes. diff --git a/extern/audaspace/include/fx/Fader.h b/extern/audaspace/include/fx/Fader.h index 63280aec292..452d525e8ca 100644 --- a/extern/audaspace/include/fx/Fader.h +++ b/extern/audaspace/include/fx/Fader.h @@ -43,12 +43,12 @@ private: /** * The fading start. */ - const float m_start; + const double m_start; /** * The fading length. */ - const float m_length; + const double m_length; // delete copy constructor and operator= Fader(const Fader&) = delete; @@ -64,7 +64,7 @@ public: */ Fader(std::shared_ptr sound, FadeType type = FADE_IN, - float start = 0.0f, float length = 1.0f); + double start = 0, double length = 1); /** * Returns the fading type. @@ -74,12 +74,12 @@ public: /** * Returns the fading start. */ - float getStart() const; + double getStart() const; /** * Returns the fading length. */ - float getLength() const; + double getLength() const; virtual std::shared_ptr createReader(); }; diff --git a/extern/audaspace/include/fx/FaderReader.h b/extern/audaspace/include/fx/FaderReader.h index 99ea3d28938..9e5fc6d265f 100644 --- a/extern/audaspace/include/fx/FaderReader.h +++ b/extern/audaspace/include/fx/FaderReader.h @@ -49,12 +49,12 @@ private: /** * The fading start. */ - const float m_start; + const double m_start; /** * The fading length. */ - const float m_length; + const double m_length; // delete copy constructor and operator= FaderReader(const FaderReader&) = delete; @@ -69,7 +69,7 @@ public: * \param length How long fading should last in seconds. */ FaderReader(std::shared_ptr reader, FadeType type, - float start,float length); + double start,double length); virtual void read(int& length, bool& eos, sample_t* buffer); }; diff --git a/extern/audaspace/include/fx/Limiter.h b/extern/audaspace/include/fx/Limiter.h index 0b5451b4eed..b3cf598db2e 100644 --- a/extern/audaspace/include/fx/Limiter.h +++ b/extern/audaspace/include/fx/Limiter.h @@ -35,12 +35,12 @@ private: /** * The start time. */ - const float m_start; + const double m_start; /** * The end time. */ - const float m_end; + const double m_end; // delete copy constructor and operator= Limiter(const Limiter&) = delete; @@ -55,17 +55,17 @@ public: * play to the end. */ Limiter(std::shared_ptr sound, - float start = 0, float end = -1); + double start = 0, double end = -1); /** * Returns the start time. */ - float getStart() const; + double getStart() const; /** * Returns the end time. */ - float getEnd() const; + double getEnd() const; virtual std::shared_ptr createReader(); }; diff --git a/extern/audaspace/include/fx/LimiterReader.h b/extern/audaspace/include/fx/LimiterReader.h index 49a07b5c29e..00ad02e343d 100644 --- a/extern/audaspace/include/fx/LimiterReader.h +++ b/extern/audaspace/include/fx/LimiterReader.h @@ -35,12 +35,12 @@ private: /** * The start sample: inclusive. */ - const float m_start; + const double m_start; /** * The end sample: exlusive. */ - const float m_end; + const double m_end; // delete copy constructor and operator= LimiterReader(const LimiterReader&) = delete; @@ -54,7 +54,7 @@ public: * \param end The desired end time (sample exklusive), a negative value * signals that it should play to the end. */ - LimiterReader(std::shared_ptr reader, float start = 0, float end = -1); + LimiterReader(std::shared_ptr reader, double start = 0, double end = -1); virtual void seek(int position); virtual int getLength() const; diff --git a/extern/audaspace/include/sequence/Sequence.h b/extern/audaspace/include/sequence/Sequence.h index 7005171e2c8..de14fd9fa38 100644 --- a/extern/audaspace/include/sequence/Sequence.h +++ b/extern/audaspace/include/sequence/Sequence.h @@ -151,7 +151,7 @@ public: * \param skip How much seconds should be skipped at the beginning. * \return The entry added. */ - std::shared_ptr add(std::shared_ptr sound, float begin, float end, float skip); + std::shared_ptr add(std::shared_ptr sound, double begin, double end, double skip); /** * Removes an entry from the scene. diff --git a/extern/audaspace/include/sequence/SequenceData.h b/extern/audaspace/include/sequence/SequenceData.h index b3df0548a4d..c3380e66924 100644 --- a/extern/audaspace/include/sequence/SequenceData.h +++ b/extern/audaspace/include/sequence/SequenceData.h @@ -203,7 +203,7 @@ public: * \param skip How much seconds should be skipped at the beginning. * \return The entry added. */ - std::shared_ptr add(std::shared_ptr sound, float begin, float end, float skip); + std::shared_ptr add(std::shared_ptr sound, double begin, double end, double skip); /** * Removes an entry from the scene. diff --git a/extern/audaspace/include/sequence/SequenceEntry.h b/extern/audaspace/include/sequence/SequenceEntry.h index 98f15faf7ff..b8e9f116ee4 100644 --- a/extern/audaspace/include/sequence/SequenceEntry.h +++ b/extern/audaspace/include/sequence/SequenceEntry.h @@ -55,13 +55,13 @@ private: std::shared_ptr m_sound; /// The begin time. - float m_begin; + double m_begin; /// The end time. - float m_end; + double m_end; /// How many seconds are skipped at the beginning. - float m_skip; + double m_skip; /// Whether the entry is muted. bool m_muted; @@ -124,7 +124,7 @@ public: * \param skip How much seconds should be skipped at the beginning. * \param id The ID of the entry. */ - SequenceEntry(std::shared_ptr sound, float begin, float end, float skip, int id); + SequenceEntry(std::shared_ptr sound, double begin, double end, double skip, int id); virtual ~SequenceEntry(); /** @@ -155,7 +155,7 @@ public: * \param end The new end time or a negative value if unknown. * \param skip How many seconds to skip at the beginning. */ - void move(float begin, float end, float skip); + void move(double begin, double end, double skip); /** * Retrieves the muting state of the entry. diff --git a/extern/audaspace/plugins/jack/JackDevice.cpp b/extern/audaspace/plugins/jack/JackDevice.cpp index 1d238f74c3a..32874fd1315 100644 --- a/extern/audaspace/plugins/jack/JackDevice.cpp +++ b/extern/audaspace/plugins/jack/JackDevice.cpp @@ -292,7 +292,7 @@ void JackDevice::stopPlayback() m_nextState = JackTransportStopped; } -void JackDevice::seekPlayback(float time) +void JackDevice::seekPlayback(double time) { if(time >= 0.0f) AUD_jack_transport_locate(m_client, time * m_specs.rate); @@ -304,11 +304,11 @@ void JackDevice::setSyncCallback(ISynchronizer::syncFunction sync, void* data) m_syncFuncData = data; } -float JackDevice::getPlaybackPosition() +double JackDevice::getPlaybackPosition() { jack_position_t position; AUD_jack_transport_query(m_client, &position); - return position.frame / (float) m_specs.rate; + return position.frame / (double) m_specs.rate; } bool JackDevice::doesPlayback() diff --git a/extern/audaspace/plugins/jack/JackDevice.h b/extern/audaspace/plugins/jack/JackDevice.h index 72143eda149..4e6b1f5d12c 100644 --- a/extern/audaspace/plugins/jack/JackDevice.h +++ b/extern/audaspace/plugins/jack/JackDevice.h @@ -174,7 +174,7 @@ public: * Seeks jack transport playback. * \param time The time to seek to. */ - void seekPlayback(float time); + void seekPlayback(double time); /** * Sets the sync callback for jack transport playback. @@ -187,7 +187,7 @@ public: * Retrieves the jack transport playback time. * \return The current time position. */ - float getPlaybackPosition(); + double getPlaybackPosition(); /** * Returns whether jack transport plays back. diff --git a/extern/audaspace/plugins/jack/JackSynchronizer.cpp b/extern/audaspace/plugins/jack/JackSynchronizer.cpp index cd4c448786d..0bcafa19ca5 100644 --- a/extern/audaspace/plugins/jack/JackSynchronizer.cpp +++ b/extern/audaspace/plugins/jack/JackSynchronizer.cpp @@ -25,12 +25,12 @@ JackSynchronizer::JackSynchronizer(JackDevice* device) : { } -void JackSynchronizer::seek(std::shared_ptr handle, float time) +void JackSynchronizer::seek(std::shared_ptr handle, double time) { m_device->seekPlayback(time); } -float JackSynchronizer::getPosition(std::shared_ptr handle) +double JackSynchronizer::getPosition(std::shared_ptr handle) { return m_device->getPlaybackPosition(); } diff --git a/extern/audaspace/plugins/jack/JackSynchronizer.h b/extern/audaspace/plugins/jack/JackSynchronizer.h index 5c7341a7872..8a1f930ebed 100644 --- a/extern/audaspace/plugins/jack/JackSynchronizer.h +++ b/extern/audaspace/plugins/jack/JackSynchronizer.h @@ -48,8 +48,8 @@ public: */ JackSynchronizer(JackDevice* device); - virtual void seek(std::shared_ptr handle, float time); - virtual float getPosition(std::shared_ptr handle); + virtual void seek(std::shared_ptr handle, double time); + virtual double getPosition(std::shared_ptr handle); virtual void play(); virtual void stop(); virtual void setSyncCallback(syncFunction function, void* data); diff --git a/extern/audaspace/plugins/openal/OpenALDevice.cpp b/extern/audaspace/plugins/openal/OpenALDevice.cpp index f41e9c6bef8..536ec4ccb1b 100644 --- a/extern/audaspace/plugins/openal/OpenALDevice.cpp +++ b/extern/audaspace/plugins/openal/OpenALDevice.cpp @@ -269,7 +269,7 @@ bool OpenALDevice::OpenALHandle::setKeep(bool keep) return true; } -bool OpenALDevice::OpenALHandle::seek(float position) +bool OpenALDevice::OpenALHandle::seek(double position) { if(!m_status) return false; @@ -335,7 +335,7 @@ bool OpenALDevice::OpenALHandle::seek(float position) return true; } -float OpenALDevice::OpenALHandle::getPosition() +double OpenALDevice::OpenALHandle::getPosition() { if(!m_status) return false; diff --git a/extern/audaspace/plugins/openal/OpenALDevice.h b/extern/audaspace/plugins/openal/OpenALDevice.h index c2bec443933..b6ba5456d85 100644 --- a/extern/audaspace/plugins/openal/OpenALDevice.h +++ b/extern/audaspace/plugins/openal/OpenALDevice.h @@ -126,8 +126,8 @@ private: virtual bool stop(); virtual bool getKeep(); virtual bool setKeep(bool keep); - virtual bool seek(float position); - virtual float getPosition(); + virtual bool seek(double position); + virtual double getPosition(); virtual Status getStatus(); virtual float getVolume(); virtual bool setVolume(float volume); diff --git a/extern/audaspace/src/devices/DefaultSynchronizer.cpp b/extern/audaspace/src/devices/DefaultSynchronizer.cpp index aa8945dadaa..3ef1f0bfc41 100644 --- a/extern/audaspace/src/devices/DefaultSynchronizer.cpp +++ b/extern/audaspace/src/devices/DefaultSynchronizer.cpp @@ -19,12 +19,12 @@ AUD_NAMESPACE_BEGIN -void DefaultSynchronizer::seek(std::shared_ptr handle, float time) +void DefaultSynchronizer::seek(std::shared_ptr handle, double time) { handle->seek(time); } -float DefaultSynchronizer::getPosition(std::shared_ptr handle) +double DefaultSynchronizer::getPosition(std::shared_ptr handle) { return handle->getPosition(); } diff --git a/extern/audaspace/src/devices/NULLDevice.cpp b/extern/audaspace/src/devices/NULLDevice.cpp index a82537f43b2..c3290465563 100644 --- a/extern/audaspace/src/devices/NULLDevice.cpp +++ b/extern/audaspace/src/devices/NULLDevice.cpp @@ -52,12 +52,12 @@ bool NULLDevice::NULLHandle::setKeep(bool keep) return false; } -bool NULLDevice::NULLHandle::seek(float position) +bool NULLDevice::NULLHandle::seek(double position) { return false; } -float NULLDevice::NULLHandle::getPosition() +double NULLDevice::NULLHandle::getPosition() { return std::numeric_limits::quiet_NaN(); } diff --git a/extern/audaspace/src/devices/SoftwareDevice.cpp b/extern/audaspace/src/devices/SoftwareDevice.cpp index 8c16c75e8e3..7186f8b9442 100644 --- a/extern/audaspace/src/devices/SoftwareDevice.cpp +++ b/extern/audaspace/src/devices/SoftwareDevice.cpp @@ -347,7 +347,7 @@ bool SoftwareDevice::SoftwareHandle::setKeep(bool keep) return true; } -bool SoftwareDevice::SoftwareHandle::seek(float position) +bool SoftwareDevice::SoftwareHandle::seek(double position) { if(!m_status) return false; @@ -366,7 +366,7 @@ bool SoftwareDevice::SoftwareHandle::seek(float position) return true; } -float SoftwareDevice::SoftwareHandle::getPosition() +double SoftwareDevice::SoftwareHandle::getPosition() { if(!m_status) return false; @@ -376,7 +376,7 @@ float SoftwareDevice::SoftwareHandle::getPosition() if(!m_status) return 0.0f; - float position = m_reader->getPosition() / (float)m_device->m_specs.rate; + double position = m_reader->getPosition() / (double)m_device->m_specs.rate; return position; } diff --git a/extern/audaspace/src/fx/Delay.cpp b/extern/audaspace/src/fx/Delay.cpp index e2a82299bc0..3ce16f54636 100644 --- a/extern/audaspace/src/fx/Delay.cpp +++ b/extern/audaspace/src/fx/Delay.cpp @@ -19,13 +19,13 @@ AUD_NAMESPACE_BEGIN -Delay::Delay(std::shared_ptr sound, float delay) : +Delay::Delay(std::shared_ptr sound, double delay) : Effect(sound), m_delay(delay) { } -float Delay::getDelay() const +double Delay::getDelay() const { return m_delay; } diff --git a/extern/audaspace/src/fx/DelayReader.cpp b/extern/audaspace/src/fx/DelayReader.cpp index 530aed69cba..ec171a76f93 100644 --- a/extern/audaspace/src/fx/DelayReader.cpp +++ b/extern/audaspace/src/fx/DelayReader.cpp @@ -20,7 +20,7 @@ AUD_NAMESPACE_BEGIN -DelayReader::DelayReader(std::shared_ptr reader, float delay) : +DelayReader::DelayReader(std::shared_ptr reader, double delay) : EffectReader(reader), m_delay(int((SampleRate)delay * reader->getSpecs().rate)), m_remdelay(int((SampleRate)delay * reader->getSpecs().rate)) diff --git a/extern/audaspace/src/fx/DynamicMusic.cpp b/extern/audaspace/src/fx/DynamicMusic.cpp index b8f5c975b3f..ad4a76fee95 100644 --- a/extern/audaspace/src/fx/DynamicMusic.cpp +++ b/extern/audaspace/src/fx/DynamicMusic.cpp @@ -133,14 +133,14 @@ bool DynamicMusic::addTransition(int init, int end, std::shared_ptr soun return false; } -void DynamicMusic::setFadeTime(float seconds) +void DynamicMusic::setFadeTime(double seconds) { m_device->lock(); m_fadeTime = seconds; m_device->unlock(); } -float DynamicMusic::getFadeTime() +double DynamicMusic::getFadeTime() { return m_fadeTime; } @@ -169,7 +169,7 @@ bool DynamicMusic::pause() return result || resultTrans; } -bool DynamicMusic::seek(float position) +bool DynamicMusic::seek(double position) { bool result = false; @@ -183,9 +183,9 @@ bool DynamicMusic::seek(float position) return result; } -float DynamicMusic::getPosition() +double DynamicMusic::getPosition() { - float result = 0.0f; + double result = 0.0f; if(m_currentHandle != nullptr) result = m_currentHandle->getPosition(); diff --git a/extern/audaspace/src/fx/Fader.cpp b/extern/audaspace/src/fx/Fader.cpp index 041d8369a01..778720b6059 100644 --- a/extern/audaspace/src/fx/Fader.cpp +++ b/extern/audaspace/src/fx/Fader.cpp @@ -18,7 +18,7 @@ AUD_NAMESPACE_BEGIN -Fader::Fader(std::shared_ptr sound, FadeType type, float start, float length) : +Fader::Fader(std::shared_ptr sound, FadeType type, double start, double length) : Effect(sound), m_type(type), m_start(start), @@ -31,12 +31,12 @@ FadeType Fader::getType() const return m_type; } -float Fader::getStart() const +double Fader::getStart() const { return m_start; } -float Fader::getLength() const +double Fader::getLength() const { return m_length; } diff --git a/extern/audaspace/src/fx/FaderReader.cpp b/extern/audaspace/src/fx/FaderReader.cpp index b1e23b993f3..10783f9f00c 100644 --- a/extern/audaspace/src/fx/FaderReader.cpp +++ b/extern/audaspace/src/fx/FaderReader.cpp @@ -20,7 +20,7 @@ AUD_NAMESPACE_BEGIN -FaderReader::FaderReader(std::shared_ptr reader, FadeType type, float start,float length) : +FaderReader::FaderReader(std::shared_ptr reader, FadeType type, double start, double length) : EffectReader(reader), m_type(type), m_start(start), @@ -36,14 +36,14 @@ void FaderReader::read(int& length, bool& eos, sample_t* buffer) m_reader->read(length, eos, buffer); - if((position + length) / (float)specs.rate <= m_start) + if((position + length) / specs.rate <= m_start) { if(m_type != FADE_OUT) { std::memset(buffer, 0, length * samplesize); } } - else if(position / (float)specs.rate >= m_start+m_length) + else if(position / specs.rate >= m_start+m_length) { if(m_type == FADE_OUT) { @@ -58,7 +58,7 @@ void FaderReader::read(int& length, bool& eos, sample_t* buffer) { if(i % specs.channels == 0) { - volume = (((position+i)/(float)specs.rate)-m_start) / m_length; + volume = float((((position + i) / specs.rate) - m_start) / m_length); if(volume > 1.0f) volume = 1.0f; else if(volume < 0.0f) diff --git a/extern/audaspace/src/fx/Limiter.cpp b/extern/audaspace/src/fx/Limiter.cpp index 38a7288e8d7..031283bb322 100644 --- a/extern/audaspace/src/fx/Limiter.cpp +++ b/extern/audaspace/src/fx/Limiter.cpp @@ -20,19 +20,19 @@ AUD_NAMESPACE_BEGIN Limiter::Limiter(std::shared_ptr sound, - float start, float end) : + double start, double end) : Effect(sound), m_start(start), m_end(end) { } -float Limiter::getStart() const +double Limiter::getStart() const { return m_start; } -float Limiter::getEnd() const +double Limiter::getEnd() const { return m_end; } diff --git a/extern/audaspace/src/fx/LimiterReader.cpp b/extern/audaspace/src/fx/LimiterReader.cpp index 1d003c29679..28eb47aed2f 100644 --- a/extern/audaspace/src/fx/LimiterReader.cpp +++ b/extern/audaspace/src/fx/LimiterReader.cpp @@ -21,7 +21,7 @@ AUD_NAMESPACE_BEGIN -LimiterReader::LimiterReader(std::shared_ptr reader, float start, float end) : +LimiterReader::LimiterReader(std::shared_ptr reader, double start, double end) : EffectReader(reader), m_start(start), m_end(end) diff --git a/extern/audaspace/src/respec/ChannelMapperReader.cpp b/extern/audaspace/src/respec/ChannelMapperReader.cpp index 6558d2444f5..f7ddf3dbc73 100644 --- a/extern/audaspace/src/respec/ChannelMapperReader.cpp +++ b/extern/audaspace/src/respec/ChannelMapperReader.cpp @@ -16,9 +16,9 @@ #include "respec/ChannelMapperReader.h" +#include #include #include -#include AUD_NAMESPACE_BEGIN diff --git a/extern/audaspace/src/respec/Mixer.cpp b/extern/audaspace/src/respec/Mixer.cpp index d63f0bab2bb..ad8d885df4e 100644 --- a/extern/audaspace/src/respec/Mixer.cpp +++ b/extern/audaspace/src/respec/Mixer.cpp @@ -66,11 +66,11 @@ void Mixer::setSpecs(Specs specs) void Mixer::clear(int length) { - m_buffer.assureSize(length * m_specs.channels * AUD_SAMPLE_SIZE(m_specs)); + m_buffer.assureSize(length * AUD_SAMPLE_SIZE(m_specs)); m_length = length; - std::memset(m_buffer.getBuffer(), 0, length * m_specs.channels * AUD_SAMPLE_SIZE(m_specs)); + std::memset(m_buffer.getBuffer(), 0, length * AUD_SAMPLE_SIZE(m_specs)); } void Mixer::mix(sample_t* buffer, int start, int length, float volume) diff --git a/extern/audaspace/src/sequence/Sequence.cpp b/extern/audaspace/src/sequence/Sequence.cpp index eaec4d84ae1..ab7e6e77857 100644 --- a/extern/audaspace/src/sequence/Sequence.cpp +++ b/extern/audaspace/src/sequence/Sequence.cpp @@ -90,7 +90,7 @@ AnimateableProperty* Sequence::getAnimProperty(AnimateablePropertyType type) return m_sequence->getAnimProperty(type); } -std::shared_ptr Sequence::add(std::shared_ptr sound, float begin, float end, float skip) +std::shared_ptr Sequence::add(std::shared_ptr sound, double begin, double end, double skip) { return m_sequence->add(sound, begin, end, skip); } diff --git a/extern/audaspace/src/sequence/SequenceData.cpp b/extern/audaspace/src/sequence/SequenceData.cpp index fb920acc1a8..288f0bd225d 100644 --- a/extern/audaspace/src/sequence/SequenceData.cpp +++ b/extern/audaspace/src/sequence/SequenceData.cpp @@ -149,7 +149,7 @@ AnimateableProperty* SequenceData::getAnimProperty(AnimateablePropertyType type) } } -std::shared_ptr SequenceData::add(std::shared_ptr sound, float begin, float end, float skip) +std::shared_ptr SequenceData::add(std::shared_ptr sound, double begin, double end, double skip) { std::lock_guard lock(m_mutex); diff --git a/extern/audaspace/src/sequence/SequenceEntry.cpp b/extern/audaspace/src/sequence/SequenceEntry.cpp index de538199d7d..b63bdd2ffca 100644 --- a/extern/audaspace/src/sequence/SequenceEntry.cpp +++ b/extern/audaspace/src/sequence/SequenceEntry.cpp @@ -22,7 +22,7 @@ AUD_NAMESPACE_BEGIN -SequenceEntry::SequenceEntry(std::shared_ptr sound, float begin, float end, float skip, int id) : +SequenceEntry::SequenceEntry(std::shared_ptr sound, double begin, double end, double skip, int id) : m_status(0), m_pos_status(1), m_sound_status(0), @@ -84,7 +84,7 @@ void SequenceEntry::setSound(std::shared_ptr sound) } } -void SequenceEntry::move(float begin, float end, float skip) +void SequenceEntry::move(double begin, double end, double skip) { std::lock_guard lock(m_mutex); diff --git a/extern/audaspace/src/sequence/SequenceHandle.cpp b/extern/audaspace/src/sequence/SequenceHandle.cpp index 140b1fbd94a..0437b05c85d 100644 --- a/extern/audaspace/src/sequence/SequenceHandle.cpp +++ b/extern/audaspace/src/sequence/SequenceHandle.cpp @@ -57,7 +57,7 @@ void SequenceHandle::start() m_valid = m_handle.get(); } -bool SequenceHandle::updatePosition(float position) +bool SequenceHandle::updatePosition(double position) { std::lock_guard lock(*m_entry); @@ -140,7 +140,7 @@ void SequenceHandle::stop() m_3dhandle = nullptr; } -void SequenceHandle::update(float position, float frame, float fps) +void SequenceHandle::update(double position, float frame, float fps) { if(m_sound_status != m_entry->m_sound_status) { @@ -229,7 +229,7 @@ void SequenceHandle::update(float position, float frame, float fps) m_handle->setVolume(0); } -bool SequenceHandle::seek(float position) +bool SequenceHandle::seek(double position) { if(!m_valid) // sound not valid, aborting @@ -240,7 +240,7 @@ bool SequenceHandle::seek(float position) return false; std::lock_guard lock(*m_entry); - float seekpos = position - m_entry->m_begin; + double seekpos = position - m_entry->m_begin; if(seekpos < 0) seekpos = 0; seekpos += m_entry->m_skip; diff --git a/extern/audaspace/src/sequence/SequenceHandle.h b/extern/audaspace/src/sequence/SequenceHandle.h index 9a77489a8f8..14a94365878 100644 --- a/extern/audaspace/src/sequence/SequenceHandle.h +++ b/extern/audaspace/src/sequence/SequenceHandle.h @@ -71,7 +71,7 @@ private: * \param position Current playback position in seconds. * \return Whether the handle is valid. */ - bool updatePosition(float position); + bool updatePosition(double position); public: /** @@ -104,14 +104,14 @@ public: * \param frame The current frame during playback. * \param fps The animation frames per second. */ - void update(float position, float frame, float fps); + void update(double position, float frame, float fps); /** * Seeks the handle to a specific time position. * \param position The time to seek to. * \return Whether the handle is valid. */ - bool seek(float position); + bool seek(double position); }; AUD_NAMESPACE_END diff --git a/extern/audaspace/src/sequence/SequenceReader.cpp b/extern/audaspace/src/sequence/SequenceReader.cpp index 38647aaeadf..c903e8ef42e 100644 --- a/extern/audaspace/src/sequence/SequenceReader.cpp +++ b/extern/audaspace/src/sequence/SequenceReader.cpp @@ -49,7 +49,7 @@ void SequenceReader::seek(int position) for(auto& handle : m_handles) { - handle->seek(position / m_sequence->m_specs.rate); + handle->seek(position / (double)m_sequence->m_specs.rate); } } @@ -150,13 +150,12 @@ void SequenceReader::read(int& length, bool& eos, sample_t* buffer) Specs specs = m_sequence->m_specs; int pos = 0; - float time = float(m_position) / float(specs.rate); + double time = double(m_position) / double(specs.rate); float volume, frame; int len, cfra; Vector3 v, v2; Quaternion q; - while(pos < length) { frame = time * m_sequence->m_fps; @@ -187,7 +186,7 @@ void SequenceReader::read(int& length, bool& eos, sample_t* buffer) m_device.read(reinterpret_cast(buffer + specs.channels * pos), len); pos += len; - time += float(len) / float(specs.rate); + time += double(len) / double(specs.rate); } m_position += length; diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 685582bcecf..b93591b7b60 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -164,7 +164,7 @@ void BKE_sound_stop_scene(struct Scene *scene); void BKE_sound_seek_scene(struct Main *bmain, struct Scene *scene); -float BKE_sound_sync_scene(struct Scene *scene); +double BKE_sound_sync_scene(struct Scene *scene); int BKE_sound_scene_playing(struct Scene *scene); @@ -180,10 +180,10 @@ float BKE_sound_get_length(struct Main *bmain, struct bSound *sound); char **BKE_sound_get_device_names(void); -typedef void (*SoundJackSyncCallback)(struct Main *bmain, int mode, float time); +typedef void (*SoundJackSyncCallback)(struct Main *bmain, int mode, double time); void BKE_sound_jack_sync_callback_set(SoundJackSyncCallback callback); -void BKE_sound_jack_scene_update(struct Scene *scene, int mode, float time); +void BKE_sound_jack_scene_update(struct Scene *scene, int mode, double time); /* Dependency graph evaluation. */ diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 64fe396d6a3..5500918428f 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -751,12 +751,12 @@ static void sound_start_play_scene(Scene *scene) } } -static float get_cur_time(Scene *scene) +static double get_cur_time(Scene *scene) { /* We divide by the current framelen to take into account time remapping. * Otherwise we will get the wrong starting time which will break A/V sync. * See T74111 for further details. */ - return FRA2TIME((CFRA + SUBFRA) / scene->r.framelen); + return FRA2TIME((CFRA + SUBFRA) / (double)scene->r.framelen); } void BKE_sound_play_scene(Scene *scene) @@ -764,7 +764,7 @@ void BKE_sound_play_scene(Scene *scene) sound_verify_evaluated_id(&scene->id); AUD_Status status; - const float cur_time = get_cur_time(scene); + const double cur_time = get_cur_time(scene); AUD_Device_lock(sound_device); @@ -811,8 +811,8 @@ void BKE_sound_seek_scene(Main *bmain, Scene *scene) bScreen *screen; int animation_playing; - const float one_frame = (float)(1.0 / FPS); - const float cur_time = FRA2TIME(CFRA); + const double one_frame = 1.0 / FPS; + const double cur_time = FRA2TIME(CFRA); AUD_Device_lock(sound_device); @@ -869,7 +869,7 @@ void BKE_sound_seek_scene(Main *bmain, Scene *scene) AUD_Device_unlock(sound_device); } -float BKE_sound_sync_scene(Scene *scene) +double BKE_sound_sync_scene(Scene *scene) { sound_verify_evaluated_id(&scene->id); @@ -1230,7 +1230,7 @@ void BKE_sound_stop_scene(Scene *UNUSED(scene)) void BKE_sound_seek_scene(Main *UNUSED(bmain), Scene *UNUSED(scene)) { } -float BKE_sound_sync_scene(Scene *UNUSED(scene)) +double BKE_sound_sync_scene(Scene *UNUSED(scene)) { return NAN_FLT; } @@ -1341,7 +1341,7 @@ void BKE_sound_jack_sync_callback_set(SoundJackSyncCallback callback) #endif } -void BKE_sound_jack_scene_update(Scene *scene, int mode, float time) +void BKE_sound_jack_scene_update(Scene *scene, int mode, double time) { sound_verify_evaluated_id(&scene->id); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index b66964d0e7f..eccc15456ae 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -4388,7 +4388,7 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv wmWindow *window; ScrArea *area; int sync; - float time; + double time; /* sync, don't sync, or follow scene setting */ if (sad->flag & ANIMPLAY_FLAG_SYNC) { @@ -4411,7 +4411,7 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), const wmEv } else if ((scene->audio.flag & AUDIO_SYNC) && (sad->flag & ANIMPLAY_FLAG_REVERSE) == false && isfinite(time = BKE_sound_sync_scene(scene_eval))) { - double newfra = (double)time * FPS; + double newfra = time * FPS; /* give some space here to avoid jumps */ if (newfra + 0.5 > scene->r.cfra && newfra - 0.5 < scene->r.cfra) { diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 8b8c1b90dc9..560581a56e2 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -3170,9 +3170,9 @@ void wm_event_do_handlers(bContext *C) } if (is_playing_sound == 0) { - const float time = BKE_sound_sync_scene(scene_eval); + const double time = BKE_sound_sync_scene(scene_eval); if (isfinite(time)) { - int ncfra = time * (float)FPS + 0.5f; + int ncfra = time * FPS + 0.5; if (ncfra != scene->r.cfra) { scene->r.cfra = ncfra; ED_update_for_newframe(CTX_data_main(C), depsgraph); diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index 657749a93e4..a93d4c7bf37 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -199,7 +199,7 @@ void WM_init_opengl(Main *bmain) opengl_is_init = true; } -static void sound_jack_sync_callback(Main *bmain, int mode, float time) +static void sound_jack_sync_callback(Main *bmain, int mode, double time) { /* Ugly: Blender doesn't like it when the animation is played back during rendering. */ if (G.is_rendering) { -- cgit v1.2.3