Olive
sourcescommon.h
Go to the documentation of this file.
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 #include "project/footage.h"
29 
30 class Project;
31 class QMouseEvent;
32 class Media;
33 class QAbstractItemView;
34 class QDropEvent;
35 
36 struct Footage;
37 
38 class SourcesCommon : public QObject {
39  Q_OBJECT
40 public:
41  SourcesCommon(Project *parent);
42  QAbstractItemView* view;
43  void show_context_menu(QWidget* parent, const QModelIndexList &items);
44 
45  void mousePressEvent(QMouseEvent* e);
46  void mouseDoubleClickEvent(QMouseEvent* e, const QModelIndexList& selected_items);
47  void dropEvent(QWidget *parent, QDropEvent* e, const QModelIndex& drop_item, const QModelIndexList &items);
48 
49  void item_click(Media* m, const QModelIndex &index);
50 private slots:
52  void reveal_in_browser();
53  void rename_interval();
54  void item_renamed(Media *item);
55 
56  // proxy functions
59 private:
61  QModelIndex editing_index;
62  QModelIndexList selected_items;
64  void stop_rename_timer();
65  QTimer rename_timer;
66 
67  // we cache the selected footage items for open_create_proxy_dialog()
68  QVector<FootagePtr> cached_selected_footage;
69 };
70 
71 #endif // SOURCESCOMMON_H
void item_renamed(Media *item)
Definition: sourcescommon.cpp:370
void show_context_menu(QWidget *parent, const QModelIndexList &items)
Definition: sourcescommon.cpp:76
Project * project_parent
Definition: sourcescommon.h:63
void mouseDoubleClickEvent(QMouseEvent *e, const QModelIndexList &selected_items)
Definition: sourcescommon.cpp:238
SourcesCommon(Project *parent)
Definition: sourcescommon.cpp:49
Media * editing_item
Definition: sourcescommon.h:60
void reveal_in_browser()
Definition: sourcescommon.cpp:335
void open_create_proxy_dialog()
Definition: sourcescommon.cpp:378
QModelIndex editing_index
Definition: sourcescommon.h:61
void mousePressEvent(QMouseEvent *e)
Definition: sourcescommon.cpp:225
Definition: media.h:42
QTimer rename_timer
Definition: sourcescommon.h:65
void stop_rename_timer()
Definition: sourcescommon.cpp:359
Definition: project.h:53
void dropEvent(QWidget *parent, QDropEvent *e, const QModelIndex &drop_item, const QModelIndexList &items)
Definition: sourcescommon.cpp:256
Definition: sourcescommon.h:38
QVector< FootagePtr > cached_selected_footage
Definition: sourcescommon.h:68
void clear_proxies_from_selected()
Definition: sourcescommon.cpp:384
QModelIndexList selected_items
Definition: sourcescommon.h:62
QAbstractItemView * view
Definition: sourcescommon.h:42
void create_seq_from_selected()
Definition: sourcescommon.cpp:57
void item_click(Media *m, const QModelIndex &index)
Definition: sourcescommon.cpp:229
Definition: footage.h:65
void rename_interval()
Definition: sourcescommon.cpp:363