Skip to content

Commit

Permalink
Add menu item for MusicXML export
Browse files Browse the repository at this point in the history
  • Loading branch information
porime42 committed Aug 6, 2024
1 parent 43f23ff commit c25f7d2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OpenUtau.Core/Format/MusicXML.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,9 @@ static public MusicXMLSchema.ScorePartwise ReadXMLScore(string xmlFile)
return score;
}
}

static public void Save(string filePath, UProject project)
{
}
}
}
1 change: 1 addition & 0 deletions OpenUtau/Strings/Strings.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
<system:String x:Key="menu.file.exportds.v2">Export DiffSinger Scripts To (v2)</system:String>
<system:String x:Key="menu.file.exportds.v2withoutpitch">Export DiffSinger Scripts To (v2, without pitch curve)</system:String>
<system:String x:Key="menu.file.exportmidi">Export Midi File</system:String>
<system:String x:Key="menu.file.exportmusicxml">Export MusicXML File</system:String>
<system:String x:Key="menu.file.exportmixdown">Mixdown To Wav File</system:String>
<system:String x:Key="menu.file.exportproject">Export Project</system:String>
<system:String x:Key="menu.file.exportust">Export Ust Files</system:String>
Expand Down
1 change: 1 addition & 0 deletions OpenUtau/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<MenuItem Header="{DynamicResource menu.file.exportust}" Click="OnMenuExportUst"/>
<MenuItem Header="{DynamicResource menu.file.exportustto}" Click="OnMenuExportUstTo"/>
<MenuItem Header="{DynamicResource menu.file.exportmidi}" Click="OnMenuExportMidi"/>
<MenuItem Header="{DynamicResource menu.file.exportmusicxml}" Click="OnMenuExportMusicXML"/>
<MenuItem Header="{DynamicResource menu.file.exportds}" Click="OnMenuExportDsTo"/>
<MenuItem Header="{DynamicResource menu.file.exportds.v2}" Click="OnMenuExportDsV2To"/>
<MenuItem Header="{DynamicResource menu.file.exportds.v2withoutpitch}" Click="OnMenuExportDsV2WithoutPitchTo"/>
Expand Down
9 changes: 9 additions & 0 deletions OpenUtau/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,15 @@ async void OnMenuExportMidi(object sender, RoutedEventArgs e) {
}
}

async void OnMenuExportMusicXML(object sender, RoutedEventArgs e) {
var project = DocManager.Inst.Project;
var file = await FilePicker.SaveFileAboutProject(
this, "menu.file.exportmusicxml", FilePicker.MUSICXML);
if (!string.IsNullOrEmpty(file)) {
MusicXML.Save(file, project);
}
}

private async Task<bool> WarnToSave(UProject project) {
if (string.IsNullOrEmpty(project.FilePath)) {
await MessageBox.Show(
Expand Down

0 comments on commit c25f7d2

Please sign in to comment.