From c3ff27796a7117cb673d95152c8b53bc3a7ac19e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 18 Jul 2005 19:06:32 +0000 Subject: [PATCH] add GetReferenceCount --- stepmania/src/RageSoundReader_Preload.cpp | 5 +++++ stepmania/src/RageSoundReader_Preload.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/stepmania/src/RageSoundReader_Preload.cpp b/stepmania/src/RageSoundReader_Preload.cpp index 4061169ffc..b034228233 100644 --- a/stepmania/src/RageSoundReader_Preload.cpp +++ b/stepmania/src/RageSoundReader_Preload.cpp @@ -118,6 +118,11 @@ SoundReader *RageSoundReader_Preload::Copy() const return new RageSoundReader_Preload(*this); } +int RageSoundReader_Preload::GetReferenceCount() const +{ + return buf.GetReferenceCount(); +} + rc_string::rc_string() { buf = new string; diff --git a/stepmania/src/RageSoundReader_Preload.h b/stepmania/src/RageSoundReader_Preload.h index 5e3a80c666..2a28766117 100644 --- a/stepmania/src/RageSoundReader_Preload.h +++ b/stepmania/src/RageSoundReader_Preload.h @@ -18,6 +18,7 @@ public: ~rc_string(); string &get_owned(); const string &get() const; + int GetReferenceCount() const { return *cnt; } }; class RageSoundReader_Preload: public SoundReader @@ -46,6 +47,10 @@ public: unsigned GetNumChannels() const { return channels; } bool IsStreamingFromDisk() const { return false; } + /* Return the total number of copies of this sound. (If 1 is returned, + * this is the last copy.) */ + int GetReferenceCount() const; + SoundReader *Copy() const; ~RageSoundReader_Preload() { }