public abstract class Pronto extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Pronto.NonProntoFormatException |
| Modifier and Type | Field and Description |
|---|---|
static int |
CHARS_IN_DIGIT
Number of characters in the hexadecimal digits of Pronto strings.
|
static double |
FREQUENCY_CONSTANT
Constant used for computing the frequency code from the frequency
|
protected static int |
FREQUENCY_INDEX |
static String |
HEX_STRING_FORMAT
Format code used to format integers in the Pronto Hex.
|
protected static int |
INTRO_LENGTH_INDEX |
protected static int |
LEARNED_CODE
Constant denoting "learned", modulated signals.
|
protected static int |
LEARNED_UNMODULATED_CODE
Constant denoting "learned", non-modulated signals.
|
protected static int |
MIN_CCF_LENGTH |
protected static int |
NUMBER_METADATA |
protected static int |
REPEAT_LENGTH_INDEX |
protected static int |
TYPE_INDEX |
| Modifier | Constructor and Description |
|---|---|
protected |
Pronto() |
| Modifier and Type | Method and Description |
|---|---|
static String |
formatInteger(int n)
Formats an integer like seen in CCF strings, in printf-ish, using "%04X".
|
static double |
frequency(int code)
Computes the carrier frequency in Hz.
|
static int |
frequencyCode(double frequency)
Returns frequency code from frequency in Hz (the second number in the CCF).
|
static void |
main(String[] args) |
static IrSignal |
parse(int[] ccf)
Creates a new IrSignals by interpreting its argument as CCF signal.
|
static IrSignal |
parse(List<String> list)
Creates a new IrSignals by interpreting its argument as CCF string.
|
static IrSignal |
parse(String ccfString)
Creates a new IrSignals by interpreting its argument as CCF string.
|
static IrSignal |
parse(String[] array)
Creates a new IrSignals by interpreting its argument as CCF string.
|
static IrSignal |
parse(String[] array,
int begin)
Creates a new IrSignals by interpreting its argument as CCF string.
|
(package private) static IrSignal |
parse(String ccfString,
boolean loose) |
protected static int[] |
parseAsInts(List<String> list) |
protected static int[] |
parseAsInts(String ccfString)
Tries to parse the string as argument.
|
static int[] |
parseAsInts(String[] array,
int begin)
Tries to parse the strings as argument.
|
static IrSignal |
parseLoose(String ccfString) |
static int |
pulses(double time,
double frequency)
Computes number of cycles of the carrier the first argument will require.
|
static int |
pulsesMicroSeconds(double time,
double frequency)
Computes number of cycles of the carrier the first argument will require.
|
static double |
pulseTime(int code)
Computes pulse time in seconds.
|
static int[] |
toArray(IrSignal irSignal)
CCF array of complete signal, i.e.
|
static String |
toString(int[] array)
Formats a CCF as string.
|
static String |
toString(IrSignal irSignal)
Computes the ("long", raw) CCF string, if possible.
|
public static final int CHARS_IN_DIGIT
public static final double FREQUENCY_CONSTANT
public static final String HEX_STRING_FORMAT
protected static final int LEARNED_CODE
protected static final int LEARNED_UNMODULATED_CODE
protected static final int TYPE_INDEX
protected static final int FREQUENCY_INDEX
protected static final int INTRO_LENGTH_INDEX
protected static final int REPEAT_LENGTH_INDEX
protected static final int NUMBER_METADATA
protected static final int MIN_CCF_LENGTH
public static String formatInteger(int n)
n - Integer to be formatted.public static int frequencyCode(double frequency)
frequency - Frequency in Hz.public static double frequency(int code)
throws InvalidArgumentException
code - Pronto frequency codeInvalidArgumentExceptionpublic static double pulseTime(int code)
throws InvalidArgumentException
code - Pronto frequency code.InvalidArgumentExceptionpublic static int pulses(double time,
double frequency)
throws InvalidArgumentException
time - duration in secondsfrequency - InvalidArgumentException - if frequency <= 0.public static int pulsesMicroSeconds(double time,
double frequency)
throws InvalidArgumentException
time - duration in micro secondsfrequency - InvalidArgumentException - if frequency <= 0.public static IrSignal parse(int[] ccf) throws OddSequenceLengthException, InvalidArgumentException
ccf - CCF signalOddSequenceLengthExceptionInvalidArgumentExceptionpublic static IrSignal parse(String ccfString) throws Pronto.NonProntoFormatException, InvalidArgumentException
ccfString - CCF signalInvalidArgumentExceptionPronto.NonProntoFormatExceptionpublic static IrSignal parseLoose(String ccfString) throws Pronto.NonProntoFormatException, InvalidArgumentException
static IrSignal parse(String ccfString, boolean loose) throws Pronto.NonProntoFormatException, InvalidArgumentException
public static IrSignal parse(String[] array, int begin) throws Pronto.NonProntoFormatException, InvalidArgumentException
array - Strings representing hexadecimal numbersbegin - Starting indexPronto.NonProntoFormatExceptionInvalidArgumentExceptionpublic static IrSignal parse(String[] array) throws InvalidArgumentException, Pronto.NonProntoFormatException
array - Strings representing hexadecimal numbersInvalidArgumentExceptionPronto.NonProntoFormatExceptionpublic static IrSignal parse(List<String> list) throws InvalidArgumentException, Pronto.NonProntoFormatException
list - Strings representing hexadecimal numbersInvalidArgumentExceptionPronto.NonProntoFormatExceptionprotected static int[] parseAsInts(String ccfString) throws Pronto.NonProntoFormatException
ccfString - Input string, to be parsed/tested.Pronto.NonProntoFormatExceptionpublic static int[] parseAsInts(String[] array, int begin) throws Pronto.NonProntoFormatException
array - Input strings, to be parsed/tested.begin - Starting indexPronto.NonProntoFormatExceptionprotected static int[] parseAsInts(List<String> list) throws Pronto.NonProntoFormatException
Pronto.NonProntoFormatExceptionpublic static int[] toArray(IrSignal irSignal) throws OddSequenceLengthException, InvalidArgumentException
irSignal - OddSequenceLengthExceptionInvalidArgumentExceptionpublic static String toString(IrSignal irSignal)
irSignal - public static String toString(int[] array)
array - CCF in form of an integer array.public static void main(String[] args)
args - Copyright © 2019. All rights reserved.