1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-02 06:04:39 -04:00

File source: play/pause button implemented with stream timing update

This commit is contained in:
f4exb
2015-08-06 01:14:44 +02:00
parent 0603bb41ca
commit 047e9f3e24
5 changed files with 87 additions and 8 deletions
@@ -31,6 +31,7 @@ FileSourceThread::FileSourceThread(std::ifstream *samplesStream, SampleFifo* sam
m_bufsize(0),
m_chunksize(0),
m_sampleFifo(sampleFifo),
m_samplesCount(0),
m_samplerate(0)
{
assert(m_ifstream != 0);
@@ -142,12 +143,14 @@ void FileSourceThread::tick()
// TODO: handle loop playback situation
m_ifstream->clear();
m_ifstream->seekg(0, std::ios::beg);
m_samplesCount = 0;
//stopWork();
//m_ifstream->close();
}
else
{
m_sampleFifo->write(m_buf, m_chunksize);
m_samplesCount += m_chunksize / 4;
}
}
}