Olive
sourcescommon.h
1 /***
2 
3  Olive - Non-Linear Video Editor
4  Copyright (C) 2019 Olive Team
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 ***/
20 
21 #ifndef SOURCESCOMMON_H
22 #define SOURCESCOMMON_H
23 
24 #include <QModelIndexList>
25 #include <QTimer>
26 #include <QVector>
27 
28 class Project;
29 class QMouseEvent;
30 class Media;
31 class QAbstractItemView;
32 class QDropEvent;
33 
34 struct Footage;
35 
36 class SourcesCommon : public QObject {
37  Q_OBJECT
38 public:
39  SourcesCommon(Project *parent);
40  QAbstractItemView* view;
41  void show_context_menu(QWidget* parent, const QModelIndexList &items);
42 
43  void mousePressEvent(QMouseEvent* e);
44  void mouseDoubleClickEvent(QMouseEvent* e, const QModelIndexList& selected_items);
45  void dropEvent(QWidget *parent, QDropEvent* e, const QModelIndex& drop_item, const QModelIndexList &items);
46 
47  void item_click(Media* m, const QModelIndex &index);
48 private slots:
49  void create_seq_from_selected();
50  void reveal_in_browser();
51  void rename_interval();
52  void item_renamed(Media *item);
53 
54  // proxy functions
55  void open_create_proxy_dialog();
56  void clear_proxies_from_selected();
57 private:
58  Media* editing_item;
59  QModelIndex editing_index;
60  QModelIndexList selected_items;
61  Project* project_parent;
62  void stop_rename_timer();
63  QTimer rename_timer;
64 
65  // we cache the selected footage items for open_create_proxy_dialog()
66  QVector<Footage*> cached_selected_footage;
67 };
68 
69 #endif // SOURCESCOMMON_H
Definition: media.h:40
Definition: project.h:60
Definition: sourcescommon.h:36
Definition: footage.h:66