Compile on Windows again.
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4155 0c269be4-1314-0410-8aa9-9f06e86f4224
This commit is contained in:
parent
325244437d
commit
4c709fef26
|
@ -8,7 +8,8 @@
|
|||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <jack/jack.h>
|
||||
|
||||
|
@ -18,14 +19,20 @@ jack_client_t *client;
|
|||
|
||||
jack_default_audio_sample_t *delay_line;
|
||||
jack_nframes_t delay_index;
|
||||
jack_nframes_t latency = 1024;
|
||||
jack_nframes_t latency = 1024;
|
||||
|
||||
#ifdef WIN32
|
||||
#define jack_sleep(val) Sleep((val))
|
||||
#else
|
||||
#define jack_sleep(val) usleep((val) * 1000)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The process callback for this JACK application is called in a
|
||||
* special realtime thread once for each audio cycle.
|
||||
*
|
||||
* This client does nothing more than copy data from its input
|
||||
* port to its output port. It will exit when stopped by
|
||||
* port to its output port. It will exit when stopped by
|
||||
* the user (e.g. using Ctrl-C on a unix-ish operating system)
|
||||
*/
|
||||
int
|
||||
|
@ -33,7 +40,7 @@ process (jack_nframes_t nframes, void *arg)
|
|||
{
|
||||
jack_default_audio_sample_t *in, *out;
|
||||
int k;
|
||||
|
||||
|
||||
in = jack_port_get_buffer (input_port, nframes);
|
||||
out = jack_port_get_buffer (output_port, nframes);
|
||||
|
||||
|
@ -41,9 +48,9 @@ process (jack_nframes_t nframes, void *arg)
|
|||
out[k] = delay_line[delay_index];
|
||||
delay_line[delay_index] = in[k];
|
||||
delay_index = (delay_index + 1) % latency;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -81,7 +88,7 @@ main (int argc, char *argv[])
|
|||
const char *server_name = NULL;
|
||||
jack_options_t options = JackNullOption;
|
||||
jack_status_t status;
|
||||
|
||||
|
||||
|
||||
if (argc == 2)
|
||||
latency = atoi(argv[1]);
|
||||
|
@ -132,7 +139,7 @@ main (int argc, char *argv[])
|
|||
|
||||
jack_on_shutdown (client, jack_shutdown, 0);
|
||||
|
||||
/* display the current sample rate.
|
||||
/* display the current sample rate.
|
||||
*/
|
||||
|
||||
printf ("engine sample rate: %" PRIu32 "\n",
|
||||
|
@ -180,7 +187,7 @@ main (int argc, char *argv[])
|
|||
}
|
||||
|
||||
free (ports);
|
||||
|
||||
|
||||
ports = jack_get_ports (client, NULL, NULL,
|
||||
JackPortIsPhysical|JackPortIsInput);
|
||||
if (ports == NULL) {
|
||||
|
@ -196,7 +203,7 @@ main (int argc, char *argv[])
|
|||
|
||||
/* keep running until stopped by the user */
|
||||
|
||||
sleep (-1);
|
||||
jack_sleep (-1);
|
||||
|
||||
/* this is never reached but if the program
|
||||
had some other way to exit besides being killed,
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
|
||||
#include <windows.h>
|
||||
|
||||
#define UINT32_MAX 4294967295U
|
||||
|
||||
#define DRIVER_HANDLE HINSTANCE
|
||||
#define LoadDriverModule(name) LoadLibrary((name))
|
||||
#define UnloadDriverModule(handle) (FreeLibrary(((HMODULE)handle)))
|
||||
|
|
|
@ -252,6 +252,16 @@ bool JackClientPipeThread::HandleRequest()
|
|||
break;
|
||||
}
|
||||
|
||||
case JackRequest::kComputeTotalLatencies: {
|
||||
jack_log("JackRequest::ComputeTotalLatencies");
|
||||
JackComputeTotalLatenciesRequest req;
|
||||
JackResult res;
|
||||
if (req.Read(fPipe) == 0)
|
||||
res.fResult = fServer->GetEngine()->ComputeTotalLatencies();
|
||||
res.Write(fPipe);
|
||||
break;
|
||||
}
|
||||
|
||||
case JackRequest::kReleaseTimebase: {
|
||||
jack_log("JackRequest::ReleaseTimebase");
|
||||
JackReleaseTimebaseRequest req;
|
||||
|
|
Loading…
Reference in New Issue