mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 18:02:16 +00:00
Add audio.setvol command for setting track volume
This commit is contained in:
parent
abfd774638
commit
11f838ea23
2 changed files with 19 additions and 1 deletions
|
@ -51,7 +51,11 @@ namespace ShiftOS.Engine
|
|||
t.Start();
|
||||
}
|
||||
|
||||
|
||||
public static void SetVolume(float volume)
|
||||
{
|
||||
_provider.Volume = volume; //persist between songs
|
||||
_out.Volume = volume;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IAudioProvider
|
||||
|
|
|
@ -44,6 +44,20 @@ using ShiftOS.Objects.ShiftFS;
|
|||
|
||||
namespace ShiftOS.Engine
|
||||
{
|
||||
[Namespace("audio")]
|
||||
public static class AudioCommands
|
||||
{
|
||||
[Command("setvol", description = "Set the volume of the system audio to anywhere between 0 and 100.")]
|
||||
[RequiresArgument("value")]
|
||||
public static bool SetVolume(Dictionary<string,object> args)
|
||||
{
|
||||
int val = Convert.ToInt32(args["value"].ToString());
|
||||
float volume = (val / 100F);
|
||||
AudioManager.SetVolume(volume);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[RequiresUpgrade("mud_fundamentals")]
|
||||
[Namespace("mud")]
|
||||
public static class MUDCommands
|
||||
|
|
Loading…
Reference in a new issue