All Downloads are FREE. Search and download functionalities are using the official Maven repository.

indigo.shared.scenegraph.SceneAudioSource.scala Maven / Gradle / Ivy

The newest version!
package indigo.shared.scenegraph

import indigo.shared.audio.Volume
import indigo.shared.datatypes.BindingKey

/** Represents a single audio source, how it is being played, and at what volume. You could implement a cross fade
  * between two audio sources.
  */
final case class SceneAudioSource(bindingKey: BindingKey, playbackPattern: PlaybackPattern, masterVolume: Volume)
    derives CanEqual:
  val volume: Volume =
    playbackPattern match
      case PlaybackPattern.SingleTrackLoop(track) => track.volume

object SceneAudioSource:
  def apply(bindingKey: BindingKey, playbackPattern: PlaybackPattern): SceneAudioSource =
    SceneAudioSource(bindingKey, playbackPattern, Volume.Max)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy