X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsession.hpp;h=8ae6673872f3c5a4804672a9a6a2b976d6b57396;hp=c4f2bed83324779c0593b9d05635c9288c188f32;hb=558ad6ceb934ab7406d286c1a4ae08da4aba1448;hpb=724f29f311db4f8b47169e58f3f3b50e6a50ed08 diff --git a/pv/session.hpp b/pv/session.hpp index c4f2bed8..8ae66738 100644 --- a/pv/session.hpp +++ b/pv/session.hpp @@ -70,6 +70,7 @@ class DeviceManager; namespace data { class Analog; class AnalogSegment; +class DecodeSignal; class Logic; class LogicSegment; class SignalBase; @@ -99,6 +100,8 @@ public: Running }; + static shared_ptr sr_context; + public: Session(DeviceManager &device_manager, QString name); @@ -160,6 +163,8 @@ public: double get_samplerate() const; + int get_segment_count() const; + void register_view(shared_ptr view); void deregister_view(shared_ptr view); @@ -169,9 +174,9 @@ public: const unordered_set< shared_ptr > signalbases() const; #ifdef ENABLE_DECODE - bool add_decoder(srd_decoder *const dec); + shared_ptr add_decode_signal(); - void remove_decode_signal(shared_ptr signalbase); + void remove_decode_signal(shared_ptr signal); #endif private: @@ -191,6 +196,9 @@ private: void free_unused_memory(); + void signal_new_segment(); + void signal_segment_completed(); + void feed_in_header(); void feed_in_meta(shared_ptr meta); @@ -198,6 +206,7 @@ private: void feed_in_trigger(); void feed_in_frame_begin(); + void feed_in_frame_end(); void feed_in_logic(shared_ptr logic); @@ -228,11 +237,13 @@ private: shared_ptr cur_logic_segment_; map< shared_ptr, shared_ptr > cur_analog_segments_; + int32_t highest_segment_id_; std::thread sampling_thread_; bool out_of_memory_; bool data_saved_; + bool frame_began_; Q_SIGNALS: void capture_state_changed(int state); @@ -244,12 +255,11 @@ Q_SIGNALS: void trigger_event(util::Timestamp location); - void frame_began(); + void new_segment(int new_segment_id); + void segment_completed(int segment_id); void data_received(); - void frame_ended(); - void add_view(const QString &title, views::ViewType type, Session *session);