Skip to content

Commit

Permalink
added user settable recording dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkassner committed Oct 15, 2014
1 parent 6028191 commit e8ef3bb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pupil_src/capture/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,23 @@ def get_from_data(data):
"""
return data.value

def set_rec_dir(val):
try:
n_path = os.path.expanduser(val.value)
logger.debug("Expanded user path.")
except:
n_path = val.value

if not n_path:
logger.warning("Please specify a path.")
elif not os.path.isdir(n_path):
logger.warning("This is not a valid path.")
else:
g_pool.rec_dir = n_path

def get_rec_dir():
return create_string_buffer(g_pool.rec_dir,512)

def set_rec_name(val):
if not val.value:
g_pool.rec_name = recorder.get_auto_name()
Expand Down Expand Up @@ -272,6 +289,7 @@ def reset_timebase():
bar.add_var("display size", vtype=window_size_enum,setter=set_window_size,getter=get_from_data,data=bar.window_size,help="Resize the world window. This has no effect on the actual image.")
bar.add_var("calibration method",setter=open_calibration,getter=get_from_data,data=bar.calibration_type, vtype=calibrate_type_enum,group="Calibration", help="Please choose your desired calibration method.")
bar.add_button("show calibration result",toggle_show_calib_result, group="Calibration", help="Click to show calibration result.")
bar.add_var("rec dir",create_string_buffer(512),getter = get_rec_dir,setter= set_rec_dir, group="Recording", help="Specify the recording path")
bar.add_var("session name",create_string_buffer(512),getter = get_rec_name,setter= set_rec_name, group="Recording", help="Give your recording session a custom name.")
bar.add_button("record", toggle_record_video, key="r", group="Recording", help="Start/Stop Recording")
bar.add_var("record eye", bar.record_eye, group="Recording", help="check to save raw video of eye")
Expand Down

0 comments on commit e8ef3bb

Please sign in to comment.