📄 rosegardenguiapp.cpp
字号:
connect(m_dockLeft, SIGNAL(hasUndocked()), this, SLOT(slotParametersClosed())); // Apparently, hasUndocked() is emitted when the dock widget's // 'close' button on the dock handle is clicked. connect(m_mainDockWidget, SIGNAL(docking(KDockWidget*, KDockWidget::DockPosition)), this, SLOT(slotParametersDockedBack(KDockWidget*, KDockWidget::DockPosition))); stateChanged("parametersbox_closed", KXMLGUIClient::StateReverse); RosegardenGUIDoc* doc = new RosegardenGUIDoc(this, m_pluginManager); m_parameterArea = new RosegardenParameterArea(m_dockLeft); m_dockLeft->setWidget(m_parameterArea); // Populate the parameter-box area with the respective // parameter box widgets. m_segmentParameterBox = new SegmentParameterBox(doc, m_parameterArea); m_parameterArea->addRosegardenParameterBox(m_segmentParameterBox); m_trackParameterBox = new TrackParameterBox(doc, m_parameterArea); m_parameterArea->addRosegardenParameterBox(m_trackParameterBox); m_instrumentParameterBox = new InstrumentParameterBox(doc, m_parameterArea); m_parameterArea->addRosegardenParameterBox(m_instrumentParameterBox); // Lookup the configuration parameter that specifies the default // arrangement, and instantiate it. kapp->config()->setGroup(GeneralOptionsConfigGroup); m_parameterArea->setArrangement((RosegardenParameterArea::Arrangement) kapp->config()->readUnsignedNumEntry("sidebarstyle", RosegardenParameterArea::CLASSIC_STYLE)); m_dockLeft->update(); connect(m_instrumentParameterBox, SIGNAL(selectPlugin(QWidget *, InstrumentId, int)), this, SLOT(slotShowPluginDialog(QWidget *, InstrumentId, int))); connect(m_instrumentParameterBox, SIGNAL(showPluginGUI(InstrumentId, int)), this, SLOT(slotShowPluginGUI(InstrumentId, int))); // relay this through our own signal so that others can use it too connect(m_instrumentParameterBox, SIGNAL(instrumentParametersChanged(InstrumentId)), this, SIGNAL(instrumentParametersChanged(InstrumentId))); connect(this, SIGNAL(instrumentParametersChanged(InstrumentId)), m_instrumentParameterBox, SLOT(slotInstrumentParametersChanged(InstrumentId))); connect(this, SIGNAL(pluginSelected(InstrumentId, int, int)), m_instrumentParameterBox, SLOT(slotPluginSelected(InstrumentId, int, int))); connect(this, SIGNAL(pluginBypassed(InstrumentId, int, bool)), m_instrumentParameterBox, SLOT(slotPluginBypassed(InstrumentId, int, bool))); // Load the initial document (this includes doc's own autoload) // setDocument(doc); emit startupStatusMessage(i18n("Starting sequence manager...")); // transport is created by setupActions() m_seqManager = new SequenceManager(m_doc, getTransport()); if (m_useSequencer) { // Check the sound driver status and warn the user of any // problems. This warning has to happen early, in case it // affects the ability to load plugins etc from a file on the // command line. m_seqManager->checkSoundDriverStatus(true); } if (m_view) { connect(m_seqManager, SIGNAL(controllerDeviceEventReceived(MappedEvent *)), m_view, SLOT(slotControllerDeviceEventReceived(MappedEvent *))); } if (m_seqManager->getSoundDriverStatus() & AUDIO_OK) { slotStateChanged("got_audio", true); } else { slotStateChanged("got_audio", false); } // If we're restarting the gui then make sure any transient // studio objects are cleared away. emit startupStatusMessage(i18n("Clearing studio data...")); m_seqManager->reinitialiseSequencerStudio(); // Send the transport control statuses for MMC and JACK // m_seqManager->sendTransportControlStatuses(); // Now autoload // stateChanged("new_file"); stateChanged("have_segments", KXMLGUIClient::StateReverse); stateChanged("have_selection", KXMLGUIClient::StateReverse); slotTestClipboard(); // Check for lack of MIDI devices and disable Studio options accordingly // if (!m_doc->getStudio().haveMidiDevices()) stateChanged("got_midi_devices", KXMLGUIClient::StateReverse); emit startupStatusMessage(i18n("Starting...")); setupFileDialogSpeedbar(); readOptions(); // All toolbars should be created before this is called setAutoSaveSettings(MainWindowConfigGroup, true);#ifdef HAVE_LIRC try { m_lircClient = new LircClient(); } catch (Exception e) { RG_DEBUG << e.getMessage().c_str() << endl; // continue without m_lircClient = 0; } if (m_lircClient) { m_lircCommander = new LircCommander(m_lircClient, this); }#endif stateChanged("have_project_packager", KXMLGUIClient::StateReverse); stateChanged("have_lilypondview", KXMLGUIClient::StateReverse); QTimer::singleShot(1000, this, SLOT(slotTestStartupTester()));}RosegardenGUIApp::~RosegardenGUIApp(){ RG_DEBUG << "~RosegardenGUIApp()\n"; if (getView() && getView()->getTrackEditor() && getView()->getTrackEditor()->getSegmentCanvas()) { getView()->getTrackEditor()->getSegmentCanvas()->endAudioPreviewGeneration(); }#ifdef HAVE_LIBLO delete m_pluginGUIManager;#endif if (isSequencerRunning() && !isSequencerExternal()) { m_sequencerProcess->blockSignals(true); rgapp->sequencerSend("quit()"); usleep(300000); delete m_sequencerProcess; } delete m_transport; delete m_seqManager;#ifdef HAVE_LIRC delete m_lircCommander; delete m_lircClient;#endif delete m_doc; Profiles::getInstance()->dump();}void RosegardenGUIApp::setupActions(){ // setup File menu // New Window ? KStdAction::openNew (this, SLOT(slotFileNew()), actionCollection()); KStdAction::open (this, SLOT(slotFileOpen()), actionCollection()); m_fileRecent = KStdAction::openRecent(this, SLOT(slotFileOpenRecent(const KURL&)), actionCollection()); KStdAction::save (this, SLOT(slotFileSave()), actionCollection()); KStdAction::saveAs(this, SLOT(slotFileSaveAs()), actionCollection()); KStdAction::revert(this, SLOT(slotRevertToSaved()), actionCollection()); KStdAction::close (this, SLOT(slotFileClose()), actionCollection()); KStdAction::print (this, SLOT(slotFilePrint()), actionCollection()); KStdAction::printPreview (this, SLOT(slotFilePrintPreview()), actionCollection()); new KAction(i18n("Import Rosegarden &Project file..."), 0, 0, this, SLOT(slotImportProject()), actionCollection(), "file_import_project"); new KAction(i18n("Import &MIDI file..."), 0, 0, this, SLOT(slotImportMIDI()), actionCollection(), "file_import_midi"); new KAction(i18n("Import &Rosegarden 2.1 file..."), 0, 0, this, SLOT(slotImportRG21()), actionCollection(), "file_import_rg21"); new KAction(i18n("Import &Hydrogen file..."), 0, 0, this, SLOT(slotImportHydrogen()), actionCollection(), "file_import_hydrogen"); new KAction(i18n("Merge &File..."), 0, 0, this, SLOT(slotMerge()), actionCollection(), "file_merge"); new KAction(i18n("Merge &MIDI file..."), 0, 0, this, SLOT(slotMergeMIDI()), actionCollection(), "file_merge_midi"); new KAction(i18n("Merge &Rosegarden 2.1 file..."), 0, 0, this, SLOT(slotMergeRG21()), actionCollection(), "file_merge_rg21"); new KAction(i18n("Merge &Hydrogen file..."), 0, 0, this, SLOT(slotMergeHydrogen()), actionCollection(), "file_merge_hydrogen"); new KAction(i18n("Export Rosegarden &Project file..."), 0, 0, this, SLOT(slotExportProject()), actionCollection(), "file_export_project"); new KAction(i18n("Export &MIDI file..."), 0, 0, this, SLOT(slotExportMIDI()), actionCollection(), "file_export_midi"); new KAction(i18n("Export &Lilypond file..."), 0, 0, this, SLOT(slotExportLilypond()), actionCollection(), "file_export_lilypond"); new KAction(i18n("Export Music&XML file..."), 0, 0, this, SLOT(slotExportMusicXml()), actionCollection(), "file_export_musicxml"); new KAction(i18n("Export &Csound score file..."), 0, 0, this, SLOT(slotExportCsound()), actionCollection(), "file_export_csound"); new KAction(i18n("Export M&up file..."), 0, 0, this, SLOT(slotExportMup()), actionCollection(), "file_export_mup"); new KAction(i18n("Print &with LilyPond..."), 0, 0, this, SLOT(slotPrintLilypond()), actionCollection(), "file_print_lilypond"); new KAction(i18n("Preview with Lil&yPond..."), 0, 0, this, SLOT(slotPreviewLilypond()), actionCollection(), "file_preview_lilypond"); new KAction(i18n("Play&list"), 0, 0, this, SLOT(slotPlayList()), actionCollection(), "file_show_playlist"); KStdAction::quit (this, SLOT(slotQuit()), actionCollection()); // help menu new KAction(i18n("Rosegarden &Tutorial"), 0, 0, this, SLOT(slotTutorial()), actionCollection(), "tutorial"); new KAction(i18n("&Bug Reporting Guidelines"), 0, 0, this, SLOT(slotBugGuidelines()), actionCollection(), "guidelines"); // setup edit menu KStdAction::cut (this, SLOT(slotEditCut()), actionCollection()); KStdAction::copy (this, SLOT(slotEditCopy()), actionCollection()); KStdAction::paste (this, SLOT(slotEditPaste()), actionCollection()); // // undo/redo actions are special in that they are connected to // slots later on, when the current document is set up - see // MultiViewCommandHistory::attachView // new KToolBarPopupAction(i18n("Und&o"), "undo", KStdAccel::shortcut(KStdAccel::Undo), actionCollection(), KStdAction::stdName(KStdAction::Undo)); new KToolBarPopupAction(i18n("Re&do"), "redo", KStdAccel::shortcut(KStdAccel::Redo), actionCollection(), KStdAction::stdName(KStdAction::Redo)); ///// // setup Settings menu // m_viewToolBar = KStdAction::showToolbar (this, SLOT(slotToggleToolBar()), actionCollection(), "show_stock_toolbar"); m_viewToolsToolBar = new KToggleAction(i18n("Show T&ools Toolbar"), 0, this, SLOT(slotToggleToolsToolBar()), actionCollection(), "show_tools_toolbar"); m_viewTracksToolBar = new KToggleAction(i18n("Show Trac&ks Toolbar"), 0, this, SLOT(slotToggleTracksToolBar()), actionCollection(), "show_tracks_toolbar"); m_viewEditorsToolBar = new KToggleAction(i18n("Show &Editors Toolbar"), 0, this, SLOT(slotToggleEditorsToolBar()), actionCollection(), "show_editors_toolbar"); m_viewTransportToolBar = new KToggleAction(i18n("Show Trans&port Toolbar"), 0, this, SLOT(slotToggleTransportToolBar()), actionCollection(), "show_transport_toolbar"); m_viewZoomToolBar = new KToggleAction(i18n("Show &Zoom Toolbar"), 0, this, SLOT(slotToggleZoomToolBar()), actionCollection(), "show_zoom_toolbar"); m_viewStatusBar = KStdAction::showStatusbar(this, SLOT(slotToggleStatusBar()), actionCollection(), "show_status_bar"); m_viewTransport = new KToggleAction(i18n("Show Tra&nsport"), Key_T, this, SLOT(slotToggleTransport()), actionCollection(), "show_transport"); m_viewTrackLabels = new KToggleAction(i18n("Show Track &Labels"), 0, this, SLOT(slotToggleTrackLabels()), actionCollection(), "show_tracklabels"); m_viewRulers = new KToggleAction(i18n("Show Playback Position R&uler"), 0, this, SLOT(slotToggleRulers()), actionCollection(), "show_rulers"); m_viewTempoRuler = new KToggleAction(i18n("Show Te&mpo Ruler"), 0, this, SLOT(slotToggleTempoRuler()), actionCollection(), "show_tempo_ruler"); m_viewChordNameRuler = new KToggleAction(i18n("Show Cho&rd Name Ruler"), 0, this, SLOT(slotToggleChordNameRuler()), actionCollection(), "show_chord_name_ruler"); m_viewPreviews = new KToggleAction(i18n("Show Segment Pre&views"), 0, this, SLOT(slotTogglePreviews()), actionCollection(), "show_previews"); new KAction(i18n("Show Special &Parameters"), Key_P, this, SLOT(slotDockParametersBack()), actionCollection(), "show_inst_segment_parameters");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -