Slotwork matrix

View: New views
7 Messages — Rating Filter:   Alert me  

Slotwork matrix

by Jani Frilander :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all.

There is few unassigned slots left in matrix. What to do with them?

1. Selection extension mechanism
slotExtendSelectionBackward()
slotExtendSelectionForward()
slotExtendSelectionBackwardBar()
slotExtendSelectionForwardBar()

Are they worth porting? Does anybody use them?

2.slotDockParametersBack()

Commented out in OldMatrixView.

3.slotAddControlRuler()

Should this link to slotAddControlRuler(QAction*) (Chris F?)

4.slotInstrumentLevelsChanged(InstrumentId, const LevelInfo &)

Depends on InstrumentParameterBox which is no longer in use at matrix.

What do you think? I think they should be removed except for number 3.

-Jani




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@... - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Re: Slotwork matrix

by cannam :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Nov 11, 2009 at 7:37 PM, Jani Frilander <j.frilander@...> wrote:

>
> There is few unassigned slots left in matrix. What to do with them?
>
> 1. Selection extension mechanism
> slotExtendSelectionBackward()
> slotExtendSelectionForward()
> slotExtendSelectionBackwardBar()
> slotExtendSelectionForwardBar()
>
> Are they worth porting? Does anybody use them?

These are very useful functions, but actually they never worked very
well in the old matrix.  They were just about good enough to be
useful, but they selected something different from what you expected a
fair amount of the time.


Chris

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@... - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Re: Slotwork matrix

by Chris Fryer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2009-11-11 at 21:37 +0200, Jani Frilander wrote:
> 3.slotAddControlRuler()
>
> Should this link to slotAddControlRuler(QAction*) (Chris F?)

Sorry, I don't know. It depends what fires that slot and whether we want
that functionality. Michael hooked the rulers up to the current buttons
so he'll be able to answer better than I can.

Chris


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@... - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Re: Slotwork matrix

by D. Michael McIntyre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 11 November 2009, Jani Frilander wrote:

> 1. Selection extension mechanism
> slotExtendSelectionBackward()
> slotExtendSelectionForward()
> slotExtendSelectionBackwardBar()
> slotExtendSelectionForwardBar()

One editor or the other has these working.  Notation, I guess?  I'd imagine
they port over from NotationView pretty easily, but I haven't looked at all.

I never use these, and don't care much one way or the other, but in principle
if it's not a major undertaking to resurrect these dead functions, we should
try.

> 2.slotDockParametersBack()

This no longer serves any purpose.

> 3.slotAddControlRuler()
>
> Should this link to slotAddControlRuler(QAction*) (Chris F?)

I have the ruler controls working, so anything left over is useless, and can
be removed.
 
> 4.slotInstrumentLevelsChanged(InstrumentId, const LevelInfo &)

Useless.
--
D. Michael McIntyre

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@... - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Re: Slotwork matrix

by Jani Frilander :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/11/11 D. Michael McIntyre <michael.mcintyre@...>
On Wednesday 11 November 2009, Jani Frilander wrote:

> 3.slotAddControlRuler()
>
> Should this link to slotAddControlRuler(QAction*) (Chris F?)

I have the ruler controls working, so anything left over is useless, and can
be removed.

If I comment it out, it segfaults:

WARNING: ActionFileClient("")::findAction: No such action as "add_control_ruler"
WARNING: Using decoy action
Segmentation fault

So it can't just be removed.

-Jani


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@... - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Re: Slotwork matrix

by D. Michael McIntyre :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thursday 12 November 2009, Jani Frilander wrote:

> > I have the ruler controls working, so anything left over is useless, and
> > can
> > be removed.
>
> If I comment it out, it segfaults:

I thought you were talking about something that had yet to be moved from one
of the Old[Notation|Matrix]View classes.  No, you're right.  I was under the
impression that we didn't have to specify the slot parameters in a call to
createAction() but there is a QObject::connect error on that, even though the
slot seems to work.  I added the (QAction *) and everything still works, but
without the error.

I also removed a number of createAction() calls to obsolete actions that have
long since been removed from the .rc file.  I wonder why that didn't fail?  Oh
well.
--
D. Michael McIntyre

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@... - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Re: Slotwork matrix

by Jani Frilander :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi.

I ported slotMoveEventsUpStaff and slotMoveEventsDownStaff to new notation.
They work ok for a while but after some moves and undosa crash occurs.
Here is gdb trace (this is not a debug build):

NotationScene::layout: from 0 to 0
NotationScene::layout: from 960 to 15360

Program received signal SIGSEGV, Segmentation fault.
0x00000000008a9844 in Rosegarden::NotationHLayout::layout(std::_Rb_tree_iterator<std::pair<Rosegarden::ViewSegment* const, std::map<int, Rosegarden::NotationHLayout::BarData, std::less<int>, std::allocator<std::pair<int const, Rosegarden::NotationHLayout::BarData> > > > >, long, long) ()


diff:

Index: src/gui/editors/notation/NotationView.cpp
===================================================================
--- src/gui/editors/notation/NotationView.cpp    (revision 11242)
+++ src/gui/editors/notation/NotationView.cpp    (working copy)
@@ -3751,7 +3751,77 @@
     action->setChecked(obj == this);
 }
 
+void
+NotationView::slotMoveEventsUpStaff()
+{
+    EventSelection *selection = getSelection();
+    if (!selection) return;
 
+    NotationScene *scene = m_notationWidget->getScene();
+    if (!scene) return;
+//    NotationStaff *current_staff = scene->getCurrentStaff();
+//    if (!current_staff) return;
+    NotationStaff *target_staff = scene->getStaffAbove();
+    if (!target_staff) return;
+
+    MacroCommand *command = new MacroCommand(tr("Move Events to Staff Above"));
+
+    timeT insertionTime = selection->getStartTime();
+
+    Clipboard *c = new Clipboard;
+    CopyCommand *cc = new CopyCommand(*selection, c);
+    cc->execute();
+
+    command->addCommand(new EraseCommand(*selection));
+
+    scene->setCurrentStaff(target_staff);
+
+    command->addCommand(new PasteEventsCommand
+                        (*getCurrentSegment(), c, insertionTime,
+                         PasteEventsCommand::NoteOverlay));
+   
+    CommandHistory::getInstance()->addCommand(command);
+
+    delete c;
+
+}
+
+void
+NotationView::slotMoveEventsDownStaff()
+{
+    EventSelection *selection = getSelection();
+    if (!selection) return;
+
+    NotationScene *scene = m_notationWidget->getScene();
+    if (!scene) return;
+//    NotationStaff *current_staff = scene->getCurrentStaff();
+//    if (!current_staff) return;
+    NotationStaff *target_staff = scene->getStaffBelow();
+    if (!target_staff) return;
+
+    MacroCommand *command = new MacroCommand(tr("Move Events to Staff Above"));
+
+    timeT insertionTime = selection->getStartTime();
+
+    Clipboard *c = new Clipboard;
+    CopyCommand *cc = new CopyCommand(*selection, c);
+    cc->execute();
+
+    command->addCommand(new EraseCommand(*selection));
+
+    scene->setCurrentStaff(target_staff);
+
+    command->addCommand(new PasteEventsCommand
+                        (*getCurrentSegment(), c, insertionTime,
+                         PasteEventsCommand::NoteOverlay));
+   
+    CommandHistory::getInstance()->addCommand(command);
+
+    delete c;
+
+}
+
+
 } // end namespace Rosegarden
 
 #include "NotationView.moc"
Index: src/gui/editors/notation/NotationView.h
===================================================================
--- src/gui/editors/notation/NotationView.h    (revision 11242)
+++ src/gui/editors/notation/NotationView.h    (working copy)
@@ -102,6 +102,8 @@
     void slotEditTranspose();
     void slotEditSwitchPreset();
 
+    void slotMoveEventsUpStaff();
+    void slotMoveEventsDownStaff();
 
     void slotPreviewSelection();
     void slotClearLoop();


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Rosegarden-devel mailing list
Rosegarden-devel@... - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel