-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Implementation for LRC Lyrics Export Functionality #27852
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
base: master
Are you sure you want to change the base?
Implementation for LRC Lyrics Export Functionality #27852
Conversation
… LRC lyrics file export feature.
…ule dependency, to add the LRC file export feature.
…format (.lrc) in export writers, to add the LRC lyrics file export feature.
…ctional changes made.
…ional changes made.
…file export feature.
…at const TYPES and added the following test steps for LRC export workflow: Open export dialog, Select LRC format, Execute export, Verify output file.
…rt modules, implementing INotationWriter interface for LRC format, and registering the exporter in imagesexport module. The implemented INotationWriter interface for LRC format extracts lyrics with timestamps from the score, formats output in standard LRC format, and handles metadata (title, composer).
…d lyrics extraction from score, formatted output in standard LRC format, and implemented the INotationWriter interface.
…d lyrics extraction from score, formatted output in standard LRC format, and implemented the INotationWriter interface.
It looks like you used an editor that automatically formats every file you open or touch, but not according to our code style. You will have to undo these formatting changes unfortunately. Also, there is currently a conflict between your branch and the master branch. To fix it, you have to rebase your branch, and then force-push:
|
@@ -21,20 +21,23 @@ | |||
*/ | |||
|
|||
#include "notationwritersregister.h" | |||
#include "importexport/lyrics/exportlrc.h" |
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.
This include does nothing. Instead, you need to register the lyrics writer from the lyrics export module file (which you will have to create), like how it's done in imagesexportmodule.cpp
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.
You have src/importexport/midi/internal/midiexport/exportLRC.{h,cpp}
and you have src/importexport/lyrics/exportlrc.{h,cpp}
, which look almost identical. It looks like only the latter should be kept.
@@ -0,0 +1,126 @@ | |||
// CREATED BHY |
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.
This file does not have the correct copyright header. Look at other files what it should be.
#include "exportLRC.h" | ||
#include "engraving/dom/chordrest.h" | ||
#include "engraving/dom/lyrics.h" | ||
#include "engraving/dom/masterscore.h" | ||
#include "engraving/compat/midi/compatmidirender.h" | ||
#include <QFile> |
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.
Please sort the includes like this:
- The header file corresponding to the cpp file
- blank line
- std includes
- blank line
- Qt includes
- blank line
- other includes, alphabetically
#include "exportLRC.h" | |
#include "engraving/dom/chordrest.h" | |
#include "engraving/dom/lyrics.h" | |
#include "engraving/dom/masterscore.h" | |
#include "engraving/compat/midi/compatmidirender.h" | |
#include <QFile> | |
#include "exportLRC.h" | |
#include <QFile> | |
#include "engraving/compat/midi/compatmidirender.h" | |
#include "engraving/dom/chordrest.h" | |
#include "engraving/dom/lyrics.h" | |
#include "engraving/dom/masterscore.h" |
(EDIT: I see I posted this comment on the wrong file, namely the one in midiexport
, while only the one in lyrics
should be kept. But it applies to that one as well.)
@@ -0,0 +1,30 @@ | |||
#ifndef EXPORTLRC_H | |||
#define EXPORTLRC_H |
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.
Same here about the copyright header and the order of the includes. And additionally, nowadays we prefer using #pragma once
in new files, instead of #ifndef...
.
project | ||
notation |
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 don't think linking to project
and notation
is necessary
@@ -0,0 +1,8 @@ | |||
declare_module(iex_lyrics) |
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.
Copyright header, again
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.
Instead of naming the module folder just lyrics
and the module just iex_lyrics
, I would call the folder lyricsexport
and the module iex_lyricsexport
.
@@ -0,0 +1,8 @@ | |||
declare_module(iex_lyrics) | |||
set(MODULE_SRC exportlrc.cpp exportlrc.h) |
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.
You will have to add lyricsexportmodule.{h,cpp}
files here, just like imagesexportmodule.{h,cpp}
. You will also need make sure that the main executable is linked to iex_lyricsexport
(see src/app/CMakeLists.txt
) and that the module is loaded at runtime (see appfactory.cpp
).
writers->reg({"pdf"}, std::make_shared<PdfWriter>(iocContext())); | ||
writers->reg({"svg"}, std::make_shared<SvgWriter>(iocContext())); | ||
writers->reg({"png"}, std::make_shared<PngWriter>(iocContext())); | ||
writers->reg({"lrc"}, std::make_shared<mu::iex::lrc::ExportLRC>()); |
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.
This is not the right place for this. The lyrics export has nothing to do with the images export module.
Resolves: #24813
This implements LRC file export for lyrics, including timestamps and metadata. The exporter appears in MuseScore's export dialog and generates standard .lrc files with [mm:ss.xx] formatted lyrics. Handles repeats and preserves score metadata (title/composer). Tested manually