|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.dvbcentral.lib.Frontend
public final class Frontend
Abstraction over a DVB frontend. Instances can be created using find(int) method
and allows one to tune to any frequency (see Tune), subscribe to
certain PIDs using openPID(int) and read the transmitted data through
ReadableByteChannel.read(java.nio.ByteBuffer) method.
| Nested Class Summary | |
|---|---|
static class |
Frontend.PID
Represents one pid. |
static class |
Frontend.Stats
A structure representing a snapshot of frontends' radio performance statistics. |
| Method Summary | |
|---|---|
void |
close()
|
static Frontend |
createVirtual(ReadableByteChannel channel,
Collection<? super Frontend.PID> pids,
Collection<? super Tune> tunes)
Creates a fake, virtual frontend that delegates all of its operations on provided interfaces. |
static Frontend |
find(int device)
Basic factory method for creating frontend for devices registered in the system. |
Frontend.Stats |
getStats()
Retrieves the radio performance statistics from the frontend. |
boolean |
isOpen()
|
Frontend.PID |
openPID(int pid)
Opens new PID for reading. |
int |
read(ByteBuffer byteBuffer)
|
void |
tune(Tune tune)
Tunes the frontend to new frequency and other aspects provided by given tune. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Frontend find(int device)
throws IOException
device - number of the adapter to create frontend for
IOException
public static Frontend createVirtual(ReadableByteChannel channel,
Collection<? super Frontend.PID> pids,
Collection<? super Tune> tunes)
ReadableByteChannel implementation. The other arguments
are not necessary, but if one of them is provided, their methods
are going to be called as follows:
frontend.openPID(...) results in a call to
pids.add(theNewlyCreatedPid) and closing the pid results in
pids.remove(theClosedPid). Calls to tune are
going to result in a call to tunes.add(theTune).
channel - the channel to read the data frompids - the collection to add and remove opened pids from, can be nulltunes - the collection to add the tunes called on this
frontend to, can be null
public void tune(Tune tune)
throws IOException
tune - the tune to tune to
IOException - if tuning failed
public Frontend.PID openPID(int pid)
throws IOException
pid - integer number describing the PID
IOException - if opening pid fails
public void close()
throws IOException
close in interface Closeableclose in interface ChannelIOExceptionpublic boolean isOpen()
isOpen in interface Channel
public int read(ByteBuffer byteBuffer)
throws IOException
read in interface ReadableByteChannelIOExceptionpublic Frontend.Stats getStats()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||