[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src commands/MoveClip.cpp commands/Mov...
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso/src commands/MoveClip.cpp commands/Mov... |
Date: |
Thu, 21 Feb 2008 20:00:49 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 08/02/21 20:00:49
Modified files:
src/commands : MoveClip.cpp MoveEdge.cpp
src/core : AudioClip.cpp AudioClipGroup.h AudioClip.h
AudioClipManager.cpp AudioClipManager.h
CMakeLists.txt Marker.cpp Marker.h
ReadSource.cpp ReadSource.h Sheet.cpp
SnapList.cpp SnapList.h Snappable.cpp
TimeLine.cpp TimeLine.h
src/sheetcanvas: AudioClipView.cpp MarkerView.cpp
TimeLineView.cpp
src/sheetcanvas/dialogs: AudioClipEditDialog.cpp
AudioClipEditDialog.h
src/traverso/dialogs: MarkerDialog.cpp
src/traverso/widgets: ResourcesWidget.cpp
Log message:
* cleanup Snappable related signal emiting, with the Snappable object
as argument, it's generally unwanted to emit signal with a pointer to an object
as it's argument.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/MoveClip.cpp?cvsroot=traverso&r1=1.74&r2=1.75
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/MoveEdge.cpp?cvsroot=traverso&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/AudioClip.cpp?cvsroot=traverso&r1=1.163&r2=1.164
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/AudioClipGroup.h?cvsroot=traverso&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/AudioClip.h?cvsroot=traverso&r1=1.74&r2=1.75
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/AudioClipManager.cpp?cvsroot=traverso&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/AudioClipManager.h?cvsroot=traverso&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/CMakeLists.txt?cvsroot=traverso&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Marker.cpp?cvsroot=traverso&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Marker.h?cvsroot=traverso&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/ReadSource.cpp?cvsroot=traverso&r1=1.96&r2=1.97
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/ReadSource.h?cvsroot=traverso&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Sheet.cpp?cvsroot=traverso&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/SnapList.cpp?cvsroot=traverso&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/SnapList.h?cvsroot=traverso&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Snappable.cpp?cvsroot=traverso&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/TimeLine.cpp?cvsroot=traverso&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/TimeLine.h?cvsroot=traverso&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/traverso/src/sheetcanvas/AudioClipView.cpp?cvsroot=traverso&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/traverso/src/sheetcanvas/MarkerView.cpp?cvsroot=traverso&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/traverso/src/sheetcanvas/TimeLineView.cpp?cvsroot=traverso&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/traverso/src/sheetcanvas/dialogs/AudioClipEditDialog.cpp?cvsroot=traverso&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/traverso/src/sheetcanvas/dialogs/AudioClipEditDialog.h?cvsroot=traverso&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/dialogs/MarkerDialog.cpp?cvsroot=traverso&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/widgets/ResourcesWidget.cpp?cvsroot=traverso&r1=1.40&r2=1.41
Patches:
Index: commands/MoveClip.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/commands/MoveClip.cpp,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -b -r1.74 -r1.75
--- commands/MoveClip.cpp 18 Feb 2008 19:49:59 -0000 1.74
+++ commands/MoveClip.cpp 21 Feb 2008 20:00:47 -0000 1.75
@@ -168,7 +168,6 @@
m_group.move_to(m_origTrackIndex, m_trackStartLocation +
TimeRef(d->sv->timeref_scalefactor * 3));
}
- m_group.set_snappable(false);
m_group.set_as_moving(true);
d->sv->stop_follow_play_head();
@@ -181,7 +180,6 @@
int MoveClip::finish_hold()
{
- m_group.set_snappable(true);
m_group.set_as_moving(false);
d->sv->start_shuttle(false);
Index: commands/MoveEdge.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/commands/MoveEdge.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- commands/MoveEdge.cpp 21 Jan 2008 16:22:11 -0000 1.22
+++ commands/MoveEdge.cpp 21 Feb 2008 20:00:47 -0000 1.23
@@ -30,6 +30,8 @@
// in case we run with memory leak detection enabled!
#include "Debugger.h"
+// FIXME: MoveEdge::jog() continuously calls Snaplist::mark_dirty()
+
MoveEdge::MoveEdge(AudioClipView* cv, SheetView* sv, QByteArray whichEdge)
: Command(cv->get_clip(), tr("Move Clip Edge"))
{
Index: core/AudioClip.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/AudioClip.cpp,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -b -r1.163 -r1.164
--- core/AudioClip.cpp 12 Feb 2008 13:05:02 -0000 1.163
+++ core/AudioClip.cpp 21 Feb 2008 20:00:47 -0000 1.164
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2005-2007 Remon Sijrier
+Copyright (C) 2005-2008 Remon Sijrier
This file is part of Traverso
@@ -65,8 +65,7 @@
*/
AudioClip::AudioClip(const QString& name)
- : ContextItem()
- , Snappable()
+ : Snappable()
, m_name(name)
{
PENTERCONS;
@@ -78,9 +77,9 @@
AudioClip::AudioClip(const QDomNode& node)
- : ContextItem()
- , Snappable()
+ : Snappable()
, m_track(0)
+ , m_sheet(0)
, m_readSource(0)
{
PENTERCONS;
@@ -285,9 +284,8 @@
movingToLeft = availableTimeLeft;
}
- m_trackStartLocation -= movingToLeft;
set_source_start_location( m_sourceStartLocation - movingToLeft
);
-
+ set_track_start_location(m_trackStartLocation - movingToLeft);
} else if (newLeftLocation > m_trackStartLocation) {
TimeRef availableTimeRight = m_length;
@@ -298,14 +296,9 @@
movingToRight = (availableTimeRight -
TimeRef(nframes_t(4), get_rate()));
}
- m_trackStartLocation += movingToRight;
set_source_start_location( m_sourceStartLocation +
movingToRight );
-
- } else {
- return;
+ set_track_start_location(m_trackStartLocation + movingToRight);
}
-
- emit positionChanged(this);
}
void AudioClip::set_right_edge(TimeRef newRightLocation)
@@ -339,12 +332,7 @@
set_track_end_location( m_trackEndLocation - movingToLeft );
set_source_end_location( m_sourceEndLocation - movingToLeft);
-
- } else {
- return;
}
-
- emit positionChanged(this);
}
void AudioClip::set_source_start_location(const TimeRef& location)
@@ -363,18 +351,35 @@
{
PENTER2;
m_trackStartLocation = location;
+
+ // set_track_end_location will emit positionChanged(), so we
+ // don't emit it in this function to avoid emitting it twice
+ // (although it seems more logical to emit it here, there are
+ // accasions where only set_track_end_location() is called, and
+ // then we also want to emit positionChanged())
set_track_end_location(m_trackStartLocation + m_length);
- if (m_track) {
- THREAD_SAVE_INVOKE(m_track, this,
clip_position_changed(AudioClip*));
- }
- emit positionChanged(this);
}
void AudioClip::set_track_end_location(const TimeRef& location)
{
// PWARN("m_trackEndLocation is %d", endFrame);
m_trackEndLocation = location;
- emit trackEndLocationChanged();
+
+ if (!is_moving()) {
+ // TODO find out if we also have to call this even during
moving?
+ // And somehow Track itself should manage this, and not from
here!
+ // The purpose of this call is to keep the AudioClip list in
track
+ // sorted on the clips track start location.
+ if (m_track) {
+ THREAD_SAVE_INVOKE(m_track, this,
clip_position_changed(AudioClip*));
+ }
+
+ if (m_sheet) {
+ m_sheet->get_snap_list()->mark_dirty();
+ }
+ }
+
+ emit positionChanged();
}
void AudioClip::set_fade_in(double range)
@@ -732,8 +737,6 @@
m_length = m_sourceEndLocation;
}
- set_track_end_location(m_trackStartLocation + m_sourceLength -
m_sourceStartLocation);
-
set_sources_active_state();
rs->set_audio_clip(this);
@@ -748,7 +751,8 @@
}
}
- emit stateChanged();
+ // This will also emit positionChanged() which is more or less what we
want.
+ set_track_end_location(m_trackStartLocation + m_sourceLength -
m_sourceStartLocation);
}
void AudioClip::finish_write_source()
@@ -880,16 +884,11 @@
return audiodevice().get_sample_rate();
}
-TimeRef& AudioClip::get_source_length( ) const
+TimeRef AudioClip::get_source_length( ) const
{
return m_sourceLength;
}
-TimeRef& AudioClip::get_length() const
-{
- return m_length;
-}
-
int AudioClip::recording_state( ) const
{
return m_recordingStatus;
@@ -1016,6 +1015,7 @@
void AudioClip::set_as_moving(bool moving)
{
m_isMoving = moving;
+ set_snappable(!m_isMoving);
set_sources_active_state();
}
Index: core/AudioClipGroup.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/AudioClipGroup.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- core/AudioClipGroup.h 18 Feb 2008 19:49:59 -0000 1.8
+++ core/AudioClipGroup.h 21 Feb 2008 20:00:47 -0000 1.9
@@ -24,7 +24,7 @@
#include "defines.h"
-class AudioClip;
+#include "AudioClip.h"
class AudioClipGroup
{
Index: core/AudioClip.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/AudioClip.h,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -b -r1.74 -r1.75
--- core/AudioClip.h 12 Feb 2008 13:05:02 -0000 1.74
+++ core/AudioClip.h 21 Feb 2008 20:00:47 -0000 1.75
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2005-2006 Remon Sijrier
+Copyright (C) 2005-2008 Remon Sijrier
This file is part of Traverso
@@ -28,7 +28,6 @@
#include "ContextItem.h"
#include "AudioProcessingItem.h"
-#include "SnapList.h"
#include "Snappable.h"
#include "defines.h"
#include "GainEnvelope.h"
@@ -90,12 +89,12 @@
FadeCurve* get_fade_out() const;
PluginChain* get_plugin_chain() const {return m_pluginChain;}
- TimeRef& get_length() const;
- TimeRef& get_source_length() const;
- TimeRef& get_track_start_location() const {return m_trackStartLocation;}
- TimeRef& get_track_end_location() const {return m_trackEndLocation;}
- TimeRef& get_source_start_location() const {return
m_sourceStartLocation;}
- TimeRef& get_source_end_location() const {return m_sourceEndLocation;}
+ TimeRef get_source_length() const;
+ TimeRef get_length() const {return m_length;}
+ TimeRef get_track_start_location() const {return m_trackStartLocation;}
+ TimeRef get_track_end_location() const {return m_trackEndLocation;}
+ TimeRef get_source_start_location() const {return
m_sourceStartLocation;}
+ TimeRef get_source_end_location() const {return m_sourceEndLocation;}
int get_channels() const;
int get_rate() const;
@@ -132,12 +131,12 @@
QString m_name;
QByteArray m_captureBusName;
- mutable TimeRef m_trackStartLocation;
- mutable TimeRef m_trackEndLocation;
- mutable TimeRef m_sourceEndLocation;
- mutable TimeRef m_sourceStartLocation;
- mutable TimeRef m_sourceLength;
- mutable TimeRef m_length;
+ TimeRef m_trackStartLocation;
+ TimeRef m_trackEndLocation;
+ TimeRef m_sourceEndLocation;
+ TimeRef m_sourceStartLocation;
+ TimeRef m_sourceLength;
+ TimeRef m_length;
int m_isSelected;
bool m_isTake;
@@ -167,8 +166,7 @@
void stateChanged();
void muteChanged();
void lockChanged();
- void positionChanged(Snappable*);
- void trackEndLocationChanged();
+ void positionChanged();
void fadeAdded(FadeCurve*);
void fadeRemoved(FadeCurve*);
void recordingFinished(AudioClip*);
Index: core/AudioClipManager.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/AudioClipManager.cpp,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- core/AudioClipManager.cpp 16 Feb 2008 21:54:44 -0000 1.22
+++ core/AudioClipManager.cpp 21 Feb 2008 20:00:47 -0000 1.23
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2005-2006 Remon Sijrier
+ Copyright (C) 2005-2008 Remon Sijrier
This file is part of Traverso
@@ -17,7 +17,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- $Id: AudioClipManager.cpp,v 1.22 2008/02/16 21:54:44 r_sijrier Exp $
*/
#include "AudioClipManager.h"
@@ -56,10 +55,9 @@
m_clips.append( clip );
- connect(clip, SIGNAL(trackEndLocationChanged()), this,
SLOT(update_last_frame()));
- connect(clip, SIGNAL(positionChanged(Snappable*)),
m_sheet->get_snap_list(), SLOT(mark_dirty(Snappable*)));
+ connect(clip, SIGNAL(positionChanged()), this,
SLOT(update_last_frame()));
- m_sheet->get_snap_list()->mark_dirty(clip);
+ m_sheet->get_snap_list()->mark_dirty();
update_last_frame();
resources_manager()->mark_clip_added(clip);
}
@@ -67,13 +65,12 @@
void AudioClipManager::remove_clip( AudioClip * clip )
{
PENTER;
- disconnect(clip, SIGNAL(positionChanged(Snappable*)),
m_sheet->get_snap_list(), SLOT(mark_dirty(Snappable*)));
if (m_clips.removeAll(clip) == 0) {
PERROR("Clip %s was not in my list, couldn't remove it!!",
QS_C(clip->get_name()));
return;
}
- m_sheet->get_snap_list()->mark_dirty(clip);
+ m_sheet->get_snap_list()->mark_dirty();
update_last_frame();
resources_manager()->mark_clip_removed(clip);
}
Index: core/AudioClipManager.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/AudioClipManager.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- core/AudioClipManager.h 16 Feb 2008 21:54:44 -0000 1.9
+++ core/AudioClipManager.h 21 Feb 2008 20:00:47 -0000 1.10
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2005-2006 Remon Sijrier
+Copyright (C) 2005-2008 Remon Sijrier
This file is part of Traverso
@@ -17,7 +17,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-$Id: AudioClipManager.h,v 1.9 2008/02/16 21:54:44 r_sijrier Exp $
*/
#ifndef AUDIOCLIPMANAGER_H
Index: core/CMakeLists.txt
===================================================================
RCS file: /sources/traverso/traverso/src/core/CMakeLists.txt,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- core/CMakeLists.txt 13 Feb 2008 13:36:09 -0000 1.10
+++ core/CMakeLists.txt 21 Feb 2008 20:00:48 -0000 1.11
@@ -70,7 +70,6 @@
ProjectManager.h
ReadSource.h
ResourcesManager.h
-SnapList.h
Sheet.h
Themer.h
TimeLine.h
Index: core/Marker.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/Marker.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- core/Marker.cpp 29 Jan 2008 18:21:53 -0000 1.20
+++ core/Marker.cpp 21 Feb 2008 20:00:48 -0000 1.21
@@ -112,7 +112,7 @@
{
if (m_when == when) return;
m_when = when;
- emit positionChanged(this);
+ emit positionChanged();
}
void Marker::set_description(const QString &s)
Index: core/Marker.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/Marker.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- core/Marker.h 21 Jan 2008 16:22:14 -0000 1.17
+++ core/Marker.h 21 Feb 2008 20:00:48 -0000 1.18
@@ -90,7 +90,7 @@
Type m_type;
signals:
- void positionChanged(Snappable*);
+ void positionChanged();
void descriptionChanged();
};
Index: core/ReadSource.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/ReadSource.cpp,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -b -r1.96 -r1.97
--- core/ReadSource.cpp 10 Feb 2008 23:47:43 -0000 1.96
+++ core/ReadSource.cpp 21 Feb 2008 20:00:48 -0000 1.97
@@ -269,7 +269,7 @@
}
-void ReadSource::set_output_rate(int rate, bool forceRate)
+void ReadSource::set_output_rate(int rate)
{
Q_ASSERT(rate > 0);
@@ -279,7 +279,7 @@
}
bool useResampling = config().get_property("Conversion",
"DynamicResampling", true).toBool();
- if (useResampling || forceRate) {
+ if (useResampling) {
m_audioReader->set_output_rate(rate);
} else {
m_audioReader->set_output_rate(m_audioReader->get_file_rate());
Index: core/ReadSource.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/ReadSource.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- core/ReadSource.h 11 Jan 2008 15:35:57 -0000 1.46
+++ core/ReadSource.h 21 Feb 2008 20:00:48 -0000 1.47
@@ -79,7 +79,7 @@
void prepare_rt_buffers();
BufferStatus* get_buffer_status();
- void set_output_rate(int rate, bool forceRate=false);
+ void set_output_rate(int rate);
private:
Index: core/Sheet.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/Sheet.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- core/Sheet.cpp 14 Feb 2008 10:32:22 -0000 1.7
+++ core/Sheet.cpp 21 Feb 2008 20:00:48 -0000 1.8
@@ -617,7 +617,7 @@
void Sheet::set_work_at(const TimeRef& location)
{
m_workLocation = location;
- snaplist->mark_dirty(workSnap);
+ snaplist->mark_dirty();
emit workingPosChanged();
}
Index: core/SnapList.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/SnapList.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- core/SnapList.cpp 16 Feb 2008 21:54:44 -0000 1.29
+++ core/SnapList.cpp 21 Feb 2008 20:00:48 -0000 1.30
@@ -39,12 +39,11 @@
#if defined(debugsnaplist)
#define SLPRINT(args...) printf(args)
#else
-#define SLPRINT(args...)
+#define SLPRINT(args...);
#endif
SnapList::SnapList(Sheet* sheet)
- : QObject(sheet)
- , m_sheet(sheet)
+ : m_sheet(sheet)
{
m_isDirty = true;
m_rangeStart = TimeRef();
@@ -52,11 +51,10 @@
m_scalefactor = 1;
}
-void SnapList::mark_dirty(Snappable *item)
+void SnapList::mark_dirty()
{
- if (item->is_snappable()) {
+ printf("mark_dirty()\n");
m_isDirty = true;
- }
}
void SnapList::update_snaplist()
Index: core/SnapList.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/SnapList.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- core/SnapList.h 13 Feb 2008 15:28:52 -0000 1.15
+++ core/SnapList.h 21 Feb 2008 20:00:48 -0000 1.16
@@ -22,18 +22,15 @@
#ifndef SNAPLIST_H
#define SNAPLIST_H
-#include <QObject>
#include <QList>
#include "defines.h"
class Sheet;
-class AudioClip;
class Snappable;
-class SnapList : public QObject
+class SnapList
{
- Q_OBJECT
public:
SnapList(Sheet* sheet);
@@ -48,6 +45,7 @@
TimeRef calculate_snap_diff(TimeRef leftlocation, TimeRef
rightlocation);
void set_range(const TimeRef& start, const TimeRef& end, int
scalefactor);
+ void mark_dirty();
private:
Sheet* m_sheet;
@@ -60,9 +58,6 @@
qint64 m_scalefactor;
void update_snaplist();
-
-public slots:
- void mark_dirty(Snappable *item);
};
#endif
Index: core/Snappable.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/Snappable.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- core/Snappable.cpp 29 Mar 2007 22:18:38 -0000 1.1
+++ core/Snappable.cpp 21 Feb 2008 20:00:48 -0000 1.2
@@ -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: Snappable.cpp,v 1.1 2007/03/29 22:18:38 benjie Exp $
+$Id: Snappable.cpp,v 1.2 2008/02/21 20:00:48 r_sijrier Exp $
*/
#include "Snappable.h"
@@ -34,11 +34,8 @@
void Snappable::set_snappable(bool snap)
{
- // Temporarily set to true so the snapList will rebuild on mark_dirty()
- m_isSnappable = true;
-
if (snapList) {
- snapList->mark_dirty(this);
+ snapList->mark_dirty();
}
m_isSnappable = snap;
}
Index: core/TimeLine.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/TimeLine.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- core/TimeLine.cpp 21 Jan 2008 16:22:15 -0000 1.16
+++ core/TimeLine.cpp 21 Feb 2008 20:00:48 -0000 1.17
@@ -60,7 +60,7 @@
while (!markerNode.isNull()) {
Marker* marker = new Marker(this, markerNode);
- connect(marker, SIGNAL(positionChanged(Snappable*)), this,
SLOT(marker_position_changed(Snappable*)));
+ connect(marker, SIGNAL(positionChanged()), this,
SLOT(marker_position_changed()));
m_markers.append(marker);
markerNode = markerNode.nextSibling();
}
@@ -72,7 +72,7 @@
Command * TimeLine::add_marker(Marker* marker, bool historable)
{
- connect(marker, SIGNAL(positionChanged(Snappable*)), this,
SLOT(marker_position_changed(Snappable*)));
+ connect(marker, SIGNAL(positionChanged()), this,
SLOT(marker_position_changed()));
AddRemove* cmd;
cmd = new AddRemove(this, marker, historable, m_sheet,
@@ -162,10 +162,10 @@
return false;
}
-void TimeLine::marker_position_changed(Snappable* snap)
+void TimeLine::marker_position_changed()
{
qSort(m_markers.begin(), m_markers.end(), smallerMarker);
- emit markerPositionChanged((Marker*)snap);
+ emit markerPositionChanged();
// FIXME This is not a fix to let the sheetview scrollbars
// know that it's range possably has to be recalculated!!!!!!!!!!!!!!
Index: core/TimeLine.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/TimeLine.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- core/TimeLine.h 21 Jan 2008 16:22:15 -0000 1.12
+++ core/TimeLine.h 21 Feb 2008 20:00:48 -0000 1.13
@@ -60,12 +60,12 @@
private slots:
void private_add_marker(Marker* marker);
void private_remove_marker(Marker* marker);
- void marker_position_changed(Snappable* snap);
+ void marker_position_changed();
signals:
void markerAdded(Marker*);
void markerRemoved(Marker*);
- void markerPositionChanged(Marker*);
+ void markerPositionChanged();
};
#endif
Index: sheetcanvas/AudioClipView.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/sheetcanvas/AudioClipView.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- sheetcanvas/AudioClipView.cpp 12 Feb 2008 15:09:36 -0000 1.7
+++ sheetcanvas/AudioClipView.cpp 21 Feb 2008 20:00:48 -0000 1.8
@@ -99,7 +99,7 @@
connect(m_clip, SIGNAL(lockChanged()), this, SLOT(repaint()));
connect(m_clip, SIGNAL(fadeAdded(FadeCurve*)), this,
SLOT(add_new_fadeview( FadeCurve*)));
connect(m_clip, SIGNAL(fadeRemoved(FadeCurve*)), this,
SLOT(remove_fadeview( FadeCurve*)));
- connect(m_clip, SIGNAL(positionChanged(Snappable*)), this,
SLOT(position_changed()));
+ connect(m_clip, SIGNAL(positionChanged()), this,
SLOT(position_changed()));
connect(m_sheet, SIGNAL(modeChanged()), this, SLOT(repaint()));
Index: sheetcanvas/MarkerView.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/sheetcanvas/MarkerView.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- sheetcanvas/MarkerView.cpp 29 Jan 2008 13:13:12 -0000 1.2
+++ sheetcanvas/MarkerView.cpp 21 Feb 2008 20:00:48 -0000 1.3
@@ -57,7 +57,7 @@
load_theme_data();
- connect(m_marker, SIGNAL(positionChanged(Snappable*)), this,
SLOT(update_position()));
+ connect(m_marker, SIGNAL(positionChanged()), this,
SLOT(update_position()));
connect(m_marker, SIGNAL(descriptionChanged()), this,
SLOT(update_drawing()));
}
@@ -169,7 +169,6 @@
if (dragging) {
if (! m_posIndicator) {
m_posIndicator = new PositionIndicator(this);
- scene()->addItem(m_posIndicator);
m_posIndicator->set_position(15, 0);
}
} else {
Index: sheetcanvas/TimeLineView.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/sheetcanvas/TimeLineView.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- sheetcanvas/TimeLineView.cpp 29 Jan 2008 13:13:13 -0000 1.2
+++ sheetcanvas/TimeLineView.cpp 21 Feb 2008 20:00:49 -0000 1.3
@@ -79,7 +79,6 @@
int DragMarker::finish_hold()
{
- m_marker->set_snappable(true);
d->view->get_sheetview()->start_shuttle(false);
d->view->set_dragging(false);
delete d;
@@ -90,12 +89,14 @@
int DragMarker::do_action()
{
m_marker->set_when(m_newWhen);
+ m_marker->set_snappable(true);
return 1;
}
int DragMarker::undo_action()
{
m_marker->set_when(m_origWhen);
+ m_marker->set_snappable(true);
return 1;
}
@@ -171,9 +172,6 @@
m_boundingRect = QRectF(0, 0, MAX_CANVAS_WIDTH, TIMELINE_HEIGHT);
m_timeline = m_sv->get_sheet()->get_timeline();
-#if QT_VERSION < 0x040300
- view->scene()->addItem(this);
-#endif
load_theme_data();
// Create MarkerViews for existing markers
Index: sheetcanvas/dialogs/AudioClipEditDialog.cpp
===================================================================
RCS file:
/sources/traverso/traverso/src/sheetcanvas/dialogs/AudioClipEditDialog.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- sheetcanvas/dialogs/AudioClipEditDialog.cpp 21 Jan 2008 16:17:31 -0000
1.1
+++ sheetcanvas/dialogs/AudioClipEditDialog.cpp 21 Feb 2008 20:00:49 -0000
1.2
@@ -69,7 +69,7 @@
fade_curve_added();
connect(clip, SIGNAL(stateChanged()), this, SLOT(clip_state_changed()));
- connect(clip, SIGNAL(positionChanged(Snappable*)), this,
SLOT(clip_position_changed()));
+ connect(clip, SIGNAL(positionChanged()), this,
SLOT(clip_position_changed()));
connect(clip, SIGNAL(fadeAdded(FadeCurve*)), this,
SLOT(fade_curve_added()));
connect(clipGainSpinBox, SIGNAL(valueChanged(double)), this,
SLOT(gain_spinbox_value_changed(double)));
@@ -350,7 +350,7 @@
return ref;
}
-QTime AudioClipEditDialog::timeref_to_qtime(TimeRef& ref)
+QTime AudioClipEditDialog::timeref_to_qtime(const TimeRef& ref)
{
qint64 remainder;
int hours, mins, secs, msec;
Index: sheetcanvas/dialogs/AudioClipEditDialog.h
===================================================================
RCS file:
/sources/traverso/traverso/src/sheetcanvas/dialogs/AudioClipEditDialog.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- sheetcanvas/dialogs/AudioClipEditDialog.h 21 Jan 2008 16:17:31 -0000
1.1
+++ sheetcanvas/dialogs/AudioClipEditDialog.h 21 Feb 2008 20:00:49 -0000
1.2
@@ -45,7 +45,7 @@
QDomNode m_origState;
TimeRef qtime_to_timeref(const QTime& time);
- QTime timeref_to_qtime(TimeRef& ref);
+ QTime timeref_to_qtime(const TimeRef& ref);
bool locked;
private slots:
Index: traverso/dialogs/MarkerDialog.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/dialogs/MarkerDialog.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- traverso/dialogs/MarkerDialog.cpp 21 Jan 2008 16:25:16 -0000 1.24
+++ traverso/dialogs/MarkerDialog.cpp 21 Feb 2008 20:00:49 -0000 1.25
@@ -116,7 +116,7 @@
comboBoxDisplaySheet->addItem("Sheet " + QString::number(i+1) +
": " + m_sheetlist.at(i)->get_title());
connect(m_sheetlist.at(i)->get_timeline(),
SIGNAL(markerAdded(Marker*)), this, SLOT(update_marker_treeview()));
connect(m_sheetlist.at(i)->get_timeline(),
SIGNAL(markerRemoved(Marker*)), this, SLOT(update_marker_treeview()));
- connect(m_sheetlist.at(i)->get_timeline(),
SIGNAL(markerPositionChanged(Marker*)), this, SLOT(update_marker_treeview()));
+ connect(m_sheetlist.at(i)->get_timeline(),
SIGNAL(markerPositionChanged()), this, SLOT(update_marker_treeview()));
}
// Fill dialog with marker stuff....
Index: traverso/widgets/ResourcesWidget.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/widgets/ResourcesWidget.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- traverso/widgets/ResourcesWidget.cpp 21 Jan 2008 16:22:18 -0000
1.40
+++ traverso/widgets/ResourcesWidget.cpp 21 Feb 2008 20:00:49 -0000
1.41
@@ -357,7 +357,7 @@
clipitem->setTextAlignment(2, Qt::AlignHCenter);
clipitem->setTextAlignment(3, Qt::AlignLeft);
- connect(clip, SIGNAL(positionChanged(Snappable*)), clipitem,
SLOT(clip_state_changed()));
+ connect(clip, SIGNAL(positionChanged()), clipitem,
SLOT(clip_state_changed()));
}
update_clip_state(clip);