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

feat: play all available bitmap slots sequentially #49

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

kienvo
Copy link
Member

@kienvo kienvo commented Sep 11, 2024

Resolves #40

Changes:

  • Add return step state to animation functions
  • Add method to get head node from bitmap list
  • Add auto change to next bitmap depend on is_play_sequentially

Summary by Sourcery

Implement sequential playback of bitmap slots by modifying animation functions to return step states and adding a method to access the head of the bitmap list. This allows automatic transitions between bitmaps based on the 'is_play_sequentially' flag.

New Features:

  • Introduce sequential playback of bitmap slots, allowing automatic transition to the next bitmap when the current one finishes.

Enhancements:

  • Modify animation functions to return the step state, enabling better control over animation sequences.
  • Add a method to retrieve the head node from the bitmap list, facilitating navigation and management of bitmap sequences.

Resovles: fossasia#40

Changes:

- Add return step state to animation functions
- Add method to get head node from bitmap list
- Add auto change to next bitmap depend on `is_play_sequentially`
Copy link

sourcery-ai bot commented Sep 11, 2024

Reviewer's Guide by Sourcery

This pull request implements sequential playback of all available bitmap slots. It modifies the animation functions to return the step state, adds a method to get the head node from the bitmap list, and introduces an auto-change mechanism to the next bitmap based on the is_play_sequentially flag.

File-Level Changes

Change Details Files
Modify animation functions to return step state
  • Change return type of animation functions from void to int
  • Add logic to calculate and return the current step or remaining steps
  • Update function calls to handle the new return value
src/animation.c
Implement sequential bitmap playback
  • Add is_play_sequentially flag to control sequential playback
  • Modify bm_transition function to handle sequential playback
  • Update main animation loop to check for end of animation and switch to next bitmap
src/main.c
Add method to get head node from bitmap list
  • Implement bmlist_head() function to return the head of the bitmap list
  • Update bmlist_drop() function to handle cases where head or tail nodes are dropped
src/bmlist.c
src/bmlist.h

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @kienvo - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -68,7 +68,17 @@ static void change_mode()
__HIGH_CODE
static void bm_transition()
Copy link

Choose a reason for hiding this comment

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

suggestion: Consider restructuring the sequential play logic for clarity

The new is_play_sequentially feature adds valuable functionality, but the implementation in bm_transition() and common_tasks() could be clearer. Consider restructuring this logic to make it more straightforward and easier to maintain.

static void bm_transition(bool is_play_sequentially)
{
    if (is_play_sequentially) {
        handle_sequential_play();
    } else {
        handle_normal_transition();
    }
}

@mariobehling mariobehling merged commit 2a730ef into fossasia:master Sep 17, 2024
2 checks passed
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.

Play all available bitmap slots sequentially
2 participants