traverso-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-commit] traverso/src/commands RemoveClip.cpp RemoveClip.h


From: Remon Sijrier
Subject: [Traverso-commit] traverso/src/commands RemoveClip.cpp RemoveClip.h
Date: Mon, 18 Feb 2008 19:17:50 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       08/02/18 19:17:50

Modified files:
        src/commands   : RemoveClip.cpp RemoveClip.h 

Log message:
        * Use AudioClipGroups, if a clip is in a group, the whole group will be 
removed on << R >>

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/RemoveClip.cpp?cvsroot=traverso&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/RemoveClip.h?cvsroot=traverso&r1=1.5&r2=1.6

Patches:
Index: RemoveClip.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/commands/RemoveClip.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- RemoveClip.cpp      17 May 2007 21:38:15 -0000      1.9
+++ RemoveClip.cpp      18 Feb 2008 19:17:49 -0000      1.10
@@ -21,10 +21,9 @@
 
 #include "RemoveClip.h"
 
-#include <AudioClip.h>
-#include <Track.h>
-#include "ResourcesManager.h"
-#include "ProjectManager.h"
+#include "AudioClip.h"
+#include "AudioClipManager.h"
+#include "Sheet.h"
 
 // Always put me below _all_ includes, this is needed
 // in case we run with memory leak detection enabled!
@@ -34,10 +33,15 @@
 AddRemoveClip::AddRemoveClip(AudioClip* clip, int type)
        : Command(clip, tr("Remove Clip"))
 {
-       m_clip = clip;
-       m_track = m_clip->get_track();
+       if (clip->is_selected()) {
+               QList<AudioClip*> selected;
+               
clip->get_sheet()->get_audioclip_manager()->get_selected_clips_state(selected);
+               m_group.set_clips(selected);
+               setText(tr("Remove ClipGroup"));
+       } else {
+               m_group.add_clip(clip);
+       }
        m_type = type;
-       m_removeFromDataBase = false;
 }
 
 
@@ -51,11 +55,11 @@
 {
        PENTER;
        if (m_type == REMOVE) {
-               Command::process_command(m_track->remove_clip(m_clip, false));
+               m_group.remove_all_clips_from_tracks();
        }
        
        if (m_type == ADD) {
-               Command::process_command(m_track->add_clip(m_clip, false));
+               m_group.add_all_clips_to_tracks();
        }
        
        return 1;
@@ -66,11 +70,11 @@
        PENTER;
 
        if (m_type == REMOVE) {
-               Command::process_command(m_track->add_clip(m_clip, false));
+               m_group.add_all_clips_to_tracks();
        }
        
        if (m_type == ADD) {
-               Command::process_command(m_track->remove_clip(m_clip, false));
+               m_group.remove_all_clips_from_tracks();
        }
        
        return 1;

Index: RemoveClip.h
===================================================================
RCS file: /sources/traverso/traverso/src/commands/RemoveClip.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- RemoveClip.h        17 May 2007 21:38:15 -0000      1.5
+++ RemoveClip.h        18 Feb 2008 19:17:49 -0000      1.6
@@ -23,6 +23,7 @@
 #define REMOVE_CLIP_HS
 
 #include "Command.h"
+#include "AudioClipGroup.h"
 
 class AudioClip;
 class Track;
@@ -43,10 +44,8 @@
        int undo_action();
        
 private :
+       AudioClipGroup  m_group;
        int m_type;
-       bool m_removeFromDataBase;
-       AudioClip* m_clip;
-       Track* m_track;
 };
 
 #endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]