]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.h
Fix compilation with KDE < 4.5
[kdenlive] / src / customtrackview.h
index 11e65110a256e0a2dd4d897812af5e9493ec7d37..a88286fe51c29dbba64169bff99aa94c01f30f9f 100644 (file)
 #ifndef CUSTOMTRACKVIEW_H
 #define CUSTOMTRACKVIEW_H
 
+#include <kdeversion.h>
+#if KDE_IS_VERSION(4,5,0)
+#include <KImageCache>
+#else
 #include <KPixmapCache>
+#endif
+
 #include <KColorScheme>
 
 #include <QGraphicsView>
@@ -43,7 +49,6 @@ class AbstractClipItem;
 class AbstractGroupItem;
 class Transition;
 
-
 class CustomTrackView : public QGraphicsView
 {
     Q_OBJECT
@@ -156,6 +161,8 @@ public:
     int selectedTrack() const;
     QStringList selectedClips() const;
     QList<ClipItem *> selectedClipItems() const;
+    /** @brief Checks wheter an item can be inserted (make sure it does not overlap another item) */
+    bool canBePastedTo(ItemInfo info, int type) const;
 
     /** @brief Selects a clip.
     * @param add Whether to select or deselect
@@ -177,7 +184,11 @@ public:
     void clearSelection();
     void editItemDuration();
     void buildGuidesMenu(QMenu *goMenu) const;
-    KPixmapCache* pixmapCache;
+#if KDE_IS_VERSION(4,5,0)
+    KImageCache* m_pixmapCache;
+#else
+    KPixmapCache* m_pixmapCache;
+#endif
     /** update the timeline objects when palette changes */
     void updatePalette();
     /** @brief Returns true if a track has audio data on it.
@@ -356,9 +367,8 @@ private:
 
     /** Get the index of the video track that is just below current track */
     int getPreviousVideoTrack(int track);
-    void updatePositionEffects(ClipItem * item, ItemInfo info);
+    void updatePositionEffects(ClipItem * item, ItemInfo info, bool standalone = true);
     bool insertDropClips(const QMimeData *data, const QPoint pos);
-    bool canBePastedTo(ItemInfo info, int type) const;
     bool canBePastedTo(QList <ItemInfo> infoList, int type) const;
     bool canBePasted(QList<AbstractClipItem *> items, GenTime offset, int trackOffset) const;
     bool canBeMoved(QList<AbstractClipItem *> items, GenTime offset, int trackOffset) const;
@@ -433,6 +443,13 @@ private:
      * In addition to update the duration in TrackInfo it updates effects with keyframes on the track. */
     void updateTrackDuration(int track, QUndoCommand *command);
 
+    /** @brief Adjusts effects after a clip resize.
+     * @param item The item that was resized
+     * @param oldInfo pre resize info
+     * @param fromStart false = resize from end
+     * @param command Used as a parent for EditEffectCommand */
+    void adjustEffects(ClipItem *item, ItemInfo oldInfo, QUndoCommand *command);
+
 private slots:
     void slotRefreshGuides();
     void slotEnableRefresh();
@@ -444,13 +461,21 @@ private slots:
     void slotGoToMarker(QAction *action);
     void slotResetMenuPosition();
     void slotDoResetMenuPosition();
+    /** @brief Re-create the clip thumbnails.
+     *  @param id The clip's Id string.
+     *  @param resetThumbs Should we recreate the timeline thumbnails. */
+    void slotRefreshThumbs(const QString &id, bool resetThumbs);
 
 signals:
     void cursorMoved(int, int);
     void zoomIn();
     void zoomOut();
     void mousePosition(int);
-    void clipItemSelected(ClipItem*, int ix = -1);
+    /** @brief A clip was selected in timeline, update the effect stack
+     *  @param clip The clip
+     *  @param ix The index of currently selected effect
+     *  @param raise If true, the effect stack widget will be raised (come to front). */
+    void clipItemSelected(ClipItem *clip, int ix = -1, bool raise = true);
     void transitionItemSelected(Transition*, int track = 0, QPoint p = QPoint(), bool update = false);
     void activateDocumentMonitor();
     void trackHeightChanged();