Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
Feature/add author comment and genre (#12)
Browse files Browse the repository at this point in the history
* Add author

* Undos accidental edits

* update readme

* Add a few more

* readme
  • Loading branch information
antazoey committed Dec 13, 2020
1 parent 6f95ad6 commit 80646a7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public enum Event
GeneratorName = Text + 9,
TextPluginName = Text + 11,
TextInsertName = Text + 12,
TextGenre = Text + 14,
TextAuthor = Text + 15,
TextMidiCtrls = Text + 16,
TextDelay = Text + 17,

Expand Down
7 changes: 5 additions & 2 deletions Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ public class Project
public int MainPitch { get; set; } = 0;
public int Ppq { get; set; } = 0;
public double Tempo { get; set; } = 140;
public string ProjectTitle { get; set; } = "";
public string VersionString { get; set; } = "";
public string ProjectTitle { get; set; } = string.Empty;
public string Comment { get; set; } = string.Empty;
public string Author { get; set; } = string.Empty;
public string Genre { get; set; } = string.Empty;
public string VersionString { get; set; } = string.Empty;
public int Version { get; set; } = 0x100;
public List<Channel> Channels { get; set; } = new List<Channel>();
public Track[] Tracks { get; set; } = new Track[MaxTrackCount];
Expand Down
9 changes: 9 additions & 0 deletions ProjectParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@ private void ParseTextEvent(Enums.Event eventId, BinaryReader reader)
case Enums.Event.TextTitle:
_project.ProjectTitle = unicodeString;
break;
case Enums.Event.TextAuthor:
_project.Author = unicodeString;
break;
case Enums.Event.TextComment:
_project.Comment = unicodeString;
break;
case Enums.Event.TextGenre:
_project.Genre = unicodeString;
break;
case Enums.Event.TextSampleFileName:
if (genData == null) break;
genData.SampleFileName = unicodeString;
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ int MainPitch; // pitch of project
int Ppq; // pulses per quarter-beat
double Tempo; // tempo of project
string ProjectTitle; // title of project
string Comment; // comment of project
string Author; // author of project
string Genre; // genre of project
string VersionString; // xx.xx.xx-formatted string of FL version
int Version; // int format of version
List<Channel> Channels; // list of channels in project
Expand Down

0 comments on commit 80646a7

Please sign in to comment.