Olive
media.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 MEDIA_H
22 #define MEDIA_H
23 
24 #include <QList>
25 #include <QVariant>
26 
27 #include "project/marker.h"
28 
29 enum MediaType {
30  MEDIA_TYPE_FOOTAGE,
31  MEDIA_TYPE_SEQUENCE,
32  MEDIA_TYPE_FOLDER
33 };
34 
35 struct Footage;
36 class MediaThrobber;
37 struct Sequence;
38 #include <QIcon>
39 
40 class Media
41 {
42 public:
43  Media(Media* iparent);
44  ~Media();
45  Footage *to_footage();
46  Sequence* to_sequence();
47  void set_footage(Footage* f);
48  void set_sequence(Sequence* s);
49  void set_folder();
50  void set_icon(const QIcon &ico);
51  void set_parent(Media* p);
52  void update_tooltip(const QString& error = 0);
53  void *to_object();
54  int get_type();
55  const QString& get_name();
56  void set_name(const QString& n);
57  MediaThrobber* throbber;
58 
59  double get_frame_rate(int stream = -1);
60  int get_sampling_rate(int stream = -1);
61 
62  // item functions
63  void appendChild(Media *child);
64  bool setData(int col, const QVariant &value);
65  Media *child(int row);
66  int childCount() const;
67  int columnCount() const;
68  QVariant data(int column, int role);
69  int row() const;
70  Media *parentItem();
71  void removeChild(int i);
72 
73  // get markers from internal object
74  QVector<Marker>& get_markers();
75 
76  bool root;
77  int temp_id;
78  int temp_id2;
79 private:
80  int type;
81  void* object;
82 
83  // item functions
84  QList<Media*> children;
85  Media* parent;
86  QString folder_name;
87  QString tooltip;
88  QIcon icon;
89 };
90 
91 #endif // MEDIA_H
Definition: sequence.h:33
Definition: media.h:40
Definition: project.h:131
Definition: footage.h:66