Guest User

Untitled

a guest
Mar 18th, 2025
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.66 KB | None | 0 0
  1. /// <summary>
  2. /// Defines the methods an audio player class should implement.
  3. /// </summary>
  4. public interface IPlayer: IDisposable
  5. {
  6.     /// <summary>
  7.     /// Gets or sets a value indicating whether the audio player is playing.
  8.     /// </summary>
  9.     EPlayerStatus PlayerStatus { get; set; }
  10.  
  11.     /// <summary>
  12.     /// Gets or sets the last file opened by the player.
  13.     /// </summary>
  14.     string LastFileOpened { get; set; }
  15.  
  16.     /// <summary>
  17.     /// Method to play audio.
  18.     /// </summary>
  19.     /// <param name="stream">The audio stream.</param>
  20.     void Play(Stream stream);
  21.    
  22.     /// <summary>
  23.     /// Method to play or pause depending on state.
  24.     /// </summary>
  25.     void PlayPause();
  26.    
  27.     /// <summary>
  28.     /// Method to stop audio playback.
  29.     /// </summary>
  30.     void Stop();
  31.  
  32.     /// <summary>
  33.     /// Method to increase audio playback volume.
  34.     /// </summary>
  35.     void IncreaseVolume();
  36.  
  37.     /// <summary>
  38.     /// Method to decrease audio playback volume.
  39.     /// </summary>
  40.     void DecreaseVolume();
  41.  
  42.     /// <summary>
  43.     /// Returns the current playtime of the audioFileReader instance.
  44.     /// </summary>
  45.     /// <returns>The current time played as TimeSpan.</returns>
  46.     float CurrentTime();
  47.  
  48.     /// <summary>
  49.     /// Returns the total track length in timespan format.
  50.     /// </summary>
  51.     /// <returns>The length of the track in timespan format.</returns>
  52.     float TrackLength();
  53.  
  54.     /// <summary>
  55.     /// Skip ahead in the audio file 5s.
  56.     /// </summary>
  57.     public void SeekForward();
  58.  
  59.     /// <summary>
  60.     /// Skip back in the audio file 5s.
  61.     /// </summary>
  62.     public void SeekBackwards();
  63. }
Advertisement
Add Comment
Please, Sign In to add comment