improving openframes capture interaction

This commit is contained in:
langolierz
2018-12-21 14:39:30 +00:00
parent 1ce731862a
commit 41767802c2
3 changed files with 37 additions and 47 deletions

View File

@@ -408,10 +408,12 @@ class Actions(object):
def switch_dev_mode(self, state):
if state == 'on':
self.toggle_of_screen_size('dev')
self.video_driver.osc_client.send_message("/dev_mode", True)
self.switch_display_to_hdmi()
elif state == 'off':
self.video_driver.osc_client.send_message("/dev_mode", False)
self.toggle_of_screen_size('full')
self.video_driver.osc_client.send_message("/dev_mode", True)
self.switch_display_to_lcd()
def switch_display_to_hdmi(self):
@@ -507,7 +509,6 @@ class Actions(object):
this_dispatcher.map("/player/a/status", self.video_driver.receive_status, "a.a")
this_dispatcher.map("/player/b/status", self.video_driver.receive_status, "b.b")
this_dispatcher.map("/player/c/status", self.video_driver.receive_status, "c.c")
this_dispatcher.map("/capture/is_setup", self.capture.receive_state)
this_dispatcher.map("/shutdown", self.exit_osc_server)
#this_dispatcher.map("/player/a/status", self.set_status)

View File

@@ -1,5 +1,5 @@
{
"capture": {
"captur": {
"TYPE": {
"action": "update_capture_settings",
"options": [
@@ -69,8 +69,8 @@
"value": "auto"
}
},
"midi": {
"CHANNEL": {
"incur": {
"MIDI CHANNEL": {
"action": null,
"options": [
1,
@@ -92,7 +92,7 @@
],
"value": 1
},
"INPUT": {
"MIDI INPUT": {
"action": null,
"options": [
"usb",
@@ -101,18 +101,11 @@
],
"value": "disabled"
},
"STATUS": {
"MIDI STATUS": {
"action": "get_midi_status",
"options": [],
"value": null
},
"CYCLE_PORT": {
"action": "cycle_midi_port_index",
"options": [],
"value": null
}
},
"other": {
"ANALOG_INPUT": {
"action": null,
"options": [
@@ -121,20 +114,14 @@
],
"value": "disabled"
},
"UPDATE_CODE": {
"action": "try_pull_code_and_reset",
"MIDI CYCLE_PORT": {
"action": "cycle_midi_port_index",
"options": [],
"value": null
},
"DEV_MODE_RESET": {
"action": "switch_dev_mode",
"options": [
"on",
"off"
],
"value": "off"
},
"OF_SCREEN_SIZE": {
}
},
"conjur":{
"OF_SCREEN_SIZE": {
"action": "toggle_of_screen_size",
"options": [
"full",
@@ -142,7 +129,7 @@
],
"value": "dev"
},
"USE_OF_CAPTURE": {
"USE_WITH_CAPTUR": {
"action": "set_capture_object",
"options": [
"yes",
@@ -158,13 +145,28 @@
],
"value": "omxplayer"
},
"RESTART_PROGRAM": {
"action": "restart_the_program",
"RESTART_OPENFRAMEWORKS": {
"action": "restart_openframeworks",
"options": [],
"value": null
}
},
"other": {
"UPDATE_CODE": {
"action": "try_pull_code_and_reset",
"options": [],
"value": null
},
"RESTART_OPENFRAMEWORKS": {
"action": "restart_openframeworks",
"DEV_MODE_RESET": {
"action": "switch_dev_mode",
"options": [
"on",
"off"
],
"value": "off"
},
"RESTART_PROGRAM": {
"action": "restart_the_program",
"options": [],
"value": null
},

View File

@@ -29,12 +29,9 @@ class OfCapture(object):
print('sending setup message !')
self.osc_client.send_message("/capture/setup", self.capture_type)
# try:
# self.device = picamera.PiCamera(resolution=self.resolution, framerate=self.framerate, sensor_mode = self.sensor_mode)
# except picamera.exc.PiCameraError as e:
# self.use_capture = False
# print('camera exception is {}'.format(e))
# self.message_handler.set_message('INFO', 'no capture device attached')
self.has_capture = True
return True
def piCapture_with_no_source(self):
is_piCapture = subprocess.check_output(['pivideo', '--query', 'ready'])
@@ -219,15 +216,5 @@ class OfCapture(object):
else:
return int(fractions.Fraction(setting_value) * 1000000)
def receive_state(self, unused_addr, args):
if args == 1.0:
self.has_capture = True
self.message_handler.set_message('INFO', 'capture device attached')
else:
self.has_capture = False
self.message_handler.set_message('INFO', 'no capture device attached')
print('the has capture is set to {}'.format(self.has_capture))
def close_capture(self):
pass