Ejemplo n.º 1
0
void FxMixer::loadSettings( const QDomElement & _this )
{
	clear();
	QDomNode node = _this.firstChild();
	bool thereIsASend = false;

	while( ! node.isNull() )
	{
		QDomElement fxch = node.toElement();

		// index of the channel we are about to load
		int num = fxch.attribute( "num" ).toInt();

		// allocate enough channels
		allocateChannelsTo( num );

		m_fxChannels[num]->m_volumeModel.loadSettings( fxch, "volume" );
		m_fxChannels[num]->m_muteModel.loadSettings( fxch, "muted" );
		m_fxChannels[num]->m_soloModel.loadSettings( fxch, "soloed" );
		m_fxChannels[num]->m_name = fxch.attribute( "name" );

		m_fxChannels[num]->m_fxChain.restoreState( fxch.firstChildElement(
			m_fxChannels[num]->m_fxChain.nodeName() ) );

		// mixer sends
		QDomNodeList chData = fxch.childNodes();
		for( unsigned int i=0; i<chData.length(); ++i )
		{
			QDomElement chDataItem = chData.at(i).toElement();
			if( chDataItem.nodeName() == QString( "send" ) )
			{
				thereIsASend = true;
				int sendTo = chDataItem.attribute( "channel" ).toInt();
				allocateChannelsTo( sendTo ) ;
				FxRoute * fxr = createChannelSend( num, sendTo, 1.0f );
				if( fxr ) fxr->amount()->loadSettings( chDataItem, "amount" );
			}
		}



		node = node.nextSibling();
	}

	// check for old format. 65 fx channels and no explicit sends.
	if( ! thereIsASend && m_fxChannels.size() == 65 ) {
		// create a send from every channel into master
		for( int i=1; i<m_fxChannels.size(); ++i )
		{
			createChannelSend( i, 0 );
		}
	}

	emit dataChanged();
}
Ejemplo n.º 2
0
void FxMixer::loadSettings( const QDomElement & _this )
{
    clear();
    QDomNode node = _this.firstChild();

    while( ! node.isNull() )
    {
        QDomElement fxch = node.toElement();

        // index of the channel we are about to load
        int num = fxch.attribute( "num" ).toInt();

        // allocate enough channels
        allocateChannelsTo( num );

        m_fxChannels[num]->m_volumeModel.loadSettings( fxch, "volume" );
        m_fxChannels[num]->m_muteModel.loadSettings( fxch, "muted" );
        m_fxChannels[num]->m_soloModel.loadSettings( fxch, "soloed" );
        m_fxChannels[num]->m_name = fxch.attribute( "name" );

        m_fxChannels[num]->m_fxChain.restoreState( fxch.firstChildElement(
                    m_fxChannels[num]->m_fxChain.nodeName() ) );

        // mixer sends
        QDomNodeList chData = fxch.childNodes();
        for( unsigned int i=0; i<chData.length(); ++i )
        {
            QDomElement chDataItem = chData.at(i).toElement();
            if( chDataItem.nodeName() == QString( "send" ) )
            {
                int sendTo = chDataItem.attribute( "channel" ).toInt();
                allocateChannelsTo( sendTo ) ;
                FxRoute * fxr = createChannelSend( num, sendTo, 1.0f );
                if( fxr ) fxr->amount()->loadSettings( chDataItem, "amount" );
            }
        }



        node = node.nextSibling();
    }

    emit dataChanged();
}