jack_client_open

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

jack_client_open

Leonard Ritter-2


        jack_client_t *jack_client_open (const char *client_name,
                                         jack_options_t options,
                                         jack_status_t *status, ...)


would you care to provide a different version that allows to pass va_args
instead? its impossible to wrap this function the way it currently works.

--
-- leonard "paniq" ritter
-- http://www.paniq.org
-- http://www.mjoo.org


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: jack_client_open

Jack O'Quin-2
"Leonard \"paniq\" Ritter" <[hidden email]> writes:

> jack_client_t *jack_client_open (const char *client_name,
> jack_options_t options,
> jack_status_t *status, ...)
>
>
> would you care to provide a different version that allows to pass va_args
> instead? its impossible to wrap this function the way it currently works.

I don't understand your question.  It uses va_args already.
--
  joq


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: jack_client_open

Paul Davis
On Tue, 2005-08-30 at 18:12 -0500, Jack O'Quin wrote:

> "Leonard \"paniq\" Ritter" <[hidden email]> writes:
>
> > jack_client_t *jack_client_open (const char *client_name,
> > jack_options_t options,
> > jack_status_t *status, ...)
> >
> >
> > would you care to provide a different version that allows to pass va_args
> > instead? its impossible to wrap this function the way it currently works.
>
> I don't understand your question.  It uses va_args already.

imagine you want to write a C++ class:
               

        class JACK {
              ...
              some_return_type open (std::string name,
                                     jack_options_t options,
                                     jack_status_t* status, ....);
        };

so far, so good. the definition of the function will be something like:
 
        some_return_type
        JACK::open (string name, jack_options_t options,
                    jack_status_t* status, ...)
        {
              va_list alist;
              va_start (alist, status);
              /* OK, so far, so good.
                 now lets call jack_client_open ...
               */
              .... uh wait, what to pass as arguments ? ...
         

see the problem. personally, i'm a little agnostic about making it easy
to wrap the JACK API, but i have to admit that making it impossible or
at least very very hard seems unwise.

--p




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: jack_client_open

Jack O'Quin-2
Paul Davis <[hidden email]> writes:

> On Tue, 2005-08-30 at 18:12 -0500, Jack O'Quin wrote:
>> "Leonard \"paniq\" Ritter" <[hidden email]> writes:
>>
>> > jack_client_t *jack_client_open (const char *client_name,
>> > jack_options_t options,
>> > jack_status_t *status, ...)
>> >
>> >
>> > would you care to provide a different version that allows to pass va_args
>> > instead? its impossible to wrap this function the way it currently works.
>>
>> I don't understand your question.  It uses va_args already.
>
> imagine you want to write a C++ class:
>
>
> class JACK {
>      ...
>               some_return_type open (std::string name,
>                             jack_options_t options,
>                             jack_status_t* status, ....);
>         };
>
> so far, so good. the definition of the function will be something like:
>  
>         some_return_type
> JACK::open (string name, jack_options_t options,
>                     jack_status_t* status, ...)
>         {
>               va_list alist;
>      va_start (alist, status);
>               /* OK, so far, so good.
>         now lets call jack_client_open ...
>                */
>      .... uh wait, what to pass as arguments ? ...
>          
>
> see the problem. personally, i'm a little agnostic about making it easy
> to wrap the JACK API, but i have to admit that making it impossible or
> at least very very hard seems unwise.

Probably just my ignorance of C++, but I still don't see the problem.

Why not just pass all the optional args, using NULL for the ones you
don't want?  (You would have to specify appropriate options bits for
that to work.)
--
  joq


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: jack_client_open

Leonard Ritter-2
On Wednesday 31 August 2005 05:33, Jack O'Quin wrote:
> Why not just pass all the optional args, using NULL for the ones you
> don't want?  (You would have to specify appropriate options bits for
> that to work.)

by the way, documentation for this function is not found in the site docs.

after looking up more closely the arguments in the header, i have to say, that
i don't quite see why char** wasn't used, or even an argv/argc kinda thing,
as the function (the way it currently works) does only allow hardcasted
arguments. it might be quite hard to automate the list of concurrent server
names.

i could solve the problem with a series of overloaded constructors for
Jack::Client on my side, but there are a few problems with the parenthesis
operator which are not even wrapper-specific, besides the one mentioned
above,

- the frustrating moment of forgetting the terminating NULL argument, because
it causes a runtime error, not a compiler error (and i believe, a quite nasty
one)

- the missing argument types in the declaration which obstruct what is
expected (i like declarations to appear as self-evident as possible, maybe
its just me)

- the incompatibility with future extensions of that function: extending it
with additional parameters will not cause compilers to complain. instead, a
runtime error will occur. (the nasty one we already talked about) - of course
there are workarounds for that, but they just don't look good.

--
-- leonard "paniq" ritter
-- http://www.paniq.org
-- http://www.mjoo.org


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel
Reply | Threaded
Open this post in threaded view
|

Re: jack_client_open

Jussi Laako
In reply to this post by Paul Davis
On Tue, 2005-08-30 at 21:29 -0400, Paul Davis wrote:
> imagine you want to write a C++ class:
>
>
> class JACK {
>      ...
>               some_return_type open (std::string name,
>                             jack_options_t options,
>                             jack_status_t* status, ....);
>         };

In libJackMM I just did following. It's not optimal but works to some
extent. va-args are always a bit problematic to whatever wrapper there
is. I would also propose "char **" way.

            /**
                Open an external client session with a JACK server.
                 
                \param cpClientNameP Name of JACK client
                \param jackoptOptions Set of JackOpenOptions
                \param jackstatStatus Status (if non-NULL)
                \param cpServerName Server name (if non-NULL)
                \param cpServerCmd Server command (if non-NULL)
            */
            void Open (const char *, jack_options_t,
                jack_status_t * = NULL, const char * = NULL,
                const char * = NULL);


--
Jussi Laako <[hidden email]>



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jackit-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jackit-devel