realbasic-nug
[Top] [All Lists]

Re: accepting inserted cdr discs

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: accepting inserted cdr discs
From: Philip George <invest at juun dot com>
Date: Mon, 30 May 2005 01:49:04 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <f40e06d6f8c17b0106756d6fa6670ca6 at juun dot com> <777737eb6614218e299276c6e4e6a2c9 at juun dot com>
issue resolved by switching build type to Mach-O and removing the "Lib" suffix from each of the declares:

  #if TargetMachO
    dim devices as integer
    Declare Function DRCopyDeviceArray Lib "DiscRecording" () as integer
Declare Function CFArrayGetCount Lib "CoreFoundation" (devarray as integer) as integer Declare Function CFArrayGetValueAtIndex Lib "CoreFoundation" (devarray as integer, i as integer) as integer Declare Function DRDeviceAcquireExclusiveAccess Lib "DiscRecording" (thedev as integer) as integer
    devices = DRCopyDeviceArray()
    if CFArrayGetCount(devices) > 0 then
if DRDeviceAcquireExclusiveAccess(CFArrayGetValueAtIndex(devices, 0)) = 0 then
        MsgBox "EXCLUSIVE ACCESS TO CD/DVD BURNER ACQUIRED"
      else
        MsgBox "PROBLEM ACQUIRING EXCLUSIVE ACCESS TO CD/DVD BURNER"
      end
    else
      MsgBox "NO CD/DVD BURNER FOUND"
    end
  #endif


by the way, does this look leaky? how do i clean up after i'm done with all the stuff allocated on the heap (1 CFArray and 1 or more DRDevices)? ...or does rb take care of this for me?

- philip




On May 29, 2005, at 11:31 PM, Philip George wrote:

On May 29, 2005, at 10:17 PM, Philip George wrote:

how can i get similar behavior to roxio toast or itunes where clicking a 'burn' button allows the next inserted blank cdr to bypass the finder and be accepted by the app?

actually, i got a carbon test app to so this just now using DiscRecordingFramework:

    OSStatus err;
    CFArrayRef devices = DRCopyDeviceArray();

    if (CFArrayGetCount(devices) > 0) {
err = DRDeviceAcquireExclusiveAccess(CFArrayGetValueAtIndex(devices, 0));
        if (err == 0) {
                        // continue with disc burning operations...
        } else {
            // problem acquiring exclusive access to cd/dvd burner
        }
    } else {
        // no cd/dvd burner found
    }


once DRDeviceAcquireExclusiveAccess() is called, inserting a blank disc is **not** grabbed by the finder as it usually is.

next problem:

how do i translate that little code snippet into rb declares?

this first little piece of it isn't working:

  #if TargetMacOS
    dim devices as integer
Declare Function DRCopyDeviceArray Lib "DiscRecordingLib" () as integer
    devices = DRCopyDeviceArray()
  #endif

i get a runtime exception dialog that there was a shared lib problem. i tried with Lib "CarbonLib" too. no dice.

any ideas?

- philip





_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>