diff options
author | Tim E. Real <termtech@rogers.com> | 2012-08-04 06:58:54 +0000 |
---|---|---|
committer | Tim E. Real <termtech@rogers.com> | 2012-08-04 06:58:54 +0000 |
commit | 79d44ac604c41d431c36bf8a6422e4d5899e68dd (patch) | |
tree | 7f529a4cc596d97e83b9dc2e79a2c7be0b6f7c9d /muse2/muse/master | |
parent | 004af724045ae8b8a0be1152b4de755f34b1b053 (diff) |
Optimizations: Added Master::songChanged, ArrangerView::songChanged.
Please test it - may need more or less SC_* filters.
Diffstat (limited to 'muse2/muse/master')
-rw-r--r-- | muse2/muse/master/master.cpp | 17 | ||||
-rw-r--r-- | muse2/muse/master/master.h | 4 |
2 files changed, 19 insertions, 2 deletions
diff --git a/muse2/muse/master/master.cpp b/muse2/muse/master/master.cpp index 5d6e6e63..88dcc8a7 100644 --- a/muse2/muse/master/master.cpp +++ b/muse2/muse/master/master.cpp @@ -3,6 +3,7 @@ // Linux Music Editor // $Id: master.cpp,v 1.3 2004/04/11 13:03:32 wschweer Exp $ // (C) Copyright 2000 Werner Schweer (ws@seh.de) +// (C) Copyright 2012 Tim E. Real (terminator356 on users dot sourceforge dot net) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -56,13 +57,25 @@ Master::Master(MidiEditor* e, QWidget* parent, int xmag, int ymag) pos[2] = 0; drag = DRAG_OFF; tool = MusEGui::PointerTool; // should be overridden soon anyway, but to be sure... - setFocusPolicy(Qt::StrongFocus); // Tim. + setFocusPolicy(Qt::StrongFocus); setMouseTracking(true); connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), this, SLOT(setPos(int, unsigned, bool))); - connect(MusEGlobal::song, SIGNAL(songChanged(int)), this, SLOT(redraw())); + connect(MusEGlobal::song, SIGNAL(songChanged(int)), this, SLOT(songChanged(int))); } //--------------------------------------------------------- +// songChanged +//--------------------------------------------------------- + +void Master::songChanged(int type) +{ + //if(_isDeleting) return; // todo: If things get complicated don't forget some mechanism to ignore while while deleting to prevent possible crash. + + if (type & (SC_SIG | SC_TEMPO | SC_KEY )) // TEST: Reasonable to start with, may need more. + redraw(); +} + +//--------------------------------------------------------- // setPos //--------------------------------------------------------- diff --git a/muse2/muse/master/master.h b/muse2/muse/master/master.h index 098df9f0..70667f6a 100644 --- a/muse2/muse/master/master.h +++ b/muse2/muse/master/master.h @@ -3,6 +3,7 @@ // Linux Music Editor // $Id: master.h,v 1.3 2004/04/11 13:03:32 wschweer Exp $ // (C) Copyright 1999 Werner Schweer (ws@seh.de) +// (C) Copyright 2012 Tim E. Real (terminator356 on users dot sourceforge dot net) // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -67,6 +68,9 @@ class Master : public MusEGui::View { bool deleteVal1(unsigned int x1, unsigned int x2); void deleteVal(int x1, int x2); + private slots: + void songChanged(int); + signals: void followEvent(int); void xposChanged(int); |