@@ -22,7 +22,6 @@ public class Settings
2222
2323 public static List < string > MidiPaths { get { return _midiPaths ; } }
2424
25-
2625 private static List < string > _soundFontsPaths = new ( )
2726 {
2827 Path . Combine ( Path . GetDirectoryName ( Environment . ProcessPath ) , "SoundFonts" ) ,
@@ -70,9 +69,20 @@ public enum Themes
7069
7170 public static void SetMidiPaths ( List < string > paths )
7271 {
72+ if ( paths . Count == 0 )
73+ return ;
74+
7375 _midiPaths = paths ;
7476 }
7577
78+ public static void SetSoundFontsPaths ( List < string > paths )
79+ {
80+ if ( paths . Count == 0 )
81+ return ;
82+
83+ _soundFontsPaths = paths ;
84+ }
85+
7686 public static void SetKeyboardInput ( bool onoff )
7787 {
7888 _keyboardInput = onoff ;
@@ -346,11 +356,11 @@ public static void Render()
346356 ImGui . EndTable ( ) ;
347357
348358 ImGui . SetCursorPosX ( ImGui . GetContentRegionAvail ( ) . X - 100 * FontController . DSF ) ;
349- if ( ImGui . Button ( FontAwesome6 . FolderPlus , new Vector2 ( 100 , 50 ) * FontController . DSF ) )
359+ if ( ImGui . Button ( $ " { FontAwesome6 . FolderPlus } ##addMidiPath" , new Vector2 ( 100 , 50 ) * FontController . DSF ) )
350360 {
351361 var dlg = new FolderPicker ( ) ;
352362 dlg . InputPath = "C:\\ " ;
353- if ( dlg . ShowDialog ( Program . _window . SdlWindowHandle ) == true )
363+ if ( dlg . ShowDialog ( Program . _window . Handle ) == true )
354364 {
355365 if ( _midiPaths . Contains ( dlg . ResultPath ) )
356366 {
@@ -435,11 +445,11 @@ public static void Render()
435445 ImGui . EndTable ( ) ;
436446
437447 ImGui . SetCursorPosX ( ImGui . GetContentRegionAvail ( ) . X - 100 * FontController . DSF ) ;
438- if ( ImGui . Button ( $ "{ FontAwesome6 . Folder } ", new Vector2 ( 100 , 50 ) * FontController . DSF ) )
448+ if ( ImGui . Button ( $ "{ FontAwesome6 . FolderPlus } ##addSoundPath ", new Vector2 ( 100 , 50 ) * FontController . DSF ) )
439449 {
440450 var dlg = new FolderPicker ( ) ;
441451 dlg . InputPath = "C:\\ " ;
442- if ( dlg . ShowDialog ( Program . _window . SdlWindowHandle ) == true )
452+ if ( dlg . ShowDialog ( Program . _window . Handle ) == true )
443453 {
444454 if ( _soundFontsPaths . Contains ( dlg . ResultPath ) )
445455 {
0 commit comments