Exemplo n.º 1
0
 private void ParseLabels(string value)
 {
     foreach (Pair<string, string> pair in ParsePairs(value, ",", "=")) {
         float beat = ParseFloat(pair.key);
         if (beat < 0f) {
             Logger.Warn(TAG, "Negative beat value events ignored");
         } else {
             Event ev = new Event();
             ev.type = EventType.Label;
             ev.beat = beat;
             ev.value = pair.value;
             _events.Add(ev);
         }
     }
 }
Exemplo n.º 2
0
 private void ParseStops(string value)
 {
     foreach (Pair<string, string> pair in ParsePairs(value, ",", "=")) {
         float beat = ParseFloat(pair.key);
         float stop = ParseFloat(pair.value);
         if (beat < 0f) {
             Logger.Warn(TAG, "Negative beat value events ignored");
         } else if (stop <= 0f) {
             Logger.Warn(TAG, "Zero or negative stops not supported");
         } else {
             Event ev = new Event();
             ev.type = EventType.Stop;
             ev.beat = beat;
             ev.value = stop;
             _events.Add(ev);
         }
     }
 }
Exemplo n.º 3
0
 private void ParseBgChanges(string value)
 {
     foreach (Pair<string, string> pair in ParsePairs(value, ",", "=")) {
         float beat = ParseFloat(pair.key);
         string filename = pair.value;
         if (filename.Contains("=")) {
             // No plans on supporting all those fancy transition flages
             // See http://www.stepmania.com/forums/general-stepmania/show/1393#post3757
             filename = filename.Substring(0, filename.IndexOf('='));
         }
         string filePath = FindImage(filename);
         if (beat < 0f) {
             Logger.Warn(TAG, "Negative beat value events ignored");
         } else if (string.IsNullOrEmpty(filename)) {
             Logger.Warn(TAG, "Unable to find background image: {0}", filename);
         } else {
             Event ev = new Event();
             ev.type = EventType.BgChange;
             ev.beat = beat;
             ev.value = filePath;
             _events.Add(ev);
         }
     }
 }