#define MAX_STREAM_CNT 1000
/* Messages to be used for callbacks output (for pool state changing) */
-static char *stream_messages[MAX_POOL_CNT][MAX_STREAM_CNT] = {{ NULL }};
+static char *stream_messages[MAX_POOL_CNT][MAX_STREAM_CNT] = { { NULL } };
/* Messages to be used for callbacks output (for stream state changing) */
-static char *stream_scripts[MAX_POOL_CNT][MAX_STREAM_CNT] = {{ NULL }};
+static char *stream_scripts[MAX_POOL_CNT][MAX_STREAM_CNT] = { { NULL } };
static const char *__stringify_sound_pool_error(sound_pool_error_e error);
static int __proxy_sound_pool_execute_script(const char *pars);
char tag[MAX_PATH_LEN] = {'\0'};
if ((pars == NULL) || sscanf(pars, " %zu %"MAX_PATH_LEN_STR"[^ ] %i %f %u",
- &idx, tag, &loop, &volume, &rank) < 2) {
+ &idx, tag, &loop, &volume, &rank) < 2) {
_printf(CMD_COLOR_RED, "You have to specify at least pool identifier and "
"source tag to be played in stream! Format: " CMD_PLAY_STREAM
" <pool id> <source tag> <loop> <volume> <priority rank>... "
char msg[MAX_MSG_LEN] = { '\0' };
if ((pars == NULL) || sscanf(pars, " %zu %zu %"MAX_MSG_LEN_STR"[^ ]",
- &idx, &stream_idx, msg) < 3) {
+ &idx, &stream_idx, msg) < 3) {
_printf(CMD_COLOR_RED, "You have to specify both identifier of the "
"pool and stream, plus message to be shown each time when "
"state of the stream is changed! Message should be a single "
char scr[MAX_MSG_LEN] = { '\0' };
if ((pars == NULL) || sscanf(pars, " %zu %zu %"MAX_MSG_LEN_STR"[^ ]",
- &idx, &stream_idx, scr) < 3) {
+ &idx, &stream_idx, scr) < 3) {
_printf(CMD_COLOR_RED, "You have to specify both identifier of the "
"pool and stream, plus file with script to be executed each "
"time when state of the stream is changed! Message should be a "
/* CMD_SET_STREAM_PRIORITY */ 3, /* CMD_GET_STREAM_PRIORITY */ 2,
/* CMD_GET_STREAM_STATE */ 2, /* CMD_SET_STREAM_CB_MSG */ 3,
/* CMD_SET_STREAM_CB_SCRIPT */ 3, /* CMD_UNSET_STREAM_CB */ 2,
- /* CMD_EXECUTE_SCRIPT */ 1, /* CMD_SLEEP */ 1 };
+ /* CMD_EXECUTE_SCRIPT */ 1, /* CMD_SLEEP */ 1 };
/* Command -> Function mapping */
static int (*cmd_fcns[MAX_COMMAND_LINE_LEN])() = {
/* CMD_SET_STREAM_CB_MSG */ __proxy_sound_pool_set_stream_state_change_callback_message,
/* CMD_SET_STREAM_CB_SCRIPT */ __proxy_sound_pool_set_stream_state_change_callback_script,
/* CMD_UNSET_STREAM_CB */ __proxy_sound_pool_unset_stream_state_change_callback,
- /* CMD_EXECUTE_SCRIPT */ __proxy_sound_pool_execute_script,
+ /* CMD_EXECUTE_SCRIPT */ __proxy_sound_pool_execute_script,
/* CMD_SLEEP */ __proxy_sleep };
int _exec_cmd(const char *cmd_line)
if (strlen(cmd_line) == 0) return OK;
size_t trim_len = 0;
- while((cmd_line + trim_len)[0] == ' ')
+ while ((cmd_line + trim_len)[0] == ' ')
trim_len++;
const char *cmd = cmd_line + trim_len;
static _cmd_history_t *_cmd_history_curp = NULL;
static char OUTPUT_LOG_FILE[MAX_PATH_LEN] = "out.log";
-void print_usage() {
- printf( "Usage: sound_pool_test [options] \n");
- printf( "Test Suite for testing Tizen SoundPool module \n");
- printf( "-h, --help - shows this help; \n");
- printf( "-s, --script=SCRIPT - executes commands from the text file \n"
+void print_usage()
+{
+ printf("Usage: sound_pool_test [options] \n");
+ printf("Test Suite for testing Tizen SoundPool module \n");
+ printf("-h, --help - shows this help; \n");
+ printf("-s, --script=SCRIPT - executes commands from the text file \n"
" directly after start; \n");
- printf( "-t, --target=TARGET(S) - selects the target or targets to \n"
+ printf("-t, --target=TARGET(S) - selects the target or targets to \n"
" output logs. Possible targets are: \n"
" stderr, dlog, file. You can also \n"
" select multiple targets using coma. \n"
" > sound_pool_test -t stderr,file \n"
" will output both in standard \n"
" error and file; \n");
- printf( "-f, --file=FILEPATH - selects file for file output logging.\n"
+ printf("-f, --file=FILEPATH - selects file for file output logging.\n"
" Works only in -t argument value \n"
" includes 'file' target; \n");
}
size_t len1 = strnlen(str1, MAX_COMMAND_LINE_LEN);
size_t len2 = strnlen(str2, MAX_COMMAND_LINE_LEN);
size_t idx = 0;
- while(idx < len1 && idx < len2) {
+ while (idx < len1 && idx < len2) {
if (str1[idx] != str2[idx])
break;
++idx;
int getch(void)
{
- struct termios oldattr, newattr;
- int ch;
- tcgetattr(STDIN_FILENO, &oldattr);
- newattr = oldattr;
- newattr.c_lflag &= ~(ICANON | ECHO);
- tcsetattr(STDIN_FILENO, TCSANOW, &newattr);
- ch = getchar();
- tcsetattr(STDIN_FILENO, TCSANOW, &oldattr);
- return ch;
+ struct termios oldattr, newattr;
+ int ch;
+ tcgetattr(STDIN_FILENO, &oldattr);
+ newattr = oldattr;
+ newattr.c_lflag &= ~(ICANON | ECHO);
+ tcsetattr(STDIN_FILENO, TCSANOW, &newattr);
+ ch = getchar();
+ tcsetattr(STDIN_FILENO, TCSANOW, &oldattr);
+ return ch;
}
size_t ts_getline(char *cmd_line)