Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for instrument type change before releasing current instrument #359

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

maks
Copy link
Collaborator

@maks maks commented Feb 4, 2025

Need to check if the instrument type actually changed due to UI event (key combo) trying to trigger an instrument type change before we actually try to release the current instrument object.

Also quick clean up to remove macro instrument type from enum list to prevent future confusion on it not yet being shipped.

Fixes: #328

also remove macro instrument type from enum list to prevent future
confusion on it not yet being shipped.
@maks maks requested a review from democloid February 4, 2025 08:59
Copy link
Collaborator

@democloid democloid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok, one nit

@@ -9,10 +9,11 @@

#include "Application/Player/TablePlayback.h"

const u_char INSTRUMENT_TYPES_COUNT = 5;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to have
enum InstrumentType { IT_NONE=0, IT_SAMPLE, IT_MIDI, IT_SID, IT_OPAL, IT_LAST };
and use IT_LAST as the count? (I'd remove macro for the moment

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes thats a neat way to do it 👍🏻

@maks maks merged commit 7a5fbd5 into master Feb 5, 2025
3 checks passed
@maks maks deleted the 328-crash-going-past-opal-instr-type branch February 5, 2025 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Freeze when select instruments
2 participants