Add FILE line to Cuefile to include file path for each track#13365
Conversation
There was a problem hiding this comment.
Thanks for the contribution, as @fwcd suggested, it would be great to make that an option. To do so, you could add a boolean to EngineRecord (like m_bCueUsesFileAnnotation), and initialise it in the EngineRecord::updateFromPreferences, using m_pConfig->getValue().
You can use Qt Designer to edit src/preferences/dialog/dlgprefrecorddlg.ui and add the logic in src/preferences/dialog/dlgprefrecord.cpp to ahndle the preference edition. Happy to do that part if you would like me to.
|
Just a word on Qt Designer: that potentially rearranges the .ui files (for no reason) which produces a unreviewable diff. |
|
@ronso0 Thanks for the tip, I will pay attention to the .ui files order and will edit manually if need be |
|
@acolombier Quick question, I just read in the Developer Guidelines to prefer merging over rebasing as rebasing apparently causes problems. I did not know this, and can't remember if I rebased or not. Is there a way for me to check if I rebased? Sorry if this is a dumb question. Thanks! |
|
Welcome at Mixxx! |
|
@presentformyfriends Merging is preferred becasue rebasing rewrites the commit history and may detach review comments (which could mean a lot / everything hd to be reviewwd again) Though, for this minimal PR that's irrelevant IMO. |
|
Thanks @JoergAtGithub just signed it!
|
|
Got it, good to know!
|
Add boolean to EngineRecord and initialize it in updateFromPreferences Add checkbox to DlgPrefRecord to enable file annotation in CUE file Add logic to ensure checkbox is disabled by default, include tooltip
|
Pushed the rest, please let me know if it's ok or if I should change anything. FYI: I edited the .ui file with kDevelop, not Qt Designer. EDIT: Build failed at pre-commit hook, I made some formatting changes and pushed those again. |
|
Can anyone tell me why my commit keeps failing on clang-format? I ran pre-commit locally and everything passes. When I look at the diff it's formatting issues that I've already fixed? 🤷 |
Are you sure? The lines that clang-format on CI complains about missing linebreaks in Also keep in mind that pre-commit only looks at the most recent commit, so if you have not run pre-commit since starting the PR, you might need to do a |
acolombier
left a comment
There was a problem hiding this comment.
This is looking good, thanks for the PR!
Just some minor comments
| .toUtf8()); | ||
|
|
||
| if (m_bCueUsesFileAnnotation) { | ||
| m_cueFile.write(QString(" FILE \"%1\"\n") |
There was a problem hiding this comment.
I believe you might be able to use a QStringLiteral
There was a problem hiding this comment.
For this one, fyi all the m_cueFile.write lines are existing code and use QString, I just added the if statement on line 254. I assumed whoever wrote that code used QString for a reason but idk.
There was a problem hiding this comment.
QStringLiteral is a QString :) (doc)
The value of a QStringLiteral is that it will create the QString at compilte time, instead of instantiating at every function calls. This is a macro optimisation.
The TL;DR is: if you use a static string in your QString (like here with " FILE \"%1\"\n"), you can make it a QStringLiteral.
You are correct that the one above could also be using QStringLiteral tho! Feel free to update them.
There was a problem hiding this comment.
Thanks for the explanation, I will update mine and the ones above. Just pushed new commit that should take care of this.
I ran this command but it still fails on clang-format and lists the same files: |
Co-authored-by: Antoine Colombier <7086688+acolombier@users.noreply.github.com>
Co-authored-by: Antoine Colombier <7086688+acolombier@users.noreply.github.com>
Did you |
|
Alternative is to apply this patch: |
No, just tried that and now I'm unable to even push or pull. git push attempt: git pull attempt: No idea what to make of this despite their "hints" EDIT: Is it ok to use 'git reset' in this case? I don't know git that well and don't want to screw up anyone else's code |
This reverts commit 5a07163.
|
Ok should be fixed now, just did a git revert on most recent commit and then pulled. Please let me know if there is anything else I need to do to complete the PR, and thanks to all for the help. |
| .toUtf8()); | ||
|
|
||
| if (m_bCueUsesFileAnnotation) { | ||
| m_cueFile.write(QString(" FILE \"%1\"\n") |
There was a problem hiding this comment.
| m_cueFile.write(QString(" FILE \"%1\"\n") | |
| m_cueFile.write(QStringLiteral(" FILE \"%1\"\n") |
Feel free to also fix other occurrence
There was a problem hiding this comment.
Just pushed new commit that should take care of this. I updated the line you suggested as well as the ones above it. Thanks!
Nice! Thanks for the guidance and thank you to everyone in here!
Ok good, I'm going to go read the Pro Git book again lol |
|
This PR is marked as stale because it has been open 90 days with no activity. |
a61a08f to
d03e359
Compare
|
@daschuer I have addressed the pre-commit, are you happy with updating your review? |
daschuer
left a comment
There was a problem hiding this comment.
Thank you for adopting this. I left two final comments
Co-authored-by: Daniel Schürmann <daschuer@mixxx.org>
1d422b6 to
d790d0d
Compare
|
Friendly ping @daschuer - addressed your change requests |
|
Hi did this ever get merged? I don't see the functionality in 2.5? |
|
Not yet. This needs a final test. |
| m_cueFile.write(QStringLiteral(" FILE \"%1\"\n") | ||
| .arg(m_pCurrentTrack->getLocation()) | ||
| .toUtf8()); |
There was a problem hiding this comment.
Nit for future PR: convert to use m_cueField.write() directly and avoid temporary string allocations.
Swiftb0y
left a comment
There was a problem hiding this comment.
Haven't done a test, but code LGTM.
|
whoops. I left a comment but apparently it has gotten lost somehow. I can confirm I now have a |
|
@Swiftb0y Optional. Any idea when this will be merged? It's been blocked for a year and I need this feature. EDIT: To clarify, I believe the |
|
@daschuer your change request have been addressed now. Could you please provide another review or remove the change request status? |
|
Thank you for this PR. |
|
Merging this PR broke the main branch CI: Last CI run of this PR was 4 months ago. |
|
Hey there. This has been merged to |
|
Oh ok good, thanks for clairfying that for me. Much appreciated. |
|
@presentformyfriends I like to add you name to the contrributor list in the Mixxx about box. Which name shall I use? |
|
@daschuer Hi you can use presentformyfriends if that's ok. Thanks! |


Fixes #13321
This PR adds a FILE line to the Cuefile to show a filepath for each track (see issue for more information).