当前位置: 首页>>代码示例>>C++>>正文


C++ BigInteger::getHighestBit方法代码示例

本文整理汇总了C++中BigInteger::getHighestBit方法的典型用法代码示例。如果您正苦于以下问题:C++ BigInteger::getHighestBit方法的具体用法?C++ BigInteger::getHighestBit怎么用?C++ BigInteger::getHighestBit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BigInteger的用法示例。


在下文中一共展示了BigInteger::getHighestBit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: open

    String open (const BigInteger& inputChannels, const BigInteger& outputChannels,
                 double /* sampleRate */, int /* bufferSizeSamples */)
    {
        jack_Log ("opening client");
        lastError = client.open (KV_JACK_NAME, 0);
        if (lastError.isNotEmpty())
        {
            jack_Log (lastError);
            return lastError;
        }

        DBG("num inputs: " << inputChannels.getHighestBit());
        DBG("num outputs: " << outputChannels.getHighestBit());


        jack_on_shutdown (client, JackDevice::shutdownCallback, this);
        jack_set_error_function (JackDevice::errorCallback);
        jack_set_port_connect_callback (client, JackDevice::portConnectCallback, this);
        jack_set_process_callback (client, JackDevice::processCallback, this);
        jack_set_thread_init_callback (client, JackDevice::threadInitCallback, this);
        jack_set_port_registration_callback (client, JackDevice::_portRegistration, this);

        client.registerPort ("audio_1", Jack::audioPort, JackPortIsOutput);
        client.registerPort ("audio_2", Jack::audioPort, JackPortIsOutput);

        return lastError;
    }
开发者ID:kushview,项目名称:element,代码行数:27,代码来源:JackDevice.cpp

示例2: open

    String open (const BigInteger& inputChannels, const BigInteger& outputChannels,
                 double /* sampleRate */, int /* bufferSizeSamples */)
    {
        if (client == nullptr)
        {
            lastError = "No JACK client running";
            return lastError;
        }

        lastError = String::empty;
        close();

        juce::jack_set_process_callback (client, processCallback, this);
        juce::jack_set_port_connect_callback (client, portConnectCallback, this);
        juce::jack_on_shutdown (client, shutdownCallback, this);
        juce::jack_activate (client);
        isOpen_ = true;

        if (! inputChannels.isZero())
        {
            if (const char** const ports = getJackPorts (client, true))
            {
                const int numInputChannels = inputChannels.getHighestBit() + 1;

                for (int i = 0; i < numInputChannels; ++i)
                {
                    const String portName (ports[i]);

                    if (inputChannels[i] && portName.upToFirstOccurrenceOf (":", false, false) == getName())
                    {
                        int error = juce::jack_connect (client, ports[i], juce::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.isZero())
        {
            if (const char** const ports = getJackPorts (client, false))
            {
                const int numOutputChannels = outputChannels.getHighestBit() + 1;

                for (int i = 0; i < numOutputChannels; ++i)
                {
                    const String portName (ports[i]);

                    if (outputChannels[i] && portName.upToFirstOccurrenceOf (":", false, false) == getName())
                    {
                        int error = juce::jack_connect (client, juce::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;
    }
开发者ID:lauyoume,项目名称:JUCE,代码行数:64,代码来源:juce_linux_JackAudio.cpp


注:本文中的BigInteger::getHighestBit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。