From: Joel Holdsworth Date: Sat, 22 Feb 2014 12:45:36 +0000 (+0000) Subject: Moved session creation into DevInst objects X-Git-Tag: pulseview-0.2.0~50 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=ae2d1bc5b5aba9fcdd7fef42ef1bc9069267d6f7 Moved session creation into DevInst objects --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 58c86c45..ebff3729 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,7 +128,10 @@ set(pulseview_SOURCES pv/data/signaldata.cpp pv/data/snapshot.cpp pv/device/device.cpp + pv/device/file.cpp pv/device/devinst.cpp + pv/device/inputfile.cpp + pv/device/sessionfile.cpp pv/dialogs/about.cpp pv/dialogs/connect.cpp pv/dialogs/storeprogress.cpp diff --git a/pv/device/device.cpp b/pv/device/device.cpp index 4a3ec35f..e70be025 100644 --- a/pv/device/device.cpp +++ b/pv/device/device.cpp @@ -41,6 +41,28 @@ sr_dev_inst* Device::dev_inst() const return _sdi; } +void Device::use(SigSession *owner) throw(QString) +{ + DevInst::use(owner); + + sr_session_new(); + + assert(_sdi); + sr_dev_open(_sdi); + if (sr_session_dev_add(_sdi) != SR_OK) + throw QString(tr("Failed to use device.")); +} + +void Device::release() +{ + if (_owner) { + DevInst::release(); + sr_session_destroy(); + } + + sr_dev_close(_sdi); +} + std::string Device::format_device_title() const { ostringstream s; diff --git a/pv/device/device.h b/pv/device/device.h index fcf74c31..b9e17297 100644 --- a/pv/device/device.h +++ b/pv/device/device.h @@ -33,6 +33,10 @@ public: sr_dev_inst* dev_inst() const; + void use(SigSession *owner) throw(QString); + + void release(); + std::string format_device_title() const; bool is_trigger_enabled() const; diff --git a/pv/device/devinst.cpp b/pv/device/devinst.cpp index 74409951..86595ae7 100644 --- a/pv/device/devinst.cpp +++ b/pv/device/devinst.cpp @@ -36,12 +36,11 @@ DevInst::DevInst() : { } -void DevInst::use(SigSession *owner) +void DevInst::use(SigSession *owner) throw(QString) { assert(owner); assert(!_owner); _owner = owner; - sr_dev_open(dev_inst()); } void DevInst::release() @@ -49,7 +48,6 @@ void DevInst::release() if (_owner) { _owner->release_device(this); _owner = NULL; - sr_dev_close(dev_inst()); } } @@ -61,6 +59,7 @@ SigSession* DevInst::owner() const GVariant* DevInst::get_config(const sr_probe_group *group, int key) { GVariant *data = NULL; + assert(_owner); sr_dev_inst *const sdi = dev_inst(); assert(sdi); if (sr_config_get(sdi->driver, sdi, group, key, &data) != SR_OK) @@ -70,6 +69,7 @@ GVariant* DevInst::get_config(const sr_probe_group *group, int key) bool DevInst::set_config(const sr_probe_group *group, int key, GVariant *data) { + assert(_owner); sr_dev_inst *const sdi = dev_inst(); assert(sdi); if(sr_config_set(sdi, group, key, data) == SR_OK) { @@ -82,6 +82,7 @@ bool DevInst::set_config(const sr_probe_group *group, int key, GVariant *data) GVariant* DevInst::list_config(const sr_probe_group *group, int key) { GVariant *data = NULL; + assert(_owner); sr_dev_inst *const sdi = dev_inst(); assert(sdi); if (sr_config_list(sdi->driver, sdi, group, key, &data) != SR_OK) @@ -91,6 +92,7 @@ GVariant* DevInst::list_config(const sr_probe_group *group, int key) void DevInst::enable_probe(const sr_probe *probe, bool enable) { + assert(_owner); sr_dev_inst *const sdi = dev_inst(); assert(sdi); for (const GSList *p = sdi->probes; p; p = p->next) @@ -122,5 +124,16 @@ bool DevInst::is_trigger_enabled() const return false; } +void DevInst::start() +{ + if (sr_session_start() != SR_OK) + throw tr("Failed to start session."); +} + +void DevInst::run() +{ + sr_session_run(); +} + } // device } // pv diff --git a/pv/device/devinst.h b/pv/device/devinst.h index 5ee38747..8932f180 100644 --- a/pv/device/devinst.h +++ b/pv/device/devinst.h @@ -51,9 +51,9 @@ protected: public: virtual sr_dev_inst* dev_inst() const = 0; - void use(SigSession *owner); + virtual void use(SigSession *owner) throw(QString); - void release(); + virtual void release(); SigSession* owner() const; @@ -77,6 +77,11 @@ public: virtual bool is_trigger_enabled() const; +public: + virtual void start(); + + virtual void run(); + signals: void config_changed(); diff --git a/pv/device/file.cpp b/pv/device/file.cpp new file mode 100644 index 00000000..190b5384 --- /dev/null +++ b/pv/device/file.cpp @@ -0,0 +1,64 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2014 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "file.h" +#include "inputfile.h" +#include "sessionfile.h" + +#include + +using std::string; + +namespace pv { +namespace device { + +File::File(const std::string path) : + _path(path) +{ +} + +std::string File::format_device_title() const +{ + return _path; +} + +File* File::create(const string &name) +{ + if (sr_session_load(name.c_str()) == SR_OK) { + GSList *devlist = NULL; + sr_session_dev_list(&devlist); + sr_session_destroy(); + + if (devlist) { + sr_dev_inst *const sdi = (sr_dev_inst*)devlist->data; + g_slist_free(devlist); + if (sdi) { + sr_dev_close(sdi); + sr_dev_clear(sdi->driver); + return new SessionFile(name); + } + } + } + + return new InputFile(name); +} + +} // device +} // pv diff --git a/pv/device/file.h b/pv/device/file.h new file mode 100644 index 00000000..4a45a823 --- /dev/null +++ b/pv/device/file.h @@ -0,0 +1,49 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2014 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PULSEVIEW_PV_DEVICE_FILE_H +#define PULSEVIEW_PV_DEVICE_FILE_H + +#include + +#include "devinst.h" + +namespace pv { +namespace device { + +class File : public DevInst +{ +protected: + File(const std::string path); + +public: + static File* create(const std::string &name); + +public: + std::string format_device_title() const; + +protected: + const std::string _path; +}; + +} // device +} // pv + +#endif // PULSEVIEW_PV_DEVICE_FILE_H diff --git a/pv/device/inputfile.cpp b/pv/device/inputfile.cpp new file mode 100644 index 00000000..55a0fa56 --- /dev/null +++ b/pv/device/inputfile.cpp @@ -0,0 +1,143 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2014 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +#include +#include +#include + +#include "inputfile.h" + +#include + +using std::string; + +namespace pv { +namespace device { + +InputFile::InputFile(const std::string &path) : + File(path), + _input(NULL) +{ +} + +sr_dev_inst* InputFile::dev_inst() const +{ + assert(_input); + return _input->sdi; +} + +void InputFile::use(SigSession *owner) throw(QString) +{ + assert(!_input); + + _input = load_input_file_format(_path, NULL); + File::use(owner); + + sr_session_new(); + + if (sr_session_dev_add(_input->sdi) != SR_OK) + throw tr("Failed to add session device."); +} + +void InputFile::release() +{ + if (!_owner) + return; + + assert(_input); + File::release(); + sr_dev_close(_input->sdi); + sr_session_destroy(); + _input = NULL; +} + +sr_input_format* InputFile::determine_input_file_format( + const string &filename) +{ + int i; + + /* If there are no input formats, return NULL right away. */ + sr_input_format *const *const inputs = sr_input_list(); + if (!inputs) { + g_critical("No supported input formats available."); + return NULL; + } + + /* Otherwise, try to find an input module that can handle this file. */ + for (i = 0; inputs[i]; i++) { + if (inputs[i]->format_match(filename.c_str())) + break; + } + + /* Return NULL if no input module wanted to touch this. */ + if (!inputs[i]) { + g_critical("Error: no matching input module found."); + return NULL; + } + + return inputs[i]; +} + +sr_input* InputFile::load_input_file_format(const string &filename, + sr_input_format *format) +{ + struct stat st; + sr_input *in; + + if (!format && !(format = + determine_input_file_format(filename.c_str()))) { + /* The exact cause was already logged. */ + throw tr("Failed to load file"); + } + + if (stat(filename.c_str(), &st) == -1) + throw tr("Failed to load file"); + + /* Initialize the input module. */ + if (!(in = new sr_input)) { + throw tr("Failed to allocate input module."); + } + + in->format = format; + in->param = NULL; + if (in->format->init && + in->format->init(in, filename.c_str()) != SR_OK) { + throw tr("Failed to load file"); + } + + return in; +} + +void InputFile::start() +{ +} + +void InputFile::run() +{ + assert(_input); + assert(_input->format); + assert(_input->format->loadfile); + _input->format->loadfile(_input, _path.c_str()); +} + +} // device +} // pv diff --git a/pv/device/inputfile.h b/pv/device/inputfile.h new file mode 100644 index 00000000..150418d5 --- /dev/null +++ b/pv/device/inputfile.h @@ -0,0 +1,68 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2014 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PULSEVIEW_PV_DEVICE_INPUTFILE_H +#define PULSEVIEW_PV_DEVICE_INPUTFILE_H + +#include "file.h" + +#include + +struct sr_input; +struct sr_input_format; + +namespace pv { +namespace device { + +class InputFile : public File +{ +public: + InputFile(const std::string &path); + + sr_dev_inst* dev_inst() const; + + virtual void use(SigSession *owner) throw(QString); + + virtual void release(); + + virtual void start(); + + virtual void run(); + +private: + /** + * Attempts to autodetect the format. Failing that + * @param filename The filename of the input file. + * @return A pointer to the 'struct sr_input_format' that should be used, + * or NULL if no input format was selected or auto-detected. + */ + static sr_input_format* determine_input_file_format( + const std::string &filename); + + static sr_input* load_input_file_format(const std::string &filename, + sr_input_format *format); +private: + sr_input *_input; +}; + +} // device +} // pv + +#endif // PULSEVIEW_PV_DEVICE_INPUTFILE_H diff --git a/pv/device/sessionfile.cpp b/pv/device/sessionfile.cpp new file mode 100644 index 00000000..ffdeb670 --- /dev/null +++ b/pv/device/sessionfile.cpp @@ -0,0 +1,75 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2014 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "sessionfile.h" + +#include + +namespace pv { +namespace device { + +SessionFile::SessionFile(const std::string &path) : + File(path), + _sdi(NULL) +{ +} + +sr_dev_inst* SessionFile::dev_inst() const +{ + return _sdi; +} + +void SessionFile::use(SigSession *owner) throw(QString) +{ + assert(!_sdi); + + if (sr_session_load(_path.c_str()) != SR_OK) + throw tr("Failed to open file.\n"); + + GSList *devlist = NULL; + sr_session_dev_list(&devlist); + + if (!devlist || !devlist->data) { + if (devlist) + g_slist_free(devlist); + throw tr("Failed to start session."); + } + + _sdi = (sr_dev_inst*)devlist->data; + g_slist_free(devlist); + + File::use(owner); +} + +void SessionFile::release() +{ + if (!_owner) + return; + + assert(_sdi); + File::release(); + sr_dev_close(_sdi); + sr_dev_clear(_sdi->driver); + sr_session_destroy(); + _sdi = NULL; +} + +} // device +} // pv diff --git a/pv/device/sessionfile.h b/pv/device/sessionfile.h new file mode 100644 index 00000000..c0ed958c --- /dev/null +++ b/pv/device/sessionfile.h @@ -0,0 +1,47 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2014 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PULSEVIEW_PV_DEVICE_SESSIONFILE_H +#define PULSEVIEW_PV_DEVICE_SESSIONFILE_H + +#include "file.h" + +namespace pv { +namespace device { + +class SessionFile : public File +{ +public: + SessionFile(const std::string &path); + + sr_dev_inst* dev_inst() const; + + virtual void use(SigSession *owner) throw(QString); + + virtual void release(); + +private: + sr_dev_inst *_sdi; +}; + +} // device +} // pv + +#endif // PULSEVIEW_PV_DEVICE_SESSIONFILE_H diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index 829c95e9..57e9c51f 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -322,9 +322,15 @@ void MainWindow::load_file(QString file_name) const QString errorMessage( QString("Failed to load file %1").arg(file_name)); const QString infoMessage; - _session.load_file(file_name.toStdString(), - boost::bind(&MainWindow::session_error, this, - errorMessage, infoMessage)); + + try { + _session.set_file(file_name.toStdString()); + } catch(QString e) { + show_session_error(tr("Failed to load ") + file_name, e); + } + + _session.start_capture(boost::bind(&MainWindow::session_error, this, + errorMessage, infoMessage)); } void MainWindow::show_session_error( diff --git a/pv/sigsession.cpp b/pv/sigsession.cpp index 9af7df74..5cc99982 100644 --- a/pv/sigsession.cpp +++ b/pv/sigsession.cpp @@ -26,6 +26,7 @@ #include "devicemanager.h" #include "device/device.h" +#include "device/file.h" #include "data/analog.h" #include "data/analogsnapshot.h" @@ -91,21 +92,35 @@ shared_ptr SigSession::get_device() const return _dev_inst; } -void SigSession::set_device(shared_ptr dev_inst) +void SigSession::set_device( + shared_ptr dev_inst) throw(QString) { using pv::device::Device; // Ensure we are not capturing before setting the device stop_capture(); - if (_dev_inst) + if (_dev_inst) { + sr_session_datafeed_callback_remove_all(); _dev_inst->release(); + } + + _dev_inst = dev_inst; + _decode_traces.clear(); - if (dev_inst) + if (dev_inst) { dev_inst->use(this); + sr_session_datafeed_callback_add(data_feed_in_proc, NULL); + update_signals(dev_inst); + } +} - _dev_inst = dev_inst; - update_signals(dev_inst); +void SigSession::set_file(const string &name) throw(QString) +{ + // Deslect the old device, because file type detection in File::create + // destorys the old session inside libsigrok. + set_device(shared_ptr()); + set_device(shared_ptr(device::File::create(name))); } void SigSession::release_device(device::DevInst *dev_inst) @@ -117,51 +132,6 @@ void SigSession::release_device(device::DevInst *dev_inst) _dev_inst = shared_ptr(); } -void SigSession::load_file(const string &name, - function error_handler) -{ - stop_capture(); - - if (sr_session_load(name.c_str()) == SR_OK) { - GSList *devlist = NULL; - sr_session_dev_list(&devlist); - - if (!devlist || !devlist->data || - sr_session_start() != SR_OK) { - error_handler(tr("Failed to start session.")); - return; - } - - shared_ptr dev_inst( - new device::Device((sr_dev_inst*)devlist->data)); - g_slist_free(devlist); - - _decode_traces.clear(); - update_signals(dev_inst); - read_sample_rate(dev_inst->dev_inst()); - - _sampling_thread = boost::thread( - &SigSession::load_session_thread_proc, this, - error_handler); - - } else { - sr_input *in = NULL; - - if (!(in = load_input_file_format(name.c_str(), - error_handler))) - return; - - _decode_traces.clear(); - update_signals(shared_ptr( - new device::Device(in->sdi))); - read_sample_rate(in->sdi); - - _sampling_thread = boost::thread( - &SigSession::load_input_thread_proc, this, - name, in, error_handler); - } -} - SigSession::capture_state SigSession::get_capture_state() const { lock_guard lock(_sampling_mutex); @@ -317,82 +287,6 @@ void SigSession::set_capture_state(capture_state state) capture_state_changed(state); } -/** - * Attempts to autodetect the format. Failing that - * @param filename The filename of the input file. - * @return A pointer to the 'struct sr_input_format' that should be used, - * or NULL if no input format was selected or auto-detected. - */ -sr_input_format* SigSession::determine_input_file_format( - const string &filename) -{ - int i; - - /* If there are no input formats, return NULL right away. */ - sr_input_format *const *const inputs = sr_input_list(); - if (!inputs) { - g_critical("No supported input formats available."); - return NULL; - } - - /* Otherwise, try to find an input module that can handle this file. */ - for (i = 0; inputs[i]; i++) { - if (inputs[i]->format_match(filename.c_str())) - break; - } - - /* Return NULL if no input module wanted to touch this. */ - if (!inputs[i]) { - g_critical("Error: no matching input module found."); - return NULL; - } - - return inputs[i]; -} - -sr_input* SigSession::load_input_file_format(const string &filename, - function error_handler, - sr_input_format *format) -{ - struct stat st; - sr_input *in; - - if (!format && !(format = - determine_input_file_format(filename.c_str()))) { - /* The exact cause was already logged. */ - return NULL; - } - - if (stat(filename.c_str(), &st) == -1) { - error_handler(tr("Failed to load file")); - return NULL; - } - - /* Initialize the input module. */ - if (!(in = new sr_input)) { - qDebug("Failed to allocate input module.\n"); - return NULL; - } - - in->format = format; - in->param = NULL; - if (in->format->init && - in->format->init(in, filename.c_str()) != SR_OK) { - qDebug("Input format init failed.\n"); - return NULL; - } - - sr_session_new(); - - if (sr_session_dev_add(in->sdi) != SR_OK) { - qDebug("Failed to use device.\n"); - sr_session_destroy(); - return NULL; - } - - return in; -} - void SigSession::update_signals(shared_ptr dev_inst) { assert(dev_inst); @@ -518,49 +412,6 @@ void SigSession::read_sample_rate(const sr_dev_inst *const sdi) } } -void SigSession::load_session_thread_proc( - function error_handler) -{ - (void)error_handler; - - sr_session_datafeed_callback_add(data_feed_in_proc, NULL); - - set_capture_state(Running); - - sr_session_run(); - - sr_session_destroy(); - set_capture_state(Stopped); - - // Confirm that SR_DF_END was received - assert(!_cur_logic_snapshot); - assert(_cur_analog_snapshots.empty()); -} - -void SigSession::load_input_thread_proc(const string name, - sr_input *in, function error_handler) -{ - (void)error_handler; - - assert(in); - assert(in->format); - - sr_session_datafeed_callback_add(data_feed_in_proc, NULL); - - set_capture_state(Running); - - in->format->loadfile(in, name.c_str()); - - sr_session_destroy(); - set_capture_state(Stopped); - - // Confirm that SR_DF_END was received - assert(!_cur_logic_snapshot); - assert(_cur_analog_snapshots.empty()); - - delete in; -} - void SigSession::sample_thread_proc(shared_ptr dev_inst, function error_handler) { @@ -568,26 +419,19 @@ void SigSession::sample_thread_proc(shared_ptr dev_inst, assert(dev_inst->dev_inst()); assert(error_handler); - sr_session_new(); - sr_session_datafeed_callback_add(data_feed_in_proc, NULL); + read_sample_rate(dev_inst->dev_inst()); - if (sr_session_dev_add(dev_inst->dev_inst()) != SR_OK) { - error_handler(tr("Failed to use device.")); - sr_session_destroy(); - return; - } - - if (sr_session_start() != SR_OK) { - error_handler(tr("Failed to start session.")); + try { + dev_inst->start(); + } catch(const QString e) { + error_handler(e); return; } set_capture_state(dev_inst->is_trigger_enabled() ? AwaitingTrigger : Running); - sr_session_run(); - sr_session_destroy(); - + dev_inst->run(); set_capture_state(Stopped); // Confirm that SR_DF_END was received diff --git a/pv/sigsession.h b/pv/sigsession.h index 39e4af68..da72015f 100644 --- a/pv/sigsession.h +++ b/pv/sigsession.h @@ -81,12 +81,13 @@ public: /** * Sets device instance that will be used in the next capture session. */ - void set_device(boost::shared_ptr dev_inst); + void set_device(boost::shared_ptr dev_inst) + throw(QString); - void release_device(device::DevInst *dev_inst); + void set_file(const std::string &name) + throw(QString); - void load_file(const std::string &name, - boost::function error_handler); + void release_device(device::DevInst *dev_inst); capture_state get_capture_state() const; @@ -134,12 +135,6 @@ private: boost::function error_handler, sr_input_format *format = NULL); - void load_session_thread_proc( - boost::function error_handler); - - void load_input_thread_proc(const std::string name, sr_input *in, - boost::function error_handler); - void sample_thread_proc(boost::shared_ptr dev_inst, boost::function error_handler); diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5e064a02..66dd7e51 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -59,6 +59,9 @@ set(pulseview_TEST_SOURCES ${PROJECT_SOURCE_DIR}/pv/data/signaldata.cpp ${PROJECT_SOURCE_DIR}/pv/device/device.cpp ${PROJECT_SOURCE_DIR}/pv/device/devinst.cpp + ${PROJECT_SOURCE_DIR}/pv/device/file.cpp + ${PROJECT_SOURCE_DIR}/pv/device/inputfile.cpp + ${PROJECT_SOURCE_DIR}/pv/device/sessionfile.cpp ${PROJECT_SOURCE_DIR}/pv/prop/int.cpp ${PROJECT_SOURCE_DIR}/pv/prop/property.cpp ${PROJECT_SOURCE_DIR}/pv/prop/string.cpp