Changeset 75
- Timestamp:
- 10/01/08 09:07:36 (5 years ago)
- Files:
-
- 23 added
- 3 deleted
- 16 edited
-
branches/4.2/Kroeger_563.ttf (deleted)
-
branches/4.2/com/carlcalderon/arthropod/Debug.as (modified) (13 diffs)
-
branches/4.2/com/jeroenwijering/models/SoundModel.as (modified) (2 diffs)
-
branches/4.2/com/jeroenwijering/parsers/ATOMParser.as (modified) (1 diff)
-
branches/4.2/com/jeroenwijering/parsers/ObjectParser.as (modified) (1 diff)
-
branches/4.2/com/jeroenwijering/player/Controller.as (modified) (1 diff)
-
branches/4.2/com/jeroenwijering/player/Desktop.as (added)
-
branches/4.2/com/jeroenwijering/player/Player.as (modified) (11 diffs)
-
branches/4.2/com/jeroenwijering/player/SWFLoader.as (modified) (7 diffs)
-
branches/4.2/com/jeroenwijering/player/View.as (modified) (2 diffs)
-
branches/4.2/com/jeroenwijering/plugins/Controlbar.as (modified) (2 diffs)
-
branches/4.2/com/jeroenwijering/plugins/Display.as (modified) (1 diff)
-
branches/4.2/com/jeroenwijering/plugins/Dragdrop.as (added)
-
branches/4.2/com/jeroenwijering/plugins/Filebar.as (added)
-
branches/4.2/com/jeroenwijering/plugins/Playlist.as (modified) (8 diffs)
-
branches/4.2/com/jeroenwijering/plugins/Resizer.as (added)
-
branches/4.2/com/jeroenwijering/plugins/YouSearch.as (added)
-
branches/4.2/com/jeroenwijering/utils/NetClient.as (modified) (1 diff)
-
branches/4.2/com/jeroenwijering/utils/Playlister.as (modified) (1 diff)
-
branches/4.2/desktopplayer.air (added)
-
branches/4.2/desktopplayer.fla (added)
-
branches/4.2/desktopplayer.p12 (added)
-
branches/4.2/desktopplayer.swf (added)
-
branches/4.2/player.swf (modified) (previous)
-
branches/4.2/resizer.fla (added)
-
branches/4.2/resizer.swf (added)
-
branches/4.2/yousearch.fla (added)
-
branches/4.2/yousearch.swf (added)
-
branches/air (deleted)
-
plugins (deleted)
-
skins/as3/stylish.fla (modified) (previous)
-
skins/as3/stylish.swf (modified) (previous)
-
skins/fonts (added)
-
skins/fonts/Kroeger_563.ttf (added)
-
skins/fonts/pf_tempesta_seven_condensed.ttf (added)
-
skins/fonts/px_sans_nouveaux.ttf (added)
-
skins/icons (added)
-
skins/icons/stylish.ai (added)
-
skins/icons/stylish128.png (added)
-
skins/icons/stylish16.png (added)
-
skins/icons/stylish32.png (added)
-
skins/icons/stylish48.png (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/4.2/com/carlcalderon/arthropod/Debug.as
r63 r75 1 1 /** 2 2 * Debug 3 * Designed for version 0. 81 to 0.96.7of the Arthropod Debugger.3 * Designed for version 0.96.7 to 1.0 of the Arthropod Debugger. 4 4 * 5 5 * USE AT YOUR OWN RISK! … … 16 16 * 17 17 * @author Carl Calderon 2008 18 * @version 0.7 318 * @version 0.74 19 19 * @link http.//www.carlcalderon.com/ 20 * @since 0. 6120 * @since 0.72 21 21 */ 22 22 … … 25 25 import flash.display.Bitmap; 26 26 import flash.display.BitmapData; 27 import flash.display.DisplayObject; 28 import flash.display.IBitmapDrawable; 29 import flash.display.Stage; 27 30 import flash.events.StatusEvent; 28 31 import flash.geom.Matrix; … … 38 41 */ 39 42 public static const NAME :String = 'Debug'; 40 public static const VERSION :String = '0.72'; 43 public static const VERSION :String = '0.74'; 44 45 /** 46 * Privacy 47 * By setting this password, you need to enter the 48 * same in "Arthropod -> Settings -> Connection Password" 49 * to be able to see the traces. 50 * 51 * default: 'CDC309AF'; 52 */ 53 public static var password :String = 'CDC309AF'; 41 54 42 55 /** … … 80 93 private static const TYPE :String = 'app'; 81 94 private static const CONNECTION :String = 'arthropod'; 82 private static const SECURITY :String = 'CDC309AF';83 95 84 96 private static const LOG_OPERATION :String = 'debug'; … … 101 113 * @return True if successful 102 114 */ 103 public static function log (message:String,color:uint=0xFEFEFE) :Boolean {104 return send ( LOG_OPERATION, message, color );115 public static function log ( message:*, color:uint = 0xFEFEFE ) :Boolean { 116 return send ( LOG_OPERATION, String ( message ) , color ) ; 105 117 } 106 118 … … 112 124 * @return True if successful 113 125 */ 114 public static function error (message:String) :Boolean {115 return send ( ERROR_OPERATION, message, 0xCC0000 );126 public static function error ( message:* ) :Boolean { 127 return send ( ERROR_OPERATION, String ( message ) , 0xCC0000 ) ; 116 128 } 117 129 … … 123 135 * @return True if successful 124 136 */ 125 public static function warning (message:String) :Boolean {126 return send ( WARNING_OPERATION, message, 0xCCCC00 );137 public static function warning ( message:* ) :Boolean { 138 return send ( WARNING_OPERATION, String ( message ) , 0xCCCC00 ) ; 127 139 } 128 140 … … 162 174 * BitmapData to an acceptable size for the call. 163 175 * 164 * @param bmd BitmapData to be traced as165 * a thumbnail166 * @return True if successful 167 */ 168 public static function bitmap ( bmd: BitmapData) :Boolean {176 * @param bmd Any IBitmapDrawable 177 * @param label Label 178 * @return True if successful 179 */ 180 public static function bitmap ( bmd:*, label:String = null ) :Boolean { 169 181 var bm:BitmapData = new BitmapData ( 100, 100, true, 0x00FFFFFF ) ; 170 182 var mtx:Matrix = new Matrix ( ) ; … … 172 184 mtx.scale ( s, s ) ; 173 185 bm.draw ( bmd, mtx,null,null,null,true ) ; 174 var bounds:Rectangle = new Rectangle ( 0, 0, Math.floor(bmd.width*s), Math.floor(bmd.height*s) ) ; 175 var ba:ByteArray = bm.getPixels ( bounds ) ; 176 return send ( BITMAP_OPERATION, ba, bounds ) ; 186 var bounds:Rectangle = new Rectangle ( 0, 0, Math.floor ( bmd.width * s ) , Math.floor ( bmd.height * s ) ) ; 187 return send ( BITMAP_OPERATION, bm.getPixels ( bounds ), { bounds:bounds, lbl:label } ) ; 188 } 189 190 /** 191 * Traces a snapshot of the current stage state. 192 * 193 * @param stage Stage 194 * @param label Label 195 * @return True if successful 196 */ 197 public static function snapshot ( stage:Stage, label:String=null ) :Boolean { 198 if ( stage ) 199 return bitmap ( stage, label ) ; 200 return false; 177 201 } 178 202 … … 192 216 * @return True if successful 193 217 */ 194 public static function object ( obj:* ) :Boolean {218 public static function object ( obj:* ) :Boolean { 195 219 return send ( OBJECT_OPERATION, obj, null ) ; 196 220 } … … 215 239 * @param color opt. Color of the message 216 240 */ 217 private static function send( operation:String, value:*, prop:* ){241 private static function send( operation:String, value:*, prop:* ):Boolean { 218 242 if (!secure) lc.allowInsecureDomain('*'); 219 243 else lc.allowDomain(secureDomain); … … 225 249 if(allowLog){ 226 250 try { 227 lc.send ( TYPE + '#' + DOMAIN + CHECK + ':' + CONNECTION , operation, SECURITY, value, prop ) ;251 lc.send ( TYPE + '#' + DOMAIN + CHECK + ':' + CONNECTION , operation, password, value, prop ) ; 228 252 return true; 229 } catch (e ) {253 } catch (e:*) { 230 254 return false; 231 255 } 232 256 } 257 return false; 233 258 } 234 259 -
branches/4.2/com/jeroenwijering/models/SoundModel.as
r64 r75 61 61 62 62 63 /** Forward ID3 data from the sound. **/ 64 private function id3Handler(evt:Event):void { 65 try { 66 var id3:ID3Info = sound.id3; 67 var obj = { 68 album:id3.album, 69 artist:id3.artist, 70 comment:id3.comment, 71 genre:id3.genre, 72 songName:id3.songName, 73 track:id3.track, 74 year:id3.year 75 } 76 model.sendEvent(ModelEvent.META,obj); 77 } catch (err:Error) {} 78 }; 79 80 63 81 /** Load the sound. **/ 64 82 public function load():void { … … 68 86 sound.addEventListener(IOErrorEvent.IO_ERROR,errorHandler); 69 87 sound.addEventListener(ProgressEvent.PROGRESS,progressHandler); 88 sound.addEventListener(Event.ID3,id3Handler); 70 89 sound.load(new URLRequest(model.playlist[model.config['item']]['file']),context); 71 90 model.mediaHandler(); -
branches/4.2/com/jeroenwijering/parsers/ATOMParser.as
r68 r75 47 47 if(i.@rel == 'alternate') { 48 48 itm['link'] = i.@href.toString(); 49 } else { 50 itm[i.@rel.toString()] = i.@href.toString(); 49 } else { 50 var pt1:RegExp = /^(.+)#(.+)$/g; 51 var pt2:RegExp = /^(.+)\.(.+)$/g; 52 var nam:String = i.@rel.toString().replace(pt1,"$2").replace(pt2,'$2'); 53 itm[nam] = i.@href.toString(); 51 54 } 52 55 break; -
branches/4.2/com/jeroenwijering/parsers/ObjectParser.as
r68 r75 129 129 if(!itm['duration']) { itm['duration'] = 0; } 130 130 if(!itm['start']) { itm['start'] = 0; } 131 //for(var i in itm) { trace(i+': '+itm[i]); } 131 132 return itm; 132 133 }; -
branches/4.2/com/jeroenwijering/player/Controller.as
r66 r75 240 240 /** Forward a resizing of the stage. **/ 241 241 private function redrawHandler(evt:ViewEvent=null):void { 242 var mgn = config['margins'].split(',');243 242 var dat = { 244 width:skin.stage.stageWidth -mgn[0],245 height:skin.stage.stageHeight -mgn[1],243 width:skin.stage.stageWidth, 244 height:skin.stage.stageHeight, 246 245 fullscreen:false 247 246 }; -
branches/4.2/com/jeroenwijering/player/Player.as
r73 r75 15 15 16 16 17 /** A list with all defaultconfiguration values. Change them to hard-code your preferences. **/17 /** All configuration values. Change them to hard-code your preferences. **/ 18 18 public var config:Object = { 19 19 author:undefined, … … 21 21 date:undefined, 22 22 duration:0, 23 file: undefined,23 file:'http://www.jeroenwijering.com/upload/bunny.mp3', 24 24 image:undefined, 25 25 link:undefined, … … 29 29 type:undefined, 30 30 31 backcolor: undefined,32 frontcolor: undefined,31 backcolor:'000000', 32 frontcolor:'ffffff', 33 33 lightcolor:undefined, 34 34 screencolor:undefined, … … 39 39 icons:true, 40 40 logo:undefined, 41 playlist:' none',41 playlist:'right', 42 42 playlistsize:180, 43 43 skin:undefined, … … 61 61 id:undefined, 62 62 linktarget:'_blank', 63 margins:'0,0', 64 plugins:undefined, 63 plugins:'resizer.swf,yousearch.swf', 65 64 streamer:undefined, 66 65 token:undefined, 67 tracer: undefined,66 tracer:'arthropod', 68 67 version:'4.2.71' 69 68 }; … … 71 70 public var skin:MovieClip; 72 71 /** Object that loads all configuration variables. **/ 73 pr ivatevar configger:Configger;72 protected var configger:Configger; 74 73 /** Object that load the skin and plugins. **/ 75 pr ivatevar loader:SWFLoader;74 protected var loader:SWFLoader; 76 75 /** Reference to the Controller of the MVC cycle. **/ 77 pr ivatevar controller:Controller;76 protected var controller:Controller; 78 77 /** Reference to the model of the MVC cycle. **/ 79 pr ivatevar model:Model;78 protected var model:Model; 80 79 /** Reference to the View of the MVC cycle, which defines all API calls. **/ 81 80 public var view:View; … … 87 86 public function Player():void { 88 87 visible = false; 89 skin = this .player;88 skin = this['player']; 90 89 addEventListener(Event.ADDED_TO_STAGE,loadConfig); 91 90 }; … … 93 92 94 93 /** When added to stage, the player loads the config. **/ 95 pr ivatefunction loadConfig(evt:Event):void {94 protected function loadConfig(evt:Event):void { 96 95 configger = new Configger(this); 97 96 configger.addEventListener(Event.COMPLETE,loadSkin); … … 101 100 102 101 /** Config loading completed; now load skin. **/ 103 pr ivate function loadSkin(evt:Event):void {102 protected function loadSkin(evt:Event=null):void { 104 103 loader = new SWFLoader(this); 105 loader.addEventListener(Event. COMPLETE,loadMVC);104 loader.addEventListener(Event.INIT,loadMVC); 106 105 loader.loadSkin(config['skin']); 107 106 }; … … 109 108 110 109 /** Skin loading completed, now load MVC. **/ 111 pr ivate function loadMVC(evt:Event):void {110 protected function loadMVC(evt:Event=null):void { 112 111 controller = new Controller(config,skin); 113 112 model = new Model(config,skin,controller); 114 113 view = new View(config,skin,controller,model,loader); 115 controller.start(model,view);116 114 loadPlugins(); 117 115 }; … … 119 117 120 118 /** MVC inited; now load plugins. **/ 121 pr ivate function loadPlugins(){119 protected function loadPlugins():void { 122 120 new Rightclick().initializePlugin(view); 123 121 new Display().initializePlugin(view); 124 122 new Controlbar().initializePlugin(view); 125 123 if(skin['playlist']) { new Playlist().initializePlugin(view); } 124 loader.addEventListener(Event.COMPLETE,startPlayer); 126 125 loader.loadPlugins(config['plugins']); 126 }; 127 128 129 /** Everything loaded; start player. **/ 130 protected function startPlayer(evt:Event=null) { 131 loader.removeEventListener(Event.COMPLETE,startPlayer); 132 controller.start(model,view); 127 133 visible = true; 128 134 }; 129 130 135 131 136 } -
branches/4.2/com/jeroenwijering/player/SWFLoader.as
r68 r75 24 24 /** Base directory for the plugins. **/ 25 25 private var basedir:String = 'http://plugins.longtailvideo.com/'; 26 /** Number of plugns that are done loading. **/ 27 private var done:Number; 26 28 27 29 … … 43 45 public function loadPlugins(pgi:String=null):void { 44 46 if(pgi) { 45 var arr = pgi.split(','); 46 for(var i in arr) { loadSWF(arr[i],false); } 47 var arr:Array = pgi.split(','); 48 done = arr.length; 49 for(var i:Number=0; i<arr.length; i++) { 50 loadSWF(arr[i],false); 51 } 52 } else { 53 dispatchEvent(new Event(Event.COMPLETE)); 47 54 } 48 }; 55 }; 49 56 50 57 … … 58 65 loadSWF(skn,true); 59 66 } else { 60 dispatchEvent(new Event(Event. COMPLETE));67 dispatchEvent(new Event(Event.INIT)); 61 68 } 62 69 }; … … 95 102 private function pluginError(evt:IOErrorEvent):void { 96 103 player.view.sendEvent('TRACE',' plugin: '+evt.text); 104 done--; 105 if(done == 0) { 106 dispatchEvent(new Event(Event.COMPLETE)); 107 } 97 108 }; 98 109 … … 106 117 player.view.sendEvent('TRACE',' plugin: '+err.message); 107 118 } 119 done--; 120 if(done == 0) { 121 dispatchEvent(new Event(Event.COMPLETE)); 122 } 108 123 }; 109 124 … … 112 127 private function skinError(evt:IOErrorEvent=null):void { 113 128 player.skin = player['player']; 114 dispatchEvent(new Event(Event. COMPLETE));129 dispatchEvent(new Event(Event.INIT)); 115 130 }; 116 131 … … 120 135 var clp = evt.target.content; 121 136 if(clp['player']) { 122 player.skin = MovieClip(clp['player']);137 player.skin = clp['player'] as MovieClip; 123 138 Draw.clear(player); 124 139 player.addChild(player.skin); 125 dispatchEvent(new Event(Event. COMPLETE));140 dispatchEvent(new Event(Event.INIT)); 126 141 } else { 127 142 skinError(); -
branches/4.2/com/jeroenwijering/player/View.as
r72 r75 50 50 controller = ctr; 51 51 model = mdl; 52 setListening(); 52 53 if(ExternalInterface.available && _skin.loaderInfo.url.indexOf('http') == 0) { 53 54 listeners = new Array(); 54 55 setJavascript(); 55 setListening();56 } else if (Capabilities.playerType == 'External') {57 setListening();58 56 } 59 57 }; … … 102 100 var obj = {CONTROLLER:'0xFF6666',VIEW:'0x66FF66',MODEL:'0x6666FF'}; 103 101 Debug.log(typ+' '+prm,obj[tgt]); 104 } else if(Capabilities.playerType == 'External') {105 trace(tgt+': '+typ+' '+prm);106 102 } else if(config['tracer']) { 107 103 ExternalInterface.call(config['tracer'],tgt+': '+typ+' '+prm); 104 } else { 105 trace(tgt+': '+typ+' '+prm); 108 106 } 109 107 if(!dat) { dat = new Object(); } -
branches/4.2/com/jeroenwijering/plugins/Controlbar.as
r73 r75 1 1 /** 2 * Display a controlbar and direct the search externally.2 * Display a controlbar with transport buttons and sliders. 3 3 **/ 4 4 package com.jeroenwijering.plugins { … … 404 404 bar.stage.removeEventListener(MouseEvent.MOUSE_UP,upHandler); 405 405 scrubber.icon.stopDrag(); 406 if(scrubber.name == 'timeSlider' && view.playlist .length) {406 if(scrubber.name == 'timeSlider' && view.playlist) { 407 407 mpl = view.playlist[view.config['item']]['duration']; 408 } else if(scrubber.name == 'volumeSlider') { 408 } else if(scrubber.name == 'volumeSlider') { 409 409 mpl = 100; 410 410 } -
branches/4.2/com/jeroenwijering/plugins/Display.as
r66 r75 188 188 break; 189 189 default: 190 if(view.config['icons'] == true ) {190 if(view.config['icons'] == true && view.playlist) { 191 191 setIcon(view.config.displayclick+'Icon'); 192 192 } else { -
branches/4.2/com/jeroenwijering/plugins/Playlist.as
r73 r75 33 33 /** Proportion between clip and mask. **/ 34 34 private var proportion:Number; 35 /** Difference between mask and back height. **/36 private var maskdiff:Number = 0;37 35 /** Interval ID for scrolling **/ 38 36 private var scrollInterval:Number; … … 73 71 buttons = new Array(); 74 72 try { 75 maskdiff = clip.back.height - clip.masker.height;76 73 image = new Array(clip.list.button.image.width,clip.list.button.image.height); 77 74 } catch (err:Error) {} … … 87 84 var wid = clip.back.width; 88 85 var hei = clip.back.height; 89 clip.masker.height = hei- maskdiff;86 clip.masker.height = hei-clip.masker.y; 90 87 clip.masker.width = wid; 91 88 proportion = view.playlist.length*buttonheight/hei; … … 126 123 scr.visible = true; 127 124 scr.x = clip.back.width-scr.width; 128 var dif = clip.back.height-scr.height ;125 var dif = clip.back.height-scr.height-scr.y; 129 126 scr.back.height += dif; 130 127 scr.rail.height += dif; … … 220 217 clip.back.height = view.config['height'];; 221 218 buildList(false); 219 clip.visible = true; 222 220 } else if (view.config['playlist'] == 'bottom') { 223 221 clip.x = 0; … … 228 226 clip.back.height = view.config['playlistsize']; 229 227 clip.back.width = view.config['width']; 228 clip.visible = true; 230 229 buildList(false); 231 230 } else if (view.config['playlist'] == 'over') { … … 234 233 clip.back.height = view.config['height']; 235 234 buildList(false); 235 clip.visible = true; 236 236 } else { 237 237 clip.visible = false; … … 261 261 private function scrollHandler():void { 262 262 var scr = clip.slider; 263 var yps = scr.mouseY ;263 var yps = scr.mouseY-scr.rail.y; 264 264 var ips = yps - scr.icon.height/2; 265 265 var cps = clip.masker.y+clip.masker.height/2-proportion*yps; -
branches/4.2/com/jeroenwijering/utils/NetClient.as
r59 r75 62 62 63 63 64 /** Some Limelight crap. **/64 /** CDN subscription callback. **/ 65 65 public function onFCSubscribe(obj:Object):void { 66 66 var dat = {type:'fcsubscribe'}; -
branches/4.2/com/jeroenwijering/utils/Playlister.as
r57 r75 52 52 _playlist = new Array(); 53 53 for each (var ent in obj) { 54 if(typeof(ent) == 'object' && ent['file']) { _playlist.push(ent); } 54 ent = ObjectParser.parse(ent); 55 if(typeof(ent) == 'object' && ent['type']) { 56 _playlist.push(ent); 57 } 55 58 } 56 59 if(_playlist.length == 0) { 57 var str = 'No file found. Did you set the "file" flashvar?';60 var str = 'No suitable file found.'; 58 61 dispatchEvent(new ErrorEvent(ErrorEvent.ERROR,false,false,str)); 59 62 } else {
Note: See TracChangeset
for help on using the changeset viewer.
