Olive
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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 #include "project/projectfilter.h"
30 
31 class Project;
32 class QMouseEvent;
33 class Media;
34 class QAbstractItemView;
35 class QDropEvent;
36 
37 class SourcesCommon : public QObject {
38  Q_OBJECT
39 public:
40  SourcesCommon(Project *parent, ProjectFilter& sort_filter);
41  QAbstractItemView* view;
42  void show_context_menu(QWidget* parent, const QModelIndexList &items);
43 
44  void mousePressEvent(QMouseEvent* e);
45  void mouseDoubleClickEvent(const QModelIndexList& selected_items);
46  void dropEvent(QWidget *parent, QDropEvent* e, const QModelIndex& drop_item, const QModelIndexList &items);
47 
48  void item_click(Media* m, const QModelIndex &index);
49 public slots:
50  void stop_rename_timer();
51 private slots:
53  void reveal_in_browser();
54  void rename_interval();
55  void item_renamed(Media *item);
58 
59  // proxy functions
62 private:
64  QModelIndex editing_index;
65  QModelIndexList selected_items;
67  QTimer rename_timer;
68 
69  // we cache the selected footage items for open_create_proxy_dialog()
70  QVector<Media*> cached_selected_footage;
71 
73 };
74 
75 #endif // SOURCESCOMMON_H
QTimer rename_timer
Definition: sourcescommon.h:67
void clear_proxies_from_selected()
Definition: sourcescommon.cpp:412
Project * project_parent
Definition: sourcescommon.h:66
QAbstractItemView * view
Definition: sourcescommon.h:41
QModelIndexList selected_items
Definition: sourcescommon.h:65
void reveal_in_browser()
Definition: sourcescommon.cpp:351
void create_seq_from_selected()
Definition: sourcescommon.cpp:59
void dropEvent(QWidget *parent, QDropEvent *e, const QModelIndex &drop_item, const QModelIndexList &items)
Definition: sourcescommon.cpp:269
ProjectFilter & sort_filter_
Definition: sourcescommon.h:72
Definition: project.h:54
void rename_interval()
Definition: sourcescommon.cpp:379
void item_click(Media *m, const QModelIndex &index)
Definition: sourcescommon.cpp:246
QModelIndex editing_index
Definition: sourcescommon.h:64
void stop_rename_timer()
Definition: sourcescommon.cpp:375
void mousePressEvent(QMouseEvent *e)
Definition: sourcescommon.cpp:242
SourcesCommon(Project *parent, ProjectFilter &sort_filter)
Definition: sourcescommon.cpp:50
Definition: media.h:45
void mouseDoubleClickEvent(const QModelIndexList &selected_items)
Definition: sourcescommon.cpp:255
Media * editing_item
Definition: sourcescommon.h:63
Definition: sourcescommon.h:37
QVector< Media * > cached_selected_footage
Definition: sourcescommon.h:70
void OpenSelectedMediaInMediaViewer(Media *item)
Definition: sourcescommon.cpp:399
Definition: projectfilter.h:26
void item_renamed(Media *item)
Definition: sourcescommon.cpp:386
void open_create_proxy_dialog()
Definition: sourcescommon.cpp:406
void show_context_menu(QWidget *parent, const QModelIndexList &items)
Definition: sourcescommon.cpp:78
void OpenSelectedMediaInMediaViewerFromAction()
Definition: sourcescommon.cpp:394