本文整理汇总了C++中BitArray::getHighestBit方法的典型用法代码示例。如果您正苦于以下问题:C++ BitArray::getHighestBit方法的具体用法?C++ BitArray::getHighestBit怎么用?C++ BitArray::getHighestBit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitArray
的用法示例。
在下文中一共展示了BitArray::getHighestBit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getListOfActiveBits
static String getListOfActiveBits (const BitArray& b)
{
StringArray bits;
for (int i = 0; i <= b.getHighestBit(); ++i)
if (b[i])
bits.add (String (i));
return bits.joinIntoString (", ");
}
示例2: open
const String open (const BitArray& inputChannels, const BitArray& outputChannels,
double sampleRate, int bufferSizeSamples)
{
if (client == 0)
{
lastError = T("No JACK client running");
return lastError;
}
lastError = String::empty;
close();
JUCE_NAMESPACE::jack_set_process_callback (client, processCallback, this);
JUCE_NAMESPACE::jack_on_shutdown (client, shutdownCallback, this);
JUCE_NAMESPACE::jack_activate (client);
isOpen_ = true;
if (! inputChannels.isEmpty())
{
const char** const ports = JUCE_NAMESPACE::jack_get_ports (client, 0, 0, /* JackPortIsPhysical | */ JackPortIsOutput);
if (ports != 0)
{
const int numInputChannels = inputChannels.getHighestBit () + 1;
for (int i = 0; i < numInputChannels; ++i)
{
const String portName (ports[i]);
if (inputChannels[i] && portName.upToFirstOccurrenceOf (T(":"), false, false) == getName())
{
int error = JUCE_NAMESPACE::jack_connect (client, ports[i], JUCE_NAMESPACE::jack_port_name ((jack_port_t*) inputPorts[i]));
if (error != 0)
jack_Log ("Cannot connect input port " + String (i) + " (" + String (ports[i]) + "), error " + String (error));
}
}
free (ports);
}
}
if (! outputChannels.isEmpty())
{
const char** const ports = JUCE_NAMESPACE::jack_get_ports (client, 0, 0, /* JackPortIsPhysical | */ JackPortIsInput);
if (ports != 0)
{
const int numOutputChannels = outputChannels.getHighestBit () + 1;
for (int i = 0; i < numOutputChannels; ++i)
{
const String portName (ports[i]);
if (outputChannels[i] && portName.upToFirstOccurrenceOf (T(":"), false, false) == getName())
{
int error = JUCE_NAMESPACE::jack_connect (client, JUCE_NAMESPACE::jack_port_name ((jack_port_t*) outputPorts[i]), ports[i]);
if (error != 0)
jack_Log ("Cannot connect output port " + String (i) + " (" + String (ports[i]) + "), error " + String (error));
}
}
free (ports);
}
}
return lastError;
}