X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;ds=inline;f=pv%2Fdata%2Fanalog.cpp;h=854dae3e68eaaec8d71212219365323abcefbbe8;hb=59ec98e2b704d918c236e82f41536ce833890fb0;hp=30cf5013033dd0f9cc8b002031769b109495c4b5;hpb=2acdb232d6bb452cfdfaea3ef5218fb4da592329;p=pulseview.git
diff --git a/pv/data/analog.cpp b/pv/data/analog.cpp
index 30cf501..854dae3 100644
--- a/pv/data/analog.cpp
+++ b/pv/data/analog.cpp
@@ -14,18 +14,18 @@
* 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
+ * along with this program; if not, see .
*/
#include
#include "analog.hpp"
-#include "analogsnapshot.hpp"
+#include "analogsegment.hpp"
using std::deque;
using std::max;
using std::shared_ptr;
+using std::vector;
namespace pv {
namespace data {
@@ -35,30 +35,44 @@ Analog::Analog() :
{
}
-void Analog::push_snapshot(shared_ptr &snapshot)
+void Analog::push_segment(shared_ptr &segment)
{
- snapshots_.push_front(snapshot);
+ segments_.push_front(segment);
}
-deque< shared_ptr >& Analog::get_snapshots()
+const deque< shared_ptr >& Analog::analog_segments() const
{
- return snapshots_;
+ return segments_;
+}
+
+vector< shared_ptr > Analog::segments() const
+{
+ return vector< shared_ptr >(
+ segments_.begin(), segments_.end());
}
void Analog::clear()
{
- snapshots_.clear();
+ segments_.clear();
+
+ samples_cleared();
}
-uint64_t Analog::get_max_sample_count() const
+uint64_t Analog::max_sample_count() const
{
uint64_t l = 0;
- for (const std::shared_ptr s : snapshots_) {
+ for (const shared_ptr s : segments_) {
assert(s);
l = max(l, s->get_sample_count());
}
return l;
}
+void Analog::notify_samples_added(QObject* segment, uint64_t start_sample,
+ uint64_t end_sample)
+{
+ samples_added(segment, start_sample, end_sample);
+}
+
} // namespace data
} // namespace pv