Some missing files & fixes

This commit is contained in:
Martin Bauer 2021-12-16 23:39:13 +01:00
parent 6243480f6e
commit 7a1ed75998
5 changed files with 58 additions and 19 deletions

View File

@ -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"
}
}

View File

@ -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])

View File

@ -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

View File

@ -12,16 +12,10 @@
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
framework = arduino
monitor_port = /dev/ttyUSB0
@ -30,8 +24,11 @@ monitor_speed = 115200
src_filter = +<*> -<host_test.cpp>
lib_deps =
miguelbalboa/MFRC522
bxparks/AceButton@^1.9.1
[env:native]
platform = native
src_filter = +<*> -<main.cpp>
build_flags = -Ilib/ledtl -g -DPLATFORM_NATIVE
lib_deps =
bxparks/AceButton@^1.9.1