-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HowlGlobal Volume (With example) #19
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Volume(...)
method should also be added to the https://github.com/StefH/Howler.Blazor/blob/master/src/Howler.Blazor/Components/IHowl.cs to enable setting the volume for a specific sound.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some more requested changes...
@@ -47,12 +47,25 @@ | |||
<td><button class="btn btn-primary oi oi-arrow-bottom" @onclick="SpeedDown"></button></td> | |||
<td>Speed Down</td> | |||
</tr> | |||
<tr> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -245,4 +261,24 @@ | |||
await Howl.Pause(id); | |||
} | |||
} | |||
private async Task VolumeUp() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a new line before this method
private async Task VolumeUp() | ||
{ | ||
Volume += 0.1; | ||
// await HowlGlobal.Volume(Volume); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe keep the await HowlGlobal.Volume(Volume);
and put the foreach loop in comment?
@@ -105,6 +105,11 @@ public ValueTask<bool> IsPlaying(int soundId) | |||
return _runtime.InvokeAsync<bool>("howl.getIsPlaying", soundId); | |||
} | |||
|
|||
public ValueTask<double> Volume(double volume, int soundId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
soundId should be first argument
@@ -48,6 +48,8 @@ public interface IHowl : IHowlEvents | |||
ValueTask<TimeSpan> GetTotalTime(int soundId); | |||
|
|||
ValueTask<bool> IsPlaying(int soundId); | |||
ValueTask<double> Volume(double volume, int soundId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a newline before
@@ -48,6 +48,8 @@ public interface IHowl : IHowlEvents | |||
ValueTask<TimeSpan> GetTotalTime(int soundId); | |||
|
|||
ValueTask<bool> IsPlaying(int soundId); | |||
ValueTask<double> Volume(double volume, int soundId); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove newline after
@@ -17,5 +17,6 @@ public interface IHowlGlobal | |||
ValueTask<string[]> GetCodecs(); | |||
|
|||
ValueTask<bool> IsCodecSupported(string? extension); | |||
ValueTask Volume(double volume); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add new line before
return howl.volume(volume, id); | ||
} | ||
|
||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't return 0 here, that is not needed
@grierson |
Hello @grierson ; did you have time to take a look at my code review comments? |
No description provided.