/* druWaitForErasableMedia DRNotificationCallback to wait for blank media. */ void druWaitForErasableMedia(DRNotificationCenterRef center,void *observer,CFStringRef name,DRTypeRef object,CFDictionaryRef info) { #pragma unused(center, info, observer) DRDeviceRef device = (DRDeviceRef)object; /* The device may have been unplugged - check for that. */ if (CFEqual(name,kDRDeviceDisappearedNotification) || !DRDeviceIsValid(device)) { printf("Aborted. (device disconnected)\n"); exit(1); } /* If the device status changed, and there's blank media now.... */ if (CFEqual(name,kDRDeviceStatusChangedNotification) && druDeviceContainsErasableMedia(device)) { /* Then stop the runloop. */ CFRunLoopStop(CFRunLoopGetCurrent()); } }
JNIEXPORT jboolean JNICALL Java_jdrlib_JDRDevice_nativeIsValid(JNIEnv *env, jobject obj, jlong dev) { DRDeviceRef device = (DRDeviceRef)(long)dev; return DRDeviceIsValid(device) == noErr ? 1 : 0; }