Skip to content

Commit

Permalink
remove trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
barbeque-squared committed Dec 16, 2024
1 parent 11f913c commit ae40ab0
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions src/base/USong.pas
Original file line number Diff line number Diff line change
Expand Up @@ -873,9 +873,9 @@ function TSong.ReadTXTHeader(SongFile: TTextFileStream; ReadCustomTags: Boolean)
Break;
end;
end; // while

//Read the songs attributes stored in the TagMap

//-----------
//Required Attributes
//-----------
Expand All @@ -888,7 +888,7 @@ function TSong.ReadTXTHeader(SongFile: TTextFileStream; ReadCustomTags: Boolean)
//Add Title Flag to Done
Done := Done or 1;
end;

if (TagMap.TryGetData('ARTIST', Value)) then
begin
RemoveTagsFromTagMap('ARTIST');
Expand All @@ -897,7 +897,7 @@ function TSong.ReadTXTHeader(SongFile: TTextFileStream; ReadCustomTags: Boolean)
//Add Artist Flag to Done
Done := Done or 2;
end;

//MP3 File
if (TagMap.TryGetData('MP3', Value)) then
begin
Expand All @@ -914,7 +914,7 @@ function TSong.ReadTXTHeader(SongFile: TTextFileStream; ReadCustomTags: Boolean)
Log.LogError('Can''t find audio file in song: ' + DecodeStringUTF8(FullFileName, Encoding));
end;
end;

//Beats per Minute
if (TagMap.TryGetData('BPM', Value)) then
begin
Expand All @@ -932,32 +932,32 @@ function TSong.ReadTXTHeader(SongFile: TTextFileStream; ReadCustomTags: Boolean)
else
Log.LogError('Was not able to convert String ' + FullFileName + '"' + Value + '" to number.');
end;

//---------
//Additional Header Information
//---------

// Gap
if (TagMap.TryGetData('GAP', Value)) then
begin
RemoveTagsFromTagMap('GAP');
self.GAP := StrToFloatI18n(Value);
end;

//Cover Picture
if (TagMap.TryGetData('COVER', Value)) then
begin
RemoveTagsFromTagMap('COVER');
self.Cover := DecodeFilename(Value);
end;

//Background Picture
if (TagMap.TryGetData('BACKGROUND', Value)) then
begin
RemoveTagsFromTagMap('BACKGROUND');
self.Background := DecodeFilename(Value);
end;

// Video File
if (TagMap.TryGetData('VIDEO', Value)) then
begin
Expand All @@ -968,67 +968,67 @@ function TSong.ReadTXTHeader(SongFile: TTextFileStream; ReadCustomTags: Boolean)
else
Log.LogError('Can''t find video file in song: ' + FullFileName);
end;

// Video Gap
if (TagMap.TryGetData('VIDEOGAP', Value)) then
begin
RemoveTagsFromTagMap('VIDEOGAP');
self.VideoGAP := StrToFloatI18n( Value )
end;

//Genre Sorting
if (TagMap.TryGetData('GENRE', Value)) then
begin
RemoveTagsFromTagMap('GENRE');
DecodeStringUTF8(Value, Genre, Encoding);
self.GenreASCII := LowerCase(TransliterateToASCII(Genre));
end;

//Edition Sorting
if (TagMap.TryGetData('EDITION', Value)) then
begin
RemoveTagsFromTagMap('EDITION');
DecodeStringUTF8(Value, Edition, Encoding);
self.EditionASCII := LowerCase(TransliterateToASCII(Edition));
end;

//Creator Tag
if (TagMap.TryGetData('CREATOR', Value)) then
begin
RemoveTagsFromTagMap('CREATOR');
DecodeStringUTF8(Value, Creator, Encoding);
self.CreatorASCII := LowerCase(TransliterateToASCII(Creator));
end;

//Language Sorting
if (TagMap.TryGetData('LANGUAGE', Value)) then
begin
RemoveTagsFromTagMap('LANGUAGE');
DecodeStringUTF8(Value, Language, Encoding);
self.LanguageASCII := LowerCase(TransliterateToASCII(Language));
end;

//Year Sorting
if (TagMap.TryGetData('YEAR', Value)) then
begin
RemoveTagsFromTagMap('YEAR');
TryStrtoInt(Value, self.Year)
end;

// Song Start
if (TagMap.TryGetData('START', Value)) then
begin
RemoveTagsFromTagMap('START');
self.Start := StrToFloatI18n( Value )
end;

// Song Ending
if (TagMap.TryGetData('END', Value)) then
begin
RemoveTagsFromTagMap('END');
TryStrtoInt(Value, self.Finish)
end;

// Resolution
if (TagMap.TryGetData('RESOLUTION', Value)) then
begin
Expand All @@ -1040,29 +1040,29 @@ function TSong.ReadTXTHeader(SongFile: TTextFileStream; ReadCustomTags: Boolean)
self.Resolution := DEFAULT_RESOLUTION;
end;
end;

// Notes Gap
if (TagMap.TryGetData('NOTESGAP', Value)) then
begin
RemoveTagsFromTagMap('NOTESGAP');
TryStrtoInt(Value, self.NotesGAP)
end;

// Relative Notes
if (TagMap.TryGetData('RELATIVE', Value)) then
begin
RemoveTagsFromTagMap('RELATIVE');
if (UpperCase(Value) = 'YES') then
self.Relative := true;
end;

// File encoding
if (TagMap.TryGetData('ENCODING', Value)) then
begin
RemoveTagsFromTagMap('ENCODING');
self.Encoding := ParseEncoding(Value, Ini.DefaultEncoding);
end;

// PreviewStart
if (TagMap.TryGetData('PREVIEWSTART', Value)) then
begin
Expand All @@ -1074,66 +1074,66 @@ function TSong.ReadTXTHeader(SongFile: TTextFileStream; ReadCustomTags: Boolean)
HasPreview := true;
end;
end;

// MedleyStartBeat
if TagMap.TryGetData('MEDLEYSTARTBEAT', Value) and not self.Relative then
begin
RemoveTagsFromTagMap('MEDLEYSTARTBEAT');
if TryStrtoInt(Value, self.Medley.StartBeat) then
MedleyFlags := MedleyFlags or 2;
end;

// MedleyEndBeat
if TagMap.TryGetData('MEDLEYENDBEAT', Value) and not self.Relative then
begin
RemoveTagsFromTagMap('MEDLEYENDBEAT');
if TryStrtoInt(Value, self.Medley.EndBeat) then
MedleyFlags := MedleyFlags or 4;
end;

// Medley
if (TagMap.TryGetData('CALCMEDLEY', Value)) then
begin
RemoveTagsFromTagMap('CALCMEDLEY');
if Uppercase(Value) = 'OFF' then
self.CalcMedley := false;
end;

// Duet Singer Name P1
if (TagMap.TryGetData('DUETSINGERP1', Value)) then
begin
RemoveTagsFromTagMap('DUETSINGERP1');
DecodeStringUTF8(Value, DuetNames[0], Encoding);
end;

// Duet Singer Name P2
if (TagMap.TryGetData('DUETSINGERP2', Value)) then
begin
RemoveTagsFromTagMap('DUETSINGERP2');
DecodeStringUTF8(Value, DuetNames[1], Encoding);
end;

// Duet Singer Name P1
if (TagMap.TryGetData('P1', Value)) then
begin
RemoveTagsFromTagMap('P1');
DecodeStringUTF8(Value, DuetNames[0], Encoding);
end;

// Duet Singer Name P2
if (TagMap.TryGetData('P2', Value)) then
begin
RemoveTagsFromTagMap('P2');
DecodeStringUTF8(Value, DuetNames[1], Encoding);
end;

// Unsupported Tags
// Use downto loop to keep the order of identical (multi-value) custom tags
for I := TagMap.Count - 1 downto 0 do
begin
AddCustomTag(TagMap.Keys[I], TagMap.Data[I]);
end;

finally
TagMap.Free;
end;
Expand Down

0 comments on commit ae40ab0

Please sign in to comment.