projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
View: Use the slider value for the v-offset
[pulseview.git]
/
main.cpp
diff --git
a/main.cpp
b/main.cpp
index 5c3e5b25818ffc70d1ac28a347e9b33cb91bda47..74d13fdc4af1b0eeb9e9b3d3e1d64169597b8dd9 100644
(file)
--- a/
main.cpp
+++ b/
main.cpp
@@
-23,22
+23,22
@@
#endif
#include <stdint.h>
#endif
#include <stdint.h>
-#include <libsigrok/libsigrok.h>
+#include <libsigrok/libsigrok.h
pp
>
#include <getopt.h>
#include <QDebug>
#ifdef ENABLE_SIGNALS
#include <getopt.h>
#include <QDebug>
#ifdef ENABLE_SIGNALS
-#include "signalhandler.h"
+#include "signalhandler.h
pp
"
#endif
#endif
-#include "pv/application.h"
-#include "pv/devicemanager.h"
-#include "pv/mainwindow.h"
+#include "pv/application.h
pp
"
+#include "pv/devicemanager.h
pp
"
+#include "pv/mainwindow.h
pp
"
#ifdef ANDROID
#include <libsigrokandroidutils/libsigrokandroidutils.h>
#ifdef ANDROID
#include <libsigrokandroidutils/libsigrokandroidutils.h>
-#include "android/loghandler.h"
+#include "android/loghandler.h
pp
"
#endif
#include "config.h"
#endif
#include "config.h"
@@
-65,7
+65,7
@@
void usage()
int main(int argc, char *argv[])
{
int ret = 0;
int main(int argc, char *argv[])
{
int ret = 0;
- st
ruct sr_context *sr_ctx = NULL
;
+ st
d::shared_ptr<sigrok::Context> context
;
const char *open_file = NULL;
Application a(argc, argv);
const char *open_file = NULL;
Application a(argc, argv);
@@
-93,7
+93,7
@@
int main(int argc, char *argv[])
case 'l':
{
const int loglevel = atoi(optarg);
case 'l':
{
const int loglevel = atoi(optarg);
-
sr_log_loglevel_set(loglevel
);
+
context->set_log_level(sigrok::LogLevel::get(loglevel)
);
#ifdef ENABLE_DECODE
srd_log_loglevel_set(loglevel);
#ifdef ENABLE_DECODE
srd_log_loglevel_set(loglevel);
@@
-121,10
+121,7
@@
int main(int argc, char *argv[])
open_file = argv[argc - 1];
// Initialise libsigrok
open_file = argv[argc - 1];
// Initialise libsigrok
- if (sr_init(&sr_ctx) != SR_OK) {
- qDebug() << "ERROR: libsigrok init failed.";
- return 1;
- }
+ context = sigrok::Context::create();
do {
do {
@@
-141,7
+138,7
@@
int main(int argc, char *argv[])
try {
// Create the device manager, initialise the drivers
try {
// Create the device manager, initialise the drivers
- pv::DeviceManager device_manager(
sr_ctx
);
+ pv::DeviceManager device_manager(
context
);
// Initialise the main window
pv::MainWindow w(device_manager, open_file);
// Initialise the main window
pv::MainWindow w(device_manager, open_file);
@@
-157,7
+154,7
@@
int main(int argc, char *argv[])
QObject::connect(handler,
SIGNAL(term_received()),
&w, SLOT(close()));
QObject::connect(handler,
SIGNAL(term_received()),
&w, SLOT(close()));
- } else {
+ } else {
qWarning() <<
"Could not prepare signal handler.";
}
qWarning() <<
"Could not prepare signal handler.";
}
@@
-177,9
+174,5
@@
int main(int argc, char *argv[])
} while (0);
} while (0);
- // Destroy libsigrok
- if (sr_ctx)
- sr_exit(sr_ctx);
-
return ret;
}
return ret;
}