28 |
PendingSamples = 0; |
PendingSamples = 0; |
29 |
} |
} |
30 |
|
|
31 |
int JackIO::Initialize(uint Channels) { |
int JackIO::Initialize(uint Channels, String OutputPorts[2]) { |
32 |
this->uiChannels = Channels; |
this->uiChannels = Channels; |
33 |
this->bInterleaved = false; |
this->bInterleaved = false; |
34 |
|
|
44 |
this->uiSamplerate = jack_get_sample_rate(Client); |
this->uiSamplerate = jack_get_sample_rate(Client); |
45 |
this->bInitialized = true; |
this->bInitialized = true; |
46 |
|
|
47 |
|
// Acquire given output ports |
48 |
|
if(OutputPorts[0] != "") |
49 |
|
if ((this->playback_port[0] = jack_port_by_name(Client, OutputPorts[0].c_str())) == 0) |
50 |
|
fprintf (stderr, "JackIO: Invalid playback port %s.\n", OutputPorts[0].c_str()); |
51 |
|
if(OutputPorts[1] != "") |
52 |
|
if ((this->playback_port[1] = jack_port_by_name(Client, OutputPorts[1].c_str())) == 0) |
53 |
|
fprintf (stderr, "JackIO: Invalid playback port %s.\n", OutputPorts[1].c_str()); |
54 |
|
|
55 |
return 0; |
return 0; |
56 |
} |
} |
57 |
|
|
72 |
Close(); |
Close(); |
73 |
exit(-1); |
exit(-1); |
74 |
} |
} |
75 |
|
|
76 |
|
// Connect to given output ports |
77 |
|
if (playback_port[0]) |
78 |
|
if (jack_connect(Client, jack_port_name(Ports[0]), jack_port_name(playback_port[0]))) |
79 |
|
fprintf (stderr, "JackIO: Cannot connect port 0.\n"); |
80 |
|
if (playback_port[1]) |
81 |
|
if (jack_connect(Client, jack_port_name(Ports[1]), jack_port_name(playback_port[1]))) |
82 |
|
fprintf (stderr, "JackIO: Cannot connect port 1.\n"); |
83 |
} |
} |
84 |
|
|
85 |
int JackIO::Process(uint Samples) { |
int JackIO::Process(uint Samples) { |