diff options
author | neodarz <neodarz@neodarz.net> | 2019-05-10 22:46:44 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2019-05-10 22:46:44 +0200 |
commit | dec49f55a15622b5489ba06ad7492796c7d65672 (patch) | |
tree | 3dcbd5a34d2b3580be82cd78bddc2a2e702b3ea3 | |
parent | 12c9474218f835a9443def9b685241db5454ef40 (diff) | |
download | pyParrotZikTCP-dec49f55a15622b5489ba06ad7492796c7d65672.tar.xz pyParrotZikTCP-dec49f55a15622b5489ba06ad7492796c7d65672.zip |
Update parrot zik version1
Diffstat (limited to '')
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | parrot_zik/interface/version1.py | 50 |
2 files changed, 17 insertions, 35 deletions
@@ -15,6 +15,8 @@ reverse engineering of Parrot Zik communication protocol. This repo contains some base class without unmaintained pyGTK crap and python3 compatible code with a simple TCP client/server for use this. +/!\ Parrot Zik 1 not tested for the moment. + ## Windows Usage Windows support is not tested for the moment. All old code from forked project diff --git a/parrot_zik/interface/version1.py b/parrot_zik/interface/version1.py index d0a1b2b..1d8f385 100644 --- a/parrot_zik/interface/version1.py +++ b/parrot_zik/interface/version1.py @@ -1,5 +1,4 @@ from parrot_zik import resource_manager -from parrot_zik.indicator import MenuItem from parrot_zik.interface.base import ParrotZikBaseInterface from parrot_zik.model.version1 import ParrotZikVersion1 @@ -9,55 +8,36 @@ class ParrotZikVersion1Interface(ParrotZikBaseInterface): def __init__(self, indicator): super(ParrotZikVersion1Interface, self).__init__(indicator) - self.noise_cancelation = MenuItem( - "Noise Cancellation", self.toggle_noise_cancelation, - checkitem=True, visible=False) - self.lou_reed_mode = MenuItem("Lou Reed Mode", self.toggle_lou_reed_mode, - checkitem=True, visible=False) - self.concert_hall_mode = MenuItem( - "Concert Hall Mode", self.toggle_parrot_concert_hall, - checkitem=True, visible=False) - self.indicator.menu.append(self.noise_cancelation) - self.indicator.menu.append(self.lou_reed_mode) - self.indicator.menu.append(self.concert_hall_mode) def activate(self, manager): super(ParrotZikVersion1Interface, self).activate(manager) - self.noise_cancelation.set_active(self.parrot.cancel_noise) - self.lou_reed_mode.set_active(self.parrot.lou_reed_mode) - self.concert_hall_mode.set_active(self.parrot.concert_hall) - - self.noise_cancelation.show() - self.lou_reed_mode.show() - self.concert_hall_mode.show() - self.indicator.menu.reposition() def deactivate(self): - self.noise_cancelation.hide() - self.lou_reed_mode.hide() - self.concert_hall_mode.hide() super(ParrotZikVersion1Interface, self).deactivate() - def toggle_noise_cancelation(self, widget): + def toggle_noise_cancelation(self, noise_cancelation): + """ + Define noise cancelation mode. + """ try: - self.parrot.cancel_noise = self.noise_cancelation.get_active() - self.noise_cancelation.set_active(self.parrot.cancel_noise) + self.parrot.cancel_noise = noise_cancelation except resource_manager.DeviceDisconnected: self.deactivate() - def toggle_lou_reed_mode(self, widget): + def toggle_lou_reed_mode(self, lou_reed_mode): + """ + Define lou reed mode. + """ try: - self.parrot.lou_reed_mode = self.lou_reed_mode.get_active() - self.lou_reed_mode.set_active(self.parrot.lou_reed_mode) - self.concert_hall_mode.set_active(self.parrot.concert_hall) - self.concert_hall_mode.set_sensitive( - not self.lou_reed_mode.get_active()) + self.parrot.lou_reed_mode = lou_reed_mode except resource_manager.DeviceDisconnected: self.deactivate() - def toggle_parrot_concert_hall(self, widget): + def toggle_parrot_concert_hall(self, parrot_concert_hall): + """ + Define parrot concert hall + """ try: - self.parrot.concert_hall = self.concert_hall_mode.get_active() - self.concert_hall_mode.set_active(self.parrot.concert_hall) + self.parrot.concert_hall = parrot_concert_hall except resource_manager.DeviceDisconnected: self.deactivate() |