Skip to content

Commit

Permalink
Merge branch 'master' into plugin-store
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Oct 31, 2023
2 parents ab31ed7 + 42792de commit 9d48763
Show file tree
Hide file tree
Showing 19 changed files with 428 additions and 230 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.kdev_include_paths
package-lock.json
*~
*.dll
*.o
*.so
*.pyc
Expand Down
15 changes: 8 additions & 7 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,6 @@
$('#mod-bypassRight').hide()
}

if ({{using_app}}) {
desktop.setupApp()
}

if ({{using_mod}}) {
desktop.authenticateDevice(function (ok) {
if (ok) {
Expand All @@ -191,9 +187,6 @@
$('#mod-status').show().statusTooltip('updatePosition')
}

if (PREFERENCES['dev-mode'] == "on") {
enable_dev_mode(true)
}
if (PREFERENCES['plugins-folded'] == "true") {
desktop.effectBox.effectBox('toggle')
}
Expand All @@ -202,6 +195,14 @@
}
desktop.pedalboardBox.pedalboardBox('initViewMode', PREFERENCES['pb-view-mode'])

if ({{using_app}}) {
desktop.setupApp()
} else {
if (PREFERENCES['dev-mode'] == "on") {
enable_dev_mode(true)
}
}

// start code for ajax loading bar

NProgress.configure({
Expand Down
4 changes: 4 additions & 0 deletions html/js/desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,11 @@ function Desktop(elements) {
$('#mod-bank').hide()
$('#mod-file-manager').hide()
$('#mod-settings').hide()
$('#mod-devices').hide()
$('#mod-status').hide()
$('#mod-ram').hide()
$('#pedalboards-library').find('a').hide()
$('#pedal-presets-window').find('.js-assign-all').hide()
}

this.effectBox = self.makeEffectBox(elements.effectBox,
Expand Down
2 changes: 1 addition & 1 deletion html/js/hardware.js
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ function HardwareManager(options) {
btn.addClass('selected')
}
// Hide Device tab under mod-app
if (jbtn.attr('data-value') === deviceOption && options.isApp()) {
if (options.isApp() && (jbtn.attr('data-value') === deviceOption || jbtn.attr('data-value') === ccOption)) {
jbtn.hide()
}
// Hide MIDI tab if not available
Expand Down
2 changes: 1 addition & 1 deletion html/js/modgui.js
Original file line number Diff line number Diff line change
Expand Up @@ -2660,7 +2660,7 @@ JqueryClass('customSelectPath', baseWidget, {
if (!self.data('enabled')) {
return self.customSelectPath('prevent', e)
}
var value = opt.attr('mod-parameter-value')
var value = opt.attr('mod-parameter-value').replace(/\\/g,'\\\\')
self.customSelectPath('setValue', value, false)
})
})
Expand Down
15 changes: 14 additions & 1 deletion mod/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

import os
import sys
import re
import json
import shutil
Expand All @@ -14,6 +15,9 @@
from mod.settings import HARDWARE_DESC_FILE


WINDOWS = sys.platform == 'win32'


def jsoncall(method):
@wraps(method)
def wrapper(self, *args, **kwargs):
Expand All @@ -39,6 +43,11 @@ def json_handler(obj):
return None


def os_sync():
if not WINDOWS:
os.sync()


def check_environment():
from mod.settings import (LV2_PEDALBOARDS_DIR,
DEFAULT_PEDALBOARD, DEFAULT_PEDALBOARD_COPY,
Expand Down Expand Up @@ -92,7 +101,7 @@ def check_environment():
# remove previous update file
if os.path.exists(UPDATE_MOD_OS_FILE) and not os.path.exists("/root/check-upgrade-system"):
os.remove(UPDATE_MOD_OS_FILE)
os.sync()
os_sync()

if os.path.exists(UPDATE_MOD_OS_HERLPER_FILE):
os.remove(UPDATE_MOD_OS_HERLPER_FILE)
Expand Down Expand Up @@ -227,4 +236,8 @@ def __exit__(self, typ, val, tb):
self.filehandle.flush()
os.fsync(self.filehandle)
self.filehandle.close()

if WINDOWS and os.path.exists(self.filename):
os.remove(self.filename)

os.rename(self.filename+".tmp", self.filename)
13 changes: 12 additions & 1 deletion mod/hmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,14 @@
from mod.settings import LOG

import logging
import serial
import time

try:
import serial
haveSerial = True
except ImportError:
haveSerial = False

class SerialIOStream(BaseIOStream):
def __init__(self, sp):
self.sp = sp
Expand Down Expand Up @@ -111,6 +116,12 @@ def isFake(self):
# this can be overriden by subclasses to avoid any connection in DEV mode
def init(self, callback):
ioloop = IOLoop.instance()

if not haveSerial:
print("ERROR: This system has no python serial support")
ioloop.call_later(1, callback)
return

try:
sp = None
# pylint: disable=unexpected-keyword-arg
Expand Down
Loading

0 comments on commit 9d48763

Please sign in to comment.