RobLoach / RobLoach/raylib-cpp

Music not getting IsPlaying() updated correctly

Open
#144 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
960
Forks
120
Avg merge
10m
Merged PRs (30d)
1

Description

When loading 2 raylib::Music files, and waiting on a if (!currentMusic.IsPlaying()) to switch to music2 using the same pointer. The Music file does not update correctly.

Draft example:
raylib::Music* currentMusic, music1, music2;
music1 = new raylib::Music("1.ogg");
music1.SetLooping(false);
music2 = new raylib::Music("2.ogg");
currentMusic = music1;
currentMusic.Play();
while (running) {
currentMusic.Update();
if (!currentMusic.IsPlaying()) {
currentMusic = music2;
}

Is an example to be filled on the app example. On my case, if I reload the App or make the songs reload on a key press, they dont change and the music1 keeps playing on loop.
Tried with the base library, works as intended. Tried with bindings, fails on this case.
I dont know if the issue is with an operator= when reasigning pointers.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the draft example and trace the Music wrapper's Play(), Update(), IsPlaying(), and assignment behavior, comparing it with the base raylib behavior described in the issue. Reproduce the two-track switch and reload cases; done means IsPlaying() reflects playback state and switching to music2 stops the looping music1 as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.