diff options
author | Michiel Van Der Kolk <not.valid@email.address> | 2005-07-11 15:42:37 +0000 |
---|---|---|
committer | Michiel Van Der Kolk <not.valid@email.address> | 2005-07-11 15:42:37 +0000 |
commit | 9fee0ec4ca0c5b7a334cc29dbb58e76c7a4c736e (patch) | |
tree | 4c304cd4151020bd5494d279ee68a105ae3a5a3a /songdbj/de/jarnbjo/ogg/PhysicalOggStream.java | |
parent | dfa8ecbe609ca8ea194d08560a44fb9a92e94b4b (diff) | |
download | rockbox-9fee0ec4ca0c5b7a334cc29dbb58e76c7a4c736e.tar.gz rockbox-9fee0ec4ca0c5b7a334cc29dbb58e76c7a4c736e.zip |
Songdb java version, source. only 1.5 compatible
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7101 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'songdbj/de/jarnbjo/ogg/PhysicalOggStream.java')
-rw-r--r-- | songdbj/de/jarnbjo/ogg/PhysicalOggStream.java | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/songdbj/de/jarnbjo/ogg/PhysicalOggStream.java b/songdbj/de/jarnbjo/ogg/PhysicalOggStream.java new file mode 100644 index 0000000000..5f342a38b7 --- /dev/null +++ b/songdbj/de/jarnbjo/ogg/PhysicalOggStream.java | |||
@@ -0,0 +1,124 @@ | |||
1 | /* | ||
2 | * $ProjectName$ | ||
3 | * $ProjectRevision$ | ||
4 | * ----------------------------------------------------------- | ||
5 | * $Id$ | ||
6 | * ----------------------------------------------------------- | ||
7 | * | ||
8 | * $Author$ | ||
9 | * | ||
10 | * Description: | ||
11 | * | ||
12 | * Copyright 2002-2003 Tor-Einar Jarnbjo | ||
13 | * ----------------------------------------------------------- | ||
14 | * | ||
15 | * Change History | ||
16 | * ----------------------------------------------------------- | ||
17 | * $Log$ | ||
18 | * Revision 1.1 2005/07/11 15:42:36 hcl | ||
19 | * Songdb java version, source. only 1.5 compatible | ||
20 | * | ||
21 | * Revision 1.1.1.1 2004/04/04 22:09:12 shred | ||
22 | * First Import | ||
23 | * | ||
24 | * Revision 1.3 2003/04/10 19:48:22 jarnbjo | ||
25 | * no message | ||
26 | * | ||
27 | * Revision 1.2 2003/03/31 00:23:04 jarnbjo | ||
28 | * no message | ||
29 | * | ||
30 | * Revision 1.1 2003/03/03 21:02:20 jarnbjo | ||
31 | * no message | ||
32 | * | ||
33 | */ | ||
34 | |||
35 | package de.jarnbjo.ogg; | ||
36 | |||
37 | import java.io.IOException; | ||
38 | import java.util.Collection; | ||
39 | |||
40 | /** | ||
41 | * Interface providing access to a physical Ogg stream. Typically this is | ||
42 | * a file. | ||
43 | */ | ||
44 | |||
45 | public interface PhysicalOggStream { | ||
46 | |||
47 | /** | ||
48 | * Returns a collection of objects implementing <code>LogicalOggStream</code> | ||
49 | * for accessing the separate logical streams within this physical Ogg stream. | ||
50 | * | ||
51 | * @return a collection of objects implementing <code>LogicalOggStream</code> | ||
52 | * which are representing the logical streams contained within this | ||
53 | * physical stream | ||
54 | * | ||
55 | * @see LogicalOggStream | ||
56 | */ | ||
57 | |||
58 | public Collection getLogicalStreams(); | ||
59 | |||
60 | /** | ||
61 | * Return the Ogg page with the absolute index <code>index</code>, | ||
62 | * independent from the logical structure of this stream or if the | ||
63 | * index parameter is -1, the next Ogg page is returned. | ||
64 | * This method should only be used by implementations of <code>LogicalOggStream</code> | ||
65 | * to access the raw pages. | ||
66 | * | ||
67 | * @param index the absolute index starting from 0 at the beginning of | ||
68 | * the file or stream or -1 to get the next page in a non-seekable | ||
69 | * stream | ||
70 | * | ||
71 | * @return the Ogg page with the physical absolute index <code>index</code> | ||
72 | * | ||
73 | * @throws OggFormatException if the ogg stream is corrupted | ||
74 | * @throws IOException if some other IO error occurs | ||
75 | */ | ||
76 | |||
77 | public OggPage getOggPage(int index) throws OggFormatException, IOException; | ||
78 | |||
79 | /** | ||
80 | * Checks if this stream is open for reading. | ||
81 | * | ||
82 | * @return <code>true</code> if this stream is open for reading, | ||
83 | * <code>false</code> otherwise | ||
84 | */ | ||
85 | |||
86 | public boolean isOpen(); | ||
87 | |||
88 | /** | ||
89 | * Closes this stream. After invoking this method, no further access | ||
90 | * to the streams data is possible. | ||
91 | * | ||
92 | * @throws IOException | ||
93 | */ | ||
94 | |||
95 | public void close() throws IOException; | ||
96 | |||
97 | /** | ||
98 | * Sets this stream's (and its logical stream's) position to the granule | ||
99 | * position. The next packet read from any logical stream will be the | ||
100 | * first packet beginning on the first page with a granule position higher | ||
101 | * than the argument.<br><br> | ||
102 | * | ||
103 | * At the moment, this method only works correctly for Ogg files with | ||
104 | * a single logical Vorbis stream, and due to the different interpretations | ||
105 | * of the granule position, depending on mixed content, this method will | ||
106 | * never be able to work for mixed streams. Chained and interleaved streams are | ||
107 | * also not yet supported. Actually, this method is only a hack to support | ||
108 | * seeking from JMF, but may of course be abused otherwise too :) | ||
109 | * | ||
110 | * @param granulePosition | ||
111 | * | ||
112 | * @throws OggFormatException if the ogg stream is corrupted | ||
113 | * @throws IOException if some other IO error occurs | ||
114 | */ | ||
115 | |||
116 | public void setTime(long granulePosition) throws OggFormatException, IOException; | ||
117 | |||
118 | /** | ||
119 | * @return <code>true</code> if the stream is seekable, <code>false</code> | ||
120 | * otherwise | ||
121 | */ | ||
122 | |||
123 | public boolean isSeekable(); | ||
124 | } \ No newline at end of file | ||