Printable Version of Topic
Click here to view this topic in its original format
Unofficial VirtualDub Support Forums > VirtualDub Filters and Filter Development > Disabling Preview


Posted by: jpsdr Jul 27 2011, 07:44 AM
I have the following problem.
I want in my filter, if an option is selected, to disable preview.
For this, i need to close the windows preview if this one has been opened.
I've try the following things without success :
- Use of mifp->Close(). Close indeed the windows preview, but the button wich switched between Show Preview and Hide preview is stuck afterward with Hide preview all the time.
- Use the following line if (mifp->isPreviewEnabled()) mifp->Toggle((VDXHWND)mhdlg);. I though it would only be called if the preview windows was opened, but unfortunately it's not the case, the mifp->Toggle is called even if the windows preview is closed.

So, if someone know how to do this, it will greatly help me.

Posted by: jpsdr Jul 29 2011, 07:42 AM
After a search in the code, i've discovered the preview2 class, with the IsPreviewDisplayed function.

Posted by: freedomdwarf Jul 31 2011, 05:01 PM
Why would you want to explicitly close the proview window in a filter???
Surely, with that being a user option, you should leave that to the user to decide whether to close it or not?
If I were using a filter that changed anything in the video stream I would want to see the output from the filter to see if it is what I wanted. If that filter didn't allow me to see the output results then I wouldn't ever use it. Simple.

Posted by: phaeron Jul 31 2011, 11:20 PM
I'll see if I can fix the problem with Close(). The weird thing is that the code for it actually explicitly calls InitButton(NULL), so I have to dig into the history to find out why. In the meantime, calling IsPreviewDisplayed() and then Toggle() is a good workaround.

Posted by: jpsdr Aug 1 2011, 07:28 AM
QUOTE (freedomdwarf @ Jul 31 2011, 05:01 PM)
Why would you want to explicitly close the proview window in a filter???

Because i have in some of my filters some specific settings wich i think are not compatible with preview. I mean, i'm not sure if preview will realy show the result, so, i prefer disabling it.

Posted by: freedomdwarf Aug 1 2011, 02:37 PM
QUOTE (jpsdr @ Aug 1 2011, 08:28 AM)
QUOTE (freedomdwarf @ Jul 31 2011, 05:01 PM)
Why would you want to explicitly close the proview window in a filter???

Because i have in some of my filters some specific settings wich i think are not compatible with preview. I mean, i'm not sure if preview will realy show the result, so, i prefer disabling it.

That should still be a user choice, not forced by the filter.

Powered by Invision Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)