diff options
author | Joerg Mueller <nexyon@gmail.com> | 2011-07-30 20:24:11 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2011-07-30 20:24:11 +0400 |
commit | 4b5a371b65ca829cc169692e6ac1f78574531303 (patch) | |
tree | cd1200d4092af0b24855948baebd535bd47e9780 /intern/audaspace | |
parent | 73183abfa98eeda9fb7deff8165a04ca6a28635d (diff) |
3D Audio GSoC:
* Fix for sequencer strip IDs, only one strip played.
* Fix for PyAPI sample rate.
* Enhanced Double Reader to return more data if possible.
Diffstat (limited to 'intern/audaspace')
-rw-r--r-- | intern/audaspace/FX/AUD_DoubleReader.cpp | 19 | ||||
-rw-r--r-- | intern/audaspace/Python/AUD_PyAPI.cpp | 6 | ||||
-rw-r--r-- | intern/audaspace/intern/AUD_SequencerEntry.cpp | 2 |
3 files changed, 22 insertions, 5 deletions
diff --git a/intern/audaspace/FX/AUD_DoubleReader.cpp b/intern/audaspace/FX/AUD_DoubleReader.cpp index 96352b0963c..e9882743d28 100644 --- a/intern/audaspace/FX/AUD_DoubleReader.cpp +++ b/intern/audaspace/FX/AUD_DoubleReader.cpp @@ -88,7 +88,24 @@ void AUD_DoubleReader::read(int& length, bool& eos, sample_t* buffer) if(!m_finished1) { - m_reader1->read(length, m_finished1, buffer); + int len = length; + + m_reader1->read(len, m_finished1, buffer); + + if(len < length) + { + AUD_Specs specs1, specs2; + specs1 = m_reader1->getSpecs(); + specs2 = m_reader2->getSpecs(); + if(memcmp(&specs1, &specs2, sizeof(AUD_Specs))) + length = len; + else + { + int len2 = length - len; + m_reader2->read(len2, eos, buffer + specs1.channels * len); + length = len + len2; + } + } } else { diff --git a/intern/audaspace/Python/AUD_PyAPI.cpp b/intern/audaspace/Python/AUD_PyAPI.cpp index 12bb19644f0..94e02576ccc 100644 --- a/intern/audaspace/Python/AUD_PyAPI.cpp +++ b/intern/audaspace/Python/AUD_PyAPI.cpp @@ -144,9 +144,9 @@ static PyObject * Factory_sine(PyTypeObject* type, PyObject* args) { float frequency; - int rate = 44100; + double rate = 44100; - if(!PyArg_ParseTuple(args, "f|i:sine", &frequency, &rate)) + if(!PyArg_ParseTuple(args, "f|d:sine", &frequency, &rate)) return NULL; Factory *self; @@ -2313,7 +2313,7 @@ Device_get_rate(Device *self, void* nothing) try { AUD_DeviceSpecs specs = (*reinterpret_cast<AUD_Reference<AUD_IDevice>*>(self->device))->getSpecs(); - return Py_BuildValue("i", specs.rate); + return Py_BuildValue("d", specs.rate); } catch(AUD_Exception& e) { diff --git a/intern/audaspace/intern/AUD_SequencerEntry.cpp b/intern/audaspace/intern/AUD_SequencerEntry.cpp index 110e5c6a931..5ba35955f3c 100644 --- a/intern/audaspace/intern/AUD_SequencerEntry.cpp +++ b/intern/audaspace/intern/AUD_SequencerEntry.cpp @@ -39,7 +39,7 @@ AUD_SequencerEntry::AUD_SequencerEntry(AUD_Reference<AUD_IFactory> sound, float m_status(0), m_pos_status(1), m_sound_status(0), - m_id(0), + m_id(id), m_sound(sound), m_begin(begin), m_end(end), |