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

[Test] NowPlaying with settings, problem: no usersettingspointer in MixxxMainWindow #13158

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Eve00000
Copy link

For Ronso to check
Mixxx NowPlaying with settings,
my problem is : I can't get the usersettingspointer in MixxxMainWindow
I tried adding m_pConfig to .h etc
does not work, help please

@ronso0 ronso0 changed the title For Ronso to check Mixxx NowPlaying with settings, problem: no usersettingspointer in MixxxMainWindow [Test] NowPlaying with settings, problem: no usersettingspointer in MixxxMainWindow Apr 22, 2024
@@ -691,11 +691,26 @@ void MixxxMainWindow::slotUpdateWindowTitle(TrackPointer pTrack) {
QString trackInfo = pTrack->getInfo();
if (!trackInfo.isEmpty()) {
appTitle = QString("%1 | %2").arg(trackInfo, appTitle);
// writing the artist & title of the playing track not only to the windowtitle but also to a file
// location and name for nowplayingfile
if (m_pConfig->getValueString(ConfigKey("[Controls]", "CreateNowPlayingFile")) != "0") {
Copy link
Member

Choose a reason for hiding this comment

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

m_pCoreServices->getSettings() like you do below.
I suggest to get the settings pointer only once in this function.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you,
I found it:
if (m_pCoreServices->getSettings()->getValueString(ConfigKey("[Controls]", "CreateNowPlayingFile")) != "0")
I thought the coreservices were settings like commandarguments, environment etc .
My apologies.

What do you mean with 'only once'? Getting the configKey and the settingspath in one line?
Or using a var to put the coreservice-settings in and then get the configkey and settingspath out of that var?
Can you explain a little more please.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I mean store the UserSettingsPointer that you get from m_pCoreServices->getSettings() in a variable.
That's not required though, just reduces the code.

UserSettingsPointer pConfig = m_pCoreServices->getSettings();
// then use it to get/set values
QString xyz = pConfig->getValueString(ConfigKey("[Controls]", "CreateNowPlayingFile"));

Copy link
Author

Choose a reason for hiding this comment

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

Thank you, I've learned something. I will use it.

But ... euh .... I counted the occurences of m_pCoreServices in MixxxMainWindow : 68 times

I wonder: the m_pCoreServices are stored in the memory, when creating an extra userpointer that refers to the settings in the memory doesn't it fill the memory with extra vars? What is the fastest: directly read the settings or first the var ...
I know the on machines nowadays it won't make a lot of difference but in the days with only 640kb basic memorywe had to be very careful when storing extra vars in the mem. And I've read that some people want to execute Mixxx on a mini-pc like RPI (funny thing, I like it too).
I don't know if the actual cpu/mem speed interest you but what would be the fastest? Although c (and c++) are languages that have a very fast interaction with the machine and the complete code gets loaded into the memory as well, it's a lot of memory-swapping.

Copy link
Member

Choose a reason for hiding this comment

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

I wonder: the m_pCoreServices are stored in the memory, when creating an extra userpointer that refers to the settings in the memory doesn't it fill the memory with extra vars? What is the fastest: directly read the settings or first the var ...

No worries, this is just a pointer, i.e. a 'link' to the actual object.

People are running Mixxx on the RPi and probably other SoC like PandaBoard etc.

@ronso0 ronso0 marked this pull request as draft April 22, 2024 23:54
@ronso0
Copy link
Member

ronso0 commented Apr 22, 2024

FYI if you look for feedback and don't intend request an upstream merge, you can simply open a PR in your Mixxx fork.
(assuming you leave the main branch alone (or have some other branch cloned from mixxx/main) and work in feature branches).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants