Pause and Resume from a script

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
Jean-Francois
Posts: 361
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Pause and Resume from a script

#1

Post by Jean-Francois »

Hello Robin,

Here a simple question ... how to pause and resume a film from a script ?

Regards,
Jean-Francois
User avatar
admin
Site Admin
Posts: 13177
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Pause and Resume from a script

#2

Post by admin »

Hi Jean-Francois,

if you want to pause/resume video capture then I think you just need to do

Code: Select all

SharpCap.SelectedCamera.Paused = True
...
SharpCap.SelectedCamera.Pause = False
If you want SharpCap to take control of your DVD player then it might be a bit harder ;)

cheers,

Robin
Jean-Francois
Posts: 361
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Pause and Resume from a script

#3

Post by Jean-Francois »

Hello Robin,

OK, thanks.
I saw the "Paused" function ... but not found the "Resume".

Now it is clear ... I will try tomorrow to write something for the focus of my Sol'Ex spectrometer.

Good night,
Jean-Francois
User avatar
admin
Site Admin
Posts: 13177
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Pause and Resume from a script

#4

Post by admin »

Actually the second line in the code snippet above was meant to be

Code: Select all

SharpCap.SelectedCamera.Paused = False
sorry for the error.

cheers,

Robin
Jean-Francois
Posts: 361
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Pause and Resume from a script

#5

Post by Jean-Francois »

Hello Robin,

Yes, I see the missing "d" ... no problem.
I test it with the simulation camera ... it work fine.

Concerning the "control" of the DVD player ... after a quick search, it exist several projects that takes the control of the CD/DVD.

Here without installing something ... I test with my extern USB3 Blu-Ray burner direct from the script console ...

Code: Select all

import ctypes

# play the CD
ctypes.windll.winmm.mciSendStringW("play cdaudio from 1 to 10000", None, 0, None)

# open the CD tray door
ctypes.windll.winmm.mciSendStringW("set cdaudio door open", None, 0, None)
The play command works .... Eh!, I can listen my old CDs now from outside :D
Here only the "open" command. My DVD has no motor for opening and closing, so only the spring-opening works.


Regards,
Jean-Francois
Post Reply