Skip to content

Add Project-Specific Settings (And Export Metadata!) #7865

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

regulus79
Copy link
Contributor

Basically, we have no way to store project properties. And that's okay for the most part, but for things like metadata or (in the future, the ticks per bar), we have no place to store them.

Usually for settings like that you would use ConfigManager::inst()->value(), and it would store it in the lmmsrc file, and maybe let the user see/edit the settings in the SetupDialog.

So, I decided to implement a ProjectProperties class analogous to ConfigManager, but it saves to the project file instead of the lmmsrc file. Also, I added a ProjectPropertiesDialog analogous to the SetupDialog to let the user edit them.

I copied a lot of code from ConfigManager and SetupDialog, so they do act/look quite similar. (Also ProjectPropertiesDialog is kind of a mess)

Images

To demo the functionality, I've added a way to edit the export metadata of the song. (And yes, this is functional when exporting wav, ogg, flac, and mp3, so now you can edit your audio metadata from within LMMS!)

Screenshot From 2025-04-27 11-48-55

Note, I'm not done with the UI! It looks really bad right now but I want to improve it (I would love feedback)

Usage

Anytime you want to access/save a project-specific setting, just put

#include "ProjectProperties.h";

at the top of your file, and then do

ProjectProperties::inst()->value("category", "name", "default");

to access a value, and

ProjectProperties::inst()->setValue("category", "name", "value");

to set it.
The settings will be saved to the project file whenever the user saves the project.

@sakertooth
Copy link
Contributor

I would prefer project properties to be a separate tab in the settings menu.

@regulus79
Copy link
Contributor Author

I would prefer project properties to be a separate tab in the settings menu.

Currently everything in the settings menu is saved to the lmmsrc file. I was kinda thinking that because these things are all saved to the project file, it would make sense to have them in their own window. Also once more project-specific settings are added (like ticksPerBar, or anything), there will need to be more tabs to organize them, and it could get confusing which settings are saved per-project vs globally if they are all together in one window. Though I guess these things are kind of "settings", so maybe it would also make sense to have them in the settings window. Hmm.

Also I was hoping to add another tab into this window for random stats about the project, and I'm not sure those would belong in settings. Idk. Actually that's not important.

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.

2 participants