Browse Source

Compile on Windows again.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4155 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.7
sletz 14 years ago
parent
commit
4c709fef26
3 changed files with 29 additions and 10 deletions
  1. +17
    -10
      example-clients/latent_client.c
  2. +2
    -0
      windows/JackSystemDeps_os.h
  3. +10
    -0
      windows/JackWinNamedPipeServerChannel.cpp

+ 17
- 10
example-clients/latent_client.c View File

@@ -8,7 +8,8 @@
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <string.h>
#include <inttypes.h>


#include <jack/jack.h> #include <jack/jack.h>


@@ -18,14 +19,20 @@ jack_client_t *client;


jack_default_audio_sample_t *delay_line; jack_default_audio_sample_t *delay_line;
jack_nframes_t delay_index; 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 * The process callback for this JACK application is called in a
* special realtime thread once for each audio cycle. * special realtime thread once for each audio cycle.
* *
* This client does nothing more than copy data from its input * 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) * the user (e.g. using Ctrl-C on a unix-ish operating system)
*/ */
int int
@@ -33,7 +40,7 @@ process (jack_nframes_t nframes, void *arg)
{ {
jack_default_audio_sample_t *in, *out; jack_default_audio_sample_t *in, *out;
int k; int k;
in = jack_port_get_buffer (input_port, nframes); in = jack_port_get_buffer (input_port, nframes);
out = jack_port_get_buffer (output_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]; out[k] = delay_line[delay_index];
delay_line[delay_index] = in[k]; delay_line[delay_index] = in[k];
delay_index = (delay_index + 1) % latency; delay_index = (delay_index + 1) % latency;
}
}


return 0;
return 0;
} }


void void
@@ -81,7 +88,7 @@ main (int argc, char *argv[])
const char *server_name = NULL; const char *server_name = NULL;
jack_options_t options = JackNullOption; jack_options_t options = JackNullOption;
jack_status_t status; jack_status_t status;


if (argc == 2) if (argc == 2)
latency = atoi(argv[1]); latency = atoi(argv[1]);
@@ -132,7 +139,7 @@ main (int argc, char *argv[])


jack_on_shutdown (client, jack_shutdown, 0); jack_on_shutdown (client, jack_shutdown, 0);


/* display the current sample rate.
/* display the current sample rate.
*/ */


printf ("engine sample rate: %" PRIu32 "\n", printf ("engine sample rate: %" PRIu32 "\n",
@@ -180,7 +187,7 @@ main (int argc, char *argv[])
} }


free (ports); free (ports);
ports = jack_get_ports (client, NULL, NULL, ports = jack_get_ports (client, NULL, NULL,
JackPortIsPhysical|JackPortIsInput); JackPortIsPhysical|JackPortIsInput);
if (ports == NULL) { if (ports == NULL) {
@@ -196,7 +203,7 @@ main (int argc, char *argv[])


/* keep running until stopped by the user */ /* keep running until stopped by the user */


sleep (-1);
jack_sleep (-1);


/* this is never reached but if the program /* this is never reached but if the program
had some other way to exit besides being killed, had some other way to exit besides being killed,


+ 2
- 0
windows/JackSystemDeps_os.h View File

@@ -23,6 +23,8 @@


#include <windows.h> #include <windows.h>


#define UINT32_MAX 4294967295U

#define DRIVER_HANDLE HINSTANCE #define DRIVER_HANDLE HINSTANCE
#define LoadDriverModule(name) LoadLibrary((name)) #define LoadDriverModule(name) LoadLibrary((name))
#define UnloadDriverModule(handle) (FreeLibrary(((HMODULE)handle))) #define UnloadDriverModule(handle) (FreeLibrary(((HMODULE)handle)))


+ 10
- 0
windows/JackWinNamedPipeServerChannel.cpp View File

@@ -252,6 +252,16 @@ bool JackClientPipeThread::HandleRequest()
break; 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: { case JackRequest::kReleaseTimebase: {
jack_log("JackRequest::ReleaseTimebase"); jack_log("JackRequest::ReleaseTimebase");
JackReleaseTimebaseRequest req; JackReleaseTimebaseRequest req;


Loading…
Cancel
Save