org.jmythapi.protocol
Interface IRecorder

All Superinterfaces:
Closeable, IVersionable
All Known Implementing Classes:
Recorder

public interface IRecorder
extends IVersionable, Closeable

An interface to communicate with a MythTV recorder.

See the usage examples for a list of things you can do with a recorder.

Supported Protocol Versions:

Protocol Version Ranges:
All listed functions are supported by at least one of the supported protocol-versions. If a given function is not supported by all known protocol-versions, it is marked with the MythProtoVersion annotation. Additionally the lower bound of the version range is documented with the @since javadoc tag, whereas the upper bound is documented with the @deprecated tag.

Extended Version Ranges:
Please note that many functions are usable (maybe with some restrictions) beyond the given protocol range, if an alternative set of functions can be used to achieve the same result. If such an "extended" version-range is available for a function, this is mentioned as "fallback-from"- and "fallback-to"-version in the functions javadoc.

Supported Versions:
Which protocol versions are in general supported by the jMythAPI can be seen in the enumeration ProtocolVersion.

How to start:

Connect to the recorder:
The following steps are required to connect to a recorder:
  1. Establish a connection to the backend and register as a client:
    IBackend backend = BackendFactory.createBackend(...);
    backend.connect();
    backend.annotatePlayback(...);
  2. Getting a reference to a recorder:
  3. Connect to the recorder:
    IRecorder recorder = backend.getRecorder(IRecorderInfo);
  4. Connect to the encoder:
    See here, if you need to work with encoders.

Use the recorder:
Afterwards you can use any function provided by this interface to query and control your recorder.
See the usage examples for some examples.

Disconnect from the recorder:
To disconnect from the recorder, recorder.close() needs to be called.

Usage Examples:

The following section provides some examples how to use a recorder class.

Usage Example:

The following example shows how to list all channels available for a recorder.

    // the connected backend
    IBackend backend = ...;

    // searching for the next free recorder
    IRecorderInfo recorderInfo = backend.getNextFreeRecorder();
    if(recorderInfo == null) {
        System.out.println("No free recorder available");
    } else {
        // connect to the recorder
        IRecorder recorder = backend.getRecorder(recorderInfo);
        
        // get all channels available on this recorder
        List<IRecorderChannelInfo> channels = recorder.getChannelInfos();
        for(IRecorderChannelInfo channel : channels) {
            System.out.println(String.format("Channel %d: %s",channel.getChannelID(),channel.getChannelName()));
        }
        
        // close recorder connection
        recorder.close();
    }
 

More usage Examples:

See the javadoc for the methods provided by this interface.

See Also:
All supported protocol version, getRecorder, getRecorders, getFreeRecorders, getRecorderIDs, getFreeRecorderIDs, getNextFreeRecorder

Method Summary
 IRingBuffer annotateRingBuffer()
          Deprecated. 20
 boolean cancelNextRecording(Boolean cancel)
          Tells the recorder to cancel or continue the next recording.
 Integer changeBrightness(boolean up)
          Changes the brightness of a recording.
 Integer changeBrightness(EPictureAdjustmentType adjustmentType, boolean up)
          Changes the brightness value.
 boolean changeChannel(EChannelChangeDirection direction)
          Changes to the next or previous channel.
 boolean changeChannel(int direction)
          Changes to the next or previous channel.
 Integer changeColour(boolean up)
          Changes the colour of a recording.
 Integer changeColour(EPictureAdjustmentType adjustmentType, boolean up)
          Changes the colour value.
 Integer changeContrast(boolean up)
          Changes the contrast of a recording.
 Integer changeContrast(EPictureAdjustmentType adjustmentType, boolean up)
          Changes the contrast value.
 Integer changeHue(boolean up)
          Changes the hue value of a recording.
 Integer changeHue(EPictureAdjustmentType adjustmentType, boolean up)
          Changes the hue value.
 boolean checkChannel(String channelNumber)
          Checks if named channel exists on current tuner.
 IRecorderChannelPrefixStatus checkChannelPrefix(String channelNumberPrefix)
          Checks a channel-number prefix against the channels in the MythTV-DB.
 void close()
          Closes the current recorder connection.
 Map<Long,Long> fillDurationMap(long start, long end)
           
 Map<Long,Long> fillPositionMap(long frameNumberStart, long frameNumberEnd)
          Returns the keyframe position map.
 boolean finishRecording()
          Tells the recorder to stop recording, but only after "overrecord" seconds.
<C extends IBasicChannelInfo>
List<C>
getBasicChannelInfos()
          Gets a list of all known channels.
 Integer getBrightness()
          Gets the brightness of a recording.
 IRecorderChannelInfo getChannelInfo(IBasicChannelInfo channelInfo)
          Gets detailed informations about the given channel.
 IRecorderChannelInfo getChannelInfo(Integer chanID)
          Gets informations about the given channel.
 List<IRecorderChannelInfo> getChannelInfos()
          Gets a list of all known channels.
 Map<Integer,IRecorderNextProgramInfo> getChannelsNextProgramInfoMap(Date startTime)
          Gets a map containing the next programs of all channels.
 Integer getColour()
          Gets the colour of a recording.
 List<String> getConnectedInputs()
          Deprecated. 37 (fallback-to: -1)
 Integer getContrast()
          Gets the contrast of a recording.
<C extends IBasicChannelInfo>
C
getCurrentChannel()
          Gets the currently active channel of the recorder.
 IProgramInfo getCurrentRecording()
          Returns the recorders current recording.
 long getFilePosition()
          Returns the total number of bytes written by the recorder.
 float getFrameRate()
          Returns the recording frame rate.
 long getFramesWritten()
          Returns the number of frames written to disk.
 IFreeInputList getFreeInputs()
          Gets all free inputs of the recorder.
 Integer getHue()
          Gets the hue of a recording.
 String getInput()
          Gets the name of the current recorder input.
 String getInputName()
          Deprecated. 21, use getInput() instead.
 long getKeyframePosition(long frameNumber)
          Returs the byte position for the given frame number.
 long getMaxBitrate()
          Gets the maximum bitrate a recorder can output.
 IRecorderNextProgramInfo getNextProgramInfo(IBasicChannelInfo channelInfo, EChannelBrowseDirection direction, Date startTime)
          Gets the next program on the specified channel.
 IRecorderNextProgramInfo getNextProgramInfo(String channelnumber, Integer chanID, EChannelBrowseDirection direction, Date startTime)
          Gets the next program on the specified channel.
 List<IRecorderNextProgramInfo> getNextProgramInfos(Date startTime)
          Gets a list containing the next programs of all channels.
 IRecorderProgramInfo getProgramInfo()
          Deprecated. 21 (fallback-to: -1), use getNextProgramInfo instead.
 int getRecorderID()
          Gets the id of this recorder
 IProgramInfo getRecording()
          Returns the recorders current recording.
 IRemoteEncoder getRemoteEncoder()
          Gets the remote-encoder object.
 boolean isRecording()
          Checks if the recorder is actually recording.
 boolean pause()
          Tells the recorder to pause a recorder.
 boolean setChannel(String channelNumber)
          Changes to a named channel on the current tuner.
 boolean setInput(String inputName)
          Tells the recorder to change to the specified input.
 boolean setLiveTvRecording()
          Tells the recorder to keep a LiveTV recording.
 boolean setNextLiveTvDirectory(String path)
          Changes LiveTV recording directory.
 int setSignalMonitoringRate(int rate, boolean notifyFrontend)
          Sets the signal monitoring rate.
 boolean shouldSwitchCard(Integer channelID)
          Checks if named channel exists on current tuner, or another tuner.
 boolean signalFrontendReady()
          Tells the recorder that the frontend is up and ready.
 boolean spawnLiveTV()
          Tells the recorder to start a "Live TV" recording.
 boolean spawnLiveTV(boolean pictureInPicture, IRecorderChannelInfo recorderChannelInfo)
          Tells the recorder to start a "Live TV" recording.
 boolean spawnLiveTV(boolean pictureInPicture, String channelNumber)
          Tells the recorder to start a "Live TV" recording.
 boolean stopLiveTv()
          Tells the recorder to stop a "Live TV" recording.
 boolean stopPlaying()
          Deprecated. 20
 String switchToNextInput()
          Tells the recorder to switch to the next input.
 boolean toggleChannelFavorite()
          Adds or removes the current channel from the favorite channel list.
 boolean toggleChannelFavorite(String channelGroup)
          Adds or removes the current channel to or from the given channel group.
 boolean toggleInputs()
          Deprecated. 27 (fallback-to: -1), replaced by setInput(String) and switchToNextInput().
 long waitForFramesWritten(long desiredFrames)
          Wait for number of frames written.
 boolean waitForIsRecording(long timeoutMs)
          Wait for recording.
 
Methods inherited from interface org.jmythapi.IVersionable
getVersionNr
 

Method Detail

close

void close()
           throws IOException
Closes the current recorder connection.

Specified by:
close in interface Closeable
Throws:
IOException - on communication errors

getRecorderID

int getRecorderID()
Gets the id of this recorder

Returns:
the recorder id

getRemoteEncoder

IRemoteEncoder getRemoteEncoder()
Gets the remote-encoder object.

Returns:
the remote encoder object.

signalFrontendReady

boolean signalFrontendReady()
                            throws IOException
Tells the recorder that the frontend is up and ready.

This is required e.g. if the backend needs to transmit the ASK_RECORDING message to the frontend.

Returns:
true if the recorder respond with OK
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_FRONTEND_READY
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

stopPlaying

boolean stopPlaying()
                    throws IOException
Deprecated. 20

Tells the recorder to stop streaming a recording to the frontend.

Usage Hint:

Use stopLiveTv() to stop streaming live TV.

Returns:
true on success.
Throws:
IOException - on communication errors.
Since:
00
See Also:
QUERY_RECORDER_STOP_PLAYING
MythTV protocol range: [00,20)
 VersionDateAdditional Version Info
Added00 
Removed202005-11-05Changelog, SVN-Rev.: 7739

spawnLiveTV

boolean spawnLiveTV()
                    throws IOException
Tells the recorder to start a "Live TV" recording.

Usage Hint:

Use stopLiveTv() to stop streaming live TV.

Returns:
true if the recorder respond with OK
Throws:
IOException - on communication errors
Since:
00
See Also:
spawnLiveTV(boolean, String), QUERY_RECORDER_SPAWN_LIVETV
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

spawnLiveTV

boolean spawnLiveTV(boolean pictureInPicture,
                    IRecorderChannelInfo recorderChannelInfo)
                    throws IOException
Tells the recorder to start a "Live TV" recording.

Usage Hint:

Use stopLiveTv() to stop streaming live TV.

Parameters:
pictureInPicture - specifies if picture in picture should be used. (Since 20).
recorderChannelInfo - the channel to swith the recorder to. (Since 34).
Returns:
true if the backend returned OK.
Throws:
IOException - on communication errors.
Since:
00
See Also:
spawnLiveTV(boolean, String)
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Changed202005-11-05Changelog, SVN-Rev.: 7739
Changed342007-04-13Changelog, SVN-Rev.: 13230
Removed-1 

spawnLiveTV

boolean spawnLiveTV(boolean pictureInPicture,
                    String channelNumber)
                    throws IOException
Tells the recorder to start a "Live TV" recording.

Protocol Version Hint:

For protocols prior to 20, this function also initializes a ringbuffer, required for LiveTV streaming.
See annotateRingBuffer() to get access to this ringbuffer.

If this function is called prior to 34, setChannel(String) is used to switch to the desired channel.

Parameters:
pictureInPicture - specifies if picture in picture should be used. (Since 20).
channelNumber - the channel number to switch to. (Since 34).
Returns:
true if the backend returned OK.
Throws:
IOException - on communication errors
Since:
00
See Also:
IMythCommand.QUERY_RECORDER_SETUP_RING_BUFFER
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Changed202005-11-05Changelog, SVN-Rev.: 7739
Changed342007-04-13Changelog, SVN-Rev.: 13230
Removed-1 

stopLiveTv

boolean stopLiveTv()
                   throws IOException
Tells the recorder to stop a "Live TV" recording.

Usage Hints:

Use spawnLiveTV() to start playing Live TV.

Returns:
true if the recorder returned OK.
Throws:
IOException - on communication errors.
Since:
00
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

isRecording

boolean isRecording()
                    throws IOException
Checks if the recorder is actually recording.

Usage Hint:

Use waitForIsRecording(long) if you need to wait till the recorder is recording.

Returns:
true if the recorder is currently recording.
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_IS_RECORDING
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

waitForIsRecording

boolean waitForIsRecording(long timeoutMs)
                           throws IOException,
                                  InterruptedException
Wait for recording.

Checks if the recorder is actually recording until recording has been started or the timeout has reached.

Parameters:
timeoutMs - the timeout in ms
Returns:
true if the recorder is currently recording
Throws:
IOException - on communication errors
InterruptedException - if the thread was interrupted

finishRecording

boolean finishRecording()
                        throws IOException
Tells the recorder to stop recording, but only after "overrecord" seconds.

Returns:
true if the recorder returned OK
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_FINISH_RECORDING
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

setLiveTvRecording

boolean setLiveTvRecording()
                           throws IOException
Tells the recorder to keep a LiveTV recording.

Returns:
true if the backend returned OK
Throws:
IOException - on communication errors
Since:
26
See Also:
QUERY_RECORDER_SET_LIVE_RECORDING
MythTV protocol range: [26,-1)
 VersionDateAdditional Version Info
Added262006-01-17Changelog, MythTV-Release: 0.19, SVN-Rev.: 8754
Removed-1 

annotateRingBuffer

IRingBuffer annotateRingBuffer()
                               throws IOException
Deprecated. 20

Signals the recorder that we want to use a ring-buffer.

Returns:
true if the recorder respond with OK
Throws:
IOException - on communication errors
Since:
00
See Also:
ANN_RING_BUFFER
MythTV protocol range: [00,20)
 VersionDateAdditional Version Info
Added00 
Removed202005-11-05Changelog, SVN-Rev.: 7739

getRecording

IProgramInfo getRecording()
                          throws IOException
Returns the recorders current recording.

Protocol Version Hint:

Prior to protocol version 20 this function returns null on live-tv recordings.

Returns:
the current recording, or null if the recorder is currently not recording.
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_GET_RECORDING
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Changed202005-11-05Changelog, SVN-Rev.: 7739
Removed-1 

getCurrentRecording

IProgramInfo getCurrentRecording()
                                 throws IOException
Returns the recorders current recording.

Usage Note:

According to the MythTV Player homepage, the backend may crash if this function is called on an idle recorder. Therefore this function first checks via a call to isRecording() if this recorder is busy and if it is not, it just returns null.

Returns:
the current recording, or null if the recorder is currently not recording.
Throws:
IOException - on communication errors
Since:
19 (fallback-from: 00)
See Also:
QUERY_RECORDER_GET_CURRENT_RECORDING
MythTV protocol range: [19,-1)
 VersionDateAdditional Version Info
Fallback00 The function can be can be used with restrictions starting with version 0.
Added192005-10-09Changelog, SVN-Rev.: 7427
Removed-1 

getProgramInfo

IRecorderProgramInfo getProgramInfo()
                                    throws IOException
Deprecated. 21 (fallback-to: -1), use getNextProgramInfo instead.

Gets the current program on the current recorder channel.

This returns information about the program that could be seen on the current channel of the recorder.

Protocol Version Hint:

If you call this function with a protocol version greater than 20, then getNextProgramInfo is used to fetch the information.

Returns:
information about the current program on the current channel of the recorder.
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_GET_PROGRAM_INFO
MythTV protocol range: [00,21)
 VersionDateAdditional Version Info
Added00 
Changed202005-11-05Changelog, SVN-Rev.: 7739
Removed212005-11-10Changelog, SVN-Rev.: 7826
Fallback-1 The function can be can be used with restrictions till version 77.

getNextProgramInfo

IRecorderNextProgramInfo getNextProgramInfo(IBasicChannelInfo channelInfo,
                                            EChannelBrowseDirection direction,
                                            Date startTime)
                                            throws IOException
Gets the next program on the specified channel.

This returns information about the program that would be seen, if we changed the channel using the given direction.

Usage Note:

Use SAME to query the program on the given channel. But if SAME is used, the channel-info must not be null, otherwise the backend will fallback to the first available channel.

Parameters:
channelInfo - the channel to start browsing.
direction - the direction to browse.
startTime - the starting time that should be used for the query
Returns:
the found program information.
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_GET_NEXT_PROGRAM_INFO
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

getNextProgramInfo

IRecorderNextProgramInfo getNextProgramInfo(String channelnumber,
                                            Integer chanID,
                                            EChannelBrowseDirection direction,
                                            Date startTime)
                                            throws IOException
Gets the next program on the specified channel.

This returns information about the program that would be seen, if we changed the channel using the given direction.

Usage Note:

Use SAME to query the program on the given channel. But if SAME is used, the channel-info must not be null, otherwise the backend will fallback to the first available channel.

Parameters:
channelnumber - the number of the channel to start browsing
chanID - the id of the channel
direction - the direction to browse.
startTime - the starting time that should be used for the query
Returns:
the found program information.
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_GET_NEXT_PROGRAM_INFO
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

getNextProgramInfos

List<IRecorderNextProgramInfo> getNextProgramInfos(Date startTime)
                                                   throws IOException
Gets a list containing the next programs of all channels.

This function internally uses getChannelsNextProgramInfoMap(Date).

Usage example:


    IRecorder recorder = ...; // an already connected recorder
    
    // query all currently distributed programs
    List<IRecorderNextProgramInfo> nextPrograms = recorder.getNextProgramInfos(null);
    for(IRecorderNextProgramInfo nextProgram : nextPrograms) {
       // skipping invalid programs
       if(!nextProgram.isValid()) continue;
       
       // print program info
       System.out.println(String.format(
          "%1$tF %1$tT | %2$tF %2$tT | %3$3d min | %4$5s | %5$s",
          nextProgram.getStartDateTime(), nextProgram.getEndDateTime(), nextProgram.getDuration(), 
          nextProgram.getChannelSign(), nextProgram.getFullTitle()
       ));
    }
 

The above example will output, e.g.:
 2012-01-01 14:55:01 | 2012-01-01 16:30:01 |  95 min |  PRO7 | Sind wir endlich fertig?
 2012-01-01 15:10:01 | 2012-01-01 16:40:01 |  90 min |   ARD | Sterne über dem Eis
 2012-01-01 13:45:01 | 2012-01-01 17:05:01 | 200 min |   ZDF | ZDF SPORTextra
 2012-01-01 15:10:01 | 2012-01-01 18:45:01 | 215 min |   RTL | Die ultimative Chart Show - Die erfolgreichsten Hits des Jahres 2011
 2012-01-01 14:10:01 | 2012-01-01 15:45:01 |  95 min | SAT.1 | Die Schöne und das Biest
 2012-01-01 14:45:01 | 2012-01-01 15:30:01 |  45 min |   BR3 | Als die Fremden kamen - Vom Winterurlaub in Tirol
 2012-01-01 14:45:01 | 2012-01-01 15:30:01 |  45 min |  SWBW | Neues aus dem Glottertal
 2012-01-01 13:55:01 | 2012-01-01 15:50:01 | 115 min |  ORF1 | FIS Weltcup Skispringen - HS 140 - Das Springen
 2012-01-01 15:15:01 | 2012-01-01 17:00:01 | 105 min |  ORF2 | Die Zürcher Verlobung
 2012-01-01 14:45:01 | 2012-01-01 16:00:01 |  75 min |  3SAT | Willi und die Wunder dieser Welt
 2012-01-01 14:30:01 | 2012-01-01 16:05:01 |  95 min | KABE1 | Legende
 2012-01-01 15:15:01 | 2012-01-01 16:30:01 |  75 min | SUPRT | Cosmo & Wanda - Wenn Elfen helfen: Alltagshelden - Die Alltagshelden
 2012-01-01 14:35:01 | 2012-01-01 16:15:01 | 100 min |   VOX | Nine Months
 2012-01-01 15:15:01 | 2012-01-01 16:55:01 | 100 min |  RTL2 | Der Todes-Twister
 2012-01-01 14:55:01 | 2012-01-01 15:40:01 |  45 min |  ARTE | Naturparadiese Afrikas - Äthiopien - Land der Extreme
 2012-01-01 13:40:01 | 2012-01-01 15:20:01 | 100 min |  ATV+ | Nach Ansage
 2012-01-01 14:45:00 | 2012-01-01 16:30:00 | 105 min | PULS4 | Louis' unheimliche Begegnung mit den Außerirdischen
 

Parameters:
startTime - the start time. if this is null the current date is used.
Returns:
the next programs of all channels.
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_GET_NEXT_PROGRAM_INFO
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

getChannelsNextProgramInfoMap

Map<Integer,IRecorderNextProgramInfo> getChannelsNextProgramInfoMap(Date startTime)
                                                                    throws IOException
Gets a map containing the next programs of all channels.

This returns a map containing the channel-id as key and recorder-next-program info as value.

This method uses getNextProgramInfo(String, Integer, EChannelBrowseDirection, Date) to loop through all channels and to fetch the current channel program.

Returns:
the channel-program map
Throws:
IOException - on communication errors
Since:
00
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

getChannelInfo

IRecorderChannelInfo getChannelInfo(Integer chanID)
                                    throws IOException
Gets informations about the given channel.

Usage Hint:

Use IBackend.setChannelInfo(String, IRecorderChannelInfo) to change the properties of a channel.

Parameters:
chanID - the id of the desired channel.
Returns:
informations about the given channel
Throws:
IOException - on communication errors
Since:
28
MythTV protocol range: [28,-1)
 VersionDateAdditional Version Info
Added282006-03-28Changelog, SVN-Rev.: 9524
Removed-1 

getChannelInfo

IRecorderChannelInfo getChannelInfo(IBasicChannelInfo channelInfo)
                                    throws IOException
Gets detailed informations about the given channel.

This uses the channel-id of the basic-channel-info object to fetch additional informations about the channel.

Usage Hint:

Use IBackend.setChannelInfo(String, IRecorderChannelInfo) to change the properties of a channel.

Parameters:
channelInfo - the desired channel
Returns:
informations about the given channel *
Throws:
IOException - on communication errors
Since:
28
See Also:
getChannelInfo(Integer), QUERY_RECORDER_GET_CHANNEL_INFO
MythTV protocol range: [28,-1)
 VersionDateAdditional Version Info
Added282006-03-28Changelog, SVN-Rev.: 9524
Removed-1 

getCurrentChannel

<C extends IBasicChannelInfo> C getCurrentChannel()
                                              throws IOException
Gets the currently active channel of the recorder.

Protocol Version Hint:

If the current protocol-version is less than 28 an IBasicChannelInfo object is returned, otherwise an IRecorderChannelInfo object is returned.

Usage example:


    // getting the current input of the recorder
    String recorderInput = recorder.getInput();
    
    // getting the current recorder channel
    IBasicChannelInfo recorderChannel = recorder.getCurrentChannel();
    
    // print infos
    System.out.println(String.format(
       "Recorder %d is using input: %s (channel: %s).",
       recorderId, recorderInput, recorderChannel==null?"-":recorderChannel.getChannelSign()
    ));
 

Type Parameters:
C - the type of the channel information. This is either a IRecorderChannelInfo or a IBasicChannelInfo.
Returns:
the information about the current channel or null.
Throws:
IOException - on communication errors.

getChannelInfos

List<IRecorderChannelInfo> getChannelInfos()
                                           throws IOException
Gets a list of all known channels.

This function uses getChannelsNextProgramInfoMap(Date) to determine the channel-IDs of all known channels and getChannelInfo(Integer) to fetch the info object for each channel.

Response example:

<0>CHANNEL_ID: 11123 | <1>SOURCE_ID: 1 | <2>CHANNEL_SIGN: PULS 4 | <3>CHANNEL_NUMBER: 10123 | <4>CHANNEL_NAME: PULS 4 | <5>XMLTV_ID:
<0>CHANNEL_ID: 12104 | <1>SOURCE_ID: 1 | <2>CHANNEL_SIGN: ServusTV | <3>CHANNEL_NUMBER: 11104 | <4>CHANNEL_NAME: ServusTV | <5>XMLTV_ID:
<0>CHANNEL_ID: 11120 | <1>SOURCE_ID: 1 | <2>CHANNEL_SIGN: ATV | <3>CHANNEL_NUMBER: 10120 | <4>CHANNEL_NAME: ATV | <5>XMLTV_ID:
<0>CHANNEL_ID: 11101 | <1>SOURCE_ID: 1 | <2>CHANNEL_SIGN: ORF1 | <3>CHANNEL_NUMBER: 10101 | <4>CHANNEL_NAME: ORF1 | <5>XMLTV_ID:
<0>CHANNEL_ID: 12102 | <1>SOURCE_ID: 1 | <2>CHANNEL_SIGN: 3SAT | <3>CHANNEL_NUMBER: 11102 | <4>CHANNEL_NAME: 3SAT | <5>XMLTV_ID:
<0>CHANNEL_ID: 11102 | <1>SOURCE_ID: 1 | <2>CHANNEL_SIGN: ORF2 W | <3>CHANNEL_NUMBER: 10102 | <4>CHANNEL_NAME: ORF2 W | <5>XMLTV_ID:
<0>CHANNEL_ID: 12103 | <1>SOURCE_ID: 1 | <2>CHANNEL_SIGN: ORF Sport Plus | <3>CHANNEL_NUMBER: 11103 | <4>CHANNEL_NAME: ORF Sport Plus | <5>XMLTV_ID:

Returns:
a list of all available channels.
Throws:
IOException - on communication errors
Since:
28
MythTV protocol range: [28,-1)
 VersionDateAdditional Version Info
Added282006-03-28Changelog, SVN-Rev.: 9524
Removed-1 

getBasicChannelInfos

<C extends IBasicChannelInfo> List<C> getBasicChannelInfos()
                                                       throws IOException
Gets a list of all known channels.

Protocol Version Hint:

If the current protocol-version is less than 28 an IBasicChannelInfo object is returned, otherwise an IRecorderChannelInfo object is returned.

Usage example:


    IRecorder recorder = ...; // an already connected recorder
    
    // getting all available channel 
    List<IBasicChannelInfo> channels = recorder.getBasicChannelInfos();
    System.out.println(String.format(
       "Id   |  Nr | Sign "				
    ));
    for(IBasicChannelInfo channel : channels) {
       System.out.println(String.format(
          "%04d | %3s | %s",
          channel.getChannelID(),channel.getChannelNumber(), channel.getChannelSign()
       ));
    }
 

The above example will output, e.g.
 Id   |  Nr | Sign 
 1063 |   1 | PRO7
 1064 |   5 | ARD
 1065 |   6 | ZDF
 1066 |   3 | RTL
 1067 |   2 | SAT.1
 1068 |  14 | BR3
 1071 |  16 | SWBW
 1072 |  10 | ORF1
 1073 |  11 | ORF2
 1074 |  18 | A9
 1075 |  12 | 3SAT
 1077 |   7 | KABE1
 1078 |  15 | SUPRT
 1079 |   8 | VOX
 1080 |   4 | RTL2
 1085 |   9 | ARTE
 1091 |  13 | ATV+
 1095 |  17 | PULS4
 

Returns:
a list of all known channels.
Throws:
IOException - on communication errors
Since:
00
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Changed282006-03-28Changelog, SVN-Rev.: 9524
Removed-1 

getInputName

String getInputName()
                    throws IOException
Deprecated. 21, use getInput() instead.

Gets the name of the current recorder input.

Protocol Version Hint:

If this method is called with a protocol-version greater to or equal with 27, then the function getInput() is called instead.

Returns:
the name of the current input, e.g. DVBInput
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_GET_INPUT_NAME
MythTV protocol range: [00,21)
 VersionDateAdditional Version Info
Added00 
Removed212005-11-10Changelog, SVN-Rev.: 7826

getInput

String getInput()
                throws IOException
Gets the name of the current recorder input.

Protocol Version Hint:

If this method is called prior to , then getInputName() is called instead.

Returns:
the name of the current recorder input, e.g. DVBInput or Tuner 1. If the recorder is currently not active null is returned.
Throws:
IOException - on communication errors
Since:
27
See Also:
QUERY_RECORDER_GET_INPUT
MythTV protocol range: [27,-1)
 VersionDateAdditional Version Info
Added272006-02-15Changelog, SVN-Rev.: 8973
Removed-1 

setInput

boolean setInput(String inputName)
                 throws IOException
Tells the recorder to change to the specified input.

Parameters:
inputName - the name of the input to change to.
Returns:
true if the input was switched successfully.
Throws:
IOException - on communication errors
Since:
27
See Also:
QUERY_RECORDER_SET_INPUT
MythTV protocol range: [27,-1)
 VersionDateAdditional Version Info
Added272006-02-15Changelog, SVN-Rev.: 8973
Removed-1 

toggleInputs

boolean toggleInputs()
                     throws IOException
Deprecated. 27 (fallback-to: -1), replaced by setInput(String) and switchToNextInput().

Tells the recorder to change to the next input.

Protocol Version Hint:

If this method is called with a protocol-version starting with 27, then the function switchToNextInput() is called instead.

Returns:
true if the backend respond with ok.
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_TOGGLE_INPUTS
MythTV protocol range: [00,27)
 VersionDateAdditional Version Info
Added00 
Removed272006-02-15Changelog, SVN-Rev.: 8973
Fallback-1 The function can be can be used with restrictions till version 77.

switchToNextInput

String switchToNextInput()
                         throws IOException
Tells the recorder to switch to the next input.

Protocol Version Hint:

If this function is called for protocols prior to 27, then toggleInputs() is called.

Returns:
the name of the new input
Throws:
IOException - on communication errors
Since:
27 (fallback-from: 00)
See Also:
QUERY_RECORDER_SET_INPUT
MythTV protocol range: [27,-1)
 VersionDateAdditional Version Info
Fallback00 The function can be can be used with restrictions starting with version 0.
Added272006-02-15Changelog, SVN-Rev.: 8973
Removed-1 

checkChannel

boolean checkChannel(String channelNumber)
                     throws IOException
Checks if named channel exists on current tuner.

Parameters:
channelNumber - the channel number
Returns:
true if it succeeds, false otherwise.
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_CHECK_CHANNEL
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

checkChannelPrefix

IRecorderChannelPrefixStatus checkChannelPrefix(String channelNumberPrefix)
                                                throws IOException
Checks a channel-number prefix against the channels in the MythTV-DB.

Parameters:
channelNumberPrefix - the channel number prefix
Returns:
the matching status
Throws:
IOException - on communication errors.
Since:
See Also:
QUERY_RECORDER_CHECK_CHANNEL_PREFIX
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

changeChannel

boolean changeChannel(EChannelChangeDirection direction)
                      throws IOException
Changes to the next or previous channel.

Usage Note:

You must pause the recorder before doing this.

Throws:
IOException - on communication errors
Since:
00
See Also:
changeChannel(int), QUERY_RECORDER_CHANGE_CHANNEL
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

changeChannel

boolean changeChannel(int direction)
                      throws IOException
Changes to the next or previous channel.

Usage Note:

You must pause the recorder before doing this.

Parameters:
direction - 0=up, 1=down, 2=favorite, 3=same
Returns:
true if the channel was changed successfully.
Throws:
IOException - on communication errors.
Since:
00
See Also:
QUERY_RECORDER_CHANGE_CHANNEL
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

setChannel

boolean setChannel(String channelNumber)
                   throws IOException
Changes to a named channel on the current tuner.

Usage Note:

You must pause the recorder before doing this.

Parameters:
channelNumber - the channel number
Returns:
true if the backend returned OK.
Throws:
IOException - on communication errors.
Since:
00
See Also:
QUERY_RECORDER_SET_CHANNEL
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

shouldSwitchCard

boolean shouldSwitchCard(Integer channelID)
                         throws IOException
Checks if named channel exists on current tuner, or another tuner.

Parameters:
channelID - the id of the channel
Returns:
true rue if the channel on another tuner and not current tuner, false otherwise. This also returns false if the channel id is unknown.
Throws:
IOException - on communication errors.
Since:
17
See Also:
QUERY_RECORDER_SHOULD_SWITCH_CARD
MythTV protocol range: [17,-1)
 VersionDateAdditional Version Info
Added172005-05-24Changelog, SVN-Rev.: 6482
Removed-1 

toggleChannelFavorite

boolean toggleChannelFavorite()
                              throws IOException
Adds or removes the current channel from the favorite channel list.

Returns:
true if the recorder respond with OK.
Throws:
IOException - on communication errors.
Since:
00
See Also:
QUERY_RECORDER_TOGGLE_CHANNEL_FAVORITE
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

toggleChannelFavorite

boolean toggleChannelFavorite(String channelGroup)
                              throws IOException
Adds or removes the current channel to or from the given channel group.

Parameters:
channelGroup - the name of the channel group (since 45). If this is null, ProtocolConstants.CHANNEL_GROUP_DEFAULT is used as group.
Returns:
true if the recorder respond with OK.
Throws:
IOException - on communication errors.
Since:
00
See Also:
QUERY_RECORDER_TOGGLE_CHANNEL_FAVORITE
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Changed452009-05-09Changelog, SVN-Rev.: 20523
Removed-1 

getFramesWritten

long getFramesWritten()
                      throws IOException
Returns the number of frames written to disk.

Usage Hint:

Use waitForFramesWritten(long) if you need to wait for a given amount of frames.

Returns:
the number of frames written to disk or -1 if the recorder is not recording.
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_GET_FRAMES_WRITTEN
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

waitForFramesWritten

long waitForFramesWritten(long desiredFrames)
                          throws IOException,
                                 InterruptedException
Wait for number of frames written.

This function uses getFramesWritten() to determine the current amount of frames written and waits till the requested amount of frames was writte.

Parameters:
desiredFrames - the amount of frames that should be written
Returns:
the actual amount of frames written
Throws:
IOException - on communication errors
InterruptedException - if the thread was interrupted
Since:
00
See Also:
QUERY_RECORDER_GET_FRAMES_WRITTEN
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

getFrameRate

float getFrameRate()
                   throws IOException
Returns the recording frame rate.

Returns:
the recording frame rate
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_GET_FRAMERATE
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

getFilePosition

long getFilePosition()
                     throws IOException
Returns the total number of bytes written by the recorder.

Returns:
the total number of bytes written.
Throws:
IOException
Since:
00
See Also:
QUERY_RECORDER_GET_FILE_POSITION
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

getFreeInputs

IFreeInputList getFreeInputs()
                             throws IOException
Gets all free inputs of the recorder.

Returns:
a list of free inputs or null if there is no free input.
Throws:
IOException - on communication errors
Since:
37
See Also:
QUERY_RECORDER_GET_FREE_INPUTS
MythTV protocol range: [37,-1)
 VersionDateAdditional Version Info
Added372008-01-14Changelog, SVN-Rev.: 15437
Removed-1 

getConnectedInputs

List<String> getConnectedInputs()
                                throws IOException
Deprecated. 37 (fallback-to: -1)

Get all inputs configured for the recorder.

Protocol Version Hint:

If this function is called with protocol versions greater than 37, getFreeInputs() and getInput() are used to determine the input names.

Returns:
the names of all known inputs
Throws:
IOException
Since:
27
See Also:
QUERY_RECORDER_GET_CONNECTED_INPUTS
MythTV protocol range: [27,37)
 VersionDateAdditional Version Info
Added272006-02-15Changelog, SVN-Rev.: 8973
Removed372008-01-14Changelog, SVN-Rev.: 15437
Fallback-1 The function can be can be used with restrictions till version 77.

getColour

Integer getColour()
                  throws IOException

Gets the colour of a recording.

Throws:
IOException - on communication errors
Since:
30
See Also:
QUERY_RECORDER_GET_COLOUR
MythTV protocol range: [30,-1)
 VersionDateAdditional Version Info
Added302006-05-22Changelog, MythTV-Release: 0.20, SVN-Rev.: 9968
Removed-1 

getContrast

Integer getContrast()
                    throws IOException

Gets the contrast of a recording.

Throws:
IOException - on communication errors
Since:
30
See Also:
QUERY_RECORDER_GET_CONTRAST
MythTV protocol range: [30,-1)
 VersionDateAdditional Version Info
Added302006-05-22Changelog, MythTV-Release: 0.20, SVN-Rev.: 9968
Removed-1 

getBrightness

Integer getBrightness()
                      throws IOException

Gets the brightness of a recording.

Throws:
IOException - on communication errors
Since:
30
See Also:
QUERY_RECORDER_GET_BRIGHTNESS
MythTV protocol range: [30,-1)
 VersionDateAdditional Version Info
Added302006-05-22Changelog, MythTV-Release: 0.20, SVN-Rev.: 9968
Removed-1 

getHue

Integer getHue()
               throws IOException

Gets the hue of a recording.

Throws:
IOException - on communication errors
Since:
30
See Also:
QUERY_RECORDER_GET_HUE
MythTV protocol range: [30,-1)
 VersionDateAdditional Version Info
Added302006-05-22Changelog, MythTV-Release: 0.20, SVN-Rev.: 9968
Removed-1 

changeColour

Integer changeColour(boolean up)
                     throws IOException
Changes the colour of a recording.

Parameters:
up - the direction, true means increase.
Returns:
the new value
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_CHANGE_COLOUR
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

changeColour

Integer changeColour(EPictureAdjustmentType adjustmentType,
                     boolean up)
                     throws IOException
Changes the colour value.

Parameters:
adjustmentType - the adjustment type (Since 30)
up - the direction, true means increase.
Returns:
the new value
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_CHANGE_COLOUR
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Changed302006-05-22Changelog, MythTV-Release: 0.20, SVN-Rev.: 9968
Removed-1 

changeContrast

Integer changeContrast(boolean up)
                       throws IOException
Changes the contrast of a recording.

Parameters:
up - the direction, true means increase.
Returns:
the new value
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_CHANGE_CONTRAST
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

changeContrast

Integer changeContrast(EPictureAdjustmentType adjustmentType,
                       boolean up)
                       throws IOException
Changes the contrast value.

Parameters:
adjustmentType - the adjustment type (Since 30)
up - the direction, true means increase.
Returns:
the new value
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_CHANGE_CONTRAST
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Changed302006-05-22Changelog, MythTV-Release: 0.20, SVN-Rev.: 9968
Removed-1 

changeBrightness

Integer changeBrightness(boolean up)
                         throws IOException
Changes the brightness of a recording.

Parameters:
up - the direction, true means increase.
Returns:
the new value
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_CHANGE_BRIGHTNESS
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

changeBrightness

Integer changeBrightness(EPictureAdjustmentType adjustmentType,
                         boolean up)
                         throws IOException
Changes the brightness value.

Parameters:
adjustmentType - the adjustment type (Since 30)
up - the direction, true means increase.
Returns:
the new value
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_CHANGE_BRIGHTNESS
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Changed302006-05-22Changelog, MythTV-Release: 0.20, SVN-Rev.: 9968
Removed-1 

changeHue

Integer changeHue(boolean up)
                  throws IOException
Changes the hue value of a recording.

Parameters:
up - the direction, true means increase.
Returns:
the new value
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_CHANGE_HUE
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

changeHue

Integer changeHue(EPictureAdjustmentType adjustmentType,
                  boolean up)
                  throws IOException
Changes the hue value.

Parameters:
adjustmentType - the adjustment type (Since 30)
up - the direction, true means increase.
Returns:
the new value
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_CHANGE_HUE
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Changed302006-05-22Changelog, MythTV-Release: 0.20, SVN-Rev.: 9968
Removed-1 

getMaxBitrate

long getMaxBitrate()
                   throws IOException
Gets the maximum bitrate a recorder can output.

Throws:
IOException - on communication errors
Since:
17
See Also:
QUERY_RECORDER_GET_MAX_BITRATE
MythTV protocol range: [17,-1)
 VersionDateAdditional Version Info
Added172005-05-24Changelog, SVN-Rev.: 6482
Removed-1 

setSignalMonitoringRate

int setSignalMonitoringRate(int rate,
                            boolean notifyFrontend)
                            throws IOException
Sets the signal monitoring rate.

Usage Note:

ATTENTION: this can only be set in LiveTV Mode. You also need to pause() the recorder before calling this function.

Parameters:
rate - Milliseconds between each signal check, 0 to disable, -1 to preserve old value.
notifyFrontend - If 1 SIGNAL messages are sent to the frontend, if 0 SIGNAL messages will not be sent, and if -1 the old value is preserved.
Returns:
Old rate if it succeeds, -1 if it fails.
Throws:
IOException - on communication errors
Since:
18
See Also:
QUERY_RECORDER_SET_SIGNAL_MONITORING_RATE
MythTV protocol range: [18,-1)
 VersionDateAdditional Version Info
Added182005-07-19Changelog, SVN-Rev.: 6865
Removed-1 

pause

boolean pause()
              throws IOException
Tells the recorder to pause a recorder.

Returns:
true if the recorder respond with OK.
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_PAUSE
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

cancelNextRecording

boolean cancelNextRecording(Boolean cancel)
                            throws IOException
Tells the recorder to cancel or continue the next recording.

This is used when the user is watching "Live TV" and does not want to allow the recorder to be taken for a pending recording.

Parameters:
cancel - if the next recording should be canceled or continued (Since 23).
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_CANCEL_NEXT_RECORDING
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Changed232006-01-10Changelog, SVN-Rev.: 8553
Removed-1 

setNextLiveTvDirectory

boolean setNextLiveTvDirectory(String path)
                               throws IOException
Changes LiveTV recording directory.

Parameters:
path - the new path
Returns:
true on success
Throws:
IOException - on communication errors
Since:
32
See Also:
SET_NEXT_LIVETV_DIR
MythTV protocol range: [32,-1)
 VersionDateAdditional Version Info
Added322006-11-30Changelog, SVN-Rev.: 12151
Removed-1 

getKeyframePosition

long getKeyframePosition(long frameNumber)
                         throws IOException
Returs the byte position for the given frame number.

Parameters:
frameNumber - the desired frame number.
Returns:
the frame pisition in bytes or -1
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_GET_KEYFRAME_POS
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Removed-1 

fillPositionMap

Map<Long,Long> fillPositionMap(long frameNumberStart,
                               long frameNumberEnd)
                               throws IOException
Returns the keyframe position map.

Protocol Version Hint:

For protocol version prior to 43, only 32 bit integer values are supported as frame-numbers.
If this fuction is valled with larger frame numbers getKeyframePosition(long) is used instead, if no more than 1000 frames should be tested, otherwise this function call returns an empty list.

Parameters:
frameNumberStart - the starting frame number
frameNumberEnd - the ending frame number
Returns:
a map containing the keyframe number as key and the byte position of the key frame as value
Throws:
IOException - on communication errors
Since:
00
See Also:
QUERY_RECORDER_FILL_POSITION_MAP
MythTV protocol range: [00,-1)
 VersionDateAdditional Version Info
Added00 
Changed432008-12-22Changelog, SVN-Rev.: 19417
Removed-1 

fillDurationMap

Map<Long,Long> fillDurationMap(long start,
                               long end)
                               throws IOException
Throws:
IOException
Since:
77
See Also:
QUERY_RECORDER_FILL_DURATION_MAP
MythTV protocol range: [77,-1)
 VersionDateAdditional Version Info
Added772013-01-01Changelog, MythTV-Release: 0.26
Removed-1 


Copyright © 2008-2013. All Rights Reserved.