mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-28 04:51:42 +00:00
Merge branch 'fix-gme-seek' into 'master'
Fix GME only ever seeking halfway See merge request KartKrew/Kart!1367
This commit is contained in:
commit
ec6408b87b
3 changed files with 4 additions and 4 deletions
|
|
@ -65,11 +65,11 @@ std::size_t Gme::get_samples(tcb::span<short> buffer)
|
||||||
return buffer.size();
|
return buffer.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gme::seek(int sample)
|
void Gme::seek(int position_ms)
|
||||||
{
|
{
|
||||||
SRB2_ASSERT(instance_ != nullptr);
|
SRB2_ASSERT(instance_ != nullptr);
|
||||||
|
|
||||||
gme_seek_samples(instance_, sample);
|
gme_seek(instance_, position_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Gme::duration_seconds() const
|
float Gme::duration_seconds() const
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ public:
|
||||||
explicit Gme(tcb::span<std::byte> data);
|
explicit Gme(tcb::span<std::byte> data);
|
||||||
|
|
||||||
std::size_t get_samples(tcb::span<short> buffer);
|
std::size_t get_samples(tcb::span<short> buffer);
|
||||||
void seek(int sample);
|
void seek(int position_ms);
|
||||||
|
|
||||||
float duration_seconds() const;
|
float duration_seconds() const;
|
||||||
std::optional<float> loop_point_seconds() const;
|
std::optional<float> loop_point_seconds() const;
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ std::size_t GmePlayer<C>::generate(tcb::span<Sample<C>> buffer)
|
||||||
template <size_t C>
|
template <size_t C>
|
||||||
void GmePlayer<C>::seek(float position_seconds)
|
void GmePlayer<C>::seek(float position_seconds)
|
||||||
{
|
{
|
||||||
gme_.seek(static_cast<std::size_t>(position_seconds * 44100.f));
|
gme_.seek(static_cast<std::size_t>(position_seconds * 1000.f));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <size_t C>
|
template <size_t C>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue