コード例 #1
0
ファイル: audiocdrecord.cpp プロジェクト: realbardia/silicon
QStringList AudioCdRecord::arguments() const
{
    QStringList args;

/*! --------------------- Normal Arguments --------------------!*/
    args << "-v";

    if( publicRead()           )        args << "-r";
    if( dummy()                )        args << "-dummy";
    if( force()                )        args << "-force";
    if( sessionAtOnce()        )        args << "-sao";
    if( trackAtOnce()          )        args << "-tao";
    if( swab()                 )        args << "-swab";
    if( multiSession()         )        args << "-multi";
    if( pad()                  )        args << "-pad";
    if( pad() && padSize() > 0 )        args << QString::number( padSize() );
    if( eject()                )        args << "-eject";

    if( ringBuffer() > 0       )        args << "fs="     + QString::number( ringBuffer() );
    if( minimumBuffer() > 0    )        args << "minbuf=" + QString::number( minimumBuffer() );
    if( speed() > 0            )        args << "speed="  + QString::number( speed() );

    args << "dev=" + currentDevice().toQString();
    args << "-audio";
    args << files();
    /*! -----------------------------------------------------------!*/

    return args;
}
コード例 #2
0
ファイル: DebugMesh.cpp プロジェクト: BackupTheBerlios/slon
void DebugMesh::dirty()
{
    // calculate bounds
    if (infiniteBounds) {
        aabb.reset_max();
    } 
    else
    {
        aabb.reset_min();
        for (vertices_vector::const_iterator iter  = vertices.begin();
                                             iter != vertices.end();
                                             ++iter)
        {
            aabb.extend(*iter);
        }
    }

    if (!vertexBuffer) {
        vertexBuffer.reset( currentDevice()->CreateVertexBuffer() );
    }

    if (!indexBuffer) {
        indexBuffer.reset( currentDevice()->CreateIndexBuffer() );
    }

    size_t size = vertices.size() * sizeof(math::Vector3f);
    if (vertexBuffer->Size() >= size) {
        vertexBuffer->SetSubData(0, size, &vertices[0]);
    }
    else {
        vertexBuffer->SetData(size, &vertices[0], sgl::Buffer::STREAM_DRAW);
    }

    size = indices.size() * sizeof(unsigned int);
    if (indexBuffer->Size() >= size) {
        indexBuffer->SetSubData(0, size, &indices[0]);
    }
    else {
        indexBuffer->SetData(size, &indices[0], sgl::Buffer::STREAM_DRAW);
    }

    geometryDirty = false;
}
コード例 #3
0
ファイル: DebugMesh.cpp プロジェクト: BackupTheBerlios/slon
void DebugMesh::subset::render() const
{
    if (debugMesh->geometryDirty) {
        const_cast<DebugMesh*>(debugMesh)->dirty();
    }

    debugMesh->vertexBuffer->Bind( debugMesh->vertexLayout.get() );
    debugMesh->indexBuffer->Bind(sgl::IndexBuffer::UINT_32);
    currentDevice()->DrawIndexed(primitiveType, vertexOffset, numVertices);
}
コード例 #4
0
ファイル: FogFilter.cpp プロジェクト: BackupTheBerlios/slon
// Override Filter
unsigned FogFilter::perform( sgl::RenderTarget*     renderTarget,
                             unsigned               source ) const
{
    int          numSwitches = 0;
    sgl::Device* device      = currentDevice();
    if (!renderTarget)
    {
        ppu::DrawUtilities::beginChain();
        {
            fogProgram.getProgram()->Bind();

            // sampler uniforms
            fogProgram.inputMapUniform->Set( 0, inputMapBinder->values() );
            fogProgram.depthMapUniform->Set( 1, depthMapBinder->values() );

            // depth uniforms
            const math::Matrix4f& projectionMatrixInverse = projectionMatrixInverseBinder->value();
            fogProgram.projectionMatrixInverseUniform->Set(projectionMatrixInverse);
            fogProgram.depthParamsUniform->Set( math::Vector4f(projectionMatrixInverse[2][2],
                                                               projectionMatrixInverse[2][3],
                                                               projectionMatrixInverse[3][2],
                                                               projectionMatrixInverse[3][3]) );

            fogProgram.colorUniform->Set( math::xyz(fogColor) );
            fogProgram.densityUniform->Set(fogDensity);
            fogProgram.levelUniform->Set(fogLevel);
            fogProgram.directionUniform->Set( normalMatrixBinder->value() * math::Vector3f(0.0f, 1.0f, 0.0f) );
            fogProgram.heightFalloffUniform->Set(fogHeightFalloff);
            device->Draw(sgl::QUADS, 0 ,4);
        }
        ppu::DrawUtilities::endChain();

        numSwitches = 1;
    }
    else
    {
        sgl::Texture2D* attachments[2] =
        {
            static_cast<sgl::Texture2D*>( renderTarget->ColorAttachment(0) ),
            static_cast<sgl::Texture2D*>( renderTarget->ColorAttachment(1) )
        };

        assert(attachments[0] && attachments[1]);
    }

    return numSwitches;
}
コード例 #5
0
void S60DeployConfigurationWidget::updateDeviceInfo()
{
    //TODO: No CODA device info! Implement it when it is available
    if (m_deployConfiguration->communicationChannel() == S60DeployConfiguration::CommunicationTrkSerialConnection) {
        QTC_ASSERT(!m_infoLauncher, return)
                setDeviceInfoLabel(tr("Connecting..."));
        // Do a launcher run with the ping protocol. Prompt to connect and
        // go asynchronous afterwards to pop up launch trk box if a timeout occurs.
        QString message;
        const SymbianUtils::SymbianDevice commDev = currentDevice();
        m_infoLauncher = trk::Launcher::acquireFromDeviceManager(commDev.portName(), this, &message);
        if (!m_infoLauncher) {
            setDeviceInfoLabel(message, true);
            return;
        }
        connect(m_infoLauncher, SIGNAL(stateChanged(int)), this, SLOT(slotLauncherStateChanged(int)));

        m_infoLauncher->setSerialFrame(commDev.type() == SymbianUtils::SerialPortCommunication);
        m_infoLauncher->setTrkServerName(commDev.portName());

        // Prompt user
        const trk::PromptStartCommunicationResult src =
                S60RunConfigBluetoothStarter::startCommunication(m_infoLauncher->trkDevice(),
                                                                 this, &message);
        switch (src) {
        case trk::PromptStartCommunicationConnected:
            break;
        case trk::PromptStartCommunicationCanceled:
            clearDeviceInfo();
            m_infoLauncher->deleteLater();
            return;
        case trk::PromptStartCommunicationError:
            setDeviceInfoLabel(message, true);
            m_infoLauncher->deleteLater();
            return;
        };
        if (!m_infoLauncher->startServer(&message)) {
            setDeviceInfoLabel(message, true);
            m_infoLauncher->deleteLater();
            return;
        }
        // Wait for either timeout or results
        m_deviceInfoButton->setEnabled(false);
    } else
コード例 #6
0
ファイル: FFPPass.cpp プロジェクト: BackupTheBerlios/slon
void FFPPass::begin() const
{
    sgl::Device*     device  = currentDevice();
    sgl::FFPProgram* program = device->FixedPipelineProgram();

    program->GetProjectionMatrixUniform()->Set( projectionMatrixParameter->value() );
    program->GetModelViewMatrixUniform()->Set( worldViewMatrixParameter->value() );

    if (diffuseSpecularParameter)
    {
        math::Vector4f diffuse = math::make_vec( math::xyz( diffuseSpecularParameter->value() ), 1.0f );
        program->GetMaterialDiffuseUniform()->Set(diffuse);
        program->GetMaterialSpecularUniform()->Set(diffuse * diffuseSpecularParameter->value().w);
    }

    for (size_t i = 0; i<textureParameters.size(); ++i)
    {
        if ( textureParameters[i] && textureParameters[i]->values() ) {
            textureParameters[i]->values()->Bind(i);
        }
    }

    if (shininessParameter) {
        program->GetMaterialShininessUniform()->Set( shininessParameter->value() );
    }

    // bind states
    if ( device->CurrentBlendState() != blendState ) {
        blendState->Bind();
    }

    if ( device->CurrentDepthStencilState() != depthStencilState ) {
        depthStencilState->Bind();
    }

    if ( device->CurrentRasterizerState() != rasterizerState ) {
        rasterizerState->Bind();
    }
}
コード例 #7
0
ファイル: DebugMesh.cpp プロジェクト: BackupTheBerlios/slon
DebugMesh::DebugMesh() :
    totalNumVertices(0),
    stateChanged(true),
    infiniteBounds(false),
    useCameraProjection(true),
    color(1.0f, 1.0f, 1.0f, 1.0f),
    textSize(10, 12),
    geometryDirty(false),
    depthTest(true),
    wireframe(false)
{
    baseTransform.make_identity();
    transform.make_identity();

    // create vertex layout
    sgl::Device* device = currentDevice();
    if ( currentRenderer()->getRenderTechnique() == Renderer::FIXED_PIPELINE )
    {
        sgl::VertexLayout::ELEMENT elements[] = 
        {
            {0, 3, 0, 12, sgl::FLOAT, sgl::VertexLayout::VERTEX}
        };
        vertexLayout.reset( device->CreateVertexLayout(1, elements) );
    }
    else
    {
        detail::AttributeTable::binding_ptr positionBinding = detail::currentAttributeTable().queryAttribute( hash_string("position") );

        sgl::VertexLayout::ELEMENT elements[] = 
        {
            {positionBinding->index, 3, 0, 12, sgl::FLOAT, sgl::VertexLayout::ATTRIBUTE}
        };
        vertexLayout.reset( device->CreateVertexLayout(1, elements) );
    }

    aabb.reset_max();
}
コード例 #8
0
void TransformEffect::dirty()
{
    // create pass
    if ( isDirty && currentRenderer()->getRenderTechnique() != Renderer::FIXED_PIPELINE ) 
    {
        EffectShaderProgram program(AUTO_LOGGER);
		if (boneMatricesBinder || (boneRotationsBinder && boneTranslationsBinder)) {
			program.addShader("Data/Shaders/skinned.vert");
		}
		else {
			program.addShader("Data/Shaders/rigid.vert");
		}
        program.addShader("Data/Shaders/fill.frag");
        program.addDefinition("#define DEPTH_ONLY");

        detail::Pass::DESC desc;
        desc.program = program.getProgram();

        detail::Pass::UNIFORM_DESC uniformDesc[4];
		{
			uniformDesc[0].uniformName = "worldViewProjMatrix";
			uniformDesc[0].parameter   = worldViewProjMatrixBinder.get();

			if (boneMatricesBinder) 
			{
				uniformDesc[1].uniformName = "boneMatrices";
				uniformDesc[1].parameter   = boneMatricesBinder.get();
			}

            if (boneRotationsBinder)
            {
				uniformDesc[2].uniformName = "boneRotations";
				uniformDesc[2].parameter   = boneRotationsBinder.get();
            }

            if (boneTranslationsBinder)
            {
				uniformDesc[3].uniformName = "boneTranslations";
				uniformDesc[3].parameter   = boneTranslationsBinder.get();
            }

			desc.uniforms    = uniformDesc;
			desc.numUniforms = 4;
		}
        
        sgl::DepthStencilState::DESC dsDesc;
        {
            dsDesc.depthEnable    = true;
            dsDesc.depthFunc      = sgl::DepthStencilState::LEQUAL;
            dsDesc.stencilEnable  = false;
            dsDesc.depthWriteMask = true;
        }
        desc.depthStencilState = currentDevice()->CreateDepthStencilState(dsDesc);
        
        sgl::RasterizerState::DESC rastDesc;
        {
            rastDesc.cullMode  = sgl::RasterizerState::BACK;
            rastDesc.fillMode  = sgl::RasterizerState::SOLID;
            rastDesc.colorMask = 0;
        }
        desc.rasterizerState = currentDevice()->CreateRasterizerState(rastDesc);

        depthPass.reset( new detail::Pass(desc) );

        // create back faces pass
        {
            rastDesc.cullMode  = sgl::RasterizerState::FRONT;
            rastDesc.fillMode  = sgl::RasterizerState::SOLID;
            rastDesc.colorMask = 0;
        }
        desc.rasterizerState = currentDevice()->CreateRasterizerState(rastDesc);
        
        backFaceDepthPass.reset( new detail::Pass(desc) );
		
        isDirty = false;
    }
}
{
    if (m_infoLauncher && m_infoLauncher->state() == trk::Launcher::WaitingForTrk) {
        m_infoLauncher->deleteLater();
        clearDeviceInfo();
        m_deviceInfoButton->setEnabled(true);
    }
}

void S60DeviceRunConfigurationWidget::updateDeviceInfo()
{
    QTC_ASSERT(!m_infoLauncher, return)
    setDeviceInfoLabel(tr("Connecting..."));
    // Do a launcher run with the ping protocol. Prompt to connect and
    // go asynchronous afterwards to pop up launch trk box if a timeout occurs.
    QString message;
    const SymbianUtils::SymbianDevice commDev = currentDevice();
    m_infoLauncher = trk::Launcher::acquireFromDeviceManager(commDev.portName(), this, &message);
    if (!m_infoLauncher) {
        setDeviceInfoLabel(message, true);
        return;
    }
    connect(m_infoLauncher, SIGNAL(stateChanged(int)), this, SLOT(slotLauncherStateChanged(int)));

    m_infoLauncher->setSerialFrame(commDev.type() == SymbianUtils::SerialPortCommunication);
    m_infoLauncher->setTrkServerName(commDev.portName());
    // Prompt user
    const trk::PromptStartCommunicationResult src =
            S60RunConfigBluetoothStarter::startCommunication(m_infoLauncher->trkDevice(),
                                                             this, &message);
    switch (src) {
    case trk::PromptStartCommunicationConnected:
コード例 #10
0
/** Reads the device selection from the ini file and sets the notifier up with the right addresses
and channel/port details.

@return KErrNone if the operation succeeded.
		Any other standard Symbian error code
 */
TInt CT_BTGPSDeviceListHandler::HandleDeviceSelection()
{
    if(iDeviceListConfig.iDeviceSelection.Length() == 0)
    {
        //Nothing to do, no device specified
        return KErrNone;
    }

    TInt err = KErrNone;
    TInt overallErr = KErrNone;
    TInt endPosition = 0;
    TInt listLength = iDeviceListConfig.iDeviceSelection.Length();

    //Loop through the devices in the ini file, adding them to the notifier
    while(listLength > 0)
    {
        err = KErrNone;

        TPtrC tempDeviceList(iDeviceListConfig.iDeviceSelection.Right(listLength));

        endPosition = tempDeviceList.Find(_L(","));
        if(endPosition == KErrNotFound)
        {
            //No more commas in the list, at the end of the file
            endPosition = tempDeviceList.Length();
        }

        TPtrC currentDevice(tempDeviceList.Mid(0, endPosition));

        TBuf<4> deviceId(currentDevice);
        deviceId.TrimAll();

        //Find this device in the BT device list
        TPtrC btAddress;
        if(!iBTListConfigFile->FindVar(deviceId, _L("Address"), btAddress))
        {
            INFO_PRINTF2(_L("ERROR - Cannot find device with id: %S, not adding to Notifier"), &deviceId);
            overallErr = err = KErrNotFound;
        }

        //If the device address has been found
        if(err == KErrNone)
        {
            TInt64 hwAddrInt(0);
            TLex lex(btAddress);
            TBTSockAddr socketAddress;

            err = lex.Val(hwAddrInt, EHex);
            if(err == KErrNone)
            {
                socketAddress.SetBTAddr(hwAddrInt);
            }

            //Get the port information
            TInt port = 0;
            if(!iBTListConfigFile->FindVar(deviceId, _L("Port"), port))
            {
                port = 1;
            }
            socketAddress.SetPort(port);

            //Get the device type
            TInt deviceType;
            if(!iBTListConfigFile->FindVar(deviceId, _L("Type"), deviceType))
            {
                //Device type not present, just add as a standard Simulation device
                deviceType = 2;
            }

            //Create the device in the neighbourhood
            RBtGpsSim sim;
            TInt err = sim.Connect();

            if (err == KErrNone)
            {
                RBtGpsSimDevice simDevice;
                err = simDevice.Open(sim, socketAddress);
                if (err == KErrNotFound)
                {
                    // Create a device Entry
                    TBtGpsSimDeviceType simType = static_cast<TBtGpsSimDeviceType>(deviceType);
                    err = simDevice.Create(sim, simType, socketAddress);
                    if(err == KErrNone)
                    {
                        simDevice.SetParameter(EBtGpsSimAuthorised, ETrue);
                        simDevice.SetParameter(EBtGpsSimPin, _L8("0000"));
                    }
                }

                //Add the device to the notifier list
                if(err == KErrNone)
                {
                    err = simDevice.AddToSelectionList();
                }

                //Check to see whether the device was successfully added
                if(err != KErrNone)
                {
                    INFO_PRINTF3(_L("ERROR %d - Cannot add device with ID %S, to the Notifier"), err, &deviceId);
                    overallErr = err;
                }

                simDevice.Close();
            }
            sim.Close();
        }

        //Get Ready for the next device
        listLength -= endPosition + 1;
    }

    return overallErr;
}
コード例 #11
0
ファイル: audiocdrecord.cpp プロジェクト: realbardia/silicon
void AudioCdRecord::step_1()
{
    p->detector->setDestinationDisc( currentDevice() );
    p->detector->check();
}