Skip to content

Commit

Permalink
IAudioManager add MusicVolume and program save MusicVolume/SoundVolume
Browse files Browse the repository at this point in the history
  • Loading branch information
MikiraSora committed Oct 11, 2024
1 parent 4a4e685 commit 19b7692
Show file tree
Hide file tree
Showing 9 changed files with 258 additions and 175 deletions.
6 changes: 6 additions & 0 deletions OngekiFumenEditor/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@
<setting name="AudioSampleRate" serializeAs="String">
<value>48000</value>
</setting>
<setting name="MusicVolume" serializeAs="String">
<value>1</value>
</setting>
<setting name="SoundVolume" serializeAs="String">
<value>1</value>
</setting>
</OngekiFumenEditor.Properties.AudioSetting>
<OngekiFumenEditor.Properties.OptionGeneratorToolsSetting>
<setting name="LastLoadedGameFolder" serializeAs="String">
Expand Down
3 changes: 2 additions & 1 deletion OngekiFumenEditor/Kernel/Audio/IAudioManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ namespace OngekiFumenEditor.Kernel.Audio
public partial interface IAudioManager : IDisposable
{
float SoundVolume { get; set; }
float MusicVolume { get; set; }

Task<ISoundPlayer> LoadSoundAsync(string filePath);
Task<ISoundPlayer> LoadSoundAsync(string filePath);
Task<IAudioPlayer> LoadAudioAsync(string filePath);

IEnumerable<(string fileExt, string extDesc)> SupportAudioFileExtensionList { get; }
Expand Down
10 changes: 6 additions & 4 deletions OngekiFumenEditor/Kernel/Audio/IAudioPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ public interface IAudioPlayer : IDisposable, INotifyPropertyChanged
/// </summary>
float Speed { get; set; }

/* control by IAudioManager
/// <summary>
/// 音量,0~1
/// </summary>
float Volume { get; set; }
*/

/// <summary>
/// 总长度,毫秒
/// </summary>
TimeSpan Duration { get; }
/// <summary>
/// 总长度,毫秒
/// </summary>
TimeSpan Duration { get; }

/// <summary>
/// 是否正在播放
Expand Down
Loading

0 comments on commit 19b7692

Please sign in to comment.