]> sigrok.org Git - pulseview.git/blobdiff - pv/session.hpp
win32: Fix the Windows build (namespace pollution via windows.h).
[pulseview.git] / pv / session.hpp
index c6a317def7b61b5f1b61a6bef5ffa65847372fc4..d71b1d6cec3f267bab7044b52dd69d375a1987a3 100644 (file)
@@ -18,8 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#ifndef PULSEVIEW_PV_SIGSESSION_H
-#define PULSEVIEW_PV_SIGSESSION_H
+#ifndef PULSEVIEW_PV_SIGSESSION_HPP
+#define PULSEVIEW_PV_SIGSESSION_HPP
 
 #include <map>
 #include <memory>
 #include <thread>
 #include <vector>
 
+#ifdef _WIN32
+// Windows: Avoid namespace pollution by thread.hpp (which includes windows.h).
+#define NOGDI
+#define NORESOURCE
+#endif
 #include <boost/thread.hpp>
 
 #include <QObject>
@@ -38,13 +43,13 @@ struct srd_decoder;
 struct srd_channel;
 
 namespace sigrok {
-       class Analog;
-       class Channel;
-       class Device;
-       class Logic;
-       class Meta;
-       class Packet;
-       class Session;
+class Analog;
+class Channel;
+class Device;
+class Logic;
+class Meta;
+class Packet;
+class Session;
 }
 
 namespace pv {
@@ -53,9 +58,9 @@ class DeviceManager;
 
 namespace data {
 class Analog;
-class AnalogSnapshot;
+class AnalogSegment;
 class Logic;
-class LogicSnapshot;
+class LogicSegment;
 class SignalData;
 }
 
@@ -94,7 +99,11 @@ public:
         */
        void set_device(std::shared_ptr<sigrok::Device> device);
 
-       void set_file(const std::string &name);
+       /**
+        * Sets a sigrok session file as the capture device.
+        * @param name the path to the file.
+        */
+       void set_session_file(const std::string &name);
 
        void set_default_device();
 
@@ -166,9 +175,10 @@ private:
 
        mutable std::mutex data_mutex_;
        std::shared_ptr<data::Logic> logic_data_;
-       std::shared_ptr<data::LogicSnapshot> cur_logic_snapshot_;
-       std::map< std::shared_ptr<sigrok::Channel>, std::shared_ptr<data::AnalogSnapshot> >
-               cur_analog_snapshots_;
+       uint64_t cur_samplerate_;
+       std::shared_ptr<data::LogicSegment> cur_logic_segment_;
+       std::map< std::shared_ptr<sigrok::Channel>, std::shared_ptr<data::AnalogSegment> >
+               cur_analog_segments_;
 
        std::thread sampling_thread_;
 
@@ -187,4 +197,4 @@ Q_SIGNALS:
 
 } // namespace pv
 
-#endif // PULSEVIEW_PV_SIGSESSION_H
+#endif // PULSEVIEW_PV_SIGSESSION_HPP