Commit 3949b7a3 authored by sletz's avatar sletz
Browse files

jackctl_driver_params_parse API moved in public control.h.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4673 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 6b53ba11
......@@ -39,6 +39,7 @@ John Emmas
2012-01-06 Stephane Letz <letz@grame.fr>
* Cleanup drivers and internals loading code.
* jackctl_driver_params_parse API moved in public control.h.
2012-01-06 Stephane Letz <letz@grame.fr>
......
......@@ -252,6 +252,9 @@ SERVER_EXPORT bool
jackctl_server_switch_master(jackctl_server_t * server,
jackctl_driver_t * driver);
SERVER_EXPORT int
jackctl_parse_driver_params(jackctl_driver * driver_ptr, int argc, char* argv[]);
#if 0
{ /* Adjust editor indent */
#endif
......
......@@ -34,7 +34,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
jack_driver_desc_t* jackctl_driver_get_desc(jackctl_driver_t * driver);
SERVER_EXPORT void jack_print_driver_options(jack_driver_desc_t* desc, FILE* file)
void jack_print_driver_options(jack_driver_desc_t* desc, FILE* file)
{
unsigned long i;
char arg_default[JACK_DRIVER_PARAM_STRING_MAX + 1];
......@@ -77,7 +77,7 @@ static void jack_print_driver_param_usage (jack_driver_desc_t* desc, unsigned lo
fprintf (file, "%s\n", desc->params[param].long_desc);
}
SERVER_EXPORT void jack_free_driver_params(JSList * driver_params)
void jack_free_driver_params(JSList * driver_params)
{
JSList*node_ptr = driver_params;
JSList*next_node_ptr;
......@@ -217,7 +217,7 @@ SERVER_EXPORT int jack_parse_driver_params(jack_driver_desc_t* desc, int argc, c
return 0;
}
SERVER_EXPORT int jackctl_parse_driver_params(jackctl_driver *driver_ptr, int argc, char* argv[])
SERVER_EXPORT int jackctl_driver_params_parse(jackctl_driver *driver_ptr, int argc, char* argv[])
{
struct option* long_options;
char* options, * options_ptr;
......
......@@ -34,9 +34,10 @@ extern "C"
{
#endif
SERVER_EXPORT int jackctl_parse_driver_params(jackctl_driver * driver_ptr, int argc, char* argv[]);
SERVER_EXPORT void jack_free_driver_params(JSList * param_ptr);
SERVER_EXPORT void jack_print_driver_options(jack_driver_desc_t* desc, FILE* file);
SERVER_EXPORT int jackctl_driver_params_parse(jackctl_driver * driver, int argc, char* argv[]);
void jack_free_driver_params(JSList * param_ptr);
void jack_print_driver_options(jack_driver_desc_t* desc, FILE* file);
#ifdef __cplusplus
}
......
......@@ -30,8 +30,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "types.h"
#include "jack.h"
#include "control.h"
#include "JackConstants.h"
#include "JackDriverLoader.h"
#include "JackPlatformPlug.h"
#if defined(JACK_DBUS) && defined(__linux__)
#include <dbus/dbus.h>
......@@ -130,23 +132,15 @@ static void usage(FILE* file)
" to display options for each master backend\n\n");
}
// To put in the control.h interface??
static jackctl_driver_t *
jackctl_server_get_driver(
jackctl_server_t *server,
const char *driver_name)
// To put in the control.h interface ??
static jackctl_driver_t * jackctl_server_get_driver(jackctl_server_t *server, const char *driver_name)
{
const JSList * node_ptr;
node_ptr = jackctl_server_get_drivers_list(server);
const JSList * node_ptr = jackctl_server_get_drivers_list(server);
while (node_ptr)
{
if (strcmp(jackctl_driver_get_name((jackctl_driver_t *)node_ptr->data), driver_name) == 0)
{
while (node_ptr) {
if (strcmp(jackctl_driver_get_name((jackctl_driver_t *)node_ptr->data), driver_name) == 0) {
return (jackctl_driver_t *)node_ptr->data;
}
node_ptr = jack_slist_next(node_ptr);
}
......@@ -167,18 +161,12 @@ static jackctl_internal_t * jackctl_server_get_internal(jackctl_server_t *server
return NULL;
}
static jackctl_parameter_t *
jackctl_get_parameter(
const JSList * parameters_list,
const char * parameter_name)
static jackctl_parameter_t * jackctl_get_parameter(const JSList * parameters_list, const char * parameter_name)
{
while (parameters_list)
{
if (strcmp(jackctl_parameter_get_name((jackctl_parameter_t *)parameters_list->data), parameter_name) == 0)
{
while (parameters_list) {
if (strcmp(jackctl_parameter_get_name((jackctl_parameter_t *)parameters_list->data), parameter_name) == 0) {
return (jackctl_parameter_t *)parameters_list->data;
}
parameters_list = jack_slist_next(parameters_list);
}
......@@ -457,7 +445,7 @@ int main(int argc, char** argv)
master_driver_args[i] = argv[optind++];
}
if (jackctl_parse_driver_params(master_driver_ctl, master_driver_nargs, master_driver_args)) {
if (jackctl_driver_params_parse(master_driver_ctl, master_driver_nargs, master_driver_args)) {
goto destroy_server;
}
......
......@@ -330,6 +330,21 @@ const JSList *
jackctl_driver_get_parameters(
jackctl_driver_t * driver);
/**
* Call this function to parse parameters for a driver.
*
* @param driver driver object handle
* @param argc parameter list len
* @param argv parameter list, as an array of char*
*
* @return success status: true - success, false - fail
*/
int
jackctl_driver_params_parse(
jackctl_driver * driver,
int argc,
char* argv[]);
/**
* Call this function to get name of internal client.
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment