SSH Productions: Module documentation for MusicC.zip

Module: Music Continuity 1.2, by SSH

Provide music that continues

Download Music Continuity as a zip file

Author

Andrew MacCormack (SSH)

Please use the PM function on the AGS forums to contact

me about problems with this module

Abstract

Provides continuous music

Dependencies

AGS 2.7 or later: MOD support only in 2.71+

MIDI, MOD, MP3 or OGG music (not WAV)

Functions

The module detects if the "Play music on room load"

is used in a game room and treats the music as continuous.

if you want a room to have non-continuous music, use

the PlayMusic or MusicC.Play with optional second arg

instead of the "Play music on room load".

MusicC.Save();

This function saves where the current playing track is

until next time it is played by this module's play

function. This is called automatically on room exit.

MusicC.Play(track, continuity, keep);

This function will play the numbered music track from

where it was left. Default continuity is to pick up

from the last saved point of that track, but the

optional second parameter can be eMusicCResetIfDiff

to start from beginning unles that track is already

playing, or eMusicCForceReset to always start from the

beginning of the track. The keep setting means that

the module will try and keep the track playing even if

you enter a new room that sets another track. This is

meant for "tension music" that might keep going. To

stop the kept music, using MusicC.Play on another track,

or use MusicC.Restore to return to the music last used

in the room.

MusicC.SPlay(track, continuity, keep);

This function is the same as Play, but does a Save

first.

MusicC.Restore();

Restore the normal music for this room after having a

"kept" track going.

Configuration

By default supports 200 tracks.

Change MUSICC_MAX_TRACKS in this file to increase

Example

   MusicC.SPlay(2);

Caveats

Needs more testing

Revision History

25 Apr 06: v1.0 First release of Music Continuity module

26 Apr 06: v1.01 Made b'ward compatible with 2.7 minus MODs

28 Jul 06: v1.2 Add "keep" functionality

Licence

Music Continuity AGS script module

Copyright (C) 2006 Andrew MacCormack

Permission is hereby granted, free of charge, to any person obtaining a copy

of this software and associated documentation files (the "Software"), to

deal in the Software without restriction, including without limitation the

rights to use, copy, modify, merge, publish, distribute, sublicense, and/or

sell copies of the Software, and to permit persons to whom the Software is

furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in

all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL

THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

DEALINGS IN THE SOFTWARE.

In addition to the licences mentioned in the modules themselves, you may choose to use the following creative commons licence if you prefer for all AGS modules and open source code resources on my site.

Creative Commons License
This work is licenced under a Creative Commons Licence.