2 Copyright (C) 2014 Samsung Electronics
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published by
6 the Free Software Foundation; either version 2.1 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #include "JackSapaProxy.h"
21 #include "JackServerGlobals.h"
22 #include "JackEngineControl.h"
23 #include "JackLockedEngine.h"
24 #include "JackArgParser.h"
33 #include "driver_interface.h"
37 static Jack::JackSapaProxy
* sapaproxy
= NULL
;
39 SERVER_EXPORT jack_driver_desc_t
* jack_get_descriptor()
41 jack_driver_desc_t
* desc
;
42 jack_driver_desc_filler_t filler
;
43 jack_driver_param_value_t value
;
45 desc
= jack_driver_descriptor_construct("in", JackDriverNone
, "sapaproxy client", &filler
);
48 jack_driver_descriptor_add_parameter(desc
, &filler
, "capture", 'C', JackDriverParamUInt
, &value
, NULL
, "Number of capture ports", NULL
);
49 jack_driver_descriptor_add_parameter(desc
, &filler
, "playback", 'P', JackDriverParamUInt
, &value
, NULL
, "Number of playback ports", NULL
);
54 SERVER_EXPORT
int jack_internal_initialize(jack_client_t
* jack_client
, const JSList
* params
)
57 jack_info("sapaproxy already loaded");
61 jack_log("Loading sapaproxy");
62 sapaproxy
= new Jack::JackSapaProxy(jack_client
, params
);
64 sapaproxy
->fCapturePorts
= 2U;
65 sapaproxy
->fPlaybackPorts
= 0U;
67 sapaproxy
->Setup(jack_client
);
72 SERVER_EXPORT
int jack_initialize(jack_client_t
* jack_client
, const char* load_init
)
74 JSList
* params
= NULL
;
75 bool parse_params
= true;
77 jack_driver_desc_t
* desc
= jack_get_descriptor();
79 Jack::JackArgParser
parser(load_init
);
80 if (parser
.GetArgc() > 0)
81 parse_params
= parser
.ParseParams(desc
, ¶ms
);
84 res
= jack_internal_initialize(jack_client
, params
);
85 parser
.FreeParams(params
);
90 SERVER_EXPORT
void jack_finish(void* arg
)
92 Jack::JackSapaProxy
* sapaproxy
= static_cast<Jack::JackSapaProxy
*>(arg
);
95 jack_log("Unloading sapaproxy");