Permalink
Browse files

Adding audiocue variable in conf. file for making a beep when a scree…

…nshot is taken. By default it is on. The beep is slightly lower pitch and shorter than the starting and ending recording beep.

Passing version number to 2.5 for next build.
  • Loading branch information...
1 parent 1d02c83 commit c898fab323a14ef72903d6befcc49c4b7c6b0295 @metadirective metadirective committed May 13, 2014
Showing with 15 additions and 11 deletions.
  1. +4 −3 MediaCours.conf
  2. +11 −8 MediaCours.py
View
@@ -37,6 +37,10 @@ audioVideoChoice=True
screencastChoice=True
live=False
+# Audiocue: make a sound when a screenshot is taken
+# a sound happens anyway when the whole recoding starts: one bip, stops: 2 bips or if some problems are detected: 3 bips
+audiocue=True
+
# Allow the client to act as a serveur for remote maintenance purposes
remoteControl=False
remotePort=80
@@ -77,9 +81,6 @@ eventDelay=0.5
# (1h=3600s ... 5h=18000s)
maxRecordingLength= 18000
-# Audiocue: gives an audio cue when recording begins and stops (in addition to the systray icons)
-audiocue=True
-
# If you use a special keyboard on the serial port give "True" here and indicate the port number to use (com1=0,com2=1,etc)
serialKeyboard=False
keyboardPort=0
View
@@ -24,7 +24,7 @@
#*******************************************************************************
-__version__="2.4"
+__version__="2.5"
## Python import (base Python 2.4)
import sys,os,time,datetime,tarfile,ConfigParser,threading,shutil,gettext,zipfile,pickle
@@ -199,6 +199,8 @@
"For live session: indicates if we have an open FTP connection to send live screenshots"
previewPlayer="realplayer"
"Standalone preview player ( realplayer or browser), used in standalone mode only"
+audiocue=True
+"make a sound when a screenshot is taken"
debug = False # more verbose messages when run from source if debug = True
forBuild = False # If not look for credentials in pass.p which is not versionned
# For publishing and live screenshots
@@ -226,7 +228,7 @@ def readConfFile(confFile="mediacours.conf"):
,serialKeyboard,startKey,videoprojectorInstalled,videoprojectorPort,keyboardPort\
,videoProjON,videoProjOFF,ftpUrl,eventDelay,maxRecordingLength,recordingPlace\
,usage,cparams,bitrate,socketEnabled,standalone,videoEncoder,audioEncoder,amxKeyboard,liveCheckBox,\
- language,ftpLogin,ftpPass,cparams, videoinput,audioinput,flashServerIP\
+ language,ftpLogin,ftpPass,cparams, videoinput,audioinput,flashServerIP,audiocue\
,formFormation, audioVideoChoice,urlLiveState,publishingForm, remoteControl, remotePort,previewPlayer, videoFormatFFMPEG, screencastChoice
confFileReport=""
@@ -286,6 +288,7 @@ def readParam(param):
if config.has_option(section,"remotePort") == True: remotePort=int(readParam("remotePort"))
if config.has_option(section,"previewPlayer") == True: previewPlayer=readParam("previewPlayer")
if config.has_option(section,"videoFormatFFMPEG") == True: videoFormatFFMPEG=readParam("videoFormatFFMPEG")
+ if config.has_option(section,"audiocue") == True: audiocue=readParam("live")
#if config.has_option(section,"screencasting") == True: screencasting=readParam("screencasting")
fconf.close()
@@ -378,11 +381,9 @@ def OnMouseEvent(event):
"""
global recording,lastEvent,lastGlobalEvent
lastGlobalEvent=time.time()# For shutdownPC_if_noactivity
- if (recording == True) and (tryFocus == False)\
- and( (time.time()-lastEvent)>eventDelay):
- if (event.MessageName == "mouse left down") or (event.Wheel==1)\
- or (event.Wheel==-1):
- if 0: winsound.Beep(300,50) # For testing purposes
+ if (recording == True) and (tryFocus == False) and( (time.time()-lastEvent)>eventDelay):
+ if (event.MessageName == "mouse left down") or (event.Wheel==1) or (event.Wheel==-1):
+ if 0: winsound.MessageBeep(winsound.MB_ICONEXCLAMATION)
start_new_thread(screenshot,())
lastEvent=time.time()
if 0: # For debug purpose put 0 for example
@@ -645,7 +646,7 @@ def screenshot():
"""
Take a screenshot and thumbnails of the screen
"""
- global recording, diaId, t0, timecodeFile, ftpHandle
+ global recording, diaId, t0, timecodeFile, ftpHandle, audiocue
#time.sleep(tempo)
if recording == True: #or False?
myscreen= ImageGrab.grab() #print "screenshot from mouse"
@@ -654,6 +655,8 @@ def screenshot():
myscreen.save(workDirectory+"/screenshots/" + 'D'+ str(diaId)+'.jpg')
timeStamp = str(round((t-t0),2))
print "Screenshot number ", diaId," taken at timeStamp = ", timeStamp
+ if audiocue==True:
+ winsound.Beep(500,70)
timecodeFile = open (workDirectory +'\\timecode.csv','a')
timecodeFile.write(timeStamp+"\n")
timecodeFile.close()

0 comments on commit c898fab

Please sign in to comment.