diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-11-24 20:18:35 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-11-24 20:23:44 +0300 |
commit | 649a2bcc3d51cfc6f9fc237695015c87bcca7deb (patch) | |
tree | 4bea67033363027c40c3e78b2782d7df00e39558 /intern/audaspace | |
parent | aa0b268acbf352bdf69644bb11ee3b893008cc40 (diff) |
Politically correct terrible consequencer changes
This patch includes the work done in the terrible consequencer branch
that hasn't been merged to master minus a few controversial and WIP
stuff, like strip parenting, new sequence data structs and cuddly
widgets.
What is included:
* Strip extensions only when slipping. It can very easily be made an
option but with a few strips with overlapping durations it makes view
too crowded and difficult to make out.
* Threaded waveform loading + code that restores waveforms on undo (not
used though, since sound_load recreates everything. There's a patch for
review D876)
* Toggle to enable backdrop in the strip sequence editor
* Toggle to easily turn on/off waveform display
* Snapping during transform on sequence boundaries. Snapping to start or
end of selection depends on position of mouse when invoking the operator
* Snapping of timeline indicator in sequencer to strip boundaries. To
use just press and hold ctrl while dragging.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D904
Diffstat (limited to 'intern/audaspace')
-rw-r--r-- | intern/audaspace/intern/AUD_C-API.cpp | 9 | ||||
-rw-r--r-- | intern/audaspace/intern/AUD_C-API.h | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp index d2a934740d6..45d72ccb50e 100644 --- a/intern/audaspace/intern/AUD_C-API.cpp +++ b/intern/audaspace/intern/AUD_C-API.cpp @@ -46,6 +46,7 @@ #include <cstring> #include <cmath> #include <sstream> +#include <iostream> #include "AUD_NULLDevice.h" #include "AUD_I3DDevice.h" @@ -317,8 +318,9 @@ AUD_SoundInfo AUD_getInfo(AUD_Sound *sound) info.length = reader->getLength() / (float) info.specs.rate; } } - catch(AUD_Exception&) + catch(AUD_Exception &ae) { + std::cout << ae.str << std::endl; } return info; @@ -1084,7 +1086,7 @@ int AUD_doesPlayback() return -1; } -int AUD_readSound(AUD_Sound *sound, sample_t *buffer, int length, int samples_per_second) +int AUD_readSound(AUD_Sound *sound, sample_t *buffer, int length, int samples_per_second, short *interrupt) { AUD_DeviceSpecs specs; sample_t *buf; @@ -1107,6 +1109,9 @@ int AUD_readSound(AUD_Sound *sound, sample_t *buffer, int length, int samples_pe for (int i = 0; i < length; i++) { len = floor(samplejump * (i+1)) - floor(samplejump * i); + if (*interrupt) { + return 0; + } aBuffer.assureSize(len * AUD_SAMPLE_SIZE(specs)); buf = aBuffer.getBuffer(); diff --git a/intern/audaspace/intern/AUD_C-API.h b/intern/audaspace/intern/AUD_C-API.h index 64a3d06bd5f..657d4e6fd02 100644 --- a/intern/audaspace/intern/AUD_C-API.h +++ b/intern/audaspace/intern/AUD_C-API.h @@ -646,7 +646,7 @@ extern int AUD_doesPlayback(void); * \param samples_per_second How many samples to read per second of the sound. * \return How many samples really have been read. Always <= length. */ -extern int AUD_readSound(AUD_Sound *sound, sample_t *buffer, int length, int samples_per_second); +extern int AUD_readSound(AUD_Sound *sound, sample_t *buffer, int length, int samples_per_second, short *interrupt); /** * Copies a sound. |