@@ -12,13 +12,22 @@ namespace NetCoreAudio.Players
1212 internal class WindowsPlayer : IPlayer
1313 {
1414 [ DllImport ( "winmm.dll" ) ]
15- private static extern int mciSendString ( string command , StringBuilder stringReturn , int returnLength , IntPtr hwndCallback ) ;
15+ private static extern int mciSendString (
16+ string command ,
17+ StringBuilder stringReturn ,
18+ int returnLength ,
19+ IntPtr hwndCallback ) ;
1620
1721 [ DllImport ( "winmm.dll" ) ]
18- private static extern int mciGetErrorString ( int errorCode , StringBuilder errorText , int errorTextSize ) ;
22+ private static extern int mciGetErrorString (
23+ int errorCode ,
24+ StringBuilder errorText ,
25+ int errorTextSize ) ;
1926
2027 [ DllImport ( "winmm.dll" ) ]
21- public static extern int waveOutSetVolume ( IntPtr hwo , uint dwVolume ) ;
28+ public static extern int waveOutSetVolume (
29+ IntPtr hwo ,
30+ uint dwVolume ) ;
2231
2332 private Timer _playbackTimer ;
2433 private Stopwatch _playStopwatch ;
@@ -108,7 +117,8 @@ private Task ExecuteMsiCommand(string commandString)
108117
109118 if ( result != 0 )
110119 {
111- var errorSb = new StringBuilder ( $ "Error executing MCI command '{ commandString } '. Error code: { result } .") ;
120+ var errorSb = new StringBuilder (
121+ $ "Error executing MCI command '{ commandString } '. Error code: { result } .") ;
112122 var sb2 = new StringBuilder ( 128 ) ;
113123
114124 mciGetErrorString ( result , sb2 , 128 ) ;
@@ -117,7 +127,9 @@ private Task ExecuteMsiCommand(string commandString)
117127 throw new Exception ( errorSb . ToString ( ) ) ;
118128 }
119129
120- if ( commandString . ToLower ( ) . StartsWith ( "status" ) && int . TryParse ( sb . ToString ( ) , out var length ) )
130+ if ( commandString . ToLower ( )
131+ . StartsWith ( "status" ) &&
132+ int . TryParse ( sb . ToString ( ) , out var length ) )
121133 _playbackTimer . Interval = length ;
122134
123135 return Task . CompletedTask ;
@@ -128,7 +140,8 @@ public Task SetVolume(byte percent)
128140 // Calculate the volume that's being set
129141 int NewVolume = ushort . MaxValue / 100 * percent ;
130142 // Set the same volume for both the left and the right channels
131- uint NewVolumeAllChannels = ( ( uint ) NewVolume & 0x0000ffff ) | ( ( uint ) NewVolume << 16 ) ;
143+ uint NewVolumeAllChannels =
144+ ( ( uint ) NewVolume & 0x0000ffff ) | ( ( uint ) NewVolume << 16 ) ;
132145 // Set the volume
133146 waveOutSetVolume ( IntPtr . Zero , NewVolumeAllChannels ) ;
134147
0 commit comments