traverso-commit
[Top][All Lists]
Advanced

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

[Traverso-commit] traverso resources/keymap.xml src/commands/plug...


From: Nicola Doebelin
Subject: [Traverso-commit] traverso resources/keymap.xml src/commands/plug...
Date: Tue, 15 May 2007 20:15:15 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Nicola Doebelin <n_doebelin>    07/05/15 20:15:15

Modified files:
        resources      : keymap.xml 
        src/commands/plugins/TraversoCommands: TraversoCommands.cpp 
        src/core       : AudioClip.cpp AudioClip.h 
        src/traverso/songcanvas: AudioClipView.cpp 
        src/traverso   : traverso.qrc 
Added files:
        resources/images: lock.png 

Log message:
        Added function to lock audio clips <L>

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/resources/images/lock.png?cvsroot=traverso&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/traverso/resources/keymap.xml?cvsroot=traverso&r1=1.67&r2=1.68
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/plugins/TraversoCommands/TraversoCommands.cpp?cvsroot=traverso&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/AudioClip.cpp?cvsroot=traverso&r1=1.92&r2=1.93
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/AudioClip.h?cvsroot=traverso&r1=1.47&r2=1.48
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/songcanvas/AudioClipView.cpp?cvsroot=traverso&r1=1.65&r2=1.66
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/traverso.qrc?cvsroot=traverso&r1=1.18&r2=1.19

Patches:
Index: resources/keymap.xml
===================================================================
RCS file: /sources/traverso/traverso/resources/keymap.xml,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -b -r1.67 -r1.68
--- resources/keymap.xml        14 May 2007 14:36:21 -0000      1.67
+++ resources/keymap.xml        15 May 2007 20:15:14 -0000      1.68
@@ -180,6 +180,7 @@
                        <Objects>
                                <Object objectname="SpectralMeterView" 
slotsignature="reset" modes="All" instantanious="0" />
                                <Object objectname="FadeCurve" 
slotsignature="reset" modes="All" instantanious="0" />
+                               <Object objectname="AudioClip" 
slotsignature="lock" modes="All" instantanious="0" />
                        </Objects>
                </keyfact>
                <keyfact type="FKEY" key1="R" >

Index: src/commands/plugins/TraversoCommands/TraversoCommands.cpp
===================================================================
RCS file: 
/sources/traverso/traverso/src/commands/plugins/TraversoCommands/TraversoCommands.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- src/commands/plugins/TraversoCommands/TraversoCommands.cpp  5 May 2007 
20:40:35 -0000       1.11
+++ src/commands/plugins/TraversoCommands/TraversoCommands.cpp  15 May 2007 
20:15:14 -0000      1.12
@@ -176,6 +176,10 @@
                                return 0;
                        }
 
+                       if (view->get_clip()->is_locked()) {
+                               return 0;
+                       }
+
                        QString type;
                        if (arguments.size()) {
                                type = arguments.at(0).toString();

Index: src/core/AudioClip.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/AudioClip.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -b -r1.92 -r1.93
--- src/core/AudioClip.cpp      15 May 2007 20:06:31 -0000      1.92
+++ src/core/AudioClip.cpp      15 May 2007 20:15:14 -0000      1.93
@@ -108,6 +108,7 @@
        m_readSource = 0;
        m_recordingStatus = NO_RECORDING;
        isSelected = m_invalidReadSource = false;
+       isLocked = true;
        fadeIn = 0;
        fadeOut = 0;
        m_refcount = 0;
@@ -124,6 +125,12 @@
        set_gain( e.attribute( "gain", "" ).toFloat() );
        m_normfactor =  e.attribute( "normfactor", "1.0" ).toFloat();
 
+       if (e.attribute( "locked", "1" ).toInt() == 1) {
+               isLocked = true;
+       } else {
+               isLocked = false;
+       }
+
        if (e.attribute("selected", "0").toInt() == 1) {
                m_song->get_audioclip_manager()->select_clip(this);
        }
@@ -180,6 +187,7 @@
        node.setAttribute("clipname", m_name );
        node.setAttribute("selected", isSelected );
        node.setAttribute("id", m_id );
+       node.setAttribute("locked", isLocked);
 
        node.setAttribute("source", m_readSource->get_id());
 
@@ -206,6 +214,12 @@
        emit muteChanged();
 }
 
+void AudioClip::toggle_lock()
+{
+       isLocked = !isLocked;
+       emit lockChanged();
+}
+
 void AudioClip::track_audible_state_changed()
 {
        set_sources_active_state();
@@ -575,6 +589,11 @@
        return new PCommand(this, "toggle_mute", tr("Toggle Mute"));
 }
 
+Command* AudioClip::lock()
+{
+       return new PCommand(this, "toggle_lock", tr("Toggle Lock"));
+}
+
 Command* AudioClip::reset_fade_in()
 {
        return new FadeRange(this, fadeIn, 1.0);
@@ -792,6 +811,11 @@
        return isMuted;
 }
 
+bool AudioClip::is_locked( ) const
+{
+       return isLocked;
+}
+
 QString AudioClip::get_name( ) const
 {
        return m_name;

Index: src/core/AudioClip.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/AudioClip.h,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- src/core/AudioClip.h        11 May 2007 13:09:23 -0000      1.47
+++ src/core/AudioClip.h        15 May 2007 20:15:14 -0000      1.48
@@ -54,6 +54,7 @@
        Q_CLASSINFO("clip_fade_out", tr("Out: Range"))
        Q_CLASSINFO("normalize", tr("Normalize"))
        Q_CLASSINFO("denormalize", tr("Normalize: reset"))
+       Q_CLASSINFO("lock", tr("Lock"))
 
 public:
 
@@ -118,6 +119,7 @@
        bool is_muted() const;
        bool is_take() const;
        bool is_selected() const;
+       bool is_locked() const;
        bool has_song() const;
        bool invalid_readsource() const {return m_invalidReadSource;}
        int recording_state() const;
@@ -157,6 +159,7 @@
        int             isSelected;
        bool            isTake;
        bool            isMuted;
+       bool            isLocked;
        bool            m_invalidReadSource;
        RecordingStatus m_recordingStatus;
        float           m_gain;
@@ -181,6 +184,7 @@
 signals:
        void stateChanged();
        void muteChanged();
+       void lockChanged();
        void positionChanged(Snappable*);
        void trackEndFrameChanged();
        void gainChanged();
@@ -195,6 +199,7 @@
        void set_right_edge(long frame);
        void track_audible_state_changed();
        void toggle_mute();
+       void toggle_lock();
        void set_gain(float g);
 
        float get_gain() const;
@@ -207,6 +212,7 @@
         Command* clip_fade_out();
         Command* normalize();
         Command* denormalize();
+       Command* lock();
 
 private slots:
        void private_add_fade(FadeCurve* fade);

Index: src/traverso/songcanvas/AudioClipView.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/songcanvas/AudioClipView.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -b -r1.65 -r1.66
--- src/traverso/songcanvas/AudioClipView.cpp   15 May 2007 06:53:00 -0000      
1.65
+++ src/traverso/songcanvas/AudioClipView.cpp   15 May 2007 20:15:14 -0000      
1.66
@@ -85,6 +85,7 @@
        
        connect(m_clip, SIGNAL(muteChanged()), this, SLOT(repaint()));
        connect(m_clip, SIGNAL(stateChanged()), this, SLOT(repaint()));
+       connect(m_clip, SIGNAL(lockChanged()), this, SLOT(repaint()));
        connect(m_clip, SIGNAL(gainChanged()), this, SLOT (gain_changed()));
        connect(m_clip, SIGNAL(fadeAdded(FadeCurve*)), this, 
SLOT(add_new_fadeview( FadeCurve*)));
        connect(m_clip, SIGNAL(fadeRemoved(FadeCurve*)), this, 
SLOT(remove_fadeview( FadeCurve*)));
@@ -199,6 +200,12 @@
                painter->drawRect(xstart, 0, pixelcount, m_height - 1);
        }
        
+       // Paint a pixmap if the clip is locked
+       if (m_clip->is_locked()) {
+               int center = m_clip->get_length() / (2 * m_sv->scalefactor);
+               painter->drawPixmap(center - 8, m_height - 20, 
find_pixmap(":/lock"));
+       }
+
        // If the beginning of the clip is painted, add some effect to make it
        // more visible that it _is_ the start of the clip ?????????
        if (xstart == 0) {
@@ -220,7 +227,6 @@
        
 }
 
-
 void AudioClipView::draw_peaks(QPainter* p, int xstart, int pixelcount)
 {
        PENTER2;

Index: src/traverso/traverso.qrc
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/traverso.qrc,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- src/traverso/traverso.qrc   10 May 2007 20:02:36 -0000      1.18
+++ src/traverso/traverso.qrc   15 May 2007 20:15:14 -0000      1.19
@@ -12,6 +12,7 @@
                <file 
alias="cursorHoldLr">../../resources/images/cursorHoldLr.xpm</file>
                <file 
alias="cursorHoldUd">../../resources/images/cursorHoldUd.xpm</file>
                <file 
alias="cursorGain">../../resources/images/cursorGain.xpm</file>
+               <file alias="lock">../../resources/images/lock.png</file>
                <file 
alias="traverso">../../resources/images/traverso.xpm</file>
                <file 
alias="windowicon">../../resources/images/windowicon.xpm</file>
                <file 
alias="keymaps/default.xml">../../resources/keymap.xml</file>

Index: resources/images/lock.png
===================================================================
RCS file: resources/images/lock.png
diff -N resources/images/lock.png
Binary files /dev/null and /tmp/cvsf1xE19 differ




reply via email to

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