]> git.sesse.net Git - kdenlive/blob - src/headertrack.h
aa20c3b8a1fbd42a6873f494532bd82c436b6388
[kdenlive] / src / headertrack.h
1 /***************************************************************************
2  *   Copyright (C) 2008 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20 #ifndef HEADERTRACK_H
21 #define HEADERTRACK_H
22
23 #include <QContextMenuEvent>
24 #include <QMenu>
25 #include <QDomElement>
26
27 #include "definitions.h"
28 #include "ui_trackheader_ui.h"
29
30 class HeaderTrack : public QWidget, public Ui::TrackHeader_UI
31 {
32     Q_OBJECT
33
34 public:
35     HeaderTrack(int index, TrackInfo info, int height, QWidget *parent = 0);
36     //virtual ~HeaderTrack();
37     void setLock(bool lock);
38     void adjustSize(int height);
39     void setSelectedIndex(int ix);
40     /** @brief Update the track label to show if current track has effects or not.*/
41     void updateEffectLabel(QStringList effects);
42
43 protected:
44     virtual void mousePressEvent(QMouseEvent * event);
45     virtual void mouseDoubleClickEvent(QMouseEvent * event);
46     virtual void contextMenuEvent(QContextMenuEvent * event);
47     virtual void dropEvent(QDropEvent * event);
48     virtual void dragEnterEvent(QDragEnterEvent *event);
49
50 private:
51     int m_index;
52     TRACKTYPE m_type;
53     bool m_isSelected;
54     QMenu m_menu;
55     QString m_name;
56
57 private slots:
58     void switchAudio();
59     void switchVideo();
60     void slotDeleteTrack();
61     void deleteTrack();
62     void slotAddTrack();
63     void slotRenameTrack();
64     void slotConfigTrack();
65     void switchLock(bool emitSignal = true);
66
67 signals:
68     void switchTrackAudio(int);
69     void switchTrackVideo(int);
70     void switchTrackLock(int);
71     void insertTrack(int);
72     void deleteTrack(int);
73     void renameTrack(int, QString);
74     void selectTrack(int);
75     void configTrack(int);
76     void addTrackInfo(const QDomElement, int);
77     void showTrackEffects(int);
78 };
79
80 #endif