Permalink
Browse files

- fixed CDLC 2 Tab menu generator

  • Loading branch information...
cozy1 committed Feb 2, 2019
1 parent bacdb7d commit e972ddc73e11e5ed9ef0a55842889837e187126b
@@ -941,8 +941,7 @@ public void FillPackageCreatorForm(DLCPackageData info, string filesBaseDir)
if (!String.IsNullOrEmpty(info.AlbumArtPath))
{
AlbumArtPath = info.AlbumArtPath.AbsoluteTo(BasePath);
// forces the ArtFiles array to be generated from the AlbumArtPath
info.ArtFiles = null;
info.ArtFiles = null; // force ArtFiles array to be generated from the AlbumArtPath
}

// Lyric art
@@ -29,5 +29,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.2.0")]
[assembly: AssemblyInformationalVersion("dfeda5a6")]
[assembly: AssemblyInformationalVersion("bacdb7d3")]
[assembly: AssemblyConfiguration("")]
@@ -1,5 +1,6 @@
Rocksmith Toolkit Release Notes

- fixed CDLC 2 Tab menu generator
- fixed AlbumArtPath exceptions caused by image file names that have extra underscores '_'
(thanks to cu1t for the contribution and pull request)
- fixed arrangement represent bug
@@ -37,17 +37,14 @@ public Song XmlToSong(string xmlFilePath)
/// <param name="outputPath"></param>
/// <param name="overWrite"></param>
/// <returns>RS Song XML file path</returns>
public string SongToXml(Song rsSong, string outputPath, bool overWrite)
public string SongToXml(Song rsSong, string outputDir, bool overWrite)
{
var outputFile = String.Format("{0}_{1}", rsSong.Title, rsSong.Arrangement);
outputFile = String.Format("{0}{1}", outputFile.GetValidFileName(), "_rs1.xml");
var outputPath = Path.Combine(outputDir, outputFile);

if (File.Exists(outputPath) && overWrite)
File.Delete(outputPath);
else
{
var outputDir = Path.GetDirectoryName(outputPath);
var outputFile = String.Format("{0}_{1}", rsSong.Title, rsSong.Arrangement);
outputFile = String.Format("{0}{1}", outputFile.GetValidFileName(), "_rs1.xml");
outputPath = Path.Combine(outputDir, outputFile);
}

using (var stream = File.OpenWrite(outputPath))
rsSong.Serialize(stream, true);
@@ -75,13 +72,13 @@ public SngFile Song2SngFile(Song rs1Song, string outputDir)
/// Converts RS1 Song Object to *.sng File
/// </summary>
/// <param name="rs1Song"></param>
/// <param name="outputPath"></param>
/// <param name="outputDir"></param>
/// <returns>Path to binary *.sng file</returns>
public string SongToSngFilePath(Song rs1Song, string outputPath)
public string SongToSngFilePath(Song rs1Song, string outputDir)
{
string rs1XmlPath;
using (var obj = new Rs1Converter())
rs1XmlPath = obj.SongToXml(rs1Song, outputPath, true);
rs1XmlPath = obj.SongToXml(rs1Song, outputDir, true);

ArrangementType arrangementType;
if (rs1Song.Arrangement.ToLower() == "bass")
@@ -151,7 +148,7 @@ public Song2014 SongToSong2014(Song rsSong)
// RS1 before Bass Edition did not contain ArrangementProperties
if (rsSong.ArrangementProperties == null)
rsSong.ArrangementProperties = new SongArrangementProperties();

// initialize arrangement properties with zero's
rsSong2014.ArrangementProperties = new SongArrangementProperties2014
{
@@ -415,11 +412,11 @@ private SongNote2014 GetNoteInfo(SongNote songNote)
bendValues.Add(new BendValue { Step = songNote.Bend, Time = (float)Math.Round((songNote.Sustain * 0.3333 / songNote.Bend) + songNote.Time, 3), Unk5 = 0 });
songNote2014.BendValues = bendValues.ToArray();
}

// RS1
// <note time="73.047" bend="0" fret="5" hammerOn="0" harmonic="0" hopo="0" ignore="0" palmMute="0" pullOff="0" slideTo="-1" string="1" sustain="0" tremolo="0"/>
songNote2014.Time = (float)songNote.Time;
songNote2014.Bend = (float) songNote.Bend;
songNote2014.Bend = (float)songNote.Bend;
songNote2014.Fret = (sbyte)songNote.Fret;
songNote2014.HammerOn = (byte)songNote.HammerOn;
songNote2014.Harmonic = (byte)songNote.Harmonic;
@@ -27,5 +27,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.2.0")]
[assembly: AssemblyInformationalVersion("dfeda5a6")]
[assembly: AssemblyInformationalVersion("bacdb7d3")]
[assembly: AssemblyConfiguration("")]
@@ -10,6 +10,7 @@
using RocksmithToolkitLib.XML;
using System.ComponentModel;
using RocksmithToolkitLib.DLCPackage;
using System.Windows.Forms;

namespace RocksmithToolkitLib.Sng
{
@@ -129,14 +130,16 @@ public static void Write(string inputFile, string outputFile, ArrangementType ar
var serializer = new XmlSerializer(typeof(Song));
var song = (Song)serializer.Deserialize(reader);

// TODO: song.Tuning is null (does not exist in the XML Arrangement)
// HACK: apply Standard E tuning
var tuning = new Int16[] { 0, 0, 0, 0, 0, 0 };
if (song.Tuning != null)
tuning = song.Tuning.ToArray();
else
throw new DataException("<ERROR> Arrangement XML contains no tuning element" + Environment.NewLine +
"The arrangment will be defaulted to Standard E tuning" + Environment.NewLine);
{
var diaMsg = "<WARNING> Arrangement XML contains no tuning element ..." + Environment.NewLine +
"The arrangment will be defaulted to Standard E tuning.";
MessageBox.Show(diaMsg, "SngFileWriter Null Tuning ...");
}

WriteSngFile(song, InstrumentTuningExtensions.GetTuningByOffsets(tuning), arrangementType, outputFile, bitConverter);
}
@@ -36,6 +36,9 @@ public class Song
[XmlElement("lastConversionDateTime")]
public string LastConversionDateTime { get; set; }

[XmlElement("tuning")]
public TuningStrings Tuning { get; set; }

[XmlArray("phrases")]
[XmlArrayItem("phrase")]
public SongPhrase[] Phrases { get; set; }
@@ -84,7 +87,7 @@ public class Song
[XmlElement("arrangementProperties")]
public SongArrangementProperties ArrangementProperties { get; set; }

# region EOF non-compliant elements, not found in RS1
# region EOF non-compliant elements, not found in original RS1
[XmlIgnore]
[XmlElement("startBeat")]
public Single StartBeat { get; set; }
@@ -93,10 +96,6 @@ public class Song
[XmlElement("averageTempo")]
public Single AverageTempo { get; set; }

[XmlIgnore]
[XmlElement("tuning")]
public TuningStrings Tuning { get; set; }

[XmlIgnore]
[XmlElement("artistName")]
public string ArtistName { get; set; }
@@ -340,9 +340,9 @@ public AutoUpdaterForm(string[] args)
if (File.Exists(latestZipPath))
File.Delete(latestZipPath);

// find open localToolkitDir and close it so it can be deleted
if (localToolkitDir != newLocalToolkitDir)
{
// find open localToolkitDir and close it so it can be deleted
var shellWindows = new SHDocVw.ShellWindows();
foreach (SHDocVw.InternetExplorer shellWindow in shellWindows)
{
@@ -359,11 +359,12 @@ public AutoUpdaterForm(string[] args)
MessageBox.Show("localToolkitDir: " + localToolkitDir + Environment.NewLine +
"should now be closed ...", "DPDM");

// attempt to delete the closed directory
DeleteDirectory(localToolkitDir);
break;
}
}

// attempt to delete the closed directory
DeleteDirectory(localToolkitDir);
}

if (isDebugMe)
@@ -29,5 +29,5 @@
//
// THESE VALUES ARE PROGRAMMATICALLY GENERATED - DO NOT EDIT
[assembly: AssemblyVersion("2.9.2.0")]
[assembly: AssemblyInformationalVersion("dfeda5a6")]
[assembly: AssemblyInformationalVersion("bacdb7d3")]
[assembly: AssemblyConfiguration("")]
@@ -1,3 +1,3 @@
2.9.2.0
dfeda5a6
bacdb7d3

0 comments on commit e972ddc

Please sign in to comment.