~ubuntu-branches/ubuntu/quantal/jackd2/quantal

« back to all changes in this revision

Viewing changes to common/JackServerAPI.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler, Adrian Knoth, Reinhard Tartler, Jonas Smedegaard
  • Date: 2010-06-19 18:54:29 UTC
  • Revision ID: james.westby@ubuntu.com-20100619185429-zhbhh0mqvukgzx0l
Tags: 1.9.5~dfsg-15
[ Adrian Knoth ]
* Also provide the shlibs file for libjack-jackd2-0
* Fix FTBFS on sparc64 (Closes: #586257)

[ Reinhard Tartler ]
* jackd must not be a virtual package, use 'jack-daemon' for that
* add breaks/replaces on old libjack0
* change shlibsfile to prefer jackd2's libjack
* use conflicts instead of breaks. libjack-jackd2-0 has file conflicts
  with libjack0 and will keep it

[ Jonas Smedegaard ]
* Update control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
{
34
34
#endif
35
35
 
36
 
    EXPORT jack_client_t * jack_client_open_aux (const char *client_name,
 
36
    jack_client_t * jack_client_new_aux (const char *client_name,
 
37
            jack_options_t options,
 
38
            jack_status_t *status);
 
39
    jack_client_t * jack_client_open_aux (const char *client_name,
37
40
            jack_options_t options,
38
41
            jack_status_t *status, va_list ap);
39
42
    EXPORT jack_client_t * jack_client_open (const char *client_name,
48
51
 
49
52
using namespace Jack;
50
53
 
51
 
EXPORT jack_client_t* jack_client_open_aux(const char* client_name, jack_options_t options, jack_status_t* status, va_list ap)
 
54
jack_client_t* jack_client_new_aux(const char* client_name, jack_options_t options, jack_status_t* status)
 
55
{
 
56
    jack_varargs_t va;          /* variable arguments */
 
57
    jack_status_t my_status;
 
58
    JackClient* client;
 
59
 
 
60
    if (client_name == NULL) {
 
61
        jack_error("jack_client_new called with a NULL client_name");
 
62
        return NULL;
 
63
    }
 
64
 
 
65
    jack_log("jack_client_new %s", client_name);
 
66
 
 
67
    if (status == NULL)                 /* no status from caller? */
 
68
        status = &my_status;    /* use local status word */
 
69
    *status = (jack_status_t)0;
 
70
 
 
71
    /* validate parameters */
 
72
    if ((options & ~JackOpenOptions)) {
 
73
        int my_status1 = *status | (JackFailure | JackInvalidOption);
 
74
        *status = (jack_status_t)my_status1;
 
75
        return NULL;
 
76
    }
 
77
 
 
78
    /* parse variable arguments */
 
79
    jack_varargs_init(&va);
 
80
 
 
81
    if (!JackServerGlobals::Init()) { // jack server initialisation
 
82
        int my_status1 = (JackFailure | JackServerError);
 
83
        *status = (jack_status_t)my_status1;
 
84
        return NULL;
 
85
    }
 
86
 
 
87
    if (JACK_DEBUG) {
 
88
        client = new JackDebugClient(new JackInternalClient(JackServerGlobals::fInstance, GetSynchroTable())); // Debug mode
 
89
    } else {
 
90
        client = new JackInternalClient(JackServerGlobals::fInstance, GetSynchroTable());
 
91
    }
 
92
 
 
93
    int res = client->Open(va.server_name, client_name, options, status);
 
94
    if (res < 0) {
 
95
        delete client;
 
96
        JackServerGlobals::Destroy(); // jack server destruction
 
97
        int my_status1 = (JackFailure | JackServerError);
 
98
        *status = (jack_status_t)my_status1;
 
99
        return NULL;
 
100
    } else {
 
101
        return (jack_client_t*)client;
 
102
    }
 
103
}
 
104
 
 
105
jack_client_t* jack_client_open_aux(const char* client_name, jack_options_t options, jack_status_t* status, va_list ap)
52
106
{
53
107
    jack_varargs_t va;          /* variable arguments */
54
108
    jack_status_t my_status;
73
127
    }
74
128
 
75
129
    /* parse variable arguments */
76
 
    if (ap) {
77
 
        jack_varargs_parse(options, ap, &va);
78
 
    } else {
79
 
        jack_varargs_init(&va);
80
 
    }
81
 
 
 
130
    jack_varargs_parse(options, ap, &va);
 
131
 
82
132
    if (!JackServerGlobals::Init()) { // jack server initialisation
83
133
        int my_status1 = (JackFailure | JackServerError);
84
134
        *status = (jack_status_t)my_status1;