~ubuntu-branches/debian/sid/jackd2/sid

« back to all changes in this revision

Viewing changes to common/JackServerAPI.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adrian Knoth
  • Date: 2011-03-31 13:54:50 UTC
  • mfrom: (1.1.3 upstream) (2.1.4 experimental)
  • Revision ID: james.westby@ubuntu.com-20110331135450-zafc1di024kzeu31
Tags: 1.9.7~dfsg-1
* New upstream version 1.9.7 (ALSA resume, new latency API)
* Build with --mixed on i386 to be compatible with amd64.
* Don't patch jack_connect for fast consecutive calls anymore, it's now
  using the same code as in jackd1 and waits for the port connection to
  appear.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
 
54
54
jack_client_t* jack_client_new_aux(const char* client_name, jack_options_t options, jack_status_t* status)
55
55
{
56
 
    jack_varargs_t va;          /* variable arguments */
 
56
    jack_varargs_t va;          /* variable arguments */
57
57
    jack_status_t my_status;
58
58
    JackClient* client;
59
59
 
63
63
    }
64
64
 
65
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 */
 
66
 
 
67
    if (status == NULL)         /* no status from caller? */
 
68
        status = &my_status;    /* use local status word */
69
69
    *status = (jack_status_t)0;
70
70
 
71
71
    /* validate parameters */
77
77
 
78
78
    /* parse variable arguments */
79
79
    jack_varargs_init(&va);
80
 
 
 
80
 
81
81
    if (!JackServerGlobals::Init()) { // jack server initialisation
82
82
        int my_status1 = (JackFailure | JackServerError);
83
83
        *status = (jack_status_t)my_status1;
84
84
        return NULL;
85
85
    }
86
 
 
 
86
 
87
87
    if (JACK_DEBUG) {
88
88
        client = new JackDebugClient(new JackInternalClient(JackServerGlobals::fInstance, GetSynchroTable())); // Debug mode
89
89
    } else {
90
90
        client = new JackInternalClient(JackServerGlobals::fInstance, GetSynchroTable());
91
91
    }
92
92
 
93
 
    int res = client->Open(va.server_name, client_name, options, status);
 
93
    int res = client->Open(va.server_name, client_name, va.session_id, options, status);
94
94
    if (res < 0) {
95
95
        delete client;
96
96
        JackServerGlobals::Destroy(); // jack server destruction
114
114
    }
115
115
 
116
116
    jack_log("jack_client_open %s", client_name);
117
 
 
 
117
 
118
118
    if (status == NULL)                 /* no status from caller? */
119
119
        status = &my_status;    /* use local status word */
120
120
    *status = (jack_status_t)0;
128
128
 
129
129
    /* parse variable arguments */
130
130
    jack_varargs_parse(options, ap, &va);
131
 
 
 
131
 
132
132
    if (!JackServerGlobals::Init()) { // jack server initialisation
133
133
        int my_status1 = (JackFailure | JackServerError);
134
134
        *status = (jack_status_t)my_status1;
135
135
        return NULL;
136
136
    }
137
 
 
 
137
 
138
138
    if (JACK_DEBUG) {
139
139
        client = new JackDebugClient(new JackInternalClient(JackServerGlobals::fInstance, GetSynchroTable())); // Debug mode
140
140
    } else {
141
141
        client = new JackInternalClient(JackServerGlobals::fInstance, GetSynchroTable());
142
142
    }
143
143
 
144
 
    int res = client->Open(va.server_name, client_name, options, status);
 
144
    int res = client->Open(va.server_name, client_name, va.session_id, options, status);
145
145
    if (res < 0) {
146
146
        delete client;
147
147
        JackServerGlobals::Destroy(); // jack server destruction
180
180
{
181
181
#ifdef __CLIENTDEBUG__
182
182
    JackGlobals::CheckContext("jack_client_close");
183
 
#endif    
 
183
#endif
184
184
    assert(JackGlobals::fOpenMutex);
185
185
    JackGlobals::fOpenMutex->Lock();
186
186
    int res = -1;
191
191
    } else {
192
192
        res = client->Close();
193
193
        delete client;
194
 
        JackServerGlobals::Destroy();   // jack server destruction
 
194
        JackServerGlobals::Destroy();   // jack server destruction
195
195
        jack_log("jack_client_close res = %d", res);
196
196
    }
197
197
    JackGlobals::fOpenMutex->Unlock();
200
200
 
201
201
EXPORT int jack_get_client_pid(const char *name)
202
202
{
203
 
    return (JackServerGlobals::fInstance != NULL) 
 
203
    return (JackServerGlobals::fInstance != NULL)
204
204
        ? JackServerGlobals::fInstance->GetEngine()->GetClientPID(name)
205
205
        : 0;
206
206
}