40 |
* Returns -1 if command queue or pickup pool is full, 0 on success (will be |
* Returns -1 if command queue or pickup pool is full, 0 on success (will be |
41 |
* called by audio thread within the voice class). |
* called by audio thread within the voice class). |
42 |
*/ |
*/ |
43 |
int DiskThread::OrderNewStream(Stream::reference_t* pStreamRef, gig::Sample* pSample, unsigned long SampleOffset) { |
int DiskThread::OrderNewStream(Stream::reference_t* pStreamRef, gig::Sample* pSample, unsigned long SampleOffset, bool DoLoop) { |
44 |
dmsg(4,("Disk Thread: new stream ordered\n")); |
dmsg(4,("Disk Thread: new stream ordered\n")); |
45 |
if (CreationQueue->write_space() < 1) { |
if (CreationQueue->write_space() < 1) { |
46 |
dmsg(1,("DiskThread: Order queue full!\n")); |
dmsg(1,("DiskThread: Order queue full!\n")); |
60 |
cmd.pStreamRef = pStreamRef; |
cmd.pStreamRef = pStreamRef; |
61 |
cmd.pSample = pSample; |
cmd.pSample = pSample; |
62 |
cmd.SampleOffset = SampleOffset; |
cmd.SampleOffset = SampleOffset; |
63 |
|
cmd.DoLoop = DoLoop; |
64 |
|
|
65 |
CreationQueue->push(&cmd); |
CreationQueue->push(&cmd); |
66 |
return 0; |
return 0; |
204 |
std::cerr << "No unused stream found (OrderID:" << Command.OrderID << ") - report if this happens, this is a bug!\n" << std::flush; |
std::cerr << "No unused stream found (OrderID:" << Command.OrderID << ") - report if this happens, this is a bug!\n" << std::flush; |
205 |
return; |
return; |
206 |
} |
} |
207 |
newstream->Launch(Command.hStream, Command.pStreamRef, Command.pSample, Command.SampleOffset); |
newstream->Launch(Command.hStream, Command.pStreamRef, Command.pSample, Command.SampleOffset, Command.DoLoop); |
208 |
dmsg(4,("new Stream launched by disk thread (OrderID:%d,StreamHandle:%d)\n", Command.OrderID, Command.hStream)); |
dmsg(4,("new Stream launched by disk thread (OrderID:%d,StreamHandle:%d)\n", Command.OrderID, Command.hStream)); |
209 |
if (pCreatedStreams[Command.OrderID] != SLOT_RESERVED) { |
if (pCreatedStreams[Command.OrderID] != SLOT_RESERVED) { |
210 |
std::cerr << "DiskThread: Slot " << Command.OrderID << " already occupied! Please report this!\n" << std::flush; |
std::cerr << "DiskThread: Slot " << Command.OrderID << " already occupied! Please report this!\n" << std::flush; |