On Fri, 2003-10-31 at 12:24, Chris Cannam wrote:
> On Friday 31 Oct 2003 10:05 am, John Anderson wrote:
> > How hard would it be to allow for dividing the grid in fractions of
> > 3, similar to the way one can do triplets in the notation editor?
>
> Shouldn't be too hard. Might take a bit of tweaking, but at least
> it's the sort of feature that's easy to test.
That wasn't programming, that was cut-n-pasting ;-) I've attached a
patch, for 1/6, 1/12, 1/24, 1/48. I've tried it out and it seems to work
fine.
bye
John
Index: gui/matrix.rc
===================================================================
RCS file: /cvsroot/rosegarden/gui/matrix.rc,v
retrieving revision 1.38
diff -u -r1.38 matrix.rc
--- gui/matrix.rc 21 Oct 2003 14:02:14 -0000 1.38
+++ gui/matrix.rc 31 Oct 2003 15:59:07 -0000
@@ -20,9 +20,13 @@
<Action name="snap_none"/>
<Action name="snap_unit"/>
<Action name="snap_64"/>
+ <Action name="snap_48"/>
<Action name="snap_32"/>
+ <Action name="snap_24"/>
<Action name="snap_16"/>
+ <Action name="snap_12"/>
<Action name="snap_8"/>
+ <Action name="snap_6"/>
<Action name="snap_4"/>
<Action name="snap_2"/>
<Action name="snap_beat"/>
Index: gui/matrixview.cpp
===================================================================
RCS file: /cvsroot/rosegarden/gui/matrixview.cpp,v
retrieving revision 1.277
diff -u -r1.277 matrixview.cpp
--- gui/matrixview.cpp 21 Oct 2003 18:23:46 -0000 1.277
+++ gui/matrixview.cpp 31 Oct 2003 15:59:09 -0000
@@ -585,12 +585,20 @@
//!!! should be using NotationStrings::makeNoteMenuLabel for these
new KAction(i18n("Snap to 1/64"), Key_0, this,
SLOT(slotSetSnapFromAction()), actionCollection(), "snap_64");
+ new KAction(i18n("Snap to 1/48"), 0, this,
+ SLOT(slotSetSnapFromAction()), actionCollection(), "snap_48");
new KAction(i18n("Snap to 1/32"), Key_3, this,
SLOT(slotSetSnapFromAction()), actionCollection(), "snap_32");
+ new KAction(i18n("Snap to 1/24"), 0, this,
+ SLOT(slotSetSnapFromAction()), actionCollection(), "snap_24");
new KAction(i18n("Snap to 1/16"), Key_6, this,
SLOT(slotSetSnapFromAction()), actionCollection(), "snap_16");
+ new KAction(i18n("Snap to 1/12"), 0, this,
+ SLOT(slotSetSnapFromAction()), actionCollection(), "snap_12");
new KAction(i18n("Snap to 1/8"), Key_8, this,
SLOT(slotSetSnapFromAction()), actionCollection(), "snap_8");
+ new KAction(i18n("Snap to 1/6"), 0, this,
+ SLOT(slotSetSnapFromAction()), actionCollection(), "snap_6");
new KAction(i18n("Snap to 1/4"), Key_4, this,
SLOT(slotSetSnapFromAction()), actionCollection(), "snap_4");
new KAction(i18n("Snap to 1/2"), Key_2, this,
@@ -1641,9 +1649,13 @@
m_snapValues.push_back(Rosegarden::SnapGrid::NoSnap);
m_snapValues.push_back(Rosegarden::SnapGrid::SnapToUnit);
m_snapValues.push_back(crotchetDuration / 16);
+ m_snapValues.push_back(crotchetDuration / 12);
m_snapValues.push_back(crotchetDuration / 8);
+ m_snapValues.push_back(crotchetDuration / 6);
m_snapValues.push_back(crotchetDuration / 4);
+ m_snapValues.push_back(crotchetDuration / 3);
m_snapValues.push_back(crotchetDuration / 2);
+ m_snapValues.push_back(crotchetDuration / 1.5);
m_snapValues.push_back(crotchetDuration);
m_snapValues.push_back(crotchetDuration * 2);
m_snapValues.push_back(Rosegarden::SnapGrid::SnapToBeat);