Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
  • core_lib
  • src
movieimporter.h
1/*
2
3Pencil2D - Traditional Animation Software
4Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5Copyright (C) 2012-2020 Matthew Chiawen Chang
6
7This program is free software; you can redistribute it and/or
8modify it under the terms of the GNU General Public License
9as published by the Free Software Foundation; version 2 of the License.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16*/
17#ifndef MOVIEIMPORTER_H
18#define MOVIEIMPORTER_H
19
20#include "pencilerror.h"
21
22#include <QObject>
23#include <functional>
24#include "filetype.h"
25
26class Editor;
27class QTemporaryDir;
28
29class MovieImporter : public QObject
30{
31 Q_OBJECT
32public:
33 MovieImporter(QObject* parent);
34 virtual ~MovieImporter();
35
36 void setCore(Editor* editor) { mEditor = editor; }
37
48 Status estimateFrames(const QString& filePath, int fps, int* frameEstimate);
49
59 Status run(const QString& filePath, int fps, FileType type,
60 std::function<void(int)> progress,
61 std::function<void(QString)> progressMessage,
62 std::function<bool()> askPermission);
63
64 void cancel() { mCanceled = true; }
65
66private:
67
68 Status verifyFFmpegExists();
69 Status importMovieVideo(const QString& filePath, int fps, int frameEstimate,
70 std::function<bool(int)> progress,
71 std::function<void(QString)> progressMessage);
72 Status importMovieAudio(const QString& filePath, std::function<bool(int)> progress);
73
74 Status generateFrames(std::function<bool(int)> progress);
75
76 Editor* mEditor = nullptr;
77
78 QTemporaryDir* mTempDir = nullptr;
79
80 bool mCanceled = false;
81};
82
83#endif // MOVIEIMPORTER_H
Editor
Definition: editor.h:71
MovieImporter
Definition: movieimporter.h:30
MovieImporter::run
Status run(const QString &filePath, int fps, FileType type, std::function< void(int)> progress, std::function< void(QString)> progressMessage, std::function< bool()> askPermission)
Definition: movieimporter.cpp:165
MovieImporter::estimateFrames
Status estimateFrames(const QString &filePath, int fps, int *frameEstimate)
Attempts to load a video and determine it's duration.
Definition: movieimporter.cpp:46
Status
Definition: pencilerror.h:40
QObject
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QString
QTemporaryDir
Generated on Thu May 8 2025 04:47:53 for Pencil2D by doxygen 1.9.6 based on revision 4513250b1d5b1a3676ec0e67b06b7a885ceaae39