]> sigrok.org Git - pulseview.git/blobdiff - pv/data/analog.cpp
LogicSegment: Make constructor and append_payload() more generic
[pulseview.git] / pv / data / analog.cpp
index c95fffaf247518454b065ef9775cb5dcab8a2447..854dae3e68eaaec8d71212219365323abcefbbe8 100644 (file)
@@ -14,8 +14,7 @@
  * 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 <http://www.gnu.org/licenses/>.
  */
 
 #include <cassert>
@@ -55,17 +54,25 @@ vector< shared_ptr<Segment> > Analog::segments() const
 void Analog::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<AnalogSegment> s : segments_) {
+       for (const shared_ptr<AnalogSegment> 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