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

Fix my regression (b7d25b0) in sequence loop end/play end handling. #147

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

dlbeswick
Copy link
Contributor

@dlbeswick dlbeswick commented Feb 8, 2024

Also removed "len-patterns" property setter. This property may not agree to set itself to a value that would cause pattern truncation, so the value supplied to g_object_set may not match g_object_get. Not only does this confuse the automated tests (check_readwrite_long_param) but sequence data size management should ideally be a hidden implementation detail.

Fixes #136.

* @length: the new value requested for length
*
* Handles making sure that loop-end doesn't extend past song length, and also
* makes sure that loop-end is set to the song length, then the loop-end is
Copy link
Member

Choose a reason for hiding this comment

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

sure that if loop-end is set ...

*/
static void
bt_sequence_post_length_change (const BtSequence * const self,
guint old_length)
Copy link
Member

Choose a reason for hiding this comment

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

gulong old_length
to avoid truncating

bt_sequence_resize_data_length (const BtSequence * const self, const gulong length)
{
const gulong tracks = self->priv->tracks;

const gulong old_length = self->priv->len_patterns;

// try to shrink the pattern up to the row having the final non-empty pattern cell
/* Try to shrink the pattern up to the row having the final non-empty pattern
Copy link
Member

Choose a reason for hiding this comment

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

s/pattern/sequence/

Copy link
Member

@ensonic ensonic left a comment

Choose a reason for hiding this comment

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

Thanks for the follow up. Only a few nits.

Removed "len-patterns" property setter. This property may not agree to set itself to a value that would cause pattern
truncation, so the value supplied to g_object_set may not match g_object_get. Not only does this confuse the automated tests (check_readwrite_long_param) but sequence data size
management should ideally be a hidden implementation detail.
@dlbeswick
Copy link
Contributor Author

Nits are good too, fixed those. Thanks!

@dlbeswick dlbeswick merged commit ddab954 into Buzztrax:master Feb 12, 2024
1 check failed
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.

3 new tests wrt to the sequence length fail
2 participants