From f7868833e792cffcb64c5f5c644e6908ee78ac23 Mon Sep 17 00:00:00 2001 From: Ahmet Inan Date: Wed, 5 Sep 2018 12:30:36 +0200 Subject: [PATCH] added good() to pcm --- pcm.hh | 2 ++ wav.hh | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/pcm.hh b/pcm.hh index 189bdd3..5905a16 100644 --- a/pcm.hh +++ b/pcm.hh @@ -13,6 +13,7 @@ template struct WritePCM { virtual void write(TYPE *, int, int = 1) = 0; + virtual bool good() = 0; virtual void silence(int) = 0; }; @@ -20,6 +21,7 @@ template struct ReadPCM { virtual void read(TYPE *, int, int = 1) = 0; + virtual bool good() = 0; virtual void skip(int) = 0; virtual int rate() = 0; virtual int channels() = 0; diff --git a/wav.hh b/wav.hh index 8b473cd..3e432b1 100644 --- a/wav.hh +++ b/wav.hh @@ -108,6 +108,10 @@ public: } } } + bool good() + { + return is.good(); + } void skip(int num) { is.seekg(num * channels_ * bytes, std::ios_base::cur); @@ -204,6 +208,10 @@ public: } } } + bool good() + { + return os.good(); + } void silence(int num) { for (int i = 0; i < num * channels; ++i)