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

📄 matrixview.h

📁 LINUX下的混音软件
💻 H
📖 第 1 页 / 共 2 页
字号:
/* -*- 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.*/#ifndef _RG_MATRIXVIEW_H_#define _RG_MATRIXVIEW_H_#include "base/MidiProgram.h"#include "base/PropertyName.h"#include "base/SnapGrid.h"#include "gui/general/EditView.h"#include "gui/widgets/ZoomSlider.h"#include "MatrixHLayout.h"#include "MatrixVLayout.h"#include "MatrixCanvasView.h"#include <kdockwidget.h>#include <qpoint.h>#include <qsize.h>#include <vector>#include "base/Event.h"#include "document/ConfigGroups.h"class QWidget;class QPaintEvent;class QObject;class QMouseEvent;class QLabel;class QCursor;class QCanvas;class KComboBox;namespace Rosegarden{class Staff;class Segment;class RulerScale;class RosegardenGUIDoc;class QDeferScrollView;class PropertyViewRuler;class PropertyBox;class PitchRuler;class MidiKeyMapping;class MatrixStaff;class MatrixElement;class InstrumentParameterBox;class Instrument;class EventSelection;class Event;class ChordNameRuler;class LevelInfo;/** * Matrix ("Piano Roll") View * * Note: we currently display only one staff */class MatrixView : public EditView{    Q_OBJECT    friend class MatrixSelector;public:    MatrixView(RosegardenGUIDoc *doc,               std::vector<Segment *> segments,               QWidget *parent, bool drumMode);    virtual ~MatrixView();    virtual bool applyLayout(int staffNo = -1,                             timeT startTime = 0,                             timeT endTime = 0);    virtual void refreshSegment(Segment *segment,                                timeT startTime = 0,                                timeT endTime = 0);    QCanvas* canvas() { return getCanvasView()->canvas(); }    void setCanvasCursor(const QCursor &cursor) {        getCanvasView()->viewport()->setCursor(cursor);    }    MatrixStaff* getStaff(int i)    {        if (i >= 0 && unsigned(i) < m_staffs.size()) return m_staffs[i];        else return 0;    }    MatrixStaff *getStaff(const Segment &segment);    virtual void updateView();    bool isDrumMode() { return m_drumMode; }    /**     * Discover whether chord-mode insertions are enabled (as opposed     * to the default melody-mode)     */    bool isInChordMode();    /**     * Set the current event selection.     *     * If preview is true, sound the selection as well.     *     * If redrawNow is true, recolour the elements on the canvas;     * otherwise just line up a refresh for the next paint event.     *     * (If the selection has changed as part of a modification to a     * segment, redrawNow should be unnecessary and undesirable, as a     * paint event will occur in the next event loop following the     * command invocation anyway.)     */    virtual void setCurrentSelection(EventSelection* s,                                     bool preview = false,                                     bool redrawNow = false);    /**     * Set the current event selection to a single event     */    void setSingleSelectedEvent(int staffNo,                                Event *event,                                bool preview = false,                                bool redrawNow = false);    /**     * Set the current event selection to a single event     */    void setSingleSelectedEvent(Segment &segment,                                Event *event,                                bool preview = false,                                bool redrawNow = false);    /**     * Play a Note Event using the keyPressed() signal     */    void playNote(Event *event);    /**     * Play a preview (same as above but a simpler interface)     */    void playNote(const Segment &segment, int pitch, int velocity = -1);    /**     * Get the SnapGrid     */    const SnapGrid &getSnapGrid() const { return *m_snapGrid; }    /**     * Add a ruler that allows control of a single property -     * return the number of the added ruler     *      */    unsigned int addPropertyViewRuler(const PropertyName &property);    /**     * Remove a control ruler - return true if it's a valid ruler number     */    bool removePropertyViewRuler(unsigned int number);    /**     * Adjust an X coord by world matrix     */    double getXbyWorldMatrix(double value)    { return m_canvasView->worldMatrix().m11() * value; }            double getXbyInverseWorldMatrix(double value)    { return m_canvasView->inverseWorldMatrix().m11() * value; }    QPoint inverseMapPoint(const QPoint& p) { return m_canvasView->inverseMapPoint(p); }    /*     * Repaint the control rulers     *     */    void repaintRulers();    /*     * Readjust the canvas size     *     */    void readjustCanvasSize();    /*     * Scrolls the view such that the given time is centered     */    void scrollToTime(timeT t);    /**     * Get the local keyMapping (when in drum mode)     */    MidiKeyMapping *getKeyMapping() { return m_localMapping; }    /**     * Get the velocity currently set in the velocity menu.     */    int getCurrentVelocity() const;signals:    /**     * Emitted when the selection has been cut or copied     *     * @see MatrixSelector#hideSelection     */    void usedSelection();    void play();    void stop();    void fastForwardPlayback();    void rewindPlayback();    void fastForwardPlaybackToEnd();    void rewindPlaybackToBeginning();    void jumpPlaybackTo(timeT);    void panic();    void stepByStepTargetRequested(QObject *);    void editTriggerSegment(int);        void editTimeSignature(timeT);public slots:    /**     * put the indicationed text/object into the clipboard and remove * it     * from the document     */    virtual void slotEditCut();    /**     * put the indicationed text/object into the clipboard     */    virtual void slotEditCopy();    /**     * paste the clipboard into the document     */    virtual void slotEditPaste();    /**     * Delete the current selection     */    void slotEditDelete();    virtual void slotStepBackward(); // override from EditView    virtual void slotStepForward(); // override from EditView    void slotPreviewSelection();    void slotClearLoop();    void slotClearSelection();    /**     * Filter selection by event type     */    void slotFilterSelection(); // dummy - not actually functional yet    /// edition tools    void slotPaintSelected();    void slotEraseSelected();    void slotSelectSelected();    void slotMoveSelected();    void slotResizeSelected();    void slotToggleStepByStep();    /// status stuff    void slotUpdateInsertModeStatus();    /// transforms    void slotTransformsQuantize();    void slotTransformsRepeatQuantize();    void slotTransformsLegato();    void slotVelocityUp();    void slotVelocityDown();    /// settings    void slotToggleChordsRuler();    void slotToggleTempoRuler();    /// cursor moves    void slotJumpCursorToPlayback();    void slotJumpPlaybackToCursor();    void slotToggleTracking();    /// Canvas actions slots    /**     * Called when a mouse press occurred on a matrix element     * or somewhere on the staff     */    void slotMousePressed(timeT time, int pitch,                          QMouseEvent*, MatrixElement*);    void slotMouseMoved(timeT time, int pitch, QMouseEvent*);    void slotMouseReleased(timeT time, int pitch, QMouseEvent*);    /**     * Called when the mouse cursor moves over a different height on     * the staff     *     * @see MatrixCanvasView#hoveredOverNoteChanged()     */    void slotHoveredOverNoteChanged(int evPitch, bool haveEvent,                                    timeT evTime);    /**     * Called when the mouse cursor moves over a different key on     * the piano keyboard     *     * @see PianoKeyboard#hoveredOverKeyChanged()     */    void slotHoveredOverKeyChanged(unsigned int);    /**     * Called when the mouse cursor moves over a note which is at a     * different time on the staff     *     * @see MatrixCanvasView#hoveredOverNoteChange()     */    void slotHoveredOverAbsoluteTimeChanged(unsigned int);

⌨️ 快捷键说明

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