Changeset 2158 for pjproject/trunk/pjsip-apps/src/python/_pjsua.c
- Timestamp:
- Jul 19, 2008 3:40:21 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/python/_pjsua.c
r2156 r2158 3458 3458 3459 3459 /* 3460 * py_pjsua_conf_set_tx_level 3461 */ 3462 static PyObject *py_pjsua_conf_set_tx_level 3463 (PyObject *pSelf, PyObject *pArgs) 3464 { 3465 int slot; 3466 float level; 3467 int status; 3468 3469 PJ_UNUSED_ARG(pSelf); 3470 3471 if (!PyArg_ParseTuple(pArgs, "if", &slot, &level)) 3472 { 3473 return NULL; 3474 } 3475 3476 status = pjsua_conf_adjust_tx_level(slot, level); 3477 3478 3479 return Py_BuildValue("i", status); 3480 } 3481 3482 /* 3483 * py_pjsua_conf_set_rx_level 3484 */ 3485 static PyObject *py_pjsua_conf_set_rx_level 3486 (PyObject *pSelf, PyObject *pArgs) 3487 { 3488 int slot; 3489 float level; 3490 int status; 3491 3492 PJ_UNUSED_ARG(pSelf); 3493 3494 if (!PyArg_ParseTuple(pArgs, "if", &slot, &level)) 3495 { 3496 return NULL; 3497 } 3498 3499 status = pjsua_conf_adjust_rx_level(slot, level); 3500 3501 3502 return Py_BuildValue("i", status); 3503 } 3504 3505 /* 3506 * py_pjsua_conf_get_signal_level 3507 */ 3508 static PyObject *py_pjsua_conf_get_signal_level 3509 (PyObject *pSelf, PyObject *pArgs) 3510 { 3511 int slot; 3512 unsigned tx_level, rx_level; 3513 int status; 3514 3515 PJ_UNUSED_ARG(pSelf); 3516 3517 if (!PyArg_ParseTuple(pArgs, "i", &slot)) 3518 { 3519 return NULL; 3520 } 3521 3522 status = pjsua_conf_get_signal_level(slot, &tx_level, &rx_level); 3523 3524 3525 return Py_BuildValue("iff", status, (float)(tx_level/255.0), 3526 (float)(rx_level/255.0)); 3527 } 3528 3529 /* 3460 3530 * py_pjsua_player_create 3461 3531 */ … … 3478 3548 str.slen = strlen(PyString_AsString(filename)); 3479 3549 status = pjsua_player_create(&str, options, &id); 3550 3551 return Py_BuildValue("ii", status, id); 3552 } 3553 3554 /* 3555 * py_pjsua_playlist_create 3556 */ 3557 static PyObject *py_pjsua_playlist_create 3558 (PyObject *pSelf, PyObject *pArgs) 3559 { 3560 int id; 3561 int options; 3562 PyObject *arg_label, *arg_filelist; 3563 pj_str_t label; 3564 int count; 3565 pj_str_t files[64]; 3566 int status; 3567 3568 PJ_UNUSED_ARG(pSelf); 3569 3570 if (!PyArg_ParseTuple(pArgs, "OOi", &arg_label, &arg_filelist, &options)) 3571 { 3572 return NULL; 3573 } 3574 label.ptr = PyString_AsString(arg_label); 3575 label.slen = PyString_Size(arg_label); 3576 3577 if (!PyList_Check(arg_filelist)) 3578 return NULL; 3579 3580 count = 0; 3581 for (count=0; count<PyList_Size(arg_filelist) && 3582 count<PJ_ARRAY_SIZE(files); ++count) 3583 { 3584 files[count].ptr = PyString_AsString(PyList_GetItem(arg_filelist, count)); 3585 files[count].slen = PyString_Size(PyList_GetItem(arg_filelist, count)); 3586 } 3587 3588 status = pjsua_playlist_create(files, count, &label, options, &id); 3480 3589 3481 3590 return Py_BuildValue("ii", status, id); … … 5766 5875 }, 5767 5876 { 5877 "conf_set_tx_level", py_pjsua_conf_set_tx_level, METH_VARARGS, 5878 "Adjust the signal level to be transmitted from the bridge to the" 5879 " specified port by making it louder or quieter" 5880 }, 5881 { 5882 "conf_set_rx_level", py_pjsua_conf_set_rx_level, METH_VARARGS, 5883 "Adjust the signal level to be received from the specified port (to" 5884 " the bridge) by making it louder or quieter" 5885 }, 5886 { 5887 "conf_get_signal_level", py_pjsua_conf_get_signal_level, METH_VARARGS, 5888 "Get last signal level transmitted to or received from the specified port" 5889 }, 5890 { 5768 5891 "player_create", py_pjsua_player_create, METH_VARARGS, 5769 5892 pjsua_player_create_doc 5893 }, 5894 { 5895 "playlist_create", py_pjsua_playlist_create, METH_VARARGS, 5896 "Create WAV playlist" 5770 5897 }, 5771 5898 {
Note: See TracChangeset
for help on using the changeset viewer.