Bayonne
|
Container class for applications implimenting the libexec process method of Bayonne interfacing. More...
#include <libexec.h>
Public Member Functions | |
Libexec () | |
Initialize libexec. | |
const char * | getEnv (const char *id) |
Get a header record item. | |
const char * | getArg (const char *id) |
Get a named libexec command line argument. | |
const char * | getPath (const char *filename, char *buffer, unsigned size) |
Get a fully qualified and resolved pathname. | |
const char * | getFile (const char *filename) |
Get and verify partial pathname for file oriented libexec commands. | |
void | setVoice (const char *voice) |
Set the effective voice library to use. | |
void | setLevel (Audio::Level level) |
Set the effective audio level for tones... | |
void | hangupSession (void) |
Hangup running session... | |
void | detachSession (unsigned code) |
Resume server session, libexec continues detached. | |
result_t | sendCommand (const char *text, char *buffer=NULL, unsigned size=0) |
Send a command through to server and capture result. | |
result_t | sendResult (const char *text) |
Send a result to the server. | |
void | sendError (const char *msg) |
Send an error to the server. | |
result_t | xferCall (const char *dest) |
Transfer a call. | |
result_t | replayFile (const char *file) |
Replay an audio file. | |
result_t | replayOffset (const char *file, const char *offset) |
Replay an audio file from a specified offset. | |
result_t | recordFile (const char *file, timeout_t duration, timeout_t silence=0) |
Record an audio file. | |
result_t | speak (const char *format,...) |
Play a phrase. | |
result_t | playTone (const char *name, timeout_t duration=0, unsigned level=0) |
Play a tone. | |
result_t | playSingleTone (short f1, timeout_t duration, unsigned level=0) |
result_t | playDualTone (short f1, short f2, timeout_t duration, unsigned level=0) |
result_t | recordOffset (const char *file, const char *offset, timeout_t duration, timeout_t silence=0) |
Record an audio file to a specified offset. | |
result_t | eraseFile (const char *file) |
Erase an audio file. | |
result_t | moveFile (const char *file1, const char *file2) |
Move an audio file. | |
result_t | clearInput (void) |
Flush input. | |
bool | waitInput (timeout_t timeout) |
Wait for input. | |
result_t | readInput (char *buffer, unsigned size, timeout_t timeout) |
Read a line of input. | |
char | readKey (timeout_t timeout) |
Read a single key of input. | |
result_t | sizeSym (const char *id, unsigned size) |
result_t | addSym (const char *id, const char *value) |
result_t | setSym (const char *id, const char *value) |
result_t | getSym (const char *id, char *buf, unsigned size) |
void | postSym (const char *id, const char *value) |
Post a symbol asychrononous event to server. | |
Public Attributes | |
result_t | result |
char | digits [64] |
char | query [512] |
char | position [32] |
unsigned | exitcode |
unsigned | reply |
Protected Attributes | |
Keydata | head |
Keydata | args |
const char * | tsid |
const char * | voice |
Audio::Level | level |
Container class for applications implimenting the libexec process method of Bayonne interfacing.
This is intended for writing external apps and is neatly tucked away into libbayonne as well.
ost::Libexec::Libexec | ( | ) |
Initialize libexec.
result_t ost::Libexec::addSym | ( | const char * | id, |
const char * | value | ||
) |
result_t ost::Libexec::clearInput | ( | void | ) |
Flush input.
void ost::Libexec::detachSession | ( | unsigned | code | ) |
Resume server session, libexec continues detached.
result_t ost::Libexec::eraseFile | ( | const char * | file | ) |
Erase an audio file.
name | of file to erase. |
const char* ost::Libexec::getArg | ( | const char * | id | ) |
Get a named libexec command line argument.
id | of libexec argument. |
const char* ost::Libexec::getEnv | ( | const char * | id | ) |
Get a header record item.
id | of header or sys env item. |
const char* ost::Libexec::getFile | ( | const char * | filename | ) |
Get and verify partial pathname for file oriented libexec commands.
filename | path to evaluate. |
const char* ost::Libexec::getPath | ( | const char * | filename, |
char * | buffer, | ||
unsigned | size | ||
) |
Get a fully qualified and resolved pathname.
filename | path to evaluate. |
buffer | to save into. |
size | of buffer. |
result_t ost::Libexec::getSym | ( | const char * | id, |
char * | buf, | ||
unsigned | size | ||
) |
void ost::Libexec::hangupSession | ( | void | ) |
Hangup running session...
result_t ost::Libexec::moveFile | ( | const char * | file1, |
const char * | file2 | ||
) |
Move an audio file.
name | of file to move. |
destination | of move. |
result_t ost::Libexec::playDualTone | ( | short | f1, |
short | f2, | ||
timeout_t | duration, | ||
unsigned | level = 0 |
||
) |
result_t ost::Libexec::playSingleTone | ( | short | f1, |
timeout_t | duration, | ||
unsigned | level = 0 |
||
) |
result_t ost::Libexec::playTone | ( | const char * | name, |
timeout_t | duration = 0 , |
||
unsigned | level = 0 |
||
) |
Play a tone.
name | of tone to play. |
duration | for tone. |
audio | level of tone. |
void ost::Libexec::postSym | ( | const char * | id, |
const char * | value | ||
) |
Post a symbol asychrononous event to server.
This sets the symbol value, and also generates a :symname event.
id | of symbol to post. |
value | of symbol. |
result_t ost::Libexec::readInput | ( | char * | buffer, |
unsigned | size, | ||
timeout_t | timeout | ||
) |
Read a line of input.
input | buffer. |
size | of input buffer. |
timeout | for input. |
char ost::Libexec::readKey | ( | timeout_t | timeout | ) |
Read a single key of input.
timeout | for read. |
result_t ost::Libexec::recordFile | ( | const char * | file, |
timeout_t | duration, | ||
timeout_t | silence = 0 |
||
) |
Record an audio file.
name | of file to record. |
total | duration of file. |
optional | silence detect. |
result_t ost::Libexec::recordOffset | ( | const char * | file, |
const char * | offset, | ||
timeout_t | duration, | ||
timeout_t | silence = 0 |
||
) |
Record an audio file to a specified offset.
name | of file to record. |
offset | to record info. |
total | duration of file. |
optional | silence detect. |
result_t ost::Libexec::replayFile | ( | const char * | file | ) |
Replay an audio file.
name | of file to play. |
result_t ost::Libexec::replayOffset | ( | const char * | file, |
const char * | offset | ||
) |
Replay an audio file from a specified offset.
name | of file to play. |
offset | to play from. |
result_t ost::Libexec::sendCommand | ( | const char * | text, |
char * | buffer = NULL , |
||
unsigned | size = 0 |
||
) |
Send a command through to server and capture result.
command | to send. |
optional | query buffer. |
optional | query size. |
void ost::Libexec::sendError | ( | const char * | msg | ) |
Send an error to the server.
error | msg to send. |
result_t ost::Libexec::sendResult | ( | const char * | text | ) |
Send a result to the server.
result | to send. |
void ost::Libexec::setLevel | ( | Audio::Level | level | ) | [inline] |
Set the effective audio level for tones...
level | to set. |
result_t ost::Libexec::setSym | ( | const char * | id, |
const char * | value | ||
) |
void ost::Libexec::setVoice | ( | const char * | voice | ) | [inline] |
Set the effective voice library to use.
voice | to set or NULL for default. |
result_t ost::Libexec::sizeSym | ( | const char * | id, |
unsigned | size | ||
) |
result_t ost::Libexec::speak | ( | const char * | format, |
... | |||
) |
Play a phrase.
text | of phrase to play. |
bool ost::Libexec::waitInput | ( | timeout_t | timeout | ) |
Wait for input.
result_t ost::Libexec::xferCall | ( | const char * | dest | ) |
Transfer a call.
destination | to transfer. |
Keydata ost::Libexec::args [protected] |
char ost::Libexec::digits[64] |
unsigned ost::Libexec::exitcode |
Keydata ost::Libexec::head [protected] |
Audio::Level ost::Libexec::level [protected] |
char ost::Libexec::position[32] |
char ost::Libexec::query[512] |
unsigned ost::Libexec::reply |
const char* ost::Libexec::tsid [protected] |
const char* ost::Libexec::voice [protected] |