Batch292Check190sw.inc 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. // Round 190sw (0.1.33): issue #292 the routing cables beside the Playlist, #322 macOS's menu bar, #289 the hardware outputs
  2. // export. Included in the app class of Main.cpp; --batch292test190sw <report> [picture prefix] and --selftest "batch292_190sw".
  3. // With a prefix, the pictures (100 % and @150): the cables with the Master / return rows and without them (tags), the
  4. // window's toolbar with the menu row as macOS's menu bar leaves it, and as it was.
  5. juce::String batch292Check190sw (juce::String& log, const juce::String& prefix = {})
  6. {
  7. using namespace lynx;
  8. juce::String result = "OK";
  9. const auto check = [&] (const juce::String& what, bool ok, const juce::String& detail = {}) {
  10. log << (ok ? "ok " : "FAIL ") << what << (detail.isNotEmpty() ? " (" + detail + ")" : juce::String()) << "\n";
  11. if (! ok && result == "OK")
  12. result = "ERROR " + what;
  13. };
  14. const auto both = [&prefix] (juce::Component& c, juce::Rectangle<int> area, const juce::String& name) {
  15. if (prefix.isEmpty())
  16. return;
  17. area = area.getIntersection (c.getLocalBounds());
  18. if (area.isEmpty())
  19. return;
  20. savePng (c.createComponentSnapshot (area, true, 1.0f), prefix + "-" + name + ".png");
  21. savePng (c.createComponentSnapshot (area, true, 1.5f), prefix + "-" + name + "@150.png");
  22. };
  23. juce::LookAndFeel::setDefaultLookAndFeel (&lookAndFeel);
  24. const juce::ScopedValueSetter<bool> shown (ui::showingForShots(), true);
  25. const auto cablesWas = routecables::on, rowsWas = mixerrows::shown;
  26. const auto modeWas = macmenu::mode();
  27. AudioEngine engine (false);
  28. const auto pump = [&engine] (int ms) {
  29. const auto end = juce::Time::getMillisecondCounter() + (juce::uint32) ms;
  30. while (juce::Time::getMillisecondCounter() < end)
  31. {
  32. engine.dispatchPendingMessages();
  33. #if JUCE_LINUX || JUCE_WINDOWS
  34. for (int i = 0; i < 64 && juce::detail::dispatchNextMessageOnSystemQueue (true); ++i) {}
  35. #endif
  36. juce::Thread::sleep (5);
  37. }
  38. };
  39. // ---- the song: inserts 1 Kick, 2 Snare -> 3 Drum bus (off the Master), 4 Lead vocal (sends to 6 REVERB, 7 DELAY
  40. // pre-fader, a sidechain link to 8 Bass), 5 Backing -> 4 (off the Master); 7 is a Live return. Tracks 0-5 linked.
  41. auto made = [] {
  42. auto song = Song::makeDefault();
  43. song.mode = PlayMode::song;
  44. song.playlistTracks.resize (40);
  45. const char* names[] = { "Kick", "Snare", "Drum bus", "Lead vocal", "Backing", "Bass" };
  46. const int inserts[] = { 1, 2, 3, 4, 5, 8 };
  47. while (song.mixer.size() < 10)
  48. song.mixer.push_back ({});
  49. for (int t = 0; t < 6; ++t)
  50. {
  51. auto& p = song.playlistTracks[(std::size_t) t];
  52. p.name = names[t];
  53. p.mode = PlaylistTrackMode::audio;
  54. p.mixerTrack = inserts[t];
  55. song.mixer[(std::size_t) inserts[t]].name = names[t];
  56. }
  57. for (int t = 6; t < 40; ++t)
  58. song.playlistTracks[(std::size_t) t].name = "Track " + std::to_string (t + 1);
  59. song.mixer[6].name = "REVERB";
  60. song.mixer[7].name = "DELAY";
  61. song.mixer[7].liveReturn = true;
  62. song.mixer[1].sends = { { 3, 1.0f } };
  63. song.mixer[2].sends = { { 3, 1.0f } };
  64. song.mixer[1].toMaster = song.mixer[2].toMaster = false;
  65. song.mixer[4].sends = { { 6, 0.7f }, { 7, 0.4f, true }, { 8, 0.0f } };
  66. song.mixer[5].sends = { { 4, 1.0f } };
  67. song.mixer[5].toMaster = false;
  68. Clip last; // (a clip on the 40th track: the Playlist shows 40 tracks and scrolls)
  69. last.kind = ClipKind::pattern;
  70. last.pattern = 0;
  71. last.track = 39;
  72. last.length = 4 * ppq;
  73. song.playlist.push_back (last);
  74. return song;
  75. }();
  76. lynx::MainComponent ui (engine, false);
  77. ui.setSize (1920, 1080);
  78. pump (50);
  79. engine.setSong (made);
  80. pump (100);
  81. ui.selectTabForSnapshot (2);
  82. pump (100);
  83. auto& playlist = ui.getPlaylistForSnapshot();
  84. auto& cables = ui.routingCablesForCheck();
  85. auto& area = ui.playlistAreaForCheck();
  86. // ================= #292: the routing cables ===================================================================
  87. // (not on macOS: the Playlist follows the song through the message loop, which the self-test doesn't pump there)
  88. #if JUCE_LINUX || JUCE_WINDOWS
  89. {
  90. routecables::on = false;
  91. ui.applyRoutingCables();
  92. pump (30);
  93. const auto x0 = playlist.getX(), w0 = playlist.getWidth();
  94. check ("292 off (the default): no gutter, the Playlist where it was", ! cables.isVisible() && area.cablesWidth() == 0);
  95. workflowextras::setExtra ("playlist.routingCables", true);
  96. pump (50);
  97. check ("292 on: the gutter shows left of the Playlist, 40 px", cables.isVisible() && cables.getWidth() == routecables::gutterWidth
  98. && cables.getRight() == playlist.getX() && playlist.getX() == x0 + routecables::gutterWidth
  99. && playlist.getWidth() == w0 - routecables::gutterWidth,
  100. cables.getBounds().toString() + " / " + playlist.getBounds().toString());
  101. check ("292 the gutter starts under the Playlist's toolbar band", cables.getY() == playlist.getY() + PlaylistComponent::toolbarHeight);
  102. mixerrows::shown = true;
  103. playlist.refreshViewOptions();
  104. pump (50);
  105. playlist.selectTrack (3); // Lead vocal
  106. pump (50);
  107. auto l = cables.layout();
  108. const auto socketOf = [&l] (int track, int insert) -> const RoutingCablesView::Socket* {
  109. for (const auto& s : l.sockets)
  110. if ((track >= 0 && s.track == track) || (track < 0 && s.track < 0 && s.insert == insert))
  111. return &s;
  112. return nullptr;
  113. };
  114. check ("292 a socket on each linked row (6 tracks) and on each mixer row (REVERB, DELAY, Master)",
  115. socketOf (0, 1) && socketOf (5, 8) && socketOf (-1, 6) && socketOf (-1, 7) && socketOf (-1, 0) && socketOf (7, -1) == nullptr,
  116. juce::String ((int) l.sockets.size()));
  117. check ("292 the selected track's socket is the source", l.sourceTrack == 3 && l.source >= 0 && l.sockets[(std::size_t) l.source].track == 3);
  118. check ("292 five cables: the Master, REVERB, DELAY, the sidechain to Bass, Backing coming in", l.cables.size() == 5);
  119. const auto tipAt = [&l] (routecables::Kind kind, int insert) -> std::optional<juce::Point<float>> {
  120. for (const auto& c : l.cables)
  121. if (c.cable.kind == kind && c.cable.insert == insert)
  122. return c.arrowTip;
  123. return std::nullopt;
  124. };
  125. const auto near = [] (std::optional<juce::Point<float>> tip, const RoutingCablesView::Socket* s) {
  126. return tip.has_value() && s != nullptr && std::abs (tip->y - s->at.y) < 0.5f && tip->x <= s->at.x && tip->x > s->at.x - 10.0f;
  127. };
  128. const auto* source = l.source >= 0 ? &l.sockets[(std::size_t) l.source] : nullptr;
  129. check ("292 the Master cable ends at the Master row", near (tipAt (routecables::Kind::master, 0), socketOf (-1, 0)));
  130. check ("292 the REVERB send ends at its return row", near (tipAt (routecables::Kind::send, 6), socketOf (-1, 6)));
  131. check ("292 the DELAY send (pre-fader) ends at its row", near (tipAt (routecables::Kind::send, 7), socketOf (-1, 7)));
  132. check ("292 the sidechain ends at the Bass track", near (tipAt (routecables::Kind::sidechain, 8), socketOf (5, 8)));
  133. check ("292 Backing's send comes into the selected track", near (tipAt (routecables::Kind::receive, 5), source));
  134. check ("292 every cable stays inside the gutter", [&] {
  135. for (const auto& c : l.cables)
  136. {
  137. const auto b = c.path.getBounds();
  138. if (b.getX() < 0.0f || b.getRight() > (float) cables.getWidth())
  139. return false;
  140. }
  141. return true;
  142. }());
  143. // the hint of a cable's middle
  144. juce::String hint;
  145. for (const auto& c : l.cables)
  146. if (c.cable.kind == routecables::Kind::send && c.cable.insert == 6)
  147. {
  148. const auto p = c.path.getPointAlongPath (c.path.getLength() * 0.5f);
  149. hint = cables.hintAt (p.roundToInt()).text;
  150. }
  151. check ("292 a cable's hint names it and its level", hint.contains ("REVERB") && hint.contains ("dB"), hint);
  152. both (ui, ui.getLocalArea (&area, area.getLocalBounds()).withWidth (900), "292-cables-rows");
  153. // without the mixer rows: REVERB, DELAY and the Master are tags at the foot
  154. mixerrows::shown = false;
  155. playlist.refreshViewOptions();
  156. pump (50);
  157. l = cables.layout();
  158. int tags = 0;
  159. bool tagsInside = true;
  160. juce::String where;
  161. for (const auto& s : l.sockets)
  162. if (s.tag)
  163. {
  164. ++tags;
  165. tagsInside = tagsInside && cables.getLocalBounds().toFloat().contains (s.tagBounds);
  166. where << s.tagBounds.toString() << "; ";
  167. }
  168. check ("292 without rows, the inserts with no row are tags (REVERB, DELAY, M) at the gutter's foot", tags == 3 && tagsInside && l.cables.size() == 5,
  169. juce::String (tags) + " " + where + "gutter " + cables.getBounds().toString());
  170. both (ui, ui.getLocalArea (&area, area.getLocalBounds()).withWidth (900), "292-cables-tags");
  171. // a track with no insert: no cable; the bus: its inputs
  172. playlist.selectTrack (2);
  173. pump (30);
  174. l = cables.layout();
  175. int incoming = 0;
  176. for (const auto& c : l.cables)
  177. incoming += c.cable.kind == routecables::Kind::receive ? 1 : 0;
  178. check ("292 the Drum bus shows Kick and Snare coming in", incoming == 2);
  179. playlist.selectTrack (10);
  180. pump (30);
  181. check ("292 an empty track: its socket, no cable", cables.layout().cables.empty() && cables.layout().source >= 0);
  182. const auto sig = cables.cableSignature();
  183. playlist.setScrollYForSnapshot (60);
  184. check ("292 a scroll changes what the gutter draws", cables.cableSignature() != sig);
  185. playlist.setScrollYForSnapshot (0);
  186. workflowextras::setExtra ("playlist.routingCables", false);
  187. pump (30);
  188. check ("292 off again: the gutter goes, the Playlist back", ! cables.isVisible() && playlist.getX() == x0 && playlist.getWidth() == w0);
  189. }
  190. #else
  191. juce::ignoreUnused (both, playlist, cables, area);
  192. log << "skip 292 on macOS (checked on Linux and Windows)\n";
  193. #endif
  194. // ================= #322: macOS's menu bar =====================================================================
  195. {
  196. const auto mac = modmap::hostOs() == modmap::Os::mac;
  197. auto& model = ui.macMenuForCheck();
  198. macmenu::mode() = macmenu::Mode::systemBar;
  199. ui.applyMacMenu();
  200. #if JUCE_MAC
  201. check ("322 macOS: the menus are in the system menu bar", juce::MenuBarModel::getMacMainMenu() == &model && model.isInstalled());
  202. check ("322 macOS: the window's menu row is hidden", ui.menuRowHiddenForCheck() && ! ui.menuBarForCheck().isVisible());
  203. #else
  204. check ("322 not macOS: no system menu bar, the window's row shows", ! model.isInstalled() && ! ui.menuRowHiddenForCheck() && ui.menuBarForCheck().isVisible());
  205. #endif
  206. check ("322 the system bar's menus are the window's", model.getMenuBarNames() == ui.getMenuNamesForSnapshot());
  207. check ("322 every menu builds for the system bar (as JUCE builds them all when the model is installed)", [&] {
  208. const auto all = model.getMenuBarNames();
  209. for (int i = 0; i < all.size(); ++i)
  210. if (model.getMenuForIndex (i, all[i]).getNumItems() == 0)
  211. return false;
  212. return all.size() >= 8;
  213. }());
  214. // the File menu: no shortcut left in a title; Save (⌘S / Ctrl+S) has its key
  215. const auto names = ui.getMenuNamesForSnapshot();
  216. const auto file = model.getMenuForIndex (juce::jmax (0, names.indexOf (tr ("File"))), tr ("File"));
  217. bool tabs = false, saveKey = false;
  218. int keyed = 0;
  219. std::function<void (const juce::PopupMenu&)> walk = [&] (const juce::PopupMenu& menu) {
  220. for (juce::PopupMenu::MenuItemIterator it (menu); it.next();)
  221. {
  222. const auto& item = it.getItem();
  223. tabs = tabs || item.text.containsChar ('\t');
  224. if (item.commandManager == &model.commands())
  225. {
  226. ++keyed;
  227. const auto keysOf = model.commands().getKeyMappings()->getKeyPressesAssignedToCommand (item.itemID);
  228. if (item.text == tr ("Save") && ! keysOf.isEmpty())
  229. saveKey = keysOf[0] == juce::KeyPress ('s', juce::ModifierKeys::commandModifier, 0)
  230. || keysOf[0].getKeyCode() == 's' && keysOf[0].getModifiers() == juce::ModifierKeys (juce::ModifierKeys::commandModifier);
  231. }
  232. if (item.subMenu != nullptr)
  233. walk (*item.subMenu);
  234. }
  235. };
  236. walk (file);
  237. check ("322 no menu title keeps its shortcut text (macOS draws the key)", ! tabs);
  238. check ("322 shortcuts become key equivalents (Save: the command key + S)", saveKey && keyed >= 3, juce::String (keyed));
  239. check ("322 every key equivalent is one macOS takes (a nil one ends the app: macOS CI run 46366524858)", [&] {
  240. const auto all = model.getMenuBarNames();
  241. bool ok = true;
  242. std::function<void (const juce::PopupMenu&)> keysOf = [&] (const juce::PopupMenu& menu) {
  243. for (juce::PopupMenu::MenuItemIterator it (menu); it.next();)
  244. {
  245. const auto& item = it.getItem();
  246. if (item.commandManager != nullptr)
  247. for (const auto& k : item.commandManager->getKeyMappings()->getKeyPressesAssignedToCommand (item.itemID))
  248. ok = ok && MacMenuModel::usableKey (k);
  249. if (item.subMenu != nullptr)
  250. keysOf (*item.subMenu);
  251. }
  252. };
  253. for (int i = 0; i < all.size(); ++i)
  254. keysOf (model.getMenuForIndex (i, all[i]));
  255. return ok && ! MacMenuModel::usableKey (juce::KeyPress (-1, juce::ModifierKeys::commandModifier, 0))
  256. && ! MacMenuModel::usableKey (juce::KeyPress (juce::KeyPress::deleteKey)) && MacMenuModel::usableKey (juce::KeyPress ('s', juce::ModifierKeys::commandModifier, 's'))
  257. && MacMenuModel::usableKey (juce::KeyPress (juce::KeyPress::spaceKey, 0, ' '))
  258. #if JUCE_MAC
  259. && MacMenuModel::usableKey (juce::KeyPress (juce::KeyPress::F5Key)) // (NSF5FunctionKey; Linux's F-key codes are past Unicode)
  260. #endif
  261. ;
  262. }());
  263. const auto key = ui.keyForShortcutText (juce::String::fromUTF8 (keys::displayString (keys::Chord { 'S', keys::ctrl }).c_str()));
  264. check ("322 a shortcut text reads back as its key", key.has_value() && key->getModifiers().isCommandDown() && key->getKeyCode() == 's');
  265. macmenu::mode() = macmenu::Mode::both;
  266. ui.applyMacMenu();
  267. check ("322 'both' (FL Studio for Mac): the window's row shows too", ! ui.menuRowHiddenForCheck() && ui.menuBarForCheck().isVisible() && model.isInstalled() == mac);
  268. macmenu::mode() = macmenu::Mode::window;
  269. ui.applyMacMenu();
  270. check ("322 'in the window only': no system menu bar", ! model.isInstalled() && ui.menuBarForCheck().isVisible());
  271. #if JUCE_MAC
  272. check ("322 macOS 'in the window only': the system bar has no LYNX menus", juce::MenuBarModel::getMacMainMenu() != &model);
  273. #endif
  274. // the window as a Mac shows it with the menus in its bar: the row's room goes to the hint bar, nothing overlaps
  275. macmenu::mode() = macmenu::Mode::systemBar;
  276. ui.applyMacMenu();
  277. ui.forceMenuRowHiddenForCheck (false);
  278. pump (30);
  279. const auto hintBefore = ui.getHintBarForSnapshot().getBounds();
  280. both (ui, juce::Rectangle<int> (0, 0, 1920, 76), "322-toolbar-row");
  281. ui.forceMenuRowHiddenForCheck (true);
  282. pump (30);
  283. const auto hintAfter = ui.getHintBarForSnapshot().getBounds();
  284. check ("322 hidden row: the menu bar is hidden", ! ui.menuBarForCheck().isVisible());
  285. check ("322 hidden row: the toolbar's items still fit, nothing overlaps", ui.checkToolbarItemsForSnapshot().isEmpty(), ui.checkToolbarItemsForSnapshot());
  286. check ("322 hidden row: the hint bar keeps its place, at least FL's 240 px wide (the room of the menu titles goes to the panels)",
  287. hintAfter.getX() == hintBefore.getX() && hintAfter.getWidth() >= 240, hintBefore.toString() + " -> " + hintAfter.toString());
  288. both (ui, juce::Rectangle<int> (0, 0, 1920, 76), "322-toolbar-macbar");
  289. ui.forceMenuRowHiddenForCheck (mac);
  290. }
  291. // ================= #289: the hardware outputs export ==========================================================
  292. {
  293. // a synth on insert 1, which goes to output 3 alone (mono) and not to the Master; a synth on insert 2 to the Master
  294. auto s = Song::makeDefault();
  295. s.bpm = 120.0;
  296. s.mode = PlayMode::song;
  297. s.mixer = Song::defaultMixer (2);
  298. s.channels.clear();
  299. for (int c = 0; c < 2; ++c)
  300. {
  301. ChannelDef ch;
  302. ch.instrument = InstrumentKind::synth;
  303. ch.mixerTrack = c + 1;
  304. ch.name = c == 0 ? "to out 3" : "to the Master";
  305. s.channels.push_back (ch);
  306. }
  307. s.mixer[1].outputChannel = 2;
  308. s.mixer[1].outputMode = OutputMode::monoSum;
  309. s.mixer[1].toMaster = false;
  310. s.patterns.clear();
  311. s.patterns.emplace_back();
  312. for (int c = 0; c < 2; ++c)
  313. {
  314. Note n;
  315. n.channel = c;
  316. n.key = c == 0 ? 57 : 64;
  317. n.start = 0;
  318. n.length = 4 * ppq;
  319. s.patterns[0].notes.push_back (n);
  320. }
  321. Clip clip;
  322. clip.kind = ClipKind::pattern;
  323. clip.pattern = 0;
  324. clip.length = 4 * ppq;
  325. s.playlist = { clip };
  326. const auto render = [] (const Song& song, exportopts::Channels channels, juce::String& error) {
  327. exportopts::Options o;
  328. o.channels = channels;
  329. o.wavBits = 32;
  330. o.tail = exportopts::TailMode::cut;
  331. const auto file = juce::File::getSpecialLocation (juce::File::tempDirectory).getChildFile ("lynx190sw-hw-" + juce::String (juce::Random::getSystemRandom().nextInt()) + ".wav");
  332. juce::AudioBuffer<float> buffer;
  333. ExportJob job (song, o, file);
  334. if (job.run ([] (double) { return true; }, error))
  335. {
  336. juce::AudioFormatManager formats;
  337. formats.registerBasicFormats();
  338. if (std::unique_ptr<juce::AudioFormatReader> reader (formats.createReaderFor (file)); reader != nullptr)
  339. {
  340. buffer.setSize ((int) reader->numChannels, (int) reader->lengthInSamples);
  341. reader->read (&buffer, 0, buffer.getNumSamples(), 0, true, true);
  342. }
  343. }
  344. file.deleteFile();
  345. return buffer;
  346. };
  347. juce::String error;
  348. const auto file = render (s, exportopts::Channels::hardwareOutputs, error);
  349. const auto rms = [&file] (int ch) { return ch < file.getNumChannels() ? file.getRMSLevel (ch, 0, file.getNumSamples()) : -1.0f; };
  350. check ("289 the file has a channel per output used (the Master on 1-2, insert 1 on 3)", file.getNumChannels() == 3 && file.getNumSamples() > 44100, error + " " + juce::String (file.getNumChannels()));
  351. check ("289 output 3 holds insert 1, outputs 1-2 the Master", rms (2) > 0.01f && rms (0) > 0.01f && rms (1) > 0.01f,
  352. juce::String (rms (0), 4) + " " + juce::String (rms (1), 4) + " " + juce::String (rms (2), 4));
  353. auto quiet = s;
  354. quiet.channels[1].muted = true;
  355. const auto alone = render (quiet, exportopts::Channels::hardwareOutputs, error);
  356. check ("289 the channel on the Master muted: outputs 1-2 silent, output 3 still plays (one insert, one output)",
  357. alone.getNumChannels() == 3 && alone.getRMSLevel (0, 0, alone.getNumSamples()) < 1.0e-6f && alone.getRMSLevel (2, 0, alone.getNumSamples()) > 0.01f);
  358. // the Export window with the choice made (a picture only)
  359. if (prefix.isNotEmpty())
  360. if (auto panel = makeExportPanel (engine))
  361. {
  362. panel->setSize (juce::jmax (panel->getWidth(), 900), juce::jmax (panel->getHeight(), 640));
  363. std::function<juce::ComboBox* (juce::Component&)> findBox = [&] (juce::Component& c) -> juce::ComboBox* {
  364. if (auto* box = dynamic_cast<juce::ComboBox*> (&c); box != nullptr && box->getNumItems() == 5
  365. && box->getItemText (4) == tr ("Hardware outputs, one channel each (LYNX)"))
  366. return box;
  367. for (auto* child : c.getChildren())
  368. if (auto* found = findBox (*child))
  369. return found;
  370. return nullptr;
  371. };
  372. auto* box = findBox (*panel);
  373. check ("289 the Export window's Channels box has the choice", box != nullptr);
  374. if (box != nullptr)
  375. box->setSelectedItemIndex (4);
  376. both (*panel, panel->getLocalBounds(), "289-export-channels");
  377. }
  378. const auto stereo = render (s, exportopts::Channels::stereo, error);
  379. check ("289 the stereo export is the Master as before (insert 1 not in it)", stereo.getNumChannels() == 2 && stereo.getNumSamples() == file.getNumSamples()
  380. && [&] {
  381. for (int ch = 0; ch < 2; ++ch)
  382. for (int i = 0; i < stereo.getNumSamples(); ++i)
  383. if (stereo.getSample (ch, i) != file.getSample (ch, i))
  384. return false;
  385. return true;
  386. }());
  387. }
  388. routecables::on = cablesWas;
  389. mixerrows::shown = rowsWas;
  390. macmenu::mode() = modeWas;
  391. return result;
  392. }