Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

commit to avoid losing it all! this is a mess!

  • Loading branch information...
commit 5b1fc61e9a98e1969126ae1517c4c899bdfad650 0 parents
Seon-Wook Park authored November 08, 2011

Showing 48 changed files with 8,630 additions and 0 deletions. Show diff stats Hide diff stats

  1. 11  LICENSE
  2. 13  Plasma.as
  3. 13  Scripts/Anim.as
  4. 45  Scripts/Anim/BasicTween.as
  5. 20  Scripts/Anim/Common.as
  6. 63  Scripts/Anim/Loop.as
  7. 53  Scripts/Anim/TextField.as
  8. 60  Scripts/Anim/Tween.as
  9. 22  Scripts/Core.as
  10. 186  Scripts/Core/Data.as
  11. 93  Scripts/Core/Display.as
  12. 80  Scripts/Core/Init.as
  13. 123  Scripts/Core/JetEffect.as
  14. 123  Scripts/Core/Key.as
  15. 193  Scripts/Core/Mode.as
  16. 98  Scripts/Core/Music.as
  17. 56  Scripts/Core/System.as
  18. 56  Scripts/Core/Time.as
  19. 81  Scripts/Core/Utility.as
  20. 107  Scripts/Core/Volume.as
  21. 14  Scripts/Cowon.as
  22. 1,411  Scripts/Cowon/C2.as
  23. 8  Scripts/Cowon/Common.as
  24. 1,573  Scripts/Cowon/J3.as
  25. 1,409  Scripts/Cowon/S9.as
  26. 1,392  Scripts/Cowon/X7.as
  27. 950  Scripts/Cowon/i9.as
  28. 12  Scripts/Launcher.as
  29. 8  Scripts/Launcher/Loader.as
  30. 25  Scripts/Launcher/Plasmoid.as
  31. 8  Scripts/Launcher/Switcher.as
  32. 20  Scripts/Music.as
  33. 58  Scripts/Music/A-B.as
  34. 15  Scripts/Music/Bookmark.as
  35. 14  Scripts/Music/Favorite.as
  36. 180  Scripts/Music/Playback.as
  37. 37  Scripts/Music/Settings.as
  38. BIN  launcher_240x320/240x320.jpg
  39. BIN  launcher_240x320/240x320.png
  40. BIN  launcher_240x320/launcher.fla
  41. BIN  launcher_272x480/272x480.jpg
  42. BIN  launcher_272x480/272x480.png
  43. BIN  launcher_272x480/launcher.fla
  44. BIN  launcher_272x480/launcher.swf
  45. BIN  launcher_272x480/launcher_Scene 1.swf
  46. BIN  launcher_320x240/320x240.jpg
  47. BIN  launcher_320x240/320x240.png
  48. BIN  launcher_320x240/launcher.fla
11  LICENSE
... ...
@@ -0,0 +1,11 @@
  1
+This work is licensed under the Creative
  2
+Commons Attribution-ShareAlike 3.0 Unported
  3
+License. To view a copy of this license, visit
  4
+http://creativecommons.org/licenses/by-sa/3.0/
  5
+or send a letter to
  6
+
  7
+Creative Commons,
  8
+444 Castro Street,
  9
+Suite 900, Mountain View,
  10
+California, 94041,
  11
+USA.
13  Plasma.as
... ...
@@ -0,0 +1,13 @@
  1
+/*
  2
+ *    _____         _______ _______ _______ _______
  3
+ *   |_____] |      |_____| |______ |  |  | |_____|
  4
+ *   |       |_____ |     | ______| |  |  | |     |
  5
+ *
  6
+ *   Plasma.as - File to #include on stage
  7
+ */
  8
+
  9
+#include "./Scripts/Core.as"
  10
+#include "./Scripts/Music.as"
  11
+#include "./Scripts/Anim.as"
  12
+#include "./Scripts/Launcher.as"
  13
+#include "./Scripts/Cowon.as"
13  Scripts/Anim.as
... ...
@@ -0,0 +1,13 @@
  1
+/*
  2
+ *    _____         _______ _______ _______ _______
  3
+ *   |_____] |      |_____| |______ |  |  | |_____|
  4
+ *   |       |_____ |     | ______| |  |  | |     |
  5
+ *
  6
+ *   Anim.as - All Animations
  7
+ */
  8
+
  9
+#include "./Anim/Common.as"
  10
+#include "./Anim/Tween.as"
  11
+#include "./Anim/BasicTween.as"
  12
+#include "./Anim/Loop.as"
  13
+#include "./Anim/TextField.as"
45  Scripts/Anim/BasicTween.as
... ...
@@ -0,0 +1,45 @@
  1
+/*
  2
+ *    _____         _______ _______ _______ _______
  3
+ *   |_____] |      |_____| |______ |  |  | |_____|
  4
+ *   |       |_____ |     | ______| |  |  | |     |
  5
+ *
  6
+ *   Anim/BasicTween.as - Basic Tween Management
  7
+ */
  8
+
  9
+Anim.addProperty( "Speed",
  10
+				  function ():Number {
  11
+					  var setting:Number = Data.Get( "AnimSpeed" );
  12
+					  if ( isNaN( setting ) ) {
  13
+						  Data.Set( "AnimSpeed", 1 );
  14
+						  setting = 1;
  15
+					  }
  16
+					  return setting;
  17
+				  },
  18
+				  function ():Void {} );
  19
+
  20
+Anim.TweenTo = function ( mc:MovieClip, property:String, target:Number,
  21
+						  speed:Number, ease:Function ):Void {
  22
+	speed = ( isNaN( speed ) ) ? 1.0 : speed;
  23
+	var dur:Number = speed * Anim.Speed;
  24
+	Anim.Tween( mc, property, ease, mc[ property ], target, dur );
  25
+}
  26
+
  27
+Anim.FadeTo = function ( mc:MovieClip, targetalpha:Number, speed:Number ) {
  28
+	if ( isNaN( targetalpha ) || targetalpha < 0 || targetalpha > 100 )
  29
+		targetalpha = 0;
  30
+	speed = ( isNaN( speed ) ) ? 1.0 : speed;
  31
+	Anim.TweenTo( mc, "_alpha", targetalpha );
  32
+}
  33
+
  34
+Anim.FadeIn = function ( mc:MovieClip, speed:Number ) {
  35
+	speed = ( isNaN( speed ) ) ? 1.0 : speed;
  36
+	mc._alpha = 0;
  37
+	Anim.TweenTo( mc, "_alpha", 100, speed );
  38
+}
  39
+
  40
+Anim.FadeOut = function ( mc:MovieClip, speed:Number ) {
  41
+	speed = ( isNaN( speed ) ) ? 1.0 : speed;
  42
+	mc._alpha = 100;
  43
+	Anim.TweenTo( mc, "_alpha", 0, speed );
  44
+}
  45
+
20  Scripts/Anim/Common.as
... ...
@@ -0,0 +1,20 @@
  1
+/*
  2
+ *    _____         _______ _______ _______ _______
  3
+ *   |_____] |      |_____| |______ |  |  | |_____|
  4
+ *   |       |_____ |     | ______| |  |  | |     |
  5
+ *
  6
+ *   Anim/Common.as - Common Methods and Other Methods
  7
+ */
  8
+
  9
+
  10
+import mx.transitions.easing.*;
  11
+
  12
+var Anim:Object = {};
  13
+
  14
+Anim.Stop = function ( mc:MovieClip ):Void {
  15
+	Anim.StopTween( mc );
  16
+	Anim.StopLoop( mc );
  17
+}
  18
+
  19
+
  20
+
63  Scripts/Anim/Loop.as
... ...
@@ -0,0 +1,63 @@
  1
+/*
  2
+ *    _____         _______ _______ _______ _______
  3
+ *   |_____] |      |_____| |______ |  |  | |_____|
  4
+ *   |       |_____ |     | ______| |  |  | |     |
  5
+ *
  6
+ *   Anim/Loop.as - Looping Functionality
  7
+ */
  8
+
  9
+Anim.BeingLooped = {};
  10
+
  11
+Anim.Loop = function ( mc:MovieClip, prop:String, easing:Function,
  12
+						startval:Number, endval:Number, duration:Number ):Void {
  13
+	var idx:String = mc._name +"."+ prop;
  14
+	if ( Anim.BeingLooped[ idx ] != undefined )
  15
+		delete Anim.BeingLooped[ idx ];
  16
+
  17
+	mc[ prop ] = startval;
  18
+	mc._visible = true;
  19
+	var change:Number = endval - startval;
  20
+	Anim.BeingLooped[ idx ] = {
  21
+		idx: idx,
  22
+		t: 0,
  23
+		last_t: Time.Ticks,
  24
+		mc: mc,
  25
+		prop: prop,
  26
+		begin: startval,
  27
+		change: change,
  28
+		end: endval,
  29
+		easing: ( easing ) ? easing : None.easeInOut,
  30
+		duration: duration * 1000,
  31
+		direction: 1
  32
+	};
  33
+}
  34
+
  35
+Anim.ProcessLoop = function ( loop:Object ):Void {
  36
+	if ( !loop.mc || !loop.mc._visible ) return;
  37
+
  38
+	loop.t += Time.Ticks - loop.last_t;
  39
+	loop.last_t = Time.Ticks;
  40
+	if ( loop.t >= loop.duration ) {
  41
+		loop.direction = -loop.direction;
  42
+		loop.t = 0;
  43
+	}
  44
+	loop.mc[ loop.prop ] = loop.easing( loop.t, ( loop.direction > 0 ) ? loop.begin : loop.end,
  45
+										loop.direction * loop.change, loop.duration );
  46
+}
  47
+
  48
+Anim.StopLoop = function ( mc:MovieClip ):Void {
  49
+	var match:String;
  50
+	for ( var idx:String in Anim.BeingLooped ) {
  51
+		match = idx.substr( 0, idx.lastIndexOf( "." ) );
  52
+		if ( match == mc._name )
  53
+			delete Anim.BeingLooped[ idx ];
  54
+	}
  55
+}
  56
+
  57
+Do_Periodic( 1, function ():Void {
  58
+	var loop:Object;
  59
+	for ( var idx:String in Anim.BeingLooped ) {
  60
+		loop = Anim.BeingLooped[ idx ];
  61
+		Anim.ProcessLoop( loop );
  62
+	}
  63
+} );
53  Scripts/Anim/TextField.as
... ...
@@ -0,0 +1,53 @@
  1
+/*
  2
+ *    _____         _______ _______ _______ _______
  3
+ *   |_____] |      |_____| |______ |  |  | |_____|
  4
+ *   |       |_____ |     | ______| |  |  | |     |
  5
+ *
  6
+ *   Anim/TextField.as - TextField Animations
  7
+ */
  8
+
  9
+Anim.TextScrollList = {};
  10
+
  11
+Anim.TextScroll = function ( tf:TextField ):Void {
  12
+	var idx:String = tf._name;
  13
+	var max:Number = tf.maxhscroll;
  14
+	Anim.StopTextScroll( tf );
  15
+
  16
+	Anim.TextScrollList[ idx ] = {
  17
+		idx: tf._name,
  18
+		t: 0,
  19
+		last_t: Time.Ticks,
  20
+		tf: tf,
  21
+		duration: max * 100,
  22
+		direction: 1
  23
+	};
  24
+}
  25
+
  26
+Anim.ProcessTextScroll = function ( loop:Object ):Void {
  27
+	if ( !loop.tf ) delete Anim.TextScrollList[ loop.idx ];
  28
+	if ( !loop.tf._visible ) return;
  29
+	var max:Number = loop.tf.maxhscroll;
  30
+	if ( max == 0 ) return;
  31
+	loop.end = max;
  32
+
  33
+	loop.t += Time.Ticks - loop.last_t;
  34
+	loop.last_t = Time.Ticks;
  35
+	if ( loop.t >= loop.duration ) {
  36
+		loop.direction = -loop.direction;
  37
+		loop.t = 0;
  38
+	}
  39
+	loop.tf.hscroll = None.easeInOut( loop.t, ( loop.direction > 0 ) ? 0 : max,
  40
+									  loop.direction * max, loop.duration );
  41
+}
  42
+
  43
+Anim.StopTextScroll = function ( tf:TextField ):Void {
  44
+	delete Anim.TextScrollList[ tf._name ];
  45
+}
  46
+
  47
+Do_Periodic( 1, function ():Void {
  48
+	var loop:Object;
  49
+	for ( var idx:String in Anim.TextScrollList ) {
  50
+		loop = Anim.TextScrollList[ idx ];
  51
+		Anim.ProcessTextScroll( loop );
  52
+	}
  53
+} );
60  Scripts/Anim/Tween.as
... ...
@@ -0,0 +1,60 @@
  1
+/*
  2
+ *    _____         _______ _______ _______ _______
  3
+ *   |_____] |      |_____| |______ |  |  | |_____|
  4
+ *   |       |_____ |     | ______| |  |  | |     |
  5
+ *
  6
+ *   Anim/Tween.as - Tweening Functionality
  7
+ */
  8
+
  9
+Anim.BeingTweened = {};
  10
+
  11
+Anim.Tween = function ( mc:MovieClip, prop:String, easing:Function,
  12
+						startval:Number, endval:Number, duration:Number ):Void {
  13
+	var idx:String = mc._name +"."+ prop;
  14
+	if ( Anim.BeingTweened[ idx ] != undefined )
  15
+		delete Anim.BeingTweened[ idx ];
  16
+
  17
+	mc[ prop ] = startval;
  18
+	mc._visible = true;
  19
+	var change:Number = endval - startval;
  20
+	Anim.BeingTweened[ idx ] = {
  21
+		idx: idx,
  22
+		start_t: Time.Ticks,
  23
+		mc: mc,
  24
+		prop: prop,
  25
+		begin: startval,
  26
+		change: change,
  27
+		end: endval,
  28
+		easing: ( easing ) ? easing : None.easeInOut,
  29
+		duration: duration * 1000
  30
+	};
  31
+}
  32
+
  33
+Anim.ProcessTween = function ( tween:Object ):Void {
  34
+	if ( !tween.mc || !tween.mc._visible ) Anim.StopTween( tween.mc );
  35
+
  36
+	var t:Number = Time.Ticks - tween.start_t;
  37
+	if ( t >= tween.duration ) {
  38
+		tween.mc[ tween.prop ] = tween.end;
  39
+		delete Anim.BeingTweened[ tween.idx ];
  40
+		return;
  41
+	}
  42
+	tween.mc[ tween.prop ] = tween.easing( t, tween.begin, tween.change, tween.duration );
  43
+}
  44
+
  45
+Anim.StopTween = function ( mc:MovieClip ):Void {
  46
+	var match:String;
  47
+	for ( var idx:String in Anim.BeingTweened ) {
  48
+		match = idx.substr( 0, idx.lastIndexOf( "." ) );
  49
+		if ( match == mc._name )
  50
+			delete Anim.BeingTweened[ idx ];
  51
+	}
  52
+}
  53
+
  54
+Do_Periodic( 1, function ():Void {
  55
+	var tween:Object;
  56
+	for ( var idx:String in Anim.BeingTweened ) {
  57
+		tween = Anim.BeingTweened[ idx ];
  58
+		Anim.ProcessTween( tween );
  59
+	}
  60
+} );
22  Scripts/Core.as
... ...
@@ -0,0 +1,22 @@
  1
+/*
  2
+ *    _____         _______ _______ _______ _______
  3
+ *   |_____] |      |_____| |______ |  |  | |_____|
  4
+ *   |       |_____ |     | ______| |  |  | |     |
  5
+ *
  6
+ *   Core.as - Core Functionality
  7
+ */
  8
+
  9
+if ( _global.Plasma == undefined )
  10
+	_global.Plasma = new Object();
  11
+
  12
+#include "./Core/Data.as"
  13
+#include "./Core/Utility.as"
  14
+#include "./Core/Mode.as"
  15
+#include "./Core/System.as"
  16
+#include "./Core/Display.as"
  17
+#include "./Core/Volume.as"
  18
+#include "./Core/Time.as"
  19
+#include "./Core/Music.as"
  20
+#include "./Core/Key.as"
  21
+#include "./Core/JetEffect.as"
  22
+#include "./Core/Init.as"
186  Scripts/Core/Data.as
... ...
@@ -0,0 +1,186 @@
  1
+/*
  2
+ *    _____         _______ _______ _______ _______
  3
+ *   |_____] |      |_____| |______ |  |  | |_____|
  4
+ *   |       |_____ |     | ______| |  |  | |     |
  5
+ *
  6
+ *   Core/Data.as - Data/Settings Management
  7
+ */
  8
+
  9
+var Data:Object = {};
  10
+Data.Loaded = {};
  11
+
  12
+// Public method
  13
+// USE THIS ONE NOT Data._Set!
  14
+Data.Set = function ( setting:String, data, filen:String ) {
  15
+	return Data.CheckLoaded( filen ).Set( setting, data );
  16
+}
  17
+
  18
+// Public method
  19
+// USE THIS ONE NOT Data._Unset!
  20
+Data.Unset = function ( setting:String, filen:String ):Boolean {
  21
+	return Data.CheckLoaded( filen ).Unset( setting );
  22
+}
  23
+
  24
+// Public method
  25
+// USE THIS ONE NOT Data._Get!
  26
+Data.Get = function ( setting:String, filen:String ) {
  27
+	return Data.CheckLoaded( filen ).Get( setting );
  28
+}
  29
+
  30
+
  31
+/**********************************************************
  32
+ * Do not use the functions below, they are for processing
  33
+ * the public functions Data.Set, Data.Unset and Data.Get
  34
+ ***********************************************************/
  35
+
  36
+Data.MaxUnsavedChanges = 8;														//  8 changes
  37
+Data.MaxDelayTillSave = 15000;													// 15 seconds
  38
+Data.MaxDelayTillUnload = 120000;												//  2 minutes
  39
+
  40
+Data.CheckLoaded = function ( filen:String ):Object {
  41
+	if ( filen ) {
  42
+		if ( filen != UCI_NAME )												// If name provided and not UCI name
  43
+			filen = UCI_NAME + "_" + filen;										// Use UCI's name + _name
  44
+	}																			// Eg. "data" for a UCI called "ABC"
  45
+	else																		// would produce "ABC_data.so"
  46
+		filen = UCI_NAME;														// Use UCI name for SO file
  47
+
  48
+	if ( Data.Loaded[ filen ] == undefined ) {
  49
+		Data.Loaded[ filen ] = {};
  50
+		var obj:Object = Data.Loaded[ filen ];
  51
+		obj.sobj = SharedObject.getLocal( filen );
  52
+		obj.name = filen;
  53
+		obj.changed = 0;
  54
+		obj.lastSaved = getTimer();
  55
+
  56
+		obj.Set = Data._Set;
  57
+		obj.Get = Data._Get;
  58
+		obj.Unset = Data._Unset;
  59
+	}
  60
+	return Data.Loaded[ filen ];
  61
+}
  62
+
  63
+Data._Set = function ( setting:String, data ) {
  64
+	if ( this.sobj.data[ setting ] != data ) {
  65
+		this.sobj.data[ setting ] = data;
  66
+		this.changed++;
  67
+	}
  68
+	return data;
  69
+}
  70
+
  71
+Data._Unset = function ( setting:String ):Boolean {
  72
+	if ( this.sobj.data[ setting ] ) {
  73
+		delete this.sobj.data[ setting ];
  74
+		return this.sobj.flush();
  75
+	}
  76
+	else return false;
  77
+}
  78
+
  79
+Data._Get = function ( setting:String ) {
  80
+	return this.sobj.data[ setting ];
  81
+}
  82
+
  83
+Data.Sync = function ():Void {
  84
+	var chksync:Function = function ( obj:Object ):Number {
  85
+		var tdiff:Number =  getTimer() - obj.lastSaved;
  86
+		if ( obj.changed == 0 ) return tdiff;
  87
+		if ( obj.changed > Data.MaxUnsavedChanges || tdiff > Data.MaxDelayTillSave ) {
  88
+			if ( obj.sobj.flush() ) {
  89
+				obj.changed = 0;
  90
+				obj.lastSaved = getTimer();
  91
+			}
  92
+		}
  93
+		return tdiff;
  94
+	}
  95
+
  96
+	var sync:Function = function ( obj:Object ):Void {
  97
+		var dobj:Object;
  98
+		var tdiff:Number;
  99
+		for ( var n:String in obj.Loaded ) {
  100
+			dobj = obj.Loaded[ n ];
  101
+			tdiff = chksync( dobj );
  102
+			if ( tdiff > Data.MaxDelayTillUnload && dobj.changed == 0 ) {
  103
+				dobj.sobj.clear();
  104
+				delete obj.Loaded[ n ];
  105
+			}
  106
+		}
  107
+	}
  108
+	sync( Data );
  109
+	sync( Plasma.Data );
  110
+	chksync( Plasma.Data );
  111
+}
  112
+
  113
+Data.Unload = function ():Void {
  114
+	var unload:Function = function ( obj:Object ):Void {
  115
+		var dobj:Object;
  116
+		for ( var n:String in obj.Loaded ) {
  117
+			dobj = obj.Loaded[ n ];
  118
+			if ( dobj.changed > 0 )
  119
+				dobj.sobj.flush();
  120
+			dobj.sobj.clear();
  121
+			delete obj.Loaded[ n ];
  122
+		}
  123
+	}
  124
+	unload( Data );
  125
+	unload( Plasma.Data );
  126
+
  127
+	if ( Plasma.Data.changed > 0 )
  128
+		Plasma.Data.sobj.flush();												// Save Plasma.Data to disk
  129
+}																				// but don't close for future
  130
+
  131
+
  132
+/* Plasma only. Not for UCIs */
  133
+
  134
+Plasma.Data = {};
  135
+
  136
+Plasma.Data.name = "Plasma";
  137
+Plasma.Data.sobj = SharedObject.getLocal( Plasma.Data.name );					// Load shared obj. This stays
  138
+Plasma.Data.changed = 0;
  139
+Plasma.Data.lastSaved = getTimer();
  140
+Plasma.Data.Loaded = {};
  141
+
  142
+Plasma.Data.CheckLoaded = function ( filen:String ):Object {
  143
+	filen = "Plasma_"+ filen;
  144
+	if ( Plasma.Data.Loaded[ filen ] == undefined ) {
  145
+		Plasma.Data.Loaded[ filen ] = {};
  146
+		var obj:Object = Plasma.Data.Loaded[ filen ];
  147
+		obj.sobj = SharedObject.getLocal( filen );
  148
+		obj.name = filen;
  149
+		obj.changed = 0;
  150
+		obj.lastSaved = getTimer();
  151
+
  152
+		obj.Set = Data._Set;
  153
+		obj.Get = Data._Get;
  154
+		obj.Unset = Data._Unset;
  155
+	}
  156
+	return Plasma.Data.Loaded[ filen ];
  157
+}
  158
+
  159
+Plasma.Data.Set = function ( setting:String, data, filen:String ) {
  160
+	if ( filen )
  161
+		return Plasma.Data.CheckLoaded( filen ).Set( setting, data );
  162
+
  163
+	if ( Plasma.Data.sobj.data[ setting ] != data ) {
  164
+		Plasma.Data.sobj.data[ setting ] = data;
  165
+		Plasma.Data.changed++;
  166
+	}
  167
+	return data;
  168
+}
  169
+
  170
+Plasma.Data.Unset = function ( setting:String ) {
  171
+	if ( filen )
  172
+		return Plasma.Data.CheckLoaded( filen ).Set( setting, data );
  173
+
  174
+	if ( Plasma.Data.sobj.data[ setting ] == undefined )
  175
+		return true;
  176
+
  177
+	delete Plasma.Data.sobj.data[ setting ];
  178
+}
  179
+
  180
+Plasma.Data.Get = function ( setting:String ) {
  181
+	if ( filen )
  182
+		return Plasma.Data.CheckLoaded( filen ).Get( setting );
  183
+
  184
+	return this.sobj.data[ setting ];
  185
+}
  186
+
93  Scripts/Core/Display.as
... ...
@@ -0,0 +1,93 @@
  1
+/*
  2
+ *    _____         _______ _______ _______ _______
  3
+ *   |_____] |      |_____| |______ |  |  | |_____|
  4
+ *   |       |_____ |     | ______| |  |  | |     |
  5
+ *
  6
+ *   Core/Display.as - UCI Display Manipulation and Properties
  7
+ */
  8
+
  9
+Sys.Display = {};
  10
+
  11
+Sys.Display.addProperty( "Brightness",
  12
+						 function ():Number {
  13
+							 var trans:Object = Sys.Display.Color;
  14
+							 trans.rb += 255;
  15
+							 trans.gb += 255;
  16
+							 trans.bb += 255;
  17
+							 var max:Number = Misc.Math.highest( [ trans.rb, trans.gb, trans.bb ] );
  18
+							 return int( max / 2.55 );
  19
+						 },
  20
+						 function ( num:Number ):Void {
  21
+							 if ( isNaN( num ) ) return;
  22
+							 if ( num < 0 ) num = 0;
  23
+							 else if ( num > 100 ) num = 100;
  24
+							 var trans:Object = Sys.Display.Color;
  25
+							 trans.rb += 255;
  26
+							 trans.gb += 255;
  27
+							 trans.bb += 255;
  28
+							 var scale:Number = 2.55 / Misc.Math.highest( [ trans.rb, trans.gb, trans.bb ] ) * num;
  29
+							 trans.rb = trans.rb * max - 255;
  30
+							 trans.gb = trans.gb * max - 255;
  31
+							 trans.bb = trans.bb * max - 255;
  32
+							 Sys.Display.Color = trans;
  33
+						 } );
  34
+
  35
+Sys.Display.addProperty( "Color",
  36
+						 function ():Object {
  37
+							 if ( Sys.Display.Color_ == undefined ) {
  38
+								 Sys.Display.Color_ = new Color( UI );
  39
+								 var trans:Object = {
  40
+									 ra: 100,
  41
+									 rb: 0,
  42
+									 ga: 100,
  43
+									 gb: 0,
  44
+									 ba: 100,
  45
+									 bb: 0,
  46
+									 aa: 100,
  47
+									 ab: 0
  48
+								 };
  49
+								 Sys.Display.Color_.setTransform( trans );
  50
+								 return trans;
  51
+							 }
  52
+							 return Sys.Display.Color_.getTransform();
  53
+						 },
  54
+						 function ( trans:Object ):Void {
  55
+							 Sys.Display.Color_.setTransform( trans );
  56
+						 } );
  57
+
  58
+Sys.Display.addProperty( "RGB",
  59
+						 function ():Number {
  60
+							 var trans:Object = Sys.Display.Color;
  61
+							 return ( trans.rb + 255 ) << 16 | ( trans.gb + 255 ) << 8 | ( trans.bb + 255 );
  62
+						 },
  63
+						 function ( num:Number ):Void {
  64
+							 var trans:Object = Sys.Display.Color;
  65
+							 trans.rb = ( num >> 16 ) - 255;
  66
+							 trans.gb = ( ( num >> 8 ) & 0xff ) - 255;
  67
+							 trans.bb = ( num & 0xff ) - 255;
  68
+							 Sys.Display.Color = trans;
  69
+						 } );
  70
+
  71
+Sys.Display.addProperty( "Red",
  72
+						 function ():Number { return Sys.Display.Color.rb + 255; },
  73
+						 function ( num:Number ):Void {
  74
+							 var trans:Object = Sys.Display.Color;
  75
+							 trans.rb = num - 255;
  76
+							 Sys.Display.Color = trans;
  77
+						 } );
  78
+
  79
+Sys.Display.addProperty( "Green",
  80
+						 function ():Number { return Sys.Display.Color.gb + 255; },
  81
+						 function ( num:Number ):Void {
  82
+							 var trans:Object = Sys.Display.Color;
  83
+							 trans.gb = num - 255;
  84
+							 Sys.Display.Color = trans;
  85
+						 } );
  86
+
  87
+Sys.Display.addProperty( "Blue",
  88
+						 function ():Number { return Sys.Display.Color.bb + 255; },
  89
+						 function ( num:Number ):Void {
  90
+							 var trans:Object = Sys.Display.Color;
  91
+							 trans.bb = num - 255;
  92
+							 Sys.Display.Color = trans;
  93
+						 } );
80  Scripts/Core/Init.as
... ...
@@ -0,0 +1,80 @@
  1
+/*
  2
+ *    _____         _______ _______ _______ _______
  3
+ *   |_____] |      |_____| |______ |  |  | |_____|
  4
+ *   |       |_____ |     | ______| |  |  | |     |
  5
+ *
  6
+ *   Core/Init.as - Core Initialisation Methods
  7
+ */
  8
+
  9
+
  10
+if ( !UCI_NAME )
  11
+	var UCI_NAME:String = "Plasma_" + new Date().getTime();		// Set some UCI name
  12
+
  13
+
  14
+// For: Mode.as
  15
+// Mode Init
  16
+{
  17
+	switch ( Sys.State ) {
  18
+		case 0:																	// No state
  19
+		case 1:																	// Music/Video Playing
  20
+		case 2:																	// Music/Video Paused
  21
+		case 3:																	// Music/Video Stopped
  22
+		case 6:																	// Reserved state
  23
+			Mode.Music = true;
  24
+			break;
  25
+		case 4:																	// Radio
  26
+		case 5:																	// Radio Recording
  27
+			Mode.Radio = true;
  28
+			break;
  29
+		case 7:																	// Recording
  30
+		case 8:																	// Recording Paused
  31
+		case 9:																	// Recording Stopped
  32
+		case 10:																// Recording Playing
  33
+		case 11:																// Recording 'Play_Pause'
  34
+			Mode.Record = true;
  35
+			break;
  36
+		case 12:																// Mobile TV
  37
+		case 13:																// Mobile TV Recording
  38
+			Mode.MobileTV = true;
  39
+			break;
  40
+		default:
  41
+			Mode.Music = true;
  42
+			break;
  43
+	}
  44
+}
  45
+
  46
+// For: Data.as
  47
+Do_Periodic( 5000, Data.Sync );
  48
+
  49
+// For: System.as
  50
+Do_onDisplayUpdate( function ():Void {
  51
+	Sys.State = ext_fscommand2( "GetEtcState" );
  52
+});
  53
+
  54
+// For: Volume.as
  55
+Do_onDisplayUpdate( Volume.CheckDevice );
  56
+
  57
+
  58
+
  59
+// For: Time.as
  60
+Do_onUnload( function ():Void {
  61
+	delete onEnterFrame;
  62
+});
  63
+
  64
+
  65
+// For: Key.as
  66
+{
  67
+	switch ( Sys.Device ) {
  68
+		case "J3":
  69
+		case "C2":
  70
+		case "X7":
  71
+			_global.RegisterKeyListener( onKey.Handler );									// J3, C2
  72
+			break;
  73
+		case "S9":
  74
+		case "i9":
  75
+			_global.gfn_Key_CreateKeyListner( onKey.Handler );							// S9, i9
  76
+			break;
  77
+	}
  78
+}
  79
+
  80
+tDevice = "Your Device: "+ Sys.Device;
123  Scripts/Core/JetEffect.as
... ...
@@ -0,0 +1,123 @@
  1
+/*
  2
+ *    _____         _______ _______ _______ _______
  3
+ *   |_____] |      |_____| |______ |  |  | |_____|
  4
+ *   |       |_____ |     | ______| |  |  | |     |
  5
+ *
  6
+ *   Core/JetEffect.as - JetEffect EQ Management
  7
+ */
  8
+
  9
+var JetEffect:Object = {};
  10
+JetEffect.EQNames = [ "User 1", "User 2", "User 3", "User 4", "Normal", "BBE", "BBE ViVA", "BBE ViVA 2",
  11
+					  "BBE Mach3Bass", "BBE MP", "BBE Headphone", "BBE Headphone 2", "BBE Headphone 3",
  12
+					  "Rock", "Jazz", "Classic", "Ballad", "Pop", "Club", "Funk", "Hip Hop", "Techno",
  13
+					  "Blues", "Metal", "Dance", "Rap", "Wide", "X-Bass", "Hall", "Vocal", "Maestro",
  14
+					  "Feel the Wind", "Mild Shore", "Crystal Clear", "Reverb Room", "Reverb Club",
  15
+					  "Reverb Stage", "Reverb Hall", "Reverb Stadium" ];
  16
+
  17
+JetEffect.addProperty( "Current",
  18
+					   function ():Number {
  19
+						   if ( JetEffect.Current_ == undefined ) {			// All Players
  20
+							   JetEffect.Current_ = ext_fscommand2( "GetJetEffectIndex" );
  21
+						   }
  22
+						   return JetEffect.Current_;
  23
+					   },
  24
+					   function ( num:Number ):Void {
  25
+
  26
+					   } );
  27
+
  28
+JetEffect.addProperty( "CurrentName",
  29
+					   function ():String {
  30
+						   return JetEffect.EQNames[ JetEffect.Current ];
  31
+					   },
  32
+					   function ( setting:String ):Void {
  33
+						   setting = setting.toLowerCase();
  34
+						   for ( var i:Number = 0; i < 39; i++ ) {
  35
+							   if ( setting == JetEffect.EQNames[ i ].toLowerCase() ) {
  36
+								   JetEffect.Current = i;
  37
+								   return;
  38
+							   }
  39
+						   }
  40
+					   } );
  41
+
  42
+// Deal with user EQs
  43
+// Namely "User 1", "User 2", "User 3", "User 4"
  44
+JetEffect.User = {};
  45
+JetEffect.User.addProperty( "Current",
  46
+							function ():Number {
  47
+								if ( JetEffect.User.Current_ == undefined ) {			// All Players
  48
+									ext_fscommand2( "SetJetUserIndex", 1 );
  49
+									JetEffect.User.Current_ = ext_fscommand2( "GetJetUserIndex" );
  50
+								}
  51
+								return JetEffect.User.Current_;
  52
+							},
  53
+							function ( num:Number ):Void {
  54
+
  55
+							} );
  56
+
  57
+JetEffect.User.addProperty( "CurrentName",
  58
+							function ():String {
  59
+								return JetEffect.EQNames[ JetEffect.User.Current ];
  60
+							},
  61
+							function ( setting:String ):Void {
  62
+								setting = setting.toLowerCase();
  63
+								for ( var i:Number = 0; i < 4; i++ ) {
  64
+									if ( setting == JetEffect.EQNames[ i ].toLowerCase() ) {
  65
+										JetEffect.User.Current = i;
  66
+										return;
  67
+									}
  68
+								}
  69
+							} );
  70
+
  71
+JetEffect.User.Update = function ():Void {
  72
+	var list:String = ext_fscommand2( "GetJetUserData", "list" );
  73
+	var settings:Array = list.split( "|" );
  74
+	JetEffect.User.BBE_ = int( settings[ 0 ] );
  75
+	JetEffect.User.M3B_ = int( settings[ 0 ] );
  76
+	JetEffect.User._3DS_ = int( settings[ 0 ] );
  77
+	JetEffect.User.MPE_ = ( settings[ 0 ] == "1" ) ? true : false;
  78
+}
  79
+
  80
+JetEffect.User.addProperty( "BBE",
  81
+							function ():Number {
  82
+								if ( !JetEffect.User.BBE_ ) {
  83
+									JetEffect.User.BBE_ = ext_fscommand2( "GetJetUserBBE" );
  84
+								}
  85
+								return JetEffect.User.BBE_;
  86
+							},
  87
+							function ( num:Number ):Void {
  88
+							} );
  89
+
  90
+JetEffect.User.addProperty( "M3B",
  91
+							function ():Number {
  92
+								if ( !JetEffect.User.M3B_ ) {
  93
+									JetEffect.User.M3B_ = ext_fscommand2( "GetJetUserM3B" );
  94
+								}
  95
+								return JetEffect.User.M3B_;
  96
+							},
  97
+							function ( num:Number ):Void {
  98
+							} );
  99
+
  100
+JetEffect.User.addProperty( "_3DS",
  101
+							function ():Number {
  102
+								if ( !JetEffect.User._3DS_ ) {
  103
+									JetEffect.User._3DS_ = ext_fscommand2( "GetJetUser3DS" );
  104
+								}
  105
+								return JetEffect.User._3DS_;
  106
+							},
  107
+							function ( num:Number ):Void {
  108
+							} );
  109
+
  110
+JetEffect.User.addProperty( "MPE",
  111
+							function ():Boolean {
  112
+								if ( !JetEffect.User.MPE_ ) {
  113
+									JetEffect.User.MPE_ = ext_fscommand2( "GetJetUserMPE" );
  114
+								}
  115
+								return JetEffect.User.MPE_;
  116
+							},
  117
+							function ( setting:Boolean ):Void {
  118
+							} );
  119
+
  120
+
  121
+
  122
+
  123
+
123  Scripts/Core/Key.as
... ...
@@ -0,0 +1,123 @@
  1
+/*
  2
+ *    _____         _______ _______ _______ _______
  3
+ *   |_____] |      |_____| |______ |  |  | |_____|
  4
+ *   |       |_____ |     | ______| |  |  | |     |
  5
+ *
  6
+ *   Core/Key.as - Key Input Handling
  7
+ */
  8
+
  9
+
  10
+var onKey:Object = {};
  11
+onKey.HoldState = ( ext_fscommand2("GetSysHoldKey") == 1 ) ? true : false;
  12
+
  13
+onKey.Handler = function ( KeyCode:Number ):Void {
  14
+	switch ( KeyCode ) {
  15
+		// Play (Short)
  16
+		case _global.KEY_PLAY_SHORT:											// Key 32 (Space)
  17
+			if ( onKey.PlayShort )
  18
+				onKey.PlayShort();
  19
+			else
  20
+				Music.PlayPause();												// Play/Pause by default
  21
+			break;
  22
+
  23
+		// FF (Short)
  24
+		case _global.KEY_FF_SHORT:												// Key 37 (Left)
  25
+			if ( onKey.FFShort )
  26
+				onKey.FFShort();
  27
+			else
  28
+				Music.Next();													// Prev by default
  29
+			break;
  30
+
  31
+		// Rew (Short)
  32
+		case _global.KEY_REW_SHORT:												// Key 39 (Right)
  33
+			if ( onKey.RewShort )
  34
+				onKey.RewShort();
  35
+			else
  36
+				Music.Prev();													// Next by default
  37
+			break;
  38
+
  39
+		// Volume Up (Short)
  40
+		case _global.KEY_PLUS_SHORT:											// Key 38 (Up)
  41
+			if ( onKey.PlusShort )
  42
+				onKey.PlusShort();
  43
+			else
  44
+				Volume.Value++;													// Inc Vol by default
  45
+			break;
  46
+
  47
+		// Volume Down (Short)
  48
+		case _global.KEY_MINUS_SHORT:											// Key 40 (Down)
  49
+			if ( onKey.MinusShort )
  50
+				onKey.MinusShort();
  51
+			else
  52
+				Volume.Value--;													// Dec Vol by default
  53
+			break;
  54
+
  55
+		// Play (Long)
  56
+		case _global.KEY_PLAY_LONG:												// Key 32 (Space)
  57
+			if ( onKey.PlayLong )
  58
+				onKey.PlayLong();
  59
+			else
  60
+				_global.LoadSWF( _global.MODE_MAIN );							// Return to main by default
  61
+			break;
  62
+
  63
+		// FF (Long)
  64
+		case _global.KEY_FF_LONG:												// Key 37 (Left)
  65
+			if ( onKey.FFLong )
  66
+				onKey.FFLong();
  67
+			else
  68
+				Music.FF();														// Rew by default
  69
+			break;
  70
+
  71
+		// Volume Up (Long)
  72
+		case _global.KEY_PLUS_LONG:												// Key 38 (Up)
  73
+			if ( onKey.PlusLong )
  74
+				onKey.PlusLong();
  75
+			else
  76
+				Volume.Value++;													// Inc Vol by default
  77
+			break;
  78
+
  79
+		// Rew (Long)
  80
+		case _global.KEY_REW_LONG:												// Key 39 (Right)
  81
+			if ( onKey.RewLong )
  82
+				onKey.RewLong();
  83
+			else
  84
+				Music.Rew();													// FF by default
  85
+			break;
  86
+
  87
+		// Volume Down (Long)
  88
+		case _global.KEY_MINUS_LONG:											// Key 40 (Down)
  89
+			if ( onKey.MinusLong )
  90
+				onKey.MinusLong();
  91
+			else
  92
+				Volume.Value--;													// Dec Vol by default
  93
+			break;
  94
+
  95
+		// Rotation to 0, 90, 180, 270 degrees
  96
+		case _global.KEY_DISPLAY_ROTATE:										// 122 Key (F11)
  97
+			break;
  98
+
  99
+		// Display Update (Speaker, Track, Screen, Bluetooth etc change)
  100
+		case _global.KEY_DISPLAY_UPDATE:										// 123 Key (F12)
  101
+			for ( var idx in onDisplayUpdateQueue )
  102
+				onDisplayUpdateQueue[ idx ]();
  103
+			break;
  104
+
  105
+		// Hold Key
  106
+		case _global.KEY_HOLD:													// 145 Key (Scroll Lock)
  107
+			onKey.HoldState = !onKey.HoldState;
  108
+			if ( onKey.HoldState ) {
  109
+				if ( onKey.Hold )
  110
+					onKey.Hold();
  111
+			}
  112
+			else if ( onKey.Unhold ) {
  113
+				onKey.Unhold();
  114
+			}
  115
+			break;
  116
+	}
  117
+}
  118
+
  119
+
  120
+var onDisplayUpdateQueue:Array = new Array();
  121
+function Do_onDisplayUpdate ( func:Function ):Void {
  122
+	onDisplayUpdateQueue.push( func );
  123
+}
193  Scripts/Core/Mode.as
... ...
@@ -0,0 +1,193 @@
  1
+/*
  2
+ *    _____         _______ _______ _______ _______
  3
+ *   |_____] |      |_____| |______ |  |  | |_____|
  4
+ *   |       |_____ |     | ______| |  |  | |     |
  5
+ *
  6
+ *   Core/Mode.as - Low-Level Mode Handling
  7
+ */
  8
+
  9
+
  10
+/*
  11
+ * All mode setting must be done via:
  12
+ * 		Mode.Current = "Music";
  13
+ * 		Mode.Current = "Video";
  14
+ * for example.
  15
+ *
  16
+ * This is so that Plasma can keep track of modes and
  17
+ * enable/disable functionality when needed.
  18
+ */
  19
+var Mode:Object = {};
  20
+
  21
+/*
  22
+ * Mode.Current can be used to set modes
  23
+ * Use in the following manner:
  24
+ * 		Mode.Current = "Music";
  25
+ * Note: Modes are case-sensitive. (ie. "Music" works but "music" does not)
  26
+ */
  27
+Mode.addProperty( "Current",
  28
+				  function ():String {
  29
+					  return Mode.CurrentData;
  30
+				  },
  31
+				  function ( mode:String ):Void {
  32
+					  mode = Mode.CheckModeName( mode );						// Check if valid mode specified
  33
+					  if ( mode == "" || mode == Mode.Previous )
  34
+						  return;												// Invalid mode name or already set
  35
+
  36
+					  var result:Number = ext_fscommand2( "EtcModChangeMode", mode );
  37
+					  var init:Boolean = ( Mode.CurrentData == null );			// Check if first time setting mode
  38
+					  if ( init || result == 1 ) {								// If first time or successful and different mode
  39
+						  if ( !init ) Mode.Previous = Mode.CurrentData;
  40
+						  Mode.CurrentData = mode;
  41
+						  if ( !init ) Mode.PostProcessing();
  42
+					  }
  43
+				  });
  44
+
  45
+Mode.CheckModeName = function ( name ):String {
  46
+	switch ( name ) {
  47
+		case "Music":
  48
+		case "Video":
  49
+		case "Radio":
  50
+		case "Record":
  51
+		case "MobileTV":
  52
+		case "Flash":
  53
+		case "Text":
  54
+		case "Picture":
  55
+		case "Dictionary":
  56
+			return name;
  57
+		default:
  58
+			return "";
  59
+	}
  60
+}
  61
+
  62
+// This function changes some cached information based on mode change
  63
+Mode.PostProcessing = function ():Void {
  64
+	var prev:String = Mode.Previous;
  65
+	var now:String = Mode.CurrentData;
  66
+
  67
+	switch ( now ) {
  68
+		case "Music":
  69
+			break;
  70
+		case "Video":
  71
+			switch ( prev ) {
  72
+				case "Music":
  73
+					Music.PlayState = false;
  74
+			}
  75
+			break;
  76
+		case "Radio":
  77
+			switch ( prev ) {
  78
+				case "Music":
  79
+					Music.PlayState = false;
  80
+			}
  81
+			break;
  82
+		case "Record":
  83
+			switch ( prev ) {
  84
+				case "Music":
  85
+					Music.PlayState = false;
  86
+			}
  87
+			break;
  88
+		case "MobileTV":
  89
+			switch ( prev ) {
  90
+				case "Music":
  91
+					Music.PlayState = false;
  92
+			}
  93
+			break;
  94
+		case "Flash":
  95
+			break;
  96
+	}
  97
+}
  98
+
  99
+
  100
+
  101
+/*
  102
+ * The following properties are shortcuts for Mode.Current
  103
+ *
  104
+ * To check whether a certain mode is enabled, check in the following way:
  105
+ * 		if ( Mode.Music )
  106
+ *
  107
+ * To set a certain mode, do the following:
  108
+ * 		Mode.Music = true;
  109
+ *
  110
+ * Note: Disabling modes is not possible as a replacement mode needs to be set.
  111
+ */
  112
+
  113
+Mode.addProperty( "Music",
  114
+				  function ():Boolean {
  115
+					  return ( Mode.Current == "Music" );
  116
+				  },
  117
+				  function ( trig:Boolean ):Void {
  118
+					  if ( trig )
  119
+						  Mode.Current = "Music";
  120
+				  });
  121
+
  122
+Mode.addProperty( "Video",
  123
+				  function ():Boolean {
  124
+					  return ( Mode.Current == "Video" );
  125
+				  },
  126
+				  function ( trig:Boolean ):Void {
  127
+					  if ( trig )
  128
+						  Mode.Current = "Video";
  129
+				  });
  130
+
  131
+Mode.addProperty( "Radio",
  132
+				  function ():Boolean {
  133
+					  return ( Mode.Current == "Radio" );
  134
+				  },
  135
+				  function ( trig:Boolean ):Void {
  136
+					  if ( trig )
  137
+						  Mode.Current = "Radio";
  138
+				  });
  139
+
  140
+Mode.addProperty( "Record",
  141
+				  function ():Boolean {
  142
+					  return ( Mode.Current == "Record" );
  143
+				  },
  144
+				  function ( trig:Boolean ):Void {
  145
+					  if ( trig )
  146
+						  Mode.Current = "Record";
  147
+				  });
  148
+
  149
+Mode.addProperty( "MobileTV",
  150
+				  function ():Boolean {
  151
+					  return ( Mode.Current == "MobileTV" );
  152
+				  },
  153
+				  function ( trig:Boolean ):Void {
  154
+					  if ( trig )
  155
+						  Mode.Current = "MobileTV";
  156
+				  });
  157
+
  158
+Mode.addProperty( "Flash",
  159
+				  function ():Boolean {
  160
+					  return ( Mode.Current == "Flash" );
  161
+				  },
  162
+				  function ( trig:Boolean ):Void {
  163
+					  if ( trig )
  164
+						  Mode.Current = "Flash";
  165
+				  });
  166
+
  167
+Mode.addProperty( "Text",
  168
+				  function ():Boolean {
  169
+					  return ( Mode.Current == "Text" );
  170
+				  },
  171
+				  function ( trig:Boolean ):Void {
  172
+					  if ( trig )
  173
+						  Mode.Current = "Text";
  174
+				  });
  175
+
  176
+Mode.addProperty( "Picture",
  177
+				  function ():Boolean {
  178
+					  return ( Mode.Current == "Picture" );
  179
+				  },
  180
+				  function ( trig:Boolean ):Void {
  181
+					  if ( trig )
  182
+						  Mode.Current = "Picture";
  183
+				  });
  184
+
  185
+Mode.addProperty( "Dictionary",
  186
+				  function ():Boolean {
  187
+					  return ( Mode.Current == "Dictionary" );
  188
+				  },
  189
+				  function ( trig:Boolean ):Void {
  190
+					  if ( trig )
  191
+						  Mode.Current = "Dictionary";
  192
+				  });
  193
+
98  Scripts/Core/Music.as
... ...
@@ -0,0 +1,98 @@
  1
+/*
  2
+ *    _____         _______ _______ _______ _______
  3
+ *   |_____] |      |_____| |______ |  |  | |_____|
  4
+ *   |       |_____ |     | ______| |  |  | |     |
  5
+ *
  6
+ *   Core/Music.as - Core Music Functionality
  7
+ */
  8
+
  9
+var Music:Object = {};
  10
+
  11
+Music.addProperty( "PlayState",
  12
+				   function ():Boolean {
  13
+					   return ( Sys.State == 1 ) ? true : false;
  14
+				   },
  15
+				   function ( state:Boolean ):Void {
  16
+					   if ( Mode.Music ) Sys.State = ( state ) ? 1 : 2;
  17
+				   } );
  18
+
  19
+Music.PlayPause = function ():Boolean {
  20
+	if ( Music.PlayState )
  21
+		return Music.Pause();
  22
+	else
  23
+		return Music.Play();
  24
+}
  25
+
  26
+Music.Play = function ():Boolean {
  27
+	if ( !Music.PlayState ) {			// All Players | J3, X7, C2
  28
+		var music:Boolean = Mode.Music;
  29
+		var setoffset:Boolean, updateoffset:Boolean;
  30
+		if ( music ) {
  31
+			if ( Music.PosOffset == undefined ) setoffset = true;
  32
+			else updateoffset = true;
  33
+		}
  34
+		if ( setoffset ) Music.Pos = Music.Pos;
  35
+
  36
+		var cmd:String = ( music ) ? "KeyAudPlay" : "KeyComShortPlay";
  37
+		if ( ext_fscommand2( cmd ) == 1 ) {
  38
+			Music.PlayState = true;
  39
+			if ( setoffset ) Music.PosOffset = ( getTimer() % 1000 );
  40
+			if ( updateoffset ) Music.PosOffset
  41
+			return true;
  42
+		}
  43
+	}
  44
+	return false;
  45
+}
  46
+
  47
+Music.Pause = function ():Boolean {
  48
+	if ( Music.PlayState ) {             // All Players | J3, X7, C2
  49
+		var cmd:String = ( Mode.Music ) ? "KeyAudPause" : "KeyComShortPlay";
  50
+		if ( ext_fscommand2( cmd ) == 1 ) {
  51
+			Music.PlayState = false;
  52
+			return true;
  53
+		}
  54
+	}
  55
+	return false;
  56
+}
  57
+
  58
+Music.Prev = function ():Boolean {  // All Players     | J3, X7, C2
  59
+	var cmd:String = ( Mode.Music ) ? "KeyAudShortREW" : "KeyComShortREW";
  60
+	if ( ext_fscommand2( cmd ) == 1 ) {
  61
+		if ( Mode.Music ) {
  62
+			if ( !Music.PlayState )
  63
+				Music.Update();
  64
+			Music.Pos_ = 0;