-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
base: main
Are you sure you want to change the base?
Conversation
src/mixxxmainwindow.cpp
Outdated
@@ -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") { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"));
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
FYI if you look for feedback and don't intend request an upstream merge, you can simply open a PR in your Mixxx fork. |
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