summaryrefslogtreecommitdiffstats
path: root/src/gui/editors/segment/segmentcanvas/CompositionModelImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/editors/segment/segmentcanvas/CompositionModelImpl.cpp')
-rw-r--r--src/gui/editors/segment/segmentcanvas/CompositionModelImpl.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/src/gui/editors/segment/segmentcanvas/CompositionModelImpl.cpp b/src/gui/editors/segment/segmentcanvas/CompositionModelImpl.cpp
index 39deb2e..9627b16 100644
--- a/src/gui/editors/segment/segmentcanvas/CompositionModelImpl.cpp
+++ b/src/gui/editors/segment/segmentcanvas/CompositionModelImpl.cpp
@@ -50,14 +50,14 @@
#include "AudioPreviewPainter.h"
#include "gui/general/GUIPalette.h"
#include "SegmentOrderer.h"
-#include <qbrush.h>
-#include <qcolor.h>
-#include <qpen.h>
-#include <qpoint.h>
-#include <qrect.h>
-#include <qregexp.h>
-#include <qsize.h>
-#include <qstring.h>
+#include <tqbrush.h>
+#include <tqcolor.h>
+#include <tqpen.h>
+#include <tqpoint.h>
+#include <tqrect.h>
+#include <tqregexp.h>
+#include <tqsize.h>
+#include <tqstring.h>
@@ -120,13 +120,13 @@ CompositionModelImpl::~CompositionModelImpl()
}
struct RectCompare {
- bool operator()(const QRect &r1, const QRect &r2) const {
+ bool operator()(const TQRect &r1, const TQRect &r2) const {
return r1.x() < r2.x();
}
};
-void CompositionModelImpl::makeNotationPreviewRects(RectRanges* npRects, QPoint basePoint,
- const Segment* segment, const QRect& clipRect)
+void CompositionModelImpl::makeNotationPreviewRects(RectRanges* npRects, TQPoint basePoint,
+ const Segment* segment, const TQRect& clipRect)
{
rectlist* cachedNPData = getNotationPreviewData(segment);
@@ -167,8 +167,8 @@ void CompositionModelImpl::makeNotationPreviewRects(RectRanges* npRects, QPoint
npRects->push_back(interval);
}
-void CompositionModelImpl::makeNotationPreviewRectsMovingSegment(RectRanges* npRects, QPoint basePoint,
- const Segment* segment, const QRect& currentSR)
+void CompositionModelImpl::makeNotationPreviewRectsMovingSegment(RectRanges* npRects, TQPoint basePoint,
+ const Segment* segment, const TQRect& currentSR)
{
CompositionRect unmovedSR = computeSegmentRect(*segment);
@@ -222,14 +222,14 @@ void CompositionModelImpl::makeNotationPreviewRectsMovingSegment(RectRanges* npR
}
void CompositionModelImpl::makeAudioPreviewRects(AudioPreviewDrawData* apRects, const Segment* segment,
- const CompositionRect& segRect, const QRect& clipRect)
+ const CompositionRect& segRect, const TQRect& clipRect)
{
Profiler profiler("CompositionModelImpl::makeAudioPreviewRects", true);
RG_DEBUG << "CompositionModelImpl::makeAudioPreviewRects - segRect = " << segRect << endl;
PixmapArray previewImage = getAudioPreviewPixmap(segment);
- QPoint basePoint = segRect.topLeft();
+ TQPoint basePoint = segRect.topLeft();
AudioPreviewDrawDataItem previewItem(previewImage, basePoint, segRect);
@@ -392,7 +392,7 @@ void CompositionModelImpl::updatePreviewCacheForNotationSegment(const Segment* s
if (y > y1 - height + 1)
y = y1 - height + 1;
- QRect r(x, (int)y, width, height);
+ TQRect r(x, (int)y, width, height);
// RG_DEBUG << "CompositionModelImpl::updatePreviewCacheForNotationSegment() : npData = "
// << npData << ", preview rect = "
@@ -402,10 +402,10 @@ void CompositionModelImpl::updatePreviewCacheForNotationSegment(const Segment* s
}
-QColor CompositionModelImpl::computeSegmentPreviewColor(const Segment* segment)
+TQColor CompositionModelImpl::computeSegmentPreviewColor(const Segment* segment)
{
// compute the preview color so it's as visible as possible over the segment's color
- QColor segColor = GUIPalette::convertColour(m_composition.getSegmentColourMap().getColourByIndex(segment->getColourIndex()));
+ TQColor segColor = GUIPalette::convertColour(m_composition.getSegmentColourMap().getColourByIndex(segment->getColourIndex()));
int h, s, v;
segColor.hsv(&h, &s, &v);
@@ -440,7 +440,7 @@ void CompositionModelImpl::updatePreviewCacheForAudioSegment(const Segment* segm
CompositionRect segRect = computeSegmentRect(*segment);
segRect.setWidth(segRect.getBaseWidth()); // don't use repeating area
- segRect.moveTopLeft(QPoint(0, 0));
+ segRect.moveTopLeft(TQPoint(0, 0));
if (apData)
apData->setSegmentRect(segRect);
@@ -451,8 +451,8 @@ void CompositionModelImpl::updatePreviewCacheForAudioSegment(const Segment* segm
AudioPreviewUpdater *updater = new AudioPreviewUpdater
(*m_audioPreviewThread, m_composition, segment, segRect, this);
- connect(updater, SIGNAL(audioPreviewComplete(AudioPreviewUpdater*)),
- this, SLOT(slotAudioPreviewComplete(AudioPreviewUpdater*)));
+ connect(updater, TQT_SIGNAL(audioPreviewComplete(AudioPreviewUpdater*)),
+ this, TQT_SLOT(slotAudioPreviewComplete(AudioPreviewUpdater*)));
m_audioPreviewUpdaterMap[segment] = updater;
@@ -473,7 +473,7 @@ void CompositionModelImpl::slotAudioPreviewComplete(AudioPreviewUpdater* apu)
RG_DEBUG << "CompositionModelImpl::slotAudioPreviewComplete()\n";
AudioPreviewData *apData = getAudioPreviewData(apu->getSegment());
- QRect updateRect;
+ TQRect updateRect;
if (apData) {
RG_DEBUG << "CompositionModelImpl::slotAudioPreviewComplete(" << apu << "): apData contains " << apData->getValues().size() << " values already" << endl;
@@ -492,7 +492,7 @@ void CompositionModelImpl::slotAudioPreviewComplete(AudioPreviewUpdater* apu)
emit needContentUpdate(updateRect);
}
-QRect CompositionModelImpl::postProcessAudioPreview(AudioPreviewData* apData, const Segment* segment)
+TQRect CompositionModelImpl::postProcessAudioPreview(AudioPreviewData* apData, const Segment* segment)
{
// RG_DEBUG << "CompositionModelImpl::postProcessAudioPreview()\n";
@@ -608,7 +608,7 @@ void CompositionModelImpl::segmentRemoved(const Composition *, Segment *s)
{
setTrackHeights();
- QRect r = computeSegmentRect(*s);
+ TQRect r = computeSegmentRect(*s);
m_selectedSegments.erase(s);
@@ -658,7 +658,7 @@ void CompositionModelImpl::endMarkerTimeChanged(const Composition *, bool)
emit needSizeUpdate();
}
-void CompositionModelImpl::setSelectionRect(const QRect& r)
+void CompositionModelImpl::setSelectionRect(const TQRect& r)
{
m_selectionRect = r.normalize();
@@ -668,7 +668,7 @@ void CompositionModelImpl::setSelectionRect(const QRect& r)
const Composition::segmentcontainer& segments = m_composition.getSegments();
Composition::segmentcontainer::iterator segEnd = segments.end();
- QRect updateRect = m_selectionRect;
+ TQRect updateRect = m_selectionRect;
for (Composition::segmentcontainer::iterator i = segments.begin();
i != segEnd; ++i) {
@@ -711,13 +711,13 @@ void CompositionModelImpl::finalizeSelectionRect()
}
}
- m_previousSelectionUpdateRect = m_selectionRect = QRect();
+ m_previousSelectionUpdateRect = m_selectionRect = TQRect();
m_tmpSelectedSegments.clear();
}
-QRect CompositionModelImpl::getSelectionContentsRect()
+TQRect CompositionModelImpl::getSelectionContentsRect()
{
- QRect selectionRect;
+ TQRect selectionRect;
SegmentSelection sel = getSelectedSegments();
for (SegmentSelection::iterator i = sel.begin();
@@ -784,7 +784,7 @@ bool CompositionModelImpl::isRecording(const Segment* s) const
return m_recordingSegments.find(const_cast<Segment*>(s)) != m_recordingSegments.end();
}
-CompositionModel::itemcontainer CompositionModelImpl::getItemsAt(const QPoint& point)
+CompositionModel::itemcontainer CompositionModelImpl::getItemsAt(const TQPoint& point)
{
itemcontainer res;
@@ -953,7 +953,7 @@ int CompositionModelImpl::getLength()
return w;
}
-timeT CompositionModelImpl::getRepeatTimeAt(const QPoint& p, const CompositionItem& cItem)
+timeT CompositionModelImpl::getRepeatTimeAt(const TQPoint& p, const CompositionItem& cItem)
{
// timeT timeAtClick = m_grid.getRulerScale()->getTimeForX(p.x());
@@ -1009,14 +1009,14 @@ bool CompositionModelImpl::setTrackHeights(Segment *s)
return heightsChanged;
}
-QPoint CompositionModelImpl::computeSegmentOrigin(const Segment& s)
+TQPoint CompositionModelImpl::computeSegmentOrigin(const Segment& s)
{
// Profiler profiler("CompositionModelImpl::computeSegmentOrigin", true);
int trackPosition = m_composition.getTrackPositionById(s.getTrack());
timeT startTime = s.getStartTime();
- QPoint res;
+ TQPoint res;
res.setX(int(nearbyint(m_grid.getRulerScale()->getXForTime(startTime))));
@@ -1027,7 +1027,7 @@ QPoint CompositionModelImpl::computeSegmentOrigin(const Segment& s)
return res;
}
-bool CompositionModelImpl::isCachedRectCurrent(const Segment& s, const CompositionRect& r, QPoint cachedSegmentOrigin, timeT cachedSegmentEndTime)
+bool CompositionModelImpl::isCachedRectCurrent(const Segment& s, const CompositionRect& r, TQPoint cachedSegmentOrigin, timeT cachedSegmentEndTime)
{
return s.isRepeating() == r.isRepeating() &&
((cachedSegmentOrigin.x() != r.x() && s.getEndMarkerTime() != cachedSegmentEndTime) ||
@@ -1059,7 +1059,7 @@ CompositionRect CompositionModelImpl::computeSegmentRect(const Segment& s, bool
{
// Profiler profiler("CompositionModelImpl::computeSegmentRect", true);
- QPoint origin = computeSegmentOrigin(s);
+ TQPoint origin = computeSegmentOrigin(s);
bool isRecordingSegment = isRecording(&s);
@@ -1119,11 +1119,11 @@ CompositionRect CompositionModelImpl::computeSegmentRect(const Segment& s, bool
// << " w = " << w << " (x for time at start is " << m_grid.getRulerScale()->getXForTime(startTime) << ", end is " << m_grid.getRulerScale()->getXForTime(endTime) << ")" << endl;
}
- CompositionRect cr(origin, QSize(w, h));
- QString label = strtoqstr(s.getLabel());
+ CompositionRect cr(origin, TQSize(w, h));
+ TQString label = strtoqstr(s.getLabel());
if (s.getType() == Segment::Audio) {
- static QRegExp re1("( *\\([^)]*\\))*$"); // (inserted) (copied) (etc)
- static QRegExp re2("\\.[^.]+$"); // filename suffix
+ static TQRegExp re1("( *\\([^)]*\\))*$"); // (inserted) (copied) (etc)
+ static TQRegExp re2("\\.[^.]+$"); // filename suffix
label.replace(re1, "").replace(re2, "");
}
cr.setLabel(label);
@@ -1155,7 +1155,7 @@ unsigned int CompositionModelImpl::getNbRows()
return m_composition.getNbTracks();
}
-const CompositionModel::rectcontainer& CompositionModelImpl::getRectanglesIn(const QRect& rect,
+const CompositionModel::rectcontainer& CompositionModelImpl::getRectanglesIn(const TQRect& rect,
RectRanges* npData,
AudioPreviewDrawData* apData)
{
@@ -1199,7 +1199,7 @@ const CompositionModel::rectcontainer& CompositionModelImpl::getRectanglesIn(con
bool isAudio = (s && s->getType() == Segment::Audio);
if (!isRecording(s)) {
- QColor brushColor = GUIPalette::convertColour(m_composition.
+ TQColor brushColor = GUIPalette::convertColour(m_composition.
getSegmentColourMap().getColourByIndex(s->getColourIndex()));
sr.setBrush(brushColor);
sr.setPen(CompositionColourCache::getInstance()->SegmentBorder);
@@ -1217,7 +1217,7 @@ const CompositionModel::rectcontainer& CompositionModelImpl::getRectanglesIn(con
// Notation preview data
if (npData && s->getType() == Segment::Internal) {
- makeNotationPreviewRects(npData, QPoint(0, sr.y()), s, rect);
+ makeNotationPreviewRects(npData, TQPoint(0, sr.y()), s, rect);
// Audio preview data
} else if (apData && s->getType() == Segment::Audio) {
makeAudioPreviewRects(apData, s, sr, rect);
@@ -1238,7 +1238,7 @@ const CompositionModel::rectcontainer& CompositionModelImpl::getRectanglesIn(con
if (sr.intersects(rect)) {
Segment* s = CompositionItemHelper::getSegment(*i);
sr.setSelected(true);
- QColor brushColor = GUIPalette::convertColour(m_composition.getSegmentColourMap().getColourByIndex(s->getColourIndex()));
+ TQColor brushColor = GUIPalette::convertColour(m_composition.getSegmentColourMap().getColourByIndex(s->getColourIndex()));
sr.setBrush(brushColor);
sr.setPen(CompositionColourCache::getInstance()->SegmentBorder);
@@ -1259,7 +1259,7 @@ const CompositionModel::rectcontainer& CompositionModelImpl::getRectanglesIn(con
}
CompositionModel::heightlist
-CompositionModelImpl::getTrackDividersIn(const QRect& rect)
+CompositionModelImpl::getTrackDividersIn(const TQRect& rect)
{
int top = m_grid.getYBin(rect.y());
int bottom = m_grid.getYBin(rect.y() + rect.height());