Example #1
0
int SoundDevicePortAudio::open() {
    qDebug() << "SoundDevicePortAudio::open()" << getInternalName();
    PaError err;

    if (m_audioOutputs.empty() && m_audioInputs.empty()) {
        m_lastError = QString::fromAscii("No inputs or outputs in SDPA::open() "
            "(THIS IS A BUG, this should be filtered by SM::setupDevices)");
        return ERR;
    }

    memset(&m_outputParams, 0, sizeof(m_outputParams));
    memset(&m_inputParams, 0, sizeof(m_inputParams));
    PaStreamParameters * pOutputParams = &m_outputParams;
    PaStreamParameters * pInputParams = &m_inputParams;

    // Look at how many audio outputs we have,
    // so we can figure out how many output channels we need to open.
    if (m_audioOutputs.empty()) {
        m_outputParams.channelCount = 0;
        pOutputParams = NULL;
    } else {
        foreach (AudioOutput out, m_audioOutputs) {
            ChannelGroup channelGroup = out.getChannelGroup();
            int highChannel = channelGroup.getChannelBase()
                + channelGroup.getChannelCount();
            if (m_outputParams.channelCount <= highChannel) {
                m_outputParams.channelCount = highChannel;
            }
        }
    }
Example #2
0
void GuiControlProfile::incLoadCount()
{
   if( !mLoadCount )
   {
      #ifdef DEBUG_SPEW
      Platform::outputDebugString( "[GuiControlProfile] Loading profile %i:%s (%s:%s)",
         getId(), getClassName(), getName(), getInternalName() );
      #endif
      
      sFontCacheDirectory = Con::getVariable( "$GUI::fontCacheDirectory" );
         
      // Load font (if not already loaded).
      
      if( mFont == NULL )
         loadFont();

      //

      if (mBitmapName && mBitmapName[0] && dStricmp(mBitmapName, "texhandle") != 0 &&
         !mTextureObject.set( mBitmapName, &GFXDefaultPersistentProfile, avar("%s() - mTextureObject (line %d)", __FUNCTION__, __LINE__) ))
         Con::errorf("Failed to load profile bitmap (%s)",mBitmapName);

      constructBitmapArray();
   }
   
   mLoadCount ++;

   // Quick check to make sure our children profile is up-to-date
   getChildrenProfile();
}
// The following method returns TRUE if parameter "output" is populated.
NABoolean
ComRoutineActionNamePart::getRoutineActionNameStoredInOBJECTS_OBJECT_NAME
(ComAnsiNamePart &output, // out
 ComBoolean performCheck) // in - default is TRUE
{
  if (NOT isValid())
    return FALSE;

  ComString funnyNameInInternalFormat;
  getUudfUID().convertTo19BytesFixedWidthStringWithZeroesPrefix(funnyNameInInternalFormat/*out*/);
  funnyNameInInternalFormat += "_";
  funnyNameInInternalFormat += getInternalName();

  NAWString ucs2FunnyInternalName;
  ComAnsiNameToUCS2(funnyNameInInternalFormat, ucs2FunnyInternalName /* out */);
  if (performCheck AND ucs2FunnyInternalName.length() > MAX_IDENTIFIER_INT_LEN)
    return FALSE;

  NAString extName = ToAnsiIdentifier(funnyNameInInternalFormat,
                                      performCheck);
  if (extName.isNull()) // the generated external name is invalid
    return FALSE;

  output.setInternalName(funnyNameInInternalFormat);
  output.setExternalName(extName);
  return TRUE;
}
//
// operator ==
//
NABoolean
ComRoutineActionNamePart::operator == (const ComRoutineActionNamePart &rhs) const
{
  return ( this EQU &rhs OR
           ( getInternalName() EQU rhs.getInternalName() AND
             getUudfUID()      EQU rhs.getUudfUID()      ));
}
void ForestItemData::packData(BitStream* stream)
{ 
   Parent::packData(stream);

   String localName = getInternalName();
   if ( localName.isEmpty() )
      localName = getName();

   stream->write( localName );

   stream->writeString(mShapeFile);
   
   stream->writeFlag( mCollidable );

   stream->write( mRadius );

   stream->write( mMass );
   stream->write( mRigidity );
   stream->write( mTightnessCoefficient );
   stream->write( mDampingCoefficient );

   stream->write( mWindScale );
   stream->write( mTrunkBendScale );
   stream->write( mWindBranchAmp );
   stream->write( mWindDetailAmp );
   stream->write( mWindDetailFreq );
}
string SymbolTableEntry::getName(bool shouldDemangle) const {
    const char* internalName = getInternalName();
    if (shouldDemangle) {
        return MachO::demangler->demangleName(internalName);
    }
    return internalName;
}
	Resource::Ptr ResourceManager::createResource(const std::string &type,
	                                              const std::string &name)
	{
		std::string resname = name;
		if (resname == "")
			resname = getInternalName();
		// Create resource
		ResourceFactory::Ptr factory = getFactory(type);
		if (!factory)
			return 0;
		Resource::Ptr created = factory->create(resname);
		return created;
	}
Example #8
0
QString MachineBridge::getAttachmentData(INetworkAdapter *iface, uint32_t attachmentType)
{
	switch(attachmentType)
	{
		case NetworkAttachmentType::NATNetwork:	return getNatNetwork(iface);
		case NetworkAttachmentType::Bridged:	return getBridgedIface(iface);
		case NetworkAttachmentType::Internal:	return getInternalName(iface);
		case NetworkAttachmentType::HostOnly:	return getHostIface(iface);
		case NetworkAttachmentType::Generic:	return getGenericDriver(iface);
		case NetworkAttachmentType::Null:
		case NetworkAttachmentType::NAT:
		default:
			return QString::fromUtf8("");
	}
}
Example #9
0
void GuiControlProfile::decLoadCount()
{
   AssertFatal( mLoadCount, "GuiControlProfile::decLoadCount - zero load count" );
   if(!mLoadCount)
      return;

   -- mLoadCount;
   if( !mLoadCount )
   {
      #ifdef DEBUG_SPEW
      Platform::outputDebugString( "[GuiControlProfile] Unloading profile %i:%s (%s:%s)",
         getId(), getClassName(), getName(), getInternalName() );
      #endif

      if( !mBitmapName || !mBitmapName[0] || dStricmp(mBitmapName, "texhandle") != 0 )
         mTextureObject = NULL;
   }
}
Example #10
0
QString MachineBridge::getInternalName(uint32_t iface)
{
	return getInternalName(getIface(iface));
}