@@ -19,22 +19,18 @@ namespace Beats2.Parser
1919 /// </summary>
2020 public class ParserSM : ParserBase
2121 {
22- private const string TAG = "SMParser " ;
22+ private const string TAG = "ParserSM " ;
2323
24- private FileInfo _inputFile ;
25- private DirectoryInfo _parentDirectory ;
26- private Simfile _simfile = new Simfile ( ) ;
2724 private List < Event > _events = new List < Event > ( ) ;
2825 private List < string > _notesData = new List < string > ( ) ;
2926 private bool _isMetadataLoaded = false ;
3027
3128 public ParserSM ( FileInfo inputFile , DirectoryInfo parentDirectory )
29+ : base ( inputFile , parentDirectory )
3230 {
33- _inputFile = inputFile ;
34- _parentDirectory = parentDirectory ;
3531 }
3632
37- public void LoadMetadata ( )
33+ public override void LoadMetadata ( )
3834 {
3935 if ( ! _inputFile . Exists ) {
4036 throw new ParserException ( string . Format ( "Input file does not exist: {0}" , _inputFile . FullName ) ) ;
@@ -72,7 +68,7 @@ public void LoadMetadata()
7268 }
7369 }
7470
75- public void LoadCharts ( )
71+ public override void LoadCharts ( )
7672 {
7773 if ( ! _isMetadataLoaded ) {
7874 throw new ParserException ( "Metadata must be loaded first" ) ;
@@ -112,24 +108,24 @@ private void ParseTag(string tag, string value)
112108 _simfile . metadata . infoCredits = value ;
113109 break ;
114110 case "BANNER" :
115- _simfile . metadata . graphicBanner = FindImage ( value , _parentDirectory ) ;
111+ _simfile . metadata . graphicBanner = FindImage ( value ) ;
116112 break ;
117113 case "BACKGROUND" :
118- _simfile . metadata . graphicBackground = FindImage ( value , _parentDirectory ) ;
114+ _simfile . metadata . graphicBackground = FindImage ( value ) ;
119115 break ;
120116 case "CDTITLE" :
121117 case "JACKET" :
122118 case "CDIMAGE" :
123119 case "DISCIMAGE" :
124120 if ( _simfile . metadata . graphicCover == null ) {
125- _simfile . metadata . graphicCover = FindImage ( value , _parentDirectory ) ;
121+ _simfile . metadata . graphicCover = FindImage ( value ) ;
126122 }
127123 break ;
128124 case "LYRICSPATH" :
129125 ParseLyricsPath ( value ) ;
130126 break ;
131127 case "MUSIC" :
132- _simfile . metadata . musicPath = FindAudio ( value , _parentDirectory ) ;
128+ _simfile . metadata . musicPath = FindAudio ( value ) ;
133129 break ;
134130 case "OFFSET" :
135131 _simfile . metadata . musicOffset = ParseFloat ( value ) ;
@@ -196,7 +192,7 @@ private void ParseTag(string tag, string value)
196192
197193 private void ParseLyricsPath ( string value )
198194 {
199- string lyricPath = FindLyrics ( value , _parentDirectory ) ;
195+ string lyricPath = FindLyrics ( value ) ;
200196 if ( string . IsNullOrEmpty ( lyricPath ) ) {
201197 Logger . Warn ( TAG , "Unable to find lyrics file: {0}" , lyricPath ) ;
202198 } else {
@@ -254,7 +250,7 @@ private void ParseBgChanges(string value)
254250 // See http://www.stepmania.com/forums/general-stepmania/show/1393#post3757
255251 filename = filename . Substring ( 0 , filename . IndexOf ( '=' ) ) ;
256252 }
257- string filePath = FindImage ( filename , _parentDirectory ) ;
253+ string filePath = FindImage ( filename ) ;
258254 if ( beat < 0f ) {
259255 Logger . Warn ( TAG , "Negative beat value events ignored" ) ;
260256 } else if ( string . IsNullOrEmpty ( filename ) ) {
0 commit comments