IDCMP_DISKINSERTED

This forum is for general developer support questions.
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

IDCMP_DISKINSERTED

Post by mritter0 »

My program watches for IDCMP_DISKINSERTED and IDCMP_DISKREMOVED. When a floppy is inserted I first get a REMOVED then INSERTED message. When I remove the floppy I only get REMOVED.

It does not do this for CDs.

I am using OS4.1FE Classic in WinUAE. I posted it originally on EAB. http://eab.abime.net/showthread.php?t=80113 Not sure if it is OS issue or WinUAE issue.
Workbench Explorer - A better way to browse drawers
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: IDCMP_DISKINSERTED

Post by tonyw »

When you insert a disk, the first signal (REMOVED) is redundant. That shouldn't be a problem to your software, though? It's just a notification to clear any old attachments you may have had.
cheers
tony
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

Re: IDCMP_DISKINSERTED

Post by thomasrapp »

It causes flicker if your program shows a list of drives which is refreshed whenever such a signal is received.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: IDCMP_DISKINSERTED

Post by broadblues »

thomasrapp wrote:It causes flicker if your program shows a list of drives which is refreshed whenever such a signal is received.
That depends on prgram design abit though does it not?

Receive Notification
Clear data
Update Display
Reload data
Update Display

Will certainly flicker

Recieve notification
Verify data
Update if changed

Won't so much.

I've not used it much directly, but I've always though of it's primary purpose as being to enabled auto clearing of insert volume requesters.
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

Re: IDCMP_DISKINSERTED

Post by thomasrapp »

A program which plays sounds on system events would suffer, too.
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

Re: IDCMP_DISKINSERTED

Post by mritter0 »

I updated my code to not flash the list being updated twice. It is a little strange behavior, but I can live with it.

Thomas is right about sounds. Floppies aren't in much use anymore, but still have to have a little bit of support for them, mainly ADFs.
Workbench Explorer - A better way to browse drawers
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 12:06 am

Re: IDCMP_DISKINSERTED

Post by xenic »

mritter0 wrote:I updated my code to not flash the list being updated twice. It is a little strange behavior, but I can live with it.

Thomas is right about sounds. Floppies aren't in much use anymore, but still have to have a little bit of support for them, mainly ADFs.
If the Intuition only sends a IDCMP_DISKINSERTED message when a CD is inserted, how can you distinguish between a quick removal and reinsertion of a CD and the insertion of a floppy disk? Both actions will produce IDCMP_DISKREMOVED followed by IDCMP_DISKINSERTED.

It's nice that people have offered workarounds but the problem should be fixed or at least examined. The system should act constistantly for disk removal/insertion and I think someone needs to file a bug report so the issue can be examined and potentially fixed
AmigaOne X1000 with 2GB memory - OS4.1 FE
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

Re: IDCMP_DISKINSERTED

Post by thomasrapp »

CDs work fine. They send DISKINSERTED when you insert a disk and DISKREMOVED when you remove one.

Floppies issue redundant messages. When you remove a disk, they send DISKREMOVED, that's ok. But when you insert a disk, they send both DISKREMOVED and DISKINSERTED. They shouldn't send a REMOVED message on disk insertion.
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: IDCMP_DISKINSERTED

Post by tonyw »

What "floppies" are we talking about, here? Which device driver?
cheers
tony
User avatar
ZeroG
Posts: 124
Joined: Sat Jun 18, 2011 11:31 am
Location: Germany

Re: IDCMP_DISKINSERTED

Post by ZeroG »

This could be a "feature" of WinUAE - if there is a disk (adf) in dfx: and you change the adf without manually removing the adf WinUAE has to emulate a "disk removed" and a "disk inserted" hardware event in a very short time - this could explain mritters observation.

WinUAE could even do this for every new inserted adf, even if there was no disk in drive before.

Anyone testet this on real hardware?
Post Reply