⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 notationview.cpp

📁 LINUX下的混音软件
💻 CPP
📖 第 1 页 / 共 5 页
字号:
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: *//*    Rosegarden    A MIDI and audio sequencer and musical notation editor.     This program is Copyright 2000-2007        Guillaume Laurent   <glaurent@telegraph-road.org>,        Chris Cannam        <cannam@all-day-breakfast.com>,        Richard Bown        <richard.bown@ferventsoftware.com>     The moral rights of Guillaume Laurent, Chris Cannam, and Richard    Bown to claim authorship of this work have been asserted.     Other copyrights also apply to some parts of this work.  Please    see the AUTHORS file and individual file headers for details.     This program is free software; you can redistribute it and/or    modify it under the terms of the GNU General Public License as    published by the Free Software Foundation; either version 2 of the    License, or (at your option) any later version.  See the file    COPYING included with this distribution for more information.*/#include "NotationView.h"#include <list>#include <qlayout.h>#include "misc/Debug.h"#include <kapplication.h>#include "gui/editors/segment/TrackEditor.h"#include "gui/editors/segment/TrackButtons.h"#include "base/BaseProperties.h"#include <klocale.h>#include <kstddirs.h>#include "misc/Strings.h"#include "base/AnalysisTypes.h"#include "base/Clipboard.h"#include "base/Composition.h"#include "base/CompositionTimeSliceAdapter.h"#include "base/Configuration.h"#include "base/Device.h"#include "base/Event.h"#include "base/Exception.h"#include "base/Instrument.h"#include "base/MidiDevice.h"#include "base/MidiTypes.h"#include "base/NotationTypes.h"#include "base/Profiler.h"#include "base/PropertyName.h"#include "base/NotationQuantizer.h"#include "base/RealTime.h"#include "base/RulerScale.h"#include "base/Segment.h"#include "base/Selection.h"#include "base/Staff.h"#include "base/Studio.h"#include "base/Track.h"#include "ClefInserter.h"#include "commands/edit/AddDotCommand.h"#include "commands/edit/ClearTriggersCommand.h"#include "commands/edit/CollapseNotesCommand.h"#include "commands/edit/CopyCommand.h"#include "commands/edit/CutAndCloseCommand.h"#include "commands/edit/CutCommand.h"#include "commands/edit/EraseCommand.h"#include "commands/edit/EventEditCommand.h"#include "commands/edit/EventQuantizeCommand.h"#include "commands/edit/InsertTriggerNoteCommand.h"#include "commands/edit/PasteEventsCommand.h"#include "commands/edit/SetLyricsCommand.h"#include "commands/edit/SetNoteTypeCommand.h"#include "commands/edit/SetTriggerCommand.h"#include "commands/edit/TransposeCommand.h"#include "commands/notation/AddFingeringMarkCommand.h"#include "commands/notation/AddIndicationCommand.h"#include "commands/notation/AddMarkCommand.h"#include "commands/notation/AddSlashesCommand.h"#include "commands/notation/AddTextMarkCommand.h"#include "commands/notation/AutoBeamCommand.h"#include "commands/notation/BeamCommand.h"#include "commands/notation/BreakCommand.h"#include "commands/notation/ChangeSlurPositionCommand.h"#include "commands/notation/ChangeStemsCommand.h"#include "commands/notation/ChangeStyleCommand.h"#include "commands/notation/ClefInsertionCommand.h"#include "commands/notation/CollapseRestsCommand.h"#include "commands/notation/DeCounterpointCommand.h"#include "commands/notation/EraseEventCommand.h"#include "commands/notation/FixNotationQuantizeCommand.h"#include "commands/notation/GraceCommand.h"#include "commands/notation/IncrementDisplacementsCommand.h"#include "commands/notation/InterpretCommand.h"#include "commands/notation/KeyInsertionCommand.h"#include "commands/notation/MakeAccidentalsCautionaryCommand.h"#include "commands/notation/MakeChordCommand.h"#include "commands/notation/MakeNotesViableCommand.h"#include "commands/notation/MultiKeyInsertionCommand.h"#include "commands/notation/NormalizeRestsCommand.h"#include "commands/notation/RemoveFingeringMarksCommand.h"#include "commands/notation/RemoveMarksCommand.h"#include "commands/notation/RemoveNotationQuantizeCommand.h"#include "commands/notation/ResetDisplacementsCommand.h"#include "commands/notation/RespellCommand.h"#include "commands/notation/RestoreSlursCommand.h"#include "commands/notation/RestoreStemsCommand.h"#include "commands/notation/SetVisibilityCommand.h"#include "commands/notation/SustainInsertionCommand.h"#include "commands/notation/TextInsertionCommand.h"#include "commands/notation/TieNotesCommand.h"#include "commands/notation/TupletCommand.h"#include "commands/notation/UnGraceCommand.h"#include "commands/notation/UntieNotesCommand.h"#include "commands/notation/UnTupletCommand.h"#include "commands/segment/PasteToTriggerSegmentCommand.h"#include "commands/segment/SegmentChangeTransposeCommand.h"#include "commands/segment/RenameTrackCommand.h"#include "document/RosegardenGUIDoc.h"#include "document/ConfigGroups.h"#include "document/io/LilypondExporter.h"#include "GuitarChordInserter.h"#include "gui/application/SetWaitCursor.h"#include "gui/application/RosegardenGUIView.h"#include "gui/dialogs/ClefDialog.h"#include "gui/dialogs/EventEditDialog.h"#include "gui/dialogs/InterpretDialog.h"#include "gui/dialogs/IntervalDialog.h"#include "gui/dialogs/KeySignatureDialog.h"#include "gui/dialogs/LilypondOptionsDialog.h"#include "gui/dialogs/LyricEditDialog.h"#include "gui/dialogs/MakeOrnamentDialog.h"#include "gui/dialogs/PasteNotationDialog.h"#include "gui/dialogs/QuantizeDialog.h"#include "gui/dialogs/SimpleEventEditDialog.h"#include "gui/dialogs/TextEventDialog.h"#include "gui/dialogs/TupletDialog.h"#include "gui/dialogs/UseOrnamentDialog.h"#include "gui/rulers/StandardRuler.h"#include "gui/general/ActiveItem.h"#include "gui/general/EditViewBase.h"#include "gui/general/EditView.h"#include "gui/general/GUIPalette.h"#include "gui/general/LinedStaff.h"#include "gui/general/LinedStaffManager.h"#include "gui/general/ProgressReporter.h"#include "gui/general/RosegardenCanvasView.h"#include "gui/kdeext/KTmpStatusMsg.h"#include "gui/kdeext/QCanvasSimpleSprite.h"#include "gui/rulers/ChordNameRuler.h"#include "gui/rulers/RawNoteRuler.h"#include "gui/rulers/TempoRuler.h"#include "gui/rulers/LoopRuler.h"#include "gui/studio/StudioControl.h"#include "gui/dialogs/EventFilterDialog.h"#include "gui/widgets/ProgressBar.h"#include "gui/widgets/ProgressDialog.h"#include "gui/widgets/ScrollBoxDialog.h"#include "gui/widgets/ScrollBox.h"#include "NotationCanvasView.h"#include "NotationElement.h"#include "NotationEraser.h"#include "NotationHLayout.h"#include "NotationProperties.h"#include "NotationSelector.h"#include "NotationStaff.h"#include "NotationStrings.h"#include "NotationToolBox.h"#include "NotationVLayout.h"#include "NoteFontFactory.h"#include "NoteInserter.h"#include "NotePixmapFactory.h"#include "NoteStyleFactory.h"#include "NoteStyle.h"#include "RestInserter.h"#include "sound/MappedEvent.h"#include "TextInserter.h"#include <kaction.h>#include <kcombobox.h>#include <kconfig.h>#include <kglobal.h>#include <klineeditdlg.h>#include <kmessagebox.h>#include <kprinter.h>#include <kprocess.h>#include <kprogress.h>#include <kstatusbar.h>#include <kstdaction.h>#include <ktempfile.h>#include <ktoolbar.h>#include <kxmlguiclient.h>#include <qbrush.h>#include <qcanvas.h>#include <qcursor.h>#include <qdialog.h>#include <qevent.h>#include <qfont.h>#include <qfontmetrics.h>#include <qhbox.h>#include <qiconset.h>#include <qlabel.h>#include <qobject.h>#include <qpaintdevicemetrics.h>#include <qpainter.h>#include <qpixmap.h>#include <qpoint.h>#include <qprinter.h>#include <qrect.h>#include <qregexp.h>#include <qsize.h>#include <qstring.h>#include <qtimer.h>#include <qwidget.h>#include <qvalidator.h>#include <algorithm>namespace Rosegarden{class NoteActionData{public:    NoteActionData();    NoteActionData(const QString& _title,		   QString _actionName,		   QString _pixmapName,		   int _keycode,		   bool _rest,		   Note::Type _noteType,		   int _dots);        QString title;    QString actionName;    QString pixmapName;    int keycode;    bool rest;    Note::Type noteType;    int dots;};NoteActionData::NoteActionData()    : title(0),      actionName(0),      pixmapName(0),      keycode(0),      rest(false),      noteType(0),      dots(0){}NoteActionData::NoteActionData(const QString& _title,			       QString _actionName,			       QString _pixmapName,			       int _keycode,			       bool _rest,			       Note::Type _noteType,			       int _dots)    : title(_title),      actionName(_actionName),      pixmapName(_pixmapName),      keycode(_keycode),      rest(_rest),      noteType(_noteType),      dots(_dots){}class NoteChangeActionData{public:    NoteChangeActionData();    NoteChangeActionData(const QString &_title,			 QString _actionName,			 QString _pixmapName,			 int _keycode,			 bool _notationOnly,			 Note::Type _noteType);    QString title;    QString actionName;    QString pixmapName;    int keycode;    bool notationOnly;    Note::Type noteType;};NoteChangeActionData::NoteChangeActionData()    : title(0),      actionName(0),      pixmapName(0),      keycode(0),      notationOnly(false),      noteType(0){}NoteChangeActionData::NoteChangeActionData(const QString& _title,					   QString _actionName,					   QString _pixmapName,					   int _keycode,					   bool _notationOnly,					   Note::Type _noteType)    : title(_title),      actionName(_actionName),      pixmapName(_pixmapName),      keycode(_keycode),      notationOnly(_notationOnly),      noteType(_noteType){}class MarkActionData{public:    MarkActionData() :	title(0),	actionName(0),	keycode(0) { }    MarkActionData(const QString &_title,		   QString _actionName,		   int _keycode,		   Mark _mark) :	title(_title),	actionName(_actionName),	keycode(_keycode),	mark(_mark) { }    QString title;    QString actionName;    int keycode;    Mark mark;};NotationView::NotationView(RosegardenGUIDoc *doc,                           std::vector<Segment *> segments,                           QWidget *parent,                           bool showProgressive) :        EditView(doc, segments, 1, parent, "notationview"),        m_properties(getViewLocalPropertyPrefix()),        m_selectionCounter(0),        m_insertModeLabel(0),        m_annotationsLabel(0),        m_lilypondDirectivesLabel(0),        m_progressBar(0),        m_currentNotePixmap(0),        m_hoveredOverNoteName(0),        m_hoveredOverAbsoluteTime(0),        m_currentStaff( -1),        m_lastFinishingStaff( -1),        m_title(0),        m_subtitle(0),        m_composer(0),        m_copyright(0),        m_insertionTime(0),        m_deferredCursorMove(NoCursorMoveNeeded),        m_lastNoteAction("crotchet"),        m_fontName(NoteFontFactory::getDefaultFontName()),        m_fontSize(NoteFontFactory::getDefaultSize(m_fontName)),        m_pageMode(LinedStaff::LinearMode),        m_leftGutter(20),        m_notePixmapFactory(new NotePixmapFactory(m_fontName, m_fontSize)),        m_hlayout(new NotationHLayout(&doc->getComposition(), m_notePixmapFactory,                                      m_properties, this)),        m_vlayout(new NotationVLayout(&doc->getComposition(), m_notePixmapFactory,                                      m_properties, this)),        m_chordNameRuler(0),        m_tempoRuler(0),

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -