Audio tool for Unity
Harmony Class Reference

The Harmony class hub of fonctionnalities. More...

Inherits MonoBehaviour.

Static Public Member Functions

static void Play (AudioSource _source, bool _destroyAfterPlaying=false, float _delay=0)
 Play the source More...
 
static void Pause (AudioSource _source, float _delay=0)
 Pause the source More...
 
static void UnPause (AudioSource _source, float _delay=0)
 UnPause the source More...
 
static void Stop (AudioSource _source, float _delay=0)
 Stop playing the source More...
 
static void StopAll (float _delay=0)
 Stop all the clip which are playing from the source list More...
 
static void StopAllBut (AudioSource _source, float _delay=0)
 Stop all the clip which are playing, except the _source More...
 
static AudioSource SetSource (string _clipName)
 Set an AudioSource and return it More...
 
static void DestroySource (AudioSource _source)
 Destroy the Source More...
 
static void AttachTo (AudioSource _source, Transform _transform)
 Make _transform the parent of the gameobject of _source More...
 
static void ReturnToHarmony (AudioSource _source)
 Make Harmony the new parent of the _source More...
 
static void EnabledPlayList (AudioSource _source, bool _enabled)
 Enable or disable the PlayList mode of a _source More...
 
static void EnabledPlaylistLoop (AudioSource _source, bool _enabled)
 Enable or disable the loop PlayList mode of a _source More...
 
static void EnabledPlaylistRandom (AudioSource _source, bool _enabled)
 Enable of disable the random mode of the playlist of _source More...
 
static void NextClip (AudioSource _source, float _delay=0)
 Set the next clip in the playlist of _source More...
 
static void PreviousClip (AudioSource _source, float _delay=0)
 Set the previous clip in the playlist of _source More...
 
static void SetClipInPlaylist (AudioSource _source, int _clipIndex, float _delay=0)
 Set the _clipIndex clip in the playlist of _source More...
 
static List< AudioClip > GetPlaylist (AudioSource _source)
 Get the Playlist as a list of AudioClip More...
 
static void AddClip (AudioSource _source, AudioClip _clip=null)
 Add the _clip to the Playlist (at the end of) More...
 
static void SubClip (AudioSource _source, AudioClip _clip=null)
 Remove the _clip from the Playlist More...
 
static void DeleteClip (AudioSource _source, AudioClip _clip)
 Remove the _clip from the Playlist More...
 
static void ResetPlaylist (AudioSource _source)
 Clear all the Playlist, then add a null clip More...
 
static void SwapClip (AudioSource _source, AudioClip _clip1, AudioClip _clip2)
 Swap the two clip in the playlist list More...
 
static void SwapUpClip (AudioSource _source, AudioClip _clip)
 Swap the _clip with the clip above More...
 
static void SwapDownClip (AudioSource _source, AudioClip _clip)
 Swap the _clip with the clip below More...
 
static void CleanPlaylist (AudioSource _source)
 Remove all the clip which are null from the playlist More...
 
static void ClearPlaylist (AudioSource _source)
 Reset the playlist but keep the first clip from the playlist More...
 

Detailed Description

The Harmony class hub of fonctionnalities.

This class is use in code by users to manipulate Harmony fonctions

Author
Baptiste Billet, proofreading by Clarisse Blondy
Version
0.1
Date
2016
Precondition
For the first use, you should use the actualize button of the Harmony window in Unity to setup
Bug:
Warning
Beta content here, use carrefully

Member Function Documentation

§ AddClip()

static void Harmony.AddClip ( AudioSource  _source,
AudioClip  _clip = null 
)
static

Add the _clip to the Playlist (at the end of)

Parameters
_sourceThe source of the playlist
_clipThe clip to add

§ AttachTo()

static void Harmony.AttachTo ( AudioSource  _source,
Transform  _transform 
)
static

Make _transform the parent of the gameobject of _source

Parameters
_sourceThe AudioSource
_transformThe new parent

§ CleanPlaylist()

static void Harmony.CleanPlaylist ( AudioSource  _source)
static

Remove all the clip which are null from the playlist

Parameters
_sourceThe source of the playlist

§ ClearPlaylist()

static void Harmony.ClearPlaylist ( AudioSource  _source)
static

Reset the playlist but keep the first clip from the playlist

Parameters
_sourceThe source of the playlist

§ DeleteClip()

static void Harmony.DeleteClip ( AudioSource  _source,
AudioClip  _clip 
)
static

Remove the _clip from the Playlist

Note
Only the first one found
Parameters
_sourceThe source of the playlist
_clipThe clip to delete

§ DestroySource()

static void Harmony.DestroySource ( AudioSource  _source)
static

Destroy the Source

Parameters
_source

§ EnabledPlayList()

static void Harmony.EnabledPlayList ( AudioSource  _source,
bool  _enabled 
)
static

Enable or disable the PlayList mode of a _source

Parameters
_sourceThe source to change
_enabledEnable the Playlist mode

§ EnabledPlaylistLoop()

static void Harmony.EnabledPlaylistLoop ( AudioSource  _source,
bool  _enabled 
)
static

Enable or disable the loop PlayList mode of a _source

Parameters
_sourceThe source to change
_enabledEnable the Playlist Loop mode

§ EnabledPlaylistRandom()

static void Harmony.EnabledPlaylistRandom ( AudioSource  _source,
bool  _enabled 
)
static

Enable of disable the random mode of the playlist of _source

Parameters
_sourceThe source to change
_enabledEnable or disable

§ GetPlaylist()

static List<AudioClip> Harmony.GetPlaylist ( AudioSource  _source)
static

Get the Playlist as a list of AudioClip

Parameters
_sourceThe source of the playlist
_clipIndexThe index of the clip to set
_delayThe action can be delayed

§ NextClip()

static void Harmony.NextClip ( AudioSource  _source,
float  _delay = 0 
)
static

Set the next clip in the playlist of _source

Parameters
_sourceThe source to set the next clip
_delayThe action can be delayed

§ Pause()

static void Harmony.Pause ( AudioSource  _source,
float  _delay = 0 
)
static

Pause the source

Parameters
_sourceThe AudioSource of the wanted clip
_delayDelay before proceed

§ Play()

static void Harmony.Play ( AudioSource  _source,
bool  _destroyAfterPlaying = false,
float  _delay = 0 
)
static

Play the source

Parameters
_sourceThe AudioSource of the wanted clip
_destroyAfterPlayingIf the source gameobject must destroy itself after playing
_delayDelay before proceed

§ PreviousClip()

static void Harmony.PreviousClip ( AudioSource  _source,
float  _delay = 0 
)
static

Set the previous clip in the playlist of _source

Parameters
_sourceThe source to set the previous clip
_delayThe action can be delayed

§ ResetPlaylist()

static void Harmony.ResetPlaylist ( AudioSource  _source)
static

Clear all the Playlist, then add a null clip

Parameters
_sourceThe source of the playlist

§ ReturnToHarmony()

static void Harmony.ReturnToHarmony ( AudioSource  _source)
static

Make Harmony the new parent of the _source

Parameters
_sourceThe source

§ SetClipInPlaylist()

static void Harmony.SetClipInPlaylist ( AudioSource  _source,
int  _clipIndex,
float  _delay = 0 
)
static

Set the _clipIndex clip in the playlist of _source

Parameters
_sourceThe source to setclip
_clipIndexThe index of the clip to set
_delayThe action can be delayed

§ SetSource()

static AudioSource Harmony.SetSource ( string  _clipName)
static

Set an AudioSource and return it

Parameters
_clipNameThe clip name to research
Returns

§ Stop()

static void Harmony.Stop ( AudioSource  _source,
float  _delay = 0 
)
static

Stop playing the source

Parameters
_sourceThe AudioSource of the wanted clip
_delayDelay before proceed

§ StopAll()

static void Harmony.StopAll ( float  _delay = 0)
static

Stop all the clip which are playing from the source list

Parameters
_delayDelay before proceed

§ StopAllBut()

static void Harmony.StopAllBut ( AudioSource  _source,
float  _delay = 0 
)
static

Stop all the clip which are playing, except the _source

Parameters
_sourceThe AudioSource of the wanted clip
_delayDelay before proceed

§ SubClip()

static void Harmony.SubClip ( AudioSource  _source,
AudioClip  _clip = null 
)
static

Remove the _clip from the Playlist

Note
Only the first one found
If the _clip is null, remove the last one on the Playlist
Parameters
_sourceThe source of the playlist
_clipThe clip to sub

§ SwapClip()

static void Harmony.SwapClip ( AudioSource  _source,
AudioClip  _clip1,
AudioClip  _clip2 
)
static

Swap the two clip in the playlist list

Note
If one of the clip is currently played in the playlist, it will continue playing
The next clip to be played will be the next on the list from the ancient index of the current clip
Parameters
_sourceThe source of the playlist
_clip1The first clip to swap
_clip2The second clip to swap

§ SwapDownClip()

static void Harmony.SwapDownClip ( AudioSource  _source,
AudioClip  _clip 
)
static

Swap the _clip with the clip below

Parameters
_sourceThe source of the playlist
_clipThe clip to swap

§ SwapUpClip()

static void Harmony.SwapUpClip ( AudioSource  _source,
AudioClip  _clip 
)
static

Swap the _clip with the clip above

Parameters
_sourceThe source of the playlist
_clipThe clip to swap

§ UnPause()

static void Harmony.UnPause ( AudioSource  _source,
float  _delay = 0 
)
static

UnPause the source

Parameters
_sourceThe AudioSource of the wanted clip
_delayDelay before proceed

The documentation for this class was generated from the following file: