Skip to content

Conversation

soyersoyer
Copy link
Contributor

@soyersoyer soyersoyer commented Jul 27, 2025

Add DefaultScreen option to the minidexed.ini
0=Default
1=Performance Load

Open the Performance>Load menu if Performance Load is set

I think this is useful, I almost always enter here.

Summary by Sourcery

Introduce a new DefaultScreen configuration option and implement logic to open the Performance Load screen automatically on startup when selected

New Features:

  • Add DefaultScreen option to configuration to specify the default startup screen (0=Default, 1=Performance Load)

Enhancements:

  • Automatically navigate to the Performance>Load menu on startup when DefaultScreen is set to Performance Load

Documentation:

  • Update minidexed.ini to include the DefaultScreen option with its description and default value

Copy link

sourcery-ai bot commented Jul 27, 2025

Reviewer's Guide

Adds a new DefaultScreen option to the configuration, extends CConfig to parse it, implements a LoadDefaultScreen method in the UI to navigate directly to the Performance Load screen when selected, and integrates this behavior into the application startup sequence.

Sequence diagram for application startup with DefaultScreen option

sequenceDiagram
    participant App as CMiniDexed
    participant UI as CUserInterface
    participant Config as CConfig
    participant Menu as CUIMenu

    App->>UI: Initialize()
    App->>UI: LoadDefaultScreen()
    UI->>Config: GetDefaultScreen()
    alt DefaultScreen == 1
        UI->>Menu: EventHandler(MenuEventStepDown)
        UI->>Menu: EventHandler(MenuEventSelect)
        UI->>Menu: EventHandler(MenuEventSelect)
    end
Loading

Class diagram for updated configuration and UI classes

classDiagram
    class CConfig {
        +unsigned GetMasterVolume() const
        +unsigned GetDefaultScreen() const
        unsigned m_nMasterVolume
        unsigned m_nDefaultScreen
    }
    class CUserInterface {
        +bool Initialize()
        +void LoadDefaultScreen()
        +void Process()
        +void ParameterChanged()
        CUIMenu m_Menu
        CConfig* m_pConfig
    }
    CUserInterface --> CConfig : uses
    CUserInterface --> CUIMenu : uses
Loading

File-Level Changes

Change Details Files
Extend configuration to support a DefaultScreen setting
  • Added DefaultScreen entry and comment to the default ini
  • Introduced m_nDefaultScreen member and GetDefaultScreen() accessor
  • Loaded DefaultScreen value in CConfig::Load() from properties
src/minidexed.ini
src/config.h
src/config.cpp
Implement UI navigation based on DefaultScreen
  • Declared LoadDefaultScreen() in CUserInterface header
  • Defined LoadDefaultScreen() to check config and simulate menu events
src/userinterface.h
src/userinterface.cpp
Invoke default screen logic during initialization
  • Inserted m_UI.LoadDefaultScreen() call after sound device start in CMiniDexed::Initialize
src/minidexed.cpp

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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 @soyersoyer - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `src/config.h:377` </location>
<code_context>

 	unsigned m_nMasterVolume; // Master volume 0-127
+	
+	unsigned m_nDefaultScreen; // 0 Default, 1 Performance

 	// Network
</code_context>

<issue_to_address>
Default value for m_nDefaultScreen should be explicitly initialized.

Initialize m_nDefaultScreen to 0 in the constructor to prevent undefined behavior from uninitialized values.
</issue_to_address>

### Comment 2
<location> `src/config.cpp:224` </location>
<code_context>

 	m_nMasterVolume = m_Properties.GetNumber ("MasterVolume", 64);
+
+	m_nDefaultScreen = m_Properties.GetNumber ("DefaultScreen", 0);
 }

</code_context>

<issue_to_address>
Consider validating the DefaultScreen value loaded from configuration.

Without validation, m_nDefaultScreen could be set to an invalid value if the config is incorrect. Adding validation or clamping will help prevent this.

Suggested implementation:

```cpp
	m_nDefaultScreen = m_Properties.GetNumber ("DefaultScreen", 0);

	// Clamp m_nDefaultScreen to valid range [0, MAX_SCREENS-1]
	if (m_nDefaultScreen < 0)
		m_nDefaultScreen = 0;
	else if (m_nDefaultScreen >= MAX_SCREENS)
		m_nDefaultScreen = MAX_SCREENS - 1;
}

```

- Make sure that `MAX_SCREENS` is defined and represents the correct upper bound for valid screen indices. If the valid range is different, adjust the clamping logic accordingly.
- If `MAX_SCREENS` is not available, replace it with the correct constant or value for your application.
</issue_to_address>

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 and I'll use the feedback to improve your reviews.

Copy link

Build for testing:
MiniDexed_1256_2025-07-27-ea3a5c5_32bit
MiniDexed_1256_2025-07-27-ea3a5c5_64bit
Use at your own risk.

@Banana71
Copy link

Wow, that's a great new feature. You're my personal hero for today. Thank you.

After the IP address is displayed, the display jumps to TG1 – but if you then turn the encoder, you're back in the Performance - Load menu.

Copy link

Build for testing:
MiniDexed_1257_2025-07-27-744d9e9_32bit
MiniDexed_1257_2025-07-27-744d9e9_64bit
Use at your own risk.

@Banana71
Copy link

You solved that very well, thank you

Peter

@Banana71
Copy link

Banana71 commented Jul 27, 2025

Perhaps it would be helpful to explain what "default" means in the minidexed.ini file?

# Default "Boot" Screen ( 0=TG1 "default"; 1=Performance Load )
DefaultScreen=0

@soyersoyer
Copy link
Contributor Author

soyersoyer commented Jul 27, 2025

You solved that very well, thank you

Wouldn't it be better if it automatically disappeared after, say, 3 seconds?

Perhaps it would be helpful to explain what "default" means in the minidexed.ini file?

Sure!

Add DefaultScreen option to the minidexed.ini
0=Default
1=Performance Load

Open the Performance>Load menu if Performance Load is set
@Banana71
Copy link

Wouldn't it be better if it automatically disappeared after, say, 3 seconds?

Do you mean the network ready indicator:

     network ready
192.167.177.122

Yes, that would be even better. 3 seconds should be enough.

Copy link

Build for testing:
MiniDexed_1258_2025-07-27-998dfa1_32bit
MiniDexed_1258_2025-07-27-998dfa1_64bit
Use at your own risk.

Copy link

Build for testing:
MiniDexed_1259_2025-07-27-404498a_32bit
MiniDexed_1259_2025-07-27-404498a_64bit
Use at your own risk.

@Banana71
Copy link

The network ready indicator works very well. It stays on for 3 seconds, but disappears immediately when you turn the encoder. Great.

TG1 is misleading if the menu is not on it.

Show only for for 3 seconds.
@soyersoyer
Copy link
Contributor Author

soyersoyer commented Jul 27, 2025

I swapped 'Network ready' with the IP because the " IP>" doesn't always fit at the 16 column LCDs.

Copy link

Build for testing:
MiniDexed_1260_2025-07-27-0c16f17_32bit
MiniDexed_1260_2025-07-27-0c16f17_64bit
Use at your own risk.

@Banana71
Copy link

I swapped 'Network ready' with the IP

Also works on my display as described, top

@Banana71
Copy link

Banana71 commented Aug 9, 2025

@probonopd , you haven't commented on this feature yet, or is there a reason why you're not integrating it?

Peter

@soyersoyer soyersoyer closed this Aug 12, 2025
@probonopd
Copy link
Owner

@Banana71 basically because #890 is what I was intending to merge. The more we make things configurable, the more complicated it becomes to document things.

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 participants