MCPcopy Create free account
hub / github.com/ChiyukiGana/Quickinput / SoundPlay

Function SoundPlay

source/src/func.cpp:78–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76 // Pop text
77 QString ParseCustom(QString text, QString name, QString number) { text.replace("@", name); return text.replace("$", number); }
78 QString ParseState(QString text) { return text.replace("@", Qi::folder); }
79 QString ParseWindow(QString text, QString window) { return text.replace("@", window); }
80 QString ParseQuickClick(QString text, short key) { return text.replace("@", QKeyEdit::keyName(key)); }
81 QString ParseMacro(QString text, QString macro, int count) { if (count) text.replace("$", QString::number(count)); else text.replace("$", "∞"); return text.replace("@", macro); }
82 void StatePop(bool state)
83 {
84 if (state) Qi::popText->Popup(Qi::ui.pop.time, ParseState(Qi::ui.pop.qe.t), Qi::ui.pop.qe.c);
85 else Qi::popText->Popup(Qi::ui.pop.time, ParseState(Qi::ui.pop.qd.t), Qi::ui.pop.qd.c);
86 }
87 void WindowPop(const QString& window, bool state)
88 {
89 if (state) Qi::popText->Popup(Qi::ui.pop.time, ParseWindow(Qi::ui.pop.we.t, window), Qi::ui.pop.we.c);
90 else Qi::popText->Popup(Qi::ui.pop.time, ParseWindow(Qi::ui.pop.wd.t, window), Qi::ui.pop.wd.c);
91 }
92 void QuickClickPop(bool state)
93 {
94 if (state) Qi::popText->Popup(Qi::ui.pop.time, ParseQuickClick(Qi::ui.pop.qce.t, Qi::fun.quickClick.key), Qi::ui.pop.qce.c);
95 else Qi::popText->Popup(Qi::ui.pop.time, ParseQuickClick(Qi::ui.pop.qcd.t, Qi::fun.quickClick.key), Qi::ui.pop.qcd.c);
96 }
97 void MacroPop(Macro* macro, bool state)
98 {
99 if (macro->mode == Macro::sw)
100 {
101 if (state) Qi::popText->Popup(Qi::ui.pop.time, ParseMacro(Qi::ui.pop.swe.t, macro->name, 0), Qi::ui.pop.swe.c);
102 else Qi::popText->Popup(Qi::ui.pop.time, ParseMacro(Qi::ui.pop.swd.t, macro->name, 0), Qi::ui.pop.swd.c);
103 }

Callers 5

ActionInterpreterMethod · 0.85
runMethod · 0.85
TriggerFunction · 0.85
QiStateFunction · 0.85
eventFilterMethod · 0.85

Calls 2

indexOfMethod · 0.80
atMethod · 0.80

Tested by

no test coverage detected