Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/extern
diff options
context:
space:
mode:
Diffstat (limited to 'extern')
-rw-r--r--extern/CMakeLists.txt2
-rw-r--r--extern/audaspace/bindings/C/AUD_Device.cpp4
-rw-r--r--extern/audaspace/bindings/C/AUD_Device.h4
-rw-r--r--extern/audaspace/bindings/C/AUD_DynamicMusic.cpp6
-rw-r--r--extern/audaspace/bindings/C/AUD_DynamicMusic.h6
-rw-r--r--extern/audaspace/bindings/C/AUD_Handle.cpp4
-rw-r--r--extern/audaspace/bindings/C/AUD_Handle.h4
-rw-r--r--extern/audaspace/bindings/C/AUD_Sequence.cpp4
-rw-r--r--extern/audaspace/bindings/C/AUD_Sequence.h4
-rw-r--r--extern/audaspace/bindings/C/AUD_Special.cpp4
-rw-r--r--extern/audaspace/bindings/C/AUD_Special.h4
-rw-r--r--extern/audaspace/bindings/doc/device.rst1
-rw-r--r--extern/audaspace/bindings/doc/handle.rst1
-rw-r--r--extern/audaspace/bindings/doc/index.rst3
-rw-r--r--extern/audaspace/bindings/doc/sequence.rst1
-rw-r--r--extern/audaspace/bindings/doc/sequence_entry.rst1
-rw-r--r--extern/audaspace/bindings/doc/sound.rst1
-rw-r--r--extern/audaspace/bindings/doc/tutorials.rst128
-rw-r--r--extern/audaspace/bindings/python/PyDevice.cpp50
-rw-r--r--extern/audaspace/bindings/python/PyDynamicMusic.cpp64
-rw-r--r--extern/audaspace/bindings/python/PyHRTF.cpp52
-rw-r--r--extern/audaspace/bindings/python/PyHandle.cpp34
-rw-r--r--extern/audaspace/bindings/python/PyPlaybackManager.cpp97
-rw-r--r--extern/audaspace/bindings/python/PySequence.cpp62
-rw-r--r--extern/audaspace/bindings/python/PySequenceEntry.cpp40
-rw-r--r--extern/audaspace/bindings/python/PySound.cpp660
-rw-r--r--extern/audaspace/include/devices/DefaultSynchronizer.h4
-rw-r--r--extern/audaspace/include/devices/IDeviceFactory.h3
-rw-r--r--extern/audaspace/include/devices/IHandle.h4
-rw-r--r--extern/audaspace/include/devices/ISynchronizer.h4
-rw-r--r--extern/audaspace/include/devices/NULLDevice.h4
-rw-r--r--extern/audaspace/include/devices/SoftwareDevice.h4
-rw-r--r--extern/audaspace/include/file/IFileInput.h5
-rw-r--r--extern/audaspace/include/fx/Delay.h6
-rw-r--r--extern/audaspace/include/fx/DelayReader.h2
-rw-r--r--extern/audaspace/include/fx/DynamicMusic.h10
-rw-r--r--extern/audaspace/include/fx/Fader.h10
-rw-r--r--extern/audaspace/include/fx/FaderReader.h6
-rw-r--r--extern/audaspace/include/fx/Limiter.h10
-rw-r--r--extern/audaspace/include/fx/LimiterReader.h6
-rw-r--r--extern/audaspace/include/sequence/Sequence.h2
-rw-r--r--extern/audaspace/include/sequence/SequenceData.h2
-rw-r--r--extern/audaspace/include/sequence/SequenceEntry.h10
-rw-r--r--extern/audaspace/plugins/jack/JackDevice.cpp6
-rw-r--r--extern/audaspace/plugins/jack/JackDevice.h4
-rw-r--r--extern/audaspace/plugins/jack/JackSynchronizer.cpp4
-rw-r--r--extern/audaspace/plugins/jack/JackSynchronizer.h4
-rw-r--r--extern/audaspace/plugins/openal/OpenALDevice.cpp4
-rw-r--r--extern/audaspace/plugins/openal/OpenALDevice.h4
-rw-r--r--extern/audaspace/src/devices/DefaultSynchronizer.cpp4
-rw-r--r--extern/audaspace/src/devices/NULLDevice.cpp4
-rw-r--r--extern/audaspace/src/devices/SoftwareDevice.cpp6
-rw-r--r--extern/audaspace/src/fx/Delay.cpp4
-rw-r--r--extern/audaspace/src/fx/DelayReader.cpp2
-rw-r--r--extern/audaspace/src/fx/DynamicMusic.cpp10
-rw-r--r--extern/audaspace/src/fx/Fader.cpp6
-rw-r--r--extern/audaspace/src/fx/FaderReader.cpp8
-rw-r--r--extern/audaspace/src/fx/Limiter.cpp6
-rw-r--r--extern/audaspace/src/fx/LimiterReader.cpp2
-rw-r--r--extern/audaspace/src/respec/ChannelMapperReader.cpp2
-rw-r--r--extern/audaspace/src/respec/Mixer.cpp4
-rw-r--r--extern/audaspace/src/sequence/Sequence.cpp2
-rw-r--r--extern/audaspace/src/sequence/SequenceData.cpp2
-rw-r--r--extern/audaspace/src/sequence/SequenceEntry.cpp4
-rw-r--r--extern/audaspace/src/sequence/SequenceHandle.cpp8
-rw-r--r--extern/audaspace/src/sequence/SequenceHandle.h6
-rw-r--r--extern/audaspace/src/sequence/SequenceReader.cpp7
-rw-r--r--extern/mantaflow/UPDATE.sh2
-rw-r--r--extern/mantaflow/preprocessed/gitinfo.h2
-rw-r--r--extern/mantaflow/preprocessed/grid.cpp153
-rw-r--r--extern/mantaflow/preprocessed/grid.h60
-rw-r--r--extern/mantaflow/preprocessed/grid.h.reg.cpp172
-rw-r--r--extern/mantaflow/preprocessed/particle.h62
-rw-r--r--extern/mantaflow/preprocessed/plugin/extforces.cpp28
-rw-r--r--extern/mantaflow/preprocessed/plugin/secondaryparticles.cpp48
-rw-r--r--extern/wcwidth/wcwidth.h2
76 files changed, 1154 insertions, 821 deletions
diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt
index e79aba0e988..235c2fa931a 100644
--- a/extern/CMakeLists.txt
+++ b/extern/CMakeLists.txt
@@ -72,7 +72,7 @@ if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV)
endif()
endif()
-if(WITH_X11 AND WITH_GHOST_XDND)
+if(WITH_GHOST_X11 AND WITH_GHOST_XDND)
add_subdirectory(xdnd)
endif()
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<std::shared_ptr<IHandle>*>(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 55f51d9ee2f..919c9083fc8 100644
--- a/extern/audaspace/bindings/doc/tutorials.rst
+++ b/extern/audaspace/bindings/doc/tutorials.rst
@@ -4,35 +4,51 @@ Tutorials
Introduction
------------
-The C and Python binding for audaspace were designed with simplicity in mind. This means however that to use the full capabilities of audaspace, there is no way around the C++ library.
+The C and Python binding for audaspace were designed with simplicity in mind.
+This means however that to use the full capabilities of audaspace,
+there is no way around the C++ library.
Simple Demo
-----------
-The **simple.py** example program contains all the basic building blocks for an application using audaspace. These building blocks are basically the classes :class:`aud.Device`, :class:`aud.Sound` and :class:`aud.Handle`.
+The **simple.py** example program contains all the basic
+building blocks for an application using audaspace.
+These building blocks are basically the classes :class:`aud.Device`,
+:class:`aud.Sound` and :class:`aud.Handle`.
-We start with importing :mod:`aud` and :mod:`time` as the modules we need for our simple example.
+We start with importing :mod:`aud` and :mod:`time`
+as the modules we need for our simple example.
.. code-block:: python
#!/usr/bin/python
import aud, time
-The first step now is to open an output device and this can simply be done by allocating a :class:`aud.Device` object.
+The first step now is to open an output device and this
+can simply be done by allocating a :class:`aud.Device` object.
.. code-block:: python
device = aud.Device()
-To create a sound we can choose to load one from a :func:`aud.Sound.file`, or we use one of our signal generators. We decide to do the latter and create a :func:`aud.Sound.sine` signal with a frequency of 440 Hz.
+To create a sound we can choose to load one from a :func:`aud.Sound.file`,
+or we use one of our signal generators. We decide to do the latter
+and create a :func:`aud.Sound.sine` signal with a frequency of 440 Hz.
.. code-block:: python
sine = aud.Sound.sine(440)
-.. note:: At this point nothing is playing back yet, :class:`aud.Sound` objects are just descriptions of sounds.
+.. note:: At this point nothing is playing back yet,
+ :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 :func:`aud.Sound.square` generator instead of sine, but we want to show how to apply effects, so we apply a :func:`aud.Sound.threshold` which makes a square wave out of our sine too, even if less efficient than directly generating the square wave.
+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
+:func:`aud.Sound.square` generator instead of sine,
+but we want to show how to apply effects,
+so we apply a :func:`aud.Sound.threshold`
+which makes a square wave out of our sine too,
+even if less efficient than directly generating the square wave.
.. code-block:: python
@@ -40,13 +56,19 @@ However instead of a sine wave, we would like to have a square wave to produce a
.. note:: The :class:`aud.Sound` class offers generator and effect functions.
-The we can play our sound by calling the :func:`aud.Device.play` method of our device. This method returns a :class:`aud.Handle` which is used to control the playback of the sound.
+The we can play our sound by calling the
+:func:`aud.Device.play` method of our device.
+This method returns a :class:`aud.Handle`
+which is used to control the playback of the sound.
.. code-block:: python
handle = device.play(square)
-Now if we do nothing else anymore the application will quit immediately, so we won't hear much of our square wave, so we decide to wait for three seconds before quitting the application by calling :func:`time.sleep`.
+Now if we do nothing else anymore the application will quit immediately,
+so we won't hear much of our square wave,
+so we decide to wait for three seconds before
+quitting the application by calling :func:`time.sleep`.
.. code-block:: python
@@ -55,29 +77,47 @@ Now if we do nothing else anymore the application will quit immediately, so we w
Audioplayer
-----------
-Now that we know the basics of audaspace, we can build our own music player easily by just slightly changing the previous program. The **player.py** example does exactly that, let's have a short look at the differences:
+Now that we know the basics of audaspace,
+we can build our own music player easily
+by just slightly changing the previous program.
+The **player.py** example does exactly that,
+let's have a short look at the differences:
-Instead of creating a sine signal and thresholding it, we in fact use the :func:`aud.Sound.file` function to load a sound from a file. The filename we pass is the first command line argument our application got.
+Instead of creating a sine signal and thresholding it,
+we in fact use the :func:`aud.Sound.file` function to load a sound from a file.
+The filename we pass is the first command line argument our application got.
.. code-block:: python
sound = aud.Sound.file(sys.argv[1])
-When the sound gets played back we now want to wait until the whole file has been played, so we use the :data:`aud.Handle.status` property to determine whether the sound finished playing.
+When the sound gets played back we now want to wait until
+the whole file has been played, so we use the :data:`aud.Handle.status`
+property to determine whether the sound finished playing.
.. code-block:: python
while handle.status:
time.sleep(0.1)
-We don't make any error checks if the user actually added a command line argument. As an exercise you could extend this program to play any number of command line supplied files in sequence.
+We don't make any error checks if the user actually added a command
+line argument. As an exercise you could extend this program to play
+any number of command line supplied files in sequence.
Siren
-----
-Let's get a little bit more complex. The **siren.py** example plays a generated siren sound that circles around your head. Depending on how many speakers you have and if the output device used supports the speaker setup, you will hear this effect. With stereo speakers you should at least hear some left-right-panning.
+Let's get a little bit more complex. The **siren.py** example
+plays a generated siren sound that circles around your head.
+Depending on how many speakers you have and if the output
+device used supports the speaker setup, you will hear this effect.
+With stereo speakers you should at least hear some left-right-panning.
-We start off again with importing the modules we need and we also define some properties of our siren sound. We want it to consist of two sine sounds with different frequencies. We define a length for the sine sounds and how long a fade in/out should take. We also know already how to open a device.
+We start off again with importing the modules we need and
+we also define some properties of our siren sound.
+We want it to consist of two sine sounds with different frequencies.
+We define a length for the sine sounds and how long a fade in/out should take.
+We also know already how to open a device.
.. code-block:: python
@@ -88,27 +128,35 @@ We start off again with importing the modules we need and we also define some pr
device = aud.Device()
-The next thing to do is to define our sine waves and apply all the required effects. As each of the effect functions returns the corresponding sound, we can easily chain those calls together.
+The next thing to do is to define our sine waves and apply all the required effects.
+As each of the effect functions returns the corresponding sound,
+we can easily chain those calls together.
.. code-block:: python
high = aud.Sound.sine(880).limit(0, length).fadein(0, fadelength).fadeout(length - fadelength, length)
low = aud.Sound.sine(700).limit(0, length).fadein(0, fadelength).fadeout(length - fadelength, length).volume(0.6)
-The next step is to connect the two sines, which we do using the :func:`aud.Sound.join` function.
+The next step is to connect the two sines,
+which we do using the :func:`aud.Sound.join` function.
.. code-block:: python
sound = high.join(low)
-The generated siren sound can now be played back and what we also do is to loop it. Therefore we set the :data:`aud.Handle.loop_count` to a negative value to loop forever.
+The generated siren sound can now be played back and what we also do is to loop it.
+Therefore we set the :data:`aud.Handle.loop_count` to a negative value to loop forever.
.. code-block:: python
handle = device.play(sound)
handle.loop_count = -1
-Now we use some timing code to make sure our demo runs for 10 seconds, but we also use the time to update the location of our playing sound, with the :data:`aud.Handle.location` property, which is a three dimensional vector. The trigonometic calculation based on the running time of the program keeps the sound on the XZ plane letting it follow a circle around us.
+Now we use some timing code to make sure our demo runs for 10 seconds,
+but we also use the time to update the location of our playing sound,
+with the :data:`aud.Handle.location` property, which is a three dimensional vector.
+The trigonometic calculation based on the running time of the program keeps
+the sound on the XZ plane letting it follow a circle around us.
.. code-block:: python
@@ -119,33 +167,54 @@ Now we use some timing code to make sure our demo runs for 10 seconds, but we al
handle.location = [math.sin(angle), 0, -math.cos(angle)]
-As an exercise you could try to let the sound come from the far left and go to the far right and a little bit in front of you within the 10 second runtime of the program. With this change you should be able to hear the volume of the sound change, depending on how far it is away from you. Updating the :data:`aud.Handle.velocity` property properly also enables the doppler effect. Compare your solution to the **siren2.py** demo.
+As an exercise you could try to let the sound come from the far left
+and go to the far right and a little bit in front of you within the
+10 second runtime of the program. With this change you should be able
+to hear the volume of the sound change, depending on how far it is away from you.
+Updating the :data:`aud.Handle.velocity` property properly also enables the doppler effect.
+Compare your solution to the **siren2.py** demo.
Tetris
------
-The **tetris.py** demo application shows an even more complex application which generates retro tetris music. Looking at the source code there should be nothing new here, again the functions used from audaspace are the same as in the previous examples. In the :func:`parseNote` function all single notes get joined which leads to a very long chain of sounds. If you think of :func:`aud.Sound.join` as a function that creates a binary tree with the two joined sounds as leaves then the :func:`parseNote` function creates a very unbalanced tree.
+The **tetris.py** demo application shows an even more
+complex application which generates retro tetris music.
+Looking at the source code there should be nothing new here,
+again the functions used from audaspace are the same as in the previous examples.
+In the :func:`parseNote` function all single notes get joined which leads
+to a very long chain of sounds. If you think of :func:`aud.Sound.join`
+as a function that creates a binary tree with the two joined sounds as
+leaves then the :func:`parseNote` function creates a very unbalanced tree.
-Insted we could rewrite the code to use two other classes: :class:`aud.Sequence` and :class:`aud.SequenceEntry` to sequence the notes. The **tetris2.py** application does exactly that. Before the while loop we add a variable that stores the current position in the score and create a new :class:`aud.Sequence` object.
+Insted we could rewrite the code to use two other classes:
+:class:`aud.Sequence` and :class:`aud.SequenceEntry` to sequence the notes.
+The **tetris2.py** application does exactly that.
+Before the while loop we add a variable that stores the current position
+in the score and create a new :class:`aud.Sequence` object.
.. code-block:: python
position = 0
sequence = aud.Sequence()
-Then in the loop we can create the note simply by chaining the :func:`aud.Sound.square` generator and :func:`aud.Sound.fadein` and :func:`aud.Sound.fadeout` effects.
+Then in the loop we can create the note simply by chaining the
+:func:`aud.Sound.square` generator and :func:`aud.Sound.fadein`
+and :func:`aud.Sound.fadeout` effects.
.. code-block:: python
note = aud.Sound.square(freq, rate).fadein(0, fadelength).fadeout(length - fadelength, fadelength)
-Now instead of using :func:`aud.Sound.limit` and :func:`aud.Sound.join` we simply add the sound to the sequence.
+Now instead of using :func:`aud.Sound.limit` and :func:`aud.Sound.join`
+we simply add the sound to the sequence.
.. code-block:: python
entry = sequence.add(note, position, position + length, 0)
-The entry returned from the :func:`aud.Sequence.add` function is an object of the :class:`aud.SequenceEntry` class. We can use this entry to mute the note in case it's actually a pause.
+The entry returned from the :func:`aud.Sequence.add`
+function is an object of the :class:`aud.SequenceEntry` class.
+We can use this entry to mute the note in case it's actually a pause.
.. code-block:: python
@@ -158,9 +227,14 @@ Lastly we have to update our position variable.
position += length
-Now in **tetris2.py** we used the :data:`aud.SequenceEntry.muted` property to show how the :class:`aud.SequenceEntry` class can be used, but it would actually be smarter to not even create a note for pauses and just skip them. You can try to implement this as an exercise and then check out the solution in **tetris3.py**.
+Now in **tetris2.py** we used the :data:`aud.SequenceEntry.muted`
+property to show how the :class:`aud.SequenceEntry` class can be used,
+but it would actually be smarter to not even create a note for pauses and just skip them.
+You can try to implement this as an exercise and then check out the solution in **tetris3.py**.
Conclusion
----------
-We introduced all five currently available classes in the audaspace Python API. Of course all classes offer a lot more functions than have been used in these demo applications, check out the specific class documentation for more details.
+We introduced all five currently available classes in the audaspace Python API.
+Of course all classes offer a lot more functions than have been used in these demo applications,
+check out the specific class documentation for more details.
diff --git a/extern/audaspace/bindings/python/PyDevice.cpp b/extern/audaspace/bindings/python/PyDevice.cpp
index a6beef57d83..3dedc8df677 100644
--- a/extern/audaspace/bindings/python/PyDevice.cpp
+++ b/extern/audaspace/bindings/python/PyDevice.cpp
@@ -124,15 +124,17 @@ Device_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Device_lock_doc,
- "lock()\n\n"
- "Locks the device so that it's guaranteed, that no samples are "
- "read from the streams until :meth:`unlock` is called.\n"
- "This is useful if you want to do start/stop/pause/resume some "
- "sounds at the same time.\n\n"
- ".. note:: The device has to be unlocked as often as locked to be "
- "able to continue playback.\n\n"
- ".. warning:: Make sure the time between locking and unlocking is "
- "as short as possible to avoid clicks.");
+ ".. classmethod:: lock()\n\n"
+ " Locks the device so that it's guaranteed, that no samples are\n"
+ " read from the streams until :meth:`unlock` is called.\n"
+ " This is useful if you want to do start/stop/pause/resume some\n"
+ " sounds at the same time.\n\n"
+ " .. note::\n\n"
+ " The device has to be unlocked as often as locked to be\n"
+ " able to continue playback.\n\n"
+ " .. warning::\n\n"
+ " Make sure the time between locking and unlocking is\n"
+ " as short as possible to avoid clicks.");
static PyObject *
Device_lock(Device* self)
@@ -150,15 +152,15 @@ Device_lock(Device* self)
}
PyDoc_STRVAR(M_aud_Device_play_doc,
- "play(sound, keep=False)\n\n"
- "Plays a sound.\n\n"
- ":arg sound: The sound to play.\n"
- ":type sound: :class:`Sound`\n"
- ":arg keep: See :attr:`Handle.keep`.\n"
- ":type keep: bool\n"
- ":return: The playback handle with which playback can be "
- "controlled with.\n"
- ":rtype: :class:`Handle`");
+ ".. classmethod:: play(sound, keep=False)\n\n"
+ " Plays a sound.\n\n"
+ " :arg sound: The sound to play.\n"
+ " :type sound: :class:`Sound`\n"
+ " :arg keep: See :attr:`Handle.keep`.\n"
+ " :type keep: bool\n"
+ " :return: The playback handle with which playback can be\n"
+ " controlled with.\n"
+ " :rtype: :class:`Handle`");
static PyObject *
Device_play(Device* self, PyObject* args, PyObject* kwds)
@@ -210,8 +212,8 @@ Device_play(Device* self, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Device_stopAll_doc,
- "stopAll()\n\n"
- "Stops all playing and paused sounds.");
+ ".. classmethod:: stopAll()\n\n"
+ " Stops all playing and paused sounds.");
static PyObject *
Device_stopAll(Device* self)
@@ -229,9 +231,9 @@ Device_stopAll(Device* self)
}
PyDoc_STRVAR(M_aud_Device_unlock_doc,
- "unlock()\n\n"
- "Unlocks the device after a lock call, see :meth:`lock` for "
- "details.");
+ ".. classmethod:: unlock()\n\n"
+ " Unlocks the device after a lock call, see :meth:`lock` for\n"
+ " details.");
static PyObject *
Device_unlock(Device* self)
@@ -284,7 +286,7 @@ Device_get_channels(Device* self, void* nothing)
PyDoc_STRVAR(M_aud_Device_distance_model_doc,
"The distance model of the device.\n\n"
- ".. seealso:: http://connect.creativelabs.com/openal/Documentation/OpenAL%201.1%20Specification.htm#_Toc199835864");
+ ".. seealso:: `OpenAL Documentation <https://www.openal.org/documentation/>`__");
static PyObject *
Device_get_distance_model(Device* self, void* nothing)
diff --git a/extern/audaspace/bindings/python/PyDynamicMusic.cpp b/extern/audaspace/bindings/python/PyDynamicMusic.cpp
index d49f73737c2..8a7d8265bf4 100644
--- a/extern/audaspace/bindings/python/PyDynamicMusic.cpp
+++ b/extern/audaspace/bindings/python/PyDynamicMusic.cpp
@@ -60,12 +60,12 @@ DynamicMusic_dealloc(DynamicMusicP* self)
}
PyDoc_STRVAR(M_aud_DynamicMusic_addScene_doc,
- "addScene(scene)\n\n"
- "Adds a new scene.\n\n"
- ":arg scene: The scene sound.\n"
- ":type scene: :class:`Sound`\n"
- ":return: The new scene id.\n"
- ":rtype: int");
+ ".. classmethod:: addScene(scene)\n\n"
+ " Adds a new scene.\n\n"
+ " :arg scene: The scene sound.\n"
+ " :type scene: :class:`Sound`\n"
+ " :return: The new scene id.\n"
+ " :rtype: int");
static PyObject *
DynamicMusic_addScene(DynamicMusicP* self, PyObject* args)
@@ -90,16 +90,16 @@ DynamicMusic_addScene(DynamicMusicP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_DynamicMusic_addTransition_doc,
- "addTransition(ini, end, transition)\n\n"
- "Adds a new scene.\n\n"
- ":arg ini: the initial scene foor the transition.\n"
- ":type ini: int\n"
- ":arg end: The final scene for the transition.\n"
- ":type end: int\n"
- ":arg transition: The transition sound.\n"
- ":type transition: :class:`Sound`\n"
- ":return: false if the ini or end scenes don't exist, true othrwise.\n"
- ":rtype: bool");
+ ".. classmethod:: addTransition(ini, end, transition)\n\n"
+ " Adds a new scene.\n\n"
+ " :arg ini: the initial scene foor the transition.\n"
+ " :type ini: int\n"
+ " :arg end: The final scene for the transition.\n"
+ " :type end: int\n"
+ " :arg transition: The transition sound.\n"
+ " :type transition: :class:`Sound`\n"
+ " :return: false if the ini or end scenes don't exist, true othrwise.\n"
+ " :rtype: bool");
static PyObject *
DynamicMusic_addTransition(DynamicMusicP* self, PyObject* args)
@@ -125,10 +125,10 @@ DynamicMusic_addTransition(DynamicMusicP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_DynamicMusic_resume_doc,
- "resume()\n\n"
- "Resumes playback of the scene.\n\n"
- ":return: Whether the action succeeded.\n"
- ":rtype: bool");
+ ".. classmethod:: resume()\n\n"
+ " Resumes playback of the scene.\n\n"
+ " :return: Whether the action succeeded.\n"
+ " :rtype: bool");
static PyObject *
DynamicMusic_resume(DynamicMusicP* self)
@@ -145,10 +145,10 @@ DynamicMusic_resume(DynamicMusicP* self)
}
PyDoc_STRVAR(M_aud_DynamicMusic_pause_doc,
- "pause()\n\n"
- "Pauses playback of the scene.\n\n"
- ":return: Whether the action succeeded.\n"
- ":rtype: bool");
+ ".. classmethod:: pause()\n\n"
+ " Pauses playback of the scene.\n\n"
+ " :return: Whether the action succeeded.\n"
+ " :rtype: bool");
static PyObject *
DynamicMusic_pause(DynamicMusicP* self)
@@ -165,10 +165,10 @@ DynamicMusic_pause(DynamicMusicP* self)
}
PyDoc_STRVAR(M_aud_DynamicMusic_stop_doc,
- "stop()\n\n"
- "Stops playback of the scene.\n\n"
- ":return: Whether the action succeeded.\n"
- ":rtype: bool\n\n");
+ ".. classmethod:: stop()\n\n"
+ " Stops playback of the scene.\n\n"
+ " :return: Whether the action succeeded.\n"
+ " :rtype: bool\n\n");
static PyObject *
DynamicMusic_stop(DynamicMusicP* self)
@@ -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<std::shared_ptr<aud::DynamicMusic>*>(self->dynamicMusic))->getPosition());
+ return Py_BuildValue("d", (*reinterpret_cast<std::shared_ptr<aud::DynamicMusic>*>(self->dynamicMusic))->getPosition());
}
catch(aud::Exception& e)
{
@@ -464,4 +464,4 @@ void addDynamicMusicToModule(PyObject* module)
{
Py_INCREF(&DynamicMusicType);
PyModule_AddObject(module, "DynamicMusic", (PyObject *)&DynamicMusicType);
-} \ No newline at end of file
+}
diff --git a/extern/audaspace/bindings/python/PyHRTF.cpp b/extern/audaspace/bindings/python/PyHRTF.cpp
index 2a5b6be624f..c209a88f3fe 100644
--- a/extern/audaspace/bindings/python/PyHRTF.cpp
+++ b/extern/audaspace/bindings/python/PyHRTF.cpp
@@ -54,16 +54,16 @@ HRTF_dealloc(HRTFP* self)
}
PyDoc_STRVAR(M_aud_HRTF_addImpulseResponse_doc,
- "addImpulseResponseFromSound(sound, azimuth, elevation)\n\n"
- "Adds a new hrtf to the HRTF object\n\n"
- ":arg sound: The sound that contains the hrtf.\n"
- ":type sound: :class:`Sound`\n"
- ":arg azimuth: The azimuth angle of the hrtf.\n"
- ":type azimuth: float\n"
- ":arg elevation: The elevation angle of the hrtf.\n"
- ":type elevation: float\n"
- ":return: Whether the action succeeded.\n"
- ":rtype: bool");
+ ".. classmethod:: addImpulseResponseFromSound(sound, azimuth, elevation)\n\n"
+ " Adds a new hrtf to the HRTF object\n\n"
+ " :arg sound: The sound that contains the hrtf.\n"
+ " :type sound: :class:`Sound`\n"
+ " :arg azimuth: The azimuth angle of the hrtf.\n"
+ " :type azimuth: float\n"
+ " :arg elevation: The elevation angle of the hrtf.\n"
+ " :type elevation: float\n"
+ " :return: Whether the action succeeded.\n"
+ " :rtype: bool");
static PyObject *
HRTF_addImpulseResponseFromSound(HRTFP* self, PyObject* args)
@@ -90,14 +90,14 @@ HRTF_addImpulseResponseFromSound(HRTFP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_HRTF_loadLeftHrtfSet_doc,
- "loadLeftHrtfSet(extension, directory)\n\n"
- "Loads all HRTFs from a directory.\n\n"
- ":arg extension: The file extension of the hrtfs.\n"
- ":type extension: string\n"
- ":arg directory: The path to where the HRTF files are located.\n"
- ":type extension: string\n"
- ":return: The loaded :class:`HRTF` object.\n"
- ":rtype: :class:`HRTF`\n\n");
+ ".. classmethod:: loadLeftHrtfSet(extension, directory)\n\n"
+ " Loads all HRTFs from a directory.\n\n"
+ " :arg extension: The file extension of the hrtfs.\n"
+ " :type extension: string\n"
+ " :arg directory: The path to where the HRTF files are located.\n"
+ " :type extension: string\n"
+ " :return: The loaded :class:`HRTF` object.\n"
+ " :rtype: :class:`HRTF`\n\n");
static PyObject *
HRTF_loadLeftHrtfSet(PyTypeObject* type, PyObject* args)
@@ -125,14 +125,14 @@ HRTF_loadLeftHrtfSet(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_HRTF_loadRightHrtfSet_doc,
- "loadLeftHrtfSet(extension, directory)\n\n"
- "Loads all HRTFs from a directory.\n\n"
- ":arg extension: The file extension of the hrtfs.\n"
- ":type extension: string\n"
- ":arg directory: The path to where the HRTF files are located.\n"
- ":type extension: string\n"
- ":return: The loaded :class:`HRTF` object.\n"
- ":rtype: :class:`HRTF`\n\n");
+ ".. classmethod:: loadLeftHrtfSet(extension, directory)\n\n"
+ " Loads all HRTFs from a directory.\n\n"
+ " :arg extension: The file extension of the hrtfs.\n"
+ " :type extension: string\n"
+ " :arg directory: The path to where the HRTF files are located.\n"
+ " :type extension: string\n"
+ " :return: The loaded :class:`HRTF` object.\n"
+ " :rtype: :class:`HRTF`\n\n");
static PyObject *
HRTF_loadRightHrtfSet(PyTypeObject* type, PyObject* args)
diff --git a/extern/audaspace/bindings/python/PyHandle.cpp b/extern/audaspace/bindings/python/PyHandle.cpp
index 7f7a7660049..4ecf2ffd210 100644
--- a/extern/audaspace/bindings/python/PyHandle.cpp
+++ b/extern/audaspace/bindings/python/PyHandle.cpp
@@ -38,10 +38,10 @@ Handle_dealloc(Handle* self)
}
PyDoc_STRVAR(M_aud_Handle_pause_doc,
- "pause()\n\n"
- "Pauses playback.\n\n"
- ":return: Whether the action succeeded.\n"
- ":rtype: bool");
+ ".. classmethod:: pause()\n\n"
+ " Pauses playback.\n\n"
+ " :return: Whether the action succeeded.\n"
+ " :rtype: bool");
static PyObject *
Handle_pause(Handle* self)
@@ -58,10 +58,10 @@ Handle_pause(Handle* self)
}
PyDoc_STRVAR(M_aud_Handle_resume_doc,
- "resume()\n\n"
- "Resumes playback.\n\n"
- ":return: Whether the action succeeded.\n"
- ":rtype: bool");
+ ".. classmethod:: resume()\n\n"
+ " Resumes playback.\n\n"
+ " :return: Whether the action succeeded.\n"
+ " :rtype: bool");
static PyObject *
Handle_resume(Handle* self)
@@ -78,11 +78,11 @@ Handle_resume(Handle* self)
}
PyDoc_STRVAR(M_aud_Handle_stop_doc,
- "stop()\n\n"
- "Stops playback.\n\n"
- ":return: Whether the action succeeded.\n"
- ":rtype: bool\n\n"
- ".. note:: This makes the handle invalid.");
+ ".. classmethod:: stop()\n\n"
+ " Stops playback.\n\n"
+ " :return: Whether the action succeeded.\n"
+ " :rtype: bool\n\n"
+ " .. note:: This makes the handle invalid.");
static PyObject *
Handle_stop(Handle* self)
@@ -696,7 +696,7 @@ Handle_get_position(Handle* self, void* nothing)
{
try
{
- return Py_BuildValue("f", (*reinterpret_cast<std::shared_ptr<IHandle>*>(self->handle))->getPosition());
+ return Py_BuildValue("d", (*reinterpret_cast<std::shared_ptr<IHandle>*>(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
@@ -1122,5 +1122,3 @@ void addHandleToModule(PyObject* module)
Py_INCREF(&HandleType);
PyModule_AddObject(module, "Handle", (PyObject *)&HandleType);
}
-
-
diff --git a/extern/audaspace/bindings/python/PyPlaybackManager.cpp b/extern/audaspace/bindings/python/PyPlaybackManager.cpp
index 9b6614cae9a..3987ac528b6 100644
--- a/extern/audaspace/bindings/python/PyPlaybackManager.cpp
+++ b/extern/audaspace/bindings/python/PyPlaybackManager.cpp
@@ -60,14 +60,15 @@ PlaybackManager_dealloc(PlaybackManagerP* self)
}
PyDoc_STRVAR(M_aud_PlaybackManager_play_doc,
- "setVolume(sound, catKey)\n\n"
- "Plays a sound through the playback manager and assigns it to a category.\n\n"
- ":arg sound: The sound to play.\n"
- ":type sound: :class:`Sound`\n"
- ":arg catKey: the key of the category in which the sound will be added, if it doesn't exist, a new one will be created.\n"
- ":type catKey: int\n"
- ":return: The playback handle with which playback can be controlled with.\n"
- ":rtype: :class:`Handle`");
+ ".. classmethod:: setVolume(sound, catKey)\n\n"
+ " Plays a sound through the playback manager and assigns it to a category.\n\n"
+ " :arg sound: The sound to play.\n"
+ " :type sound: :class:`Sound`\n"
+ " :arg catKey: the key of the category in which the sound will be added,\n"
+ " if it doesn't exist, a new one will be created.\n"
+ " :type catKey: int\n"
+ " :return: The playback handle with which playback can be controlled with.\n"
+ " :rtype: :class:`Handle`");
static PyObject *
PlaybackManager_play(PlaybackManagerP* self, PyObject* args)
@@ -103,12 +104,12 @@ PlaybackManager_play(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_resume_doc,
- "resume(catKey)\n\n"
- "Resumes playback of the catgory.\n\n"
- ":arg catKey: the key of the category.\n"
- ":type catKey: int\n"
- ":return: Whether the action succeeded.\n"
- ":rtype: bool");
+ ".. classmethod:: resume(catKey)\n\n"
+ " Resumes playback of the catgory.\n\n"
+ " :arg catKey: the key of the category.\n"
+ " :type catKey: int\n"
+ " :return: Whether the action succeeded.\n"
+ " :rtype: bool");
static PyObject *
PlaybackManager_resume(PlaybackManagerP* self, PyObject* args)
@@ -130,12 +131,12 @@ PlaybackManager_resume(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_pause_doc,
- "pause(catKey)\n\n"
- "Pauses playback of the category.\n\n"
- ":arg catKey: the key of the category.\n"
- ":type catKey: int\n"
- ":return: Whether the action succeeded.\n"
- ":rtype: bool");
+ ".. classmethod:: pause(catKey)\n\n"
+ " Pauses playback of the category.\n\n"
+ " :arg catKey: the key of the category.\n"
+ " :type catKey: int\n"
+ " :return: Whether the action succeeded.\n"
+ " :rtype: bool");
static PyObject *
PlaybackManager_pause(PlaybackManagerP* self, PyObject* args)
@@ -157,12 +158,12 @@ PlaybackManager_pause(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_add_category_doc,
- "addCategory(volume)\n\n"
- "Adds a category with a custom volume.\n\n"
- ":arg volume: The volume for ther new category.\n"
- ":type volume: float\n"
- ":return: The key of the new category.\n"
- ":rtype: int\n\n");
+ ".. classmethod:: addCategory(volume)\n\n"
+ " Adds a category with a custom volume.\n\n"
+ " :arg volume: The volume for ther new category.\n"
+ " :type volume: float\n"
+ " :return: The key of the new category.\n"
+ " :rtype: int\n\n");
static PyObject *
PlaybackManager_add_category(PlaybackManagerP* self, PyObject* args)
@@ -184,12 +185,12 @@ PlaybackManager_add_category(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_get_volume_doc,
- "getVolume(catKey)\n\n"
- "Retrieves the volume of a category.\n\n"
- ":arg catKey: the key of the category.\n"
- ":type catKey: int\n"
- ":return: The volume of the cateogry.\n"
- ":rtype: float\n\n");
+ ".. classmethod:: getVolume(catKey)\n\n"
+ " Retrieves the volume of a category.\n\n"
+ " :arg catKey: the key of the category.\n"
+ " :type catKey: int\n"
+ " :return: The volume of the cateogry.\n"
+ " :rtype: float\n\n");
static PyObject *
PlaybackManager_get_volume(PlaybackManagerP* self, PyObject* args)
@@ -211,14 +212,14 @@ PlaybackManager_get_volume(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_set_volume_doc,
- "setVolume(volume, catKey)\n\n"
- "Changes the volume of a category.\n\n"
- ":arg volume: the new volume value.\n"
- ":type volume: float\n"
- ":arg catKey: the key of the category.\n"
- ":type catKey: int\n"
- ":return: Whether the action succeeded.\n"
- ":rtype: int\n\n");
+ ".. classmethod:: setVolume(volume, catKey)\n\n"
+ " Changes the volume of a category.\n\n"
+ " :arg volume: the new volume value.\n"
+ " :type volume: float\n"
+ " :arg catKey: the key of the category.\n"
+ " :type catKey: int\n"
+ " :return: Whether the action succeeded.\n"
+ " :rtype: int\n\n");
static PyObject *
PlaybackManager_set_volume(PlaybackManagerP* self, PyObject* args)
@@ -241,12 +242,12 @@ PlaybackManager_set_volume(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_stop_doc,
- "stop(catKey)\n\n"
- "Stops playback of the category.\n\n"
- ":arg catKey: the key of the category.\n"
- ":type catKey: int\n"
- ":return: Whether the action succeeded.\n"
- ":rtype: bool\n\n");
+ ".. classmethod:: stop(catKey)\n\n"
+ " Stops playback of the category.\n\n"
+ " :arg catKey: the key of the category.\n"
+ " :type catKey: int\n"
+ " :return: Whether the action succeeded.\n"
+ " :rtype: bool\n\n");
static PyObject *
PlaybackManager_stop(PlaybackManagerP* self, PyObject* args)
@@ -268,8 +269,8 @@ PlaybackManager_stop(PlaybackManagerP* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_PlaybackManager_clean_doc,
- "clean()\n\n"
- "Cleans all the invalid and finished sound from the playback manager.\n\n");
+ ".. classmethod:: clean()\n\n"
+ " Cleans all the invalid and finished sound from the playback manager.\n\n");
static PyObject *
PlaybackManager_clean(PlaybackManagerP* self)
diff --git a/extern/audaspace/bindings/python/PySequence.cpp b/extern/audaspace/bindings/python/PySequence.cpp
index e574d76bea1..26f0c9e566f 100644
--- a/extern/audaspace/bindings/python/PySequence.cpp
+++ b/extern/audaspace/bindings/python/PySequence.cpp
@@ -99,30 +99,30 @@ Sequence_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Sequence_add_doc,
- "add()\n\n"
- "Adds a new entry to the sequence.\n\n"
- ":arg sound: The sound this entry should play.\n"
- ":type sound: :class:`Sound`\n"
- ":arg begin: The start time.\n"
- ":type begin: float\n"
- ":arg end: The end time or a negative value if determined by the sound.\n"
- ":type end: float\n"
- ":arg skip: How much seconds should be skipped at the beginning.\n"
- ":type skip: float\n"
- ":return: The entry added.\n"
- ":rtype: :class:`SequenceEntry`");
+ ".. classmethod:: add()\n\n"
+ " Adds a new entry to the sequence.\n\n"
+ " :arg sound: The sound this entry should play.\n"
+ " :type sound: :class:`Sound`\n"
+ " :arg begin: The start time.\n"
+ " :type begin: double\n"
+ " :arg end: The end time or a negative value if determined by the sound.\n"
+ " :type end: double\n"
+ " :arg skip: How much seconds should be skipped at the beginning.\n"
+ " :type skip: double\n"
+ " :return: The entry added.\n"
+ " :rtype: :class:`SequenceEntry`");
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<char**>(kwlist), &object, &begin, &end, &skip))
+ if(!PyArg_ParseTupleAndKeywords(args, kwds, "Od|dd:add", const_cast<char**>(kwlist), &object, &begin, &end, &skip))
return nullptr;
Sound* sound = checkSound(object);
@@ -151,10 +151,10 @@ Sequence_add(Sequence* self, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Sequence_remove_doc,
- "remove()\n\n"
- "Removes an entry from the sequence.\n\n"
- ":arg entry: The entry to remove.\n"
- ":type entry: :class:`SequenceEntry`\n");
+ ".. classmethod:: remove()\n\n"
+ " Removes an entry from the sequence.\n\n"
+ " :arg entry: The entry to remove.\n"
+ " :type entry: :class:`SequenceEntry`\n");
static PyObject *
Sequence_remove(Sequence* self, PyObject* args)
@@ -183,16 +183,16 @@ Sequence_remove(Sequence* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sequence_setAnimationData_doc,
- "setAnimationData()\n\n"
- "Writes animation data to a sequence.\n\n"
- ":arg type: The type of animation data.\n"
- ":type type: int\n"
- ":arg frame: The frame this data is for.\n"
- ":type frame: int\n"
- ":arg data: The data to write.\n"
- ":type data: sequence of float\n"
- ":arg animated: Whether the attribute is animated.\n"
- ":type animated: bool");
+ ".. classmethod:: setAnimationData()\n\n"
+ " Writes animation data to a sequence.\n\n"
+ " :arg type: The type of animation data.\n"
+ " :type type: int\n"
+ " :arg frame: The frame this data is for.\n"
+ " :type frame: int\n"
+ " :arg data: The data to write.\n"
+ " :type data: sequence of float\n"
+ " :arg animated: Whether the attribute is animated.\n"
+ " :type animated: bool");
static PyObject *
Sequence_setAnimationData(Sequence* self, PyObject* args)
@@ -325,7 +325,7 @@ Sequence_set_channels(Sequence* self, PyObject* args, void* nothing)
PyDoc_STRVAR(M_aud_Sequence_distance_model_doc,
"The distance model of the sequence.\n\n"
- ".. seealso:: http://connect.creativelabs.com/openal/Documentation/OpenAL%201.1%20Specification.htm#_Toc199835864");
+ ".. seealso:: `OpenAL Documentation <https://www.openal.org/documentation/>`__");
static PyObject *
Sequence_get_distance_model(Sequence* self, void* nothing)
diff --git a/extern/audaspace/bindings/python/PySequenceEntry.cpp b/extern/audaspace/bindings/python/PySequenceEntry.cpp
index e6a034ed880..74c038de0b0 100644
--- a/extern/audaspace/bindings/python/PySequenceEntry.cpp
+++ b/extern/audaspace/bindings/python/PySequenceEntry.cpp
@@ -43,21 +43,21 @@ SequenceEntry_dealloc(SequenceEntry* self)
}
PyDoc_STRVAR(M_aud_SequenceEntry_move_doc,
- "move()\n\n"
- "Moves the entry.\n\n"
- ":arg begin: The new start time.\n"
- ":type begin: float\n"
- ":arg end: The new end time or a negative value if unknown.\n"
- ":type end: float\n"
- ":arg skip: How many seconds to skip at the beginning.\n"
- ":type skip: float\n");
+ ".. classmethod:: move()\n\n"
+ " Moves the entry.\n\n"
+ " :arg begin: The new start time.\n"
+ " :type begin: double\n"
+ " :arg end: The new end time or a negative value if unknown.\n"
+ " :type end: double\n"
+ " :arg skip: How many seconds to skip at the beginning.\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
@@ -73,16 +73,16 @@ SequenceEntry_move(SequenceEntry* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_SequenceEntry_setAnimationData_doc,
- "setAnimationData()\n\n"
- "Writes animation data to a sequenced entry.\n\n"
- ":arg type: The type of animation data.\n"
- ":type type: int\n"
- ":arg frame: The frame this data is for.\n"
- ":type frame: int\n"
- ":arg data: The data to write.\n"
- ":type data: sequence of float\n"
- ":arg animated: Whether the attribute is animated.\n"
- ":type animated: bool");
+ ".. classmethod:: setAnimationData()\n\n"
+ " Writes animation data to a sequenced entry.\n\n"
+ " :arg type: The type of animation data.\n"
+ " :type type: int\n"
+ " :arg frame: The frame this data is for.\n"
+ " :type frame: int\n"
+ " :arg data: The data to write.\n"
+ " :type data: sequence of float\n"
+ " :arg animated: Whether the attribute is animated.\n"
+ " :type animated: bool");
static PyObject *
SequenceEntry_setAnimationData(SequenceEntry* self, PyObject* args)
diff --git a/extern/audaspace/bindings/python/PySound.cpp b/extern/audaspace/bindings/python/PySound.cpp
index c589e7110cb..62ee3435e82 100644
--- a/extern/audaspace/bindings/python/PySound.cpp
+++ b/extern/audaspace/bindings/python/PySound.cpp
@@ -114,11 +114,11 @@ Sound_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Sound_data_doc,
- "data()\n\n"
- "Retrieves the data of the sound as numpy array.\n\n"
- ":return: A two dimensional numpy float array.\n"
- ":rtype: :class:`numpy.ndarray`\n\n"
- ".. note:: Best efficiency with cached sounds.");
+ ".. classmethod:: data()\n\n"
+ " Retrieves the data of the sound as numpy array.\n\n"
+ " :return: A two dimensional numpy float array.\n"
+ " :rtype: :class:`numpy.ndarray`\n\n"
+ " .. note:: Best efficiency with cached sounds.");
static PyObject *
Sound_data(Sound* self)
@@ -145,24 +145,24 @@ Sound_data(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_write_doc,
- "write(filename, rate, channels, format, container, codec, bitrate, buffersize)\n\n"
- "Writes the sound to a file.\n\n"
- ":arg filename: The path to write to.\n"
- ":type filename: string\n"
- ":arg rate: The sample rate to write with.\n"
- ":type rate: int\n"
- ":arg channels: The number of channels to write with.\n"
- ":type channels: int\n"
- ":arg format: The sample format to write with.\n"
- ":type format: int\n"
- ":arg container: The container format for the file.\n"
- ":type container: int\n"
- ":arg codec: The codec to use in the file.\n"
- ":type codec: int\n"
- ":arg bitrate: The bitrate to write with.\n"
- ":type bitrate: int\n"
- ":arg buffersize: The size of the writing buffer.\n"
- ":type buffersize: int\n");
+ ".. classmethod:: write(filename, rate, channels, format, container, codec, bitrate, buffersize)\n\n"
+ " Writes the sound to a file.\n\n"
+ " :arg filename: The path to write to.\n"
+ " :type filename: string\n"
+ " :arg rate: The sample rate to write with.\n"
+ " :type rate: int\n"
+ " :arg channels: The number of channels to write with.\n"
+ " :type channels: int\n"
+ " :arg format: The sample format to write with.\n"
+ " :type format: int\n"
+ " :arg container: The container format for the file.\n"
+ " :type container: int\n"
+ " :arg codec: The codec to use in the file.\n"
+ " :type codec: int\n"
+ " :arg bitrate: The bitrate to write with.\n"
+ " :type bitrate: int\n"
+ " :arg buffersize: The size of the writing buffer.\n"
+ " :type buffersize: int");
static PyObject *
Sound_write(Sound* self, PyObject* args, PyObject* kwds)
@@ -286,14 +286,14 @@ Sound_write(Sound* self, PyObject* args, PyObject* kwds)
}
PyDoc_STRVAR(M_aud_Sound_buffer_doc,
- "buffer(data, rate)\n\n"
- "Creates a sound from a data buffer.\n\n"
- ":arg data: The data as two dimensional numpy array.\n"
- ":type data: numpy.ndarray\n"
- ":arg rate: The sample rate.\n"
- ":type rate: double\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: buffer(data, rate)\n\n"
+ " Creates a sound from a data buffer.\n\n"
+ " :arg data: The data as two dimensional numpy array.\n"
+ " :type data: numpy.ndarray\n"
+ " :arg rate: The sample rate.\n"
+ " :type rate: double\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_buffer(PyTypeObject* type, PyObject* args)
@@ -356,16 +356,17 @@ Sound_buffer(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_cache_doc,
- "cache()\n\n"
- "Caches a sound into RAM.\n"
- "This saves CPU usage needed for decoding and file access if the "
- "underlying sound reads from a file on the harddisk, but it "
- "consumes a lot of memory.\n\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: Only known-length factories can be buffered.\n\n"
- ".. warning:: Raw PCM data needs a lot of space, only buffer "
- "short factories.");
+ ".. classmethod:: cache()\n\n"
+ " Caches a sound into RAM.\n\n"
+ " This saves CPU usage needed for decoding and file access if the\n"
+ " underlying sound reads from a file on the harddisk,\n"
+ " but it consumes a lot of memory.\n\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note:: Only known-length factories can be buffered.\n\n"
+ " .. warning::\n\n"
+ " Raw PCM data needs a lot of space, only buffer\n"
+ " short factories.");
static PyObject *
Sound_cache(Sound* self)
@@ -391,15 +392,16 @@ Sound_cache(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_file_doc,
- "file(filename)\n\n"
- "Creates a sound object of a sound file.\n\n"
- ":arg filename: Path of the file.\n"
- ":type filename: string\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. warning:: If the file doesn't exist or can't be read you will "
- "not get an exception immediately, but when you try to start "
- "playback of that sound.");
+ ".. classmethod:: file(filename)\n\n"
+ " Creates a sound object of a sound file.\n\n"
+ " :arg filename: Path of the file.\n"
+ " :type filename: string\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. warning::\n\n"
+ " If the file doesn't exist or can't be read you will\n"
+ " not get an exception immediately, but when you try to start\n"
+ " playback of that sound.\n");
static PyObject *
Sound_file(PyTypeObject* type, PyObject* args)
@@ -430,15 +432,15 @@ Sound_file(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_sawtooth_doc,
- "sawtooth(frequency, rate=48000)\n\n"
- "Creates a sawtooth sound which plays a sawtooth wave.\n\n"
- ":arg frequency: The frequency of the sawtooth wave in Hz.\n"
- ":type frequency: float\n"
- ":arg rate: The sampling rate in Hz. It's recommended to set this "
- "value to the playback device's samling rate to avoid resamping.\n"
- ":type rate: int\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: sawtooth(frequency, rate=48000)\n\n"
+ " Creates a sawtooth sound which plays a sawtooth wave.\n\n"
+ " :arg frequency: The frequency of the sawtooth wave in Hz.\n"
+ " :type frequency: float\n"
+ " :arg rate: The sampling rate in Hz. It's recommended to set this\n"
+ " value to the playback device's samling rate to avoid resamping.\n"
+ " :type rate: int\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_sawtooth(PyTypeObject* type, PyObject* args)
@@ -470,13 +472,13 @@ Sound_sawtooth(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_silence_doc,
- "silence(rate=48000)\n\n"
- "Creates a silence sound which plays simple silence.\n\n"
- ":arg rate: The sampling rate in Hz. It's recommended to set this "
- "value to the playback device's samling rate to avoid resamping.\n"
- ":type rate: int\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: silence(rate=48000)\n\n"
+ " Creates a silence sound which plays simple silence.\n\n"
+ " :arg rate: The sampling rate in Hz. It's recommended to set this\n"
+ " value to the playback device's samling rate to avoid resamping.\n"
+ " :type rate: int\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_silence(PyTypeObject* type, PyObject* args)
@@ -507,15 +509,15 @@ Sound_silence(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_sine_doc,
- "sine(frequency, rate=48000)\n\n"
- "Creates a sine sound which plays a sine wave.\n\n"
- ":arg frequency: The frequency of the sine wave in Hz.\n"
- ":type frequency: float\n"
- ":arg rate: The sampling rate in Hz. It's recommended to set this "
- "value to the playback device's samling rate to avoid resamping.\n"
- ":type rate: int\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: sine(frequency, rate=48000)\n\n"
+ " Creates a sine sound which plays a sine wave.\n\n"
+ " :arg frequency: The frequency of the sine wave in Hz.\n"
+ " :type frequency: float\n"
+ " :arg rate: The sampling rate in Hz. It's recommended to set this\n"
+ " value to the playback device's samling rate to avoid resamping.\n"
+ " :type rate: int\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_sine(PyTypeObject* type, PyObject* args)
@@ -547,15 +549,15 @@ Sound_sine(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_square_doc,
- "square(frequency, rate=48000)\n\n"
- "Creates a square sound which plays a square wave.\n\n"
- ":arg frequency: The frequency of the square wave in Hz.\n"
- ":type frequency: float\n"
- ":arg rate: The sampling rate in Hz. It's recommended to set this "
- "value to the playback device's samling rate to avoid resamping.\n"
- ":type rate: int\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: square(frequency, rate=48000)\n\n"
+ " Creates a square sound which plays a square wave.\n\n"
+ " :arg frequency: The frequency of the square wave in Hz.\n"
+ " :type frequency: float\n"
+ " :arg rate: The sampling rate in Hz. It's recommended to set this\n"
+ " value to the playback device's samling rate to avoid resamping.\n"
+ " :type rate: int\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_square(PyTypeObject* type, PyObject* args)
@@ -587,15 +589,15 @@ Sound_square(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_triangle_doc,
- "triangle(frequency, rate=48000)\n\n"
- "Creates a triangle sound which plays a triangle wave.\n\n"
- ":arg frequency: The frequency of the triangle wave in Hz.\n"
- ":type frequency: float\n"
- ":arg rate: The sampling rate in Hz. It's recommended to set this "
- "value to the playback device's samling rate to avoid resamping.\n"
- ":type rate: int\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: triangle(frequency, rate=48000)\n\n"
+ " Creates a triangle sound which plays a triangle wave.\n\n"
+ " :arg frequency: The frequency of the triangle wave in Hz.\n"
+ " :type frequency: float\n"
+ " :arg rate: The sampling rate in Hz. It's recommended to set this\n"
+ " value to the playback device's samling rate to avoid resamping.\n"
+ " :type rate: int\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_triangle(PyTypeObject* type, PyObject* args)
@@ -627,14 +629,16 @@ Sound_triangle(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_accumulate_doc,
- "accumulate(additive=False)\n\n"
- "Accumulates a sound by summing over positive input differences thus generating a monotonic sigal. "
- "If additivity is set to true negative input differences get added too, but positive ones with a factor of two. "
- "Note that with additivity the signal is not monotonic anymore.\n\n"
- ":arg additive: Whether the accumulation should be additive or not.\n"
- ":type time: bool\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: accumulate(additive=False)\n\n"
+ " Accumulates a sound by summing over positive input\n"
+ " differences thus generating a monotonic sigal.\n"
+ " If additivity is set to true negative input differences get added too,\n"
+ " but positive ones with a factor of two.\n\n"
+ " Note that with additivity the signal is not monotonic anymore.\n\n"
+ " :arg additive: Whether the accumulation should be additive or not.\n"
+ " :type time: bool\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_accumulate(Sound* self, PyObject* args)
@@ -677,19 +681,19 @@ Sound_accumulate(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_ADSR_doc,
- "ADSR(attack,decay,sustain,release)\n\n"
- "Attack-Decay-Sustain-Release envelopes the volume of a sound. "
- "Note: there is currently no way to trigger the release with this API.\n\n"
- ":arg attack: The attack time in seconds.\n"
- ":type attack: float\n"
- ":arg decay: The decay time in seconds.\n"
- ":type decay: float\n"
- ":arg sustain: The sustain level.\n"
- ":type sustain: float\n"
- ":arg release: The release level.\n"
- ":type release: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: ADSR(attack, decay, sustain, release)\n\n"
+ " Attack-Decay-Sustain-Release envelopes the volume of a sound.\n"
+ " Note: there is currently no way to trigger the release with this API.\n\n"
+ " :arg attack: The attack time in seconds.\n"
+ " :type attack: float\n"
+ " :arg decay: The decay time in seconds.\n"
+ " :type decay: float\n"
+ " :arg sustain: The sustain level.\n"
+ " :type sustain: float\n"
+ " :arg release: The release level.\n"
+ " :type release: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_ADSR(Sound* self, PyObject* args)
@@ -720,14 +724,12 @@ Sound_ADSR(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_delay_doc,
- "delay(time)\n\n"
- "Delays by playing adding silence in front of the other sound's "
- "data.\n\n"
- ":arg time: How many seconds of silence should be added before "
- "the sound.\n"
- ":type time: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: delay(time)\n\n"
+ " Delays by playing adding silence in front of the other sound's data.\n\n"
+ " :arg time: How many seconds of silence should be added before the sound.\n"
+ " :type time: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_delay(Sound* self, PyObject* args)
@@ -758,19 +760,18 @@ Sound_delay(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_envelope_doc,
- "envelope(attack, release, threshold, arthreshold)\n\n"
- "Delays by playing adding silence in front of the other sound's "
- "data.\n\n"
- ":arg attack: The attack factor.\n"
- ":type attack: float\n"
- ":arg release: The release factor.\n"
- ":type release: float\n"
- ":arg threshold: The general threshold value.\n"
- ":type threshold: float\n"
- ":arg arthreshold: The attack/release threshold value.\n"
- ":type arthreshold: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: envelope(attack, release, threshold, arthreshold)\n\n"
+ " Delays by playing adding silence in front of the other sound's data.\n\n"
+ " :arg attack: The attack factor.\n"
+ " :type attack: float\n"
+ " :arg release: The release factor.\n"
+ " :type release: float\n"
+ " :arg threshold: The general threshold value.\n"
+ " :type threshold: float\n"
+ " :arg arthreshold: The attack/release threshold value.\n"
+ " :type arthreshold: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_envelope(Sound* self, PyObject* args)
@@ -801,16 +802,16 @@ Sound_envelope(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_fadein_doc,
- "fadein(start, length)\n\n"
- "Fades a sound in by raising the volume linearly in the given "
- "time interval.\n\n"
- ":arg start: Time in seconds when the fading should start.\n"
- ":type start: float\n"
- ":arg length: Time in seconds how long the fading should last.\n"
- ":type length: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: Before the fade starts it plays silence.");
+ ".. classmethod:: fadein(start, length)\n\n"
+ " Fades a sound in by raising the volume linearly in the given\n"
+ " time interval.\n\n"
+ " :arg start: Time in seconds when the fading should start.\n"
+ " :type start: float\n"
+ " :arg length: Time in seconds how long the fading should last.\n"
+ " :type length: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note:: Before the fade starts it plays silence.");
static PyObject *
Sound_fadein(Sound* self, PyObject* args)
@@ -841,17 +842,18 @@ Sound_fadein(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_fadeout_doc,
- "fadeout(start, length)\n\n"
- "Fades a sound in by lowering the volume linearly in the given "
- "time interval.\n\n"
- ":arg start: Time in seconds when the fading should start.\n"
- ":type start: float\n"
- ":arg length: Time in seconds how long the fading should last.\n"
- ":type length: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: After the fade this sound plays silence, so that "
- "the length of the sound is not altered.");
+ ".. classmethod:: fadeout(start, length)\n\n"
+ " Fades a sound in by lowering the volume linearly in the given\n"
+ " time interval.\n\n"
+ " :arg start: Time in seconds when the fading should start.\n"
+ " :type start: float\n"
+ " :arg length: Time in seconds how long the fading should last.\n"
+ " :type length: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note::\n\n"
+ " After the fade this sound plays silence, so that\n"
+ " the length of the sound is not altered.");
static PyObject *
Sound_fadeout(Sound* self, PyObject* args)
@@ -882,20 +884,20 @@ Sound_fadeout(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_filter_doc,
- "filter(b, a = (1))\n\n"
- "Filters a sound with the supplied IIR filter coefficients.\n"
- "Without the second parameter you'll get a FIR filter.\n"
- "If the first value of the a sequence is 0 it will be set to 1 "
- "automatically.\n"
- "If the first value of the a sequence is neither 0 nor 1, all "
- "filter coefficients will be scaled by this value so that it is 1 "
- "in the end, you don't have to scale yourself.\n\n"
- ":arg b: The nominator filter coefficients.\n"
- ":type b: sequence of float\n"
- ":arg a: The denominator filter coefficients.\n"
- ":type a: sequence of float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: filter(b, a = (1))\n\n"
+ " Filters a sound with the supplied IIR filter coefficients.\n"
+ " Without the second parameter you'll get a FIR filter.\n\n"
+ " If the first value of the a sequence is 0,\n"
+ " it will be set to 1 automatically.\n"
+ " If the first value of the a sequence is neither 0 nor 1, all\n"
+ " filter coefficients will be scaled by this value so that it is 1\n"
+ " in the end, you don't have to scale yourself.\n\n"
+ " :arg b: The nominator filter coefficients.\n"
+ " :type b: sequence of float\n"
+ " :arg a: The denominator filter coefficients.\n"
+ " :type a: sequence of float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_filter(Sound* self, PyObject* args)
@@ -982,15 +984,15 @@ Sound_filter(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_highpass_doc,
- "highpass(frequency, Q=0.5)\n\n"
- "Creates a second order highpass filter based on the transfer "
- "function H(s) = s^2 / (s^2 + s/Q + 1)\n\n"
- ":arg frequency: The cut off trequency of the highpass.\n"
- ":type frequency: float\n"
- ":arg Q: Q factor of the lowpass.\n"
- ":type Q: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: highpass(frequency, Q=0.5)\n\n"
+ " Creates a second order highpass filter based on the transfer\n"
+ " function :math:`H(s) = s^2 / (s^2 + s/Q + 1)`\n\n"
+ " :arg frequency: The cut off trequency of the highpass.\n"
+ " :type frequency: float\n"
+ " :arg Q: Q factor of the lowpass.\n"
+ " :type Q: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_highpass(Sound* self, PyObject* args)
@@ -1022,14 +1024,14 @@ Sound_highpass(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_limit_doc,
- "limit(start, end)\n\n"
- "Limits a sound within a specific start and end time.\n\n"
- ":arg start: Start time in seconds.\n"
- ":type start: float\n"
- ":arg end: End time in seconds.\n"
- ":type end: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: limit(start, end)\n\n"
+ " Limits a sound within a specific start and end time.\n\n"
+ " :arg start: Start time in seconds.\n"
+ " :type start: float\n"
+ " :arg end: End time in seconds.\n"
+ " :type end: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_limit(Sound* self, PyObject* args)
@@ -1060,15 +1062,16 @@ Sound_limit(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_loop_doc,
- "loop(count)\n\n"
- "Loops a sound.\n\n"
- ":arg count: How often the sound should be looped. "
- "Negative values mean endlessly.\n"
- ":type count: integer\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: This is a filter function, you might consider using "
- ":attr:`Handle.loop_count` instead.");
+ ".. classmethod:: loop(count)\n\n"
+ " Loops a sound.\n\n"
+ " :arg count: How often the sound should be looped.\n"
+ " Negative values mean endlessly.\n"
+ " :type count: integer\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note::\n\n"
+ " This is a filter function, you might consider using\n"
+ " :attr:`Handle.loop_count` instead.");
static PyObject *
Sound_loop(Sound* self, PyObject* args)
@@ -1099,15 +1102,15 @@ Sound_loop(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_lowpass_doc,
- "lowpass(frequency, Q=0.5)\n\n"
- "Creates a second order lowpass filter based on the transfer "
- "function H(s) = 1 / (s^2 + s/Q + 1)\n\n"
- ":arg frequency: The cut off trequency of the lowpass.\n"
- ":type frequency: float\n"
- ":arg Q: Q factor of the lowpass.\n"
- ":type Q: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: lowpass(frequency, Q=0.5)\n\n"
+ " Creates a second order lowpass filter based on the transfer "
+ " function :math:`H(s) = 1 / (s^2 + s/Q + 1)`\n\n"
+ " :arg frequency: The cut off trequency of the lowpass.\n"
+ " :type frequency: float\n"
+ " :arg Q: Q factor of the lowpass.\n"
+ " :type Q: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_lowpass(Sound* self, PyObject* args)
@@ -1139,14 +1142,15 @@ Sound_lowpass(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_modulate_doc,
- "modulate(sound)\n\n"
- "Modulates two factories.\n\n"
- ":arg sound: The sound to modulate over the other.\n"
- ":type sound: :class:`Sound`\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: The two factories have to have the same specifications "
- "(channels and samplerate).");
+ ".. classmethod:: modulate(sound)\n\n"
+ " Modulates two factories.\n\n"
+ " :arg sound: The sound to modulate over the other.\n"
+ " :type sound: :class:`Sound`\n"
+ " :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).");
static PyObject *
Sound_modulate(Sound* self, PyObject* object)
@@ -1180,17 +1184,19 @@ Sound_modulate(Sound* self, PyObject* object)
}
PyDoc_STRVAR(M_aud_Sound_pitch_doc,
- "pitch(factor)\n\n"
- "Changes the pitch of a sound with a specific factor.\n\n"
- ":arg factor: The factor to change the pitch with.\n"
- ":type factor: float\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: This is done by changing the sample rate of the "
- "underlying sound, which has to be an integer, so the factor "
- "value rounded and the factor may not be 100 % accurate.\n\n"
- ".. note:: This is a filter function, you might consider using "
- ":attr:`Handle.pitch` instead.");
+ ".. classmethod:: pitch(factor)\n\n"
+ " Changes the pitch of a sound with a specific factor.\n\n"
+ " :arg factor: The factor to change the pitch with.\n"
+ " :type factor: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note::\n\n"
+ " This is done by changing the sample rate of the\n"
+ " underlying sound, which has to be an integer, so the factor\n"
+ " value rounded and the factor may not be 100 % accurate.\n\n"
+ " .. note::\n\n"
+ " This is a filter function, you might consider using\n"
+ " :attr:`Handle.pitch` instead.");
static PyObject *
Sound_pitch(Sound* self, PyObject* args)
@@ -1221,12 +1227,12 @@ Sound_pitch(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_rechannel_doc,
- "rechannel(channels)\n\n"
- "Rechannels the sound.\n\n"
- ":arg channels: The new channel configuration.\n"
- ":type channels: int\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: rechannel(channels)\n\n"
+ " Rechannels the sound.\n\n"
+ " :arg channels: The new channel configuration.\n"
+ " :type channels: int\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_rechannel(Sound* self, PyObject* args)
@@ -1261,14 +1267,14 @@ Sound_rechannel(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_resample_doc,
- "resample(rate, high_quality)\n\n"
- "Resamples the sound.\n\n"
- ":arg rate: The new sample rate.\n"
- ":type rate: double\n"
- ":arg high_quality: When true use a higher quality but slower resampler.\n"
- ":type high_quality: bool\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: resample(rate, high_quality)\n\n"
+ " Resamples the sound.\n\n"
+ " :arg rate: The new sample rate.\n"
+ " :type rate: double\n"
+ " :arg high_quality: When true use a higher quality but slower resampler.\n"
+ " :type high_quality: bool\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_resample(Sound* self, PyObject* args)
@@ -1316,17 +1322,19 @@ Sound_resample(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_reverse_doc,
- "reverse()\n\n"
- "Plays a sound reversed.\n\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: The sound has to have a finite length and has to be "
- "seekable. It's recommended to use this only with factories with "
- "fast and accurate seeking, which is not true for encoded audio "
- "files, such ones should be buffered using :meth:`cache` before "
- "being played reversed.\n\n"
- ".. warning:: If seeking is not accurate in the underlying sound "
- "you'll likely hear skips/jumps/cracks.");
+ ".. classmethod:: reverse()\n\n"
+ " Plays a sound reversed.\n\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\n\n"
+ " .. note::\n\n"
+ " The sound has to have a finite length and has to be seekable.\n"
+ " It's recommended to use this only with factories with\n"
+ " fast and accurate seeking, which is not true for encoded audio\n"
+ " files, such ones should be buffered using :meth:`cache` before\n"
+ " being played reversed.\n\n"
+ " .. warning::\n\n"
+ " If seeking is not accurate in the underlying sound\n"
+ " you'll likely hear skips/jumps/cracks.");
static PyObject *
Sound_reverse(Sound* self)
@@ -1352,10 +1360,10 @@ Sound_reverse(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_sum_doc,
- "sum()\n\n"
- "Sums the samples of a sound.\n\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: sum()\n\n"
+ " Sums the samples of a sound.\n\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_sum(Sound* self)
@@ -1381,12 +1389,12 @@ Sound_sum(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_threshold_doc,
- "threshold(threshold = 0)\n\n"
- "Makes a threshold wave out of an audio wave by setting all samples "
- "with a amplitude >= threshold to 1, all <= -threshold to -1 and "
- "all between to 0.\n\n"
- ":arg threshold: Threshold value over which an amplitude counts "
- "non-zero.\n"
+ ".. classmethod:: threshold(threshold = 0)\n\n"
+ " Makes a threshold wave out of an audio wave by setting all samples\n"
+ " 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\n"
":type threshold: float\n"
":return: The created :class:`Sound` object.\n"
":rtype: :class:`Sound`");
@@ -1420,15 +1428,17 @@ Sound_threshold(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_volume_doc,
- "volume(volume)\n\n"
- "Changes the volume of a sound.\n\n"
- ":arg volume: The new volume..\n"
- ":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:: This is a filter function, you might consider using "
- ":attr:`Handle.volume` instead.");
+ ".. classmethod:: volume(volume)\n\n"
+ " Changes the volume of a sound.\n\n"
+ " :arg volume: The new volume..\n"
+ " :type volume: float\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`\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.");
static PyObject *
Sound_volume(Sound* self, PyObject* args)
@@ -1459,14 +1469,15 @@ Sound_volume(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_join_doc,
- "join(sound)\n\n"
- "Plays two factories in sequence.\n\n"
- ":arg sound: The sound to play second.\n"
- ":type sound: :class:`Sound`\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: The two factories have to have the same specifications "
- "(channels and samplerate).");
+ ".. classmethod:: join(sound)\n\n"
+ " Plays two factories in sequence.\n\n"
+ " :arg sound: The sound to play second.\n"
+ " :type sound: :class:`Sound`\n"
+ " :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).");
static PyObject *
Sound_join(Sound* self, PyObject* object)
@@ -1501,14 +1512,15 @@ Sound_join(Sound* self, PyObject* object)
}
PyDoc_STRVAR(M_aud_Sound_mix_doc,
- "mix(sound)\n\n"
- "Mixes two factories.\n\n"
- ":arg sound: The sound to mix over the other.\n"
- ":type sound: :class:`Sound`\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`\n\n"
- ".. note:: The two factories have to have the same specifications "
- "(channels and samplerate).");
+ ".. classmethod:: mix(sound)\n\n"
+ " Mixes two factories.\n\n"
+ " :arg sound: The sound to mix over the other.\n"
+ " :type sound: :class:`Sound`\n"
+ " :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).");
static PyObject *
Sound_mix(Sound* self, PyObject* object)
@@ -1542,11 +1554,11 @@ Sound_mix(Sound* self, PyObject* object)
}
PyDoc_STRVAR(M_aud_Sound_pingpong_doc,
- "pingpong()\n\n"
- "Plays a sound forward and then backward.\n"
- "This is like joining a sound with its reverse.\n\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: pingpong()\n\n"
+ " Plays a sound forward and then backward.\n"
+ " This is like joining a sound with its reverse.\n\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_pingpong(Sound* self)
@@ -1572,12 +1584,12 @@ Sound_pingpong(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_list_doc,
- "list()\n\n"
- "Creates an empty sound list that can contain several sounds.\n\n"
- ":arg random: wether the playback will be random or not.\n"
- ":type random: int\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: list()\n\n"
+ " Creates an empty sound list that can contain several sounds.\n\n"
+ " :arg random: whether the playback will be random or not.\n"
+ " :type random: int\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_list(PyTypeObject* type, PyObject* args)
@@ -1608,11 +1620,11 @@ Sound_list(PyTypeObject* type, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_mutable_doc,
- "mutable()\n\n"
- "Creates a sound that will be restarted when sought backwards.\n"
- "If the original sound is a sound list, the playing sound can change.\n\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: mutable()\n\n"
+ " Creates a sound that will be restarted when sought backwards.\n"
+ " If the original sound is a sound list, the playing sound can change.\n\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_mutable(Sound* self)
@@ -1638,12 +1650,12 @@ Sound_mutable(Sound* self)
}
PyDoc_STRVAR(M_aud_Sound_list_addSound_doc,
- "addSound(sound)\n\n"
- "Adds a new sound to a sound list.\n\n"
- ":arg sound: The sound that will be added to the list.\n"
- ":type sound: :class:`Sound`\n\n"
- ".. note:: You can only add a sound to a sound list.");
-
+ ".. classmethod:: addSound(sound)\n\n"
+ " Adds a new sound to a sound list.\n\n"
+ " :arg sound: The sound that will be added to the list.\n"
+ " :type sound: :class:`Sound`\n\n"
+ " .. note:: You can only add a sound to a sound list.");
+
static PyObject *
Sound_list_addSound(Sound* self, PyObject* object)
{
@@ -1671,14 +1683,14 @@ Sound_list_addSound(Sound* self, PyObject* object)
#ifdef WITH_CONVOLUTION
PyDoc_STRVAR(M_aud_Sound_convolver_doc,
- "convolver()\n\n"
- "Creates a sound that will apply convolution to another sound.\n\n"
- ":arg impulseResponse: The filter with which convolve the sound.\n"
- ":type impulseResponse: :class:`ImpulseResponse`\n"
- ":arg threadPool: A thread pool used to parallelize convolution.\n"
- ":type threadPool: :class:`ThreadPool`\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: convolver()\n\n"
+ " Creates a sound that will apply convolution to another sound.\n\n"
+ " :arg impulseResponse: The filter with which convolve the sound.\n"
+ " :type impulseResponse: :class:`ImpulseResponse`\n"
+ " :arg threadPool: A thread pool used to parallelize convolution.\n"
+ " :type threadPool: :class:`ThreadPool`\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_convolver(Sound* self, PyObject* args)
@@ -1720,16 +1732,16 @@ Sound_convolver(Sound* self, PyObject* args)
}
PyDoc_STRVAR(M_aud_Sound_binaural_doc,
- "convolver()\n\n"
- "Creates a binaural sound using another sound as source. The original sound must be mono\n\n"
- ":arg hrtfs: An HRTF set.\n"
- ":type hrtf: :class:`HRTF`\n"
- ":arg source: An object representing the source position of the sound.\n"
- ":type source: :class:`Source`\n"
- ":arg threadPool: A thread pool used to parallelize convolution.\n"
- ":type threadPool: :class:`ThreadPool`\n"
- ":return: The created :class:`Sound` object.\n"
- ":rtype: :class:`Sound`");
+ ".. classmethod:: convolver()\n\n"
+ " Creates a binaural sound using another sound as source. The original sound must be mono\n\n"
+ " :arg hrtfs: An HRTF set.\n"
+ " :type hrtf: :class:`HRTF`\n"
+ " :arg source: An object representing the source position of the sound.\n"
+ " :type source: :class:`Source`\n"
+ " :arg threadPool: A thread pool used to parallelize convolution.\n"
+ " :type threadPool: :class:`ThreadPool`\n"
+ " :return: The created :class:`Sound` object.\n"
+ " :rtype: :class:`Sound`");
static PyObject *
Sound_binaural(Sound* self, PyObject* args)
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<IHandle> handle, float time);
- virtual float getPosition(std::shared_ptr<IHandle> handle);
+ virtual void seek(std::shared_ptr<IHandle> handle, double time);
+ virtual double getPosition(std::shared_ptr<IHandle> 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<IHandle> handle, float time) = 0;
+ virtual void seek(std::shared_ptr<IHandle> 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<IHandle> handle) = 0;
+ virtual double getPosition(std::shared_ptr<IHandle> 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<ISound> sound, float delay = 0);
+ Delay(std::shared_ptr<ISound> sound, double delay = 0);
/**
* Returns the delay in seconds.
*/
- float getDelay() const;
+ double getDelay() const;
virtual std::shared_ptr<IReader> 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<IReader> reader, float delay);
+ DelayReader(std::shared_ptr<IReader> 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<ISound> 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<IReader> 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<IReader> 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<ISound> 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<IReader> 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<IReader> reader, float start = 0, float end = -1);
+ LimiterReader(std::shared_ptr<IReader> 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<SequenceEntry> add(std::shared_ptr<ISound> sound, float begin, float end, float skip);
+ std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> 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<SequenceEntry> add(std::shared_ptr<ISound> sound, float begin, float end, float skip);
+ std::shared_ptr<SequenceEntry> add(std::shared_ptr<ISound> 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<ISound> 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<ISound> sound, float begin, float end, float skip, int id);
+ SequenceEntry(std::shared_ptr<ISound> 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<IHandle> handle, float time)
+void JackSynchronizer::seek(std::shared_ptr<IHandle> handle, double time)
{
m_device->seekPlayback(time);
}
-float JackSynchronizer::getPosition(std::shared_ptr<IHandle> handle)
+double JackSynchronizer::getPosition(std::shared_ptr<IHandle> 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<IHandle> handle, float time);
- virtual float getPosition(std::shared_ptr<IHandle> handle);
+ virtual void seek(std::shared_ptr<IHandle> handle, double time);
+ virtual double getPosition(std::shared_ptr<IHandle> 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<IHandle> handle, float time)
+void DefaultSynchronizer::seek(std::shared_ptr<IHandle> handle, double time)
{
handle->seek(time);
}
-float DefaultSynchronizer::getPosition(std::shared_ptr<IHandle> handle)
+double DefaultSynchronizer::getPosition(std::shared_ptr<IHandle> 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<float>::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<ISound> sound, float delay) :
+Delay::Delay(std::shared_ptr<ISound> 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<IReader> reader, float delay) :
+DelayReader::DelayReader(std::shared_ptr<IReader> 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<ISound> 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<ISound> sound, FadeType type, float start, float length) :
+Fader::Fader(std::shared_ptr<ISound> 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<IReader> reader, FadeType type, float start,float length) :
+FaderReader::FaderReader(std::shared_ptr<IReader> 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<ISound> 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<IReader> reader, float start, float end) :
+LimiterReader::LimiterReader(std::shared_ptr<IReader> 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 <algorithm>
#include <cmath>
#include <limits>
-#include <algorithm>
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<SequenceEntry> Sequence::add(std::shared_ptr<ISound> sound, float begin, float end, float skip)
+std::shared_ptr<SequenceEntry> Sequence::add(std::shared_ptr<ISound> 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<SequenceEntry> SequenceData::add(std::shared_ptr<ISound> sound, float begin, float end, float skip)
+std::shared_ptr<SequenceEntry> SequenceData::add(std::shared_ptr<ISound> sound, double begin, double end, double skip)
{
std::lock_guard<std::recursive_mutex> 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<ISound> sound, float begin, float end, float skip, int id) :
+SequenceEntry::SequenceEntry(std::shared_ptr<ISound> 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<ISound> sound)
}
}
-void SequenceEntry::move(float begin, float end, float skip)
+void SequenceEntry::move(double begin, double end, double skip)
{
std::lock_guard<std::recursive_mutex> 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<ILockable> 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<ILockable> 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<data_t*>(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/extern/mantaflow/UPDATE.sh b/extern/mantaflow/UPDATE.sh
index 0db18d03094..3feb1ba9226 100644
--- a/extern/mantaflow/UPDATE.sh
+++ b/extern/mantaflow/UPDATE.sh
@@ -71,7 +71,7 @@ rm $BLENDER_INSTALLATION/blender/tmp/preprocessed/fileio/*.reg
cd $BLENDER_INSTALLATION/blender/tmp/
echo "Applying clang format to Mantaflow source files"
-find . -iname *.h -o -iname *.cpp | xargs clang-format --verbose -i -style=file
+find . -iname *.h -o -iname *.cpp | xargs clang-format --verbose -i -style=file -sort-includes=0
find . -iname *.h -o -iname *.cpp | xargs dos2unix --verbose
# ==================== 5) MOVE MANTAFLOW FILES TO EXTERN/ ================================
diff --git a/extern/mantaflow/preprocessed/gitinfo.h b/extern/mantaflow/preprocessed/gitinfo.h
index 208d8008a7e..023974fd6cd 100644
--- a/extern/mantaflow/preprocessed/gitinfo.h
+++ b/extern/mantaflow/preprocessed/gitinfo.h
@@ -1,3 +1,3 @@
-#define MANTA_GIT_VERSION "commit 5fbd3d04381b21afce4a593d1fe2d9bc7bef5424"
+#define MANTA_GIT_VERSION "commit b61bf9efa7a1d8ca98635076a7e9f2c4dacb2914"
diff --git a/extern/mantaflow/preprocessed/grid.cpp b/extern/mantaflow/preprocessed/grid.cpp
index f10052349d5..0ea3afb91f4 100644
--- a/extern/mantaflow/preprocessed/grid.cpp
+++ b/extern/mantaflow/preprocessed/grid.cpp
@@ -853,6 +853,147 @@ template<class T> struct knPermuteAxes : public KernelBase {
int axis2;
};
+struct knJoinVec : public KernelBase {
+ knJoinVec(Grid<Vec3> &a, const Grid<Vec3> &b, bool keepMax)
+ : KernelBase(&a, 0), a(a), b(b), keepMax(keepMax)
+ {
+ runMessage();
+ run();
+ }
+ inline void op(IndexInt idx, Grid<Vec3> &a, const Grid<Vec3> &b, bool keepMax) const
+ {
+ Real a1 = normSquare(a[idx]);
+ Real b1 = normSquare(b[idx]);
+ a[idx] = (keepMax) ? max(a1, b1) : min(a1, b1);
+ }
+ inline Grid<Vec3> &getArg0()
+ {
+ return a;
+ }
+ typedef Grid<Vec3> type0;
+ inline const Grid<Vec3> &getArg1()
+ {
+ return b;
+ }
+ typedef Grid<Vec3> type1;
+ inline bool &getArg2()
+ {
+ return keepMax;
+ }
+ typedef bool type2;
+ void runMessage()
+ {
+ debMsg("Executing kernel knJoinVec ", 3);
+ debMsg("Kernel range"
+ << " x " << maxX << " y " << maxY << " z " << minZ << " - " << maxZ << " ",
+ 4);
+ };
+ void operator()(const tbb::blocked_range<IndexInt> &__r) const
+ {
+ for (IndexInt idx = __r.begin(); idx != (IndexInt)__r.end(); idx++)
+ op(idx, a, b, keepMax);
+ }
+ void run()
+ {
+ tbb::parallel_for(tbb::blocked_range<IndexInt>(0, size), *this);
+ }
+ Grid<Vec3> &a;
+ const Grid<Vec3> &b;
+ bool keepMax;
+};
+struct knJoinInt : public KernelBase {
+ knJoinInt(Grid<int> &a, const Grid<int> &b, bool keepMax)
+ : KernelBase(&a, 0), a(a), b(b), keepMax(keepMax)
+ {
+ runMessage();
+ run();
+ }
+ inline void op(IndexInt idx, Grid<int> &a, const Grid<int> &b, bool keepMax) const
+ {
+ a[idx] = (keepMax) ? max(a[idx], b[idx]) : min(a[idx], b[idx]);
+ }
+ inline Grid<int> &getArg0()
+ {
+ return a;
+ }
+ typedef Grid<int> type0;
+ inline const Grid<int> &getArg1()
+ {
+ return b;
+ }
+ typedef Grid<int> type1;
+ inline bool &getArg2()
+ {
+ return keepMax;
+ }
+ typedef bool type2;
+ void runMessage()
+ {
+ debMsg("Executing kernel knJoinInt ", 3);
+ debMsg("Kernel range"
+ << " x " << maxX << " y " << maxY << " z " << minZ << " - " << maxZ << " ",
+ 4);
+ };
+ void operator()(const tbb::blocked_range<IndexInt> &__r) const
+ {
+ for (IndexInt idx = __r.begin(); idx != (IndexInt)__r.end(); idx++)
+ op(idx, a, b, keepMax);
+ }
+ void run()
+ {
+ tbb::parallel_for(tbb::blocked_range<IndexInt>(0, size), *this);
+ }
+ Grid<int> &a;
+ const Grid<int> &b;
+ bool keepMax;
+};
+struct knJoinReal : public KernelBase {
+ knJoinReal(Grid<Real> &a, const Grid<Real> &b, bool keepMax)
+ : KernelBase(&a, 0), a(a), b(b), keepMax(keepMax)
+ {
+ runMessage();
+ run();
+ }
+ inline void op(IndexInt idx, Grid<Real> &a, const Grid<Real> &b, bool keepMax) const
+ {
+ a[idx] = (keepMax) ? max(a[idx], b[idx]) : min(a[idx], b[idx]);
+ }
+ inline Grid<Real> &getArg0()
+ {
+ return a;
+ }
+ typedef Grid<Real> type0;
+ inline const Grid<Real> &getArg1()
+ {
+ return b;
+ }
+ typedef Grid<Real> type1;
+ inline bool &getArg2()
+ {
+ return keepMax;
+ }
+ typedef bool type2;
+ void runMessage()
+ {
+ debMsg("Executing kernel knJoinReal ", 3);
+ debMsg("Kernel range"
+ << " x " << maxX << " y " << maxY << " z " << minZ << " - " << maxZ << " ",
+ 4);
+ };
+ void operator()(const tbb::blocked_range<IndexInt> &__r) const
+ {
+ for (IndexInt idx = __r.begin(); idx != (IndexInt)__r.end(); idx++)
+ op(idx, a, b, keepMax);
+ }
+ void run()
+ {
+ tbb::parallel_for(tbb::blocked_range<IndexInt>(0, size), *this);
+ }
+ Grid<Real> &a;
+ const Grid<Real> &b;
+ bool keepMax;
+};
+
template<class T> Grid<T> &Grid<T>::safeDivide(const Grid<T> &a)
{
knGridSafeDiv<T>(*this, a);
@@ -928,6 +1069,18 @@ void Grid<T>::permuteAxesCopyToGrid(int axis0, int axis1, int axis2, Grid<T> &ou
"Permuted grids must have the same dimensions!");
knPermuteAxes<T>(*this, out, axis0, axis1, axis2);
}
+template<> void Grid<Vec3>::join(const Grid<Vec3> &a, bool keepMax)
+{
+ knJoinVec(*this, a, keepMax);
+}
+template<> void Grid<int>::join(const Grid<int> &a, bool keepMax)
+{
+ knJoinInt(*this, a, keepMax);
+}
+template<> void Grid<Real>::join(const Grid<Real> &a, bool keepMax)
+{
+ knJoinReal(*this, a, keepMax);
+}
template<> Real Grid<Real>::getMax() const
{
diff --git a/extern/mantaflow/preprocessed/grid.h b/extern/mantaflow/preprocessed/grid.h
index 6abe3a2b08a..fe386cfc269 100644
--- a/extern/mantaflow/preprocessed/grid.h
+++ b/extern/mantaflow/preprocessed/grid.h
@@ -966,10 +966,38 @@ template<class T> class Grid : public GridBase {
}
}
+ //! join other grid by either keeping min or max value at cell
+ void join(const Grid<T> &a, bool keepMax = true);
+ static PyObject *_W_27(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ {
+ try {
+ PbArgs _args(_linargs, _kwds);
+ Grid *pbo = dynamic_cast<Grid *>(Pb::objFromPy(_self));
+ bool noTiming = _args.getOpt<bool>("notiming", -1, 0);
+ pbPreparePlugin(pbo->getParent(), "Grid::join", !noTiming);
+ PyObject *_retval = 0;
+ {
+ ArgLocker _lock;
+ const Grid<T> &a = *_args.getPtr<Grid<T>>("a", 0, &_lock);
+ bool keepMax = _args.getOpt<bool>("keepMax", 1, true, &_lock);
+ pbo->_args.copy(_args);
+ _retval = getPyNone();
+ pbo->join(a, keepMax);
+ pbo->_args.check();
+ }
+ pbFinalizePlugin(pbo->getParent(), "Grid::join", !noTiming);
+ return _retval;
+ }
+ catch (std::exception &e) {
+ pbSetError("Grid::join", e.what());
+ return 0;
+ }
+ }
+
// common compound operators
//! get absolute max value in grid
Real getMaxAbs() const;
- static PyObject *_W_27(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_28(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -994,7 +1022,7 @@ template<class T> class Grid : public GridBase {
//! get max value in grid
Real getMax() const;
- static PyObject *_W_28(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_29(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1019,7 +1047,7 @@ template<class T> class Grid : public GridBase {
//! get min value in grid
Real getMin() const;
- static PyObject *_W_29(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_30(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1044,7 +1072,7 @@ template<class T> class Grid : public GridBase {
//! calculate L1 norm of grid content
Real getL1(int bnd = 0);
- static PyObject *_W_30(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_31(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1070,7 +1098,7 @@ template<class T> class Grid : public GridBase {
//! calculate L2 norm of grid content
Real getL2(int bnd = 0);
- static PyObject *_W_31(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_32(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1096,7 +1124,7 @@ template<class T> class Grid : public GridBase {
//! set all boundary cells to constant value (Dirichlet)
void setBound(T value, int boundaryWidth = 1);
- static PyObject *_W_32(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_33(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1124,7 +1152,7 @@ template<class T> class Grid : public GridBase {
//! set all boundary cells to last inner value (Neumann)
void setBoundNeumann(int boundaryWidth = 1);
- static PyObject *_W_33(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_34(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1151,7 +1179,7 @@ template<class T> class Grid : public GridBase {
//! get data pointer of grid
std::string getDataPointer();
- static PyObject *_W_34(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_35(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1176,7 +1204,7 @@ template<class T> class Grid : public GridBase {
//! debugging helper, print grid from python. skip boundary of width bnd
void printGrid(int zSlice = -1, bool printIndex = false, int bnd = 1);
- static PyObject *_W_35(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_36(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1244,7 +1272,7 @@ class MACGrid : public Grid<Vec3> {
{
mType = (GridType)(TypeMAC | TypeVec3);
}
- static int _W_36(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static int _W_37(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
PbClass *obj = Pb::objFromPy(_self);
if (obj)
@@ -1326,7 +1354,7 @@ class MACGrid : public Grid<Vec3> {
//! set all boundary cells of a MAC grid to certain value (Dirchlet). Respects staggered grid
//! locations optionally, only set normal components
void setBoundMAC(Vec3 value, int boundaryWidth, bool normalOnly = false);
- static PyObject *_W_37(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_38(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1367,7 +1395,7 @@ class FlagGrid : public Grid<int> {
{
mType = (GridType)(TypeFlags | TypeInt);
}
- static int _W_38(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static int _W_39(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
PbClass *obj = Pb::objFromPy(_self);
if (obj)
@@ -1547,7 +1575,7 @@ class FlagGrid : public Grid<int> {
const std::string &inflow = " ",
const std::string &outflow = " ",
Grid<Real> *phiWalls = 0x00);
- static PyObject *_W_39(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_40(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1581,7 +1609,7 @@ class FlagGrid : public Grid<int> {
//! set fluid flags inside levelset (liquids)
void updateFromLevelset(LevelsetGrid &levelset);
- static PyObject *_W_40(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_41(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1608,7 +1636,7 @@ class FlagGrid : public Grid<int> {
//! set all cells (except obs/in/outflow) to type (fluid by default)
void fillGrid(int type = TypeFluid);
- static PyObject *_W_41(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_42(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
@@ -1637,7 +1665,7 @@ class FlagGrid : public Grid<int> {
//! warning for large grids! only regular int returned (due to python interface)
//! optionally creates mask in RealGrid (1 where flag matches, 0 otherwise)
int countCells(int flag, int bnd = 0, Grid<Real> *mask = NULL);
- static PyObject *_W_42(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
+ static PyObject *_W_43(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
try {
PbArgs _args(_linargs, _kwds);
diff --git a/extern/mantaflow/preprocessed/grid.h.reg.cpp b/extern/mantaflow/preprocessed/grid.h.reg.cpp
index 70c4d8de453..9fe3e7298fa 100644
--- a/extern/mantaflow/preprocessed/grid.h.reg.cpp
+++ b/extern/mantaflow/preprocessed/grid.h.reg.cpp
@@ -8,11 +8,11 @@ namespace Manta {
#ifdef _C_FlagGrid
static const Pb::Register _R_26("FlagGrid", "FlagGrid", "Grid<int>");
template<> const char *Namify<FlagGrid>::S = "FlagGrid";
-static const Pb::Register _R_27("FlagGrid", "FlagGrid", FlagGrid::_W_38);
-static const Pb::Register _R_28("FlagGrid", "initDomain", FlagGrid::_W_39);
-static const Pb::Register _R_29("FlagGrid", "updateFromLevelset", FlagGrid::_W_40);
-static const Pb::Register _R_30("FlagGrid", "fillGrid", FlagGrid::_W_41);
-static const Pb::Register _R_31("FlagGrid", "countCells", FlagGrid::_W_42);
+static const Pb::Register _R_27("FlagGrid", "FlagGrid", FlagGrid::_W_39);
+static const Pb::Register _R_28("FlagGrid", "initDomain", FlagGrid::_W_40);
+static const Pb::Register _R_29("FlagGrid", "updateFromLevelset", FlagGrid::_W_41);
+static const Pb::Register _R_30("FlagGrid", "fillGrid", FlagGrid::_W_42);
+static const Pb::Register _R_31("FlagGrid", "countCells", FlagGrid::_W_43);
#endif
#ifdef _C_Grid
static const Pb::Register _R_32("Grid<int>", "Grid<int>", "GridBase");
@@ -35,92 +35,95 @@ static const Pb::Register _R_47("Grid<int>", "clamp", Grid<int>::_W_23);
static const Pb::Register _R_48("Grid<int>", "stomp", Grid<int>::_W_24);
static const Pb::Register _R_49("Grid<int>", "permuteAxes", Grid<int>::_W_25);
static const Pb::Register _R_50("Grid<int>", "permuteAxesCopyToGrid", Grid<int>::_W_26);
-static const Pb::Register _R_51("Grid<int>", "getMaxAbs", Grid<int>::_W_27);
-static const Pb::Register _R_52("Grid<int>", "getMax", Grid<int>::_W_28);
-static const Pb::Register _R_53("Grid<int>", "getMin", Grid<int>::_W_29);
-static const Pb::Register _R_54("Grid<int>", "getL1", Grid<int>::_W_30);
-static const Pb::Register _R_55("Grid<int>", "getL2", Grid<int>::_W_31);
-static const Pb::Register _R_56("Grid<int>", "setBound", Grid<int>::_W_32);
-static const Pb::Register _R_57("Grid<int>", "setBoundNeumann", Grid<int>::_W_33);
-static const Pb::Register _R_58("Grid<int>", "getDataPointer", Grid<int>::_W_34);
-static const Pb::Register _R_59("Grid<int>", "printGrid", Grid<int>::_W_35);
-static const Pb::Register _R_60("Grid<Real>", "Grid<Real>", "GridBase");
+static const Pb::Register _R_51("Grid<int>", "join", Grid<int>::_W_27);
+static const Pb::Register _R_52("Grid<int>", "getMaxAbs", Grid<int>::_W_28);
+static const Pb::Register _R_53("Grid<int>", "getMax", Grid<int>::_W_29);
+static const Pb::Register _R_54("Grid<int>", "getMin", Grid<int>::_W_30);
+static const Pb::Register _R_55("Grid<int>", "getL1", Grid<int>::_W_31);
+static const Pb::Register _R_56("Grid<int>", "getL2", Grid<int>::_W_32);
+static const Pb::Register _R_57("Grid<int>", "setBound", Grid<int>::_W_33);
+static const Pb::Register _R_58("Grid<int>", "setBoundNeumann", Grid<int>::_W_34);
+static const Pb::Register _R_59("Grid<int>", "getDataPointer", Grid<int>::_W_35);
+static const Pb::Register _R_60("Grid<int>", "printGrid", Grid<int>::_W_36);
+static const Pb::Register _R_61("Grid<Real>", "Grid<Real>", "GridBase");
template<> const char *Namify<Grid<Real>>::S = "Grid<Real>";
-static const Pb::Register _R_61("Grid<Real>", "Grid", Grid<Real>::_W_9);
-static const Pb::Register _R_62("Grid<Real>", "save", Grid<Real>::_W_10);
-static const Pb::Register _R_63("Grid<Real>", "load", Grid<Real>::_W_11);
-static const Pb::Register _R_64("Grid<Real>", "clear", Grid<Real>::_W_12);
-static const Pb::Register _R_65("Grid<Real>", "copyFrom", Grid<Real>::_W_13);
-static const Pb::Register _R_66("Grid<Real>", "getGridType", Grid<Real>::_W_14);
-static const Pb::Register _R_67("Grid<Real>", "add", Grid<Real>::_W_15);
-static const Pb::Register _R_68("Grid<Real>", "sub", Grid<Real>::_W_16);
-static const Pb::Register _R_69("Grid<Real>", "setConst", Grid<Real>::_W_17);
-static const Pb::Register _R_70("Grid<Real>", "addConst", Grid<Real>::_W_18);
-static const Pb::Register _R_71("Grid<Real>", "addScaled", Grid<Real>::_W_19);
-static const Pb::Register _R_72("Grid<Real>", "mult", Grid<Real>::_W_20);
-static const Pb::Register _R_73("Grid<Real>", "multConst", Grid<Real>::_W_21);
-static const Pb::Register _R_74("Grid<Real>", "safeDivide", Grid<Real>::_W_22);
-static const Pb::Register _R_75("Grid<Real>", "clamp", Grid<Real>::_W_23);
-static const Pb::Register _R_76("Grid<Real>", "stomp", Grid<Real>::_W_24);
-static const Pb::Register _R_77("Grid<Real>", "permuteAxes", Grid<Real>::_W_25);
-static const Pb::Register _R_78("Grid<Real>", "permuteAxesCopyToGrid", Grid<Real>::_W_26);
-static const Pb::Register _R_79("Grid<Real>", "getMaxAbs", Grid<Real>::_W_27);
-static const Pb::Register _R_80("Grid<Real>", "getMax", Grid<Real>::_W_28);
-static const Pb::Register _R_81("Grid<Real>", "getMin", Grid<Real>::_W_29);
-static const Pb::Register _R_82("Grid<Real>", "getL1", Grid<Real>::_W_30);
-static const Pb::Register _R_83("Grid<Real>", "getL2", Grid<Real>::_W_31);
-static const Pb::Register _R_84("Grid<Real>", "setBound", Grid<Real>::_W_32);
-static const Pb::Register _R_85("Grid<Real>", "setBoundNeumann", Grid<Real>::_W_33);
-static const Pb::Register _R_86("Grid<Real>", "getDataPointer", Grid<Real>::_W_34);
-static const Pb::Register _R_87("Grid<Real>", "printGrid", Grid<Real>::_W_35);
-static const Pb::Register _R_88("Grid<Vec3>", "Grid<Vec3>", "GridBase");
+static const Pb::Register _R_62("Grid<Real>", "Grid", Grid<Real>::_W_9);
+static const Pb::Register _R_63("Grid<Real>", "save", Grid<Real>::_W_10);
+static const Pb::Register _R_64("Grid<Real>", "load", Grid<Real>::_W_11);
+static const Pb::Register _R_65("Grid<Real>", "clear", Grid<Real>::_W_12);
+static const Pb::Register _R_66("Grid<Real>", "copyFrom", Grid<Real>::_W_13);
+static const Pb::Register _R_67("Grid<Real>", "getGridType", Grid<Real>::_W_14);
+static const Pb::Register _R_68("Grid<Real>", "add", Grid<Real>::_W_15);
+static const Pb::Register _R_69("Grid<Real>", "sub", Grid<Real>::_W_16);
+static const Pb::Register _R_70("Grid<Real>", "setConst", Grid<Real>::_W_17);
+static const Pb::Register _R_71("Grid<Real>", "addConst", Grid<Real>::_W_18);
+static const Pb::Register _R_72("Grid<Real>", "addScaled", Grid<Real>::_W_19);
+static const Pb::Register _R_73("Grid<Real>", "mult", Grid<Real>::_W_20);
+static const Pb::Register _R_74("Grid<Real>", "multConst", Grid<Real>::_W_21);
+static const Pb::Register _R_75("Grid<Real>", "safeDivide", Grid<Real>::_W_22);
+static const Pb::Register _R_76("Grid<Real>", "clamp", Grid<Real>::_W_23);
+static const Pb::Register _R_77("Grid<Real>", "stomp", Grid<Real>::_W_24);
+static const Pb::Register _R_78("Grid<Real>", "permuteAxes", Grid<Real>::_W_25);
+static const Pb::Register _R_79("Grid<Real>", "permuteAxesCopyToGrid", Grid<Real>::_W_26);
+static const Pb::Register _R_80("Grid<Real>", "join", Grid<Real>::_W_27);
+static const Pb::Register _R_81("Grid<Real>", "getMaxAbs", Grid<Real>::_W_28);
+static const Pb::Register _R_82("Grid<Real>", "getMax", Grid<Real>::_W_29);
+static const Pb::Register _R_83("Grid<Real>", "getMin", Grid<Real>::_W_30);
+static const Pb::Register _R_84("Grid<Real>", "getL1", Grid<Real>::_W_31);
+static const Pb::Register _R_85("Grid<Real>", "getL2", Grid<Real>::_W_32);
+static const Pb::Register _R_86("Grid<Real>", "setBound", Grid<Real>::_W_33);
+static const Pb::Register _R_87("Grid<Real>", "setBoundNeumann", Grid<Real>::_W_34);
+static const Pb::Register _R_88("Grid<Real>", "getDataPointer", Grid<Real>::_W_35);
+static const Pb::Register _R_89("Grid<Real>", "printGrid", Grid<Real>::_W_36);
+static const Pb::Register _R_90("Grid<Vec3>", "Grid<Vec3>", "GridBase");
template<> const char *Namify<Grid<Vec3>>::S = "Grid<Vec3>";
-static const Pb::Register _R_89("Grid<Vec3>", "Grid", Grid<Vec3>::_W_9);
-static const Pb::Register _R_90("Grid<Vec3>", "save", Grid<Vec3>::_W_10);
-static const Pb::Register _R_91("Grid<Vec3>", "load", Grid<Vec3>::_W_11);
-static const Pb::Register _R_92("Grid<Vec3>", "clear", Grid<Vec3>::_W_12);
-static const Pb::Register _R_93("Grid<Vec3>", "copyFrom", Grid<Vec3>::_W_13);
-static const Pb::Register _R_94("Grid<Vec3>", "getGridType", Grid<Vec3>::_W_14);
-static const Pb::Register _R_95("Grid<Vec3>", "add", Grid<Vec3>::_W_15);
-static const Pb::Register _R_96("Grid<Vec3>", "sub", Grid<Vec3>::_W_16);
-static const Pb::Register _R_97("Grid<Vec3>", "setConst", Grid<Vec3>::_W_17);
-static const Pb::Register _R_98("Grid<Vec3>", "addConst", Grid<Vec3>::_W_18);
-static const Pb::Register _R_99("Grid<Vec3>", "addScaled", Grid<Vec3>::_W_19);
-static const Pb::Register _R_100("Grid<Vec3>", "mult", Grid<Vec3>::_W_20);
-static const Pb::Register _R_101("Grid<Vec3>", "multConst", Grid<Vec3>::_W_21);
-static const Pb::Register _R_102("Grid<Vec3>", "safeDivide", Grid<Vec3>::_W_22);
-static const Pb::Register _R_103("Grid<Vec3>", "clamp", Grid<Vec3>::_W_23);
-static const Pb::Register _R_104("Grid<Vec3>", "stomp", Grid<Vec3>::_W_24);
-static const Pb::Register _R_105("Grid<Vec3>", "permuteAxes", Grid<Vec3>::_W_25);
-static const Pb::Register _R_106("Grid<Vec3>", "permuteAxesCopyToGrid", Grid<Vec3>::_W_26);
-static const Pb::Register _R_107("Grid<Vec3>", "getMaxAbs", Grid<Vec3>::_W_27);
-static const Pb::Register _R_108("Grid<Vec3>", "getMax", Grid<Vec3>::_W_28);
-static const Pb::Register _R_109("Grid<Vec3>", "getMin", Grid<Vec3>::_W_29);
-static const Pb::Register _R_110("Grid<Vec3>", "getL1", Grid<Vec3>::_W_30);
-static const Pb::Register _R_111("Grid<Vec3>", "getL2", Grid<Vec3>::_W_31);
-static const Pb::Register _R_112("Grid<Vec3>", "setBound", Grid<Vec3>::_W_32);
-static const Pb::Register _R_113("Grid<Vec3>", "setBoundNeumann", Grid<Vec3>::_W_33);
-static const Pb::Register _R_114("Grid<Vec3>", "getDataPointer", Grid<Vec3>::_W_34);
-static const Pb::Register _R_115("Grid<Vec3>", "printGrid", Grid<Vec3>::_W_35);
+static const Pb::Register _R_91("Grid<Vec3>", "Grid", Grid<Vec3>::_W_9);
+static const Pb::Register _R_92("Grid<Vec3>", "save", Grid<Vec3>::_W_10);
+static const Pb::Register _R_93("Grid<Vec3>", "load", Grid<Vec3>::_W_11);
+static const Pb::Register _R_94("Grid<Vec3>", "clear", Grid<Vec3>::_W_12);
+static const Pb::Register _R_95("Grid<Vec3>", "copyFrom", Grid<Vec3>::_W_13);
+static const Pb::Register _R_96("Grid<Vec3>", "getGridType", Grid<Vec3>::_W_14);
+static const Pb::Register _R_97("Grid<Vec3>", "add", Grid<Vec3>::_W_15);
+static const Pb::Register _R_98("Grid<Vec3>", "sub", Grid<Vec3>::_W_16);
+static const Pb::Register _R_99("Grid<Vec3>", "setConst", Grid<Vec3>::_W_17);
+static const Pb::Register _R_100("Grid<Vec3>", "addConst", Grid<Vec3>::_W_18);
+static const Pb::Register _R_101("Grid<Vec3>", "addScaled", Grid<Vec3>::_W_19);
+static const Pb::Register _R_102("Grid<Vec3>", "mult", Grid<Vec3>::_W_20);
+static const Pb::Register _R_103("Grid<Vec3>", "multConst", Grid<Vec3>::_W_21);
+static const Pb::Register _R_104("Grid<Vec3>", "safeDivide", Grid<Vec3>::_W_22);
+static const Pb::Register _R_105("Grid<Vec3>", "clamp", Grid<Vec3>::_W_23);
+static const Pb::Register _R_106("Grid<Vec3>", "stomp", Grid<Vec3>::_W_24);
+static const Pb::Register _R_107("Grid<Vec3>", "permuteAxes", Grid<Vec3>::_W_25);
+static const Pb::Register _R_108("Grid<Vec3>", "permuteAxesCopyToGrid", Grid<Vec3>::_W_26);
+static const Pb::Register _R_109("Grid<Vec3>", "join", Grid<Vec3>::_W_27);
+static const Pb::Register _R_110("Grid<Vec3>", "getMaxAbs", Grid<Vec3>::_W_28);
+static const Pb::Register _R_111("Grid<Vec3>", "getMax", Grid<Vec3>::_W_29);
+static const Pb::Register _R_112("Grid<Vec3>", "getMin", Grid<Vec3>::_W_30);
+static const Pb::Register _R_113("Grid<Vec3>", "getL1", Grid<Vec3>::_W_31);
+static const Pb::Register _R_114("Grid<Vec3>", "getL2", Grid<Vec3>::_W_32);
+static const Pb::Register _R_115("Grid<Vec3>", "setBound", Grid<Vec3>::_W_33);
+static const Pb::Register _R_116("Grid<Vec3>", "setBoundNeumann", Grid<Vec3>::_W_34);
+static const Pb::Register _R_117("Grid<Vec3>", "getDataPointer", Grid<Vec3>::_W_35);
+static const Pb::Register _R_118("Grid<Vec3>", "printGrid", Grid<Vec3>::_W_36);
#endif
#ifdef _C_GridBase
-static const Pb::Register _R_116("GridBase", "GridBase", "PbClass");
+static const Pb::Register _R_119("GridBase", "GridBase", "PbClass");
template<> const char *Namify<GridBase>::S = "GridBase";
-static const Pb::Register _R_117("GridBase", "GridBase", GridBase::_W_0);
-static const Pb::Register _R_118("GridBase", "getSizeX", GridBase::_W_1);
-static const Pb::Register _R_119("GridBase", "getSizeY", GridBase::_W_2);
-static const Pb::Register _R_120("GridBase", "getSizeZ", GridBase::_W_3);
-static const Pb::Register _R_121("GridBase", "getSize", GridBase::_W_4);
-static const Pb::Register _R_122("GridBase", "is3D", GridBase::_W_5);
-static const Pb::Register _R_123("GridBase", "is4D", GridBase::_W_6);
-static const Pb::Register _R_124("GridBase", "getSizeT", GridBase::_W_7);
-static const Pb::Register _R_125("GridBase", "getStrideT", GridBase::_W_8);
+static const Pb::Register _R_120("GridBase", "GridBase", GridBase::_W_0);
+static const Pb::Register _R_121("GridBase", "getSizeX", GridBase::_W_1);
+static const Pb::Register _R_122("GridBase", "getSizeY", GridBase::_W_2);
+static const Pb::Register _R_123("GridBase", "getSizeZ", GridBase::_W_3);
+static const Pb::Register _R_124("GridBase", "getSize", GridBase::_W_4);
+static const Pb::Register _R_125("GridBase", "is3D", GridBase::_W_5);
+static const Pb::Register _R_126("GridBase", "is4D", GridBase::_W_6);
+static const Pb::Register _R_127("GridBase", "getSizeT", GridBase::_W_7);
+static const Pb::Register _R_128("GridBase", "getStrideT", GridBase::_W_8);
#endif
#ifdef _C_MACGrid
-static const Pb::Register _R_126("MACGrid", "MACGrid", "Grid<Vec3>");
+static const Pb::Register _R_129("MACGrid", "MACGrid", "Grid<Vec3>");
template<> const char *Namify<MACGrid>::S = "MACGrid";
-static const Pb::Register _R_127("MACGrid", "MACGrid", MACGrid::_W_36);
-static const Pb::Register _R_128("MACGrid", "setBoundMAC", MACGrid::_W_37);
+static const Pb::Register _R_130("MACGrid", "MACGrid", MACGrid::_W_37);
+static const Pb::Register _R_131("MACGrid", "setBoundMAC", MACGrid::_W_38);
#endif
static const Pb::Register _R_7("GridType_TypeNone", 0);
static const Pb::Register _R_8("GridType_TypeReal", 1);
@@ -247,6 +250,9 @@ void PbRegister_file_7()
KEEP_UNUSED(_R_126);
KEEP_UNUSED(_R_127);
KEEP_UNUSED(_R_128);
+ KEEP_UNUSED(_R_129);
+ KEEP_UNUSED(_R_130);
+ KEEP_UNUSED(_R_131);
}
}
} // namespace Manta \ No newline at end of file
diff --git a/extern/mantaflow/preprocessed/particle.h b/extern/mantaflow/preprocessed/particle.h
index 2d41397a961..d9dd3f49c38 100644
--- a/extern/mantaflow/preprocessed/particle.h
+++ b/extern/mantaflow/preprocessed/particle.h
@@ -469,6 +469,7 @@ template<class S> class ParticleSystem : public ParticleBase {
const int integrationMode,
const bool deleteInObstacle = true,
const bool stopInObstacle = true,
+ const bool skipNew = false,
const ParticleDataImpl<int> *ptype = NULL,
const int exclude = 0);
static PyObject *_W_9(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
@@ -486,13 +487,20 @@ template<class S> class ParticleSystem : public ParticleBase {
const int integrationMode = _args.get<int>("integrationMode", 2, &_lock);
const bool deleteInObstacle = _args.getOpt<bool>("deleteInObstacle", 3, true, &_lock);
const bool stopInObstacle = _args.getOpt<bool>("stopInObstacle", 4, true, &_lock);
+ const bool skipNew = _args.getOpt<bool>("skipNew", 5, false, &_lock);
const ParticleDataImpl<int> *ptype = _args.getPtrOpt<ParticleDataImpl<int>>(
- "ptype", 5, NULL, &_lock);
- const int exclude = _args.getOpt<int>("exclude", 6, 0, &_lock);
+ "ptype", 6, NULL, &_lock);
+ const int exclude = _args.getOpt<int>("exclude", 7, 0, &_lock);
pbo->_args.copy(_args);
_retval = getPyNone();
- pbo->advectInGrid(
- flags, vel, integrationMode, deleteInObstacle, stopInObstacle, ptype, exclude);
+ pbo->advectInGrid(flags,
+ vel,
+ integrationMode,
+ deleteInObstacle,
+ stopInObstacle,
+ skipNew,
+ ptype,
+ exclude);
pbo->_args.check();
}
pbFinalizePlugin(pbo->getParent(), "ParticleSystem::advectInGrid", !noTiming);
@@ -1863,6 +1871,7 @@ template<class S> struct _GridAdvectKernel : public KernelBase {
const Real dt,
const bool deleteInObstacle,
const bool stopInObstacle,
+ const bool skipNew,
const ParticleDataImpl<int> *ptype,
const int exclude,
std::vector<Vec3> &u)
@@ -1873,6 +1882,7 @@ template<class S> struct _GridAdvectKernel : public KernelBase {
dt(dt),
deleteInObstacle(deleteInObstacle),
stopInObstacle(stopInObstacle),
+ skipNew(skipNew),
ptype(ptype),
exclude(exclude),
u(u)
@@ -1885,11 +1895,13 @@ template<class S> struct _GridAdvectKernel : public KernelBase {
const Real dt,
const bool deleteInObstacle,
const bool stopInObstacle,
+ const bool skipNew,
const ParticleDataImpl<int> *ptype,
const int exclude,
std::vector<Vec3> &u) const
{
- if ((p[idx].flag & ParticleBase::PDELETE) || (ptype && ((*ptype)[idx] & exclude))) {
+ if ((p[idx].flag & ParticleBase::PDELETE) || (ptype && ((*ptype)[idx] & exclude)) ||
+ (skipNew && (p[idx].flag & ParticleBase::PNEW))) {
u[idx] = 0.;
return;
}
@@ -1910,7 +1922,7 @@ template<class S> struct _GridAdvectKernel : public KernelBase {
void operator()(const tbb::blocked_range<IndexInt> &__r) const
{
for (IndexInt idx = __r.begin(); idx != (IndexInt)__r.end(); idx++)
- op(idx, p, vel, flags, dt, deleteInObstacle, stopInObstacle, ptype, exclude, u);
+ op(idx, p, vel, flags, dt, deleteInObstacle, stopInObstacle, skipNew, ptype, exclude, u);
}
void run()
{
@@ -1922,6 +1934,7 @@ template<class S> struct _GridAdvectKernel : public KernelBase {
const Real dt;
const bool deleteInObstacle;
const bool stopInObstacle;
+ const bool skipNew;
const ParticleDataImpl<int> *ptype;
const int exclude;
std::vector<Vec3> &u;
@@ -1933,6 +1946,7 @@ template<class S> struct GridAdvectKernel : public KernelBase {
const Real dt,
const bool deleteInObstacle,
const bool stopInObstacle,
+ const bool skipNew,
const ParticleDataImpl<int> *ptype,
const int exclude)
: KernelBase(p.size()),
@@ -1943,6 +1957,7 @@ template<class S> struct GridAdvectKernel : public KernelBase {
dt,
deleteInObstacle,
stopInObstacle,
+ skipNew,
ptype,
exclude,
u),
@@ -1952,6 +1967,7 @@ template<class S> struct GridAdvectKernel : public KernelBase {
dt(dt),
deleteInObstacle(deleteInObstacle),
stopInObstacle(stopInObstacle),
+ skipNew(skipNew),
ptype(ptype),
exclude(exclude),
u((size))
@@ -2001,16 +2017,21 @@ template<class S> struct GridAdvectKernel : public KernelBase {
return stopInObstacle;
}
typedef bool type5;
- inline const ParticleDataImpl<int> *getArg6()
+ inline const bool &getArg6()
+ {
+ return skipNew;
+ }
+ typedef bool type6;
+ inline const ParticleDataImpl<int> *getArg7()
{
return ptype;
}
- typedef ParticleDataImpl<int> type6;
- inline const int &getArg7()
+ typedef ParticleDataImpl<int> type7;
+ inline const int &getArg8()
{
return exclude;
}
- typedef int type7;
+ typedef int type8;
void runMessage()
{
debMsg("Executing kernel GridAdvectKernel ", 3);
@@ -2025,6 +2046,7 @@ template<class S> struct GridAdvectKernel : public KernelBase {
const Real dt;
const bool deleteInObstacle;
const bool stopInObstacle;
+ const bool skipNew;
const ParticleDataImpl<int> *ptype;
const int exclude;
std::vector<Vec3> u;
@@ -2195,6 +2217,7 @@ void ParticleSystem<S>::advectInGrid(const FlagGrid &flags,
const int integrationMode,
const bool deleteInObstacle,
const bool stopInObstacle,
+ const bool skipNew,
const ParticleDataImpl<int> *ptype,
const int exclude)
{
@@ -2208,8 +2231,15 @@ void ParticleSystem<S>::advectInGrid(const FlagGrid &flags,
}
// update positions
- GridAdvectKernel<S> kernel(
- mData, vel, flags, getParent()->getDt(), deleteInObstacle, stopInObstacle, ptype, exclude);
+ GridAdvectKernel<S> kernel(mData,
+ vel,
+ flags,
+ getParent()->getDt(),
+ deleteInObstacle,
+ stopInObstacle,
+ skipNew,
+ ptype,
+ exclude);
integratePointSet(kernel, integrationMode);
if (!deleteInObstacle) {
@@ -2438,15 +2468,15 @@ template<class S> void ParticleSystem<S>::compress()
//! insert buffered positions as new particles, update additional particle data
template<class S> void ParticleSystem<S>::insertBufferedParticles()
{
+ // clear new flag everywhere
+ for (IndexInt i = 0; i < (IndexInt)mData.size(); ++i)
+ mData[i].flag &= ~PNEW;
+
if (mNewBufferPos.size() == 0)
return;
IndexInt newCnt = mData.size();
resizeAll(newCnt + mNewBufferPos.size());
- // clear new flag everywhere
- for (IndexInt i = 0; i < (IndexInt)mData.size(); ++i)
- mData[i].flag &= ~PNEW;
-
for (IndexInt i = 0; i < (IndexInt)mNewBufferPos.size(); ++i) {
int flag = (mNewBufferFlag.size() > 0) ? mNewBufferFlag[i] : 0;
// note, other fields are not initialized here...
diff --git a/extern/mantaflow/preprocessed/plugin/extforces.cpp b/extern/mantaflow/preprocessed/plugin/extforces.cpp
index 36221fbbc10..798bb3daeee 100644
--- a/extern/mantaflow/preprocessed/plugin/extforces.cpp
+++ b/extern/mantaflow/preprocessed/plugin/extforces.cpp
@@ -244,13 +244,15 @@ struct KnApplyForce : public KernelBase {
bool additive;
};
-//! add gravity forces to all fluid cells, automatically adapts to different grid sizes
+//! add gravity forces to all fluid cells, optionally adapts to different grid sizes automatically
void addGravity(const FlagGrid &flags,
MACGrid &vel,
Vec3 gravity,
- const Grid<Real> *exclude = NULL)
+ const Grid<Real> *exclude = NULL,
+ bool scale = true)
{
- Vec3 f = gravity * flags.getParent()->getDt() / flags.getDx();
+ float gridScale = (scale) ? flags.getDx() : 1;
+ Vec3 f = gravity * flags.getParent()->getDt() / gridScale;
KnApplyForce(flags, vel, f, exclude, true);
}
static PyObject *_W_0(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
@@ -267,8 +269,9 @@ static PyObject *_W_0(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
MACGrid &vel = *_args.getPtr<MACGrid>("vel", 1, &_lock);
Vec3 gravity = _args.get<Vec3>("gravity", 2, &_lock);
const Grid<Real> *exclude = _args.getPtrOpt<Grid<Real>>("exclude", 3, NULL, &_lock);
+ bool scale = _args.getOpt<bool>("scale", 4, true, &_lock);
_retval = getPyNone();
- addGravity(flags, vel, gravity, exclude);
+ addGravity(flags, vel, gravity, exclude, scale);
_args.check();
}
pbFinalizePlugin(parent, "addGravity", !noTiming);
@@ -287,14 +290,13 @@ void PbRegister_addGravity()
}
}
-//! add gravity forces to all fluid cells , but dont account for changing cell size
+//! Deprecated: use addGravity(scale=false) instead
void addGravityNoScale(const FlagGrid &flags,
MACGrid &vel,
const Vec3 &gravity,
const Grid<Real> *exclude = NULL)
{
- const Vec3 f = gravity * flags.getParent()->getDt();
- KnApplyForce(flags, vel, f, exclude, true);
+ addGravity(flags, vel, gravity, exclude, false);
}
static PyObject *_W_1(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
{
@@ -412,14 +414,17 @@ struct KnAddBuoyancy : public KernelBase {
Vec3 strength;
};
-//! add Buoyancy force based on fctor (e.g. smoke density)
+//! add Buoyancy force based on factor (e.g. smoke density), optionally adapts to different grid
+//! sizes automatically
void addBuoyancy(const FlagGrid &flags,
const Grid<Real> &density,
MACGrid &vel,
Vec3 gravity,
- Real coefficient = 1.)
+ Real coefficient = 1.,
+ bool scale = true)
{
- Vec3 f = -gravity * flags.getParent()->getDt() / flags.getParent()->getDx() * coefficient;
+ float gridScale = (scale) ? flags.getDx() : 1;
+ Vec3 f = -gravity * flags.getParent()->getDt() / gridScale * coefficient;
KnAddBuoyancy(flags, density, vel, f);
}
static PyObject *_W_2(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
@@ -437,8 +442,9 @@ static PyObject *_W_2(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
MACGrid &vel = *_args.getPtr<MACGrid>("vel", 2, &_lock);
Vec3 gravity = _args.get<Vec3>("gravity", 3, &_lock);
Real coefficient = _args.getOpt<Real>("coefficient", 4, 1., &_lock);
+ bool scale = _args.getOpt<bool>("scale", 5, true, &_lock);
_retval = getPyNone();
- addBuoyancy(flags, density, vel, gravity, coefficient);
+ addBuoyancy(flags, density, vel, gravity, coefficient, scale);
_args.check();
}
pbFinalizePlugin(parent, "addBuoyancy", !noTiming);
diff --git a/extern/mantaflow/preprocessed/plugin/secondaryparticles.cpp b/extern/mantaflow/preprocessed/plugin/secondaryparticles.cpp
index 18582d57e64..5e24b6f28db 100644
--- a/extern/mantaflow/preprocessed/plugin/secondaryparticles.cpp
+++ b/extern/mantaflow/preprocessed/plugin/secondaryparticles.cpp
@@ -525,7 +525,7 @@ struct knFlipSampleSecondaryParticlesMoreCylinders : public KernelBase {
if (!(flags(i, j, k) & itype))
return;
- RandomStream mRand(9832);
+ static RandomStream mRand(9832);
Real radius =
0.25; // diameter=0.5 => sampling with two cylinders in each dimension since cell size=1
for (Real x = i - radius; x <= i + radius; x += 2 * radius) {
@@ -791,11 +791,9 @@ struct knFlipSampleSecondaryParticles : public KernelBase {
const int n = KE * (k_ta * TA + k_wc * WC) * dt; // number of secondary particles
if (n == 0)
return;
- RandomStream mRand(9832);
+ static RandomStream mRand(9832);
- Vec3 xi = Vec3(i + mRand.getReal(),
- j + mRand.getReal(),
- k + mRand.getReal()); // randomized offset uniform in cell
+ Vec3 xi = Vec3(i, j, k) + mRand.getVec3(); // randomized offset uniform in cell
Vec3 vi = v.getInterpolated(xi);
Vec3 dir = dt * vi; // direction of movement of current particle
Vec3 e1 = getNormalized(Vec3(dir.z, 0, -dir.x)); // perpendicular to dir
@@ -984,9 +982,14 @@ void flipSampleSecondaryParticles(const std::string mode,
const Real c_b,
const Real k_ta,
const Real k_wc,
- const Real dt,
+ const Real dt = 0,
const int itype = FlagGrid::TypeFluid)
{
+
+ float timestep = dt;
+ if (dt <= 0)
+ timestep = flags.getParent()->getDt();
+
if (mode == "single") {
knFlipSampleSecondaryParticles(flags,
v,
@@ -1003,7 +1006,7 @@ void flipSampleSecondaryParticles(const std::string mode,
c_b,
k_ta,
k_wc,
- dt,
+ timestep,
itype);
}
else if (mode == "multiple") {
@@ -1022,7 +1025,7 @@ void flipSampleSecondaryParticles(const std::string mode,
c_b,
k_ta,
k_wc,
- dt,
+ timestep,
itype);
}
else {
@@ -1055,7 +1058,7 @@ static PyObject *_W_1(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
const Real c_b = _args.get<Real>("c_b", 13, &_lock);
const Real k_ta = _args.get<Real>("k_ta", 14, &_lock);
const Real k_wc = _args.get<Real>("k_wc", 15, &_lock);
- const Real dt = _args.get<Real>("dt", 16, &_lock);
+ const Real dt = _args.getOpt<Real>("dt", 16, 0, &_lock);
const int itype = _args.getOpt<int>("itype", 17, FlagGrid::TypeFluid, &_lock);
_retval = getPyNone();
flipSampleSecondaryParticles(mode,
@@ -1693,13 +1696,20 @@ void flipUpdateSecondaryParticles(const std::string mode,
const Real k_d,
const Real c_s,
const Real c_b,
- const Real dt,
+ const Real dt = 0,
+ bool scale = true,
const int exclude = ParticleBase::PTRACER,
const int antitunneling = 0,
const int itype = FlagGrid::TypeFluid)
{
- Vec3 g = gravity / flags.getDx();
+ float gridScale = (scale) ? flags.getParent()->getDx() : 1;
+ Vec3 g = gravity / gridScale;
+
+ float timestep = dt;
+ if (dt <= 0)
+ timestep = flags.getParent()->getDt();
+
if (mode == "linear") {
knFlipUpdateSecondaryParticlesLinear(pts_sec,
v_sec,
@@ -1713,7 +1723,7 @@ void flipUpdateSecondaryParticles(const std::string mode,
k_d,
c_s,
c_b,
- dt,
+ timestep,
exclude,
antitunneling);
}
@@ -1731,7 +1741,7 @@ void flipUpdateSecondaryParticles(const std::string mode,
k_d,
c_s,
c_b,
- dt,
+ timestep,
exclude,
antitunneling,
itype);
@@ -1766,10 +1776,11 @@ static PyObject *_W_2(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
const Real k_d = _args.get<Real>("k_d", 11, &_lock);
const Real c_s = _args.get<Real>("c_s", 12, &_lock);
const Real c_b = _args.get<Real>("c_b", 13, &_lock);
- const Real dt = _args.get<Real>("dt", 14, &_lock);
- const int exclude = _args.getOpt<int>("exclude", 15, ParticleBase::PTRACER, &_lock);
- const int antitunneling = _args.getOpt<int>("antitunneling", 16, 0, &_lock);
- const int itype = _args.getOpt<int>("itype", 17, FlagGrid::TypeFluid, &_lock);
+ const Real dt = _args.getOpt<Real>("dt", 14, 0, &_lock);
+ bool scale = _args.getOpt<bool>("scale", 15, true, &_lock);
+ const int exclude = _args.getOpt<int>("exclude", 16, ParticleBase::PTRACER, &_lock);
+ const int antitunneling = _args.getOpt<int>("antitunneling", 17, 0, &_lock);
+ const int itype = _args.getOpt<int>("itype", 18, FlagGrid::TypeFluid, &_lock);
_retval = getPyNone();
flipUpdateSecondaryParticles(mode,
pts_sec,
@@ -1786,6 +1797,7 @@ static PyObject *_W_2(PyObject *_self, PyObject *_linargs, PyObject *_kwds)
c_s,
c_b,
dt,
+ scale,
exclude,
antitunneling,
itype);
@@ -1834,7 +1846,7 @@ struct knFlipDeleteParticlesInObstacle : public KernelBase {
}
int gridIndex = flags.index(xidx);
// remove particles that penetrate obstacles
- if (flags[gridIndex] == FlagGrid::TypeObstacle || flags[gridIndex] == FlagGrid::TypeOutflow) {
+ if (flags.isObstacle(gridIndex) || flags.isOutflow(gridIndex)) {
pts.kill(idx);
}
}
diff --git a/extern/wcwidth/wcwidth.h b/extern/wcwidth/wcwidth.h
index d87eaf20695..3039a50bddd 100644
--- a/extern/wcwidth/wcwidth.h
+++ b/extern/wcwidth/wcwidth.h
@@ -21,7 +21,7 @@
#define __WCWIDTH_H__
#ifndef __cplusplus
-# if defined(__APPLE__)
+# if defined(__APPLE__) || defined(__NetBSD__)
/* The <uchar.h> standard header is missing on macOS. */
#include <stddef.h>
typedef unsigned int char32_t;