mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-23 01:55:48 -05:00
File source debugging interim state #1
This commit is contained in:
parent
f9029e8572
commit
fb167dad70
@ -170,12 +170,16 @@ bool FileSourceInput::handleMessage(Message* message)
|
|||||||
bool FileSourceInput::applySettings(const GeneralSettings& generalSettings, const Settings& settings, bool force)
|
bool FileSourceInput::applySettings(const GeneralSettings& generalSettings, const Settings& settings, bool force)
|
||||||
{
|
{
|
||||||
QMutexLocker mutexLocker(&m_mutex);
|
QMutexLocker mutexLocker(&m_mutex);
|
||||||
|
bool wasRunning = false;
|
||||||
|
|
||||||
if((m_settings.m_fileName != settings.m_fileName) || force) {
|
if((m_settings.m_fileName != settings.m_fileName) || force) {
|
||||||
m_settings.m_fileName = settings.m_fileName;
|
m_settings.m_fileName = settings.m_fileName;
|
||||||
|
|
||||||
if (m_fileSourceThread != 0) {
|
if (m_fileSourceThread != 0) {
|
||||||
m_fileSourceThread->stopWork();
|
wasRunning = m_fileSourceThread->isRunning();
|
||||||
|
if (wasRunning) {
|
||||||
|
m_fileSourceThread->stopWork();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_ifstream.is_open()) {
|
if (m_ifstream.is_open()) {
|
||||||
@ -186,10 +190,16 @@ bool FileSourceInput::applySettings(const GeneralSettings& generalSettings, cons
|
|||||||
|
|
||||||
if (m_fileSourceThread != 0) {
|
if (m_fileSourceThread != 0) {
|
||||||
m_fileSourceThread->setSamplerate(m_sampleRate);
|
m_fileSourceThread->setSamplerate(m_sampleRate);
|
||||||
|
if (wasRunning) {
|
||||||
|
m_fileSourceThread->startWork();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cerr << "FileSourceInput: center freq: " << m_generalSettings.m_centerFrequency << " Hz"
|
std::cerr << "FileSourceInput::applySettings:"
|
||||||
<< " file name: " << settings.m_fileName.toStdString() << std::endl;
|
<< " file name: " << settings.m_fileName.toStdString()
|
||||||
|
<< " center freq: " << m_centerFrequency << " Hz"
|
||||||
|
<< " sample rate: " << m_sampleRate
|
||||||
|
<< " Unix timestamp: " << m_startingTimeStamp << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -47,6 +47,7 @@ FileSourceThread::~FileSourceThread()
|
|||||||
|
|
||||||
void FileSourceThread::startWork()
|
void FileSourceThread::startWork()
|
||||||
{
|
{
|
||||||
|
std::cerr << "FileSourceThread::startWork" << std::endl;
|
||||||
m_startWaitMutex.lock();
|
m_startWaitMutex.lock();
|
||||||
start();
|
start();
|
||||||
while(!m_running)
|
while(!m_running)
|
||||||
@ -56,6 +57,7 @@ void FileSourceThread::startWork()
|
|||||||
|
|
||||||
void FileSourceThread::stopWork()
|
void FileSourceThread::stopWork()
|
||||||
{
|
{
|
||||||
|
std::cerr << "FileSourceThread::stopWork" << std::endl;
|
||||||
m_running = false;
|
m_running = false;
|
||||||
wait();
|
wait();
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ public:
|
|||||||
void startWork();
|
void startWork();
|
||||||
void stopWork();
|
void stopWork();
|
||||||
void setSamplerate(int samplerate);
|
void setSamplerate(int samplerate);
|
||||||
|
bool isRunning() const { return m_running; }
|
||||||
|
|
||||||
void connectTimer(const QTimer& timer);
|
void connectTimer(const QTimer& timer);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user