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/core/Song.cpp...


From: Remon Sijrier
Subject: [Traverso-commit] traverso resources/keymap.xml src/core/Song.cpp...
Date: Thu, 12 Apr 2007 13:39:12 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       07/04/12 13:39:12

Modified files:
        resources      : keymap.xml 
        src/core       : Song.cpp Song.h 
        src/traverso   : traverso.qrc 
        src/traverso/widgets: InfoWidgets.cpp InfoWidgets.h 
Added files:
        resources/images/icons/16x16: redledinactive.png 

Log message:
        * Added recording state to Song, and activated the Recording button in 
the toolbar.
        Recording now only starts if the button is checked.
        To start play and recording in one go, use modifier key CTRL and 
spacebar: CTRL +  <SpaceBar>

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/resources/images/icons/16x16/redledinactive.png?cvsroot=traverso&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/traverso/resources/keymap.xml?cvsroot=traverso&r1=1.53&r2=1.54
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Song.cpp?cvsroot=traverso&r1=1.79&r2=1.80
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Song.h?cvsroot=traverso&r1=1.45&r2=1.46
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/traverso.qrc?cvsroot=traverso&r1=1.14&r2=1.15
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/widgets/InfoWidgets.cpp?cvsroot=traverso&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/widgets/InfoWidgets.h?cvsroot=traverso&r1=1.9&r2=1.10

Patches:
Index: resources/keymap.xml
===================================================================
RCS file: /sources/traverso/traverso/resources/keymap.xml,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- resources/keymap.xml        12 Apr 2007 12:32:06 -0000      1.53
+++ resources/keymap.xml        12 Apr 2007 13:39:11 -0000      1.54
@@ -101,6 +101,7 @@
                <keyfact type="FKEY" key1="SPACE" >
                        <Objects>
                                <Object objectname="Song" slotsignature="go" 
modes="All" sortorder="1" instantanious="0" />
+                               <Object objectname="Song" 
slotsignature="go_and_record" modes="All" modifierkeys="CTRL" sortorder="2" 
instantanious="0" />
                        </Objects>
                </keyfact>
                <keyfact type="FKEY" key1="A" >

Index: src/core/Song.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/Song.cpp,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -b -r1.79 -r1.80
--- src/core/Song.cpp   11 Apr 2007 15:56:35 -0000      1.79
+++ src/core/Song.cpp   12 Apr 2007 13:39:12 -0000      1.80
@@ -147,7 +147,7 @@
        realtimepath = false;
        scheduleForDeletion = false;
        isSnapOn=true;
-       changed = rendering = false;
+       changed = rendering = m_recording = false;
        firstVisibleFrame=workingFrame=0;
        seeking = 0;
        // TODO seek to old position on project exit ?
@@ -574,6 +574,17 @@
        return track;
 }
 
+Command* Song::go_and_record()
+{
+       if ( ! is_transporting() && ! m_recording) {
+               set_recording(true);
+       } else if (is_transporting() && m_recording) {
+               set_recording(false);
+       }
+       
+       return go();
+}
+
 Command* Song::go()
 {
 //     printf("Song-%d::go transport is %d\n", m_id, transport);
@@ -585,7 +596,7 @@
        } else {
                emit transferStarted();
                
-               if (any_track_armed()) {
+               if (m_recording && any_track_armed()) {
                        group = new CommandGroup(this, "");
                        int clipcount = 0;
                        foreach(Track* track, m_tracks) {
@@ -931,5 +942,11 @@
        return 0;
 }
 
+void Song::set_recording(bool recording)
+{
+       m_recording = recording;
+       emit recordingStateChanged();
+}
+
 // eof
 

Index: src/core/Song.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/Song.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- src/core/Song.h     12 Apr 2007 12:32:07 -0000      1.45
+++ src/core/Song.h     12 Apr 2007 13:39:12 -0000      1.46
@@ -47,7 +47,8 @@
 class Song : public ContextItem
 {
        Q_OBJECT
-       Q_CLASSINFO("go", tr("Play (Record)"))
+       Q_CLASSINFO("go", tr("Play"))
+       Q_CLASSINFO("go_and_record", tr("Record"));
        Q_CLASSINFO("work_next_edge", tr("Workcursor: To next ege"))
        Q_CLASSINFO("work_previous_edge", tr("Workcursor: To previous edge"))
        Q_CLASSINFO("undo", tr("Undo"))
@@ -107,6 +108,8 @@
        void set_hzoom(int hzoom);
        void set_snapping(bool snap);
        int set_state( const QDomNode & node );
+       void set_recording(bool recording);
+       
 
        int process(nframes_t nframes);
        int process_export(nframes_t nframes);
@@ -124,6 +127,7 @@
        bool is_transporting() const {return transport;}
        bool is_changed() const {return changed;}
        bool is_snap_on() const {return isSnapOn;}
+       bool is_recording() const {return m_recording;}
 
        void disconnect_from_audiodevice();
        void connect_to_audiodevice();
@@ -171,6 +175,7 @@
        bool            stopTransport;
        bool            realtimepath;
        bool            scheduleForDeletion;
+       bool            m_recording;
        SnapList*       snaplist;
        Snappable*      workSnap;
        
@@ -193,7 +198,7 @@
        float get_gain() const;
 
        Command* go();
-
+       Command* go_and_record();
        Command* work_next_edge();
        Command* work_previous_edge();
        Command* toggle_snap();
@@ -219,6 +224,7 @@
        void setCursorAtEdge();
        void masterGainChanged();
        void modeChanged();
+       void recordingStateChanged();
 
 private slots:
        void private_add_track(Track* track);

Index: src/traverso/traverso.qrc
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/traverso.qrc,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- src/traverso/traverso.qrc   12 Apr 2007 10:30:53 -0000      1.14
+++ src/traverso/traverso.qrc   12 Apr 2007 13:39:12 -0000      1.15
@@ -37,6 +37,7 @@
                <file 
alias="undo-16">../../resources/images/icons/16x16/undo.png</file>
                <file 
alias="redo-16">../../resources/images/icons/16x16/redo.png</file>
                <file 
alias="redled-16">../../resources/images/icons/16x16/redled.png</file>
+               <file 
alias="redledinactive-16">../../resources/images/icons/16x16/redledinactive.png</file>
                <file 
alias="songmanager-16">../../resources/images/icons/16x16/contents.png</file>
                <file alias="traverso_nl">../../traverso_nl.qm</file>
                <file alias="traverso_de">../../traverso_de.qm</file>

Index: src/traverso/widgets/InfoWidgets.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/widgets/InfoWidgets.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- src/traverso/widgets/InfoWidgets.cpp        12 Apr 2007 12:32:07 -0000      
1.11
+++ src/traverso/widgets/InfoWidgets.cpp        12 Apr 2007 13:39:12 -0000      
1.12
@@ -552,10 +552,13 @@
        m_mode->addItem("Mode: Effects");
        m_mode->setFocusPolicy(Qt::NoFocus);
        
-       m_record = new QPushButton(tr("Record"));
+       m_record = new QToolButton(this);
+       m_recAction = new QAction(tr("Record"), this);
+       m_recAction->setCheckable(true);
+       m_recAction->setToolTip(tr("Toggle recording state on/off"));
+       m_record->setDefaultAction(m_recAction);
        m_record->setFocusPolicy(Qt::NoFocus);
-       m_record->setEnabled(false);
-       m_record->setIcon(find_pixmap(":/redled-16"));
+       m_record->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
        
        
        QToolButton* undobutton = new QToolButton(this);
@@ -602,6 +605,7 @@
        connect(m_followAct, SIGNAL(triggered(bool)), this, 
SLOT(follow_state_changed(bool)));
        connect(&config(), SIGNAL(configChanged()), this, 
SLOT(update_follow_state()));
        connect(m_mode, SIGNAL(currentIndexChanged(int)), this, 
SLOT(mode_index_changed(int)));
+       connect(m_recAction, SIGNAL(triggered(bool)), this, 
SLOT(recording_button_state_changed(bool)));
        
        update_follow_state();
 }
@@ -613,13 +617,16 @@
        if (m_song) {
                connect(m_song, SIGNAL(snapChanged()), this, 
SLOT(update_snap_state()));
                connect(m_song, SIGNAL(modeChanged()), this, 
SLOT(update_mode_state()));
+               connect(m_song, SIGNAL(recordingStateChanged()), this, 
SLOT(update_recording_state()));
                update_snap_state();
                update_mode_state();
                m_snapAct->setEnabled(true);
                m_mode->setEnabled(true);
+               m_record->setEnabled(true);
        } else {
                m_snapAct->setEnabled(false);
                m_mode->setEnabled(false);
+               m_record->setEnabled(false);
        }
 }
 
@@ -665,6 +672,28 @@
        }
 }
 
+void SongInfo::recording_button_state_changed(bool state)
+{
+       m_song->set_recording(state);
+       if (state) {
+               m_recAction->setIcon(find_pixmap(":/redled-16"));
+       } else {
+               m_recAction->setIcon(find_pixmap(":/redledinactive-16"));
+       }
+}
+
+void SongInfo::update_recording_state()
+{
+       if (m_song->is_recording()) {
+               m_recAction->setChecked(true);
+               m_recAction->setIcon(find_pixmap(":/redled-16"));
+       } else {
+               m_recAction->setChecked(false);
+               m_recAction->setIcon(find_pixmap(":/redledinactive-16"));
+       }
+}
+
+
 QSize SongInfo::sizeHint() const
 {
        return QSize(400, INFOBAR_HEIGH_HOR_ORIENTATION);
@@ -795,4 +824,3 @@
 }
 
 //eof
-

Index: src/traverso/widgets/InfoWidgets.h
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/widgets/InfoWidgets.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- src/traverso/widgets/InfoWidgets.h  12 Apr 2007 12:32:07 -0000      1.9
+++ src/traverso/widgets/InfoWidgets.h  12 Apr 2007 13:39:12 -0000      1.10
@@ -209,6 +209,8 @@
        void update_mode_state();
        void follow_state_changed(bool state);
        void mode_index_changed(int index);
+       void recording_button_state_changed(bool state);
+       void update_recording_state();
        
 private:
        PlayHeadInfo*   m_playhead;
@@ -218,7 +220,8 @@
        QAction*        m_snapAct;
        QToolButton*    m_follow;
        QAction*        m_followAct;
-       QPushButton*    m_record;
+       QAction*        m_recAction;
+       QToolButton*    m_record;
 };
 
 

Index: resources/images/icons/16x16/redledinactive.png
===================================================================
RCS file: resources/images/icons/16x16/redledinactive.png
diff -N resources/images/icons/16x16/redledinactive.png
Binary files /dev/null and /tmp/cvsv58NQ4 differ




reply via email to

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