Java Doc for RecordControl.java in  » 6.0-JDK-Modules » j2me » javax » microedition » media » control » 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 » 6.0 JDK Modules » j2me » javax.microedition.media.control 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.microedition.media.control.RecordControl

RecordControl
public interface RecordControl extends javax.microedition.media.Control(Code)
RecordControl controls the recording of media from a Player. RecordControl records what's currently being played by the Player.

Example

 try {
 // Create a Player that captures live audio.
 Player p = Manager.createPlayer("capture://audio");
 p.realize();
 // Get the RecordControl, set the record stream,
 // start the Player and record for 5 seconds.
 RecordControl rc = (RecordControl)p.getControl("RecordControl");
 ByteArrayOutputStream output = new ByteArrayOutputStream();
 rc.setRecordStream(output);
 rc.startRecord();
 p.start();
 Thread.currentThread().sleep(5000);
 rc.commit();
 p.close();
 } catch (IOException ioe) {
 } catch (MediaException me) {
 } catch (InterruptedException ie) { }
 

See Also:   javax.microedition.media.Player




Method Summary
 voidcommit()
     Complete the current recording.

If the recording is in progress, commit will implicitly call stopRecord.

To record again after commit has been called, setRecordLocation or setRecordStream must be called.
exception:
  IOException - Thrown if an I/O error occurs during commit.The current recording is not valid.

 StringgetContentType()
     Return the content type of the recorded media.
 voidreset()
     Erase the current recording.

If the recording is in progress, reset will implicitly call stopRecord.

Calling reset after commit will have no effect on the current recording.

If the Player that is associated with this RecordControl is closed, reset will be called implicitly.
exception:
  IOException - Thrown if the current recordingcannot be erased.

 voidsetRecordLocation(String locator)
     Set the output location where the data will be recorded.

Whenever possible, the recording format is the same as the format of the input media.

 intsetRecordSizeLimit(int size)
     Set the record size limit.
 voidsetRecordStream(OutputStream stream)
     Set the output stream where the data will be recorded.

Whenever possible, the recording format is the same as the format of the input media.

 voidstartRecord()
     Start recording the media.

If the Player is already started, startRecord will immediately start the recording.

 voidstopRecord()
     Stop recording the media.



Method Detail
commit
void commit() throws IOException(Code)
Complete the current recording.

If the recording is in progress, commit will implicitly call stopRecord.

To record again after commit has been called, setRecordLocation or setRecordStream must be called.
exception:
  IOException - Thrown if an I/O error occurs during commit.The current recording is not valid. To record again,setRecordLocation or setRecordStreammust be called.




getContentType
String getContentType()(Code)
Return the content type of the recorded media. The content type is given in the content type syntax. The content type of the media.



reset
void reset() throws IOException(Code)
Erase the current recording.

If the recording is in progress, reset will implicitly call stopRecord.

Calling reset after commit will have no effect on the current recording.

If the Player that is associated with this RecordControl is closed, reset will be called implicitly.
exception:
  IOException - Thrown if the current recordingcannot be erased. The current recording is not valid.To record again, setRecordLocation orsetRecordStream must be called.




setRecordLocation
void setRecordLocation(String locator) throws IOException, MediaException(Code)
Set the output location where the data will be recorded.

Whenever possible, the recording format is the same as the format of the input media. In some cases, the recording format may be different from the input format if the input format is not a recordable format, e.g. streaming media data. An application can query the recorded format by calling the getContentType method.
Parameters:
  locator - The locator specifying where therecorded media will be saved. The locator must bespecified as a URL.
exception:
  IllegalStateException - Thrown if one of the followingconditions is true:

  • startRecord has been called and commit hasnot been called.
  • setRecordStream has been called and commit hasnot been called.

exception:
  IllegalArgumentException - Thrown if locatoris null.
exception:
  IOException - Thrown if protocol is valid but themedia cannot be created at the specified location.
exception:
  MediaException - Thrown if the locator is not in URL syntaxor it specifies a protocol that is not supported.
exception:
  SecurityException - Thrown if the caller does nothave security permission to set the record location.



setRecordSizeLimit
int setRecordSizeLimit(int size) throws MediaException(Code)
Set the record size limit. This limits the size of the recorded media to the number of bytes specified.

When recording is in progress, commit will be called implicitly in the following cases:

  • Record size limit is reached
  • If the requested size is less than the already recorded size
  • No more space is available.

Once a record size limit has been set, it will remain so for future recordings until it is changed by another setRecordSizeLimit call.

To remove the record size limit, set it to Integer.MAX_VALUE. By default, the record size limit is not set.

Only positive values can be set. Zero or negative values are invalid and an IllegalArgumentException will be thrown.
Parameters:
  size - The record size limit in number of bytes. The actual size limit set.
exception:
  IllegalArgumentException - Thrown if the given size is invalid.
exception:
  MediaException - Thrown if setting the recordsize limit is not supported.




setRecordStream
void setRecordStream(OutputStream stream)(Code)
Set the output stream where the data will be recorded.

Whenever possible, the recording format is the same as the format of the input media. In some cases, the recording format may be different from the input format if the input format is not a recordable format, e.g. streaming media data. An application can query the recorded format by calling the getContentType method.
Parameters:
  stream - The output stream where the data will be recorded.
exception:
  IllegalStateException - Thrown if one of the followingconditions is true:

  • startRecord has been called and commit hasnot been called.
  • setRecordLocation has been called and commit hasnot been called.

exception:
  IllegalArgumentException - Thrown ifstream is null.
exception:
  SecurityException - Thrown if the caller does nothave security permission to set the record stream.



startRecord
void startRecord()(Code)
Start recording the media.

If the Player is already started, startRecord will immediately start the recording. If the Player is not already started, startRecord will not record any media. It will put the recording in a "standby" mode. As soon as the Player is started, the recording will start right away.

If startRecord is called when the recording has already started, it will be ignored.

When startRecord returns, the recording has started and a RECORD_STARTED event will be delivered through the PlayerListener.

If an error occurs while recording is in progress, RECORD_ERROR event will be delivered via the PlayerListener.
exception:
  IllegalStateException - Thrown if any of the followingconditions is true:

  • if setRecordLocation or setRecordStream hasnot been called for the first time.
  • If commit has been called andsetRecordLocation or setRecordStreamhas not been called.



stopRecord
void stopRecord()(Code)
Stop recording the media. stopRecord will not automatically stop the Player. It only stops the recording.

Stopping the Player does not imply a stopRecord. Rather, the recording will be put into a "standby" mode. Once the Player is re-started, the recording will resume automatically.

After stopRecord, startRecord can be called to resume the recording.

If stopRecord is called when the recording has already stopped, it will be ignored.

When stopRecord returns, the recording has stopped and a RECORD_STOPPED event will be delivered through the PlayerListener.




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.