actually never mind, fixed the underlying bugs (and made QuickLevel much more efficient in the process)

master
zetaPRIME 2022-03-20 03:09:33 -04:00
parent 7f471bf5ce
commit 3eb25120ce
9 changed files with 12 additions and 20 deletions

6
notes
View File

@ -41,7 +41,8 @@ TODO {
}
filter cutoff preset for knobgadget
- force at least 1hz in svfilter for normalization
move config default vars into a single file for cleanliness
revert-to-saved menu action
@ -59,9 +60,6 @@ TODO {
focusable control to set param
}
- qt update causing some patchboard artifacting on mouse movement
eventually switch from indiscriminate mouse-move updates to only on certain events
look into performance/timing/sync of audio engine; it's having buffer issues way more than it feels like it should
editing song info should probably be an UndoStack action

View File

@ -3,5 +3,3 @@
using namespace Xybrid::Config;
bool UIConfig::verticalKnobs = false;
bool UIConfig::fullSceneRefresh = true;

View File

@ -4,7 +4,5 @@ namespace Xybrid::Config {
namespace UIConfig {
/// Determines if KnobGadgets turn with vertical mouse movement instead of horizontal.
extern bool verticalKnobs;
extern bool fullSceneRefresh;
}
}

View File

@ -91,7 +91,9 @@ void QuickLevel::process() {
lv[1][1] = std::max(lv[1][1], f.r);
}
if (obj) QMetaObject::invokeMethod(obj->scene(), "update", Qt::QueuedConnection);
if (obj) QMetaObject::invokeMethod(obj, [obj = obj] {
obj->scene()->update(obj->sceneBoundingRect());
}, Qt::QueuedConnection);
}
// clear levels on port disconnect

View File

@ -12,7 +12,10 @@ void GadgetScene::toolTip(QGraphicsItem* g, const QString& s, const QPointF& pos
if (s.isEmpty()) {
if (toolTipSource && toolTipSource != g) return;
// remove existing tool tip
if (toolTipObject) toolTipObject->deleteLater();
if (toolTipObject) {
toolTipObject->setVisible(false); // hide immediately to ensure ghosting doesn't happen
toolTipObject->deleteLater();
}
toolTipObject = nullptr;
} else {
// create/set up

View File

@ -17,6 +17,6 @@ namespace Xybrid::UI {
GadgetScene(QGraphicsView* view);
~GadgetScene() override = default;
void toolTip(QGraphicsItem*, const QString&, const QPointF&, const QColor&);
void toolTip(QGraphicsItem*, const QString& = { }, const QPointF& = {0, 0}, const QColor& = {255, 255, 255});
};
}

View File

@ -64,7 +64,7 @@ void PortObject::setHighlighted(bool h, bool hideLabel) {
if (!port->name.isEmpty()) txt = qs("%1 (%2)").arg(port->name).arg(txt);
double side = port->type == Port::Input ? -1.0 : 1.0;
gs->toolTip(this, txt, {side, 0}, c);
} else gs->toolTip(this, { }, { }, { });
} else gs->toolTip(this);
update();
}
@ -175,7 +175,7 @@ NodeObject::NodeObject(const std::shared_ptr<Data::Node>& n) {
node->onGadgetCreated();
emit finalized();
emit finalized(); // clazy:exclude=incorrect-emit
}
void NodeObject::setGadgetSize(QPointF p) {

View File

@ -183,11 +183,6 @@ void PatchboardScene::keyReleaseEvent(QKeyEvent* e) {
if (!e->isAccepted() && !e->isAutoRepeat()) stopPreview(Util::unshiftedKey(e->key()));
}
void PatchboardScene::mouseMoveEvent(QGraphicsSceneMouseEvent* e) {
QGraphicsScene::mouseMoveEvent(e);
if (UIConfig::fullSceneRefresh) update(); // force full update (for now)
}
void PatchboardScene::startPreview(int key, int16_t note) {
stopPreview(key); // end current preview first, if applicable
auto p = graph->project->shared_from_this();

View File

@ -34,8 +34,6 @@ namespace Xybrid::UI {
void keyPressEvent(QKeyEvent*) override;
void keyReleaseEvent(QKeyEvent*) override;
void mouseMoveEvent(QGraphicsSceneMouseEvent*) override;
void refresh();
};
}