Exemple #1
0
AudioPortConfig::AudioPortConfig(QWidget* parent)
: QFrame(parent)
{
    setupUi(this);
    _selected = 0;
    selectedIndex = -1;
    connect(routeList, SIGNAL(itemSelectionChanged()), SLOT(routeSelectionChanged()));
    connect(newSrcList, SIGNAL(itemSelectionChanged()), SLOT(srcSelectionChanged()));
    connect(newDstList, SIGNAL(itemSelectionChanged()), SLOT(dstSelectionChanged()));
    connect(tracksList, SIGNAL(itemSelectionChanged()), SLOT(trackSelectionChanged()));
    connect(removeButton, SIGNAL(clicked()), SLOT(removeRoute()));
    connect(connectButton, SIGNAL(clicked()), SLOT(addRoute()));
    connect(btnConnectOut, SIGNAL(clicked()), SLOT(addOutRoute()));
    connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int)));
    routingChanged();
}
NotificationRouteDialog::NotificationRouteDialog( QWidget * parent )
: QDialog( parent )
{
	setupUi( this );
	connect( mUserFilterCombo, SIGNAL(currentChanged( const Record & )), SLOT(slotUserFilterChanged( const Record & )) );
	connect( mAddButton, SIGNAL( clicked() ), SLOT( slotAddRoute() ) );
	connect( mRemoveButton, SIGNAL( clicked() ), SLOT( slotRemoveRoute() ) );
	connect( mNotificationRouteView, SIGNAL( selectionChanged( RecordList ) ), SLOT( routeSelectionChanged( RecordList ) ) );

	EmployeeList emps = Employee::select( "dateoftermination IS NULL" ).sorted( "name" );
	Employee none;
	none.setName( "Global Routes" );
	emps.insert( emps.begin(), none );
	mUserFilterCombo->setItems( emps  );
	mUserFilterCombo->setColumn( "name" );
	mUserFilterCombo->setCurrentIndex( 0 );

}
Exemple #3
0
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)
                {
                        QString src("");
                        if (atrack->type() == Track::WAVE_INPUT_HELPER)
                        {
                                widgetItem = new QTreeWidgetItem(routeList, QStringList() << ri->name() << QString::number(ri->channel) << atrack->name() << src << QString(""), Track::WAVE_INPUT_HELPER);
                        }
                        else
                        {
                                widgetItem = new QTreeWidgetItem(routeList, QStringList() << ri->name() << QString::number(0) << atrack->name() << src << QString(""), Track::WAVE_INPUT_HELPER);
                        }
                        widgetItem->setTextAlignment(1, Qt::AlignHCenter);
                        widgetItem->setTextAlignment(4, Qt::AlignHCenter);
                }
        routeSelectionChanged(); // init remove button
        srcSelectionChanged(); // init select button
    }
}