summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2011-10-14 19:07:15 +0000
committerRobert Jonsson <spamatica@gmail.com>2011-10-14 19:07:15 +0000
commit7249c6fb8513867e13dd6a69ebb51648e734204e (patch)
treef8246988708b27394ce683bb01404ec80006e504 /muse2/muse
parent395eb053ed2cd2ba1a47bf3fe99fe65ace523cad (diff)
keyboard navigation for tracks
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/arranger/tlist.cpp13
-rw-r--r--muse2/muse/track.cpp28
-rw-r--r--muse2/muse/track.h1
3 files changed, 39 insertions, 3 deletions
diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp
index cca8a086..1e3ad419 100644
--- a/muse2/muse/arranger/tlist.cpp
+++ b/muse2/muse/arranger/tlist.cpp
@@ -579,7 +579,6 @@ void TList::mouseDoubleClickEvent(QMouseEvent* ev)
//---------------------------------------------------------
// portsPopupMenu
//---------------------------------------------------------
-
void TList::portsPopupMenu(MusECore::Track* t, int x, int y)
{
switch(t->type()) {
@@ -886,16 +885,24 @@ void TList::moveSelection(int n)
if (t == tracks->end()) {
--t;
break;
- }
}
- }
+ // skip over hidden tracks
+ if (!(*t)->isVisible()) {
+ n++;
+ }
+ }
+ }
else {
while (n++ != 0) {
if (t == tracks->begin())
break;
--t;
+ // skip over hidden tracks
+ if (!(*t)->isVisible()) {
+ n--;
}
}
+ }
(*s)->setSelected(false);
(*t)->setSelected(true);
diff --git a/muse2/muse/track.cpp b/muse2/muse/track.cpp
index 6fbe81c5..1ee1dfde 100644
--- a/muse2/muse/track.cpp
+++ b/muse2/muse/track.cpp
@@ -144,6 +144,34 @@ void removePortCtrlEvents(MidiTrack* t)
}
}
+//---------------------------------------------------------
+// isVisible
+//---------------------------------------------------------
+bool Track::isVisible()
+{
+ switch (type())
+ {
+ case Track::AUDIO_AUX:
+ return AudioAux::visible();
+ break;
+ case Track::AUDIO_GROUP:
+ return AudioGroup::visible();
+ case Track::AUDIO_INPUT:
+ return AudioInput::visible();
+ case Track::AUDIO_OUTPUT:
+ return AudioOutput::visible();
+ case Track::WAVE:
+ return WaveTrack::visible();
+ case Track::MIDI:
+ return MidiTrack::visible();
+ case Track::AUDIO_SOFTSYNTH:
+ return AudioAux::visible();
+ default:
+ break;
+ }
+
+ return false;
+}
//---------------------------------------------------------
diff --git a/muse2/muse/track.h b/muse2/muse/track.h
index 46dfc59f..25a846ac 100644
--- a/muse2/muse/track.h
+++ b/muse2/muse/track.h
@@ -205,6 +205,7 @@ class Track {
virtual AutomationType automationType() const = 0;
virtual void setAutomationType(AutomationType t) = 0;
static void setVisible(bool ) { }
+ bool isVisible();
};