Skip to content

Commit 98dc65c

Browse files
committed
🐛 Fix Source::get_gain()
1 parent 4ab5013 commit 98dc65c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/src/capo.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,7 @@ class Source : public ISource {
296296
ma_sound_set_looping(m_sound.get(), looping ? MA_TRUE : MA_FALSE);
297297
}
298298

299-
[[nodiscard]] auto get_gain() const -> float final {
300-
if (!is_bound()) { return -1.0f; }
301-
return ma_sound_get_volume(m_sound.get());
302-
}
299+
[[nodiscard]] auto get_gain() const -> float final { return m_state.gain; }
303300

304301
void set_gain(float const gain) final {
305302
m_state.gain = std::clamp(gain, 0.0f, 1.0f);

0 commit comments

Comments
 (0)