[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso resources/keymap.xml src/commands/Move...
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso resources/keymap.xml src/commands/Move... |
Date: |
Thu, 07 Feb 2008 15:35:07 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 08/02/07 15:35:07
Modified files:
resources : keymap.xml
src/commands : MoveClip.cpp MoveClip.h
Log message:
* added Jog Zoom to MoveClip, as [ D ] + < Z >
It doesn't work as expected yet, but well, thought you might like to
see how easy it is to start hacking on a feature like this :)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/resources/keymap.xml?cvsroot=traverso&r1=1.98&r2=1.99
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/MoveClip.cpp?cvsroot=traverso&r1=1.55&r2=1.56
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/MoveClip.h?cvsroot=traverso&r1=1.22&r2=1.23
Patches:
Index: resources/keymap.xml
===================================================================
RCS file: /sources/traverso/traverso/resources/keymap.xml,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -b -r1.98 -r1.99
--- resources/keymap.xml 29 Jan 2008 13:05:25 -0000 1.98
+++ resources/keymap.xml 7 Feb 2008 15:35:06 -0000 1.99
@@ -101,6 +101,7 @@
<keyfact type="FKEY" key1="Z" >
<Objects>
<Object objectname="SheetView" modes="All"
sortorder="3" submenu="Zoom" pluginname="TraversoCommands"
commandname="HZoomIn" arguments="HZoom;0.8" />
+ <Object objectname="MoveClip"
slotsignature="start_zoom" modes="All" />
</Objects>
</keyfact>
<keyfact type="FKEY" key1="S" >
Index: src/commands/MoveClip.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/commands/MoveClip.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- src/commands/MoveClip.cpp 21 Jan 2008 16:22:11 -0000 1.55
+++ src/commands/MoveClip.cpp 7 Feb 2008 15:35:07 -0000 1.56
@@ -29,6 +29,7 @@
#include <ViewPort.h>
#include <ClipsViewPort.h>
#include <QScrollBar>
+#include "Zoom.h"
// Always put me below _all_ includes, this is needed
@@ -84,6 +85,7 @@
d->view = cv;
d->sv = d->view->get_sheetview();
+ d->zoom = 0;
m_sheet = d->sv->get_sheet();
m_targetTrack = 0;
@@ -99,6 +101,9 @@
MoveClip::~MoveClip()
{
if (d) {
+ if (d->zoom) {
+ delete d->zoom;
+ }
delete d;
}
}
@@ -302,6 +307,12 @@
}
}
+ if (d->zoom) {
+ d->zoom->jog();
+ return 0;
+ }
+
+
d->jogBypassPos = cpointer().pos();
int scrollbardif = d->hScrollbarValue - d->sv->hscrollbar_value();
@@ -463,5 +474,19 @@
}
-// eof
+void MoveClip::start_zoom(bool autorepeat)
+{
+ if (!d->zoom) {
+ d->zoom = new Zoom(d->sv, QList<QVariant>() << "HJogZoom" <<
"1.2" << "0.2");
+ d->zoom->begin_hold();
+
cpointer().get_viewport()->set_holdcursor(":/cursorZoomHorizontal");
+ d->sv->start_shuttle(false);
+ } else {
+ d->zoom->finish_hold();
+ delete d->zoom;
+ d->zoom = 0;
+ cpointer().get_viewport()->set_holdcursor(":/cursorHoldLrud");
+ d->sv->start_shuttle(true, true);
+ }
+}
Index: src/commands/MoveClip.h
===================================================================
RCS file: /sources/traverso/traverso/src/commands/MoveClip.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- src/commands/MoveClip.h 21 Jan 2008 16:22:11 -0000 1.22
+++ src/commands/MoveClip.h 7 Feb 2008 15:35:07 -0000 1.23
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- $Id: MoveClip.h,v 1.22 2008/01/21 16:22:11 r_sijrier Exp $
+ $Id: MoveClip.h,v 1.23 2008/02/07 15:35:07 r_sijrier Exp $
*/
#ifndef MOVECLIPACTION_H
@@ -34,12 +34,14 @@
class SheetView;
class TrackView;
class AudioClipView;
+class Zoom;
class MoveClip : public Command
{
Q_OBJECT
Q_CLASSINFO("next_snap_pos", tr("To next snap position"));
Q_CLASSINFO("prev_snap_pos", tr("To previous snap position"));
+ Q_CLASSINFO("start_zoom", tr("Jog Zoom"));
public :
MoveClip(AudioClipView* clipView, QString type);
@@ -77,6 +79,7 @@
bool resync;
bool bypassjog;
QPoint jogBypassPos;
+ Zoom* zoom;
};
@@ -85,12 +88,12 @@
void init_data(bool isCopy=false);
void calculate_snap_diff(TimeRef& leftlocation, TimeRef rightlocation);
-
public slots:
void next_snap_pos(bool autorepeat);
void prev_snap_pos(bool autorepeat);
void move_to_start(bool autorepeat);
void move_to_end(bool autorepeat);
+ void start_zoom(bool autorepeat);
private slots:
void audioclip_added(AudioClip* clip);
- [Traverso-commit] traverso resources/keymap.xml src/commands/Move...,
Remon Sijrier <=