Example #1
0
pid_t	CoreAudioDevice::hogModeOwner() const
{
    pid_t retour = 0;
    UInt32 size = sizeof(pid_t);
    propertyData(0, kAudioDeviceSectionInput, kAudioDevicePropertyHogMode, size, &retour);
    return retour;
}
Example #2
0
Float32 CoreAudioDevice::GetVolumeControlScalarValue(UInt32 channel, CoreAudioDeviceSection section) const
{
    Float32 value = 0.0;
    UInt32 size = sizeof(Float32);
    propertyData(channel, section, kAudioDevicePropertyVolumeScalar, size, &value);
    return value;
}
Example #3
0
UInt32 CoreAudioDevice::numberOfChannels(CoreAudioDeviceSection section) const
{
    UInt32 n = 0;
    UInt32 size = propertyDataSize(0, section, kAudioDevicePropertyStreamConfiguration);
    AudioBufferList* bufList=(AudioBufferList*)malloc(size);
    
    propertyData(0, section, kAudioDevicePropertyStreamConfiguration, size, bufList);
    for(UInt32 i = 0; i < bufList->mNumberBuffers; ++i)
    {
        n += bufList->mBuffers[i].mNumberChannels;
    }
    free(bufList);
    return n;
}
Example #4
0
CFStringRef CoreAudioDevice::name() const
{
    CFStringRef nom;
    try
    {
        UInt32 size = sizeof(CFStringRef);
        propertyData(0, kAudioDeviceSectionGlobal, kAudioDevicePropertyDeviceNameCFString, size, &nom);
    }
    catch(...)
    {
        nom = CFSTR("");
    }
    return nom;
}
Example #5
0
void MSWidget::selectionNotify(const XEvent *pEvent_)
{
#ifndef MS_WINDOWS
  if (pEvent_->xselection.selection==XA_PRIMARY&&pEvent_->xselection.requestor==_window&&
      pEvent_->xselection.property!=(Atom)None&&pEvent_->xselection.target!=(Atom)None)
   {
     if(propertyData(pEvent_->xselection.property,pEvent_->xselection.target) ==MSSuccess &&
	server()->pasteBuffer().length()>0) 
       {
	 insertPrimarySelection();
       }
   }
#else
  insertPrimarySelection();
#endif
}
Example #6
0
/**
 * Provides the data to display/edit for a given index and role.
 * @param  index The index for which data is requested
 * @param  role  The requested role
 * @return The relevant data
 */
QVariant LexerStyleModel::data(const QModelIndex& index, int role) const
{
	const Node* node = nodeFromIndex(index);
	if (node == NULL || node->data() == NULL)
		return 0;

	if (node->data()->type() == StyleNode) {
		// Get the lexer and style ID for this node.
		StyleData* data = static_cast<StyleData*>(node->data());
		QsciLexer* lexer = data->lexer_;
		int style = data->style_;

		switch (index.column()) {
		case 0:
			// Show language name or style name in the first column.
			if (role == Qt::DisplayRole) {
				if (style == lexer->defaultStyle())
					return lexer->language();

				return lexer->description(style);
			}
			break;

		case 1:
			// Show a formatted text string in the second column, using the
			// style's properties.
			return styleData(node, role);
		}
	}
	else {
		// Get the lexer and style ID for this node.
		PropertyData* data = static_cast<PropertyData*>(node->data());

		switch (index.column()) {
		case 0:
			if (role == Qt::DisplayRole)
				return propertyName(data->prop_);
			break;

		case 1:
			return propertyData(data, role);
		}
	}

	return QVariant();
}