forked from Baystation12/Baystation12
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIRROR] tiny cleanup pass on jukebox datum, audio singleton (#2863)
Co-authored-by: Spookerton <[email protected]> Co-authored-by: Lexanx <[email protected]>
- Loading branch information
1 parent
0fb5a09
commit 3a0065b
Showing
10 changed files
with
73 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,50 @@ | ||
/singleton/audio | ||
var/source //Path to file source | ||
var/display //A display title we use in the game | ||
var/volume //If present, a `normal` volume | ||
var/title //The real title | ||
/// Path to file source | ||
var/source | ||
|
||
/// The real (ie, artist's) audio title | ||
var/title | ||
|
||
/// The display title to use in game, if different | ||
var/display | ||
|
||
/// The normal volume to play the audio at, if set | ||
var/volume | ||
|
||
/// The artist's name | ||
var/author | ||
|
||
/// The collection (eg album) the audio belongs to | ||
var/collection | ||
var/singleton/license/license | ||
var/url | ||
|
||
/// The license under which the audio was made available | ||
var/singleton/license/license | ||
|
||
//Repository scopes | ||
/singleton/audio/effect | ||
/singleton/audio/track | ||
/// A link to the audio's source, if available | ||
var/url | ||
|
||
|
||
/singleton/audio/New() | ||
/singleton/audio/Initialize() | ||
. = ..() | ||
license = GET_SINGLETON(license) | ||
|
||
|
||
/singleton/audio/VV_static() | ||
return ..() + vars | ||
|
||
|
||
/singleton/audio/proc/get_info(with_meta = TRUE) | ||
. = SPAN_GOOD("[title][!author?"":" by [author]"][!collection?"":" ([collection])"]") | ||
if (with_meta) | ||
. = "[.][!url?"":"\[<a href='[url]'>link</a>\]"]\[<a href='[license.url]'>license</a>\]" | ||
|
||
|
||
/singleton/audio/proc/get_sound(channel) | ||
var/sound/S = sound(source, FALSE, FALSE, channel, volume || 100) | ||
return S | ||
var/sound/sound = sound(source, FALSE, FALSE, channel, volume || 100) | ||
return sound | ||
|
||
|
||
/singleton/audio/track/get_sound(channel = GLOB.lobby_sound_channel) | ||
var/sound/S = ..() | ||
S.repeat = TRUE | ||
return S | ||
var/sound/sound = ..() | ||
sound.repeat = TRUE | ||
return sound |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters