summaryrefslogtreecommitdiff
path: root/muse2
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2012-08-04 06:58:54 +0000
committerTim E. Real <termtech@rogers.com>2012-08-04 06:58:54 +0000
commit79d44ac604c41d431c36bf8a6422e4d5899e68dd (patch)
tree7f529a4cc596d97e83b9dc2e79a2c7be0b6f7c9d /muse2
parent004af724045ae8b8a0be1152b4de755f34b1b053 (diff)
Optimizations: Added Master::songChanged, ArrangerView::songChanged.
Please test it - may need more or less SC_* filters.
Diffstat (limited to 'muse2')
-rw-r--r--muse2/ChangeLog2
-rw-r--r--muse2/muse/arranger/arrangerview.cpp21
-rw-r--r--muse2/muse/arranger/arrangerview.h14
-rw-r--r--muse2/muse/master/master.cpp17
-rw-r--r--muse2/muse/master/master.h4
-rw-r--r--muse2/muse/waveedit/waveview.cpp2
6 files changed, 50 insertions, 10 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index faa7b698..13ccfd37 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -1,3 +1,5 @@
+04.08.2012:
+ - Optimizations: Added Master::songChanged and ArrangerView::songChanged to filter some SCs. (Tim)
01.08.2012:
- Finished the Sysex Editor in the Instrument Editor. (Tim)
Create, delete, save named instrument sysexes. Does nothing more than that for now.
diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp
index 9641ab2e..6fe38b69 100644
--- a/muse2/muse/arranger/arrangerview.cpp
+++ b/muse2/muse/arranger/arrangerview.cpp
@@ -3,6 +3,7 @@
// Linux Music Editor
// arrangerview.cpp
// (C) Copyright 2011 Florian Jung (flo93@users.sourceforge.net)
+// (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
@@ -112,7 +113,7 @@ ArrangerView::ArrangerView(QWidget* parent)
connect(MusEGlobal::muse, SIGNAL(configChanged()), arranger, SLOT(configChanged()));
connect(arranger, SIGNAL(setUsedTool(int)), editTools, SLOT(set(int)));
connect(arranger, SIGNAL(selectionChanged()), SLOT(selectionChanged()));
- connect(MusEGlobal::song, SIGNAL(songChanged(int)), visTracks, SLOT(updateVisibleTracksButtons()));
+ connect(MusEGlobal::song, SIGNAL(songChanged(int)), this, SLOT(songChanged(int)));
@@ -374,6 +375,24 @@ void ArrangerView::closeEvent(QCloseEvent* e)
e->accept();
}
+//---------------------------------------------------------
+// songChanged
+//---------------------------------------------------------
+
+void ArrangerView::songChanged(int type)
+{
+ // TEST Try these, may need more/less. Esp more: Originally songChanged was directly connected to updateVisibleTracksButtons, so...
+ if(type & (SC_TRACK_INSERTED | SC_TRACK_REMOVED | SC_TRACK_MODIFIED |
+ SC_PART_INSERTED | SC_PART_REMOVED | SC_PART_MODIFIED |
+ //SC_EVENT_INSERTED | SC_EVENT_REMOVED | SC_EVENT_MODIFIED |
+ //SC_SIG | SC_TEMPO | SC_MASTER |
+ //SC_MIDI_TRACK_PROP |
+ SC_CONFIG |
+ SC_DRUMMAP|
+ SC_SONG_TYPE))
+ visTracks->updateVisibleTracksButtons();
+}
+
void ArrangerView::writeStatus(int level, MusECore::Xml& xml) const
diff --git a/muse2/muse/arranger/arrangerview.h b/muse2/muse/arranger/arrangerview.h
index 570dcd80..94e49e96 100644
--- a/muse2/muse/arranger/arrangerview.h
+++ b/muse2/muse/arranger/arrangerview.h
@@ -3,6 +3,7 @@
// Linux Music Editor
// arrangerview.h
// (C) Copyright 2011 Florian Jung (flo93@users.sourceforge.net)
+// (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
@@ -121,12 +122,13 @@ class ArrangerView : public TopWin
void globalCut();
void globalInsert();
void globalSplit();
- void globalCutSel();
- void globalInsertSel();
- void globalSplitSel();
- void cmd(int);
- void addNewTrack(QAction* action);
- void configCustomColumns();
+ void globalCutSel();
+ void globalInsertSel();
+ void globalSplitSel();
+ void cmd(int);
+ void addNewTrack(QAction* action);
+ void configCustomColumns();
+ void songChanged(int);
signals:
void isDeleting(MusEGui::TopWin*);
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);
diff --git a/muse2/muse/waveedit/waveview.cpp b/muse2/muse/waveedit/waveview.cpp
index c585ba4b..5b143e22 100644
--- a/muse2/muse/waveedit/waveview.cpp
+++ b/muse2/muse/waveedit/waveview.cpp
@@ -143,7 +143,7 @@ void WaveView::pdraw(QPainter& p, const QRect& rr)
int pos = (xpos + sx) * xScale + event.spos() - event.frame() - px;
- //printf("pos=%d xpos=%d sx=%d ex=%d xScale=%d event.spos=%d event.frame=%d px=%d\n",
+ //printf("pos=%d xpos=%d sx=%d ex=%d xScale=%d event.spos=%d event.frame=%d px=%d\n",
// pos, xpos, sx, ex, xScale, event.spos(), event.frame(), px);
h = hh / (channels * 2);