IDCMP_DISKINSERTED

This forum is for general developer support questions.

IDCMP_DISKINSERTED

Postby mritter0 » Tue Oct 27, 2015 9:44 pm

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
mritter0
 
Posts: 207
Joined: Mon Aug 25, 2014 10:41 pm
Location: Bettendorf, IA, USA

Re: IDCMP_DISKINSERTED

Postby tonyw » Wed Oct 28, 2015 12:14 am

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
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 1298
Joined: Wed Mar 09, 2011 2:36 pm
Location: Sydney, Australia

Re: IDCMP_DISKINSERTED

Postby thomasrapp » Wed Oct 28, 2015 12:37 pm

It causes flicker if your program shows a list of drives which is refreshed whenever such a signal is received.
User avatar
thomasrapp
 
Posts: 247
Joined: Sun Jun 19, 2011 12:22 am

Re: IDCMP_DISKINSERTED

Postby broadblues » Wed Oct 28, 2015 3:59 pm

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
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 528
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK

Re: IDCMP_DISKINSERTED

Postby thomasrapp » Wed Oct 28, 2015 6:31 pm

A program which plays sounds on system events would suffer, too.
User avatar
thomasrapp
 
Posts: 247
Joined: Sun Jun 19, 2011 12:22 am

Re: IDCMP_DISKINSERTED

Postby mritter0 » Wed Oct 28, 2015 7:23 pm

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
User avatar
mritter0
 
Posts: 207
Joined: Mon Aug 25, 2014 10:41 pm
Location: Bettendorf, IA, USA

Re: IDCMP_DISKINSERTED

Postby xenic » Thu Oct 29, 2015 4:46 pm

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
xenic
 
Posts: 1100
Joined: Sun Jun 19, 2011 1:06 am

Re: IDCMP_DISKINSERTED

Postby thomasrapp » Thu Oct 29, 2015 5:03 pm

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
thomasrapp
 
Posts: 247
Joined: Sun Jun 19, 2011 12:22 am

Re: IDCMP_DISKINSERTED

Postby tonyw » Thu Oct 29, 2015 11:46 pm

What "floppies" are we talking about, here? Which device driver?
cheers
tony
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 1298
Joined: Wed Mar 09, 2011 2:36 pm
Location: Sydney, Australia

Re: IDCMP_DISKINSERTED

Postby ZeroG » Fri Oct 30, 2015 9:07 am

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?
User avatar
ZeroG
 
Posts: 117
Joined: Sat Jun 18, 2011 12:31 pm
Location: Germany

Next

Return to General Developer Support

Who is online

Users browsing this forum: No registered users and 1 guest