Skip to content

Add FILE line to Cuefile to include file path for each track#13365

Merged
daschuer merged 15 commits into
mixxxdj:mainfrom
presentformyfriends:fixing_some_bug
Jun 26, 2025
Merged

Add FILE line to Cuefile to include file path for each track#13365
daschuer merged 15 commits into
mixxxdj:mainfrom
presentformyfriends:fixing_some_bug

Conversation

@presentformyfriends
Copy link
Copy Markdown
Contributor

Fixes #13321

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

Copy link
Copy Markdown
Member

@acolombier acolombier left a comment

Choose a reason for hiding this comment

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

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.

@ronso0
Copy link
Copy Markdown
Member

ronso0 commented Jun 13, 2024

Just a word on Qt Designer: that potentially rearranges the .ui files (for no reason) which produces a unreviewable diff.
If that happens please resort to editing the ui file manually in a text editor.

@presentformyfriends
Copy link
Copy Markdown
Contributor Author

@ronso0 Thanks for the tip, I will pay attention to the .ui files order and will edit manually if need be

@presentformyfriends
Copy link
Copy Markdown
Contributor Author

@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!

@JoergAtGithub
Copy link
Copy Markdown
Member

Welcome at Mixxx!
As a first-time contributor we need you to sign the Mixxx Contributor Agreement and comment here when you have done so. It gives us permission to distribute your contribution under the GPL v2 or later license and the Apple Mac App Store. It is also helpful for us to have contact information for contributors in case we may need it in the future.

@ronso0
Copy link
Copy Markdown
Member

ronso0 commented Jun 13, 2024

@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.

@presentformyfriends
Copy link
Copy Markdown
Contributor Author

Thanks @JoergAtGithub just signed it!

Welcome at Mixxx! As a first-time contributor we need you to sign the

@presentformyfriends
Copy link
Copy Markdown
Contributor Author

Got it, good to know!

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.

presentformyfriends and others added 2 commits June 29, 2024 16:53
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
@presentformyfriends
Copy link
Copy Markdown
Contributor Author

presentformyfriends commented Jul 14, 2024

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.

@presentformyfriends
Copy link
Copy Markdown
Contributor Author

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? 🤷

@Swiftb0y
Copy link
Copy Markdown
Member

Swiftb0y commented Jul 15, 2024

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 enginerecord.cpp:128 for example.

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 pre-commit run --from-ref upstream/main --to-ref HEAD so it runs on the entire PR.

Copy link
Copy Markdown
Member

@acolombier acolombier left a comment

Choose a reason for hiding this comment

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

This is looking good, thanks for the PR!
Just some minor comments

Comment thread src/preferences/dialog/dlgprefrecord.cpp Outdated
Comment thread src/engine/sidechain/enginerecord.cpp Outdated
.toUtf8());

if (m_bCueUsesFileAnnotation) {
m_cueFile.write(QString(" FILE \"%1\"\n")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe you might be able to use a QStringLiteral

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

@presentformyfriends presentformyfriends Jul 23, 2024

Choose a reason for hiding this comment

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

Thanks for the explanation, I will update mine and the ones above. Just pushed new commit that should take care of this.

Comment thread src/preferences/dialog/dlgprefrecord.cpp Outdated
Comment thread src/preferences/dialog/dlgprefrecord.cpp Outdated
Comment thread src/preferences/dialog/dlgprefrecord.cpp
@presentformyfriends
Copy link
Copy Markdown
Contributor Author

presentformyfriends commented Jul 17, 2024

you might need to do a pre-commit run --from-ref upstream/main --to-ref HEAD so it runs on the entire PR.

I ran this command but it still fails on clang-format and lists the same files:

fix utf-8 byte order marker..............................................Passed
check for case conflicts.................................................Passed
check json...........................................(no files to check)Skipped
check for merge conflicts................................................Passed
check xml............................................(no files to check)Skipped
check yaml...........................................(no files to check)Skipped
fix end of files.........................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
don't commit to branch...................................................Passed
codespell................................................................Passed
eslint...............................................(no files to check)Skipped
clang-format.............................................................Failed
- hook id: clang-format
- files were modified by this hook

[INFO] First pass: Reformatting added/changed lines...
[INFO] Reformatting src/engine/sidechain/enginerecord.cpp [21-22, 40-40, 254-259]...
[INFO] Reformatting src/engine/sidechain/enginerecord.h [88-88]...
[INFO] Reformatting src/preferences/dialog/dlgprefrecord.cpp [79-81, 125-129, 155-155, 187-187, 191-192, 215-216, 218-220, 322-331, 458-461, 467-471]...
[INFO] Reformatting src/preferences/dialog/dlgprefrecord.h [35-37, 50-51]...
[INFO] Second pass: Breaking long added/changed lines...
[INFO] Reformatting src/engine/sidechain/enginerecord.cpp [40-40]...
[INFO] Reformatting src/preferences/dialog/dlgprefrecord.cpp [322-322]...

black................................................(no files to check)Skipped
flake8...............................................(no files to check)Skipped
shellcheck...........................................(no files to check)Skipped
markdownlint-cli2....................................(no files to check)Skipped
Validate GitHub Workflows............................(no files to check)Skipped
prettier.............................................(no files to check)Skipped
reformat QML files...................................(no files to check)Skipped
qsscheck.............................................(no files to check)Skipped
changelog............................................(no files to check)Skipped
qmllint..............................................(no files to check)Skipped
metainfo.............................................(no files to check)Skipped 

presentformyfriends and others added 2 commits July 17, 2024 18:21
Co-authored-by: Antoine Colombier <7086688+acolombier@users.noreply.github.com>
Co-authored-by: Antoine Colombier <7086688+acolombier@users.noreply.github.com>
@daschuer
Copy link
Copy Markdown
Member

I ran this command but it still fails on clang-format and lists the same files:

Did you
git commit -a after checking all files?

@daschuer
Copy link
Copy Markdown
Member

@presentformyfriends
Copy link
Copy Markdown
Contributor Author

presentformyfriends commented Jul 19, 2024

Did you git commit -a after checking all files?

No, just tried that and now I'm unable to even push or pull.

git push attempt:

To github.com:presentformyfriends/mixxx.git
 ! [rejected]              fixing_some_bug -> fixing_some_bug (fetch first)
error: failed to push some refs to 'github.com:presentformyfriends/mixxx.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

git pull attempt:

remote: Enumerating objects: 12, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 12 (delta 5), reused 8 (delta 5), pack-reused 0
Unpacking objects: 100% (12/12), 11.50 KiB | 3.83 MiB/s, done.
From github.com:presentformyfriends/mixxx
   d6a42bb989..7ae6cb7bb7  fixing_some_bug -> origin/fixing_some_bug
hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint: 
hint:   git config pull.rebase false  # merge (the default strategy)
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint: 
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.

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

@presentformyfriends
Copy link
Copy Markdown
Contributor Author

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.

Comment thread src/engine/sidechain/enginerecord.cpp Outdated
.toUtf8());

if (m_bCueUsesFileAnnotation) {
m_cueFile.write(QString(" FILE \"%1\"\n")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
m_cueFile.write(QString(" FILE \"%1\"\n")
m_cueFile.write(QStringLiteral(" FILE \"%1\"\n")

Feel free to also fix other occurrence

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just pushed new commit that should take care of this. I updated the line you suggested as well as the ones above it. Thanks!

@presentformyfriends
Copy link
Copy Markdown
Contributor Author

LGTM! Thanks for addressing the feature request.

Nice! Thanks for the guidance and thank you to everyone in here!

It may be that the pipeline complains due to some precommit checks but otherwise, it looks good now.

Ok good, I'm going to go read the Pro Git book again lol

@github-actions
Copy link
Copy Markdown

This PR is marked as stale because it has been open 90 days with no activity.

@github-actions github-actions Bot added the stale Stale issues that haven't been updated for a long time. label Jan 23, 2025
@acolombier
Copy link
Copy Markdown
Member

@daschuer I have addressed the pre-commit, are you happy with updating your review?

Copy link
Copy Markdown
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

Thank you for adopting this. I left two final comments

Comment thread src/engine/sidechain/enginerecord.cpp Outdated
Comment thread src/preferences/dialog/dlgprefrecord.cpp Outdated
@Swiftb0y Swiftb0y requested a review from daschuer February 13, 2025 14:29
Co-authored-by: Daniel Schürmann <daschuer@mixxx.org>
@github-actions github-actions Bot removed the stale Stale issues that haven't been updated for a long time. label Feb 14, 2025
@acolombier
Copy link
Copy Markdown
Member

Friendly ping @daschuer - addressed your change requests

@presentformyfriends
Copy link
Copy Markdown
Contributor Author

Hi did this ever get merged? I don't see the functionality in 2.5?

@daschuer
Copy link
Copy Markdown
Member

Not yet. This needs a final test.

Comment on lines +258 to +260
m_cueFile.write(QStringLiteral(" FILE \"%1\"\n")
.arg(m_pCurrentTrack->getLocation())
.toUtf8());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit for future PR: convert to use m_cueField.write() directly and avoid temporary string allocations.

Copy link
Copy Markdown
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

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

Haven't done a test, but code LGTM.

@Swiftb0y
Copy link
Copy Markdown
Member

Swiftb0y commented Jun 19, 2025

whoops. I left a comment but apparently it has gotten lost somehow.

I can confirm I now have a FILE line in the cuesheet per played track. However unlike the top level FILE tag (referencing the recording), there is no indication of the filetype (like WAVE or MP3) after the path. Is this needed or optional @presentformyfriends?

@presentformyfriends
Copy link
Copy Markdown
Contributor Author

presentformyfriends commented Jun 25, 2025

@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 WAVE or MP3 was exclusive to Rekordbox's creation of cuefiles, but I could be wrong.

@acolombier
Copy link
Copy Markdown
Member

@daschuer your change request have been addressed now. Could you please provide another review or remove the change request status?

Copy link
Copy Markdown
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

I can confirm the review issues are solved.
Edit: Oh I see @Swiftb0y has tested an his finding has been clarified.

@daschuer
Copy link
Copy Markdown
Member

Thank you for this PR.

@daschuer daschuer merged commit a163fd1 into mixxxdj:main Jun 26, 2025
@JoergAtGithub
Copy link
Copy Markdown
Member

Merging this PR broke the main branch CI:

Error: D:\a\mixxx\mixxx\src\preferences\dialog\dlgprefrecord.cpp(129): error C2220: the following warning is treated as an error
Warning: D:\a\mixxx\mixxx\src\preferences\dialog\dlgprefrecord.cpp(129): warning C4996: 'QCheckBox::stateChanged': Use checkStateChanged() instead

Last CI run of this PR was 4 months ago.

@presentformyfriends
Copy link
Copy Markdown
Contributor Author

Hi there, just wondering why the "FILE LINE" functionality is missing in the Mixxx beta 2.6-beta-51-gd58909dcd3 ?

I am testing it now:
cuefile1
cuefile2

Now that this is merged, shouldn't the functionality be present in the beta? Thanks.

@Swiftb0y
Copy link
Copy Markdown
Member

Swiftb0y commented Aug 4, 2025

Hey there. This has been merged to main after the 2.6 has been cut from it. That means it'll only be available in 2.7-alpha and later.

@presentformyfriends
Copy link
Copy Markdown
Contributor Author

Oh ok good, thanks for clairfying that for me. Much appreciated.

@daschuer
Copy link
Copy Markdown
Member

daschuer commented Mar 8, 2026

@presentformyfriends I like to add you name to the contrributor list in the Mixxx about box. Which name shall I use?

@presentformyfriends
Copy link
Copy Markdown
Contributor Author

@daschuer Hi you can use presentformyfriends if that's ok. Thanks!

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.

Please add a FILE line to the Cue Sheet

6 participants