Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
Use new Stream Deck cache
Browse files Browse the repository at this point in the history
  • Loading branch information
VortexAcherontic committed May 11, 2023
1 parent 55f5896 commit 659ff90
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions ed_ui_gtk4/el_decko_gtk4.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
gi.require_version('Gtk', '4.0')
gi.require_version('Adw', '1')
from gi.repository import GLib, Gtk, GObject, Adw
from ed_core import streamdeck, query_deck
from ed_core import cache, core


class MainWindow(Gtk.ApplicationWindow):
Expand Down Expand Up @@ -67,24 +67,24 @@ def reload_core(self, button):
self.start_core()

def create_combo_box(self):
if streamdeck.get_stream_decks():
for index, deck in enumerate(streamdeck.get_stream_decks()):
deck_type = query_deck.query_deck(deck, query_deck.QueryType.DECK_TYPE)
if cache.CACHE:
for index, deck in enumerate(cache.CACHE):
deck_type = deck["deck_type"]
self.cb_decks.append(str(index), deck_type)
self.cb_decks.set_active_id("0")

def create_button_grid(self, index):
if streamdeck.get_stream_decks():
deck = streamdeck.get_stream_decks()[int(index)]
key_layout = query_deck.query_deck(deck, query_deck.QueryType.KEY_LAYOUT)
serial = query_deck.query_deck(deck, query_deck.QueryType.SERIAL)
if cache.CACHE:
deck = cache.CACHE[int(index)]
key_layout = deck["key_layout"]
serial = deck["serial"]
rows = key_layout[0]
columns = key_layout[1]
serial = serial
current_key = 0
for i in range(0, rows):
for j in range(0, columns):
key_cfg = streamdeck.get_key_config(serial, current_key)
key_cfg = core.get_key_config(serial, current_key)
bt_box = Gtk.Box(spacing=6, orientation=Gtk.Orientation.VERTICAL,
halign=Gtk.Align.CENTER, valign=Gtk.Align.CENTER)
image = Gtk.Image()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dynamic = ["version", "readme"]
description = "El Decko GTK4 User Interface"
license = { text = "GPL-3"}
dependencies = [
"el_decko_core>=2023.5.8.1",
"el_decko_core>=2023.5.11",
"xdg>=6.0.0",
"PyGObject>=3.42.2"
]
Expand Down

0 comments on commit 659ff90

Please sign in to comment.