home *** CD-ROM | disk | FTP | other *** search
- class net.onepixelout.audio.Track
- {
- var _soundObject;
- var _src;
- var _isLoaded;
- var _isFullyLoaded;
- var _id3Loaded;
- var _notFound;
- var _id3Tags;
- function Track(src, title, artist)
- {
- this._soundObject = new Sound();
- this._src = src;
- this._isLoaded = false;
- this._isFullyLoaded = false;
- this._id3Loaded = false;
- this._notFound = false;
- this._id3Tags = new Object();
- if(title != undefined && artist != undefined)
- {
- this._id3Tags.songname = title;
- this._id3Tags.artist = artist;
- this._id3Loaded = true;
- }
- }
- function setTitle(title)
- {
- this._id3Tags.songname = title;
- this._id3Loaded = true;
- }
- function setArtist(artist)
- {
- this._id3Tags.artist = artist;
- this._id3Loaded = true;
- }
- function load(checkPolicy)
- {
- if(!this._isLoaded)
- {
- this._soundObject.onLoad = mx.utils.Delegate.create(this,function(success)
- {
- this._notFound = !success;
- this._isFullyLoaded = success;
- }
- );
- this._soundObject.checkPolicyFile = checkPolicy;
- this._soundObject.loadSound(this._src,true);
- this._isLoaded = true;
- }
- return this._soundObject;
- }
- function unLoad()
- {
- if(!this._isFullyLoaded)
- {
- delete this._soundObject;
- this._isLoaded = false;
- this._soundObject = new Sound();
- }
- }
- function isFullyLoaded()
- {
- return this._isFullyLoaded;
- }
- function isLoaded()
- {
- return this._isLoaded;
- }
- function exists()
- {
- return !this._notFound;
- }
- function isID3Loaded()
- {
- return this._id3Loaded;
- }
- function setInfo()
- {
- this._id3Tags = this._soundObject.id3;
- this._id3Loaded = true;
- }
- function getInfo()
- {
- return this._id3Tags;
- }
- }
-