Source Code Cross Referenced for SoundStreamHead.java in  » Ajax » Laszlo-4.0.10 » org » openlaszlo » iv » flash » api » sound » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » Laszlo 4.0.10 » org.openlaszlo.iv.flash.api.sound 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: SoundStreamHead.java,v 1.4 2002/07/18 06:02:22 skavish Exp $
003:         *
004:         * ===========================================================================
005:         *
006:         */
007:
008:        package org.openlaszlo.iv.flash.api.sound;
009:
010:        import java.io.PrintStream;
011:        import org.openlaszlo.iv.flash.parser.*;
012:        import org.openlaszlo.iv.flash.util.*;
013:        import org.openlaszlo.iv.flash.api.*;
014:
015:        public class SoundStreamHead extends FlashObject {
016:            public int reserved; // 4 bits ( reserved, always 0 )
017:            public int playbackRate; // 2 bits
018:            public boolean isPlayback16bit; // 1 bit
019:            public boolean isPlaybackStereo; // 1 bit
020:
021:            public int streamCompression; // 4 bits
022:            public int streamRate; // 2 bits
023:            public boolean isStream16bit; // 1 bit
024:            public boolean isStreamStereo; // 1 bit
025:
026:            public int streamSampleCount; // 1 word
027:
028:            // Total: 4 bytes
029:            private int tagCode = -1;
030:
031:            public int getTag() {
032:                if (tagCode != -1)
033:                    return tagCode;
034:                if (streamCompression == Sound.COMPRESS_ADPCM
035:                        && streamRate == Sound.RATE_5_5
036:                        && isStream16bit == true) {
037:                    return Tag.SOUNDSTREAMHEAD;
038:                } else {
039:                    return Tag.SOUNDSTREAMHEAD2;
040:                }
041:            }
042:
043:            public static SoundStreamHead parse(Parser p) {
044:                SoundStreamHead o = new SoundStreamHead();
045:
046:                o.tagCode = p.getTagCode();
047:                p.initBits();
048:
049:                //p.skipBits( 4 ); // Reserved
050:                o.reserved = p.getBits(4);
051:
052:                o.playbackRate = p.getBits(2);
053:                o.isPlayback16bit = p.getBool();
054:                o.isPlaybackStereo = p.getBool();
055:
056:                o.streamCompression = p.getBits(4);
057:
058:                o.streamRate = p.getBits(2);
059:                o.isStream16bit = p.getBool();
060:                o.isStreamStereo = p.getBool();
061:
062:                o.streamSampleCount = p.getUWord();
063:
064:                return o;
065:            }
066:
067:            public void write(FlashOutput fob) {
068:                fob.writeTag(getTag(), 4);
069:
070:                fob.initBits(); // Prepare to write to bit buffer
071:
072:                //fob.writeBits( 0, 4 ); // Reserved
073:                fob.writeBits(reserved, 4);
074:
075:                fob.writeBits(playbackRate, 2);
076:                fob.writeBool(isPlayback16bit);
077:                fob.writeBool(isPlaybackStereo);
078:
079:                fob.flushBits(); // End of first byte
080:
081:                fob.writeBits(streamCompression, 4);
082:                fob.writeBits(streamRate, 2);
083:                fob.writeBool(isStream16bit);
084:                fob.writeBool(isStreamStereo);
085:
086:                fob.flushBits(); // End of second byte
087:
088:                fob.writeWord(streamSampleCount);
089:            }
090:
091:            public boolean isConstant() {
092:                return true;
093:            }
094:
095:            protected FlashItem copyInto(FlashItem item, ScriptCopier copier) {
096:                super .copyInto(item, copier);
097:
098:                ((SoundStreamHead) item).tagCode = tagCode;
099:                ((SoundStreamHead) item).playbackRate = playbackRate;
100:                ((SoundStreamHead) item).isPlayback16bit = isPlayback16bit;
101:                ((SoundStreamHead) item).isPlaybackStereo = isPlaybackStereo;
102:
103:                ((SoundStreamHead) item).streamCompression = streamCompression;
104:                ((SoundStreamHead) item).streamRate = streamRate;
105:                ((SoundStreamHead) item).isStream16bit = isStream16bit;
106:                ((SoundStreamHead) item).isStreamStereo = isStreamStereo;
107:
108:                ((SoundStreamHead) item).streamSampleCount = streamSampleCount;
109:
110:                return item;
111:            }
112:
113:            public FlashItem getCopy(ScriptCopier copier) {
114:                return copyInto(new SoundStreamHead(), copier);
115:            }
116:
117:            public void printContent(PrintStream out, String indent) {
118:                if (getTag() == Tag.SOUNDSTREAMHEAD2) {
119:                    out.println(indent + "SoundStreamHead2");
120:                } else {
121:                    out.println(indent + "SoundStreamHead");
122:                }
123:
124:                out.println(indent + "    Playback Rate: "
125:                        + Sound.rates[playbackRate]);
126:                out.println(indent + "    Playback 16 Bit: " + isPlayback16bit);
127:                out
128:                        .println(indent + "    Playback Stereo: "
129:                                + isPlaybackStereo);
130:
131:                out.println(indent + "    Stream Compression: "
132:                        + Sound.compressions[streamCompression]);
133:                out.println(indent + "    Stream Rate: "
134:                        + Sound.rates[streamRate]);
135:                out.println(indent + "    Stream 16 Bit: " + isStream16bit);
136:                out.println(indent + "    Stream Stereo: " + isStreamStereo);
137:
138:                out.println(indent + "    Stream Sample Count: "
139:                        + streamSampleCount);
140:            }
141:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.