In [1]:
import IPython
import ipywidgets

import context
import gopro_helper as gopro

In [2]:
%load_ext autoreload
%autoreload 2

Dropdown feature/option selection widget

Driven entirely by GoPro JSON configuration file.


In [3]:
# Fetch new information from camera
raw_status, raw_settings = gopro.commands.get_raw_status_settings()

info_status = gopro.api.parse_status_names(raw_status)
name_mode, name_sub_mode = gopro.api.parse_mode_sub_mode(info_status)

name_mode


Out[3]:
'video'

Features and Options


In [4]:
gopro.commands.set_mode_photo()

In [5]:
# List features for current mode (copied from API notebook)
features = gopro.api.mode_features(name_mode)
    
for F in features:
    print('{:2d} - {:22s} [{}]'.format(F['id'], F['path_segment'], F['display_name']))


 1 - default_sub_mode       [Default Video Sub Mode]
68 - current_sub_mode       [Video Sub Mode]
 2 - resolution             [Resolution]
 3 - fps                    [Frames Per Second]
 4 - fov                    [Field of View]
 5 - timelapse_rate         [Interval]
 6 - looping                [Interval]
 7 - piv                    [Interval]
 8 - low_light              [Low Light]
78 - eis                    [Video Stabilization]
10 - protune                [Protune]
11 - protune_white_balance  [White Balance]
12 - protune_color          [Color]
14 - protune_sharpness      [Sharpness]
15 - protune_ev             [EV Comp]
73 - exposure_time          [Shutter]
13 - protune_iso            [ISO]
74 - protune_iso_mode       [ISO Mode]
96 - no_audio               [No Audio Track]

In [6]:
# List features for current mode (copied from API notebook)
features = gopro.api.mode_features(name_mode)
    
for F in features:
    print(F['path_segment'])


default_sub_mode
current_sub_mode
resolution
fps
fov
timelapse_rate
looping
piv
low_light
eis
protune
protune_white_balance
protune_color
protune_sharpness
protune_ev
exposure_time
protune_iso
protune_iso_mode
no_audio

The Widget


In [7]:
wid = gopro.Settings()



In [18]:
wid.start()



In [9]:
wid.stop()

In [16]:
gopro.commands.set_mode_photo()

In [8]:
gopro.commands.set_mode_video()

In [ ]:
wid.up