diff --git a/espmusicmouse/.vscode/settings.json b/espmusicmouse/.vscode/settings.json index df80d00..ce5562c 100644 --- a/espmusicmouse/.vscode/settings.json +++ b/espmusicmouse/.vscode/settings.json @@ -6,6 +6,42 @@ "unordered_map": "cpp", "unordered_set": "cpp", "vector": "cpp", - "system_error": "cpp" + "system_error": "cpp", + "cstdint": "cpp", + "cmath": "cpp", + "array": "cpp", + "cctype": "cpp", + "clocale": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "functional": "cpp", + "string_view": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "fstream": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "limits": "cpp", + "memory": "cpp", + "new": "cpp", + "ostream": "cpp", + "numeric": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "cinttypes": "cpp", + "utility": "cpp", + "typeinfo": "cpp" } } \ No newline at end of file diff --git a/espmusicmouse/doc.md b/espmusicmouse/doc.md index 9a5305e..2849b3f 100644 --- a/espmusicmouse/doc.md +++ b/espmusicmouse/doc.md @@ -15,7 +15,7 @@ Reader Button Board: ------------- -- rot in | white 13 +- rot in | white 13 - btn2 led | grey 12 - btn2 in | purple 14 - rotB | blue 27 diff --git a/espmusicmouse/host_driver/main.py b/espmusicmouse/host_driver/main.py index d1087b6..a5f9330 100644 --- a/espmusicmouse/host_driver/main.py +++ b/espmusicmouse/host_driver/main.py @@ -69,7 +69,8 @@ def on_firmware_msg(protocol: MusicMouseProtocol, message): eff.swipe.bell_curve_width_in_leds = 6 protocol.led_ring_effect(eff) - protocol.mouse_led_effect(EffectStaticConfig(ColorRGBW(0, 0, 1, 0))) + protocol.mouse_led_effect( + EffectStaticConfig(ColorRGBW(18 / 255 / 2, 156 / 255 / 2, 140 / 255 / 2, 0))) print(figure) if figure in playlists: audio_player.set_playlist(playlists[figure]) diff --git a/espmusicmouse/host_driver/player.py b/espmusicmouse/host_driver/player.py index c8db800..58bc969 100644 --- a/espmusicmouse/host_driver/player.py +++ b/espmusicmouse/host_driver/player.py @@ -75,7 +75,11 @@ class AudioPlayer: self.media_player = self.media_list_player.get_media_player() evm = self.media_player.event_manager() - evm.event_attach(vlc.EventType.MediaPlayerEndReached, self._callback) + evm.event_attach(vlc.EventType.MediaPlayerStopped, self._callback) + evm.event_attach(vlc.EventType.MediaListEndReached, self._callback) + + evm2 = self.media_list_player.event_manager() + evm2.event_attach(vlc.EventType.MediaListEndReached, self._callback) self.on_playlist_end_callback = None @@ -107,12 +111,13 @@ class AudioPlayer: self.media_list_player.pause() def _callback(self, event, *args, **kwargs): - if event.type == vlc.EventType.MediaPlayerEndReached: + + if True: # event.type == vlc.EventType.MediaPlayerEndReached: print("End reached") if self.on_playlist_end_callback: self.on_playlist_end_callback() - #print("Callback from VLC", event, args, kwargs) - #print(event.meta_type, event.obj, event.type) + print("Callback from VLC", event, args, kwargs) + print(event.meta_type, event.obj, event.type) def change_volume(self, amount=1): vol = self.media_player.audio_get_volume() + amount diff --git a/espmusicmouse/platformio.ini b/espmusicmouse/platformio.ini index d507438..df60b87 100644 --- a/espmusicmouse/platformio.ini +++ b/espmusicmouse/platformio.ini @@ -1,4 +1,4 @@ -;PlatformIO Project Configuration File +; PlatformIO Project Configuration File ; ; Build options: build flags, source filter ; Upload options: custom upload port, speed and extra flags @@ -12,26 +12,23 @@ data_dir = data default_envs = esp32 - [env:esp32] platform = espressif32 -#platform_packages = -# framework-arduinoespressif32@https://github.com/espressif/arduino-esp32 board = esp-wrover-kit board_upload.flash_size = "4MB" -#platform = espressif8266 -#board = esp_wroom_02 -#build_flags = -Wl,-Teagle.flash.2m1m.ld -build_flags = -DPLATFORM_ESP32 +build_flags = -DPLATFORM_ESP32 framework = arduino monitor_port = /dev/ttyUSB0 upload_port = /dev/ttyUSB0 monitor_speed = 115200 src_filter = +<*> - -lib_deps = - miguelbalboa/MFRC522 +lib_deps = + miguelbalboa/MFRC522 + bxparks/AceButton@^1.9.1 [env:native] -platform=native +platform = native src_filter = +<*> - -build_flags=-Ilib/ledtl -g -DPLATFORM_NATIVE \ No newline at end of file +build_flags = -Ilib/ledtl -g -DPLATFORM_NATIVE +lib_deps = + bxparks/AceButton@^1.9.1