summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2010-04-04 22:35:51 +0000
committerRobert Jonsson <spamatica@gmail.com>2010-04-04 22:35:51 +0000
commit1151c236e1710d6b99225a7a1e5914b0d793be88 (patch)
tree20017d78b6bfecc9f2a26235fc642971e4d28c39
parent877df47f6c8021a4377e76720e7f13943404f20b (diff)
move rec enabled track with selection
-rw-r--r--muse/ChangeLog3
-rw-r--r--muse/muse/arranger/tlist.cpp45
-rw-r--r--muse/muse/arranger/tlist.h3
-rw-r--r--muse/muse/gconfig.cpp2
4 files changed, 52 insertions, 1 deletions
diff --git a/muse/ChangeLog b/muse/ChangeLog
index cdf4928f..7ab4d115 100644
--- a/muse/ChangeLog
+++ b/muse/ChangeLog
@@ -1,3 +1,6 @@
+05.04.2010
+ * Added: Rec enabled track moved with selection when only one track is rec enabled (rj)
+ * Changed: Made canvas show grid the default (rj)
30.03.2010
* Major reworks: Jack midi, routing system, multichannel synth ins/outs, midi strips and trackinfo pane. (T356)
- WORK IN PROGRESS. Should be usable for current projects.
diff --git a/muse/muse/arranger/tlist.cpp b/muse/muse/arranger/tlist.cpp
index 2bd4c685..5b212eb6 100644
--- a/muse/muse/arranger/tlist.cpp
+++ b/muse/muse/arranger/tlist.cpp
@@ -66,6 +66,7 @@ void THeaderTip::maybeTip(const QPoint &pos)
//case COL_OPORT: p = QHeader::tr("Output Port"); break;
case COL_OPORT: p = QHeader::tr("Midi output port or synth midi port"); break;
case COL_TIMELOCK: p = QHeader::tr("Time Lock"); break;
+ case COL_AUTOMATION: p = QHeader::tr("Automation parameter selection"); break;
default: return;
}
tip(r, p);
@@ -343,6 +344,19 @@ void TList::paint(const QRect& r)
p.drawText(r, Qt::AlignVCenter|Qt::AlignLeft, s);
}
break;
+ case COL_AUTOMATION:
+ {
+ QString s="-";
+
+ if (!track->isMidiTrack()) {
+ int count = ((AudioTrack*)track)->controller()->size();
+ s.sprintf("%d", count);
+ }
+
+
+ p.drawText(r, Qt::AlignVCenter|Qt::AlignLeft, s);
+ }
+ break;
default:
break;
}
@@ -696,6 +710,14 @@ void TList::moveSelection(int n)
}
(*s)->setSelected(false);
(*t)->setSelected(true);
+
+ // rec enable track if expected
+ TrackList recd = getRecEnabledTracks();
+ if (recd.size() == 1) { // one rec enabled track, move rec enabled with selection
+ song->setRecordFlag((Track*)recd.front(),false);
+ song->setRecordFlag((*t),true);
+ }
+
if (editTrack && editTrack != *t)
returnPressed();
redraw();
@@ -705,6 +727,20 @@ void TList::moveSelection(int n)
emit selectionChanged();
}
+TrackList TList::getRecEnabledTracks()
+{
+ //printf("getRecEnabledTracks\n");
+ TrackList recEnabled;
+ TrackList* tracks = song->tracks();
+ for (iTrack t = tracks->begin(); t != tracks->end(); ++t) {
+ if ((*t)->recordFlag()) {
+ //printf("rec enabled track\n");
+ recEnabled.push_back(*t);
+ }
+ }
+ return recEnabled;
+}
+
//---------------------------------------------------------
// mousePressEvent
//---------------------------------------------------------
@@ -788,6 +824,7 @@ void TList::mousePressEvent(QMouseEvent* ev)
{
song->deselectTracks();
t->setSelected(true);
+
emit selectionChanged();
adjustScrollbar();
}
@@ -900,6 +937,13 @@ void TList::mousePressEvent(QMouseEvent* ev)
if (!shift) {
song->deselectTracks();
t->setSelected(true);
+
+ // rec enable track if expected
+ TrackList recd = getRecEnabledTracks();
+ if (recd.size() == 1) { // one rec enabled track, move rec enabled with selection
+ song->setRecordFlag((Track*)recd.front(),false);
+ song->setRecordFlag(t,true);
+ }
}
else
t->setSelected(!t->selected());
@@ -1149,6 +1193,7 @@ void TList::wheelEvent(QWheelEvent* ev)
case COL_NONE:
case COL_CLASS:
case COL_NAME:
+ case COL_AUTOMATION:
break;
case COL_MUTE:
// p3.3.29
diff --git a/muse/muse/arranger/tlist.h b/muse/muse/arranger/tlist.h
index 998f4bf7..1cf86490 100644
--- a/muse/muse/arranger/tlist.h
+++ b/muse/muse/arranger/tlist.h
@@ -11,6 +11,7 @@
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qheader.h>
+#include "track.h"
class QPainter;
class ScrollScale;
@@ -29,6 +30,7 @@ enum TrackColumn {
COL_OPORT,
COL_OCHANNEL,
COL_TIMELOCK,
+ COL_AUTOMATION,
COL_NONE = -1
};
@@ -91,6 +93,7 @@ class TList : public QWidget {
void redraw(const QRect& r);
Track* y2Track(int) const;
void classesPopupMenu(Track*, int x, int y);
+ TrackList getRecEnabledTracks();
private slots:
void returnPressed();
diff --git a/muse/muse/gconfig.cpp b/muse/muse/gconfig.cpp
index 5d46a175..f7687cc7 100644
--- a/muse/muse/gconfig.cpp
+++ b/muse/muse/gconfig.cpp
@@ -119,7 +119,7 @@ GlobalConfigValues config = {
true, // showSplashScreen
1, // canvasShowPartType 1 - names, 2 events
5, // canvasShowPartEvent
- false, // canvasShowGrid;
+ true, // canvasShowGrid;
QString(""), // canvasBgPixmap;
QString(""), // style
QString("sweep"), // externalWavEditor