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


C++ AudioTrack::inRoutes方法代码示例

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


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

示例1: trackSelectionChanged

void AudioPortConfig::trackSelectionChanged()
{
    routeList->clear();
    newSrcList->clear();
    newDstList->clear();
    QListWidgetItem* titem = tracksList->currentItem();
    AudioTrack* atrack = (AudioTrack*)song->findTrack(titem->text());
    if(atrack)
    {
        _selected = atrack;
        selectedIndex = tracksList->row(titem);
        //TrackList* tl = song->tracks();
        //for(iTrack t = tl->begin(); t != tl->end(); ++t)
        //{
        //	if((*t)->isMidiTrack())
        //		continue;
        //	AudioTrack* track = (AudioTrack*) (*t);
        //	if(track->name() == atrack->name())
        //		continue; //You cant connect a track to itself
            //int channels = track->channels();
            switch (atrack->type())
            {
                case Track::WAVE_OUTPUT_HELPER:/*{{{*/
                    for(iTrack t = song->tracks()->begin(); t != song->tracks()->end(); ++t)
                    {
                        if((*t)->isMidiTrack())
                            continue;
                        AudioTrack* track = (AudioTrack*) (*t);
                        if(track->name() == atrack->name() || track->type() == Track::WAVE_OUTPUT_HELPER)
                            continue; //You cant connect a track to itself
                        //for (int channel = 0; channel < track->channels(); ++channel)
                        //{
                            Route r(track, -1);
                            newSrcList->addItem(r.name());
                        //}
                    }
                    insertInputs();
                    //newDstList->addItem(Route(track, -1).name());
                break;
                case Track::WAVE_INPUT_HELPER:
                    for(iTrack t = song->tracks()->begin(); t != song->tracks()->end(); ++t)
                    {
                        if((*t)->isMidiTrack())
                            continue;
                        AudioTrack* track = (AudioTrack*) (*t);
                        if(track->name() == atrack->name())
                            continue; //You cant connect a track to itself
                        switch(track->type())
                        {
                            case Track::WAVE_OUTPUT_HELPER:
                            case Track::WAVE:
                                newDstList->addItem(Route(track, -1).name());
                            break;
                            default:
                            break;
                        }
                    }
                    insertOutputs();
                break;
                case Track::WAVE:
                    for(iTrack t = song->tracks()->begin(); t != song->tracks()->end(); ++t)
                    {
                        if((*t)->isMidiTrack())
                            continue;
                        AudioTrack* track = (AudioTrack*) (*t);
                        if(track->name() == atrack->name())
                            continue; //You cant connect a track to itself
                        if(track->type() == Track::WAVE_INPUT_HELPER)
                        {
                            newSrcList->addItem(Route(track, -1).name());
                        }
                        else if(track->type() == Track::WAVE_OUTPUT_HELPER)
                        {
                            newDstList->addItem(Route(track, -1).name());
                        }
                    }
                break;
                default:
                break;/*}}}*/
            }
        //}

                QTreeWidgetItem* widgetItem;
        const RouteList* rl = atrack->outRoutes();
        for (ciRoute r = rl->begin(); r != rl->end(); ++r)
        {
                        QString src("");
            if (atrack->type() == Track::WAVE_OUTPUT_HELPER)
            {
                                widgetItem = new QTreeWidgetItem(routeList, QStringList() << src << QString("") << atrack->name() << r->name() << QString::number(r->channel), Track::WAVE_OUTPUT_HELPER);
            }
            else
            {
                                widgetItem = new QTreeWidgetItem(routeList, QStringList() << src << QString("") << atrack->name() << r->name() << QString::number(0), Track::WAVE_OUTPUT_HELPER);
            }
                        widgetItem->setTextAlignment(1, Qt::AlignHCenter);
                        widgetItem->setTextAlignment(4, Qt::AlignHCenter);
                }
                const RouteList* rli = atrack->inRoutes();
                for (ciRoute ri = rli->begin(); ri != rli->end(); ++ri)
//.........这里部分代码省略.........
开发者ID:Adamiko,项目名称:los,代码行数:101,代码来源:apconfig.cpp


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