Changeset 6bb14a37382b8ebb9192f9d82432a2e03b67b558 for flex
- Timestamp:
- 03/06/11 17:11:53 (15 months ago)
- Parents:
- 0f973c08b964db1275e3a7379cd46660a974b7dd
- Children:
- f50d604d32ac938942e5c715c1f9dc095c44e464
- git-committer:
- Robin Gareus <robin@gareus.org> / 2011-03-06T18:11:53Z+0100
- Files:
-
- 1 modified
-
flex/sansarmes/main.mxml (modified) (22 diffs)
Legend:
- Unmodified
- Added
- Removed
-
flex/sansarmes/main.mxml
r0f973c0 r6bb14a3 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <mx:Application 3 xmlns:mx="http://www.adobe.com/2006/mxml" 4 width="800" height="600" 2 <mx:Application 3 xmlns:mx="http://www.adobe.com/2006/mxml" 4 width="800" height="600" 5 5 layout="vertical" 6 6 verticalAlign="middle" … … 26 26 import mx.core.mx_internal; 27 27 28 28 29 29 private var conn:NetConnection; 30 30 private var stream:NetStream; … … 34 34 private var mic:Microphone; 35 35 private var avallowed:Boolean 36 36 37 37 private var server:String; 38 38 private var password:String; … … 62 62 uploadName=null; 63 63 avallowed=false; 64 64 65 65 br.enabled=false; 66 66 bp.enabled=false; … … 78 78 return; 79 79 } 80 80 81 81 mic.rate=44.10; //kHz 82 82 mic.setSilenceLevel(0,2500); 83 83 mic.gain=80; 84 84 mic.setUseEchoSuppression(true); 85 85 86 86 cam.setMode(640,480,25); 87 87 cam.setQuality(0, 70); … … 99 99 myVu=new Shape(); 100 100 myVu.graphics.clear(); 101 vucanvas.rawChildren.addChild(myVu); 101 vucanvas.rawChildren.addChild(myVu); 102 102 } 103 103 … … 125 125 ; 126 126 } 127 127 128 128 private function asyncErrorHandler(event:AsyncErrorEvent):void { 129 129 ; 130 } 131 130 } 131 132 132 private function onBWDone():void { 133 133 ; 134 } 134 } 135 135 136 136 private function recStarted():void { … … 151 151 vutimer.stop(); 152 152 myVu.graphics.clear(); 153 } 154 153 } 154 155 155 private function netStatusHandler(event:NetStatusEvent):void { 156 156 switch (event.info.code) { … … 159 159 recStarted(); 160 160 break; 161 case "NetStream.Record.Start": 161 case "NetStream.Record.Start": 162 162 case "NetStream.Publish.Start": 163 163 case "NetStream.Record.Stop": … … 168 168 break; 169 169 case "NetConnection.Connect.Rejected": 170 default: 170 default: 171 171 recStopped(); 172 172 Alert.show('warning:\n'+event.info.code, 'Alert.', mx.controls.Alert.OK); … … 188 188 launchConnection(); 189 189 } 190 190 191 191 private function launchConnection():void 192 { 192 { 193 193 // Alert.show('uploadName: '+uploadName,'Debug.', mx.controls.Alert.OK); 194 194 conn = new NetConnection(); … … 199 199 conn.connect(server,username,password,uploadName); 200 200 } 201 201 202 202 private function startStream():void { 203 203 stream = new NetStream(conn); … … 207 207 vubox.visible = true; 208 208 vutimer.start(); 209 stream.publish(uploadName, "record"); 210 } 211 209 stream.publish(uploadName, "record"); 210 } 211 212 212 private function stopRecording():void 213 213 { … … 255 255 private function playStatusHandler(event:NetStatusEvent):void { 256 256 switch (event.info.code) { 257 case "NetStream.Buffer.Flush": 258 case "NetStream.Play.Start": 259 case "NetStream.Buffer.Full": 260 case "NetStream.Buffer.Empty": 257 case "NetStream.Buffer.Flush": 258 case "NetStream.Play.Start": 259 case "NetStream.Buffer.Full": 260 case "NetStream.Buffer.Empty": 261 261 case "NetStream.Seek.Notify": 262 262 break; … … 265 265 bu.enabled=false; 266 266 bp.enabled=false; 267 case "NetStream.Play.Stop": 267 case "NetStream.Play.Stop": 268 268 bp.selected=false; 269 269 playBt(null); 270 270 break; 271 default: 271 default: 272 272 //Alert.show('debug:\n'+event.info.code, 'Alert.', mx.controls.Alert.OK); 273 273 break; … … 353 353 else if (vol>70) color=0xFFFF00; 354 354 else color=0x00FF00; 355 myVu.graphics.clear(); 355 myVu.graphics.clear(); 356 356 myVu.graphics.beginFill(0x000000); 357 myVu.graphics.drawRect(0, 0, 260, 16); 357 myVu.graphics.drawRect(0, 0, 260, 16); 358 358 myVu.graphics.beginFill(color); 359 myVu.graphics.drawRect(1, 1, vol*2.58, 14); 359 myVu.graphics.drawRect(1, 1, vol*2.58, 14); 360 360 myVu.graphics.endFill(); 361 361 } … … 375 375 } 376 376 </mx:Style> 377 378 <mx:Text styleName="center"> 377 378 <mx:Text styleName="center"> 379 379 <mx:htmlText> 380 380 <![CDATA[<font size="22px">Sans Armes Citoyens</font>]]> … … 383 383 <mx:Spacer height="1" /> 384 384 385 <mx:Text styleName="center"> 385 <mx:Text styleName="center"> 386 386 <mx:htmlText> 387 387 <![CDATA[<font size="14px">J'interprÚte l'hymne national qui me convient</font>]]> … … 397 397 </mx:htmlText> 398 398 </mx:Text> 399 <mx:Box direction="horizontal" > 399 <mx:Box direction="horizontal" > 400 400 <mx:Label width="130" text="titre:" /> 401 <mx:TextInput id="tt" width="240" text="pas de titre" restrict="a-zA-Z0-9, " maxChars="64"/> 401 <mx:TextInput id="tt" width="240" text="pas de titre" restrict="a-zA-Z0-9, " maxChars="64"/> 402 402 </mx:Box> 403 <mx:Box direction="horizontal" > 403 <mx:Box direction="horizontal" > 404 404 <mx:Label width="130" text="interprÚte:" /> 405 405 <mx:TextInput id="ta" width="240" text="moi" restrict="a-zA-Z0-9, " maxChars="64"/> … … 410 410 </mx:htmlText> 411 411 </mx:Text> 412 <mx:Box direction="horizontal" > 412 <mx:Box direction="horizontal" > 413 413 <mx:Label width="130" text="Adresse email:" /> 414 414 <mx:TextInput id="te" width="240" text="@" restrict="a-zA-Z@0-9" maxChars="128"/> … … 440 440 <mx:VideoDisplay id="video" width="340" height="240" /> 441 441 <mx:ProgressBar width="340" mode="manual" label="%3%%" labelPlacement="center" visible="false" id="soundProgress"/> 442 <mx:Box direction="horizontal" visible="false" id="vubox" width="340"> 442 <mx:Box direction="horizontal" visible="false" id="vubox" width="340"> 443 443 <mx:Label width="70" text="Micro:" /> 444 444 <mx:Canvas id="vucanvas" width="260" height="16"/> … … 465 465 <mx:Spacer height="100%"/> 466 466 467 <mx:Text width="100%" styleName="footer"> 467 <mx:Text width="100%" styleName="footer"> 468 468 <mx:htmlText> 469 469 <![CDATA[© 2011 CITU, robin@gareus.org]]>
