Esempio n. 1
0
AAFRESULT ImplAAFSegment::FindSubSegment(aafPosition_t offset, 
										 aafPosition_t *sequPosPtr,
										 ImplAAFSegment **subseg,
										 aafBool *found)
{
	aafLength_t	segLen;
	aafPosition_t begPos, endPos, zero;
	
	XPROTECT( )
	{
		CHECK(GetLength(&segLen));
		begPos = 0;
		zero = 0;
		endPos = begPos;
		endPos += segLen;
		if ((begPos <= offset) &&
			(offset < endPos))
		{
			*found = kAAFTrue;
			*subseg = this;
			// We are returning a reference to this object so bump the ref count
			AcquireReference();
			*sequPosPtr = 0;
		}
		else if ((begPos == endPos) && (offset == zero))	 //JeffB: Handle zero-length sourceClips
		{
			*found = kAAFTrue;
			*subseg = this;
			// We are returning a reference to this object so bump the ref count
			AcquireReference();
			*sequPosPtr = 0;
		}
		else
		{
			*found = kAAFFalse;
			*subseg = NULL;
			*sequPosPtr = 0;
		}
	} /* XPROTECT */
	XEXCEPT
	{
	}
	XEND;

	return(AAFRESULT_SUCCESS);
}
Esempio n. 2
0
Int32 CursorWindow::GetNumRows()
{
    AcquireReference();
    //try {
    Int32 num = NativeGetNumRows();
    //} finally {
    ReleaseReference();
    //}
    return num;
}
Esempio n. 3
0
Boolean CursorWindow::AllocRow()
{
    AcquireReference();
    //try {
    Boolean result = NativeAllocRow();
    //} finally {
    ReleaseReference();
    //}
    return result;
}
Esempio n. 4
0
ECode CursorWindow::FreeLastRow()
{
    AcquireReference();
    //try {
    NativeFreeLastRow();
    //} finally {
    ReleaseReference();
    //}
    return NOERROR;
}
Esempio n. 5
0
Boolean CursorWindow::SetNumColumns(
    /* [in] */ Int32 columnNum)
{
    AcquireReference();
    //try {
    Boolean result = NativeSetNumColumns(columnNum);
    //} finally {
    ReleaseReference();
    //}
    return result;
}
Esempio n. 6
0
ECode CursorWindow::Clear()
{
    AcquireReference();
    //try {
    mStartPos = 0;
    NativeClear();
    //} finally {
    ReleaseReference();
    //}
    return NOERROR;
}
Esempio n. 7
0
Boolean CursorWindow::PutNull(
    /* [in] */ Int32 row,
    /* [in] */ Int32 col)
{
    AcquireReference();
    //try {
    Boolean result = NativePutNull(row - mStartPos, col);
    //} finally {
    ReleaseReference();
    //}
    return result;
}
Esempio n. 8
0
Boolean CursorWindow::IsNull(
    /* [in] */ Int32 row,
    /* [in] */ Int32 col)
{
    AcquireReference();
    //try {
    Boolean isNull = NativeIsNull(row - mStartPos, col);
    //} finally {
    ReleaseReference();
    //}
    return isNull;
}
Esempio n. 9
0
status_t
CreateThreadEvent::Fire()
{
	bool wasPending = atomic_get_and_set(&fPendingDPC, 1) != 0;
	if (wasPending)
		return B_BUSY;

	AcquireReference();
	DPCQueue::DefaultQueue(B_NORMAL_PRIORITY)->Add(this);

	return B_OK;
}
Esempio n. 10
0
ECode CursorWindow::GetBlob(
    /* [in] */ Int32 row,
    /* [in] */ Int32 col,
    /* [out] */ ArrayOf<Byte>** blob)
{
    AcquireReference();
    //try {
    ECode ec = NativeGetBlob(row - mStartPos, col, blob);
    //} finally {
    ReleaseReference();
    //}
    return ec;
}
Esempio n. 11
0
Boolean CursorWindow::PutBlob(
    /* [in] */ const ArrayOf<Byte> & value,
    /* [in] */ Int32 row,
    /* [in] */ Int32 col)
{
    AcquireReference();
    //try {
    Boolean result = NativePutBlob(value, row - mStartPos, col);
    //} finally {
    ReleaseReference();
    //}
    return result;
}
Esempio n. 12
0
ECode CursorWindow::IsString(
    /* [in] */ Int32 row,
    /* [in] */ Int32 col,
    /* [out] */ Boolean* isString)
{
    AcquireReference();
    //try {
    ECode ec = NativeIsString(row - mStartPos, col, isString);
    //} finally {
    ReleaseReference();
    //}
    return ec;
}
Esempio n. 13
0
ECode CursorWindow::GetDouble(
    /* [in] */ Int32 row,
    /* [in] */ Int32 col,
    /* [out] */ Double* value)
{
    AcquireReference();
    //try {
    ECode ec = NativeGetDouble(row - mStartPos, col, value);
    //} finally {
    ReleaseReference();
    //}
    return ec;
}
Esempio n. 14
0
ECode CursorWindow::GetString(
    /* [in] */ Int32 row,
    /* [in] */ Int32 col,
    /* [out] */ String* str)
{
    AcquireReference();
    //try {
    ECode ec = NativeGetString(row - mStartPos, col, str);
    //} finally {
    ReleaseReference();
    //}
    return ec;
}
Esempio n. 15
0
// ReadVNode
status_t
VirtualVolume::ReadVNode(vnode_id vnid, char reenter, Node** node)
{
	if (vnid != GetRootID())
		return B_BAD_VALUE;

	AutoLocker<Locker> _(fLock);
	fRootNode->SetKnownToVFS(true);
	*node = fRootNode;

	// add a volume reference for the node
	AcquireReference();

	return B_OK;
}
Esempio n. 16
0
ECode CursorWindow::GetFloat(
    /* [in] */ Int32 row,
    /* [in] */ Int32 col,
    /* [out] */ Float* value)
{
    AcquireReference();
    //try {
    Double dValue;
    ECode ec = NativeGetDouble(row - mStartPos, col, &dValue);
    *value = dValue;
    //} finally {
    ReleaseReference();
    //}
    return ec;
}
Esempio n. 17
0
ECode CursorWindow::GetInt32(
    /* [in] */ Int32 row,
    /* [in] */ Int32 col,
    /* [out] */ Int32* value)
{
    AcquireReference();
    //try {
    Int64 i64Value;
    ECode ec = NativeGetInt64(row - mStartPos, col, &i64Value);
    *value = (Int32)i64Value;
    //} finally {
    ReleaseReference();
    //}
    return ec;
}
Esempio n. 18
0
status_t
SignalEvent::Fire()
{
	bool wasPending = atomic_get_and_set(&fPendingDPC, 1) != 0;
	if (wasPending)
		return B_BUSY;

	if (fSignal->MarkUsed()) {
		atomic_set(&fPendingDPC, 0);
		return B_BUSY;
	}

	AcquireReference();
	DPCQueue::DefaultQueue(B_NORMAL_PRIORITY)->Add(this);

	return B_OK;
}
Esempio n. 19
0
// AddChildVolume
status_t
VirtualVolume::AddChildVolume(Volume* volume)
{
	if (!volume)
		return B_BAD_VALUE;

	// don't add anything, if we are already unmounting
	AutoLocker<Locker> locker(fLock);
	if (fUnmounting)
		return B_BAD_VALUE;

	// get and check the node name
	char name[B_FILE_NAME_LENGTH];
	int32 nameLen = strlen(volume->GetName());
	if (nameLen == 0 || nameLen >= B_FILE_NAME_LENGTH)
		return B_BAD_VALUE;
	strcpy(name, volume->GetName());

	// add the volume's root node
	status_t error = fRootNode->AddEntry(name, volume->GetRootNode());
	if (error != B_OK)
		return error;

	// set the volume's parent volume
	volume->SetParentVolume(this);
	AcquireReference();

	// send out a notification
	vnode_id dirID = fRootNode->GetID();
	vnode_id nodeID = volume->GetRootID();
	locker.Unlock();
	NotifyListener(B_ENTRY_CREATED, fVolumeManager->GetID(), dirID, 0, nodeID,
		name);

	return B_OK;
}