[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src commands/CommandGroup.cpp commands...
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso/src commands/CommandGroup.cpp commands... |
Date: |
Mon, 30 Apr 2007 10:09:11 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 07/04/30 10:09:11
Modified files:
src/commands : CommandGroup.cpp commands.h commands.pro
Gain.cpp MoveEdge.cpp Zoom.cpp
src/commands/plugins/TraversoCommands: TraversoCommands.cpp
src/core : Command.cpp
src/traverso/songcanvas: SongView.h
src/traverso/ui: MemoryConfigPage.ui
Added files:
src/commands : RemoveClip.cpp RemoveClip.h
Log message:
* correctly return -1 from prepare_actions commands if the call failed
* correctly check for this value in Command::process_actions()
* Added RemoveClip class to fix problems when undoing remove clip
* minor string updates
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/CommandGroup.cpp?cvsroot=traverso&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/commands.h?cvsroot=traverso&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/commands.pro?cvsroot=traverso&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/Gain.cpp?cvsroot=traverso&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/MoveEdge.cpp?cvsroot=traverso&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/Zoom.cpp?cvsroot=traverso&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/RemoveClip.cpp?cvsroot=traverso&rev=1.7
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/RemoveClip.h?cvsroot=traverso&rev=1.3
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/plugins/TraversoCommands/TraversoCommands.cpp?cvsroot=traverso&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Command.cpp?cvsroot=traverso&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/songcanvas/SongView.h?cvsroot=traverso&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/ui/MemoryConfigPage.ui?cvsroot=traverso&r1=1.3&r2=1.4
Patches:
Index: commands/CommandGroup.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/commands/CommandGroup.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- commands/CommandGroup.cpp 17 Apr 2007 19:56:45 -0000 1.5
+++ commands/CommandGroup.cpp 30 Apr 2007 10:09:11 -0000 1.6
@@ -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: CommandGroup.cpp,v 1.5 2007/04/17 19:56:45 r_sijrier Exp $
+$Id: CommandGroup.cpp,v 1.6 2007/04/30 10:09:11 r_sijrier Exp $
*/
#include "CommandGroup.h"
@@ -46,11 +46,16 @@
return -1;
}
+ int result = 1;
+
foreach(Command* cmd, m_commands) {
- cmd->prepare_actions();
+ if (cmd->prepare_actions() == -1) {
+ printf("one of the commands in the group failed
prepare_actions\n");
+ result = -1;
+ }
}
- return 1;
+ return result;
}
int CommandGroup::do_action()
Index: commands/commands.h
===================================================================
RCS file: /sources/traverso/traverso/src/commands/commands.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- commands/commands.h 22 Mar 2007 01:33:12 -0000 1.12
+++ commands/commands.h 30 Apr 2007 10:09:11 -0000 1.13
@@ -12,3 +12,4 @@
#include "AddRemove.h"
#include "AudioClipExternalProcessing.h"
#include "ArmTracks.h"
+#include "RemoveClip.h"
Index: commands/commands.pro
===================================================================
RCS file: /sources/traverso/traverso/src/commands/commands.pro,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- commands/commands.pro 10 Apr 2007 19:37:57 -0000 1.17
+++ commands/commands.pro 30 Apr 2007 10:09:11 -0000 1.18
@@ -13,7 +13,8 @@
AudioClipExternalProcessing.cpp \
ArmTracks.cpp \
PlayHeadMove.cpp \
-WorkCursorMove.cpp
+WorkCursorMove.cpp \
+RemoveClip.cpp
HEADERS += AddRemove.h \
ClipSelection.h \
CommandGroup.h \
@@ -31,7 +32,8 @@
AudioClipExternalProcessing.h \
ArmTracks.h \
PlayHeadMove.h \
-WorkCursorMove.h
+WorkCursorMove.h \
+RemoveClip.h
TARGET = traversocommands
DESTDIR = ../../lib
TEMPLATE = lib
Index: commands/Gain.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/commands/Gain.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- commands/Gain.cpp 25 Apr 2007 05:43:36 -0000 1.17
+++ commands/Gain.cpp 30 Apr 2007 10:09:11 -0000 1.18
@@ -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: Gain.cpp,v 1.17 2007/04/25 05:43:36 benjie Exp $
+$Id: Gain.cpp,v 1.18 2007/04/30 10:09:11 r_sijrier Exp $
*/
#include "Gain.h"
@@ -74,7 +74,7 @@
{
if (origGain == newGain) {
// Nothing happened!
- return 0;
+ return -1;
}
return 1;
}
Index: commands/MoveEdge.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/commands/MoveEdge.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- commands/MoveEdge.cpp 20 Apr 2007 06:37:10 -0000 1.16
+++ commands/MoveEdge.cpp 30 Apr 2007 10:09:11 -0000 1.17
@@ -49,7 +49,7 @@
if (m_newPos == m_originalPos) {
// Nothing happened!
- return 0;
+ return -1;
}
return 1;
Index: commands/Zoom.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/commands/Zoom.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- commands/Zoom.cpp 20 Apr 2007 06:12:39 -0000 1.13
+++ commands/Zoom.cpp 30 Apr 2007 10:09:11 -0000 1.14
@@ -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: Zoom.cpp,v 1.13 2007/04/20 06:12:39 benjie Exp $
+ $Id: Zoom.cpp,v 1.14 2007/04/30 10:09:11 r_sijrier Exp $
*/
#include <libtraversocore.h>
@@ -43,7 +43,7 @@
int Zoom::prepare_actions()
{
- return 0;
+ return -1;
}
Index: commands/plugins/TraversoCommands/TraversoCommands.cpp
===================================================================
RCS file:
/sources/traverso/traverso/src/commands/plugins/TraversoCommands/TraversoCommands.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- commands/plugins/TraversoCommands/TraversoCommands.cpp 24 Apr 2007
23:47:19 -0000 1.8
+++ commands/plugins/TraversoCommands/TraversoCommands.cpp 30 Apr 2007
10:09:11 -0000 1.9
@@ -116,7 +116,7 @@
"RemoveClipCommand needs a Clip as
argument");
return 0;
}
- return clip->get_track()->remove_clip(clip);
+ return new RemoveClip(clip);
}
case RemoveTrackCommand:
Index: core/Command.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/Command.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- core/Command.cpp 17 Apr 2007 11:51:20 -0000 1.18
+++ core/Command.cpp 30 Apr 2007 10:09:11 -0000 1.19
@@ -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: Command.cpp,v 1.18 2007/04/17 11:51:20 r_sijrier Exp $
+$Id: Command.cpp,v 1.19 2007/04/30 10:09:11 r_sijrier Exp $
*/
#include "Command.h"
@@ -274,7 +274,7 @@
{
Q_ASSERT(cmd);
- if (cmd->prepare_actions()) {
+ if (cmd->prepare_actions() != -1) {
cmd->set_valid(true);
if (cmd->push_to_history_stack() < 0) {
// QUndoStack calls redo() for us, now it's not
Index: traverso/songcanvas/SongView.h
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/songcanvas/SongView.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- traverso/songcanvas/SongView.h 23 Apr 2007 17:56:53 -0000 1.22
+++ traverso/songcanvas/SongView.h 30 Apr 2007 10:09:11 -0000 1.23
@@ -53,10 +53,10 @@
Q_CLASSINFO("shuttle", tr("Shuttle"))
Q_CLASSINFO("goto_begin", tr("To start"))
Q_CLASSINFO("goto_end", tr("To end"))
- Q_CLASSINFO("play_cursor_move", tr("Playcursor: Move"))
+ Q_CLASSINFO("play_cursor_move", tr("Playhead: Move"))
Q_CLASSINFO("work_cursor_move", tr("Workcursor: Move"))
Q_CLASSINFO("add_marker", tr("Add Marker"))
- Q_CLASSINFO("playhead_to_workcursor", tr("Playcursor: To workcursor"))
+ Q_CLASSINFO("playhead_to_workcursor", tr("Playhead: To workcursor"))
public :
Index: traverso/ui/MemoryConfigPage.ui
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/ui/MemoryConfigPage.ui,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- traverso/ui/MemoryConfigPage.ui 18 Apr 2007 12:52:53 -0000 1.3
+++ traverso/ui/MemoryConfigPage.ui 30 Apr 2007 10:09:11 -0000 1.4
@@ -53,16 +53,16 @@
<string><html><head><meta name="qrichtext" content="1"
/><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Sans Serif'; font-size:9pt;
font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="
font-weight:600;">Read / Write buffer size:</span></p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">The amount of audio
data that can be stored </p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">in the read / write
buffers in seconds.</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style="
font-weight:600;">Read buffer size:</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">The amount of audio
data that can be stored in the </p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">read buffers in
seconds.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px;
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">The default value of 1
second should do just fine.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">However, if you're
tight on memory, you can make this value lower.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">If you experience
buffer underruns when the hard disk bandwidth is </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">(almost) saturated, or
when buffer underruns happen regularly due </p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">the hard disk can't
keep up for some reason, you can try a larger value, </p>
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">like 1.5 or 2.0
seconds.</p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">the hard disk can't
keep up for some reason, you can try a larger </p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">value, like 1.5 or 2.0
seconds.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px;
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">Keep in mind that when
using a larger buffer, </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;">it will take
considerably more time to move (i.e. seeking) </p>
Index: commands/RemoveClip.cpp
===================================================================
RCS file: commands/RemoveClip.cpp
diff -N commands/RemoveClip.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ commands/RemoveClip.cpp 30 Apr 2007 10:09:11 -0000 1.7
@@ -0,0 +1,62 @@
+/*
+Copyright (C) 2005-2007 Remon Sijrier
+
+This file is part of Traverso
+
+Traverso is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+*/
+
+#include "RemoveClip.h"
+
+#include <AudioClip.h>
+#include <Track.h>
+
+// Always put me below _all_ includes, this is needed
+// in case we run with memory leak detection enabled!
+#include "Debugger.h"
+
+
+RemoveClip::RemoveClip(AudioClip* clip)
+ : Command(clip, tr("Remove Clip"))
+{
+ m_clip = clip;
+ m_track = m_clip->get_track();
+}
+
+
+int RemoveClip::prepare_actions()
+{
+ return 1;
+}
+
+
+int RemoveClip::do_action()
+{
+ PENTER;
+ Command::process_command(m_track->remove_clip(m_clip, false));
+ return 1;
+}
+
+int RemoveClip::undo_action()
+{
+ PENTER;
+
+ Command::process_command(m_track->add_clip(m_clip, false));
+ return 1;
+}
+
+// eof
+
Index: commands/RemoveClip.h
===================================================================
RCS file: commands/RemoveClip.h
diff -N commands/RemoveClip.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ commands/RemoveClip.h 30 Apr 2007 10:09:11 -0000 1.3
@@ -0,0 +1,45 @@
+/*
+ Copyright (C) 2005-2007 Remon Sijrier
+
+ This file is part of Traverso
+
+ Traverso is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+*/
+
+#ifndef REMOVE_CLIP_H
+#define REMOVE_CLIP_HS
+
+#include "Command.h"
+
+class AudioClip;
+class Track;
+
+class RemoveClip : public Command
+{
+public :
+ RemoveClip(AudioClip* clip);
+ ~RemoveClip() {};
+
+ int prepare_actions();
+ int do_action();
+ int undo_action();
+
+private :
+ AudioClip* m_clip;
+ Track* m_track;
+};
+
+#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Traverso-commit] traverso/src commands/CommandGroup.cpp commands...,
Remon Sijrier <=