[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso resources/keymap.xml src/commands/Clip...
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso resources/keymap.xml src/commands/Clip... |
Date: |
Mon, 18 Feb 2008 19:50:00 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 08/02/18 19:50:00
Modified files:
resources : keymap.xml
src/commands : ClipSelection.cpp ClipSelection.h MoveClip.cpp
src/commands/plugins/TraversoCommands: TraversoCommands.cpp
TraversoCommands.h
src/core : AudioClipGroup.cpp AudioClipGroup.h
Log message:
* dirty hack to make << S >> (select all clips) work. the whole clip
selection concept needs to be reviewed!
* honor locked clips: when a clip is locked, the clip(group) is not
moved!
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/resources/keymap.xml?cvsroot=traverso&r1=1.107&r2=1.108
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/ClipSelection.cpp?cvsroot=traverso&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/ClipSelection.h?cvsroot=traverso&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/MoveClip.cpp?cvsroot=traverso&r1=1.73&r2=1.74
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/plugins/TraversoCommands/TraversoCommands.cpp?cvsroot=traverso&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/plugins/TraversoCommands/TraversoCommands.h?cvsroot=traverso&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/AudioClipGroup.cpp?cvsroot=traverso&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/AudioClipGroup.h?cvsroot=traverso&r1=1.7&r2=1.8
Patches:
Index: resources/keymap.xml
===================================================================
RCS file: /sources/traverso/traverso/resources/keymap.xml,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -b -r1.107 -r1.108
--- resources/keymap.xml 18 Feb 2008 10:15:48 -0000 1.107
+++ resources/keymap.xml 18 Feb 2008 19:49:59 -0000 1.108
@@ -599,6 +599,11 @@
<Object objectname="SheetView"
slotsignature="play_to_begin" modes="All" sortorder="30" submenu="Playhead" />
</Objects>
</keyfact>
+ <keyfact type="D_FKEY" key1="S">
+ <Objects>
+ <Object objectname="Sheet" modes="All"
sortorder="1" submenu="Selection" pluginname="TraversoCommands"
commandname="ClipSelectionSelectAll" arguments="select_all_clips" />
+ </Objects>
+ </keyfact>
Index: src/commands/ClipSelection.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/commands/ClipSelection.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- src/commands/ClipSelection.cpp 21 Jan 2008 16:22:11 -0000 1.6
+++ src/commands/ClipSelection.cpp 18 Feb 2008 19:49:59 -0000 1.7
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2005-2007 Remon Sijrier
+Copyright (C) 2005-2008 Remon Sijrier
This file is part of Traverso
@@ -23,6 +23,7 @@
#include "ClipSelection.h"
#include "AudioClipManager.h"
#include <AudioClip.h>
+#include "ContextPointer.h"
#include <Sheet.h>
#include <Utils.h>
@@ -57,6 +58,15 @@
ClipSelection::~ClipSelection()
{}
+int ClipSelection::begin_hold()
+{
+ m_selectionArea = QRect(cpointer().on_first_input_event_x(),
cpointer().on_first_input_event_y(), 1, 1);
+}
+
+int ClipSelection::finish_hold()
+{
+}
+
int ClipSelection::prepare_actions()
{
m_acmanager->get_selected_clips_state( selectedClips );
@@ -82,5 +92,11 @@
return 1;
}
-// eof
+void ClipSelection::cancel_action()
+{
+ undo_action();
+}
+int ClipSelection::jog()
+{
+}
Index: src/commands/ClipSelection.h
===================================================================
RCS file: /sources/traverso/traverso/src/commands/ClipSelection.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- src/commands/ClipSelection.h 16 Mar 2007 00:09:12 -0000 1.3
+++ src/commands/ClipSelection.h 18 Feb 2008 19:49:59 -0000 1.4
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2005-2007 Remon Sijrier
+Copyright (C) 2005-2008 Remon Sijrier
This file is part of Traverso
@@ -24,6 +24,7 @@
#include "Command.h"
#include <QList>
+#include <QRect>
class AudioClip;
class AudioClipManager;
@@ -35,14 +36,20 @@
ClipSelection(QList<AudioClip*> clips, AudioClipManager* manager, const
char* slot, const QString& des);
~ClipSelection();
+ int begin_hold();
+ int finish_hold();
int prepare_actions();
int do_action();
int undo_action();
+ void cancel_action();
+
+ int jog();
private :
QList<AudioClip* > m_clips;
const char* m_slot;
AudioClipManager* m_acmanager;
+ QRect m_selectionArea;
QList<AudioClip* > selectedClips;
};
Index: src/commands/MoveClip.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/commands/MoveClip.cpp,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -b -r1.73 -r1.74
--- src/commands/MoveClip.cpp 18 Feb 2008 10:15:49 -0000 1.73
+++ src/commands/MoveClip.cpp 18 Feb 2008 19:49:59 -0000 1.74
@@ -156,7 +156,7 @@
int MoveClip::begin_hold()
{
- if (!m_group.get_size()) {
+ if (!m_group.get_size() || m_group.is_locked()) {
return -1;
}
Index: src/commands/plugins/TraversoCommands/TraversoCommands.cpp
===================================================================
RCS file:
/sources/traverso/traverso/src/commands/plugins/TraversoCommands/TraversoCommands.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- src/commands/plugins/TraversoCommands/TraversoCommands.cpp 13 Feb 2008
23:20:59 -0000 1.27
+++ src/commands/plugins/TraversoCommands/TraversoCommands.cpp 18 Feb 2008
19:49:59 -0000 1.28
@@ -108,6 +108,7 @@
m_dict.insert("RemoveTrack", RemoveTrackCommand);
m_dict.insert("AudioClipExternalProcessing",
AudioClipExternalProcessingCommand);
m_dict.insert("ClipSelectionSelect", ClipSelectionCommand);
+ m_dict.insert("ClipSelectionSelectAll", ClipSelectionCommand);
m_dict.insert("ClipSelectionAdd", ClipSelectionCommand);
m_dict.insert("ClipSelectionRemove", ClipSelectionCommand);
m_dict.insert("MoveClip", MoveClipCommand);
@@ -252,6 +253,16 @@
case ClipSelectionCommand:
{
+ Sheet* sheet = qobject_cast<Sheet*>(obj);
+ if (sheet) {
+ QString action;
+ if (arguments.size()) {
+ action = arguments.at(0).toString();
+ if (action == "select_all_clips") {
+ return
sheet->get_audioclip_manager()->select_all_clips();
+ }
+ }
+ }
AudioClip* clip = qobject_cast<AudioClip*>(obj);
if (!clip) {
PERROR("TraversoCommands: Supplied QObject was
not an AudioClip! "
@@ -270,10 +281,6 @@
return 0;
}
-// if (view->get_clip()->is_locked()) {
-// return 0;
-// }
-
return new MoveClip(view, arguments);
}
Index: src/commands/plugins/TraversoCommands/TraversoCommands.h
===================================================================
RCS file:
/sources/traverso/traverso/src/commands/plugins/TraversoCommands/TraversoCommands.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- src/commands/plugins/TraversoCommands/TraversoCommands.h 13 Feb 2008
23:20:59 -0000 1.11
+++ src/commands/plugins/TraversoCommands/TraversoCommands.h 18 Feb 2008
19:49:59 -0000 1.12
@@ -40,6 +40,7 @@
Q_CLASSINFO("RemoveTrack", tr("Remove Track"))
Q_CLASSINFO("AudioClipExternalProcessing", tr("External Processing"))
Q_CLASSINFO("ClipSelectionSelect", tr("Select"))
+ Q_CLASSINFO("ClipSelectionSelectAll", tr("(De)Select All"))
Q_CLASSINFO("ClipSelectionRemove", tr("Remove from Selection"))
Q_CLASSINFO("ClipSelectionAdd", tr("Add to Selection"))
Q_CLASSINFO("MoveClip", tr("Move Clip"))
Index: src/core/AudioClipGroup.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/AudioClipGroup.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- src/core/AudioClipGroup.cpp 16 Feb 2008 20:04:43 -0000 1.6
+++ src/core/AudioClipGroup.cpp 18 Feb 2008 19:49:59 -0000 1.7
@@ -158,3 +158,12 @@
}
}
+bool AudioClipGroup::is_locked() const
+{
+ foreach(AudioClip* clip, m_clips) {
+ if (clip->is_locked()) {
+ return true;
+ }
+ }
+ return false;
+}
Index: src/core/AudioClipGroup.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/AudioClipGroup.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- src/core/AudioClipGroup.h 16 Feb 2008 20:09:14 -0000 1.7
+++ src/core/AudioClipGroup.h 18 Feb 2008 19:49:59 -0000 1.8
@@ -47,6 +47,8 @@
int get_size() const {return m_clips.size();}
int get_track_index() const {return m_topTrackIndex;}
+ bool is_locked() const;
+
TimeRef get_track_start_location() const {return m_trackStartLocation;}
TimeRef get_track_end_location() const {return m_trackEndLocation;}
TimeRef get_length() const {return m_trackEndLocation -
m_trackStartLocation;}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Traverso-commit] traverso resources/keymap.xml src/commands/Clip...,
Remon Sijrier <=