File: project.h

package info (click to toggle)
olive-editor 20181223-2
  • links: PTS
  • area: main
  • in suites: buster
  • size: 2,844 kB
  • sloc: cpp: 20,147; xml: 315; ansic: 16; makefile: 11
file content (116 lines) | stat: -rw-r--r-- 3,013 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#ifndef PROJECT_H
#define PROJECT_H

#include <QDockWidget>
#include <QVector>
#include <QTimer>
#include <QDir>

#include "project/projectmodel.h"

struct Footage;
struct Sequence;
struct Clip;
class Timeline;
class Viewer;
class SourceTable;
class Media;
class QXmlStreamWriter;
class QXmlStreamReader;
class QFile;
class QSortFilterProxyModel;
class ComboAction;

#define LOAD_TYPE_VERSION 69
#define LOAD_TYPE_URL 70

namespace Ui {
class Project;
}

extern QString autorecovery_filename;
extern QString project_url;
extern QStringList recent_projects;
extern QString recent_proj_file;

extern ProjectModel project_model;

Sequence* create_sequence_from_media(QVector<Media *> &media_list);

QString get_channel_layout_name(int channels, uint64_t layout);
QString get_interlacing_name(int interlacing);

class Project : public QDockWidget
{
	Q_OBJECT

public:
	explicit Project(QWidget *parent = 0);
	~Project();
    bool is_focused();
	void clear();
    Media* new_sequence(ComboAction *ca, Sequence* s, bool open, Media* parent);
    QString get_next_sequence_name(QString start = 0);
    void process_file_list(QStringList& files, bool recursive = false, Media* replace = NULL, Media *parent = NULL);
    void replace_media(Media* item, QString filename);
    Media *get_selected_folder();
    bool reveal_media(void* media, QModelIndex parent = QModelIndex());
    void add_recent_project(QString url);

    void new_project();
    void load_project(bool autorecovery);
    void save_project(bool autorecovery);

    Media* new_folder(QString name);
    Media* item_to_media(const QModelIndex& index);

    void save_recent_projects();

    QVector<Media*> list_all_project_sequences();

	SourceTable* source_table;
    QSortFilterProxyModel* sorter;

    QVector<Media*> last_imported_media;

    //Media *new_item();

	void start_preview_generator(Media* item, bool replacing);
public slots:
	void import_dialog();
    void delete_selected_media();
    void duplicate_selected();
	void delete_clips_using_selected_media();
	void replace_selected_file();
	void replace_clip_media();
	void open_properties();
private:
    void save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only, const QModelIndex &parent = QModelIndex());
    int folder_id;
    int media_id;
    int sequence_id;
    void get_all_media_from_table(QList<Media *> items, QList<Media *> &list, int type);
    void list_all_sequences_worker(QVector<Media *> *list, Media* parent);
	QString get_file_name_from_path(const QString &path);
    QDir proj_dir;
private slots:
	void clear_recent_projects();
};

class MediaThrobber : public QObject {
    Q_OBJECT
public:
    MediaThrobber(Media*);
public slots:
    void start();
	void stop(int, bool replace);
private slots:
    void animation_update();
private:
    QPixmap pixmap;
    int animation;
    Media* item;
    QTimer* animator;
};

#endif // PROJECT_H