Skip to content

Commit

Permalink
waveform::clear()
Browse files Browse the repository at this point in the history
  • Loading branch information
igagis committed May 23, 2024
1 parent fc26095 commit de790eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/waveform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,20 @@ void waveform::render(const ruis::matrix4& matrix) const
}
}

void waveform::on_resize()
void waveform::clear()
{
for (auto& p : this->paths) {
p.points.clear();
}
this->clear_accumulated_value();
this->make_vaos();
}

void waveform::on_resize()
{
this->clear();
}

void waveform::clear_accumulated_value()
{
this->accumulated_value = 0;
Expand Down
2 changes: 2 additions & 0 deletions src/waveform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class waveform :

void push(ruis::real value, ruis::real dt_ms);

void clear();

private:
void make_vaos();
};
Expand Down

0 comments on commit de790eb

Please sign in to comment.