forked from bartvdbraak/blender
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.
This commit is contained in:
parent
73183abfa9
commit
4b5a371b65
@ -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
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user