Hello.
I'm a newbie to this Disc Recording stuff, and after having read the below I
changed some of my code but apparently I didn't change it correctly and thus
my "free space" calculations didn't work out. So, I'm seeking clarification.
I tried searching the mailing list archives and the docs (pity those
conceptual docs got put on the backburner), but didn't see an answer to my
question.
on 11/15/05 2:30 PM, Ed Wynne at
arwyn@appl... wrote:
> On Nov 15, 2005, at 2:19 PM, Benjámin Salánki wrote:
>
>> I have a method that checks if there is available free space on a
>> disc to fit my data on it.
>>
>> But if a rewritable disc is inserted into the drive and i choose
>> erase before burn my app still calculates the free space that is
>> available on the yet unerased disc.
>>
>> My question is if i can somehow query if the erase before burn
>> option was selected in the DRBurnSetupPanel, as I have my method
>> check for the size right after the setup panel ended.
>>
>> Or should I check at some other point before the burning starts?
>
> You should check the (k)DRDeviceMediaBlocksOverwritable instead of
> the free space. For rewritable media, overwritable will be the value
> of free space** after the disc has been erased.
>
> -Ed
>
> ** Due to uncontrollable drive lameness, it may be off by +/- a few
> blocks.
I have a method that calculates the free space on a device. I'm using the
C/Carbon DiscRecording API. So I have my DRDeviceRef, I
DRDeviceCopyStatus(), I then get the kDRDeviceMediaInfoKey. Then, I obtain
the kDRDeviceMediaBlocksFreeKey and do my math.
Based on the above message, I changed my code from using the
kDRDeviceMediaBlocksFreeKey to use the kDRDeviceMediaBlocksOverwritableKey.
And that seemed to work out ok when burning to a CD-R the first time. But if
we then tried to append to the same CD-R, it would fail saying there's not
enough disk space (the appends worked fine with
kDRDeviceMediaBlocksFreeKey).
Rereading the above, it sounds like one should only use BlocksOverwritable
if you know the media is rewritable (and then, I assume if the user
specified to erase before burning). So is that the case? That I should check
what type of media it is first, then based on the media type (and perhaps
the options the user set in the burn setup dialog) I determine which key to
check?
Bottom line: just how is one to determine the free space on the burnable
media? What's the procedure, what keys/data are we to check, any special
math considerations (e.g. to deal with that uncontrollable drive lameness
mentioned above).
Thank you.
--
John C. Daub }:-)>=
<mailto:
hsoi@hsoi...> <
http://www.hsoi.com/>
Peace on the Earth, goodwill to men.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Discrecording mailing list (
Discrecording@list...)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/discrecording/subscriber%40opensubscriber.com
This email sent to
subscriber@open...
opensubscriber is not affiliated with the authors of this message nor responsible for its content.